Debian Codegraph @

nx-X11/lib/src/XomGeneric.h

raw
1 /*
2 * Copyright 1992, 1993 by TOSHIBA Corp.
3 *
4 * Permission to use, copy, modify, and distribute this software and its
5 * documentation for any purpose and without fee is hereby granted, provided
6 * that the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of TOSHIBA not be used in advertising
9 * or publicity pertaining to distribution of the software without specific,
10 * written prior permission. TOSHIBA make no representations about the
11 * suitability of this software for any purpose. It is provided "as is"
12 * without express or implied warranty.
13 *
14 * TOSHIBA DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
15 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
16 * TOSHIBA BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
17 * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
19 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
20 * SOFTWARE.
21 *
22 * Author: Katsuhisa Yano TOSHIBA Corp.
23 * [email protected]
24 */
25 /*
26 * Copyright 1995 by FUJITSU LIMITED
27 * This is source code modified by FUJITSU LIMITED under the Joint
28 * Development Agreement for the CDE/Motif PST.
29 *
30 * Modifier: Takanori Tateno FUJITSU LIMITED
31 *
32 */
33
34 #ifndef _XOMGENERIC_H_
35 #define _XOMGENERIC_H_
36
37 #include "XlcPublic.h"
38
39 #define XOM_GENERIC(om) (&((XOMGeneric) om)->gen)
40 #define XOC_GENERIC(font_set) (&((XOCGeneric) font_set)->gen)
41
42 /* For VW/UDC */
43 typedef struct _CodeRangeRec {
44 unsigned long start;
45 unsigned long end;
46 unsigned long dmy1;
47 unsigned long dmy2;
48 } CodeRangeRec, *CodeRange;
49
50 typedef struct _VRotateRec {
51 char *charset_name; /* Charset name */
52 XlcSide side; /* Encoding side */
53 int num_cr;
54 CodeRange code_range;
55 char *xlfd_name;
56 XFontStruct *font;
57 } VRotateRec, *VRotate;
58
59 typedef enum {
60 XOMMultiByte,
61 XOMWideChar,
62 XOMUtf8String
63 } XOMTextType;
64
65 typedef struct _FontDataRec {
66 char *name;
67 XlcSide side;
68 /* For VW/UDC */
69 int scopes_num;
70 FontScope scopes;
71 char *xlfd_name;
72 XFontStruct *font;
73 } FontDataRec, *FontData;
74
75 #define VROTATE_NONE 0
76 #define VROTATE_PART 1
77 #define VROTATE_ALL 2
78
79 typedef struct _OMDataRec {
80 int charset_count;
81 XlcCharSet *charset_list;
82 int font_data_count;
83 FontData font_data;
84 /* For VW/UDC */
85 int substitute_num;
86 FontData substitute;
87 /* Vertical Writing */
88 int vmap_num;
89 FontData vmap;
90 int vrotate_type;
91 int vrotate_num;
92 CodeRange vrotate;
93 } OMDataRec, *OMData;
94
95 typedef struct _XOMGenericPart {
96 int data_num;
97 OMData data;
98 Bool on_demand_loading;
99 char *object_name;
100 } XOMGenericPart;
101
102 typedef struct _XOMGenericRec {
103 XOMMethods methods;
104 XOMCoreRec core;
105 XOMGenericPart gen;
106 } XOMGenericRec, *XOMGeneric;
107
108 /*
109 * XOC dependent data
110 */
111
112 typedef struct _FontSetRec {
113 int id;
114 int charset_count;
115 XlcCharSet *charset_list;
116 int font_data_count;
117 FontData font_data;
118 char *font_name;
119 XFontStruct *info;
120 XFontStruct *font;
121 XlcSide side;
122 Bool is_xchar2b;
123 /* For VW/UDC */
124 int substitute_num;
125 FontData substitute;
126 /* Vertical Writing */
127 int vpart_initialize;
128 int vmap_num;
129 FontData vmap;
130 int vrotate_num;
131 VRotate vrotate;
132 } FontSetRec, *FontSet;
133
134 typedef struct _XOCGenericPart {
135 XlcConv mbs_to_cs;
136 XlcConv wcs_to_cs;
137 XlcConv utf8_to_cs;
138 int font_set_num;
139 FontSet font_set;
140 } XOCGenericPart;
141
142 typedef struct _XOCGenericRec {
143 XOCMethods methods;
144 XOCCoreRec core;
145 XOCGenericPart gen;
146 } XOCGenericRec, *XOCGeneric;
147
148 _XFUNCPROTOBEGIN
149
150 extern XOM _XomGenericOpenOM(
151 XLCd /* lcd */,
152 Display* /* dpy */,
153 XrmDatabase /* rdb */,
154 _Xconst char* /* res_name */,
155 _Xconst char* /* res_class */
156 );
157
158 extern XlcConv _XomInitConverter(
159 XOC /* oc */,
160 XOMTextType /* type */
161 );
162
163 extern int _XomConvert(
164 XOC /* oc */,
165 XlcConv /* conv */,
166 XPointer* /* from */,
167 int* /* from_left */,
168 XPointer* /* to */,
169 int* /* to_left */,
170 XPointer* /* args */,
171 int /* num_args */
172 );
173
174 extern int
175 _XmbDefaultTextEscapement(XOC oc, _Xconst char *text, int length);
176 extern int
177 _XwcDefaultTextEscapement(XOC oc, _Xconst wchar_t *text, int length);
178 extern int
179 _Xutf8DefaultTextEscapement(XOC oc, _Xconst char *text, int length);
180 extern int
181 _XmbDefaultTextExtents(XOC oc, _Xconst char *text, int length,
182 XRectangle *overall_ink, XRectangle *overall_logical);
183 extern int
184 _XwcDefaultTextExtents(XOC oc, _Xconst wchar_t *text, int length,
185 XRectangle *overall_ink, XRectangle *overall_logical);
186 extern int
187 _Xutf8DefaultTextExtents(XOC oc, _Xconst char *text, int length,
188 XRectangle *overall_ink, XRectangle *overall_logical);
189 extern Status
190 _XmbDefaultTextPerCharExtents(
191 XOC oc, _Xconst char *text, int length,
192 XRectangle *ink_buf, XRectangle *logical_buf,
193 int buf_size, int *num_chars,
194 XRectangle *overall_ink,
195 XRectangle *overall_logical);
196 extern Status
197 _XwcDefaultTextPerCharExtents(
198 XOC oc, _Xconst wchar_t *text, int length,
199 XRectangle *ink_buf, XRectangle *logical_buf,
200 int buf_size, int *num_chars,
201 XRectangle *overall_ink,
202 XRectangle *overall_logical);
203 extern Status
204 _Xutf8DefaultTextPerCharExtents(
205 XOC oc, _Xconst char *text, int length,
206 XRectangle *ink_buf, XRectangle *logical_buf,
207 int buf_size, int *num_chars,
208 XRectangle *overall_ink,
209 XRectangle *overall_logical);
210 extern int
211 _XmbDefaultDrawString(Display *dpy, Drawable d, XOC oc, GC gc, int x, int y,
212 _Xconst char *text, int length);
213 extern int
214 _XwcDefaultDrawString(Display *dpy, Drawable d, XOC oc, GC gc, int x, int y,
215 _Xconst wchar_t *text, int length);
216 extern int
217 _Xutf8DefaultDrawString(Display *dpy, Drawable d, XOC oc, GC gc, int x, int y,
218 _Xconst char *text, int length);
219 extern void
220 _XmbDefaultDrawImageString(Display *dpy, Drawable d, XOC oc, GC gc, int x,
221 int y, _Xconst char *text, int length);
222 extern void
223 _XwcDefaultDrawImageString(Display *dpy, Drawable d, XOC oc, GC gc, int x,
224 int y, _Xconst wchar_t *text, int length);
225 extern void
226 _Xutf8DefaultDrawImageString(Display *dpy, Drawable d, XOC oc, GC gc, int x,
227 int y, _Xconst char *text, int length);
228
229 extern int
230 _XmbGenericTextEscapement(XOC oc, _Xconst char *text, int length);
231 extern int
232 _XmbGenericTextExtents(XOC oc, _Xconst char *text, int length,
233 XRectangle *overall_ink, XRectangle *overall_logical);
234 extern int
235 _Xutf8GenericDrawString(Display *dpy, Drawable d, XOC oc, GC gc, int x, int y,
236 _Xconst char *text, int length);
237 extern void
238 _Xutf8GenericDrawImageString(Display *dpy, Drawable d, XOC oc, GC gc, int x,
239 int y, _Xconst char *text, int length);
240 extern Status
241 _Xutf8GenericTextPerCharExtents(
242 XOC oc, _Xconst char *text, int length,
243 XRectangle *ink_buf, XRectangle *logical_buf,
244 int buf_size, int *num_chars,
245 XRectangle *overall_ink,
246 XRectangle *overall_logical);
247 extern int
248 _Xutf8GenericTextExtents(XOC oc, _Xconst char *text, int length,
249 XRectangle *overall_ink, XRectangle *overall_logical);
250 extern int
251 _Xutf8GenericTextEscapement(XOC oc, _Xconst char *text, int length);
252 extern void
253 _XwcGenericDrawImageString(Display *dpy, Drawable d, XOC oc, GC gc, int x,
254 int y, _Xconst wchar_t *text, int length);
255 extern int
256 _XwcGenericDrawString(Display *dpy, Drawable d, XOC oc, GC gc, int x, int y,
257 _Xconst wchar_t *text, int length);
258 extern Status
259 _XwcGenericTextPerCharExtents(XOC oc, _Xconst wchar_t *text, int length,
260 XRectangle *ink_buf, XRectangle *logical_buf,
261 int buf_size, int *num_chars,
262 XRectangle *overall_ink,
263 XRectangle *overall_logical);
264 extern int
265 _XwcGenericTextExtents(XOC oc, _Xconst wchar_t *text, int length,
266 XRectangle *overall_ink, XRectangle *overall_logical);
267 extern int
268 _XwcGenericTextEscapement(XOC oc, _Xconst wchar_t *text, int length);
269 extern void
270 _XmbGenericDrawImageString(Display *dpy, Drawable d, XOC oc, GC gc, int x,
271 int y, _Xconst char *text, int length);
272 extern int
273 _XmbGenericDrawString(Display *dpy, Drawable d, XOC oc, GC gc, int x, int y,
274 _Xconst char *text, int length);
275 extern Status
276 _XmbGenericTextPerCharExtents(XOC oc, _Xconst char *text, int length,
277 XRectangle *ink_buf, XRectangle *logical_buf,
278 int buf_size, int *num_chars,
279 XRectangle *overall_ink,
280 XRectangle *overall_logical);
281
282 extern FontData
283 read_EncodingInfo(
284 int count,
285 char **value);
286
287 extern int
288 _XomGenericDrawString(
289 Display *dpy,
290 Drawable d,
291 XOC oc,
292 GC gc,
293 int x, int y,
294 XOMTextType type,
295 XPointer text,
296 int length);
297 extern int
298 _XomGenericTextExtents(
299 XOC oc,
300 XOMTextType type,
301 XPointer text,
302 int length,
303 XRectangle *overall_ink,
304 XRectangle *overall_logical);
305 extern FontData
306 _XomGetFontDataFromFontSet(
307 FontSet fs,
308 unsigned char *str,
309 int len,
310 int *len_ret,
311 int is2b,
312 int type);
313
314 _XFUNCPROTOEND
315
316 #endif /* _XOMGENERIC_H_ */