Back to index

im-sdk  12.3.91
XSunIMCm.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 #pragma ident   "@(#)XSunIMCm.h    1.2 95/11/01        Sun Microsystems,Inc."
00043 
00044 /*   derivded from :
00045 static char     sccsid[] = "@(#)XSunIMCm.h       2.4 94/08/08 SMI";
00046 */
00047 
00048 /******************************************************************
00049 
00050               Copyright 1990, 1991, by Sun Microsystems, Inc.
00051 
00052 Permission to use, copy, modify, distribute, and sell this software
00053 and its documentation for any purpose is hereby granted without fee,
00054 provided that the above copyright notice appear in all copies and
00055 that both that copyright notice and this permission notice appear
00056 in supporting documentation, and that the name of Sun Microsystems, Inc.
00057 not be used in advertising or publicity pertaining to distribution
00058 of the software without specific, written prior permission.
00059 Sun Microsystems, Inc. makes no representations about the suitability of
00060 this software for any purpose.  It is provided "as is" without
00061 express or implied warranty.
00062 
00063 Sun Microsystems Inc. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
00064 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
00065 IN NO EVENT SHALL Sun Microsystems, Inc. BE LIABLE FOR ANY SPECIAL, INDIRECT
00066 OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
00067 OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
00068 OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
00069 OR PERFORMANCE OF THIS SOFTWARE.
00070 
00071   Author: Hideki Hiura (hhiura@Sun.COM)
00072                                         Sun Microsystems, Inc.
00073 ******************************************************************/
00074 
00075 #ifndef xim_imlogic_jle103_DEFIND
00076 #define xim_imlogic_jle103_DEFIND
00077 
00078 /*
00079  * cm status string management data
00080  */
00081 typedef struct {
00082     wchar_t   name[STATUSNAMELEN];
00083     wchar_t   value[STATUSVALUELEN];
00084     wchar_t   string[STATUSSTRINGLEN];
00085     int              order ;
00086 } IMStatusString ;
00087 
00088 typedef struct {
00089     wchar_t   *name;
00090     wchar_t   *value;
00091     wchar_t   *string;
00092     int              order ;
00093 } IMCurrentStatusString ;
00094 
00095 typedef struct _iml_session {
00096 /* ---- Inherit Base class [imlogic_session] ----- */
00097 
00098 #define xim_iml_inheritance_DEFIND
00099 #include "XSunIMCore.h"
00100 #undef  xim_iml_inheritance_DEFIND
00101 
00102 /* ----- Derived class [jle103_session] declaration ---- */
00103 
00104 wchar_t conversion_on_key ;
00105 Bool   nego;
00106 
00107 } iml_session_t;
00108 
00109 #define xim_imlogic_session_DEFIND
00110 
00111 typedef struct _cmif_spec_t {
00112 /*
00113  * Status region
00114  */
00115     int NStatusInFile ;
00116     int NStatus ;
00117     IMStatusString StatusString[MAXSTATUS] ;
00118     IMCurrentStatusString CurrentStatusString[MAXSTATUS] ;
00119 } cmif_spec_t ;
00120 
00121 #define DEFAULTPreEditTextBufferSize 512
00122 #define DEFAULTPreEditAttrBufferSize 512
00123 #define DEFAULTStatusStringRemainBufferSize 512
00124 /*
00125  * for the active_ regions
00126  */
00127 #define PREEDIT_IS_ACTIVE   0x00000001
00128 #define STATUS_IS_ACTIVE    0x00000002
00129 #define LOOKUP_IS_ACTIVE    0x00000004
00130 #define AUX_IS_ACTIVE              0x00000008
00131 
00132 /*
00133  * for the remainder flag due to handle pseudo_packet in eval_it()
00134  */
00135 
00136 #define PRE_EDIT_DONE_REQUIRED     0x00000001
00137 #define STATUS_DONE_REQUIRED       0x00000002
00138 #define STATUS_DRAW_REQUIRED       0x00000004
00139 #define IMM_COMMIT_REQUIRED 0x00000008
00140 
00141 #define DEFAULT_OPENWINHOME "/usr/openwin"
00142 #define OW_LOCALE_PATH "lib/locale"
00143 #define MODE_DAT_PATH "htt/mode.dat"
00144 #define XXXCOMPAT_MODE_DAT_PATH "se/sunview/mode.dat"
00145 #define DEFAULT_MLEPATH "/usr/lib/mle"
00146 
00147 #define MAX_ENV_OPCODE 153
00148 
00149 /*
00150  * cm interface module private member functions
00151  */
00152 
00153 Private void cm_destruct_session(iml_session_t *);
00154 Private int destruct_session(iml_session_t*);
00155 Private void cm_reset(iml_session_t *, iml_inst **);
00156 Private void cm_conversion_on(iml_session_t *);
00157 Private void cm_send_commit(iml_session_t *);
00158 Private void cm_make_conversion_on(iml_session_t *);
00159 Private void cm_make_conversion_off(iml_session_t *);
00160 Private int cm_make_status_string(iml_session_t *, wchar_t *,
00161                               unsigned char *,int);
00162 Private void cm_set_choice(iml_session_t *, int);
00163 Private void cm_attr2feedback(XIMFeedback*, unsigned char*,
00164                            int, char*);
00165 Private int cm_create_session(int, iml_session_t*, Bool);
00166 Private void cm_select_unknown_control(iml_session_t *);
00167 Private void cm_opsw_init(void);
00168 Private int construct_cm_initial_data(struct cm_initstruct *);
00169 Private iml_inst **eval_it(iml_session_t*, struct cm_to_env*, iml_inst**);
00170 Private void  init_status_string(iml_session_t *);
00171 
00172 Private void eval_cm_to_env_packet(iml_session_t*, struct cm_to_env*);
00173 
00174 Private struct cm_to_env *get_cte(struct cm_to_env **);
00175 Private env_commit(iml_session_t*, iml_inst **, struct cm_to_env**);
00176 Private void cm_eval_results(iml_session_t*, iml_inst *);
00177 Private Bool  ims_cm_negotiation_pool(int, iml_session_t*, 
00178                                    char*, void*);
00179 Private ReadOneLine(char*, int, int);     /* Alternative function of fgets() */
00180 
00181 extern struct cm_to_env *cm_put(int, int, struct env_to_cm*);
00182 extern int cm_open(int, struct cm_initstruct*, struct cm_to_env**);
00183 extern struct cm_to_env *cm_close(int, int);
00184 
00185 #endif  xim_imlogic_jle103_DEFINED