2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: dcsvg.h
|
2008-03-10 15:24:38 +00:00
|
|
|
// Purpose: interface of wxSVGFileDC
|
2008-03-08 13:52:38 +00:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
2010-07-13 13:29:13 +00:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxSVGFileDC
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-04-19 08:12:58 +00:00
|
|
|
A wxSVGFileDC is a device context onto which graphics and text can be
|
|
|
|
drawn, and the output produced as a vector file, in SVG format (see the W3C
|
|
|
|
SVG Specifications <http://www.w3.org/TR/2001/REC-SVG-20010904/>). This
|
|
|
|
format can be read by a range of programs, including a Netscape plugin
|
|
|
|
(Adobe), full details are given in the SVG Implementation and Resource
|
|
|
|
Directory <http://www.svgi.org/>. Vector formats may often be smaller than
|
|
|
|
raster formats.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
The intention behind wxSVGFileDC is that it can be used to produce a file
|
2008-04-19 08:12:58 +00:00
|
|
|
corresponding to the screen display context, wxSVGFileDC, by passing the
|
|
|
|
wxSVGFileDC as a parameter instead of a wxSVGFileDC. Thus the wxSVGFileDC
|
|
|
|
is a write-only class.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-04-19 08:12:58 +00:00
|
|
|
As the wxSVGFileDC is a vector format, raster operations like GetPixel()
|
|
|
|
are unlikely to be supported. However, the SVG specification allows for PNG
|
|
|
|
format raster files to be embedded in the SVG, and so bitmaps, icons and
|
|
|
|
blit operations in wxSVGFileDC are supported.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-04-19 08:12:58 +00:00
|
|
|
A more substantial SVG library (for reading and writing) is available at
|
|
|
|
the wxArt2D website <http://wxart2d.sourceforge.net/>.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
2008-04-19 08:12:58 +00:00
|
|
|
@category{dc}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxSVGFileDC : public wxDC
|
|
|
|
{
|
|
|
|
public:
|
2008-04-20 23:50:56 +00:00
|
|
|
/**
|
|
|
|
Initializes a wxSVGFileDC with the given @a f filename with the given
|
|
|
|
@a Width and @a Height at @a dpi resolution.
|
|
|
|
*/
|
2008-11-13 21:32:53 +00:00
|
|
|
wxSVGFileDC(const wxString& filename, int width = 320, int height = 240, double dpi = 72);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor.
|
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual ~wxSVGFileDC();
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-20 23:50:56 +00:00
|
|
|
Does nothing.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void EndDoc();
|
|
|
|
|
|
|
|
/**
|
2008-04-20 23:50:56 +00:00
|
|
|
Does nothing.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void EndPage();
|
|
|
|
|
|
|
|
/**
|
2009-01-10 23:07:44 +00:00
|
|
|
This makes no sense in wxSVGFileDC and does nothing.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2009-01-10 23:07:44 +00:00
|
|
|
void Clear();
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2009-01-10 23:07:44 +00:00
|
|
|
Does the same as wxDC::SetLogicalFunction(), except that only wxCOPY is
|
|
|
|
available. Trying to set one of the other values will fail.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2009-01-10 23:07:44 +00:00
|
|
|
void SetLogicalFunction(wxRasterOperationMode function);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
2009-01-10 23:07:44 +00:00
|
|
|
Functions not implemented in this DC class.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2009-01-10 23:07:44 +00:00
|
|
|
void CrossHair(wxCoord x, wxCoord y);
|
|
|
|
void DestroyClippingRegion();
|
|
|
|
bool FloodFill(wxCoord x, wxCoord y, const wxColour& colour,
|
|
|
|
wxFloodFillStyle style = wxFLOOD_SURFACE);
|
2008-11-15 11:37:43 +00:00
|
|
|
void GetClippingBox(wxCoord *x, wxCoord *y, wxCoord *width, wxCoord *height) const;
|
2008-10-13 11:09:56 +00:00
|
|
|
bool GetPixel(wxCoord x, wxCoord y, wxColour* colour) const;
|
2008-03-08 13:52:38 +00:00
|
|
|
void SetClippingRegion(wxCoord x, wxCoord y, wxCoord width,
|
|
|
|
wxCoord height);
|
2008-03-08 14:43:31 +00:00
|
|
|
void SetClippingRegion(const wxPoint& pt, const wxSize& sz);
|
|
|
|
void SetClippingRegion(const wxRect& rect);
|
|
|
|
void SetClippingRegion(const wxRegion& region);
|
2008-03-08 13:52:38 +00:00
|
|
|
void SetPalette(const wxPalette& palette);
|
|
|
|
bool StartDoc(const wxString& message);
|
2009-01-10 23:07:44 +00:00
|
|
|
//@}
|
2008-03-08 13:52:38 +00:00
|
|
|
};
|
2008-03-10 15:24:38 +00:00
|
|
|
|