2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
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
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 $ */
27 Copyright (c) 1991 X Consortium
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:
37 The above copyright notice and this permission notice shall be included
38 in all copies or substantial portions of the Software.
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.
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.
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
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.
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.
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.
90 * Katsuhisa Yano TOSHIBA Corp.
91 * Makoto Wakamatsu Sony Corporation
92 * Takashi Fujiwara FUJITSU LIMITED
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
105 #include <X11/Xresource.h>
106 #include "_falutil.h"
107 #include "_falvarargs.h"
109 typedef Bool (*XFilterEventProc)(
110 #if NeedFunctionPrototypes
111 Display* /* display */,
114 XPointer /* client_data */
118 typedef struct _XIMFilter {
119 struct _XIMFilter *next;
121 unsigned long event_mask;
122 int start_type, end_type;
123 XFilterEventProc filter;
124 XPointer client_data;
125 } XFilterEventRec, *XFilterEventList;
133 #define XOffsetOf(s_type,field) offsetof(s_type,field)
135 #define XOffsetOf(s_type,field) ((unsigned int)&(((s_type*)NULL)->field))
138 #define XIMNumber(arr) ((unsigned int) (sizeof(arr) / sizeof(arr[0])))
141 * define secondary data structs which are part of Input Methods
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;
154 * data block describing the visual attributes associated with
159 XRectangle area_needed;
160 XPoint spot_location;
163 unsigned long foreground;
164 unsigned long background;
165 Pixmap background_pixmap;
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;
179 XRectangle area_needed;
182 unsigned long foreground;
183 unsigned long background;
184 Pixmap background_pixmap;
188 XIMCallback start_callback;
189 XIMCallback done_callback;
190 XIMCallback draw_callback;
191 } ICStatusAttributes, *ICStatusAttributesPtr;
194 * Methods for Xrm parsing
197 typedef void (*XmbInitProc)(
198 #if NeedFunctionPrototypes
203 typedef char (*XmbCharProc)(
204 #if NeedFunctionPrototypes
205 XPointer /* state */,
211 typedef void (*XmbFinishProc)(
212 #if NeedFunctionPrototypes
217 typedef char* (*XlcNameProc)(
218 #if NeedFunctionPrototypes
223 typedef void (*XrmDestroyProc)(
224 #if NeedFunctionPrototypes
232 XmbFinishProc mbfinish;
234 XrmDestroyProc destroy;
235 } XrmMethodsRec, *XrmMethods;
237 typedef struct _XLCd *XLCd; /* need forward reference */
240 * define an LC, it's methods, and data.
243 typedef void (*XCloseLCProc)(
244 #if NeedFunctionPrototypes
249 typedef char* (*XlcMapModifiersProc)(
250 #if NeedFunctionPrototypes
252 char* /* user_mods */,
253 char* /* prog_mods */
257 typedef XOM (*XOpenOMProc)(
258 #if NeedFunctionPrototypes
260 Display* /* display */,
261 XrmDatabase /* rdb */,
262 _Xconst char* /* res_name */,
263 _Xconst char* /* res_class */
267 typedef XIM (*XOpenIMProc)(
268 #if NeedFunctionPrototypes
270 Display* /* display */,
271 XrmDatabase /* rdb */,
272 char* /* res_name */,
273 char* /* res_class */
277 typedef Bool (*XRegisterIMInstantiateCBProc)(
278 #if NeedFunctionPrototypes
280 Display* /* display */,
281 XrmDatabase /* rdb */,
282 char* /* res_name */,
283 char* /* res_class */,
284 XIMProc /* callback */,
285 XPointer* /* client_data */
289 typedef Bool (*XUnregisterIMInstantiateCBProc)(
290 #if NeedFunctionPrototypes
292 Display* /* display */,
293 XrmDatabase /* rdb */,
294 char* /* res_name */,
295 char* /* res_class */,
296 XIMProc /* callback */,
297 XPointer* /* client_data */
301 typedef XrmMethods (*XrmInitParseInfoProc)(
302 #if NeedFunctionPrototypes
304 XPointer* /* state */
308 typedef int (*falmbTextPropertyToTextListProc)(
309 #if NeedFunctionPrototypes
311 Display* /* display */,
312 XTextProperty* /* text_prop */,
313 char*** /* list_return */,
314 int* /* count_return */
318 typedef int (*falwcTextPropertyToTextListProc)(
319 #if NeedFunctionPrototypes
321 Display* /* display */,
322 XTextProperty* /* text_prop */,
323 wchar_t*** /* list_return */,
324 int* /* count_return */
328 typedef int (*falmbTextListToTextPropertyProc)(
329 #if NeedFunctionPrototypes
331 Display* /* display */,
334 XICCEncodingStyle /* style */,
335 XTextProperty* /* text_prop_return */
339 typedef int (*falwcTextListToTextPropertyProc)(
340 #if NeedFunctionPrototypes
342 Display* /* display */,
343 wchar_t** /* list */,
345 XICCEncodingStyle /* style */,
346 XTextProperty* /* text_prop_return */
350 typedef void (*falwcFreeStringListProc)(
351 #if NeedFunctionPrototypes
357 typedef char* (*falDefaultStringProc)(
358 #if NeedFunctionPrototypes
365 XlcMapModifiersProc map_modifiers;
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;
381 char* name; /* name of this LC */
382 char* modifiers; /* modifiers of locale */
383 } XLCdCoreRec, *XLCdCore;
386 typedef struct _XLCd {
387 XLCdMethods methods; /* methods of this LC */
388 XLCdCore core; /* data of this LC */
389 XPointer opaque; /* LDX specific data */
392 typedef int XlcPosition;
400 } XlcArg, *XlcArgList;
402 typedef struct _XlcResource {
408 } XlcResource, *XlcResourceList;
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)
416 #define XlcNumber(arr) (sizeof(arr) / sizeof(arr[0]))
418 typedef Status (*XCloseOMProc)(
419 #if NeedFunctionPrototypes
424 typedef char* (*XSetOMValuesProc)(
425 #if NeedFunctionPrototypes
427 XlcArgList /* args */,
432 typedef char* (*XGetOMValuesProc)(
433 #if NeedFunctionPrototypes
435 XlcArgList /* args */,
440 typedef XOC (*XCreateOCProc)(
441 #if NeedFunctionPrototypes
443 XlcArgList /* args */,
448 typedef struct _XOMMethodsRec {
450 XSetOMValuesProc set_values;
451 XGetOMValuesProc get_values;
452 XCreateOCProc create_oc;
453 } XOMMethodsRec, *XOMMethods;
455 typedef struct _XOMCoreRec {
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;
471 typedef struct _XOM {
476 typedef void (*XDestroyOCProc)(
477 #if NeedFunctionPrototypes
482 typedef char* (*XSetOCValuesProc)(
483 #if NeedFunctionPrototypes
485 XlcArgList /* args */,
490 typedef char* (*XGetOCValuesProc)(
491 #if NeedFunctionPrototypes
493 XlcArgList /* args */,
499 * X Font Sets are an instantiable object, so we define it, the
500 * object itself, a method list and data
504 * XFontSet object method list
507 typedef int (*XmbTextEscapementProc)(
508 #if NeedFunctionPrototypes
509 XFontSet /* font_set */,
510 _Xconst char* /* text */,
515 typedef int (*XmbTextExtentsProc)(
516 #if NeedFunctionPrototypes
517 XFontSet /* font_set */,
518 _Xconst char* /* text */,
520 XRectangle* /* overall_ink_extents */,
521 XRectangle* /* overall_logical_extents */
525 typedef Status (*XmbTextPerCharExtentsProc)(
526 #if NeedFunctionPrototypes
527 XFontSet /* font_set */,
528 _Xconst char* /* text */,
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 */
539 typedef int (*XmbDrawStringProc)(
540 #if NeedFunctionPrototypes
541 Display* /* display */,
542 Drawable /* drawable */,
543 XFontSet /* font_set */,
547 _Xconst char* /* text */,
552 typedef void (*XmbDrawImageStringProc)(
553 #if NeedFunctionPrototypes
554 Display* /* display */,
555 Drawable /* drawable */,
556 XFontSet /* font_set */,
560 _Xconst char* /* text */,
565 typedef int (*XwcTextEscapementProc)(
566 #if NeedFunctionPrototypes
567 XFontSet /* font_set */,
568 _Xconst wchar_t* /* text */,
573 typedef int (*XwcTextExtentsProc)(
574 #if NeedFunctionPrototypes
575 XFontSet /* font_set */,
576 _Xconst wchar_t* /* text */,
578 XRectangle* /* overall_ink_extents */,
579 XRectangle* /* overall_logical_extents */
583 typedef Status (*XwcTextPerCharExtentsProc)(
584 #if NeedFunctionPrototypes
585 XFontSet /* font_set */,
586 _Xconst wchar_t* /* text */,
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 */
597 typedef int (*XwcDrawStringProc)(
598 #if NeedFunctionPrototypes
599 Display* /* display */,
600 Drawable /* drawable */,
601 XFontSet /* font_set */,
605 _Xconst wchar_t* /* text */,
610 typedef void (*XwcDrawImageStringProc)(
611 #if NeedFunctionPrototypes
612 Display* /* display */,
613 Drawable /* drawable */,
614 XFontSet /* font_set */,
618 _Xconst wchar_t* /* text */,
624 XDestroyOCProc destroy;
625 XSetOCValuesProc set_values;
626 XGetOCValuesProc get_values;
628 /* multi-byte text drawing methods */
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;
636 /* wide character text drawing methods */
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;
647 * XOC independent data
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;
666 typedef struct _XOC {
672 /* current Ultrix compiler gets horribly confused */
673 #if defined(FUNCPROTO) && defined(ultrix)
674 #undef NeedFunctionPrototypes
679 * X Input Managers are an instantiable object, so we define it, the
680 * object itself, a method list and data.
684 * an Input Manager object method list
688 #if NeedFunctionPrototypes
693 #if NeedFunctionPrototypes
698 #if NeedFunctionPrototypes
703 #if NeedFunctionPrototypes
708 #if NeedFunctionPrototypes
709 XIM, char*, int, char*, int, Status *
713 #if NeedFunctionPrototypes
714 XIM, char*, int, wchar_t*, int, Status *
717 } XIMMethodsRec, *XIMMethods;
720 * Input Manager LC independent data
723 XLCd lcd; /* LC of this input method */
724 XIC ic_chain; /* list of ICs for this IM */
726 Display * display; /* display */
731 XIMValuesList *im_values_list;
732 XIMValuesList *ic_values_list;
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;
746 * An X Input Manager (IM). Implementations may need to extend this data
747 * structure to accomodate additional data, state information etc.
749 typedef struct _XIM {
750 XIMMethods methods; /* method list of this IM */
751 XIMCoreRec core; /* data of this IM */
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
762 * Input Context method list
766 #if NeedFunctionPrototypes
771 #if NeedFunctionPrototypes
776 #if NeedFunctionPrototypes
781 #if NeedFunctionPrototypes
786 #if NeedFunctionPrototypes
791 #if NeedFunctionPrototypes
795 wchar_t* (*wc_reset)(
796 #if NeedFunctionPrototypes
800 int (*mb_lookup_string)(
801 #if NeedFunctionPrototypes
802 XIC, XKeyEvent*, char*, int, KeySym*, Status*
805 int (*wc_lookup_string)(
806 #if NeedFunctionPrototypes
807 XIC, XKeyEvent*, wchar_t*, int, KeySym*, Status*
810 } XICMethodsRec, *XICMethods;
814 * Input Context LC independent data
817 XIM im; /* XIM this IC belongs too */
818 XIC next; /* linked list of ICs for IM */
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 */
829 XIMCallback destroy_callback;
830 XIMCallback string_conversion_callback;
831 XIMStringConversionText string_conversion;
832 XIMResetState reset_state;
833 XIMHotKeyTriggers *hotkey;
834 XIMHotKeyState hotkey_state;
836 ICPreeditAttributes preedit_attr; /* visuals of preedit area */
837 ICStatusAttributes status_attr; /* visuals of status area */
838 } XICCoreRec, *XICCore;
842 * an Input Context. Implementations may need to extend this data
843 * structure to accomodate additional data, state information etc.
845 typedef struct _XIC {
846 XICMethods methods; /* method list of this IC */
847 XICCoreRec core; /* data of this IC */
850 /* current Ultrix compiler gets horribly confused */
851 #if !defined(NeedFunctionPrototypes) && defined(FUNCPROTO)
852 #define NeedFunctionPrototypes 1
855 typedef XLCd (*XLCdLoadProc)(
856 #if NeedFunctionPrototypes
863 extern XLCd _falOpenLC(
864 #if NeedFunctionPrototypes
869 extern void _falCloseLC(
870 #if NeedFunctionPrototypes
875 extern XLCd _fallcCurrentLC(
876 #if NeedFunctionPrototypes
881 extern Bool _fallcValidModSyntax(
882 #if NeedFunctionPrototypes
888 extern char *_fallcDefaultMapModifiers(
889 #if NeedFunctionPrototypes
891 char* /* user_mods */,
892 char* /* prog_mods */
896 extern void _XIMCompileResourceList(
897 #if NeedFunctionPrototypes
898 XIMResourceList /* res */,
899 unsigned int /* num_res */
903 extern void _XCopyToArg(
904 #if NeedFunctionPrototypes
907 unsigned int /* size */
911 extern char ** _falParseBaseFontNameList(
912 #if NeedFunctionPrototypes
918 extern XrmMethods _falrmInitParseInfo(
919 #if NeedFunctionPrototypes
920 XPointer* /* statep */
924 extern void _XRegisterFilterByMask(
925 #if NeedFunctionPrototypes
928 unsigned long /* event_mask */,
930 #if NeedNestedPrototypes
931 Display* /* display */,
934 XPointer /* client_data */
937 XPointer /* client_data */
941 extern void _XRegisterFilterByType(
942 #if NeedFunctionPrototypes
945 int /* start_type */,
948 #if NeedNestedPrototypes
949 Display* /* display */,
952 XPointer /* client_data */
955 XPointer /* client_data */
959 extern void _XUnregisterFilter(
960 #if NeedFunctionPrototypes
964 #if NeedNestedPrototypes
965 Display* /* display */,
968 XPointer /* client_data */
971 XPointer /* client_data */
975 extern void _fallcCountVaList(
976 #if NeedFunctionPrototypes
978 int* /* count_return */
982 extern void _fallcVaToArgList(
983 #if NeedFunctionPrototypes
986 XlcArgList* /* args_return */
990 extern void _fallcCompileResourceList(
991 #if NeedFunctionPrototypes
992 XlcResourceList /* resources */,
993 int /* num_resources */
997 extern char *_fallcGetValues(
998 #if NeedFunctionPrototypes
1000 XlcResourceList /* resources */,
1001 int /* num_resources */,
1002 XlcArgList /* args */,
1004 unsigned long /* mask */
1008 extern char *_fallcSetValues(
1009 #if NeedFunctionPrototypes
1010 XPointer /* base */,
1011 XlcResourceList /* resources */,
1012 int /* num_resources */,
1013 XlcArgList /* args */,
1015 unsigned long /* mask */
1019 extern Bool _fallcAddLoader(
1020 #if NeedFunctionPrototypes
1021 XLCdLoadProc /* proc */,
1022 XlcPosition /* position */
1026 extern void _fallcRemoveLoader(
1027 #if NeedFunctionPrototypes
1028 XLCdLoadProc /* proc */
1034 #endif /* _XLCINT_H_ */