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