image.cpp revision cc618cb0faf84b6f5ab2cc9802b29d03f6a22f97
#define __SP_FEIMAGE_CPP__
/** \file
* SVG <feImage> implementation.
*
*/
/*
* Authors:
* Felipe CorrĂȘa da Silva Sanches <juca@members.fsf.org>
* hugo Rodrigues <haa.rodrigues@gmail.com>
*
* Copyright (C) 2007 Felipe Sanches
* Copyright (C) 2006 Hugo Rodrigues
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "uri.h"
#include "uri-references.h"
#include "attributes.h"
#include "image.h"
#include <string.h>
#include "display/nr-filter.h"
#include "display/nr-filter-image.h"
/* FeImage base class */
static Inkscape::XML::Node *sp_feImage_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_feImage_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter);
{
static GType feImage_type = 0;
if (!feImage_type) {
sizeof(SPFeImageClass),
sizeof(SPFeImage),
16,
NULL, /* value_table */
};
feImage_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeImage", &feImage_info, (GTypeFlags)0);
}
return feImage_type;
}
{
}
{
}
/**
* Reads the Inkscape::XML::Node, and initializes SPFeImage variables. For this to get called,
* our name must be associated with a repr via "sp_object_type_register". Best done through
* sp-object-repr.cpp's repr_name_entries array.
*/
{
// Save document reference so we can load images with relative paths.
}
/*LOAD ATTRIBUTES FROM REPR HERE*/
}
/**
* Drops any allocated memory.
*/
{
}
{
}
{
if (new_elem) {
feImage->_image_modified_connection = ((SPObject*) feImage->SVGElem)->connectModified(sigc::bind(sigc::ptr_fun(&sp_feImage_elem_modified), obj));
} else {
}
}
/**
* Sets a specific value in the SPFeImage.
*/
{
(void)feImage;
switch(key) {
/*DEAL WITH SETTING ATTRIBUTES HERE*/
case SP_ATTR_XLINK_HREF:
}
delete feImage->SVGElemRef;
feImage->SVGElemRef = 0;
try{
feImage->from_element = true;
feImage->_href_modified_connection = feImage->SVGElemRef->changedSignal().connect(sigc::bind(sigc::ptr_fun(&sp_feImage_href_modified), object));
feImage->_image_modified_connection = ((SPObject*) feImage->SVGElem)->connectModified(sigc::bind(sigc::ptr_fun(&sp_feImage_elem_modified), object));
break;
} else {
g_warning("SVG element URI was not found in the document while loading feImage");
}
}
// catches either MalformedURIException or UnsupportedURIException
catch(const Inkscape::BadURIException & e)
{
feImage->from_element = false;
/* This occurs when using external image as the source */
//g_warning("caught Inkscape::BadURIException in sp_feImage_set");
break;
}
break;
case SP_ATTR_X:
break;
case SP_ATTR_Y:
break;
case SP_ATTR_WIDTH:
break;
case SP_ATTR_HEIGHT:
break;
default:
break;
}
}
/**
* Receives update notifications.
*/
{
/* do something to trigger redisplay, updates? */
}
}
}
/**
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node * sp_feImage_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
/* TODO: Don't just clone, but create a new repr node and write all
* relevant values into it */
if (!repr) {
}
}
return repr;
}
static void sp_feImage_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter) {
Inkscape::Filters::FilterImage *nr_image = dynamic_cast<Inkscape::Filters::FilterImage*>(nr_primitive);
}
/*
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:encoding=utf-8:textwidth=99 :