]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/dcsvg.h | |
3 | // Purpose: wxSVGFileDC | |
4 | // Author: Chris Elliott | |
5 | // Modified by: | |
6 | // Created: | |
7 | // Copyright: (c) Chris Elliott | |
8 | // RCS-ID: $Id$ | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef __DCSVG_H | |
13 | #define __DCSVG_H | |
14 | ||
15 | #include "wx/wfstream.h" | |
16 | #include "wx/string.h" | |
17 | ||
18 | #define wxSVGVersion wxT("v0100") | |
19 | ||
20 | #ifdef __BORLANDC__ | |
21 | #pragma warn -8008 | |
22 | #pragma warn -8066 | |
23 | #endif | |
24 | ||
25 | class WXDLLIMPEXP_CORE wxSVGFileDC : public wxDC | |
26 | { | |
27 | public: | |
28 | wxSVGFileDC (wxString f); | |
29 | wxSVGFileDC (wxString f, int Width, int Height); | |
30 | wxSVGFileDC (wxString f, int Width, int Height, float dpi); | |
31 | ||
32 | ~wxSVGFileDC(); | |
33 | ||
34 | bool CanDrawBitmap() const { return true; } | |
35 | bool CanGetTextExtent() const { return true; } | |
36 | ||
37 | int GetDepth() const | |
38 | { wxASSERT_MSG (false, wxT("wxSVGFILEDC::GetDepth Call not implemented")); return -1 ; } | |
39 | ||
40 | void Clear() | |
41 | { wxASSERT_MSG (false, wxT("wxSVGFILEDC::Clear() Call not implemented \nNot sensible for an output file?")); return ; } | |
42 | ||
43 | void DestroyClippingRegion() | |
44 | { wxASSERT_MSG (false, wxT("wxSVGFILEDC::void Call not yet implemented")); return ; } | |
45 | ||
46 | wxCoord GetCharHeight() const; | |
47 | wxCoord GetCharWidth() const; | |
48 | ||
49 | void SetClippingRegion(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxCoord WXUNUSED(width), wxCoord WXUNUSED(height)) | |
50 | { wxASSERT_MSG (false, wxT("wxSVGFILEDC::SetClippingRegion not implemented")); return ; } | |
51 | ||
52 | void SetPalette(const wxPalette& WXUNUSED(palette)) | |
53 | { wxASSERT_MSG (false, wxT("wxSVGFILEDC::SetPalette not implemented")); return ; } | |
54 | ||
55 | void GetClippingBox(wxCoord *WXUNUSED(x), wxCoord *WXUNUSED(y), wxCoord * WXUNUSED(width), wxCoord * WXUNUSED(height)) | |
56 | { wxASSERT_MSG (false, wxT("wxSVGFILEDC::GetClippingBox not implemented")); return ; } | |
57 | ||
58 | void SetLogicalFunction(int WXUNUSED(function)) | |
59 | { wxASSERT_MSG (false, wxT("wxSVGFILEDC::SetLogicalFunction Call not implemented")); return ; } | |
60 | ||
61 | int GetLogicalFunction() const | |
62 | { wxASSERT_MSG (false, wxT("wxSVGFILEDC::GetLogicalFunction() not implemented")); return wxCOPY ; } | |
63 | ||
64 | void SetBackground( const wxBrush &brush ) ; | |
65 | void SetBackgroundMode( int mode ) ; | |
66 | void SetBrush(const wxBrush& brush) ; | |
67 | void SetFont(const wxFont& font) ; | |
68 | void SetPen(const wxPen& pen) ; | |
69 | ||
70 | bool IsOk() const {return m_OK;} | |
71 | ||
72 | // these need to be overridden as wxPostscriptDC inherits | |
73 | // from the platform dependent wxDC and this we'd call | |
74 | // e.g. wxMSW specific code here. | |
75 | virtual void SetMapMode( int mode ); | |
76 | virtual void SetUserScale( double x, double y ); | |
77 | virtual void SetLogicalScale( double x, double y ); | |
78 | virtual void SetLogicalOrigin( wxCoord x, wxCoord y ); | |
79 | virtual void SetDeviceOrigin( wxCoord x, wxCoord y ); | |
80 | void SetAxisOrientation( bool xLeftRight, bool yBottomUp ); | |
81 | ||
82 | private: | |
83 | bool DoGetPixel(wxCoord, wxCoord, class wxColour *) const | |
84 | { wxASSERT_MSG (false, wxT("wxSVGFILEDC::DoGetPixel Call not implemented")); return true; } | |
85 | ||
86 | virtual bool DoBlit(wxCoord, wxCoord, wxCoord, wxCoord, class wxDC *, | |
87 | wxCoord, wxCoord, int = wxCOPY, bool = 0, int = -1, int = -1) ; | |
88 | ||
89 | void DoCrossHair(wxCoord, wxCoord) | |
90 | { wxASSERT_MSG (false, wxT("wxSVGFILEDC::CrossHair Call not implemented")); return ; } | |
91 | ||
92 | void DoDrawArc(wxCoord, wxCoord, wxCoord, wxCoord, wxCoord, wxCoord); | |
93 | ||
94 | void DoDrawBitmap(const class wxBitmap &, wxCoord, wxCoord, bool = 0) ; | |
95 | ||
96 | void DoDrawCheckMark(wxCoord x, wxCoord y, wxCoord width, wxCoord height) ; | |
97 | ||
98 | void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height) ; | |
99 | ||
100 | void DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea) ; | |
101 | ||
102 | void DoDrawIcon(const class wxIcon &, wxCoord, wxCoord) ; | |
103 | ||
104 | void DoDrawLine (wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) ; | |
105 | ||
106 | void DoDrawLines(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0) ; | |
107 | ||
108 | void DoDrawPoint(wxCoord, wxCoord) ; | |
109 | ||
110 | void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset,int fillStyle) ; | |
111 | ||
112 | void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) ; | |
113 | ||
114 | void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle) ; | |
115 | ||
116 | void DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20) ; | |
117 | ||
118 | void DoDrawText(const wxString& text, wxCoord x, wxCoord y); | |
119 | ||
120 | bool DoFloodFill(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const wxColour& WXUNUSED(col), | |
121 | int WXUNUSED(style) = wxFLOOD_SURFACE) | |
122 | { wxASSERT_MSG (false, wxT("wxSVGFILEDC::DoFloodFill Call not implemented")); return false ; } | |
123 | ||
124 | void DoGetSize(int * x, int *y) const { *x = m_width; *y = m_height ; return ; } | |
125 | ||
126 | void DoGetTextExtent(const wxString& string, wxCoord *w, wxCoord *h, wxCoord *descent = NULL, wxCoord *externalLeading = NULL, const wxFont *font = NULL) const ; | |
127 | ||
128 | void DoSetClippingRegionAsRegion(const class wxRegion &) | |
129 | { wxASSERT_MSG (false, wxT("wxSVGFILEDC::DoSetClippingRegionAsRegion Call not yet implemented")); return ; } | |
130 | ||
131 | void Init (wxString f, int Width, int Height, float dpi); | |
132 | ||
133 | void NewGraphics(); | |
134 | ||
135 | void write( const wxString &s ); | |
136 | ||
137 | private: | |
138 | wxFileOutputStream *m_outfile; | |
139 | wxString m_filename; | |
140 | int m_sub_images; // number of png format images we have | |
141 | bool m_OK; | |
142 | bool m_graphics_changed; | |
143 | int m_width, m_height; | |
144 | ||
145 | private: | |
146 | DECLARE_ABSTRACT_CLASS(wxSVGFileDC) | |
147 | }; | |
148 | ||
149 | #endif // __DCSVG_H |