Mercurial > hg > xemacs-beta
diff src/objects-msw.h @ 440:8de8e3f6228a r21-2-28
Import from CVS: tag r21-2-28
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:33:38 +0200 |
parents | 3ecd8885ac67 |
children | abe6d1db359e |
line wrap: on
line diff
--- a/src/objects-msw.h Mon Aug 13 11:32:27 2007 +0200 +++ b/src/objects-msw.h Mon Aug 13 11:33:38 2007 +0200 @@ -31,8 +31,8 @@ */ -#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,31 @@ #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) -#endif /* _XEMACS_OBJECTS_MSW_H_ */ +#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 INVALID_HANDLE_VALUE + +HFONT mswindows_get_hfont (Lisp_Font_Instance* f, int under, int strike); + +#endif /* INCLUDED_objects_msw_h_ */