XEmacs 21.2.28 "Hermes".
[chise/xemacs-chise.git.1] / src / objects-msw.h
index b8df7ff..71b423b 100644 (file)
@@ -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,31 @@ 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 INVALID_HANDLE_VALUE
+
+HFONT mswindows_get_hfont (Lisp_Font_Instance* f, int under, int strike);
 
-#endif /* _XEMACS_OBJECTS_MSW_H_ */
+#endif /* INCLUDED_objects_msw_h_ */