1/* 2 * Author: William Chia-Wei Cheng (bill.cheng@acm.org) 3 * 4 * Copyright (C) 2001-2009, William Chia-Wei Cheng. 5 * 6 * This file may be distributed under the terms of the Q Public License 7 * as defined by Trolltech AS of Norway and appearing in the file 8 * LICENSE.QPL included in the packaging of this file. 9 * 10 * THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING 11 * THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 12 * PURPOSE. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, 13 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING 14 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 15 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 16 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 * 18 * @(#)$Header: /mm2/home/cvs/bc-src/tgif/inmethod.e,v 1.7 2011/05/16 16:21:58 william Exp $ 19 */ 20 21#ifndef _INMETHOD_E_ 22#define _INMETHOD_E_ 23 24typedef char *(Tgim_stringprep_convert_Func)ARGS_DECL((const char *str, 25 const char *to_codeset, const char *from_codeset)); 26 27extern int gnInputMethod; /* one of TGIM_* */ 28extern int gnOverTheSpot; 29 30extern int cmdLineHasInputMethod; 31extern int cmdLineDoubleByteInputMethod; 32extern char cmdLineInputMethod[]; 33 34#ifdef _INCLUDE_FROM_INMETHOD_C_ 35#undef extern 36#define extern 37#endif /*_INCLUDE_FROM_INMETHOD_C_*/ 38 39extern int Tgim_has_stringprep_convert ARGS_DECL((void)); 40extern char *Tgim_stringprep_convert ARGS_DECL((const char *str, 41 const char *to_codeset, 42 const char *from_codeset)); 43 44extern void CleanUpInputMethods ARGS_DECL((void)); 45extern int InitInputMethods ARGS_DECL((void)); 46 47extern int ResetInputMethod ARGS_DECL((void)); 48extern int InputMethodTypeMatched ARGS_DECL((int DoubleByte)); 49 50extern int tgIMFocusIn ARGS_DECL((Display *dpy, Window win)); 51extern int tgIMFocusOut ARGS_DECL((Display *dpy, Window win)); 52extern int tgIMTranslateKeyEvent ARGS_DECL((Display *dpy, 53 Window win, 54 XKeyEvent *key_ev, 55 char *buf)); 56extern int tgIMConvertProperty ARGS_DECL((Display *dpy, 57 Window win, 58 XPropertyEvent *prop_ev, 59 char **ppsz_buf)); 60extern int tgIMExpectClientMessage ARGS_DECL((Display *dpy, 61 Window win)); 62extern int tgIMHandleClientMessage ARGS_DECL((Display *dpy, 63 Window win, 64 XClientMessageEvent *cm_ev, 65 XKeyEvent *key_ev, 66 char *buf)); 67extern int tgIMActiveOnCntrlSpace ARGS_DECL((Display *dpy, 68 Window win)); 69extern int tgIMHandleCntrlSpace ARGS_DECL((Display *dpy, 70 Window win)); 71extern int tgIMDeactiveOnCreateText ARGS_DECL((Display *dpy, 72 Window win)); 73extern int tgIMHandleCreateText ARGS_DECL((Display *dpy, 74 Window win)); 75extern int tgIMTellCursorPosition ARGS_DECL((Display *dpy, 76 Window win, 77 int cur_x, 78 int cur_y)); 79extern int tgIMExpectNextEvent ARGS_DECL((Display *dpy, 80 Window win)); 81extern int tgIMHandleNextEvent ARGS_DECL((Display *dpy, 82 Window win, 83 XEvent *ev)); 84extern int tgIMHandleNewCurText ARGS_DECL((Display *dpy, 85 Window win)); 86extern int tgIMExpectLookupString ARGS_DECL((Display *dpy, 87 Window win)); 88extern int tgIMHandleLookupString ARGS_DECL((Display *dpy, 89 Window win, 90 XKeyEvent *key_ev, 91 char *psz_buf, 92 int buf_size, 93 KeySym *p_key_sym, 94 int *pn_has_ch)); 95 96#ifdef _INCLUDE_FROM_INMETHOD_C_ 97#undef extern 98#ifndef _NO_RECURSIVE_EXTERN 99#define extern extern 100#endif /* ~_NO_RECURSIVE_EXTERN */ 101#endif /*_INCLUDE_FROM_INMETHOD_C_*/ 102 103#endif /*_INMETHOD_E_*/ 104