(Mdetail_text, minput_get_description, minput_get_commands)
[m17n/m17n-lib.git] / src / m17n-gui.h
index 7777272..e26f235 100644 (file)
@@ -32,6 +32,8 @@ extern "C"
 {
 #endif
 
+#if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
+
 extern void m17n_init_win (void);
 #undef M17N_INIT
 #define M17N_INIT() m17n_init_win ()
@@ -40,6 +42,8 @@ extern void m17n_fini_win (void);
 #undef M17N_FINI
 #define M17N_FINI() m17n_fini_win ()
 
+#endif
+
 /***en @defgroup m17nGUI GUI API */
 /***ja @defgroup m17nGUI GUI API */
 /*=*/
@@ -93,8 +97,6 @@ extern MSymbol Mwidget;
 extern MSymbol Mdepth;
 extern MSymbol Mcolormap;
 
-extern MSymbol Mx;
-
 extern MFrame *mframe (MPlist *plist);
 
 extern void *mframe_get_prop (MFrame *frame, MSymbol key);
@@ -141,7 +143,7 @@ typedef struct MFont MFont;
 
 /*=*/
 
-extern MSymbol Mfont;
+extern MSymbol Mx, Mfreetype, Mxft;
 
 extern MPlist *mfont_freetype_path;
 
@@ -153,10 +155,6 @@ extern MFont *mfont_parse_name (char *name, MSymbol format);
 
 extern char *mfont_unparse_name (MFont *font, MSymbol format);
 
-extern MFont *mfont_from_spec (char *family, char *weight, char *slant,
-                              char *swidth, char *adstyle, char *registry,
-                              unsigned short point, unsigned short res);
-
 /* These two are obsolete (from 1.1.0).  */
 extern char *mfont_name (MFont *font);
 extern MFont *mfont_from_name (char *name);
@@ -217,6 +215,12 @@ extern MSymbol *mfont_selection_priority ();
 
 extern int mfont_set_selection_priority (MSymbol *keys);
 
+extern int mfont_resize_ratio (MFont *font);
+
+extern MPlist *mfont_list (MFrame *frame, MFont *font, MSymbol language,
+                          int maxnum);
+
+
 /* end of font module */
 /*=*/
 
@@ -224,7 +228,8 @@ extern int mfont_set_selection_priority (MSymbol *keys);
 /***en @defgroup m17nFontset Fontset */
 /***ja @defgroup m17nFontset ¥Õ¥©¥ó¥È¥»¥Ã¥È */
 /*=*/
-
+/*** @addtogroup m17nFontset
+     @{   */
 typedef struct MFontset MFontset;
 
 extern MFontset *mfontset (char *name);
@@ -239,6 +244,9 @@ extern int mfontset_modify_entry (MFontset *fontset,
                                  MFont *spec, MSymbol layouter_name,
                                  int how);
 
+extern MPlist *mfontset_lookup (MFontset *fontset, MSymbol script,
+                               MSymbol language, MSymbol charset);
+/*** @}   */
 /* end of fontset module */
 /*=*/
 
@@ -529,6 +537,12 @@ typedef struct
       ¹ç¤Î¤ß¡£¡Ë */
   unsigned anti_alias : 1;
 
+  /***en If nonzero, disable the adjustment of glyph positions to
+      avoid horizontal overlapping at font boundary.  */
+  /***ja 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢¥Õ¥©¥ó¥È¶­³¦¤Ç¤Î¿åÊ¿Êý¸þ¤Î¥°¥ê¥Õ¤Î½Å¤Ê¤ê¤òÈò¤±
+      ¤ë¤¿¤á¤Î¥°¥ê¥Õ°ÌÃÖ¤ÎÄ´À°¤ò̵¸ú¤Ë¤¹¤ë¡£  */
+  unsigned disable_overlapping_adjustment : 1;
+
   /***en If nonzero, the values are minimum line ascent and descent
       pixels.  */
   /***ja 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢ÃͤϹԤΠascent ¤È descent ¤ÎºÇ¾®Ãͤò¼¨¤¹¡£  */
@@ -734,11 +748,11 @@ typedef struct
 
   /***en Metric of the glyph.  */
   /***ja ¥°¥ê¥Õ¤ÎÀ£Ë¡.  */
-  MDrawMetric this;
+  MDrawMetric metrics;
 
   /***en Font used for the glyph.  Set to NULL if no font is found for
       the glyph.  */
-  /***ja ¤½¤Î¥°¥ê¥ÕÍѤ˻Ȥï¤ì¤ë¥Õ¥©¥ó¥È¡£¸«¤Ä¤«¤é¤Ê¤±¤ì¤Ð NULL¡£
+  /***ja ¥°¥ê¥Õ¤Ë»È¤ï¤ì¤ë¥Õ¥©¥ó¥È¡£¸«¤Ä¤«¤é¤Ê¤±¤ì¤Ð NULL¡£
       the glyph.  */
   MFont *font;
 
@@ -753,14 +767,77 @@ typedef struct
 
   /***en Character ranges corresponding to visually left and right
       glyphs. */
-  /***ja »ë³ÐŪ¤Êº¸±¦¤Î¥°¥ê¥Õ¤ËÂбþ¤¹¤ëʸ»ú¤ÎÈÏ°Ï¡£  */
+  /***ja É½¼¨¾å¤Îº¸±¦¤Î¥°¥ê¥Õ¤ËÂбþ¤¹¤ëʸ»ú¤ÎÈÏ°Ï¡£  */
   int left_from, left_to;
   int right_from, right_to;
 
+  /***en Logical width of the glyph.  Nominal distance to the next
+      glyph.  */
+  /***ja ¥°¥ê¥Õ¤ÎÏÀÍýŪÉý¡£¼¡¤Î¥°¥ê¥Õ¤È¤Î̾Ìܾå¤Îµ÷Î¥¡£  */
+  int logical_width;
 } MDrawGlyphInfo;
 
 /*=*/
 
