]> git.saurik.com Git - wxWidgets.git/blame - contrib/include/wx/ogl/mfutils.h
wxUniv build fix.
[wxWidgets.git] / contrib / include / wx / ogl / mfutils.h
CommitLineData
1fc25a89
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: mfutils.h
3// Purpose: Metafile utilities: reading a placeable metafile independently
4// of Windows.
5// Author: Julian Smart
6// Modified by:
7// Created: 12/07/98
8// RCS-ID: $Id$
9// Copyright: (c) Julian Smart
2ba06d5a 10// Licence: wxWindows licence
1fc25a89
JS
11/////////////////////////////////////////////////////////////////////////////
12
13#ifndef _MFUTILS_H_
14#define _MFUTILS_H_
15
ab7ce33c 16#if defined(__GNUG__) && !defined(__APPLE__)
1fc25a89
JS
17#pragma interface "mfutils.h"
18#endif
19
5f331691 20
1fc25a89
JS
21#include <wx/metafile.h>
22
23#ifndef GetRValue
2ba06d5a
WS
24#define GetRValue(rgb) ((unsigned char)(rgb))
25#define GetGValue(rgb) ((unsigned char)(((int)(rgb)) >> 8))
26#define GetBValue(rgb) ((unsigned char)((rgb)>>16))
1fc25a89
JS
27#endif
28
29/* Metafile Functions */
f7a8c129
JS
30// some compilers have them in their include files
31
32#ifndef META_SETBKCOLOR
2ba06d5a 33 #define META_SETBKCOLOR 0x0201
f7a8c129
JS
34#endif
35#ifndef META_SETBKMODE
2ba06d5a 36 #define META_SETBKMODE 0x0102
f7a8c129
JS
37#endif
38#ifndef META_SETMAPMODE
2ba06d5a 39 #define META_SETMAPMODE 0x0103
f7a8c129
JS
40#endif
41#ifndef META_SETROP2
2ba06d5a 42 #define META_SETROP2 0x0104
f7a8c129
JS
43#endif
44#ifndef META_SETRELABS
2ba06d5a 45 #define META_SETRELABS 0x0105
f7a8c129
JS
46#endif
47#ifndef META_SETPOLYFILLMODE
2ba06d5a 48 #define META_SETPOLYFILLMODE 0x0106
f7a8c129
JS
49#endif
50#ifndef META_SETSTRETCHBLTMODE
2ba06d5a 51 #define META_SETSTRETCHBLTMODE 0x0107
f7a8c129
JS
52#endif
53#ifndef META_SETTEXTCHAREXTRA
2ba06d5a 54 #define META_SETTEXTCHAREXTRA 0x0108
f7a8c129
JS
55#endif
56#ifndef META_SETTEXTCOLOR
2ba06d5a 57 #define META_SETTEXTCOLOR 0x0209
f7a8c129
JS
58#endif
59#ifndef META_SETTEXTJUSTIFICATION
2ba06d5a 60 #define META_SETTEXTJUSTIFICATION 0x020A
f7a8c129
JS
61#endif
62#ifndef META_SETWINDOWORG
2ba06d5a 63 #define META_SETWINDOWORG 0x020B
f7a8c129
JS
64#endif
65#ifndef META_SETWINDOWEXT
2ba06d5a 66 #define META_SETWINDOWEXT 0x020C
f7a8c129
JS
67#endif
68#ifndef META_SETVIEWPORTORG
2ba06d5a 69 #define META_SETVIEWPORTORG 0x020D
f7a8c129
JS
70#endif
71#ifndef META_SETVIEWPORTEXT
2ba06d5a 72 #define META_SETVIEWPORTEXT 0x020E
f7a8c129
JS
73#endif
74#ifndef META_OFFSETWINDOWORG
2ba06d5a 75 #define META_OFFSETWINDOWORG 0x020F
f7a8c129
JS
76#endif
77#ifndef META_SCALEWINDOWEXT
2ba06d5a 78 #define META_SCALEWINDOWEXT 0x0410
f7a8c129
JS
79#endif
80#ifndef META_OFFSETVIEWPORTORG
2ba06d5a 81 #define META_OFFSETVIEWPORTORG 0x0211
f7a8c129
JS
82#endif
83#ifndef META_SCALEVIEWPORTEXT
2ba06d5a 84 #define META_SCALEVIEWPORTEXT 0x0412
f7a8c129
JS
85#endif
86#ifndef META_LINETO
2ba06d5a 87 #define META_LINETO 0x0213
f7a8c129
JS
88#endif
89#ifndef META_MOVETO
2ba06d5a 90 #define META_MOVETO 0x0214
f7a8c129
JS
91#endif
92#ifndef META_EXCLUDECLIPRECT
2ba06d5a 93 #define META_EXCLUDECLIPRECT 0x0415
f7a8c129
JS
94#endif
95#ifndef META_INTERSECTCLIPRECT
2ba06d5a 96 #define META_INTERSECTCLIPRECT 0x0416
f7a8c129
JS
97#endif
98#ifndef META_ARC
2ba06d5a 99 #define META_ARC 0x0817
f7a8c129
JS
100#endif
101#ifndef META_ELLIPSE
2ba06d5a 102 #define META_ELLIPSE 0x0418
f7a8c129
JS
103#endif
104#ifndef META_FLOODFILL
2ba06d5a 105 #define META_FLOODFILL 0x0419
f7a8c129
JS
106#endif
107#ifndef META_PIE
2ba06d5a 108 #define META_PIE 0x081A
f7a8c129
JS
109#endif
110#ifndef META_RECTANGLE
2ba06d5a 111 #define META_RECTANGLE 0x041B
f7a8c129
JS
112#endif
113#ifndef META_ROUNDRECT
2ba06d5a 114 #define META_ROUNDRECT 0x061C
f7a8c129
JS
115#endif
116#ifndef META_PATBLT
2ba06d5a 117 #define META_PATBLT 0x061D
f7a8c129
JS
118#endif
119#ifndef META_SAVEDC
2ba06d5a 120 #define META_SAVEDC 0x001E
f7a8c129
JS
121#endif
122#ifndef META_SETPIXEL
2ba06d5a 123 #define META_SETPIXEL 0x041F
f7a8c129
JS
124#endif
125#ifndef META_OFFSETCLIPRGN
2ba06d5a 126 #define META_OFFSETCLIPRGN 0x0220
f7a8c129
JS
127#endif
128#ifndef META_TEXTOUT
2ba06d5a 129 #define META_TEXTOUT 0x0521
f7a8c129
JS
130#endif
131#ifndef META_BITBLT
2ba06d5a 132 #define META_BITBLT 0x0922
f7a8c129
JS
133#endif
134#ifndef META_STRETCHBLT
2ba06d5a 135 #define META_STRETCHBLT 0x0B23
f7a8c129
JS
136#endif
137#ifndef META_POLYGON
2ba06d5a 138 #define META_POLYGON 0x0324
f7a8c129
JS
139#endif
140#ifndef META_POLYLINE
2ba06d5a 141 #define META_POLYLINE 0x0325
f7a8c129
JS
142#endif
143#ifndef META_ESCAPE
2ba06d5a 144 #define META_ESCAPE 0x0626
f7a8c129
JS
145#endif
146#ifndef META_RESTOREDC
2ba06d5a 147 #define META_RESTOREDC 0x0127
f7a8c129
JS
148#endif
149#ifndef META_FILLREGION
2ba06d5a 150 #define META_FILLREGION 0x0228
f7a8c129
JS
151#endif
152#ifndef META_FRAMEREGION
2ba06d5a 153 #define META_FRAMEREGION 0x0429
f7a8c129
JS
154#endif
155#ifndef META_INVERTREGION
2ba06d5a 156 #define META_INVERTREGION 0x012A
f7a8c129
JS
157#endif
158#ifndef META_PAINTREGION
2ba06d5a 159 #define META_PAINTREGION 0x012B
f7a8c129
JS
160#endif
161#ifndef META_SELECTCLIPREGION
2ba06d5a 162 #define META_SELECTCLIPREGION 0x012C
f7a8c129
JS
163#endif
164#ifndef META_SELECTOBJECT
2ba06d5a 165 #define META_SELECTOBJECT 0x012D
f7a8c129
JS
166#endif
167#ifndef META_SETTEXTALIGN
2ba06d5a 168 #define META_SETTEXTALIGN 0x012E
f7a8c129
JS
169#endif
170#ifndef META_DRAWTEXT
2ba06d5a 171 #define META_DRAWTEXT 0x062F
f7a8c129
JS
172#endif
173
174#ifndef META_CHORD
2ba06d5a 175 #define META_CHORD 0x0830
f7a8c129
JS
176#endif
177#ifndef META_SETMAPPERFLAGS
2ba06d5a 178 #define META_SETMAPPERFLAGS 0x0231
f7a8c129
JS
179#endif
180#ifndef META_EXTTEXTOUT
2ba06d5a 181 #define META_EXTTEXTOUT 0x0a32
f7a8c129
JS
182#endif
183#ifndef META_SETDIBTODEV
2ba06d5a 184 #define META_SETDIBTODEV 0x0d33
f7a8c129
JS
185#endif
186#ifndef META_SELECTPALETTE
2ba06d5a 187 #define META_SELECTPALETTE 0x0234
f7a8c129
JS
188#endif
189#ifndef META_REALIZEPALETTE
2ba06d5a 190 #define META_REALIZEPALETTE 0x0035
f7a8c129
JS
191#endif
192#ifndef META_ANIMATEPALETTE
2ba06d5a 193 #define META_ANIMATEPALETTE 0x0436
f7a8c129
JS
194#endif
195#ifndef META_SETPALENTRIES
2ba06d5a 196 #define META_SETPALENTRIES 0x0037
f7a8c129
JS
197#endif
198#ifndef META_POLYPOLYGON
2ba06d5a 199 #define META_POLYPOLYGON 0x0538
f7a8c129
JS
200#endif
201#ifndef META_RESIZEPALETTE
2ba06d5a 202 #define META_RESIZEPALETTE 0x0139
f7a8c129
JS
203#endif
204
205#ifndef META_DIBBITBLT
2ba06d5a 206 #define META_DIBBITBLT 0x0940
f7a8c129
JS
207#endif
208#ifndef META_DIBSTRETCHBLT
2ba06d5a 209 #define META_DIBSTRETCHBLT 0x0b41
f7a8c129
JS
210#endif
211#ifndef META_DIBCREATEPATTERNBRUSH
2ba06d5a 212 #define META_DIBCREATEPATTERNBRUSH 0x0142
f7a8c129
JS
213#endif
214#ifndef META_STRETCHDIB
2ba06d5a 215 #define META_STRETCHDIB 0x0f43
f7a8c129
JS
216#endif
217
218#ifndef META_EXTFLOODFILL
2ba06d5a 219 #define META_EXTFLOODFILL 0x0548
f7a8c129
JS
220#endif
221
222#ifndef META_RESETDC
2ba06d5a 223 #define META_RESETDC 0x014C
f7a8c129
JS
224#endif
225#ifndef META_STARTDOC
2ba06d5a 226 #define META_STARTDOC 0x014D
f7a8c129
JS
227#endif
228#ifndef META_STARTPAGE
2ba06d5a 229 #define META_STARTPAGE 0x004F
f7a8c129
JS
230#endif
231#ifndef META_ENDPAGE
2ba06d5a 232 #define META_ENDPAGE 0x0050
f7a8c129
JS
233#endif
234#ifndef META_ABORTDOC
2ba06d5a 235 #define META_ABORTDOC 0x0052
f7a8c129
JS
236#endif
237#ifndef META_ENDDOC
2ba06d5a 238 #define META_ENDDOC 0x005E
f7a8c129
JS
239#endif
240
241#ifndef META_DELETEOBJECT
2ba06d5a 242 #define META_DELETEOBJECT 0x01f0
f7a8c129
JS
243#endif
244
245#ifndef META_CREATEPALETTE
2ba06d5a 246 #define META_CREATEPALETTE 0x00f7
f7a8c129
JS
247#endif
248#ifndef META_CREATEBRUSH
2ba06d5a 249 #define META_CREATEBRUSH 0x00F8
f7a8c129
JS
250#endif
251#ifndef META_CREATEPATTERNBRUSH
2ba06d5a 252 #define META_CREATEPATTERNBRUSH 0x01F9
f7a8c129
JS
253#endif
254#ifndef META_CREATEPENINDIRECT
2ba06d5a 255 #define META_CREATEPENINDIRECT 0x02FA
f7a8c129
JS
256#endif
257#ifndef META_CREATEFONTINDIRECT
2ba06d5a 258 #define META_CREATEFONTINDIRECT 0x02FB
f7a8c129
JS
259#endif
260#ifndef META_CREATEBRUSHINDIRECT
2ba06d5a 261 #define META_CREATEBRUSHINDIRECT 0x02FC
f7a8c129
JS
262#endif
263#ifndef META_CREATEBITMAPINDIRECT
2ba06d5a 264 #define META_CREATEBITMAPINDIRECT 0x02FD
f7a8c129
JS
265#endif
266#ifndef META_CREATEBITMAP
2ba06d5a 267 #define META_CREATEBITMAP 0x06FE
f7a8c129
JS
268#endif
269#ifndef META_CREATEREGION
2ba06d5a 270 #define META_CREATEREGION 0x06FF
f7a8c129 271#endif
1fc25a89
JS
272
273/* Background Modes */
f7a8c129
JS
274#ifndef TRANSPARENT
275 #define TRANSPARENT 1
276#endif
277#ifndef OPAQUE
278 #define OPAQUE 2
279#endif
1fc25a89
JS
280
281/* Pen Styles */
f7a8c129 282#ifndef PS_SOLID
2ba06d5a 283 #define PS_SOLID 0
f7a8c129
JS
284#endif
285#ifndef PS_DASH
2ba06d5a 286 #define PS_DASH 1
f7a8c129
JS
287#endif
288#ifndef PS_DOT
2ba06d5a 289 #define PS_DOT 2
f7a8c129
JS
290#endif
291#ifndef PS_DASHDOT
2ba06d5a 292 #define PS_DASHDOT 3
f7a8c129
JS
293#endif
294#ifndef PS_DASHDOTDOT
2ba06d5a 295 #define PS_DASHDOTDOT 4
f7a8c129
JS
296#endif
297#ifndef PS_NULL
2ba06d5a 298 #define PS_NULL 5
f7a8c129
JS
299#endif
300#ifndef PS_INSIDEFRAME
2ba06d5a 301 #define PS_INSIDEFRAME 6
f7a8c129 302#endif
1fc25a89
JS
303
304/* PitchAndFamily family values (high 4 bits) */
f7a8c129
JS
305#ifndef FF_DONTCARE
306 #define FF_DONTCARE 0x00
307#endif
308#ifndef FF_ROMAN
309 #define FF_ROMAN 0x10
310#endif
311#ifndef FF_SWISS
312 #define FF_SWISS 0x20
313#endif
314#ifndef FF_MODERN
315 #define FF_MODERN 0x30
316#endif
317#ifndef FF_SCRIPT
318 #define FF_SCRIPT 0x40
319#endif
320#ifndef FF_DECORATIVE
321 #define FF_DECORATIVE 0x50
1fc25a89
JS
322#endif
323
324/* Brush Styles */
f7a8c129 325#ifndef BS_SOLID
2ba06d5a 326 #define BS_SOLID 0
f7a8c129
JS
327#endif
328#ifndef BS_NULL
2ba06d5a 329 #define BS_NULL 1
f7a8c129
JS
330#endif
331#ifndef BS_HOLLOW
2ba06d5a 332 #define BS_HOLLOW BS_NULL
f7a8c129
JS
333#endif
334#ifndef BS_HATCHED
2ba06d5a 335 #define BS_HATCHED 2
f7a8c129
JS
336#endif
337#ifndef BS_PATTERN
2ba06d5a 338 #define BS_PATTERN 3
f7a8c129
JS
339#endif
340#ifndef BS_INDEXED
2ba06d5a 341 #define BS_INDEXED 4
f7a8c129
JS
342#endif
343#ifndef BS_DIBPATTERN
2ba06d5a 344 #define BS_DIBPATTERN 5
f7a8c129 345#endif
1fc25a89
JS
346
347/* Hatch Styles */
f7a8c129
JS
348#ifndef HS_HORIZONTAL
349 #define HS_HORIZONTAL 0
350#endif
351#ifndef HS_VERTICAL
352 #define HS_VERTICAL 1
353#endif
354#ifndef HS_FDIAGONAL
355 #define HS_FDIAGONAL 2
356#endif
357#ifndef HS_BDIAGONAL
358 #define HS_BDIAGONAL 3
359#endif
360#ifndef HS_CROSS
361 #define HS_CROSS 4
362#endif
363#ifndef HS_DIAGCROSS
364 #define HS_DIAGCROSS 5
365#endif
1fc25a89 366
5f331691 367class WXDLLIMPEXP_OGL wxMetaRecord: public wxObject
1fc25a89
JS
368{
369 public:
370 int metaFunction;
371 long param1;
372 long param2;
373 long param3;
374 long param4;
375 long param5;
376 long param6;
377 long param7;
378 long param8;
c1fa2fda 379 wxChar *stringParam;
1fc25a89 380 wxRealPoint *points;
c1fa2fda 381
1fc25a89
JS
382 wxMetaRecord(int fun)
383 {
384 metaFunction = fun; points = NULL; stringParam = NULL;
385 param1 = 0;
386 }
387 ~wxMetaRecord(void);
388};
389
5f331691 390class WXDLLIMPEXP_OGL wxXMetaFile: public wxObject
1fc25a89
JS
391{
392 public:
393 double lastX;
394 double lastY;
395 bool ok;
396
397 double left;
398 double top;
399 double right;
400 double bottom;
401
402 wxList metaRecords;
403 wxList gdiObjects; // List of wxMetaRecord objects created with Create...,
404 // referenced by position in list by SelectObject
9e053640 405 wxXMetaFile(const wxChar* file = NULL);
1fc25a89 406 ~wxXMetaFile(void);
c1fa2fda 407
1fc25a89
JS
408 // After this is called, the metafile cannot be used for anything
409 // since it is now owned by the clipboard.
410 bool SetClipboard(int width = 0, int height = 0);
411
412 bool Play(wxDC *dc);
413 inline bool Ok(void) const { return ok; }
9e053640 414 bool ReadFile(const wxChar *file);
1fc25a89
JS
415};
416
417#endif
418 // _MFUTILS_H_