Back to index

im-sdk  12.3.91
Xlcint.h
Go to the documentation of this file.
00001 /* $XConsortium: Xlcint.h /main/24 1995/09/16 08:59:05 kaleb $ */
00002 /*
00003 
00004 Copyright (c) 1991  X Consortium
00005 
00006 Permission is hereby granted, free of charge, to any person obtaining
00007 a copy of this software and associated documentation files (the
00008 "Software"), to deal in the Software without restriction, including
00009 without limitation the rights to use, copy, modify, merge, publish,
00010 distribute, sublicense, and/or sell copies of the Software, and to
00011 permit persons to whom the Software is furnished to do so, subject to
00012 the following conditions:
00013 
00014 The above copyright notice and this permission notice shall be included
00015 in all copies or substantial portions of the Software.
00016 
00017 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00018 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00019 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00020 IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
00021 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00022 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00023 OTHER DEALINGS IN THE SOFTWARE.
00024 
00025 Except as contained in this notice, the name of the X Consortium shall
00026 not be used in advertising or otherwise to promote the sale, use or
00027 other dealings in this Software without prior written authorization
00028 from the X Consortium.
00029 
00030 */
00031 
00032 /*
00033  * Copyright 1990, 1991 by OMRON Corporation, NTT Software Corporation,
00034  *                      and Nippon Telegraph and Telephone Corporation
00035  * Copyright 1991 by the Open Software Foundation
00036  * Copyright 1993 by the TOSHIBA Corp.
00037  * Copyright 1993, 1994 by Sony Corporation
00038  * Copyright 1993, 1994 by the FUJITSU LIMITED
00039  *
00040  * Permission to use, copy, modify, distribute, and sell this software and its
00041  * documentation for any purpose is hereby granted without fee, provided that
00042  * the above copyright notice appear in all copies and that both that
00043  * copyright notice and this permission notice appear in supporting
00044  * documentation, and that the names of OMRON, NTT Software, NTT, Open
00045  * Software Foundation, and Sony Corporation not be used in advertising
00046  * or publicity pertaining to distribution of the software without specific, 
00047  * written prior permission. OMRON, NTT Software, NTT, Open Software
00048  * Foundation, and Sony Corporation  make no representations about the 
00049  * suitability of this software for any purpose.  It is provided "as is" 
00050  * without express or implied warranty.
00051  *
00052  * OMRON, NTT SOFTWARE, NTT, OPEN SOFTWARE FOUNDATION, AND SONY 
00053  * CORPORATION DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 
00054  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT 
00055  * SHALL OMRON, NTT SOFTWARE, NTT, OPEN SOFTWARE FOUNDATION, OR SONY 
00056  * CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
00057  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
00058  * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 
00059  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00060  * 
00061  *     Authors: Li Yuhong          OMRON Corporation
00062  *             Tatsuya Kato        NTT Software Corporation
00063  *             Hiroshi Kuribayashi OMRON Coproration
00064  *             Muneiyoshi Suzuki   Nippon Telegraph and Telephone Co.
00065  * 
00066  *             M. Collins          OSF  
00067  *             Katsuhisa Yano             TOSHIBA Corp.
00068  *               Makoto Wakamatsu       Sony Corporation
00069  *               Takashi Fujiwara  FUJITSU LIMITED
00070  */                         
00071 
00072 
00073 #ifndef       _XLCINT_H_
00074 #define       _XLCINT_H_
00075 
00076 #include <X11/Xresource.h>
00077 #include <X11/Xutil.h>
00078 #include "Xvarargs.h"
00079 
00080 typedef Bool (*XFilterEventProc)(
00081 #if NeedFunctionPrototypes
00082     Display*         /* display */,
00083     Window           /* window */,
00084     XEvent*          /* event */,
00085     XPointer         /* client_data */
00086 #endif
00087 );
00088 
00089 typedef struct _XIMFilter {
00090     struct _XIMFilter *next;
00091     Window window;
00092     unsigned long event_mask;
00093     int start_type, end_type;
00094     XFilterEventProc filter;
00095     XPointer client_data;
00096 } XFilterEventRec, *XFilterEventList;
00097 
00098 typedef struct {
00099     char    *name;
00100     XPointer value;
00101 } XIMArg;
00102 
00103 #ifdef offsetof
00104 #define XOffsetOf(s_type,field) offsetof(s_type,field)
00105 #else
00106 #define XOffsetOf(s_type,field) ((unsigned int)&(((s_type*)NULL)->field))
00107 #endif
00108 
00109 #define XIMNumber(arr) ((unsigned int) (sizeof(arr) / sizeof(arr[0])))
00110 
00111 /*
00112  * define secondary data structs which are part of Input Methods
00113  * and Input Context
00114  */
00115 typedef struct {
00116     char             *resource_name;             /* Resource string */
00117     XrmQuark         xrm_name;            /* Resource name quark */
00118     int                     resource_size;              /* Size in bytes of data */
00119     long             resource_offset;     /* Offset from base */
00120     unsigned short   mode;                /* Read Write Permission */
00121     unsigned short   id;                  /* Input Method Protocol */
00122 } XIMResource, *XIMResourceList;
00123 
00124 /*
00125  * data block describing the visual attributes associated with
00126  * an input context
00127  */
00128 typedef struct {
00129     XRectangle              area;
00130     XRectangle              area_needed;
00131     XPoint           spot_location;
00132     Colormap         colormap;
00133     Atom             std_colormap;
00134     unsigned long    foreground;
00135     unsigned long    background;
00136     Pixmap           background_pixmap;
00137     XFontSet            fontset;
00138     int                            line_spacing;
00139     Cursor           cursor;
00140     XIMCallback             start_callback;
00141     XIMCallback             done_callback;
00142     XIMCallback             draw_callback;
00143     XIMCallback             caret_callback;
00144     XIMPreeditState  preedit_state;
00145     XIMCallback             state_notify_callback;
00146 } ICPreeditAttributes, *ICPreeditAttributesPtr;
00147 
00148 typedef struct {
00149     XRectangle              area;
00150     XRectangle              area_needed;
00151     Colormap         colormap;
00152     Atom             std_colormap;
00153     unsigned long    foreground;
00154     unsigned long    background;
00155     Pixmap           background_pixmap;
00156     XFontSet            fontset;
00157     int                            line_spacing;
00158     Cursor           cursor;
00159     XIMCallback             start_callback;
00160     XIMCallback             done_callback;
00161     XIMCallback             draw_callback;
00162 } ICStatusAttributes, *ICStatusAttributesPtr;
00163 
00164 /*
00165  * Methods for Xrm parsing
00166  */
00167 
00168 typedef void (*XmbInitProc)(
00169 #if NeedFunctionPrototypes
00170     XPointer         /* state */
00171 #endif
00172 );
00173 
00174 typedef char (*XmbCharProc)(
00175 #if NeedFunctionPrototypes
00176     XPointer         /* state */,
00177     char*            /* str */,
00178     int*             /* lenp */
00179 #endif
00180 );
00181 
00182 typedef void (*XmbFinishProc)(
00183 #if NeedFunctionPrototypes
00184     XPointer         /* state */
00185 #endif
00186 );
00187 
00188 typedef char* (*XlcNameProc)(
00189 #if NeedFunctionPrototypes
00190     XPointer         /* state */
00191 #endif
00192 );
00193 
00194 typedef void (*XrmDestroyProc)(
00195 #if NeedFunctionPrototypes
00196     XPointer         /* state */
00197 #endif
00198 );
00199 
00200 typedef struct {
00201     XmbInitProc             mbinit;
00202     XmbCharProc             mbchar;
00203     XmbFinishProc    mbfinish;
00204     XlcNameProc             lcname;
00205     XrmDestroyProc   destroy;
00206 } XrmMethodsRec, *XrmMethods;
00207 
00208 typedef struct _XLCd *XLCd; /* need forward reference */
00209 
00210 /*
00211  * define an LC, it's methods, and data.
00212  */
00213 
00214 typedef void (*XCloseLCProc)(
00215 #if NeedFunctionPrototypes
00216     XLCd             /* lcd */
00217 #endif
00218 );
00219 
00220 typedef char* (*XlcMapModifiersProc)(
00221 #if NeedFunctionPrototypes
00222     XLCd             /* lcd */,
00223     char*            /* user_mods */,
00224     char*            /* prog_mods */
00225 #endif
00226 );
00227 
00228 typedef XOM (*XOpenOMProc)(
00229 #if NeedFunctionPrototypes
00230     XLCd             /* lcd */,
00231     Display*         /* display */,
00232     XrmDatabase             /* rdb */,
00233     _Xconst char*    /* res_name */,
00234     _Xconst char*    /* res_class */
00235 #endif
00236 );
00237 
00238 typedef XIM (*XOpenIMProc)(
00239 #if NeedFunctionPrototypes
00240     XLCd             /* lcd */,
00241     Display*         /* display */,
00242     XrmDatabase             /* rdb */,
00243     char*            /* res_name */,
00244     char*            /* res_class */
00245 #endif
00246 );
00247 
00248 typedef Bool (*XRegisterIMInstantiateCBProc)(
00249 #if NeedFunctionPrototypes
00250     XLCd             /* lcd */,
00251     Display*         /* display */,
00252     XrmDatabase             /* rdb */,
00253     char*            /* res_name */,
00254     char*            /* res_class */,
00255     XIMProc          /* callback */,
00256     XPointer*        /* client_data */
00257 #endif
00258 );
00259 
00260 typedef Bool (*XUnregisterIMInstantiateCBProc)(
00261 #if NeedFunctionPrototypes
00262     XLCd             /* lcd */,
00263     Display*         /* display */,
00264     XrmDatabase             /* rdb */,
00265     char*            /* res_name */,
00266     char*            /* res_class */,
00267     XIMProc          /* callback */,
00268     XPointer*        /* client_data */
00269 #endif
00270 );
00271 
00272 typedef XrmMethods (*XrmInitParseInfoProc)(
00273 #if NeedFunctionPrototypes
00274     XLCd             /* lcd */,
00275     XPointer*        /* state */
00276 #endif
00277 );
00278 
00279 typedef int (*XmbTextPropertyToTextListProc)(
00280 #if NeedFunctionPrototypes
00281     XLCd             /* lcd */,
00282     Display*         /* display */,
00283     XTextProperty*   /* text_prop */,
00284     char***          /* list_return */,
00285     int*             /* count_return */
00286 #endif
00287 );
00288 
00289 typedef int (*XwcTextPropertyToTextListProc)(
00290 #if NeedFunctionPrototypes
00291     XLCd             /* lcd */,
00292     Display*         /* display */,
00293     XTextProperty*   /* text_prop */,
00294     wchar_t***              /* list_return */,
00295     int*             /* count_return */
00296 #endif
00297 );
00298 
00299 typedef int (*XmbTextListToTextPropertyProc)(
00300 #if NeedFunctionPrototypes
00301     XLCd             /* lcd */,
00302     Display*         /* display */,
00303     char**           /* list */,
00304     int                     /* count */,
00305     XICCEncodingStyle       /* style */,
00306     XTextProperty*   /* text_prop_return */
00307 #endif
00308 );
00309 
00310 typedef int (*XwcTextListToTextPropertyProc)(
00311 #if NeedFunctionPrototypes
00312     XLCd             /* lcd */,
00313     Display*         /* display */,
00314     wchar_t**        /* list */,
00315     int                     /* count */,
00316     XICCEncodingStyle       /* style */,
00317     XTextProperty*   /* text_prop_return */
00318 #endif
00319 );
00320 
00321 typedef void (*XwcFreeStringListProc)(
00322 #if NeedFunctionPrototypes
00323     XLCd             /* lcd */,
00324     wchar_t**        /* list */
00325 #endif
00326 );
00327 
00328 typedef char* (*XDefaultStringProc)(
00329 #if NeedFunctionPrototypes
00330     XLCd             /* lcd */
00331 #endif
00332 );
00333 
00334 typedef struct {
00335     XCloseLCProc                   close;
00336     XlcMapModifiersProc                   map_modifiers;
00337     XOpenOMProc                           open_om;
00338     XOpenIMProc                           open_im;
00339     XrmInitParseInfoProc           init_parse_info;
00340     XmbTextPropertyToTextListProc  mb_text_prop_to_list;
00341     XwcTextPropertyToTextListProc  wc_text_prop_to_list;
00342     XmbTextListToTextPropertyProc  mb_text_list_to_prop;
00343     XwcTextListToTextPropertyProc  wc_text_list_to_prop;
00344     XwcFreeStringListProc          wc_free_string_list;
00345     XDefaultStringProc                    default_string;
00346     XRegisterIMInstantiateCBProc   register_callback;
00347     XUnregisterIMInstantiateCBProc unregister_callback;
00348 } XLCdMethodsRec, *XLCdMethods;
00349 
00350 
00351 typedef struct {
00352     char*            name;                /* name of this LC */
00353     char*            modifiers;           /* modifiers of locale */
00354 } XLCdCoreRec, *XLCdCore;
00355 
00356 
00357 typedef struct _XLCd {
00358     XLCdMethods             methods;             /* methods of this LC */
00359     XLCdCore         core;                /* data of this LC */
00360     XPointer         opaque;                     /* LDX specific data */
00361 } XLCdRec;
00362 
00363 typedef int XlcPosition;
00364 
00365 #define XlcHead             0
00366 #define XlcTail             -1
00367 
00368 typedef struct {
00369     char *name;
00370     XPointer value;
00371 } XlcArg, *XlcArgList;
00372 
00373 typedef struct _XlcResource {
00374     char *name;
00375     XrmQuark xrm_name;
00376     int size;
00377     int offset;
00378     unsigned long mask;
00379 } XlcResource, *XlcResourceList;
00380 
00381 #define XlcCreateMask       (1L<<0)
00382 #define XlcDefaultMask      (1L<<1)
00383 #define XlcGetMask   (1L<<2)
00384 #define XlcSetMask   (1L<<3)
00385 #define XlcIgnoreMask       (1L<<4)
00386 
00387 #define XlcNumber(arr)      (sizeof(arr) / sizeof(arr[0]))
00388 
00389 typedef Status (*XCloseOMProc)(
00390 #if NeedFunctionPrototypes
00391     XOM                     /* om */
00392 #endif
00393 );
00394 
00395 typedef char* (*XSetOMValuesProc)(
00396 #if NeedFunctionPrototypes
00397     XOM                     /* om */,
00398     XlcArgList              /* args */,
00399     int                     /* num_args */
00400 #endif
00401 );
00402 
00403 typedef char* (*XGetOMValuesProc)(
00404 #if NeedFunctionPrototypes
00405     XOM                     /* om */,
00406     XlcArgList              /* args */,
00407     int                     /* num_args */
00408 #endif
00409 );
00410 
00411 typedef XOC (*XCreateOCProc)(
00412 #if NeedFunctionPrototypes
00413     XOM                     /* om */,
00414     XlcArgList              /* args */,
00415     int                     /* num_args */
00416 #endif
00417 );
00418 
00419 typedef struct _XOMMethodsRec {
00420     XCloseOMProc     close;
00421     XSetOMValuesProc set_values;
00422     XGetOMValuesProc get_values;
00423     XCreateOCProc    create_oc;
00424 } XOMMethodsRec, *XOMMethods;
00425 
00426 typedef struct _XOMCoreRec {
00427     XLCd lcd;                      /* lcd */
00428     Display *display;                     /* display */
00429     XrmDatabase rdb;               /* database */
00430     char *res_name;                /* resource name */
00431     char *res_class;               /* resource class */
00432     XOC oc_list;                   /* xoc list */
00433     XlcResourceList resources;            /* xom resources */
00434     int num_resources;                    /* number of xom resources */
00435     XOMCharSetList required_charset;      /* required charset list */
00436     XOMOrientation orientation_list;      /* orientation list */
00437     Bool directional_dependent;           /* directional-dependent */
00438     Bool contextual_drawing;              /* contextual drawing */
00439     Bool context_dependent;        /* context-dependent drawing */
00440 } XOMCoreRec, *XOMCore;
00441 
00442 typedef struct _XOM {
00443     XOMMethods methods;
00444     XOMCoreRec core;
00445 } XOMRec;
00446 
00447 typedef void (*XDestroyOCProc)(
00448 #if NeedFunctionPrototypes
00449     XOC                     /* oc */
00450 #endif
00451 );
00452 
00453 typedef char* (*XSetOCValuesProc)(
00454 #if NeedFunctionPrototypes
00455     XOC                     /* oc */,
00456     XlcArgList              /* args */,
00457     int                     /* num_args */
00458 #endif
00459 );
00460 
00461 typedef char* (*XGetOCValuesProc)(
00462 #if NeedFunctionPrototypes
00463     XOC                     /* oc */,
00464     XlcArgList              /* args */,
00465     int                     /* num_args */
00466 #endif
00467 );
00468 
00469 /*
00470  * X Font Sets are an instantiable object, so we define it, the 
00471  * object itself, a method list and data
00472  */
00473 
00474 /* 
00475  * XFontSet object method list
00476  */
00477 
00478 typedef int (*XmbTextEscapementProc)(
00479 #if NeedFunctionPrototypes
00480     XFontSet         /* font_set */,
00481     _Xconst char*    /* text */,
00482     int                     /* text_len */
00483 #endif
00484 );
00485 
00486 typedef int (*XmbTextExtentsProc)(
00487 #if NeedFunctionPrototypes
00488     XFontSet         /* font_set */,
00489     _Xconst char*    /* text */,
00490     int                     /* text_len */,
00491     XRectangle*             /* overall_ink_extents */,
00492     XRectangle*             /* overall_logical_extents */
00493 #endif
00494 );
00495 
00496 typedef Status (*XmbTextPerCharExtentsProc)(
00497 #if NeedFunctionPrototypes
00498     XFontSet         /* font_set */,
00499     _Xconst char*    /* text */,
00500     int                     /* text_len */,
00501     XRectangle*             /* ink_extents_buffer */,
00502     XRectangle*             /* logical_extents_buffer */,
00503     int                     /* buffer_size */,
00504     int*             /* num_chars */,
00505     XRectangle*             /* max_ink_extents */,
00506     XRectangle*             /* max_logical_extents */
00507 #endif
00508 );
00509 
00510 typedef int (*XmbDrawStringProc)(
00511 #if NeedFunctionPrototypes
00512     Display*         /* display */,
00513     Drawable         /* drawable */,
00514     XFontSet         /* font_set */,
00515     GC               /* gc */,
00516     int                     /* x */,
00517     int                     /* y */,
00518     _Xconst char*    /* text */,
00519     int                     /* text_len */
00520 #endif
00521 );
00522 
00523 typedef void (*XmbDrawImageStringProc)(
00524 #if NeedFunctionPrototypes
00525     Display*         /* display */,
00526     Drawable         /* drawable */,
00527     XFontSet         /* font_set */,
00528     GC               /* gc */,
00529     int                     /* x */,
00530     int                     /* y */,
00531     _Xconst char*    /* text */,
00532     int                     /* text_len */
00533 #endif
00534 );
00535 
00536 typedef int (*XwcTextEscapementProc)(
00537 #if NeedFunctionPrototypes
00538     XFontSet         /* font_set */,
00539     _Xconst wchar_t* /* text */,
00540     int                     /* text_len */
00541 #endif
00542 );
00543 
00544 typedef int (*XwcTextExtentsProc)(
00545 #if NeedFunctionPrototypes
00546     XFontSet         /* font_set */,
00547     _Xconst wchar_t* /* text */,
00548     int                     /* text_len */,
00549     XRectangle*             /* overall_ink_extents */,
00550     XRectangle*             /* overall_logical_extents */
00551 #endif
00552 );
00553 
00554 typedef Status (*XwcTextPerCharExtentsProc)(
00555 #if NeedFunctionPrototypes
00556     XFontSet         /* font_set */,
00557     _Xconst wchar_t* /* text */,
00558     int                     /* text_len */,
00559     XRectangle*             /* ink_extents_buffer */,
00560     XRectangle*             /* logical_extents_buffer */,
00561     int                     /* buffer_size */,
00562     int*             /* num_chars */,
00563     XRectangle*             /* max_ink_extents */,
00564     XRectangle*             /* max_logical_extents */
00565 #endif
00566 );
00567 
00568 typedef int (*XwcDrawStringProc)(
00569 #if NeedFunctionPrototypes
00570     Display*         /* display */,
00571     Drawable         /* drawable */,
00572     XFontSet         /* font_set */,
00573     GC               /* gc */,
00574     int                     /* x */,
00575     int                     /* y */,
00576     _Xconst wchar_t* /* text */,
00577     int                     /* text_len */
00578 #endif
00579 );
00580 
00581 typedef void (*XwcDrawImageStringProc)(
00582 #if NeedFunctionPrototypes
00583     Display*         /* display */,
00584     Drawable         /* drawable */,
00585     XFontSet         /* font_set */,
00586     GC               /* gc */,
00587     int                     /* x */,
00588     int                     /* y */,
00589     _Xconst wchar_t* /* text */,
00590     int                     /* text_len */
00591 #endif
00592 );
00593 
00594 typedef struct {
00595     XDestroyOCProc          destroy;
00596     XSetOCValuesProc               set_values;
00597     XGetOCValuesProc               get_values;
00598 
00599     /* multi-byte text drawing methods */
00600 
00601     XmbTextEscapementProc   mb_escapement;
00602     XmbTextExtentsProc             mb_extents;
00603     XmbTextPerCharExtentsProc      mb_extents_per_char;
00604     XmbDrawStringProc              mb_draw_string;
00605     XmbDrawImageStringProc  mb_draw_image_string;
00606 
00607     /* wide character text drawing methods */
00608 
00609     XwcTextEscapementProc   wc_escapement;
00610     XwcTextExtentsProc             wc_extents;
00611     XwcTextPerCharExtentsProc      wc_extents_per_char;
00612     XwcDrawStringProc              wc_draw_string;
00613     XwcDrawImageStringProc  wc_draw_image_string;
00614 } XOCMethodsRec, *XOCMethods;
00615 
00616 
00617 /*
00618  * XOC independent data
00619  */
00620 
00621 typedef struct {
00622     XOM om;                        /* XOM */
00623     XOC next;                      /* next XOC */
00624     XlcResourceList resources;            /* xoc resources */
00625     int num_resources;                    /* number of xoc resources */
00626     char *base_name_list;                 /* base font name list */
00627     Bool om_automatic;                    /* OM Automatic */
00628     XOMFontInfo font_info;         /* font info */
00629     XFontSetExtents font_set_extents;     /* font set extents */
00630     char *default_string;                 /* default string */
00631     XOMCharSetList missing_list;   /* missing charset list */
00632     XOrientation orientation;             /* orientation */
00633     char *res_name;                /* resource name */
00634     char *res_class;               /* resource class */
00635 } XOCCoreRec, *XOCCore;
00636 
00637 typedef struct _XOC {
00638     XOCMethods methods;
00639     XOCCoreRec core;
00640 } XOCRec;
00641 
00642 
00643 /* current Ultrix compiler gets horribly confused */
00644 #if defined(FUNCPROTO) && defined(ultrix)
00645 #undef NeedFunctionPrototypes
00646 #endif
00647 
00648 
00649 /*
00650  * X Input Managers are an instantiable object, so we define it, the 
00651  * object itself, a method list and data.
00652  */
00653 
00654 /*
00655  * an Input Manager object method list
00656  */
00657 typedef struct {
00658     Status (*close)(
00659 #if NeedFunctionPrototypes
00660        XIM
00661 #endif
00662        );
00663     char* (*set_values)(
00664 #if NeedFunctionPrototypes
00665        XIM, XIMArg*
00666 #endif
00667        );
00668     char* (*get_values)(
00669 #if NeedFunctionPrototypes
00670        XIM, XIMArg*
00671 #endif
00672        );
00673     XIC (*create_ic)(
00674 #if NeedFunctionPrototypes
00675        XIM, XIMArg*
00676 #endif
00677        );
00678     int (*ctstombs)(
00679 #if NeedFunctionPrototypes
00680        XIM, char*, int, char*, int, Status *
00681 #endif
00682        );
00683     int (*ctstowcs)(
00684 #if NeedFunctionPrototypes
00685        XIM, char*, int, wchar_t*, int, Status *
00686 #endif
00687        );
00688 } XIMMethodsRec, *XIMMethods;
00689 
00690 /*
00691  * Input Manager LC independent data
00692  */
00693 typedef struct {
00694     XLCd             lcd;                 /* LC of this input method */
00695     XIC                     ic_chain;            /* list of ICs for this IM */
00696 
00697     Display *        display;                    /* display */
00698     XrmDatabase      rdb;
00699     char *           res_name;
00700     char *           res_class;
00701 
00702     XIMValuesList    *im_values_list;
00703     XIMValuesList    *ic_values_list;
00704     XIMStyles        *styles;
00705     XIMCallback              destroy_callback;
00706     char *           im_name;             /* XIMMODIFIER name */
00707     XIMResourceList  im_resources;        /* compiled IM resource list */
00708     unsigned int     im_num_resources;
00709     XIMResourceList  ic_resources;        /* compiled IC resource list */
00710     unsigned int     ic_num_resources;
00711     Bool             visible_position;
00712 } XIMCoreRec, *XIMCore;
00713 
00714 
00715 
00716 /*
00717  * An X Input Manager (IM).  Implementations may need to extend this data 
00718  * structure to accomodate additional data, state information etc.
00719  */
00720 typedef struct _XIM {
00721     XIMMethods              methods;             /* method list of this IM */
00722     XIMCoreRec              core;                /* data of this IM */
00723 } XIMRec;
00724 
00725 
00726 
00727 /*
00728  * X Input Contexts (IC) are an instantiable object, so we define it, the 
00729  * object itself, a method list and data for this object
00730  */
00731 
00732 /*
00733  * Input Context method list
00734  */ 
00735 typedef struct {
00736     void (*destroy)(
00737 #if NeedFunctionPrototypes
00738        XIC
00739 #endif
00740        );
00741     void (*set_focus)(
00742 #if NeedFunctionPrototypes
00743        XIC
00744 #endif
00745        );
00746     void (*unset_focus)(
00747 #if NeedFunctionPrototypes
00748        XIC
00749 #endif
00750        );
00751     char* (*set_values)(
00752 #if NeedFunctionPrototypes
00753        XIC, XIMArg*
00754 #endif
00755        );
00756     char* (*get_values)(
00757 #if NeedFunctionPrototypes
00758        XIC, XIMArg*
00759 #endif
00760        );
00761     char* (*mb_reset)(
00762 #if NeedFunctionPrototypes
00763        XIC
00764 #endif
00765        );
00766     wchar_t* (*wc_reset)(
00767 #if NeedFunctionPrototypes
00768        XIC
00769 #endif
00770        );
00771     int (*mb_lookup_string)(
00772 #if NeedFunctionPrototypes
00773        XIC, XKeyEvent*, char*, int, KeySym*, Status*
00774 #endif
00775        );
00776     int (*wc_lookup_string)(
00777 #if NeedFunctionPrototypes
00778        XIC, XKeyEvent*, wchar_t*, int, KeySym*, Status*
00779 #endif
00780        );
00781 } XICMethodsRec, *XICMethods;
00782 
00783 
00784 /*
00785  * Input Context LC independent data
00786  */
00787 typedef struct {
00788     XIM                     im;                  /* XIM this IC belongs too */
00789     XIC                     next;                /* linked list of ICs for IM */
00790 
00791     Window           client_window;              /* window IM can use for */
00792                                           /* display or subwindows */
00793     XIMStyle         input_style;         /* IM's input style */
00794     Window           focus_window;        /* where key events go */
00795     unsigned long    filter_events;              /* event mask from IM */
00796     XIMCallback             geometry_callback;   /* client callback */
00797     char *           res_name;
00798     char *           res_class;
00799 
00800     XIMCallback             destroy_callback;
00801     XIMCallback             string_conversion_callback;
00802     XIMStringConversionText  string_conversion;
00803     XIMResetState    reset_state;
00804     XIMHotKeyTriggers  *hotkey;
00805     XIMHotKeyState   hotkey_state;
00806 
00807     ICPreeditAttributes     preedit_attr;        /* visuals of preedit area */
00808     ICStatusAttributes      status_attr;         /* visuals of status area */
00809 } XICCoreRec, *XICCore;
00810 
00811 
00812 /*
00813  * an Input Context.  Implementations may need to extend this data 
00814  * structure to accomodate additional data, state information etc.
00815  */
00816 typedef struct _XIC {
00817     XICMethods              methods;             /* method list of this IC */
00818     XICCoreRec              core;                /* data of this IC */
00819 } XICRec;
00820 
00821 /* current Ultrix compiler gets horribly confused */
00822 #if !defined(NeedFunctionPrototypes) && defined(FUNCPROTO)
00823 #define NeedFunctionPrototypes 1
00824 #endif
00825 
00826 typedef XLCd (*XLCdLoadProc)(
00827 #if NeedFunctionPrototypes
00828     char*
00829 #endif
00830 );
00831 
00832 _XFUNCPROTOBEGIN
00833 
00834 extern XLCd _XOpenLC(
00835 #if NeedFunctionPrototypes
00836     char*            /* name */
00837 #endif
00838 );
00839 
00840 extern void _XCloseLC(
00841 #if NeedFunctionPrototypes
00842     XLCd             /* lcd */
00843 #endif
00844 );
00845 
00846 extern XLCd _XlcCurrentLC(
00847 #if NeedFunctionPrototypes
00848     void
00849 #endif
00850 );
00851 
00852 extern char *_XlcDefaultMapModifiers(
00853 #if NeedFunctionPrototypes
00854     XLCd      /* lcd */,
00855     char*     /* user_mods */,
00856     char*     /* prog_mods */
00857 #endif
00858 );
00859 
00860 extern char ** _XParseBaseFontNameList(
00861 #if NeedFunctionPrototypes
00862     char*            /* str */,
00863     int*             /* num */
00864 #endif
00865 );
00866 
00867 extern XrmMethods _XrmInitParseInfo(
00868 #if NeedFunctionPrototypes
00869        XPointer*     /* statep */
00870 #endif
00871 );
00872 
00873 extern void _XRegisterFilterByMask(
00874 #if NeedFunctionPrototypes
00875     Display*         /* dpy */,
00876     Window           /* window */,
00877     unsigned long    /* event_mask */,
00878     Bool (*)(
00879 #if NeedNestedPrototypes
00880             Display* /* display */,
00881             Window   /* window */,
00882             XEvent*  /* event */,
00883             XPointer /* client_data */
00884 #endif
00885             )        /* filter */,
00886     XPointer         /* client_data */
00887 #endif
00888 );
00889 
00890 extern void _XRegisterFilterByType(
00891 #if NeedFunctionPrototypes
00892     Display*         /* dpy */,
00893     Window           /* window */,
00894     int                     /* start_type */,
00895     int                     /* end_type */,
00896     Bool (*)(
00897 #if NeedNestedPrototypes
00898             Display* /* display */,
00899             Window   /* window */,
00900             XEvent*  /* event */,
00901             XPointer /* client_data */
00902 #endif
00903             )        /* filter */,
00904     XPointer         /* client_data */
00905 #endif
00906 );
00907 
00908 extern void _XUnregisterFilter(
00909 #if NeedFunctionPrototypes
00910     Display*         /* dpy */,
00911     Window           /* window */,
00912     Bool (*)(
00913 #if NeedNestedPrototypes
00914             Display* /* display */,
00915             Window   /* window */,
00916             XEvent*  /* event */,
00917             XPointer /* client_data */
00918 #endif
00919             )        /* filter */,
00920     XPointer         /* client_data */
00921 #endif
00922 );
00923 
00924 extern void _XlcCountVaList(
00925 #if NeedFunctionPrototypes
00926     va_list          /* var */,
00927     int*             /* count_return */
00928 #endif
00929 );
00930 
00931 extern void _XlcVaToArgList(
00932 #if NeedFunctionPrototypes
00933     va_list          /* var */,
00934     int                     /* count */,
00935     XlcArgList*             /* args_return */
00936 #endif
00937 );
00938 
00939 extern void _XlcCompileResourceList(
00940 #if NeedFunctionPrototypes
00941     XlcResourceList  /* resources */,
00942     int                     /* num_resources */
00943 #endif
00944 );
00945 
00946 extern char *_XlcGetValues(
00947 #if NeedFunctionPrototypes
00948     XPointer         /* base */,
00949     XlcResourceList  /* resources */,
00950     int                     /* num_resources */,
00951     XlcArgList              /* args */,
00952     int                     /* num_args */,
00953     unsigned long    /* mask */
00954 #endif
00955 );
00956 
00957 extern char *_XlcSetValues(
00958 #if NeedFunctionPrototypes
00959     XPointer         /* base */,
00960     XlcResourceList  /* resources */,
00961     int                     /* num_resources */,
00962     XlcArgList              /* args */,
00963     int                     /* num_args */,
00964     unsigned long    /* mask */
00965 #endif
00966 );
00967 
00968 extern Bool _XlcAddLoader(
00969 #if NeedFunctionPrototypes
00970     XLCdLoadProc     /* proc */,
00971     XlcPosition             /* position */
00972 #endif
00973 );
00974 
00975 extern void _XlcRemoveLoader(
00976 #if NeedFunctionPrototypes
00977     XLCdLoadProc     /* proc */
00978 #endif
00979 );
00980 
00981 _XFUNCPROTOEND
00982 
00983 #endif /* _XLCINT_H_ */