xref: /AOO41X/main/vcl/inc/unx/XIM.h (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef _XIM_h
28*cdf0e10cSrcweir #define _XIM_h
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #include <X11/Xlib.h>
31*cdf0e10cSrcweir #include <X11/Xresource.h>
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir #ifdef __cplusplus
34*cdf0e10cSrcweir extern "C"
35*cdf0e10cSrcweir #endif
36*cdf0e10cSrcweir XIM XvaOpenIM( Display*, XrmDatabase, char*, char*, ... );
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir extern Status XCloseIM(XIM);
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir #ifndef XIMCallback1
41*cdf0e10cSrcweir typedef int (*XIMProc1)(XIC, XPointer, XPointer);
42*cdf0e10cSrcweir typedef struct {
43*cdf0e10cSrcweir   XPointer client_data;
44*cdf0e10cSrcweir   XIMProc1 callback;
45*cdf0e10cSrcweir } XIMCallback1;
46*cdf0e10cSrcweir #endif
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir typedef struct _XIMAnnotation {
49*cdf0e10cSrcweir   int start_position;
50*cdf0e10cSrcweir   int end_position;
51*cdf0e10cSrcweir   XPointer data;
52*cdf0e10cSrcweir } XIMAnnotation;
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir /*
55*cdf0e10cSrcweir   XIMUText: XIMText extention for UTF16
56*cdf0e10cSrcweir  */
57*cdf0e10cSrcweir typedef struct _XIMUnicodeText {
58*cdf0e10cSrcweir   unsigned short length;
59*cdf0e10cSrcweir   XIMFeedback *feedback;
60*cdf0e10cSrcweir   Bool encoding_is_wchar;
61*cdf0e10cSrcweir   union {
62*cdf0e10cSrcweir     char *multi_byte;
63*cdf0e10cSrcweir     wchar_t *wide_char;
64*cdf0e10cSrcweir     unsigned short *utf16_char;
65*cdf0e10cSrcweir   } string;
66*cdf0e10cSrcweir   unsigned int   count_annotations;
67*cdf0e10cSrcweir   XIMAnnotation	 *annotations;
68*cdf0e10cSrcweir } XIMUnicodeText;
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir /* lookup choice */
71*cdf0e10cSrcweir typedef enum {
72*cdf0e10cSrcweir   XIMDrawUpHorizontally = 0 ,
73*cdf0e10cSrcweir   XIMDrawUpVertically = 1
74*cdf0e10cSrcweir } XIMDrawUpDirection ;
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir typedef struct _XIMLookupStartCallbackStruct {
77*cdf0e10cSrcweir   int		choice_per_window;  /* Number of choices can be display
78*cdf0e10cSrcweir 				     * in the region
79*cdf0e10cSrcweir 				     */
80*cdf0e10cSrcweir   int		nrows;
81*cdf0e10cSrcweir   int		ncolumns;
82*cdf0e10cSrcweir   XIMDrawUpDirection draw_up_direction;
83*cdf0e10cSrcweir } XIMLookupStartCallbackStruct;
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir typedef struct _XIMUnicodeChoiceObject {
86*cdf0e10cSrcweir   XIMUnicodeText *label;
87*cdf0e10cSrcweir   XIMUnicodeText *value;
88*cdf0e10cSrcweir } XIMUnicodeChoiceObject;
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir typedef struct _XIMLookupDrawCallbackStruct {
91*cdf0e10cSrcweir   XIMUnicodeChoiceObject *choices;       /* the lookup choices */
92*cdf0e10cSrcweir   int              n_choices;      /* Total number of lookup choices */
93*cdf0e10cSrcweir   int              first_index;
94*cdf0e10cSrcweir   int              last_index;
95*cdf0e10cSrcweir   int              current_index;
96*cdf0e10cSrcweir   XIMUnicodeText   *title;
97*cdf0e10cSrcweir } XIMLookupDrawCallbackStruct;
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir /* Unicode Subset */
100*cdf0e10cSrcweir typedef enum {
101*cdf0e10cSrcweir   XIMKatakana, XIMHanzi
102*cdf0e10cSrcweir } XIMUnicodeCharacterSubsetID;
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir typedef	struct	_XIMUncodeSubset {
105*cdf0e10cSrcweir   XIMUnicodeCharacterSubsetID	index;
106*cdf0e10cSrcweir   XIMUnicodeCharacterSubsetID	subset_id;
107*cdf0e10cSrcweir   char			*name;
108*cdf0e10cSrcweir   Bool			is_active;
109*cdf0e10cSrcweir } XIMUnicodeCharacterSubset;
110*cdf0e10cSrcweir 
111*cdf0e10cSrcweir typedef	struct	_XIMUncodeSubsets {
112*cdf0e10cSrcweir   unsigned short count_subsets;
113*cdf0e10cSrcweir   XIMUnicodeCharacterSubset *supported_subsets;
114*cdf0e10cSrcweir } XIMUnicodeCharacterSubsets;
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir typedef	struct	_XIMSwitchIMNotifyCallbackStruct {
117*cdf0e10cSrcweir   XIMUnicodeCharacterSubset *from;
118*cdf0e10cSrcweir   XIMUnicodeCharacterSubset *to;
119*cdf0e10cSrcweir } XIMSwitchIMNotifyCallbackStruct;
120*cdf0e10cSrcweir 
121*cdf0e10cSrcweir /* XIM attributes for multilingual IM extension */
122*cdf0e10cSrcweir #define XNMultiLingualInput "multiLingualInput"
123*cdf0e10cSrcweir #define XNQueryUnicodeCharacterSubset "unicodeCharacterSubset"
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir /* XIC attributes for multilingual IM extension */
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir #define XNUnicodeCharacterSubset "UnicodeChararcterSubset"
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir #define XNSwitchIMNotifyCallback "switchIMNotifyCallback"
130*cdf0e10cSrcweir #define XNCommitStringCallback "commitStringCallback"
131*cdf0e10cSrcweir #define XNForwardEventCallback "forwardEventCallback"
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir #define XNLookupStartCallback "lookupStartCallback"
134*cdf0e10cSrcweir #define XNLookupDrawCallback "lookupDrawCallback"
135*cdf0e10cSrcweir #define XNLookupDoneCallback "lookupDoneCallback"
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir #endif
138