2 This contains parts of the original header and thus contains its copyright notice:
4 Copyright (c) 2003-2009 uim Project http://code.google.com/p/uim/
8 Redistribution and use in source and binary forms, with or without
9 modification, are permitted provided that the following conditions
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.
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
45 typedef struct uim_context_ *uim_context;
46 typedef struct uim_candidate_ *uim_candidate;
49 void UIM_Shutdown(void);
50 qboolean UIM_Available(void);
51 qboolean UIM_Direct(void);
52 void UIM_SetCursor(int pos);
53 qboolean UIM_Key(int key, Uchar unicode);
54 qboolean UIM_KeyUp(int key, Uchar unicode);
55 qboolean UIM_KeyDown(int key, Uchar unicode);
57 // exiting functions have a qUIM_ prefix
58 typedef void (*qUIM_SetCursor)(size_t pos);
60 qboolean UIM_EnterBuffer(char *buffer, size_t bufsize, size_t pos, qUIM_SetCursor setcursor_cb);
61 void UIM_CancelBuffer(void);
63 // from the original uim.h:
87 UKey_Prior , /* page up */
88 UKey_Next , /* page down */
92 UKey_Multi_key, /* multi-key character compose */
95 UKey_MultipleCandidate,
96 UKey_PreviousCandidate,
97 UKey_Mode_switch, /* charcter set switch */
99 /* Japanese keyboard */
100 UKey_Kanji, /* kanji, kanji convert */
101 UKey_Muhenkan, /* cancel conversion */
102 UKey_Henkan_Mode, /* start/stop conversion */
103 UKey_Henkan = UKey_Henkan_Mode, /* alias for Henkan_Mode */
107 UKey_Hiragana_Katakana, /* hiragana/katakana toggle */
110 UKey_Zenkaku_Hankaku, /* zenkaku/hankaku toggle */
115 UKey_Eisu_Shift, /* alphanumeric shift */
116 UKey_Eisu_toggle, /* alphanumeric toggle */
118 /* Korean keyboard */
125 UKey_Hangul_Codeinput,
128 UKey_Hangul_PreHanja,
129 UKey_Hangul_PostHanja,
130 UKey_Hangul_SingleCandidate,
131 UKey_Hangul_MultipleCandidate,
132 UKey_Hangul_PreviousCandidate,
170 UKey_F35, /* X, Gtk and Qt supports up to F35 */
175 UKey_Dead_Circumflex,
182 UKey_Dead_Doubleacute,
187 UKey_Dead_VoicedSound,
188 UKey_Dead_SemivoicedSound,
193 /* Japanese Kana keys */
195 UKey_Kana_OpeningBracket,
196 UKey_Kana_ClosingBracket,
198 UKey_Kana_Conjunctive,
209 UKey_Kana_ProlongedSound,
255 UKey_Kana_VoicedSound,
256 UKey_Kana_SemivoicedSound,
258 /* non-standard platform specific keys (e.g. Zaurus PDA) */
298 /* lock modifier keys: unstable */
299 UKey_Caps_Lock = 0x9000,
318 UPreeditAttr_None = 0,
319 UPreeditAttr_UnderLine = 1,
320 UPreeditAttr_Reverse = 2,
321 UPreeditAttr_Cursor = 4,
322 UPreeditAttr_Separator = 8
325 /* Cursor of clipboard text is always positioned at end. */
327 UTextArea_Unspecified = 0,
328 UTextArea_Primary = 1, /* primary text area which IM commits to */
329 UTextArea_Selection = 2, /* user-selected region of primary text area */
330 UTextArea_Clipboard = 4 /* clipboard text */
334 UTextOrigin_Unspecified = 0,
335 UTextOrigin_Cursor = 1, /* current position of the cursor */
336 UTextOrigin_Beginning = 2, /* beginning of the text */
337 UTextOrigin_End = 3 /* end of the text */
341 UTextExtent_Unspecified = -1, /* invalid */
343 /* logical extents */
344 UTextExtent_Full = -2, /* beginning or end of the whole text */
345 UTextExtent_Paragraph = -3, /* the paragraph which the origin is included */
346 UTextExtent_Sentence = -5, /* the sentence which the origin is included */
347 UTextExtent_Word = -9, /* the word which the origin is included */
348 UTextExtent_CharFrags = -17, /* character fragments around the origin */
350 /* physical extents */
351 UTextExtent_DispRect = -33, /* the text region displayed in the widget */
352 UTextExtent_DispLine = -65, /* displayed line (eol: linebreak) */
353 UTextExtent_Line = -129 /* real line (eol: newline char) */
356 #endif // UIM_DPH_H__