1/******************************************************************
2
3          Copyright 1991, 1992, 1993, 1994 by FUJITSU LIMITED
4          Copyright 1993 by Digital Equipment Corporation
5
6Permission to use, copy, modify, distribute, and sell this software
7and its documentation for any purpose is hereby granted without fee,
8provided that the above copyright notice appear in all copies and that
9both that copyright notice and this permission notice appear in
10supporting documentation, and that the name of FUJITSU LIMITED and
11Digital Equipment Corporation not be used in advertising or publicity
12pertaining to distribution of the software without specific, written
13prior permission.  FUJITSU LIMITED and Digital Equipment Corporation
14makes no representations about the suitability of this software for
15any purpose.  It is provided "as is" without express or implied
16warranty.
17
18FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION DISCLAIM ALL
19WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
20WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
21FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR
22ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
23WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
24IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
25ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
26THIS SOFTWARE.
27
28  Author:    Takashi Fujiwara     FUJITSU LIMITED
29                               	  fujiwara@a80.tech.yk.fujitsu.co.jp
30  Modifier:  Franky Ling          Digital Equipment Corporation
31	                          frankyling@hgrd01.enet.dec.com
32
33******************************************************************/
34
35#ifndef _XIMINTL_H
36#define _XIMINTL_H
37
38#define	COMPOSE_FILE	"Compose"
39
40/*
41 * Data Structures for Local Processing
42 */
43typedef INT32  DTIndex;
44typedef INT32  DTCharIndex;
45typedef BITS32 DTModifier;
46
47typedef struct _DefTree {
48    DTIndex          next;
49    DTIndex          succession;	/* successive Key Sequence */
50					/* Key definitions */
51    DTModifier       modifier_mask;
52    DTModifier       modifier;
53    KeySym           keysym;		/* leaf only */
54    DTCharIndex      mb;
55    DTCharIndex      wc;		/* make from mb */
56    DTCharIndex      utf8;		/* make from mb */
57    KeySym           ks;
58} DefTree;
59
60typedef struct _DefTreeBase {
61    DefTree         *tree;
62    char            *mb;
63    wchar_t         *wc;
64    char            *utf8;
65    DTIndex          treeused, treesize;
66    DTCharIndex      mbused,   mbsize;
67    DTCharIndex      wcused,   wcsize;
68    DTCharIndex      utf8used, utf8size;
69} DefTreeBase;
70
71typedef struct _XimLocalPrivateRec {
72	/* The first fields are identical with XimCommonPrivateRec. */
73	XlcConv		 ctom_conv;
74	XlcConv		 ctow_conv;
75	XlcConv		 ctoutf8_conv;
76	XlcConv		 cstomb_conv;
77	XlcConv		 cstowc_conv;
78	XlcConv		 cstoutf8_conv;
79	XlcConv		 ucstoc_conv;
80	XlcConv		 ucstoutf8_conv;
81
82	XIC		 current_ic;
83	DefTreeBase	 base;
84	DTIndex          top;
85} XimLocalPrivateRec;
86
87typedef struct _XicThaiPart {
88	int		comp_state;
89	KeySym		keysym;
90	int		input_mode;
91} XicThaiPart;
92
93typedef struct _XicLocalPrivateRec {
94	long			 value_mask;
95	DefTreeBase              base;
96	DTIndex			 context;
97	DTIndex			 composed;
98	XicThaiPart		 thai;
99
100	XIMResourceList		 ic_resources;
101	unsigned int		 ic_num_resources;
102
103	unsigned char	 	 brl_pressed, brl_committing, brl_committed;
104	Time		 	 brl_release_start;
105} XicLocalPrivateRec;
106#endif /* _XIMINTL_H */
107