]> icculus.org git repositories - divverent/darkplaces.git/blob - uim_dp.h
UIM_Init
[divverent/darkplaces.git] / uim_dp.h
1 /*
2   This contains parts of the original header and thus contains its copyright notice:
3
4   Copyright (c) 2003-2009 uim Project http://code.google.com/p/uim/
5
6   All rights reserved.
7
8   Redistribution and use in source and binary forms, with or without
9   modification, are permitted provided that the following conditions
10   are met:
11
12   1. Redistributions of source code must retain the above copyright
13      notice, this list of conditions and the following disclaimer.
14   2. Redistributions in binary form must reproduce the above copyright
15      notice, this list of conditions and the following disclaimer in the
16      documentation and/or other materials provided with the distribution.
17   3. Neither the name of authors nor the names of its contributors
18      may be used to endorse or promote products derived from this software
19      without specific prior written permission.
20
21   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
22   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24   ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
25   FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27   OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30   OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31   SUCH DAMAGE.
32
33 */
34 #ifndef UIM_DP__H__
35 #define UIM_DP_H__
36
37 typedef enum
38 {
39         uim_false = 0,
40         uim_true = 1
41 } uim_bool;
42
43 typedef struct uim_context_   *uim_context;
44 typedef struct uim_candidate_ *uim_candidate;
45
46 // from the original uim.h:
47 enum UKey {
48   UKey_0 = 48,
49   UKey_1 = 49,
50   UKey_2 = 50,
51   UKey_3 = 51,
52   UKey_4 = 52,
53   UKey_5 = 53,
54   UKey_6 = 54,
55   UKey_7 = 55,
56   UKey_8 = 56,
57   UKey_9 = 57,
58   UKey_Yen = 165,
59
60   UKey_Escape = 256,
61   UKey_Tab,
62   UKey_Backspace,
63   UKey_Delete,
64   UKey_Insert,
65   UKey_Return,
66   UKey_Left,
67   UKey_Up ,
68   UKey_Right ,
69   UKey_Down ,
70   UKey_Prior , /* page up */
71   UKey_Next , /* page down */
72   UKey_Home,
73   UKey_End,
74
75   UKey_Multi_key, /* multi-key character compose */
76   UKey_Codeinput,
77   UKey_SingleCandidate,
78   UKey_MultipleCandidate,
79   UKey_PreviousCandidate,
80   UKey_Mode_switch, /* charcter set switch */
81
82   /* Japanese keyboard */
83   UKey_Kanji, /* kanji, kanji convert */
84   UKey_Muhenkan, /* cancel conversion */
85   UKey_Henkan_Mode, /* start/stop conversion */
86   UKey_Henkan = UKey_Henkan_Mode, /* alias for Henkan_Mode */
87   UKey_Romaji,
88   UKey_Hiragana,
89   UKey_Katakana,
90   UKey_Hiragana_Katakana, /* hiragana/katakana toggle */
91   UKey_Zenkaku,
92   UKey_Hankaku,
93   UKey_Zenkaku_Hankaku, /* zenkaku/hankaku toggle */
94   UKey_Touroku,
95   UKey_Massyo,
96   UKey_Kana_Lock,
97   UKey_Kana_Shift,
98   UKey_Eisu_Shift, /* alphanumeric shift */
99   UKey_Eisu_toggle, /* alphanumeric toggle */
100
101   /* Korean keyboard */
102   UKey_Hangul,
103   UKey_Hangul_Start,
104   UKey_Hangul_End,
105   UKey_Hangul_Hanja,
106   UKey_Hangul_Jamo,
107   UKey_Hangul_Romaja,
108   UKey_Hangul_Codeinput,
109   UKey_Hangul_Jeonja,
110   UKey_Hangul_Banja,
111   UKey_Hangul_PreHanja,
112   UKey_Hangul_PostHanja,
113   UKey_Hangul_SingleCandidate,
114   UKey_Hangul_MultipleCandidate,
115   UKey_Hangul_PreviousCandidate,
116   UKey_Hangul_Special,
117
118   /* function keys */
119   UKey_F1,
120   UKey_F2,
121   UKey_F3,
122   UKey_F4,
123   UKey_F5,
124   UKey_F6,
125   UKey_F7,
126   UKey_F8,
127   UKey_F9,
128   UKey_F10,
129   UKey_F11,
130   UKey_F12,
131   UKey_F13,
132   UKey_F14,
133   UKey_F15,
134   UKey_F16,
135   UKey_F17,
136   UKey_F18,
137   UKey_F19,
138   UKey_F20,
139   UKey_F21,
140   UKey_F22,
141   UKey_F23,
142   UKey_F24,
143   UKey_F25,
144   UKey_F26,
145   UKey_F27,
146   UKey_F28,
147   UKey_F29,
148   UKey_F30,
149   UKey_F31,
150   UKey_F32,
151   UKey_F33,
152   UKey_F34,
153   UKey_F35, /* X, Gtk and Qt supports up to F35 */
154
155   /* dead keys */
156   UKey_Dead_Grave,
157   UKey_Dead_Acute,
158   UKey_Dead_Circumflex,
159   UKey_Dead_Tilde,
160   UKey_Dead_Macron,
161   UKey_Dead_Breve,
162   UKey_Dead_Abovedot,
163   UKey_Dead_Diaeresis,
164   UKey_Dead_Abovering,
165   UKey_Dead_Doubleacute,
166   UKey_Dead_Caron,
167   UKey_Dead_Cedilla,
168   UKey_Dead_Ogonek,
169   UKey_Dead_Iota,
170   UKey_Dead_VoicedSound,
171   UKey_Dead_SemivoicedSound,
172   UKey_Dead_Belowdot,
173   UKey_Dead_Hook,
174   UKey_Dead_Horn,
175
176   /* Japanese Kana keys */
177   UKey_Kana_Fullstop,
178   UKey_Kana_OpeningBracket,
179   UKey_Kana_ClosingBracket,
180   UKey_Kana_Comma,
181   UKey_Kana_Conjunctive,
182   UKey_Kana_WO,
183   UKey_Kana_a,
184   UKey_Kana_i,
185   UKey_Kana_u,
186   UKey_Kana_e,
187   UKey_Kana_o,
188   UKey_Kana_ya,
189   UKey_Kana_yu,
190   UKey_Kana_yo,
191   UKey_Kana_tsu,
192   UKey_Kana_ProlongedSound,
193   UKey_Kana_A,
194   UKey_Kana_I,
195   UKey_Kana_U,
196   UKey_Kana_E,
197   UKey_Kana_O,
198   UKey_Kana_KA,
199   UKey_Kana_KI,
200   UKey_Kana_KU,
201   UKey_Kana_KE,
202   UKey_Kana_KO,
203   UKey_Kana_SA,
204   UKey_Kana_SHI,
205   UKey_Kana_SU,
206   UKey_Kana_SE,
207   UKey_Kana_SO,
208   UKey_Kana_TA,
209   UKey_Kana_CHI,
210   UKey_Kana_TSU,
211   UKey_Kana_TE,
212   UKey_Kana_TO,
213   UKey_Kana_NA,
214   UKey_Kana_NI,
215   UKey_Kana_NU,
216   UKey_Kana_NE,
217   UKey_Kana_NO,
218   UKey_Kana_HA,
219   UKey_Kana_HI,
220   UKey_Kana_FU,
221   UKey_Kana_HE,
222   UKey_Kana_HO,
223   UKey_Kana_MA,
224   UKey_Kana_MI,
225   UKey_Kana_MU,
226   UKey_Kana_ME,
227   UKey_Kana_MO,
228   UKey_Kana_YA,
229   UKey_Kana_YU,
230   UKey_Kana_YO,
231   UKey_Kana_RA,
232   UKey_Kana_RI,
233   UKey_Kana_RU,
234   UKey_Kana_RE,
235   UKey_Kana_RO,
236   UKey_Kana_WA,
237   UKey_Kana_N,
238   UKey_Kana_VoicedSound,
239   UKey_Kana_SemivoicedSound,
240
241   /* non-standard platform specific keys (e.g. Zaurus PDA) */
242   UKey_Private1,
243   UKey_Private2,
244   UKey_Private3,
245   UKey_Private4,
246   UKey_Private5,
247   UKey_Private6,
248   UKey_Private7,
249   UKey_Private8,
250   UKey_Private9,
251   UKey_Private10,
252   UKey_Private11,
253   UKey_Private12,
254   UKey_Private13,
255   UKey_Private14,
256   UKey_Private15,
257   UKey_Private16,
258   UKey_Private17,
259   UKey_Private18,
260   UKey_Private19,
261   UKey_Private20,
262   UKey_Private21,
263   UKey_Private22,
264   UKey_Private23,
265   UKey_Private24,
266   UKey_Private25,
267   UKey_Private26,
268   UKey_Private27,
269   UKey_Private28,
270   UKey_Private29,
271   UKey_Private30,
272
273   /* modifier keys */
274   UKey_Shift = 0x8000,
275   UKey_Control,
276   UKey_Alt,
277   UKey_Meta,
278   UKey_Super,
279   UKey_Hyper,
280
281   /* lock modifier keys: unstable */
282   UKey_Caps_Lock = 0x9000,
283   UKey_Num_Lock,
284   UKey_Scroll_Lock,
285
286 #if 1
287   /* Deprecated. Please replace with UKey_Shift and so on. */
288   UKey_Shift_key = UKey_Shift,
289   UKey_Control_key = UKey_Control,
290   UKey_Alt_key = UKey_Alt,
291   UKey_Meta_key = UKey_Meta,
292   UKey_Super_key = UKey_Super,
293   UKey_Hyper_key = UKey_Hyper,
294 #endif
295
296   UKey_Other = 0x10000
297 };
298
299 enum UKeyModifier {
300   UMod_Shift = 1,
301   UMod_Control = 2,
302   UMod_Alt = 4,
303   UMod_Meta = 8,
304   UMod_Pseudo0 = 16,
305   UMod_Pseudo1 = 32,
306   UMod_Super = 64,
307   UMod_Hyper = 128
308 };
309
310 enum UPreeditAttr {
311   UPreeditAttr_None = 0,
312   UPreeditAttr_UnderLine = 1,
313   UPreeditAttr_Reverse = 2,
314   UPreeditAttr_Cursor = 4,
315   UPreeditAttr_Separator = 8
316 };
317
318 /* Cursor of clipboard text is always positioned at end. */
319 enum UTextArea {
320   UTextArea_Unspecified = 0,
321   UTextArea_Primary     = 1,  /* primary text area which IM commits to */
322   UTextArea_Selection   = 2,  /* user-selected region of primary text area */
323   UTextArea_Clipboard   = 4   /* clipboard text */
324 };
325
326 enum UTextOrigin {
327   UTextOrigin_Unspecified = 0,
328   UTextOrigin_Cursor      = 1,  /* current position of the cursor */
329   UTextOrigin_Beginning   = 2,  /* beginning of the text */
330   UTextOrigin_End         = 3   /* end of the text */
331 };
332
333 enum UTextExtent {
334   UTextExtent_Unspecified = -1,  /* invalid */
335
336   /* logical extents */
337   UTextExtent_Full      = -2,   /* beginning or end of the whole text */
338   UTextExtent_Paragraph = -3,   /* the paragraph which the origin is included */
339   UTextExtent_Sentence  = -5,   /* the sentence which the origin is included */
340   UTextExtent_Word      = -9,   /* the word which the origin is included */
341   UTextExtent_CharFrags = -17,  /* character fragments around the origin */
342
343   /* physical extents */
344   UTextExtent_DispRect  = -33,  /* the text region displayed in the widget */
345   UTextExtent_DispLine  = -65,  /* displayed line (eol: linebreak) */
346   UTextExtent_Line      = -129  /* real line      (eol: newline char) */
347 };
348
349 #endif // UIM_DPH_H__