2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: dcsvg.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxSVGFileDC
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxSVGFileDC
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-04-19 04:12:58 -04: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 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
The intention behind wxSVGFileDC is that it can be used to produce a file
|
2008-04-19 04:12:58 -04: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 09:43:31 -05:00
|
|
|
|
2008-04-19 04:12:58 -04: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 09:43:31 -05:00
|
|
|
|
2008-04-19 04:12:58 -04:00
|
|
|
A more substantial SVG library (for reading and writing) is available at
|
|
|
|
the wxArt2D website <http://wxart2d.sourceforge.net/>.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
2008-04-19 04:12:58 -04:00
|
|
|
@category{dc}
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxSVGFileDC : public wxDC
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Initializes a wxSVGFileDC with the given @a f filename with a default
|
|
|
|
size (340x240) at 72.0 dots per inch (a frequent screen resolution).
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxSVGFileDC(wxString f);
|
2008-04-20 19:50:56 -04:00
|
|
|
/**
|
|
|
|
Initializes a wxSVGFileDC with the given @a f filename with the given
|
|
|
|
@a Width and @a Height at 72.0 dots per inch.
|
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxSVGFileDC(wxString f, int Width, int Height);
|
2008-04-20 19:50:56 -04:00
|
|
|
/**
|
|
|
|
Initializes a wxSVGFileDC with the given @a f filename with the given
|
|
|
|
@a Width and @a Height at @a dpi resolution.
|
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxSVGFileDC(wxString f, int Width, int Height, float dpi);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual ~wxSVGFileDC();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Copies from a source DC to this DC, specifying the destination
|
2008-03-08 08:52:38 -05:00
|
|
|
coordinates, size of area to copy, source DC, source coordinates,
|
2008-04-20 19:50:56 -04:00
|
|
|
logical function, whether to use a bitmap mask, and mask source
|
|
|
|
position.
|
|
|
|
|
|
|
|
@see wxDC::Blit()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-04-20 19:50:56 -04:00
|
|
|
bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
|
|
|
wxSVGFileDC* source, wxCoord xsrc, wxCoord ysrc,
|
|
|
|
int logicalFunc = wxCOPY, bool useMask = FALSE,
|
|
|
|
wxCoord xsrcMask = -1, wxCoord ysrcMask = -1);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Adds the specified point to the bounding box which can be retrieved
|
|
|
|
with wxDC::MinX(), wxDC::MaxX() and wxDC::MinY(), wxDC::MaxY()
|
|
|
|
functions.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void CalcBoundingBox(wxCoord x, wxCoord y);
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
This makes no sense in wxSVGFileDC and does nothing.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void Clear();
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Not Implemented.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void CrossHair(wxCoord x, wxCoord y);
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Not Implemented.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void DestroyClippingRegion();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Convert device X coordinate to logical coordinate, using the current
|
|
|
|
mapping mode.
|
|
|
|
*/
|
2008-10-13 07:09:56 -04:00
|
|
|
wxCoord DeviceToLogicalX(wxCoord x) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Convert device X coordinate to relative logical coordinate, using the
|
|
|
|
current mapping mode but ignoring the x axis orientation. Use this
|
|
|
|
function for converting a width, for example.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-13 07:09:56 -04:00
|
|
|
wxCoord DeviceToLogicalXRel(wxCoord x) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Converts device Y coordinate to logical coordinate, using the current
|
|
|
|
mapping mode.
|
|
|
|
*/
|
2008-10-13 07:09:56 -04:00
|
|
|
wxCoord DeviceToLogicalY(wxCoord y) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Convert device Y coordinate to relative logical coordinate, using the
|
|
|
|
current mapping mode but ignoring the y axis orientation. Use this
|
|
|
|
function for converting a height, for example.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-13 07:09:56 -04:00
|
|
|
wxCoord DeviceToLogicalYRel(wxCoord y) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Draws an arc of a circle, centred on (@a xc, @a yc), with starting
|
|
|
|
point (@a x1, @a y1) and ending at (@a x2, @a y2). The current pen is
|
|
|
|
used for the outline and the current brush for filling the shape.
|
|
|
|
|
|
|
|
The arc is drawn in a counter-clockwise direction from the start point
|
|
|
|
to the end point.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void DrawArc(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
|
|
|
|
wxCoord xc, wxCoord yc);
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Draw a bitmap on the device context at the specified point. If
|
|
|
|
@a transparent is @true and the bitmap has a transparency mask, the
|
|
|
|
bitmap will be drawn transparently.
|
|
|
|
|
|
|
|
When drawing a mono-bitmap, the current text foreground colour will be
|
|
|
|
used to draw the foreground of the bitmap (all bits set to 1), and the
|
|
|
|
current text background colour to draw the background (all bits set to
|
|
|
|
0).
|
|
|
|
|
|
|
|
@see wxDC::SetTextForeground(), wxDC::SetTextBackground(), wxMemoryDC
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void DrawBitmap(const wxBitmap& bitmap, wxCoord x, wxCoord y,
|
|
|
|
bool transparent);
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Draws a check mark inside the given rectangle.
|
|
|
|
*/
|
2008-04-20 19:50:56 -04:00
|
|
|
void DrawCheckMark(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
2008-03-09 08:33:59 -04:00
|
|
|
void DrawCheckMark(const wxRect& rect);
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Draws a circle with the given centre and radius.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-04-20 19:50:56 -04:00
|
|
|
@see wxDC::DrawEllipse()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void DrawCircle(wxCoord x, wxCoord y, wxCoord radius);
|
2008-03-08 09:43:31 -05:00
|
|
|
void DrawCircle(const wxPoint& pt, wxCoord radius);
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Draws an ellipse contained in the rectangle specified either with the
|
|
|
|
given top left corner and the given size or directly. The current pen
|
|
|
|
is used for the outline and the current brush for filling the shape.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-04-20 19:50:56 -04:00
|
|
|
@see wxDC::DrawCircle()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-04-20 19:50:56 -04:00
|
|
|
void DrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
2008-03-08 09:43:31 -05:00
|
|
|
void DrawEllipse(const wxPoint& pt, const wxSize& size);
|
|
|
|
void DrawEllipse(const wxRect& rect);
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Draws an arc of an ellipse. The current pen is used for drawing the arc
|
|
|
|
and the current brush is used for drawing the pie.
|
|
|
|
|
|
|
|
@a x and @a y specify the x and y coordinates of the upper-left corner
|
|
|
|
of the rectangle that contains the ellipse.
|
|
|
|
|
|
|
|
@a width and @a height specify the width and height of the rectangle
|
|
|
|
that contains the ellipse.
|
|
|
|
|
|
|
|
@a start and @a end specify the start and end of the arc relative to
|
|
|
|
the three-o'clock position from the center of the rectangle. Angles are
|
|
|
|
specified in degrees (360 is a complete circle). Positive values mean
|
|
|
|
counter-clockwise motion. If @a start is equal to @a end, a complete
|
|
|
|
ellipse will be drawn.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-04-20 19:50:56 -04:00
|
|
|
void DrawEllipticArc(wxCoord x, wxCoord y, wxCoord width, wxCoord height,
|
|
|
|
double start, double end);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Draw an icon on the display (does nothing if the device context is
|
|
|
|
PostScript). This can be the simplest way of drawing bitmaps on a
|
|
|
|
window.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void DrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Draws a line from the first point to the second. The current pen is
|
|
|
|
used for drawing the line.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void DrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Draws lines using an array of @a points of size @a n, or list of
|
2008-03-08 08:52:38 -05:00
|
|
|
pointers to points, adding the optional offset coordinate. The current
|
2008-04-20 19:50:56 -04:00
|
|
|
pen is used for drawing the lines. The programmer is responsible for
|
2008-03-08 08:52:38 -05:00
|
|
|
deleting the list of points.
|
|
|
|
*/
|
|
|
|
void DrawLines(int n, wxPoint points[], wxCoord xoffset = 0,
|
|
|
|
wxCoord yoffset = 0);
|
2008-03-09 08:33:59 -04:00
|
|
|
void DrawLines(wxList* points, wxCoord xoffset = 0,
|
2008-03-08 09:43:31 -05:00
|
|
|
wxCoord yoffset = 0);
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Draws a point using the current pen.
|
|
|
|
*/
|
|
|
|
void DrawPoint(wxCoord x, wxCoord y);
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Draws a filled polygon using an array of @a points of size @a n,
|
2008-03-08 08:52:38 -05:00
|
|
|
or list of pointers to points, adding the optional offset coordinate.
|
2008-04-20 19:50:56 -04:00
|
|
|
wxWidgets automatically closes the first and last points.
|
|
|
|
|
|
|
|
The last argument specifies the fill rule: @c wxODDEVEN_RULE (the
|
|
|
|
default) or @c wxWINDING_RULE.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
The current pen is used for drawing the outline, and the current brush
|
2008-04-20 19:50:56 -04:00
|
|
|
for filling the shape. Using a transparent brush suppresses filling.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
The programmer is responsible for deleting the list of points.
|
|
|
|
*/
|
|
|
|
void DrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0,
|
2008-04-20 19:50:56 -04:00
|
|
|
wxCoord yoffset = 0, int fill_style = wxODDEVEN_RULE);
|
2008-03-09 08:33:59 -04:00
|
|
|
void DrawPolygon(wxList* points, wxCoord xoffset = 0,
|
2008-04-20 19:50:56 -04:00
|
|
|
wxCoord yoffset = 0, int fill_style = wxODDEVEN_RULE);
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Draws a rectangle with the given top left corner, and with the given
|
|
|
|
size. The current pen is used for the outline and the current brush
|
|
|
|
for filling the shape.
|
|
|
|
*/
|
2008-04-20 19:50:56 -04:00
|
|
|
void DrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-09 08:33:59 -04:00
|
|
|
Draws the text rotated by @a angle degrees.
|
2008-04-20 19:50:56 -04:00
|
|
|
|
|
|
|
The wxMSW wxDC and wxSVGFileDC rotate the text around slightly
|
|
|
|
different points, depending on the size of the font.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void DrawRotatedText(const wxString& text, wxCoord x, wxCoord y,
|
|
|
|
double angle);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Draws a rectangle with the given top left corner, and with the given
|
|
|
|
size. The corners are quarter-circles using the given radius. The
|
|
|
|
current pen is used for the outline and the current brush for filling
|
|
|
|
the shape.
|
2008-04-20 19:50:56 -04:00
|
|
|
|
|
|
|
If @a radius is positive, the value is assumed to be the radius of the
|
|
|
|
rounded corner. If @a radius is negative, the absolute value is assumed
|
|
|
|
to be the @e proportion of the smallest dimension of the rectangle.
|
|
|
|
This means that the corner can be a sensible size relative to the size
|
|
|
|
of the rectangle, and also avoids the strange effects X produces when
|
|
|
|
the corners are too big for the rectangle.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void DrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width,
|
2008-04-20 19:50:56 -04:00
|
|
|
wxCoord height, double radius = 20);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Draws a spline between all given control points, using the current pen.
|
2008-10-04 10:52:38 -04:00
|
|
|
The programmer is responsible for deleting the list of points.
|
|
|
|
The spline is drawn using a series of lines, using an algorithm taken from
|
2008-04-20 19:50:56 -04:00
|
|
|
the X drawing program "XFIG".
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
void DrawSpline(wxList* points);
|
2008-10-04 10:52:38 -04:00
|
|
|
|
2008-04-20 19:50:56 -04:00
|
|
|
/**
|
|
|
|
Draws a three-point spline using the current pen.
|
|
|
|
*/
|
|
|
|
void DrawSpline(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
|
|
|
|
wxCoord x3, wxCoord y3);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Draws a text string at the specified point, using the current text
|
|
|
|
font, and the current text foreground and background colours.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
The coordinates refer to the top-left corner of the rectangle bounding
|
2008-04-20 19:50:56 -04:00
|
|
|
the string. See wxDC::GetTextExtent() for how to get the dimensions of
|
|
|
|
a text string, which can be used to position the text more precisely.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void DrawText(const wxString& text, wxCoord x, wxCoord y);
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Does nothing.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void EndDoc();
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Does nothing.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void EndDrawing();
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Does nothing.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void EndPage();
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Not implemented.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void FloodFill(wxCoord x, wxCoord y, const wxColour& colour,
|
2008-03-09 08:33:59 -04:00
|
|
|
int style = wxFLOOD_SURFACE);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Gets the brush used for painting the background.
|
|
|
|
|
|
|
|
@see SetBackground()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxBrush GetBackground() const;
|
|
|
|
const wxBrush GetBackground() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the current background mode: @c wxSOLID or @c wxTRANSPARENT.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-04-20 19:50:56 -04:00
|
|
|
@see SetBackgroundMode()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetBackgroundMode() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Gets the current brush.
|
|
|
|
|
|
|
|
@see SetBrush()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxBrush GetBrush() const;
|
|
|
|
const wxBrush GetBrush() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the character height of the currently set font.
|
|
|
|
*/
|
2008-10-13 07:09:56 -04:00
|
|
|
wxCoord GetCharHeight() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the average character width of the currently set font.
|
|
|
|
*/
|
2008-10-13 07:09:56 -04:00
|
|
|
wxCoord GetCharWidth() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Not implemented.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-04-20 19:50:56 -04:00
|
|
|
void GetClippingBox(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Gets the current font.
|
|
|
|
|
|
|
|
@see SetFont()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxFont GetFont() const;
|
|
|
|
const wxFont GetFont() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Gets the current logical function.
|
|
|
|
|
|
|
|
@see SetLogicalFunction()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-13 07:09:56 -04:00
|
|
|
int GetLogicalFunction() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Gets the mapping mode for the device context.
|
|
|
|
|
|
|
|
@see SetMapMode()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-13 07:09:56 -04:00
|
|
|
int GetMapMode() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Gets the current pen.
|
|
|
|
|
|
|
|
@see SetPen()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxPen GetPen() const;
|
|
|
|
const wxPen GetPen() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Not implemented.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-13 07:09:56 -04:00
|
|
|
bool GetPixel(wxCoord x, wxCoord y, wxColour* colour) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
For a Windows printer device context, this gets the horizontal and
|
|
|
|
vertical resolution.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
void GetSize(wxCoord* width, wxCoord* height);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Gets the current text background colour.
|
|
|
|
|
|
|
|
@see SetTextBackground()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxColour GetTextBackground() const;
|
2008-10-04 10:52:38 -04:00
|
|
|
const wxColour& GetTextBackground() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the dimensions of the string using the currently selected font.
|
2008-04-20 19:50:56 -04:00
|
|
|
|
|
|
|
@param string
|
|
|
|
The text string to measure.
|
|
|
|
@param w
|
|
|
|
This value will be set to the width after this call.
|
|
|
|
@param h
|
|
|
|
This value will be set to the height after this call.
|
|
|
|
@param descent
|
|
|
|
The dimension from the baseline of the font to the bottom of the
|
|
|
|
descender.
|
|
|
|
@param externalLeading
|
|
|
|
Any extra vertical space added to the font by the font designer
|
|
|
|
(usually is zero).
|
2008-10-04 10:52:38 -04:00
|
|
|
@param font
|
|
|
|
Specifies an alternative to the currently selected font: but note
|
|
|
|
that this does not yet work under Windows, so you need to set a
|
|
|
|
font for the device context first.
|
2008-04-20 19:50:56 -04:00
|
|
|
|
|
|
|
@see wxFont, SetFont()
|
|
|
|
*/
|
|
|
|
void GetTextExtent(const wxString& string, wxCoord* w, wxCoord* h,
|
2008-03-09 08:33:59 -04:00
|
|
|
wxCoord* descent = NULL,
|
|
|
|
wxCoord* externalLeading = NULL,
|
|
|
|
wxFont* font = NULL);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Gets the current text foreground colour.
|
|
|
|
|
|
|
|
@see SetTextForeground()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxColour GetTextForeground() const;
|
|
|
|
const wxColour GetTextForeground() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Gets the current user scale factor.
|
|
|
|
|
|
|
|
@see SetUserScale()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void GetUserScale(double x, double y);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Converts logical X coordinate to device coordinate, using the current
|
|
|
|
mapping mode.
|
|
|
|
*/
|
2008-10-13 07:09:56 -04:00
|
|
|
wxCoord LogicalToDeviceX(wxCoord x) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Converts logical X coordinate to relative device coordinate, using the
|
|
|
|
current mapping mode but ignoring the x axis orientation. Use this for
|
|
|
|
converting a width, for example.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-13 07:09:56 -04:00
|
|
|
wxCoord LogicalToDeviceXRel(wxCoord x) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Converts logical Y coordinate to device coordinate, using the current
|
|
|
|
mapping mode.
|
|
|
|
*/
|
2008-10-13 07:09:56 -04:00
|
|
|
wxCoord LogicalToDeviceY(wxCoord y) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Converts logical Y coordinate to relative device coordinate, using the
|
|
|
|
current mapping mode but ignoring the y axis orientation. Use this for
|
|
|
|
converting a height, for example.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-13 07:09:56 -04:00
|
|
|
wxCoord LogicalToDeviceYRel(wxCoord y) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the maximum horizontal extent used in drawing commands so far.
|
|
|
|
*/
|
2008-10-13 07:09:56 -04:00
|
|
|
wxCoord MaxX() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the maximum vertical extent used in drawing commands so far.
|
|
|
|
*/
|
2008-10-13 07:09:56 -04:00
|
|
|
wxCoord MaxY() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the minimum horizontal extent used in drawing commands so far.
|
|
|
|
*/
|
2008-10-13 07:09:56 -04:00
|
|
|
wxCoord MinX() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the minimum vertical extent used in drawing commands so far.
|
|
|
|
*/
|
2008-10-13 07:09:56 -04:00
|
|
|
wxCoord MinY() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Returns @true if the DC is ok to use. @false values arise from being
|
|
|
|
unable to write the file.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
bool Ok();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Resets the bounding box. After a call to this function, the bounding
|
|
|
|
box doesn't contain anything.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-04-20 19:50:56 -04:00
|
|
|
@see CalcBoundingBox()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void ResetBoundingBox();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the x and y axis orientation (i.e., the direction from lowest to
|
|
|
|
highest values on the axis). The default orientation is the natural
|
|
|
|
orientation, e.g. x axis from left to right and y axis from bottom up.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param xLeftRight
|
2008-04-20 19:50:56 -04:00
|
|
|
@true to set the x axis orientation to the natural left to right
|
|
|
|
orientation, @false to invert it.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param yBottomUp
|
2008-04-20 19:50:56 -04:00
|
|
|
@true to set the y axis orientation to the natural bottom up
|
|
|
|
orientation, @false to invert it.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetAxisOrientation(bool xLeftRight, bool yBottomUp);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the current background brush for the DC.
|
|
|
|
*/
|
|
|
|
void SetBackground(const wxBrush& brush);
|
|
|
|
|
|
|
|
/**
|
2008-03-09 08:33:59 -04:00
|
|
|
@a mode may be one of wxSOLID and wxTRANSPARENT. This setting determines
|
2008-03-08 08:52:38 -05:00
|
|
|
whether text will be drawn with a background colour or not.
|
|
|
|
*/
|
|
|
|
void SetBackgroundMode(int mode);
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Sets the current brush for the DC. If the argument is wxNullBrush, the
|
|
|
|
current brush is selected out of the device context, and the original
|
|
|
|
brush restored, allowing the current brush to be destroyed safely.
|
|
|
|
|
|
|
|
@see wxBrush, wxMemoryDC (for the interpretation of colours
|
|
|
|
when drawing into a monochrome bitmap).
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetBrush(const wxBrush& brush);
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Not implemented.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetClippingRegion(wxCoord x, wxCoord y, wxCoord width,
|
|
|
|
wxCoord height);
|
2008-03-08 09:43:31 -05:00
|
|
|
void SetClippingRegion(const wxPoint& pt, const wxSize& sz);
|
|
|
|
void SetClippingRegion(const wxRect& rect);
|
|
|
|
void SetClippingRegion(const wxRegion& region);
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Sets the device origin (i.e., the origin in pixels after scaling has
|
|
|
|
been applied). This function may be useful in Windows printing
|
2008-03-08 08:52:38 -05:00
|
|
|
operations for placing a graphic on a page.
|
|
|
|
*/
|
|
|
|
void SetDeviceOrigin(wxCoord x, wxCoord y);
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Sets the current font for the DC. It must be a valid font, in
|
|
|
|
particular you should not pass @c wxNullFont to this method.
|
|
|
|
|
|
|
|
@see wxFont
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetFont(const wxFont& font);
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Does the same as wxDC::SetLogicalFunction(), except that only wxCOPY is
|
|
|
|
avalaible. Trying to set one of the othe values will fail.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetLogicalFunction(int function);
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
The mapping mode of the device context defines the unit of measurement
|
|
|
|
used to convert logical units to device units. Note that in X, text
|
|
|
|
drawing isn't handled consistently with the mapping mode; a font is
|
|
|
|
always specified in point size. However, setting the user scale scales
|
|
|
|
the text appropriately. In Windows, scalable TrueType fonts are always
|
|
|
|
used; in X, results depend on availability of fonts, but usually a
|
|
|
|
reasonable match is found.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
Note that the coordinate origin should ideally be selectable, but for
|
|
|
|
now is always at the top left of the screen/printer.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-04-20 19:50:56 -04:00
|
|
|
Drawing to a Windows printer device context under UNIX uses the current
|
|
|
|
mapping mode, but mapping mode is currently ignored for PostScript
|
|
|
|
output.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-04-20 19:50:56 -04:00
|
|
|
The mapping mode can be one of the following:
|
|
|
|
- wxMM_TWIPS - Each logical unit is 1/20 of a point, or 1/1440 of an
|
|
|
|
inch.
|
|
|
|
- wxMM_POINTS - Each logical unit is a point, or 1/72 of an inch.
|
|
|
|
- wxMM_METRIC - Each logical unit is 1 mm.
|
|
|
|
- wxMM_LOMETRIC - Each logical unit is 1/10 of a mm.
|
|
|
|
- wxMM_TEXT - Each logical unit is 1 pixel.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-04-20 19:50:56 -04:00
|
|
|
void SetMapMode(int mode);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Not implemented.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetPalette(const wxPalette& palette);
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Sets the current pen for the DC. If the argument is wxNullPen, the
|
|
|
|
current pen is selected out of the device context, and the original pen
|
|
|
|
restored.
|
|
|
|
|
|
|
|
@see wxMemoryDC (for the interpretation of colours when drawing into a
|
|
|
|
monochrome bitmap)
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetPen(const wxPen& pen);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the current text background colour for the DC.
|
|
|
|
*/
|
|
|
|
void SetTextBackground(const wxColour& colour);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the current text foreground colour for the DC.
|
2008-04-20 19:50:56 -04:00
|
|
|
|
|
|
|
@see wxMemoryDC (for the interpretation of colours when drawing into a
|
|
|
|
monochrome bitmap)
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetTextForeground(const wxColour& colour);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the user scaling factor, useful for applications which require
|
2008-04-20 19:50:56 -04:00
|
|
|
"zooming".
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetUserScale(double xScale, double yScale);
|
|
|
|
|
|
|
|
/**
|
2008-04-20 19:50:56 -04:00
|
|
|
Does nothing.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
bool StartDoc(const wxString& message);
|
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|