* font.h (struct font_bitmap): Remove unused 'extra' member.
[bpt/emacs.git] / src / font.h
index daeb320..539ebeb 100644 (file)
@@ -56,11 +56,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object;
 
-
-struct font_driver;
-struct font;
-struct glyph_string;
-
 /* An enumerator for each font property.  This is used as an index to
    the vector of FONT-SPEC and FONT-ENTITY.
 
@@ -239,6 +234,11 @@ enum font_property_index
 #define FONT_SET_STYLE(font, prop, val)        \
   ASET ((font), prop, make_number (font_style_to_value (prop, val, 1)))
 
+#define FONT_WIDTH(f) ((f)->max_width)
+#define FONT_HEIGHT(f) ((f)->height)
+#define FONT_BASE(f) ((f)->ascent)
+#define FONT_DESCENT(f) ((f)->descent)
+
 extern Lisp_Object QCspacing, QCdpi, QCscalable, QCotf, QClang, QCscript;
 extern Lisp_Object QCavgwidth, QCantialias, QCfont_entity;
 extern Lisp_Object Qp;
@@ -312,6 +312,10 @@ struct font
   /* Ascent and descent of the font (in pixels).  */
   int ascent, descent;
 
+  /* The following members makes sense on graphic displays only.  */
+
+#if defined (HAVE_WINDOW_SYSTEM)
+
   /* Vertical pixel width of the underline.  If is zero if that
      information is not in the font.  */
   int underline_thickness;
@@ -374,12 +378,6 @@ struct font
      registered in char-table `use-default-ascent'.  */
   int default_ascent;
 
-  /* CCL program to calculate code points of the font.  */
-  struct ccl_program *font_encoder;
-
-  /* Font-driver for the font.  */
-  struct font_driver *driver;
-
   /* Charset to encode a character code into a glyph code of the font.
      -1 means that the font doesn't require this information to encode
      a character.  */
@@ -390,6 +388,11 @@ struct font
      determine it.  */
   int repertory_charset;
 
+#endif /* HAVE_WINDOW_SYSTEM */
+
+  /* Font-driver for the font.  */
+  struct font_driver *driver;
+
   /* There are more members in this structure, but they are private
      to the font-driver.  */
 };
@@ -417,7 +420,6 @@ struct font_bitmap
   int left;
   int top;
   int advance;
-  void *extra;
 };
 
 /* Predicates to check various font-related objects.  */
@@ -487,8 +489,6 @@ struct font_bitmap
    this value.  */
 #define FONT_PIXEL_SIZE_QUANTUM 1
 
-struct face;
-
 #define FONT_INVALID_CODE 0xFFFFFFFF
 
 /* Font driver.  Members specified as "optional" can be NULL.  */
@@ -552,8 +552,8 @@ struct font_driver
   Lisp_Object (*open) (struct frame *f, Lisp_Object font_entity,
                        int pixel_size);
 
-  /* Close FONT on frame F.  */
-  void (*close) (struct frame *f, struct font *font);
+  /* Close FONT.  NOTE: this can be called by GC.  */
+  void (*close) (struct font *font);
 
   /* Optional (if FACE->extra is not used).
      Prepare FACE for displaying characters by FONT on frame F by
@@ -582,6 +582,8 @@ struct font_driver
                        unsigned *code, int nglyphs,
                        struct font_metrics *metrics);
 
+#ifdef HAVE_WINDOW_SYSTEM
+
   /* Optional.
      Draw glyphs between FROM and TO of S->char2b at (X Y) pixel
      position of frame F with S->FACE and S->GC.  If WITH_BACKGROUND,
@@ -602,6 +604,8 @@ struct font_driver
      Free bitmap data in BITMAP.  */
   void (*free_bitmap) (struct font *font, struct font_bitmap *bitmap);
 
+#endif /* HAVE_WINDOW_SYSTEM */
+
   /* Optional.
      Return an outline data for glyph-code CODE of FONT.  The format
      of the outline data depends on the font-driver.  */
@@ -760,6 +764,7 @@ extern Lisp_Object font_load_for_lface (struct frame *f, Lisp_Object *lface,
                                         Lisp_Object spec);
 extern void font_prepare_for_face (struct frame *f, struct face *face);
 extern void font_done_for_face (struct frame *f, struct face *face);
+extern void clear_font_cache (struct frame *);
 
 extern Lisp_Object font_open_by_spec (struct frame *f, Lisp_Object spec);
 extern Lisp_Object font_open_by_name (struct frame *f, Lisp_Object name);
@@ -827,6 +832,7 @@ extern void syms_of_w32font (void);
 extern Lisp_Object Qfontsize;
 extern struct font_driver nsfont_driver;
 extern void syms_of_nsfont (void);
+extern void syms_of_macfont (void);
 #endif /* HAVE_NS */
 
 #ifndef FONT_DEBUG