X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=src%2Fobjects-msw.h;h=f01de9494b3973a661c89870a37f2b65da5e14d7;hp=b8df7ffbb7bd6533279e746626f3976ea21dfbbc;hb=2bf45e07013c281a55bc509b24f5e83568f3d0fd;hpb=6883ee56ec887c2c48abe5b06b5e66aa74031910 diff --git a/src/objects-msw.h b/src/objects-msw.h index b8df7ff..f01de94 100644 --- a/src/objects-msw.h +++ b/src/objects-msw.h @@ -31,8 +31,8 @@ Boston, MA 02111-1307, USA. */ */ -#ifndef _XEMACS_OBJECTS_MSW_H_ -#define _XEMACS_OBJECTS_MSW_H_ +#ifndef INCLUDED_objects_msw_h_ +#define INCLUDED_objects_msw_h_ #include "objects.h" @@ -46,6 +46,33 @@ struct mswindows_color_instance_data #define COLOR_INSTANCE_MSWINDOWS_COLOR(c) \ (MSWINDOWS_COLOR_INSTANCE_DATA (c)->color) -#define FONT_INSTANCE_MSWINDOWS_HFONT(c) ((HFONT) (c)->data) +/* The four HFONTS are for the 4 (underlined, strikethrough) + combinations. Only the one at index 0, neither underlined nor + struk through is created with the font instance. Other fonts are + created as necessary during redisplay, using the one at index 0 + as protptype */ +#define MSWINDOWS_NUM_FONT_VARIANTS 4 +struct mswindows_font_instance_data +{ + HFONT hfont [MSWINDOWS_NUM_FONT_VARIANTS]; +}; + +#define MSWINDOWS_FONT_INSTANCE_DATA(c) \ + ((struct mswindows_font_instance_data *) (c)->data) + +#define FONT_INSTANCE_MSWINDOWS_HFONT_I(c,i) \ + (MSWINDOWS_FONT_INSTANCE_DATA(c)->hfont[(i)]) + +#define FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT(c,under,strike) \ + FONT_INSTANCE_MSWINDOWS_HFONT_I (c, (!!(strike)<<1)|!!(under)) + +/* If font creation during redisplay fails, then the following + value is used to prevent future attempts to create this font. + Redisplay uses the "main" font when encounters this value */ +#define MSWINDOWS_BAD_HFONT ((HFONT)INVALID_HANDLE_VALUE) + +HFONT mswindows_get_hfont (Lisp_Font_Instance* f, int under, int strike); + +Lisp_Object mswindows_color_to_string (COLORREF color); -#endif /* _XEMACS_OBJECTS_MSW_H_ */ +#endif /* INCLUDED_objects_msw_h_ */