sp-filter.cpp revision a4030d5ca449e7e384bc699cd249ee704faaeab0
#define __SP_FILTER_CPP__
/** \file
* SVG <filter> implementation.
*/
/*
* Authors:
* Hugo Rodrigues <haa.rodrigues@gmail.com>
* Niko Kiirala <niko@kiirala.com>
*
* Copyright (C) 2006,2007 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <map>
#include <string.h>
#include <gtkmm.h>
#include "attributes.h"
#include "document.h"
#include "sp-filter.h"
#include "sp-filter-reference.h"
#include "uri.h"
#include <cstring>
#include <string>
#define SP_MACROS_SILENT
#include "macros.h"
#include "display/nr-filter.h"
/* Filter base class */
static Inkscape::XML::Node *sp_filter_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static SPObjectClass *filter_parent_class;
{
static GType filter_type = 0;
if (!filter_type) {
GTypeInfo filter_info = {
sizeof(SPFilterClass),
sizeof(SPFilter),
16,
NULL, /* value_table */
};
}
return filter_type;
}
static void
{
}
static void
{
filter->x = 0;
filter->y = 0;
filter->_image_number_next = 0;
}
/**
* Reads the Inkscape::XML::Node, and initializes SPFilter 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.
*/
static void
{
}
//Read values of key attributes from XML nodes into object.
//is this necessary?
}
/**
* Drops any allocated memory.
*/
static void
{
if (SP_OBJECT_DOCUMENT(object)) {
/* Unregister ourselves */
}
//TODO: release resources here
//release href
}
delete filter->_image_name;
}
/**
* Sets a specific value in the SPFilter.
*/
static void
{
switch (key) {
case SP_ATTR_FILTERUNITS:
if (value) {
} else {
}
} else {
}
break;
case SP_ATTR_PRIMITIVEUNITS:
if (value) {
} else {
}
} else {
}
break;
case SP_ATTR_X:
break;
case SP_ATTR_Y:
break;
case SP_ATTR_WIDTH:
break;
case SP_ATTR_HEIGHT:
break;
case SP_ATTR_FILTERRES:
break;
case SP_ATTR_XLINK_HREF:
if (value) {
try {
} catch (Inkscape::BadURIException &e) {
}
} else {
}
break;
default:
// See if any parents need this value.
}
break;
}
}
/**
* Receives update notifications.
*/
static void
{
//SPFilter *filter = SP_FILTER(object);
/* do something to trigger redisplay, updates? */
}
}
}
/**
* Writes its settings to an incoming repr object, if any.
*/
sp_filter_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
/* Original from sp-item-group.cpp */
if (flags & SP_OBJECT_WRITE_BUILD) {
GSList *l;
if (!repr) {
}
l = NULL;
}
while (l) {
l = g_slist_remove (l, l->data);
}
} else {
}
}
switch (filter->filterUnits) {
break;
default:
break;
}
}
switch (filter->primitiveUnits) {
break;
default:
break;
}
}
} else {
}
} else {
}
} else {
}
} else {
}
} else {
}
}
// TODO: This is evil, correctly implement support for color-interpolation-filters!!!
// The color-interpolation-filters attribute is initially set to linearRGB according to the SVG standard.
// However, Inkscape completely ignores it and implicitly assumes that it is sRGB (like color-interpolation-filters).
// This results in a discrepancy between Inkscape and other renderers in how they render filters.
// To mitigate this problem I've (Jasper van de Gronde,th.v.d.gronde@hccnet.nl) added this to ensure that at least
// any filters written by Inkscape will henceforth be rendered the same in other renderers.
// In the future Inkscape should have proper support for the color-interpolation properties and this should be changed.
}
return repr;
}
/**
* Gets called when the filter is (re)attached to another filter.
*/
static void
{
if (old_ref) {
}
if ( SP_IS_FILTER(ref)
{
}
}
static void
{
}
/**
* Callback for child_added event.
*/
static void
{
//SPFilter *f = SP_FILTER(object);
}
/**
* Callback for remove_child event.
*/
static void
{
// SPFilter *f = SP_FILTER(object);
}
{
} else {
}
}
while (primitive_obj) {
if (SP_IS_FILTER_PRIMITIVE(primitive_obj)) {
} else {
g_warning("Cannot build filter renderer: missing builder");
}
}
}
}
int count = 0;
while (primitive_obj) {
}
return count;
}
}
}
return value;
}
switch (image) {
return "SourceGraphic";
break;
return "SourceAlpha";
break;
return "BackgroundImage";
break;
return "BackgroundAlpha";
break;
return "StrokePaint";
break;
return "FillPaint";
break;
return 0;
break;
default:
return i->first;
}
}
}
return 0;
}
int largest = 0;
while (primitive_obj) {
if (SP_IS_FILTER_PRIMITIVE(primitive_obj)) {
int index;
}
}
}
}
}
{
}
/*
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:fileencoding=utf-8:textwidth=99 :