Back to index

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