+/*** @ingroup m17nDraw */
+/***en
+    @brief Type of information about a glyph metric and font.
+
+    The type #MDrawGlyph is the structure that contains information
+    about a glyph metric and font.  It is used by the function
+    mdraw_glyph_list ().  */
+/***ja
+    @brief ¥°¥ê¥Õ¤ÎÀ£Ë¡¤È¥Õ¥©¥ó¥È¤Ë´Ø¤¹¤ë¾ðÊó¤Î·¿Àë¸À.
+
+    #MDrawGlyph ·¿¤Ï¥°¥ê¥Õ¤ÎÀ£Ë¡¤È¥Õ¥©¥ó¥È¤Ë´Ø¤¹¤ë¾ðÊó¤ò´Þ¤à¹½Â¤ÂΤǤ¢
+    ¤ë¡£mdraw_glyph_list () ¤Ï¤³¤ì¤òÍѤ¤¤ë¡£  */
+
+typedef struct
+{
+  /***en Character range corresponding to the glyph.  */
+  /***ja ¥°¥ê¥Õ¤ËÂбþ¤¹¤ëʸ»ú¤ÎÈÏ°Ï.  */
+  int from, to;
+
+  /***en Font glyph code of the glyph.  */
+  /***ja ¥Õ¥©¥ó¥ÈÆâ¤Î¥°¥ê¥Õ¥³¡¼¥É¡£  */
+  int glyph_code;
+
+  /***en Logical width of the glyph.  Nominal distance to the next
+      glyph.  */
+  /***ja ¥°¥ê¥Õ¤ÎÏÀÍýŪÉý¡£¼¡¤Î¥°¥ê¥Õ¤È¤Î̾Ìܾå¤Îµ÷Î¥¡£  */
+  int x_advance, y_advance;
+
+  /***en X/Y offset relative to the glyph position.  */
+  /***ja ¥°¥ê¥Õ¤Î°ÌÃÖ¤ËÂФ¹¤ë X/Y ¥ª¥Õ¥»¥Ã¥È.  */
+  int x_off, y_off;
+
+  /***en Metric of the glyph.  */
+  /***ja ¥°¥ê¥Õ¤ÎÀ£Ë¡.  */
+  int lbearing, rbearing, ascent, descent;
+
+  /***en Font used for the glyph.  Set to NULL if no font is found for
+      the glyph.  */
+  /***ja ¥°¥ê¥Õ¤Ë»È¤ï¤ì¤ë¥Õ¥©¥ó¥È¡£¸«¤Ä¤«¤é¤Ê¤±¤ì¤Ð NULL¡£
+      the glyph.  */
+  MFont *font;
+
+  /***en Type of the font.  One of Mx, Mfreetype, Mxft.  */
+  /***ja ¥Õ¥©¥ó¥È¤Î¥¿¥¤¥×¡£Mx¡¢Mfreetype¡¢Mxft ¤Î¤¤¤º¤ì¤«¡£  */
+  MSymbol font_type;
+
+  /***en Pointer to the font structure.  The actual type is
+      (XFontStruct *) if <font_type> member is Mx, FT_Face if
+      <font_type> member is Mfreetype, and (XftFont *) if <font_type>
+      member is Mxft.  */
+  /***ja ¥Õ¥©¥ó¥È¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¡£¼ÂºÝ¤Î·¿¤Ï <font_type> ¥á¥ó¥Ð¤¬
+      Mx ¤Ê¤é (XFontStruct *)¡¢ Mfreetype ¤Ê¤é FT_Face¡¢Mxft ¤Ê¤é
+      (XftFont *)¡£ */
+  void *fontp;
+
+} MDrawGlyph;
+
+/*=*/
+
 /***en
     @brief Type of text items.
 
@@ -840,6 +917,10 @@ extern int mdraw_text_per_char_extents (MFrame *frame,
 extern int mdraw_glyph_info (MFrame *frame, MText *mt, int from, int pos,
                             MDrawControl *control, MDrawGlyphInfo *info);
 
+extern int mdraw_glyph_list (MFrame *frame, MText *mt, int from, int to,
+                            MDrawControl *control, MDrawGlyph *glyphs,
+                            int array_size, int *num_glyphs_return);
+
 extern void mdraw_text_items (MFrame *frame, MDrawWindow win, int x, int y,
                              MDrawTextItem *items, int nitems);