*** empty log message ***
[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, the values are minimum line ascent and descent
442       pixels.  */
443   unsigned int min_line_ascent;
444   unsigned int min_line_descent;
445
446   /***en If nonzero, the values are maximum line ascent and descent
447       pixels.  */
448   unsigned int max_line_ascent;
449   unsigned int max_line_descent;
450
451   /***en If nonzero, the value specifies how many pixels each line can
452       occupy on the display.  The value zero means that there is no
453       limit.  It is ignored if <format> is non-NULL.  */
454   unsigned int max_line_width;
455
456   /***en If nonzero, the value specifies the distance between tab
457       stops in columns (the width of one column is the width of a
458       space in the default font of the frame).  The value zero means
459       8.  */
460   unsigned int tab_width;
461
462   /***en If non-NULL, the value is a function that calculates the
463       indentation and width limit of each line based on the line
464       number LINE and the coordinate Y.  The function store the
465       indentation and width limit at the place pointed by INDENT and
466       WIDTH respectively.
467
468       The indentation specifies how many pixels the first glyph of
469       each line is shifted to the right (if the member
470       <orientation_reversed> is zero) or to the left (otherwise).  If
471       the value is negative, each line is shifted to the reverse
472       direction.
473
474       The width limit specifies how many pixels each line can occupy
475       on the display.  The value 0 means that there is no limit.
476
477       LINE and Y are reset to 0 when a line is broken by a newline
478       character, and incremented each time when a long line is broken
479       because of the width limit.
480
481       This has an effect only when <two_dimensional> is nonzero.  */
482   void (*format) (int line, int y, int *indent, int *width);
483
484   /***en If non-NULL, the value is a function that calculates a line
485       breaking position when a line is too long to fit within the
486       width limit.  POS is a position of the character next to the
487       last one that fits within the limit.  FROM is a position of the
488       first character of the line, and TO is a position of the last
489       character displayed on the line if there were not width limit.
490       LINE and Y are the same as the arguments to <format>.
491
492       The function must return a character position to break the
493       line.
494
495       The function should not modify MT.
496
497       The mdraw_default_line_break () function is useful for such a
498       script that uses SPACE as a word separator.  */
499   int (*line_break) (MText *mt, int pos, int from, int to, int line, int y);
500
501   int with_cursor;
502
503   /***en Specifies the character position to display a cursor.  If it
504       is greater than the maximum character position, the cursor is
505       displayed next to the last character of an M-text.  If the value
506       is negative, even if <cursor_width> is nonzero, cursor is not
507       displayed.  */
508   int cursor_pos;
509
510   /***en If nonzero, display a cursor at the character position
511       <cursor_pos>.  If the value is positive, it is the pixel width
512       of the cursor.  If the value is negative, the cursor width is
513       the same as the underlining glyph(s).  */
514   int cursor_width;
515
516   /***en If nonzero and <cursor_width> is also nonzero, display double
517       bar cursors; at the character position <cursor_pos> and at the
518       logically previous character.  Both cursors have one pixel width
519       with horizontal fringes at upper or lower positions.  HOW TO
520       EXPLAIN THE DOUBLE CURSORS?  */
521   int cursor_bidi;
522
523   /***en If nonzero, on drawing partial text, pixels of surrounding
524       texts that intrude into the drawing area are also drawn.  For
525       instance, some CVC sequence of Thai text (C is consonant, V is
526       upper vowel) is drawn so that V is placed over the middle of two
527       Cs.  If this CVC sequence is already drawn and only the last C
528       is drawn again (for instance by updating cursor position), the
529       left half of V is erased if this member is zero.  By setting
530       this member to nonzero, even with such a drawing, we can keep
531       this CVC sequence correctly displayed.  */
532   int partial_update;
533
534   /***en If nonzero, don't cache the result of any drawing information
535       of an M-text.  */
536   int disable_caching;
537
538   /* If non-NULL, limit the drawing effect to the specified region.  */
539   MDrawRegion clip_region;
540
541 } MDrawControl;
542
543 /*=*/
544
545 /*** @ingroup m17nDraw */
546 /***en
547     @brief Type of metric for gylphs and texts.
548
549     The type #MDrawMetric is for a metric of a glyph and a drawn text.
550     It is also used to represent a rectangle area of a graphic
551     device.  */
552
553 typedef struct {
554   int x, y;
555   unsigned int width, height;
556 } MDrawMetric;
557
558 /*=*/
559
560 /*** @ingroup m17nDraw */
561 /***en
562     @brief Type of information about a glyph.
563
564     The type #MDrawGlyphInfo is the structure that contains
565     information about a glyph.  It is used by mdraw_glyph_info ().  */
566
567 typedef struct
568 {
569   /***en Character range corresponding to the glyph.  */
570   int from, to;
571
572   /***en Character ranges corresponding to the line of the glyph.  */
573   int line_from, line_to;
574
575   /***en X/Y coordinates of the glyph.  */
576   int x, y;
577
578   /***en Metric of the glyph.  */
579   MDrawMetric this;
580
581   /***en Font used for the glyph.  Set to NULL if no font is found for
582       the glyph.  */
583   MFont *font;
584
585   /***en Character ranges corresponding to logically previous and next
586       glyphs.  Note that we do not need the members prev_to and
587       next_from because they must be the same as the memberse from and
588       to respectively.  */
589   int prev_from, next_to;
590
591   /***en Character ranges corresponding to visually left and right
592       glyphs. */
593   int left_from, left_to;
594   int right_from, right_to;
595
596 } MDrawGlyphInfo;
597
598 /*=*/
599
600 /***en
601     @brief Type of text items.
602
603     The type #MDrawTextItem is for @e textitem objects.
604     Each textitem contains an M-text and some other information to
605     control the drawing of the M-text.  */
606
607 /***ja
608     @brief textitem Íѹ½Â¤ÂÎ
609
610     ·¿ #MDrawTextItem ¤Ï @e ¥Æ¥­¥¹¥È¥¢¥¤¥Æ¥à ¥ª¥Ö¥¸¥§¥¯¥ÈÍѤι½Â¤ÂΤǤ¢
611     ¤ë¡£³Æ¥Æ¥­¥¹¥È¥¢¥¤¥Æ¥à¤Ï¡¢1¸Ä¤Î M-text ¤È¡¢¤½¤Îɽ¼¨¤òÀ©¸æ¤¹¤ë¤¿¤á
612     ¤Î³Æ¼ï¾ðÊó¤ò´Þ¤ó¤Ç¤¤¤ë¡£
613
614     @latexonly \IPAlabel{MTextItem} @endlatexonly  */
615
616 typedef struct
617 {
618   /***en M-text. */
619   /***ja M-text */
620   MText *mt;                      
621
622   /***en Optional change in the position (in the unit of pixel) along
623       the X-axis before the M-text is drawn.  */
624   /***ja ÉÁ²èÁ°¤Ë¹Ô¤Ê¤¦X¼´Êý¸þ¤Î°ÌÃÖÄ´À° (¥Ô¥¯¥»¥ëñ°Ì) */
625   int delta;                     
626
627   /***en Pointer to a face object.  Each property of the face, if not
628       Mnil, overrides the same property of face(s) specified as a text
629       property in <mt>.  */
630   /***ja ¥Õ¥©¥ó¥È¥»¥Ã¥È¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¡£¤³¤ì¤Ï M-text Æâ¤Ç»Ø
631       Äꤵ¤ì¤¿¥Õ¥§¡¼¥¹¤Î¥Õ¥©¥ó¥È¥»¥Ã¥È¤ËÍ¥À褹¤ë*/
632   MFace *face;
633
634   /***en Pointer to a draw control object.  The M-text <mt> is drawn
635       by mdraw_text_with_control () with this control object.  */
636   MDrawControl *control;
637
638 } MDrawTextItem;
639
640 /*=*/
641
642 extern int mdraw_text (MFrame *frame, MDrawWindow win, int x, int y,
643                        MText *mt, int from, int to);
644
645 extern int mdraw_image_text (MFrame *frame, MDrawWindow win, int x, int y,
646                              MText *mt, int from, int to);
647
648 extern int mdraw_text_with_control (MFrame *frame, MDrawWindow win,
649                                     int x, int y, MText *mt, int from, int to,
650                                     MDrawControl *control);
651
652 extern int mdraw_coordinates_position (MFrame *frame,
653                                        MText *mt, int from, int to,
654                                        int x, int y, MDrawControl *control);
655
656 extern int mdraw_text_extents (MFrame *frame,
657                                MText *mt, int from, int to,
658                                MDrawControl *control,
659                                MDrawMetric *overall_ink_return,
660                                MDrawMetric *overall_logical_return,
661                                MDrawMetric *overall_line_return);
662
663 extern int mdraw_text_per_char_extents (MFrame *frame,
664                                         MText *mt, int from, int to,
665                                         MDrawControl *control,
666                                         MDrawMetric *ink_array_return,
667                                         MDrawMetric *logical_array_return,
668                                         int array_size,
669                                         int *num_chars_return,
670                                         MDrawMetric *overall_ink_return,
671                                         MDrawMetric *overall_logical_return);
672
673 extern int mdraw_glyph_info (MFrame *frame, MText *mt, int from, int pos,
674                              MDrawControl *control, MDrawGlyphInfo *info);
675
676 extern void mdraw_text_items (MFrame *frame, MDrawWindow win, int x, int y,
677                               MDrawTextItem *items, int nitems);
678
679 extern void mdraw_per_char_extents (MFrame *frame, MText *mt,
680                                     MDrawMetric *array_return,
681                                     MDrawMetric *overall_return);
682
683 extern int mdraw_default_line_break (MText *mt, int pos,
684                                      int from, int to, int line, int y);
685
686 extern void mdraw_clear_cache (MText *mt);
687
688 /* end of drawing module */
689 /*=*/
690
691 /*** @ingroup m17nGUI */
692 /***en @defgroup m17nInputMethodWin Input Method (GUI) */
693 /***ja @defgroup m17nInputMethodWin ÆþÎϥ᥽¥Ã¥É (GUI) */
694 /*=*/
695
696 extern MInputDriver minput_gui_driver;
697
698 /*=*/
699 /*** @ingroup m17nInputMethodWin */
700 /***en 
701     @brief Type of the argument to the function minput_create_ic ().
702
703     The type #MInputGUIArgIC is for the argument $ARG of the function
704     minput_create_ic () to create an input context of an internal
705     input method.  */
706
707 /***ja
708     @brief ´Ø¿ô minput_create_ic () ¤Î°ú¿ô $ARG ¤Ç»Ø¤µ¤ì¤ë¹½Â¤ÂÎ
709
710     #MInputGUIArgIC ·¿¤Ï¡¢´Ø¿ô minput_create_ic () ¤¬ÆâÉôÆþÎϥ᥽¥Ã
711     ¥É¤òÀ¸À®¤¹¤ëºÝ¤Ë¡¢°ú¿ô $ARG ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ë¹½Â¤ÂΤǤ¢¤ë¡£  */
712
713 typedef struct
714 {
715   /***en Frame of the client.  */
716   /***ja ¥¯¥é¥¤¥¢¥ó¥È¤Î¥Õ¥ì¡¼¥à  */
717   MFrame *frame;
718
719   /***en Window on which to display the preedit and status text.  */
720   /***ja preedit ¥Æ¥­¥¹¥È¤È status ¥Æ¥­¥¹¥È¤òɽ¼¨¤¹¤ë¥¦¥£¥ó¥É¥¦  */
721   MDrawWindow client;
722
723   /***en Window that the input context has a focus on.  */
724   /***ja ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤¬¥Õ¥©¡¼¥«¥¹¤ò¤ª¤¤¤Æ¤¤¤ë¥¦¥£¥ó¥É¥¦  */
725   MDrawWindow focus;
726 } MInputGUIArgIC;
727
728 /*=*/
729
730 extern MSymbol minput_event_to_key (MFrame *frame, void *event);
731
732 /* end of input module */
733 /*=*/
734 /* end of window modules */
735 /*=*/
736
737 extern MFace *mdebug_dump_face (MFace *face, int indent);
738 extern MFont *mdebug_dump_font (MFont *font);
739 extern MFontset *mdebug_dump_fontset (MFontset *fontset, int indent);
740
741 #ifdef __cplusplus
742 }
743 #endif
744
745 #endif /* _M17N_GUI_H_ */
746
747 /*
748   Local Variables:
749   coding: euc-japan
750   End:
751 */