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