turbulence.cpp revision 60282e8335d7b6ae7020613bb22c7c69a6909fbb
/** \file
* SVG <feTurbulence> implementation.
*
*/
/*
* Authors:
* Felipe CorrĂȘa da Silva Sanches <juca@members.fsf.org>
* hugo Rodrigues <haa.rodrigues@gmail.com>
* Abhishek Sharma
*
* Copyright (C) 2007 Felipe Sanches
* 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 "turbulence.h"
#include "helper-fns.h"
#include <string.h>
#include "display/nr-filter.h"
#include "display/nr-filter-turbulence.h"
/* FeTurbulence base class */
static void sp_feTurbulence_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static Inkscape::XML::Node *sp_feTurbulence_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_feTurbulence_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter);
{
static GType feTurbulence_type = 0;
if (!feTurbulence_type) {
sizeof(SPFeTurbulenceClass),
sizeof(SPFeTurbulence),
16,
NULL, /* value_table */
};
feTurbulence_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeTurbulence", &feTurbulence_info, (GTypeFlags)0);
}
return feTurbulence_type;
}
static void
{
}
static void
{
feTurbulence->updated=false;
}
/**
* Reads the Inkscape::XML::Node, and initializes SPFeTurbulence 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*/
}
/**
* Drops any allocated memory.
*/
static void
{
}
if (!value) return false; // 'noStitch' is default
switch(value[0]){
case 's':
break;
case 'n':
break;
}
return false; // 'noStitch' is default
}
switch(value[0]){
case 'f':
break;
case 't':
break;
}
}
/**
* Sets a specific value in the SPFeTurbulence.
*/
static void
{
(void)feTurbulence;
int read_int;
double read_num;
bool read_bool;
switch(key) {
/*DEAL WITH SETTING ATTRIBUTES HERE*/
case SP_ATTR_BASEFREQUENCY:
//From SVG spec: If two <number>s are provided, the first number represents a base frequency in the X direction and the second value represents a base frequency in the Y direction. If one number is provided, then that value is used for both X and Y.
feTurbulence->updated = false;
break;
case SP_ATTR_NUMOCTAVES:
feTurbulence->updated = false;
}
break;
case SP_ATTR_SEED:
feTurbulence->updated = false;
}
break;
case SP_ATTR_STITCHTILES:
feTurbulence->updated = false;
}
break;
case SP_ATTR_TYPE:
feTurbulence->updated = false;
}
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_feTurbulence_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
/* TODO: Don't just clone, but create a new repr node and write all
* relevant values into it */
if (!repr) {
}
}
/* turbulence doesn't take input */
return repr;
}
static void sp_feTurbulence_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter) {
Inkscape::Filters::FilterTurbulence *nr_turbulence = dynamic_cast<Inkscape::Filters::FilterTurbulence*>(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:fileencoding=utf-8:textwidth=99 :