X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/015e1bb0daf6f28d6a28e8b13d8a1147050f3c5b..8bae7480b8bfe970f97e6afbb919ca41c28397f0:/src/fontset.h diff --git a/src/fontset.h b/src/fontset.h index bb7c8e8ffc..57545fbfa1 100644 --- a/src/fontset.h +++ b/src/fontset.h @@ -22,10 +22,6 @@ Boston, MA 02111-1307, USA. */ #ifndef _FONTSET_H #define _FONTSET_H -/* - -#define GENERIC_FONT_PTR void - /* This data type is used for the font_table field of window system depending data area (e.g. struct x_display_info on X window). */ @@ -128,7 +124,7 @@ struct font_info /* A value which may appear in the member encoding of struch font_info indicating that a font itself doesn't tell which encoding to be used. */ -#define FONT_ENCODING_NOT_DECIDED 4 +#define FONT_ENCODING_NOT_DECIDED 255 #define FONT_NOT_OPENED -1 #define FONT_NOT_FOUND -2 @@ -170,41 +166,59 @@ struct fontset_data int n_fontsets; }; +/* Forward declaration for prototypes. */ +struct frame; + /* The following six are window system dependent functions. Initialization routine of each window system should set appropriate functions to these variables. For instance, in case of X window, x_term_init does this. */ /* Return a pointer to struct font_info of font FONT_IDX of frame F. */ -extern struct font_info *(*get_font_info_func) (/* FRAME_PTR f; - int font_idx */); +extern struct font_info *(*get_font_info_func) P_ ((struct frame *f, + int font_idx)); /* Return a list of font names which matches PATTERN. See the document of `x-list-fonts' for more detail. */ -extern Lisp_Object (*list_fonts_func) (/* Lisp_Object pattern, face, frame, - width */); +extern Lisp_Object (*list_fonts_func) P_ ((struct frame *f, + Lisp_Object pattern, + int size, + int maxnames)); /* Load a font named NAME for frame F and return a pointer to the information of the loaded font. If loading is failed, return -1. */ -extern struct font_info *(*load_font_func) (/* FRAME_PTR f; char *name */); +extern struct font_info *(*load_font_func) P_ ((struct frame *f, + char *name, int)); /* Return a pointer to struct font_info of a font named NAME for frame F. If no such font is loaded, return NULL. */ -extern struct font_info *(*query_font_func) (/* FRAME_PTR f; char *name */); +extern struct font_info *(*query_font_func) P_ ((struct frame *f, char *name)); /* Additional function for setting fontset or changing fontset contents of frame F. This function may change the coordinate of the frame. */ -extern void (*set_frame_fontset_func) (/* FRAME_PTR f; Lisp_Object arg, oldval */); +extern void (*set_frame_fontset_func) P_ ((struct frame *f, Lisp_Object arg, + Lisp_Object oldval)); -/* Check if any window system is used now. */ -extern void (*check_window_system_func) (); +/* To find a CCL program, fs_load_font calls this function. + The argument is a pointer to the struct font_info. + This function set the memer `encoder' of the structure. */ +extern void (*find_ccl_program_func) P_ ((struct font_info *)); -extern struct fontset_data *alloc_fontset_data (); -extern void free_fontset_data (); -extern struct font_info *fs_load_font (); -extern Lisp_Object list_fontsets (); +/* Check if any window system is used now. */ +extern void (*check_window_system_func) P_ ((void)); + +extern struct fontset_data *alloc_fontset_data P_ ((void)); +extern void free_fontset_data P_ ((struct fontset_data *)); +extern struct font_info *fs_load_font P_ ((struct frame *, struct font_info *, + int, char *, int)); +extern int fs_query_fontset P_ ((struct frame *, char *)); +extern int fs_register_fontset P_ ((struct frame *, Lisp_Object)); +EXFUN (Fquery_fontset, 2); +extern Lisp_Object list_fontsets P_ ((struct frame *, Lisp_Object, int)); extern Lisp_Object Vglobal_fontset_alist; +struct frame; +int fs_query_fontset P_ ((struct frame *f, char *name)); extern Lisp_Object Qfontset; extern Lisp_Object Vuse_default_ascent; @@ -231,4 +245,24 @@ extern int font_idx_temp; ? font_table + font_idx_temp \ : fs_load_font (f, font_table, charset, fontname, fontset)) +extern Lisp_Object Vfontset_alias_alist; +extern Lisp_Object Vglobal_fontset_alist; + + +/* Return an immutable id for font_info FONT_INFO on frame F. The + reason for this macro is hat one cannot hold pointers to font_info + structures in other data structures, because the table is + reallocated in x_list_fonts. */ + +#define FONT_INFO_ID(F, FONT_INFO) \ + (FONT_INFO) - (FRAME_X_DISPLAY_INFO ((F))->font_table) + +/* Given a font_info id ID, return a pointer to the font_info + structure on frame F. If ID is invalid, return null. */ + +#define FONT_INFO_FROM_ID(F, ID) \ + (((ID) >= 0 && (ID) < FRAME_X_DISPLAY_INFO ((F))->font_table_size) \ + ? (FRAME_X_DISPLAY_INFO ((F))->font_table + (ID)) \ + : 0) + #endif /* _FONTSET_H */