19#include <glibmm/i18n.h>
66#define noSP_ITEM_DEBUG_IDLE
73 , drawingitem(
std::move(drawingitem)) {}
129 return clip->getTextObject();
150 std::cerr <<
"SPItem::getClipPathVector: precondition violation: root specified but not an ancestor" << std::endl;
155 if (intersection && intersection->empty()) {
159 auto const anc_item = cast<SPItem>(anc);
163 if (
auto clip = anc_item->getClipObject()) {
164 intersection =
intersect_clips(std::move(intersection),
clip->getPathVector(cumulative_transform));
171 cumulative_transform = anc_item->transform.inverse() * cumulative_transform;
230 ( locked ?
"1" : nullptr ));
254 for (
auto &v :
views) {
255 if (v.key == display_key) {
256 g_assert(v.drawingitem);
257 for (
auto di = v.drawingitem.get(); di; di = di->parent()) {
258 if (!di->visible()) {
287 return prefs->getColor(
"/tools/nodes/highlight_color",
"#aaaaaaff");
303 auto switchItem = cast<SPSwitch>(
parent);
305 switchItem->resetChildEvaluated();
335 gdouble viewscale = 1.0;
340 viewscale = std::min(viewscale_h, viewscale_w);
385 gdouble viewscale = 1.0;
390 viewscale = std::min(viewscale_h, viewscale_w);
413bool is_item(
SPObject const &
object) {
414 return cast<SPItem>(&
object) !=
nullptr;
421 auto end = SPObject::ChildrenList::reverse_iterator(list.iterator_to(*
this));
422 auto topmost = std::find_if(list.rbegin(),
end, &is_item);
424 if (topmost != list.rend()) {
441 auto self = list.iterator_to(*
this);
442 auto start = SPObject::ChildrenList::reverse_iterator(self);
443 auto next_lower = std::find_if(
start, list.rend(), &is_item);
444 if (next_lower != list.rend()) {
445 auto next = list.iterator_to(*next_lower);
446 if (next == list.begin()) {
450 auto ref = next->getRepr();
464 ref = bottom->getRepr();
475 return cast<SPGroup>(
parent);
487 while (!is<SPItem>(bottom->
getNext())) {
490 target_ref = bottom->
getRepr();
493 if (target_ref == our_ref) {
501 target_ref->
addChild(our_ref,
nullptr);
561 std::stringstream temp;
616 object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
625 object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
641 object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG);
656 explicit lazy(F &&f): f(
std::move(f)) {}
660 if (!result)
result = f();
666 std::optional<typename std::invoke_result<F>::type>
result;
673 for (
auto &v :
views) {
674 auto oldPath = cast<SPClipPath>(old_clip);
679 auto clipPath = cast<SPClipPath>(
clip);
682 for (
auto &v :
views) {
684 auto ai = clipPath->show(v.drawingitem->drawing(), clip_key,
bbox);
685 v.drawingitem->setClip(ai);
688 if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG)) {
700 for (
auto &v :
views) {
701 auto maskItem = cast<SPMask>(old_mask);
706 auto maskItem = cast<SPMask>(mask);
709 for (
auto &v :
views) {
711 auto ai = maskItem->show(v.drawingitem->drawing(), mask_key,
bbox);
712 v.drawingitem->setMask(ai);
715 if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG)) {
725 auto old_fill_ps = cast<SPPaintServer>(old_ps);
727 for (
auto &v :
views) {
732 auto new_fill_ps = cast<SPPaintServer>(ps);
735 for (
auto &v :
views) {
737 auto pi = new_fill_ps->show(v.drawingitem->drawing(), fill_key,
bbox);
738 v.drawingitem->setFillPattern(pi);
745 auto old_stroke_ps = cast<SPPaintServer>(old_ps);
747 for (
auto &v :
views) {
752 auto new_stroke_ps = cast<SPPaintServer>(ps);
755 for (
auto &v :
views) {
757 auto pi = new_stroke_ps->show(v.drawingitem->drawing(), stroke_key,
bbox);
758 v.drawingitem->setStrokePattern(pi);
765 auto old_filter = cast<SPFilter>(old_obj);
767 for (
auto &v :
views) {
768 old_filter->hide(v.drawingitem.get());
774 for (
auto &v :
views) {
782 auto ictx =
static_cast<SPItemCtx const*
>(ctx);
790 auto bbox = lazy([
this] {
794 if (flags & (SP_OBJECT_CHILD_MODIFIED_FLAG |
795 SP_OBJECT_MODIFIED_FLAG |
796 SP_OBJECT_STYLE_MODIFIED_FLAG))
798 if (flags & SP_OBJECT_MODIFIED_FLAG) {
799 for (
auto &v :
views) {
804 auto set_bboxes = [&,
this] (
auto obj,
int type) {
806 for (
auto &v :
views) {
807 obj->setBBox(v.drawingitem->key() + type,
bbox());
817 if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) {
818 for (
auto &v :
views) {
819 v.drawingitem->setOpacity(SP_SCALE24_TO_FLOAT(
style->
opacity.value));
823 v.drawingitem->setVisible(!
isHidden());
830 for (
auto &v :
views) {
832 v.drawingitem->setItemBounds(
bbox());
857 if (flags & SP_OBJECT_WRITE_BUILD) {
858 std::vector<Inkscape::XML::Node *>l;
859 for (
auto&
child:
object->children) {
860 if (is<SPTitle>(&
child) || is<SPDesc>(&
child)) {
867 for (
auto i = l.rbegin(); i!= l.rend(); ++i) {
872 for (
auto&
child:
object->children) {
873 if (is<SPTitle>(&
child) || is<SPDesc>(&
child)) {
874 child.updateRepr(flags);
881 if (flags & SP_OBJECT_WRITE_EXT) {
929 auto gbox = lazy([
this] {
945 if (filter->x._set) x = filter->x;
946 if (filter->y._set) y = filter->y;
947 if (filter->width._set)
w = filter->width;
948 if (filter->height._set) h = filter->height;
954 w.update(12, 6,
len.x());
974 auto transform_with_units = [&] (
bool contentunits) {
980 auto apply_clip_or_mask_bbox = [&] (
auto const *obj,
bool contentunits) {
985 apply_clip_or_mask_bbox(
clip,
clip->clippath_units());
989 apply_clip_or_mask_bbox(mask, mask->mask_content_units());
1037 std::optional<Geom::PathVector>
result;
1077 g_assert(
parent !=
nullptr);
1079 unsigned int pos = 0;
1082 if (&iter ==
this) {
1086 if (is<SPItem>(&iter)) {
1091 g_assert_not_reached();
1116 auto desktop = SP_ACTIVE_DESKTOP;
1118 auto gbox = lazy([
this] {
1122 auto add_clip_or_mask_points = [&,
this] (
SPObject const *obj,
bool contentunits) {
1126 std::vector<Inkscape::SnapCandidatePoint> p_clip_or_mask;
1130 for (
auto const &p_orig : p_clip_or_mask) {
1133 auto pt = p_orig.getPoint();
1138 p.emplace_back(pt, p_orig.getSourceType(), p_orig.getTargetType());
1145 add_clip_or_mask_points(
clip,
clip->clippath_units());
1149 add_clip_or_mask_points(mask, mask->mask_content_units());
1190 return g_strdup(
"");
1194 gchar* s = g_strdup_printf(
"<b>%s</b> %s",
1198 char *snew = g_strdup_printf(_(
"%s; <i>clipped</i>"), s);
1204 char *snew = g_strdup_printf(_(
"%s; <i>masked</i>"), s);
1211 char *snew =
nullptr;
1214 snew = g_strdup_printf(_(
"%s; <i>filtered (%s)</i>"), s, _(
label));
1216 snew = g_strdup_printf(_(
"%s; <i>filtered</i>"), s);
1232 while (parent && !is<SPMask>(
parent)) {
1240 while (parent && !is<SPClipPath>(
parent)) {
1248 static unsigned dkey = 1;
1252 return dkey - numkeys;
1271 auto ai =
show(drawing,
key, flags);
1279 ai->setItemBounds(
bbox);
1281 ai->setOpacity(SP_SCALE24_TO_FLOAT(
style->
opacity.value));
1290 auto ac =
clip->show(drawing, clip_key,
bbox);
1295 auto ac = mask->show(drawing, mask_key,
bbox);
1300 auto ap = fill->show(drawing, fill_key,
bbox);
1301 ai->setFillPattern(ap);
1305 auto ap = stroke->show(drawing, stroke_key,
bbox);
1306 ai->setStrokePattern(ap);
1324 for (
auto it =
views.begin(); it !=
views.end(); ) {
1327 unsigned ai_key = v.drawingitem->key();
1342 filter->hide(v.drawingitem.get());
1345 v.drawingitem.reset();
1347 *it = std::move(
views.back());
1361 if (to_keep.end() == find(to_keep.begin(), to_keep.end(),
this)) {
1363 if (!is<SPRoot>(
this) &&
1364 !is<SPGroup>(
this) &&
1371 if (
auto child = cast<SPItem>(&obj)) {
1372 child->invoke_hide_except(
key, to_keep);
1385 auto serverPatt = cast<SPPattern>(server);
1395 auto serverPatt = cast<SPPattern>(server);
1408 auto serverHatch = cast<SPHatch>(server);
1418 auto serverHatch = cast<SPHatch>(server);
1430 auto serverGrad = cast<SPGradient>(server);
1450 auto serverGrad = cast<SPGradient>(server);
1461 clip_group->transform_multiply(postmul,
set);
1468 clip_group->removeTransformsRecursively(clip_group->parent);
1487 value.computed *= ex;
1520 if (!is<SPUse>(
this)) {
1522 auto item = cast<SPItem>(&o);
1535 if (!is<SPUse>(
this)) {
1537 auto item = cast<SPItem>(&o);
1551 auto rect = cast<SPRect>(
item);
1553 rect->compensateRxRy(advertized_transform);
1557 auto itm = cast<SPItem>(&o);
1575 if (!(cast<SPText>(
this) || cast<SPUse>(
this))) {
1577 auto item = cast<SPItem>(&o);
1615 return other_shape ?
collidesWith(*other_shape) :
false;
1638 if (is<LivePathEffectObject>(
ref)) {
1646 if (
auto path_effect =
getAttribute(
"inkscape:path-effect")) {
1647 assert(path_effect[0]);
1662 if (adv !=
nullptr) {
1663 advertized_transform = *adv;
1674 if (!prefs->
getBool(
"/options/transform/stroke",
true)) {
1675 double const expansion = 1. / advertized_transform.
descrim();
1676 if (expansion < 1e-9 || expansion > 1e9) {
1690 if (!prefs->
getBool(
"/options/transform/rectcorners",
true)) {
1695 if (!prefs->
getBool(
"/options/transform/pattern",
true)) {
1698 if (!prefs->
getBool(
"/options/transform/hatch",
true)) {
1704 if (!prefs->
getBool(
"/options/transform/gradient",
true)) {
1714 gint preserve = prefs->
getBool(
"/options/preservetransform/value",
false);
1720 auto lpeitem = cast<SPLPEItem>(
this);
1740 if (!prefs->
getBool(
"/options/transform/stroke",
true)) {
1743 double const expansion = 1. / advertized_transform.
descrim();
1792 while (
object != ancestor && is<SPItem>(
object)) {
1793 if (
auto root = cast<SPRoot>(
object)) {
1796 auto item = cast_unsafe<SPItem>(
object);
1799 object =
object->parent;
1807 g_return_val_if_fail(src !=
nullptr && dest !=
nullptr,
Geom::identity());
1851 return v.key == key;
1853 return view_it ==
views.end() ? nullptr : view_it->drawingitem.get();
1871 auto tmp = cast<SPItem>(&iter);
1882 int prefs_bbox = prefs->
getInt(
"/tools/bounding_box", 0);
1886 g_warning (
"Cannot determine item's bounding box during conversion to guides.\n");
1890 std::list<std::pair<Geom::Point, Geom::Point> > pts;
1897 pts.emplace_back(A, B);
1898 pts.emplace_back(B, C);
1899 pts.emplace_back(C,
D);
1900 pts.emplace_back(
D, A);
gchar const * sp_attribute_name(SPAttr id)
Get attribute name by id.
bool SP_ATTRIBUTE_IS_CSS(SPAttr k)
True iff k is a property in SVG, i.e.
Lookup dictionary for attributes/properties.
@ INKSCAPE_HIGHLIGHT_COLOR
3x3 matrix representing an affine transformation.
Coord descrim() const
Calculate the descriminant.
bool isIdentity(Coord eps=EPSILON) const
Check whether this matrix is an identity matrix.
bool isTranslation(Coord eps=EPSILON) const
Check whether this matrix represents a pure translation.
Affine inverse() const
Compute the inverse matrix.
void intersectWith(CRect const &b)
Leave only the area overlapping with the argument.
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.
Axis-aligned rectangle that can be empty.
Sequence of contiguous curves, aka spline.
Two-dimensional point that doubles as a vector.
Axis aligned, non-empty rectangle.
bool hasZeroArea(Coord eps=EPSILON) const
Check whether the rectangle has zero area up to specified tolerance.
Rotation around the origin.
Translate inverse() const
Get the inverse translation.
SVG drawing item for display.
void setKey(unsigned key)
Preference storage class.
bool getBool(Glib::ustring const &pref_path, bool def=false)
Retrieve a Boolean value.
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.
bool isTargetSnappable(Inkscape::SnapTargetType const target) const
URI const * getURI() const
Returns a pointer to a URI containing the currently attached URI, or NULL if no URI is currently atta...
bool try_attach(char const *uri)
Try to attach to a URI.
sigc::signal< void(SPObject *, SPObject *)> changedSignal()
Accessor for the referrent change notification signal; this signal is emitted whenever the URIReferen...
std::string cssStr(char const *baseuri=nullptr) const
Return a CSS formatted url value.
double value(Unit const *u) const
Return the quantity's value in the specified unit.
Interface for refcounted XML nodes.
virtual Node * parent()=0
Get the parent of this node.
virtual void addChild(Node *child, Node *after)=0
Insert another node as a child of this node.
virtual void changeOrder(Node *child, Node *after)=0
Move a given node in this node's child order.
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 removeAttribute(Inkscape::Util::const_char_ptr key)
Remove an attribute of this node.
virtual void removeChild(Node *child)=0
Remove a child of this node.
bool setAttributeSvgDouble(Util::const_char_ptr key, double val)
For attributes where an exponent is allowed.
virtual Node * root()=0
Get the root node of this node's document.
void handleSettingChange()
void setAvoid(char const *value)
sigc::connection modified_connection
SPClipPath * getObject() const
Geom::PathVector getPathVector(Geom::Affine const &transform) const
This gets a compiled path vector from all the objects.
Geom::Affine const & dt2doc() const
Typed SVG document implementation.
const Geom::Affine & doc2dt() const
Document to desktop coordinate transformation.
void _emitModified(unsigned int object_modified_tag=0)
SPRoot * getRoot()
Returns our SPRoot.
const Geom::Affine & dt2doc() const
Desktop to document coordinate transformation.
Inkscape::Util::Quantity getWidth() const
double yaxisdir() const
"1" if the desktop Y-axis points down, "-1" if it points up.
int ensureUpToDate(unsigned int object_modified_tag=0)
Repeatedly works on getting the document updated, since sometimes it takes more than one pass to get ...
SPObject * getObjectByRepr(Inkscape::XML::Node *repr) const
Inkscape::Util::Quantity getHeight() const
void show(Inkscape::DrawingItem *item)
void transform_multiply(Geom::Affine postmul, bool set)
SPHatch * clone_if_necessary(SPItem *item, const gchar *property)
Base class for visual SVG elements.
void scale_rel(Geom::Scale const &scale)
Geom::OptRect desktopPreferredBounds() const
void modified(unsigned int flags) override
double transform_center_y
SPGroup * getParentGroup() const
Return the parent, only if it's a group object.
virtual Geom::Affine set_transform(Geom::Affine const &transform)
SPClipPathReference & getClipRef()
void clip_ref_changed(SPObject *old_clip, SPObject *clip)
void set_i2d_affine(Geom::Affine const &transform)
void stroke_ps_ref_changed(SPObject *old_ps, SPObject *ps)
void set_item_transform(Geom::Affine const &transform_matrix)
Sets item private transform (not propagated to repr), without compensating stroke widths,...
EvaluatedStatus _evaluated_status
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
virtual void print(SPPrintContext *ctx)
virtual std::optional< Geom::PathVector > documentExactBounds() const
Get an exact geometric shape representing the visual bounds of the item in the document coordinates.
Geom::OptRect desktopBounds(BBoxType type) const
Geom::OptRect documentVisualBounds() const
Get item's visual bbox in document coordinate system.
void setHighlight(Inkscape::Colors::Color color)
SPMaskReference & getMaskRef()
virtual char * description() const
Geom::OptRect documentPreferredBounds() const
void freeze_stroke_width_recursive(bool freeze)
sigc::signal< void(Geom::Affine const *, SPItem *)> _transformed_signal
Geom::OptRect documentBounds(BBoxType type) const
Geom::OptRect documentGeometricBounds() const
Get item's geometric bbox in document coordinate system.
virtual Inkscape::Colors::Color highlight_color() const
Inkscape::XML::Node * write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned int flags) override
SPClipPathReference * clip_ref
Inkscape::DrawingItem * invoke_show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags)
void set(SPAttr key, char const *value) override
Geom::Point getCenter(bool ensure_uptodate=true) const
SPMask * getMaskObject() const
Inkscape::DrawingItem * get_arenaitem(unsigned key) const
Return the arenaitem corresponding to the given item in the display with the given key.
bool isVisibleAndUnlocked() const
void invoke_print(SPPrintContext *ctx)
void adjust_gradient(Geom::Affine const &postmul, bool set=false)
void filter_ref_changed(SPObject *old_obj, SPObject *obj)
virtual void hide(unsigned int key)
void moveTo(SPItem *target, bool intoafter)
Move this SPItem into or after another SPItem in the doc.
void adjust_stroke_width_recursive(double ex)
Recursively scale stroke width in item and its children by expansion.
void skew_rel(double skewX, double skewY)
void adjust_paint_recursive(Geom::Affine advertized_transform, Geom::Affine t_ancestors, PaintServerType type=GRADIENT)
Recursively compensate pattern or gradient transform.
void invoke_hide(unsigned int key)
void setEvaluated(bool visible)
void setHidden(bool hidden)
SPObject * isInClipPath() const
std::optional< Inkscape::Colors::Color > _highlightColor
void fill_ps_ref_changed(SPObject *old_ps, SPObject *ps)
void getSnappoints(std::vector< Inkscape::SnapCandidatePoint > &p, Inkscape::SnapPreferences const *snapprefs=nullptr) const
void rotate_rel(Geom::Rotate const &rotation)
bool collidesWith(Geom::PathVector const &shape) const
Checks for visual collision with another item.
void move_rel(Geom::Translate const &tr)
virtual Geom::OptRect bbox(Geom::Affine const &transform, SPItem::BBoxType type) const
SPAvoidRef & getAvoidRef()
SPText const * getClipTextObject() const
Return the text object, IF and only if this item is clipped by a single SPText object.
Geom::OptRect desktopVisualBounds() const
Get item's visual bbox in desktop coordinate system.
void adjust_hatch(Geom::Affine const &postmul, bool set=false, PaintServerTransform=TRANSFORM_BOTH)
bool updateCenterIfSet(Geom::Point const ¢er)
Geom::Affine getRelativeTransform(SPObject const *obj) const
void scaleCenter(Geom::Scale const &sc)
Geom::OptRect desktopGeometricBounds() const
Get item's geometric bbox in desktop coordinate system.
void adjust_pattern(Geom::Affine const &postmul, bool set=false, PaintServerTransform=TRANSFORM_BOTH)
virtual void removeTransformsRecursively(SPObject const *root)
void adjust_stroke(double ex)
virtual const char * typeName() const
The item's type name, not node tag name.
bool isExplicitlyHidden() const
Returns something suitable for the ‘Hide’ checkbox in the Object Properties dialog box.
Geom::OptRect geometricBounds(Geom::Affine const &transform=Geom::identity()) const
Get item's geometric bounding box in this item's coordinate system.
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 ...
Geom::Affine i2doc_affine() const
Returns the accumulated transformation of the item and all its ancestors, including root's viewport.
SPMaskReference * mask_ref
bool isFiltered() const
Returns true if the item is filtered, false otherwise.
std::optional< Geom::PathVector > getClipPathVector() const
Return the path vector of the clipping region.
virtual const char * displayName() const
The item's type name as a translated human string.
char * detailedDescription() const
Returns a string suitable for status bar, formatted in pango markup language.
static unsigned int display_key_new(unsigned numkeys)
Allocates unique integer keys.
void build(SPDocument *document, Inkscape::XML::Node *repr) override
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.
virtual Inkscape::DrawingItem * show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags)
SPObject * isInMask() const
virtual void convert_to_guides() const
unsigned int pos_in_parent() const
void doWriteTransform(Geom::Affine const &transform, Geom::Affine const *adv=nullptr, bool compensate=true)
Set a new transform on an object.
void remove_clip_transforms()
void setLocked(bool lock)
void adjust_clip(Geom::Affine const &postmul, bool set=false)
std::vector< SPItemView > views
void setExplicitlyHidden(bool val)
Sets the display CSS property to ‘hidden’ if val is true, otherwise makes it unset.
void mask_ref_changed(SPObject *old_mask, SPObject *mask)
void setCenter(Geom::Point const &object_centre)
Sets the transform_center_x and transform_center_y properties to retain the rotation center.
Geom::Affine dt2i_affine() const
Returns the transformation from desktop to item coords.
SPClipPath * getClipObject() const
double transform_center_x
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.
bool isHighlightSet() const
sigc::connection modified_connection
SPMask * getObject() const
SPObject is an abstract base class of all of the document nodes at the SVG document level.
char const * label() const
Gets the author-visible label property for the object or a default if no label is defined.
Inkscape::XML::Node * repr
void setAttribute(Inkscape::Util::const_char_ptr key, Inkscape::Util::const_char_ptr value)
virtual void set(SPAttr key, const char *value)
SPStyle * style
Represents the style properties, whether from presentation attributes, the style attribute,...
virtual Inkscape::XML::Node * write(Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned int flags)
Inkscape::XML::Node * updateRepr(unsigned int flags=SP_OBJECT_WRITE_EXT)
Updates the object's repr based on the object's state.
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.
char const * getAttribute(char const *name) const
void objectTrace(std::string const &, bool in=true, unsigned flags=0)
std::list< SPObject * > hrefList
virtual void build(SPDocument *doc, Inkscape::XML::Node *repr)
SPObject const * nearestCommonAncestor(SPObject const *object) const
Returns youngest object being parent to this and object.
void requestDisplayUpdate(unsigned int flags)
Queues an deferred update of this object's display.
void transform_multiply(Geom::Affine postmul, bool set)
SPPattern * clone_if_necessary(SPItem *item, char const *property)
sigc::signal< void(SPObject *, SPObject *)> signal_fill_ps_changed
Emitted when the fill paint server changes, meaning it starts pointing to a different object.
SPPaintServer * getFillPaintServer()
T< SPAttr::FILL, SPIPaint > fill
fill
T< SPAttr::STROKE_DASHARRAY, SPIDashArray > stroke_dasharray
stroke-dasharray
T< SPAttr::STROKE, SPIPaint > stroke
stroke
SPPaintServer * getStrokePaintServer()
void readFromObject(SPObject *object)
Read style properties from object's repr.
T< SPAttr::STROKE_WIDTH, SPILength > stroke_width
stroke-width
sigc::signal< void(SPObject *, SPObject *)> signal_stroke_ps_changed
Emitted when the stroke paint server changes, meaning it starts pointing to a different object.
T< SPAttr::DISPLAY, SPIEnum< SPCSSDisplay > > display
display
T< SPAttr::ISOLATION, SPIEnum< SPIsolation > > isolation
mix-blend-mode: CSS Compositing and Blending Level 1
T< SPAttr::MIX_BLEND_MODE, SPIEnum< SPBlendMode > > mix_blend_mode
T< SPAttr::OPACITY, SPIScale24 > opacity
opacity
T< SPAttr::FILTER, SPIFilter > filter
Filter effect.
T< SPAttr::STROKE_DASHOFFSET, SPILength > stroke_dashoffset
stroke-dashoffset
T< SPAttr::STROKE_EXTENSIONS, SPIStrokeExtensions > stroke_extensions
-inkscape-stroke
sigc::signal< void(SPObject *, SPObject *)> signal_filter_changed
Emitted when the filter changes, meaning it starts pointing to a different object.
T< SPAttr::SHAPE_RENDERING, SPIEnum< SPShapeRendering > > shape_rendering
void set(Unit u, float v)
void update(double em, double ex, double scale)
bool sp_item_evaluate(SPItem const *item)
TODO: insert short description here.
A class for handling shape interaction with libavoid.
Editable view implementation.
std::unique_ptr< T, UnlinkDeleter > DrawingItemPtr
Smart pointer used by the Object Tree to hold items in the Display Tree, like std::unique_ptr.
Canvas item belonging to an SVG drawing element.
@ SP_CONTENT_UNITS_OBJECTBOUNDINGBOX
SPFilter * new_filter(SPDocument *document)
void sp_gradient_transform_multiply(SPGradient *gradient, Geom::Affine postmul, bool set)
SPGradient * sp_gradient_convert_to_userspace(SPGradient *gr, SPItem *item, gchar const *property)
Convert an item's gradient to userspace if necessary, also fork it if necessary.
constexpr Coord EPSILON
Default "acceptably small" value.
bool pathvs_have_nonempty_overlap(Geom::PathVector const &a, Geom::PathVector const &b)
An exact check for whether the two pathvectors intersect or overlap, including the case of a line cro...
Specific geometry functions for Inkscape, not provided my lib2geom.
Affine identity()
Create an identity matrix.
bool are_near(Affine const &a1, Affine const &a2, Coord eps=EPSILON)
static R & release(R &r)
Decrements the reference count of a anchored object.
@ SNAPSOURCE_ROTATION_CENTER
@ SNAPTARGET_ROTATION_CENTER
static T clip(T const &v, T const &a, T const &b)
static cairo_user_data_key_t key
std::optional< Geom::PathVector > intersect_clips(std::optional< Geom::PathVector > &&a, std::optional< Geom::PathVector > &&b)
Intersect two clips, treating empty optionals as no clip.
Singleton class to access the preferences file in a convenient way.
int sp_repr_compare_position(Inkscape::XML::Node const *first, Inkscape::XML::Node const *second)
Works for different-parent objects, so long as they have a common ancestor.
Some utility classes to store various kinds of snap candidates.
@ SP_FILTER_UNITS_OBJECTBOUNDINGBOX
void sp_guide_pt_pairs_to_guides(SPDocument *doc, std::list< std::pair< Geom::Point, Geom::Point > > &pts)
SVG <hatch> implementation.
static bool is_satellite_item(SPItem const &item)
Return true if the item is referenced by an LPE.
Geom::Affine sp_item_transform_repr(SPItem *item)
Find out the inverse of previous transform of an item (from its repr)
Geom::Affine i2i_affine(SPObject const *src, SPObject const *dest)
SPItem const * sp_item_first_item_child(SPObject const *obj)
Geom::Affine i2anc_affine(SPObject const *object, SPObject const *ancestor)
static void sp_item_adjust_rects_recursive(SPItem *item, Geom::Affine advertized_transform)
Recursively adjust rx and ry of rects.
int sp_item_repr_compare_position(SPItem const *first, SPItem const *second)
Some things pertinent to all visible shapes: SPItem, SPItemView, SPItemCtx.
Geom::Affine sp_item_transform_repr(SPItem *item)
Find out the inverse of previous transform of an item (from its repr)
Geom::Affine i2i_affine(SPObject const *src, SPObject const *dest)
Geom::Affine i2anc_affine(SPObject const *item, SPObject const *ancestor)
void sp_lpe_item_update_patheffect(SPLPEItem *lpeitem, bool wholetree, bool write, bool with_satellites)
Calls any registered handlers for the update_patheffect action.
SVG <pattern> implementation.
SPRoot: SVG <svg> implementation.
TODO: insert short description here.
Interface for XML documents.
Contains transformations to document/viewport and the viewport size.
SPItemView(unsigned flags, unsigned key, DrawingItemPtr< Inkscape::DrawingItem > drawingitem)
unsigned int bind(Geom::Affine const &transform, float opacity)
@ SP_CSS_SHAPE_RENDERING_CRISPEDGES
static const unsigned SP_SCALE24_MAX
SPStyle - a style object for SPItem objects.
bool sp_svg_transform_read(gchar const *str, Geom::Affine *transform)
std::string sp_svg_transform_write(Geom::Affine const &transform)
Geom::IntPoint dimensions(const Cairo::RefPtr< Cairo::ImageSurface > &surface)