Back to index

im-sdk  12.3.91
SunIMMthd.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 1998 by Sun Microsystems, Inc., 901 San Antonio Road,
00003  * Palo Alto, California, 94303, U.S.A. All rights reserved.
00004  * 
00005  * This software is the confidential and proprietary information of Sun
00006  * Microsystems, Inc. ("Confidential Information").  You shall not
00007  * disclose such Confidential Information and shall use it only in
00008  * accordance with the terms of the license agreement you entered
00009  * into with Sun.
00010  */
00011 
00012 #ifndef  SUNIMMTHD_H
00013 #define  SUNIMMTHD_H
00014 
00015 #include "IMProtocolStruct.h"
00016 
00017 #if defined(sun)
00018 #include <thread.h>
00019 #elif defined(WIN32)
00020 #include <windows.h>
00021 #else
00022 #include <pthread.h>
00023 #endif
00024 
00025 typedef struct _iml_session *iml_session;
00026 typedef struct _iml_if_t *iml_if;
00027 typedef struct _iml_aux *iml_aux;
00028 
00029 typedef iml_session iml_session_list;
00030 
00031 typedef struct _iml_desktop_t {
00032   /* public */
00033     iml_if If;                            /* parent IF */
00034 
00035     char *user_name;               /* user info */
00036     char *host_name;               /* user info */
00037     char *display_id;                     /* user info */
00038 
00039     void *specific_data;           /* specific data for desktop */
00040 
00041     iml_session_list session_list;
00042     int session_count;
00043 
00044   /* private */
00045     struct _iml_desktop_t *next;   /* link */
00046 }   iml_desktop_t;
00047 
00048 typedef iml_desktop_t *iml_desktop_list;
00049 
00050 typedef struct _iml_methods {
00051     iml_inst *(*iml_make_preedit_start_inst) (iml_session);
00052     iml_inst *(*iml_make_preedit_draw_inst) (iml_session, IMText *);
00053     iml_inst *(*iml_make_preedit_draw_with_chgpos_inst) (iml_session, IMText *, int, int, int);
00054     iml_inst *(*iml_make_preedit_erase_inst) (iml_session);
00055     iml_inst *(*iml_make_preedit_caret_inst) (iml_session, int);
00056     iml_inst *(*iml_make_preedit_done_inst) (iml_session);
00057 
00058     iml_inst *(*iml_make_status_start_inst) (iml_session);
00059     iml_inst *(*iml_make_status_draw_inst) (iml_session, IMText *);
00060     iml_inst *(*iml_make_status_done_inst) (iml_session);
00061 
00062     iml_inst *(*iml_make_lookup_start_inst) (iml_session, IMLookupStartCallbackStruct *);
00063     iml_inst *(*iml_make_lookup_draw_inst) (iml_session, IMLookupDrawCallbackStruct *);
00064     iml_inst *(*iml_make_lookup_done_inst) (iml_session);
00065 
00066     iml_inst *(*iml_make_start_conversion_inst) (iml_session);
00067     iml_inst *(*iml_make_end_conversion_inst) (iml_session);
00068 
00069     iml_inst *(*iml_make_commit_inst) (iml_session, IMText *);
00070     iml_inst *(*iml_make_keypress_inst) (iml_session, IMKeyEventStruct *);
00071 
00072     iml_inst *(*iml_make_aux_start_inst) (iml_session, IMAuxStartCallbackStruct *);
00073     iml_inst *(*iml_make_aux_draw_inst) (iml_session, IMAuxDrawCallbackStruct *);
00074     iml_inst *(*iml_make_aux_done_inst) (iml_session, IMAuxDoneCallbackStruct *);
00075     void *(*iml_new) (iml_session, int);
00076     void *(*iml_new2) (iml_session, int);
00077     void *(*iml_delete) (iml_session);
00078     void *(*iml_delete2) (iml_session);
00079 
00080     iml_inst *(*iml_link_inst_tail) (iml_inst **, iml_inst *);
00081     iml_inst *(*iml_execute) (iml_session, iml_inst **);
00082 
00083 }   iml_methods_t;
00084 
00085 typedef struct _if_methods {
00086     Bool(*if_OpenIF) (iml_if);
00087     Bool(*if_CloseIF) (iml_if);
00088     Bool(*if_GetIFValues) (iml_if, IMArgList, int);
00089     Bool(*if_SetIFValues) (iml_if, IMArgList, int);
00090 
00091     Bool(*if_OpenDesktop) (iml_desktop_t *, IMArgList, int);
00092     Bool(*if_CloseDesktop) (iml_desktop_t *);
00093 
00094     Bool(*if_CreateSC) (iml_session, IMArgList, int);
00095     Bool(*if_DestroySC) (iml_session);
00096     Bool(*if_GetSCValues) (iml_session, IMArgList, int);
00097     Bool(*if_SetSCValues) (iml_session, IMArgList, int);
00098 
00099     IMText *(*if_ResetSC) (iml_session);
00100 
00101     void (*if_SetSCFocus) (iml_session);
00102     void (*if_UnsetSCFocus) (iml_session);
00103 
00104     void (*if_SendEvent) (iml_session, IMInputEvent *);
00105 }   if_methods_t;
00106 
00107 /*
00108  * Per interface data structure
00109  */
00110 typedef struct _iml_if_t {
00111   /* public */
00112     char *if_name;                        /* id */
00113     char *if_version;                            /* version */
00114     char *locale;                         /* locale */
00115 
00116     iml_methods_t *m;                            /* link for iml methods */
00117 
00118     iml_desktop_list desktop_list;        /* list for child desktop */
00119     int desktop_count;
00120 
00121     char *ifpath_name;                           /* location of if module */
00122 
00123   /* private */
00124     if_methods_t *ifm;
00125 
00126     void *dl_module;
00127 
00128     IMLEName *lename;
00129     IMLocale *locale_list;
00130     IMObjectDescriptorStruct *object_list;
00131 
00132     Bool xsunim;
00133     Bool need_thread_lock;
00134 #ifdef USE_SUNIM_ADAPTER
00135     Bool need_adapter;
00136 #endif /* USE_SUNIM_ADAPTER */
00137 }   iml_if_t;
00138 
00139 typedef enum {
00140     IF_VERSION = 1,
00141     IF_METHOD_TABLE,
00142     IF_LE_NAME,
00143     IF_SUPPORTED_LOCALES,
00144     IF_SUPPORTED_OBJECTS,
00145 #ifdef USE_SUNIM_ADAPTER
00146     IF_NEED_THREAD_LOCK,
00147     IF_HAVE_LOCALE_DEPENDENCY
00148 #else  /* USE_SUNIM_ADAPTER */
00149     IF_NEED_THREAD_LOCK
00150 #endif /* USE_SUNIM_ADAPTER */
00151 }   IF_Attribute;
00152 
00153 typedef enum {
00154     SC_REALIZE = 1,
00155     SC_TRIGGER_ON_NOTIFY,
00156     SC_TRIGGER_OFF_NOTIFY,
00157     SC_SUPPORTED_CHARACTER_SUBSETS,
00158     SC_LOOKUP_NROWS = 100,         /* for compatibility purpose */
00159     SC_LOOKUP_NCOLS,               /* for compatibility purpose */
00160     SC_LOOKUP_LABELTYPE                   /* for compatibility purpose */
00161 }   SC_Attribute;
00162 
00163 typedef enum {
00164     UI_USER_NAME = 1,
00165     UI_HOST_NAME,
00166     UI_DISPLAY_ID,
00167     UI_PROTOCOL_TYPE,
00168     UI_CLIENT_TYPE,
00169     UI_OS_NAME,
00170     UI_OS_ARCH,
00171     UI_OS_VERSION,
00172     UI_XSERVER_VENDOR,
00173     UI_AUTH_PASSWD
00174 }   UI_Attribute;
00175 
00176 #define       MAX_UI_ATTRIBUTE     UI_AUTH_PASSWD
00177 
00178 #define UI_PROTOCOL_TYPE_IIIMP     "IIIMP"
00179 #define UI_PROTOCOL_TYPE_XIMP      "XIMP"
00180 #define UI_PROTOCOL_TYPE_XIMCP     "XIMCP"
00181 
00182 #define UI_CLIENT_TYPE_JAVA "JAVA"
00183 #define UI_CLIENT_TYPE_X    "X"
00184 #define UI_CLIENT_TYPE_UNKNOWN     "Unknown"
00185 
00186 #endif                      /* SUNIMMTHD_H */