1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxSVGFileDC
4 // Author: Chris Elliott
7 // Copyright: (c) Chris Elliott
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/string.h"
20 #define wxSVGVersion wxT("v0100")
27 class WXDLLIMPEXP_FWD_BASE wxFileOutputStream
;
29 class WXDLLIMPEXP_CORE wxSVGFileDC
: public wxDC
32 wxSVGFileDC (wxString f
);
33 wxSVGFileDC (wxString f
, int Width
, int Height
);
34 wxSVGFileDC (wxString f
, int Width
, int Height
, float dpi
);
36 virtual ~wxSVGFileDC();
38 virtual bool CanDrawBitmap() const { return true; }
39 virtual bool CanGetTextExtent() const { return true; }
41 virtual int GetDepth() const
43 wxFAIL_MSG(wxT("wxSVGFILEDC::GetDepth Call not implemented"));
49 wxFAIL_MSG(wxT("wxSVGFILEDC::Clear() Call not implemented \nNot sensible for an output file?"));
52 virtual void DestroyClippingRegion()
54 wxFAIL_MSG(wxT("wxSVGFILEDC::void Call not yet implemented"));
57 virtual wxCoord
GetCharHeight() const;
58 virtual wxCoord
GetCharWidth() const;
60 virtual void SetClippingRegion(wxCoord
WXUNUSED(x
), wxCoord
WXUNUSED(y
),
61 wxCoord
WXUNUSED(w
), wxCoord
WXUNUSED(h
))
63 wxFAIL_MSG(wxT("wxSVGFILEDC::SetClippingRegion not implemented"));
66 virtual void SetPalette(const wxPalette
& WXUNUSED(palette
))
68 wxFAIL_MSG(wxT("wxSVGFILEDC::SetPalette not implemented"));
71 virtual void GetClippingBox(wxCoord
*WXUNUSED(x
), wxCoord
*WXUNUSED(y
),
72 wxCoord
*WXUNUSED(w
), wxCoord
*WXUNUSED(h
))
74 wxFAIL_MSG(wxT("wxSVGFILEDC::GetClippingBox not implemented"));
77 virtual void SetLogicalFunction(int WXUNUSED(function
))
79 wxFAIL_MSG(wxT("wxSVGFILEDC::SetLogicalFunction Call not implemented"));
82 virtual int GetLogicalFunction() const
84 wxFAIL_MSG(wxT("wxSVGFILEDC::GetLogicalFunction() not implemented"));
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
);
94 virtual bool IsOk() const {return m_OK
;}
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
);
101 virtual void SetAxisOrientation( bool xLeftRight
, bool yBottomUp
);
104 virtual bool DoGetPixel(wxCoord
, wxCoord
, wxColour
*) const
106 wxFAIL_MSG(wxT("wxSVGFILEDC::DoGetPixel Call not implemented"));
110 virtual bool DoBlit(wxCoord
, wxCoord
, wxCoord
, wxCoord
, wxDC
*,
111 wxCoord
, wxCoord
, int = wxCOPY
,
112 bool = 0, int = -1, int = -1);
114 virtual void DoCrossHair(wxCoord
, wxCoord
)
116 wxFAIL_MSG(wxT("wxSVGFILEDC::CrossHair Call not implemented"));
119 virtual void DoDrawArc(wxCoord
, wxCoord
, wxCoord
, wxCoord
, wxCoord
, wxCoord
);
121 virtual void DoDrawBitmap(const wxBitmap
&, wxCoord
, wxCoord
, bool = 0);
123 virtual void DoDrawCheckMark(wxCoord x
, wxCoord y
, wxCoord w
, wxCoord h
);
125 virtual void DoDrawEllipse(wxCoord x
, wxCoord y
, wxCoord w
, wxCoord h
);
127 virtual void DoDrawEllipticArc(wxCoord x
, wxCoord y
, wxCoord w
, wxCoord h
,
128 double sa
, double ea
);
130 virtual void DoDrawIcon(const wxIcon
&, wxCoord
, wxCoord
);
132 virtual void DoDrawLine (wxCoord x1
, wxCoord y1
, wxCoord x2
, wxCoord y2
);
134 virtual void DoDrawLines(int n
, wxPoint points
[],
135 wxCoord xoffset
= 0, wxCoord yoffset
= 0);
137 virtual void DoDrawPoint(wxCoord
, wxCoord
);
139 virtual void DoDrawPolygon(int n
, wxPoint points
[], wxCoord xoffset
, wxCoord yoffset
,int fillStyle
);
141 virtual void DoDrawRectangle(wxCoord x
, wxCoord y
, wxCoord w
, wxCoord h
);
143 virtual void DoDrawRotatedText(const wxString
& text
, wxCoord x
, wxCoord y
,
146 virtual void DoDrawRoundedRectangle(wxCoord x
, wxCoord y
,
147 wxCoord w
, wxCoord h
,
148 double radius
= 20) ;
150 virtual void DoDrawText(const wxString
& text
, wxCoord x
, wxCoord y
);
152 virtual bool DoFloodFill(wxCoord
WXUNUSED(x
), wxCoord
WXUNUSED(y
),
153 const wxColour
& WXUNUSED(col
),
154 int WXUNUSED(style
) = wxFLOOD_SURFACE
)
156 wxFAIL_MSG(wxT("wxSVGFILEDC::DoFloodFill Call not implemented"));
160 virtual void DoGetSize(int * x
, int *y
) const
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;
173 virtual void DoSetClippingRegionAsRegion(const wxRegion
& WXUNUSED(region
))
175 wxFAIL_MSG(wxT("wxSVGFILEDC::DoSetClippingRegionAsRegion Call not yet implemented"));
178 void Init (wxString f
, int Width
, int Height
, float dpi
);
182 void write( const wxString
&s
);
185 wxFileOutputStream
*m_outfile
;
187 int m_sub_images
; // number of png format images we have
189 bool m_graphics_changed
;
190 int m_width
, m_height
;
193 DECLARE_ABSTRACT_CLASS(wxSVGFileDC
)
198 #endif // _WX_DCSVG_H_