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