Tizen 2.1 base
[platform/core/uifw/ise-engine-sunpinyin.git] / wrapper / xim / IMdkit / IMdkit.h
1 /******************************************************************
2  
3          Copyright 1994, 1995 by Sun Microsystems, Inc.
4          Copyright 1993, 1994 by Hewlett-Packard Company
5  
6 Permission to use, copy, modify, distribute, and sell this software
7 and its documentation for any purpose is hereby granted without fee,
8 provided that the above copyright notice appear in all copies and
9 that both that copyright notice and this permission notice appear
10 in supporting documentation, and that the name of Sun Microsystems, Inc.
11 and Hewlett-Packard not be used in advertising or publicity pertaining to
12 distribution of the software without specific, written prior permission.
13 Sun Microsystems, Inc. and Hewlett-Packard make no representations about
14 the suitability of this software for any purpose.  It is provided "as is"
15 without express or implied warranty.
16  
17 SUN MICROSYSTEMS INC. AND HEWLETT-PACKARD COMPANY DISCLAIMS ALL
18 WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
19 WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
20 SUN MICROSYSTEMS, INC. AND HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY
21 SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
22 RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
23 CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
24 IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25  
26   Author: Hidetoshi Tajima(tajima@Eng.Sun.COM) Sun Microsystems, Inc.
27
28     This version tidied and debugged by Steve Underwood May 1999
29  
30 ******************************************************************/
31
32 #ifndef _IMdkit_h
33 #define _IMdkit_h
34
35 #include <X11/Xmd.h>
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 /* IM Attributes Name */
42 #define IMModifiers             "modifiers"
43 #define IMServerWindow          "serverWindow"
44 #define IMServerName            "serverName"
45 #define IMServerTransport       "serverTransport"
46 #define IMLocale                "locale"
47 #define IMInputStyles           "inputStyles"
48 #define IMProtocolHandler       "protocolHandler"
49 #define IMOnKeysList            "onKeysList"
50 #define IMOffKeysList           "offKeysList"
51 #define IMEncodingList          "encodingList"
52 #define IMFilterEventMask       "filterEventMask"
53 #define IMProtocolDepend        "protocolDepend"
54
55 /* Masks for IM Attributes Name */
56 #define I18N_IMSERVER_WIN       0x0001 /* IMServerWindow */
57 #define I18N_IM_NAME            0x0002 /* IMServerName */
58 #define I18N_IM_LOCALE          0x0004 /* IMLocale */
59 #define I18N_IM_ADDRESS         0x0008 /* IMServerTransport */
60 #define I18N_INPUT_STYLES       0x0010 /* IMInputStyles */
61 #define I18N_ON_KEYS            0x0020 /* IMOnKeysList */
62 #define I18N_OFF_KEYS           0x0040 /* IMOffKeysList */
63 #define I18N_IM_HANDLER         0x0080 /* IMProtocolHander */
64 #define I18N_ENCODINGS          0x0100 /* IMEncodingList */
65 #define I18N_FILTERMASK         0x0200 /* IMFilterEventMask */
66 #define I18N_PROTO_DEPEND       0x0400 /* IMProtoDepend */
67
68 typedef struct
69 {
70     char        *name;
71     XPointer    value;
72 } XIMArg;
73
74 typedef struct
75 {
76     CARD32      keysym;
77     CARD32      modifier;
78     CARD32      modifier_mask;
79 } XIMTriggerKey;
80
81 typedef struct
82 {
83     unsigned short count_keys;
84     XIMTriggerKey *keylist;
85 } XIMTriggerKeys;
86
87 typedef char *XIMEncoding;
88
89 typedef struct
90 {
91     unsigned short count_encodings;
92     XIMEncoding *supported_encodings;
93 } XIMEncodings;
94
95 typedef struct _XIMS *XIMS;
96
97 typedef struct
98 {
99     void*       (*setup) (Display *, XIMArg *);
100     Status      (*openIM) (XIMS);
101     Status      (*closeIM) (XIMS);
102     char*       (*setIMValues) (XIMS, XIMArg *);
103     char*       (*getIMValues) (XIMS, XIMArg *);
104     Status      (*forwardEvent) (XIMS, XPointer);
105     Status      (*commitString) (XIMS, XPointer);
106     int         (*callCallback) (XIMS, XPointer);
107     int         (*preeditStart) (XIMS, XPointer);
108     int         (*preeditEnd) (XIMS, XPointer);
109     int         (*syncXlib) (XIMS, XPointer);
110 } IMMethodsRec, *IMMethods;
111
112 typedef struct
113 {
114     Display     *display;
115     int         screen;
116 } IMCoreRec, *IMCore;
117
118 typedef struct _XIMS
119 {
120     IMMethods   methods;
121     IMCoreRec   core;
122     Bool        sync;
123     void        *protocol;
124 } XIMProtocolRec;
125
126 /* 
127  * X function declarations.
128  */
129 extern XIMS IMOpenIM (Display *, ...);
130 extern Status IMCloseIM (XIMS);
131 extern char *IMSetIMValues (XIMS, ...);
132 extern char *IMGetIMValues (XIMS, ...);
133 void IMForwardEvent (XIMS, XPointer);
134 void IMCommitString (XIMS, XPointer);
135 int IMCallCallback (XIMS, XPointer);
136 int IMPreeditStart (XIMS, XPointer);
137 int IMPreeditEnd (XIMS, XPointer);
138 int IMSyncXlib (XIMS, XPointer);
139
140 #ifdef __cplusplus
141 }
142 #endif
143
144 #endif /* IMdkit_h */