Back to index

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