componenttransfer.cpp revision 79483ba14ddfcd2a9befc251c88233d6495d8436
#define __SP_FECOMPONENTTRANSFER_CPP__
/** \file
* SVG <feComponentTransfer> 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 <string.h>
#include "document.h"
#include "attributes.h"
#include "componenttransfer.h"
#include "componenttransfer-funcnode.h"
#include "display/nr-filter-component-transfer.h"
/* FeComponentTransfer base class */
static void sp_feComponentTransfer_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static void sp_feComponentTransfer_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
static void sp_feComponentTransfer_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref);
static Inkscape::XML::Node *sp_feComponentTransfer_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
{
static GType feComponentTransfer_type = 0;
if (!feComponentTransfer_type) {
sizeof(SPFeComponentTransferClass),
sizeof(SPFeComponentTransfer),
16,
NULL, /* value_table */
};
feComponentTransfer_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeComponentTransfer", &feComponentTransfer_info, (GTypeFlags)0);
}
return feComponentTransfer_type;
}
static void
{
}
static void
{}
/**
* Reads the Inkscape::XML::Node, and initializes SPFeComponentTransfer 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
{
}
/*LOAD ATTRIBUTES FROM REPR HERE*/
//do we need this?
}
{
if (sp_componenttransfer->renderer) {
bool set[4] = {false, false, false, false};
int i=4;
if (SP_IS_FEFUNCR(node)) i=0;
if (i==4) {
g_warning("Unrecognized channel for component transfer.");
break;
}
set[i] = true;
}
// Set any types not explicitly set to the identity transform
for(int i=0;i<4;i++) {
if (!set[i]) {
}
}
}
}
/**
* Callback for child_added event.
*/
static void
sp_feComponentTransfer_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref)
{
g_warning("child_added");
}
/**
* Callback for remove_child event.
*/
static void
{
}
/**
* Drops any allocated memory.
*/
static void
{
}
/**
* Sets a specific value in the SPFeComponentTransfer.
*/
static void
{
(void)feComponentTransfer;
switch(key) {
/*DEAL WITH SETTING ATTRIBUTES HERE*/
default:
break;
}
}
/**
* Receives update notifications.
*/
static void
{
/* do something to trigger redisplay, updates? */
}
}
}
/**
* Writes its settings to an incoming repr object, if any.
*/
sp_feComponentTransfer_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_feComponentTransfer_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter) {
NR::FilterComponentTransfer *nr_componenttransfer = dynamic_cast<NR::FilterComponentTransfer*>(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 :