]> git.eshelyaron.com Git - emacs.git/commitdiff
(struct font_bitmap): New member bits_per_pixel.
authorKenichi Handa <handa@m17n.org>
Mon, 19 Nov 2007 05:16:48 +0000 (05:16 +0000)
committerKenichi Handa <handa@m17n.org>
Mon, 19 Nov 2007 05:16:48 +0000 (05:16 +0000)
(struct font_driver): New members start_for_frame and end_for_frame.
(struct font_data_list): New struct.
(font_put_frame_data, font_get_frame_data): Extern them.

src/font.h

index bc15dc779fcd0053bce00a37c11a24593f4ed942..9d4bc9b6a1cd9aeb7493c869c1b9479344b8eaff 100644 (file)
@@ -197,6 +197,7 @@ struct font_metrics
 
 struct font_bitmap
 {
+  int bits_per_pixel;
   int rows;
   int width;
   int pitch;
@@ -407,17 +408,49 @@ struct font_driver
   int (*otf_drive) P_ ((struct font *font, Lisp_Object features,
                       Lisp_Object gstring_in, int from, int to,
                       Lisp_Object gstring_out, int idx, int alternate_subst));
+
+  /* Optional.
+     Make the font driver ready for frame F.  Usually this function
+     makes some data specific to F and store it in F by calling
+     font_put_frame_data ().  */
+  int (*start_for_frame) P_ ((FRAME_PTR f));
+  
+  /* Optional.
+     End using the driver for frame F.  Usually this function free
+     some data stored for F.  */
+  int (*end_for_frame) P_ ((FRAME_PTR f));
 };
 
 
+/* Chain of font drivers.  There's one global font driver list
+   (font_driver_list in font.c).  In addition, each frame has it's own
+   font driver list at FRAME_PTR->font_driver_list.  */
+
 struct font_driver_list
 {
-  /* 1 iff this driver is currently used.  */
+  /* 1 iff this driver is currently used.  It is igonred in the global
+     font driver list.*/
   int on;
+  /* Pointer to the font driver.  */
   struct font_driver *driver;
+  /* Pointer to the next element of the chain.  */
   struct font_driver_list *next;
 };
 
+
+/* Chain of arbitrary data specific to each font driver.  Each frame
+   has it's own font data list at FRAME_PTR->font_data_list.  */
+
+struct font_data_list
+{
+  /* Pointer to the font driver.  */
+  struct font_driver *driver;
+  /* Data specific to the font driver.  */
+  void *data;
+  /* Pointer to the next element of the chain.  */
+  struct font_data_list *next;
+};
+
 extern int enable_font_backend;
 
 EXFUN (Ffont_spec, MANY);
@@ -486,6 +519,13 @@ extern int font_drive_otf P_ ((struct font *font, Lisp_Object otf_features,
                               int alternate_subst));
 #endif /* HAVE_LIBOTF */
 
+extern int font_put_frame_data P_ ((FRAME_PTR f,
+                                   struct font_driver *driver,
+                                   void *data));
+extern void *font_get_frame_data P_ ((FRAME_PTR f,
+                                     struct font_driver *driver));
+
+
 #ifdef HAVE_FREETYPE
 extern struct font_driver ftfont_driver;
 #endif /* HAVE_FREETYPE */