1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxSVGFileDC
4 // Author: Chris Elliott
7 // Copyright: (c) Chris Elliott
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/wfstream.h"
16 #include "wx/string.h"
18 #define wxSVGVersion wxT("v0100")
25 class WXDLLIMPEXP_CORE wxSVGFileDC
: public wxDC
28 wxSVGFileDC (wxString f
);
29 wxSVGFileDC (wxString f
, int Width
, int Height
);
30 wxSVGFileDC (wxString f
, int Width
, int Height
, float dpi
);
34 bool CanDrawBitmap() const { return true; }
35 bool CanGetTextExtent() const { return true; }
38 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::GetDepth Call not implemented")); return -1 ; }
41 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::Clear() Call not implemented \nNot sensible for an output file?")); return ; }
43 void DestroyClippingRegion()
44 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::void Call not yet implemented")); return ; }
46 wxCoord
GetCharHeight() const;
47 wxCoord
GetCharWidth() const;
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 ; }
52 void SetPalette(const wxPalette
& WXUNUSED(palette
))
53 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::SetPalette not implemented")); return ; }
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 ; }
58 void SetLogicalFunction(int WXUNUSED(function
))
59 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::SetLogicalFunction Call not implemented")); return ; }
61 int GetLogicalFunction() const
62 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::GetLogicalFunction() not implemented")); return wxCOPY
; }
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
) ;
70 bool IsOk() const {return m_OK
;}
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
);
83 bool DoGetPixel(wxCoord
, wxCoord
, class wxColour
*) const
84 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::DoGetPixel Call not implemented")); return true; }
86 virtual bool DoBlit(wxCoord
, wxCoord
, wxCoord
, wxCoord
, class wxDC
*,
87 wxCoord
, wxCoord
, int = wxCOPY
, bool = 0, int = -1, int = -1) ;
89 void DoCrossHair(wxCoord
, wxCoord
)
90 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::CrossHair Call not implemented")); return ; }
92 void DoDrawArc(wxCoord
, wxCoord
, wxCoord
, wxCoord
, wxCoord
, wxCoord
);
94 void DoDrawBitmap(const class wxBitmap
&, wxCoord
, wxCoord
, bool = 0) ;
96 void DoDrawCheckMark(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
) ;
98 void DoDrawEllipse(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
) ;
100 void DoDrawEllipticArc(wxCoord x
,wxCoord y
,wxCoord w
,wxCoord h
,double sa
,double ea
) ;
102 void DoDrawIcon(const class wxIcon
&, wxCoord
, wxCoord
) ;
104 void DoDrawLine (wxCoord x1
, wxCoord y1
, wxCoord x2
, wxCoord y2
) ;
106 void DoDrawLines(int n
, wxPoint points
[], wxCoord xoffset
= 0, wxCoord yoffset
= 0) ;
108 void DoDrawPoint(wxCoord
, wxCoord
) ;
110 void DoDrawPolygon(int n
, wxPoint points
[], wxCoord xoffset
, wxCoord yoffset
,int fillStyle
) ;
112 void DoDrawRectangle(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
) ;
114 void DoDrawRotatedText(const wxString
& text
, wxCoord x
, wxCoord y
, double angle
) ;
116 void DoDrawRoundedRectangle(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
, double radius
= 20) ;
118 void DoDrawText(const wxString
& text
, wxCoord x
, wxCoord y
);
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 ; }
124 void DoGetSize(int * x
, int *y
) const { *x
= m_width
; *y
= m_height
; return ; }
126 void DoGetTextExtent(const wxString
& string
, wxCoord
*w
, wxCoord
*h
, wxCoord
*descent
= NULL
, wxCoord
*externalLeading
= NULL
, const wxFont
*font
= NULL
) const ;
128 void DoSetClippingRegionAsRegion(const class wxRegion
&)
129 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::DoSetClippingRegionAsRegion Call not yet implemented")); return ; }
131 void Init (wxString f
, int Width
, int Height
, float dpi
);
135 void write( const wxString
&s
);
138 wxFileOutputStream
*m_outfile
;
140 int m_sub_images
; // number of png format images we have
142 bool m_graphics_changed
;
143 int m_width
, m_height
;
146 DECLARE_ABSTRACT_CLASS(wxSVGFileDC
)