composite.cpp revision 76750e3eb87017e5b9aefb0c0148a67bbb3d7232
#define __SP_FECOMPOSITE_CPP__
/** \file
* SVG <feComposite> 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 "composite.h"
#include "helper-fns.h"
#include "display/nr-filter-composite.h"
/* FeComposite base class */
static void sp_feComposite_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static Inkscape::XML::Node *sp_feComposite_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_feComposite_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter);
{
static GType feComposite_type = 0;
if (!feComposite_type) {
sizeof(SPFeCompositeClass),
sizeof(SPFeComposite),
16,
NULL, /* value_table */
};
feComposite_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeComposite", &feComposite_info, (GTypeFlags)0);
}
return feComposite_type;
}
static void
{
}
static void
{
feComposite->k1 = 0;
feComposite->k2 = 0;
feComposite->k3 = 0;
feComposite->k4 = 0;
}
/**
* Reads the Inkscape::XML::Node, and initializes SPFeComposite 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
{
}
}
}
/**
* Drops any allocated memory.
*/
static void
{
}
static FeCompositeOperator
if (!value) return COMPOSITE_DEFAULT;
return COMPOSITE_DEFAULT;
}
/**
* Sets a specific value in the SPFeComposite.
*/
static void
{
(void)feComposite;
int input;
double k_n;
switch(key) {
/*DEAL WITH SETTING ATTRIBUTES HERE*/
case SP_ATTR_OPERATOR:
}
break;
case SP_ATTR_K1:
}
break;
case SP_ATTR_K2:
}
break;
case SP_ATTR_K3:
}
break;
case SP_ATTR_K4:
}
break;
case SP_ATTR_IN2:
}
break;
default:
break;
}
}
/**
* Receives update notifications.
*/
static void
{
/* do something to trigger redisplay, updates? */
}
}
}
/**
* Writes its settings to an incoming repr object, if any.
*/
sp_feComposite_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
if (repr) {
// is this sane?
//repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
}
}
}
return repr;
}
static void sp_feComposite_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter) {
Inkscape::Filters::FilterComposite *nr_composite = dynamic_cast<Inkscape::Filters::FilterComposite*>(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 :