Mercurial > emacs
comparison src/xterm.c @ 28142:156c32f18198
(xim_close_dpy, xim_initialize): Use X11R6-style XIM
support functions only if HAVE_X11R6_XIM is defined.
(xim_instantiate_callback): Define only if HAVE_X11R6_XIM.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Tue, 14 Mar 2000 21:15:46 +0000 |
parents | fb1a89235280 |
children | 7d97c6fbc3d9 |
comparison
equal
deleted
inserted
replaced
28141:52b185e0d8bd | 28142:156c32f18198 |
---|---|
11037 #endif | 11037 #endif |
11038 } | 11038 } |
11039 } | 11039 } |
11040 | 11040 |
11041 | 11041 |
11042 #ifdef HAVE_X11R6 | 11042 #ifdef HAVE_X11R6_XIM |
11043 | 11043 |
11044 struct xim_inst_t | 11044 struct xim_inst_t |
11045 { | 11045 { |
11046 struct x_display_info *dpyinfo; | 11046 struct x_display_info *dpyinfo; |
11047 char *resource_name; | 11047 char *resource_name; |
11094 | 11094 |
11095 UNBLOCK_INPUT; | 11095 UNBLOCK_INPUT; |
11096 } | 11096 } |
11097 } | 11097 } |
11098 | 11098 |
11099 #endif /* HAVE_X11R6 */ | 11099 #endif /* HAVE_X11R6_XIM */ |
11100 | 11100 |
11101 | 11101 |
11102 /* Open a connection to the XIM server on display DPYINFO. | 11102 /* Open a connection to the XIM server on display DPYINFO. |
11103 RESOURCE_NAME is the resource name for Emacs. On X11R5, open the | 11103 RESOURCE_NAME is the resource name for Emacs. On X11R5, open the |
11104 connection only at the first time. On X11R6, open the connection | 11104 connection only at the first time. On X11R6, open the connection |
11107 static void | 11107 static void |
11108 xim_initialize (dpyinfo, resource_name) | 11108 xim_initialize (dpyinfo, resource_name) |
11109 struct x_display_info *dpyinfo; | 11109 struct x_display_info *dpyinfo; |
11110 char *resource_name; | 11110 char *resource_name; |
11111 { | 11111 { |
11112 #ifdef HAVE_X11R6 | 11112 #ifdef HAVE_X11R6_XIM |
11113 struct xim_inst_t *xim_inst; | 11113 struct xim_inst_t *xim_inst; |
11114 int len; | 11114 int len; |
11115 | 11115 |
11116 dpyinfo->xim = NULL; | 11116 dpyinfo->xim = NULL; |
11117 xim_inst = (struct xim_inst_t *) xmalloc (sizeof (struct xim_inst_t)); | 11117 xim_inst = (struct xim_inst_t *) xmalloc (sizeof (struct xim_inst_t)); |
11121 bcopy (resource_name, xim_inst->resource_name, len + 1); | 11121 bcopy (resource_name, xim_inst->resource_name, len + 1); |
11122 XRegisterIMInstantiateCallback (dpyinfo->display, dpyinfo->xrdb, | 11122 XRegisterIMInstantiateCallback (dpyinfo->display, dpyinfo->xrdb, |
11123 resource_name, EMACS_CLASS, | 11123 resource_name, EMACS_CLASS, |
11124 xim_instantiate_callback, | 11124 xim_instantiate_callback, |
11125 (XPointer)xim_inst); | 11125 (XPointer)xim_inst); |
11126 #else /* not HAVE_X11R6 */ | 11126 #else /* not HAVE_X11R6_XIM */ |
11127 dpyinfo->xim = NULL; | 11127 dpyinfo->xim = NULL; |
11128 xim_open_dpy (dpyinfo, resource_name); | 11128 xim_open_dpy (dpyinfo, resource_name); |
11129 #endif /* not HAVE_X11R6 */ | 11129 #endif /* not HAVE_X11R6_XIM */ |
11130 } | 11130 } |
11131 | 11131 |
11132 | 11132 |
11133 /* Close the connection to the XIM server on display DPYINFO. */ | 11133 /* Close the connection to the XIM server on display DPYINFO. */ |
11134 | 11134 |
11135 static void | 11135 static void |
11136 xim_close_dpy (dpyinfo) | 11136 xim_close_dpy (dpyinfo) |
11137 struct x_display_info *dpyinfo; | 11137 struct x_display_info *dpyinfo; |
11138 { | 11138 { |
11139 #ifdef HAVE_X11R6 | 11139 #ifdef HAVE_X11R6_XIM |
11140 XUnregisterIMInstantiateCallback (dpyinfo->display, dpyinfo->xrdb, | 11140 XUnregisterIMInstantiateCallback (dpyinfo->display, dpyinfo->xrdb, |
11141 NULL, EMACS_CLASS, | 11141 NULL, EMACS_CLASS, |
11142 xim_instantiate_callback, NULL); | 11142 xim_instantiate_callback, NULL); |
11143 #endif /* HAVE_X11R6 */ | 11143 #endif /* not HAVE_X11R6_XIM */ |
11144 XCloseIM (dpyinfo->xim); | 11144 XCloseIM (dpyinfo->xim); |
11145 dpyinfo->xim = NULL; | 11145 dpyinfo->xim = NULL; |
11146 XFree (dpyinfo->xim_styles); | 11146 XFree (dpyinfo->xim_styles); |
11147 } | 11147 } |
11148 | 11148 |
11149 #endif /* HAVE_X_I18N */ | 11149 #endif /* not HAVE_X11R6_XIM */ |
11150 | 11150 |
11151 | 11151 |
11152 | 11152 |
11153 /* Calculate the absolute position in frame F | 11153 /* Calculate the absolute position in frame F |
11154 from its current recorded position values and gravity. */ | 11154 from its current recorded position values and gravity. */ |