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