Xlcint.h revision 1ab64890
1/* $Xorg: Xlcint.h,v 1.4 2001/02/09 02:03:38 xorgcvs Exp $ */
2/*
3
4Copyright 1991, 1998  The Open Group
5
6Permission to use, copy, modify, distribute, and sell this software and its
7documentation for any purpose is hereby granted without fee, provided that
8the above copyright notice appear in all copies and that both that
9copyright notice and this permission notice appear in supporting
10documentation.
11
12The above copyright notice and this permission notice shall be included
13in all copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
19OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21OTHER DEALINGS IN THE SOFTWARE.
22
23Except as contained in this notice, the name of The Open Group shall
24not be used in advertising or otherwise to promote the sale, use or
25other dealings in this Software without prior written authorization
26from The Open Group.
27
28*/
29/* $XFree86: xc/lib/X11/Xlcint.h,v 3.16 2003/04/17 02:06:31 dawes Exp $ */
30
31/*
32 * Copyright 1990, 1991 by OMRON Corporation, NTT Software Corporation,
33 *                      and Nippon Telegraph and Telephone Corporation
34 * Copyright 1991 by the Open Software Foundation
35 * Copyright 1993 by the TOSHIBA Corp.
36 * Copyright 1993, 1994 by Sony Corporation
37 * Copyright 1993, 1994 by the FUJITSU LIMITED
38 *
39 * Permission to use, copy, modify, distribute, and sell this software and its
40 * documentation for any purpose is hereby granted without fee, provided that
41 * the above copyright notice appear in all copies and that both that
42 * copyright notice and this permission notice appear in supporting
43 * documentation, and that the names of OMRON, NTT Software, NTT, Open
44 * Software Foundation, and Sony Corporation not be used in advertising
45 * or publicity pertaining to distribution of the software without specific,
46 * written prior permission. OMRON, NTT Software, NTT, Open Software
47 * Foundation, and Sony Corporation  make no representations about the
48 * suitability of this software for any purpose.  It is provided "as is"
49 * without express or implied warranty.
50 *
51 * OMRON, NTT SOFTWARE, NTT, OPEN SOFTWARE FOUNDATION, AND SONY
52 * CORPORATION DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
53 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
54 * SHALL OMRON, NTT SOFTWARE, NTT, OPEN SOFTWARE FOUNDATION, OR SONY
55 * CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
56 * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
57 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
58 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
59 *
60 *	Authors: Li Yuhong		OMRON Corporation
61 *		 Tatsuya Kato		NTT Software Corporation
62 *		 Hiroshi Kuribayashi	OMRON Coproration
63 *		 Muneiyoshi Suzuki	Nippon Telegraph and Telephone Co.
64 *
65 *		 M. Collins		OSF
66 *		 Katsuhisa Yano		TOSHIBA Corp.
67 *               Makoto Wakamatsu       Sony Corporation
68 *               Takashi Fujiwara	FUJITSU LIMITED
69 */
70
71
72#ifndef	_XLCINT_H_
73#define	_XLCINT_H_
74
75#ifndef _XP_PRINT_SERVER_
76
77#include <X11/Xresource.h>
78#include <X11/Xutil.h>
79#include <stdarg.h>
80
81typedef Bool (*XFilterEventProc)(
82    Display*		/* display */,
83    Window		/* window */,
84    XEvent*		/* event */,
85    XPointer		/* client_data */
86);
87
88typedef struct _XIMFilter {
89    struct _XIMFilter *next;
90    Window window;
91    unsigned long event_mask;
92    int start_type, end_type;
93    XFilterEventProc filter;
94    XPointer client_data;
95} XFilterEventRec, *XFilterEventList;
96
97typedef struct {
98    char    *name;
99    XPointer value;
100} XIMArg;
101
102#ifdef offsetof
103#define XOffsetOf(s_type,field) offsetof(s_type,field)
104#else
105#define XOffsetOf(s_type,field) ((unsigned int)&(((s_type*)NULL)->field))
106#endif
107
108#define XIMNumber(arr) ((unsigned int) (sizeof(arr) / sizeof(arr[0])))
109
110/*
111 * define secondary data structs which are part of Input Methods
112 * and Input Context
113 */
114typedef struct {
115    const char		*resource_name;		/* Resource string */
116    XrmQuark		xrm_name;		/* Resource name quark */
117    int			resource_size;		/* Size in bytes of data */
118    long		resource_offset;	/* Offset from base */
119    unsigned short 	mode;			/* Read Write Permission */
120    unsigned short 	id;			/* Input Method Protocol */
121} XIMResource, *XIMResourceList;
122
123/*
124 * data block describing the visual attributes associated with
125 * an input context
126 */
127typedef struct {
128    XRectangle		area;
129    XRectangle		area_needed;
130    XPoint		spot_location;
131    Colormap		colormap;
132    Atom		std_colormap;
133    unsigned long	foreground;
134    unsigned long	background;
135    Pixmap		background_pixmap;
136    XFontSet            fontset;
137    int	       		line_spacing;
138    Cursor		cursor;
139    XICCallback		start_callback;
140    XICCallback		done_callback;
141    XICCallback		draw_callback;
142    XICCallback		caret_callback;
143    XIMPreeditState	preedit_state;
144    XICCallback		state_notify_callback;
145} ICPreeditAttributes, *ICPreeditAttributesPtr;
146
147typedef struct {
148    XRectangle		area;
149    XRectangle		area_needed;
150    Colormap		colormap;
151    Atom		std_colormap;
152    unsigned long	foreground;
153    unsigned long	background;
154    Pixmap		background_pixmap;
155    XFontSet            fontset;
156    int	       		line_spacing;
157    Cursor		cursor;
158    XICCallback		start_callback;
159    XICCallback		done_callback;
160    XICCallback		draw_callback;
161} ICStatusAttributes, *ICStatusAttributesPtr;
162
163#endif /* !_XP_PRINT_SERVER_ */
164
165/*
166 * Methods for Xrm parsing
167 */
168
169/* The state is a pointer to an object created by the locale's
170   init_parse_info function (default: _XrmDefaultInitParseInfo). */
171
172/* Sets the state to the initial state.
173   Initiates a sequence of calls to the XmbCharProc. */
174typedef void (*XmbInitProc)(
175    XPointer		state
176);
177
178/* Transforms one multibyte character, starting at str, and return a 'char'
179   in the same parsing class (not a wide character!). Returns the number of
180   consumed bytes in *lenp. */
181typedef char (*XmbCharProc)(
182    XPointer		state,
183    const char *	str,
184    int*		lenp
185);
186
187/* Terminates a sequence of calls to the XmbCharProc. */
188typedef void (*XmbFinishProc)(
189    XPointer		state
190);
191
192/* Returns the name of the state's locale, as a static string. */
193typedef const char* (*XlcNameProc)(
194    XPointer		state
195);
196
197/* Frees the state, which was allocated by the locale's init_parse_info
198   function. */
199typedef void (*XrmDestroyProc)(
200    XPointer		state
201);
202
203/* Set of methods for Xrm parsing. */
204typedef struct {
205    XmbInitProc		mbinit;
206    XmbCharProc		mbchar;
207    XmbFinishProc	mbfinish;
208    XlcNameProc		lcname;
209    XrmDestroyProc	destroy;
210} XrmMethodsRec;
211typedef const XrmMethodsRec *XrmMethods;
212
213#ifndef _XP_PRINT_SERVER_
214
215typedef struct _XLCd *XLCd; /* need forward reference */
216
217/*
218 * define an LC, it's methods, and data.
219 */
220
221typedef void (*XCloseLCProc)(
222    XLCd		/* lcd */
223);
224
225typedef char* (*XlcMapModifiersProc)(
226    XLCd		/* lcd */,
227    _Xconst char*	/* user_mods */,
228    _Xconst char*	/* prog_mods */
229);
230
231typedef XOM (*XOpenOMProc)(
232    XLCd		/* lcd */,
233    Display*		/* display */,
234    XrmDatabase		/* rdb */,
235    _Xconst char*	/* res_name */,
236    _Xconst char*	/* res_class */
237);
238
239typedef XIM (*XOpenIMProc)(
240    XLCd		/* lcd */,
241    Display*		/* display */,
242    XrmDatabase		/* rdb */,
243    char*		/* res_name */,
244    char*		/* res_class */
245);
246
247typedef Bool (*XRegisterIMInstantiateCBProc)(
248    XLCd		/* lcd */,
249    Display*		/* display */,
250    XrmDatabase		/* rdb */,
251    char*		/* res_name */,
252    char*		/* res_class */,
253    XIDProc		/* callback */,
254    XPointer		/* client_data */
255);
256
257typedef Bool (*XUnregisterIMInstantiateCBProc)(
258    XLCd		/* lcd */,
259    Display*		/* display */,
260    XrmDatabase		/* rdb */,
261    char*		/* res_name */,
262    char*		/* res_class */,
263    XIDProc		/* callback */,
264    XPointer		/* client_data */
265);
266
267typedef XrmMethods (*XrmInitParseInfoProc)(
268    XLCd		/* lcd */,
269    XPointer*		/* state */
270);
271
272typedef int (*XmbTextPropertyToTextListProc)(
273    XLCd		lcd,
274    Display*		display,
275    const XTextProperty* text_prop,
276    char***		list_return,
277    int*		count_return
278);
279
280typedef int (*XwcTextPropertyToTextListProc)(
281    XLCd		lcd,
282    Display*		display,
283    const XTextProperty* text_prop,
284    wchar_t***		list_return,
285    int*		count_return
286);
287
288typedef int (*XmbTextListToTextPropertyProc)(
289    XLCd		lcd,
290    Display*		display,
291    char**		list,
292    int			count,
293    XICCEncodingStyle	style,
294    XTextProperty*	text_prop_return
295);
296
297typedef int (*XwcTextListToTextPropertyProc)(
298    XLCd		lcd,
299    Display*		display,
300    wchar_t**		list,
301    int			count,
302    XICCEncodingStyle	style,
303    XTextProperty*	text_prop_return
304);
305
306typedef void (*XwcFreeStringListProc)(
307    XLCd		lcd,
308    wchar_t**		list
309);
310
311typedef const char* (*XDefaultStringProc)(
312    XLCd		lcd
313);
314
315typedef struct {
316    XCloseLCProc			close;
317    XlcMapModifiersProc			map_modifiers;
318    XOpenOMProc				open_om;
319    XOpenIMProc				open_im;
320    XrmInitParseInfoProc		init_parse_info;
321    XmbTextPropertyToTextListProc	mb_text_prop_to_list;
322    XwcTextPropertyToTextListProc	wc_text_prop_to_list;
323    XmbTextPropertyToTextListProc	utf8_text_prop_to_list;
324    XmbTextListToTextPropertyProc	mb_text_list_to_prop;
325    XwcTextListToTextPropertyProc	wc_text_list_to_prop;
326    XmbTextListToTextPropertyProc	utf8_text_list_to_prop;
327    XwcFreeStringListProc		wc_free_string_list;
328    XDefaultStringProc			default_string;
329    XRegisterIMInstantiateCBProc	register_callback;
330    XUnregisterIMInstantiateCBProc	unregister_callback;
331} XLCdMethodsRec, *XLCdMethods;
332
333
334typedef struct {
335    char*		name;			/* name of this LC */
336    char*		modifiers;		/* modifiers of locale */
337} XLCdCoreRec, *XLCdCore;
338
339
340typedef struct _XLCd {
341    XLCdMethods		methods;		/* methods of this LC */
342    XLCdCore		core;			/* data of this LC */
343    XPointer		opaque;			/* LDX specific data */
344} XLCdRec;
345
346typedef int XlcPosition;
347
348#define XlcHead		0
349#define XlcTail		-1
350
351typedef struct {
352    char *name;
353    XPointer value;
354} XlcArg, *XlcArgList;
355
356typedef struct _XlcResource {
357    const char *name;
358    XrmQuark xrm_name;
359    int size;
360    int offset;
361    unsigned long mask;
362} XlcResource, *XlcResourceList;
363
364#define XlcCreateMask	(1L<<0)
365#define XlcDefaultMask	(1L<<1)
366#define XlcGetMask	(1L<<2)
367#define XlcSetMask	(1L<<3)
368#define XlcIgnoreMask	(1L<<4)
369
370#define XlcNumber(arr)	(sizeof(arr) / sizeof(arr[0]))
371
372typedef Status (*XCloseOMProc)(
373    XOM			/* om */
374);
375
376typedef char* (*XSetOMValuesProc)(
377    XOM			/* om */,
378    XlcArgList		/* args */,
379    int			/* num_args */
380);
381
382typedef char* (*XGetOMValuesProc)(
383    XOM			/* om */,
384    XlcArgList		/* args */,
385    int			/* num_args */
386);
387
388typedef XOC (*XCreateOCProc)(
389    XOM			/* om */,
390    XlcArgList		/* args */,
391    int			/* num_args */
392);
393
394typedef struct _XOMMethodsRec {
395    XCloseOMProc	close;
396    XSetOMValuesProc	set_values;
397    XGetOMValuesProc	get_values;
398    XCreateOCProc	create_oc;
399} XOMMethodsRec, *XOMMethods;
400
401typedef struct _XOMCoreRec {
402    XLCd lcd;				/* lcd */
403    Display *display;			/* display */
404    XrmDatabase rdb;			/* database */
405    char *res_name;			/* resource name */
406    char *res_class;			/* resource class */
407    XOC oc_list;			/* xoc list */
408    XlcResourceList resources;		/* xom resources */
409    int num_resources;			/* number of xom resources */
410    XOMCharSetList required_charset;	/* required charset list */
411    XOMOrientation orientation_list;	/* orientation list */
412    Bool directional_dependent;		/* directional-dependent */
413    Bool contextual_drawing;		/* contextual drawing */
414    Bool context_dependent;		/* context-dependent drawing */
415} XOMCoreRec, *XOMCore;
416
417typedef struct _XOM {
418    XOMMethods methods;
419    XOMCoreRec core;
420} XOMRec;
421
422typedef void (*XDestroyOCProc)(
423    XOC			/* oc */
424);
425
426typedef char* (*XSetOCValuesProc)(
427    XOC			/* oc */,
428    XlcArgList		/* args */,
429    int			/* num_args */
430);
431
432typedef char* (*XGetOCValuesProc)(
433    XOC			/* oc */,
434    XlcArgList		/* args */,
435    int			/* num_args */
436);
437
438/*
439 * X Font Sets are an instantiable object, so we define it, the
440 * object itself, a method list and data
441 */
442
443/*
444 * XFontSet object method list
445 */
446
447typedef int (*XmbTextEscapementProc)(
448    XFontSet		/* font_set */,
449    _Xconst char*	/* text */,
450    int			/* text_len */
451);
452
453typedef int (*XmbTextExtentsProc)(
454    XFontSet		/* font_set */,
455    _Xconst char*	/* text */,
456    int			/* text_len */,
457    XRectangle*		/* overall_ink_extents */,
458    XRectangle*		/* overall_logical_extents */
459);
460
461typedef Status (*XmbTextPerCharExtentsProc)(
462    XFontSet		/* font_set */,
463    _Xconst char*	/* text */,
464    int			/* text_len */,
465    XRectangle*		/* ink_extents_buffer */,
466    XRectangle*		/* logical_extents_buffer */,
467    int			/* buffer_size */,
468    int*		/* num_chars */,
469    XRectangle*		/* max_ink_extents */,
470    XRectangle*		/* max_logical_extents */
471);
472
473typedef int (*XmbDrawStringProc)(
474    Display*		/* display */,
475    Drawable		/* drawable */,
476    XFontSet		/* font_set */,
477    GC			/* gc */,
478    int			/* x */,
479    int			/* y */,
480    _Xconst char*	/* text */,
481    int			/* text_len */
482);
483
484typedef void (*XmbDrawImageStringProc)(
485    Display*		/* display */,
486    Drawable		/* drawable */,
487    XFontSet		/* font_set */,
488    GC			/* gc */,
489    int			/* x */,
490    int			/* y */,
491    _Xconst char*	/* text */,
492    int			/* text_len */
493);
494
495typedef int (*XwcTextEscapementProc)(
496    XFontSet		/* font_set */,
497    _Xconst wchar_t*	/* text */,
498    int			/* text_len */
499);
500
501typedef int (*XwcTextExtentsProc)(
502    XFontSet		/* font_set */,
503    _Xconst wchar_t*	/* text */,
504    int			/* text_len */,
505    XRectangle*		/* overall_ink_extents */,
506    XRectangle*		/* overall_logical_extents */
507);
508
509typedef Status (*XwcTextPerCharExtentsProc)(
510    XFontSet		/* font_set */,
511    _Xconst wchar_t*	/* text */,
512    int			/* text_len */,
513    XRectangle*		/* ink_extents_buffer */,
514    XRectangle*		/* logical_extents_buffer */,
515    int			/* buffer_size */,
516    int*		/* num_chars */,
517    XRectangle*		/* max_ink_extents */,
518    XRectangle*		/* max_logical_extents */
519);
520
521typedef int (*XwcDrawStringProc)(
522    Display*		/* display */,
523    Drawable		/* drawable */,
524    XFontSet		/* font_set */,
525    GC			/* gc */,
526    int			/* x */,
527    int			/* y */,
528    _Xconst wchar_t*	/* text */,
529    int			/* text_len */
530);
531
532typedef void (*XwcDrawImageStringProc)(
533    Display*		/* display */,
534    Drawable		/* drawable */,
535    XFontSet		/* font_set */,
536    GC			/* gc */,
537    int			/* x */,
538    int			/* y */,
539    _Xconst wchar_t*	/* text */,
540    int			/* text_len */
541);
542
543typedef struct {
544    XDestroyOCProc 		destroy;
545    XSetOCValuesProc 		set_values;
546    XGetOCValuesProc 		get_values;
547
548    /* multi-byte text drawing methods */
549
550    XmbTextEscapementProc	mb_escapement;
551    XmbTextExtentsProc		mb_extents;
552    XmbTextPerCharExtentsProc	mb_extents_per_char;
553    XmbDrawStringProc		mb_draw_string;
554    XmbDrawImageStringProc	mb_draw_image_string;
555
556    /* wide character text drawing methods */
557
558    XwcTextEscapementProc	wc_escapement;
559    XwcTextExtentsProc		wc_extents;
560    XwcTextPerCharExtentsProc	wc_extents_per_char;
561    XwcDrawStringProc		wc_draw_string;
562    XwcDrawImageStringProc	wc_draw_image_string;
563
564    /* UTF-8 text drawing methods */
565
566    XmbTextEscapementProc	utf8_escapement;
567    XmbTextExtentsProc		utf8_extents;
568    XmbTextPerCharExtentsProc	utf8_extents_per_char;
569    XmbDrawStringProc		utf8_draw_string;
570    XmbDrawImageStringProc	utf8_draw_image_string;
571} XOCMethodsRec, *XOCMethods;
572
573
574/*
575 * XOC independent data
576 */
577
578typedef struct {
579    XOM om;				/* XOM */
580    XOC next;				/* next XOC */
581    XlcResourceList resources;		/* xoc resources */
582    int num_resources;			/* number of xoc resources */
583    char *base_name_list;     		/* base font name list */
584    Bool om_automatic;			/* OM Automatic */
585    XOMFontInfo font_info;		/* font info */
586    XFontSetExtents font_set_extents;  	/* font set extents */
587    char *default_string;     		/* default string */
588    XOMCharSetList missing_list;	/* missing charset list */
589    XOrientation orientation;		/* orientation */
590    char *res_name;			/* resource name */
591    char *res_class;			/* resource class */
592} XOCCoreRec, *XOCCore;
593
594typedef struct _XOC {
595    XOCMethods methods;
596    XOCCoreRec core;
597} XOCRec;
598
599
600/*
601 * X Input Managers are an instantiable object, so we define it, the
602 * object itself, a method list and data.
603 */
604
605/*
606 * an Input Manager object method list
607 */
608typedef struct {
609    Status (*close)(
610	XIM
611	);
612    char* (*set_values)(
613	XIM, XIMArg*
614	);
615    char* (*get_values)(
616	XIM, XIMArg*
617	);
618    XIC (*create_ic)(
619	XIM, XIMArg*
620	);
621    int (*ctstombs)(
622	XIM, char*, int, char*, int, Status *
623	);
624    int (*ctstowcs)(
625	XIM, char*, int, wchar_t*, int, Status *
626	);
627    int (*ctstoutf8)(
628	XIM, char*, int, char*, int, Status *
629	);
630} XIMMethodsRec, *XIMMethods;
631
632/*
633 * Input Manager LC independent data
634 */
635typedef struct {
636    XLCd		lcd;			/* LC of this input method */
637    XIC			ic_chain;		/* list of ICs for this IM */
638
639    Display *		display;               	/* display */
640    XrmDatabase 	rdb;
641    char *		res_name;
642    char *		res_class;
643
644    XIMValuesList	*im_values_list;
645    XIMValuesList	*ic_values_list;
646    XIMStyles		*styles;
647    XIMCallback		 destroy_callback;
648    char *		im_name;		/* XIMMODIFIER name */
649    XIMResourceList	im_resources;		/* compiled IM resource list */
650    unsigned int	im_num_resources;
651    XIMResourceList	ic_resources;		/* compiled IC resource list */
652    unsigned int	ic_num_resources;
653    Bool		visible_position;
654} XIMCoreRec, *XIMCore;
655
656
657
658/*
659 * An X Input Manager (IM).  Implementations may need to extend this data
660 * structure to accomodate additional data, state information etc.
661 */
662typedef struct _XIM {
663    XIMMethods		methods;		/* method list of this IM */
664    XIMCoreRec		core;			/* data of this IM */
665} XIMRec;
666
667
668
669/*
670 * X Input Contexts (IC) are an instantiable object, so we define it, the
671 * object itself, a method list and data for this object
672 */
673
674/*
675 * Input Context method list
676 */
677typedef struct {
678    void (*destroy)(
679	XIC
680	);
681    void (*set_focus)(
682	XIC
683	);
684    void (*unset_focus)(
685	XIC
686	);
687    char* (*set_values)(
688	XIC, XIMArg*
689	);
690    char* (*get_values)(
691	XIC, XIMArg*
692	);
693    char* (*mb_reset)(
694	XIC
695	);
696    wchar_t* (*wc_reset)(
697	XIC
698	);
699    char* (*utf8_reset)(
700	XIC
701	);
702    int (*mb_lookup_string)(
703	XIC, XKeyEvent*, char*, int, KeySym*, Status*
704	);
705    int (*wc_lookup_string)(
706	XIC, XKeyEvent*, wchar_t*, int, KeySym*, Status*
707	);
708    int (*utf8_lookup_string)(
709	XIC, XKeyEvent*, char*, int, KeySym*, Status*
710	);
711} XICMethodsRec, *XICMethods;
712
713
714/*
715 * Input Context LC independent data
716 */
717typedef struct {
718    XIM			im;			/* XIM this IC belongs too */
719    XIC			next;			/* linked list of ICs for IM */
720
721    Window		client_window;		/* window IM can use for */
722						/* display or subwindows */
723    XIMStyle		input_style;		/* IM's input style */
724    Window		focus_window;		/* where key events go */
725    unsigned long	filter_events;		/* event mask from IM */
726    XICCallback		geometry_callback;	/* client callback */
727    char *		res_name;
728    char *		res_class;
729
730    XICCallback		destroy_callback;
731    XICCallback		string_conversion_callback;
732    XIMStringConversionText	 string_conversion;
733    XIMResetState	reset_state;
734    XIMHotKeyTriggers  *hotkey;
735    XIMHotKeyState	hotkey_state;
736
737    ICPreeditAttributes	preedit_attr;		/* visuals of preedit area */
738    ICStatusAttributes	status_attr;		/* visuals of status area */
739} XICCoreRec, *XICCore;
740
741
742/*
743 * an Input Context.  Implementations may need to extend this data
744 * structure to accomodate additional data, state information etc.
745 */
746typedef struct _XIC {
747    XICMethods		methods;		/* method list of this IC */
748    XICCoreRec		core;			/* data of this IC */
749} XICRec;
750
751
752/* If the argument 'name' is appropriate for this loader, it instantiates an
753   XLCd object with appropriate locale methods and returns it. May return
754   NULL; in this case, the remaining loaders are tried. */
755typedef XLCd (*XLCdLoadProc)(
756    const char*		name
757);
758
759_XFUNCPROTOBEGIN
760
761extern XLCd _XOpenLC(
762    char*		name
763);
764
765extern void _XCloseLC(
766    XLCd		lcd
767);
768
769extern XLCd _XlcCurrentLC (void);
770
771extern Bool _XlcValidModSyntax(
772    const char*		mods,
773    const char* const *	valid
774);
775
776extern char *_XlcDefaultMapModifiers(
777    XLCd		lcd,
778    _Xconst char*		user_mods,
779    _Xconst char*		prog_mods
780);
781
782extern void _XIMCompileResourceList(
783    XIMResourceList	/* res */,
784    unsigned int	/* num_res */
785);
786
787extern void _XCopyToArg(
788    XPointer		/* src */,
789    XPointer*		/* dst */,
790    unsigned int	/* size */
791);
792
793extern char ** _XParseBaseFontNameList(
794    char*		/* str */,
795    int*		/* num */
796);
797
798extern XrmMethods _XrmInitParseInfo(
799	XPointer*	statep
800);
801
802extern void _XRegisterFilterByMask(
803    Display*		/* dpy */,
804    Window		/* window */,
805    unsigned long	/* event_mask */,
806    Bool (*)(
807	     Display*	/* display */,
808	     Window	/* window */,
809	     XEvent*	/* event */,
810	     XPointer	/* client_data */
811	     )		/* filter */,
812    XPointer		/* client_data */
813);
814
815extern void _XRegisterFilterByType(
816    Display*		/* dpy */,
817    Window		/* window */,
818    int			/* start_type */,
819    int			/* end_type */,
820    Bool (*)(
821	     Display*	/* display */,
822	     Window	/* window */,
823	     XEvent*	/* event */,
824	     XPointer	/* client_data */
825	     )		/* filter */,
826    XPointer		/* client_data */
827);
828
829extern void _XUnregisterFilter(
830    Display*		/* dpy */,
831    Window		/* window */,
832    Bool (*)(
833	     Display*	/* display */,
834	     Window	/* window */,
835	     XEvent*	/* event */,
836	     XPointer	/* client_data */
837	     )		/* filter */,
838    XPointer		/* client_data */
839);
840
841extern void _XlcCountVaList(
842    va_list		var,
843    int*		count_return
844);
845
846extern void _XlcVaToArgList(
847    va_list		var,
848    int			count,
849    XlcArgList*		args_return
850);
851
852
853extern void _XlcCopyFromArg(
854    char *		src,
855    char *		dst,
856    int			size
857);
858
859extern void _XlcCopyToArg(
860    char *		src,
861    char **		dst,
862    int			size
863);
864
865extern void _XlcCompileResourceList(
866    XlcResourceList	resources,
867    int			num_resources
868);
869
870extern char *_XlcGetValues(
871    XPointer		base,
872    XlcResourceList	resources,
873    int			num_resources,
874    XlcArgList		args,
875    int			num_args,
876    unsigned long	mask
877);
878
879extern char *_XlcSetValues(
880    XPointer		base,
881    XlcResourceList	resources,
882    int			num_resources,
883    XlcArgList		args,
884    int			num_args,
885    unsigned long	mask
886);
887
888/* documented in i18n/Framework.PS */
889extern void _XlcInitLoader (void);
890
891extern void _XlcDeInitLoader (void);
892
893/* documented in i18n/Framework.PS */
894/* Returns True on success, False on failure. */
895extern Bool _XlcAddLoader(
896    XLCdLoadProc	proc,
897    XlcPosition		position
898);
899
900/* documented in i18n/Framework.PS */
901extern void _XlcRemoveLoader(
902    XLCdLoadProc	proc
903);
904
905/* Registers UTF-8 converters for a non-UTF-8 locale. */
906extern void _XlcAddUtf8Converters(
907    XLCd		lcd
908);
909
910/* Registers UTF-8 converters for a UTF-8 locale. */
911extern void _XlcAddUtf8LocaleConverters(
912    XLCd		lcd
913);
914
915/* The default locale loader. Assumes an ASCII encoding. */
916extern XLCd _XlcDefaultLoader(
917    const char*		name
918);
919
920/* The generic locale loader. Suitable for all encodings except UTF-8.
921   Uses an XLC_LOCALE configuration file. */
922extern XLCd _XlcGenericLoader(
923    const char*		name
924);
925
926/* The UTF-8 locale loader. Suitable for UTF-8 encoding.
927   Uses an XLC_LOCALE configuration file. */
928extern XLCd _XlcUtf8Loader(
929    const char*		name
930);
931
932/* The old EUC locale loader. */
933extern XLCd _XlcEucLoader(
934    const char*		name
935);
936
937/* The old SJIS locale loader. */
938extern XLCd _XlcSjisLoader(
939    const char*		name
940);
941
942/* The old ISO-2022-JP locale loader. */
943extern XLCd _XlcJisLoader(
944    const char*		name
945);
946
947extern XLCd _XlcDynamicLoad(
948    const char*		name
949);
950
951/* The old dynamic loader. */
952extern XLCd _XlcDynamicLoader(
953    const char*		name
954);
955
956extern Bool _XInitDefaultIM(
957    XLCd		lcd
958);
959
960extern Bool _XInitDefaultOM(
961    XLCd		lcd
962);
963
964extern Bool _XInitDynamicIM(
965    XLCd		lcd
966);
967
968extern Bool _XInitDynamicOM(
969    XLCd		lcd
970);
971
972_XFUNCPROTOEND
973
974#endif /* !_XP_PRINT_SERVER_ */
975
976#endif	/* _XLCINT_H_ */
977