66 if (!this->
getRepr()->attribute(
"version")) {
122 if (!this->
x.
read(value)) {
133 if (!this->
y.
read(value)) {
167 this->
onload = (
char *) value;
214 this->
defs =
nullptr;
295 for (
auto &v :
views) {
297 g->setChildTransform(
c2p);
327 }
else if (this->
root_x) {
334 }
else if (this->
root_y) {
359 g->setChildTransform(this->
c2p);
376 ctx->bind(this->
c2p, 1.0);
3x3 affine transformation matrix.
Lookup dictionary for attributes/properties.
static CRect from_xywh(Coord x, Coord y, Coord w, Coord h)
Create rectangle from origin and dimensions.
C height() const
Get the vertical extent of the rectangle.
C width() const
Get the horizontal extent of the rectangle.
SVG drawing item for display.
static double convert(double from_dist, Unit const *from, Unit const *to)
Convert distances.
static std::optional< Version > from_string(const char *version_string)
Build a Version form a string, returning an empty optional in case of error.
std::string const & str() const
Interface for refcounted XML nodes.
void setAttribute(Util::const_char_ptr key, Util::const_char_ptr value)
Change an attribute of this node.
virtual char const * attribute(char const *key) const =0
Get the string representation of a node's attribute.
bool setAttributeSvgDouble(Util::const_char_ptr key, double val)
For attributes where an exponent is allowed.
void calcDimsFromParentViewport(const SPItemCtx *ictx, bool assign_to_set=false, SPDimensions const *use=nullptr)
Update computed x/y/width/height for "percent" units and/or from its referencing clone parent.
Typed SVG document implementation.
SPObject * getObjectByRepr(Inkscape::XML::Node *repr) const
SPNamedView * getNamedView()
Get the namedview for this document, creates it if it's not found.
Inkscape::Util::Unit const * getDisplayUnit()
guaranteed not to return nullptr
Inkscape::DrawingItem * show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) override
void remove_child(Inkscape::XML::Node *child) override
void print(SPPrintContext *ctx) override
Inkscape::XML::Node * write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned int flags) override
void set(SPAttr key, char const *value) override
void build(SPDocument *document, Inkscape::XML::Node *repr) override
void child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) override
void modified(unsigned int flags) override
void update(SPCtx *ctx, unsigned int flags) override
std::vector< SPItemView > views
void updateViewPort()
Update the visibility of the viewport space.
SPObject is an abstract base class of all of the document nodes at the SVG document level.
Inkscape::XML::Node * repr
void readAttr(char const *key)
Read value of key attribute from XML node into object.
Inkscape::XML::Node * getRepr()
Returns the XML representation of tree.
void requestDisplayUpdate(unsigned int flags)
Queues an deferred update of this object's display.
Inkscape::Version inkscape_version
void build(SPDocument *document, Inkscape::XML::Node *repr) override
Inkscape::XML::Node * write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned int flags) override
Inkscape::Version svg_version
void set(SPAttr key, char const *value) override
void remove_child(Inkscape::XML::Node *child) override
Inkscape::DrawingItem * show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) override
void print(SPPrintContext *ctx) override
void child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) override
void update(SPCtx *ctx, unsigned int flags) override
const char * displayName() const override
The item's type name as a translated human string.
void modified(unsigned int flags) override
const char * typeName() const override
The item's type name, not node tag name.
SPDefs * defs
Primary <defs> element where we put new defs (patterns, gradients etc.).
void set_viewBox(const gchar *value)
void set_preserveAspectRatio(const gchar *value)
void write_preserveAspectRatio(Inkscape::XML::Node *repr) const
Write preserveAspectRatio attribute to XML, if set.
SPItemCtx get_rctx(const SPItemCtx *ictx, double scale_none=1.0)
void write_viewBox(Inkscape::XML::Node *repr) const
Write viewBox attribute to XML, if set.
void set(Unit u, float v)
bool read(char const *str)
void unset(Unit u=NONE, float v=0, float c=0)
static char const *const parent
Group belonging to an SVG drawing element.
Affine identity()
Create an identity matrix.
Helper class to stream background task notifications as a series of messages.
static cairo_user_data_key_t key
Some things pertinent to all visible shapes: SPItem, SPItemView, SPItemCtx.
SPRoot: SVG <svg> implementation.
Interface for XML documents.
Contains transformations to document/viewport and the viewport size.
std::string sp_svg_length_write_with_units(SVGLength const &length)
N.B. This routine will sometimes return strings with āeā notation, so is unsuitable for CSS lengths (...
Interface for XML documents.