Back to index

im-sdk  12.3.91
XimpIm.h
Go to the documentation of this file.
00001 /* $XimpImplementGroup: XimpIm.h, v 1.1 94/05/31 21:16:06 $ */
00002 /******************************************************************
00003 
00004               Copyright 1991, 1992 by FUJITSU LIMITED
00005              Copyright 1991, 1992 by Sun Microsystems, Inc.
00006               Copyright 1991, 1992 by Sony Corporation
00007 
00008 Permission to use, copy, modify, distribute, and sell this software
00009 and its documentation for any purpose is hereby granted without fee,
00010 provided that the above copyright notice appear in all copies and
00011 that both that copyright notice and this permission notice appear
00012 in supporting documentation, and that the name of FUJITSU LIMITED,
00013 Sun Microsystems, Inc. and Sony Corporation not be used in advertising 
00014 or publicity pertaining to distribution of the software without specific,
00015 written prior permission.
00016 FUJITSU LIMITED, Sun Microsystems, Inc. and Sony Corporation make no 
00017 representations about the suitability of this software for any purpose.
00018 It is provided "as is" without express or implied warranty.
00019 
00020 FUJITSU LIMITED, SUN MICROSYSTEMS, INC. AND SONY CORPORATION DISCLAIM 
00021 ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED 
00022 WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL FUJITSU
00023 LIMITED, SUN MICROSYSTEMS, INC. AND SONY CORPORATION BE LIABLE FOR ANY
00024 SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
00025 RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
00026 CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
00027 CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00028 
00029   Author: Takashi Fujiwara     FUJITSU LIMITED 
00030           Hiromu Inukai        Sun Microsystems, Inc.
00031           Hideki Hiura         Sun Microsystems, Inc.
00032          Makoto Wakamatsu     Sony Corporation
00033 
00034 ******************************************************************/
00035 /*
00036 
00037 Copyright (c) 1991 - 1994  FUJITSU LIMITED
00038 Copyright (c) 1991 - 1994  Sony Corporation
00039 
00040 Permission is hereby granted, free of charge, to any person obtaining
00041 a copy of this software and associated documentation files (the
00042 "Software"), to deal in the Software without restriction, including
00043 without limitation the rights to use, copy, modify, merge, publish,
00044 distribute, sublicense, and/or sell copies of the Software, and to
00045 permit persons to whom the Software is furnished to do so, subject to
00046 the following conditions:
00047 
00048 The above copyright notice and this permission notice shall be included
00049 in all copies or substantial portions of the Software.
00050 
00051 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00052 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00053 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00054 IN NO EVENT SHALL THE FUJITSU LIMITED AND SONY CORPORATION BE LIABLE FOR
00055 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00056 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00057 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00058 
00059 Except as contained in this notice, the name of the FUJITSU LIMITED and
00060 Sony Corporation shall not be used in advertising or otherwise to promote
00061 the sale, use or other dealings in this Software without prior written
00062 authorization from the FUJITSU LIMITED and Sony Corporation.
00063 
00064   Author: Takashi Fujiwara     FUJITSU LIMITED 
00065          Makoto Wakamatsu     Sony Corporation
00066 
00067 */
00068 
00069 #ifdef HAVE_CONFIG_H
00070 #include <config.h>
00071 #endif
00072 
00073 #ifndef _XimpIm_h
00074 #define _XimpIm_h
00075 
00076 #define XIMP_40
00077 #include "XIMProto.h"
00078 
00079 #include "XlcPubI.h"
00080 
00081 #define XIMP_NAME    256
00082 
00083 #define XIMP_CREATE_IC      0
00084 #define       XIMP_SET_IC   1
00085 #define       XIMP_START_IC 2
00086 
00087 #define FILTERD             True
00088 #define NOTFILTERD   False
00089 
00090 #define XIMP_MAXBUF 1024
00091 #define CT_MAX_IN_CM 15
00092 
00093 #define COPYMASK(src, dist) {\
00094        (dist).proto3 = (src).proto3;\
00095        (dist).proto4 = (src).proto4;\
00096 }
00097 
00098 /*
00099  * XIMP Extension IM data struction 
00100  */
00101 
00102 typedef struct {
00103 /* Selecting the Frontend method or Backend method */
00104     int              extension_back_front_exist;
00105     Atom      extension_back_front_id;
00106 /* Handling/Querying IM Server's conversion mode */
00107     Bool      extension_conversion_exist;
00108     Atom      extension_conversion_id;
00109     Bool      extension_conversion;
00110 /* Status Window ID Extension */
00111     int              extension_statuswindow_exist;
00112     Atom      extension_statuswindow_id;
00113 /* Candidates List Displaying Extention */
00114     int              extension_lookup_exist;
00115     Atom      extension_lookup_id;
00116     Atom      extension_lookup_start;
00117     Atom      extension_lookup_start_rep;
00118     Atom      extension_lookup_draw;
00119     Atom      extension_lookup_proc;
00120     Atom      extension_lookup_proc_rep;
00121 /* Control the input mode depending on the native language */
00122 /* - Setting method */
00123     int              extension_inputmode_exist;
00124     Atom      extension_inputmode_id;
00125     int              extension_inputmode_rtn_exist;
00126     Atom      extension_inputmode_rtn_id;
00127 /* - Locking method */
00128     int              extension_modelock_exist;
00129     Atom      extension_modelock_id;
00130 /* - Reporting method */
00131     int              extension_modechange_exist;
00132     Atom      extension_modechange_id;
00133 /* Report the keyBinding change */
00134     int              extension_keychange_exist;
00135     Atom      extension_keychange_id;
00136     Atom      off_keys_id;
00137 /* Flushing Preedit buffer */
00138     int              extension_flush_exist;
00139     Atom      extension_flush_id;
00140 /* Add XIMP Extension data */
00141     int              extension_direct_im_mode_setting_exist;
00142     Atom      extension_direct_im_mode_setting_id;
00143 } Ximp_ExtXIMRec;
00144 
00145 /*
00146  * IM dependent data struction 
00147  */
00148 
00149 typedef struct _Ximp_XIM    *Ximp_XIM;
00150 
00151 typedef struct _XIMXimpRec {
00152     int                      reconnection_mode;
00153     Bool              is_connected;
00154     char             *im_name;
00155     int                      def_svr_mode;
00156     Ximp_KeyList     *process_start_keys;
00157     Bool              use_wchar;
00158     XIMStyles        *delaybind_styles;
00159 /* for IM Server data */
00160     Window            fe_window;
00161     Window            owner;
00162     Atom              improtocol_id;
00163     Atom              version_id;
00164     Atom              style_id;
00165     Atom              keys_id;
00166     Atom              servername_id;
00167     Atom              serverversion_id;
00168     Atom              vendorname_id;
00169     Atom              extension_id;
00170     Atom              ctext_id;
00171     Atom              focus_win_id;
00172     Atom              preedit_atr_id;
00173     Atom              status_atr_id;
00174     Atom              preeditfont_id;
00175     Atom              statusfont_id;
00176     Atom              preeditmaxsize_id;
00177     Atom              type_id;
00178     long             *type_list;
00179     char             *im_proto_vl;
00180     int                      im_proto_vnum;
00181     XIMStyles        *im_styles;
00182     Ximp_KeyList     *im_keyslist;
00183     Ximp_KeyList     *im_offkeyslist;
00184     char             *im_server_name;
00185     char             *im_server_vl;
00186     char             *im_vendor_name;
00187     Atom             *im_ext_list;
00188 /* for Force Select KeyRelease */
00189     Bool             is_forceselectkeyrelease;
00190 /* for CT => MB,WC converter */
00191     XlcConv           ctom_conv;
00192     XlcConv           ctow_conv;
00193 /* for Extension */
00194     Ximp_ExtXIMRec   *imtype;
00195 } XIMXimpRec;
00196 
00197 /*
00198  * IM data struction 
00199  */
00200 
00201 typedef struct _Ximp_XIM {
00202     XIMMethods               methods;
00203     XIMCoreRec               core;
00204     XIMXimpRec              *ximp_impart;
00205 } Ximp_XIMRec;
00206 
00207 /*
00208  * Candidates List Displaying Extention
00209  * ( Lookup Callback )
00210  */
00211 
00212 typedef struct {
00213     XIMCallback     start;
00214     XIMCallback     done;
00215     XIMCallback     draw;
00216     XIMCallback     proc;
00217 } ICExtLookupCallbacks;
00218 
00219 /*
00220  * data block describing the visual attributes associated with an input
00221  * context
00222  */
00223 
00224 typedef struct {
00225     XRectangle      area;
00226     XRectangle      area_needed;
00227     XPoint          spot_location;
00228     Colormap        colormap;
00229     Atom            std_colormap;
00230     unsigned long   foreground;
00231     unsigned long   background;
00232     Pixmap          background_pixmap;
00233     XFontSet        fontset;
00234     int             line_space;
00235     Cursor          cursor;
00236     XPointer        draw_data;
00237     ICExtLookupCallbacks callbacks;
00238 } ICExtLookupAttributes;
00239 
00240 typedef int Ximp_CBStatus;
00241 
00242 #define XIMPCBPREEDITACTIVE    0x00000001
00243 #define XIMPCBSTATUSACTIVE     0x00000002
00244 
00245 #define DEFAULTCBSTATUSSTRING " "
00246 
00247 typedef enum _Ximp_inputmode {
00248     BEING_BYPASSED  = 0,
00249     BEING_PREEDITED = 1
00250 } input_mode_t ;
00251 
00252 typedef struct {
00253     int              proto3;
00254     int              proto4;
00255 } XimpChangeMaskRec, *XimpChangeaMask;
00256 
00257 /*
00258  * XIMP Extension IC data struction 
00259  */
00260 
00261 typedef struct {
00262 /* Extended Callback attribute */
00263 /* - Error callback */
00264     XIMCallback                     error;
00265 /* - Lookup choices callback */
00266     Bool                     use_lookup_choices;
00267     ICExtLookupAttributes    lookup_attr;
00268 /* - restart callback */
00269     XIMCallback                     restart;
00270 /* - destroy callback */
00271     XIMCallback                     destroy;
00272 /* Control the input mode depending on the native language */
00273 /* - Setting method */
00274     int                             inputmode;
00275     int                             inputmode_resource;
00276     XimpChangeMaskRec               save_mask;
00277     int                             inputmode_current ;
00278 /* - Locking method */
00279     int                             lockmode;
00280     int                             lockmode_resource;
00281     int                             lockmode_request;
00282 /* - Reporting method */
00283     int                             use_modechange;
00284     int                             modechangecommand;
00285     XIMCallback                     modechange;
00286 /* Report the keyBinding change */
00287     int                             use_keybindchange;
00288 /* XIMP Vendor Extension data */
00289     void                    *ictype_vendor;
00290 /* Prev. Status data obtained thru GetAttributes */
00291     Ximp_StatusPropRec4            prev_status_data;
00292        
00293 } Ximp_ExtXICRec;
00294 
00295 /*
00296  * IC dependent data struction 
00297  */
00298 
00299 typedef struct _XICXimpRec {
00300     long                     icid;
00301     int                             svr_mode;
00302     input_mode_t             input_mode;
00303     int                             filter_mode;
00304     long                     value_mask;
00305     unsigned long            back_mask;
00306     Bool                     putback_key_event;
00307     Window                   back_focus_win;
00308     char                    *res_name,
00309                             *res_class;
00310     long                     proto3_mask;
00311     long                     proto4_mask;
00312     Ximp_PreeditPropRec4     preedit_attr;
00313     char                    *preedit_font;
00314     Ximp_StatusPropRec4             status_attr;
00315     char                    *status_font;
00316     Ximp_CBStatus            cbstatus;
00317     Ximp_ExtXICRec          *ictype;       /* for Extension */
00318 
00319 #define LIBIC_NULL                      0
00320 #define LIBIC_CONNECTED_FIRST_IC        1
00321 #define LIBIC_COPIED_IC                 2
00322 #define LIBIC_CONNECTION_REQUIRED_IC    3
00323 #define LIBIC_CONNECTED_IC              4
00324     unsigned short int             libic_status;
00325 
00326     Bool                    preedit_fg_assigned;
00327     Bool                    preedit_bg_assigned;
00328     Bool                    status_fg_assigned;
00329     Bool                    status_bg_assigned;
00330     Window                  cw_self_created;
00331     Bool                    is_areaneeded;
00332     XRectangle                     saved_areaneeded;
00333 } XICXimpRec;
00334 
00335 /*
00336  * IC data struction 
00337  */
00338 
00339 typedef struct _Ximp_XIC    *Ximp_XIC;
00340 
00341 typedef struct _Ximp_XIC {
00342     XICMethods        methods;
00343     XICCoreRec        core;
00344     XICXimpRec       *ximp_icpart;
00345 } Ximp_XICRec;
00346 
00347 /*
00348  * predicate argument
00349  */
00350 
00351 typedef struct {
00352     Atom      type;
00353     Window    owner;
00354     int              request;
00355     int              protocol;
00356     ICID      icid;
00357 } XimpCMPredicateArgRec, *XimpCMPredicateArg;
00358 
00359 typedef struct {
00360     Atom      type;
00361     Window    owner;
00362     ICID      icid;
00363     Window    window;
00364     Atom      atom;
00365 } XimpPNPredicateArgRec, *XimpPNPredicateArg;
00366 
00367 typedef struct {
00368     char      *name;
00369     int               (*func)();
00370 } icop_t;
00371 
00372 typedef enum {
00373     XICOpCreate = 1,
00374     XICOpSet = 2,
00375     XICOpGet = 3
00376 } XICOp_t;
00377 
00378 /*
00379  * Direct IM mode setting extension.
00380  */
00381 #define XIMP_EXT_SUN_DIRECTIMMODESETTING "_XIMP_EXT_SUN_DIRECTIMMODESETTING"
00382 
00383 #define XIMP_INPUT_STYLE    0x0001
00384 #define XIMP_CLIENT_WIN            0x0002
00385 #define XIMP_RES_NAME              0x0004
00386 #define XIMP_RES_CLASS             0x0008
00387 #define XIMP_GEOMETRY_CB        0x0010
00388 #define XIMP_FILTER_EV          0x0020
00389 #define XIMP_PRE_CALLBAK        0x0040
00390 #define XIMP_STS_CALLBAK        0x0080
00391 
00392 #define XIMP_CHK_FOCUSWINMASK(ic)         (ic->ximp_icpart->proto4_mask & XIMP_FOCUS_WIN_MASK4)
00393 #define XIMP_CHK_PREAREAMASK(ic)          (ic->ximp_icpart->proto4_mask & XIMP_PRE_AREA_MASK4)
00394 #define XIMP_CHK_PREAREANEEDMASK(ic)             (ic->ximp_icpart->proto4_mask & XIMP_PRE_AREANEED_MASK4)
00395 #define XIMP_CHK_PRECOLORMAPMASK(ic)             (ic->ximp_icpart->proto4_mask & XIMP_PRE_COLORMAP_MASK4)
00396 #define XIMP_CHK_PRESTDCOLORMAPMASK(ic)          (ic->ximp_icpart->proto4_mask & XIMP_PRE_STD_COLORMAP_MASK4)
00397 #define XIMP_CHK_PREFGMASK(ic)                   (ic->ximp_icpart->proto4_mask & XIMP_PRE_FG_MASK4)
00398 #define XIMP_CHK_PREBGMASK(ic)                   (ic->ximp_icpart->proto4_mask & XIMP_PRE_BG_MASK4)
00399 #define XIMP_CHK_PREBGPIXMAPMASK(ic)             (ic->ximp_icpart->proto4_mask & XIMP_PRE_BGPIXMAP_MASK4)
00400 #define XIMP_CHK_PRELINESPMASK(ic)        (ic->ximp_icpart->proto4_mask & XIMP_PRE_LINESP_MASK4)
00401 #define XIMP_CHK_PRECURSORMASK(ic)        (ic->ximp_icpart->proto4_mask & XIMP_PRE_CURSOR_MASK4)
00402 #define XIMP_CHK_PRESPOTLMASK(ic)         (ic->ximp_icpart->proto4_mask & XIMP_PRE_SPOTL_MASK4)
00403 #define XIMP_CHK_STSAREAMASK(ic)          (ic->ximp_icpart->proto4_mask & XIMP_STS_AREA_MASK4)
00404 #define XIMP_CHK_STSAREANEEDMASK(ic)             (ic->ximp_icpart->proto4_mask & XIMP_STS_AREANEED_MASK4)
00405 #define XIMP_CHK_STSCOLORMAPMASK(ic)             (ic->ximp_icpart->proto4_mask & XIMP_STS_COLORMAP_MASK4)
00406 #define XIMP_CHK_STSSTDCOLORMAPMASK(ic)          (ic->ximp_icpart->proto4_mask & XIMP_STS_STD_COLORMAP_MASK4)
00407 #define XIMP_CHK_STSFGMASK(ic)                   (ic->ximp_icpart->proto4_mask & XIMP_STS_FG_MASK4)
00408 #define XIMP_CHK_STSBGMASK(ic)                   (ic->ximp_icpart->proto4_mask & XIMP_STS_BG_MASK4)
00409 #define XIMP_CHK_STSBGPIXMAPMASK(ic)             (ic->ximp_icpart->proto4_mask & XIMP_STS_BGPIXMAP_MASK4)
00410 #define XIMP_CHK_STSLINESPMASK(ic)        (ic->ximp_icpart->proto4_mask & XIMP_STS_LINESP_MASK4)
00411 #define XIMP_CHK_STSCURSORMASK(ic)        (ic->ximp_icpart->proto4_mask & XIMP_STS_CURSOR_MASK4)
00412 #define XIMP_CHK_STSWINDOWMASK(ic)        (ic->ximp_icpart->proto4_mask & XIMP_STS_WINDOW_MASK4)
00413 #define XIMP_CHK_PREFONTMASK(ic)          (ic->ximp_icpart->proto4_mask & XIMP_PRE_FONT_MASK4)
00414 #define XIMP_CHK_STSFONTMASK(ic)          (ic->ximp_icpart->proto4_mask & XIMP_STS_FONT_MASK4)
00415 #define XIMP_CHK_SERVERTYPEMASK(ic)              (ic->ximp_icpart->proto4_mask & XIMP_SERVERTYPE_MASK4)
00416 
00417 #define XIMP_CHK_PROP_FOCUS(mask)         ( (mask.proto4) & XIMP_FOCUS_WIN_MASK4 )
00418 #define XIMP_CHK_PROP_PREEDIT(mask)              ( (mask.proto4) & \
00419                                            (  XIMP_PRE_AREA_MASK4 \
00420                                             | XIMP_PRE_AREANEED_MASK4 \
00421                                             | XIMP_PRE_COLORMAP_MASK4 \
00422                                             | XIMP_PRE_STD_COLORMAP_MASK4 \
00423                                             | XIMP_PRE_FG_MASK4 \
00424                                             | XIMP_PRE_BG_MASK4 \
00425                                             | XIMP_PRE_BGPIXMAP_MASK4 \
00426                                             | XIMP_PRE_LINESP_MASK4 \
00427                                             | XIMP_PRE_CURSOR_MASK4 \
00428                                             | XIMP_PRE_SPOTL_MASK4 ) )
00429 #define XIMP_CHK_PROP_STATUS(mask)        ( (mask.proto4) & \
00430                                            (  XIMP_STS_AREA_MASK4 \
00431                                             | XIMP_STS_AREANEED_MASK4 \
00432                                             | XIMP_STS_COLORMAP_MASK4 \
00433                                             | XIMP_STS_STD_COLORMAP_MASK4 \
00434                                             | XIMP_STS_FG_MASK4 \
00435                                             | XIMP_STS_BG_MASK4 \
00436                                             | XIMP_STS_BGPIXMAP_MASK4 \
00437                                             | XIMP_STS_LINESP_MASK4 \
00438                                             | XIMP_STS_CURSOR_MASK4 \
00439                                             | XIMP_STS_WINDOW_MASK4 ) )
00440 #define XIMP_CHK_PROP_PREFONT(mask)              ( (mask.proto4) & XIMP_PRE_FONT_MASK4 )
00441 #define XIMP_CHK_PROP_STSFONT(mask)              ( (mask.proto4) & XIMP_STS_FONT_MASK4 )
00442 #define XIMP_EQU_PRESPOTLMASK(mask)              ( (mask.proto4) == XIMP_PRE_SPOTL_MASK4 )
00443 
00444 #define XIMP_UNSET_PROPFOCUS(mask)        { mask.proto4 &= ~(XIMP_FOCUS_WIN_MASK4); \
00445                                             mask.proto3 &= ~(XIMP_FOCUS_WIN_MASK3); }
00446 #define XIMP_UNSET_PROPPREEDIT(mask)             { mask.proto4 &= ~( \
00447                                            (  XIMP_PRE_AREA_MASK4 \
00448                                             | XIMP_PRE_AREANEED_MASK4 \
00449                                             | XIMP_PRE_COLORMAP_MASK4 \
00450                                             | XIMP_PRE_STD_COLORMAP_MASK4 \
00451                                             | XIMP_PRE_FG_MASK4 \
00452                                             | XIMP_PRE_BG_MASK4 \
00453                                             | XIMP_PRE_BGPIXMAP_MASK4 \
00454                                             | XIMP_PRE_LINESP_MASK4 \
00455                                             | XIMP_PRE_CURSOR_MASK4 \
00456                                             | XIMP_PRE_SPOTL_MASK4 \
00457                                             | XIMP_PRE_FONT_MASK4 ) ); \
00458                                             mask.proto3 &= ~( \
00459                                            (  XIMP_PRE_AREA_MASK3 \
00460                                             | XIMP_PRE_AREANEED_MASK3 \
00461                                             | XIMP_PRE_COLORMAP_MASK3 \
00462                                             | XIMP_PRE_FG_MASK3 \
00463                                             | XIMP_PRE_BG_MASK3 \
00464                                             | XIMP_PRE_BGPIXMAP_MASK3 \
00465                                             | XIMP_PRE_LINESP_MASK3 \
00466                                             | XIMP_PRE_CURSOR_MASK3 \
00467                                             | XIMP_PRE_SPOTL_MASK3 \
00468                                             | XIMP_PRE_FONT_MASK4 ) ); }
00469 #define XIMP_UNSET_PROPSTATUS(mask)              { mask.proto4 &= ~( \
00470                                            (  XIMP_STS_AREA_MASK4 \
00471                                             | XIMP_STS_AREANEED_MASK4 \
00472                                             | XIMP_STS_COLORMAP_MASK4 \
00473                                             | XIMP_STS_STD_COLORMAP_MASK4 \
00474                                             | XIMP_STS_FG_MASK4 \
00475                                             | XIMP_STS_BG_MASK4 \
00476                                             | XIMP_STS_BGPIXMAP_MASK4 \
00477                                             | XIMP_STS_LINESP_MASK4 \
00478                                             | XIMP_STS_CURSOR_MASK4 \
00479                                             | XIMP_STS_WINDOW_MASK4 \
00480                                             | XIMP_STS_FONT_MASK4 ) ); \
00481                                             mask.proto3 &= ~( \
00482                                            (  XIMP_STS_AREA_MASK3 \
00483                                             | XIMP_STS_AREANEED_MASK3 \
00484                                             | XIMP_STS_COLORMAP_MASK3 \
00485                                             | XIMP_STS_FG_MASK3 \
00486                                             | XIMP_STS_BG_MASK3 \
00487                                             | XIMP_STS_BGPIXMAP_MASK3 \
00488                                             | XIMP_STS_LINESP_MASK3 \
00489                                             | XIMP_STS_CURSOR_MASK3 \
00490                                             | XIMP_STS_WINDOW_MASK3 \
00491                                             | XIMP_STS_FONT_MASK3 ) ); }
00492 
00493 #define XIMP_SET_NULLMASK(mask)                  { mask.proto4                 = NULL; \
00494                                             mask.proto3                 = NULL; }
00495 #define XIMP_SET_NULLMASK2(mask)          { mask->proto4                 = NULL; \
00496                                             mask->proto3                 = NULL; }
00497 
00498 #define XIMP_SET_FOCUSWINMASK(ic)         { ic->ximp_icpart->proto4_mask |= XIMP_FOCUS_WIN_MASK4; \
00499                                             ic->ximp_icpart->proto3_mask |= XIMP_FOCUS_WIN_MASK3; }
00500 
00501 #define XIMP_SET_FOCUSWINMASK2(ic, mask)  { ic->ximp_icpart->proto4_mask |= XIMP_FOCUS_WIN_MASK4; \
00502                                             ic->ximp_icpart->proto3_mask |= XIMP_FOCUS_WIN_MASK3; \
00503                                             mask->proto4                 |= XIMP_FOCUS_WIN_MASK4; \
00504                                             mask->proto3                 |= XIMP_FOCUS_WIN_MASK3; }
00505 #define XIMP_SET_PREAREAMASK(ic, mask)           { ic->ximp_icpart->proto4_mask |= XIMP_PRE_AREA_MASK4; \
00506                                             ic->ximp_icpart->proto3_mask |= XIMP_PRE_AREA_MASK3; \
00507                                             mask->proto4                 |= XIMP_PRE_AREA_MASK4; \
00508                                             mask->proto3                 |= XIMP_PRE_AREA_MASK3; }
00509 #define XIMP_SET_PREAREANEEDMASK(ic, mask)       { ic->ximp_icpart->proto4_mask |= XIMP_PRE_AREANEED_MASK4; \
00510                                             ic->ximp_icpart->proto3_mask |= XIMP_PRE_AREANEED_MASK3; \
00511                                             mask->proto4                 |= XIMP_PRE_AREANEED_MASK4; \
00512                                             mask->proto3                 |= XIMP_PRE_AREANEED_MASK3; }
00513 #define XIMP_SET_PRECOLORMAPMASK(ic, mask)       { ic->ximp_icpart->proto4_mask |= XIMP_PRE_COLORMAP_MASK4; \
00514                                             ic->ximp_icpart->proto3_mask |= XIMP_PRE_COLORMAP_MASK3; \
00515                                             mask->proto4                 |= XIMP_PRE_COLORMAP_MASK4; \
00516                                             mask->proto3                 |= XIMP_PRE_COLORMAP_MASK3; }
00517 #define XIMP_SET_PRESTDCOLORMAPMASK(ic, mask)    { ic->ximp_icpart->proto4_mask |= XIMP_PRE_STD_COLORMAP_MASK4; \
00518                                             ic->ximp_icpart->proto3_mask |= XIMP_PRE_COLORMAP_MASK3; \
00519                                             mask->proto4                 |= XIMP_PRE_STD_COLORMAP_MASK4; \
00520                                             mask->proto3                 |= XIMP_PRE_COLORMAP_MASK3; }
00521 #define XIMP_SET_PREFGMASK(ic, mask)             { ic->ximp_icpart->proto4_mask |= XIMP_PRE_FG_MASK4; \
00522                                             ic->ximp_icpart->proto3_mask |= XIMP_PRE_FG_MASK3; \
00523                                             mask->proto4                 |= XIMP_PRE_FG_MASK4; \
00524                                             mask->proto3                 |= XIMP_PRE_FG_MASK3; }
00525 #define XIMP_SET_PREBGMASK(ic, mask)             { ic->ximp_icpart->proto4_mask |= XIMP_PRE_BG_MASK4; \
00526                                             ic->ximp_icpart->proto3_mask |= XIMP_PRE_BG_MASK3; \
00527                                             mask->proto4                 |= XIMP_PRE_BG_MASK4; \
00528                                             mask->proto3                 |= XIMP_PRE_BG_MASK3; }
00529 #define XIMP_SET_PREBGPIXMAPMASK(ic, mask)       { ic->ximp_icpart->proto4_mask |= XIMP_PRE_BGPIXMAP_MASK4; \
00530                                             ic->ximp_icpart->proto3_mask |= XIMP_PRE_BGPIXMAP_MASK3; \
00531                                             mask->proto4                 |= XIMP_PRE_BGPIXMAP_MASK4; \
00532                                             mask->proto3                 |= XIMP_PRE_BGPIXMAP_MASK3; }
00533 #define XIMP_SET_PRELINESPMASK(ic, mask)  { ic->ximp_icpart->proto4_mask |= XIMP_PRE_LINESP_MASK4; \
00534                                             ic->ximp_icpart->proto3_mask |= XIMP_PRE_LINESP_MASK3; \
00535                                             mask->proto4                 |= XIMP_PRE_LINESP_MASK4; \
00536                                             mask->proto3                 |= XIMP_PRE_LINESP_MASK3; }
00537 #define XIMP_SET_PRECURSORMASK(ic, mask)  { ic->ximp_icpart->proto4_mask |= XIMP_PRE_CURSOR_MASK4; \
00538                                             ic->ximp_icpart->proto3_mask |= XIMP_PRE_CURSOR_MASK3; \
00539                                             mask->proto4                 |= XIMP_PRE_CURSOR_MASK4; \
00540                                             mask->proto3                 |= XIMP_PRE_CURSOR_MASK3; }
00541 #define XIMP_SET_PRESPOTLMASK(ic, mask)          { ic->ximp_icpart->proto4_mask |= XIMP_PRE_SPOTL_MASK4; \
00542                                             ic->ximp_icpart->proto3_mask |= XIMP_PRE_SPOTL_MASK3; \
00543                                             mask->proto4                 |= XIMP_PRE_SPOTL_MASK4; \
00544                                             mask->proto3                 |= XIMP_PRE_SPOTL_MASK3; }
00545 
00546 #define XIMP_SET_STSAREAMASK(ic, mask)           { ic->ximp_icpart->proto4_mask |= XIMP_STS_AREA_MASK4; \
00547                                             ic->ximp_icpart->proto3_mask |= XIMP_STS_AREA_MASK3; \
00548                                             mask->proto4                 |= XIMP_STS_AREA_MASK4; \
00549                                             mask->proto3                 |= XIMP_STS_AREA_MASK3; }
00550 #define XIMP_SET_STSAREANEEDMASK(ic, mask)       { ic->ximp_icpart->proto4_mask |= XIMP_STS_AREANEED_MASK4; \
00551                                             ic->ximp_icpart->proto3_mask |= XIMP_STS_AREANEED_MASK3; \
00552                                             mask->proto4                 |= XIMP_STS_AREANEED_MASK4; \
00553                                             mask->proto3                 |= XIMP_STS_AREANEED_MASK3; }
00554 #define XIMP_SET_STSCOLORMAPMASK(ic, mask)       { ic->ximp_icpart->proto4_mask |= XIMP_STS_COLORMAP_MASK4; \
00555                                             ic->ximp_icpart->proto3_mask |= XIMP_STS_COLORMAP_MASK3; \
00556                                             mask->proto4                 |= XIMP_STS_COLORMAP_MASK4; \
00557                                             mask->proto3                 |= XIMP_STS_COLORMAP_MASK3; }
00558 #define XIMP_SET_STSSTDCOLORMAPMASK(ic, mask)    { ic->ximp_icpart->proto4_mask |= XIMP_STS_STD_COLORMAP_MASK4; \
00559                                             ic->ximp_icpart->proto3_mask |= XIMP_STS_COLORMAP_MASK3; \
00560                                             mask->proto4                 |= XIMP_STS_STD_COLORMAP_MASK4; \
00561                                             mask->proto3                 |= XIMP_STS_COLORMAP_MASK3; }
00562 #define XIMP_SET_STSFGMASK(ic, mask)             { ic->ximp_icpart->proto4_mask |= XIMP_STS_FG_MASK4; \
00563                                             ic->ximp_icpart->proto3_mask |= XIMP_STS_FG_MASK3; \
00564                                             mask->proto4                 |= XIMP_STS_FG_MASK4; \
00565                                             mask->proto3                 |= XIMP_STS_FG_MASK3; }
00566 #define XIMP_SET_STSBGMASK(ic, mask)             { ic->ximp_icpart->proto4_mask |= XIMP_STS_BG_MASK4; \
00567                                             ic->ximp_icpart->proto3_mask |= XIMP_STS_BG_MASK3; \
00568                                             mask->proto4                 |= XIMP_STS_BG_MASK4; \
00569                                             mask->proto3                 |= XIMP_STS_BG_MASK3; }
00570 #define XIMP_SET_STSBGPIXMAPMASK(ic, mask)       { ic->ximp_icpart->proto4_mask |= XIMP_STS_BGPIXMAP_MASK4; \
00571                                             ic->ximp_icpart->proto3_mask |= XIMP_STS_BGPIXMAP_MASK3; \
00572                                             mask->proto4                 |= XIMP_STS_BGPIXMAP_MASK4; \
00573                                             mask->proto3                 |= XIMP_STS_BGPIXMAP_MASK3; }
00574 #define XIMP_SET_STSLINESPMASK(ic, mask)  { ic->ximp_icpart->proto4_mask |= XIMP_STS_LINESP_MASK4; \
00575                                             ic->ximp_icpart->proto3_mask |= XIMP_STS_LINESP_MASK3; \
00576                                             mask->proto4                 |= XIMP_STS_LINESP_MASK4; \
00577                                             mask->proto3                 |= XIMP_STS_LINESP_MASK3; }
00578 #define XIMP_SET_STSCURSORMASK(ic, mask)  { ic->ximp_icpart->proto4_mask |= XIMP_STS_CURSOR_MASK4; \
00579                                             ic->ximp_icpart->proto3_mask |= XIMP_STS_CURSOR_MASK3; \
00580                                             mask->proto4                 |= XIMP_STS_CURSOR_MASK4; \
00581                                             mask->proto3                 |= XIMP_STS_CURSOR_MASK3; }
00582 #define XIMP_SET_STSWINDOWMASK(ic, mask)  { ic->ximp_icpart->proto4_mask |= XIMP_STS_WINDOW_MASK4; \
00583                                             ic->ximp_icpart->proto3_mask |= XIMP_STS_WINDOW_MASK3; \
00584                                             mask->proto4                 |= XIMP_STS_WINDOW_MASK4; \
00585                                             mask->proto3                 |= XIMP_STS_WINDOW_MASK3; }
00586 
00587 #define XIMP_SET_PREFONTMASK(ic, mask)           { ic->ximp_icpart->proto4_mask |= XIMP_PRE_FONT_MASK4; \
00588                                             ic->ximp_icpart->proto3_mask |= XIMP_PRE_FONT_MASK3; \
00589                                             mask->proto4                 |= XIMP_PRE_FONT_MASK4; \
00590                                             mask->proto3                 |= XIMP_PRE_FONT_MASK3; }
00591 #define XIMP_SET_STSFONTMASK(ic, mask)           { ic->ximp_icpart->proto4_mask |= XIMP_STS_FONT_MASK4; \
00592                                             ic->ximp_icpart->proto3_mask |= XIMP_STS_FONT_MASK3; \
00593                                             mask->proto4                 |= XIMP_STS_FONT_MASK4; \
00594                                             mask->proto3                 |= XIMP_STS_FONT_MASK3; }
00595 #define XIMP_SET_SERVERTYPEMASK(ic, mask) { ic->ximp_icpart->proto4_mask |= XIMP_SERVERTYPE_MASK4; \
00596                                             mask->proto4                 |= XIMP_SERVERTYPE_MASK4; }
00597 
00598 #define XIMP_PROTO_MASK(ic, mask)  (ISXimp4(ic)?mask.proto4:mask.proto3)
00599 #define XIMP_PROTO_MASK2(ic)              (ISXimp4(ic)?ic->ximp_icpart->proto4_mask:ic->ximp_icpart->proto3_mask)
00600 
00601 #define XIMP_FOCUS_WIN_MASK(ic)           (ISXimp4(ic)?XIMP_FOCUS_WIN_MASK4:XIMP_FOCUS_WIN_MASK3)
00602 #define XIMP_PRE_AREA_MASK(ic)            (ISXimp4(ic)?XIMP_PRE_AREA_MASK4:XIMP_PRE_AREA_MASK3)
00603 #define XIMP_PRE_AREANEED_MASK(ic) (ISXimp4(ic)?XIMP_PRE_AREANEED_MASK4:XIMP_PRE_AREANEED_MASK3)
00604 #define XIMP_PRE_COLORMAP_MASK(ic) (ISXimp4(ic)?XIMP_PRE_COLORMAP_MASK4:XIMP_PRE_COLORMAP_MASK3)
00605 #define XIMP_PRE_STD_COLORMAP_MASK(ic)    (ISXimp4(ic)?XIMP_PRE_STD_COLORMAP_MASK4:XIMP_PRE_COLORMAP_MASK3)
00606 #define XIMP_PRE_FG_MASK(ic)              (ISXimp4(ic)?XIMP_PRE_FG_MASK4:XIMP_PRE_FG_MASK3)
00607 #define XIMP_PRE_BG_MASK(ic)              (ISXimp4(ic)?XIMP_PRE_BG_MASK4:XIMP_PRE_BG_MASK3)
00608 #define XIMP_PRE_BGPIXMAP_MASK(ic) (ISXimp4(ic)?XIMP_PRE_BGPIXMAP_MASK4:XIMP_PRE_BGPIXMAP_MASK3)
00609 #define XIMP_PRE_LINESP_MASK(ic)   (ISXimp4(ic)?XIMP_PRE_LINESP_MASK4:XIMP_PRE_LINESP_MASK3)
00610 #define XIMP_PRE_CURSOR_MASK(ic)   (ISXimp4(ic)?XIMP_PRE_CURSOR_MASK4:XIMP_PRE_CURSOR_MASK3)
00611 #define XIMP_PRE_SPOTL_MASK(ic)           (ISXimp4(ic)?XIMP_PRE_SPOTL_MASK4:XIMP_PRE_SPOTL_MASK3)
00612 #define XIMP_STS_AREA_MASK(ic)            (ISXimp4(ic)?XIMP_STS_AREA_MASK4:XIMP_STS_AREA_MASK3)
00613 #define XIMP_STS_AREANEED_MASK(ic) (ISXimp4(ic)?XIMP_STS_AREANEED_MASK4:XIMP_STS_AREANEED_MASK3)
00614 #define XIMP_STS_COLORMAP_MASK(ic) (ISXimp4(ic)?XIMP_STS_COLORMAP_MASK4:XIMP_STS_COLORMAP_MASK3)
00615 #define XIMP_STS_STD_COLORMAP_MASK(ic)    (ISXimp4(ic)?XIMP_STS_STD_COLORMAP_MASK4:XIMP_STS_COLORMAP_MASK3)
00616 #define XIMP_STS_FG_MASK(ic)              (ISXimp4(ic)?XIMP_STS_FG_MASK4:XIMP_STS_FG_MASK3)
00617 #define XIMP_STS_BG_MASK(ic)              (ISXimp4(ic)?XIMP_STS_BG_MASK4:XIMP_STS_BG_MASK3)
00618 #define XIMP_STS_BGPIXMAP_MASK(ic) (ISXimp4(ic)?XIMP_STS_BGPIXMAP_MASK4:XIMP_STS_BGPIXMAP_MASK3)
00619 #define XIMP_STS_LINESP_MASK(ic)   (ISXimp4(ic)?XIMP_STS_LINESP_MASK4:XIMP_STS_LINESP_MASK3)
00620 #define XIMP_STS_CURSOR_MASK(ic)   (ISXimp4(ic)?XIMP_STS_CURSOR_MASK4:XIMP_STS_CURSOR_MASK3)
00621 #define XIMP_STS_WINDOW_MASK(ic)   (ISXimp4(ic)?XIMP_STS_WINDOW_MASK4:XIMP_STS_WINDOW_MASK3)
00622 #define XIMP_PRE_FONT_MASK(ic)            (ISXimp4(ic)?XIMP_PRE_FONT_MASK4:XIMP_PRE_FONT_MASK3)
00623 #define XIMP_STS_FONT_MASK(ic)            (ISXimp4(ic)?XIMP_STS_FONT_MASK4:XIMP_STS_FONT_MASK3)
00624 
00625 #define XIMP_PROP_FOCUS(ic) ( XIMP_FOCUS_WIN_MASK(ic) )
00626 #define XIMP_PROP_PREEDIT(ic)      ( XIMP_PRE_AREA_MASK(ic) \
00627                             | XIMP_PRE_FG_MASK(ic) \
00628                             | XIMP_PRE_BG_MASK(ic) \
00629                             | XIMP_PRE_COLORMAP_MASK(ic) \
00630                             | XIMP_PRE_BGPIXMAP_MASK(ic) \
00631                             | XIMP_PRE_LINESP_MASK(ic) \
00632                             | XIMP_PRE_CURSOR_MASK(ic) \
00633                             | XIMP_PRE_AREANEED_MASK(ic) \
00634                             | XIMP_PRE_SPOTL_MASK(ic) )
00635 #define XIMP_PROP_STATUS(ic)       ( XIMP_STS_AREA_MASK(ic) \
00636                             | XIMP_STS_FG_MASK(ic) \
00637                             | XIMP_STS_BG_MASK(ic) \
00638                             | XIMP_STS_COLORMAP_MASK(ic) \
00639                             | XIMP_STS_BGPIXMAP_MASK(ic) \
00640                             | XIMP_STS_LINESP_MASK(ic) \
00641                             | XIMP_STS_CURSOR_MASK(ic) \
00642                             | XIMP_STS_AREANEED_MASK(ic) \
00643                             | XIMP_STS_WINDOW_MASK(ic) )
00644 #define XIMP_PROP_PREFONT(ic)      ( XIMP_PRE_FONT_MASK(ic) )
00645 #define XIMP_PROP_STSFONT(ic)      ( XIMP_STS_FONT_MASK(ic) )
00646 
00647 #define XIMP_NOCONNECT             0x0000
00648 #define XIMP_DELAYBINDABLE  0x0001
00649 #define XIMP_RECONNECTABLE  0x0002
00650 #define XIMP_RESTARTABLE    0x0004
00651 
00652 #define IS_FORCESELECTKEYRELEASE(im)        (((Ximp_XIM)(im))->ximp_impart->is_forceselectkeyrelease)
00653 
00654 #define ISXimp4IM(im)              (im->ximp_impart->im_proto_vnum >= XIMP_VERSION_NUMBER) 
00655 #define RECONNECTION_MODE(im)      (((Ximp_XIM)(im))->ximp_impart->reconnection_mode)
00656 #define IS_SERVER_CONNECTED(im)    (((Ximp_XIM)(im))->ximp_impart->is_connected)
00657 
00658 #define IS_IC_CONNECTED(ic) (ic->ximp_icpart->icid)
00659 
00660 #define IS_RECONNECTABLE(im)   (RECONNECTION_MODE(im) & XIMP_RECONNECTABLE)
00661 #define MAKE_RECONNECTABLE(im) (RECONNECTION_MODE(im) |= XIMP_RECONNECTABLE)
00662 #define MAKE_UNRECONNECTABLE(im) (RECONNECTION_MODE(im) &= ~XIMP_RECONNECTABLE)
00663 #define IS_DELAYBINDABLE(im)   (RECONNECTION_MODE(im) & XIMP_DELAYBINDABLE)
00664 #define MAKE_DELAYBINDABLE(im) (RECONNECTION_MODE(im) |= XIMP_DELAYBINDABLE)
00665 #define MAKE_UNDELAYBINDABLE(im) (RECONNECTION_MODE(im) &= ~XIMP_DELAYBINDABLE)
00666 #define IS_RESTARTABLE(im)     (RECONNECTION_MODE(im) & XIMP_RESTARTABLE)
00667 #define MAKE_RESTARTABLE(im)   (RECONNECTION_MODE(im) |= XIMP_RESTARTABLE)
00668 #define MAKE_UNRESTARTABLE(im)   (RECONNECTION_MODE(im) &= ~XIMP_RESTARTABLE)
00669 #define IS_UNCONNECTABLE(im)   (RECONNECTION_MODE(im) == XIMP_NOCONNECT)
00670 #define MAKE_UNCONNECTABLE(im) (RECONNECTION_MODE(im) = XIMP_NOCONNECT)
00671 #define IS_CONNECTABLE(im)     (RECONNECTION_MODE(im) != XIMP_NOCONNECT)
00672 #define MAKE_CONNECTABLE(im)   (RECONNECTION_MODE(im) = XIMP_RECONNECTABLE|XIMP_DELAYBINDABLE|XIMP_RESTARTABLE)
00673 
00674 #define ISXimp4(ic)   (((Ximp_XIM)ic->core.im)->ximp_impart->im_proto_vnum >= XIMP_VERSION_NUMBER)
00675 
00676 #define ISFE1(ic)     (((Ximp_XIC)ic)->ximp_icpart->svr_mode == XIMP_FE_TYPE1)
00677 #define ISFE2(ic)     (((Ximp_XIC)ic)->ximp_icpart->svr_mode == XIMP_FE_TYPE2)
00678 #define ISFE3(ic)     (((Ximp_XIC)ic)->ximp_icpart->svr_mode == XIMP_FE_TYPE3)
00679 #define ISBE1(ic)     ((((Ximp_XIC)ic)->ximp_icpart->svr_mode & XIMP_BE_TYPE1) == XIMP_BE_TYPE1)
00680 #define ISBE2(ic)     ((((Ximp_XIC)ic)->ximp_icpart->svr_mode & XIMP_BE_TYPE2) == XIMP_BE_TYPE2)
00681 #define ISSYNCBE1(ic) (((Ximp_XIC)ic)->ximp_icpart->svr_mode == XIMP_SYNC_BE_TYPE1)
00682 #define ISSYNCBE2(ic) (((Ximp_XIC)ic)->ximp_icpart->svr_mode == XIMP_SYNC_BE_TYPE2)
00683 #define ISFRONTEND(ic) (((Ximp_XIC)ic)->ximp_icpart->svr_mode & XIMP_FRONTEND4)
00684 #define ISBACKEND(ic) (((Ximp_XIC)ic)->ximp_icpart->svr_mode & XIMP_BACKEND4)
00685 #define ISTYPE1(ic)   (((Ximp_XIC)ic)->ximp_icpart->svr_mode & XIMP_TYPE1)
00686 #define ISTYPE2(ic)   (((Ximp_XIC)ic)->ximp_icpart->svr_mode & XIMP_TYPE2)
00687 #define ISTYPE3(ic)   (((Ximp_XIC)ic)->ximp_icpart->svr_mode & XIMP_TYPE3)
00688 #define ISSYNC(ic)    (((Ximp_XIC)ic)->ximp_icpart->svr_mode & XIMP_SYNC)
00689 
00690 #define ISXIMP3FE(ic) ((((Ximp_XIC)ic)->ximp_icpart->svr_mode & 0x03) == XIMP_FRONTEND_BC_MASK)
00691 
00692 #define IS_BEING_PREEDITED(ic)     (((Ximp_XIC)ic)->ximp_icpart->input_mode == BEING_PREEDITED)
00693 #define IS_FABLICATED(ic,ev)       ((ic->ximp_icpart->putback_key_event) || (ev->keycode == 0))
00694 #define IS_USE_WCHAR(ic)    (((Ximp_XIM)ic->core.im)->ximp_impart->use_wchar)
00695     
00696 #define ISCMOf(ev,n,x)             (((XEvent*)ev)->xclient.data.l[n] == (x))
00697 #define ISXIMP_ERROR(ev)    (((XEvent*)ev)->type == ClientMessage && ((XEvent*)ev)->xclient.format == 32 \
00698                               && (ISCMOf(ev,0,XIMP_ERROR3) || ISCMOf(ev,0,XIMP_ERROR4)))
00699 #define XIMP_SYNCHRONIZE(ic)        {if(IS_SERVER_CONNECTED((ic->core.im)) && (IS_BEING_PREEDITED(ic)) &&\
00700                                   ((((Ximp_XIC)ic)->ximp_icpart->svr_mode) & XIMP_SYNC ))\
00701                                   _Ximp_Synchronize(ic);}
00702 
00703 #define XIMP_PREEDIT_MAX_LONG(ic) (ISXimp4(ic)?XIMP_PREEDIT_MAX_LONG4:XIMP_PREEDIT_MAX_LONG3)
00704 #define XIMP_STATUS_MAX_LONG(ic)  (ISXimp4(ic)?XIMP_STATUS_MAX_LONG4:XIMP_STATUS_MAX_LONG3)
00705 
00706 #define  XIMP3_RESET_RETURN_ATOM    2
00707 #define  XIMP4_RESET_RETURN_DETAIL  2
00708 #define  XIMP4_RESET_RETURN_ATOM    3
00709 #define  NO_RESET_DATA              0
00710 #define  RESET_DATA_VIA_CM          1
00711 #define  RESET_DATA_VIA_PROP        2
00712 #define  XIMP_RESET_RETURN_ATOM(ic) (ISXimp4(ic)?XIMP4_RESET_RETURN_ATOM:XIMP3_RESET_RETURN_ATOM)
00713 
00714 #define  XIMP_KEYRELEASE(ic)              XIMP_KEYRELEASE4
00715 #define  XIMP_KEYPRESS(ic)         (ISXimp4(ic)?XIMP_KEYPRESS4:XIMP_KEYPRESS3)
00716 
00717 #define  XIMP_CREATE(ic)           (ISXimp4(ic)?XIMP_CREATE4:XIMP_CREATE3)
00718 #define  XIMP_DESTROY(ic)          (ISXimp4(ic)?XIMP_DESTROY4:XIMP_DESTROY3)
00719 #define  XIMP_REG_KEY_PRESSED(ic)  (ISXimp4(ic)?XIMP_REG_KEY_PRESSED4:XIMP_BEGIN3)
00720 #define  XIMP_SETFOCUS(ic)         (ISXimp4(ic)?XIMP_SETFOCUS4:XIMP_SETFOCUS3)
00721 #define  XIMP_UNSETFOCUS(ic)              (ISXimp4(ic)?XIMP_UNSETFOCUS4:XIMP_UNSETFOCUS3)
00722 #define  XIMP_CLIENT_WINDOW(ic)           XIMP_CLIENT_WINDOW4
00723 #define  XIMP_FOCUS_WINDOW(ic)            XIMP_FOCUS_WINDOW4
00724 #define  XIMP_MOVE(ic)                    (ISXimp4(ic)?XIMP_MOVE4:XIMP_MOVE3)
00725 #define  XIMP_RESET(ic)                   (ISXimp4(ic)?XIMP_RESET4:XIMP_RESET3)
00726 #define  XIMP_SETVALUE(ic)         (ISXimp4(ic)?XIMP_SETVALUE4:XIMP_SETVALUE3)
00727 #define  XIMP_GETVALUE(ic)         (ISXimp4(ic)?XIMP_GETVALUE4:XIMP_GETVALUE3)
00728 
00729 #define  XIMP_PREEDITSTART_RETURN(ic)     (ISXimp4(ic)?XIMP_PREEDITSTART_RETURN4:XIMP_PREEDITSTART_RETURN3)
00730 #define  XIMP_PREEDITCARET_RETURN(ic)     (ISXimp4(ic)?XIMP_PREEDITCARET_RETURN4:XIMP_PREEDITCARET_RETURN3)
00731 #define  XIMP_SPROC_STARTED(ic)           (ISXimp4(ic)?XIMP_SPROC_STARTED4:XIMP_PROCESS_BEGIN3)
00732 #define  XIMP_SPROC_STOPPED(ic)           (ISXimp4(ic)?XIMP_SPROC_STOPPED4:XIMP_PROCESS_END3)
00733 #define  XIMP_READPROP(ic)         (ISXimp4(ic)?XIMP_READPROP4:XIMP_READPROP3)
00734 #define  XIMP_CLIENT_WINDOW_RETURN(ic)    XIMP_CLIENT_WINDOW_RETURN4
00735 #define  XIMP_FOCUS_WINDOW_RETURN(ic)     XIMP_FOCUS_WINDOW_RETURN4
00736 #define  XIMP_GETVALUE_RETURN(ic)  (ISXimp4(ic)?XIMP_GETVALUE_RETURN4:XIMP_GETVALUE_RETURN3)
00737 #define  XIMP_RESET_RETURN(ic)            (ISXimp4(ic)?XIMP_RESET_RETURN4:XIMP_RESET_RETURN3)
00738 #define  XIMP_CREATE_RETURN(ic)           (ISXimp4(ic)?XIMP_CREATE_RETURN4:XIMP_CREATE_RETURN3)
00739 #define  XIMP_KEYPRESS_RETURN(ic)  XIMP_KEYPRESS_RETURN4
00740 #define  XIMP_KEYRELEASE_RETURN(ic)       XIMP_KEYRELEASE_RETURN4
00741 #define  XIMP_EVENTMASK_NOTIFY(ic) XIMP_EVENTMASK_NOTIFY4
00742 #define  XIMP_EVENTMASK_NOTIFY_RETURN(ic) XIMP_EVENTMASK_NOTIFY_RETURN4
00743 
00744 #define  XIMP_GEOMETRY(ic)         (ISXimp4(ic)?XIMP_GEOMETRY4:XIMP_GEOMETRY3)
00745 #define  XIMP_PREEDITSTART(ic)            (ISXimp4(ic)?XIMP_PREEDITSTART4:XIMP_PREEDITSTART3)
00746 #define  XIMP_PREEDITDONE(ic)             (ISXimp4(ic)?XIMP_PREEDITDONE4:XIMP_PREEDITDONE3)
00747 #define  XIMP_PREEDITDRAW(ic)             (ISXimp4(ic)?XIMP_PREEDITDRAW4:XIMP_PREEDITDRAW3)
00748 #define  XIMP_PREEDITDRAW_CM(ic)   (ISXimp4(ic)?XIMP_PREEDITDRAW_CM4:XIMP_PREEDITDRAW_CM3)
00749 #define  XIMP_PREEDITDRAW_CM_TINY(ic)     (ISXimp4(ic)?XIMP_PREEDITDRAW_CM_TINY4:XIMP_PREEDITDRAW_CM_TINY3)
00750 #define  XIMP_PREEDITCARET(ic)            (ISXimp4(ic)?XIMP_PREEDITCARET4:XIMP_PREEDITCARET3)
00751 #define  XIMP_STATUSSTART(ic)             (ISXimp4(ic)?XIMP_STATUSSTART4:XIMP_STATUSSTART3)
00752 #define  XIMP_STATUSDONE(ic)              (ISXimp4(ic)?XIMP_STATUSDONE4:XIMP_STATUSDONE3)
00753 #define  XIMP_STATUSDRAW(ic)              (ISXimp4(ic)?XIMP_STATUSDRAW4:XIMP_STATUSDRAW3)
00754 #define  XIMP_STATUSDRAW_CM(ic)           (ISXimp4(ic)?XIMP_STATUSDRAW_CM4:XIMP_STATUSDRAW_CM3)
00755 #define  XIMP_EXTENSION(ic)        (ISXimp4(ic)?XIMP_EXTENSION4:XIMP_EXTENSION3)
00756 
00757 /*
00758  * extern
00759  */
00760 
00761 #define Public              
00762 #define Private             static
00763 
00764 extern int     Ximp_Xim_count;
00765 extern Ximp_XIM      *Ximp_Xim_List;
00766 
00767 extern void
00768 _Ximp_CallGeometryCallback(
00769 #if NeedFunctionPrototypes
00770        Ximp_XIC, XClientMessageEvent *
00771 #endif
00772 );
00773 
00774 extern void
00775 _Ximp_CallPreeditStartCallback(
00776 #if NeedFunctionPrototypes
00777        Ximp_XIC, XClientMessageEvent *
00778 #endif
00779 );
00780 
00781 extern void
00782 _Ximp_CallPreeditDoneCallback(
00783 #if NeedFunctionPrototypes
00784        Ximp_XIC, XClientMessageEvent *
00785 #endif
00786 );
00787 
00788 extern void
00789 _Ximp_CallPreeditDrawCallback(
00790 #if NeedFunctionPrototypes
00791        Ximp_XIC, XClientMessageEvent *
00792 #endif
00793 );
00794 
00795 extern void
00796 _Ximp_CallPreeditDrawCallback2(
00797 #if NeedFunctionPrototypes
00798        Ximp_XIC, XClientMessageEvent *
00799 #endif
00800 );
00801 
00802 extern void
00803 _Ximp_CallPreeditDrawCallback3(
00804 #if NeedFunctionPrototypes
00805        Ximp_XIC, XClientMessageEvent *
00806 #endif
00807 );
00808 
00809 extern void
00810 _Ximp_CallPreeditCaretCallback(
00811 #if NeedFunctionPrototypes
00812        Ximp_XIC, XClientMessageEvent *
00813 #endif
00814 );
00815 
00816 extern void
00817 _Ximp_CallStatusStartCallback(
00818 #if NeedFunctionPrototypes
00819        Ximp_XIC, XClientMessageEvent *
00820 #endif
00821 );
00822 
00823 extern void
00824 _Ximp_CallStatusDoneCallback(
00825 #if NeedFunctionPrototypes
00826        Ximp_XIC, XClientMessageEvent *
00827 #endif
00828 );
00829 
00830 extern void
00831 _Ximp_CallStatusDrawCallback(
00832 #if NeedFunctionPrototypes
00833        Ximp_XIC, XClientMessageEvent *
00834 #endif
00835 );
00836 
00837 extern void
00838 _Ximp_CallStatusDrawCallback2(
00839 #if NeedFunctionPrototypes
00840        Ximp_XIC, XClientMessageEvent *
00841 #endif
00842 );
00843 
00844 extern int
00845 _ximp_ext_do_flush(
00846 #if NeedFunctionPrototypes
00847        Ximp_XIC
00848 #endif
00849 );
00850 
00851 extern int
00852 _XimpIsNeedMoveProtoMode(
00853 #if NeedFunctionPrototypes
00854        Ximp_XIC
00855 #endif
00856 );
00857 
00858 extern void
00859 _Ximp_OpenIMResourceExtension(
00860 #if NeedFunctionPrototypes
00861        Ximp_XIM
00862 #endif
00863 );
00864 
00865 extern Bool
00866 _XimpConnectServerExtensionHook(
00867 #if NeedFunctionPrototypes
00868        Ximp_XIM
00869 #endif
00870 );
00871 
00872 extern void
00873 _XimpConnectServerFreeExtensionHook(
00874 #if NeedFunctionPrototypes
00875        Ximp_XIM
00876 #endif
00877 );
00878 
00879 extern Bool
00880 _Ximp_GetIMValuesExtensionHook(
00881 #if NeedFunctionPrototypes
00882        Ximp_XIM, char *, long
00883 #endif
00884 );
00885 
00886 extern Bool
00887 _XimpCreateICExtensionHook(
00888 #if NeedFunctionPrototypes
00889        Ximp_XIC
00890 #endif
00891 );
00892 
00893 extern Bool
00894 _XimpBeforeCreateConnectionsHook(
00895 #if NeedFunctionPrototypes
00896        Ximp_XIC, XIMArg *
00897 #endif
00898 );
00899 
00900 extern void
00901 _Ximp_SetIcValueAfterCreate(
00902 #if NeedFunctionPrototypes
00903        Ximp_XIC
00904 #endif
00905 );
00906 
00907 extern void
00908 _XimpAfterCreateConnectionsHook(
00909 #if NeedFunctionPrototypes
00910        Ximp_XIC
00911 #endif
00912 );
00913 
00914 extern void
00915 _XimpAfterLoseConnectionsHook(
00916 #if NeedFunctionPrototypes
00917        Ximp_XIC
00918 #endif
00919 );
00920 
00921 extern Ximp_XIC
00922 _XimpBeforeSetClientWindowExtensionHook(
00923 #if NeedFunctionPrototypes
00924        Ximp_XIC
00925 #endif
00926 );
00927 
00928 extern Ximp_XIC
00929 _XimpAfterSetClientWindowExtensionHook(
00930 #if NeedFunctionPrototypes
00931        Ximp_XIC
00932 #endif
00933 );
00934 
00935 extern Bool
00936 _XimpSetICValuesExtensionHookCheck(
00937 #if NeedFunctionPrototypes
00938        Ximp_XIC
00939 #endif
00940 );
00941 
00942 extern char *
00943 _XimpSetICValuesExtensionHook(
00944 #if NeedFunctionPrototypes
00945        Ximp_XIC, XIMArg *
00946 #endif
00947 );
00948 
00949 extern Bool
00950 _Ximp_SetFocusExtensionHook(
00951 #if NeedFunctionPrototypes
00952        Ximp_XIC
00953 #endif
00954 );
00955 
00956 extern Bool
00957 _Ximp_UnSetFocusExtensionHook(
00958 #if NeedFunctionPrototypes
00959        Ximp_XIC
00960 #endif
00961 );
00962 
00963 extern Bool
00964 _XimpReconnectICExtensionCheak(
00965 #if NeedFunctionPrototypes
00966        Ximp_XIC
00967 #endif
00968 );
00969 
00970 extern Bool
00971 _XimpReconnectICExtensionHook(
00972 #if NeedFunctionPrototypes
00973        Ximp_XIC
00974 #endif
00975 );
00976 
00977 extern Bool
00978 _XimpLockedICExtensionCheck(
00979 #if NeedFunctionPrototypes
00980        Ximp_XIC
00981 #endif
00982 );
00983 
00984 extern void
00985 _Ximp_ServerDestroyExtensionHook(
00986 #if NeedFunctionPrototypes
00987        Ximp_XIC
00988 #endif
00989 );
00990 
00991 extern Bool
00992 _Ximp_SetICExtensionHook(
00993 #if NeedFunctionPrototypes
00994        Ximp_XIC, char *, long, int
00995 #endif
00996 );
00997 
00998 extern Bool
00999 _Ximp_GetICExtensionHook(
01000 #if NeedFunctionPrototypes
01001        Ximp_XIC, char *, long
01002 #endif
01003 );
01004 
01005 extern void
01006 _Ximp_AfterCreateExtensionHook(
01007 #if NeedFunctionPrototypes
01008        Ximp_XIC
01009 #endif
01010 );
01011 
01012 extern void
01013 _Ximp_ProcExtension(
01014 #if NeedFunctionPrototypes
01015        Display *, Window, XClientMessageEvent *
01016 #endif
01017 );
01018 
01019 extern void
01020 _Ximp_CallRestartCallbackExtensionHook(
01021 #if NeedFunctionPrototypes
01022        Ximp_XIC
01023 #endif
01024 );
01025 
01026 extern void
01027 _Ximp_CallDestroyCallbackExtensionHook(
01028 #if NeedFunctionPrototypes
01029        Ximp_XIC
01030 #endif
01031 );
01032 
01033 extern XIC
01034 _Ximp_CreateIC(
01035 #if NeedFunctionPrototypes
01036        XIM, XIMArg *
01037 #endif
01038 );
01039 
01040 extern void
01041 _Ximp_SetFocusWindowFilter(
01042 #if NeedFunctionPrototypes
01043        Ximp_XIC
01044 #endif
01045 );
01046 
01047 extern void
01048 _Ximp_SetFocusWindowProp(
01049 #if NeedFunctionPrototypes
01050        Ximp_XIC
01051 #endif
01052 );
01053 
01054 extern void
01055 _Ximp_SetPreeditAtr(
01056 #if NeedFunctionPrototypes
01057        Ximp_XIC
01058 #endif
01059 );
01060 
01061 extern void
01062 _Ximp_SetPreeditFont(
01063 #if NeedFunctionPrototypes
01064        Ximp_XIC
01065 #endif
01066 );
01067 
01068 extern void
01069 _Ximp_SetStatusAtr(
01070 #if NeedFunctionPrototypes
01071        Ximp_XIC
01072 #endif
01073 );
01074 
01075 extern void
01076 _Ximp_SetStatusFont(
01077 #if NeedFunctionPrototypes
01078        Ximp_XIC
01079 #endif
01080 );
01081 
01082 extern void
01083 _Ximp_IM_SendMessage(
01084 #if NeedFunctionPrototypes
01085        Ximp_XIC, unsigned long, unsigned long, unsigned long, unsigned long
01086 #endif
01087 );
01088 
01089 extern char *
01090 _Ximp_GetICValues(
01091 #if NeedFunctionPrototypes
01092        XIC, XIMArg *
01093 #endif
01094 );
01095 
01096 extern char *
01097 _Ximp_SetICValues(
01098 #if NeedFunctionPrototypes
01099        XIC, XIMArg *
01100 #endif
01101 );
01102 
01103 extern char *
01104 _Ximp_SetICValueData(
01105 #if NeedFunctionPrototypes
01106        Ximp_XIC, XIMArg *, int, XimpChangeaMask
01107 #endif
01108 );
01109 
01110 extern Ximp_XIC
01111 _Ximp_LookupXIC(
01112 #if NeedFunctionPrototypes
01113        int, Window
01114 #endif
01115 );
01116 
01117 extern Atom
01118 _Ximp_Protocol_id(
01119 #if NeedFunctionPrototypes
01120        void
01121 #endif
01122 );
01123 
01124 extern XIM
01125 _Ximp_OpenIM(
01126 #if NeedFunctionPrototypes
01127        XLCd, Display *, XrmDatabase, char *, char *
01128 #endif
01129 );
01130 
01131 extern Bool
01132 _Ximp_ConnectServer(
01133 #if NeedFunctionPrototypes
01134        Ximp_XIM
01135 #endif
01136 );
01137 
01138 extern int
01139 _Ximp_SetupFree(
01140 #if NeedFunctionPrototypes
01141        char *, XIMStyles *, long *, Ximp_KeyList *, Ximp_KeyList *, char *, char *, char *, Atom *
01142 #endif
01143 );
01144 
01145 extern Bool
01146 _XimpIfEvent(
01147 #if NeedFunctionPrototypes
01148        Ximp_XIC, XEvent *, Bool (*)(
01149 #if NeedNestedPrototypes
01150        Display *, XEvent *, char *
01151 #endif
01152        ), char *
01153 #endif
01154 );
01155 
01156 extern Bool
01157 _Ximp_CMPredicate32(
01158 #if NeedFunctionPrototypes
01159        Display *, XEvent *, XPointer
01160 #endif
01161 );
01162 
01163 extern int
01164 _Ximp_CombineMultipleCM(
01165 #if NeedFunctionPrototypes
01166        Ximp_XIC, unsigned char **
01167 #endif
01168 );
01169 
01170 extern char *
01171 _Ximp_MbReset(
01172 #if NeedFunctionPrototypes
01173        XIC
01174 #endif
01175 );
01176 
01177 extern wchar_t *
01178 _Ximp_WcReset(
01179 #if NeedFunctionPrototypes
01180        XIC
01181 #endif
01182 );
01183 
01184 extern int
01185 _Ximp_MbLookupString(
01186 #if NeedFunctionPrototypes
01187        XIC, XKeyEvent *, char *, int, KeySym *, Status *
01188 #endif
01189 );
01190 
01191 extern int
01192 _Ximp_WcLookupString(
01193 #if NeedFunctionPrototypes
01194        XIC, XKeyEvent *, wchar_t *, int, KeySym *, Status *
01195 #endif
01196 );
01197 
01198 extern void
01199 _Ximp_GetFocusWindowSelectMask(
01200 #if NeedFunctionPrototypes
01201        Ximp_XIC, Window, unsigned long *
01202 #endif
01203 );
01204 
01205 extern Bool
01206 _Ximp_ConnectIC(
01207 #if NeedFunctionPrototypes
01208        Ximp_XIC, int
01209 #endif
01210 );
01211 
01212 extern void
01213 _Ximp_ConvertOn(
01214 #if NeedFunctionPrototypes
01215        Ximp_XIC
01216 #endif
01217 );
01218 
01219 extern void
01220 _Ximp_ConvertOff(
01221 #if NeedFunctionPrototypes
01222        Ximp_XIC
01223 #endif
01224 );
01225 
01226 extern void
01227 _Ximp_ProcError(
01228 #if NeedFunctionPrototypes
01229        Ximp_XIC, Display *, Window, XClientMessageEvent *
01230 #endif
01231 );
01232 
01233 extern Bool
01234 _Ximp_XimFilter_Keypress(
01235 #if NeedFunctionPrototypes
01236        Display *, Window, XEvent *, XPointer
01237 #endif
01238 );
01239 
01240 extern Bool
01241 _Ximp_XimFilter_Keyrelease(
01242 #if NeedFunctionPrototypes
01243        Display *, Window, XEvent *, XPointer
01244 #endif
01245 );
01246 
01247 extern Bool
01248 _Ximp_XimFilter_Client(
01249 #if NeedFunctionPrototypes
01250        Display *, Window, XEvent *, XPointer
01251 #endif
01252 );
01253 
01254 extern Bool
01255 _Ximp_XimFilter_Destroy(
01256 #if NeedFunctionPrototypes
01257        Display *, Window, XEvent *, XPointer
01258 #endif
01259 );
01260 
01261 extern void
01262 _Ximp_OpenIM_Resource(
01263 #if NeedFunctionPrototypes
01264        Ximp_XIM
01265 #endif
01266 );
01267 
01268 extern void
01269 _Ximp_CreateIC_InitializeRDB(
01270 #if NeedFunctionPrototypes
01271        Ximp_XIC
01272 #endif
01273 );
01274 
01275 extern void
01276 _Ximp_SetValue_Resource(
01277 #if NeedFunctionPrototypes
01278        Ximp_XIC, XimpChangeaMask
01279 #endif
01280 );
01281 
01282 extern int
01283 _Ximp_ctstombs(
01284 #if NeedFunctionPrototypes
01285        XIM, char *, int, char *, int, Status *
01286 #endif
01287 );
01288 
01289 extern int
01290 _Ximp_ctstowcs(
01291 #if NeedFunctionPrototypes
01292        XIM, char *, int, wchar_t *, int, Status *
01293 #endif
01294 );
01295 
01296 extern int
01297 _Ximp_mbs_charlen(
01298 #if NeedFunctionPrototypes
01299        Ximp_XIM, char *, int
01300 #endif
01301 );
01302 
01303 extern int
01304 _Ximp_LookupMBText(
01305 #if NeedFunctionPrototypes
01306        Ximp_XIC, XKeyEvent *, unsigned char *, int, KeySym *, XComposeStatus *
01307 #endif
01308 );
01309 
01310 extern int
01311 _Ximp_LookupWCText(
01312 #if NeedFunctionPrototypes
01313        Ximp_XIC, XKeyEvent *, wchar_t *, int, KeySym *, XComposeStatus *
01314 #endif
01315 );
01316 
01317 #endif /* _XimpIm_h */