*** empty log message ***
[m17n/m17n-lib.git] / src / m17n-gui.c
1 /* m17n-gui.c -- body of the GUI API.
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 /***en
24     @addtogroup m17nGUI
25     @brief GUI support for a window system.
26
27     This section defines the m17n GUI API concerning M-text drawing
28     and inputting under a window system.
29
30     All the definitions here are independent of window systems.  An
31     actual library file, however, can depend on a specific window
32     system.  For instance, the library file m17n-X.so is an example of
33     implementation of the m17n GUI API for the X Window System.
34
35     Actually the GUI API is mainly for toolkit libraries or to
36     implement XOM, not for direct use from application programs.
37 */
38
39 /***ja
40     @addtogroup m17nGUI
41     @brief ¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¾å¤Î GUI ¥µ¥Ý¡¼¥È.
42
43     ¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¤Î¤â¤È¤Ç¤Î M-text ¤Îɽ¼¨¤ÈÆþÎϤË
44     ¤«¤«¤ï¤ë m17n GUI API ¤òÄêµÁ¤¹¤ë¡£
45
46     ¤³¤³¤Ç¤Î¤¹¤Ù¤Æ¤ÎÄêµÁ¤Ï¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¤È¤ÏÆÈΩ¤Ç¤¢¤ë¡£¤·¤«¤·¡¢¼Â
47     ºÝ¤Î¥é¥¤¥Ö¥é¥ê¥Õ¥¡¥¤¥ë¤Ï¸ÄÊ̤Υ¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¤Ë°Í¸¤¹¤ë¾ì¹ç¤¬¤¢
48     ¤ë¡£¤¿¤È¤¨¤Ð¥é¥¤¥Ö¥é¥ê¥Õ¥¡¥¤¥ë m17n-X.so ¤Ï¡¢m17n GUI API ¤Î X ¥¦¥£
49     ¥ó¥É¥¦ÍѤμÂÁõÎã¤Ç¤¢¤ë¡£
50
51     ¸½¼Â¤Ë¤Ï¡¢GUI API ¤Ï¼ç¤Ë¥Ä¡¼¥ë¥­¥Ã¥È¥é¥¤¥Ö¥é¥ê¸þ¤±¤Ç¤¢¤ë¤«¡¢¤Þ¤¿¤Ï 
52     XOM ¤ò¼ÂÁõ¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤Æ¤ª¤ê¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é
53     ¤ÎľÀܤÎÍøÍѤòǰƬ¤Ë¤ª¤¤¤¿¤â¤Î¤Ç¤Ï¤Ê¤¤¡£
54 */
55
56 /*=*/
57
58 #if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
59 /*** @addtogroup m17nInternal
60      @{ */
61
62 #include "config.h"
63
64 #include <stdio.h>
65 #include <string.h>
66 #include <stdlib.h>
67
68 #include "m17n-gui.h"
69 #include "m17n-misc.h"
70 #include "internal.h"
71 #include "internal-gui.h"
72 #include "font.h"
73 #include "fontset.h"
74 #include "face.h"
75
76 static int win_initialized;
77
78 static void
79 free_frame (void *object)
80 {
81   MFrame *frame = (MFrame *) object;
82
83   M17N_OBJECT_UNREF (frame->face);
84   mwin__close_device ((MFrame *) object);
85   free (frame->font);
86   free (object);
87 }
88
89 \f
90 /* Internal API */
91
92 /*** @} */ 
93 #endif /* !FOR_DOXYGEN || DOXYGEN_INTERNAL_MODULE */
94
95 \f
96 /* External API */
97
98 void
99 m17n_init_win (void)
100 {
101   int mdebug_mask = MDEBUG_INIT;
102
103   if (win_initialized)
104     return;
105   m17n_init ();
106   if (merror_code != MERROR_NONE)
107     return;
108
109   Mfont = msymbol ("font");
110   Mfont_width = msymbol ("font-width");
111   Mfont_ascent = msymbol ("font-ascent");
112   Mfont_descent = msymbol ("font-descent");
113
114   MDEBUG_PUSH_TIME ();
115   MDEBUG_PUSH_TIME ();
116   if (mfont__init () < 0)
117     goto err;
118   MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize font module."));
119   if (mwin__init () < 0)
120     goto err;
121   MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize win module."));
122   if (mfont__fontset_init () < 0)
123     goto err;
124   MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize fontset module."));
125   if (mface__init () < 0)
126     goto err;
127   MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize face module."));
128   if (mdraw__init () < 0)
129     goto err;
130   MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize draw module."));
131   if (minput__win_init () < 0)
132     goto err;
133   MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize input-win module."));
134   mframe_default = NULL;
135   win_initialized = 1;
136
137  err:
138   MDEBUG_POP_TIME ();
139   MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize the m17n GUI module."));
140   MDEBUG_POP_TIME ();
141   return;
142 }
143
144 void
145 m17n_fini_win (void)
146 {
147   int mdebug_mask = MDEBUG_FINI;
148
149   if (win_initialized)
150     {
151       MDEBUG_PUSH_TIME ();
152       MDEBUG_PUSH_TIME ();
153       MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize input-gui module."));
154       minput__win_fini ();
155       MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize draw module."));
156       mdraw__fini ();
157       MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize face module."));
158       mface__fini ();
159       MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize fontset module."));
160       mfont__fontset_fini ();
161       MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize window module."));
162       mwin__fini ();
163       MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize font module."));
164       mfont__fini ();
165       mframe_default = NULL;
166       MDEBUG_POP_TIME ();
167       MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize the gui modules."));
168       MDEBUG_POP_TIME ();
169       win_initialized = 0;
170     }
171   m17n_fini ();
172 }
173
174 /*** @addtogroup m17nFrame */
175 /***en
176     @brief A @e frame is an object corresponding to the physical device.
177
178     A @e frame is an object of the type #MFrame to hold various
179     information about each physical display/input device.  Almost all
180     m17n GUI functions require a pointer to a frame as an
181     argument.  */
182
183 /***ja
184     @brief @e ¥Õ¥ì¡¼¥à¤È¤ÏʪÍýŪ¥Ç¥Ð¥¤¥¹¤ËÂбþ¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ë.
185
186     @e ¥Õ¥ì¡¼¥à¤È¤Ï #MFrame ·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ê¡¢¸Ä¡¹¤ÎʪÍýŪ¤Êɽ¼¨¡¿
187     ÆþÎϥǥХ¤¥¹¤Î¾ðÊó¤ò³ÊǼ¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£¤Û¤È¤ó¤É¤¹¤Ù¤Æ¤Î 
188     m17n GUI API ¤Ï¡¢°ú¿ô¤È¤·¤Æ¥Õ¥ì¡¼¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÍ׵᤹¤ë¡£  */
189
190 /*** @{ */
191 /*=*/
192
193 /***en
194     @name Variables: Keys of frame property (common).
195 /***ja
196     @name ÊÑ¿ô¡§ ¥Õ¥ì¡¼¥à¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼ (¶¦ÄÌ).
197  */ 
198 /*** @{ */ 
199 /*=*/
200 MSymbol Mfont;
201 MSymbol Mfont_width;
202 MSymbol Mfont_ascent;
203 MSymbol Mfont_descent;
204
205 /*=*/
206 /*** @} */ 
207 /*=*/
208
209 /***en
210     @brief Create a new frame.
211
212     The mframe () function creates a new frame with parameters listed
213     in $PLIST.
214
215     The recognized keys in $PLIST are window system dependent.
216
217     The following key is always recognized.
218
219     <ul>
220
221     <li> #Mface, the value type must be <tt>(MFace *)</tt>.
222
223     The value is used as the default face of the frame.
224
225     </ul>
226
227     In addition, in the m17n-X library, the following keys are
228     recognized.  They are to specify the root window and the depth of
229     drawables that can be used with the frame.
230
231     <ul>
232
233     <li> #Mdrawable, the value type must be <tt>Drawable</tt>
234
235     A parameter of key #Mdisplay must also be specified.  The
236     created frame can be used for drawables whose root window and
237     depth are the same as those of the specified drawable on the
238     specified display.
239
240     When this parameter is specified, the parameter of key #Mscreen
241     is ignored.
242
243     <li> #Mwidget, the value type must be <tt>Widget</tt>.
244
245     The created frame can be used for drawables whose root window and
246     depth are the same as those of the specified widget.
247
248     If a parameter of key #Mface is not specified, the default face
249     is created from the resources of the widget.
250
251     When this parameter is specified, the parameters of key #Mdisplay,
252     #Mscreen, #Mdrawable, #Mdepth are ignored.
253
254     <li> #Mdepth, the value type must be <tt>unsigned</tt>.
255
256     The created frame can be used for drawables of the specified
257     depth.
258
259     <li> #Mscreen, the value type must be <tt>(Screen *)</tt>.
260
261     The created frame can be used for drawables whose root window is
262     the same as the root window of the specified screen, and depth is
263     the same at the default depth of the screen.
264
265     When this parameter is specified, parameter of key #Mdisplay is
266     ignored.
267
268     <li> #Mdisplay, the value type must be <tt>(Display *)</tt>.
269
270     The created frame can be used for drawables whose root window is
271     the same as the root window for the default screen of the display,
272     and depth is the same as the default depth of the screen.
273
274     <li> #Mcolormap, the value type must be <tt>(Colormap)</tt>.
275
276     The created frame uses the specified colormap.
277
278     </ul>
279
280     @return
281     If the operation was successful, mframe () returns a pointer to a
282     newly created frame.  Otherwise, it returns @c NULL.  */
283
284 /***ja
285     @brief ¿·¤·¤¤¥Õ¥ì¡¼¥à¤òºî¤ë.
286
287     ´Ø¿ô mframe () ¤Ï $PLIST Ãæ¤Î¥Ñ¥é¥á¡¼¥¿¤ò»ý¤Ä¿·¤·¤¤¥Õ¥ì¡¼¥à¤òºî¤ë¡£
288
289     $PLIST ¤Ë¸½¤ï¤ì¤ë¥­¡¼¤Î¤¦¤Á¤É¤ì¤¬Ç§¼±¤µ¤ì¤ë¤«¤Ï¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à
290     ¤Ë°Í¸¤¹¤ë¡£¤·¤«¤·°Ê²¼¤Î¥­¡¼¤Ï¾ï¤Ëǧ¼±¤µ¤ì¤ë¡£
291
292     <ul>
293
294     <li> #Mface. ÃͤϠ<tt>(MFace *)</tt> ·¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
295
296     ¤³¤ÎÃͤϥե졼¥à¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥§¡¼¥¹¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
297
298     </ul>
299
300     ¤³¤ì¤Ë²Ã¤¨¤Æ¡¢m17n-X ¥é¥¤¥Ö¥é¥ê¤Ç¤Ï°Ê²¼¤Î¥­¡¼¤âǧ¼±¤¹¤ë¡£¤³¤ì¤é¤Ï
301     ¥ë¡¼¥È¥¦¥£¥ó¥É¥¦¤È¡¢¥Õ¥ì¡¼¥à¤ÇÍøÍѤǤ­¤ë drawable ¤Î¿¼¤µ¤ò»ØÄꤹ¤ë¡£
302
303     <ul>
304
305     <li> #Mdrawable. ÃͤϠ<tt>Drawable</tt> ·¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
306
307     ¥­¡¼ #Mdisplay ¤ò»ý¤Ä¥Ñ¥é¥á¡¼¥¿¤â»ØÄꤵ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£À¸À®¤µ
308     ¤ì¤¿¥Õ¥ì¡¼¥à¤Ï¡¢»ØÄꤵ¤ì¤¿¥Ç¥£¥¹¥×¥ì¥¤¾å¤Î»ØÄꤵ¤ì¤¿ drawable ¤ÈƱ
309     ¤¸¥ë¡¼¥È¥¦¥£¥ó¥É¥¦¤È¿¼¤µ¤ò»ý¤Ä drawable ¤ËÍѤ¤¤é¤ì¤ë¡£
310
311     ¤³¤Î¥Ñ¥é¥á¡¼¥¿¤¬¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢#Mscreen ¤ò¥­¡¼¤È¤¹¤ë¥Ñ¥é¥á¡¼¥¿¤Ï̵
312     »ë¤µ¤ì¤ë¡£
313
314     <li> #Mwidget. ÃͤϠ<tt>Widget</tt> ·¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
315
316     À¸À®¤µ¤ì¤¿¥Õ¥ì¡¼¥à¤Ï¡¢»ØÄꤷ¤¿¥¦¥£¥¸¥§¥Ã¥È¤ÈƱ¤¸¥ë¡¼¥È¥¦¥£¥ó¥É¥¦¤È
317     ¿¼¤µ¤ò»ý¤Ä drawable ¤ËÍѤ¤¤é¤ì¤ë¡£
318
319     ¥­¡¼ #Mface ¤ò»ý¤Ä¥Ñ¥é¥á¡¼¥¿¤¬¤Ê¤±¤ì¤Ð¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥§¡¼¥¹¤Ï¤³¤Î
320     ¥¦¥£¥¸¥§¥Ã¥È¤Î¥ê¥½¡¼¥¹¤«¤éºî¤é¤ì¤ë¡£
321
322     ¤³¤Î¥Ñ¥é¥á¡¼¥¿¤¬¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢#Mdisplay, #Mscreen, #Mdrawable,
323     #Mdepth ¤ò¥­¡¼¤È¤¹¤ë¥Ñ¥é¥á¡¼¥¿¤Ï̵»ë¤µ¤ì¤ë¡£
324
325     <li> #Mdepth. ÃͤϠ<tt>unsigned</tt>  ·¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
326
327     À¸À®¤µ¤ì¤¿¥Õ¥ì¡¼¥à¤Ï¡¢»ØÄꤷ¤¿¿¼¤µ¤Î drawable ¤ËÍѤ¤¤é¤ì¤ë¡£
328
329     <li> #Mscreen. ÃͤϠ<tt>(Screen *)</tt> ·¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
330
331     À¸À®¤·¤¿¥Õ¥ì¡¼¥à¤Ï¡¢»ØÄꤷ¤¿¥¹¥¯¥ê¡¼¥ó¤ÈƱ¤¸¥ë¡¼¥È¥¦¥£¥ó¥É¥¦¤ò»ý¤Á¡¢
332     ¥¹¥¯¥ê¡¼¥ó¤Î¥Ç¥Õ¥©¥ë¥È¤Î¿¼¤µ¤ÈƱ¤¸¿¼¤µ¤ò»ý¤Ä drawable ¤ËÍѤ¤¤é¤ì¤ë¡£
333
334     ¤³¤Î¥Ñ¥é¥á¡¼¥¿¤¬¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢#Mdisplay ¤ò¥­¡¼¤È¤¹¤ë¥Ñ¥é¥á¡¼¥¿¤Ï̵
335     »ë¤µ¤ì¤ë¡£
336
337     <li> #Mdisplay. ÃͤϠ<tt>(Display *)</tt> ·¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
338
339     À¸À®¤µ¤ì¤¿¥Õ¥ì¡¼¥à¤Ï¡¢»ØÄꤷ¤¿¥Ç¥£¥¹¥×¥ì¥¤¤Î¥Ç¥Õ¥©¥ë¥È¥¹¥¯¥ê¡¼¥ó¤È
340     Æ±¤¸¥ë¡¼¥È¥¦¥£¥ó¥É¥¦¤ÈƱ¤¸¿¼¤µ¤ò»ý¤Ädrawables ¤ËÍѤ¤¤é¤ì¤ë¡£
341
342     <li> #Mcolormap. ÃͤϠ<tt>(Colormap)</tt> ·¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
343
344     À¸À®¤µ¤ì¤¿¥Õ¥ì¡¼¥à¤Ï¡¢»ØÄꤷ¤¿¥«¥é¡¼¥Þ¥Ã¥×¤ò»ÈÍѤ¹¤ë¡£
345
346     </ul>
347
348     @return
349     À®¸ù¤¹¤ì¤Ð mframe() ¤Ï¿·¤·¤¤¥Õ¥ì¡¼¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±
350     ¤ì¤Ð @c NULL ¤òÊÖ¤¹¡£  */
351
352 MFrame *
353 mframe (MPlist *plist)
354 {
355   MFrame *frame;
356   MSymbol key;
357
358   M17N_OBJECT (frame, free_frame, MERROR_FRAME);
359   frame->device = mwin__open_device (frame, plist);
360   if (! frame->device)
361     {
362       free (frame);
363       MERROR (MERROR_WIN, NULL);
364     }
365
366   frame->face = mface_from_font (frame->font);
367   frame->face->property[MFACE_FONTSET] = mfontset (NULL);
368   M17N_OBJECT_REF (mface__default->property[MFACE_FONTSET]);
369   if (plist)
370     for (; (key = mplist_key (plist)) != Mnil; plist = mplist_next (plist))
371       if (key == Mface)
372         mface_merge (frame->face, (MFace *) mplist_value (plist));
373
374   frame->rface = mface__realize (frame, NULL, 0, Mnil, Mnil, 0);
375   if (! frame->rface->rfont)
376     MERROR (MERROR_WIN, NULL);
377   frame->space_width = frame->rface->space_width;
378   frame->ascent = frame->rface->ascent;
379   frame->descent = frame->rface->descent;
380
381   if (! mframe_default)
382     mframe_default = frame;
383
384   return frame;
385 }
386
387 /*=*/
388
389 /***en
390     @brief Return property value of frame.
391
392     The mframe_get_prop () function returns a value of property $KEY
393     of frame $FRAME.  The valid keys and the corresponding return
394     values are as follows.
395
396 @verbatim
397
398         key             type of value   meaning of value
399         ---             -------------   ----------------
400         Mface           MFace *         The default face.
401
402         Mfont           MFont *         The default font.
403
404         Mfont_width     int             Width of the default font.
405
406         Mfont_ascent    int             Ascent of the default font.
407
408         Mfont_descent   int             Descent of the default font.
409
410 @endverbatim
411
412     In the m17n-X library, the followings are also accepted.
413
414 @verbatim
415
416         key             type of value   meaning of value
417         ---             -------------   ----------------
418         Mdisplay        Display *       Display associated with the frame.
419
420         Mscreen         int             Screen number of a screen associated
421                                         with the frame.
422
423         Mcolormap       Colormap        Colormap of the frame.
424
425         Mdepth          unsigned        Depth of the frame.
426 @endverbatim
427 */
428
429 /***ja
430     @brief ¥Õ¥ì¡¼¥à¤Î¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÊÖ¤¹.
431
432     ´Ø¿ô mframe_get_prop () ¤Ï¥Õ¥ì¡¼¥à $FRAME ¤Î¥­¡¼ $KEY ¤ò»ý¤Ä¥×¥í¥Ñ
433     ¥Æ¥£¤ÎÃͤòÊÖ¤¹¡£Í­¸ú¤Ê¥­¡¼¤È¤½¤ÎÃͤϰʲ¼¤ÎÄ̤ꡣ
434
435 @verbatim
436
437         ¥­¡¼            Ãͤη¿          ÃͤΰÕÌ£
438         ---             -------------   ----------------
439         Mface           MFace *         ¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥§¡¼¥¹
440
441         Mfont           MFont *         ¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥©¥ó¥È
442
443         Mfont_width     int             ¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥©¥ó¥È¤ÎÉý
444
445         Mfont_ascent    int             ¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥©¥ó¥È¤Î ascent
446
447         Mfont_descent   int             ¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥©¥ó¥È¤Î descent
448
449 @endverbatim
450
451      m17n-X ¥é¥¤¥Ö¥é¥ê¤Ç¤Ï¡¢°Ê²¼¤Î¥­¡¼¤â»ÈÍѤǤ­¤ë¡£
452
453 @verbatim
454
455         ¥­¡¼            Ãͤη¿          ÃͤΰÕÌ£
456         ---             -------------   ----------------
457         Mdisplay        Display *       ¥Õ¥ì¡¼¥à¤È´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Ç¥£¥¹¥×¥ì¥¤
458
459         Mscreen         int             ¥Õ¥ì¡¼¥à¤È´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥¹¥¯¥ê¡¼¥ó
460                                         ¤Î¥¹¥¯¥ê¡¼¥ó¥Ê¥ó¥Ð
461
462         Mcolormap       Colormap        ¥Õ¥ì¡¼¥à¤Î¥«¥é¡¼¥Þ¥Ã¥×
463
464         Mdepth          unsigned        ¥Õ¥ì¡¼¥à¤Î¿¼¤µ
465 @endverbatim
466
467 */
468
469 void *
470 mframe_get_prop (MFrame *frame, MSymbol key)
471 {
472   if (key == Mface)
473     return frame->face;
474   if (key == Mfont)
475     return &frame->rface->rfont->font;
476   if (key == Mfont_width)
477     return (void *) (frame->space_width);
478   if (key == Mfont_ascent)
479     return (void *) (frame->ascent);
480   if (key == Mfont_descent)
481     return (void *) (frame->descent);
482   return mwin__device_get_prop (frame->device, key);
483 }
484
485 /*=*/
486
487 /***en
488     @brief The default frame.
489
490     The external variable #mframe_default contains a pointer to the
491     default frame that is created by the first call of mframe ().  */
492
493 /***ja
494     @brief ¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥ì¡¼¥à.
495
496     ³°ÉôÊÑ¿ô #mframe_default ¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥ì¡¼¥à¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò»ý
497     ¤Ä¡£¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥ì¡¼¥à¤Ï¡¢ºÇ½é¤Ë mframe () ¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¤È¤­¤Ë
498     ºî¤é¤ì¤ë¡£  */
499
500 MFrame *mframe_default;
501
502 /*** @} */
503
504 /*
505   Local Variables:
506   coding: euc-japan
507   End:
508 */