17
17
may be used to endorse or promote products derived from this software
18
18
without specific prior written permission.
20
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
21
21
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
22
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
24
24
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
25
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26
26
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
85
86
void init_convdisp();
86
87
void init_modifier_keys();
92
void hex_dump(unsigned char *buf, int len);
88
#if HAVE_XFT_UTF8_STRING
89
void init_default_xftfont();
90
void update_default_xftfont();
92
void reload_uim(int x);
93
void check_candwin_pos_type();
95
96
// for command line option
114
117
#define COMMIT_RAW 1
115
118
#define UPDATE_MODE 2
117
// do convert from original event, and released within the same function
120
// do convert from original event into uim event
123
keyState(class XimIC *);
122
125
void check_key(class keyEventX *);
126
bool check_compose();
126
133
bool is_push(); // for distinguish from release
129
int revise_mod(int uim_mod);
164
172
void update_prop_list(const char *str);
165
173
void update_prop_label(const char *str);
166
174
bool hasActiveCandwin();
175
bool isCaretStateShown();
167
176
const char *get_engine_name();
168
177
const char *get_locale_name();
169
178
void changeContext(const char *engine);
179
void customContext(const char *custom, const char *val);
180
void createUimContext(const char *engine);
181
void configuration_changed();
182
void switch_app_global_im(const char *name);
183
void switch_system_global_im(const char *name);
171
static void commit_cb(void *, const char *);
172
static void clear_cb(void *);
173
static void pushback_cb(void *, int attr, const char *str);
174
static void update_cb(void *);
185
static void commit_cb(void *ptr, const char *str);
186
static void clear_cb(void *ptr);
187
static void pushback_cb(void *ptr, int attr, const char *str);
188
static void update_cb(void *ptr);
175
189
static void candidate_activate_cb(void *ptr, int nr, int index);
176
190
static void candidate_select_cb(void *ptr, int index);
177
191
static void candidate_shift_page_cb(void *ptr, int direction);
178
192
static void candidate_deactivate_cb(void *ptr);
179
193
static void update_prop_list_cb(void *ptr, const char *str);
180
194
static void update_prop_label_cb(void *ptr, const char *str);
195
static void configuration_changed_cb(void *ptr);
196
static void switch_app_global_im_cb(void *ptr, const char *name);
197
static void switch_system_global_im_cb(void *ptr, const char *name);
181
198
static InputContext *focusedContext();
182
199
static void deletefocusedContext();
184
201
void commit_string(char *);
202
void clear_pe_stat();
203
void review_im(const char *engine);
204
char *get_caret_state_label_from_prop_list(const char *str);
186
207
XimServer *mServer;
188
209
Convdisp *mConvdisp;
191
uim_context createUimContext(const char *engine);
192
static InputContext *mFocusedContext;
193
211
bool mCandwinActive;
194
212
int mDisplayLimit;
198
216
std::vector<const char *> active_candidates;
199
217
char *mEngineName;
200
218
char *mLocaleName;
219
bool mCaretStateShown;
221
static InputContext *mFocusedContext;
205
virtual char *uStringToCtext(uString *us, const char *encoding) = 0;
227
virtual char *uStringToCtext(uString *us) = 0;
228
virtual char *utf8_to_native_str(char *str) = 0;
206
229
virtual bool supportOverTheSpot();
207
virtual void set_localename_from_im_lang(const char *im_lang) = 0;
212
Locale *createLocale(const char *im_lang);
232
Locale *createLocale(const char *encoding);
213
233
const char *compose_localenames_from_im_lang(const char *im_lang);
214
234
bool is_locale_included(const char *locales, const char *locale);
215
235
// Sring returned by get_first_locale() is allocated with strdup().
216
char *get_first_locale(const char *locales);
236
char *get_prefered_locale(const char *locales);
217
237
const char *find_localename_from_encoding(const char *encoding);
218
char *utf8_to_native_str(char *utf8, const char *encoding);
219
238
int utf8_mbtowc(uchar *wc, const unsigned char *src, int src_len);
220
239
int utf8_wctomb(unsigned char *dest, uchar wc); // dest must have size 6
240
int mb_string_to_utf8(char *utf8, const char *str, int to_len, const char *enc);
222
242
class XimServer {
224
XimServer(Locale *lc, const char *name, const char *lang);
244
XimServer(const char *name, const char *lang);
226
246
InputContext *createContext(XimIC *, const char *engine);
227
247
void deleteContext(InputContext *);
230
250
void setupNewConnection(XClientMessageEvent *ev);
231
251
char *uStringToCtext(uString *js, const char *encoding);
232
252
void strToUstring(uString *d, const char *s);
233
struct input_style *getInputStyles();
234
253
const char *getIMName();
235
254
const char *getIMLang();
236
255
void set_im(const char *name);
237
256
void changeContext(const char *engine);
257
void customContext(const char *custom, const char *val);
258
void reloadConfigs();
259
std::list<InputContext *> ic_list;
240
261
static XimServer *findServer(Window w);
241
262
static Display *gDpy;
242
263
static std::map<Window, XimServer *> gServerMap;
264
static CandWinPosType gCandWinPosType;
245
266
Window mSelectionWin;
246
267
Atom mServerAtom;
248
269
const char *mIMLang;
249
std::list<InputContext *> ic_list;
277
extern std::list<UIMInfo> uim_info;
259
279
const char *get_im_lang_from_engine(const char *engine);