Back to index

im-sdk  12.3.91
SunIMMthd.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 #ifndef  SUNIMMTHD_H
00043 #define  SUNIMMTHD_H
00044 
00045 #include "IMProtocolStruct.h"
00046 
00047 #if defined(sun)
00048 #include <thread.h>
00049 #elif defined(WIN32)
00050 #include <windows.h>
00051 #else
00052 #include <pthread.h>
00053 #endif
00054 
00055 #ifdef ENABLE_EIMIL
00056 #include <EIMIL.h>
00057 #endif
00058 
00059 
00060 typedef struct _iml_session *iml_session;
00061 typedef struct _iml_if_t *iml_if;
00062 typedef struct _iml_aux *iml_aux;
00063 
00064 typedef iml_session iml_session_list;
00065 
00066 typedef struct _iml_desktop_t {
00067   /* public */
00068     iml_if If;                            /* parent IF */
00069 
00070     char *user_name;               /* user info */
00071     char *host_name;               /* user info */
00072     char *display_id;                     /* user info */
00073 
00074     void *specific_data;           /* specific data for desktop */
00075 
00076     iml_session_list session_list;
00077     int session_count;
00078 
00079   /* private */
00080     struct _iml_desktop_t *next;   /* link */
00081 }   iml_desktop_t;
00082 
00083 typedef iml_desktop_t *iml_desktop_list;
00084 
00085 typedef struct _iml_methods {
00086     iml_inst *(*iml_make_preedit_start_inst) (iml_session);
00087     iml_inst *(*iml_make_preedit_draw_inst) (iml_session, IMText *);
00088     iml_inst *(*iml_make_preedit_draw_with_chgpos_inst) (iml_session, IMText *, int, int, int);
00089     iml_inst *(*iml_make_preedit_erase_inst) (iml_session);
00090     iml_inst *(*iml_make_preedit_caret_inst) (iml_session, int);
00091     iml_inst *(*iml_make_preedit_done_inst) (iml_session);
00092 
00093     iml_inst *(*iml_make_status_start_inst) (iml_session);
00094     iml_inst *(*iml_make_status_draw_inst) (iml_session, IMText *);
00095     iml_inst *(*iml_make_status_done_inst) (iml_session);
00096 
00097     iml_inst *(*iml_make_lookup_start_inst) (iml_session, IMLookupStartCallbackStruct *);
00098     iml_inst *(*iml_make_lookup_draw_inst) (iml_session, IMLookupDrawCallbackStruct *);
00099     iml_inst *(*iml_make_lookup_done_inst) (iml_session);
00100 
00101     iml_inst *(*iml_make_start_conversion_inst) (iml_session);
00102     iml_inst *(*iml_make_end_conversion_inst) (iml_session);
00103 
00104     iml_inst *(*iml_make_commit_inst) (iml_session, IMText *);
00105     iml_inst *(*iml_make_keypress_inst) (iml_session, IMKeyEventStruct *);
00106 
00107     iml_inst *(*iml_make_aux_start_inst) (iml_session, IMAuxStartCallbackStruct *);
00108     iml_inst *(*iml_make_aux_draw_inst) (iml_session, IMAuxDrawCallbackStruct *);
00109     iml_inst *(*iml_make_aux_done_inst) (iml_session, IMAuxDoneCallbackStruct *);
00110     void *(*iml_new) (iml_session, int);
00111     void *(*iml_new2) (iml_session, int);
00112     void *(*iml_delete) (iml_session);
00113     void *(*iml_delete2) (iml_session);
00114 
00115     iml_inst *(*iml_link_inst_tail) (iml_inst **, iml_inst *);
00116     iml_inst *(*iml_execute) (iml_session, iml_inst **);
00117 
00118 }   iml_methods_t;
00119 
00120 typedef struct _if_methods {
00121     Bool(*if_OpenIF) (iml_if);
00122     Bool(*if_CloseIF) (iml_if);
00123     Bool(*if_GetIFValues) (iml_if, IMArgList, int);
00124     Bool(*if_SetIFValues) (iml_if, IMArgList, int);
00125 
00126     Bool(*if_OpenDesktop) (iml_desktop_t *, IMArgList, int);
00127     Bool(*if_CloseDesktop) (iml_desktop_t *);
00128 
00129     Bool(*if_CreateSC) (iml_session, IMArgList, int);
00130     Bool(*if_DestroySC) (iml_session);
00131     Bool(*if_GetSCValues) (iml_session, IMArgList, int);
00132     Bool(*if_SetSCValues) (iml_session, IMArgList, int);
00133 
00134     IMText *(*if_ResetSC) (iml_session);
00135 
00136     void (*if_SetSCFocus) (iml_session);
00137     void (*if_UnsetSCFocus) (iml_session);
00138 
00139     void (*if_SendEvent) (iml_session, IMInputEvent *);
00140 }   if_methods_t;
00141 
00142 /*
00143  * Per interface data structure
00144  */
00145 typedef struct _iml_if_t {
00146   /* public */
00147     char *if_name;                        /* id */
00148     char *if_version;                            /* version */
00149     char *locale;                         /* locale */
00150 
00151     iml_methods_t *m;                            /* link for iml methods */
00152 
00153     iml_desktop_list desktop_list;        /* list for child desktop */
00154     int desktop_count;
00155 
00156     char *ifpath_name;                           /* location of if module */
00157 
00158   /* private */
00159     if_methods_t *ifm;
00160 
00161     void *dl_module;
00162 
00163     IMLEName *lename;
00164     IMLocale *locale_list;
00165     IMEInfo *imeinfo_list;
00166     IMObjectDescriptorStruct *object_list;
00167 
00168     Bool xsunim;
00169     Bool need_thread_lock;
00170 #ifdef USE_SUNIM_ADAPTER
00171     Bool need_adapter;
00172 #endif /* USE_SUNIM_ADAPTER */
00173 
00174 #ifdef ENABLE_EIMIL
00175     EIMIL_handle eh;
00176 #endif
00177 }   iml_if_t;
00178 
00179 typedef enum {
00180     IF_VERSION = 1,
00181     IF_METHOD_TABLE,
00182     IF_LE_NAME,
00183     IF_SUPPORTED_LOCALES,
00184     IF_SUPPORTED_OBJECTS,
00185 #ifdef USE_SUNIM_ADAPTER
00186     IF_NEED_THREAD_LOCK,
00187     IF_HAVE_LOCALE_DEPENDENCY,
00188 #else  /* USE_SUNIM_ADAPTER */
00189     IF_NEED_THREAD_LOCK,
00190 #endif /* USE_SUNIM_ADAPTER */
00191 
00192     /* EIMIL extension */
00193     IF_EIMIL_HANDLE = 0x100,
00194 
00195     /* LE extension */
00196     IF_SUPPORTED_KEYRELEASE,
00197     IF_SUPPORTED_IMEINFO
00198 
00199 }   IF_Attribute;
00200 
00201 typedef enum {
00202     SC_REALIZE = 1,
00203     SC_TRIGGER_ON_NOTIFY,
00204     SC_TRIGGER_OFF_NOTIFY,
00205     SC_SUPPORTED_CHARACTER_SUBSETS,
00206 
00207     SC_PREFERED_OBJECTS = 64,
00208     SC_SUPPORTED_CLASSES = 65,
00209     SC_LOOKUP_NROWS = 100,         /* for compatibility purpose */
00210     SC_LOOKUP_NCOLS,               /* for compatibility purpose */
00211     SC_LOOKUP_LABELTYPE,           /* for compatibility purpose */
00212 
00213     SC_CLIENT_LOCALE = 200,
00214     SC_CLIENT_CHARACTER_SUBSETS,
00215     SC_CLIENT_INPUT_METHOD_NAME,
00216     SC_CLIENT_INPUT_METHOD_ENGINE
00217 }   SC_Attribute;
00218 
00219 typedef enum {
00220     UI_USER_NAME = 1,
00221     UI_HOST_NAME,
00222     UI_DISPLAY_ID,
00223     UI_PROTOCOL_TYPE,
00224     UI_CLIENT_TYPE,
00225     UI_OS_NAME,
00226     UI_OS_ARCH,
00227     UI_OS_VERSION,
00228     UI_XSERVER_VENDOR,
00229     UI_AUTH_PASSWD
00230 }   UI_Attribute;
00231 
00232 #define       MAX_UI_ATTRIBUTE     UI_AUTH_PASSWD
00233 
00234 #define UI_PROTOCOL_TYPE_IIIMP     "IIIMP"
00235 #define UI_PROTOCOL_TYPE_XIMP      "XIMP"
00236 #define UI_PROTOCOL_TYPE_XIMCP     "XIMCP"
00237 
00238 #define UI_CLIENT_TYPE_JAVA "JAVA"
00239 #define UI_CLIENT_TYPE_X    "X"
00240 #define UI_CLIENT_TYPE_UNKNOWN     "Unknown"
00241 
00242 #endif                      /* SUNIMMTHD_H */