]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: dcsvg.h | |
3 | // Purpose: interface of wxSVGFileDC | |
4 | // Author: wxWidgets team | |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows licence | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxSVGFileDC | |
11 | ||
12 | A wxSVGFileDC is a device context onto which graphics and text can be | |
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/). | |
18 | ||
19 | The intention behind wxSVGFileDC is that it can be used to produce a file | |
20 | corresponding to the screen display context, wxSVGFileDC, by passing the | |
21 | wxSVGFileDC as a parameter instead of a wxDC. Thus the wxSVGFileDC | |
22 | is a write-only class. | |
23 | ||
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. | |
28 | ||
29 | A more substantial SVG library (for reading and writing) is available at | |
30 | the wxArt2D website <http://wxart2d.sourceforge.net/>. | |
31 | ||
32 | @library{wxcore} | |
33 | @category{dc} | |
34 | */ | |
35 | class wxSVGFileDC : public wxDC | |
36 | { | |
37 | public: | |
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 | */ | |
42 | wxSVGFileDC(const wxString& filename, int width = 320, int height = 240, double dpi = 72); | |
43 | ||
44 | /** | |
45 | Destructor. | |
46 | */ | |
47 | virtual ~wxSVGFileDC(); | |
48 | ||
49 | /** | |
50 | Does nothing. | |
51 | */ | |
52 | void EndDoc(); | |
53 | ||
54 | /** | |
55 | Does nothing. | |
56 | */ | |
57 | void EndPage(); | |
58 | ||
59 | /** | |
60 | This makes no sense in wxSVGFileDC and does nothing. | |
61 | */ | |
62 | void Clear(); | |
63 | ||
64 | /** | |
65 | Does the same as wxDC::SetLogicalFunction(), except that only wxCOPY is | |
66 | available. Trying to set one of the other values will fail. | |
67 | */ | |
68 | void SetLogicalFunction(wxRasterOperationMode function); | |
69 | ||
70 | //@{ | |
71 | /** | |
72 | Functions not implemented in this DC class. | |
73 | */ | |
74 | void CrossHair(wxCoord x, wxCoord y); | |
75 | void DestroyClippingRegion(); | |
76 | bool FloodFill(wxCoord x, wxCoord y, const wxColour& colour, | |
77 | wxFloodFillStyle style = wxFLOOD_SURFACE); | |
78 | void GetClippingBox(wxCoord *x, wxCoord *y, wxCoord *width, wxCoord *height) const; | |
79 | bool GetPixel(wxCoord x, wxCoord y, wxColour* colour) const; | |
80 | void SetClippingRegion(wxCoord x, wxCoord y, wxCoord width, | |
81 | wxCoord height); | |
82 | void SetClippingRegion(const wxPoint& pt, const wxSize& sz); | |
83 | void SetClippingRegion(const wxRect& rect); | |
84 | void SetClippingRegion(const wxRegion& region); | |
85 | void SetPalette(const wxPalette& palette); | |
86 | bool StartDoc(const wxString& message); | |
87 | //@} | |
88 | }; | |
89 |