]> git.saurik.com Git - wxWidgets.git/blame - include/wx/dcsvg.h
include wx/msw/winundef.g instead of writing just a subset of #undefs in wx/defs...
[wxWidgets.git] / include / wx / dcsvg.h
CommitLineData
18cea871
RD
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
8e10778e
VZ
12#ifndef _WX_DCSVG_H_
13#define _WX_DCSVG_H_
18cea871 14
ae0fbcee 15#include "wx/string.h"
8e10778e 16#include "wx/dc.h"
e104adcd 17
b0fc907f
VZ
18#if wxUSE_SVG
19
e104adcd 20#define wxSVGVersion wxT("v0100")
e104adcd 21
210bb741
CE
22#ifdef __BORLANDC__
23#pragma warn -8008
24#pragma warn -8066
25#endif
26
8e10778e
VZ
27class WXDLLIMPEXP_FWD_BASE wxFileOutputStream;
28
54429bb3 29class WXDLLIMPEXP_CORE wxSVGFileDC : public wxDC
e104adcd 30{
621b83d9
RR
31public:
32 wxSVGFileDC (wxString f);
33 wxSVGFileDC (wxString f, int Width, int Height);
34 wxSVGFileDC (wxString f, int Width, int Height, float dpi);
621b83d9 35
8e10778e
VZ
36 virtual ~wxSVGFileDC();
37
38 virtual bool CanDrawBitmap() const { return true; }
39 virtual bool CanGetTextExtent() const { return true; }
40
41 virtual int GetDepth() const
42 {
43 wxFAIL_MSG(wxT("wxSVGFILEDC::GetDepth Call not implemented"));
44 return -1;
45 }
46
47 virtual void Clear()
48 {
49 wxFAIL_MSG(wxT("wxSVGFILEDC::Clear() Call not implemented \nNot sensible for an output file?"));
50 }
51
52 virtual void DestroyClippingRegion()
53 {
54 wxFAIL_MSG(wxT("wxSVGFILEDC::void Call not yet implemented"));
55 }
56
57 virtual wxCoord GetCharHeight() const;
58 virtual wxCoord GetCharWidth() const;
59
60 virtual void SetClippingRegion(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
61 wxCoord WXUNUSED(w), wxCoord WXUNUSED(h))
62 {
63 wxFAIL_MSG(wxT("wxSVGFILEDC::SetClippingRegion not implemented"));
64 }
65
66 virtual void SetPalette(const wxPalette& WXUNUSED(palette))
67 {
68 wxFAIL_MSG(wxT("wxSVGFILEDC::SetPalette not implemented"));
69 }
70
71 virtual void GetClippingBox(wxCoord *WXUNUSED(x), wxCoord *WXUNUSED(y),
72 wxCoord *WXUNUSED(w), wxCoord *WXUNUSED(h))
73 {
74 wxFAIL_MSG(wxT("wxSVGFILEDC::GetClippingBox not implemented"));
75 }
76
77 virtual void SetLogicalFunction(int WXUNUSED(function))
78 {
79 wxFAIL_MSG(wxT("wxSVGFILEDC::SetLogicalFunction Call not implemented"));
80 }
81
82 virtual int GetLogicalFunction() const
83 {
84 wxFAIL_MSG(wxT("wxSVGFILEDC::GetLogicalFunction() not implemented"));
85 return -1;
86 }
87
88 virtual void SetBackground( const wxBrush &brush );
89 virtual void SetBackgroundMode( int mode );
90 virtual void SetBrush(const wxBrush& brush);
91 virtual void SetFont(const wxFont& font);
92 virtual void SetPen(const wxPen& pen);
93
94 virtual bool IsOk() const {return m_OK;}
621b83d9 95
621b83d9
RR
96 virtual void SetMapMode( int mode );
97 virtual void SetUserScale( double x, double y );
98 virtual void SetLogicalScale( double x, double y );
99 virtual void SetLogicalOrigin( wxCoord x, wxCoord y );
100 virtual void SetDeviceOrigin( wxCoord x, wxCoord y );
8e10778e 101 virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
ea76a6a5 102
621b83d9 103private:
8e10778e
VZ
104 virtual bool DoGetPixel(wxCoord, wxCoord, wxColour *) const
105 {
106 wxFAIL_MSG(wxT("wxSVGFILEDC::DoGetPixel Call not implemented"));
107 return true;
108 }
109
110 virtual bool DoBlit(wxCoord, wxCoord, wxCoord, wxCoord, wxDC *,
111 wxCoord, wxCoord, int = wxCOPY,
112 bool = 0, int = -1, int = -1);
e104adcd 113
8e10778e
VZ
114 virtual void DoCrossHair(wxCoord, wxCoord)
115 {
116 wxFAIL_MSG(wxT("wxSVGFILEDC::CrossHair Call not implemented"));
117 }
e104adcd 118
8e10778e 119 virtual void DoDrawArc(wxCoord, wxCoord, wxCoord, wxCoord, wxCoord, wxCoord);
e104adcd 120
8e10778e 121 virtual void DoDrawBitmap(const wxBitmap &, wxCoord, wxCoord, bool = 0);
e104adcd 122
8e10778e 123 virtual void DoDrawCheckMark(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
e104adcd 124
8e10778e 125 virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
e104adcd 126
8e10778e
VZ
127 virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
128 double sa, double ea);
e104adcd 129
8e10778e 130 virtual void DoDrawIcon(const wxIcon &, wxCoord, wxCoord);
e104adcd 131
8e10778e 132 virtual void DoDrawLine (wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
e104adcd 133
8e10778e
VZ
134 virtual void DoDrawLines(int n, wxPoint points[],
135 wxCoord xoffset = 0, wxCoord yoffset = 0);
e104adcd 136
8e10778e 137 virtual void DoDrawPoint(wxCoord, wxCoord);
621b83d9 138
8e10778e 139 virtual void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset,int fillStyle);
e104adcd 140
8e10778e 141 virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
e104adcd 142
8e10778e
VZ
143 virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y,
144 double angle);
e104adcd 145
8e10778e
VZ
146 virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
147 wxCoord w, wxCoord h,
148 double radius = 20) ;
e104adcd 149
8e10778e 150 virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y);
e104adcd 151
8e10778e
VZ
152 virtual bool DoFloodFill(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
153 const wxColour& WXUNUSED(col),
154 int WXUNUSED(style) = wxFLOOD_SURFACE)
155 {
156 wxFAIL_MSG(wxT("wxSVGFILEDC::DoFloodFill Call not implemented"));
157 return false;
158 }
e104adcd 159
8e10778e
VZ
160 virtual void DoGetSize(int * x, int *y) const
161 {
162 if ( x )
163 *x = m_width;
164 if ( y )
165 *y = m_height;
166 }
e104adcd 167
8e10778e
VZ
168 virtual void DoGetTextExtent(const wxString& string, wxCoord *w, wxCoord *h,
169 wxCoord *descent = NULL,
170 wxCoord *externalLeading = NULL,
171 const wxFont *font = NULL) const;
e104adcd 172
8e10778e
VZ
173 virtual void DoSetClippingRegionAsRegion(const wxRegion& WXUNUSED(region))
174 {
175 wxFAIL_MSG(wxT("wxSVGFILEDC::DoSetClippingRegionAsRegion Call not yet implemented"));
176 }
e104adcd 177
8e10778e 178 void Init (wxString f, int Width, int Height, float dpi);
e104adcd 179
8e10778e 180 void NewGraphics();
e104adcd 181
8e10778e 182 void write( const wxString &s );
621b83d9
RR
183
184private:
8e10778e
VZ
185 wxFileOutputStream *m_outfile;
186 wxString m_filename;
187 int m_sub_images; // number of png format images we have
188 bool m_OK;
189 bool m_graphics_changed;
190 int m_width, m_height;
191
621b83d9 192private:
8e10778e 193 DECLARE_ABSTRACT_CLASS(wxSVGFileDC)
e104adcd
CE
194};
195
b0fc907f
VZ
196#endif // wxUSE_SVG
197
8e10778e 198#endif // _WX_DCSVG_H_