Mercurial > kinput2.yaz
comparison include/InputConv.h @ 0:92745d501b9a
initial import from kinput2-v3.1
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Mon, 08 Mar 2010 04:44:30 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:92745d501b9a |
---|---|
1 /* $Id: InputConv.h,v 1.20 1999/01/13 08:41:54 ishisone Exp $ */ | |
2 /* | |
3 * Copyright (c) 1990 Software Research Associates, Inc. | |
4 * | |
5 * Permission to use, copy, modify, and distribute this software and its | |
6 * documentation for any purpose and without fee is hereby granted, provided | |
7 * that the above copyright notice appear in all copies and that both that | |
8 * copyright notice and this permission notice appear in supporting | |
9 * documentation, and that the name of Software Research Associates not be | |
10 * used in advertising or publicity pertaining to distribution of the | |
11 * software without specific, written prior permission. Software Research | |
12 * Associates makes no representations about the suitability of this software | |
13 * for any purpose. It is provided "as is" without express or implied | |
14 * warranty. | |
15 * | |
16 * Author: Makoto Ishisone, Software Research Associates, Inc., Japan | |
17 */ | |
18 | |
19 #ifndef _InputConv_h | |
20 #define _InputConv_h | |
21 | |
22 #include "ICtypes.h" | |
23 #include <X11/Object.h> | |
24 | |
25 /* | |
26 InputConv new resources: | |
27 | |
28 name class type default access | |
29 ---------------------------------------------------------------------------- | |
30 selectionControl Callback Callback NULL C | |
31 textChangeNotify Callback Callback NULL C | |
32 modeChangeNotify Callback Callback NULL C | |
33 endNotify Callback Callback NULL C | |
34 fixNotify Callback Callback NULL C | |
35 auxControl Callback Callback NULL C | |
36 displayObjectClass Class Pointer NULL CG | |
37 */ | |
38 | |
39 /* new resources */ | |
40 #define XtNselectionControl "selectionControl" | |
41 #define XtNtextChangeNotify "textChangeNotify" | |
42 #define XtNmodeChangeNotify "modeChangeNotify" | |
43 #define XtNfixNotify "fixNotify" | |
44 #define XtNendNotify "endNotify" | |
45 #define XtNauxControl "auxControl" | |
46 #define XtNdisplayObjectClass "displayObjectClass" | |
47 #define XtCClass "Class" | |
48 | |
49 typedef struct _InputConvClassRec *InputConvObjectClass; | |
50 typedef struct _InputConvRec *InputConvObject; | |
51 | |
52 extern WidgetClass inputConvObjectClass; | |
53 | |
54 | |
55 /* | |
56 * XtNselectionControl $B%3!<%k%P%C%/$N(B call_data $B9=B$BN(B | |
57 */ | |
58 | |
59 typedef struct { | |
60 | |
61 int command; /* $B%3%^%s%I(B | |
62 * Start: $B9`L\A*Br3+;O%j%/%(%9%H(B | |
63 * End: $B9`L\A*Br=*N;%j%/%(%9%H(B | |
64 * Set: $B%+%l%s%H9`L\@_Dj%j%/%(%9%H(B | |
65 * Move: $B%+%l%s%H9`L\0\F0%j%/%(%9%H(B | |
66 * Get: $B%+%l%s%H9`L\<hF@%j%/%(%9%H(B | |
67 */ | |
68 #define ICSelectionStart 1 | |
69 #define ICSelectionEnd 2 | |
70 #define ICSelectionSet 3 | |
71 #define ICSelectionMove 4 | |
72 #define ICSelectionGet 5 | |
73 | |
74 union { | |
75 int selection_kind; /* ICSelectionStart $B$N;~(B */ | |
76 #define ICSelectionCandidates 1 | |
77 #define ICSelectionSymbols 2 | |
78 | |
79 int current_item; /* ICSelectionSet/ICSelectionEnd/ | |
80 * ICSelectionGet $B$N;~(B | |
81 * ICSelectionEnd/ICSelectionGet $B$N(B | |
82 * $B>l9g$O%3!<%k%P%C%/4X?tB&$G8=:_$N(B | |
83 * $B%+%l%s%H8uJdHV9f$rBeF~$9$k(B | |
84 * ($B%+%l%s%H$,$J$1$l$P(B -1 $B$rBeF~$9$k(B) | |
85 */ | |
86 | |
87 int dir; /* ICSelectionMove $B$N;~(B */ | |
88 } u; | |
89 | |
90 } ICSelectionControlArg; | |
91 | |
92 | |
93 /* | |
94 * ICCompareSegment $B$GJV$5$l$kCM(B | |
95 */ | |
96 | |
97 #define ICSame 0 /* $BA4$/F1$8(B */ | |
98 #define ICAttrChanged 1 /* attr $B$N$_0[$J$k(B */ | |
99 #define ICStringChanged 2 /* data $B$,0[$J$k(B */ | |
100 /* attribute $B$H(B data $B$H$b$K0[$J$l$P(B | |
101 * (ICAttrChanged | ICStringChanged) $B$,JV$k(B | |
102 */ | |
103 | |
104 | |
105 /* | |
106 * XtNauxControl $B%3!<%k%P%C%/$N(B call_data $B9=B$BN(B | |
107 */ | |
108 | |
109 typedef struct { | |
110 | |
111 int command; /* $B%3%^%s%I(B | |
112 * Start: $B9`L\A*Br3+;O%j%/%(%9%H(B | |
113 * End: $B9`L\A*Br=*N;%j%/%(%9%H(B | |
114 * Change: $B%+%l%s%H9`L\@_Dj%j%/%(%9%H(B | |
115 */ | |
116 #define ICAuxStart 1 | |
117 #define ICAuxEnd 2 | |
118 #define ICAuxChange 3 | |
119 | |
120 } ICAuxControlArg; | |
121 | |
122 /* | |
123 * GetTriggerKeys $B$K;H$o$l$k(B keys $B$N$?$a$N9=B$BN(B | |
124 */ | |
125 | |
126 typedef struct { | |
127 KeySym keysym; | |
128 long modifiers; | |
129 long modifiermask; | |
130 } ICTriggerKey; | |
131 | |
132 /* | |
133 * $B%Q%V%j%C%/%$%s%?!<%U%'%$%9%U%!%s%/%7%g%s(B | |
134 */ | |
135 | |
136 /* | |
137 * Boolean ICSupportMultipleObjects(WidgetClass objectclass) | |
138 * $B;XDj$5$l$?%*%V%8%'%/%H%/%i%9$+$iJ#?t$N%$%s%9%?%s%9$,@8@.$G$-$k$+(B | |
139 * $B$I$&$+$rJV$9(B | |
140 * True $B$J$i2DG=$@$7!"(BFalse $B$J$i$?$@0l$D$N%$%s%9%?%s%9$7$+@8@.$G$-$J$$(B | |
141 * $B0z?t$,(B Widget $B$G$O$J$/(B WidgetClass $B$G$"$k$3$H$KCm0U(B | |
142 */ | |
143 extern Boolean ICSupportMultipleObjects( | |
144 #if NeedFunctionPrototypes | |
145 WidgetClass /* objectclass */ | |
146 #endif | |
147 ); | |
148 | |
149 /* | |
150 * int ICInputEvent(Widget ojbect, XEvent *event) | |
151 * $B%*%V%8%'%/%H$KF~NO%$%Y%s%H$rM?$($k(B | |
152 * $B%(%i!<$,5/$3$C$?>l9g$O(B -1 $B$,JV$k(B | |
153 * $B%(%i!<$G$J$1$l$P(B 0 $B$+(B 1 $B$,JV$k(B | |
154 * $BDL>o$O(B 0 $B$,JV$k$,!"$b$7(B 1 $B$,JV$C$F$-$?$i!"$=$l$O$G$-$k$J$i$P(B | |
155 * $B$=$NF~NO%$%Y%s%H$r%"%W%j%1!<%7%g%s$KAw$jJV$7$?J}$,$h$$$H$$$&(B | |
156 * $B%*%V%8%'%/%H$+$i$N%R%s%H$G$"$k(B | |
157 */ | |
158 extern int ICInputEvent( | |
159 #if NeedFunctionPrototypes | |
160 Widget /* object */, | |
161 XEvent * /* event */ | |
162 #endif | |
163 ); | |
164 | |
165 /* | |
166 * ICString *ICGetMode(Widget object) | |
167 * $B8=:_$NF~NO%b!<%I$r(B ICString $B$N7A<0$GJV$9(B | |
168 * $B%G!<%?$O(B InputConvObject $B$N$b$N$J$N$G>!<j$KCM$rJQ99$7$?$j(B | |
169 * free() $B$7$F$O$J$i$J$$(B | |
170 */ | |
171 extern ICString *ICGetMode( | |
172 #if NeedFunctionPrototypes | |
173 Widget /* object */ | |
174 #endif | |
175 ); | |
176 | |
177 /* | |
178 * int ICCursorPos(Widget object, Cardinal *segidx, Cardinal *offset) | |
179 * $B8=:_$N%$%s%5!<%H%+!<%=%k0LCV$rJV$9(B | |
180 * $B8=:_%+!<%=%k$,$J$$;~$K$O(B 0 $B$"$k;~$K$O(B 1 $B$,JV$k(B | |
181 * 1 $B$,JV$5$l$?;~$K$O!"(Bsegidx $B$K%+!<%=%k$N$"$k%;%0%a%s%HHV9f!"(B | |
182 * offset $B$K%;%0%a%s%HFb$N0LCV(B($B@hF,$+$i2?J8;zL\$+(B) $B$,JV$5$l$k(B | |
183 */ | |
184 extern int ICCursorPos( | |
185 #if NeedFunctionPrototypes | |
186 Widget /* object */, | |
187 Cardinal * /* segidx */, | |
188 Cardinal * /* offset */ | |
189 #endif | |
190 ); | |
191 | |
192 /* | |
193 * int ICNumSegments(Widget object) | |
194 * $B%;%0%a%s%H?t$rJV$9(B | |
195 */ | |
196 extern int ICNumSegments( | |
197 #if NeedFunctionPrototypes | |
198 Widget /* object */ | |
199 #endif | |
200 ); | |
201 | |
202 /* | |
203 * ICString *ICGetSegment(Widget object, Cardinal n) | |
204 * n $BHVL\$N%;%0%a%s%H$rJV$9(B ($B@hF,$N%;%0%a%s%H$O(B n=0) | |
205 * $B;XDj$5$l$?%;%0%a%s%H$,B8:_$7$J$1$l$P(B NULL $B$rJV$9(B | |
206 * $B%G!<%?$O(B InputConvObject $B$N$b$N$J$N$G>!<j$KCM$rJQ99$7$?$j(B | |
207 * free() $B$7$F$O$J$i$J$$(B | |
208 */ | |
209 extern ICString *ICGetSegment( | |
210 #if NeedFunctionPrototypes | |
211 Widget /* object */, | |
212 Cardinal /* n */ | |
213 #endif | |
214 ); | |
215 | |
216 /* | |
217 * int ICCompareSegment(Widget object, ICString *seg1, ICString *seg2, | |
218 * Cardinal *nchar) | |
219 * $BFs$D$N%;%0%a%s%H$rHf3S$9$k(B | |
220 * $BHf3S7k2L$O4X?t$NCM$H$7$FJV$5$l$k(B | |
221 * nchar $B$K%;%0%a%s%H$N@hF,$+$i$N0lCW$9$kJ8;z?t$,JV$5$l$k(B | |
222 */ | |
223 extern int ICCompareSegment( | |
224 #if NeedFunctionPrototypes | |
225 Widget /* object */, | |
226 ICString * /* seg1 */, | |
227 ICString * /* seg2 */, | |
228 Cardinal * /* nchar */ | |
229 #endif | |
230 ); | |
231 | |
232 /* | |
233 * ICString *ICGetItemList(Widget object, Cardinal *num_items) | |
234 * $BA*Br9`L\$N%j%9%H$rJV$9(B | |
235 * $B9`L\A*BrCf$G$J$1$l$P(B NULL $B$rJV$9(B | |
236 * num_items $B$K9`L\?t$,JV$5$l$k(B | |
237 * $B%G!<%?$O(B InputConvObject $B$N$b$N$J$N$G>!<j$KCM$rJQ99$7$?$j(B | |
238 * free() $B$7$F$O$J$i$J$$(B | |
239 * $B$3$N4X?t$NJV$9%j%9%H$OA*BrCf(B (ICSelectionStart $B$N%3!<%k%P%C%/$+$i(B | |
240 * ICSelectionEnd $B$N%3!<%k%P%C%/$^$?$O(B ICSelectItem() $B$,%3!<%k$5$l$k$^$G(B) | |
241 * $BM-8z$G$"$k(B | |
242 */ | |
243 extern ICString *ICGetItemList( | |
244 #if NeedFunctionPrototypes | |
245 Widget /* object */, | |
246 Cardinal * /* num_items */ | |
247 #endif | |
248 ); | |
249 | |
250 /* | |
251 * int ICSelectItem(Widget object, int n) | |
252 * n $BHVL\$N9`L\$,A*Br$5$l$?$3$H$r%*%V%8%'%/%H$KCN$i$;$k(B | |
253 * n < 0 $B$J$i$I$N9`L\$bA*Br$5$l$J$+$C$?$3$H$r<($9(B | |
254 * $B9`L\A*BrCf$G$J$+$C$?$j;XDj$7$?9`L\$,B8:_$7$J$1$l$P(B -1 $B$rJV$9(B | |
255 * $B$=$l0J30$O(B 0 $B$rJV$9(B | |
256 * XtNselectionControl $B%3!<%k%P%C%/Cf$G$3$N4X?t$r8F$VI,MW$O$J$$(B | |
257 * (ICSelectionControlArg.u.current_item $B$K%+%l%s%H$N9`L\HV9f$r(B | |
258 * $BBeF~$9$k$@$1$G$h$$(B) | |
259 */ | |
260 extern int ICSelectItem( | |
261 #if NeedFunctionPrototypes | |
262 Widget /* object */, | |
263 int /* n */ | |
264 #endif | |
265 ); | |
266 | |
267 /* | |
268 * int ICGetConvertedString(Widget object, Atom *encoding, int *format, | |
269 * int *length, XtPointer *string) | |
270 * $BJQ49$5$l$?%F%-%9%H$r(B string $B$KJV$9(B | |
271 * encoding $B$K$O!"%F%-%9%H$N%(%s%3!<%G%#%s%0$r;XDj$7$F$*$/(B | |
272 * $B$?$@$7$3$l$OC1$J$k%j%/%(%9%H$G$"$C$F!"JQ49%*%V%8%'%/%H$O(B | |
273 * $BJL$N%(%s%3!<%G%#%s%0$GJV$7$F$b$h$$(B | |
274 * encoding $B$K$O<B:]$N%(%s%3!<%G%#%s%0$,JV$5$l$k(B | |
275 * $BJQ49%*%V%8%'%/%H$O>/$J$/$H$b(B COMPOUND_TEXT $B%(%s%3!<%G%#%s%0$O(B | |
276 * $B%5%]!<%H$7$J$/$F$O$J$i$J$$(B | |
277 * format $B$K$O(B 8/16/32 $B$N$$$:$l$+!"(Blength $B$O(B string $B$N%(%l%a%s%H?t$,(B | |
278 * $B$=$l$>$lJV$5$l$k(B | |
279 * $B%F%-%9%H$NNN0h$O(B malloc $B$5$l$F$$$k$N$G$3$N4X?t$r8F$s$@B&$G(B | |
280 * free $B$7$J$1$l$P$J$i$J$$(B | |
281 * $BJQ49%F%-%9%H$,$J$$;~$d%(%i!<$N>l9g$K$O(B -1$B!"$=$&$G$J$1$l$P(B 0 $B$,(B | |
282 * $B4X?t$NCM$H$7$FJV$5$l$k(B | |
283 * | |
284 * $B$3$N4X?t$O(B XtNfixNotify $B%3!<%k%P%C%/$NCf$G;H$o$l$k$3$H$rA[Dj$7$F$$$k(B | |
285 */ | |
286 extern int ICGetConvertedString( | |
287 #if NeedFunctionPrototypes | |
288 Widget /* object */, | |
289 Atom * /* encoding */, | |
290 int * /* format */, | |
291 int * /* length */, | |
292 XtPointer * /* string */ | |
293 #endif | |
294 ); | |
295 | |
296 /* | |
297 * int ICClearConversion(Widget object) | |
298 * $B6/@)E*$K(B ($BJQ49ESCf$G$"$C$F$b(B) $BJQ49%F%-%9%H$r%/%j%"$9$k(B | |
299 * $B2?$i$+$NM}M3$G%/%j%"$G$-$J$+$C$?;~$K$O(B -1$B!"$=$&$G$J$1$l$P(B 0 $B$,(B | |
300 * $BJV$5$l$k(B | |
301 */ | |
302 extern int ICClearConversion( | |
303 #if NeedFunctionPrototypes | |
304 Widget /* object */ | |
305 #endif | |
306 ); | |
307 | |
308 /* | |
309 * ICString *ICGetAuxSegments(Widget object, Cardinal *n, | |
310 * Cardinal *ns, Cardinal *nc) | |
311 * AUX$BNN0h$N%;%0%a%s%H$rJV$9!#(B | |
312 * $B;XDj$5$l$?%;%0%a%s%H$,B8:_$7$J$1$l$P(B NULL $B$rJV$9(B | |
313 * $B%G!<%?$O(B InputConvObject $B$N$b$N$J$N$G>!<j$KCM$rJQ99$7$?$j(B | |
314 * free() $B$7$F$O$J$i$J$$(B | |
315 * $BF@$i$l$?%;%0%a%s%H?t!"%+%l%s%H%;%0%a%s%H!"%+%l%s%H%;%0%a%s%H(B | |
316 * $BFb$N%+!<%=%k%]%8%7%g%s$,$=$l$>$l(B n, ns, nc $B$K$FJV$k!#(B | |
317 */ | |
318 extern ICString *ICGetAuxSegments( | |
319 #if NeedFunctionPrototypes | |
320 Widget /* object */, | |
321 Cardinal * /* n */, | |
322 Cardinal * /* ns */, | |
323 Cardinal * /* nc */ | |
324 #endif | |
325 ); | |
326 | |
327 /* | |
328 * int ICRegisterTriggerKeys(Widget object) | |
329 * $B;XDj$5$l$?%*%V%8%'%/%H$NF|K\8lF~NO3+;O%-!<$r<h$j=P$7!"(B | |
330 * $B%/%i%9JQ?t$K3JG<$9$k!#(B | |
331 */ | |
332 extern int ICRegisterTriggerKeys( | |
333 #if NeedFunctionPrototypes | |
334 Widget /* object */ | |
335 #endif | |
336 ); | |
337 | |
338 /* | |
339 * int ICGetTriggerKeysOfInputObjectClass(WidgetClass objectclass, | |
340 * ICTriggerKey *keys_return) | |
341 * $B;XDj$5$l$?F~NO%*%V%8%'%/%H%/%i%9$KEPO?$5$l$F$$$kF|K\8l(B | |
342 * $BF~NO3+;O%-!<$r<h$j=P$9!#(B | |
343 */ | |
344 extern int ICGetTriggerKeysOfInputObjectClass( | |
345 #if NeedFunctionPrototypes | |
346 WidgetClass /* objectclass */, | |
347 ICTriggerKey ** /* keys_return */ | |
348 #endif | |
349 ); | |
350 | |
351 /* | |
352 * int ICGetPreeditString(Widget object, int segn, int offset, | |
353 * Atom *encoding, int *format, | |
354 * int *length, XtPointer *string) | |
355 * $BJQ49ESCf$N(B segn $BHVL\$N(B $B%;%0%a%s%H$N(B offset $BJ8;z$+$i$N%F%-%9%H$r(B | |
356 * string $B$KJV$9(B | |
357 * encoding $B$K$O!"%F%-%9%H$N%(%s%3!<%G%#%s%0$r;XDj$7$F$*$/(B | |
358 * $B$?$@$7$3$l$OC1$J$k%j%/%(%9%H$G$"$C$F!"JQ49%*%V%8%'%/%H$O(B | |
359 * $BJL$N%(%s%3!<%G%#%s%0$GJV$7$F$b$h$$(B | |
360 * encoding $B$K$O<B:]$N%(%s%3!<%G%#%s%0$,JV$5$l$k(B | |
361 * $BJQ49%*%V%8%'%/%H$O>/$J$/$H$b(B COMPOUND_TEXT $B%(%s%3!<%G%#%s%0$O(B | |
362 * $B%5%]!<%H$7$J$/$F$O$J$i$J$$(B | |
363 * format $B$K$O(B 8/16/32 $B$N$$$:$l$+!"(Blength $B$O(B string $B$N%(%l%a%s%H?t$,(B | |
364 * $B$=$l$>$lJV$5$l$k(B | |
365 * $B%F%-%9%H$NNN0h$O(B malloc $B$5$l$F$$$k$N$G$3$N4X?t$r8F$s$@B&$G(B | |
366 * free $B$7$J$1$l$P$J$i$J$$(B | |
367 * $BJQ49%F%-%9%H$,$J$$;~$d%(%i!<$N>l9g$K$O(B -1$B!"$=$&$G$J$1$l$P(B 0 $B$,(B | |
368 * $B4X?t$NCM$H$7$FJV$5$l$k(B | |
369 */ | |
370 extern int ICGetPreeditString( | |
371 #if NeedFunctionPrototypes | |
372 Widget /* object */, | |
373 int /* segn */, | |
374 int /* offset */, | |
375 Atom * /* encoding */, | |
376 int * /* format */, | |
377 int * /* length */, | |
378 XtPointer * /* string */ | |
379 #endif | |
380 ); | |
381 | |
382 /* | |
383 * int ICGetStatusString(Widget object, Atom *encoding, int *format, | |
384 * int *length, XtPointer *string, int *nchars) | |
385 * $B%9%F!<%?%9%F%-%9%H$r(B string $B$KJV$9(B | |
386 * encoding $B$K$O!"%F%-%9%H$N%(%s%3!<%G%#%s%0$r;XDj$7$F$*$/(B | |
387 * $B$?$@$7$3$l$OC1$J$k%j%/%(%9%H$G$"$C$F!"JQ49%*%V%8%'%/%H$O(B | |
388 * $BJL$N%(%s%3!<%G%#%s%0$GJV$7$F$b$h$$(B | |
389 * encoding $B$K$O<B:]$N%(%s%3!<%G%#%s%0$,JV$5$l$k(B | |
390 * $BJQ49%*%V%8%'%/%H$O>/$J$/$H$b(B COMPOUND_TEXT $B%(%s%3!<%G%#%s%0$O(B | |
391 * $B%5%]!<%H$7$J$/$F$O$J$i$J$$(B | |
392 * format $B$K$O(B 8/16/32 $B$N$$$:$l$+!"(Blength $B$O(B string $B$N%(%l%a%s%H?t$,(B | |
393 * $B$=$l$>$lJV$5$l$k(B | |
394 * nchars $B$K$O(B string $B$NJ8;z?t$,JV$5$l$k(B | |
395 * $B%F%-%9%H$NNN0h$O(B malloc $B$5$l$F$$$k$N$G$3$N4X?t$r8F$s$@B&$G(B | |
396 * free $B$7$J$1$l$P$J$i$J$$(B | |
397 * $BJQ49%F%-%9%H$,$J$$;~$d%(%i!<$N>l9g$K$O(B -1$B!"$=$&$G$J$1$l$P(B 0 $B$,(B | |
398 * $B4X?t$NCM$H$7$FJV$5$l$k(B | |
399 */ | |
400 extern int ICGetStatusString( | |
401 #if NeedFunctionPrototypes | |
402 Widget /* object */, | |
403 Atom * /* encoding */, | |
404 int * /* format */, | |
405 int * /* length */, | |
406 XtPointer * /* string */, | |
407 int * /* nchars */ | |
408 #endif | |
409 ); | |
410 | |
411 #endif /* _InputConv_h */ |