(minput_event_to_key): Delete extern.
[m17n/m17n-lib.git] / src / m17n-gui.h
1 /* m17n-gui.h -- header file for the GUI API of the m17n library.
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_GUI_H_
24 #define _M17N_GUI_H_
25
26 #ifndef _M17N_H_
27 #include <m17n.h>
28 #endif
29
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #endif
34
35 extern void m17n_init_win (void);
36 #undef M17N_INIT
37 #define M17N_INIT() m17n_init_win ()
38
39 extern void m17n_fini_win (void);
40 #undef M17N_FINI
41 #define M17N_FINI() m17n_fini_win ()
42
43 /***en @defgroup m17nGUI GUI API */
44 /***ja @defgroup m17nGUI GUI API */
45 /*=*/
46
47 /*** @ingroup m17nGUI */
48 /***en @defgroup m17nFrame Frame */
49 /***ja @defgroup m17nFrame ¥Õ¥ì¡¼¥à */
50 /*=*/
51
52 /*** @ingroup m17nFrame */
53 /***en
54     @brief Type of frames.
55
56     The type #MFrame is for a @e frame object.  Each frame holds
57     various information about the corresponding physical display/input
58     device.
59
60     The internal structure of the type #MFrame is concealed from an
61     application program, and its contents depend on the window system
62     in use.  In the m17n-X library, it contains the information about
63     @e display and @e screen in the X Window System.  */
64
65 /***ja
66     @brief ¥Õ¥ì¡¼¥à¤Î·¿Àë¸À.
67
68     #MFrame ¤Ï¡¢@e ¥Õ¥ì¡¼¥à ¥ª¥Ö¥¸¥§¥¯¥ÈÍѤη¿¤Ç¤¢¤ë¡£¸Ä¡¹¤Î¥Õ¥ì¡¼¥à¤Ï¡¢
69     ¤½¤ì¤¬Âбþ¤¹¤ëʪÍýŪ¤Êɽ¼¨¡¿ÆþÎϥǥХ¤¥¹¤Î³Æ¼ï¾ðÊó¤òÊÝ»ý¤¹¤ë¡£
70
71     #MFrame ·¿¤ÎÆâÉô¹½Â¤¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£
72     ¤Þ¤¿¤½¤ÎÆâÍƤϻÈÍѤ¹¤ë¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¤Ë°Í¸¤¹¤ë¡£¤Þ¤¿m17n-X ¥é
73     ¥¤¥Ö¥é¥ê¤Ë¤ª¤±¤ë¥Õ¥ì¡¼¥à¤Ï¡¢X ¥¦¥£¥ó¥É¥¦¤Î @e display ¤È @e screen 
74     ¤Ë´Ø¤¹¤ë¾ðÊó¤ò»ý¤Ä¡£
75       */
76
77 typedef struct MFrame MFrame;
78
79 /*=*/
80
81 extern MSymbol Mdevice;
82
83 extern MSymbol Mfont;
84 extern MSymbol Mfont_width;
85 extern MSymbol Mfont_ascent;
86 extern MSymbol Mfont_descent;
87 extern MFrame *mframe_default;
88
89 extern MSymbol Mdisplay;
90 extern MSymbol Mscreen;
91 extern MSymbol Mdrawable;
92 extern MSymbol Mwidget;
93 extern MSymbol Mdepth;
94 extern MSymbol Mcolormap;
95
96 extern MSymbol Mx;
97
98 extern MFrame *mframe (MPlist *plist);
99
100 extern void *mframe_get_prop (MFrame *frame, MSymbol key);
101
102 /* end of frame module */
103 /*=*/
104
105 /*** @ingroup m17nGUI  */
106 /***en @defgroup m17nFont Font */
107 /***ja @defgroup m17nFont ¥Õ¥©¥ó¥È */
108 /*=*/
109
110 /*** @ingroup m17nFont */
111 /***en
112     @brief Type of fonts.
113
114     The type #MFont is the structure defining fonts.  It contains
115     information about the following properties of a font: foundry,
116     family, weight, style, stretch, adstyle, registry, size, and
117     resolution.
118
119     This structure is used both for specifying a font in a fontset
120     and for storing information about available system fonts.
121
122     The internal structure is concealed from an application program.  */
123
124 /***ja
125     @brief ¥Õ¥©¥ó¥È¤Î·¿Àë¸À.
126
127     #MFont ·¿¤Ï¥Õ¥©¥ó¥È»ØÄêÍѤι½Â¤ÂΤǤ¢¤ê¡¢¥Õ¥©¥ó¥È¤Î¥×¥í¥Ñ¥Æ¥£¤Ç¤¢
128     ¤ë foundry, family, weight, style, stretch, adstyle, registry,
129     size, resolution ¤Ë´Ø¤¹¤ë¾ðÊó¤ò´Þ¤à¡£
130
131     ¤³¤Î¹½Â¤ÂΤϥե©¥ó¥È¥»¥Ã¥ÈÆâ¤Î¥Õ¥©¥ó¥È¤ò»ØÄꤹ¤ëºÝ¤È¡¢»ÈÍѲÄǽ¤Ê¥·
132     ¥¹¥Æ¥à¥Õ¥©¥ó¥È¤Î¾ðÊó¤ò³ÊǼ¤¹¤ëºÝ¤ÎξÊý¤ËÍѤ¤¤é¤ì¤ë¡£
133
134     ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£  */
135
136 /***
137     @seealso
138     mfont (), mfont_from_name (), mfont_find ().  */
139
140 typedef struct MFont MFont;
141
142 /*=*/
143
144 extern MSymbol Mfont;
145
146 extern MPlist *mfont_freetype_path;
147
148 extern MFont *mfont ();
149
150 extern MFont *mfont_copy (MFont *font);
151
152 extern MFont *mfont_parse_name (char *name, MSymbol format);
153
154 extern char *mfont_unparse_name (MFont *font, MSymbol format);
155
156 extern MFont *mfont_from_spec (char *family, char *weight, char *slant,
157                                char *swidth, char *adstyle, char *registry,
158                                unsigned short point, unsigned short res);
159
160 /* These two are obsolete (from 1.1.0).  */
161 extern char *mfont_name (MFont *font);
162 extern MFont *mfont_from_name (char *name);
163
164 extern MSymbol Mfoundry;
165 extern MSymbol Mfamily;
166 extern MSymbol Mweight;
167 extern MSymbol Mstyle;
168 extern MSymbol Mstretch;
169 extern MSymbol Madstyle;
170 extern MSymbol Mregistry;
171 extern MSymbol Msize;
172 extern MSymbol Mresolution;
173
174 extern MSymbol Mfontconfig;
175
176 extern void *mfont_get_prop (MFont *font, MSymbol key);
177
178 extern int mfont_put_prop (MFont *font, MSymbol key, void *val);
179
180 extern int mfont_set_encoding (MFont *font,
181                                MSymbol encoding_name, MSymbol repertory_name);
182
183
184 /*=*/
185
186 /***en
187     @brief Find a font.
188
189     The mfont_find () function returns a pointer to the available font
190     that matches best with the specification $SPEC in frame $FRAME.
191
192     $SCORE, if not NULL, must point to a place to store the score
193     value which indicates how well the found font matches $SPEC.  The
194     smaller score means a better match.
195
196     $LIMITED_SIZE, if nonzero, forces the font selector to find a
197     font not greater than the #Msize property of $SPEC.  */
198
199 /***ja
200     @brief ¥Õ¥©¥ó¥È¤òõ¤¹.
201
202     ´Ø¿ô mfont_find () ¤Ï¡¢¥Õ¥ì¡¼¥à $FRAME ¾å¤Ç¥Õ¥©¥ó¥ÈÄêµÁ $SPEC ¤Ë¤â¤Ã
203     ¤È¤â¹çÃפ¹¤ë»ÈÍѲÄǽ¤Ê¥Õ¥©¥ó¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£  
204
205     $SCORE ¤Ï NULL ¤Ç¤¢¤ë¤«¡¢¸«¤Ä¤«¤Ã¤¿¥Õ¥©¥ó¥È¤¬ $SPEC ¤Ë¤É¤ì¤Û¤É¹ç¤Ã
206     ¤Æ¤¤¤ë¤«¤ò¼¨¤¹¥¹¥³¥¢¤òÊݸ¤¹¤ë¾ì½ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£¥¹¥³¥¢¤¬¾®¤µ
207     ¤¤¤Û¤ÉÎɤ¯¹ç¤Ã¤Æ¤¤¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£
208
209     $LIMITED_SIZE ¤¬ 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢$SPEC ¤Î¥×¥í¥Ñ¥Æ¥£ #Msize ¤è¤êÂ礭
210     ¤¯¤Ê¤¤¥Õ¥©¥ó¥È¤À¤±¤¬Ãµ¤µ¤ì¤ë¡£
211 */
212
213 extern MFont *mfont_find (MFrame *frame, MFont *spec,
214                           int *score, int limited_size);
215
216 extern MSymbol *mfont_selection_priority ();
217
218 extern int mfont_set_selection_priority (MSymbol *keys);
219
220 /* end of font module */
221 /*=*/
222
223 /*** @ingroup m17nGUI  */
224 /***en @defgroup m17nFontset Fontset */
225 /***ja @defgroup m17nFontset ¥Õ¥©¥ó¥È¥»¥Ã¥È */
226 /*=*/
227
228 typedef struct MFontset MFontset;
229
230 extern MFontset *mfontset (char *name);
231
232 extern MSymbol mfontset_name (MFontset *fontset);
233
234 extern MFontset *mfontset_copy (MFontset *fontset, char *name);
235
236 extern int mfontset_modify_entry (MFontset *fontset,
237                                   MSymbol language, MSymbol script,
238                                   MSymbol charset,
239                                   MFont *spec, MSymbol layouter_name,
240                                   int how);
241
242 /* end of fontset module */
243 /*=*/
244
245 /*** @ingroup m17nGUI */
246 /***en @defgroup m17nFace Face */
247 /***ja @defgroup m17nFace ¥Õ¥§¡¼¥¹ */
248 /*=*/
249
250 /*** @ingroup m17nFace */
251 /***en
252     @brief Type of faces.
253
254     The type #MFace is the structure of face objects.  The internal
255     structure is concealed from an application program.  */
256
257 /***ja
258     @brief ¥Õ¥§¡¼¥¹¤Î·¿Àë¸À.
259
260     #MFace ·¿¤Ï¥Õ¥§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È¤Î¤¿¤á¤Î¹½Â¤ÂΤǤ¢¤ë¡£ÆâÉô¹½Â¤¤Ï
261     ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£  */
262
263 typedef struct MFace MFace;
264 /*=*/
265
266 extern MSymbol Mforeground;
267 extern MSymbol Mbackground;
268 extern MSymbol Mvideomode;
269 extern MSymbol Mnormal;
270 extern MSymbol Mreverse;
271 extern MSymbol Mhline;
272 extern MSymbol Mbox;
273 extern MSymbol Mfontset;
274 extern MSymbol Mratio;
275 extern MSymbol Mhook_func;
276 extern MSymbol Mhook_arg;
277
278 /* Predefined faces.  */
279 extern MFace *mface_normal_video;
280 extern MFace *mface_reverse_video;
281 extern MFace *mface_underline;
282 extern MFace *mface_medium;
283 extern MFace *mface_bold;
284 extern MFace *mface_italic;
285 extern MFace *mface_bold_italic;
286 extern MFace *mface_xx_small;
287 extern MFace *mface_x_small;
288 extern MFace *mface_small;
289 extern MFace *mface_normalsize;
290 extern MFace *mface_large;
291 extern MFace *mface_x_large;
292 extern MFace *mface_xx_large;
293 extern MFace *mface_black;
294 extern MFace *mface_white;
295 extern MFace *mface_red;
296 extern MFace *mface_green;
297 extern MFace *mface_blue;
298 extern MFace *mface_cyan;
299 extern MFace *mface_yellow;
300 extern MFace *mface_magenta;
301
302 /* etc */
303 extern MSymbol Mface;
304
305 extern MFace *mface ();
306
307 extern MFace *mface_copy (MFace *face);
308
309 extern MFace *mface_merge (MFace *dst, MFace *src);
310
311 extern MFace *mface_from_font (MFont *font);
312
313 /*=*/
314
315 /*** @ingroup m17nFace */
316 /***en
317     @brief Type of horizontal line spec of face.
318
319     The type #MFaceHLineProp is to specify the detail of #Mhline
320     property of a face.  The value of the property must be a pointer
321     to an object of this type.  */
322 /***ja
323     @brief ¥Õ¥§¡¼¥¹¤Î¿åÊ¿Àþ»ØÄêÍÑ·¿Àë¸À.
324
325     #MFaceHLineProp ¤Ï¥Õ¥§¡¼¥¹¤Î #Mhline ¥×¥í¥Ñ¥Æ¥£¤Î¾ÜºÙ¤ò»ØÄꤹ¤ë·¿
326     ¤Ç¤¢¤ë¡£¤³¤Î¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϤ³¤Î·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
327       */
328
329 typedef struct
330 {
331   /***en Type of the horizontal line.  */
332   /***ja ¿åÊ¿Àþ¤Î¥¿¥¤¥×.  */
333   enum MFaceHLineType
334     {
335       MFACE_HLINE_BOTTOM,      
336       MFACE_HLINE_UNDER,
337       MFACE_HLINE_STRIKE_THROUGH,
338       MFACE_HLINE_OVER,
339       MFACE_HLINE_TOP
340     } type;
341
342   /***en Width of the line in pixels.  */
343   /***ja ÀþÉý¡Ê¥Ô¥¯¥»¥ëñ°Ì¡Ë.  */
344   unsigned width;
345
346   /***en Color of the line.  If the value is Mnil, foreground color of
347       a merged face is used.  */
348   /***ja Àþ¤Î¿§.  Mnil ¤Ê¤é¤Ð¡¢Åý¹ç¤·¤¿¥Õ¥§¡¼¥¹¤ÎÁ°·Ê¿§¤¬»È¤ï¤ì¤ë¡£  */
349   
350   MSymbol color;
351 } MFaceHLineProp;
352 /*=*/
353
354 /*** @ingroup m17nFace */
355 /***en
356     @brief Type of box spec of face.
357
358     The type #MFaceBoxProp is to specify the detail of #Mbox property
359     of a face.  The value of the property must be a pointer to an
360     object of this type.  */
361 /***ja
362     @brief ¥Õ¥§¡¼¥¹¤Î°Ï¤ßÏÈ»ØÄêÍÑ·¿Àë¸À.
363
364     #MFaceBoxProp ¤Ï¥Õ¥§¡¼¥¹¤Î #Mbox ¥×¥í¥Ñ¥Æ¥£¤Î¾ÜºÙ¤ò»ØÄꤹ¤ë·¿¤Ç¤¢
365     ¤ë¡£¤³¤Î¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϤ³¤Î·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
366       */
367
368 typedef struct
369 {
370   /***en Width of the box line in pixels.  */
371   /***ja ÀþÉý¡Ê¥Ô¥¯¥»¥ëñ°Ì¡Ë.  */
372   unsigned width;
373
374   MSymbol color_top;
375   MSymbol color_bottom;
376   MSymbol color_left;
377   MSymbol color_right;
378
379   unsigned inner_hmargin;
380   unsigned inner_vmargin;
381   unsigned outer_hmargin;
382   unsigned outer_vmargin;
383
384 } MFaceBoxProp;
385 /*=*/
386
387 /*** @ingroup m17nFace */
388 /***en
389     @brief Type of hook function of face.
390
391     The type #MFaceHookFunc is to specify the #Mhook property of a
392     face.  The value of the property must be function of this
393     type.  */
394 /***ja
395     @brief ¥Õ¥§¡¼¥¹¤Î¥Õ¥Ã¥¯´Ø¿ô¤Î·¿Àë¸À.
396
397     #MFaceHookFunc ¤Ï¥Õ¥§¡¼¥¹¤Î #Mhook ¥×¥í¥Ñ¥Æ¥£¤ò»ØÄꤹ¤ë·¿¤Ç¤¢¤ë¡£
398     ¤³¤Î¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¤³¤Î·¿¤Î´Ø¿ô¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
399       */
400 typedef void (*MFaceHookFunc) (MFace *face, void *arg, void *info);
401 /*=*/
402
403 extern void *mface_get_prop (MFace *face, MSymbol key);
404
405 extern int mface_put_prop (MFace *face, MSymbol key, void *val);
406
407 extern void mface_update (MFrame *frame, MFace *face);
408
409 /* end of face module */
410 /*=*/
411
412 /*** @ingroup m17nGUI */
413 /***en @defgroup m17nDraw Drawing */
414 /***ja @defgroup m17nDraw É½¼¨ */
415 /*=*/
416
417 /*** @ingroup m17nDraw */
418 /***en
419     @brief Window system dependent type for a window.
420
421     The type #MDrawWindow is for a window; a rectangular area that
422     works in several ways like a miniature screen.
423
424     What it actually points depends on a window system.  A program
425     that uses the m17n-X library must coerce the type @c Drawable to
426     this type.  */
427 /***ja 
428     @brief ¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¤Ë°Í¸¤¹¤ë¡¢¥¦¥£¥ó¥É¥¦¤Î·¿Àë¸À.
429
430     #MDrawWindow ¤Ï¥¦¥£¥ó¥É¥¦¡¢¤¹¤Ê¤ï¤Á´ö¤Ä¤«¤ÎÅÀ¤Ç¥¹¥¯¥ê¡¼¥ó¤Î¥ß¥Ë¥Á¥å
431     ¥¢¤È¤·¤ÆƯ¤¯¶ë·ÁÎΰèÍѤη¿¤Ç¤¢¤ë¡£
432
433     ¼ÂºÝ¤Ë²¿¤ò»Ø¤¹¤«¤Ï¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¤Ë°Í¸¤¹¤ë¡£ m17n X ¥é¥¤¥Ö¥é¥ê
434     ¤òÍøÍѤ¹¤ë¥×¥í¥°¥é¥à¤Ï @c Drawable ·¿¤ò¤³¤Î·¿¤ËÊÑ´¹¤·¤Ê¤¯¤Æ¤Ï¤Ê¤é
435     ¤Ê¤¤¡£ */
436
437 typedef void *MDrawWindow;
438 /*=*/
439
440 /*** @ingroup m17nDraw */
441 /***en
442     @brief Window system dependent type for a region.
443
444     The type #MDrawRegion is for a region; an arbitrary set of pixels
445     on the screen (typically a rectangular area).
446
447     What it actually points depends on a window system.  A program
448     that uses the m17n-X library must coerce the type @c Region to
449     this type.  */
450 /***ja
451     @brief ¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¤Ë°Í¸¤¹¤ë¡¢Îΰè¤Î·¿Àë¸À.
452
453     #MDrawRegion ¤ÏÎΰ衢¤¹¤Ê¤ï¤Á¥¹¥¯¥ê¡¼¥ó¾å¤ÎǤ°Õ¤Î¥Ô¥¯¥»¥ë¤Î½¸¹ç
454    ¡Êŵ·¿Åª¤Ë¤Ï¶ë·ÁÎΰè¡ËÍѤη¿¤Ç¤¢¤ë¡£
455
456     ¼ÂºÝ¤Ë²¿¤ò»Ø¤¹¤«¤Ï¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¤Ë°Í¸¤¹¤ë¡£ m17n X ¥é¥¤¥Ö¥é¥ê
457     ¤òÍøÍѤ¹¤ë¥×¥í¥°¥é¥à¤Ï @c Region ·¿¤ò¤³¤Î·¿¤ËÊÑ´¹¤·¤Ê¤¯¤Æ¤Ï¤Ê¤é
458     ¤Ê¤¤¡£  */
459
460 typedef void *MDrawRegion;
461 /*=*/
462
463 /*** @ingroup m17nDraw */
464 /***en
465     @brief Type of a text drawing control.
466
467     The type #MDrawControl is the structure that controls how to draw
468     an M-text.  */
469 /***ja
470     @brief ¥Æ¥­¥¹¥Èɽ¼¨À©¸æ¤Î·¿Àë¸À.
471
472     #MDrawControl ·¿¤Ï¡¢M-text ¤ò¤É¤¦É½¼¨¤¹¤ë¤«¤òÀ©¸æ¤¹¤ë¹½Â¤ÂΤǤ¢¤ë¡£
473       */
474
475
476 typedef struct
477 {
478   /***en If nonzero, draw an M-text as image, i.e. with background
479       filled with background colors of faces put on the M-text.
480       Otherwise, the background is not changed.  */
481   /***ja 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢ M-text ¤ò²èÁü¤È¤·¤Æ¡¢¤¹¤Ê¤ï¤ÁÇطʤò M-text ¤Î
482       ¥Õ¥§¡¼¥¹¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ëÇØ·Ê¿§¤ÇËä¤á¤Æɽ¼¨¤¹¤ë¡£¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÇØ
483       ·Ê¤ÏÊѤï¤é¤Ê¤¤¡£  */
484   unsigned as_image : 1;
485
486   /***en If nonzero and the first glyph of each line has negative
487       lbearing, shift glyphs horizontally to right so that no pixel is
488       drawn to the left of the specified position.  */
489   /***ja 0 ¤Ç¤Ê¤¯¡¢³Æ¹Ô¤ÎºÇ½é¤Î¥°¥ê¥Õ¤Îlbearing ¤¬Éé¤Ê¤é¤Ð¡¢¥°¥ê¥Õ¤ò¿å
490       Ê¿¤Ë±¦¤Ë¤º¤é¤·¤Æ¡¢»ØÄꤷ¤¿°ÌÃÖ¤è¤êº¸¤Ë¥Ô¥¯¥»¥ë¤¬ÉÁ¤«¤ì¤Ê¤¤¤è¤¦¤Ë
491       ¤¹¤ë¡£  */
492   unsigned align_head : 1;
493
494   /***en If nonzero, draw an M-text two-dimensionally, i.e., newlines
495       in M-text breaks lines and the following characters are drawn in
496       the next line.  If <format> is non-NULL, and the function
497       returns nonzero line width, a line longer than that width is
498       also broken.  */
499   /***ja 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢M-text ¤ò£²¼¡¸µÅª¤Ë¡¢¤¹¤Ê¤ï¤ÁM-text Ãæ¤Î 
500       newline ¤Ç²þ¹Ô¤·¡¢Â³¤¯Ê¸»ú¤Ï¼¡¤®¤Î¹Ô¤Ëɽ¼¨¤¹¤ë¡£¤â¤· <format> ¤¬ 
501       NULL ¤Ç¤Ê¤¯¡¢¤½¤Î´Ø¿ô¤¬ 0 ¤Ç¤Ê¤¤¹ÔÉý¤òÊÖ¤»¤Ð¡¢¤½¤ÎÉý¤è¤êŤ¤¹Ô¤â
502       ²þ¹Ô¤µ¤ì¤ë¡£  */
503   unsigned two_dimensional : 1;
504
505   /***en If nonzero, draw an M-text to the right of a specified
506       position.  */
507   /***ja 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢M-text ¤ò»ØÄꤷ¤¿°ÌÃ֤ᦤËɽ¼¨¤¹¤ë¡£  */
508   unsigned orientation_reversed : 1;
509
510   /***en If nonzero, reorder glyphs correctly for bidi text.  */ 
511   /***ja 0 ¤Ê¤±¤ì¤Ð¡¢bidi ¥Æ¥­¥¹¥ÈÍѤ˥°¥ê¥Õ¤òÀµ¤·¤¯À°Î󤹤롣  */
512   unsigned enable_bidi : 1;
513
514   /***en If nonzero, don't draw characters whose general category (in
515       Unicode) is Cf (Other, format).  */
516   /***ja 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢¥æ¥Ë¥³¡¼¥É¤ËÃÖ¤±¤ë°ìÈÌ¥«¥Æ¥´¥ê¤¬ Cf (Other,
517       format) ¤Ç¤¢¤ëʸ»ú¤òɽ¼¨¤·¤Ê¤¤¡£  */
518   unsigned ignore_formatting_char : 1;
519
520   /***en If nonzero, draw glyphs suitable for a terminal.  Not yet
521       implemented.  */
522   /***ja 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢Ã¼ËöÍѤΥ°¥ê¥Õ¤òɽ¼¨¤¹¤ë¡£¡Ê̤¼ÂÁõ¡£¡Ë  */
523   unsigned fixed_width : 1;
524
525   /***en If nonzero, draw glyphs with anti-aliasing if a backend font
526       driver supports it.  */
527   /***ja 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢¥¢¥ó¥Á¥¨¡¼¥ê¥¢¥¹¤Ç¥°¥ê¥Õ¤òɽ¼¨¤¹¤ë¡£¡Ê¥Ð¥Ã¥¯¥¨
528       ¥ó¥É¤Î¥Õ¥©¥ó¥È¥É¥é¥¤¥Ð¤¬¥¢¥ó¥Á¥¨¡¼¥ê¥¢¥¹µ¡Ç½¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¾ì
529       ¹ç¤Î¤ß¡£¡Ë */
530   unsigned anti_alias : 1;
531
532   /***en If nonzero, the values are minimum line ascent and descent
533       pixels.  */
534   /***ja 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢ÃͤϹԤΠascent ¤È descent ¤ÎºÇ¾®Ãͤò¼¨¤¹¡£  */
535   unsigned int min_line_ascent;
536   unsigned int min_line_descent;
537
538   /***en If nonzero, the values are maximum line ascent and descent
539       pixels.  */
540   /***ja 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢ÃͤϹԤΠascent ¤È descent ¤ÎºÇÂçÃͤò¼¨¤¹¡£  */
541   unsigned int max_line_ascent;
542   unsigned int max_line_descent;
543
544   /***en If nonzero, the value specifies how many pixels each line can
545       occupy on the display.  The value zero means that there is no
546       limit.  It is ignored if <format> is non-NULL.  */
547   /***ja 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢ÃͤϤ³¤Î¥Ç¥£¥¹¥×¥ì¥¤¾å¤Ç³Æ¹Ô¤¬Àê¤á¤ë¤³¤È¤Î¤Ç¤­
548       ¤ë¥Ô¥¯¥»¥ë¿ô¤ò¼¨¤¹¡£ 0 ¤Ï¸ÂÄꤵ¤ì¤Ê¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£<format> ¤¬
549       NULL ¤Ç¤Ê¤±¤ì¤Ð̵»ë¤µ¤ì¤ë¡£   */
550   unsigned int max_line_width;
551
552   /***en If nonzero, the value specifies the distance between tab
553       stops in columns (the width of one column is the width of a
554       space in the default font of the frame).  The value zero means
555       8.  */
556   /***ja 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢Ãͤϥ¿¥Ö¥¹¥È¥Ã¥×´Ö¤Îµ÷Î¥¤ò¥³¥é¥àñ°Ì¡Ê¥³¥é¥à¤Ï
557       ¥Õ¥ì¡¼¥à¤Î¥Ç¥Õ¥©¥ë¥È¥Õ¥©¥ó¥È¤Ë¤ª¤±¤ë¶õÇòʸ»ú¤ÎÉý¤Ç¤¢¤ë¡Ë¤Ç¼¨¤¹¡£ 
558       0 ¤Ï 8 ¤ò°ÕÌ£¤¹¤ë¡£ */
559   unsigned int tab_width;
560
561   /***en If non-NULL, the value is a function that calculates the
562       indentation and width limit of each line based on the line
563       number LINE and the coordinate Y.  The function store the
564       indentation and width limit at the place pointed by INDENT and
565       WIDTH respectively.
566
567       The indentation specifies how many pixels the first glyph of
568       each line is shifted to the right (if the member
569       <orientation_reversed> is zero) or to the left (otherwise).  If
570       the value is negative, each line is shifted to the reverse
571       direction.
572
573       The width limit specifies how many pixels each line can occupy
574       on the display.  The value 0 means that there is no limit.
575
576       LINE and Y are reset to 0 when a line is broken by a newline
577       character, and incremented each time when a long line is broken
578       because of the width limit.
579
580       This has an effect only when <two_dimensional> is nonzero.  */
581   /***ja 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢Ãͤϴؿô¤Ç¤¢¤ê¡¢¤½¤Î´Ø¿ô¤Ï¹ÔÈÖ¹æ LINE ¤ÈºÂɸ Y 
582       ¤Ë´ð¤Å¤¤¤Æ³Æ¹Ô¤Î¥¤¥ó¥Ç¥ó¥È¤ÈºÇÂçÉý¤ò·×»»¤·¡¢¤½¤ì¤¾¤ì¤òINDENT ¤È
583       WIDTH ¤Ç»Ø¤µ¤ì¤ë¾ì½ê¤ËÊݸ¤¹¤ë¡£
584
585       ¥¤¥ó¥Ç¥ó¥È¤Ï¡¢³Æ¹Ô¤ÎºÇ½é¤Î¥°¥ê¥Õ¤¬±¦¡Ê¥á¥ó¥Ð 
586       <orientation_reversed> ¤¬ 0 ¤Î»þ¡Ë¤¢¤ë¤¤¤Ïº¸¡Ê¤½¤ì°Ê³°¤Î»þ¡Ë¤Ë²¿
587       ¥Ô¥¯¥»¥ë¤º¤é¤¹¤ò»ØÄꤹ¤ë¡£Ãͤ¬Éé¤Ê¤é¤ÐµÕÊý¸þ¤Ë¤º¤é¤¹¡£
588
589       ºÇÂçÉý¤Ï¡¢³Æ¹Ô¤¬¥Ç¥£¥¹¥×¥ì¥¤¾å¤ÇÀê¤á¤ë¤³¤È¤Î¤Ç¤­¤ë¥Ô¥¯¥»¥ë¿ô¤ÎºÇ
590       ÂçÃͤǤ¢¤ë¡£Ãͤ¬ 0 ¤Î¾ì¹ç¤ÏÀ©¸Â¤ò¼õ¤±¤Ê¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£
591
592       LINE ¤È Y ¤Ï²þ¹Ôʸ»ú¤Ë¤è¤Ã¤Æ¹Ô¤¬²þ¤Þ¤Ã¤¿ºÝ¤Ë¤Ï 0 ¤Ë¥ê¥»¥Ã¥È¤µ¤ì¡¢
593       ºÇÂçÉý¤Ë¤è¤Ã¤Æ¹Ô¤¬²þ¤Þ¤Ã¤¿¾ì¹ç¤Ë¤Ï 1 ¤Å¤ÄÁý¤ä¤µ¤ì¤ë¡£
594
595       ¤³¤ì¤Ï <two_dimensional> ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Î¤ßÍ­¸ú¤Ç¤¢¤ë¡£  */
596   void (*format) (int line, int y, int *indent, int *width);
597
598   /***en If non-NULL, the value is a function that calculates a line
599       breaking position when a line is too long to fit within the
600       width limit.  POS is the position of the character next to the
601       last one that fits within the limit.  FROM is the position of the
602       first character of the line, and TO is the position of the last
603       character displayed on the line if there were not width limit.
604       LINE and Y are the same as the arguments to <format>.
605
606       The function must return a character position to break the
607       line.
608
609       The function should not modify MT.
610
611       The mdraw_default_line_break () function is useful for such a
612       script that uses SPACE as a word separator.  */
613   /***ja NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢ÃͤϹԤ¬ºÇÂçÉýÃæ¤Ë¼ý¤Þ¤é¤Ê¤¤¾ì¹ç¤Ë¹Ô¤ò²þ¤á¤ë
614       °ÌÃÖ¤ò·×»»¤¹¤ë´Ø¿ô¤Ç¤¢¤ë¡£POS ¤ÏºÇÂçÉý¤Ë¼ý¤Þ¤ëºÇ¸å¤Îʸ»ú¤Î¼¡¤Îʸ
615       »ú¤Î°ÌÃ֤Ǥ¢¤ë¡£FROM ¤Ï¹Ô¤ÎºÇ½é¤Îʸ»ú¤Î°ÌÃÖ¡¢TO ¤ÏºÇÂçÉý¤¬»ØÄꤵ
616       ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤½¤Î¹Ô¤Ëɽ¼¨¤µ¤ì¤ëºÇ¸å¤Îʸ»ú¤Î°ÌÃ֤Ǥ¢¤ë¡£LINE ¤È 
617       Y ¤Ï <format> ¤Î°ú¿ô¤ÈƱ¤¸¤Ç¤¢¤ë¡£
618
619       ¤³¤Î´Ø¿ô¤Ï¹Ô¤ò²þ¤á¤ëʸ»ú°ÌÃÖ¤òÊÖ¤µ¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£¤Þ¤¿MT ¤ò
620       Êѹ¹¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
621
622       ´Ø¿ô mdraw_default_line_break () ¤Ï¡¢¶õÇò¤ò¸ì¤Î¶èÀÚ¤ê¤È¤·¤ÆÍѤ¤
623       ¤ë¥¹¥¯¥ê¥×¥ÈÍѤȤ·¤ÆÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£  */
624   int (*line_break) (MText *mt, int pos, int from, int to, int line, int y);
625
626   int with_cursor;
627
628   /***en Specifies the character position to display a cursor.  If it
629       is greater than the maximum character position, the cursor is
630       displayed next to the last character of an M-text.  If the value
631       is negative, even if <cursor_width> is nonzero, cursor is not
632       displayed.  */
633   /***ja ¥«¡¼¥½¥ë¤òɽ¼¨¤¹¤ëʸ»ú°ÌÃÖ¤ò¼¨¤¹¡£ºÇÂç¤Îʸ»ú°ÌÃÖ¤è¤êÂ礭¤±¤ì
634       ¤Ð¡¢¥«¡¼¥½¥ë¤ÏM-text ¤ÎºÇ¸å¤Îʸ»ú¤ÎÎÙ¤Ëɽ¼¨¤µ¤ì¤ë¡£Éé¤Ê¤é¤Ð¡¢
635       <cursor_width> ¤¬ 0 ¤Ç¤Ê¤¯¤Æ¤â¥«¡¼¥½¥ë¤Ïɽ¼¨¤µ¤ì¤Ê¤¤¡£
636         */
637   int cursor_pos;
638
639   /***en If nonzero, display a cursor at the character position
640       <cursor_pos>.  If the value is positive, it is the pixel width
641       of the cursor.  If the value is negative, the cursor width is
642       the same as the underlining glyph(s).  */
643   /***ja 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢<cursor_pos> ¤Ë¥«¡¼¥½¥ë¤òɽ¼¨¤¹¤ë¡£Ãͤ¬Àµ¤Ê¤é¤Ð¡¢
644       ¥«¡¼¥½¥ë¤ÎÉý¤Ï¤½¤ÎÃÍ¡Ê¥Ô¥¯¥»¥ëñ°Ì¡Ë¤Ç¤¢¤ë¡£Éé¤Ê¤é¤Ð¡¢¥«¡¼¥½¥ë¤Î
645       ¤¢¤ë¥°¥ê¥Õ¤ÈƱ¤¸Éý¤Ç¤¢¤ë¡£  */
646   int cursor_width;
647
648   /***en If nonzero and <cursor_width> is also nonzero, display double
649       bar cursors; at the character position <cursor_pos> and at the
650       logically previous character.  Both cursors have one pixel width
651       with horizontal fringes at upper or lower positions.  */
652   /***ja If 0 ¤Ç¤Ê¤¯¡¢¤«¤Ä <cursor_width> ¤â 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢¥Ð¡¼¥«¡¼¥½
653       ¥ë¤òʸ»ú°ÌÃÖ<cursor_pos> ¤ÈÏÀÍýŪ¤Ë¤½¤ì¤ÎÁ°¤Ë¤¢¤ëʸ»ú¤Î£²¥ö½êɽ
654       ¼¨¤¹¤ë¡£ÁÐÊý¤È¤â£±¥Ô¥¯¥»¥ëÉý¤Ç¡¢¾å²¼¤Ë¿åÊ¿¤Î¾þ¤ê¤¬¤Ä¤¯¡£*/
655   int cursor_bidi;
656
657   /***en If nonzero, on drawing partial text, pixels of surrounding
658       texts that intrude into the drawing area are also drawn.  For
659       instance, some CVC sequence of Thai text (C is consonant, V is
660       upper vowel) is drawn so that V is placed over the middle of two
661       Cs.  If this CVC sequence is already drawn and only the last C
662       is drawn again (for instance by updating cursor position), the
663       right half of V is erased if this member is zero.  By setting
664       this member to nonzero, even with such a drawing, we can keep
665       this CVC sequence correctly displayed.  */
666   /***ja 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢¥Æ¥­¥¹¥È¤Î°ìÉôʬ¤òɽ¼¨¤¹¤ëºÝ¤Ë¡¢Á°¸å¤Î¥Æ¥­¥¹¥È
667       ¤Î¤¦¤Á¤½¤Îɽ¼¨Îΰè¤Ë¿¯Æþ¤¹¤ëÉôʬ¤âɽ¼¨¤¹¤ë¡£¤¿¤È¤¨¤Ð¡¢¥¿¥¤¸ìʸ½ñ
668       ¤Î»Ò²»-Êì²»-»Ò²»¤È¤¤¤¦¥·¡¼¥¯¥¨¥ó¥¹¤Î¤¤¤¯¤Ä¤«¤Ï¡¢Êì²»¤¬Æó¤Ä¤Î»Ò²»
669       ¤Î´Ö¤Ë¾å¤Ë¤Î¤ë¤è¤¦¤ËÉÁ¤«¤ì¤ë¡£¤³¤Î¤è¤¦¤Ê¥·¡¼¥¯¥¨¥ó¥¹¤¬¤¹¤Ç¤ËÉÁ¤«
670       ¤ì¤Æ¤ª¤ê¡¢ºÇ¸å¤Î»Ò²»¤À¤±¤òÉÁ¤­Ä¾¤¹¾ì¹ç¡Ê¤¿¤È¤¨¤Ð¡¢¥«¡¼¥½¥ë°ÌÃÖ¤ò
671       ¹¹¿·¤¹¤ëºÝ¤Ê¤É¡Ë¤³¤Î¥á¥ó¥Ð¤¬ 0 ¤Ç¤¢¤ì¤Ð¡¢Êì²»¤Î±¦È¾Ê¬¤¬¾Ã¤µ¤ì¤Æ
672       ¤·¤Þ¤¦¡£¤³¤ì¤ò 0 °Ê³°¤Ë¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢¤½¤Î¤è¤¦¤ÊºÝ¤Ë¤â»Ò²»-Êì
673       ²»-»Ò²»¥·¡¼¥¯¥¨¥ó¥¹¤òÀµ¤·¤¯É½¼¨¤·Â³¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¡£  */
674   int partial_update;
675
676   /***en If nonzero, don't cache the result of any drawing information
677       of an M-text.  */
678   /***ja 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢M-text ¤Îɽ¼¨¤Ë´Ø¤¹¤ë¾ðÊó¤ò¥­¥ã¥Ã¥·¥å¤·¤Ê¤¤¡£
679        */
680   int disable_caching;
681
682   /* If non-NULL, limit the drawing effect to the specified region.  */
683   MDrawRegion clip_region;
684
685 } MDrawControl;
686
687 /*=*/
688
689 /*** @ingroup m17nDraw */
690 /***en
691     @brief Type of metric for gylphs and texts.
692
693     The type #MDrawMetric is for a metric of a glyph and a drawn text.
694     It is also used to represent a rectangle area of a graphic
695     device.  */
696 /***ja
697     @brief ¥°¥ê¥Õ¤È¥Æ¥­¥¹¥È¤ÎÀ£Ë¡¤Î·¿Àë¸À.
698
699     #MDrawMetric ¤Ï¥°¥ê¥Õ¤Èɽ¼¨¤µ¤ì¤¿¥Æ¥­¥¹¥È¤ÎÀ£Ë¡ÍѤη¿¤Ç¤¢¤ë¡£¤Þ¤¿¡¢
700     É½¼¨¥Ç¥Ð¥¤¥¹¤Î¶ë·ÁÎΰè¤òɽ¤¹¤Î¤Ë¤âÍѤ¤¤é¤ì¤ë¡£ */
701
702 typedef struct {
703   int x, y;
704   unsigned int width, height;
705 } MDrawMetric;
706
707 /*=*/
708
709 /*** @ingroup m17nDraw */
710 /***en
711     @brief Type of information about a glyph.
712
713     The type #MDrawGlyphInfo is the structure that contains
714     information about a glyph.  It is used by mdraw_glyph_info ().  */
715 /***ja
716     @brief ¥°¥ê¥Õ¤Ë´Ø¤¹¤ë¾ðÊó¤Î·¿Àë¸À.
717
718     #MDrawGlyphInfo ·¿¤Ï¥°¥ê¥Õ¤Ë´Ø¤¹¤ë¾ðÊó¤ò´Þ¤à¹½Â¤ÂΤǤ¢¤ë¡£
719     mdraw_glyph_info () ¤Ï¤³¤ì¤òÍѤ¤¤ë¡£  */
720
721 typedef struct
722 {
723   /***en Character range corresponding to the glyph.  */
724   /***ja ¥°¥ê¥Õ¤ËÂбþ¤¹¤ëʸ»ú¤ÎÈÏ°Ï.  */
725   int from, to;
726
727   /***en Character ranges corresponding to the line of the glyph.  */
728   /***ja  ¥°¥ê¥Õ¤ÎÎó¤ËÂбþ¤¹¤ëʸ»ú¤ÎÈÏ°Ï.  */
729   int line_from, line_to;
730
731   /***en X/Y coordinates of the glyph.  */
732   /***ja ¥°¥ê¥Õ¤Î X/Y ºÂɸ.  */
733   int x, y;
734
735   /***en Metric of the glyph.  */
736   /***ja ¥°¥ê¥Õ¤ÎÀ£Ë¡.  */
737   MDrawMetric this;
738
739   /***en Font used for the glyph.  Set to NULL if no font is found for
740       the glyph.  */
741   /***ja ¤½¤Î¥°¥ê¥ÕÍѤ˻Ȥï¤ì¤ë¥Õ¥©¥ó¥È¡£¸«¤Ä¤«¤é¤Ê¤±¤ì¤Ð NULL¡£
742       the glyph.  */
743   MFont *font;
744
745   /***en Character ranges corresponding to logically previous and next
746       glyphs.  Note that we do not need the members prev_to and
747       next_from because they must be the same as the members from and
748       to respectively.  */
749   /***ja ÏÀÍýŪ¤ÊÁ°¸å¤Î¥°¥ê¥Õ¤ËÂбþ¤¹¤ëʸ»ú¤ÎÈÏ°Ï¡£¥á¥ó¥Ð prev_to ¤È
750       next_from ¤Ï¡¢¤½¤ì¤¾¤ì¥á¥ó¥Ð from ¤Èto ¤ÈƱ¤¸¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤
751       ¤¿¤áÉÔÍפǤ¢¤ë¤³¤È¤ËÃí°Õ¡£  */
752   int prev_from, next_to;
753
754   /***en Character ranges corresponding to visually left and right
755       glyphs. */
756   /***ja »ë³ÐŪ¤Êº¸±¦¤Î¥°¥ê¥Õ¤ËÂбþ¤¹¤ëʸ»ú¤ÎÈÏ°Ï¡£  */
757   int left_from, left_to;
758   int right_from, right_to;
759
760 } MDrawGlyphInfo;
761
762 /*=*/
763
764 /***en
765     @brief Type of text items.
766
767     The type #MDrawTextItem is for @e textitem objects.
768     Each textitem contains an M-text and some other information to
769     control the drawing of the M-text.  */
770
771 /***ja
772     @brief textitem ¤Î·¿Àë¸À.
773
774     #MDrawTextItem ¤Ï @e ¥Æ¥­¥¹¥È¥¢¥¤¥Æ¥à ¥ª¥Ö¥¸¥§¥¯¥ÈÍѤη¿¤Ç¤¢¤ë¡£³Æ
775     ¥Æ¥­¥¹¥È¥¢¥¤¥Æ¥à¤Ï¡¢1¸Ä¤Î M-text ¤È¡¢¤½¤Îɽ¼¨¤òÀ©¸æ¤¹¤ë¤¿¤á¤Î³Æ¼ï
776     ¾ðÊó¤ò´Þ¤ó¤Ç¤¤¤ë¡£
777
778     @latexonly \IPAlabel{MTextItem} @endlatexonly  */
779
780 typedef struct
781 {
782   /***en M-text. */
783   /***ja M-text. */
784   MText *mt;                      
785
786   /***en Optional change in the position (in the unit of pixel) along
787       the X-axis before the M-text is drawn.  */
788   /***ja M-text É½¼¨Á°¤Ë¹Ô¤Ê¤¦X¼´Êý¸þ¤Î°ÌÃÖÄ´À° (¥Ô¥¯¥»¥ëñ°Ì) */
789   int delta;                     
790
791   /***en Pointer to a face object.  Each property of the face, if not
792       Mnil, overrides the same property of face(s) specified as a text
793       property in <mt>.  */
794   /***ja ¥Õ¥§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¡£¥Õ¥§¡¼¥¹¤Î³Æ¥×¥í¥Ñ¥Æ¥£¤Ï 
795       Mnil ¤Ç¤Ê¤±¤ì¤Ð <mt> ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥§¡¼¥¹¤ÎƱ¤¸¥×¥í¥Ñ¥Æ¥£¤ËÍ¥Àè
796       ¤¹¤ë*/
797   MFace *face;
798
799   /***en Pointer to a draw control object.  The M-text <mt> is drawn
800       by mdraw_text_with_control () with this control object.  */
801   /***ja É½¼¨À©¸æ¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ mdraw_text_with_control () 
802       ¤Ï¤³¤Î¥ª¥Ö¥¸¥§¥¯¥È¤òÍѤ¤¤Æ M-text <mt> ¤òɽ¼¨¤¹¤ë¡£  */
803   MDrawControl *control;
804
805 } MDrawTextItem;
806
807 /*=*/
808
809 extern int mdraw_text (MFrame *frame, MDrawWindow win, int x, int y,
810                        MText *mt, int from, int to);
811
812 extern int mdraw_image_text (MFrame *frame, MDrawWindow win, int x, int y,
813                              MText *mt, int from, int to);
814
815 extern int mdraw_text_with_control (MFrame *frame, MDrawWindow win,
816                                     int x, int y, MText *mt, int from, int to,
817                                     MDrawControl *control);
818
819 extern int mdraw_coordinates_position (MFrame *frame,
820                                        MText *mt, int from, int to,
821                                        int x, int y, MDrawControl *control);
822
823 extern int mdraw_text_extents (MFrame *frame,
824                                MText *mt, int from, int to,
825                                MDrawControl *control,
826                                MDrawMetric *overall_ink_return,
827                                MDrawMetric *overall_logical_return,
828                                MDrawMetric *overall_line_return);
829
830 extern int mdraw_text_per_char_extents (MFrame *frame,
831                                         MText *mt, int from, int to,
832                                         MDrawControl *control,
833                                         MDrawMetric *ink_array_return,
834                                         MDrawMetric *logical_array_return,
835                                         int array_size,
836                                         int *num_chars_return,
837                                         MDrawMetric *overall_ink_return,
838                                         MDrawMetric *overall_logical_return);
839
840 extern int mdraw_glyph_info (MFrame *frame, MText *mt, int from, int pos,
841                              MDrawControl *control, MDrawGlyphInfo *info);
842
843 extern void mdraw_text_items (MFrame *frame, MDrawWindow win, int x, int y,
844                               MDrawTextItem *items, int nitems);
845
846 extern void mdraw_per_char_extents (MFrame *frame, MText *mt,
847                                     MDrawMetric *array_return,
848                                     MDrawMetric *overall_return);
849
850 extern int mdraw_default_line_break (MText *mt, int pos,
851                                      int from, int to, int line, int y);
852
853 extern void mdraw_clear_cache (MText *mt);
854
855 /* end of drawing module */
856 /*=*/
857
858 /*** @ingroup m17nGUI */
859 /***en @defgroup m17nInputMethodWin Input Method (GUI) */
860 /***ja @defgroup m17nInputMethodWin ÆþÎϥ᥽¥Ã¥É (GUI) */
861 /*=*/
862
863 extern MInputDriver minput_gui_driver;
864
865 /*=*/
866 /*** @ingroup m17nInputMethodWin */
867 /***en 
868     @brief Type of the argument to the function minput_create_ic ().
869
870     The type #MInputGUIArgIC is for the argument $ARG of the function
871     minput_create_ic () to create an input context of an internal
872     input method.  */
873
874 /***ja
875     @brief ´Ø¿ô minput_create_ic () ¤Î°ú¿ô¤Î·¿Àë¸À.
876
877     #MInputGUIArgIC ¤Ï¡¢´Ø¿ô minput_create_ic () ¤¬ÆâÉôÆþÎϥ᥽¥Ã¥É¤Î
878     ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤òÀ¸À®¤¹¤ëºÝ¤Î¡¢°ú¿ô $ARG ÍѤη¿¤Ç¤¢¤ë¡£  */
879
880 typedef struct
881 {
882   /***en Frame of the client.  */
883   /***ja ¥¯¥é¥¤¥¢¥ó¥È¤Î¥Õ¥ì¡¼¥à  */
884   MFrame *frame;
885
886   /***en Window on which to display the preedit and status text.  */
887   /***ja preedit ¥Æ¥­¥¹¥È¤È status ¥Æ¥­¥¹¥È¤òɽ¼¨¤¹¤ë¥¦¥£¥ó¥É¥¦  */
888   MDrawWindow client;
889
890   /***en Window that the input context has a focus on.  */
891   /***ja ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤¬¥Õ¥©¡¼¥«¥¹¤ò¤ª¤¤¤Æ¤¤¤ë¥¦¥£¥ó¥É¥¦  */
892   MDrawWindow focus;
893 } MInputGUIArgIC;
894
895
896 /* end of input module */
897 /*=*/
898 /* end of window modules */
899 /*=*/
900
901 extern MFace *mdebug_dump_face (MFace *face, int indent);
902 extern MFont *mdebug_dump_font (MFont *font);
903 extern MFontset *mdebug_dump_fontset (MFontset *fontset, int indent);
904
905 #ifdef __cplusplus
906 }
907 #endif
908
909 #endif /* _M17N_GUI_H_ */
910
911 /*
912   Local Variables:
913   coding: euc-japan
914   End:
915 */