20#ifdef LIVEPATHEFFECT_VERBOSE
21 g_message(
"Init livepatheffectobject");
64#ifdef LIVEPATHEFFECT_VERBOSE
65 g_print(
"Set livepatheffect");
96 if ((flags & SP_OBJECT_WRITE_BUILD) && !
repr) {
100 if ((flags & SP_OBJECT_WRITE_ALL) || this->
lpe) {
116 const char *thisid = this->
getId();
117 const char *thatid = that->
getId();
118 if (!thisid || !thatid || strcmp(thisid, thatid) != 0) {
123 if (thatlpe && thislpe && thislpe->
getName() != thatlpe->
getName()) {
159 auto lpeobj_new = cast<LivePathEffectObject>(doc->
getObjectByRepr(dup_repr));
164 lpeobj_new->setAttribute(
"id",
id);
175#ifdef LIVEPATHEFFECT_VERBOSE
176 g_print(
"LPENodeObserver::notifyAttributeChanged()\n");
179 auto const key = g_quark_to_string(key_);
180 if (!lpeobj->get_lpe()) {
183 lpeobj->get_lpe()->setParameter(
key, newval);
184 lpeobj->requestModified(SP_OBJECT_MODIFIED_FLAG);
Lookup dictionary for attributes/properties.
static Effect * New(EffectType lpenr, LivePathEffectObject *lpeobj)
Glib::ustring getName() const
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.
virtual Node * duplicate(Document *doc) const =0
Create a duplicate of this node.
virtual void addObserver(NodeObserver &observer)=0
Add an object that will be notified of the changes to this node.
virtual void removeObserver(NodeObserver &observer)=0
Remove an object from the list of observers.
void notifyAttributeChanged(Inkscape::XML::Node &node, GQuark key, Inkscape::Util::ptr_shared oldval, Inkscape::Util::ptr_shared newval) final
Attribute change callback.
void build(SPDocument *doc, Inkscape::XML::Node *repr) override
Virtual build: set livepatheffect attributes from its associated XML node.
Inkscape::LivePathEffect::Effect * get_lpe()
~LivePathEffectObject() override
void set(SPAttr key, char const *value) override
Virtual set: set attribute to value.
void setOnClipboard()
Set lpeobject is on clipboard.
Inkscape::XML::Node * write(Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned int flags) override
Virtual write: write object attributes to repr.
Inkscape::LivePathEffect::Effect * lpe
LPENodeObserver & nodeObserver()
bool is_similar(LivePathEffectObject *that)
Inkscape::LivePathEffect::EffectType effecttype
LivePathEffectObject * fork_private_if_necessary(unsigned int nr_of_allowed_users=1)
If this has other users, create a new private duplicate and return it returns 'this' when no forking ...
void release() override
Virtual release of livepatheffect members before destruction.
Typed SVG document implementation.
Inkscape::XML::Node * getReprRoot()
SPDefs * getDefs()
Return the main defs object for the document.
Inkscape::XML::Document * getReprDoc()
Our Inkscape::XML::Document.
SPObject * getObjectByRepr(Inkscape::XML::Node *repr) const
Inkscape::XML::Node * repr
void requestModified(unsigned int flags)
Requests that a modification notification signal be emitted later (e.g.
virtual void set(SPAttr key, const char *value)
char const * getId() const
Returns the objects current ID string.
virtual Inkscape::XML::Node * write(Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned int flags)
void readAttr(char const *key)
Read value of key attribute from XML node into object.
std::string generate_unique_id(char const *default_id=nullptr) const
Generate a document-wide unique id for this object.
Inkscape::XML::Node * getRepr()
Returns the XML representation of tree.
virtual void build(SPDocument *doc, Inkscape::XML::Node *repr)
static R & release(R &r)
Decrements the reference count of a anchored object.
const EnumEffectDataConverter< EffectType > LPETypeConverter
defined in effect.cpp
static cairo_user_data_key_t key
Inkscape::XML::Node const * sp_repr_lookup_name(Inkscape::XML::Node const *repr, gchar const *name, gint maxdepth)
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.
Interface for XML documents.
virtual Node * createElement(char const *name)=0