home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / evbl0627.zip / everblue_20010627.zip / x11 / Xlcint.h < prev    next >
C/C++ Source or Header  |  1999-11-02  |  25KB  |  1,007 lines

  1. /* $XConsortium: Xlcint.h /main/25 1996/09/28 16:35:19 rws $ */
  2. /*
  3.  
  4. Copyright (c) 1991  X Consortium
  5.  
  6. Permission is hereby granted, free of charge, to any person obtaining
  7. a copy of this software and associated documentation files (the
  8. "Software"), to deal in the Software without restriction, including
  9. without limitation the rights to use, copy, modify, merge, publish,
  10. distribute, sublicense, and/or sell copies of the Software, and to
  11. permit persons to whom the Software is furnished to do so, subject to
  12. the following conditions:
  13.  
  14. The above copyright notice and this permission notice shall be included
  15. in all copies or substantial portions of the Software.
  16.  
  17. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  18. OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  19. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  20. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
  21. OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  22. ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  23. OTHER DEALINGS IN THE SOFTWARE.
  24.  
  25. Except as contained in this notice, the name of the X Consortium shall
  26. not be used in advertising or otherwise to promote the sale, use or
  27. other dealings in this Software without prior written authorization
  28. from the X Consortium.
  29.  
  30. */
  31.  
  32. /*
  33.  * Copyright 1990, 1991 by OMRON Corporation, NTT Software Corporation,
  34.  *                      and Nippon Telegraph and Telephone Corporation
  35.  * Copyright 1991 by the Open Software Foundation
  36.  * Copyright 1993 by the TOSHIBA Corp.
  37.  * Copyright 1993, 1994 by Sony Corporation
  38.  * Copyright 1993, 1994 by the FUJITSU LIMITED
  39.  *
  40.  * Permission to use, copy, modify, distribute, and sell this software and its
  41.  * documentation for any purpose is hereby granted without fee, provided that
  42.  * the above copyright notice appear in all copies and that both that
  43.  * copyright notice and this permission notice appear in supporting
  44.  * documentation, and that the names of OMRON, NTT Software, NTT, Open
  45.  * Software Foundation, and Sony Corporation not be used in advertising
  46.  * or publicity pertaining to distribution of the software without specific, 
  47.  * written prior permission. OMRON, NTT Software, NTT, Open Software
  48.  * Foundation, and Sony Corporation  make no representations about the 
  49.  * suitability of this software for any purpose.  It is provided "as is" 
  50.  * without express or implied warranty.
  51.  *
  52.  * OMRON, NTT SOFTWARE, NTT, OPEN SOFTWARE FOUNDATION, AND SONY 
  53.  * CORPORATION DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 
  54.  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT 
  55.  * SHALL OMRON, NTT SOFTWARE, NTT, OPEN SOFTWARE FOUNDATION, OR SONY 
  56.  * CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  57.  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  58.  * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 
  59.  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  60.  * 
  61.  *    Authors: Li Yuhong        OMRON Corporation
  62.  *         Tatsuya Kato        NTT Software Corporation
  63.  *         Hiroshi Kuribayashi    OMRON Coproration
  64.  *         Muneiyoshi Suzuki    Nippon Telegraph and Telephone Co.
  65.  * 
  66.  *         M. Collins        OSF  
  67.  *         Katsuhisa Yano        TOSHIBA Corp.
  68.  *               Makoto Wakamatsu       Sony Corporation
  69.  *               Takashi Fujiwara    FUJITSU LIMITED
  70.  */                
  71. /* $XFree86: xc/lib/X11/Xlcint.h,v 3.1.2.3 1998/01/25 06:11:04 dawes Exp $ */
  72.  
  73.  
  74. #ifndef    _XLCINT_H_
  75. #define    _XLCINT_H_
  76.  
  77. #include <X11/Xresource.h>
  78. #include <X11/Xutil.h>
  79. #include "Xvarargs.h"
  80.  
  81. typedef Bool (*XFilterEventProc)(
  82. #if NeedFunctionPrototypes
  83.     Display*        /* display */,
  84.     Window        /* window */,
  85.     XEvent*        /* event */,
  86.     XPointer        /* client_data */
  87. #endif
  88. );
  89.  
  90. typedef struct _XIMFilter {
  91.     struct _XIMFilter *next;
  92.     Window window;
  93.     unsigned long event_mask;
  94.     int start_type, end_type;
  95.     XFilterEventProc filter;
  96.     XPointer client_data;
  97. } XFilterEventRec, *XFilterEventList;
  98.  
  99. typedef struct {
  100.     char    *name;
  101.     XPointer value;
  102. } XIMArg;
  103.  
  104. #ifdef offsetof
  105. #define XOffsetOf(s_type,field) offsetof(s_type,field)
  106. #else
  107. #define XOffsetOf(s_type,field) ((unsigned int)&(((s_type*)NULL)->field))
  108. #endif
  109.  
  110. #define XIMNumber(arr) ((unsigned int) (sizeof(arr) / sizeof(arr[0])))
  111.  
  112. /*
  113.  * define secondary data structs which are part of Input Methods
  114.  * and Input Context
  115.  */
  116. typedef struct {
  117.     char        *resource_name;        /* Resource string */
  118.     XrmQuark        xrm_name;        /* Resource name quark */
  119.     int            resource_size;        /* Size in bytes of data */
  120.     long        resource_offset;    /* Offset from base */
  121.     unsigned short     mode;            /* Read Write Permission */
  122.     unsigned short     id;            /* Input Method Protocol */
  123. } XIMResource, *XIMResourceList;
  124.  
  125. /*
  126.  * data block describing the visual attributes associated with
  127.  * an input context
  128.  */
  129. typedef struct {
  130.     XRectangle        area;
  131.     XRectangle        area_needed;
  132.     XPoint        spot_location;
  133.     Colormap        colormap;
  134.     Atom        std_colormap;
  135.     unsigned long    foreground;
  136.     unsigned long    background;
  137.     Pixmap        background_pixmap;
  138.     XFontSet            fontset;
  139.     int                   line_spacing;
  140.     Cursor        cursor;
  141.     XICCallback        start_callback;
  142.     XICCallback        done_callback;
  143.     XICCallback        draw_callback;
  144.     XICCallback        caret_callback;
  145.     XIMPreeditState    preedit_state;
  146.     XICCallback        state_notify_callback;
  147. } ICPreeditAttributes, *ICPreeditAttributesPtr;
  148.  
  149. typedef struct {
  150.     XRectangle        area;
  151.     XRectangle        area_needed;
  152.     Colormap        colormap;
  153.     Atom        std_colormap;
  154.     unsigned long    foreground;
  155.     unsigned long    background;
  156.     Pixmap        background_pixmap;
  157.     XFontSet            fontset;
  158.     int                   line_spacing;
  159.     Cursor        cursor;
  160.     XICCallback        start_callback;
  161.     XICCallback        done_callback;
  162.     XICCallback        draw_callback;
  163. } ICStatusAttributes, *ICStatusAttributesPtr;
  164.  
  165. /*
  166.  * Methods for Xrm parsing
  167.  */
  168.  
  169. typedef void (*XmbInitProc)(
  170. #if NeedFunctionPrototypes
  171.     XPointer        /* state */
  172. #endif
  173. );
  174.  
  175. typedef char (*XmbCharProc)(
  176. #if NeedFunctionPrototypes
  177.     XPointer        /* state */,
  178.     char*        /* str */,
  179.     int*        /* lenp */
  180. #endif
  181. );
  182.  
  183. typedef void (*XmbFinishProc)(
  184. #if NeedFunctionPrototypes
  185.     XPointer        /* state */
  186. #endif
  187. );
  188.  
  189. typedef char* (*XlcNameProc)(
  190. #if NeedFunctionPrototypes
  191.     XPointer        /* state */
  192. #endif
  193. );
  194.  
  195. typedef void (*XrmDestroyProc)(
  196. #if NeedFunctionPrototypes
  197.     XPointer        /* state */
  198. #endif
  199. );
  200.  
  201. typedef struct {
  202.     XmbInitProc        mbinit;
  203.     XmbCharProc        mbchar;
  204.     XmbFinishProc    mbfinish;
  205.     XlcNameProc        lcname;
  206.     XrmDestroyProc    destroy;
  207. } XrmMethodsRec, *XrmMethods;
  208.  
  209. typedef struct _XLCd *XLCd; /* need forward reference */
  210.  
  211. /*
  212.  * define an LC, it's methods, and data.
  213.  */
  214.  
  215. typedef void (*XCloseLCProc)(
  216. #if NeedFunctionPrototypes
  217.     XLCd        /* lcd */
  218. #endif
  219. );
  220.  
  221. typedef char* (*XlcMapModifiersProc)(
  222. #if NeedFunctionPrototypes
  223.     XLCd        /* lcd */,
  224.     char*        /* user_mods */,
  225.     char*        /* prog_mods */
  226. #endif
  227. );
  228.  
  229. typedef XOM (*XOpenOMProc)(
  230. #if NeedFunctionPrototypes
  231.     XLCd        /* lcd */,
  232.     Display*        /* display */,
  233.     XrmDatabase        /* rdb */,
  234.     _Xconst char*    /* res_name */,
  235.     _Xconst char*    /* res_class */
  236. #endif
  237. );
  238.  
  239. typedef XIM (*XOpenIMProc)(
  240. #if NeedFunctionPrototypes
  241.     XLCd        /* lcd */,
  242.     Display*        /* display */,
  243.     XrmDatabase        /* rdb */,
  244.     char*        /* res_name */,
  245.     char*        /* res_class */
  246. #endif
  247. );
  248.  
  249. typedef Bool (*XRegisterIMInstantiateCBProc)(
  250. #if NeedFunctionPrototypes
  251.     XLCd        /* lcd */,
  252.     Display*        /* display */,
  253.     XrmDatabase        /* rdb */,
  254.     char*        /* res_name */,
  255.     char*        /* res_class */,
  256.     XIDProc        /* callback */,
  257.     XPointer        /* client_data */
  258. #endif
  259. );
  260.  
  261. typedef Bool (*XUnregisterIMInstantiateCBProc)(
  262. #if NeedFunctionPrototypes
  263.     XLCd        /* lcd */,
  264.     Display*        /* display */,
  265.     XrmDatabase        /* rdb */,
  266.     char*        /* res_name */,
  267.     char*        /* res_class */,
  268.     XIDProc        /* callback */,
  269.     XPointer        /* client_data */
  270. #endif
  271. );
  272.  
  273. typedef XrmMethods (*XrmInitParseInfoProc)(
  274. #if NeedFunctionPrototypes
  275.     XLCd        /* lcd */,
  276.     XPointer*        /* state */
  277. #endif
  278. );
  279.  
  280. typedef int (*XmbTextPropertyToTextListProc)(
  281. #if NeedFunctionPrototypes
  282.     XLCd        /* lcd */,
  283.     Display*        /* display */,
  284.     XTextProperty*    /* text_prop */,
  285.     char***        /* list_return */,
  286.     int*        /* count_return */
  287. #endif
  288. );
  289.  
  290. typedef int (*XwcTextPropertyToTextListProc)(
  291. #if NeedFunctionPrototypes
  292.     XLCd        /* lcd */,
  293.     Display*        /* display */,
  294.     XTextProperty*    /* text_prop */,
  295.     wchar_t***        /* list_return */,
  296.     int*        /* count_return */
  297. #endif
  298. );
  299.  
  300. typedef int (*XmbTextListToTextPropertyProc)(
  301. #if NeedFunctionPrototypes
  302.     XLCd        /* lcd */,
  303.     Display*        /* display */,
  304.     char**        /* list */,
  305.     int            /* count */,
  306.     XICCEncodingStyle    /* style */,
  307.     XTextProperty*    /* text_prop_return */
  308. #endif
  309. );
  310.  
  311. typedef int (*XwcTextListToTextPropertyProc)(
  312. #if NeedFunctionPrototypes
  313.     XLCd        /* lcd */,
  314.     Display*        /* display */,
  315.     wchar_t**        /* list */,
  316.     int            /* count */,
  317.     XICCEncodingStyle    /* style */,
  318.     XTextProperty*    /* text_prop_return */
  319. #endif
  320. );
  321.  
  322. typedef void (*XwcFreeStringListProc)(
  323. #if NeedFunctionPrototypes
  324.     XLCd        /* lcd */,
  325.     wchar_t**        /* list */
  326. #endif
  327. );
  328.  
  329. typedef char* (*XDefaultStringProc)(
  330. #if NeedFunctionPrototypes
  331.     XLCd        /* lcd */
  332. #endif
  333. );
  334.  
  335. typedef struct {
  336.     XCloseLCProc            close;
  337.     XlcMapModifiersProc            map_modifiers;
  338.     XOpenOMProc                open_om;
  339.     XOpenIMProc                open_im;
  340.     XrmInitParseInfoProc        init_parse_info;
  341.     XmbTextPropertyToTextListProc    mb_text_prop_to_list;
  342.     XwcTextPropertyToTextListProc    wc_text_prop_to_list;
  343.     XmbTextListToTextPropertyProc    mb_text_list_to_prop;
  344.     XwcTextListToTextPropertyProc    wc_text_list_to_prop;
  345.     XwcFreeStringListProc        wc_free_string_list;
  346.     XDefaultStringProc            default_string;
  347.     XRegisterIMInstantiateCBProc    register_callback;
  348.     XUnregisterIMInstantiateCBProc    unregister_callback;
  349. } XLCdMethodsRec, *XLCdMethods;
  350.  
  351.  
  352. typedef struct {
  353.     char*        name;            /* name of this LC */
  354.     char*        modifiers;        /* modifiers of locale */
  355. } XLCdCoreRec, *XLCdCore;
  356.  
  357.  
  358. typedef struct _XLCd {
  359.     XLCdMethods        methods;        /* methods of this LC */
  360.     XLCdCore        core;            /* data of this LC */
  361.     XPointer        opaque;            /* LDX specific data */
  362. } XLCdRec;
  363.  
  364. typedef int XlcPosition;
  365.  
  366. #define XlcHead        0
  367. #define XlcTail        -1
  368.  
  369. typedef struct {
  370.     char *name;
  371.     XPointer value;
  372. } XlcArg, *XlcArgList;
  373.  
  374. typedef struct _XlcResource {
  375.     char *name;
  376.     XrmQuark xrm_name;
  377.     int size;
  378.     int offset;
  379.     unsigned long mask;
  380. } XlcResource, *XlcResourceList;
  381.  
  382. #define XlcCreateMask    (1L<<0)
  383. #define XlcDefaultMask    (1L<<1)
  384. #define XlcGetMask    (1L<<2)
  385. #define XlcSetMask    (1L<<3)
  386. #define XlcIgnoreMask    (1L<<4)
  387.  
  388. #define XlcNumber(arr)    (sizeof(arr) / sizeof(arr[0]))
  389.  
  390. typedef Status (*XCloseOMProc)(
  391. #if NeedFunctionPrototypes
  392.     XOM            /* om */
  393. #endif
  394. );
  395.  
  396. typedef char* (*XSetOMValuesProc)(
  397. #if NeedFunctionPrototypes
  398.     XOM            /* om */,
  399.     XlcArgList        /* args */,
  400.     int            /* num_args */
  401. #endif
  402. );
  403.  
  404. typedef char* (*XGetOMValuesProc)(
  405. #if NeedFunctionPrototypes
  406.     XOM            /* om */,
  407.     XlcArgList        /* args */,
  408.     int            /* num_args */
  409. #endif
  410. );
  411.  
  412. typedef XOC (*XCreateOCProc)(
  413. #if NeedFunctionPrototypes
  414.     XOM            /* om */,
  415.     XlcArgList        /* args */,
  416.     int            /* num_args */
  417. #endif
  418. );
  419.  
  420. typedef struct _XOMMethodsRec {
  421.     XCloseOMProc    close;
  422.     XSetOMValuesProc    set_values;
  423.     XGetOMValuesProc    get_values;
  424.     XCreateOCProc    create_oc;
  425. } XOMMethodsRec, *XOMMethods;
  426.  
  427. typedef struct _XOMCoreRec {
  428.     XLCd lcd;                /* lcd */
  429.     Display *display;            /* display */
  430.     XrmDatabase rdb;            /* database */
  431.     char *res_name;            /* resource name */
  432.     char *res_class;            /* resource class */
  433.     XOC oc_list;            /* xoc list */
  434.     XlcResourceList resources;        /* xom resources */
  435.     int num_resources;            /* number of xom resources */
  436.     XOMCharSetList required_charset;    /* required charset list */
  437.     XOMOrientation orientation_list;    /* orientation list */
  438.     Bool directional_dependent;        /* directional-dependent */
  439.     Bool contextual_drawing;        /* contextual drawing */
  440.     Bool context_dependent;        /* context-dependent drawing */
  441. } XOMCoreRec, *XOMCore;
  442.  
  443. typedef struct _XOM {
  444.     XOMMethods methods;
  445.     XOMCoreRec core;
  446. } XOMRec;
  447.  
  448. typedef void (*XDestroyOCProc)(
  449. #if NeedFunctionPrototypes
  450.     XOC            /* oc */
  451. #endif
  452. );
  453.  
  454. typedef char* (*XSetOCValuesProc)(
  455. #if NeedFunctionPrototypes
  456.     XOC            /* oc */,
  457.     XlcArgList        /* args */,
  458.     int            /* num_args */
  459. #endif
  460. );
  461.  
  462. typedef char* (*XGetOCValuesProc)(
  463. #if NeedFunctionPrototypes
  464.     XOC            /* oc */,
  465.     XlcArgList        /* args */,
  466.     int            /* num_args */
  467. #endif
  468. );
  469.  
  470. /*
  471.  * X Font Sets are an instantiable object, so we define it, the 
  472.  * object itself, a method list and data
  473.  */
  474.  
  475. /* 
  476.  * XFontSet object method list
  477.  */
  478.  
  479. typedef int (*XmbTextEscapementProc)(
  480. #if NeedFunctionPrototypes
  481.     XFontSet        /* font_set */,
  482.     _Xconst char*    /* text */,
  483.     int            /* text_len */
  484. #endif
  485. );
  486.  
  487. typedef int (*XmbTextExtentsProc)(
  488. #if NeedFunctionPrototypes
  489.     XFontSet        /* font_set */,
  490.     _Xconst char*    /* text */,
  491.     int            /* text_len */,
  492.     XRectangle*        /* overall_ink_extents */,
  493.     XRectangle*        /* overall_logical_extents */
  494. #endif
  495. );
  496.  
  497. typedef Status (*XmbTextPerCharExtentsProc)(
  498. #if NeedFunctionPrototypes
  499.     XFontSet        /* font_set */,
  500.     _Xconst char*    /* text */,
  501.     int            /* text_len */,
  502.     XRectangle*        /* ink_extents_buffer */,
  503.     XRectangle*        /* logical_extents_buffer */,
  504.     int            /* buffer_size */,
  505.     int*        /* num_chars */,
  506.     XRectangle*        /* max_ink_extents */,
  507.     XRectangle*        /* max_logical_extents */
  508. #endif
  509. );
  510.  
  511. typedef int (*XmbDrawStringProc)(
  512. #if NeedFunctionPrototypes
  513.     Display*        /* display */,
  514.     Drawable        /* drawable */,
  515.     XFontSet        /* font_set */,
  516.     GC            /* gc */,
  517.     int            /* x */,
  518.     int            /* y */,
  519.     _Xconst char*    /* text */,
  520.     int            /* text_len */
  521. #endif
  522. );
  523.  
  524. typedef void (*XmbDrawImageStringProc)(
  525. #if NeedFunctionPrototypes
  526.     Display*        /* display */,
  527.     Drawable        /* drawable */,
  528.     XFontSet        /* font_set */,
  529.     GC            /* gc */,
  530.     int            /* x */,
  531.     int            /* y */,
  532.     _Xconst char*    /* text */,
  533.     int            /* text_len */
  534. #endif
  535. );
  536.  
  537. typedef int (*XwcTextEscapementProc)(
  538. #if NeedFunctionPrototypes
  539.     XFontSet        /* font_set */,
  540.     _Xconst wchar_t*    /* text */,
  541.     int            /* text_len */
  542. #endif
  543. );
  544.  
  545. typedef int (*XwcTextExtentsProc)(
  546. #if NeedFunctionPrototypes
  547.     XFontSet        /* font_set */,
  548.     _Xconst wchar_t*    /* text */,
  549.     int            /* text_len */,
  550.     XRectangle*        /* overall_ink_extents */,
  551.     XRectangle*        /* overall_logical_extents */
  552. #endif
  553. );
  554.  
  555. typedef Status (*XwcTextPerCharExtentsProc)(
  556. #if NeedFunctionPrototypes
  557.     XFontSet        /* font_set */,
  558.     _Xconst wchar_t*    /* text */,
  559.     int            /* text_len */,
  560.     XRectangle*        /* ink_extents_buffer */,
  561.     XRectangle*        /* logical_extents_buffer */,
  562.     int            /* buffer_size */,
  563.     int*        /* num_chars */,
  564.     XRectangle*        /* max_ink_extents */,
  565.     XRectangle*        /* max_logical_extents */
  566. #endif
  567. );
  568.  
  569. typedef int (*XwcDrawStringProc)(
  570. #if NeedFunctionPrototypes
  571.     Display*        /* display */,
  572.     Drawable        /* drawable */,
  573.     XFontSet        /* font_set */,
  574.     GC            /* gc */,
  575.     int            /* x */,
  576.     int            /* y */,
  577.     _Xconst wchar_t*    /* text */,
  578.     int            /* text_len */
  579. #endif
  580. );
  581.  
  582. typedef void (*XwcDrawImageStringProc)(
  583. #if NeedFunctionPrototypes
  584.     Display*        /* display */,
  585.     Drawable        /* drawable */,
  586.     XFontSet        /* font_set */,
  587.     GC            /* gc */,
  588.     int            /* x */,
  589.     int            /* y */,
  590.     _Xconst wchar_t*    /* text */,
  591.     int            /* text_len */
  592. #endif
  593. );
  594.  
  595. typedef struct {
  596.     XDestroyOCProc         destroy;
  597.     XSetOCValuesProc         set_values;
  598.     XGetOCValuesProc         get_values;
  599.  
  600.     /* multi-byte text drawing methods */
  601.  
  602.     XmbTextEscapementProc    mb_escapement;
  603.     XmbTextExtentsProc        mb_extents;
  604.     XmbTextPerCharExtentsProc    mb_extents_per_char;
  605.     XmbDrawStringProc        mb_draw_string;
  606.     XmbDrawImageStringProc    mb_draw_image_string;
  607.  
  608.     /* wide character text drawing methods */
  609.  
  610.     XwcTextEscapementProc    wc_escapement;
  611.     XwcTextExtentsProc        wc_extents;
  612.     XwcTextPerCharExtentsProc    wc_extents_per_char;
  613.     XwcDrawStringProc        wc_draw_string;
  614.     XwcDrawImageStringProc    wc_draw_image_string;
  615. } XOCMethodsRec, *XOCMethods;
  616.  
  617.  
  618. /*
  619.  * XOC independent data
  620.  */
  621.  
  622. typedef struct {
  623.     XOM om;                /* XOM */
  624.     XOC next;                /* next XOC */
  625.     XlcResourceList resources;        /* xoc resources */
  626.     int num_resources;            /* number of xoc resources */
  627.     char *base_name_list;             /* base font name list */
  628.     Bool om_automatic;            /* OM Automatic */
  629.     XOMFontInfo font_info;        /* font info */
  630.     XFontSetExtents font_set_extents;      /* font set extents */
  631.     char *default_string;             /* default string */
  632.     XOMCharSetList missing_list;    /* missing charset list */
  633.     XOrientation orientation;        /* orientation */
  634.     char *res_name;            /* resource name */
  635.     char *res_class;            /* resource class */
  636. } XOCCoreRec, *XOCCore;
  637.  
  638. typedef struct _XOC {
  639.     XOCMethods methods;
  640.     XOCCoreRec core;
  641. } XOCRec;
  642.  
  643.  
  644. /* current Ultrix compiler gets horribly confused */
  645. #if defined(FUNCPROTO) && defined(ultrix)
  646. #undef NeedFunctionPrototypes
  647. #endif
  648.  
  649.  
  650. /*
  651.  * X Input Managers are an instantiable object, so we define it, the 
  652.  * object itself, a method list and data.
  653.  */
  654.  
  655. /*
  656.  * an Input Manager object method list
  657.  */
  658. typedef struct {
  659.     Status (*close)(
  660. #if NeedFunctionPrototypes
  661.     XIM
  662. #endif
  663.     );
  664.     char* (*set_values)(
  665. #if NeedFunctionPrototypes
  666.     XIM, XIMArg*
  667. #endif
  668.     );
  669.     char* (*get_values)(
  670. #if NeedFunctionPrototypes
  671.     XIM, XIMArg*
  672. #endif
  673.     );
  674.     XIC (*create_ic)(
  675. #if NeedFunctionPrototypes
  676.     XIM, XIMArg*
  677. #endif
  678.     );
  679.     int (*ctstombs)(
  680. #if NeedFunctionPrototypes
  681.     XIM, char*, int, char*, int, Status *
  682. #endif
  683.     );
  684.     int (*ctstowcs)(
  685. #if NeedFunctionPrototypes
  686.     XIM, char*, int, wchar_t*, int, Status *
  687. #endif
  688.     );
  689. } XIMMethodsRec, *XIMMethods;
  690.  
  691. /*
  692.  * Input Manager LC independent data
  693.  */
  694. typedef struct {
  695.     XLCd        lcd;            /* LC of this input method */
  696.     XIC            ic_chain;        /* list of ICs for this IM */
  697.  
  698.     Display *        display;                   /* display */
  699.     XrmDatabase     rdb;
  700.     char *        res_name;
  701.     char *        res_class;
  702.  
  703.     XIMValuesList    *im_values_list;
  704.     XIMValuesList    *ic_values_list;
  705.     XIMStyles        *styles;
  706.     XIMCallback         destroy_callback;
  707.     char *        im_name;        /* XIMMODIFIER name */
  708.     XIMResourceList    im_resources;        /* compiled IM resource list */
  709.     unsigned int    im_num_resources;
  710.     XIMResourceList    ic_resources;        /* compiled IC resource list */
  711.     unsigned int    ic_num_resources;
  712.     Bool        visible_position;
  713. } XIMCoreRec, *XIMCore;
  714.  
  715.  
  716.  
  717. /*
  718.  * An X Input Manager (IM).  Implementations may need to extend this data 
  719.  * structure to accomodate additional data, state information etc.
  720.  */
  721. typedef struct _XIM {
  722.     XIMMethods        methods;        /* method list of this IM */
  723.     XIMCoreRec        core;            /* data of this IM */
  724. } XIMRec;
  725.  
  726.  
  727.  
  728. /*
  729.  * X Input Contexts (IC) are an instantiable object, so we define it, the 
  730.  * object itself, a method list and data for this object
  731.  */
  732.  
  733. /*
  734.  * Input Context method list
  735.  */ 
  736. typedef struct {
  737.     void (*destroy)(
  738. #if NeedFunctionPrototypes
  739.     XIC
  740. #endif
  741.     );
  742.     void (*set_focus)(
  743. #if NeedFunctionPrototypes
  744.     XIC
  745. #endif
  746.     );
  747.     void (*unset_focus)(
  748. #if NeedFunctionPrototypes
  749.     XIC
  750. #endif
  751.     );
  752.     char* (*set_values)(
  753. #if NeedFunctionPrototypes
  754.     XIC, XIMArg*
  755. #endif
  756.     );
  757.     char* (*get_values)(
  758. #if NeedFunctionPrototypes
  759.     XIC, XIMArg*
  760. #endif
  761.     );
  762.     char* (*mb_reset)(
  763. #if NeedFunctionPrototypes
  764.     XIC
  765. #endif
  766.     );
  767.     wchar_t* (*wc_reset)(
  768. #if NeedFunctionPrototypes
  769.     XIC
  770. #endif
  771.     );
  772.     int (*mb_lookup_string)(
  773. #if NeedFunctionPrototypes
  774.     XIC, XKeyEvent*, char*, int, KeySym*, Status*
  775. #endif
  776.     );
  777.     int (*wc_lookup_string)(
  778. #if NeedFunctionPrototypes
  779.     XIC, XKeyEvent*, wchar_t*, int, KeySym*, Status*
  780. #endif
  781.     );
  782. } XICMethodsRec, *XICMethods;
  783.  
  784.  
  785. /*
  786.  * Input Context LC independent data
  787.  */
  788. typedef struct {
  789.     XIM            im;            /* XIM this IC belongs too */
  790.     XIC            next;            /* linked list of ICs for IM */
  791.  
  792.     Window        client_window;        /* window IM can use for */
  793.                         /* display or subwindows */
  794.     XIMStyle        input_style;        /* IM's input style */
  795.     Window        focus_window;        /* where key events go */
  796.     unsigned long    filter_events;        /* event mask from IM */
  797.     XICCallback        geometry_callback;    /* client callback */
  798.     char *        res_name;
  799.     char *        res_class;
  800.  
  801.     XICCallback        destroy_callback;
  802.     XICCallback        string_conversion_callback;
  803.     XIMStringConversionText     string_conversion;
  804.     XIMResetState    reset_state;
  805.     XIMHotKeyTriggers  *hotkey;
  806.     XIMHotKeyState    hotkey_state;
  807.  
  808.     ICPreeditAttributes    preedit_attr;        /* visuals of preedit area */
  809.     ICStatusAttributes    status_attr;        /* visuals of status area */
  810. } XICCoreRec, *XICCore;
  811.  
  812.  
  813. /*
  814.  * an Input Context.  Implementations may need to extend this data 
  815.  * structure to accomodate additional data, state information etc.
  816.  */
  817. typedef struct _XIC {
  818.     XICMethods        methods;        /* method list of this IC */
  819.     XICCoreRec        core;            /* data of this IC */
  820. } XICRec;
  821.  
  822. /* current Ultrix compiler gets horribly confused */
  823. #if !defined(NeedFunctionPrototypes) && defined(FUNCPROTO)
  824. #define NeedFunctionPrototypes 1
  825. #endif
  826.  
  827. typedef XLCd (*XLCdLoadProc)(
  828. #if NeedFunctionPrototypes
  829.     _Xconst char*
  830. #endif
  831. );
  832.  
  833. _XFUNCPROTOBEGIN
  834.  
  835. extern XLCd _XOpenLC(
  836. #if NeedFunctionPrototypes
  837.     _Xconst char*        /* name */
  838. #endif
  839. );
  840.  
  841. extern void _XCloseLC(
  842. #if NeedFunctionPrototypes
  843.     XLCd        /* lcd */
  844. #endif
  845. );
  846.  
  847. extern XLCd _XlcCurrentLC(
  848. #if NeedFunctionPrototypes
  849.     void
  850. #endif
  851. );
  852.  
  853. extern Bool _XlcValidModSyntax(
  854. #if NeedFunctionPrototypes
  855.     char*    /* mods */,
  856.     char**    /* valid */
  857. #endif
  858. );
  859.  
  860. extern char *_XlcDefaultMapModifiers(
  861. #if NeedFunctionPrototypes
  862.     XLCd    /* lcd */,
  863.     char*    /* user_mods */,
  864.     char*    /* prog_mods */
  865. #endif
  866. );
  867.  
  868. extern void _XIMCompileResourceList(
  869. #if NeedFunctionPrototypes
  870.     XIMResourceList    /* res */,
  871.     unsigned int    /* num_res */
  872. #endif
  873. );
  874.  
  875. extern void _XCopyToArg(
  876. #if NeedFunctionPrototypes
  877.     XPointer        /* src */,
  878.     XPointer*        /* dst */,
  879.     unsigned int    /* size */
  880. #endif
  881. );
  882.  
  883. extern char ** _XParseBaseFontNameList(
  884. #if NeedFunctionPrototypes
  885.     char*        /* str */,
  886.     int*        /* num */
  887. #endif
  888. );
  889.  
  890. extern XrmMethods _XrmInitParseInfo(
  891. #if NeedFunctionPrototypes
  892.     XPointer*    /* statep */
  893. #endif
  894. );
  895.  
  896. extern void _XRegisterFilterByMask(
  897. #if NeedFunctionPrototypes
  898.     Display*        /* dpy */,
  899.     Window        /* window */,
  900.     unsigned long    /* event_mask */,
  901.     Bool (*)(
  902. #if NeedNestedPrototypes
  903.          Display*    /* display */,
  904.          Window    /* window */,
  905.          XEvent*    /* event */,
  906.          XPointer    /* client_data */
  907. #endif
  908.          )        /* filter */,
  909.     XPointer        /* client_data */
  910. #endif
  911. );
  912.  
  913. extern void _XRegisterFilterByType(
  914. #if NeedFunctionPrototypes
  915.     Display*        /* dpy */,
  916.     Window        /* window */,
  917.     int            /* start_type */,
  918.     int            /* end_type */,
  919.     Bool (*)(
  920. #if NeedNestedPrototypes
  921.          Display*    /* display */,
  922.          Window    /* window */,
  923.          XEvent*    /* event */,
  924.          XPointer    /* client_data */
  925. #endif
  926.          )        /* filter */,
  927.     XPointer        /* client_data */
  928. #endif
  929. );
  930.  
  931. extern void _XUnregisterFilter(
  932. #if NeedFunctionPrototypes
  933.     Display*        /* dpy */,
  934.     Window        /* window */,
  935.     Bool (*)(
  936. #if NeedNestedPrototypes
  937.          Display*    /* display */,
  938.          Window    /* window */,
  939.          XEvent*    /* event */,
  940.          XPointer    /* client_data */
  941. #endif
  942.          )        /* filter */,
  943.     XPointer        /* client_data */
  944. #endif
  945. );
  946.  
  947. extern void _XlcCountVaList(
  948. #if NeedFunctionPrototypes
  949.     va_list        /* var */,
  950.     int*        /* count_return */
  951. #endif
  952. );
  953.  
  954. extern void _XlcVaToArgList(
  955. #if NeedFunctionPrototypes
  956.     va_list        /* var */,
  957.     int            /* count */,
  958.     XlcArgList*        /* args_return */
  959. #endif
  960. );
  961.  
  962. extern void _XlcCompileResourceList(
  963. #if NeedFunctionPrototypes
  964.     XlcResourceList    /* resources */,
  965.     int            /* num_resources */
  966. #endif
  967. );
  968.  
  969. extern char *_XlcGetValues(
  970. #if NeedFunctionPrototypes
  971.     XPointer        /* base */,
  972.     XlcResourceList    /* resources */,
  973.     int            /* num_resources */,
  974.     XlcArgList        /* args */,
  975.     int            /* num_args */,
  976.     unsigned long    /* mask */
  977. #endif
  978. );
  979.  
  980. extern char *_XlcSetValues(
  981. #if NeedFunctionPrototypes
  982.     XPointer        /* base */,
  983.     XlcResourceList    /* resources */,
  984.     int            /* num_resources */,
  985.     XlcArgList        /* args */,
  986.     int            /* num_args */,
  987.     unsigned long    /* mask */
  988. #endif
  989. );
  990.  
  991. extern Bool _XlcAddLoader(
  992. #if NeedFunctionPrototypes
  993.     XLCdLoadProc    /* proc */,
  994.     XlcPosition        /* position */
  995. #endif
  996. );
  997.  
  998. extern void _XlcRemoveLoader(
  999. #if NeedFunctionPrototypes
  1000.     XLCdLoadProc    /* proc */
  1001. #endif
  1002. );
  1003.  
  1004. _XFUNCPROTOEND
  1005.  
  1006. #endif    /* _XLCINT_H_ */
  1007.