diff options
Diffstat (limited to 'src/live_effects/lpeobject.h')
| -rw-r--r-- | src/live_effects/lpeobject.h | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/src/live_effects/lpeobject.h b/src/live_effects/lpeobject.h index f141f07ca..dc631a5c1 100644 --- a/src/live_effects/lpeobject.h +++ b/src/live_effects/lpeobject.h @@ -12,26 +12,49 @@ #include "sp-object.h" #include "effect.h" -#define TYPE_LIVEPATHEFFECT (livepatheffect_get_type()) +namespace Inkscape { +namespace XML { +class Node; +class Document; +} +} + +#define TYPE_LIVEPATHEFFECT (LivePathEffectObject::livepatheffect_get_type()) #define LIVEPATHEFFECT(o) (G_TYPE_CHECK_INSTANCE_CAST((o), TYPE_LIVEPATHEFFECT, LivePathEffectObject)) #define IS_LIVEPATHEFFECT(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), TYPE_LIVEPATHEFFECT)) +/// The LivePathEffect vtable. +struct LivePathEffectObjectClass { + SPObjectClass parent_class; +}; + class LivePathEffectObject : public SPObject { public: Inkscape::LivePathEffect::EffectType effecttype; - Inkscape::LivePathEffect::Effect *lpe; bool effecttype_set; LivePathEffectObject * fork_private_if_necessary(unsigned int nr_of_allowed_users = 1); -}; -/// The LivePathEffect vtable. -struct LivePathEffectObjectClass { - SPObjectClass parent_class; + /* Note that the returned pointer can be NULL in a valid LivePathEffectObject contained in a valid list of lpeobjects in an lpeitem! + * So one should always check whether the returned value is NULL or not */ + Inkscape::LivePathEffect::Effect * get_lpe() { return lpe; }; + +private: + Inkscape::LivePathEffect::Effect *lpe; // this can be NULL in a valid LivePathEffectObject + + /* C-style class functions: */ +public: + static GType livepatheffect_get_type(); +private: + static void livepatheffect_class_init(LivePathEffectObjectClass *klass); + static void livepatheffect_init(LivePathEffectObject *stop); + static void livepatheffect_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); + static void livepatheffect_release(SPObject *object); + static void livepatheffect_set(SPObject *object, unsigned key, gchar const *value); + static Inkscape::XML::Node *livepatheffect_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); }; -GType livepatheffect_get_type(); #endif |
