11ab64890Smrg/******************************************************************
21ab64890Smrg
31ab64890Smrg                Copyright 1992, 1993, 1994 by FUJITSU LIMITED
41ab64890Smrg                Copyright 1993, 1994 by Sony Corporation
51ab64890Smrg
61ab64890SmrgPermission to use, copy, modify, distribute, and sell this software
71ab64890Smrgand its documentation for any purpose is hereby granted without fee,
81ab64890Smrgprovided that the above copyright notice appear in all copies and that
91ab64890Smrgboth that copyright notice and this permission notice appear in
101ab64890Smrgsupporting documentation, and that the name of FUJITSU LIMITED and
111ab64890SmrgSony Corporation not be used in advertising or publicity pertaining to
121ab64890Smrgdistribution of the software without specific, written prior
131ab64890Smrgpermission.  FUJITSU LIMITED and Sony Corporation makes no
141ab64890Smrgrepresentations about the suitability of this software for any
1561b2299dSmrgpurpose.  It is provided "as is" without express or implied warranty.
161ab64890Smrg
171ab64890SmrgFUJITSU LIMITED AND SONY CORPORATION DISCLAIM ALL WARRANTIES WITH
181ab64890SmrgREGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
191ab64890SmrgMERCHANTABILITY AND FITNESS, IN NO EVENT SHALL FUJITSU LIMITED AND
201ab64890SmrgSONY CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
211ab64890SmrgDAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
221ab64890SmrgPROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
231ab64890SmrgTORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2461b2299dSmrgPERFORMANCE OF THIS SOFTWARE.
251ab64890Smrg
2661b2299dSmrg  Author:   Takashi Fujiwara   FUJITSU LIMITED
271ab64890Smrg                               fujiwara@a80.tech.yk.fujitsu.co.jp
281ab64890Smrg  Motifier: Makoto Wakamatsu   Sony Corporation
291ab64890Smrg			       makoto@sm.sony.co.jp
301ab64890Smrg
311ab64890Smrg******************************************************************/
321ab64890Smrg
331ab64890Smrg#ifndef _XIMINT_H
341ab64890Smrg#define _XIMINT_H
351ab64890Smrg
361ab64890Smrg#include <stdio.h>
371ab64890Smrg#include <X11/Xutil.h>
381ab64890Smrg
391ab64890Smrgtypedef struct _Xim	*Xim;
401ab64890Smrgtypedef struct _Xic	*Xic;
411ab64890Smrg
421ab64890Smrg/*
431ab64890Smrg * Input Method data
441ab64890Smrg */
451ab64890Smrg#include "XimintP.h"
461ab64890Smrg#include "XimintL.h"
471ab64890Smrg
481ab64890Smrg/*
491ab64890Smrg * XIM dependent data
501ab64890Smrg */
511ab64890Smrg
521ab64890Smrgtypedef struct _XimCommonPrivateRec {
531ab64890Smrg    /* This struct is also inlined in XimLocalPrivateRec, XimProtoPrivateRec. */
541ab64890Smrg    XlcConv		ctom_conv;
551ab64890Smrg    XlcConv		ctow_conv;
561ab64890Smrg    XlcConv		ctoutf8_conv;
571ab64890Smrg    XlcConv		cstomb_conv;
581ab64890Smrg    XlcConv		cstowc_conv;
591ab64890Smrg    XlcConv		cstoutf8_conv;
601ab64890Smrg    XlcConv		ucstoc_conv;
611ab64890Smrg    XlcConv		ucstoutf8_conv;
621ab64890Smrg} XimCommonPrivateRec;
631ab64890Smrg
641ab64890Smrgtypedef union _XIMPrivateRec {
651ab64890Smrg    XimCommonPrivateRec  common;
661ab64890Smrg    XimLocalPrivateRec   local;
671ab64890Smrg    XimProtoPrivateRec   proto;
681ab64890Smrg} XIMPrivateRec;
691ab64890Smrg
701ab64890Smrg/*
711ab64890Smrg * IM struct
721ab64890Smrg */
731ab64890Smrgtypedef struct _Xim {
741ab64890Smrg    XIMMethods		methods;
751ab64890Smrg    XIMCoreRec		core;
761ab64890Smrg    XIMPrivateRec	private;
771ab64890Smrg} XimRec;
781ab64890Smrg
791ab64890Smrg/*
801ab64890Smrg * IC deprndent data
811ab64890Smrg */
821ab64890Smrgtypedef union _XICPrivateRec {
831ab64890Smrg    XicLocalPrivateRec   local;
841ab64890Smrg    XicProtoPrivateRec   proto;
851ab64890Smrg} XICPrivateRec;
861ab64890Smrg
871ab64890Smrg/*
881ab64890Smrg * IC struct
891ab64890Smrg */
901ab64890Smrgtypedef struct _Xic {
911ab64890Smrg	XICMethods	methods;
921ab64890Smrg	XICCoreRec	core;
931ab64890Smrg	XICPrivateRec	private;
941ab64890Smrg} XicRec;
951ab64890Smrg
961ab64890Smrgtypedef struct _XimDefIMValues {
971ab64890Smrg	XIMValuesList		*im_values_list;
981ab64890Smrg	XIMValuesList		*ic_values_list;
991ab64890Smrg	XIMStyles		*styles;
1001ab64890Smrg	XIMCallback		 destroy_callback;
1011ab64890Smrg	char			*res_name;
1021ab64890Smrg	char			*res_class;
1031ab64890Smrg	Bool			 visible_position;
1041ab64890Smrg} XimDefIMValues;
1051ab64890Smrg
1061ab64890Smrgtypedef struct _XimDefICValues {
1071ab64890Smrg    XIMStyle			 input_style;
1081ab64890Smrg    Window			 client_window;
1091ab64890Smrg    Window			 focus_window;
1101ab64890Smrg    unsigned long		 filter_events;
1111ab64890Smrg    XICCallback			 geometry_callback;
1121ab64890Smrg    char			*res_name;
1131ab64890Smrg    char			*res_class;
1141ab64890Smrg    XICCallback			 destroy_callback;
1151ab64890Smrg    XICCallback			 preedit_state_notify_callback;
1161ab64890Smrg    XICCallback			 string_conversion_callback;
1171ab64890Smrg    XIMStringConversionText	 string_conversion;
1181ab64890Smrg    XIMResetState		 reset_state;
1191ab64890Smrg    XIMHotKeyTriggers		*hotkey;
1201ab64890Smrg    XIMHotKeyState		 hotkey_state;
1211ab64890Smrg    ICPreeditAttributes		 preedit_attr;
1221ab64890Smrg    ICStatusAttributes		 status_attr;
1231ab64890Smrg} XimDefICValues;
1241ab64890Smrg
1251ab64890Smrg#define XIM_MODE_IM_GET		(1 << 0)
1261ab64890Smrg#define XIM_MODE_IM_SET		(1 << 1)
1271ab64890Smrg#define XIM_MODE_IM_DEFAULT	(1 << 2)
1281ab64890Smrg
1291ab64890Smrg#define XIM_MODE_PRE_GET	(1 << 0)
1301ab64890Smrg#define XIM_MODE_PRE_SET	(1 << 1)
1311ab64890Smrg#define XIM_MODE_PRE_CREATE	(1 << 2)
1321ab64890Smrg#define XIM_MODE_PRE_ONCE	(1 << 3)
1331ab64890Smrg#define XIM_MODE_PRE_DEFAULT	(1 << 4)
1341ab64890Smrg
1351ab64890Smrg#define XIM_MODE_STS_GET	(1 << 5)
1361ab64890Smrg#define XIM_MODE_STS_SET	(1 << 6)
1371ab64890Smrg#define XIM_MODE_STS_CREATE	(1 << 7)
1381ab64890Smrg#define XIM_MODE_STS_ONCE	(1 << 8)
1391ab64890Smrg#define XIM_MODE_STS_DEFAULT	(1 << 9)
1401ab64890Smrg
1411ab64890Smrg#define XIM_MODE_IC_GET		(XIM_MODE_PRE_GET      | XIM_MODE_STS_GET)
1421ab64890Smrg#define XIM_MODE_IC_SET		(XIM_MODE_PRE_SET      | XIM_MODE_STS_SET)
1431ab64890Smrg#define XIM_MODE_IC_CREATE	(XIM_MODE_PRE_CREATE   | XIM_MODE_STS_CREATE)
1441ab64890Smrg#define XIM_MODE_IC_ONCE	(XIM_MODE_PRE_ONCE     | XIM_MODE_STS_ONCE)
1451ab64890Smrg#define XIM_MODE_IC_DEFAULT	(XIM_MODE_PRE_DEFAULT  | XIM_MODE_STS_DEFAULT)
1461ab64890Smrg
1471ab64890Smrg#define XIM_MODE_PRE_MASK	(XIM_MODE_PRE_GET    | XIM_MODE_PRE_SET    | \
1481ab64890Smrg				 XIM_MODE_PRE_CREATE | XIM_MODE_PRE_ONCE   | \
1491ab64890Smrg				 XIM_MODE_PRE_DEFAULT)
1501ab64890Smrg#define XIM_MODE_STS_MASK	(XIM_MODE_STS_GET    | XIM_MODE_STS_SET    | \
1511ab64890Smrg				 XIM_MODE_STS_CREATE | XIM_MODE_STS_ONCE   | \
1521ab64890Smrg				 XIM_MODE_STS_DEFAULT)
1531ab64890Smrg
1541ab64890Smrg#define XIM_SETIMDEFAULTS	(1L << 0)
1551ab64890Smrg#define XIM_SETIMVALUES		(1L << 1)
1561ab64890Smrg#define XIM_GETIMVALUES		(1L << 2)
1571ab64890Smrg
1581ab64890Smrg#define XIM_SETICDEFAULTS	(1L << 0)
1591ab64890Smrg#define XIM_CREATEIC		(1L << 1)
1601ab64890Smrg#define XIM_SETICVALUES		(1L << 2)
1611ab64890Smrg#define XIM_GETICVALUES		(1L << 3)
1621ab64890Smrg#define XIM_PREEDIT_ATTR	(1L << 4)
1631ab64890Smrg#define XIM_STATUS_ATTR		(1L << 5)
1641ab64890Smrg
1651ab64890Smrg#define XIM_CHECK_VALID		0
1661ab64890Smrg#define XIM_CHECK_INVALID	1
1671ab64890Smrg#define XIM_CHECK_ERROR		2
1681ab64890Smrg
1691ab64890Smrg#define FILTERD         True
1701ab64890Smrg#define NOTFILTERD      False
1711ab64890Smrg
1721ab64890Smrg#define XIMMODIFIER		"@im="
1731ab64890Smrg
1741ab64890Smrg#define	XIM_TRUE	True
1751ab64890Smrg#define	XIM_FALSE	False
1761ab64890Smrg#define	XIM_OVERFLOW	(-1)
1771ab64890Smrg
1781ab64890Smrg#define BRL_UC_ROW	0x2800
1791ab64890Smrg
1801ab64890Smrg/*
1811ab64890Smrg * Global symbols
1821ab64890Smrg */
1831ab64890Smrg
1841ab64890SmrgXPointer _XimGetLocaleCode (
1851ab64890Smrg    const char	*encoding_name
1861ab64890Smrg);
1871ab64890Smrg
1881ab64890Smrgint _XimGetCharCode (
1891ab64890Smrg    XPointer		conv,
1901ab64890Smrg    KeySym		keysym,
1911ab64890Smrg    unsigned char	*buf,
1921ab64890Smrg    int			nbytes
1931ab64890Smrg);
1941ab64890Smrg
1951ab64890Smrgunsigned int KeySymToUcs4 (
1961ab64890Smrg    KeySym		keysym
1971ab64890Smrg);
1981ab64890Smrg
1991ab64890Smrgextern Bool _XimSetIMResourceList(
2001ab64890Smrg    XIMResourceList	*res_list,
2011ab64890Smrg    unsigned int	*list_num
2021ab64890Smrg);
2031ab64890Smrg
2041ab64890Smrgextern Bool _XimSetICResourceList(
2051ab64890Smrg    XIMResourceList	*res_list,
2061ab64890Smrg    unsigned int	*list_num
2071ab64890Smrg);
2081ab64890Smrg
2091ab64890Smrgextern Bool _XimSetInnerIMResourceList(
2101ab64890Smrg    XIMResourceList	*res_list,
2111ab64890Smrg    unsigned int	*list_num
2121ab64890Smrg);
2131ab64890Smrg
2141ab64890Smrgextern Bool _XimSetInnerICResourceList(
2151ab64890Smrg    XIMResourceList	*res_list,
2161ab64890Smrg    unsigned int	*list_num
2171ab64890Smrg);
2181ab64890Smrg
2191ab64890Smrgextern Bool _XimCheckCreateICValues(
2201ab64890Smrg    XIMResourceList	 res_list,
2211ab64890Smrg    unsigned int	 list_num
2221ab64890Smrg);
2231ab64890Smrg
2241ab64890Smrgextern XIMResourceList _XimGetResourceListRec(
2251ab64890Smrg    XIMResourceList	 res_list,
2261ab64890Smrg    unsigned int	 list_num,
2271ab64890Smrg    const char		*name
2281ab64890Smrg);
2291ab64890Smrg
2301ab64890Smrgextern void _XimSetIMMode(
2311ab64890Smrg    XIMResourceList	 res_list,
2321ab64890Smrg    unsigned int	 list_num
2331ab64890Smrg);
2341ab64890Smrg
2351ab64890Smrgextern void _XimSetICMode(
2361ab64890Smrg    XIMResourceList	 res_list,
2371ab64890Smrg    unsigned int	 list_num,
2381ab64890Smrg    XIMStyle		 style
2391ab64890Smrg);
2401ab64890Smrg
2411ab64890Smrgextern int _XimCheckIMMode(
2421ab64890Smrg    XIMResourceList	 res_list,
2431ab64890Smrg    unsigned long	 mode
2441ab64890Smrg);
2451ab64890Smrg
2461ab64890Smrgextern int _XimCheckICMode(
2471ab64890Smrg    XIMResourceList	 res_list,
2481ab64890Smrg    unsigned long	 mode
2491ab64890Smrg);
2501ab64890Smrg
2511ab64890Smrgextern Bool _XimSetLocalIMDefaults(
2521ab64890Smrg    Xim			 im,
2531ab64890Smrg    XPointer		 top,
2541ab64890Smrg    XIMResourceList	 res_list,
2551ab64890Smrg    unsigned int	 list_num
2561ab64890Smrg);
2571ab64890Smrg
2581ab64890Smrgextern Bool _XimSetICDefaults(
2591ab64890Smrg    Xic			 ic,
2601ab64890Smrg    XPointer		 top,
2611ab64890Smrg    unsigned long	 mode,
2621ab64890Smrg    XIMResourceList	 res_list,
2631ab64890Smrg    unsigned int	 list_num
2641ab64890Smrg);
2651ab64890Smrg
2661ab64890Smrgextern Bool _XimEncodeLocalIMAttr(
2671ab64890Smrg    XIMResourceList	 res,
2681ab64890Smrg    XPointer		 top,
2691ab64890Smrg    XPointer		 val
2701ab64890Smrg);
2711ab64890Smrg
2721ab64890Smrgextern Bool _XimEncodeLocalICAttr(
2731ab64890Smrg    Xic			 ic,
2741ab64890Smrg    XIMResourceList	 res,
2751ab64890Smrg    XPointer		 top,
2761ab64890Smrg    XIMArg		*arg,
2771ab64890Smrg    unsigned long	 mode
2781ab64890Smrg);
2791ab64890Smrg
2801ab64890Smrgextern Bool _XimCheckLocalInputStyle(
2811ab64890Smrg    Xic			 ic,
2821ab64890Smrg    XPointer		 top,
2831ab64890Smrg    XIMArg		*values,
2841ab64890Smrg    XIMStyles           *styles,
2851ab64890Smrg    XIMResourceList	 res_list,
2861ab64890Smrg    unsigned int	 list_num
2871ab64890Smrg);
2881ab64890Smrg
2891ab64890Smrgextern Bool _XimDecodeLocalIMAttr(
2901ab64890Smrg    XIMResourceList	 res,
2911ab64890Smrg    XPointer		 top,
2921ab64890Smrg    XPointer		 val
2931ab64890Smrg);
2941ab64890Smrg
2951ab64890Smrgextern Bool _XimDecodeLocalICAttr(
2961ab64890Smrg    XIMResourceList	 res,
2971ab64890Smrg    XPointer		 top,
2981ab64890Smrg    XPointer		 val,
2991ab64890Smrg    unsigned long	mode
3001ab64890Smrg);
3011ab64890Smrg
3021ab64890Smrgextern void _XimGetCurrentIMValues(
3031ab64890Smrg    Xim			 im,
3041ab64890Smrg    XimDefIMValues	*im_values
3051ab64890Smrg);
3061ab64890Smrg
3071ab64890Smrgextern void _XimSetCurrentIMValues(
3081ab64890Smrg    Xim			 im,
3091ab64890Smrg    XimDefIMValues	*im_values
3101ab64890Smrg);
3111ab64890Smrg
3121ab64890Smrgextern void _XimGetCurrentICValues(
3131ab64890Smrg    Xic			 ic,
3141ab64890Smrg    XimDefICValues	*ic_values
3151ab64890Smrg);
3161ab64890Smrg
3171ab64890Smrgextern void _XimSetCurrentICValues(
3181ab64890Smrg    Xic			 ic,
3191ab64890Smrg    XimDefICValues	*ic_values
3201ab64890Smrg);
3211ab64890Smrg
3221ab64890Smrgextern void _XimInitialResourceInfo(
3231ab64890Smrg    void
3241ab64890Smrg);
3251ab64890Smrg
3261ab64890Smrgextern void	 _XimParseStringFile(
3271ab64890Smrg    FILE        *fp,
3281ab64890Smrg    Xim          im
3291ab64890Smrg);
3301ab64890Smrg
3311ab64890Smrgextern Bool	 _XimCheckIfLocalProcessing(
3321ab64890Smrg    Xim		 im
3331ab64890Smrg);
3341ab64890Smrg
3351ab64890Smrgextern Bool	 _XimCheckIfThaiProcessing(
3361ab64890Smrg    Xim		 im
3371ab64890Smrg);
3381ab64890Smrg
3391ab64890Smrgextern Bool	 _XimLocalOpenIM(
3401ab64890Smrg    Xim		 im
3411ab64890Smrg);
3421ab64890Smrg
3431ab64890Smrgextern Bool	 _XimThaiOpenIM(
3441ab64890Smrg    Xim		 im
3451ab64890Smrg);
3461ab64890Smrg
3471ab64890Smrgextern Bool	 _XimProtoOpenIM(
3481ab64890Smrg    Xim		 im
3491ab64890Smrg);
3501ab64890Smrg
3511ab64890Smrgextern void	 _XimLocalIMFree(
3521ab64890Smrg    Xim		 im
3531ab64890Smrg);
3541ab64890Smrg
3551ab64890Smrgextern void	 _XimThaiIMFree(
3561ab64890Smrg    Xim	         im
3571ab64890Smrg);
3581ab64890Smrg
3591ab64890Smrgextern void	 _XimProtoIMFree(
3601ab64890Smrg    Xim		 im
3611ab64890Smrg);
3621ab64890Smrg
3631ab64890Smrgextern char *	 _XimSetIMValueData(
3641ab64890Smrg    Xim			 im,
3651ab64890Smrg    XPointer		 top,
3661ab64890Smrg    XIMArg		*arg,
3671ab64890Smrg    XIMResourceList	 res_list,
3681ab64890Smrg    unsigned int	 list_num
3691ab64890Smrg);
3701ab64890Smrg
3711ab64890Smrgextern char *	 _XimGetIMValueData(
3721ab64890Smrg    Xim			 im,
3731ab64890Smrg    XPointer		 top,
3741ab64890Smrg    XIMArg		*arg,
3751ab64890Smrg    XIMResourceList	 res_list,
3761ab64890Smrg    unsigned int	 list_num
3771ab64890Smrg);
3781ab64890Smrg
3791ab64890Smrgextern char *	 _XimSetICValueData(
3801ab64890Smrg    Xic			 ic,
3811ab64890Smrg    XPointer		 top,
3821ab64890Smrg    XIMResourceList	 res_list,
3831ab64890Smrg    unsigned int	 list_num,
3841ab64890Smrg    XIMArg		*arg,
3851ab64890Smrg    unsigned long	 mode,
3861ab64890Smrg    Bool		 flag
3871ab64890Smrg);
3881ab64890Smrg
3891ab64890Smrgextern char *	 _XimGetICValueData(
3901ab64890Smrg    Xic			 ic,
3911ab64890Smrg    XPointer		 top,
3921ab64890Smrg    XIMResourceList	 res_list,
3931ab64890Smrg    unsigned int	 list_num,
3941ab64890Smrg    XIMArg		*arg,
3951ab64890Smrg    unsigned long	 mode
3961ab64890Smrg);
3971ab64890Smrg
3981ab64890Smrgextern char *	 _XimLocalSetIMValues(
3991ab64890Smrg    XIM		 im,
4001ab64890Smrg    XIMArg	*arg
4011ab64890Smrg);
4021ab64890Smrg
4031ab64890Smrgextern char *	 _XimLocalGetIMValues(
4041ab64890Smrg    XIM		 im,
4051ab64890Smrg    XIMArg	*arg
4061ab64890Smrg);
4071ab64890Smrg
4081ab64890Smrgextern XIC	 _XimLocalCreateIC(
4091ab64890Smrg    XIM		 im,
4101ab64890Smrg    XIMArg	*arg
4111ab64890Smrg);
4121ab64890Smrg
4131ab64890Smrgextern Bool	_XimDispatchInit(
4141ab64890Smrg    Xim		 im
4151ab64890Smrg);
4161ab64890Smrg
4171ab64890Smrgextern Bool	 _XimGetAttributeID(
4181ab64890Smrg    Xim		 im,
4191ab64890Smrg    CARD16	*buf
4201ab64890Smrg);
4211ab64890Smrg
4221ab64890Smrgextern Bool	 _XimExtension(
4231ab64890Smrg    Xim		 im
4241ab64890Smrg);
4251ab64890Smrg
4261ab64890Smrgextern void	_XimDestroyIMStructureList(
4271ab64890Smrg    Xim		 im
4281ab64890Smrg);
4291ab64890Smrg
4301ab64890Smrgextern char *	_XimMakeIMAttrIDList(
4311ab64890Smrg    Xim			 im,
4321ab64890Smrg    XIMResourceList	 res_list,
4331ab64890Smrg    unsigned int	 res_num,
4341ab64890Smrg    XIMArg		*arg,
4351ab64890Smrg    CARD16		*buf,
4361ab64890Smrg    INT16		*len,
4371ab64890Smrg    unsigned long        mode
4381ab64890Smrg);
4391ab64890Smrg
4401ab64890Smrgextern char *	_XimMakeICAttrIDList(
4411ab64890Smrg    Xic                  ic,
4421ab64890Smrg    XIMResourceList	 res_list,
4431ab64890Smrg    unsigned int	 res_num,
4441ab64890Smrg    XIMArg		*arg,
4451ab64890Smrg    CARD16		*idList,
4461ab64890Smrg    INT16		*num,
4471ab64890Smrg    unsigned long	 mode
4481ab64890Smrg);
4491ab64890Smrg
4501ab64890Smrgextern char *	_XimDecodeIMATTRIBUTE(
4511ab64890Smrg    Xim			 im,
4521ab64890Smrg    XIMResourceList	 res_list,
4531ab64890Smrg    unsigned int	 res_num,
4541ab64890Smrg    CARD16		*buf,
4551ab64890Smrg    INT16		 buf_len,
4561ab64890Smrg    XIMArg		*arg,
4571ab64890Smrg    BITMASK32		 mode
4581ab64890Smrg);
4591ab64890Smrg
4601ab64890Smrgextern char *	_XimDecodeICATTRIBUTE(
4611ab64890Smrg    Xic			 ic,
4621ab64890Smrg    XIMResourceList	 res_list,
4631ab64890Smrg    unsigned int	 res_num,
4641ab64890Smrg    CARD16		*buf,
4651ab64890Smrg    INT16		 buf_len,
4661ab64890Smrg    XIMArg		*arg,
4671ab64890Smrg    BITMASK32		 mode
4681ab64890Smrg);
4691ab64890Smrg
4701ab64890Smrgextern Bool	_XimRegProtoIntrCallback(
4711ab64890Smrg    Xim		 im,
4721ab64890Smrg    CARD16	 major_code,
4731ab64890Smrg    CARD16	 minor_code,
4741ab64890Smrg    Bool	 (*proc)(
4751ab64890Smrg			Xim, INT16, XPointer, XPointer
4761ab64890Smrg			),
4771ab64890Smrg    XPointer	 call_data
4781ab64890Smrg);
4791ab64890Smrg
4801ab64890Smrgextern Bool	_XimErrorCallback(
4811ab64890Smrg    Xim		 im,
4821ab64890Smrg    INT16	 len,
4831ab64890Smrg    XPointer	 data,
4841ab64890Smrg    XPointer	 call_data
4851ab64890Smrg);
4861ab64890Smrg
4871ab64890Smrgextern Bool	_XimError(
4881ab64890Smrg    Xim		 im,
4891ab64890Smrg    Xic		 ic,
4901ab64890Smrg    CARD16	 error_code,
4911ab64890Smrg    INT16	 detail_length,
4921ab64890Smrg    CARD16	 type,
4931ab64890Smrg    char	*detail
4941ab64890Smrg);
4951ab64890Smrg
4961ab64890Smrgextern Bool	_XimRegisterTriggerKeysCallback(
4971ab64890Smrg    Xim		 im,
4981ab64890Smrg    INT16	 len,
4991ab64890Smrg    XPointer	 data,
5001ab64890Smrg    XPointer	 call_data
5011ab64890Smrg);
5021ab64890Smrg
5031ab64890Smrgextern Bool	_XimSetEventMaskCallback(
5041ab64890Smrg    Xim		 im,
5051ab64890Smrg    INT16	 len,
5061ab64890Smrg    XPointer	 data,
5071ab64890Smrg    XPointer	 call_data
5081ab64890Smrg);
5091ab64890Smrg
5101ab64890Smrgextern Bool	_XimForwardEventCallback(
5111ab64890Smrg    Xim		 im,
5121ab64890Smrg    INT16	 len,
5131ab64890Smrg    XPointer	 data,
5141ab64890Smrg    XPointer	 call_data
5151ab64890Smrg);
5161ab64890Smrg
5171ab64890Smrgextern Bool	_XimCommitCallback(
5181ab64890Smrg    Xim		 im,
5191ab64890Smrg    INT16	 len,
5201ab64890Smrg    XPointer	 data,
5211ab64890Smrg    XPointer	 call_data
5221ab64890Smrg);
5231ab64890Smrg
5241ab64890Smrgextern Bool	_XimSyncCallback(
5251ab64890Smrg    Xim		 im,
5261ab64890Smrg    INT16	 len,
5271ab64890Smrg    XPointer	 data,
5281ab64890Smrg    XPointer	 call_data
5291ab64890Smrg);
5301ab64890Smrg
5311ab64890Smrgextern void	_XimFreeProtoIntrCallback(
5321ab64890Smrg    Xim		 im
5331ab64890Smrg);
5341ab64890Smrg
5351ab64890Smrgextern XIC	 _XimProtoCreateIC(
5361ab64890Smrg    XIM		 im,
5371ab64890Smrg    XIMArg	*arg
5381ab64890Smrg);
5391ab64890Smrg
5401ab64890Smrgextern void	_XimRegisterServerFilter(
5411ab64890Smrg    Xim		 im
5421ab64890Smrg);
5431ab64890Smrg
5441ab64890Smrgextern void	_XimUnregisterServerFilter(
5451ab64890Smrg    Xim		 im
5461ab64890Smrg);
5471ab64890Smrg
5481ab64890Smrgextern Bool	_XimTriggerNotify(
5491ab64890Smrg    Xim		 im,
5501ab64890Smrg    Xic		 ic,
5511ab64890Smrg    int		 mode,
5521ab64890Smrg    CARD32	 idx
5531ab64890Smrg);
5541ab64890Smrg
5551ab64890Smrgextern Bool	_XimProcSyncReply(
5561ab64890Smrg    Xim		 im,
5571ab64890Smrg    Xic		 ic
5581ab64890Smrg);
5591ab64890Smrg
5601ab64890Smrgextern void	_XimSendSetFocus(
5611ab64890Smrg    Xim		 im,
5621ab64890Smrg    Xic		 ic
5631ab64890Smrg);
5641ab64890Smrg
5651ab64890Smrgextern Bool	_XimForwardEvent(
5661ab64890Smrg    Xic		 ic,
5671ab64890Smrg    XEvent	*ev,
5681ab64890Smrg    Bool	 sync
5691ab64890Smrg);
5701ab64890Smrg
5711ab64890Smrgextern void	_XimFreeRemakeArg(
5721ab64890Smrg    XIMArg	*arg
5731ab64890Smrg);
5741ab64890Smrg
5751ab64890Smrgextern void	_XimServerDestroy(
5761ab64890Smrg    Xim			im
5771ab64890Smrg);
5781ab64890Smrg
5791ab64890Smrgextern char *	_XimEncodeIMATTRIBUTE(
5801ab64890Smrg    Xim			  im,
5811ab64890Smrg    XIMResourceList	  res_list,
5821ab64890Smrg    unsigned int	  res_num,
58361b2299dSmrg    XIMArg               *arg,
5841ab64890Smrg    XIMArg		**arg_ret,
5851ab64890Smrg    char		 *buf,
5861ab64890Smrg    int			  size,
5871ab64890Smrg    int			 *ret_len,
5881ab64890Smrg    XPointer		  top,
5891ab64890Smrg    unsigned long	  mode
5901ab64890Smrg);
5911ab64890Smrg
5921ab64890Smrgextern char *	_XimEncodeICATTRIBUTE(
5931ab64890Smrg    Xic			  ic,
5941ab64890Smrg    XIMResourceList	  res_list,
5951ab64890Smrg    unsigned int	  res_num,
59661b2299dSmrg    XIMArg               *arg,
5971ab64890Smrg    XIMArg		**arg_ret,
5981ab64890Smrg    char		 *buf,
5991ab64890Smrg    int			  size,
6001ab64890Smrg    int			 *ret_len,
6011ab64890Smrg    XPointer		  top,
6021ab64890Smrg    BITMASK32		 *flag,
6031ab64890Smrg    unsigned long	  mode
6041ab64890Smrg);
6051ab64890Smrg
6061ab64890Smrg#ifdef EXT_MOVE
6071ab64890Smrgextern Bool	_XimExtenMove(
6081ab64890Smrg    Xim		 im,
6091ab64890Smrg    Xic		 ic,
6101ab64890Smrg    CARD32	 flag,
6111ab64890Smrg    CARD16	*buf,
6121ab64890Smrg    INT16	 length
6131ab64890Smrg);
6141ab64890Smrg#endif
6151ab64890Smrg
6161ab64890Smrgextern int	_Ximctstombs(
6171ab64890Smrg    XIM		 im,
6181ab64890Smrg    char	*from,
6191ab64890Smrg    int		 from_len,
6201ab64890Smrg    char	*to,
6211ab64890Smrg    int		 to_len,
6221ab64890Smrg    Status	*state
6231ab64890Smrg);
6241ab64890Smrg
6251ab64890Smrgextern int	_Ximctstowcs(
6261ab64890Smrg    XIM		 im,
6271ab64890Smrg    char	*from,
6281ab64890Smrg    int		 from_len,
6291ab64890Smrg    wchar_t	*to,
6301ab64890Smrg    int		 to_len,
6311ab64890Smrg    Status	*state
6321ab64890Smrg);
6331ab64890Smrg
6341ab64890Smrgextern int	_Ximctstoutf8(
6351ab64890Smrg    XIM		 im,
6361ab64890Smrg    char	*from,
6371ab64890Smrg    int		 from_len,
6381ab64890Smrg    char	*to,
6391ab64890Smrg    int		 to_len,
6401ab64890Smrg    Status	*state
6411ab64890Smrg);
6421ab64890Smrg
6431ab64890Smrgextern int	_XimLcctstombs(
6441ab64890Smrg    XIM		 im,
6451ab64890Smrg    char	*from,
6461ab64890Smrg    int		 from_len,
6471ab64890Smrg    char	*to,
6481ab64890Smrg    int		 to_len,
6491ab64890Smrg    Status	*state
6501ab64890Smrg);
6511ab64890Smrg
6521ab64890Smrgextern int	_XimLcctstowcs(
6531ab64890Smrg    XIM		 im,
6541ab64890Smrg    char	*from,
6551ab64890Smrg    int		 from_len,
6561ab64890Smrg    wchar_t	*to,
6571ab64890Smrg    int		 to_len,
6581ab64890Smrg    Status	*state
6591ab64890Smrg);
6601ab64890Smrg
6611ab64890Smrgextern int	_XimLcctstoutf8(
6621ab64890Smrg    XIM		 im,
6631ab64890Smrg    char	*from,
6641ab64890Smrg    int		 from_len,
6651ab64890Smrg    char	*to,
6661ab64890Smrg    int		 to_len,
6671ab64890Smrg    Status	*state
6681ab64890Smrg);
6691ab64890Smrg
6701ab64890Smrgextern char _XimGetMyEndian(
6711ab64890Smrg    void
6721ab64890Smrg);
6731ab64890Smrg
6741ab64890Smrgextern int	_XimCheckDataSize(
6751ab64890Smrg    XPointer	 buf,
6761ab64890Smrg    int		 len
6771ab64890Smrg);
6781ab64890Smrg
6791ab64890Smrgextern void	_XimSetHeader(
6801ab64890Smrg    XPointer	 buf,
6811ab64890Smrg    CARD8	 major_opcode,
6821ab64890Smrg    CARD8	 minor_opcode,
6831ab64890Smrg    INT16	*len
6841ab64890Smrg);
6851ab64890Smrg
6861ab64890Smrgextern Bool	_XimSync(
6871ab64890Smrg    Xim		 im,
6881ab64890Smrg    Xic		 ic
6891ab64890Smrg);
6901ab64890Smrg
6911ab64890Smrgextern int	_XimProtoMbLookupString(
6921ab64890Smrg    XIC		 xic,
6931ab64890Smrg    XKeyEvent	*ev,
6941ab64890Smrg    char	*buffer,
6951ab64890Smrg    int		 bytes,
6961ab64890Smrg    KeySym	*keysym,
6971ab64890Smrg    Status	*state
6981ab64890Smrg);
6991ab64890Smrg
7001ab64890Smrgextern int	_XimProtoWcLookupString(
7011ab64890Smrg    XIC		 xic,
7021ab64890Smrg    XKeyEvent	*ev,
7031ab64890Smrg    wchar_t	*buffer,
7041ab64890Smrg    int		 bytes,
7051ab64890Smrg    KeySym	*keysym,
7061ab64890Smrg    Status	*state
7071ab64890Smrg);
7081ab64890Smrg
7091ab64890Smrgextern int	_XimProtoUtf8LookupString(
7101ab64890Smrg    XIC		 xic,
7111ab64890Smrg    XKeyEvent	*ev,
7121ab64890Smrg    char	*buffer,
7131ab64890Smrg    int		 bytes,
7141ab64890Smrg    KeySym	*keysym,
7151ab64890Smrg    Status	*state
7161ab64890Smrg);
7171ab64890Smrg
7181ab64890Smrgextern void	_XimRegisterFilter(
7191ab64890Smrg    Xic		 ic
7201ab64890Smrg);
7211ab64890Smrg
7221ab64890Smrgextern void	_XimUnregisterFilter(
7231ab64890Smrg    Xic		 ic
7241ab64890Smrg);
7251ab64890Smrg
7261ab64890Smrgextern void	_XimReregisterFilter(
7271ab64890Smrg    Xic		 ic
7281ab64890Smrg);
7291ab64890Smrg
7301ab64890Smrgextern Status	_XimProtoEventToWire(
7311ab64890Smrg    XEvent	*re,
7321ab64890Smrg    xEvent	*event,
7331ab64890Smrg    Bool	sw
7341ab64890Smrg);
7351ab64890Smrg
7361ab64890Smrgextern Bool	_XimProtoWireToEvent(
7371ab64890Smrg    XEvent	*re,
7381ab64890Smrg    xEvent	*event,
7391ab64890Smrg    Bool	 sw
7401ab64890Smrg);
7411ab64890Smrg
7421ab64890Smrg#ifdef EXT_FORWARD
7431ab64890Smrgextern Bool	_XimExtForwardKeyEvent(
7441ab64890Smrg    Xic		 ic,
7451ab64890Smrg    XKeyEvent	*ev,
7461ab64890Smrg    Bool	 sync
7471ab64890Smrg);
7481ab64890Smrg#endif
7491ab64890Smrg
7501ab64890Smrgextern int	_XimLookupMBText(
7511ab64890Smrg    Xic			 ic,
7521ab64890Smrg    XKeyEvent		*event,
7531ab64890Smrg    char		*buffer,
7541ab64890Smrg    int			 nbytes,
7551ab64890Smrg    KeySym		*keysym,
7561ab64890Smrg    XComposeStatus	*status
7571ab64890Smrg);
7581ab64890Smrg
7591ab64890Smrgextern int	_XimLookupWCText(
7601ab64890Smrg    Xic			 ic,
7611ab64890Smrg    XKeyEvent		*event,
7621ab64890Smrg    wchar_t		*buffer,
7631ab64890Smrg    int			 nbytes,
7641ab64890Smrg    KeySym		*keysym,
7651ab64890Smrg    XComposeStatus	*status
7661ab64890Smrg);
7671ab64890Smrg
7681ab64890Smrgextern int	_XimLookupUTF8Text(
7691ab64890Smrg    Xic			 ic,
7701ab64890Smrg    XKeyEvent		*event,
7711ab64890Smrg    char		*buffer,
7721ab64890Smrg    int			 nbytes,
7731ab64890Smrg    KeySym		*keysym,
7741ab64890Smrg    XComposeStatus	*status
7751ab64890Smrg);
7761ab64890Smrg
7771ab64890Smrgextern EVENTMASK	_XimGetWindowEventmask(
7781ab64890Smrg    Xic		 ic
7791ab64890Smrg);
7801ab64890Smrg
7811ab64890Smrgextern Xic	_XimICOfXICID(
7821ab64890Smrg    Xim		im,
7831ab64890Smrg    XICID	icid
7841ab64890Smrg);
7851ab64890Smrg
7861ab64890Smrgextern void	_XimResetIMInstantiateCallback(
7871ab64890Smrg    Xim         xim
7881ab64890Smrg);
7891ab64890Smrg
7901ab64890Smrgextern Bool	_XimRegisterIMInstantiateCallback(
7911ab64890Smrg    XLCd	 lcd,
7921ab64890Smrg    Display	*display,
7931ab64890Smrg    XrmDatabase	 rdb,
7941ab64890Smrg    char	*res_name,
7951ab64890Smrg    char	*res_class,
7961ab64890Smrg    XIDProc	 callback,
7971ab64890Smrg    XPointer	 client_data
7981ab64890Smrg);
7991ab64890Smrg
8001ab64890Smrgextern Bool	_XimUnRegisterIMInstantiateCallback(
8011ab64890Smrg    XLCd	 lcd,
8021ab64890Smrg    Display	*display,
8031ab64890Smrg    XrmDatabase	 rdb,
8041ab64890Smrg    char	*res_name,
8051ab64890Smrg    char	*res_class,
8061ab64890Smrg    XIDProc	 callback,
8071ab64890Smrg    XPointer	 client_data
8081ab64890Smrg);
8091ab64890Smrg
8101ab64890Smrgextern void	_XimFreeCommitInfo(
8111ab64890Smrg    Xic		 ic
8121ab64890Smrg);
8131ab64890Smrg
8141ab64890Smrgextern Bool	_XimConnect(
8151ab64890Smrg    Xim		 im
8161ab64890Smrg);
8171ab64890Smrg
8181ab64890Smrgextern Bool	_XimShutdown(
8191ab64890Smrg    Xim		 im
8201ab64890Smrg);
8211ab64890Smrg
8221ab64890Smrgextern Bool	_XimWrite(
8231ab64890Smrg    Xim		 im,
8241ab64890Smrg    INT16	 len,
8251ab64890Smrg    XPointer	 data
8261ab64890Smrg);
8271ab64890Smrg
8281ab64890Smrgextern Bool	_XimRead(
8291ab64890Smrg    Xim		 im,
8301ab64890Smrg    INT16	*len,
8311ab64890Smrg    XPointer	 data,
8321ab64890Smrg    int		 data_len,
8331ab64890Smrg    Bool	 (*predicate)(
8341ab64890Smrg			      Xim, INT16, XPointer, XPointer
8351ab64890Smrg			      ),
8361ab64890Smrg    XPointer	 arg
8371ab64890Smrg);
8381ab64890Smrg
8391ab64890Smrgextern void	_XimFlush(
8401ab64890Smrg    Xim		 im
8411ab64890Smrg);
8421ab64890Smrg
8431ab64890Smrgextern Bool	_XimFilterWaitEvent(
8441ab64890Smrg    Xim		 im
8451ab64890Smrg);
8461ab64890Smrg
8471ab64890Smrgextern void   _XimProcError(
8481ab64890Smrg    Xim		im,
8491ab64890Smrg    Xic		ic,
8501ab64890Smrg    XPointer	data
8511ab64890Smrg);
8521ab64890Smrg
8531ab64890Smrg#ifdef EXT_MOVE
8541ab64890Smrgextern CARD32	_XimExtenArgCheck(
8551ab64890Smrg    XIMArg	*arg
8561ab64890Smrg);
8571ab64890Smrg#endif
8581ab64890Smrg
8591ab64890Smrgextern Bool _XimCbDispatch(
86061b2299dSmrg    Xim im,
86161b2299dSmrg    INT16 len,
86261b2299dSmrg    XPointer data,
8631ab64890Smrg    XPointer call_data
8641ab64890Smrg);
8651ab64890Smrg
8661ab64890Smrgextern Bool _XimLocalFilter(
8671ab64890Smrg    Display		*d,
8681ab64890Smrg    Window		 w,
8691ab64890Smrg    XEvent		*ev,
8701ab64890Smrg    XPointer		 client_data
8711ab64890Smrg);
8721ab64890Smrg
8731ab64890Smrgextern XIMResourceList _XimGetResourceListRecByQuark(
8741ab64890Smrg    XIMResourceList	 res_list,
8751ab64890Smrg    unsigned int	 list_num,
8761ab64890Smrg    XrmQuark		 quark
8771ab64890Smrg);
8781ab64890Smrg
8791ab64890Smrgextern Bool _XimReconnectModeCreateIC(
8801ab64890Smrg    Xic			 ic
8811ab64890Smrg);
8821ab64890Smrg
8831ab64890Smrgextern char *_XimLocalSetICValues(
8841ab64890Smrg    XIC			 ic,
8851ab64890Smrg    XIMArg		*values
8861ab64890Smrg);
8871ab64890Smrg
8881ab64890Smrgextern char * _XimLocalGetICValues(
8891ab64890Smrg    XIC			 ic,
8901ab64890Smrg    XIMArg		*values
8911ab64890Smrg);
8921ab64890Smrg
8931ab64890Smrgextern int _XimLocalMbLookupString(
8941ab64890Smrg    XIC			 ic,
8951ab64890Smrg    XKeyEvent		*ev,
8961ab64890Smrg    char		*buffer,
8971ab64890Smrg    int			 bytes,
8981ab64890Smrg    KeySym		*keysym,
8991ab64890Smrg    Status		*status
9001ab64890Smrg);
9011ab64890Smrg
9021ab64890Smrgextern int _XimLocalWcLookupString(
9031ab64890Smrg    XIC			 ic,
9041ab64890Smrg    XKeyEvent		*ev,
9051ab64890Smrg    wchar_t		*buffer,
9061ab64890Smrg    int			 bytes,
9071ab64890Smrg    KeySym		*keysym,
9081ab64890Smrg    Status		*status
9091ab64890Smrg);
9101ab64890Smrg
9111ab64890Smrgextern int _XimLocalUtf8LookupString(
9121ab64890Smrg    XIC			 ic,
9131ab64890Smrg    XKeyEvent		*ev,
9141ab64890Smrg    char		*buffer,
9151ab64890Smrg    int			 bytes,
9161ab64890Smrg    KeySym		*keysym,
9171ab64890Smrg    Status		*status
9181ab64890Smrg);
9191ab64890Smrg
9201ab64890Smrgextern Bool _XimThaiFilter(
9211ab64890Smrg    Display		*d,
9221ab64890Smrg    Window		 w,
9231ab64890Smrg    XEvent		*ev,
9241ab64890Smrg    XPointer		 client_data
9251ab64890Smrg);
9261ab64890Smrg
9271ab64890Smrgextern XIC _XimThaiCreateIC(
9281ab64890Smrg    XIM			 im,
9291ab64890Smrg    XIMArg		*values
9301ab64890Smrg);
9311ab64890Smrg
9321ab64890Smrgextern Status _XimThaiCloseIM(
9331ab64890Smrg    XIM			 xim
9341ab64890Smrg);
9351ab64890Smrg
9361ab64890Smrg#ifdef XIM_CONNECTABLE
9371ab64890Smrgextern void _XimSetProtoResource(
9381ab64890Smrg    Xim im
9391ab64890Smrg);
9401ab64890Smrg
9411ab64890Smrgextern Bool _XimConnectServer(
9421ab64890Smrg    Xim im
9431ab64890Smrg);
9441ab64890Smrg
9451ab64890Smrgextern Bool _XimDelayModeSetAttr(
9461ab64890Smrg    Xim			 im
9471ab64890Smrg);
9481ab64890Smrg
9491ab64890Smrgextern void	_XimServerReconectableDestroy(
9501ab64890Smrg    void
9511ab64890Smrg);
9521ab64890Smrg
9531ab64890Smrgextern Bool _XimReCreateIC(
9541ab64890Smrg    Xic			ic
9551ab64890Smrg);
9561ab64890Smrg
9571ab64890Smrgextern Bool _XimEncodeSavedIMATTRIBUTE(
9581ab64890Smrg    Xim			 im,
9591ab64890Smrg    XIMResourceList	 res_list,
9601ab64890Smrg    unsigned int	 res_num,
9611ab64890Smrg    int			*idx,
9621ab64890Smrg    char		*buf,
9631ab64890Smrg    int			 size,
9641ab64890Smrg    int			*ret_len,
9651ab64890Smrg    XPointer		 top,
9661ab64890Smrg    unsigned long	 mode
9671ab64890Smrg);
9681ab64890Smrg
9691ab64890Smrgextern Bool _XimEncodeSavedICATTRIBUTE(
9701ab64890Smrg    Xic			 ic,
9711ab64890Smrg    XIMResourceList	 res_list,
9721ab64890Smrg    unsigned int	 res_num,
9731ab64890Smrg    int			*idx,
9741ab64890Smrg    char		*buf,
9751ab64890Smrg    int			 size,
9761ab64890Smrg    int			*ret_len,
9771ab64890Smrg    XPointer		 top,
9781ab64890Smrg    unsigned long	 mode
9791ab64890Smrg);
9801ab64890Smrg#endif
9811ab64890Smrg
982eb411b4bSmrgextern Bool
9831ab64890Smrg_XimRegisterDispatcher(
9841ab64890Smrg    Xim          im,
9851ab64890Smrg    Bool         (*callback)(
9861ab64890Smrg                             Xim, INT16, XPointer, XPointer
9871ab64890Smrg                             ),
9881ab64890Smrg    XPointer     call_data);
9891ab64890Smrg
990eb411b4bSmrgextern Bool
9911ab64890Smrg_XimRespSyncReply(
9921ab64890Smrg    Xic          ic,
9931ab64890Smrg    BITMASK16    mode);
9941ab64890Smrg
9951ab64890Smrg#endif /* _XIMINT_H */
996