/*
* Copyright (C) Johan Engelen 2007-2008 <j.b.c.engelen@utwente.nl>
* Abhishek Sharma
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "live_effects/lpeobject.h"
#include "live_effects/effect.h"
#include "xml/node-event-vector.h"
#include "sp-object.h"
#include "attributes.h"
#include "document.h"
#include "document-private.h"
//#define LIVEPATHEFFECT_VERBOSE
static void livepatheffect_on_repr_attr_changed (Inkscape::XML::Node * repr, const gchar *key, const gchar *oldval, const gchar *newval, bool is_interactive, void * data);
NULL, /* child_added */
NULL, /* child_removed */
NULL, /* content_changed */
NULL /* order_changed */
};
{
#ifdef LIVEPATHEFFECT_VERBOSE
g_message("Init livepatheffectobject");
#endif
}
}
/**
* Virtual build: set livepatheffect attributes from its associated XML node.
*/
g_assert(SP_IS_OBJECT(this));
this->readAttr( "effect" );
if (repr) {
}
/* Register ourselves, is this necessary? */
// document->addResource("path-effect", object);
}
/**
* Virtual release of livepatheffect members before destruction.
*/
this->getRepr()->removeListenerByData(this);
/*
if (object->document) {
// Unregister ourselves
sp_document_removeResource(object->document, "livepatheffect", object);
}
if (gradient->ref) {
gradient->modified_connection.disconnect();
gradient->ref->detach();
delete gradient->ref;
gradient->ref = NULL;
}
gradient->modified_connection.~connection();
*/
if (this->lpe) {
delete this->lpe;
}
}
/**
* Virtual set: set attribute to value.
*/
#ifdef LIVEPATHEFFECT_VERBOSE
g_print("Set livepatheffect");
#endif
switch (key) {
case SP_PROP_PATH_EFFECT:
if (this->lpe) {
delete this->lpe;
}
this->effecttype_set = true;
} else {
this->effecttype_set = false;
}
break;
}
}
/**
* Virtual write: write object attributes to repr.
*/
Inkscape::XML::Node* LivePathEffectObject::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) {
}
repr->setAttribute("effect", Inkscape::LivePathEffect::LPETypeConverter.get_key(this->effecttype).c_str());
this->lpe->writeParamsToSVG();
}
return repr;
}
static void
const gchar */*oldval*/,
bool /*is_interactive*/,
void * data )
{
#ifdef LIVEPATHEFFECT_VERBOSE
g_print("livepatheffect_on_repr_attr_changed");
#endif
if (!data)
return;
return;
}
/**
* If this has other users, create a new private duplicate and return it
* returns 'this' when no forking was necessary (and therefore no duplicate was made)
* Check out SPLPEItem::forkPathEffectsIfNecessary !
*/
LivePathEffectObject *LivePathEffectObject::fork_private_if_necessary(unsigned int nr_of_allowed_users)
{
if (hrefcount > nr_of_allowed_users) {
return lpeobj_new;
}
return this;
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :