/usr/include/wxSVG/SVGCanvas.h is in libwxsvg-dev 2:1.2~dfsg0-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | /////////////////////////////////////////////////////////////////////////////
// Name: SVGCanvas.h
// Purpose: wxSVGCanvas - Base class for SVG renders (backends)
// Author: Alex Thuering
// Created: 2005/05/02
// RCS-ID: $Id: SVGCanvas.h,v 1.14 2013/08/25 12:53:34 ntalex Exp $
// Copyright: (c) 2005 Alex Thuering
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef WX_SVG_CANVAS_H
#define WX_SVG_CANVAS_H
class wxSVGDocument;
#include "SVGCanvasItem.h"
/** Base class for SVG-Renders (backends) */
class wxSVGCanvas: public wxObject {
public:
wxSVGCanvas(): m_itemsCached(true) {}
virtual ~wxSVGCanvas() {}
virtual void Init(int width, int height, bool alpha = false) = 0;
virtual int GetWidth() = 0;
virtual int GetHeight() = 0;
virtual wxImage GetImage() = 0;
virtual void Clear(wxRGBColor color = wxRGBColor(0xFF,0xFF,0xFF)) = 0;
virtual wxSVGCanvasPath* CreateCanvasPath(wxSVGMatrix* matrix = NULL) = 0;
wxSVGCanvasItem* CreateItem(wxSVGLineElement* element);
wxSVGCanvasItem* CreateItem(wxSVGPolylineElement* element);
wxSVGCanvasItem* CreateItem(wxSVGPolygonElement* element);
wxSVGCanvasItem* CreateItem(wxSVGRectElement* element);
wxSVGCanvasItem* CreateItem(wxSVGCircleElement* element);
wxSVGCanvasItem* CreateItem(wxSVGEllipseElement* element);
wxSVGCanvasItem* CreateItem(wxSVGPathElement* element);
virtual wxSVGCanvasItem* CreateItem(wxSVGTextElement* element, const wxCSSStyleDeclaration* style = NULL,
wxSVGMatrix* matrix = NULL) = 0;
virtual wxSVGCanvasItem* CreateItem(wxSVGImageElement* element, const wxCSSStyleDeclaration* style = NULL,
wxProgressDialog* progressDlg = NULL) = 0;
virtual wxSVGCanvasItem* CreateItem(wxSVGVideoElement* element, const wxCSSStyleDeclaration* style = NULL,
wxProgressDialog* progressDlg = NULL) = 0;
virtual void DrawItem(wxSVGCanvasItem& item, wxSVGMatrix& matrix,
const wxCSSStyleDeclaration& style, wxSVGSVGElement& svgElem) = 0;
void DrawLine(wxSVGLineElement* element, wxSVGMatrix* matrix, const wxCSSStyleDeclaration* style = NULL);
void DrawPolyline(wxSVGPolylineElement* element, wxSVGMatrix* matrix, const wxCSSStyleDeclaration* style = NULL);
void DrawPolygon(wxSVGPolygonElement* element, wxSVGMatrix* matrix, const wxCSSStyleDeclaration* style = NULL);
void DrawRect(wxSVGRectElement* element, wxSVGMatrix* matrix, const wxCSSStyleDeclaration* style = NULL);
void DrawCircle(wxSVGCircleElement* element, wxSVGMatrix* matrix, const wxCSSStyleDeclaration* style = NULL);
void DrawEllipse(wxSVGEllipseElement* element, wxSVGMatrix* matrix, const wxCSSStyleDeclaration* style = NULL);
void DrawPath(wxSVGPathElement* element, wxSVGMatrix* matrix, const wxCSSStyleDeclaration* style = NULL);
void DrawText(wxSVGTextElement* element, wxSVGMatrix* matrix, const wxCSSStyleDeclaration* style = NULL);
void DrawImage(wxSVGImageElement* element, wxSVGMatrix* matrix, const wxCSSStyleDeclaration* style = NULL,
const wxSVGRect* rect = NULL, wxProgressDialog* progressDlg = NULL);
void DrawVideo(wxSVGVideoElement* element, wxSVGMatrix* matrix, const wxCSSStyleDeclaration* style = NULL,
wxProgressDialog* progressDlg = NULL);
void RenderElement(wxSVGElement* elem, const wxSVGRect* rect, const wxSVGMatrix* parentMatrix,
const wxCSSStyleDeclaration* parentStyle, wxSVGSVGElement* ownerSVGElement, wxSVGElement* viewportElement,
wxProgressDialog* progressDlg);
bool IsItemsCached() { return m_itemsCached; }
void EnableItemsCache(bool enable = true) { m_itemsCached = enable; }
protected:
bool m_itemsCached;
virtual void DrawCanvasText(wxSVGCanvasText& canvasText, wxSVGMatrix& matrix, const wxCSSStyleDeclaration& style,
wxSVGSVGElement& svgElem);
wxSVGGradientElement* GetGradientElement(const wxSVGSVGElement& svgElem, const wxString& href);
unsigned int GetGradientStops(const wxSVGSVGElement& svgElem, wxSVGGradientElement* gradElem, float opacity);
virtual void SetStopValue(unsigned int index, float offset, float opacity, const wxRGBColor& RGBColor) = 0;
virtual void AllocateGradientStops(unsigned int stop_count) = 0;
void GetLinearGradientVector(wxSVGPoint& p1, wxSVGPoint& p2, const wxSVGLinearGradientElement& gradElem,
wxSVGCanvasPath& path);
void GetRadialGradientTransform(wxSVGPoint& Focus, wxSVGMatrix& matrix, const wxSVGRadialGradientElement& gradElem,
wxSVGCanvasPath& path, bool scale = false);
void RenderChilds(wxSVGElement* parent, const wxSVGRect* rect, const wxSVGMatrix* parentMatrix,
const wxCSSStyleDeclaration* parentStyle, wxSVGSVGElement* ownerSVGElement, wxSVGElement* viewportElement,
wxProgressDialog* progressDlg);
void LoadImages(wxSVGElement* parent1, wxSVGElement* parent2, wxProgressDialog* progressDlg);
};
#define WX_SVG_CREATE_M_CANVAS_ITEM \
if (m_canvasItem == NULL)\
m_canvasItem = ((wxSVGDocument*) GetOwnerDocument())->GetCanvas()->CreateItem(this);
#define WX_SVG_CLEAR_M_CANVAS_ITEM \
if (!((wxSVGDocument*) GetOwnerDocument())->GetCanvas()->IsItemsCached())\
{\
delete m_canvasItem;\
m_canvasItem = NULL;\
}
#endif // WX_SVG_CANVAS_H
|