1 /************************************************************************/
2 /*									*/
3 /*  Windows Meta File and GDI specific definitions.			*/
4 /*									*/
5 /************************************************************************/
6 
7 #   ifndef		BM_WMF_H	/*	{{	*/
8 #   define		BM_WMF_H
9 
10 #   include	"bmcolor.h"
11 #   include	<geo2DInteger.h>
12 
13 typedef enum
14     {
15     META_EOF = 0x0000,
16     META_REALIZEPALETTE = 0x0035,
17     META_SETPALENTRIES = 0x0037,
18     META_SETBKMODE = 0x0102,
19     META_SETMAPMODE = 0x0103,
20     META_SETROP2 = 0x0104,
21     META_SETRELABS = 0x0105,
22     META_SETPOLYFILLMODE = 0x0106,
23     META_SETSTRETCHBLTMODE = 0x0107,
24     META_SETTEXTCHAREXTRA = 0x0108,
25     META_RESTOREDC = 0x0127,
26     META_RESIZEPALETTE = 0x0139,
27     META_DIBCREATEPATTERNBRUSH = 0x0142,
28     META_SETLAYOUT = 0x0149,
29     META_SETBKCOLOR = 0x0201,
30     META_SETTEXTCOLOR = 0x0209,
31     META_OFFSETVIEWPORTORG = 0x0211,
32     META_LINETO = 0x0213,
33     META_MOVETO = 0x0214,
34     META_OFFSETCLIPRGN = 0x0220,
35     META_FILLREGION = 0x0228,
36     META_SETMAPPERFLAGS = 0x0231,
37     META_SELECTPALETTE = 0x0234,
38     META_POLYGON = 0x0324,
39     META_POLYLINE = 0x0325,
40     META_SETTEXTJUSTIFICATION = 0x020A,
41     META_SETWINDOWORG = 0x020B,
42     META_SETWINDOWEXT = 0x020C,
43     META_SETVIEWPORTORG = 0x020D,
44     META_SETVIEWPORTEXT = 0x020E,
45     META_OFFSETWINDOWORG = 0x020F,
46     META_SCALEWINDOWEXT = 0x0410,
47     META_SCALEVIEWPORTEXT = 0x0412,
48     META_EXCLUDECLIPRECT = 0x0415,
49     META_INTERSECTCLIPRECT = 0x0416,
50     META_ELLIPSE = 0x0418,
51     META_FLOODFILL = 0x0419,
52     META_FRAMEREGION = 0x0429,
53     META_ANIMATEPALETTE = 0x0436,
54     META_TEXTOUT = 0x0521,
55     META_POLYPOLYGON = 0x0538,
56     META_EXTFLOODFILL = 0x0548,
57     META_RECTANGLE = 0x041B,
58     META_SETPIXEL = 0x041F,
59     META_ROUNDRECT = 0x061C,
60     META_PATBLT = 0x061D,
61     META_SAVEDC = 0x001E,
62     META_PIE = 0x081A,
63     META_STRETCHBLT = 0x0B23,
64     META_ESCAPE = 0x0626,
65     META_INVERTREGION = 0x012A,
66     META_PAINTREGION = 0x012B,
67     META_SELECTCLIPREGION = 0x012C,
68     META_SELECTOBJECT = 0x012D,
69     META_SETTEXTALIGN = 0x012E,
70     META_ARC = 0x0817,
71     META_CHORD = 0x0830,
72     META_BITBLT = 0x0922,
73     META_EXTTEXTOUT = 0x0a32,
74     META_SETDIBTODEV = 0x0d33,
75     META_DIBBITBLT = 0x0940,
76     META_DIBSTRETCHBLT = 0x0b41,
77     META_STRETCHDIB = 0x0f43,
78     META_DELETEOBJECT = 0x01f0,
79     META_CREATEPALETTE = 0x00f7,
80     META_CREATEPATTERNBRUSH = 0x01F9,
81     META_CREATEPENINDIRECT = 0x02FA,
82     META_CREATEFONTINDIRECT = 0x02FB,
83     META_CREATEBRUSHINDIRECT = 0x02FC,
84     META_CREATEREGION = 0x06FF
85     } WmfRecordType;
86 
87 /************************************************************************/
88 /*									*/
89 /*  1)  Various MapModes: Refer to petzold for an explanation.		*/
90 /*  2)  StrechBlt() modes.						*/
91 /*  3)  Font family styles.						*/
92 /*  4)  Polygon Fill Modes.						*/
93 /*									*/
94 /************************************************************************/
95 
96 /*  1  */
97 #   define	MM_TEXT				1
98 #   define	MM_LOMETRIC			2
99 #   define	MM_HIMETRIC			3
100 #   define	MM_LOENGLISH			4
101 #   define	MM_HIENGLISH			5
102 #   define	MM_TWIPS			6
103 #   define	MM_ISOTROPIC			7
104 #   define	MM_ANISOTROPIC			8
105 
106 /*  2  */
107 #   define	STRETCH_BLT_BLACKONWHITE	1
108 #   define	STRETCH_BLT_WHITEONBLACK	2
109 #   define	STRETCH_BLT_COLORONCOLOR	3
110 
111 /*  3  */
112 #   define	FF_DONTCARE			0x00
113 #   define	FF_ROMAN			0x10
114 #   define	FF_SWISS			0x20
115 #   define	FF_MODERN			0x30
116 #   define	FF_SCRIPT			0x40
117 #   define	FF_DECORATIVE			0x50
118 
119 /*  4  */
120 #   define	ALTERNATE			1
121 #   define	WINDING				2
122 
123 /*  5  */
124 #   define	TRANSPARENT			1
125 #   define	OPAQUE				2
126 
127 /************************************************************************/
128 /*									*/
129 /*  Implementation of a metafile 'Object'				*/
130 /*									*/
131 /************************************************************************/
132 
133 #   define TA_NOUPDATECP			0x0000
134 #   define TA_UPDATECP				0x0001
135 #   define TA_LEFT				0x0000
136 #   define TA_RIGHT				0x0002
137 #   define TA_CENTER				0x0006
138 #   define TA_TOP				0x0000
139 #   define TA_BOTTOM				0x0008
140 #   define TA_BASELINE				0x0018
141 
142 typedef struct LogicalPen
143     {
144     int		lpStyle;
145 #		define		PS_SOLID	0
146 #		define		PS_DASH		1
147 #		define		PS_DOT		2
148 #		define		PS_DASHDOT	3
149 #		define		PS_DASHDOTDOT	4
150 #		define		PS_NULL		5
151 #		define		PS_INSIDEFRAME	6
152     int		lpWidth;
153     RGB8Color	lpColor;
154     } LogicalPen;
155 
156 typedef struct LogicalPalette
157     {
158     int		lpVersion;
159     int		lpColorCount;
160     } LogicalPalette;
161 
162 #   define	MFtypeFREE		0
163 #   define	MFtypeBRUSH		1
164 #   define	MFtypePEN		2
165 #   define	MFtypeFONT		3
166 #   define	MFtypePALETTE		4
167 #   define	MFtypePATTERNBRUSH	5
168 #   define	MFtypeREGION		6
169 
170 #   define	mfoLogicalBrush		mfoSpecific.mfsLogicalBrush
171 #   define	mfoLogicalPen		mfoSpecific.mfsLogicalPen
172 #   define	mfoLogicalFont		mfoSpecific.mfsLogicalFont
173 #   define	mfoPatternBrush		mfoSpecific.mfsPatternBrush
174 
175 /************************************************************************/
176 /*									*/
177 /*  The header of a WMF metafile.					*/
178 /*									*/
179 /************************************************************************/
180 
181 typedef struct WmfHeader
182     {
183     int				wh_fileType;
184     int				wh_headerSize;
185     int				wh_windowsVersion;
186     long			wh_fileSize;
187     int				wh_objectCount;
188     long			wh_maxRecordSize;
189     int				wh_parameterCount;
190     } WmfHeader;
191 
192 typedef struct WmfFileHeader
193     {
194     unsigned long		wfh_key;
195     unsigned int		wfh_handle;
196     DocumentRectangle		wfhBounds;
197     unsigned int		wfhUnitsPerInch;
198 
199     unsigned long		wfh_reserved;
200     unsigned int		wfh_checksum;
201     } WmfFileHeader;
202 
203 #   endif	/*	BM_WMF_H		}}	*/
204