Back to index

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