4bc4c3e173ca69a806d6ada8337cc16cb4b9b936
[m17n/m17n-lib.git] / src / m17n-X.h
1 /* m17n-X.h -- header file for the GUI API on X Windows.
2    Copyright (C) 2003, 2004
3      National Institute of Advanced Industrial Science and Technology (AIST)
4      Registration Number H15PRO112
5
6    This file is part of the m17n library.
7
8    The m17n library is free software; you can redistribute it and/or
9    modify it under the terms of the GNU Lesser General Public License
10    as published by the Free Software Foundation; either version 2.1 of
11    the License, or (at your option) any later version.
12
13    The m17n library is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    Lesser General Public License for more details.
17
18    You should have received a copy of the GNU Lesser General Public
19    License along with the m17n library; if not, write to the Free
20    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21    02111-1307, USA.  */
22
23 #ifndef _M17N_X_H_
24 #define _M17N_X_H_
25
26 #include <X11/Xlib.h>
27 #include <X11/Xutil.h>
28 #include <X11/Xresource.h>
29
30 #ifndef _M17N_GUI_H_
31 #include <m17n-gui.h>
32 #endif
33
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38
39 extern int m17n_init_X (void);
40 #undef M17N_INIT_X
41 #define M17N_INIT_X() m17n_init_X ()
42
43 #undef M17N_INIT
44 #define M17N_INIT()                     \
45   do {                                  \
46     if (m17n_init_win () < 0) break;    \
47     if (M17N_INIT_GD () < 0) break;     \
48     M17N_INIT_X ();                     \
49   } while (0)
50
51 /* For inputting.  */
52
53 extern MInputDriver minput_xim_driver;
54 extern MSymbol Mxim;
55
56 /*** @ingroup m17nInputMethodWin */
57 /***en
58     @brief Structure pointed to by the argument $ARG of the function minput_open_im ().
59
60     The type #MInputXIMArgIM is the structure pointed to by the
61     argument $ARG of the function minput_open_im () for the foreign
62     input method of name #Mxim.  */
63
64 /***ja
65     @brief ´Ø¿ô minput_open_im () ¤Î°ú¿ô $ARG ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ë¹½Â¤ÂÎ.
66
67     #MInputXIMArgIM ·¿¤Ï¡¢´Ø¿ô minput_open_im () ¤¬Ì¾Á° #Mxim ¤ò»ý
68     ¤Ä³°ÉôÆþÎϥ᥽¥Ã¥É¤òÀ¸À®¤¹¤ëºÝ¤Ë°ú¿ô $ARG ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ë¹½Â¤ÂΤÇ
69     ¤¢¤ë¡£  */
70
71 typedef struct
72 {
73   /***en The meaning of the following four members are the same as
74       arguments to XOpenIM ().  */
75   /***ja °Ê²¼¤Î£´¤Ä¤Î¥á¥ó¥Ð¤Î°ÕÌ£¤Ï¡¢XOpenIM () ¤Î°ú¿ô¤Î°ÕÌ£¤ÈƱ¤¸¤Ç¤¢
76       ¤ë¡£  */
77
78   /***en Display of the client.  */
79   /***ja ¥¯¥é¥¤¥¢¥ó¥È¤Î¥Ç¥£¥¹¥×¥ì¥¤  */
80   Display *display;
81
82   /***en Pointer to the X resource database.  */
83   /***ja X ¥ê¥½¡¼¥¹¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥Ý¥¤¥ó¥¿  */
84   XrmDatabase db;
85
86   /***en Full class name of the application.  */
87   /***ja ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î´°Á´¤Ê¥¯¥é¥¹Ì¾  */
88   char *res_class;
89
90   /***en Full resource name of the application.  */
91   /***ja ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î´°Á´¤Ê¥ê¥½¡¼¥¹Ì¾  */
92   char *res_name;
93
94   /***en Locale name under which an XIM is opened.  */
95   /***ja XIM¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¥í¥±¡¼¥ë̾  */
96   char *locale;
97
98   /***en Arguments to XSetLocaleModifiers ().  */
99   /***ja XSetLocaleModifiers () ¤Î°ú¿ô  */
100   char *modifier_list;
101 } MInputXIMArgIM;
102
103 /*=*/
104
105 /*** @ingroup m17nInputMethodWin */
106 /***en
107     @brief Structure pointed to by the argument $ARG of the function minput_create_ic ().
108
109     The type #MInputXIMArgIC is the structure pointed to by the
110     argument $ARG of the function minput_create_ic () for the foreign
111     input method of name #Mxim.  */
112
113 /***ja
114     @brief ´Ø¿ô minput_create_ic () ¤Î°ú¿ô $ARG ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ë¹½Â¤ÂÎ.
115
116     #MInputXIMArgIC ·¿¤Ï¡¢´Ø¿ô minput_create_ic () ¤¬Ì¾Á° #Mxim ¤ò
117     »ý¤Ä³°ÉôÆþÎϥ᥽¥Ã¥ÉÍѤ˸ƤФì¤ëºÝ¤Ë¡¢°ú¿ô $ARG ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ë¹½
118     Â¤ÂΤǤ¢¤ë¡£ */
119
120 typedef struct
121 {
122   /***en Used as the arguments of @c XCreateIC following @c
123       XNInputStyle.  If this is zero, ( @c XIMPreeditNothing | @c
124       XIMStatusNothing) is used, and <preedit_attrs> and
125       <status_attrs> are set to @c NULL.  */
126   /***ja @c XCreateIC ¤Î @c XNInputStyle ¤Ë³¤¯°ú¿ô¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
127       ¥¼¥í¤Ê¤é¤Ð¡¢ ( @c XIMPreeditNothing | @c XIMStatusNothing) ¤¬ÍÑ
128       ¤¤¤é¤ì¡¢ <preedit_attrs> ¤È <status_attrs> ¤Ï @c NULL ¤ËÀßÄꤵ¤ì
129       ¤ë¡£ */
130
131   XIMStyle input_style;
132   /***en Used as the argument of @c XCreateIC following @c XNClientWindow.  */
133   /***ja @c XCreateIC ¤Î @c XNClientWindow ¤Ë³¤¯°ú¿ô¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£  */
134
135
136   Window client_win;
137   /***en Used as the argument of @c XCreateIC following @c XNFocusWindow.  */
138   /***ja @c XCreateIC ¤Î @c XNFocusWindow ¤Ë³¤¯°ú¿ô¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£  */
139
140   Window focus_win;
141   /***en If non- @c NULL, used as the argument of @c XCreateIC following
142       @c XNPreeditAttributes.  */
143   /***ja @c NULL¤Ç¤Ê¤±¤ì¤Ð¡¢ @c XCreateIC following ¤Î@c
144       XNPreeditAttributes ¤Ë³¤¯°ú¿ô¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£  */
145
146   XVaNestedList preedit_attrs;
147   /***en If non- @c NULL, used as the argument of @c XCreateIC following
148       @c XNStatusAttributes.  */ 
149   /***ja @c NULL¤Ç¤Ê¤±¤ì¤Ð¡¢ @c XCreateIC following ¤Î @c
150       XNStatusAttributes ¤Ë³¤¯°ú¿ô¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£  */
151
152   XVaNestedList status_attrs;
153 } MInputXIMArgIC;
154 /*=*/
155
156 #ifdef __cplusplus
157 }
158 #endif
159
160 #endif /* not _M17N_X_H_ */
161
162 /*
163   Local Variables:
164   coding: euc-japan
165   End:
166 */