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