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 virtual wxCoord
DeviceToLogicalX(wxCoord x
) const;
73 virtual wxCoord
DeviceToLogicalY(wxCoord y
) const;
74 virtual wxCoord
DeviceToLogicalXRel(wxCoord x
) const;
75 virtual wxCoord
DeviceToLogicalYRel(wxCoord y
) const;
76 virtual wxCoord
LogicalToDeviceX(wxCoord x
) const;
77 virtual wxCoord
LogicalToDeviceY(wxCoord y
) const;
78 virtual wxCoord
LogicalToDeviceXRel(wxCoord x
) const;
79 virtual wxCoord
LogicalToDeviceYRel(wxCoord y
) const ;
81 virtual void SetMapMode( int mode
);
82 virtual void SetUserScale( double x
, double y
);
83 virtual void SetLogicalScale( double x
, double y
);
84 virtual void SetLogicalOrigin( wxCoord x
, wxCoord y
);
85 virtual void SetDeviceOrigin( wxCoord x
, wxCoord y
);
87 virtual void SetAxisOrientation( bool xLeftRight
, bool yBottomUp
);
89 virtual void ComputeScaleAndOrigin();
92 bool DoGetPixel(wxCoord
, wxCoord
, class wxColour
*) const
93 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::DoGetPixel Call not implemented")); return true; }
95 virtual bool DoBlit(wxCoord
, wxCoord
, wxCoord
, wxCoord
, class wxDC
*,
96 wxCoord
, wxCoord
, int = wxCOPY
, bool = 0, int = -1, int = -1) ;
98 void DoCrossHair(wxCoord
, wxCoord
)
99 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::CrossHair Call not implemented")); return ; }
101 void DoDrawArc(wxCoord
, wxCoord
, wxCoord
, wxCoord
, wxCoord
, wxCoord
);
103 void DoDrawBitmap(const class wxBitmap
&, wxCoord
, wxCoord
, bool = 0) ;
105 void DoDrawCheckMark(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
) ;
107 void DoDrawEllipse(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
) ;
109 void DoDrawEllipticArc(wxCoord x
,wxCoord y
,wxCoord w
,wxCoord h
,double sa
,double ea
) ;
111 void DoDrawIcon(const class wxIcon
&, wxCoord
, wxCoord
) ;
113 void DoDrawLine (wxCoord x1
, wxCoord y1
, wxCoord x2
, wxCoord y2
) ;
115 void DoDrawLines(int n
, wxPoint points
[], wxCoord xoffset
= 0, wxCoord yoffset
= 0) ;
117 void DoDrawPoint(wxCoord
, wxCoord
) ;
119 void DoDrawPolygon(int n
, wxPoint points
[], wxCoord xoffset
, wxCoord yoffset
,int fillStyle
) ;
121 void DoDrawRectangle(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
) ;
123 void DoDrawRotatedText(const wxString
& text
, wxCoord x
, wxCoord y
, double angle
) ;
125 void DoDrawRoundedRectangle(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
, double radius
= 20) ;
127 void DoDrawText(const wxString
& text
, wxCoord x
, wxCoord y
);
129 bool DoFloodFill(wxCoord
WXUNUSED(x
), wxCoord
WXUNUSED(y
), const wxColour
& WXUNUSED(col
),
130 int WXUNUSED(style
) = wxFLOOD_SURFACE
)
131 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::DoFloodFill Call not implemented")); return false ; }
133 void DoGetSize(int * x
, int *y
) const { *x
= m_width
; *y
= m_height
; return ; }
135 void DoGetTextExtent(const wxString
& string
, wxCoord
*w
, wxCoord
*h
, wxCoord
*descent
= NULL
, wxCoord
*externalLeading
= NULL
, const wxFont
*font
= NULL
) const ;
137 void DoSetClippingRegionAsRegion(const class wxRegion
&)
138 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::DoSetClippingRegionAsRegion Call not yet implemented")); return ; }
140 void Init (wxString f
, int Width
, int Height
, float dpi
);
144 void write( const wxString
&s
);
147 wxFileOutputStream
*m_outfile
;
149 int m_sub_images
; // number of png format images we have
151 bool m_graphics_changed
;
152 int m_width
, m_height
;
153 double m_mm_to_pix_x
, m_mm_to_pix_y
;
156 DECLARE_ABSTRACT_CLASS(wxSVGFileDC
)