]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: dcsvg.h | |
e54c96f1 | 3 | // Purpose: interface of wxSVGFileDC |
23324ae1 FM |
4 | // Author: wxWidgets team |
5 | // RCS-ID: $Id$ | |
526954c5 | 6 | // Licence: wxWindows licence |
23324ae1 FM |
7 | ///////////////////////////////////////////////////////////////////////////// |
8 | ||
9 | /** | |
10 | @class wxSVGFileDC | |
7c913512 | 11 | |
3a7fb603 | 12 | A wxSVGFileDC is a device context onto which graphics and text can be |
e844dc64 VZ |
13 | drawn, and the output produced as a vector file, in SVG format. |
14 | ||
15 | This format can be read by a range of programs, including a Netscape plugin | |
16 | (Adobe) and the open source Inkscape program (http://inkscape.org/). Full | |
17 | details are given in the W3C SVG recommendation (http://www.w3.org/TR/SVG/). | |
7c913512 | 18 | |
23324ae1 | 19 | The intention behind wxSVGFileDC is that it can be used to produce a file |
3a7fb603 | 20 | corresponding to the screen display context, wxSVGFileDC, by passing the |
e844dc64 | 21 | wxSVGFileDC as a parameter instead of a wxDC. Thus the wxSVGFileDC |
3a7fb603 | 22 | is a write-only class. |
7c913512 | 23 | |
3a7fb603 BP |
24 | As the wxSVGFileDC is a vector format, raster operations like GetPixel() |
25 | are unlikely to be supported. However, the SVG specification allows for PNG | |
26 | format raster files to be embedded in the SVG, and so bitmaps, icons and | |
27 | blit operations in wxSVGFileDC are supported. | |
7c913512 | 28 | |
3a7fb603 BP |
29 | A more substantial SVG library (for reading and writing) is available at |
30 | the wxArt2D website <http://wxart2d.sourceforge.net/>. | |
7c913512 | 31 | |
23324ae1 | 32 | @library{wxcore} |
3a7fb603 | 33 | @category{dc} |
23324ae1 FM |
34 | */ |
35 | class wxSVGFileDC : public wxDC | |
36 | { | |
37 | public: | |
1db8f1dc BP |
38 | /** |
39 | Initializes a wxSVGFileDC with the given @a f filename with the given | |
40 | @a Width and @a Height at @a dpi resolution. | |
41 | */ | |
11e3af6e | 42 | wxSVGFileDC(const wxString& filename, int width = 320, int height = 240, double dpi = 72); |
23324ae1 FM |
43 | |
44 | /** | |
45 | Destructor. | |
46 | */ | |
adaaa686 | 47 | virtual ~wxSVGFileDC(); |
23324ae1 | 48 | |
23324ae1 | 49 | /** |
1db8f1dc | 50 | Does nothing. |
23324ae1 FM |
51 | */ |
52 | void EndDoc(); | |
53 | ||
23324ae1 | 54 | /** |
1db8f1dc | 55 | Does nothing. |
23324ae1 FM |
56 | */ |
57 | void EndPage(); | |
58 | ||
59 | /** | |
f045ad8d | 60 | This makes no sense in wxSVGFileDC and does nothing. |
23324ae1 | 61 | */ |
f045ad8d | 62 | void Clear(); |
23324ae1 FM |
63 | |
64 | /** | |
f045ad8d FM |
65 | Does the same as wxDC::SetLogicalFunction(), except that only wxCOPY is |
66 | available. Trying to set one of the other values will fail. | |
23324ae1 | 67 | */ |
f045ad8d | 68 | void SetLogicalFunction(wxRasterOperationMode function); |
23324ae1 | 69 | |
614e38db VZ |
70 | /** |
71 | Sets the clipping region for this device context to the intersection of | |
72 | the given region described by the parameters of this method and the previously | |
73 | set clipping region. | |
74 | Clipping is implemented in the SVG output using SVG group elements (<g>), with | |
75 | nested group elements being used to represent clipping region intersections when | |
76 | two or more calls are made to SetClippingRegion(). | |
77 | */ | |
78 | void SetClippingRegion(wxCoord x, wxCoord y, wxCoord width, | |
79 | wxCoord height); | |
80 | ||
81 | /** | |
82 | This is an overloaded member function, provided for convenience. It differs from the | |
83 | above function only in what argument(s) it accepts. | |
84 | */ | |
85 | void SetClippingRegion(const wxPoint& pt, const wxSize& sz); | |
86 | ||
87 | /** | |
88 | This is an overloaded member function, provided for convenience. It differs from the | |
89 | above function only in what argument(s) it accepts. | |
90 | */ | |
91 | void SetClippingRegion(const wxRect& rect); | |
92 | ||
93 | /** | |
94 | This function is not implemented in this DC class. | |
95 | It could be implemented in future if a GetPoints() function were made available on wxRegion. | |
96 | */ | |
97 | void SetClippingRegion(const wxRegion& region); | |
98 | ||
99 | /** | |
100 | Destroys the current clipping region so that none of the DC is clipped. | |
101 | Since intersections arising from sequential calls to SetClippingRegion are represented | |
102 | with nested SVG group elements (<g>), all such groups are closed when | |
103 | DestroyClippingRegion is called. | |
104 | */ | |
105 | void DestroyClippingRegion(); | |
106 | ||
23324ae1 FM |
107 | //@{ |
108 | /** | |
f045ad8d | 109 | Functions not implemented in this DC class. |
23324ae1 | 110 | */ |
f045ad8d | 111 | void CrossHair(wxCoord x, wxCoord y); |
f045ad8d FM |
112 | bool FloodFill(wxCoord x, wxCoord y, const wxColour& colour, |
113 | wxFloodFillStyle style = wxFLOOD_SURFACE); | |
4ccf0566 | 114 | void GetClippingBox(wxCoord *x, wxCoord *y, wxCoord *width, wxCoord *height) const; |
0004982c | 115 | bool GetPixel(wxCoord x, wxCoord y, wxColour* colour) const; |
23324ae1 | 116 | void SetPalette(const wxPalette& palette); |
23324ae1 | 117 | bool StartDoc(const wxString& message); |
f045ad8d | 118 | //@} |
23324ae1 | 119 | }; |
e54c96f1 | 120 |