22#include <unordered_map>
40 , filterUnits_set(false)
42 , primitiveUnits_set(false)
44 href = std::make_unique<SPFilterReference>(
this);
108 if (!std::strcmp(value,
"userSpaceOnUse")) {
122 if (!std::strcmp(value,
"objectBoundingBox")) {
151 auto_region = !value || std::strcmp(value,
"false");
241 std::vector<Inkscape::XML::Node *> l;
243 auto crepr =
child.updateRepr(doc,
nullptr, flags);
249 for (
auto i = l.rbegin(); i != l.rend(); ++i) {
255 child.updateRepr(flags);
312 if (
href->getURI()) {
423 if (primitive && !primitive->valid_for(
obj)) {
435 for (
auto &v :
views) {
446 for (
auto &v :
views) {
537 if (std::sscanf(
result,
"result%5d", &
index) == 1) {
538 if (
index > largest) {
546 return "result" + Glib::Ascii::dtostr(largest + 1);
574 item->setFilterRenderer(
nullptr);
Lookup dictionary for attributes/properties.
TODO: insert short description here.
C top() const
Return top coordinate of the rectangle (+Y is downwards).
C left() const
Return leftmost coordinate of the rectangle (+X is to the right).
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.
Axis aligned, non-empty rectangle.
SVG drawing item for display.
Represents an URI as per RFC 2396.
Interface for refcounted XML nodes.
virtual void addChild(Node *child, Node *after)=0
Insert another node as a child 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 removeAttribute(Inkscape::Util::const_char_ptr key)
Remove an attribute of this node.
bool setAttributeSvgDouble(Util::const_char_ptr key, double val)
For attributes where an exponent is allowed.
float getOptNumber(bool or_num=false) const
void set(char const *str)
std::string getValueString() const
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.
bool removeResource(char const *key, SPObject *object)
bool addResource(char const *key, SPObject *object)
Glib::ustring get_new_result_name() const
Returns a result image name that is not in use inside this filter.
void hide(Inkscape::DrawingItem *item)
void order_changed(Inkscape::XML::Node *child, Inkscape::XML::Node *old_repr, Inkscape::XML::Node *new_repr) override
unsigned getRefCount()
Returns the number of references to the filter.
Geom::Rect get_automatic_filter_region(SPItem const *item) const
Generate a filter region based on the item and return it.
void modified(unsigned flags) override
void update_filter_region(SPItem *item)
Update the filter region based on the object's bounding box.
int primitive_count() const
Returns the number of filter primitives in this SPFilter object.
void child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) override
std::vector< Inkscape::DrawingItem * > views
Inkscape::XML::Node * write(Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned flags) override
void set_filter_region(double x, double y, double width, double height)
Set the filter region attributes from a bounding box.
void remove_child(Inkscape::XML::Node *child) override
std::unique_ptr< SPFilterReference > href
void update_filter_all_regions()
Update the filter's region based on its detectable href links.
void build(SPDocument *doc, Inkscape::XML::Node *repr) override
bool valid_for(SPObject const *obj) const
Checks each filter primitive to make sure the object won't cause issues.
void update(SPCtx *ctx, unsigned flags) override
void show(Inkscape::DrawingItem *item)
NumberOptNumber filterRes
SPFilterUnits primitiveUnits
sigc::scoped_connection modified_connection
void set(SPAttr key, char const *value) override
SPFilterUnits filterUnits
std::unique_ptr< Inkscape::Filters::Filter > build_renderer(Inkscape::DrawingItem *item)
Returns a renderer for this filter, for use by the DrawingItem item.
Base class for visual SVG elements.
virtual Geom::OptRect bbox(Geom::Affine const &transform, SPItem::BBoxType type) const
SPObject is an abstract base class of all of the document nodes at the SVG document level.
Inkscape::XML::Node * repr
void requestModified(unsigned int flags)
Requests that a modification notification signal be emitted later (e.g.
SPObject * get_child_by_repr(Inkscape::XML::Node *repr)
Return object's child whose node pointer equals repr.
virtual void set(SPAttr key, const char *value)
virtual void remove_child(Inkscape::XML::Node *child)
virtual Inkscape::XML::Node * write(Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned int flags)
virtual void update(SPCtx *ctx, unsigned int flags)
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.
virtual void child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref)
std::list< SPObject * > hrefList
virtual void build(SPDocument *doc, Inkscape::XML::Node *repr)
virtual void order_changed(Inkscape::XML::Node *child, Inkscape::XML::Node *old_repr, Inkscape::XML::Node *new_repr)
void requestDisplayUpdate(unsigned int flags)
Queues an deferred update of this object's display.
void readOrUnset(char const *str, Unit u=NONE, float v=0, float c=0)
Canvas item belonging to an SVG drawing element.
Affine identity()
Create an identity matrix.
static R & release(R &r)
Decrements the reference count of a anchored object.
std::pair< char const *, char const * > getHrefAttribute(XML::Node const &node)
Get the 'href' or 'xlink:href' (fallback) attribute from an XML node.
static cairo_user_data_key_t key
Document level base class for all SVG filter primitives.
TODO: insert short description here.
@ SP_FILTER_UNITS_USERSPACEONUSE
@ SP_FILTER_UNITS_OBJECTBOUNDINGBOX
unsigned cascade_flags(unsigned flags)
Interface for XML documents.
virtual Node * createElement(char const *name)=0
Contains transformations to document/viewport and the viewport size.