Inkscape
Vector Graphics Editor
|
#include <sp-use.h>
Public Member Functions | |
SPUse () | |
~SPUse () override | |
int | tag () const override |
void | build (SPDocument *doc, Inkscape::XML::Node *repr) override |
void | release () 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 | update (SPCtx *ctx, unsigned int flags) override |
void | modified (unsigned int flags) override |
Geom::OptRect | bbox (Geom::Affine const &transform, SPItem::BBoxType bboxtype) const override |
std::optional< Geom::PathVector > | documentExactBounds () const override |
Get an exact geometric shape representing the visual bounds of the item in the document coordinates. | |
const char * | typeName () const override |
The item's type name, not node tag name. | |
const char * | displayName () const override |
The item's type name as a translated human string. | |
char * | description () const override |
void | print (SPPrintContext *ctx) override |
Inkscape::DrawingItem * | show (Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) override |
void | hide (unsigned int key) override |
void | snappoints (std::vector< Inkscape::SnapCandidatePoint > &p, Inkscape::SnapPreferences const *snapprefs) const override |
SPItem * | root () |
Returns the ultimate original of a SPUse (i.e. | |
SPItem const * | root () const |
int | cloneDepth () const |
Get the number of dereferences or calls to get_original() needed to get an object which is not an svg:use. | |
SPItem * | unlink () |
SPItem * | get_original () const |
Geom::Affine | get_parent_transform () const |
Returns the transform that leads to the use from its immediate original. | |
Geom::Affine | get_root_transform () const |
Returns the effective transform that goes from the ultimate original to given SPUse, both ends included. | |
bool | has_xy_offset () const |
Geom::Translate | get_xy_offset () const |
SPItem * | trueOriginal () const |
Returns the ultimate original of a SPUse, i.e., the first object in the chain of uses which is not itself an SPUse. | |
bool | anyInChain (bool(*predicate)(SPItem const *)) const |
Test the passed predicate on all items in a chain of uses. | |
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. | |
![]() | |
SPItem () | |
~SPItem () override | |
SPClipPath * | getClipObject () const |
SPMask * | getMaskObject () const |
SPClipPathReference & | getClipRef () |
SPMaskReference & | getMaskRef () |
std::optional< Geom::PathVector > | getClipPathVector () const |
Return the path vector of the clipping region. | |
std::optional< Geom::PathVector > | getClipPathVector (SPItem const *root) const |
Return the path vector of the clipping region, combined with the clipping regions of all groups containing this object up to and including root. | |
SPText const * | getClipTextObject () const |
Return the text object, IF and only if this item is clipped by a single SPText object. | |
SPAvoidRef & | getAvoidRef () |
bool | isLocked () const |
void | setLocked (bool lock, bool recursive=false) |
bool | isHidden () const |
void | setHidden (bool hidden) |
bool | isSensitive () const |
void | setHighlight (Inkscape::Colors::Color color) |
bool | isHighlightSet () const |
virtual Inkscape::Colors::Color | highlight_color () const |
bool | isEvaluated () const |
void | setEvaluated (bool visible) |
void | resetEvaluated () |
bool | unoptimized () |
bool | isHidden (unsigned display_key) const |
bool | isExplicitlyHidden () const |
Returns something suitable for the ‘Hide’ checkbox in the Object Properties dialog box. | |
void | setExplicitlyHidden (bool val) |
Sets the display CSS property to ‘hidden’ if val is true, otherwise makes it unset. | |
void | setCenter (Geom::Point const &object_centre) |
Sets the transform_center_x and transform_center_y properties to retain the rotation center. | |
bool | updateCenterIfSet (Geom::Point const ¢er) |
void | unsetCenter () |
bool | isCenterSet () const |
Geom::Point | getCenter (bool ensure_uptodate=true) const |
void | scaleCenter (Geom::Scale const &sc) |
bool | isVisibleAndUnlocked () const |
bool | isVisibleAndUnlocked (unsigned display_key) const |
Geom::Affine | getRelativeTransform (SPObject const *obj) const |
bool | raiseOne () |
bool | lowerOne () |
void | raiseToTop () |
void | lowerToBottom () |
SPGroup * | getParentGroup () const |
Return the parent, only if it's a group object. | |
void | moveTo (SPItem *target, bool intoafter) |
Move this SPItem into or after another SPItem in the doc. | |
sigc::connection | connectTransformed (sigc::slot< void(Geom::Affine const *, SPItem *)> slot) |
Geom::OptRect | geometricBounds (Geom::Affine const &transform=Geom::identity()) const |
Get item's geometric bounding box in this item's coordinate system. | |
Geom::OptRect | visualBounds (Geom::Affine const &transform=Geom::identity(), bool wfilter=true, bool wclip=true, bool wmask=true) const |
Get item's visual bounding box in this item's coordinate system. | |
Geom::OptRect | bounds (BBoxType type, Geom::Affine const &transform=Geom::identity()) const |
Geom::OptRect | documentGeometricBounds () const |
Get item's geometric bbox in document coordinate system. | |
Geom::OptRect | documentVisualBounds () const |
Get item's visual bbox in document coordinate system. | |
Geom::OptRect | documentBounds (BBoxType type) const |
Geom::OptRect | documentPreferredBounds () const |
Geom::OptRect | desktopGeometricBounds () const |
Get item's geometric bbox in desktop coordinate system. | |
Geom::OptRect | desktopVisualBounds () const |
Get item's visual bbox in desktop coordinate system. | |
Geom::OptRect | desktopPreferredBounds () const |
Geom::OptRect | desktopBounds (BBoxType type) const |
unsigned int | pos_in_parent () const |
char * | detailedDescription () const |
Returns a string suitable for status bar, formatted in pango markup language. | |
bool | isFiltered () const |
Returns true if the item is filtered, false otherwise. | |
SPObject * | isInMask () const |
SPObject * | isInClipPath () const |
void | invoke_print (SPPrintContext *ctx) |
Inkscape::DrawingItem * | invoke_show (Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) |
void | invoke_hide (unsigned int key) |
void | invoke_hide_except (unsigned key, const std::vector< SPItem const * > &to_keep) |
Invoke hide on all non-group items, except for the list of items to keep. | |
void | getSnappoints (std::vector< Inkscape::SnapCandidatePoint > &p, Inkscape::SnapPreferences const *snapprefs=nullptr) const |
void | adjust_pattern (Geom::Affine const &postmul, bool set=false, PaintServerTransform=TRANSFORM_BOTH) |
void | adjust_hatch (Geom::Affine const &postmul, bool set=false, PaintServerTransform=TRANSFORM_BOTH) |
void | adjust_gradient (Geom::Affine const &postmul, bool set=false) |
void | adjust_clip (Geom::Affine const &postmul, bool set=false) |
void | remove_clip_transforms () |
void | adjust_stroke (double ex) |
void | adjust_stroke_width_recursive (double ex) |
Recursively scale stroke width in item and its children by expansion. | |
void | freeze_stroke_width_recursive (bool freeze) |
void | adjust_paint_recursive (Geom::Affine advertized_transform, Geom::Affine t_ancestors, PaintServerType type=GRADIENT) |
Recursively compensate pattern or gradient transform. | |
bool | collidesWith (Geom::PathVector const &shape) const |
Checks for visual collision with another item. | |
bool | collidesWith (SPItem const &other) const |
void | doWriteTransform (Geom::Affine const &transform, Geom::Affine const *adv=nullptr, bool compensate=true) |
Set a new transform on an object. | |
void | set_item_transform (Geom::Affine const &transform_matrix) |
Sets item private transform (not propagated to repr), without compensating stroke widths, gradients, patterns as sp_item_write_transform does. | |
Inkscape::DrawingItem * | get_arenaitem (unsigned key) const |
Return the arenaitem corresponding to the given item in the display with the given key. | |
Geom::Affine | i2doc_affine () const |
Returns the accumulated transformation of the item and all its ancestors, including root's viewport. | |
Geom::Affine | i2dt_affine () const |
Returns the transformation from item to desktop coords. | |
void | set_i2d_affine (Geom::Affine const &transform) |
Geom::Affine | dt2i_affine () const |
Returns the transformation from desktop to item coords. | |
bool | isExpanded () const |
void | setExpanded (bool expand) |
void | rotate_rel (Geom::Rotate const &rotation) |
void | scale_rel (Geom::Scale const &scale) |
void | skew_rel (double skewX, double skewY) |
void | move_rel (Geom::Translate const &tr) |
virtual Geom::Affine | set_transform (Geom::Affine const &transform) |
virtual void | removeTransformsRecursively (SPObject const *root) |
virtual void | convert_to_guides () const |
![]() | |
SPObject () | |
Constructor, sets all attributes to default values. | |
SPObject (SPObject const &)=delete | |
SPObject & | operator= (SPObject const &)=delete |
~SPObject () override | |
Destructor, frees the used memory and unreferences a potential successor of the object. | |
char const * | getId () const |
Returns the objects current ID string. | |
void | getIds (std::set< std::string > &ret) const |
Accumulate this id and all it's descendants ids. | |
std::string | getUrl () const |
Get the id in a URL format. | |
Inkscape::XML::Node * | getRepr () |
Returns the XML representation of tree. | |
Inkscape::XML::Node const * | getRepr () const |
Returns the XML representation of tree. | |
void | releaseReferences () |
Cleans up an SPObject, releasing its references and requesting that references to it be released. | |
sigc::connection | connectRelease (sigc::slot< void(SPObject *)> slot) |
Connects to the release request signal. | |
bool | isSiblingOf (SPObject const *object) const |
std::vector< SPObject * > | getLinked (LinkedObjectNature direction=LinkedObjectNature::ANY) const |
Get objects which are linked, like above. | |
bool | isAncestorOf (SPObject const *object) const |
True if object is non-NULL and this is some in/direct parent of object. | |
SPObject const * | nearestCommonAncestor (SPObject const *object) const |
Returns youngest object being parent to this and object. | |
SPObject const * | getTopAncestorNonLayer () const |
Returns ancestor non layer. | |
SPObject * | getNext () |
SPObject * | getPrev () |
Returns previous object in sibling list or NULL. | |
bool | hasChildren () const |
SPObject * | firstChild () |
SPObject const * | firstChild () const |
SPObject * | lastChild () |
SPObject const * | lastChild () const |
SPObject * | nthChild (unsigned index) |
SPObject const * | nthChild (unsigned index) const |
std::vector< SPObject * > | childList (bool add_ref, Action action=ActionGeneral) |
Retrieves the children as a std vector object, optionally ref'ing the children in the process, if add_ref is specified. | |
std::vector< SPObject * > | ancestorList (bool root_to_tip) |
Retrieves a list of ancestors of the object, as an easy to use vector. | |
SPObject * | appendChildRepr (Inkscape::XML::Node *repr) |
Append repr as child of this object. | |
char const * | label () const |
Gets the author-visible label property for the object or a default if no label is defined. | |
char const * | defaultLabel () const |
Returns a default label property for this object. | |
void | setLabel (char const *label) |
Sets the author-visible label for this object. | |
char * | title () const |
Returns the title of this object, or NULL if there is none. | |
bool | setTitle (char const *title, bool verbatim=false) |
Sets the title of this object. | |
char * | desc () const |
Returns the description of this object, or NULL if there is none. | |
bool | setDesc (char const *desc, bool verbatim=false) |
Sets the description of this object. | |
Glib::ustring | getExportFilename () const |
Get and set the exportable filename on this object. | |
void | setExportFilename (Glib::ustring filename) |
Geom::Point | getExportDpi () const |
Get and set the exported DPI for this objet, if available. | |
void | setExportDpi (Geom::Point dpi) |
CollectionPolicy | collectionPolicy () const |
Set the policy under which this object will be orphan-collected. | |
void | setCollectionPolicy (CollectionPolicy policy) |
Sets the orphan-collection policy in effect for this object. | |
void | requestOrphanCollection () |
Requests a later automatic call to collectOrphan(). | |
void | collectOrphan () |
Unconditionally delete the object if it is not referenced. | |
void | hrefObject (SPObject *owner=nullptr) |
Increase weak refcount. | |
void | unhrefObject (SPObject *owner=nullptr) |
Decrease weak refcount. | |
bool | isReferenced () |
Check if object is referenced by any other object. | |
void | deleteObject (bool propagate, bool propagate_descendants) |
Deletes an object, unparenting it from its parent. | |
void | deleteObject (bool propagate=true) |
Deletes on object. | |
void | cropToObject (SPObject *except) |
Removes all children except for the given object, it's children and it's ancesstors. | |
void | cropToObjects (std::vector< SPObject * > except_objects) |
Removes objects which are not related to given list of objects. | |
void | getObjectsExcept (std::vector< SPObject * > &objects, const std::vector< SPObject * > &except) |
Get all child objects except for any in the list. | |
void | getLinkedRecursive (std::vector< SPObject * > &objects, LinkedObjectNature direction=LinkedObjectNature::ANY) const |
Grows the input list with all linked items recursively in both child nodes and links of links. | |
sigc::connection | connectDelete (sigc::slot< void(SPObject *)> slot) |
Connects a slot to be called when an object is deleted. | |
sigc::connection | connectPositionChanged (sigc::slot< void(SPObject *)> slot) |
SPObject * | successor () |
Returns the object which supercedes this one (if any). | |
void | setSuccessor (SPObject *successor) |
Indicates that another object supercedes this one. | |
void | setTmpSuccessor (SPObject *tmpsuccessor) |
Indicates that another object supercedes temporaty this one. | |
void | unsetTmpSuccessor () |
Unset object supercedes. | |
void | fixTmpSuccessors () |
Fix temporary successors in duple stamp. | |
Inkscape::XML::Node * | updateRepr (unsigned int flags=SP_OBJECT_WRITE_EXT) |
Updates the object's repr based on the object's state. | |
Inkscape::XML::Node * | updateRepr (Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned int flags) |
Updates the given repr based on the object's state. | |
void | requestDisplayUpdate (unsigned int flags) |
Queues an deferred update of this object's display. | |
void | updateDisplay (SPCtx *ctx, unsigned int flags) |
Updates the object's display immediately. | |
void | requestModified (unsigned int flags) |
Requests that a modification notification signal be emitted later (e.g. | |
void | emitModified (unsigned int flags) |
Emits the MODIFIED signal with the object's flags. | |
sigc::connection | connectModified (sigc::slot< void(SPObject *, unsigned int)> slot) |
Connects to the modification notification signal. | |
void | _sendDeleteSignalRecursive () |
Sends the delete signal to all children of this object recursively. | |
void | _updateTotalHRefCount (int increment) |
Adds increment to _total_hrefcount of object and its parents. | |
void | _requireSVGVersion (unsigned major, unsigned minor) |
void | _requireSVGVersion (Inkscape::Version version) |
Lifts SVG version of all root objects to version. | |
void | attach (SPObject *object, SPObject *prev) |
Put object into object tree, under parent, and behind prev; also update object's XML space. | |
void | reorder (SPObject *obj, SPObject *prev) |
In list of object's children, move object behind prev. | |
void | detach (SPObject *object) |
Remove object from parent's children, release and unref it. | |
SPObject * | get_child_by_repr (Inkscape::XML::Node *repr) |
Return object's child whose node pointer equals repr. | |
void | invoke_build (SPDocument *document, Inkscape::XML::Node *repr, unsigned int cloned) |
int | getIntAttribute (char const *key, int def) |
unsigned | getPosition () |
char const * | getAttribute (char const *name) const |
void | appendChild (Inkscape::XML::Node *child) |
void | addChild (Inkscape::XML::Node *child, Inkscape::XML::Node *prev=nullptr) |
void | setKeyValue (SPAttr key, char const *value) |
Call virtual set() function of object. | |
void | setAttribute (Inkscape::Util::const_char_ptr key, Inkscape::Util::const_char_ptr value) |
void | setAttributeDouble (Inkscape::Util::const_char_ptr key, double value) |
void | setAttributeOrRemoveIfEmpty (Inkscape::Util::const_char_ptr key, Inkscape::Util::const_char_ptr value) |
void | readAttr (char const *key) |
Read value of key attribute from XML node into object. | |
void | readAttr (SPAttr keyid) |
char const * | getTagName () const |
void | removeAttribute (char const *key) |
void | setCSS (SPCSSAttr *css, char const *attr) |
void | changeCSS (SPCSSAttr *css, char const *attr) |
bool | storeAsDouble (char const *key, double *val) const |
virtual void | read_content () |
void | recursivePrintTree (unsigned level=0) |
void | objectTrace (std::string const &, bool in=true, unsigned flags=0) |
std::string | generate_unique_id (char const *default_id=nullptr) const |
Generate a document-wide unique id for this object. | |
![]() | |
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. | |
Public Attributes | |
SPItem * | child |
char * | href |
SPUseReference * | ref |
sigc::connection | _delete_connection |
sigc::connection | _changed_connection |
sigc::connection | _transformed_connection |
![]() | |
unsigned int | sensitive: 1 |
unsigned int | stop_paint: 1 |
unsigned | bbox_valid: 1 |
double | transform_center_x |
double | transform_center_y |
bool | freeze_stroke_width |
bool | _is_expanded = false |
Geom::Affine | transform |
Geom::OptRect | doc_bbox |
Geom::Rect | viewport |
std::vector< std::pair< Glib::ustring, Glib::ustring > > | rootsatellites |
std::vector< SPItemView > | views |
sigc::signal< void(Geom::Affine const *, SPItem *)> | _transformed_signal |
std::optional< Inkscape::Colors::Color > | _highlightColor |
![]() | |
unsigned int | cloned: 1 |
SPObject * | clone_original {nullptr} |
unsigned int | uflags: 16 |
unsigned int | mflags: 16 |
SPIXmlSpace | xml_space |
Glib::ustring | lang |
unsigned int | hrefcount {0} |
unsigned int | _total_hrefcount {0} |
SPDocument * | document {nullptr} |
SPObject * | parent {nullptr} |
int | refCount {1} |
std::list< SPObject * > | hrefList |
SPStyle * | style |
Represents the style properties, whether from presentation attributes, the style attribute, or inherited. | |
SPStyle * | context_style |
Represents the style that should be used to resolve 'context-fill' and 'context-stroke'. | |
sigc::signal< void(SPObject *)> | _release_signal |
sigc::signal< void(SPObject *)> | _delete_signal |
sigc::signal< void(SPObject *)> | _position_changed_signal |
sigc::signal< void(SPObject *, unsigned int)> | _modified_signal |
SPObject * | _successor {nullptr} |
SPObject * | _tmpsuccessor {nullptr} |
CollectionPolicy | _collection_policy {SPObject::COLLECT_WITH_PARENT} |
char * | _label {nullptr} |
char * | _default_label {nullptr} |
ChildrenList | children |
![]() | |
SVGLength | x |
SVGLength | y |
SVGLength | width |
SVGLength | height |
Private Member Functions | |
void | href_changed () |
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 the clone stays unmoved or moves in parallel (depending on user setting) regardless of the clone's transform. | |
void | delete_self () |
Additional Inherited Members | |
![]() | |
enum | BBoxType { APPROXIMATE_BBOX , GEOMETRIC_BBOX , VISUAL_BBOX } |
enum | PaintServerType { PATTERN , HATCH , GRADIENT } |
![]() | |
enum | CollectionPolicy { COLLECT_WITH_PARENT , ALWAYS_COLLECT } |
enum class | LinkedObjectNature { DEPENDENT = -1 , ANY = 0 , DEPENDENCY = 1 } |
enum | Action { ActionGeneral , ActionBBox , ActionUpdate , ActionShow } |
typedef Inkscape::Util::ForwardPointerIterator< SPObject, ParentIteratorStrategy > | ParentIterator |
typedef Inkscape::Util::ForwardPointerIterator< SPObject const, ParentIteratorStrategy > | ConstParentIterator |
using | ChildrenList = boost::intrusive::list< SPObject, boost::intrusive::member_hook< SPObject, ListHook, &SPObject::_child_hook > > |
![]() | |
static unsigned int | display_key_new (unsigned numkeys) |
Allocates unique integer keys. | |
static unsigned | ensure_key (Inkscape::DrawingItem *di) |
Ensures that a drawing item's key is the first of a block of ITEM_KEY_SIZE keys, assigning it such a key if necessary. | |
![]() | |
typedef boost::intrusive::list_member_hook | ListHook |
![]() | |
virtual void | child_added (Inkscape::XML::Node *child, Inkscape::XML::Node *ref) |
virtual void | remove_child (Inkscape::XML::Node *child) |
virtual void | order_changed (Inkscape::XML::Node *child, Inkscape::XML::Node *old_repr, Inkscape::XML::Node *new_repr) |
virtual void | tag_name_changed (gchar const *oldname, gchar const *newname) |
![]() | |
ListHook | _child_hook |
SPUse::SPUse | ( | ) |
Definition at line 54 of file sp-use.cpp.
References _changed_connection, Inkscape::URIReference::changedSignal(), SPDimensions::height, href_changed(), SVGLength::PERCENT, ref, SVGLength::unset(), SPDimensions::width, SPDimensions::x, and SPDimensions::y.
|
override |
Definition at line 74 of file sp-use.cpp.
References child, Inkscape::URIReference::detach(), SPObject::detach(), and ref.
Test the passed predicate on all items in a chain of uses.
The chain includes this item, all of its intermediate ancestors in a chain of uses, as well as the ultimate original item.
Definition at line 384 of file sp-use.cpp.
References cloneDepth(), item, predicate, and SPDimensions::x.
|
overridevirtual |
Reimplemented from SPItem.
Definition at line 199 of file sp-use.cpp.
References bbox(), SPItem::bounds(), child, SVGLength::computed, SPItem::transform, and SPDimensions::x.
Referenced by bbox().
|
overridevirtual |
Reimplemented from SPItem.
Definition at line 85 of file sp-use.cpp.
References SPItem::build(), SPObject::document, HEIGHT, SPObject::readAttr(), SPObject::repr, WIDTH, X, XLINK_HREF, and Y.
int SPUse::cloneDepth | ( | ) | const |
Get the number of dereferences or calls to get_original() needed to get an object which is not an svg:use.
Returns -1 if there is no original object.
Definition at line 413 of file sp-use.cpp.
References child, orig, and SPDimensions::x.
Referenced by anyInChain(), and trueOriginal().
|
private |
Definition at line 637 of file sp-use.cpp.
References SPObject::deleteObject(), Inkscape::Preferences::get(), Inkscape::Preferences::getInt(), mode, SPObject::parent, SP_CLONE_ORPHANS_DELETE, SP_CLONE_ORPHANS_UNLINK, unlink(), and SPDimensions::x.
Referenced by href_changed().
|
overridevirtual |
Reimplemented from SPItem.
Definition at line 263 of file sp-use.cpp.
References child, SPItem::detailedDescription(), SPObject::getAttribute(), SPObject::title(), and SPDimensions::x.
The item's type name as a translated human string.
Translated string for UI display.
Reimplemented from SPItem.
Definition at line 255 of file sp-use.cpp.
References child, and SPDimensions::x.
|
overridevirtual |
Get an exact geometric shape representing the visual bounds of the item in the document coordinates.
This is different than a simple bounding rectangle aligned to the coordinate axes: the returned pathvector may effectively describe any shape and coincides with an appropriately transformed path-vector for paths. Even for rectangular items such as SPImage, the bounds may be a parallelogram resulting from transforming the bounding rectangle by an affine transformation.
Reimplemented from SPItem.
Definition at line 211 of file sp-use.cpp.
References get_root_transform(), SPItem::i2doc_affine(), original, SPObject::parent, result, trueOriginal(), and SPDimensions::x.
SPItem * SPUse::get_original | ( | ) | const |
Definition at line 826 of file sp-use.cpp.
References ref.
Referenced by _ungroup_compensate_source_transform().
Geom::Affine SPUse::get_parent_transform | ( | ) | const |
Returns the transform that leads to the use from its immediate original.
Does not include the original's transform if any.
Definition at line 471 of file sp-use.cpp.
References get_xy_offset(), has_xy_offset(), Geom::identity(), and SPItem::transform.
Referenced by move_compensate().
Geom::Affine SPUse::get_root_transform | ( | ) | const |
Returns the effective transform that goes from the ultimate original to given SPUse, both ends included.
Definition at line 433 of file sp-use.cpp.
References child, Geom::identity(), orig, and SPDimensions::x.
Referenced by documentExactBounds(), and unlink().
Geom::Translate SPUse::get_xy_offset | ( | ) | const |
Definition at line 487 of file sp-use.cpp.
References SVGLength::_set, SVGLength::computed, SPDimensions::x, and SPDimensions::y.
Referenced by get_parent_transform(), and snappoints().
|
overridevirtual |
Get objects which are linked to this object as either a source or a target.
Reimplemented from SPObject.
Definition at line 862 of file sp-use.cpp.
References SPObject::ANY, SPObject::DEPENDENCY, SPObject::getLinked(), SPUseReference::getObject(), and ref.
bool SPUse::has_xy_offset | ( | ) | const |
Definition at line 483 of file sp-use.cpp.
References SVGLength::_set, SVGLength::computed, SPDimensions::x, and SPDimensions::y.
Referenced by get_parent_transform(), print(), and snappoints().
Reimplemented from SPItem.
Definition at line 320 of file sp-use.cpp.
References child, and SPItem::invoke_hide().
|
private |
Definition at line 590 of file sp-use.cpp.
References _delete_connection, _transformed_connection, SPObject::attach(), child, SPObject::connectDelete(), SPItem::connectTransformed(), SPFactory::createObject(), delete_self(), SPObject::detach(), SPObject::document, NodeTraits::get_type_string(), SPUseReference::getObject(), href, SPObject::invoke_build(), SPItem::invoke_show(), item, SPObject::lastChild(), move_compensate(), ref, sp_object_unref(), SPItem::views, and SPDimensions::x.
Referenced by SPUse().
Reimplemented from SPItem.
Definition at line 703 of file sp-use.cpp.
References cascade_flags(), child, SPObject::context_style, SPObject::emitModified(), SPObject::mflags, sp_object_ref(), sp_object_unref(), SPObject::style, SPItem::views, and SPDimensions::x.
|
private |
Sensing a movement of the original, this function attempts to compensate for it in such a way that the clone stays unmoved or moves in parallel (depending on user setting) regardless of the clone's transform.
Definition at line 496 of file sp-use.cpp.
References SPObject::children, clip(), SPObject::cloned, SPItem::doWriteTransform(), Inkscape::Preferences::get(), get_parent_transform(), SPItem::getClipObject(), Inkscape::Preferences::getInt(), SPItem::getMaskObject(), Geom::Affine::inverse(), Geom::Affine::isTranslation(), item, mode, SPObject::parent, SPObject::readAttr(), SPObject::requestDisplayUpdate(), SP_CLONE_COMPENSATION_NONE, SP_CLONE_COMPENSATION_PARALLEL, SP_CLONE_COMPENSATION_UNMOVED, TRANSFORM, SPItem::transform, and SPDimensions::x.
Referenced by href_changed().
|
overridevirtual |
Reimplemented from SPItem.
Definition at line 233 of file sp-use.cpp.
References child, SVGLength::computed, has_xy_offset(), SPItem::invoke_print(), and SPDimensions::x.
|
overridevirtual |
Reimplemented from SPItem.
Definition at line 99 of file sp-use.cpp.
References _changed_connection, _delete_connection, _transformed_connection, child, Inkscape::URIReference::detach(), SPObject::detach(), href, ref, SPItem::release(), and SPDimensions::x.
SPItem * SPUse::root | ( | ) |
Returns the ultimate original of a SPUse (i.e.
the first object in the chain of its originals which is not an SPUse). If no original is found, NULL is returned (it is the responsibility of the caller to make sure that this is handled correctly).
Note that the returned is the clone object, i.e. the child of an SPUse (of the argument one for the trivial case) and not the "true original". If you want the true original, use trueOriginal().
Definition at line 337 of file sp-use.cpp.
References child, orig, and SPDimensions::x.
Definition at line 349 of file sp-use.cpp.
References root().
Reimplemented from SPItem.
Definition at line 117 of file sp-use.cpp.
References Inkscape::URIReference::attach(), Inkscape::URIReference::detach(), HEIGHT, SPDimensions::height, href, key, SVGLength::PERCENT, SVGLength::readOrUnset(), ref, SPObject::requestDisplayUpdate(), SPItem::set(), WIDTH, SPDimensions::width, X, SPDimensions::x, XLINK_HREF, Y, and SPDimensions::y.
|
overridevirtual |
Reimplemented from SPItem.
Definition at line 298 of file sp-use.cpp.
References child, SVGLength::computed, SPObject::context_style, SPItem::invoke_show(), key, Inkscape::DrawingGroup::setChildTransform(), Inkscape::DrawingItem::setStyle(), SPObject::style, and SPDimensions::x.
|
overridevirtual |
Reimplemented from SPItem.
Definition at line 837 of file sp-use.cpp.
References child, get_xy_offset(), has_xy_offset(), SPItem::i2dt_affine(), SPItem::snappoints(), Geom::Translate::vector(), Geom::Affine::withoutTranslation(), and SPDimensions::x.
|
inlineoverridevirtual |
SPItem * SPUse::trueOriginal | ( | ) | const |
Returns the ultimate original of a SPUse, i.e., the first object in the chain of uses which is not itself an SPUse.
If the chain of references is broken or no original is found, the return value will be nullptr.
Definition at line 358 of file sp-use.cpp.
References cloneDepth(), and SPDimensions::x.
Referenced by documentExactBounds(), and unlink().
The item's type name, not node tag name.
NOT translated.
Reimplemented from SPItem.
Definition at line 247 of file sp-use.cpp.
References child, and SPDimensions::x.
SPItem * SPUse::unlink | ( | ) |
Definition at line 727 of file sp-use.cpp.
References SPObject::addChild(), Inkscape::GC::anchor(), Inkscape::XML::Node::attribute(), SPStyle::cascade(), child, SPObject::deleteObject(), SPObject::document, SPItem::doWriteTransform(), get_root_transform(), SPDocument::getObjectByRepr(), SPObject::getRepr(), SPDocument::getReprDoc(), Geom::identity(), item, orig, SPObject::parent, Inkscape::XML::Node::parent(), Inkscape::GC::release(), SPObject::repr, root(), Inkscape::XML::Node::setAttribute(), SPObject::setSuccessor(), sp_object_ref(), sp_object_unref(), SPObject::style, trueOriginal(), and SPDimensions::x.
Referenced by delete_self().
Reimplemented from SPItem.
Definition at line 655 of file sp-use.cpp.
References SPDimensions::calcDimsFromParentViewport(), child, SVGLength::computed, SPObject::context_style, sp_object_ref(), sp_object_unref(), SPObject::style, SPItem::transform, SPObject::uflags, SPItem::update(), SPObject::updateDisplay(), SPItem::views, SPDimensions::x, and SPDimensions::y.
|
overridevirtual |
Reimplemented from SPItem.
Definition at line 170 of file sp-use.cpp.
References child, Inkscape::getHrefAttribute(), Inkscape::URIReference::getURI(), ref, SPObject::repr, Inkscape::XML::Node::setAttributeOrRemoveIfEmpty(), Inkscape::URI::str(), SPItem::write(), SPDimensions::writeDimensions(), and SPDimensions::x.
sigc::connection SPUse::_changed_connection |
sigc::connection SPUse::_delete_connection |
Definition at line 42 of file sp-use.h.
Referenced by href_changed(), and release().
sigc::connection SPUse::_transformed_connection |
Definition at line 46 of file sp-use.h.
Referenced by href_changed(), and release().
SPItem* SPUse::child |
Definition at line 33 of file sp-use.h.
Referenced by bbox(), cloneDepth(), description(), displayName(), get_root_transform(), hide(), href_changed(), modified(), print(), release(), root(), show(), snappoints(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_use_render(), Inkscape::Extension::Internal::sp_use_render(), typeName(), unlink(), update(), write(), and ~SPUse().
char* SPUse::href |
Definition at line 36 of file sp-use.h.
Referenced by href_changed(), release(), and set().
SPUseReference* SPUse::ref |
Definition at line 39 of file sp-use.h.
Referenced by get_original(), getLinked(), href_changed(), release(), set(), SPUse(), write(), and ~SPUse().