PageRenderTime 53ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/nx-3.5.0/nx-X11/lib/X11/XimintP.h

#
C Header | 293 lines | 182 code | 33 blank | 78 comment | 0 complexity | a551a029036662f82a2525c5264e5119 MD5 | raw file
Possible License(s): BSD-3-Clause, GPL-2.0, LGPL-2.0
  1. /* $Xorg: XimintP.h,v 1.3 2000/08/17 19:45:05 cpqbld Exp $ */
  2. /******************************************************************
  3. Copyright 1991, 1992 by Sun Microsystems, Inc.
  4. Copyright 1992, 1993, 1994 by FUJITSU LIMITED
  5. Copyright 1993, 1994 by Sony Corporation
  6. Permission to use, copy, modify, distribute, and sell this software and
  7. its documentation for any purpose is hereby granted without fee, provided
  8. that the above copyright notice appear in all copies and that both that
  9. copyright notice and this permission notice appear in supporting
  10. documentation, and that the name of Sun Microsystems, Inc., FUJITSU
  11. LIMITED and Sony Corporation not be used in advertising or publicity
  12. pertaining to distribution of the software without specific, written
  13. prior permission. Sun Microsystems, Inc., FUJITSU LIMITED and Sony
  14. Corporation makes no representations about the suitability of this
  15. software for any purpose. It is provided "as is" without express or
  16. implied warranty.
  17. Sun Microsystems Inc. ,FUJITSU LIMITED AND SONY CORPORATION DISCLAIMS ALL
  18. WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
  19. OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL Sun Microsystems, Inc.,
  20. FUJITSU LIMITED, SONY CORPORATIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  21. CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  22. USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  23. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  24. PERFORMANCE OF THIS SOFTWARE.
  25. Author: Hideki Hiura (hhiura@Sun.COM) Sun Microsystems, Inc.
  26. Takashi Fujiwara FUJITSU LIMITED
  27. fujiwara@a80.tech.yk.fujitsu.co.jp
  28. Makoto Wakamatsu Sony Corporation
  29. makoto@sm.sony.co.jp
  30. Hiroyuki Miyamoto Digital Equipment Corporation
  31. miyamoto@jrd.dec.com
  32. ******************************************************************/
  33. /* $XFree86: xc/lib/X11/XimintP.h,v 1.7 2001/01/17 19:41:49 dawes Exp $ */
  34. #ifndef _XIMINTP_H
  35. #define _XIMINTP_H
  36. #include "XimProto.h"
  37. #include "XlcPublic.h"
  38. /*
  39. * for protocol layer callback function
  40. */
  41. typedef Bool (*XimProtoIntrProc)(
  42. Xim, INT16, XPointer, XPointer
  43. );
  44. typedef struct _XimProtoIntrRec {
  45. XimProtoIntrProc func;
  46. CARD16 major_code;
  47. CARD16 minor_code;
  48. XPointer call_data;
  49. struct _XimProtoIntrRec *next;
  50. } XimProtoIntrRec;
  51. /*
  52. * for transport layer methods
  53. */
  54. typedef Bool (*XimTransConnectProc)(
  55. Xim
  56. );
  57. typedef Bool (*XimTransShutdownProc)(
  58. Xim
  59. );
  60. typedef Bool (*XimTransWriteProc)(
  61. Xim, INT16, XPointer
  62. );
  63. typedef Bool (*XimTransReadProc)(
  64. Xim, XPointer, int, int *
  65. );
  66. typedef void (*XimTransFlushProc)(
  67. Xim
  68. );
  69. typedef Bool (*XimTransRegDispatcher)(
  70. Xim, Bool (*)(Xim, INT16, XPointer, XPointer), XPointer
  71. );
  72. typedef Bool (*XimTransCallDispatcher)(
  73. Xim, INT16, XPointer
  74. );
  75. /*
  76. * private part of IM
  77. */
  78. typedef struct _XimProtoPrivateRec {
  79. /* The first fields are identical with XimCommonPrivateRec. */
  80. XlcConv ctom_conv;
  81. XlcConv ctow_conv;
  82. XlcConv ctoutf8_conv;
  83. XlcConv cstomb_conv;
  84. XlcConv cstowc_conv;
  85. XlcConv cstoutf8_conv;
  86. XlcConv ucstoc_conv;
  87. XlcConv ucstoutf8_conv;
  88. Window im_window;
  89. XIMID imid;
  90. CARD16 unused;
  91. XIMStyles *default_styles;
  92. CARD32 *im_onkeylist;
  93. CARD32 *im_offkeylist;
  94. BITMASK32 flag;
  95. BITMASK32 registed_filter_event;
  96. EVENTMASK forward_event_mask;
  97. EVENTMASK synchronous_event_mask;
  98. XimProtoIntrRec *intrproto;
  99. XIMResourceList im_inner_resources;
  100. unsigned int im_num_inner_resources;
  101. XIMResourceList ic_inner_resources;
  102. unsigned int ic_num_inner_resources;
  103. char *hold_data;
  104. int hold_data_len;
  105. char *locale_name;
  106. CARD16 protocol_major_version;
  107. CARD16 protocol_minor_version;
  108. XrmQuark *saved_imvalues;
  109. int num_saved_imvalues;
  110. /*
  111. * transport specific
  112. */
  113. XimTransConnectProc connect;
  114. XimTransShutdownProc shutdown;
  115. XimTransWriteProc write;
  116. XimTransReadProc read;
  117. XimTransFlushProc flush;
  118. XimTransRegDispatcher register_dispatcher;
  119. XimTransCallDispatcher call_dispatcher;
  120. XPointer spec;
  121. } XimProtoPrivateRec;
  122. /*
  123. * bit mask for the flag of XIMPrivateRec
  124. */
  125. #define SERVER_CONNECTED (1L)
  126. #define DYNAMIC_EVENT_FLOW (1L << 1)
  127. #define USE_AUTHORIZATION_FUNC (1L << 2)
  128. #ifdef XIM_CONNECTABLE
  129. #define DELAYBINDABLE (1L << 3)
  130. #define RECONNECTABLE (1L << 4)
  131. #endif /* XIM_CONNECTABLE */
  132. /*
  133. * macro for the flag of XIMPrivateRec
  134. */
  135. #define IS_SERVER_CONNECTED(im) \
  136. ((((Xim)im))->private.proto.flag & SERVER_CONNECTED)
  137. #define MARK_SERVER_CONNECTED(im) \
  138. ((((Xim)im))->private.proto.flag |= SERVER_CONNECTED)
  139. #define UNMARK_SERVER_CONNECTED(im) \
  140. ((((Xim)im))->private.proto.flag &= ~SERVER_CONNECTED)
  141. #define IS_DYNAMIC_EVENT_FLOW(im) \
  142. (((Xim)im)->private.proto.flag & DYNAMIC_EVENT_FLOW)
  143. #define MARK_DYNAMIC_EVENT_FLOW(im) \
  144. (((Xim)im)->private.proto.flag |= DYNAMIC_EVENT_FLOW)
  145. #define IS_USE_AUTHORIZATION_FUNC(im) \
  146. (((Xim)im)->private.proto.flag & USE_AUTHORIZATION_FUNC)
  147. #define MARK_USE_AUTHORIZATION_FUNC(im) \
  148. (((Xim)im)->private.proto.flag |= USE_AUTHORIZATION_FUNC)
  149. #ifdef XIM_CONNECTABLE
  150. #define IS_DELAYBINDABLE(im) \
  151. (((Xim)im)->private.proto.flag & DELAYBINDABLE)
  152. #define MARK_DELAYBINDABLE(im) \
  153. (((Xim)im)->private.proto.flag |= DELAYBINDABLE)
  154. #define IS_RECONNECTABLE(im) \
  155. (((Xim)im)->private.proto.flag & RECONNECTABLE)
  156. #define MARK_RECONNECTABLE(im) \
  157. (((Xim)im)->private.proto.flag |= RECONNECTABLE)
  158. #define IS_CONNECTABLE(im) \
  159. (((Xim)im)->private.proto.flag & (DELAYBINDABLE|RECONNECTABLE))
  160. #define UNMAKE_CONNECTABLE(im) \
  161. (((Xim)im)->private.proto.flag &= ~(DELAYBINDABLE|RECONNECTABLE))
  162. #endif /* XIM_CONNECTABLE */
  163. /*
  164. * bit mask for the register_filter_event of XIMPrivateRec/XICPrivateRec
  165. */
  166. #define KEYPRESS_MASK (1L)
  167. #define KEYRELEASE_MASK (1L << 1)
  168. #define DESTROYNOTIFY_MASK (1L << 2)
  169. typedef struct _XimCommitInfoRec {
  170. struct _XimCommitInfoRec *next;
  171. char *string;
  172. int string_len;
  173. KeySym *keysym;
  174. int keysym_len;
  175. } XimCommitInfoRec, *XimCommitInfo;
  176. typedef struct _XimPendingCallback {
  177. int major_opcode;
  178. Xim im;
  179. Xic ic;
  180. char *proto;
  181. int proto_len;
  182. struct _XimPendingCallback *next;
  183. } XimPendingCallbackRec, *XimPendingCallback;
  184. /*
  185. * private part of IC
  186. */
  187. typedef struct _XicProtoPrivateRec {
  188. XICID icid; /* ICID */
  189. CARD16 dmy;
  190. BITMASK32 flag; /* Input Mode */
  191. BITMASK32 registed_filter_event; /* registed filter mask */
  192. EVENTMASK forward_event_mask; /* forward event mask */
  193. EVENTMASK synchronous_event_mask;/* sync event mask */
  194. EVENTMASK filter_event_mask; /* negrect event mask */
  195. EVENTMASK intercept_event_mask; /* deselect event mask */
  196. EVENTMASK select_event_mask; /* select event mask */
  197. char *preedit_font; /* Base font name list */
  198. int preedit_font_length; /* length of base font name */
  199. char *status_font; /* Base font name list */
  200. int status_font_length; /* length of base font name */
  201. XimCommitInfo commit_info;
  202. XIMResourceList ic_resources;
  203. unsigned int ic_num_resources;
  204. XIMResourceList ic_inner_resources;
  205. unsigned int ic_num_inner_resources;
  206. XrmQuark *saved_icvalues;
  207. int num_saved_icvalues;
  208. XimPendingCallback pend_cb_que;
  209. Bool waitCallback;
  210. } XicProtoPrivateRec ;
  211. /*
  212. * bit mask for the flag of XICPrivateRec
  213. */
  214. #define IC_CONNECTED (1L)
  215. #define FABLICATED (1L << 1)
  216. #define NEED_SYNC_REPLY (1L << 2)
  217. /*
  218. * macro for the flag of XICPrivateRec
  219. */
  220. #define IS_IC_CONNECTED(ic) \
  221. (((Xic)ic)->private.proto.flag & IC_CONNECTED)
  222. #define MARK_IC_CONNECTED(ic) \
  223. (((Xic)ic)->private.proto.flag |= IC_CONNECTED)
  224. #define UNMARK_IC_CONNECTED(ic) \
  225. (((Xic)ic)->private.proto.flag &= ~IC_CONNECTED)
  226. #define IS_FABLICATED(ic) \
  227. (((Xic)ic)->private.proto.flag & FABLICATED)
  228. #define MARK_FABLICATED(ic) \
  229. (((Xic)ic)->private.proto.flag |= FABLICATED)
  230. #define UNMARK_FABLICATED(ic) \
  231. (((Xic)ic)->private.proto.flag &= ~FABLICATED)
  232. #define IS_NEED_SYNC_REPLY(ic) \
  233. (((Xic)ic)->private.proto.flag & NEED_SYNC_REPLY)
  234. #define MARK_NEED_SYNC_REPLY(ic) \
  235. (((Xic)ic)->private.proto.flag |= NEED_SYNC_REPLY)
  236. #define UNMARK_NEED_SYNC_REPLY(ic) \
  237. (((Xic)ic)->private.proto.flag &= ~NEED_SYNC_REPLY)
  238. /*
  239. * macro for the filter_event_mask of XICPrivateRec
  240. */
  241. #define IS_NEGLECT_EVENT(ic, mask) \
  242. (((Xic)ic)->private.proto.filter_event_mask & (mask))
  243. /*
  244. * macro for the forward_event_mask of XICPrivateRec
  245. */
  246. #define IS_FORWARD_EVENT(ic, mask) \
  247. (((Xic)ic)->private.proto.forward_event_mask & (mask))
  248. /*
  249. * macro for the synchronous_event_mask of XICPrivateRec
  250. */
  251. #define IS_SYNCHRONOUS_EVENT(ic, mask) \
  252. ((((Xic)ic)->private.proto.synchronous_event_mask & (mask)) ? True: False)
  253. #define XIM_MAXIMNAMELEN 64
  254. #define XIM_MAXLCNAMELEN 64
  255. #endif /* _XIMINTP_H */