]> git.saurik.com Git - wxWidgets.git/blame - include/wx/dcsvg.h
Added DetachOldLog to avoid destruction of old log target
[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
e104adcd
CE
12#ifndef __DCSVG_H
13#define __DCSVG_H
18cea871 14
ae0fbcee
WS
15#include "wx/wfstream.h"
16#include "wx/string.h"
e104adcd
CE
17
18#define wxSVGVersion wxT("v0100")
e104adcd 19
210bb741
CE
20#ifdef __BORLANDC__
21#pragma warn -8008
22#pragma warn -8066
23#endif
24
54429bb3 25class WXDLLIMPEXP_CORE wxSVGFileDC : public wxDC
e104adcd 26{
621b83d9
RR
27public:
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();
e104adcd 33
621b83d9
RR
34 bool CanDrawBitmap() const { return true; }
35 bool CanGetTextExtent() const { return true; }
e104adcd 36
621b83d9
RR
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
04ab8b6d 49 void SetClippingRegion(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxCoord WXUNUSED(width), wxCoord WXUNUSED(height))
621b83d9
RR
50 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::SetClippingRegion not implemented")); return ; }
51
04ab8b6d 52 void SetPalette(const wxPalette& WXUNUSED(palette))
621b83d9
RR
53 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::SetPalette not implemented")); return ; }
54
04ab8b6d 55 void GetClippingBox(wxCoord *WXUNUSED(x), wxCoord *WXUNUSED(y), wxCoord * WXUNUSED(width), wxCoord * WXUNUSED(height))
621b83d9
RR
56 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::GetClippingBox not implemented")); return ; }
57
04ab8b6d 58 void SetLogicalFunction(int WXUNUSED(function))
621b83d9
RR
59 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::SetLogicalFunction Call not implemented")); return ; }
60
04ab8b6d 61 int GetLogicalFunction() const
621b83d9
RR
62 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::GetLogicalFunction() not implemented")); return wxCOPY ; }
63
04ab8b6d
RR
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) ;
621b83d9 69
04ab8b6d 70 bool IsOk() const {return m_OK;}
621b83d9 71
04ab8b6d
RR
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.
621b83d9
RR
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 );
04ab8b6d 80 void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
ea76a6a5 81
621b83d9 82private:
ea76a6a5 83 bool DoGetPixel(wxCoord, wxCoord, class wxColour *) const
47b378bd 84 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::DoGetPixel Call not implemented")); return true; }
e104adcd
CE
85
86 virtual bool DoBlit(wxCoord, wxCoord, wxCoord, wxCoord, class wxDC *,
87 wxCoord, wxCoord, int = wxCOPY, bool = 0, int = -1, int = -1) ;
88
ea76a6a5 89 void DoCrossHair(wxCoord, wxCoord)
47b378bd 90 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::CrossHair Call not implemented")); return ; }
e104adcd
CE
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
621b83d9
RR
106 void DoDrawLines(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0) ;
107
e104adcd
CE
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
9c11ecdb
CE
120 bool DoFloodFill(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const wxColour& WXUNUSED(col),
121 int WXUNUSED(style) = wxFLOOD_SURFACE)
47b378bd 122 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::DoFloodFill Call not implemented")); return false ; }
e104adcd 123
47b378bd 124 void DoGetSize(int * x, int *y) const { *x = m_width; *y = m_height ; return ; }
e104adcd 125
c94f845b 126 void DoGetTextExtent(const wxString& string, wxCoord *w, wxCoord *h, wxCoord *descent = NULL, wxCoord *externalLeading = NULL, const wxFont *font = NULL) const ;
e104adcd 127
ea76a6a5 128 void DoSetClippingRegionAsRegion(const class wxRegion &)
47b378bd 129 { wxASSERT_MSG (false, wxT("wxSVGFILEDC::DoSetClippingRegionAsRegion Call not yet implemented")); return ; }
e104adcd
CE
130
131 void Init (wxString f, int Width, int Height, float dpi);
132
621b83d9
RR
133 void NewGraphics();
134
135 void write( const wxString &s );
136
137private:
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;
621b83d9
RR
144
145private:
146 DECLARE_ABSTRACT_CLASS(wxSVGFileDC)
e104adcd
CE
147};
148
18cea871 149#endif // __DCSVG_H