sp-fecomponenttransfer-funcnode.cpp revision 0cc082e09c2ce5f515a90ce45a6a440c11150dc6
#define __SP_FEFUNCNODE_CPP__
/** \file
* SVG <funcR>, <funcG>, <funcB> and <funcA> implementations.
*/
/*
* Authors:
* Hugo Rodrigues <haa.rodrigues@gmail.com>
* Niko Kiirala <niko@kiirala.com>
* Felipe CorrĂȘa da Silva Sanches <felipe.sanches@gmail.com>
*
* Copyright (C) 2006, 2007, 2008 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <glib.h>
#include "attributes.h"
#include "document.h"
#include "sp-fecomponenttransfer.h"
#include "sp-fecomponenttransfer-funcnode.h"
#include "display/nr-filter-component-transfer.h"
#include "helper-fns.h"
#define SP_MACROS_SILENT
#include "macros.h"
/* FeFuncNode class */
static Inkscape::XML::Node *sp_fefuncnode_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
static SPObjectClass *feFuncNode_parent_class;
{
static GType fefuncnode_type = 0;
if (!fefuncnode_type) {
sizeof(SPFeFuncNodeClass),
sizeof(SPFeFuncNode),
16,
NULL, /* value_table */
};
fefuncnode_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeFuncR", &fefuncnode_info, (GTypeFlags)0);
}
return fefuncnode_type;
}
{
static GType fefuncnode_type = 0;
if (!fefuncnode_type) {
sizeof(SPFeFuncNodeClass),
sizeof(SPFeFuncNode),
16,
NULL, /* value_table */
};
fefuncnode_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeFuncG", &fefuncnode_info, (GTypeFlags)0);
}
return fefuncnode_type;
}
{
static GType fefuncnode_type = 0;
if (!fefuncnode_type) {
sizeof(SPFeFuncNodeClass),
sizeof(SPFeFuncNode),
16,
NULL, /* value_table */
};
fefuncnode_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeFuncB", &fefuncnode_info, (GTypeFlags)0);
}
return fefuncnode_type;
}
{
static GType fefuncnode_type = 0;
if (!fefuncnode_type) {
sizeof(SPFeFuncNodeClass),
sizeof(SPFeFuncNode),
16,
NULL, /* value_table */
};
fefuncnode_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeFuncA", &fefuncnode_info, (GTypeFlags)0);
}
return fefuncnode_type;
}
static void
{
}
static void
{
//fefuncnode->tableValues = NULL;
fefuncnode->intercept = 0;
fefuncnode->offset = 0;
}
/**
* Reads the Inkscape::XML::Node, and initializes SPDistantLight 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?
sp_document_add_resource(document, "fefuncnode", object); //maybe feFuncR, fefuncG, feFuncB and fefuncA ?
}
/**
* Drops any allocated memory.
*/
static void
{
//SPFeFuncNode *fefuncnode = SP_FEFUNCNODE(object);
if (SP_OBJECT_DOCUMENT(object)) {
/* Unregister ourselves */
}
//TODO: release resources here
}
switch(value[0]){
case 'i':
break;
case 't':
break;
case 'd':
break;
case 'l':
break;
case 'g':
break;
}
}
/**
* Sets a specific value in the SPFeFuncNode.
*/
static void
{
double read_num;
switch(key) {
case SP_ATTR_TYPE:
}
break;
case SP_ATTR_TABLEVALUES:
if (value){
}
break;
case SP_ATTR_SLOPE:
}
break;
case SP_ATTR_INTERCEPT:
}
break;
case SP_ATTR_AMPLITUDE:
}
break;
case SP_ATTR_EXPONENT:
}
break;
case SP_ATTR_OFFSET:
}
break;
default:
break;
}
}
/**
* * Receives update notifications.
* */
static void
{
(void)feFuncNode;
if (flags & SP_OBJECT_MODIFIED_FLAG) {
/* do something to trigger redisplay, updates? */
//TODO
//sp_object_read_attr(object, "azimuth");
//sp_object_read_attr(object, "elevation");
}
}
}
/**
* Writes its settings to an incoming repr object, if any.
*/
{
if (!repr) {
}
/*
TODO: I'm not sure what to do here...
if (fefuncnode->azimuth_set)
sp_repr_set_css_double(repr, "azimuth", fefuncnode->azimuth);
if (fefuncnode->elevation_set)
sp_repr_set_css_double(repr, "elevation", fefuncnode->elevation);*/
}
return repr;
}
/*
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 :