Back to index

im-sdk  12.3.91
iiimpAux.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1999, by Sun Microsystems, Inc.
00003  * Copyright (c) 1999, by Nihon Sun Microsystems K.K.
00004  * All rights reserved.
00005  */
00006 
00007 /*
00008  * $Id: iiimpAux.h,v 1.2 2004/02/19 00:45:10 tajima Exp $
00009  */
00010 
00011 #ifndef _IIIMP_AUX_H
00012 #define _IIIMP_AUX_H
00013 
00014 
00015 #include <X11/Xmd.h>
00016 #include <X11/Xlib.h>
00017 
00018 typedef struct _aux_service aux_service_t;
00019 typedef struct _aux_im_data aux_im_data_t;
00020 
00021 typedef struct _XicCommon   *XicCommon;
00022 
00023 typedef struct _aux {
00024        XicCommon            ic;           /* input context */
00025        aux_service_t *             service;      /* Aux service method */
00026        aux_im_data_t *             im;           /* current IM */
00027        aux_im_data_t *             im_list;      /* list of IM structure */
00028 } aux_t;
00029 
00030 
00031 typedef enum {
00032        AUX_DATA_NONE = 0,
00033        AUX_DATA_START = 1,
00034        AUX_DATA_DRAW = 2,
00035        AUX_DATA_DONE = 3,
00036        AUX_DATA_SETVALUE = 4
00037 } aux_data_type_t;
00038 
00039 
00040 typedef struct {
00041        int           length;
00042        unsigned char *      ptr;
00043 } aux_string_t;
00044 
00045 
00046 typedef struct {
00047        aux_data_type_t      type;
00048        int           im;
00049        int           ic;
00050        int           aux_index;
00051        int           aux_name_length;
00052        unsigned char *      aux_name;
00053        int           integer_count;
00054        int *         integer_list;
00055        int           string_count;
00056        aux_string_t *       string_list;
00057        unsigned char *      string_ptr;
00058 } aux_data_t;
00059 
00060 
00061 struct _aux_service {
00062        void          (* aux_setvalue)(aux_t *, const unsigned char *, int);
00063        int           (* im_id)(aux_t *);
00064        int           (* ic_id)(aux_t *);
00065        void          (* data_set)(aux_t *, int, void *);
00066        void *        (* data_get)(aux_t *, int);
00067        Display *     (* display)(aux_t *);
00068        Window        (* window)(aux_t *);
00069        XPoint *      (* point)(aux_t *, XPoint *);
00070        XPoint *      (* point_caret)(aux_t *, XPoint *);
00071        size_t        (* utf16_mb)(const char **, size_t *,
00072                                  char **, size_t *);
00073        size_t        (* mb_utf16)(const char **, size_t *,
00074                                  char **, size_t *);
00075        unsigned char *      (* compose)(const aux_data_t *, int *);
00076        int           (* compose_size)(aux_data_type_t,
00077                                     const unsigned char *);
00078        aux_data_t *  (* decompose)(aux_data_type_t, const unsigned char *);
00079        void          (* decompose_free)(aux_data_t *);
00080        void          (* register_X_filter)(Display *, Window, int, int, 
00081                                          Bool (* filter)(Display *,
00082                                                        Window,
00083                                                        XEvent *,
00084                                                        XPointer),
00085                                          XPointer);
00086        void          (* unregister_X_filter)(Display *, Window,
00087                                           Bool (* filter)(Display *,
00088                                                         Window,
00089                                                         XEvent *,
00090                                                         XPointer),
00091                                           XPointer);
00092        Bool          (* server)(aux_t *);
00093        Window        (* client_window)(aux_t *);
00094        Window        (* focus_window)(aux_t *);
00095        int           (* screen_number)(aux_t *);
00096        int           (* point_screen)(aux_t *, XPoint *);
00097        int           (* point_caret_screen)(aux_t *, XPoint *);
00098        Bool          (* get_conversion_mode)(aux_t *);
00099        void          (* set_conversion_mode)(aux_t *, int);
00100 };
00101 
00102 
00103 typedef struct _aux_method {
00104        Bool   (* create)(aux_t *);
00105        Bool   (* start)(aux_t *, const unsigned char *, int);
00106        Bool   (* draw)(aux_t *, const unsigned char *, int);
00107        Bool   (* done)(aux_t *, const unsigned char *, int);
00108        Bool   (* switched)(aux_t *, int, int);
00109        Bool   (* destroy)(aux_t *);
00110 } aux_method_t;
00111 
00112 
00113 typedef struct {
00114        int           len;
00115        CARD16 *      ptr;
00116 } aux_name_t;
00117 
00118 
00119 typedef struct {
00120        aux_name_t    name;
00121        aux_method_t *       method;
00122 } aux_dir_t;
00123 
00124 
00125 typedef enum {
00126        AUX_DOWNLOAD = 1,
00127        AUX_START = 2,
00128        AUX_DRAW = 3,
00129        AUX_DONE = 4,
00130        AUX_SWITCHED = 5,
00131        AUX_DESTROY = 6
00132 } AuxChangeReason;
00133 
00134 extern void AuxChange(XicCommon, AuxChangeReason, XPointer);
00135 
00136 
00137 #endif /* !_IIIMP_AUX_H */