sp-filter.cpp revision 6c1edd8c9f1d31e0b4ceafa26f44692e18ee09d2
#define __SP_FILTER_CPP__
/** \file
* SVG <filter> implementation.
*/
/*
* Authors:
* Hugo Rodrigues <haa.rodrigues@gmail.com>
*
* 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 "attributes.h"
#include "document.h"
#include "sp-filter.h"
#include "sp-filter-reference.h"
#include "uri.h"
#define SP_MACROS_SILENT
#include "macros.h"
#define DEBUG_FILTER
#ifdef DEBUG_FILTER
g_print(f, ## a); \
g_print("\n"); \
}
#else
# define debug(f, a...) /**/
#endif
/*
* For debugging purposes only
*/
{
g_print("filterUnits=SP_FILTER_UNITS_USERSPACEONUSE\n");
g_print("filterUnits=SP_FILTER_UNITS_OBJECTBOUNDINGBOX\n");
else
g_print("filterUnits=UNKNOWN!!!\n");
g_print("primitiveUnits=SP_FILTER_UNITS_USERSPACEONUSE\n");
g_print("primitiveUnits=SP_FILTER_UNITS_OBJECTBOUNDINGBOX\n");
else
g_print("primitiveUnits=UNKNOWN!!!\n");
//TODO: print X, Y, W and H units
}
/* Filter base class */
static Inkscape::XML::Node *sp_filter_write(SPObject *object, 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;
}
/**
* 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
}
}
}
/**
* 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.
*/
{
if (!repr) {
}
switch (filter->filterUnits) {
break;
default:
break;
}
}
switch (filter->primitiveUnits) {
break;
default:
break;
}
}
} else {
}
} else {
}
} else {
}
} else {
}
char filterRes[32];
} else {
}
}
}
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
{
}
/*
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 :