1 /* $Id: imfuncs.h,v 1.11 2002/01/07 15:34:14 ishisone Exp $ */
2 /*
3  * Copyright (c) 1994  Software Research Associates, Inc.
4  *
5  * Permission to use, copy, modify, and distribute this software and its
6  * documentation for any purpose and without fee is hereby granted, provided
7  * that the above copyright notice appear in all copies and that both that
8  * copyright notice and this permission notice appear in supporting
9  * documentation, and that the name of Software Research Associates not be
10  * used in advertising or publicity pertaining to distribution of the
11  * software without specific, written prior permission.  Software Research
12  * Associates makes no representations about the suitability of this software
13  * for any purpose.  It is provided "as is" without express or implied
14  * warranty.
15  *
16  * Author:  Makoto Ishisone, Software Research Associates, Inc., Japan
17  */
18 
19 #ifndef _imfuncs_h
20 #define _imfuncs_h
21 
22 #include "imprtype.h"
23 
24 /*
25  * Functions to get/put data (defined in imdata.c)
26  */
27 extern int IMGetC8 _Pt_((IMConnection *conn, int offset));
28 extern unsigned int IMGetC16 _Pt_((IMConnection *conn, int offset));
29 extern int IMGetI16 _Pt_((IMConnection *conn, int offset));
30 extern unsigned long IMGetC32 _Pt_((IMConnection *conn, int offset));
31 extern void IMGetString _Pt_((IMConnection *conn,
32 			       int offset, char *buf, int len));
33 
34 extern void IMPutC8 _Pt_((IMConnection *conn, int x));
35 extern void IMPutC16 _Pt_((IMConnection *conn, unsigned int x));
36 extern void IMPutC32 _Pt_((IMConnection *conn, unsigned long x));
37 extern void IMPutI16 _Pt_((IMConnection *conn, int x));
38 extern void IMPutString _Pt_((IMConnection *conn, char *s, int len));
39 extern void IMPutPad _Pt_((IMConnection *conn));
40 extern void IMRewriteC16 _Pt_((IMConnection *conn, int pos, unsigned int x));
41 
42 extern int IMWritePos _Pt_((IMConnection *conn));
43 
44 extern int IMPutHeader _Pt_((IMConnection *conn,
45 			     int major, int minor, int arglen));
46 extern void IMFinishRequest _Pt_((IMConnection *conn, int offset));
47 extern void IMCancelRequest _Pt_((IMConnection *conn, int offset));
48 extern void IMSendSimpleRequest _Pt_((IMConnection *conn,
49 				      int major, int minor));
50 extern void IMSendRequestWithIC _Pt_((IMConnection *conn,
51 				      int major, int minor, IMIC *icp));
52 
53 extern void IMSendError _Pt_((IMConnection *conn, int code,
54 			      unsigned int imid, unsigned int icid,
55 			      char *msg));
56 extern void IMSendBadProtocol _Pt_((IMConnection *conn, char *msg));
57 extern void IMSendBadLength _Pt_((IMConnection *conn,
58 				  unsigned int imid, unsigned int icid));
59 
60 /*
61  * Transport layer functions (defined in imxport.c)
62  */
63 extern int IMCreateTCPService _Pt_((int *portp, char *listenaddr));
64 extern IMConnection *IMTCPConnection _Pt_((Widget protocol, int socket));
65 extern int IMCreateUnixService _Pt_((char *path));
66 extern IMConnection *IMUnixConnection _Pt_((Widget protocol, int socket));
67 extern IMConnection *IMXConnection _Pt_((Widget protocol, XEvent *ev));
68 extern int IMFlush _Pt_((IMConnection *conn));
69 extern void IMShutdown _Pt_((IMConnection *conn));
70 extern void IMCloseConnection _Pt_((IMConnection *conn));
71 
72 /*
73  * Request dispatch functions (defined in imdispatch.c)
74  */
75 extern void IMSetInitialDispatcher _Pt_((IMConnection *conn));
76 extern void IMDispatch _Pt_((IMConnection *conn, int cond));
77 extern void IMSchedule _Pt_((IMConnection *conn, int type));
78 extern void IMProcessQueue _Pt_((Widget w));
79 
80 /*
81  * Function to compile request dispatch table (defined in imrequest.c)
82  */
83 extern void IMCompileReq _Pt_((void));
84 
85 /*
86  * Functions handling IM/IC creation/destruction/lookup (defined in imic.c)
87  */
88 extern IMIM *IMGetIM _Pt_((IMConnection *conn, int arglen));
89 extern IMIC *IMGetIC _Pt_((IMConnection *conn, int arglen));
90 extern IMIM *IMCreateIM _Pt_((IMConnection *conn, IMConverter *converter));
91 extern IMIC *IMCreateIC _Pt_((IMIM *imp));
92 extern void IMDestroyIM _Pt_((IMIM *imp));
93 extern void IMDestroyIC _Pt_((IMIC *imp));
94 
95 /*
96  * Functions handling conversion start/stop/etc. (defined in imconv.c)
97  */
98 extern int IMStartConversion _Pt_((IMIC *icp));
99 extern void IMStopConversion _Pt_((IMIC *icp));
100 extern int IMResetIC _Pt_((IMIC *icp, char **preedit_strp));
101 extern void IMForwardEvent _Pt_((IMIC *icp, XEvent *ev));
102 extern void IMSetFocus _Pt_((IMIC *icp));
103 extern void IMUnsetFocus _Pt_((IMIC *icp));
104 extern void IMStatusStart _Pt_((IMIC *icp));
105 extern void IMStatusDone _Pt_((IMIC *icp));
106 extern void IMStartForwarding _Pt_((IMIC *icp));
107 extern void IMStopForwarding _Pt_((IMIC *icp));
108 
109 /*
110  * Functions dealing with IM/IC attributes (defined in imattr.c)
111  */
112 extern void IMPutIMAttrList _Pt_((IMIM *imp));
113 extern void IMPutICAttrList _Pt_((IMIM *imp));
114 extern int IMSetIMValues _Pt_((IMIM *imp, char *data, int len, int major));
115 extern int IMGetIMValues _Pt_((IMIM *imp, char *data, int len, int offset));
116 extern int IMSetICValues _Pt_((IMIC *icp, char *data, int len, int major));
117 extern int IMGetICValues _Pt_((IMIC *icp, char *data, int len, int offset));
118 extern void IMFillDefault _Pt_((IMIC *icp,
119 				unsigned long common_mask,
120 				unsigned long preedit_mask,
121 				unsigned long status_mask));
122 extern int IMValidateWindow _Pt_((Display *dpy, Window win,
123 				  IMWindowProfile *profilep));
124 extern int IMValidateICAttributes _Pt_((IMIC *icp, int checkonly));
125 extern void IMFreeICAttributes _Pt_((IMIC *icp));
126 extern unsigned long IMMakeConvAttributes _Pt_((IMIC *icp,
127 						ConversionAttributes *attr));
128 extern void IMMoveLocation _Pt_((IMIC *icp, int x, int y));
129 
130 /*
131  * Functions interfacing imlib and IMProtocol widget (defined in improto.c)
132  */
133 extern void IMRegisterConnection _Pt_((IMConnection *conn));
134 extern void IMUnregisterConnection _Pt_((IMConnection *conn));
135 extern IMConnection *IMConnectionList _Pt_((Widget w));
136 extern void IMPushQueue _Pt_((IMConnection *conn));
137 extern IMConnection *IMPopQueue _Pt_((Widget w));
138 extern int IMQueueEmpty _Pt_((Widget w));
139 extern Pixel IMDefaultForeground _Pt_((Widget w));
140 extern Pixel IMDefaultBackground _Pt_((Widget w));
141 extern char *IMDefaultFontSet _Pt_((IMIM *imp));
142 extern FontBank IMFontBank _Pt_((IMIM *imp));
143 extern int IMStatusWidth _Pt_((Widget w));
144 extern void IMInitHash _Pt_((Widget w));
145 extern IMIM **IMIMHash _Pt_((Widget w));
146 extern IMIC **IMICHash _Pt_((Widget w));
147 extern unsigned int IMNextIMID _Pt_((Widget w));
148 extern unsigned int IMNextICID _Pt_((Widget w));
149 extern Atom IMCtextAtom _Pt_((Widget w));
150 extern Atom IMKi2CommAtom _Pt_((Widget w));
151 extern Atom IMXConnectAtom _Pt_((Widget w));
152 extern Atom IMProtocolAtom _Pt_((Widget w));
153 extern Atom IMMoreDataAtom _Pt_((Widget w));
154 extern IMTriggerKey *IMTriggerKeys _Pt_((IMIM *imp, int *num_triggersp));
155 extern IMConverter *IMGetConverter _Pt_((Widget w, char *locale));
156 
157 #endif /* _imfuncs_h */
158