]>
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
62 inline wxDrawOp(int theOp
) { op
= theOp
; }
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;
74 * Set font, brush, text colour
78 class wxOpSetGDI
: public wxDrawOp
83 wxPseudoMetaFile
*image
;
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
);
95 * Set/destroy clipping
99 class wxOpSetClipping
: public wxDrawOp
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
);
116 * Draw line, rectangle, rounded rectangle, ellipse, point, arc, text
120 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
*WritewxExpr(wxPseudoMetaFile
*image
);
140 void ReadwxExpr(wxPseudoMetaFile
*image
, wxExpr
*expr
);
144 * Draw polyline, spline, polygon
148 class wxOpPolyDraw
: public wxDrawOp
154 wxOpPolyDraw(int theOp
, int n
, wxRealPoint
*thePoints
);
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
);