Back to index

im-sdk  12.3.91
XIM.h
Go to the documentation of this file.
00001 /*
00002 Copyright 1985, 1986, 1987, 1991, 1998  The Open Group
00003 
00004 Portions Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
00005 
00006 Permission is hereby granted, free of charge, to any person obtaining a
00007 copy of this software and associated documentation files (the
00008 "Software"), to deal in the Software without restriction, including
00009 without limitation the rights to use, copy, modify, merge, publish,
00010 distribute, sublicense, and/or sell copies of the Software, and to
00011 permit persons to whom the Software is furnished to do so, subject to
00012 the following conditions: The above copyright notice and this
00013 permission notice shall be included in all copies or substantial
00014 portions of the Software.
00015 
00016 
00017 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00018 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00019 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00020 IN NO EVENT SHALL THE OPEN GROUP OR SUN MICROSYSTEMS, INC. BE LIABLE
00021 FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
00022 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
00023 THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE EVEN IF
00024 ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES.
00025 
00026 
00027 Except as contained in this notice, the names of The Open Group and/or
00028 Sun Microsystems, Inc. shall not be used in advertising or otherwise to
00029 promote the sale, use or other dealings in this Software without prior
00030 written authorization from The Open Group and/or Sun Microsystems,
00031 Inc., as applicable.
00032 
00033 
00034 X Window System is a trademark of The Open Group
00035 
00036 OSF/1, OSF/Motif and Motif are registered trademarks, and OSF, the OSF
00037 logo, LBX, X Window System, and Xinerama are trademarks of the Open
00038 Group. All other trademarks and registered trademarks mentioned herein
00039 are the property of their respective owners. No right, title or
00040 interest in or to any trademark, service mark, logo or trade name of
00041 Sun Microsystems, Inc. or its licensors is granted.
00042 
00043 */
00044 #ifndef _XIM_h
00045 #define _XIM_h
00046 
00047 #include <X11/Xlib.h>
00048 #include <X11/Xresource.h>
00049 
00050 extern XIM XvaOpenIM(
00051 #if NeedVarargsPrototypes
00052                    Display*, XrmDatabase, 
00053                    char*, char*, ...
00054 #endif
00055                    );
00056 
00057 extern Status XCloseIM(XIM);
00058 
00059 #ifndef XIMCallback1
00060 typedef int (*XIMProc1)(XIC, XPointer, XPointer);
00061 typedef struct {
00062   XPointer client_data;
00063   XIMProc1 callback;
00064 } XIMCallback1;
00065 #endif
00066 
00067 typedef struct _XIMAnnotation {
00068   int start_position;
00069   int end_position;
00070   XPointer data;
00071 } XIMAnnotation;
00072 
00073 /*
00074   XIMUText: XIMText extention for UTF16
00075  */
00076 typedef struct _XIMUnicodeText {
00077   unsigned short length;
00078   XIMFeedback *feedback;
00079   Bool encoding_is_wchar;
00080   union {
00081     char *multi_byte;
00082     wchar_t *wide_char;
00083     unsigned short *utf16_char;
00084   } string; 
00085   unsigned int   count_annotations;
00086   XIMAnnotation       *annotations;
00087 } XIMUnicodeText;
00088 
00089 /* lookup choice */
00090 typedef enum {
00091   XIMDrawUpHorizontally = 0 ,
00092   XIMDrawUpVertically = 1
00093 } XIMDrawUpDirection ;
00094 
00095 typedef struct _XIMLookupStartCallbackStruct {
00096   int         choice_per_window;  /* Number of choices can be display
00097                                  * in the region
00098                                  */
00099   int         nrows;
00100   int         ncolumns;
00101   XIMDrawUpDirection draw_up_direction;
00102 } XIMLookupStartCallbackStruct;
00103 
00104 typedef struct _XIMUnicodeChoiceObject {
00105   XIMUnicodeText *label;
00106   XIMUnicodeText *value;
00107 } XIMUnicodeChoiceObject;
00108 
00109 typedef struct _XIMLookupDrawCallbackStruct {
00110   XIMUnicodeChoiceObject *choices;       /* the lookup choices */
00111   int              n_choices;      /* Total number of lookup choices */
00112   int              first_index;
00113   int              last_index;
00114   int              current_index;
00115   XIMUnicodeText   *title;
00116 } XIMLookupDrawCallbackStruct;
00117 
00118 /* Unicode Subset */
00119 typedef enum {
00120   XIMKatakana, XIMHanzi
00121 } XIMUnicodeCharacterSubsetID;
00122 
00123 typedef       struct _XIMUncodeSubset {
00124   XIMUnicodeCharacterSubsetID      index;
00125   XIMUnicodeCharacterSubsetID      subset_id;
00126   char               *name;
00127   Bool               is_active;
00128 } XIMUnicodeCharacterSubset;
00129 
00130 typedef       struct _XIMUncodeSubsets {
00131   unsigned short count_subsets;
00132   XIMUnicodeCharacterSubset *supported_subsets;
00133 } XIMUnicodeCharacterSubsets;
00134 
00135 typedef       struct _XIMSwitchIMNotifyCallbackStruct {
00136   XIMUnicodeCharacterSubset *from;
00137   XIMUnicodeCharacterSubset *to;
00138 } XIMSwitchIMNotifyCallbackStruct;
00139 
00140 /* XIM attributes for multilingual IM extension */
00141 #define XNMultiLingualInput "multiLingualInput"
00142 #define XNQueryUnicodeCharacterSubset "unicodeCharacterSubset"
00143 #define XNQueryExtensionVersion "queryExtensionersion"
00144 #define XIIIMP_MULTILINGUAL_EXTENSION_VERSION 2
00145 
00146 /* XIC attributes for multilingual IM extension */
00147 
00148 #define XNUnicodeCharacterSubset "UnicodeChararcterSubset"
00149 
00150 #define XNSwitchIMNotifyCallback "switchIMNotifyCallback"
00151 #define XNCommitStringCallback "commitStringCallback"
00152 #define XNForwardEventCallback "forwardEventCallback"
00153 
00154 #define XNLookupStartCallback "lookupStartCallback"
00155 #define XNLookupDrawCallback "lookupDrawCallback"
00156 #define XNLookupDoneCallback "lookupDoneCallback"
00157 
00158 #endif