Mercurial > hg > xemacs-beta
comparison src/input-method-xlib.c @ 442:abe6d1db359e r21-2-36
Import from CVS: tag r21-2-36
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:35:02 +0200 |
parents | 8de8e3f6228a |
children | 576fb035e263 |
comparison
equal
deleted
inserted
replaced
441:72a7cfa4a488 | 442:abe6d1db359e |
---|---|
124 | 124 |
125 static Boolean xim_initted = False; | 125 static Boolean xim_initted = False; |
126 | 126 |
127 static XIMStyle best_style (XIMStyles *user, XIMStyles *xim); | 127 static XIMStyle best_style (XIMStyles *user, XIMStyles *xim); |
128 | 128 |
129 /* #### it appears this prototype is missing from the X11R6.4 includes, | |
130 at least the XFree86 version ... */ | |
131 char * XSetIMValues(XIM, ...); | |
132 | |
129 void | 133 void |
130 Initialize_Locale (void) | 134 Initialize_Locale (void) |
131 { | 135 { |
132 char *locale; | 136 char *locale; |
133 | 137 |
244 XIM_init_device (struct device *d) | 248 XIM_init_device (struct device *d) |
245 { | 249 { |
246 #ifdef THIS_IS_X11R6 | 250 #ifdef THIS_IS_X11R6 |
247 DEVICE_X_XIM (d) = NULL; | 251 DEVICE_X_XIM (d) = NULL; |
248 XRegisterIMInstantiateCallback (DEVICE_X_DISPLAY (d), NULL, NULL, NULL, | 252 XRegisterIMInstantiateCallback (DEVICE_X_DISPLAY (d), NULL, NULL, NULL, |
249 IMInstantiateCallback, (XPointer) d); | 253 IMInstantiateCallback, |
254 /* The sixth parameter is of type | |
255 XPointer in XFree86 but (XPointer *) | |
256 on most other X11's. */ | |
257 (void *) d); | |
250 return; | 258 return; |
251 #else | 259 #else |
252 Display *dpy = DEVICE_X_DISPLAY (d); | 260 Display *dpy = DEVICE_X_DISPLAY (d); |
253 char *name, *class; | 261 char *name, *class; |
254 XIM xim; | 262 XIM xim; |
331 | 339 |
332 xim = DEVICE_X_XIM (d); | 340 xim = DEVICE_X_XIM (d); |
333 | 341 |
334 if (!xim) | 342 if (!xim) |
335 { | 343 { |
336 xim_info ("X Input Method open failed. Waiting for an XIM to be enabled.\n"); | |
337 return; | 344 return; |
338 } | 345 } |
339 | 346 |
340 w = FRAME_X_TEXT_WIDGET (f); | 347 w = FRAME_X_TEXT_WIDGET (f); |
341 | 348 |
607 XtPointer *converter_data) | 614 XtPointer *converter_data) |
608 { | 615 { |
609 #define STYLE_INFO(style) { style, #style, sizeof(#style) } | 616 #define STYLE_INFO(style) { style, #style, sizeof(#style) } |
610 static struct XIMStyleInfo | 617 static struct XIMStyleInfo |
611 { | 618 { |
612 CONST XIMStyle style; | 619 const XIMStyle style; |
613 CONST char * CONST name; | 620 const char * const name; |
614 CONST int namelen; | 621 const int namelen; |
615 } emacs_XIMStyleInfo[] = { | 622 } emacs_XIMStyleInfo[] = { |
616 STYLE_INFO (XIMPreeditPosition|XIMStatusArea), | 623 STYLE_INFO (XIMPreeditPosition|XIMStatusArea), |
617 STYLE_INFO (XIMPreeditPosition|XIMStatusNothing), | 624 STYLE_INFO (XIMPreeditPosition|XIMStatusNothing), |
618 STYLE_INFO (XIMPreeditPosition|XIMStatusNone), | 625 STYLE_INFO (XIMPreeditPosition|XIMStatusNone), |
619 STYLE_INFO (XIMPreeditNothing|XIMStatusArea), | 626 STYLE_INFO (XIMPreeditNothing|XIMStatusArea), |
625 }; | 632 }; |
626 #undef STYLE_INFO | 633 #undef STYLE_INFO |
627 | 634 |
628 char *s = (char *) fromVal->addr; | 635 char *s = (char *) fromVal->addr; |
629 char *end = s + fromVal->size; | 636 char *end = s + fromVal->size; |
630 XIMStyles * CONST p = (XIMStyles *) toVal->addr; | 637 XIMStyles * const p = (XIMStyles *) toVal->addr; |
631 CONST char * CONST delimiter = " \t\n\r:;," ; | 638 const char * const delimiter = " \t\n\r:;," ; |
632 CONST int max_styles = XtNumber(emacs_XIMStyleInfo); | 639 const int max_styles = XtNumber(emacs_XIMStyleInfo); |
633 int i; | 640 int i; |
634 char *c; | 641 char *c; |
635 | 642 |
636 #ifdef DEBUG_XIM | 643 #ifdef DEBUG_XIM |
637 stderr_out ("EmacsCvtStringToXIMStyles called with size=%d, string=\"%s\"\n", | 644 stderr_out ("EmacsCvtStringToXIMStyles called with size=%d, string=\"%s\"\n", |