annotate src/input-method-xlib.c @ 380:8626e4521993 r21-2-5

Import from CVS: tag r21-2-5
author cvs
date Mon, 13 Aug 2007 11:07:10 +0200
parents d883f39b8495
children 74fd4e045ea6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1 /* Various functions for X11R5+ input methods, using the Xlib interface.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2 Copyright (C) 1996 Sun Microsystems.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
3
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
4 This file is part of XEmacs.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
5
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
9 later version.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
10
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
14 for more details.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
15
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
20
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
21 /* Synched up with: Not in FSF. */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
22
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
23 /* Written by Martin Buchholz. */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
24
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
25 /* This file implements an interface to X input methods, available
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
26 with X11R5 and above. See O'Reilly, Xlib programmer's guide,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
27 and X11 R6 release guide chapters on internationalized input,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
28 for further details */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
29
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
30 #include <config.h>
280
7df0dd720c89 Import from CVS: tag r21-0b38
cvs
parents: 272
diff changeset
31 #include "lisp.h"
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
32 #include <X11/Xlocale.h> /* More portable than <locale.h> ? */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
33 #include "frame.h"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
34 #include "device.h"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
35 #include "window.h"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
36 #include "buffer.h"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
37 #include "console-x.h"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
38 #include "EmacsFrame.h"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
39 #include "events.h"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
40
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
41 #ifndef XIM_XLIB
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
42 #error XIM_XLIB is not defined??
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
43 #endif
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
44
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
45 /* Get/Set IC values for just one attribute */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
46 #ifdef DEBUG_XEMACS
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
47 #define XIC_Value(Get_Set, xic, name, attr, value) \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
48 do { \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
49 char *bad_arg; \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
50 XVaNestedList list = XVaCreateNestedList (0, attr, value, NULL); \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
51 if ((bad_arg = X##Get_Set##ICValues (xic, name, list, NULL)) != NULL) \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
52 stderr_out ("X" #Get_Set "ICValues " "bad Arg: %s\n", bad_arg); \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
53 XFree (list); \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
54 } while (0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
55 #else /* ! DEBUG_XEMACS */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
56 #define XIC_Value(Get_Set, xic, name, attr, value) \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
57 do { \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
58 XVaNestedList list = XVaCreateNestedList (0, attr, value, NULL); \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
59 X##Get_Set##ICValues (xic, name, list, NULL); \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
60 XFree (list); \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
61 } while (0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
62 #endif /* DEBUG_XEMACS */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
63
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
64 static char DefaultXIMStyles[] =
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
65 "XIMPreeditPosition|XIMStatusArea\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
66 "XIMPreeditPosition|XIMStatusNone\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
67 "XIMPreeditPosition|XIMStatusNothing\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
68 "XIMPreeditNothing|XIMStatusArea\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
69 "XIMPreeditNothing|XIMStatusNothing\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
70 "XIMPreeditNothing|XIMStatusNone\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
71 "XIMPreeditNone|XIMStatusArea\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
72 "XIMPreeditNone|XIMStatusNothing\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
73 "XIMPreeditNone|XIMStatusNone";
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
74
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
75 static XIMStyle best_style (XIMStyles *user, XIMStyles *xim);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
76
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
77 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
78 Initialize_Locale (void)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
79 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
80 char *locale;
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
81
377
d883f39b8495 Import from CVS: tag r21-2b4
cvs
parents: 371
diff changeset
82 /* dverna - Nov. 98: ### DON'T DO THIS !!! The default XtLanguageProc
d883f39b8495 Import from CVS: tag r21-2b4
cvs
parents: 371
diff changeset
83 routine calls setlocale(LC_ALL, lang) which fucks up our lower-level
d883f39b8495 Import from CVS: tag r21-2b4
cvs
parents: 371
diff changeset
84 locale management, and especially the value of LC_NUMERIC. Anyway, since
d883f39b8495 Import from CVS: tag r21-2b4
cvs
parents: 371
diff changeset
85 at this point, we don't know yet whether we're gonna need an X11 frame,
d883f39b8495 Import from CVS: tag r21-2b4
cvs
parents: 371
diff changeset
86 we should really do it manually and not use Xlib's dumb default routine */
d883f39b8495 Import from CVS: tag r21-2b4
cvs
parents: 371
diff changeset
87 /*XtSetLanguageProc (NULL, (XtLanguageProc) NULL, NULL);*/
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
88 if ((locale = setlocale (LC_ALL, "")) == NULL)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
89 {
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
90 stderr_out ("Can't set locale.\n");
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
91 stderr_out ("Using C locale instead.\n");
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
92 putenv ("LANG=C");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
93 putenv ("LC_ALL=C");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
94 if ((locale = setlocale (LC_ALL, "C")) == NULL)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
95 {
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
96 stderr_out ("Can't even set locale to `C'!\n");
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
97 return;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
98 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
99 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
100
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
101 if (!XSupportsLocale ())
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
102 {
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
103 stderr_out ("X Windows does not support locale `%s'\n", locale);
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
104 stderr_out ("Using C Locale instead\n");
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
105 putenv ("LANG=C");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
106 putenv ("LC_ALL=C");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
107 if ((locale = setlocale (LC_ALL, "C")) == NULL)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
108 {
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
109 stderr_out ("Can't even set locale to `C'!\n");
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
110 return;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
111 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
112 if (!XSupportsLocale ())
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
113 {
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
114 stderr_out ("X Windows does not even support locale `C'!\n");
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
115 return;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
116 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
117 }
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
118
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 207
diff changeset
119 setlocale(LC_NUMERIC, "C");
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 207
diff changeset
120
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
121 if (XSetLocaleModifiers ("") == NULL)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
122 {
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
123 stderr_out ("XSetLocaleModifiers(\"\") failed\n");
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
124 stderr_out ("Check the value of the XMODIFIERS environment variable.\n");
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
125 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
126 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
127
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
128 /* Create X input method for device */
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
129 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
130 XIM_init_device (struct device *d)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
131 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
132 Display *dpy = DEVICE_X_DISPLAY (d);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
133 char *name, *class;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
134 XIM xim;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
135
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
136 XtGetApplicationNameAndClass (dpy, &name, &class);
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
137
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
138 DEVICE_X_XIM (d) = xim = XOpenIM (dpy, XtDatabase (dpy), name, class);
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
139
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
140 if (xim == NULL)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
141 {
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
142 stderr_out ("Warning: XOpenIM() failed...no input server available\n");
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
143 return;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
144 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
145 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
146 {
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
147 /* Get supported styles */
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
148 XGetIMValues (xim, XNQueryInputStyle, &DEVICE_X_XIM_STYLES (d), NULL);
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
149 #ifdef DEBUG_XIM
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
150 describe_XIM (xim);
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
151 #endif
359
8e84bee8ddd0 Import from CVS: tag r21-1-9
cvs
parents: 321
diff changeset
152 }
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
153 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
154
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
155 /* Create an X input context for this frame. */
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
156 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
157 XIM_init_frame (struct frame *f)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
158 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
159 struct device *d = XDEVICE (FRAME_DEVICE (f));
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
160 XIM xim = DEVICE_X_XIM (d);
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
161 XIC xic;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
162 Widget w = FRAME_X_TEXT_WIDGET (f);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
163 Window win = XtWindow (w);
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
164 XRectangle p_area = {0,0,1,1}, s_area={0,0,1,1};
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
165 XPoint spot = {0,0};
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
166 XIMStyle style;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
167 XVaNestedList p_list, s_list;
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
168
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
169 typedef struct
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
170 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
171 XIMStyles styles;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
172 XFontSet fontset;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
173 Pixel fg;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
174 Pixel bg;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
175 } xic_vars_t;
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
176
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
177 xic_vars_t xic_vars;
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
178
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
179 /* mrb: #### Fix so that background and foreground is set from
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
180 default face, rather than foreground and background resources, or
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
181 that the user can use set-frame-parameters to set xic attributes */
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
182
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
183 #define res(name, class, representation, field, default_value) \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
184 { name, class, representation, sizeof(xic_vars.field), \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
185 XtOffsetOf(xic_vars_t, field), XtRString, default_value }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
186
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
187 static XtResource resources[] =
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
188 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
189 /* name class represent'n field default value */
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 377
diff changeset
190 res(XtNximStyles, XtCXimStyles, XtRXimStyles, styles, (XtPointer) DefaultXIMStyles),
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 377
diff changeset
191 res(XtNfontSet, XtCFontSet, XtRFontSet, fontset, (XtPointer) XtDefaultFontSet),
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 377
diff changeset
192 res(XtNximForeground, XtCForeground, XtRPixel, fg, (XtPointer) XtDefaultForeground),
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 377
diff changeset
193 res(XtNximBackground, XtCBackground, XtRPixel, bg, (XtPointer) XtDefaultBackground)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
194 };
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
195
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
196 assert (win != 0 && w != NULL && d != NULL);
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
197
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
198 if (!xim)
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
199 { /* No input method? */
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
200 FRAME_X_XIC (f) = NULL;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
201 return;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
202 }
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
203
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
204 XtGetApplicationResources (w, &xic_vars,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
205 resources, XtNumber (resources),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
206 NULL, 0);
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
207
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
208 if (!xic_vars.fontset)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
209 {
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
210 stderr_out ("Can't get fontset resource for Input Method\n");
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
211 FRAME_X_XIC (f) = NULL;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
212 return;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
213 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
214
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
215 FRAME_X_XIC_STYLE (f) = style =
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
216 best_style (&xic_vars.styles, DEVICE_X_XIM_STYLES (d));
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
217
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
218 /* Hopefully we don't have to conditionalize the following based on
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
219 style; the IM should ignore values it doesn't use */
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
220 p_list = XVaCreateNestedList (0,
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
221 XNArea, &p_area,
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
222 XNSpotLocation, &spot,
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
223 XNForeground, xic_vars.fg,
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
224 XNBackground, xic_vars.bg,
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
225 XNFontSet, xic_vars.fontset,
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
226 NULL);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
227
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
228 s_list = XVaCreateNestedList (0,
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
229 XNArea, &s_area,
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
230 XNForeground, xic_vars.fg,
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
231 XNBackground, xic_vars.bg,
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
232 XNFontSet, xic_vars.fontset,
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
233 NULL);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
234 FRAME_X_XIC (f) = xic =
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
235 XCreateIC (xim,
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
236 XNInputStyle, style,
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
237 XNClientWindow, win,
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
238 XNFocusWindow, win,
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
239 XNPreeditAttributes, p_list,
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
240 XNStatusAttributes, s_list,
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
241 NULL);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
242 XFree (p_list);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
243 XFree (s_list);
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
244
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
245 if (!xic)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
246 {
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
247 stderr_out ("Warning: XCreateIC failed\n");
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
248 return;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
249 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
250
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
251 if (style & XIMPreeditPosition)
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
252 { /* Init spot to invalid values */
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
253 XPoint *frame_spot = &(FRAME_X_XIC_SPOT (f));
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 267
diff changeset
254 frame_spot->x = frame_spot->y = -1;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
255 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
256
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
257 XIM_SetGeometry (f);
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
258
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
259 XSetICFocus (xic);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
260
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
261 #ifdef DEBUG_XIM
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
262 describe_XIC (xic);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
263 #endif
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
264 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
265
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
266 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
267 XIM_SetGeometry (struct frame *f)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
268 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
269 XIC xic = FRAME_X_XIC (f);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
270 XIMStyle style = FRAME_X_XIC_STYLE (f);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
271 XRectangle area;
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
272
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
273 if (!xic || !f)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
274 return;
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
275
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
276 if (style & XIMStatusArea)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
277 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
278 /* Place Status Area in bottom right corner */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
279 /* Negotiate geometry of status area */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
280 /* See O'Reilly Xlib XIM chapter (but beware, it's buggy) */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
281 XRectangle *needed;
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
282
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
283 /* If input method has existing status area, use its current size */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
284 /* The following at least works for Sun's htt */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
285 area.x = area.y = area.width = area.height = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
286 XIC_Value (Set, xic, XNStatusAttributes, XNAreaNeeded, &area);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
287 XIC_Value (Get, xic, XNStatusAttributes, XNAreaNeeded, &needed);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
288 if (needed->width == 0) /* Use XNArea instead of XNAreaNeeded */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
289 XIC_Value (Get, xic, XNStatusAttributes, XNArea, &needed);
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
290
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
291 area.width = needed->width;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
292 area.height = needed->height;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
293 area.x = FRAME_RIGHT_BORDER_START (f) - area.width;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
294 area.y = FRAME_BOTTOM_BORDER_START (f) - area.height;
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
295
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
296 #ifdef DEBUG_XIM
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
297 stderr_out ("Putting StatusArea in x=%d y=%d w=%d h=%d\n",
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
298 area.x, area.y, area.width, area.height);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
299 #endif /* DEBUG_XIM */
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
300
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
301 XIC_Value (Set, xic, XNStatusAttributes, XNArea, &area);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
302 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
303
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
304 if (style & XIMPreeditPosition)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
305 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
306 /* Set Preedit Area to whole frame size (sans border) */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
307 /* We include the border because Preedit window might be larger
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
308 than display line at edge. #### FIX: we should adjust to make
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
309 sure that there is always room for the spot sub-window */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
310 area.x = FRAME_LEFT_BORDER_START (f);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
311 area.y = FRAME_TOP_BORDER_START (f);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
312 area.width = FRAME_RIGHT_BORDER_END (f) - area.x;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
313 area.height = FRAME_BOTTOM_BORDER_END (f) - area.y;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
314 XIC_Value(Set, xic, XNPreeditAttributes, XNArea, &area);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
315 }
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
316
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
317 #ifdef DEBUG_XIM
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
318 describe_XIC (xic);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
319 #endif
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
320 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
321
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
322 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
323 XIM_SetSpotLocation (struct frame *f, int x, int y)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
324 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
325 XIC xic = FRAME_X_XIC (f);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
326 XPoint *spot = &(FRAME_X_XIC_SPOT (f));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
327
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
328 /* Only care if we have a valid XIC using Over the Spot in
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
329 * a different location */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
330 if (!xic ||
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
331 !(FRAME_X_XIC_STYLE (f) & XIMPreeditPosition) ||
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
332 (spot->x == (short) x &&
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
333 spot->y == (short) y))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
334 return;
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
335
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
336 spot->x = (short) x;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
337 spot->y = (short) y;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
338
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
339 /* ### FIX: Must make sure spot fits within Preedit Area */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
340 XIC_Value (Set, xic, XNPreeditAttributes, XNSpotLocation, spot);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
341 #ifdef DEBUG_XIM
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
342 stderr_out ("Spot: %d %d\n", spot->x, spot->y);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
343 #endif
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
344 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
345
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
346 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
347 XIM_focus_event (struct frame *f, int in_p)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
348 {
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 359
diff changeset
349 if (FRAME_X_XIC (f))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
350 (in_p ? XSetICFocus : XUnsetICFocus) (FRAME_X_XIC (f));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
351 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
352
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
353 #if 0
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
354 #define XIM_Composed_Text_BUFSIZE 64
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
355 typedef struct XIM_Composed_Text
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
356 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
357 int size;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
358 wchar_t data [XIM_Composed_Text_BUFSIZE];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
359 } XIM_Composed_Text;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
360
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
361 static XIM_Composed_Text composed_input_buf = {XIM_Composed_Text_BUFSIZE, {0}};
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
362 Window main_window;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
363
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
364 /* get_XIM_input -- Process results of input method composition.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
365
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
366 This function copies the results of the input method composition to
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
367 composed_input_buf. Then for each character, a custom event of type
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
368 wc_atom is sent with the character as its data.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
369
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
370 It is probably more efficient to copy the composition results to some
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
371 allocated memory and send a single event pointing to that memory.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
372 That would cut down on the event processing as well as allow quick
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
373 insertion into the buffer of the whole string. It might require some
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
374 care, though, to avoid fragmenting memory through the allocation and
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
375 freeing of many small chunks. Maybe the existing system for
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
376 (single-byte) string allocation can be used, multiplying the length by
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
377 sizeof (wchar_t) to get the right size.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
378 */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
379 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
380 get_XIM_input (XKeyPressedEvent *x_key_event, XIC ic, Display *dpy)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
381 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
382 KeySym keysym;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
383 Status status;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
384 int len;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
385 int i;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
386 XClientMessageEvent new_event;
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
387
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 377
diff changeset
388 retry:
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
389 len = XwcLookupString (ic, x_key_event, composed_input_buf.data,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
390 composed_input_buf.size, &keysym, &status);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
391 switch (status)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
392 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
393 case XBufferOverflow:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
394 /* GROW_WC_STRING (&composed_input_buf, 32); mrb */
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 377
diff changeset
395 goto retry;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
396 case XLookupChars:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
397 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
398 default:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
399 abort ();
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
400 }
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
401
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
402 new_event.type = ClientMessage;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
403 new_event.display = x_key_event->display;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
404 new_event.window = x_key_event->window;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
405 new_event.message_type = wc_atom;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
406 new_event.format = 32; /* 32-bit wide data */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
407 new_event.data.l[2] = new_event.data.l[3] = new_event.data.l[4] = 0L;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
408 new_event.data.l[0] = x_key_event->time;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
409 for (i = 0; i < len; i++)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
410 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
411 new_event.data.l[1] = ((wchar_t *) composed_input_buf.data)[i];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
412 XSendEvent (display, main_window, False, 0L, (XEvent *) &new_event);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
413 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
414 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
415 #endif /* 0 */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
416
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
417 /* ============================================================== */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
418 /* X input method style determination */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
419 /* ============================================================== */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
420
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
421 #if 0
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
422 #define done(type, value) \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
423 if (toVal->addr != NULL) { \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
424 if (toVal->size < sizeof(type)) { \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
425 toVal->size = sizeof(type); \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
426 return False; \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
427 } \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
428 *(type*)toVal->addr = (value); \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
429 } else { \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
430 static type static_val; \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
431 static_val = (value); \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
432 toVal->addr = (XPointer)&static_val; \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
433 } \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
434 toVal->size = sizeof(type); \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
435 return True /* Caller supplies `;' */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
436 #endif /* 0 */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
437
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
438 /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
439 * This is a standard Xt type converter, except that the caller MUST
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
440 * supply a proper non-NULL toVal XIMStyles structure that we will
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
441 * fill in.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
442 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
443 * fromVal points to a string like
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
444 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
445 "XIMPreeditPosition|XIMStatusArea,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
446 XIMPreeditPosition|XIMStatusNothing
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
447 XIMPreeditNothing|XIMStatusNothing"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
448 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
449 * This is converted in the obvious way to a XIMStyles structure.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
450 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
451 * mrb: #### Fix this to handle Motif-style specifications for
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
452 * XIMStyles as well: overTheSpot, rootWindow, none */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
453
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
454 /* XtTypeConverter */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
455 Boolean
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
456 EmacsXtCvtStringToXIMStyles (
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
457 Display *dpy,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
458 XrmValuePtr args,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
459 Cardinal *num_args,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
460 XrmValuePtr fromVal,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
461 XrmValuePtr toVal,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
462 XtPointer *converter_data)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
463 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
464 #define STYLE_INFO(style) { style, #style, sizeof(#style) }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
465 static struct XIMStyleInfo
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
466 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
467 CONST XIMStyle style;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
468 CONST char * CONST name;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
469 CONST int namelen;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
470 } emacs_XIMStyleInfo[] = {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
471 STYLE_INFO (XIMPreeditPosition|XIMStatusArea),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
472 STYLE_INFO (XIMPreeditPosition|XIMStatusNothing),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
473 STYLE_INFO (XIMPreeditPosition|XIMStatusNone),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
474 STYLE_INFO (XIMPreeditNothing|XIMStatusArea),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
475 STYLE_INFO (XIMPreeditNothing|XIMStatusNothing),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
476 STYLE_INFO (XIMPreeditNothing|XIMStatusNone),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
477 STYLE_INFO (XIMPreeditNone|XIMStatusArea),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
478 STYLE_INFO (XIMPreeditNone|XIMStatusNothing),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
479 STYLE_INFO (XIMPreeditNone|XIMStatusNone)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
480 };
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
481 #undef STYLE_INFO
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
482
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 267
diff changeset
483 char *s = (char *) fromVal->addr;
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 267
diff changeset
484 char *end = s + fromVal->size;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
485 XIMStyles * CONST p = (XIMStyles *) toVal->addr;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
486 CONST char * CONST delimiter = " \t\n\r:;," ;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
487 CONST int max_styles = XtNumber(emacs_XIMStyleInfo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
488 int i;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
489 char *c;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
490
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
491 #ifdef DEBUG_XIM
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
492 stderr_out ("EmacsCvtStringToXIMStyles called with size=%d, string=\"%s\"\n",
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
493 fromVal->size, (char *) fromVal->addr);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
494 #endif /* DEBUG_XIM */
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
495
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
496 if (*num_args != 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
497 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
498 XtAppContext the_app_con = XtDisplayToApplicationContext (dpy);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
499 XtAppWarningMsg(the_app_con, "wrongParameters", "cvtStringToXIMStyle",
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
500 "XtToolkitError",
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
501 "String to XIMStyle conversion requires exactly 0 parameters",
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
502 (String *)NULL, (Cardinal *)NULL);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
503 return False;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
504 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
505
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
506 #ifdef DEBUG_XEMACS
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
507 /* Make sure caller is giving us good data */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
508 assert (fromVal->addr != NULL);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
509 assert (fromVal->size == strlen(fromVal->addr)+1);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
510 assert (toVal->addr != NULL);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
511 assert (toVal->size == sizeof(XIMStyles));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
512 #endif /* DEBUG_XEMACS */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
513
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
514 p->count_styles = 0;
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
515 p->supported_styles = xnew_array (XIMStyle, max_styles);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
516
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
517 /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
518 * The following routine assumes that the style name resource is
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
519 * identical with the programmatic name of style. For example,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
520 * "XIMPreeditPosition|XIMStatusArea" means the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
521 * XIMPreeditPosition|XIMStatusArea value is specified. If the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
522 * style name is changed, such as "OverTheSpot|imDisplaysInClient",
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
523 * the parsing logic below should be modified as well. */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
524
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
525 if ((c = strtok(s, delimiter)) == NULL)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
526 c = end;
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
527
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
528 while (c < end)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
529 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
530 for(i=0 ; i<max_styles ; i++)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
531 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
532 struct XIMStyleInfo *rec = emacs_XIMStyleInfo + i;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
533 if(!strncmp(c, rec->name, rec->namelen - 1)) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
534 p->supported_styles[p->count_styles] = rec->style;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
535 p->count_styles++;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
536 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
537 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
538 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
539 if((c = strtok(NULL, delimiter)) == NULL) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
540 break ;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
541 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
542 }
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
543
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
544 if (p->count_styles == 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
545 { /* No valid styles? */
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 223
diff changeset
546 char *buf = (char *)alloca (strlen (fromVal->addr)
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 223
diff changeset
547 + strlen (DefaultXIMStyles)
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 223
diff changeset
548 + 100);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
549 XrmValue new_from;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
550 XtAppContext the_app_con = XtDisplayToApplicationContext (dpy);
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
551
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
552 sprintf(buf, "Cannot convert string \"%s\" to type XIMStyles.\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
553 "Using default string \"%s\" instead.\n",
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
554 fromVal->addr, DefaultXIMStyles);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
555 XtAppWarningMsg(the_app_con, "wrongParameters", "cvtStringToXIMStyle",
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
556 "XtToolkitError",
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
557 buf, (String *)NULL, (Cardinal *)NULL);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
558 new_from.addr = DefaultXIMStyles;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
559 new_from.size = sizeof(DefaultXIMStyles);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
560 return EmacsXtCvtStringToXIMStyles (dpy, args, num_args,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
561 &new_from, toVal, converter_data);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
562 }
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
563 XREALLOC_ARRAY (p->supported_styles, XIMStyle, p->count_styles);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
564 *converter_data = (char *) True;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
565 return True;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
566 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
567
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
568 /* XtDestructor */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
569 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
570 EmacsFreeXIMStyles (
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
571 XtAppContext app,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
572 XrmValuePtr toVal,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
573 XtPointer converter_data,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
574 XrmValuePtr args,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
575 Cardinal *num_args)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
576 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
577 #ifdef DEBUG_XIM
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
578 stderr_out ("Converter data: %x\n", converter_data);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
579 stderr_out ("EmacsFreeXIMStyles called\n");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
580 #endif /* DEBUG_XIM */
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
581
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
582 if (*num_args != 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
583 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
584 XtAppWarningMsg(app, "wrongParameters","freeXIMStyles","XtToolkitError",
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
585 "Freeing an XIMStyles requires that zero arguments be passwd",
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
586 (String *)NULL, (Cardinal *)NULL);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
587 return;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
588 }
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
589
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
590 if (converter_data)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
591 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
592 Boolean free_p = (Boolean) (int) converter_data;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
593 XIMStyles *styles = (XIMStyles *) toVal->addr;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
594 if (free_p)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
595 XFree ( styles->supported_styles );
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
596 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
597 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
598
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
599 #if 0
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
600 /* O'Reilly XLib Programming Manual, pg. 371 */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
601 /* Much nicer implementation than O'Reilly */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
602 /* Choose the more `complicated', hence nicer, XIM input style */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
603 static XIMStyle
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
604 BetterStyle (XIMStyle s, XIMStyle t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
605 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
606 #define CHECK_XIMStyle_BIT(bit) \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
607 if ((s ^ t) & bit) { return (s & bit) ? s : t; }
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
608
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
609 CHECK_XIMStyle_BIT (XIMPreeditCallbacks);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
610 CHECK_XIMStyle_BIT (XIMPreeditPosition);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
611 CHECK_XIMStyle_BIT (XIMPreeditArea);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
612 CHECK_XIMStyle_BIT (XIMPreeditNothing);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
613 CHECK_XIMStyle_BIT (XIMStatusCallbacks);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
614 CHECK_XIMStyle_BIT (XIMStatusArea);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
615 CHECK_XIMStyle_BIT (XIMStatusNothing);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
616 #undef CHECK_XIMStyle_BIT
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
617 return s ? s : t ;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
618 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
619 #endif /* 0 */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
620
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
621 /* Choose the best style, given:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
622 * - user preferences (already checked to be supported by XEmacs)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
623 * - styles supported by the input method */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
624 #define DEFAULTStyle (XIMPreeditNothing|XIMStatusNothing)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
625 static XIMStyle
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
626 best_style (XIMStyles *user, XIMStyles *xim)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
627 {
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 185
diff changeset
628 REGISTER int i, j;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
629 for (i=0 ; i<user->count_styles ; i++)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
630 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
631 for (j=0 ; j<xim->count_styles ; j++)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
632 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
633 if (user->supported_styles[i] == xim->supported_styles[j])
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
634 return user->supported_styles[i];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
635 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
636 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
637 return DEFAULTStyle; /* Default Style */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
638 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
639
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
640
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
641 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
642 vars_of_input_method_xlib (void)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
643 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
644 Fprovide (intern ("xim"));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
645 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
646
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
647
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
648 /* ====================================================================== */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
649 /* Internal Debugging Routines */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
650 /* ====================================================================== */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
651 #ifdef DEBUG_XEMACS
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
652
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
653 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
654 describe_XIM (XIM xim)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
655 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
656 XIMStyles *styles;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
657
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
658 /* Print locale of XIM */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
659 stderr_out ("\nXIM Locale of IM: %s\n", XLocaleOfIM(xim));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
660
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
661 /* List supported input method styles */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
662 XGetIMValues(xim, XNQueryInputStyle, &styles, NULL);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
663
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
664 stderr_out ("\n%d input style(s) supported by input method.\n",
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
665 styles->count_styles);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
666
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
667 #ifdef DEBUG_XIM
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
668 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
669 int i;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
670 for (i=0; i < styles->count_styles; i++)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
671 describe_XIMStyle (styles->supported_styles[i]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
672 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
673 #endif /* DEBUG_XIM */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
674 XFree(styles);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
675 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
676
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
677 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
678 describe_XFontSet (XFontSet fontset)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
679 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
680 XFontStruct **font_struct_list;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
681 char **font_name_list;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
682 int count, i;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
683
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
684 if (fontset == NULL)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
685 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
686 stderr_out ("NULL\n");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
687 return;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
688 }
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
689
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
690 count = XFontsOfFontSet (fontset, &font_struct_list, &font_name_list);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
691 stderr_out ( "%d font(s) available:\n", count);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
692 for (i=0 ; i < count ; i++)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
693 stderr_out ("Font: %s\n", *(font_name_list+i));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
694 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
695
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
696 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
697 describe_Status (Status status)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
698 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
699 #define DESCRIBE_STATUS(value) \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
700 if (status == value) stderr_out ("Status: " #value "\n")
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
701
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
702 DESCRIBE_STATUS (XBufferOverflow);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
703 DESCRIBE_STATUS (XLookupNone);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
704 DESCRIBE_STATUS (XLookupKeySym);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
705 DESCRIBE_STATUS (XLookupBoth);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
706 DESCRIBE_STATUS (XLookupChars);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
707 #undef DESCRIBE_STATUS
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
708 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
709
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
710 void
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
711 describe_Window (Window win)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
712 {
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 223
diff changeset
713 char xwincmd[128];
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
714 sprintf (xwincmd, "xwininfo -id 0x%x >&2; xwininfo -events -id 0x%x >&2",
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
715 (int) win, (int) win);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
716 system (xwincmd);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
717 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
718
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
719 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
720 describe_XIC (XIC xic)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
721 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
722 XIMStyle style;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
723 Window client_win=0, focus_win=0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
724 char *resourceName = NULL;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
725 char *resourceClass = NULL;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
726 char *bad_arg = NULL;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
727 unsigned long filter_mask = NoEventMask;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
728 XVaNestedList p_list, s_list;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
729 XFontSet p_fontset = NULL, s_fontset = NULL;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
730 Pixel p_fg=0, p_bg = 0, s_fg=0, s_bg = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
731 XRectangle *p_area = NULL, *s_area = NULL;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
732 XRectangle *p_needed = NULL, *s_needed = NULL;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
733 XPoint *p_spot = NULL;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
734
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
735 /* Check for valid input context and method */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
736 if (!xic)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
737 stderr_out ("Input method is NULL\n");
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
738
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
739 if (!XIMOfIC(xic))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
740 stderr_out ("XIMOfIC() returns NULL\n");
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
741
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
742 /* Print out Input Context Attributes */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
743 p_list = XVaCreateNestedList (0,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
744 XNFontSet, &p_fontset,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
745 XNArea, &p_area,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
746 XNAreaNeeded, &p_needed,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
747 XNSpotLocation, &p_spot,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
748 XNForeground, &p_fg,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
749 XNBackground, &p_bg,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
750 NULL);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
751
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
752 s_list = XVaCreateNestedList (0,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
753 XNFontSet, &s_fontset,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
754 XNArea, &s_area,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
755 XNAreaNeeded, &s_needed,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
756 XNForeground, &s_fg,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
757 XNBackground, &s_bg,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
758 NULL);
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
759
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
760 bad_arg = XGetICValues(xic,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
761 XNInputStyle, &style,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
762 XNFilterEvents, &filter_mask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
763 XNClientWindow, &client_win,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
764 XNFocusWindow, &focus_win,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
765 XNResourceName, &resourceName,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
766 XNResourceClass, &resourceClass,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
767 XNPreeditAttributes, p_list,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
768 XNStatusAttributes, s_list,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
769 NULL);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
770 XFree(p_list);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
771 XFree(s_list);
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
772
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
773 if (bad_arg != NULL)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
774 stderr_out ("Couldn't get IC value: %s\n", bad_arg);
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
775
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
776 stderr_out ("\nInput method context attributes:\n");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
777 stderr_out ("Style: "); describe_XIMStyle (style);
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 207
diff changeset
778 stderr_out ("Client window: %lx\n", (unsigned long int)client_win);
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 207
diff changeset
779 stderr_out ("Focus window: %lx\n", (unsigned long int)focus_win);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
780 stderr_out ("Preedit:\n");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
781 describe_XRectangle (" Area", p_area);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
782 describe_XRectangle (" Area needed", p_needed);
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 207
diff changeset
783 stderr_out (" foreground: %lx\n", (unsigned long int)p_fg);
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 207
diff changeset
784 stderr_out (" background: %lx\n", (unsigned long int)p_bg);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
785 stderr_out (" fontset: "); describe_XFontSet (p_fontset);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
786 stderr_out ("Status:\n");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
787 describe_XRectangle (" Area", s_area);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
788 describe_XRectangle (" Area needed", s_needed);
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 207
diff changeset
789 stderr_out (" foreground: %lx\n", (unsigned long int)s_fg);
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 207
diff changeset
790 stderr_out (" background: %lx\n", (unsigned long int)s_bg);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
791 stderr_out (" fontset: \n"); describe_XFontSet (s_fontset);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
792 stderr_out ("XNResourceName: %s\n", resourceName ? resourceName : "NULL");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
793 stderr_out ("XNResourceClass: %s\n", resourceClass ? resourceClass : "NULL");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
794 stderr_out ("XNFilterEvents: "); describe_event_mask (filter_mask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
795 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
796
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
797 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
798 describe_XRectangle (char *name, XRectangle *r)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
799 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
800 if (r == NULL)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
801 stderr_out ("%s: NULL\n", name);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
802 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
803 stderr_out ("%s: x=%d y=%d w=%d h=%d\n",
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
804 name, r->x, r->y, r->width, r->height);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
805 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
806
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
807 /* Print out elements of Event mask */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
808 /* Defines from X11/X.h */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
809 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
810 describe_event_mask (unsigned long mask)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
811 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
812 #define DESCRIBE_EVENT_MASK(bit) if ((bit) & mask) stderr_out (#bit " ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
813 DESCRIBE_EVENT_MASK (NoEventMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
814 DESCRIBE_EVENT_MASK (KeyPressMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
815 DESCRIBE_EVENT_MASK (KeyReleaseMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
816 DESCRIBE_EVENT_MASK (ButtonPressMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
817 DESCRIBE_EVENT_MASK (ButtonReleaseMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
818 DESCRIBE_EVENT_MASK (EnterWindowMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
819 DESCRIBE_EVENT_MASK (LeaveWindowMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
820 DESCRIBE_EVENT_MASK (PointerMotionMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
821 DESCRIBE_EVENT_MASK (PointerMotionHintMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
822 DESCRIBE_EVENT_MASK (Button1MotionMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
823 DESCRIBE_EVENT_MASK (Button2MotionMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
824 DESCRIBE_EVENT_MASK (Button3MotionMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
825 DESCRIBE_EVENT_MASK (Button4MotionMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
826 DESCRIBE_EVENT_MASK (Button5MotionMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
827 DESCRIBE_EVENT_MASK (ButtonMotionMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
828 DESCRIBE_EVENT_MASK (KeymapStateMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
829 DESCRIBE_EVENT_MASK (ExposureMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
830 DESCRIBE_EVENT_MASK (VisibilityChangeMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
831 DESCRIBE_EVENT_MASK (StructureNotifyMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
832 DESCRIBE_EVENT_MASK (ResizeRedirectMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
833 DESCRIBE_EVENT_MASK (SubstructureNotifyMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
834 DESCRIBE_EVENT_MASK (SubstructureRedirectMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
835 DESCRIBE_EVENT_MASK (FocusChangeMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
836 DESCRIBE_EVENT_MASK (PropertyChangeMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
837 DESCRIBE_EVENT_MASK (ColormapChangeMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
838 DESCRIBE_EVENT_MASK (OwnerGrabButtonMask);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
839 #undef DESCRIBE_EVENT_MASK
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
840 stderr_out("\n");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
841 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
842
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
843 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
844 describe_XIMStyle (XIMStyle style)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
845 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
846 #define DESCRIBE_STYLE(bit) \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
847 if (bit & style) \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
848 stderr_out (#bit " ");
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
849
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
850 DESCRIBE_STYLE (XIMPreeditArea);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
851 DESCRIBE_STYLE (XIMPreeditCallbacks);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
852 DESCRIBE_STYLE (XIMPreeditPosition);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
853 DESCRIBE_STYLE (XIMPreeditNothing);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
854 DESCRIBE_STYLE (XIMPreeditNone);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
855 DESCRIBE_STYLE (XIMStatusArea);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
856 DESCRIBE_STYLE (XIMStatusCallbacks);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
857 DESCRIBE_STYLE (XIMStatusNothing);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
858 DESCRIBE_STYLE (XIMStatusNone);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
859 #undef DESCRIBE_STYLE
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
860 stderr_out("\n");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
861 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
862
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
863 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
864 describe_XIMStyles (XIMStyles *p)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
865 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
866 int i;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
867 stderr_out ("%d Style(s):\n", p->count_styles);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
868 for (i=0; i<p->count_styles ; i++)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
869 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
870 describe_XIMStyle (p->supported_styles[i]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
871 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
872 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
873
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
874 #endif /* DEBUG_XEMACS */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
875
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
876 /* Random cruft follows */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
877
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
878 #if 0
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
879 static void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
880 Unit_Test (struct frame *f, char * s)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
881 /* mrb unit testing */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
882 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
883 XrmValue fromVal, toVal;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
884
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
885 fromVal.addr = s;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
886 fromVal.size = strlen (s);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
887 toVal.addr = (XtPointer) &user_preferred_XIMStyles;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
888 toVal.size = sizeof (XIMStyles);
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
889
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
890 if (XtConvertAndStore (FRAME_X_TEXT_WIDGET (f), XtRString, &fromVal,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
891 XtRXimStyles, &toVal) != False)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
892 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
893 stderr_out ("Unit_Test: fromVal.addr=0x%x\n",fromVal.addr);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
894 stderr_out ("Unit_Test: fromVal.size=%d\n", fromVal.size);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
895 stderr_out ("Unit_Test: toVal.addr=0x%x\n", toVal.addr);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
896 stderr_out ("Unit_Test: toVal.size=%d\n", toVal.size);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
897 describe_XIMStyles ((XIMStyles *) toVal.addr);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
898 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
899 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
900 #endif
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
901
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
902 #if 0
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
903 /* Get a fontset for IM to use */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
904 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
905 x_init_fontset (struct device *d)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
906 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
907 Display *dpy = DEVICE_X_DISPLAY (d);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
908 XFontSet fontset;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
909 char ** missing_charsets;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
910 int num_missing_charsets;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
911 char * default_string;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
912 /* char * font_set_string = "-dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*";*/
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
913 char * font_set_string = "-dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*, -misc-fixed-medium-r-normal--14-130-75-75-c-70-jisx0201.1976-0,-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-0, -misc-fixed-medium-r-normal--14-130-75-75-c-70-jisx0201.1976-0" ;
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
914
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
915 DEVICE_X_FONTSET (d) = fontset =
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
916 XCreateFontSet (dpy,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
917 font_set_string,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
918 &missing_charsets,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
919 &num_missing_charsets,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
920 &default_string);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
921
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
922 if (fontset == NULL)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
923 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
924 stderr_out ("Unable to create fontset from string:\n%s\n", font_set_string);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
925 return;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
926 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
927 if (num_missing_charsets > 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
928 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
929 int i;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
930 stderr_out ("\nMissing charsets for fontset %s:\n", font_set_string);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
931 for (i=0; i < num_missing_charsets; i++)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
932 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
933 stderr_out ("%s\n", missing_charsets[i]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
934 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
935 XFreeStringList (missing_charsets);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
936 stderr_out ("Default string: %s\n", default_string);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
937 }
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 179
diff changeset
938
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
939 #ifdef DEBUG_XIM
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
940 describe_XFontSet (fontset);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
941 #endif
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
942 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
943 #endif /* 0 */