]>
git.saurik.com Git - wxWidgets.git/blob - utils/ogl/src/drawnp.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Private header for wxDrawnShape
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _OGL_DRAWNP_H_
13 #define _OGL_DRAWNP_H_
16 #pragma interface "drawnp.h"
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
36 #define DRAWOP_CREATE_PEN 10
37 #define DRAWOP_CREATE_BRUSH 11
38 #define DRAWOP_CREATE_FONT 12
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
57 class wxDrawOp
: public wxObject
60 inline wxDrawOp(int theOp
) { m_op
= theOp
; }
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;
70 int GetOp() const { return m_op
; }
78 * Set font, brush, text colour
82 class wxOpSetGDI
: public wxDrawOp
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
);
94 wxPseudoMetaFile
* m_image
;
101 * Set/destroy clipping
105 class wxOpSetClipping
: public wxDrawOp
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
);
124 * Draw line, rectangle, rounded rectangle, ellipse, point, arc, text
128 class wxOpDraw
: public wxDrawOp
131 wxOpDraw(int theOp
, float theX1
, float theY1
, float theX2
, float theY2
,
132 float radius
= 0.0, char *s
= NULL
);
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
);
154 * Draw polyline, spline, polygon
158 class wxOpPolyDraw
: public wxDrawOp
161 wxOpPolyDraw(int theOp
, int n
, wxRealPoint
*thePoints
);
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
);
172 wxRealPoint
* m_points
;