Back to index

im-sdk  12.3.91
iiimpAux.h
Go to the documentation of this file.
00001 /*
00002 Copyright 1990-2003 Sun Microsystems, Inc. All Rights Reserved.
00003 
00004 Permission is hereby granted, free of charge, to any person obtaining a
00005 copy of this software and associated documentation files (the
00006 "Software"), to deal in the Software without restriction, including
00007 without limitation the rights to use, copy, modify, merge, publish,
00008 distribute, sublicense, and/or sell copies of the Software, and to
00009 permit persons to whom the Software is furnished to do so, subject to
00010 the following conditions: The above copyright notice and this
00011 permission notice shall be included in all copies or substantial
00012 portions of the Software.
00013 
00014 
00015 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00016 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00017 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00018 IN NO EVENT SHALL THE OPEN GROUP OR SUN MICROSYSTEMS, INC. BE LIABLE
00019 FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
00020 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
00021 THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE EVEN IF
00022 ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES.
00023 
00024 
00025 Except as contained in this notice, the names of The Open Group and/or
00026 Sun Microsystems, Inc. shall not be used in advertising or otherwise to
00027 promote the sale, use or other dealings in this Software without prior
00028 written authorization from The Open Group and/or Sun Microsystems,
00029 Inc., as applicable.
00030 
00031 
00032 X Window System is a trademark of The Open Group
00033 
00034 OSF/1, OSF/Motif and Motif are registered trademarks, and OSF, the OSF
00035 logo, LBX, X Window System, and Xinerama are trademarks of the Open
00036 Group. All other trademarks and registered trademarks mentioned herein
00037 are the property of their respective owners. No right, title or
00038 interest in or to any trademark, service mark, logo or trade name of
00039 Sun Microsystems, Inc. or its licensors is granted.
00040 
00041 */
00042 
00043 #ifndef _IIIMP_AUX_H
00044 #define _IIIMP_AUX_H
00045 
00046 #pragma ident "$Id$"
00047 
00048 
00049 #include <X11/Xmd.h>
00050 #include <X11/Xlib.h>
00051 
00052 #include "commonIM.h"
00053 
00054 typedef struct _aux_service aux_service_t;
00055 typedef struct _aux_im_data aux_im_data_t;
00056 
00057 
00058 typedef struct _aux {
00059        XicCommon            ic;           /* input context */
00060        aux_service_t *             service;      /* Aux service method */
00061        aux_im_data_t *             im;           /* current IM */
00062        aux_im_data_t *             im_list;      /* list of IM structure */
00063 } aux_t;
00064 
00065 
00066 typedef enum {
00067        AUX_DATA_NONE = 0,
00068        AUX_DATA_START = 1,
00069        AUX_DATA_DRAW = 2,
00070        AUX_DATA_DONE = 3,
00071        AUX_DATA_SETVALUE = 4
00072 } aux_data_type_t;
00073 
00074 
00075 typedef struct {
00076        int           length;
00077        unsigned char *      ptr;
00078 } aux_string_t;
00079 
00080 
00081 typedef struct {
00082        aux_data_type_t      type;
00083        int           im;
00084        int           ic;
00085        int           aux_index;
00086        int           aux_name_length;
00087        unsigned char *      aux_name;
00088        int           integer_count;
00089        int *         integer_list;
00090        int           string_count;
00091        aux_string_t *       string_list;
00092        unsigned char *      string_ptr;
00093 } aux_data_t;
00094 
00095 
00096 struct _aux_service {
00097        void          (* aux_setvalue)(aux_t *, const unsigned char *, int);
00098        int           (* im_id)(aux_t *);
00099        int           (* ic_id)(aux_t *);
00100        void          (* data_set)(aux_t *, int, void *);
00101        void *        (* data_get)(aux_t *, int);
00102        Display *     (* display)(aux_t *);
00103        Window        (* window)(aux_t *);
00104        XPoint *      (* point)(aux_t *, XPoint *);
00105        XPoint *      (* point_caret)(aux_t *, XPoint *);
00106        size_t        (* utf16_mb)(const char **, size_t *,
00107                                  char **, size_t *);
00108        size_t        (* mb_utf16)(const char **, size_t *,
00109                                  char **, size_t *);
00110        unsigned char *      (* compose)(const aux_data_t *, int *);
00111        int           (* compose_size)(aux_data_type_t,
00112                                     const unsigned char *);
00113        aux_data_t *  (* decompose)(aux_data_type_t, const unsigned char *);
00114        void          (* decompose_free)(aux_data_t *);
00115        void          (* register_X_filter)(Display *, Window, int, int, 
00116                                          Bool (* filter)(Display *,
00117                                                        Window,
00118                                                        XEvent *,
00119                                                        XPointer),
00120                                          XPointer);
00121        void          (* unregister_X_filter)(Display *, Window,
00122                                           Bool (* filter)(Display *,
00123                                                         Window,
00124                                                         XEvent *,
00125                                                         XPointer),
00126                                           XPointer);
00127        Bool          (* server)(aux_t *);
00128        Window        (* client_window)(aux_t *);
00129        Window        (* focus_window)(aux_t *);
00130        int           (* screen_number)(aux_t *);
00131        int           (* point_screen)(aux_t *, XPoint *);
00132        int           (* point_caret_screen)(aux_t *, XPoint *);
00133 };
00134 
00135 
00136 typedef struct _aux_method {
00137        Bool   (* create)(aux_t *);
00138        Bool   (* start)(aux_t *, const unsigned char *, int);
00139        Bool   (* draw)(aux_t *, const unsigned char *, int);
00140        Bool   (* done)(aux_t *, const unsigned char *, int);
00141        Bool   (* switched)(aux_t *, int, int);
00142        Bool   (* destroy)(aux_t *);
00143 } aux_method_t;
00144 
00145 
00146 typedef struct {
00147        int           len;
00148        CARD16 *      ptr;
00149 } aux_name_t;
00150 
00151 
00152 typedef struct {
00153        aux_name_t    name;
00154        aux_method_t *       method;
00155 } aux_dir_t;
00156 
00157 
00158 typedef enum {
00159        AUX_DOWNLOAD = 1,
00160        AUX_START = 2,
00161        AUX_DRAW = 3,
00162        AUX_DONE = 4,
00163        AUX_SWITCHED = 5,
00164        AUX_DESTROY = 6
00165 } AuxChangeReason;
00166 
00167 extern void AuxChange(XicCommon, AuxChangeReason, XPointer);
00168 
00169 
00170 #endif /* !_IIIMP_AUX_H */