20#include <glibmm/i18n.h>
21#include <glibmm/markup.h>
50class SnapCandidatePoint;
61 _changed_connection(),
62 _transformed_connection()
77 this->
child =
nullptr;
102 this->
child =
nullptr;
110 this->
href =
nullptr;
140 if ( value && this->
href && (
strcmp(value, this->
href) == 0 ) ) {
144 this->
href =
nullptr;
191 text->rebuildLayout();
217 std::optional<Geom::PathVector>
result;
231 *
original->i2doc_affine().inverse()
306 ai->setPickChildren(
false);
314 ai->prependChild(ac);
370 for (
int i = 0; i < depth; ++i) {
400 for (
int i = 0; i < depth; ++i) {
442 std::vector<SPItem const *>
chain;
443 chain.push_back(
this);
455 for (
auto i=
chain.rbegin(); i!=
chain.rend(); ++i) {
463 t = t *
i_use->get_xy_offset();
466 t *=
i_tem->transform;
600 this->
child =
nullptr;
620 for (
auto &v :
views) {
623 v.drawingitem->prependChild(
ai);
692 for (
auto &v :
views) {
700 for (
auto &v :
views) {
703 g->setChildTransform(t);
713 for (
auto &v :
views) {
756 copy =
xml_doc->createElement(
"svg:g");
757 copy->setAttribute(
"display",
"none");
768 copy->setAttribute(
"display",
"none");
782 newLPEObj->forkPathEffectsIfNecessary(1,
true,
true);
792 unlinked->removeAttribute(
"display");
807 copy->removeAttribute(
"inkscape:tiled-clone-of");
808 copy->removeAttribute(
"inkscape:tile-w");
809 copy->removeAttribute(
"inkscape:tile-h");
810 copy->removeAttribute(
"inkscape:tile-cx");
811 copy->removeAttribute(
"inkscape:tile-cy");
835 ref = this->ref->getObject();
849 std::vector<Inkscape::SnapCandidatePoint>
vec_pts;
870 objects.emplace_back(linked);
Lookup dictionary for attributes/properties.
TODO: insert short description here.
3x3 matrix representing an affine transformation.
bool isTranslation(Coord eps=EPSILON) const
Check whether this matrix represents a pure translation.
Affine inverse() const
Compute the inverse matrix.
Affine withoutTranslation() const
Axis-aligned rectangle that can be empty.
Two-dimensional point that doubles as a vector.
void setChildTransform(Geom::Affine const &)
Set additional transform for the group.
SVG drawing item for display.
virtual void setStyle(SPStyle const *style, SPStyle const *context_style=nullptr)
Process information related to the new style.
Preference storage class.
static Preferences * get()
Access the singleton Preferences object.
int getInt(Glib::ustring const &pref_path, int def=0)
Retrieve an integer.
Storing of snapping preferences.
URI const * getURI() const
Returns a pointer to a URI containing the currently attached URI, or NULL if no URI is currently atta...
void detach()
Detaches from the currently attached URI target, if any; the current referrent is signaled as NULL.
sigc::signal< void(SPObject *, SPObject *)> changedSignal()
Accessor for the referrent change notification signal; this signal is emitted whenever the URIReferen...
void attach(URI const &uri)
Attaches to a URI, relative to the specified document.
Represents an URI as per RFC 2396.
std::string str(char const *baseuri=nullptr) const
Return the string representation of this URI.
Interface for refcounted XML nodes.
virtual Node * parent()=0
Get the parent of this node.
void setAttributeOrRemoveIfEmpty(Inkscape::Util::const_char_ptr key, Inkscape::Util::const_char_ptr value)
Change an attribute of this node.
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.
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.
void writeDimensions(Inkscape::XML::Node *) const
Write the geometric properties (x/y/width/height) to XML attributes, if they are set.
Typed SVG document implementation.
Inkscape::XML::Document * getReprDoc()
Our Inkscape::XML::Document.
SPObject * getObjectByRepr(Inkscape::XML::Node *repr) const
Base class for visual SVG elements.
Geom::Affine i2dt_affine() const
Returns the transformation from item to desktop coords.
void update(SPCtx *ctx, unsigned int flags) override
Geom::OptRect bounds(BBoxType type, Geom::Affine const &transform=Geom::identity()) const
virtual void snappoints(std::vector< Inkscape::SnapCandidatePoint > &p, Inkscape::SnapPreferences const *snapprefs) const
Inkscape::XML::Node * write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned int flags) override
Inkscape::DrawingItem * invoke_show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags)
void set(SPAttr key, char const *value) override
SPMask * getMaskObject() const
sigc::connection connectTransformed(sigc::slot< void(Geom::Affine const *, SPItem *)> slot)
void invoke_print(SPPrintContext *ctx)
void invoke_hide(unsigned int key)
Geom::Affine i2doc_affine() const
Returns the accumulated transformation of the item and all its ancestors, including root's viewport.
char * detailedDescription() const
Returns a string suitable for status bar, formatted in pango markup language.
void build(SPDocument *document, Inkscape::XML::Node *repr) override
void doWriteTransform(Geom::Affine const &transform, Geom::Affine const *adv=nullptr, bool compensate=true)
Set a new transform on an object.
std::vector< SPItemView > views
SPClipPath * getClipObject() const
SPObject is an abstract base class of all of the document nodes at the SVG document level.
Inkscape::XML::Node * repr
void detach(SPObject *object)
Remove object from parent's children, release and unref it.
sigc::connection connectDelete(sigc::slot< void(SPObject *)> slot)
Connects a slot to be called when an object is deleted.
void invoke_build(SPDocument *document, Inkscape::XML::Node *repr, unsigned int cloned)
void attach(SPObject *object, SPObject *prev)
Put object into object tree, under parent, and behind prev; also update object's XML space.
void updateDisplay(SPCtx *ctx, unsigned int flags)
Updates the object's display immediately.
void emitModified(unsigned int flags)
Emits the MODIFIED signal with the object's flags.
SPStyle * style
Represents the style properties, whether from presentation attributes, the style attribute,...
void setSuccessor(SPObject *successor)
Indicates that another object supercedes this one.
SPStyle * context_style
Represents the style that should be used to resolve 'context-fill' and 'context-stroke'.
void readAttr(char const *key)
Read value of key attribute from XML node into object.
void deleteObject(bool propagate, bool propagate_descendants)
Deletes an object, unparenting it from its parent.
Inkscape::XML::Node * getRepr()
Returns the XML representation of tree.
char const * getAttribute(char const *name) const
char * title() const
Returns the title of this object, or NULL if there is none.
virtual void getLinked(std::vector< SPObject * > &objects, LinkedObjectNature direction=LinkedObjectNature::ANY) const
Get objects which are linked to this object as either a source or a target.
void addChild(Inkscape::XML::Node *child, Inkscape::XML::Node *prev=nullptr)
void requestDisplayUpdate(unsigned int flags)
Queues an deferred update of this object's display.
void cascade(SPStyle const *parent)
Sets computed values in style, which may involve inheriting from (or in some other way calculating fr...
SPItem * getObject() const
Geom::Affine get_root_transform() const
Returns the effective transform that goes from the ultimate original to given SPUse,...
const char * typeName() const override
The item's type name, not node tag name.
SPItem * get_original() const
SPItem * trueOriginal() const
Returns the ultimate original of a SPUse, i.e., the first object in the chain of uses which is not it...
void update(SPCtx *ctx, unsigned int flags) override
void getLinked(std::vector< SPObject * > &objects, LinkedObjectNature direction=LinkedObjectNature::ANY) const override
Get objects which are linked to this object as either a source or a target.
void move_compensate(Geom::Affine const *mp)
Sensing a movement of the original, this function attempts to compensate for it in such a way that th...
void build(SPDocument *doc, Inkscape::XML::Node *repr) override
sigc::connection _delete_connection
bool has_xy_offset() const
Geom::Affine get_parent_transform() const
Returns the transform that leads to the use from its immediate original.
void snappoints(std::vector< Inkscape::SnapCandidatePoint > &p, Inkscape::SnapPreferences const *snapprefs) const override
void hide(unsigned int key) override
Inkscape::DrawingItem * show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) override
std::optional< Geom::PathVector > documentExactBounds() const override
Get an exact geometric shape representing the visual bounds of the item in the document coordinates.
int cloneDepth() const
Get the number of dereferences or calls to get_original() needed to get an object which is not an svg...
void print(SPPrintContext *ctx) override
const char * displayName() const override
The item's type name as a translated human string.
SPItem * root()
Returns the ultimate original of a SPUse (i.e.
Geom::Translate get_xy_offset() const
sigc::connection _changed_connection
void modified(unsigned int flags) override
Geom::OptRect bbox(Geom::Affine const &transform, SPItem::BBoxType bboxtype) const override
sigc::connection _transformed_connection
bool anyInChain(bool(*predicate)(SPItem const *)) const
Test the passed predicate on all items in a chain of uses.
char * description() const override
void set(SPAttr key, char const *value) override
Inkscape::XML::Node * write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned int flags) override
void readOrUnset(char const *str, Unit u=NONE, float v=0, float c=0)
void unset(Unit u=NONE, float v=0, float c=0)
ObserverPredicate predicate
Group belonging to an SVG drawing element.
@ SP_CLONE_ORPHANS_UNLINK
@ SP_CLONE_ORPHANS_DELETE
@ SP_CLONE_COMPENSATION_UNMOVED
@ SP_CLONE_COMPENSATION_PARALLEL
@ SP_CLONE_COMPENSATION_NONE
Affine identity()
Create an identity matrix.
static R & anchor(R &r)
Increments the reference count of a anchored object.
static R & release(R &r)
Decrements the reference count of a anchored object.
Helper class to stream background task notifications as a series of messages.
std::pair< char const *, char const * > getHrefAttribute(XML::Node const &node)
Get the 'href' or 'xlink:href' (fallback) attribute from an XML node.
static T clip(T const &v, T const &a, T const &b)
static cairo_user_data_key_t key
Singleton class to access the preferences file in a convenient way.
Some utility classes to store various kinds of snap candidates.
TODO: insert short description here.
TODO: insert short description here.
SPObject * sp_object_unref(SPObject *object, SPObject *owner)
Decrease reference count of object, with possible debugging and finalization.
SPObject * sp_object_ref(SPObject *object, SPObject *owner)
Increase reference count of object, with possible debugging.
unsigned cascade_flags(unsigned flags)
SPRoot: SVG <svg> implementation.
Interface for XML documents.
static std::string get_type_string(Inkscape::XML::Node const &node)
static SPObject * createObject(std::string const &id)
Contains transformations to document/viewport and the viewport size.
SPStyle - a style object for SPItem objects.
Interface for XML documents.