comparison src/input-method-xlib.c @ 5118:e0db3c197671 ben-lisp-object

merge up to latest default branch, doesn't compile yet
author Ben Wing <ben@xemacs.org>
date Sat, 26 Dec 2009 21:18:49 -0600
parents 3a87551bfeb5
children 0ca81354c4c7
comparison
equal deleted inserted replaced
5117:3742ea8250b5 5118:e0db3c197671
284 char *inputmethod; 284 char *inputmethod;
285 } xic_vars_t; 285 } xic_vars_t;
286 xic_vars_t xic_vars; 286 xic_vars_t xic_vars;
287 XIC xic; 287 XIC xic;
288 288
289 #define res(name, class_, representation, field, default_value) \ 289 #define res(name, class_, representation, field, default_value) \
290 { name, class_, representation, sizeof(xic_vars.field), \ 290 Xt_RESOURCE (name, class_, representation, xic_vars.field, \
291 XtOffsetOf(xic_vars_t, field), XtRString, default_value } 291 XtOffsetOf(xic_vars_t, field), XtRString, default_value)
292 292
293 static XtResource resources[] = 293 static XtResource resources[] =
294 { 294 {
295 /* name class represent'n field default value */ 295 /* name class represent'n field default value */
296 res(XtNximStyles, XtCXimStyles, XtRXimStyles, styles, (XtPointer) DefaultXIMStyles), 296 res(XtNximStyles, XtCXimStyles, XtRXimStyles, styles, DefaultXIMStyles),
297 res(XtNfontSet, XtCFontSet, XtRFontSet, fontset, (XtPointer) XtDefaultFontSet), 297 res(XtNfontSet, XtCFontSet, XtRFontSet, fontset, XtDefaultFontSet),
298 res(XtNximForeground, XtCForeground, XtRPixel, fg, (XtPointer) XtDefaultForeground), 298 res(XtNximForeground, XtCForeground, XtRPixel, fg, XtDefaultForeground),
299 res(XtNximBackground, XtCBackground, XtRPixel, bg, (XtPointer) XtDefaultBackground) 299 res(XtNximBackground, XtCBackground, XtRPixel, bg, XtDefaultBackground)
300 }; 300 };
301 301 #undef res
302 302
303 xim = DEVICE_X_XIM (d); 303 xim = DEVICE_X_XIM (d);
304 304
305 if (!xim) 305 if (!xim)
306 { 306 {
382 382
383 383
384 void 384 void
385 XIM_SetGeometry (struct frame *f) 385 XIM_SetGeometry (struct frame *f)
386 { 386 {
387 XIC xic = FRAME_X_XIC (f); 387 XIC xic;
388 XIMStyle style = FRAME_X_XIC_STYLE (f); 388 XIMStyle style;
389 XRectangle area; 389 XRectangle area;
390 390
391 if (!xic || !f) 391 if (!f)
392 return; 392 return;
393 393
394 xic = FRAME_X_XIC (f);
395 if (!xic)
396 return;
397
398 style = FRAME_X_XIC_STYLE (f);
394 if (style & XIMStatusArea) 399 if (style & XIMStatusArea)
395 { 400 {
396 /* Place Status Area in bottom right corner */ 401 /* Place Status Area in bottom right corner */
397 /* Negotiate geometry of status area */ 402 /* Negotiate geometry of status area */
398 /* See O'Reilly Xlib XIM chapter (but beware, it's buggy) */ 403 /* See O'Reilly Xlib XIM chapter (but beware, it's buggy) */
706 return; 711 return;
707 } 712 }
708 713
709 if (converter_data) 714 if (converter_data)
710 { 715 {
711 Boolean free_p = (Boolean) (int) converter_data; 716 Boolean free_p = (Boolean) (EMACS_INT) converter_data;
712 XIMStyles *styles = (XIMStyles *) toVal->addr; 717 XIMStyles *styles = (XIMStyles *) toVal->addr;
713 if (free_p) 718 if (free_p)
714 XFree ( styles->supported_styles ); 719 XFree ( styles->supported_styles );
715 } 720 }
716 } 721 }
888 describe_Window (Window win) 893 describe_Window (Window win)
889 { 894 {
890 char xwincmd[128]; 895 char xwincmd[128];
891 sprintf (xwincmd, "xwininfo -id 0x%x >&2; xwininfo -events -id 0x%x >&2", 896 sprintf (xwincmd, "xwininfo -id 0x%x >&2; xwininfo -events -id 0x%x >&2",
892 (int) win, (int) win); 897 (int) win, (int) win);
893 system (xwincmd); 898 if (system (xwincmd) == -1)
899 stderr_out ("Unable to execute xwininfo\n");
894 } 900 }
895 901
896 void 902 void
897 describe_XIC (XIC xic) 903 describe_XIC (XIC xic)
898 { 904 {
970 stderr_out ("XNResourceClass: %s\n", resourceClass ? resourceClass : "NULL"); 976 stderr_out ("XNResourceClass: %s\n", resourceClass ? resourceClass : "NULL");
971 stderr_out ("XNFilterEvents: "); describe_event_mask (filter_mask); 977 stderr_out ("XNFilterEvents: "); describe_event_mask (filter_mask);
972 } 978 }
973 979
974 void 980 void
975 describe_XRectangle (char *name, XRectangle *r) 981 describe_XRectangle (const char *name, XRectangle *r)
976 { 982 {
977 if (r == NULL) 983 if (r == NULL)
978 stderr_out ("%s: NULL\n", name); 984 stderr_out ("%s: NULL\n", name);
979 else 985 else
980 stderr_out ("%s: x=%d y=%d w=%d h=%d\n", 986 stderr_out ("%s: x=%d y=%d w=%d h=%d\n",