]>
git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/ogl/mfutils.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Metafile utilities: reading a placeable metafile independently
5 // Author: Julian Smart
9 // Copyright: (c) Julian Smart
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
17 #pragma interface "mfutils.h"
20 #include <wx/metafile.h>
23 #define GetRValue(rgb) ((unsigned char)(rgb))
24 #define GetGValue(rgb) ((unsigned char)(((int)(rgb)) >> 8))
25 #define GetBValue(rgb) ((unsigned char)((rgb)>>16))
28 /* Metafile Functions */
29 /* Win32s/Borland need these macros, although META_SETBKCOLOR is defined */
30 #if 1 // !defined(META_SETBKCOLOR) // || defined(WIN32)
32 #define META_SETBKCOLOR 0x0201
33 #define META_SETBKMODE 0x0102
34 #define META_SETMAPMODE 0x0103
35 #define META_SETROP2 0x0104
36 #define META_SETRELABS 0x0105
37 #define META_SETPOLYFILLMODE 0x0106
38 #define META_SETSTRETCHBLTMODE 0x0107
39 #define META_SETTEXTCHAREXTRA 0x0108
40 #define META_SETTEXTCOLOR 0x0209
41 #define META_SETTEXTJUSTIFICATION 0x020A
42 #define META_SETWINDOWORG 0x020B
43 #define META_SETWINDOWEXT 0x020C
44 #define META_SETVIEWPORTORG 0x020D
45 #define META_SETVIEWPORTEXT 0x020E
46 #define META_OFFSETWINDOWORG 0x020F
47 #define META_SCALEWINDOWEXT 0x0410
48 #define META_OFFSETVIEWPORTORG 0x0211
49 #define META_SCALEVIEWPORTEXT 0x0412
50 #define META_LINETO 0x0213
51 #define META_MOVETO 0x0214
52 #define META_EXCLUDECLIPRECT 0x0415
53 #define META_INTERSECTCLIPRECT 0x0416
54 #define META_ARC 0x0817
55 #define META_ELLIPSE 0x0418
56 #define META_FLOODFILL 0x0419
57 #define META_PIE 0x081A
58 #define META_RECTANGLE 0x041B
59 #define META_ROUNDRECT 0x061C
60 #define META_PATBLT 0x061D
61 #define META_SAVEDC 0x001E
62 #define META_SETPIXEL 0x041F
63 #define META_OFFSETCLIPRGN 0x0220
64 #define META_TEXTOUT 0x0521
65 #define META_BITBLT 0x0922
66 #define META_STRETCHBLT 0x0B23
67 #define META_POLYGON 0x0324
68 #define META_POLYLINE 0x0325
69 #define META_ESCAPE 0x0626
70 #define META_RESTOREDC 0x0127
71 #define META_FILLREGION 0x0228
72 #define META_FRAMEREGION 0x0429
73 #define META_INVERTREGION 0x012A
74 #define META_PAINTREGION 0x012B
75 #define META_SELECTCLIPREGION 0x012C
76 #define META_SELECTOBJECT 0x012D
77 #define META_SETTEXTALIGN 0x012E
78 #define META_DRAWTEXT 0x062F
80 #define META_CHORD 0x0830
81 #define META_SETMAPPERFLAGS 0x0231
82 #define META_EXTTEXTOUT 0x0a32
83 #define META_SETDIBTODEV 0x0d33
84 #define META_SELECTPALETTE 0x0234
85 #define META_REALIZEPALETTE 0x0035
86 #define META_ANIMATEPALETTE 0x0436
87 #define META_SETPALENTRIES 0x0037
88 #define META_POLYPOLYGON 0x0538
89 #define META_RESIZEPALETTE 0x0139
91 #define META_DIBBITBLT 0x0940
92 #define META_DIBSTRETCHBLT 0x0b41
93 #define META_DIBCREATEPATTERNBRUSH 0x0142
94 #define META_STRETCHDIB 0x0f43
96 #define META_EXTFLOODFILL 0x0548
98 #define META_RESETDC 0x014C
99 #define META_STARTDOC 0x014D
100 #define META_STARTPAGE 0x004F
101 #define META_ENDPAGE 0x0050
102 #define META_ABORTDOC 0x0052
103 #define META_ENDDOC 0x005E
105 #define META_DELETEOBJECT 0x01f0
107 #define META_CREATEPALETTE 0x00f7
108 #define META_CREATEBRUSH 0x00F8
109 #define META_CREATEPATTERNBRUSH 0x01F9
110 #define META_CREATEPENINDIRECT 0x02FA
111 #define META_CREATEFONTINDIRECT 0x02FB
112 #define META_CREATEBRUSHINDIRECT 0x02FC
113 #define META_CREATEBITMAPINDIRECT 0x02FD
114 #define META_CREATEBITMAP 0x06FE
115 #define META_CREATEREGION 0x06FF
117 /* Background Modes */
118 #define TRANSPARENT 1
126 #define PS_DASHDOTDOT 4
128 #define PS_INSIDEFRAME 6
130 /* PitchAndFamily family values (high 4 bits) */
131 /* Win32s/Borland don't need this */
132 #ifndef FF_DONTCARE // !defined(__BORLANDC__) && !defined(WIN32)
133 #define FF_DONTCARE 0x00
134 #define FF_ROMAN 0x10
135 #define FF_SWISS 0x20
136 #define FF_MODERN 0x30
137 #define FF_SCRIPT 0x40
138 #define FF_DECORATIVE 0x50
144 #define BS_HOLLOW BS_NULL
148 #define BS_DIBPATTERN 5
151 #define HS_HORIZONTAL 0
152 #define HS_VERTICAL 1
153 #define HS_FDIAGONAL 2
154 #define HS_BDIAGONAL 3
156 #define HS_DIAGCROSS 5
158 #endif // metafile functions
160 class wxMetaRecord
: public wxObject
175 wxMetaRecord(int fun
)
177 metaFunction
= fun
; points
= NULL
; stringParam
= NULL
;
183 class wxXMetaFile
: public wxObject
196 wxList gdiObjects
; // List of wxMetaRecord objects created with Create...,
197 // referenced by position in list by SelectObject
198 wxXMetaFile(char *file
= NULL
);
201 // After this is called, the metafile cannot be used for anything
202 // since it is now owned by the clipboard.
203 bool SetClipboard(int width
= 0, int height
= 0);
206 inline bool Ok(void) const { return ok
; }
207 bool ReadFile(char *file
);