(mplist_deserialize): Extern it.
[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 void 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
61     application code, and its contents depend on the window system in
62     use.  In the m17n-X library, it contains the information about @e
63     display and @e screen in the X Window System.  */
64
65 /***ja
66     @brief ¥Õ¥ì¡¼¥àÍѹ½Â¤ÂÎ
67
68     #MFrame ·¿¤Ï¡¢¥Õ¥ì¡¼¥à¥ª¥Ö¥¸¥§¥¯¥ÈÍѤι½Â¤ÂΤǤ¢¤ë¡£¸Ä¡¹¤Î¥Õ¥ì¡¼
69     ¥à¤Ï¡¢¤½¤ì¤¬Âбþ¤¹¤ëʪÍý¥Ç¥Ð¥¤¥¹¤Î³Æ¼ï¾ðÊó¤òÊÝ»ý¤¹¤ë¡£
70
71     #MFrame ·¿¤ÎÆâÉô¹½Â¤¤Ï¡¢»ÈÍѤ¹¤ë¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¤Ë°Í¸¤·¡¢¤Þ¤¿
72     ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£m17n-X ¥é¥¤¥Ö¥é¥ê¤Ë¤ª¤±
73     ¤ë¥Õ¥ì¡¼¥à¤Ï¡¢X ¥¦¥£¥ó¥É¥¦¤Î display ¤È screen ¤Ë´Ø¤¹¤ë¾ðÊó¤ò»ý¤Ä¡£
74       */
75
76 typedef struct MFrame MFrame;
77
78 /*=*/
79
80 extern MSymbol Mfont;
81 extern MSymbol Mfont_width;
82 extern MSymbol Mfont_ascent;
83 extern MSymbol Mfont_descent;
84 extern MFrame *mframe_default;
85
86 extern MFrame *mframe (MPlist *plist);
87
88 extern void *mframe_get_prop (MFrame *frame, MSymbol key);
89
90 /* end of frame module */
91 /*=*/
92
93 /*** @ingroup m17nGUI  */
94 /***en @defgroup m17nFont Font */
95 /***ja @defgroup m17nFont ¥Õ¥©¥ó¥È */
96 /*=*/
97
98 /*** @ingroup m17nFont */
99 /***en
100     @brief Type of fonts.
101
102     The type #MFont is the structure defining fonts.  It contains
103     information about the following properties of a font: foundry,
104     family, weight, style, stretch, adstyle, registry, size, and
105     resolution.
106
107     This structure is used both for specifying a font in a fontset
108     and for storing information about available system fonts.
109
110     The internal structure is concealed from application code.  */
111
112 /***ja
113     @brief ¥Õ¥©¥ó¥È¤Î¹½Â¤
114
115     #MFont ·¿¤Ï¥Õ¥©¥ó¥È»ØÄêÍѤι½Â¤ÂΤǤ¢¤ê¡¢¥Õ¥©¥ó¥È¤Î¥×¥í
116     ¥Ñ¥Æ¥£¤È¤·¤Æ family, weight, style, stretch, adstyle, registry,
117     size, resolution ¤ò»ý¤Ä¡£
118
119     ¤³¤Î¹½Â¤ÂΤϥե©¥ó¥È¥»¥Ã¥ÈÆâ¤Î¥Õ¥©¥ó¥È¤ò»ØÄꤹ¤ë¾ì¹ç¤È¡¢»ÈÍѲÄǽ¤Ê
120     ¥·¥¹¥Æ¥à¥Õ¥©¥ó¥È¤Î¾ðÊó¤ò³ÊǼ¤¹¤ë¾ì¹ç¤ÎξÊý¤ÇÍѤ¤¤é¤ì¤ë¡£
121
122     ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£  */
123
124 /***
125     @seealso
126     mfont (), mfont_from_name (), mfont_find ().  */
127
128 typedef struct MFont MFont;
129
130 /*=*/
131
132 extern MSymbol Mfont;
133
134 extern MPlist *mfont_freetype_path;
135
136 extern MFont *mfont ();
137
138 extern MFont *mfont_from_name (char *name);
139
140 extern MFont *mfont_copy (MFont *font);
141
142 extern char *mfont_name (MFont *font);
143
144 extern MFont *mfont_from_spec (char *family, char *weight, char *slant,
145                                char *swidth, char *adstyle, char *registry,
146                                unsigned short point, unsigned short res);
147
148 extern MSymbol Mfoundry;
149 extern MSymbol Mfamily;
150 extern MSymbol Mweight;
151 extern MSymbol Mstyle;
152 extern MSymbol Mstretch;
153 extern MSymbol Madstyle;
154 extern MSymbol Mregistry;
155 extern MSymbol Msize;
156 extern MSymbol Mresolution;
157
158 extern void *mfont_get_prop (MFont *font, MSymbol key);
159
160 extern int mfont_put_prop (MFont *font, MSymbol key, void *val);
161
162 extern int mfont_set_encoding (MFont *font,
163                                MSymbol encoding_name, MSymbol repertory_name);
164
165
166 /*=*/
167
168 /***en
169     @brief Find a font.
170
171     The mfont_find () function returns a pointer to the available font
172     that matches best with the specification $SPEC in frame $FRAME.
173
174     $SCORE, if not NULL, must point to a place to store the score
175     value which indicates how well the found font matches $SPEC.  The
176     smaller score means a better match.
177
178     $LIMITED_SIZE, if nonzero, forces the font selector to find a
179     font not greater than the #Msize property of $SPEC.  */
180
181 /***ja
182     @brief ¥Õ¥©¥ó¥È¤òõ¤¹
183
184     ´Ø¿ô mfont_find () ¤Ï¡¢¥Õ¥ì¡¼¥à $FRAME ¾å¤Ç¥Õ¥©¥ó¥ÈÄêµÁ $SPEC ¤Ë¤â¤Ã
185     ¤È¤â¶á¤¤¥Õ¥©¥ó¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£  */
186
187 extern MFont *mfont_find (MFrame *frame, MFont *spec,
188                           int *score, int limited_size);
189
190 extern MSymbol *mfont_selection_priority ();
191
192 extern int mfont_set_selection_priority (MSymbol *keys);
193
194 /* end of font module */
195 /*=*/
196
197 /*** @ingroup m17nGUI  */
198 /***en @defgroup m17nFontset Fontset */
199 /***ja @defgroup m17nFontset ¥Õ¥©¥ó¥È¥»¥Ã¥È */
200 /*=*/
201
202 typedef struct MFontset MFontset;
203
204 extern MFontset *mfontset (char *name);
205
206 extern MSymbol mfontset_name (MFontset *fontset);
207
208 extern MFontset *mfontset_copy (MFontset *fontset, char *name);
209
210 extern int mfontset_modify_entry (MFontset *fontset,
211                                   MSymbol language, MSymbol script,
212                                   MSymbol charset,
213                                   MFont *spec, MSymbol layouter_name,
214                                   int how);
215
216 /* end of fontset module */
217 /*=*/
218
219 /*** @ingroup m17nGUI */
220 /***en @defgroup m17nFace Face */
221 /***ja @defgroup m17nFace ¥Õ¥§¡¼¥¹ */
222 /*=*/
223
224 /*** @ingroup m17nFace */
225 /***en
226     @brief Type of faces.
227
228     The type #MFace is the structure of face objects.  The internal
229     structure is concealed from application code.  */
230
231 /***ja
232     @brief ¥Õ¥§¡¼¥¹Íѹ½Â¤ÂÎ
233
234     #MFace ·¿¤Ï¥Õ¥§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È¤Î¤¿¤á¤Î¹½Â¤ÂΤǤ¢¤ë¡£ÆâÉô¹½Â¤¤Ï
235     ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£  */
236
237 typedef struct MFace MFace;
238 /*=*/
239
240 extern MSymbol Mforeground;
241 extern MSymbol Mbackground;
242 extern MSymbol Mvideomode;
243 extern MSymbol Mnormal;
244 extern MSymbol Mreverse;
245 extern MSymbol Mhline;
246 extern MSymbol Mbox;
247 extern MSymbol Mfontset;
248 extern MSymbol Mratio;
249 extern MSymbol Mhook_func;
250 extern MSymbol Mhook_arg;
251
252 /* Predefined faces.  */
253 extern MFace *mface_normal_video;
254 extern MFace *mface_reverse_video;
255 extern MFace *mface_underline;
256 extern MFace *mface_medium;
257 extern MFace *mface_bold;
258 extern MFace *mface_italic;
259 extern MFace *mface_bold_italic;
260 extern MFace *mface_xx_small;
261 extern MFace *mface_x_small;
262 extern MFace *mface_small;
263 extern MFace *mface_normalsize;
264 extern MFace *mface_large;
265 extern MFace *mface_x_large;
266 extern MFace *mface_xx_large;
267 extern MFace *mface_black;
268 extern MFace *mface_white;
269 extern MFace *mface_red;
270 extern MFace *mface_green;
271 extern MFace *mface_blue;
272 extern MFace *mface_cyan;
273 extern MFace *mface_yellow;
274 extern MFace *mface_magenta;
275
276 /* etc */
277 extern MSymbol Mface;
278
279 extern MFace *mface ();
280
281 extern MFace *mface_copy (MFace *face);
282
283 extern MFace *mface_merge (MFace *dst, MFace *src);
284
285 extern MFace *mface_from_font (MFont *font);
286
287 /*=*/
288
289 /*** @ingroup m17nFace */
290 /***en
291     @brief Type of horizontal line spec of face.
292
293     The type #MFaceHLineProp is to specify the detail of #Mhline
294     property of a face.  The value of the property must be a pointer
295     to an object of this type.  */
296
297 typedef struct
298 {
299   /***en Type of the horizontal line.  */
300   enum MFaceHLineType
301     {
302       MFACE_HLINE_BOTTOM,      
303       MFACE_HLINE_UNDER,
304       MFACE_HLINE_STRIKE_THROUGH,
305       MFACE_HLINE_OVER,
306       MFACE_HLINE_TOP
307     } type;
308
309   /***en Width of the line in pixels.  */
310   unsigned width;
311
312   /***en Color of the line.  If the value is Mnil, foreground color of
313       a merged face is used.  */
314   MSymbol color;
315 } MFaceHLineProp;
316 /*=*/
317
318 /*** @ingroup m17nFace */
319 /***en
320     @brief Type of box spec of face.
321
322     The type #MFaceBoxProp is to specify the detail of #Mbox property
323     of a face.  The value of the property must be a pointer to an
324     object of this type.  */
325
326 typedef struct
327 {
328   /***en Width of the box line in pixels.  */
329   unsigned width;
330
331   MSymbol color_top;
332   MSymbol color_bottom;
333   MSymbol color_left;
334   MSymbol color_right;
335
336   unsigned inner_hmargin;
337   unsigned inner_vmargin;
338   unsigned outer_hmargin;
339   unsigned outer_vmargin;
340
341 } MFaceBoxProp;
342 /*=*/
343
344 /*** @ingroup m17nFace */
345 /***en
346     @brief Type of hook function of face.
347
348     The type #MFaceHookFunc is to specify the #Mhook property of a
349     face.  The value of the property must be function of this
350     type.  */
351 typedef void *(*MFaceHookFunc) (MFace *face, void *arg, void *info);
352 /*=*/
353
354 extern void *mface_get_prop (MFace *face, MSymbol key);
355
356 extern int mface_put_prop (MFace *face, MSymbol key, void *val);
357
358 extern void mface_update (MFrame *frame, MFace *face);
359
360 /* end of face module */
361 /*=*/
362
363 /*** @ingroup m17nGUI */
364 /***en @defgroup m17nDraw Drawing */
365 /***ja @defgroup m17nDraw É½¼¨ */
366 /*=*/
367
368 /*** @ingroup m17nDraw */
369 /***en
370     @brief Window system dependent type for a window.
371
372     The type MDrawWindow is for a window; a rectangular area that
373     works in several ways like a miniature screen.
374
375     What it actually points depends on a window system.  A program
376     that uses the m17n-X library must coerce the type @c Drawable to
377     this type.  */
378
379 /***ja ¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¤Ë°Í¸¤¹¤ë¡¢¥¦¥£¥ó¥É¥¦¤òɽ¤¹¥ª¥Ö¥¸¥§¥¯¥ÈÍѤη¿¡£
380
381        m17n X ¥é¥¤¥Ö¥é¥ê¤Ç¤Ï¡¢@c Window ·¿¤ÈƱ¤¸.  */
382
383 typedef void *MDrawWindow;
384 /*=*/
385
386 /*** @ingroup m17nDraw */
387 /***en
388     @brief Window system dependent type for a region.
389
390     The type MDrawRegion is for a region; an arbitrary set of pixels
391     on the screen (typically a rectangular area).
392
393     What it actually points depends on a window system.  A program
394     that uses the m17n-X library must coerce the type @c Region to
395     this type.  */
396
397 typedef void *MDrawRegion;
398 /*=*/
399
400 /*** @ingroup m17nDraw */
401 /***en
402     @brief Type of a text drawing control.
403
404     The type #MDrawControl is the structure that controls how to draw
405     an M-text.  */
406
407 typedef struct
408 {
409   /***en If nonzero, draw an M-text as image, i.e. with background
410       filled with background colors of faces put on the M-text.
411       Otherwise, the background is not changed.  */
412   unsigned as_image : 1;
413
414   /***en If nonzero and the first glyph of each line has negative
415       lbearing, shift glyphs horizontally to right so that no pixel is
416       drawn to the left of the specified position.  */
417   unsigned align_head : 1;
418
419   /***en If nonzero, draw an M-text two-dimensionally, i.e., newlines
420       in M-text breaks lines and the following characters are drawn in
421       the next line.  If <format> is non-NULL, and the function
422       returns nonzero line width, a line longer than that width is
423       also broken.  */
424   unsigned two_dimensional : 1;
425
426   /***en If nonzero, draw an M-text to the right of a specified
427       position.  */
428   unsigned orientation_reversed : 1;
429
430   /***en If nonzero, reorder glyphs correctly for bidi text.  */
431   unsigned enable_bidi : 1;
432
433   /***en If nonzero, don't draw characters whose general category (in
434       Unicode) is Cf (Other, format).  */
435   unsigned ignore_formatting_char : 1;
436
437   /***en If nonzero, draw glyphs suitable for a terminal.  Not yet
438       implemented.  */
439   unsigned fixed_width : 1;
440
441   /***en If nonzero, draw glyphs with anti-aliasing if a backend font
442       driver supports it.  */
443   unsigned anti_alias : 1;
444
445   /***en If nonzero, the values are minimum line ascent and descent
446       pixels.  */
447   unsigned int min_line_ascent;
448   unsigned int min_line_descent;
449
450   /***en If nonzero, the values are maximum line ascent and descent
451       pixels.  */
452   unsigned int max_line_ascent;
453   unsigned int max_line_descent;
454
455   /***en If nonzero, the value specifies how many pixels each line can
456       occupy on the display.  The value zero means that there is no
457       limit.  It is ignored if <format> is non-NULL.  */
458   unsigned int max_line_width;
459
460   /***en If nonzero, the value specifies the distance between tab
461       stops in columns (the width of one column is the width of a
462       space in the default font of the frame).  The value zero means
463       8.  */
464   unsigned int tab_width;
465
466   /***en If non-NULL, the value is a function that calculates the
467       indentation and width limit of each line based on the line
468       number LINE and the coordinate Y.  The function store the
469       indentation and width limit at the place pointed by INDENT and
470       WIDTH respectively.
471
472       The indentation specifies how many pixels the first glyph of
473       each line is shifted to the right (if the member
474       <orientation_reversed> is zero) or to the left (otherwise).  If
475       the value is negative, each line is shifted to the reverse
476       direction.
477
478       The width limit specifies how many pixels each line can occupy
479       on the display.  The value 0 means that there is no limit.
480
481       LINE and Y are reset to 0 when a line is broken by a newline
482       character, and incremented each time when a long line is broken
483       because of the width limit.
484
485       This has an effect only when <two_dimensional> is nonzero.  */
486   void (*format) (int line, int y, int *indent, int *width);
487
488   /***en If non-NULL, the value is a function that calculates a line
489       breaking position when a line is too long to fit within the
490       width limit.  POS is a position of the character next to the
491       last one that fits within the limit.  FROM is a position of the
492       first character of the line, and TO is a position of the last
493       character displayed on the line if there were not width limit.
494       LINE and Y are the same as the arguments to <format>.
495
496       The function must return a character position to break the
497       line.
498
499       The function should not modify MT.
500
501       The mdraw_default_line_break () function is useful for such a
502       script that uses SPACE as a word separator.  */
503   int (*line_break) (MText *mt, int pos, int from, int to, int line, int y);
504
505   int with_cursor;
506
507   /***en Specifies the character position to display a cursor.  If it
508       is greater than the maximum character position, the cursor is
509       displayed next to the last character of an M-text.  If the value
510       is negative, even if <cursor_width> is nonzero, cursor is not
511       displayed.  */
512   int cursor_pos;
513
514   /***en If nonzero, display a cursor at the character position
515       <cursor_pos>.  If the value is positive, it is the pixel width
516       of the cursor.  If the value is negative, the cursor width is
517       the same as the underlining glyph(s).  */
518   int cursor_width;
519
520   /***en If nonzero and <cursor_width> is also nonzero, display double
521       bar cursors; at the character position <cursor_pos> and at the
522       logically previous character.  Both cursors have one pixel width
523       with horizontal fringes at upper or lower positions.  HOW TO
524       EXPLAIN THE DOUBLE CURSORS?  */
525   int cursor_bidi;
526
527   /***en If nonzero, on drawing partial text, pixels of surrounding
528       texts that intrude into the drawing area are also drawn.  For
529       instance, some CVC sequence of Thai text (C is consonant, V is
530       upper vowel) is drawn so that V is placed over the middle of two
531       Cs.  If this CVC sequence is already drawn and only the last C
532       is drawn again (for instance by updating cursor position), the
533       left half of V is erased if this member is zero.  By setting
534       this member to nonzero, even with such a drawing, we can keep
535       this CVC sequence correctly displayed.  */
536   int partial_update;
537
538   /***en If nonzero, don't cache the result of any drawing information
539       of an M-text.  */
540   int disable_caching;
541
542   /* If non-NULL, limit the drawing effect to the specified region.  */
543   MDrawRegion clip_region;
544
545 } MDrawControl;
546
547 /*=*/
548
549 /*** @ingroup m17nDraw */
550 /***en
551     @brief Type of metric for gylphs and texts.
552
553     The type #MDrawMetric is for a metric of a glyph and a drawn text.
554     It is also used to represent a rectangle area of a graphic
555     device.  */
556
557 typedef struct {
558   int x, y;
559   unsigned int width, height;
560 } MDrawMetric;
561
562 /*=*/
563
564 /*** @ingroup m17nDraw */
565 /***en
566     @brief Type of information about a glyph.
567
568     The type #MDrawGlyphInfo is the structure that contains
569     information about a glyph.  It is used by mdraw_glyph_info ().  */
570
571 typedef struct
572 {
573   /***en Character range corresponding to the glyph.  */
574   int from, to;
575
576   /***en Character ranges corresponding to the line of the glyph.  */
577   int line_from, line_to;
578
579   /***en X/Y coordinates of the glyph.  */
580   int x, y;
581
582   /***en Metric of the glyph.  */
583   MDrawMetric this;
584
585   /***en Font used for the glyph.  Set to NULL if no font is found for
586       the glyph.  */
587   MFont *font;
588
589   /***en Character ranges corresponding to logically previous and next
590       glyphs.  Note that we do not need the members prev_to and
591       next_from because they must be the same as the memberse from and
592       to respectively.  */
593   int prev_from, next_to;
594
595   /***en Character ranges corresponding to visually left and right
596       glyphs. */
597   int left_from, left_to;
598   int right_from, right_to;
599
600 } MDrawGlyphInfo;
601
602 /*=*/
603
604 /***en
605     @brief Type of text items.
606
607     The type #MDrawTextItem is for @e textitem objects.
608     Each textitem contains an M-text and some other information to
609     control the drawing of the M-text.  */
610
611 /***ja
612     @brief textitem Íѹ½Â¤ÂÎ
613
614     ·¿ #MDrawTextItem ¤Ï @e ¥Æ¥­¥¹¥È¥¢¥¤¥Æ¥à ¥ª¥Ö¥¸¥§¥¯¥ÈÍѤι½Â¤ÂΤǤ¢
615     ¤ë¡£³Æ¥Æ¥­¥¹¥È¥¢¥¤¥Æ¥à¤Ï¡¢1¸Ä¤Î M-text ¤È¡¢¤½¤Îɽ¼¨¤òÀ©¸æ¤¹¤ë¤¿¤á
616     ¤Î³Æ¼ï¾ðÊó¤ò´Þ¤ó¤Ç¤¤¤ë¡£
617
618     @latexonly \IPAlabel{MTextItem} @endlatexonly  */
619
620 typedef struct
621 {
622   /***en M-text. */
623   /***ja M-text */
624   MText *mt;                      
625
626   /***en Optional change in the position (in the unit of pixel) along
627       the X-axis before the M-text is drawn.  */
628   /***ja ÉÁ²èÁ°¤Ë¹Ô¤Ê¤¦X¼´Êý¸þ¤Î°ÌÃÖÄ´À° (¥Ô¥¯¥»¥ëñ°Ì) */
629   int delta;                     
630
631   /***en Pointer to a face object.  Each property of the face, if not
632       Mnil, overrides the same property of face(s) specified as a text
633       property in <mt>.  */
634   /***ja ¥Õ¥©¥ó¥È¥»¥Ã¥È¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¡£¤³¤ì¤Ï M-text Æâ¤Ç»Ø
635       Äꤵ¤ì¤¿¥Õ¥§¡¼¥¹¤Î¥Õ¥©¥ó¥È¥»¥Ã¥È¤ËÍ¥À褹¤ë*/
636   MFace *face;
637
638   /***en Pointer to a draw control object.  The M-text <mt> is drawn
639       by mdraw_text_with_control () with this control object.  */
640   MDrawControl *control;
641
642 } MDrawTextItem;
643
644 /*=*/
645
646 extern int mdraw_text (MFrame *frame, MDrawWindow win, int x, int y,
647                        MText *mt, int from, int to);
648
649 extern int mdraw_image_text (MFrame *frame, MDrawWindow win, int x, int y,
650                              MText *mt, int from, int to);
651
652 extern int mdraw_text_with_control (MFrame *frame, MDrawWindow win,
653                                     int x, int y, MText *mt, int from, int to,
654                                     MDrawControl *control);
655
656 extern int mdraw_coordinates_position (MFrame *frame,
657                                        MText *mt, int from, int to,
658                                        int x, int y, MDrawControl *control);
659
660 extern int mdraw_text_extents (MFrame *frame,
661                                MText *mt, int from, int to,
662                                MDrawControl *control,
663                                MDrawMetric *overall_ink_return,
664                                MDrawMetric *overall_logical_return,
665                                MDrawMetric *overall_line_return);
666
667 extern int mdraw_text_per_char_extents (MFrame *frame,
668                                         MText *mt, int from, int to,
669                                         MDrawControl *control,
670                                         MDrawMetric *ink_array_return,
671                                         MDrawMetric *logical_array_return,
672                                         int array_size,
673                                         int *num_chars_return,
674                                         MDrawMetric *overall_ink_return,
675                                         MDrawMetric *overall_logical_return);
676
677 extern int mdraw_glyph_info (MFrame *frame, MText *mt, int from, int pos,
678                              MDrawControl *control, MDrawGlyphInfo *info);
679
680 extern void mdraw_text_items (MFrame *frame, MDrawWindow win, int x, int y,
681                               MDrawTextItem *items, int nitems);
682
683 extern void mdraw_per_char_extents (MFrame *frame, MText *mt,
684                                     MDrawMetric *array_return,
685                                     MDrawMetric *overall_return);
686
687 extern int mdraw_default_line_break (MText *mt, int pos,
688                                      int from, int to, int line, int y);
689
690 extern void mdraw_clear_cache (MText *mt);
691
692 /* end of drawing module */
693 /*=*/
694
695 /*** @ingroup m17nGUI */
696 /***en @defgroup m17nInputMethodWin Input Method (GUI) */
697 /***ja @defgroup m17nInputMethodWin ÆþÎϥ᥽¥Ã¥É (GUI) */
698 /*=*/
699
700 extern MInputDriver minput_gui_driver;
701
702 /*=*/
703 /*** @ingroup m17nInputMethodWin */
704 /***en 
705     @brief Type of the argument to the function minput_create_ic ().
706
707     The type #MInputGUIArgIC is for the argument $ARG of the function
708     minput_create_ic () to create an input context of an internal
709     input method.  */
710
711 /***ja
712     @brief ´Ø¿ô minput_create_ic () ¤Î°ú¿ô $ARG ¤Ç»Ø¤µ¤ì¤ë¹½Â¤ÂÎ
713
714     #MInputGUIArgIC ·¿¤Ï¡¢´Ø¿ô minput_create_ic () ¤¬ÆâÉôÆþÎϥ᥽¥Ã
715     ¥É¤òÀ¸À®¤¹¤ëºÝ¤Ë¡¢°ú¿ô $ARG ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ë¹½Â¤ÂΤǤ¢¤ë¡£  */
716
717 typedef struct
718 {
719   /***en Frame of the client.  */
720   /***ja ¥¯¥é¥¤¥¢¥ó¥È¤Î¥Õ¥ì¡¼¥à  */
721   MFrame *frame;
722
723   /***en Window on which to display the preedit and status text.  */
724   /***ja preedit ¥Æ¥­¥¹¥È¤È status ¥Æ¥­¥¹¥È¤òɽ¼¨¤¹¤ë¥¦¥£¥ó¥É¥¦  */
725   MDrawWindow client;
726
727   /***en Window that the input context has a focus on.  */
728   /***ja ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤¬¥Õ¥©¡¼¥«¥¹¤ò¤ª¤¤¤Æ¤¤¤ë¥¦¥£¥ó¥É¥¦  */
729   MDrawWindow focus;
730 } MInputGUIArgIC;
731
732 /*=*/
733
734 extern MSymbol minput_event_to_key (MFrame *frame, void *event);
735
736 /* end of input module */
737 /*=*/
738 /* end of window modules */
739 /*=*/
740
741 extern MFace *mdebug_dump_face (MFace *face, int indent);
742 extern MFont *mdebug_dump_font (MFont *font);
743 extern MFontset *mdebug_dump_fontset (MFontset *fontset, int indent);
744
745 #ifdef __cplusplus
746 }
747 #endif
748
749 #endif /* _M17N_GUI_H_ */
750
751 /*
752   Local Variables:
753   coding: euc-japan
754   End:
755 */