summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e2b6c14)
raw | patch | inline | side by side (parent: e2b6c14)
author | kiirala <kiirala@users.sourceforge.net> | |
Sat, 16 May 2009 22:40:13 +0000 (22:40 +0000) | ||
committer | kiirala <kiirala@users.sourceforge.net> | |
Sat, 16 May 2009 22:40:13 +0000 (22:40 +0000) |
src/display/nr-filter-image.cpp | patch | blob | history | |
src/filters/image.cpp | patch | blob | history | |
src/filters/image.h | patch | blob | history |
index 625aadf803e28ac83726cfa5daf71f3a1f71a79a..9679e56e7d949f475eb53d0f03adf6109ca7d48d 100644 (file)
FilterImage::~FilterImage()
{
if (feImageHref) g_free(feImageHref);
- if (image_pixbuf) g_free(image_pixbuf);
}
int FilterImage::render(FilterSlot &slot, FilterUnits const &units) {
nr_object_unref((NRObject *) arena);
return 0;
}
+
pb = new NRPixBlock;
free_pb_on_exit = true;
diff --git a/src/filters/image.cpp b/src/filters/image.cpp
index a23ffeee4eba9dbe5ffea29d0fbd313e16dc8907..1c92b772a43f6c56817065b951367b831c5c01d0 100644 (file)
--- a/src/filters/image.cpp
+++ b/src/filters/image.cpp
sp_feImage_release(SPObject *object)
{
SPFeImage *feImage = SP_FEIMAGE(object);
- feImage->_modified_connection.disconnect();
+ feImage->_image_modified_connection.disconnect();
+ feImage->_href_modified_connection.disconnect();
if (feImage->SVGElemRef) delete feImage->SVGElemRef;
if (((SPObjectClass *) feImage_parent_class)->release)
obj->parent->requestModified(SP_OBJECT_MODIFIED_FLAG);
}
+static void
+sp_feImage_href_modified(SPObject* old_elem, SPObject* new_elem, SPObject* obj)
+{
+ SPFeImage *feImage = SP_FEIMAGE(obj);
+ feImage->_image_modified_connection.disconnect();
+ if (new_elem) {
+ feImage->SVGElem = SP_ITEM(new_elem);
+ feImage->_image_modified_connection = ((SPObject*) feImage->SVGElem)->connectModified(sigc::bind(sigc::ptr_fun(&sp_feImage_elem_modified), obj));
+ } else {
+ feImage->SVGElem = 0;
+ }
+
+ obj->parent->requestModified(SP_OBJECT_MODIFIED_FLAG);
+}
+
/**
* Sets a specific value in the SPFeImage.
*/
}
feImage->href = (value) ? g_strdup (value) : NULL;
if (!feImage->href) return;
+ delete feImage->SVGElemRef;
+ feImage->SVGElemRef = 0;
+ feImage->SVGElem = 0;
+ feImage->_image_modified_connection.disconnect();
+ feImage->_href_modified_connection.disconnect();
try{
Inkscape::URI SVGElem_uri(feImage->href);
- delete feImage->SVGElemRef;
feImage->SVGElemRef = new Inkscape::URIReference(feImage->document);
- feImage->from_element = true;
feImage->SVGElemRef->attach(SVGElem_uri);
+ feImage->from_element = true;
+ feImage->_href_modified_connection = feImage->SVGElemRef->changedSignal().connect(sigc::bind(sigc::ptr_fun(&sp_feImage_href_modified), object));
if (SPObject *elemref = feImage->SVGElemRef->getObject()) {
feImage->SVGElem = SP_ITEM(elemref);
-
- feImage->_modified_connection = ((SPObject*) feImage->SVGElem)->connectModified(sigc::bind(sigc::ptr_fun(&sp_feImage_elem_modified), object));
+ feImage->_image_modified_connection = ((SPObject*) feImage->SVGElem)->connectModified(sigc::bind(sigc::ptr_fun(&sp_feImage_elem_modified), object));
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
break;
} else {
catch(const Inkscape::UnsupportedURIException & e)
{
feImage->from_element = false;
- g_warning("caught Inkscape::UnsupportedURIException in sp_feImage_set");
+ /* This occurs when using external image as the source */
+ //g_warning("caught Inkscape::UnsupportedURIException in sp_feImage_set");
break;
}
-
+ break;
case SP_ATTR_X:
feImage->x.readOrUnset(value);
diff --git a/src/filters/image.h b/src/filters/image.h
index 8952aee6c3e932099197f733964a76108d5e0d88..7207918e12923a93014c9881003edaab46cbdec8 100644 (file)
--- a/src/filters/image.h
+++ b/src/filters/image.h
bool from_element;
SPItem* SVGElem;
Inkscape::URIReference* SVGElemRef;
- sigc::connection _modified_connection;
+ sigc::connection _image_modified_connection;
+ sigc::connection _href_modified_connection;
};
struct SPFeImageClass {