]> git.saurik.com Git - wxWidgets.git/blob - utils/ogl/src/drawnp.h
OGL fixes; documentation fixes; dialog editor updates
[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 int op;
61
62 inline wxDrawOp(int theOp) { op = theOp; }
63 inline ~wxDrawOp() {}
64 inline virtual void Scale(float xScale, float yScale) {};
65 inline virtual void Translate(float x, float y) {};
66 inline virtual void Rotate(float x, float y, float sinTheta, float cosTheta) {};
67 virtual void Do(wxDC& dc, float xoffset, float yoffset) = 0;
68 virtual wxDrawOp *Copy(wxPseudoMetaFile *newImage) = 0;
69 virtual wxExpr *WritewxExpr(wxPseudoMetaFile *image) = 0;
70 virtual void ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr) = 0;
71 };
72
73 /*
74 * Set font, brush, text colour
75 *
76 */
77
78 class wxOpSetGDI: public wxDrawOp
79 {
80 public:
81 int mode;
82 int gdiIndex;
83 wxPseudoMetaFile *image;
84 unsigned char r;
85 unsigned char g;
86 unsigned char b;
87 wxOpSetGDI(int theOp, wxPseudoMetaFile *theImage, int theGdiIndex, int theMode = 0);
88 void Do(wxDC& dc, float xoffset, float yoffset);
89 wxDrawOp *Copy(wxPseudoMetaFile *newImage);
90 wxExpr *WritewxExpr(wxPseudoMetaFile *image);
91 void ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr);
92 };
93
94 /*
95 * Set/destroy clipping
96 *
97 */
98
99 class wxOpSetClipping: public wxDrawOp
100 {
101 public:
102 float x1;
103 float y1;
104 float x2;
105 float y2;
106 wxOpSetClipping(int theOp, float theX1, float theY1, float theX2, float theY2);
107 void Do(wxDC& dc, float xoffset, float yoffset);
108 void Scale(float xScale, float yScale);
109 void Translate(float x, float y);
110 wxDrawOp *Copy(wxPseudoMetaFile *newImage);
111 wxExpr *WritewxExpr(wxPseudoMetaFile *image);
112 void ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr);
113 };
114
115 /*
116 * Draw line, rectangle, rounded rectangle, ellipse, point, arc, text
117 *
118 */
119
120 class wxOpDraw: public wxDrawOp
121 {
122 public:
123 float x1;
124 float y1;
125 float x2;
126 float y2;
127 float x3;
128 float radius;
129 char *textString;
130
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 *WritewxExpr(wxPseudoMetaFile *image);
140 void ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr);
141 };
142
143 /*
144 * Draw polyline, spline, polygon
145 *
146 */
147
148 class wxOpPolyDraw: public wxDrawOp
149 {
150 public:
151 wxRealPoint *points;
152 int noPoints;
153
154 wxOpPolyDraw(int theOp, int n, wxRealPoint *thePoints);
155 ~wxOpPolyDraw();
156 void Do(wxDC& dc, float xoffset, float yoffset);
157 void Scale(float scaleX, float scaleY);
158 void Translate(float x, float y);
159 void Rotate(float x, float y, float sinTheta, float cosTheta);
160 wxDrawOp *Copy(wxPseudoMetaFile *newImage);
161 wxExpr *WritewxExpr(wxPseudoMetaFile *image);
162 void ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr);
163 };
164
165 #endif
166 // _OGL_DRAWNP_H_
167
168