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