sp-filter-primitive.cpp revision 51dc158adbe2c9d1df3c941cbf78b90944d1afc2
/** \file
* Superclass for all the filter primitives
*
*/
/*
* Authors:
* Kees Cook <kees@outflux.net>
* Niko Kiirala <niko@kiirala.com>
* Abhishek Sharma
*
* Copyright (C) 2004-2007 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <string.h>
#include "attributes.h"
#include "style.h"
#include "sp-filter-primitive.h"
#include "sp-filter.h"
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-types.h"
/* FilterPrimitive base class */
{
static GType filter_primitive_type = 0;
if (!filter_primitive_type) {
sizeof(SPFilterPrimitiveClass),
sizeof(SPFilterPrimitive),
16,
NULL, /* value_table */
};
filter_primitive_type = g_type_register_static(SP_TYPE_OBJECT, "SPFilterPrimitive", &filter_primitive_info, (GTypeFlags)0);
}
return filter_primitive_type;
}
{
}
this->spfilterprimitive = fp;
}
}
// CPPIFY: Make pure virtual.
// throw;
}
{
delete filter_primitive->cobject;
// We must keep track if a value is set or not, if not set then the region defaults to 0%, 0%,
// 100%, 100% ("x", "y", "width", "height") of the -> filter <- region. If set then
// percentages are in terms of bounding box or viewbox, depending on value of "primitiveUnits"
// NB: SVGLength.set takes prescaled percent values: 1 means 100%
}
/**
* Reads the Inkscape::XML::Node, and initializes SPFilterPrimitive 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.
*/
}
/**
* Drops any allocated memory.
*/
void CFilterPrimitive::release() {
}
/**
* Sets a specific value in the SPFilterPrimitive.
*/
(void)filter_primitive;
int image_nr;
switch (key) {
case SP_ATTR_IN:
if (value) {
} else {
}
}
break;
case SP_ATTR_RESULT:
if (value) {
} else {
}
}
break;
/* Filter primitive sub-region */
case SP_ATTR_X:
break;
case SP_ATTR_Y:
break;
case SP_ATTR_WIDTH:
break;
case SP_ATTR_HEIGHT:
break;
}
/* See if any parents need this value. */
}
/**
* Receives update notifications.
*/
//SPFilterPrimitive *filter_primitive = SP_FILTER_PRIMITIVE(object);
// Is this required?
if (flags & SP_OBJECT_MODIFIED_FLAG) {
}
}
/**
* Writes its settings to an incoming repr object, if any.
*/
Inkscape::XML::Node* CFilterPrimitive::write(Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags) {
if (!repr) {
}
/* Do we need to add x,y,width,height? */
return repr;
}
{
// TODO: are these case sensitive or not? (assumed yes)
switch (name[0]) {
case 'S':
break;
case 'B':
break;
case 'F':
break;
}
}
{
}
/**
* Gives name for output of previous filter. Makes things clearer when prim
* is a filter with two or more inputs. Returns the slot number of result
* of previous primitive, or NR_FILTER_SOURCEGRAPHIC if this is the first
* primitive.
*/
if (i) {
//XML Tree is being directly used while it shouldn't be.
return slot;
} else {
}
}
}
/* Common initialization for filter primitives */
void sp_filter_primitive_renderer_common(SPFilterPrimitive *sp_prim, Inkscape::Filters::FilterPrimitive *nr_prim)
{
/* TODO: place here code to handle input images, filter area etc. */
// Give renderer access to filter properties
}
/*
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 :