comparison include/XimpProtoP.h @ 0:92745d501b9a

initial import from kinput2-v3.1
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Mon, 08 Mar 2010 04:44:30 +0900
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:92745d501b9a
1 /* $Id: XimpProtoP.h,v 1.12 1999/01/13 08:41:56 ishisone Exp $ */
2 /*
3 * Copyright (c) 1991 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 _XimpProtocolP_h
20 #define _XimpProtocolP_h
21
22 #include "FontBank.h"
23 #include "XimpProto.h"
24 #include "ConvCtrl.h"
25
26 typedef struct {
27 int ximp_dummy;
28 } XimpProtocolClassPart;
29
30 typedef struct _XimpProtocolClassRec {
31 CoreClassPart core_class;
32 XimpProtocolClassPart ximpprotocol_class;
33 } XimpProtocolClassRec;
34
35 extern XimpProtocolClassRec ximpProtocolClassRec;
36
37
38 typedef enum {
39 onthespot_style,
40 offthespot_style,
41 overthespot_style,
42 separate_style
43 } ConversionStyle;
44
45 typedef struct {
46 XIMStyle ximstyle;
47 ConversionStyle cstyle;
48 } XimpInputStyle;
49
50 typedef struct {
51 Position areax, areay;
52 Dimension areawidth, areaheight;
53 Pixel foreground, background;
54 Colormap colormap;
55 Pixmap bgpixmap;
56 Dimension linespacing;
57 Cursor cursor;
58 Dimension neededwidth, neededheight;
59 Position spotx, spoty;
60 String fontlist;
61 } XimpPreEditAttributes;
62
63 typedef struct {
64 Position areax, areay;
65 Dimension areawidth, areaheight;
66 Pixel foreground, background;
67 Colormap colormap;
68 Pixmap bgpixmap;
69 Dimension linespacing;
70 Cursor cursor;
71 Dimension neededwidth, neededheight;
72 Window statuswin;
73 String fontlist;
74 } XimpStatusAttributes;
75
76 typedef struct _convclient_ {
77 unsigned long id; /* ICID */
78 String version; /* client version string */
79 ConversionStyle style;
80 Widget protocolwidget; /* protocol widget */
81 Widget conversion; /* conversion widget */
82 Window reqwin; /* conversion requestor window */
83 Dimension reqwinwidth;
84 Dimension reqwinheight;
85 Window focuswin; /* focus window */
86 Dimension focuswidth;
87 Dimension focusheight;
88 Atom property; /* property to store converted string*/
89 XimpPreEditAttributes xpattrs; /* to keep specified values */
90 XimpStatusAttributes xsattrs; /* for GETVALUE request */
91 unsigned long xattrmask;
92 Boolean defaultsfilledin; /* if def.values are filled in */
93 EventSelectMethod esm;
94 XFontStruct **fonts;
95 int num_fonts;
96 XFontStruct **status_fonts;
97 int num_status_fonts;
98 Boolean resetting; /* now resetting */
99 XClientMessageEvent *event; /* current processing event */
100 XIMStyle ximstyle;
101 Boolean in_preedit;
102 Boolean in_status;
103 Atom preeditdata; /* property to store preedit data */
104 Atom preedittext; /* property to store preedit text */
105 Atom preeditfeedback;/* property to store preedit feedback */
106 Atom statustext; /* property to store status text */
107 Atom statusfeedback; /* property to store status feedback */
108 struct _convclient_ *next;
109 } ConvClient;
110
111 typedef struct _ximpfcache_ {
112 int sum;
113 String namelist;
114 XFontStruct **fonts;
115 Cardinal num_fonts;
116 struct _ximpfcache_ *next;
117 } XimpFontListCache;
118
119
120 typedef struct {
121 /* resources */
122 String localename;
123 String servername;
124 WidgetClass inputObjClass;
125 WidgetClass displayObjClass;
126 Boolean forceDefaultServer;
127 String defaultfontlist; /* default font list to be used */
128 Pixel foreground; /* default fg pixel */
129 String convkeys; /* conversion start/end keys */
130 Dimension statuswidth; /* default width of status area */
131 /* private state */
132 FontBank fontbank;
133 XFontStruct **deffonts;
134 int numdeffonts;
135 ConvClient *clients;
136 ConvClient *freeclients; /* free list */
137 unsigned long icid; /* next ICID */
138 int propid;
139 int callbackpropid;
140 /* atoms */
141 Atom selAtom1; /* _XIMP_<localeName> */
142 Atom selAtom2; /* _XIMP_<localeName>@<serverName>.<screen> */
143 Atom ctextAtom; /* COMPOUND_TEXT */
144 Atom ximpVersionAtom; /* _XIMP_VERSION */
145 Atom ximpStyleAtom; /* _XIMP_STYLE */
146 Atom ximpKeysAtom; /* _XIMP_KEYS */
147 Atom ximpServerNameAtom; /* _XIMP_SERVERNAME */
148 Atom ximpServerVersionAtom; /* _XIMP_SERVERVERSION */
149 Atom ximpVendorNameAtom; /* _XIMP_VENDORNAME */
150 Atom ximpExtensionsAtom; /* _XIMP_EXTENSIONS */
151 Atom ximpProtocolAtom; /* _XIMP_PROTOCOL */
152 Atom ximpFocusAtom; /* _XIMP_FOCUS */
153 Atom ximpPreeditAtom; /* _XIMP_PREEDIT */
154 Atom ximpStatusAtom; /* _XIMP_STATUS */
155 Atom ximpPreeditFontAtom; /* _XIMP_PREEDITFONT */
156 Atom ximpStatusFontAtom; /* _XIMP_STATUSFONT */
157 Atom ximpExtXimpBackFrontAtom; /* _XIMP_EXT_XIMP_BACK_FRONT */
158 Atom ximpPreeditDrawDataAtom; /* _XIMP_PREEDIT_DRAW_DATA */
159 Atom ximpFeedbacksAtom; /* _XIMP_FEEDBACKS */
160 } XimpProtocolPart;
161
162 typedef struct _XimpProtocolRec {
163 CorePart core;
164 XimpProtocolPart ximp;
165 } XimpProtocolRec;
166
167 #endif