X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/adaaa68635b4c8a4d8c5284add40366ea3eefb07..40ae960071c5d74e167c7fd596122ed7d9e766b9:/interface/wx/dcsvg.h diff --git a/interface/wx/dcsvg.h b/interface/wx/dcsvg.h index ccf2f89689..0efdf5a17b 100644 --- a/interface/wx/dcsvg.h +++ b/interface/wx/dcsvg.h @@ -36,21 +36,11 @@ class wxSVGFileDC : public wxDC { public: - /** - Initializes a wxSVGFileDC with the given @a f filename with a default - size (340x240) at 72.0 dots per inch (a frequent screen resolution). - */ - wxSVGFileDC(wxString f); - /** - Initializes a wxSVGFileDC with the given @a f filename with the given - @a Width and @a Height at 72.0 dots per inch. - */ - wxSVGFileDC(wxString f, int Width, int Height); /** Initializes a wxSVGFileDC with the given @a f filename with the given @a Width and @a Height at @a dpi resolution. */ - wxSVGFileDC(wxString f, int Width, int Height, float dpi); + wxSVGFileDC(const wxString& filename, int width = 320, int height = 240, double dpi = 72); /** Destructor. @@ -66,9 +56,9 @@ public: @see wxDC::Blit() */ 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); + wxDC* source, wxCoord xsrc, wxCoord ysrc, wxRasterOperationMode rop = wxCOPY, + bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, + wxCoord ysrcMask = wxDefaultCoord); /** Adds the specified point to the bounding box which can be retrieved @@ -96,27 +86,27 @@ public: Convert device X coordinate to logical coordinate, using the current mapping mode. */ - wxCoord DeviceToLogicalX(wxCoord x); + wxCoord DeviceToLogicalX(wxCoord x) const; /** 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. */ - wxCoord DeviceToLogicalXRel(wxCoord x); + wxCoord DeviceToLogicalXRel(wxCoord x) const; /** Converts device Y coordinate to logical coordinate, using the current mapping mode. */ - wxCoord DeviceToLogicalY(wxCoord y); + wxCoord DeviceToLogicalY(wxCoord y) const; /** 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. */ - wxCoord DeviceToLogicalYRel(wxCoord y); + wxCoord DeviceToLogicalYRel(wxCoord y) const; /** Draws an arc of a circle, centred on (@a xc, @a yc), with starting @@ -131,7 +121,7 @@ public: /** Draw a bitmap on the device context at the specified point. If - @a transparent is @true and the bitmap has a transparency mask, the + @a useMask 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 @@ -142,7 +132,7 @@ public: @see wxDC::SetTextForeground(), wxDC::SetTextBackground(), wxMemoryDC */ void DrawBitmap(const wxBitmap& bitmap, wxCoord x, wxCoord y, - bool transparent); + bool useMask = false); //@{ /** @@ -240,9 +230,11 @@ public: The programmer is responsible for deleting the list of points. */ void DrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0, - wxCoord yoffset = 0, int fill_style = wxODDEVEN_RULE); + wxCoord yoffset = 0, + wxPolygonFillMode fill_style = wxODDEVEN_RULE); void DrawPolygon(wxList* points, wxCoord xoffset = 0, - wxCoord yoffset = 0, int fill_style = wxODDEVEN_RULE); + wxCoord yoffset = 0, + wxPolygonFillMode fill_style = wxODDEVEN_RULE); //@} /** @@ -279,14 +271,13 @@ public: /** Draws a spline between all given control points, using the current pen. - The programmer is responsible for deleting the list of points. The - spline is drawn using a series of lines, using an algorithm taken from + The programmer is responsible for deleting the list of points. + The spline is drawn using a series of lines, using an algorithm taken from the X drawing program "XFIG". */ - void DrawSpline(wxList* points); + void DrawSpline(const wxPointList* points); + /** - @param string - The text string to measure. Draws a three-point spline using the current pen. */ void DrawSpline(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, @@ -307,11 +298,6 @@ public: */ void EndDoc(); - /** - Does nothing. - */ - void EndDrawing(); - /** Does nothing. */ @@ -320,8 +306,8 @@ public: /** Not implemented. */ - void FloodFill(wxCoord x, wxCoord y, const wxColour& colour, - int style = wxFLOOD_SURFACE); + bool FloodFill(wxCoord x, wxCoord y, const wxColour& colour, + wxFloodFillStyle style = wxFLOOD_SURFACE); //@{ /** @@ -353,17 +339,17 @@ public: /** Gets the character height of the currently set font. */ - wxCoord GetCharHeight(); + wxCoord GetCharHeight() const; /** Gets the average character width of the currently set font. */ - wxCoord GetCharWidth(); + wxCoord GetCharWidth() const; /** Not implemented. */ - void GetClippingBox(wxCoord x, wxCoord y, wxCoord width, wxCoord height); + void GetClippingBox(wxCoord *x, wxCoord *y, wxCoord *width, wxCoord *height) const; //@{ /** @@ -380,14 +366,14 @@ public: @see SetLogicalFunction() */ - int GetLogicalFunction(); + wxRasterOperationMode GetLogicalFunction() const; /** Gets the mapping mode for the device context. @see SetMapMode() */ - int GetMapMode(); + wxMappingMode GetMapMode() const; //@{ /** @@ -402,7 +388,7 @@ public: /** Not implemented. */ - bool GetPixel(wxCoord x, wxCoord y, wxColour* colour); + bool GetPixel(wxCoord x, wxCoord y, wxColour* colour) const; /** For a Windows printer device context, this gets the horizontal and @@ -417,7 +403,7 @@ public: @see SetTextBackground() */ wxColour GetTextBackground() const; - const wxColour GetTextBackground() const; + const wxColour& GetTextBackground() const; //@} /** @@ -435,17 +421,17 @@ public: @param externalLeading Any extra vertical space added to the font by the font designer (usually is zero). - - The optional parameter @a 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. + @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. @see wxFont, SetFont() */ void GetTextExtent(const wxString& string, wxCoord* w, wxCoord* h, wxCoord* descent = NULL, wxCoord* externalLeading = NULL, - wxFont* font = NULL); + const wxFont* font = NULL) const; //@{ /** @@ -462,59 +448,59 @@ public: @see SetUserScale() */ - void GetUserScale(double x, double y); + void GetUserScale(double* x, double* y) const; /** Converts logical X coordinate to device coordinate, using the current mapping mode. */ - wxCoord LogicalToDeviceX(wxCoord x); + wxCoord LogicalToDeviceX(wxCoord x) const; /** 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. */ - wxCoord LogicalToDeviceXRel(wxCoord x); + wxCoord LogicalToDeviceXRel(wxCoord x) const; /** Converts logical Y coordinate to device coordinate, using the current mapping mode. */ - wxCoord LogicalToDeviceY(wxCoord y); + wxCoord LogicalToDeviceY(wxCoord y) const; /** 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. */ - wxCoord LogicalToDeviceYRel(wxCoord y); + wxCoord LogicalToDeviceYRel(wxCoord y) const; /** Gets the maximum horizontal extent used in drawing commands so far. */ - wxCoord MaxX(); + wxCoord MaxX() const; /** Gets the maximum vertical extent used in drawing commands so far. */ - wxCoord MaxY(); + wxCoord MaxY() const; /** Gets the minimum horizontal extent used in drawing commands so far. */ - wxCoord MinX(); + wxCoord MinX() const; /** Gets the minimum vertical extent used in drawing commands so far. */ - wxCoord MinY(); + wxCoord MinY() const; /** Returns @true if the DC is ok to use. @false values arise from being unable to write the file. */ - bool Ok(); + bool IsOk(); /** Resets the bounding box. After a call to this function, the bounding @@ -587,9 +573,9 @@ public: /** Does the same as wxDC::SetLogicalFunction(), except that only wxCOPY is - avalaible. Trying to set one of the othe values will fail. + available. Trying to set one of the other values will fail. */ - void SetLogicalFunction(int function); + void SetLogicalFunction(wxRasterOperationMode function); /** The mapping mode of the device context defines the unit of measurement @@ -615,7 +601,7 @@ public: - wxMM_LOMETRIC - Each logical unit is 1/10 of a mm. - wxMM_TEXT - Each logical unit is 1 pixel. */ - void SetMapMode(int mode); + void SetMapMode(wxMappingMode mode); /** Not implemented.