Back to index

im-sdk  12.3.91
XIMProto.h
Go to the documentation of this file.
00001 /* $XimpImplementGroup: XIMProto.h, v 1.1 94/05/31 21:16:00 $ */
00002 /* $XConsortium: XIMProto.h,v 1.7 92/10/19 19:23:05 rws Exp $ */
00003 /******************************************************************
00004 
00005               Copyright 1991, 1992 by FUJITSU LIMITED
00006               Copyright 1991, 1992 by Sun Microsystems, Inc.
00007 
00008 Permission to use, copy, modify, distribute, and sell this software
00009 and its documentation for any purpose is hereby granted without fee,
00010 provided that the above copyright notice appear in all copies and
00011 that both that copyright notice and this permission notice appear
00012 in supporting documentation, and that the name of FUJITSU LIMITED
00013 and Sun Microsystems, Inc.not be used in advertising or publicity
00014 pertaining to distribution of the software without specific, written
00015 prior permission. FUJITSU LIMITED and Sun Microsystems, Inc. makes no
00016 representations about the suitability of this software for any purpose. 
00017 It is provided "as is" without express or implied warranty.
00018 
00019 FUJITSU LIMITED AND SUN MICROSYSTEMS, INC DISCLAIM ALL WARRANTIES WITH 
00020 REGARD TO THIS SOFTWARE,INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
00021 AND FITNESS, IN NO EVENT SHALL FUJITSU LIMITED BE LIABLE FOR ANY SPECIAL, 
00022 INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 
00023 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
00024 OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
00025 OR PERFORMANCE OF THIS SOFTWARE.
00026 
00027   Author: Takashi Fujiwara     FUJITSU LIMITED 
00028                                fujiwara@a80.tech.yk.fujitsu.co.jp
00029           Hideki Hiura         Sun Microsystems, Inc.
00030                               hhiura@Sun.COM
00031 ******************************************************************/
00032 /*
00033 
00034 Copyright (c) 1991 - 1994  FUJITSU LIMITED
00035 
00036 Permission is hereby granted, free of charge, to any person obtaining
00037 a copy of this software and associated documentation files (the
00038 "Software"), to deal in the Software without restriction, including
00039 without limitation the rights to use, copy, modify, merge, publish,
00040 distribute, sublicense, and/or sell copies of the Software, and to
00041 permit persons to whom the Software is furnished to do so, subject to
00042 the following conditions:
00043 
00044 The above copyright notice and this permission notice shall be included
00045 in all copies or substantial portions of the Software.
00046 
00047 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00048 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00049 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00050 IN NO EVENT SHALL THE FUJITSU LIMITED BE LIABLE FOR ANY CLAIM, DAMAGES
00051 OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00052 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00053 OTHER DEALINGS IN THE SOFTWARE.
00054 
00055 Except as contained in this notice, the name of the FUJITSU LIMITED shall
00056 not be used in advertising or otherwise to promote the sale, use or
00057 other dealings in this Software without prior written authorization
00058 from the FUJITSU LIMITED.
00059 
00060   Author: Takashi Fujiwara     FUJITSU LIMITED 
00061 
00062 */
00063 #ifndef _XIMP_PROTO_H
00064 #define _XIMP_PROTO_H
00065 
00066 /* Ximp implementation revision */
00067 #define XIMP_REVISION "Ximp Revision 4.0.1"
00068 
00069 /* Ximp Protocol Version */
00070 #ifdef XIMP_40
00071 #define XIMP_PROTOCOL_VERSION "XIMP.4.0"
00072 #else
00073 #define XIMP_PROTOCOL_VERSION "XIMP.3.5"
00074 #endif /* XIMP_40 */
00075 
00076 /* Ximp Protocol Version Number */
00077 #ifdef XIMP_40
00078 #define XIMP_VERSION_NUMBER 40
00079 #endif /* XIMP_40 */
00080 
00081 /* Input Context ID */
00082 typedef unsigned long       ICID;
00083 
00084 /* ClientMessage No.  Ximp 4.0 */
00085 
00086 /* client <=> frontend  */
00087 #define  XIMP_KEYRELEASE4               100
00088 #define  XIMP_KEYPRESS4                   101
00089 /* client ==> frontend  * Base Protocol */
00090 #define  XIMP_CREATE4                     102
00091 #define  XIMP_DESTROY4                    103
00092 #define  XIMP_REG_KEY_PRESSED4            104
00093 #define  XIMP_SETFOCUS4                   105
00094 #define  XIMP_UNSETFOCUS4          106
00095 #define  XIMP_CLIENT_WINDOW4              107
00096 #define  XIMP_FOCUS_WINDOW4        108
00097 #define  XIMP_MOVE4                109
00098 #define  XIMP_RESET4               110
00099 #define  XIMP_SETVALUE4                   111
00100 #define  XIMP_GETVALUE4                   112
00101 /*                      * Callback  Protocol */
00102 #define  XIMP_PREEDITSTART_RETURN4 120
00103 #define  XIMP_PREEDITCARET_RETURN4 121
00104 /* client <== frontend  * Base Protocol  */
00105 #define  XIMP_SPROC_STARTED4              130
00106 #define  XIMP_SPROC_STOPPED4              131
00107 #define  XIMP_READPROP4                   132
00108 #define  XIMP_CLIENT_WINDOW_RETURN4       133
00109 #define  XIMP_FOCUS_WINDOW_RETURN4 134
00110 #define  XIMP_GETVALUE_RETURN4            135
00111 #define  XIMP_RESET_RETURN4        136
00112 #define  XIMP_CREATE_RETURN4              137
00113 #define  XIMP_KEYPRESS_RETURN4            138
00114 #define  XIMP_KEYRELEASE_RETURN4        139
00115 /*                      * Callback  Protocol */
00116 #define  XIMP_GEOMETRY4                   140
00117 #define  XIMP_PREEDITSTART4        150
00118 #define  XIMP_PREEDITDONE4         151
00119 #define  XIMP_PREEDITDRAW4         152
00120 #define  XIMP_PREEDITDRAW_CM4             153
00121 #define  XIMP_PREEDITDRAW_CM_TINY4 154
00122 #define  XIMP_PREEDITDRAW_CM_FEEDBACK4    155
00123 #define  XIMP_PREEDITCARET4        156
00124 #define  XIMP_STATUSSTART4         160
00125 #define  XIMP_STATUSDONE4          161
00126 #define  XIMP_STATUSDRAW4          162
00127 #define  XIMP_STATUSDRAW_CM4              163
00128 /* client => IM Server for frontend method */
00129 #define  XIMP_EVENTMASK_NOTIFY4         200
00130 /* client <== frontend for frontend method */
00131 #define  XIMP_EVENTMASK_NOTIFY_RETURN4  201
00132 /* Extension Protocol */
00133 #define  XIMP_EXTENSION4           500
00134 /* client <== frontend  * Error Protocol */
00135 #define  XIMP_ERROR4               999
00136 
00137 /* ClientMessage No.  Ximp 3.5 */
00138 /* client <=> frontend  */
00139 #define  XIMP_KEYPRESS3             1
00140 /* client ==> frontend  * Base Protocol */
00141 #define  XIMP_CREATE3                      2
00142 #define  XIMP_DESTROY3                     3
00143 #define  XIMP_BEGIN3                4
00144 #define  XIMP_END3                  5
00145 #define  XIMP_SETFOCUS3                    6
00146 #define  XIMP_UNSETFOCUS3           7
00147 #define  XIMP_CHANGE3                      8
00148 #define  XIMP_MOVE3                 9
00149 #define  XIMP_RESET3               10
00150 #define  XIMP_SETVALUE3                   11
00151 #define  XIMP_GETVALUE3                   12
00152 /*                      * Callback  Protocol */
00153 #define  XIMP_PREEDITSTART_RETURN3 20
00154 #define  XIMP_PREEDITCARET_RETURN3 21
00155 /* client <== frontend  * Base Protocol  */
00156 #define  XIMP_CREATE_RETURN3               2
00157 #define  XIMP_CONVERSION_BEGIN3           30
00158 #define  XIMP_PROCESS_BEGIN3              30
00159 #define  XIMP_CONVERSION_END3             31
00160 #define  XIMP_PROCESS_END3         31
00161 #define  XIMP_READPROP3                   32
00162 #define  XIMP_GETVALUE_RETURN3            33
00163 #define  XIMP_RESET_RETURN3        34
00164 /*                      * Callback  Protocol */
00165 #define  XIMP_GEOMETRY3                   40
00166 #define  XIMP_PREEDITSTART3        41
00167 #define  XIMP_PREEDITDONE3         42
00168 #define  XIMP_PREEDITDRAW3         43
00169 #define  XIMP_PREEDITDRAW_CM3             44
00170 #define  XIMP_PREEDITCARET3        45
00171 #define  XIMP_STATUSSTART3         46
00172 #define  XIMP_STATUSDONE3          47
00173 #define  XIMP_STATUSDRAW3          48
00174 #define  XIMP_STATUSDRAW_CM3              49
00175 #define  XIMP_PREEDITDRAW_TINY3           50
00176 /* Extension Protocol */
00177 #define  XIMP_EXTENSION3           90
00178 /* client <== frontend  * Error Protocol */
00179 #define  XIMP_ERROR3               99
00180 
00181 /* For Backward Compatibility */
00182 #ifndef XIMP_40
00183 #define  XIMP_KEYPRESS                    XIMP_KEYPRESS3
00184 #define  XIMP_CREATE               XIMP_CREATE3
00185 #define  XIMP_DESTROY                     XIMP_DESTROY3
00186 #define  XIMP_BEGIN                XIMP_BEGIN3
00187 #define  XIMP_END                  XIMP_END3
00188 #define  XIMP_SETFOCUS                    XIMP_SETFOCUS3
00189 #define  XIMP_UNSETFOCUS           XIMP_UNSETFOCUS3
00190 #define  XIMP_CHANGE               XIMP_CHANGE3
00191 #define  XIMP_MOVE                 XIMP_MOVE3
00192 #define  XIMP_RESET                XIMP_RESET3
00193 #define  XIMP_SETVALUE                    XIMP_SETVALUE3
00194 #define  XIMP_GETVALUE                    XIMP_GETVALUE3
00195 #define  XIMP_PREEDITSTART_RETURN  XIMP_PREEDITSTART_RETURN3
00196 #define  XIMP_PREEDITCARET_RETURN  XIMP_PREEDITCARET_RETURN3
00197 #define  XIMP_CREATE_RETURN        XIMP_CREATE_RETURN3
00198 #define  XIMP_CONVERSION_BEGIN            XIMP_CONVERSION_BEGIN3
00199 #define  XIMP_PROCESS_BEGIN        XIMP_PROCESS_BEGIN3
00200 #define  XIMP_CONVERSION_END              XIMP_CONVERSION_END3
00201 #define  XIMP_PROCESS_END          XIMP_PROCESS_END3
00202 #define  XIMP_READPROP                    XIMP_READPROP3
00203 #define  XIMP_GETVALUE_RETURN             XIMP_GETVALUE_RETURN3
00204 #define  XIMP_RESET_RETURN         XIMP_RESET_RETURN3
00205 #define  XIMP_GEOMETRY                    XIMP_GEOMETRY3
00206 #define  XIMP_PREEDITSTART         XIMP_PREEDITSTART3
00207 #define  XIMP_PREEDITDONE          XIMP_PREEDITDONE3
00208 #define  XIMP_PREEDITDRAW          XIMP_PREEDITDRAW3
00209 #define  XIMP_PREEDITDRAW_CM              XIMP_PREEDITDRAW_CM3
00210 #define  XIMP_PREEDITCARET         XIMP_PREEDITCARET3
00211 #define  XIMP_STATUSSTART          XIMP_STATUSSTART3
00212 #define  XIMP_STATUSDONE           XIMP_STATUSDONE3
00213 #define  XIMP_STATUSDRAW           XIMP_STATUSDRAW3
00214 #define  XIMP_STATUSDRAW_CM        XIMP_STATUSDRAW_CM3
00215 #define  XIMP_PREEDITDRAW_TINY            XIMP_PREEDITDRAW_TINY3
00216 #define  XIMP_EXTENSION                   XIMP_EXTENSION3
00217 #define  XIMP_ERROR                XIMP_ERROR3
00218 #endif /* !XIMP_40 */
00219 
00220 
00221 /* Error Notify from IM Server */
00222 /*  Detail Error Number */
00223 #define  XIMP_NoError                     0      /* No Error */
00224 #define  XIMP_BadAlloc                    1      /* Memeory Alloc Fail */
00225 #define  XIMP_BadStyle                    2      /* Unspported Input Style */
00226 #define  XIMP_BadClientWindow             3      /* Invalid Client Window */
00227 #define  XIMP_BadFocusWindow              4      /* Invalid Focus Window */
00228 #define  XIMP_BadArea                     5      /* Invalid Area */
00229 #define  XIMP_BadSpotLocation             6      /* SpotLocation Out Of Range */
00230 #define  XIMP_BadColormap          7      /* Invalid Colormap ID */
00231 #define  XIMP_BadAtom                     8      /* Invalid Atom ID */
00232 #define  XIMP_BadPixel                    9      /* Invalid Pixel Value */
00233 #define  XIMP_BadPixmap                   10     /* Invalid Pixmap Value */
00234 #define  XIMP_BadName                     11     /* Invalid Font Name */
00235 #define  XIMP_BadCursor                   12     /* Invalid Cursor ID */
00236 #define  XIMP_BadProtocol          13     /* Invalid Protocol ID */
00237 #define  XIMP_BadProperty          14     /* Invalid Property Name */
00238 #define  XIMP_BadPropertyType             15     /* Invalid Property Type */
00239 
00240 /* Property Name */
00241 #define  _XIMP_PROTOCOL            "_XIMP_PROTOCOL"
00242 #define  _XIMP_BASE         "_XIMP_" /* Root Window _XIP_<locale_name> */
00243 
00244 /* IMS Window Property Name */
00245 #define  _XIMP_VERSION                    "_XIMP_VERSION"
00246 #define  _XIMP_STYLE               "_XIMP_STYLE"
00247 #define  _XIMP_SPROC_STARTED_KEYS  "_XIMP_SPROC_STARTED_KEYS"
00248 #define  _XIMP_SPROC_STOPPED_KEYS  "_XIMP_SPROC_STOPPED_KEYS"
00249 #define  _XIMP_KEYS                "_XIMP_KEYS"
00250 #define  _XIMP_SERVERNAME          "_XIMP_SERVERNAME"
00251 #define  _XIMP_SERVERVERSION              "_XIMP_SERVERVERSION"
00252 #define  _XIMP_EXTENSIONS          "_XIMP_EXTENSIONS"
00253 #define  _XIMP_PREEDITMAXSIZE             "_XIMP_PREEDITMAXSIZE"
00254 #define  _XIMP_VENDORNAME          "_XIMP_VENDORNAME"
00255 #define  _XIMP_TYPE                "_XIMP_TYPE"
00256 
00257 /* Client Window Property Name */
00258 #define  _XIMP_LIBVERSION   "_XIMP_VERSION"
00259 #define  _XIMP_FOCUS        "_XIMP_FOCUS"
00260 #define  _XIMP_PREEDIT             "_XIMP_PREEDIT"
00261 #define  _XIMP_STATUS              "_XIMP_STATUS"
00262 #define  _XIMP_PREEDITFONT  "_XIMP_PREEDITFONT"
00263 #define  _XIMP_STATUSFONT   "_XIMP_STATUSFONT"
00264 
00265 #define  _XIMP_CTEXT        "_XIMP_CTEXT"
00266 
00267 /* CallBack Property Name */
00268 #define  _XIMP_PREEDIT_DRAW_DATA          "_XIMP_PREEDIT_DRAW_DATA"
00269 #define  _XIMP_FEEDBACKS                  "_XIMP_FEEDBACKS"
00270 #define  _XIMP_PREEDITDRAWLENGTH          "_XIMP_PREEDITDRAWLENGTH"
00271 #define  _XIMP_PREEDITDRAWSTRING          "_XIMP_PREEDITDRAWSTRING"
00272 #define  _XIMP_PREEDITDRAWFEEDBACK               "_XIMP_PREEDITDRAWFEEDBACK"
00273 
00274 #define  _XIMP_EXT_XIMP_CHOICE_START_REQ  "_XIMP_EXT_XIMP_CHOICE_START_REQ"
00275 #define  _XIMP_EXT_XIMP_CHOICE_START_REP  "_XIMP_EXT_XIMP_CHOICE_START_REP"
00276 #define  _XIMP_EXT_XIMP_CHOICE_DRAW_REQ          "_XIMP_EXT_XIMP_CHOICE_DRAW_REQ"
00277 #define  _XIMP_EXT_XIMP_CHOICE_PROC_REQ          "_XIMP_EXT_XIMP_CHOICE_PROC_REQ"
00278 #define  _XIMP_EXT_XIMP_CHOICE_PROC_REP          "_XIMP_EXT_XIMP_CHOICE_PROC_REP"
00279 #define  _XIMP_EXT_XIMP_LOOKUPCHOICES            "_XIMP_EXT_XIMP_LOOKUPCHOICES"
00280 
00281 /* Lookup choices REQ and REP */
00282 #define  LOOKUP_CHOICES_BEGIN              0
00283 #define  LOOKUP_CHOICES_START_REQ  1
00284 #define  LOOKUP_CHOICES_START_REP  2
00285 #define  LOOKUP_CHOICES_PROCESS_REQ       3
00286 #define  LOOKUP_CHOICES_PROCESS_REP       4
00287 #define  LOOKUP_CHOICES_DRAW_REQ   5
00288 #define  LOOKUP_CHOICES_DONE_REQ   6
00289 
00290 
00291 /* mask (XIMP_CREATE, XIMP_SETVALUE, XIMP_GETVALUE) */
00292 /* Ximp 4.0 */
00293 #define XIMP_FOCUS_WIN_MASK4              (1L <<  0)
00294 #define XIMP_PRE_AREA_MASK4        (1L <<  1)
00295 #define XIMP_PRE_AREANEED_MASK4           (1L <<  2)
00296 #define XIMP_PRE_COLORMAP_MASK4           (1L <<  3)
00297 #define XIMP_PRE_STD_COLORMAP_MASK4       (1L <<  4)
00298 #define XIMP_PRE_FG_MASK4          (1L <<  5)
00299 #define XIMP_PRE_BG_MASK4          (1L <<  6)
00300 #define XIMP_PRE_BGPIXMAP_MASK4           (1L <<  7)
00301 #define XIMP_PRE_LINESP_MASK4             (1L <<  8)
00302 #define XIMP_PRE_CURSOR_MASK4             (1L <<  9)
00303 #define XIMP_PRE_SPOTL_MASK4              (1L << 10)
00304 #define XIMP_STS_AREA_MASK4        (1L << 11)
00305 #define XIMP_STS_AREANEED_MASK4           (1L << 12)
00306 #define XIMP_STS_COLORMAP_MASK4           (1L << 13)
00307 #define XIMP_STS_STD_COLORMAP_MASK4       (1L << 14)
00308 #define XIMP_STS_FG_MASK4          (1L << 15)
00309 #define XIMP_STS_BG_MASK4          (1L << 16)
00310 #define XIMP_STS_BGPIXMAP_MASK4           (1L << 17)
00311 #define XIMP_STS_LINESP_MASK4             (1L << 18)
00312 #define XIMP_STS_CURSOR_MASK4             (1L << 19)
00313 #define XIMP_STS_WINDOW_MASK4             (1L << 20)
00314 #define XIMP_PRE_FONT_MASK4        (1L << 21)
00315 #define XIMP_STS_FONT_MASK4        (1L << 22)
00316 #define XIMP_SERVERTYPE_MASK4             (1L << 23)
00317 
00318 /* Ximp 3.5 */
00319 #define XIMP_FOCUS_WIN_MASK3          (1L <<  0)
00320 #define XIMP_PRE_AREA_MASK3           (1L <<  1)
00321 #define XIMP_PRE_FG_MASK3             (1L <<  2)
00322 #define XIMP_PRE_BG_MASK3             (1L <<  3)
00323 #define XIMP_PRE_COLORMAP_MASK3       (1L <<  4)
00324 #define XIMP_PRE_BGPIXMAP_MASK3       (1L <<  5)
00325 #define XIMP_PRE_LINESP_MASK3         (1L <<  6)
00326 #define XIMP_PRE_CURSOR_MASK3         (1L <<  7)
00327 #define XIMP_PRE_AREANEED_MASK3       (1L <<  8)
00328 #define XIMP_PRE_SPOTL_MASK3          (1L <<  9)
00329 #define XIMP_STS_AREA_MASK3           (1L << 10)
00330 #define XIMP_STS_FG_MASK3             (1L << 11)
00331 #define XIMP_STS_BG_MASK3             (1L << 12)
00332 #define XIMP_STS_COLORMAP_MASK3       (1L << 13)
00333 #define XIMP_STS_BGPIXMAP_MASK3       (1L << 14)
00334 #define XIMP_STS_LINESP_MASK3         (1L << 15)
00335 #define XIMP_STS_CURSOR_MASK3         (1L << 16)
00336 #define XIMP_STS_AREANEED_MASK3       (1L << 17)
00337 #define XIMP_STS_WINDOW_MASK3         (1L << 18)
00338 #define XIMP_PRE_FONT_MASK3           (1L << 19)
00339 #define XIMP_STS_FONT_MASK3           (1L << 20)
00340 
00341 /* mask (For Backward Compatibility) */
00342 #ifndef XIMP_40
00343 #define XIMP_FOCUS_WIN_MASK        XIMP_FOCUS_WIN_MASK3
00344 #define XIMP_PRE_AREA_MASK         XIMP_PRE_AREA_MASK3
00345 #define XIMP_PRE_FG_MASK           XIMP_PRE_FG_MASK3
00346 #define XIMP_PRE_BG_MASK           XIMP_PRE_BG_MASK3
00347 #define XIMP_PRE_COLORMAP_MASK            XIMP_PRE_COLORMAP_MASK3
00348 #define XIMP_PRE_BGPIXMAP_MASK            XIMP_PRE_BGPIXMAP_MASK3
00349 #define XIMP_PRE_LINESP_MASK              XIMP_PRE_LINESP_MASK3
00350 #define XIMP_PRE_CURSOR_MASK              XIMP_PRE_CURSOR_MASK3
00351 #define XIMP_PRE_AREANEED_MASK            XIMP_PRE_AREANEED_MASK3
00352 #define XIMP_PRE_SPOTL_MASK        XIMP_PRE_SPOTL_MASK3
00353 #define XIMP_STS_AREA_MASK         XIMP_STS_AREA_MASK3
00354 #define XIMP_STS_FG_MASK           XIMP_STS_FG_MASK3
00355 #define XIMP_STS_BG_MASK           XIMP_STS_BG_MASK3
00356 #define XIMP_STS_COLORMAP_MASK            XIMP_STS_COLORMAP_MASK3
00357 #define XIMP_STS_BGPIXMAP_MASK            XIMP_STS_BGPIXMAP_MASK3
00358 #define XIMP_STS_LINESP_MASK              XIMP_STS_LINESP_MASK3
00359 #define XIMP_STS_CURSOR_MASK              XIMP_STS_CURSOR_MASK3
00360 #define XIMP_STS_AREANEED_MASK            XIMP_STS_AREANEED_MASK3
00361 #define XIMP_STS_WINDOW_MASK              XIMP_STS_WINDOW_MASK3
00362 #define XIMP_PRE_FONT_MASK         XIMP_PRE_FONT_MASK3
00363 #define XIMP_STS_FONT_MASK         XIMP_STS_FONT_MASK3
00364 #endif /* !XIMP_40 */
00365 
00366 /* MODE(FRONTEND or BACKEND), TYPE(Type1,2,3) and SYNC/ASYNC */
00367 #define XIMP_FRONTEND4             (1L << 0)
00368 #define XIMP_BACKEND4              (1L << 1)
00369 #define XIMP_TYPE1          (1L << 2)
00370 #define XIMP_TYPE2          (1L << 3)
00371 #define XIMP_TYPE3          (1L << 4)
00372 #define XIMP_SYNC           (1L << 5)
00373 #define XIMP_FE_TYPE1              (XIMP_FRONTEND4 | XIMP_TYPE1)
00374 #define XIMP_FE_TYPE2              (XIMP_FRONTEND4 | XIMP_TYPE2)
00375 #define XIMP_FE_TYPE3              (XIMP_FRONTEND4 | XIMP_TYPE3)
00376 #define XIMP_BE_TYPE1              (XIMP_BACKEND4  | XIMP_TYPE1)
00377 #define XIMP_BE_TYPE2              (XIMP_BACKEND4  | XIMP_TYPE2)
00378 #define XIMP_SYNC_BE_TYPE1  (XIMP_SYNC      | XIMP_BE_TYPE1)
00379 #define XIMP_SYNC_BE_TYPE2  (XIMP_SYNC      | XIMP_BE_TYPE2)
00380 
00381 /* MODE(FRONTEND or BACKEND) For Backward Compatibility */
00382 #define XIMP_FRONTEND_BC_MASK      (1L << 0)
00383 #define XIMP_BACKEND_BC_MASK       (1L << 1)
00384 
00385 /* mask (For Backward Compatibility) */
00386 #define XIMP_FRONTEND              0
00387 #define XIMP_BACKEND        1
00388 
00389 /*  XIMP_PREEDITDRAW_CM status value
00390  * post Ximp 3.4 protocol maybe compliant. 
00391  * XIMP status flag will may contain the supplementary infomations to 
00392  * reassemble the XIMPreeditDrawCallbackStruct.
00393  *       +-----------------------------------------+
00394  *     0 | XIMP_PREEDITDRAW_CM                     |
00395  *       +-----------------------------------------+
00396  *     4 | ICID                                    |
00397  *       +-------------------+---------------------+
00398  *     8 |PreeditDrawCBStatus|       caret         |
00399  *       +-------------------+---------------------+
00400  *     12|      chg_first    |      chg_length     |
00401  *       +-------------------+---------------------+
00402  *     16|               feedback                  |
00403  *       +-----------------------------------------+
00404  * PreeditDrawCBStatus:
00405  *    0x0001 no_text:  if 1, string == NULL (no following client message.)
00406  *    0x0002 no_feedback: if 1 feedback == NULL
00407  *    0x0004 feedbacks_via_property: if 1 , feedback field is property atom#
00408  **/
00409 
00410 #define XIMP_PDCBSTATUS_NOTEXT                   0x0001
00411 #define XIMP_PDCBSTATUS_NOFEEDBACK               0x0002
00412 #define XIMP_PDCBSTATUS_FEEDBACKS_VIA_PROP       0x0004
00413 
00414 /* _XIMP_KEYS   struct  */
00415 
00416 typedef struct {
00417        unsigned long        modifier;
00418        unsigned long        modifier_mask;
00419        KeySym               keysym;
00420 } Ximp_Key;
00421 
00422 typedef struct {
00423        unsigned short               count_keys;
00424        Ximp_Key             *keys_list;
00425 } Ximp_KeyList;
00426 
00427 typedef struct _Ximp_Area {
00428        long          x;
00429        long          y;
00430        long          width;
00431        long          height;
00432 } Ximp_AreaRec;
00433 
00434 typedef struct _Ximp_Point {
00435        long          x;
00436        long          y;
00437 } Ximp_PointRec;
00438 
00439 typedef struct _Ximp_Size {
00440        long          width;
00441        long          height;
00442 } Ximp_SizeRec;
00443 
00444 /* kana-kanji conversion window attributes */
00445 
00446 #ifdef XIMP_40
00447 
00448 #define XIMP_PREEDIT_MAX_LONG4 15
00449 #define XIMP_PREEDIT_MAX_CHAR4 60
00450 
00451 typedef struct  _Ximp_Preedit4 {
00452        Ximp_AreaRec  Area;
00453        Ximp_SizeRec  AreaNeeded;
00454        Ximp_PointRec   SpotLocation;
00455        Colormap      Colormap;
00456        Atom          StdColormap;
00457        unsigned long   Foreground;
00458        unsigned long   Background;
00459        Pixmap        Bg_Pixmap;
00460        long          LineSpacing;
00461        Cursor        Cursor;
00462 } Ximp_PreeditPropRec4;
00463 
00464 #define XIMP_PREEDIT_MAX_LONG3 14
00465 #define XIMP_PREEDIT_MAX_CHAR3 56
00466 
00467 typedef struct  _Ximp_Preedit3 {
00468         Ximp_AreaRec    Area;
00469         unsigned long   Foreground;
00470         unsigned long   Background;
00471         Colormap        Colormap;
00472         Pixmap          Bg_Pixmap;
00473         long            LineSpacing;
00474         Cursor          Cursor;
00475         Ximp_SizeRec    AreaNeeded;
00476         Ximp_PointRec   SpotLocation;
00477 } Ximp_PreeditPropRec3;
00478 
00479 #define XIMP_STATUS_MAX_LONG4 14
00480 #define XIMP_STATUS_MAX_CHAR4 56
00481 #define XIMP_STATUS_MAX_LONG4 14
00482 #define XIMP_STATUS_MAX_CHAR4 56
00483 
00484 typedef struct  _Ximp_Status4 {
00485        Ximp_AreaRec  Area;
00486        Ximp_SizeRec  AreaNeeded;
00487        Colormap      Colormap;
00488        Atom          StdColormap;
00489        unsigned long   Foreground;
00490        unsigned long   Background;
00491        Pixmap        Bg_Pixmap;
00492        long          LineSpacing;
00493        Cursor        Cursor;
00494        Window        window;
00495 } Ximp_StatusPropRec4;
00496 
00497 #define XIMP_STATUS_MAX_LONG3 13
00498 #define XIMP_STATUS_MAX_CHAR3 52
00499  
00500 typedef struct  _Ximp_Status3 {
00501         Ximp_AreaRec    Area;
00502         unsigned long   Foreground;
00503         unsigned long   Background;
00504         Colormap        Colormap;
00505         Pixmap          Bg_Pixmap;
00506         long            LineSpacing;
00507         Cursor          Cursor;
00508         Ximp_SizeRec    AreaNeeded;
00509         Window          window;
00510 } Ximp_StatusPropRec3;
00511 
00512 #else /* XIMP_40 */ /* For Backward Compatibility  */
00513 
00514 #define XIMP_PREEDIT_MAX_LONG  14
00515 #define XIMP_PREEDIT_MAX_CHAR  56
00516 
00517 typedef struct  _Ximp_Preedit {
00518         Ximp_AreaRec    Area;
00519         unsigned long   Foreground;
00520         unsigned long   Background;
00521         Colormap        Colormap;
00522         Pixmap          Bg_Pixmap;
00523         long            LineSpacing;
00524         Cursor          Cursor;
00525         Ximp_SizeRec    AreaNeeded;
00526         Ximp_PointRec   SpotLocation;
00527 } Ximp_PreeditPropRec;
00528 
00529 #define XIMP_STATUS_MAX_LONG  13
00530 #define XIMP_STATUS_MAX_CHAR  52
00531  
00532 typedef struct  _Ximp_Status {
00533         Ximp_AreaRec    Area;
00534         unsigned long   Foreground;
00535         unsigned long   Background;
00536         Colormap        Colormap;
00537         Pixmap          Bg_Pixmap;
00538         long            LineSpacing;
00539         Cursor          Cursor;
00540         Ximp_SizeRec    AreaNeeded;
00541         Window          window;
00542 } Ximp_StatusPropRec;
00543 
00544 #endif /* XIMP_40 */
00545 
00546 /* for CallBack */
00547 typedef struct _Ximp_PreeditDrawDataPropRec {
00548        long caret;
00549        long chg_first;
00550        long chg_length;
00551 } Ximp_PreeditDrawDataPropRec, *Ximp_PreeditDrawDataProp;
00552 
00553 /* for Commit, PreEditDraw, StatusDraw */
00554 typedef struct _Ximp_CommitPropRec {
00555        unsigned long   icid;
00556        char            size;
00557        char            ctext[11];
00558 } Ximp_CommitPropRec, Ximp_PreEditDrawCallbackPropRec,
00559   Ximp_StatusDrawCallbackPropRec;
00560 
00561 /* for PreEditDraw */
00562 typedef struct {
00563        short           chg_first;
00564        short           chg_length;
00565 } Ximp_slong;
00566 
00567 typedef union {
00568        Ximp_slong      slong;
00569        long            l;
00570 } Ximp_uslong;
00571 
00572 #endif /* _XIMP_PROTO_H */