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