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