Back to index

im-sdk  12.3.91
XimProto.h
Go to the documentation of this file.
00001 /* $XConsortium: XimProto.h,v 1.4 94/09/01 18:44:49 kaleb Exp $ */
00002 /******************************************************************
00003 
00004            Copyright 1992, 1993 by FUJITSU LIMITED
00005 
00006 Permission to use, copy, modify, distribute, and sell this software
00007 and its documentation for any purpose is hereby granted without fee,
00008 provided that the above copyright notice appear in all copies and
00009 that both that copyright notice and this permission notice appear
00010 in supporting documentation, and that the name of FUJITSU LIMITED
00011 not be used in advertising or publicity pertaining to distribution
00012 of the software without specific, written prior permission.
00013 FUJITSU LIMITED makes no representations about the suitability of
00014 this software for any purpose. 
00015 It is provided "as is" without express or implied warranty.
00016 
00017 FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
00018 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
00019 EVENT SHALL FUJITSU LIMITED BE LIABLE FOR ANY SPECIAL, INDIRECT OR
00020 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
00021 USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
00022 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
00023 PERFORMANCE OF THIS SOFTWARE.
00024 
00025   Author: Takashi Fujiwara     FUJITSU LIMITED 
00026                                fujiwara@a80.tech.yk.fujitsu.co.jp
00027 
00028 ******************************************************************/
00029 
00030 #ifndef _XIMPROTO_H
00031 #define _XIMPROTO_H
00032 
00033 /*
00034  * Default Preconnection selection target
00035  */
00036 #define XIM_SERVERS         "XIM_SERVERS"
00037 #define XIM_LOCALES         "LOCALES"
00038 #define XIM_TRANSPORT              "TRANSPORT"
00039 
00040 /*
00041  * categories in XIM_SERVERS
00042  */
00043 #define XIM_SERVER_CATEGORY "@server="
00044 #define XIM_LOCAL_CATEGORY  "@locale="
00045 #define XIM_TRANSPORT_CATEGORY     "@transport="
00046 
00047 /*
00048  * Xim implementation revision
00049  */
00050 #define PROTOCOLMAJORVERSION              1
00051 #define PROTOCOLMINORVERSION              0
00052 
00053 /*
00054  * Major Protocol number
00055  */
00056 #define       XIM_CONNECT                   1
00057 #define       XIM_CONNECT_REPLY             2
00058 #define       XIM_DISCONNECT                       3
00059 #define       XIM_DISCONNECT_REPLY          4
00060 
00061 #define XIM_AUTH_REQUIRED           10
00062 #define XIM_AUTH_REPLY                     11
00063 #define XIM_AUTH_NEXT                      12
00064 #define XIM_AUTH_SETUP                     13
00065 #define XIM_AUTH_NG                 14
00066 
00067 #define       XIM_ERROR                    20
00068 
00069 #define       XIM_OPEN                     30
00070 #define       XIM_OPEN_REPLY                      31
00071 #define       XIM_CLOSE                    32
00072 #define       XIM_CLOSE_REPLY                     33
00073 #define       XIM_REGISTER_TRIGGERKEYS     34
00074 #define       XIM_TRIGGER_NOTIFY           35
00075 #define       XIM_TRIGGER_NOTIFY_REPLY     36
00076 #define       XIM_SET_EVENT_MASK           37
00077 #define       XIM_ENCODING_NEGOTIATION     38
00078 #define       XIM_ENCODING_NEGOTIATION_REPLY      39
00079 #define       XIM_QUERY_EXTENSION          40
00080 #define       XIM_QUERY_EXTENSION_REPLY    41
00081 #define       XIM_SET_IM_VALUES            42
00082 #define       XIM_SET_IM_VALUES_REPLY             43
00083 #define       XIM_GET_IM_VALUES            44
00084 #define       XIM_GET_IM_VALUES_REPLY             45
00085 
00086 #define XIM_CREATE_IC                      50
00087 #define       XIM_CREATE_IC_REPLY          51
00088 #define       XIM_DESTROY_IC                      52
00089 #define       XIM_DESTROY_IC_REPLY         53
00090 #define XIM_SET_IC_VALUES           54
00091 #define       XIM_SET_IC_VALUES_REPLY             55
00092 #define XIM_GET_IC_VALUES           56
00093 #define XIM_GET_IC_VALUES_REPLY            57
00094 #define       XIM_SET_IC_FOCUS             58
00095 #define       XIM_UNSET_IC_FOCUS           59
00096 #define       XIM_FORWARD_EVENT            60
00097 #define       XIM_SYNC                     61
00098 #define       XIM_SYNC_REPLY                      62
00099 #define       XIM_COMMIT                   63
00100 #define       XIM_RESET_IC                 64
00101 #define       XIM_RESET_IC_REPLY           65
00102 
00103 #define       XIM_GEOMETRY                 70
00104 #define       XIM_STR_CONVERSION           71
00105 #define       XIM_STR_CONVERSION_REPLY     72
00106 #define       XIM_PREEDIT_START            73
00107 #define       XIM_PREEDIT_START_REPLY             74
00108 #define       XIM_PREEDIT_DRAW             75
00109 #define       XIM_PREEDIT_CARET            76
00110 #define XIM_PREEDIT_CARET_REPLY            77
00111 #define       XIM_PREEDIT_DONE             78
00112 #define       XIM_STATUS_START             79
00113 #define       XIM_STATUS_DRAW                     80
00114 #define       XIM_STATUS_DONE                     81
00115 #define       XIM_PREEDITSTATE             82
00116 
00117 #define XIM_DELAY_DESTROY_IC             83
00118 #define XIM_DELAY_DESTROY_IC_REPLY       84
00119 /*
00120  * values for the flag of XIM_ERROR
00121  */
00122 #define       XIM_IMID_VALID                     0x0001
00123 #define       XIM_ICID_VALID                     0x0002
00124 
00125 /*
00126  * XIM Error Code
00127  */
00128 #define XIM_BadAlloc               1
00129 #define XIM_BadStyle               2
00130 #define XIM_BadClientWindow        3
00131 #define XIM_BadFocusWindow         4
00132 #define XIM_BadArea                5
00133 #define XIM_BadSpotLocation        6
00134 #define XIM_BadColormap                   7
00135 #define XIM_BadAtom                8
00136 #define XIM_BadPixel               9
00137 #define XIM_BadPixmap                     10
00138 #define XIM_BadName                11
00139 #define XIM_BadCursor                     12
00140 #define XIM_BadProtocol                   13
00141 #define XIM_BadForeground          14
00142 #define XIM_BadBackground          15
00143 #define XIM_LocaleNotSupported            16
00144 #define XIM_BadSomething           999
00145 
00146 /*
00147  * byte order
00148  */
00149 #define BIGENDIAN    (CARD8)0x42   /* MSB first */
00150 #define LITTLEENDIAN (CARD8)0x6c   /* LSB first */
00151 
00152 /*
00153  * values for the type of XIMATTR & XICATTR
00154  */
00155 #define       XimType_SeparatorOfNestedList      0
00156 #define       XimType_CARD8               1
00157 #define       XimType_CARD16                     2
00158 #define       XimType_CARD32                     3
00159 #define       XimType_STRING8                    4
00160 #define       XimType_Window                     5
00161 #define       XimType_XIMStyles           10
00162 #define       XimType_XRectangle          11
00163 #define       XimType_XPoint                     12
00164 #define XimType_XFontSet           13
00165 #define XimType_XIMOptions         14
00166 #define XimType_XIMHotKeyTriggers  15
00167 #define XimType_XIMHotKeyState            16
00168 #define XimType_XIMStringConversion       17
00169 #define       XimType_NEST                0x7fff
00170 
00171 /*
00172  * values for the category of XIM_ENCODING_NEGITIATON_REPLY
00173  */
00174 #define       XIM_Encoding_NameCategory   0
00175 #define       XIM_Encoding_DetailCategory 1
00176 
00177 /*
00178  * value for the index of XIM_ENCODING_NEGITIATON_REPLY
00179  */
00180 #define       XIM_Default_Encoding_IDX    -1
00181 
00182 /*
00183  * request packet header size
00184  */
00185 #define XIM_HEADER_SIZE                                        \
00186          sizeof(CARD8)             /* sizeof mejor-opcode */   \
00187        + sizeof(CARD8)             /* sizeof minor-opcode */   \
00188        + sizeof(INT16)             /* sizeof length */
00189 
00190 /*
00191  * Client Message data size
00192  */
00193 #define       XIM_CM_DATA_SIZE     20
00194 
00195 /*
00196  * XIM data structure
00197  */
00198 typedef CARD16       BITMASK16;
00199 typedef CARD32       BITMASK32;
00200 typedef CARD32       EVENTMASK;
00201 
00202 typedef CARD16       XIMID;        /* Input Method ID */
00203 typedef CARD16       XICID;        /* Input Context ID */
00204 
00205 /*
00206  * Padding macro
00207  */
00208 #define       XIM_PAD(length) ((4 - ((length) % 4)) % 4)
00209 
00210 #define XIM_SET_PAD(ptr, length)                               \
00211     {                                                          \
00212        register int   Counter = XIM_PAD((int)length);          \
00213        if (Counter) {                                                 \
00214            register char    *Ptr = (char *)(ptr) + (length);   \
00215            length += Counter;                                         \
00216            for (; Counter; --Counter, ++Ptr)                          \
00217               *Ptr = '\0';                                     \
00218        }                                                       \
00219     }
00220 
00221 #endif /* _XIMPROTO_H */