(mflt_enable_new_feature): Document it.
[m17n/m17n-lib.git] / src / face.h
index dd7f538..31e326c 100644 (file)
@@ -1,5 +1,5 @@
 /* face.h -- header file for the face module.
-   Copyright (C) 2003, 2004
+   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H15PRO112
 
@@ -17,7 +17,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the m17n library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    02111-1307, USA.  */
 
 #ifndef _M17N_FACE_H_
@@ -46,14 +46,12 @@ enum MFaceProperty
     MFACE_BOX,
     MFACE_VIDEOMODE,
 
-    /** Extention by applications.  */
-    MFACE_HOOK_FUNC,
-    MFACE_HOOK_ARG,
-
-    /* In a realized face, this is already reflected in MFACE_SIZE,
-       thus is ignored.  */
+    /* In a realized face, this is ignored because it is already
+       reflected in MFACE_SIZE.  */
     MFACE_RATIO,
 
+    MFACE_HOOK_ARG,
+
     MFACE_PROPERTY_MAX
   };
 
@@ -64,8 +62,10 @@ struct MFace
   /** Properties of the face.  */
   void *property[MFACE_PROPERTY_MAX];
 
-  /** List of realized faces based on the face.  */
-  MPlist *realized_face_list;
+  MFaceHookFunc hook;
+
+  /** List of frames affected by the face modification.  */
+  MPlist *frame_list;
 };
 
 
@@ -80,13 +80,13 @@ struct MRealizedFace
   /** Properties of all stacked faces are merged into here.  */
   MFace face;
 
+  /** Font explicitly specified for the face (maybe NULL).  */
+  MFont *font;
+
   /** From what faces this is realized.  Keys are Mface and values are
      (MFace *).  */
   MPlist *base_face_list;
 
-  /* Set to 1 if some of above faces is modified.  */
-  unsigned need_update;
-
   /* Realized font, one of <frame>->realized_font_list.  */
   MRealizedFont *rfont;
 
@@ -103,12 +103,12 @@ struct MRealizedFace
       properties. */
   MRealizedFace *ascii_rface;
 
-  /** Realized face for undisplayable chars (no font found) that has
-      the same face properties. */
-  MRealizedFace *nofont_rface;
+  /** List of realized faces that have the same face properties.  */
+  MPlist *non_ascii_list;
 
   int ascent, descent;
   int space_width;
+  int average_width;
 
   /** Pointer to a window system dependent object.  */
   void *info;
@@ -118,8 +118,7 @@ struct MRealizedFace
 extern MFace *mface__default;
 
 extern MRealizedFace *mface__realize (MFrame *frame, MFace **faces, int num,
-                                     MSymbol language, MSymbol charset,
-                                     int limitted_size);
+                                     int limitted_size, MFont *font);
 
 extern MGlyph *mface__for_chars (MSymbol script, MSymbol language,
                                 MSymbol charset, MGlyph *from_g, MGlyph *to_g,
@@ -127,4 +126,6 @@ extern MGlyph *mface__for_chars (MSymbol script, MSymbol language,
 
 extern void mface__free_realized (MRealizedFace *rface);
 
+extern void mface__update_frame_face (MFrame *frame);
+
 #endif /* _M17N_FACE_H_ */