From 5a74d0e5072fdd7b9dbbe67a2fff9675256e2338 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 19 Nov 2007 05:16:48 +0000 Subject: [PATCH] (struct font_bitmap): New member bits_per_pixel. (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 | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/src/font.h b/src/font.h index bc15dc779fc..9d4bc9b6a1c 100644 --- a/src/font.h +++ b/src/font.h @@ -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 */ -- 2.39.5