]> git.saurik.com Git - wxWidgets.git/blob - utils/ogl/src/drawnp.h
spurious error messages from wxRegKey::HasValue() suppressed
[wxWidgets.git] / utils / ogl / src / drawnp.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: drawnp.h
3 // Purpose: Private header for wxDrawnShape
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 12/07/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _OGL_DRAWNP_H_
13 #define _OGL_DRAWNP_H_
14
15 #ifdef __GNUG__
16 #pragma interface "drawnp.h"
17 #endif
18
19 #include "drawn.h"
20
21 /*
22 * Drawing operations
23 *
24 */
25
26 #define DRAWOP_SET_PEN 1
27 #define DRAWOP_SET_BRUSH 2
28 #define DRAWOP_SET_FONT 3
29 #define DRAWOP_SET_TEXT_COLOUR 4
30 #define DRAWOP_SET_BK_COLOUR 5
31 #define DRAWOP_SET_BK_MODE 6
32 #define DRAWOP_SET_CLIPPING_RECT 7
33 #define DRAWOP_DESTROY_CLIPPING_RECT 8
34
35 /*
36 #define DRAWOP_CREATE_PEN 10
37 #define DRAWOP_CREATE_BRUSH 11
38 #define DRAWOP_CREATE_FONT 12
39 */
40
41 #define DRAWOP_DRAW_LINE 20
42 #define DRAWOP_DRAW_POLYLINE 21
43 #define DRAWOP_DRAW_POLYGON 22
44 #define DRAWOP_DRAW_RECT 23
45 #define DRAWOP_DRAW_ROUNDED_RECT 24
46 #define DRAWOP_DRAW_ELLIPSE 25
47 #define DRAWOP_DRAW_POINT 26
48 #define DRAWOP_DRAW_ARC 27
49 #define DRAWOP_DRAW_TEXT 28
50 #define DRAWOP_DRAW_SPLINE 29
51
52 /*
53 * Base, virtual class
54 *
55 */
56
57 class wxDrawOp: public wxObject
58 {
59 public:
60 inline wxDrawOp(int theOp) { m_op = theOp; }
61 inline ~wxDrawOp() {}
62 inline virtual void Scale(float xScale, float yScale) {};
63 inline virtual void Translate(float x, float y) {};
64 inline virtual void Rotate(float x, float y, float sinTheta, float cosTheta) {};
65 virtual void Do(wxDC& dc, float xoffset, float yoffset) = 0;
66 virtual wxDrawOp *Copy(wxPseudoMetaFile *newImage) = 0;
67 virtual wxExpr *WriteExpr(wxPseudoMetaFile *image) = 0;
68 virtual void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) = 0;
69
70 int GetOp() const { return m_op; }
71
72 protected:
73 int m_op;
74
75 };
76
77 /*
78 * Set font, brush, text colour
79 *
80 */
81
82 class wxOpSetGDI: public wxDrawOp
83 {
84 public:
85 wxOpSetGDI(int theOp, wxPseudoMetaFile *theImage, int theGdiIndex, int theMode = 0);
86 void Do(wxDC& dc, float xoffset, float yoffset);
87 wxDrawOp *Copy(wxPseudoMetaFile *newImage);
88 wxExpr *WriteExpr(wxPseudoMetaFile *image);
89 void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr);
90
91 public:
92 int m_mode;
93 int m_gdiIndex;
94 wxPseudoMetaFile* m_image;
95 unsigned char m_r;
96 unsigned char m_g;
97 unsigned char m_b;
98 };
99
100 /*
101 * Set/destroy clipping
102 *
103 */
104
105 class wxOpSetClipping: public wxDrawOp
106 {
107 public:
108 wxOpSetClipping(int theOp, float theX1, float theY1, float theX2, float theY2);
109 void Do(wxDC& dc, float xoffset, float yoffset);
110 void Scale(float xScale, float yScale);
111 void Translate(float x, float y);
112 wxDrawOp *Copy(wxPseudoMetaFile *newImage);
113 wxExpr *WriteExpr(wxPseudoMetaFile *image);
114 void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr);
115
116 public:
117 float m_x1;
118 float m_y1;
119 float m_x2;
120 float m_y2;
121 };
122
123 /*
124 * Draw line, rectangle, rounded rectangle, ellipse, point, arc, text
125 *
126 */
127
128 class wxOpDraw: public wxDrawOp
129 {
130 public:
131 wxOpDraw(int theOp, float theX1, float theY1, float theX2, float theY2,
132 float radius = 0.0, char *s = NULL);
133 ~wxOpDraw();
134 void Do(wxDC& dc, float xoffset, float yoffset);
135 void Scale(float scaleX, float scaleY);
136 void Translate(float x, float y);
137 void Rotate(float x, float y, float sinTheta, float cosTheta);
138 wxDrawOp *Copy(wxPseudoMetaFile *newImage);
139 wxExpr *WriteExpr(wxPseudoMetaFile *image);
140 void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr);
141
142 public:
143 float m_x1;
144 float m_y1;
145 float m_x2;
146 float m_y2;
147 float m_x3;
148 float m_radius;
149 char* m_textString;
150
151 };
152
153 /*
154 * Draw polyline, spline, polygon
155 *
156 */
157
158 class wxOpPolyDraw: public wxDrawOp
159 {
160 public:
161 wxOpPolyDraw(int theOp, int n, wxRealPoint *thePoints);
162 ~wxOpPolyDraw();
163 void Do(wxDC& dc, float xoffset, float yoffset);
164 void Scale(float scaleX, float scaleY);
165 void Translate(float x, float y);
166 void Rotate(float x, float y, float sinTheta, float cosTheta);
167 wxDrawOp *Copy(wxPseudoMetaFile *newImage);
168 wxExpr *WriteExpr(wxPseudoMetaFile *image);
169 void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr);
170
171 public:
172 wxRealPoint* m_points;
173 int m_noPoints;
174
175 };
176
177 #endif
178 // _OGL_DRAWNP_H_
179
180