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.1.1.1 2000/10/29 16:23:43 himi Exp $
00009  */
00010 
00011 #ifndef _IIIMP_AUX_H
00012 #define _IIIMP_AUX_H
00013 
00014 #pragma ident "@(#)iiimpAux.h 1.11 99/08/02 SMI"
00015 
00016 
00017 #include <X11/Xmd.h>
00018 #include <X11/Xlib.h>
00019 
00020 
00021 struct _Xic;
00022 
00023 typedef struct _aux_service aux_service_t;
00024 typedef struct _aux_im_data aux_im_data_t;
00025 
00026 
00027 typedef struct _aux {
00028        struct _Xic *        ic;           /* input context */
00029        aux_service_t *             service;      /* Aux service method */
00030        aux_im_data_t *             im;           /* current IM */
00031        aux_im_data_t *             im_list;      /* list of IM structure */
00032 } aux_t;
00033 
00034 
00035 typedef enum {
00036        AUX_DATA_NONE = 0,
00037        AUX_DATA_START = 1,
00038        AUX_DATA_DRAW = 2,
00039        AUX_DATA_DONE = 3,
00040        AUX_DATA_SETVALUE = 4
00041 } aux_data_type_t;
00042 
00043 
00044 typedef struct {
00045        int           length;
00046        unsigned char *      ptr;
00047 } aux_string_t;
00048 
00049 
00050 typedef struct {
00051        aux_data_type_t      type;
00052        int           im;
00053        int           ic;
00054        int           aux_index;
00055        int           aux_name_length;
00056        unsigned char *      aux_name;
00057        int           integer_count;
00058        int *         integer_list;
00059        int           string_count;
00060        aux_string_t *       string_list;
00061        unsigned char *      string_ptr;
00062 } aux_data_t;
00063 
00064 
00065 struct _aux_service {
00066        void          (* aux_setvalue)(aux_t *, const unsigned char *, int);
00067        int           (* im_id)(aux_t *);
00068        int           (* ic_id)(aux_t *);
00069        void          (* data_set)(aux_t *, int, void *);
00070        void *        (* data_get)(aux_t *, int);
00071        Display *     (* display)(aux_t *);
00072        Window        (* window)(aux_t *);
00073        XPoint *      (* point)(aux_t *, XPoint *);
00074        XPoint *      (* point_caret)(aux_t *, XPoint *);
00075        size_t        (* utf16_mb)(const char **, size_t *,
00076                                  char **, size_t *);
00077        size_t        (* mb_utf16)(const char **, size_t *,
00078                                  char **, size_t *);
00079        unsigned char *      (* compose)(const aux_data_t *, int *);
00080        int           (* compose_size)(aux_data_type_t,
00081                                     const unsigned char *);
00082        aux_data_t *  (* decompose)(aux_data_type_t, const unsigned char *);
00083        void          (* decompose_free)(aux_data_t *);
00084        void          (* register_X_filter)(Display *, Window, int, int, 
00085                                          Bool (* filter)(Display *,
00086                                                        Window,
00087                                                        XEvent *,
00088                                                        XPointer),
00089                                          XPointer);
00090        void          (* unregister_X_filter)(Display *, Window,
00091                                           Bool (* filter)(Display *,
00092                                                         Window,
00093                                                         XEvent *,
00094                                                         XPointer),
00095                                           XPointer);
00096        Bool          (* server)(void);
00097 };
00098 
00099 
00100 typedef struct _aux_method {
00101        Bool   (* create)(aux_t *);
00102        Bool   (* start)(aux_t *, const unsigned char *, int);
00103        Bool   (* draw)(aux_t *, const unsigned char *, int);
00104        Bool   (* done)(aux_t *, const unsigned char *, int);
00105        Bool   (* switched)(aux_t *, int, int);
00106        Bool   (* destroy)(aux_t *);
00107 } aux_method_t;
00108 
00109 
00110 typedef struct {
00111        int           len;
00112        CARD16 *      ptr;
00113 } aux_name_t;
00114 
00115 
00116 typedef struct {
00117        aux_name_t    name;
00118        aux_method_t *       method;
00119 } aux_dir_t;
00120 
00121 
00122 typedef enum {
00123        AUX_DOWNLOAD = 1,
00124        AUX_START = 2,
00125        AUX_DRAW = 3,
00126        AUX_DONE = 4,
00127        AUX_SWITCHED = 5,
00128        AUX_DESTROY = 6
00129 } AuxChangeReason;
00130 
00131 extern void AuxChange(struct _Xic *, AuxChangeReason, XPointer);
00132 
00133 
00134 #endif /* !_IIIMP_AUX_H */