Back to index

im-sdk  12.3.91
imaux-int.h
Go to the documentation of this file.
00001 /*
00002 Copyright 1990-2001 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 /*
00044  * $Id: imaux-int.h,v 1.3 2004/02/19 00:51:53 tajima Exp $
00045  */
00046 
00047 #ifndef _IIIMP_AUX_P_H
00048 #define _IIIMP_AUX_P_H
00049 
00050 #include <iiimcf.h>
00051 #include <X11/Xlib.h>              /* inevitable X dependency */
00052 #include "imaux.h"
00053 
00054 #define AUX_DIR_SYMBOL             "aux_dir"
00055 #define AUX_CONF_MAGIC             "# IIIM X auxiliary"
00056 #define AUX_INFO_SYMBOL            "aux_info"
00057 
00058 typedef struct _aux aux_t;
00059 typedef struct _aux_ic_data aux_ic_data_t;
00060 typedef struct _aux_service aux_service_t;
00061 typedef struct _aux_im_data aux_im_data_t;
00062 
00063 struct _aux {
00064   aux_ic_data_t *ic;        /* input context */
00065   aux_service_t *service;   /* Aux service method */
00066   aux_im_data_t *im;        /* current IM */
00067   aux_im_data_t *im_list;   /* list of IM structure */
00068 };
00069 
00070 typedef enum {
00071   AUX_DATA_NONE = 0,
00072   AUX_DATA_START = 1,
00073   AUX_DATA_DRAW = 2,
00074   AUX_DATA_DONE = 3,
00075   AUX_DATA_SETVALUE = 4,
00076   AUX_DATA_GETVALUE = 5,
00077   AUX_DATA_GETVALUE_REPLY = 6
00078 } aux_data_type_t;
00079 
00080 typedef struct {
00081   int length;
00082   unsigned char *ptr;
00083 } aux_string_t;
00084 
00085 typedef struct {
00086   aux_data_type_t type;
00087   int im;
00088   int ic;
00089   int aux_index;
00090   int aux_name_length;
00091   unsigned char *aux_name;
00092   int integer_count;
00093   int *integer_list;
00094   int string_count;
00095   aux_string_t *string_list;
00096   unsigned char *string_ptr;
00097 } aux_data_t;
00098 
00099 struct _aux_service {
00100   void (*aux_setvalue)(aux_t *, const unsigned char *, int);
00101   int  (*im_id)(aux_t *);
00102   int  (*ic_id)(aux_t *);
00103   void (*data_set)(aux_t *, int, void *);
00104   void *(*data_get)(aux_t *, int);
00105   Display *(*display)(aux_t *);
00106   Window (*window)(aux_t *);
00107   XPoint *(*point)(aux_t *, XPoint *);
00108   XPoint *(*point_caret)(aux_t *, XPoint *);
00109   size_t (*utf16_mb)(const char **, size_t *,
00110                    char **, size_t *);
00111   size_t (*mb_utf16)(const char **, size_t *,
00112                    char **, size_t *);
00113   unsigned char *(*compose)(const aux_data_t *, int *);
00114   int (* compose_size)(aux_data_type_t,
00115                      const unsigned char *);
00116   aux_data_t *(*decompose)(aux_data_type_t, const unsigned char *);
00117   void (*decompose_free)(aux_data_t *);
00118   void (*register_X_filter)(Display *, Window, int, int, 
00119                          Bool (*filter)(Display *,
00120                                       Window,
00121                                       XEvent *,
00122                                       XPointer),
00123                          XPointer);
00124   void (*unregister_X_filter)(Display *, Window,
00125                            Bool (* filter)(Display *,
00126                                          Window,
00127                                          XEvent *,
00128                                          XPointer),
00129                            XPointer);
00130   Bool (*server)(aux_t *);
00131   Window (*client_window)(aux_t *);
00132   Window (*focus_window)(aux_t *);
00133   int (*screen_number)(aux_t *);
00134   int (*point_screen)(aux_t *, XPoint *);
00135   int (*point_caret_screen)(aux_t *, XPoint *);
00136   Bool (*get_conversion_mode)(aux_t*);
00137   void (*set_conversion_mode)(aux_t*, int);
00138        /* if_version(1st arg of register_service()) >= AUX_IF_VERSION_2 */
00139   void (*aux_getvalue)(aux_t *, const unsigned char *, int);
00140   aux_t *(* aux_get_from_id)(int im_id, int ic_id,
00141                           IIIMP_card16 *aux_name, int aux_name_length);
00142 };
00143 
00144 typedef struct _aux_method {
00145   gboolean (*create)(aux_t *);
00146   gboolean (*start)(aux_t *, const unsigned char *, int);
00147   gboolean (*draw)(aux_t *, const unsigned char *, int);
00148   gboolean (*done)(aux_t *, const unsigned char *, int);
00149   gboolean (*switched)(aux_t *, int, int);
00150   gboolean (*destroy)(aux_t *);
00151        /* aux_info_t.if_version >= AUX_IF_VERSION_2 */
00152   gboolean (*getvalues_reply)(aux_t *, const unsigned char *, int);
00153   gboolean (*destroy_ic)(aux_t *);
00154   gboolean (*set_icforcus)(aux_t *);
00155   gboolean (*unset_icforcus)(aux_t *);
00156 } aux_method_t;
00157 
00158 typedef struct {
00159   int len;
00160   IIIMP_card16 *ptr;
00161 } aux_name_t;
00162 
00163 typedef struct {
00164   aux_name_t name;
00165   aux_method_t *method;
00166 } aux_dir_t;
00167 
00168 typedef struct {
00169   unsigned int if_version;         /* >= AUX_IF_VERSION_2 */
00170   gboolean (* register_service)(unsigned int  if_version,
00171                             aux_service_t *service);
00172   aux_dir_t *dir;
00173 } aux_info_t;
00174 #define       AUX_IF_VERSION_2     0x00020000
00175 
00176 typedef struct _aux_entry {
00177   int created;
00178   aux_dir_t dir;
00179   struct _aux_entry *next;
00180   unsigned int if_version;
00181 } aux_entry_t;
00182 
00183 typedef struct _aux_handle {
00184   aux_name_t aux_name;
00185   char *file_name;
00186   void *handle;
00187   aux_entry_t *ae;
00188   int ae_num;
00189   struct _aux_handle *next;
00190 } aux_handle_t;
00191 
00192 struct _aux_im_data {
00193   int im_id;
00194   int ic_id;
00195   aux_entry_t *ae;
00196   void *data;
00197   aux_im_data_t *next;
00198 };
00199 
00200 typedef struct _aux_ic_info {
00201   int im_id;
00202   int ic_id;
00203   aux_ic_data_t *ic_data;
00204   struct _aux_ic_info *next;
00205 } aux_ic_info_t;
00206 
00207 #endif
00208 
00209 /* Local Variables: */
00210 /* c-file-style: "iiim-project" */
00211 /* End: */