summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8dbefd3)
raw | patch | inline | side by side (parent: 8dbefd3)
author | haa_rodrigues <haa_rodrigues@users.sourceforge.net> | |
Mon, 14 Aug 2006 18:54:26 +0000 (18:54 +0000) | ||
committer | haa_rodrigues <haa_rodrigues@users.sourceforge.net> | |
Mon, 14 Aug 2006 18:54:26 +0000 (18:54 +0000) |
44 files changed:
diff --git a/src/Makefile_insert b/src/Makefile_insert
index 4438353e2ec6227332328e9903dc380c38e61a09..d0ef0248b74d912538073a7fc3877c7c30da3e48 100644 (file)
--- a/src/Makefile_insert
+++ b/src/Makefile_insert
sp-feturbulence.cpp sp-feturbulence.h \
sp-feturbulence-fns.h \
sp-filter-fns.h \
+ sp-filter-primitive.cpp \
+ sp-filter-primitive.h \
sp-filter-reference.cpp \
sp-filter-reference.h \
sp-filter-units.h \
index df750c71b01277a23e340f14ca42f9c6656f3569..4d6298b05136fb0a354101d4bef86bb23707b4f5 100644 (file)
#include "inkscape-stock.h"
#include "prefs-utils.h"
#include "svg/css-ostringstream.h"
+#include "sp-gaussian-blur.h"
+#include "sp-filter.h"
#include "desktop-handles.h"
#include "desktop-style.h"
#include "document.h"
GtkWidget *blur_hb = gtk_hbox_new (FALSE, 4);
gtk_box_pack_start (GTK_BOX (b_vb), blur_hb, FALSE, FALSE, 0);
- GtkObject *blur_a = gtk_adjustment_new (0.0, 0.0, 1.0, 0.01, 0.1, 0.0);
+ GtkObject *blur_a = gtk_adjustment_new (0.0, 0.0, 100.0, 1.0, 1.0, 0.0);
gtk_object_set_data(GTK_OBJECT(dlg), "blur_adjustment", blur_a);
GtkWidget *blur_s = gtk_hscale_new (GTK_ADJUSTMENT (blur_a));
gtk_box_pack_start (GTK_BOX (blur_hb), blur_s, TRUE, TRUE, 4);
gtk_label_set_mnemonic_widget (GTK_LABEL(blur_l), blur_s);
- GtkWidget *blur_sb = gtk_spin_button_new (GTK_ADJUSTMENT (blur_a), 0.01, 3);
+ GtkWidget *blur_sb = gtk_spin_button_new (GTK_ADJUSTMENT (blur_a), 1.0, 3);
gtk_box_pack_start (GTK_BOX (blur_hb), blur_sb, FALSE, FALSE, 0);
gtk_signal_connect ( blur_a, "value_changed",
dlg );
gtk_widget_show_all (b_vb);
-*/
+*/
sp_fillstroke_selection_changed(NULL, NULL, NULL);
gtk_widget_show (dlg);
}
-
/**
* Creates new private filter for the given vector
*/
repr = sp_repr_new("svg:filter");
// privates are garbage-collectable
repr->setAttribute("inkscape:collect", "always");
-
+
Inkscape::XML::Node *b_repr;
b_repr = sp_repr_new("svg:feGaussianBlur");
// privates are garbage-collectable
- b_repr->setAttribute("inkscape:collect", "always");
+ //b_repr->setAttribute("inkscape:collect", "always");
Inkscape::CSSOStringStream os;
- os << CLAMP (stdDeviation, 0.0, 1.0);
+ os << stdDeviation;
b_repr->setAttribute("stdDeviation", os.str().c_str());
repr->appendChild(b_repr);
Inkscape::GC::release(repr);
// get corresponding object
- SPFilter *f = (SPFilter *) document->getObjectByRepr(repr);
+ SPFilter *f = SP_FILTER( document->getObjectByRepr(repr) );
+ SPGaussianBlur *b = SP_GAUSSIANBLUR( document->getObjectByRepr(b_repr) );
+ add_primitive(f, /*(SPFilterPrimitive * )*/ b);
g_assert(f != NULL);
g_assert(SP_IS_FILTER(f));
+ g_assert(b != NULL);
+ g_assert(SP_IS_GAUSSIANBLUR(b));
return f;
}
return;
}
- if(a->value==0.0) //blur set to zero, remove filter
- {
- //if there is a filter attached, remove it
- SPCSSAttr *css = sp_repr_css_attr_new ();
- sp_repr_css_unset_property (css, "filter");
- sp_desktop_set_style (desktop, css);
- sp_repr_css_attr_unref (css);
-
- } else { //blur non-zero
-
- //get current selection
- Inkscape::Selection *selection = sp_desktop_selection (desktop);
- //get list of selected items
- GSList const *items = selection->itemList();
- //get current document
- SPDocument *document = sp_desktop_document (desktop);
-
-
- //create new filter with feGaussianBlur primitive
- SPFilter *constructed = sp_filter_get(document, a->value);
-
- //apply created filter to every selected item
- for (GSList const *i = items; i != NULL; i = i->next) {
-
+ //get current selection
+ Inkscape::Selection *selection = sp_desktop_selection (desktop);
+ //get list of selected items
+ GSList const *items = selection->itemList();
+ //get current document
+ SPDocument *document = sp_desktop_document (desktop);
+
+
+ //create new filter with feGaussianBlur primitive
+ SPFilter *constructed = sp_filter_get(document, a->value);
+
+
+ //apply created filter to every selected item
+ for (GSList const *i = items; i != NULL; i = i->next) {
+
+ SPItem * item = SP_ITEM(i->data);
+ SPStyle *style = SP_OBJECT_STYLE(item);
+ g_assert(style != NULL);
+
+ if(a->value==0.0) //blur set to zero, remove filter
+ {
+ //if there is a filter attached, remove it
+ SPCSSAttr *css = sp_repr_css_attr_new ();
+ sp_repr_css_unset_property (css, "filter");
+ sp_desktop_set_style (desktop, css);
+ sp_repr_css_attr_unref (css);
+ }/* else if( style->filter.filter ) { //item has a filter assigned
+ Inkscape::XML::Node *repr = SP_OBJECT_REPR ( style->filter.filter );
+ Inkscape::CSSOStringStream os;
+ os << a->value;
+ repr->firstChild()->setAttribute("stdDeviation", os.str().c_str());
+ }*/ else {
gchar *val = g_strdup_printf("url(#%s)", SP_OBJECT_ID(constructed));
-
SPCSSAttr *css = sp_repr_css_attr_new();
sp_repr_css_set_property(css, "filter", val);
g_free(val);
- sp_repr_css_change_recursive(SP_OBJECT_REPR(SP_ITEM(i->data)), css, "style");
-
+ sp_repr_css_change_recursive(SP_OBJECT_REPR(item), css, "style");
sp_desktop_set_style (SP_ACTIVE_DESKTOP, css);
sp_repr_css_attr_unref(css);
-
- SP_OBJECT(SP_ITEM(i->data))->requestDisplayUpdate(( SP_OBJECT_MODIFIED_FLAG |
- SP_OBJECT_STYLE_MODIFIED_FLAG ));
}
+ SP_OBJECT(item)->requestDisplayUpdate(( SP_OBJECT_MODIFIED_FLAG |
+ SP_OBJECT_STYLE_MODIFIED_FLAG ));
}
- sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "fillstroke:blur", SP_VERB_NONE, "object-properties.cpp:467");
-
- gtk_object_set_data (GTK_OBJECT (dlg), "blocked", GUINT_TO_POINTER (FALSE));
+ sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "fillstroke:blur", SP_VERB_NONE, "object-properties.cpp:467");
+ gtk_object_set_data (GTK_OBJECT (dlg), "blocked", GUINT_TO_POINTER (FALSE));
}
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+
index 4653b5ce68c79c9182d59c5b11857746e6232cba..f9c2031874b671b24fb667f0819884e660f97781 100644 (file)
#include <display/nr-arena.h>
#include <display/nr-arena-shape.h>
#include "display/nr-filter.h"
+#include "display/nr-filter-gaussian.h"
+#include "display/nr-filter-types.h"
#include <libnr/n-art-bpath.h>
#include <libnr/nr-path.h>
#include <libnr/nr-pixops.h>
#include <style.h>
/* prefs-utils used for deciding, whether to run filtering test or not */
#include "prefs-utils.h"
+#include "sp-filter.h"
+#include "sp-gaussian-blur.h"
//int showRuns=0;
void nr_pixblock_render_shape_mask_or(NRPixBlock &m,Shape* theS);
/* TODO: after SPStyle handles filters, get the correct filter
* from there. */
- //if (prefs_get_double_attribute("options.filtertest", "value", 0) != 0)
if (style->filter.set && style->filter.filter)
+ {
shape->filter = new NR::Filter();
+ shape->filter->set_x(style->filter.filter->x);
+ shape->filter->set_y(style->filter.filter->y);
+ shape->filter->set_width(style->filter.filter->width);
+ shape->filter->set_height(style->filter.filter->height);
+
+ //go through all SP filter primitives
+ for(int i=0; i<style->filter.filter->_primitive_count; i++)
+ {
+ SPFilterPrimitive *primitive = style->filter.filter->_primitives[i];
+ //if primitive is gaussianblur
+// if(SP_IS_GAUSSIANBLUR(primitive))
+ {
+ NR::FilterGaussian * gaussian = (NR::FilterGaussian *) shape->filter->add_primitive(NR::NR_FILTER_GAUSSIANBLUR);
+ SPGaussianBlur * spblur = SP_GAUSSIANBLUR(primitive);
+ float num = spblur->stdDeviation.getNumber();
+ if( num>=0.0 )
+ {
+ float optnum = spblur->stdDeviation.getOptNumber();
+ if( optnum>=0.0 )
+ gaussian->set_deviation((double) num, (double) optnum);
+ else
+ gaussian->set_deviation((double) num);
+ }
+ }
+ }
+ }
nr_arena_item_request_update(shape, NR_ARENA_ITEM_STATE_ALL, FALSE);
}
index bda64c50ce232068fee2c966dd6dbb19738e6e4e..a96b02a621888c9753e224f6c4f5a4f61b8a2d97 100644 (file)
Filter::Filter()
{
- _primitive_count = 1;
+ _primitive_count = 0;
_primitive_table_size = 1;
_primitive = new FilterPrimitive*[1];
- _primitive[0] = new FilterGaussian;
+ _primitive[0] = NULL;
+ //_primitive_count = 1;
+ //_primitive[0] = new FilterGaussian;
_common_init();
}
_primitive_count = 0;
}
+void Filter::set_x(SVGLength &lenght)
+{ /*write me*/ }
+void Filter::set_y(SVGLength &length)
+{ /*write me*/ }
+void Filter::set_width(SVGLength &length)
+{ /*write me*/ }
+void Filter::set_height(SVGLength &length)
+{ /*write me*/ }
+
} /* namespace NR */
/*
index c08de58efcab9e5a5966cd5393febdfa6dfa0ffc..abbc759d83fa2ac2891bd7ad78d932e2238c047b 100644 (file)
--- a/src/number-opt-number.h
+++ b/src/number-opt-number.h
}
gfloat getNumber()
- { return number; }
+ {
+ if(_set)
+ return number;
+ return -1;
+ }
gfloat getOptNumber()
- { return optNumber; }
+ {
+ if(optNumber_set)
+ return optNumber;
+ return -1;
+ }
+
+ void setOptNumber(gfloat num)
+ {
+ optNumber_set = true;
+ optNumber = num;
+ }
+
+ void setNumber(gfloat num)
+ {
+ _set = true;
+ number = num;
+ }
gchar *getValueString(gchar *str)
- {
+ {
if( _set )
{
diff --git a/src/sp-feblend.cpp b/src/sp-feblend.cpp
index 41f1ceaf1d38d3ce8d5f896d8cfd1102ba411318..9fc5ee483deb20947c9529c373097d8d9d583847 100644 (file)
--- a/src/sp-feblend.cpp
+++ b/src/sp-feblend.cpp
#include "sp-feblend.h"
#include "xml/repr.h"
-//#define SP_MACROS_SILENT
-//#include "macros.h"
-
-#define DEBUG_FEBLEND
-#ifdef DEBUG_FEBLEND
-# define debug(f, a...) { g_print("%s(%d) %s:", \
- __FILE__,__LINE__,__FUNCTION__); \
- g_print(f, ## a); \
- g_print("\n"); \
- }
-#else
-# define debug(f, a...) /**/
-#endif
/* FeBlend base class */
static void sp_feBlend_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feBlend_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
-static SPObjectClass *feBlend_parent_class;
+static SPFilterPrimitiveClass *feBlend_parent_class;
GType
sp_feBlend_get_type()
(GInstanceInitFunc) sp_feBlend_init,
NULL, /* value_table */
};
- feBlend_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeBlend", &feBlend_info, (GTypeFlags)0);
+ feBlend_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeBlend", &feBlend_info, (GTypeFlags)0);
}
return feBlend_type;
}
{
SPObjectClass *sp_object_class = (SPObjectClass *)klass;
- feBlend_parent_class = (SPObjectClass*)g_type_class_peek_parent(klass);
+ feBlend_parent_class = (SPFilterPrimitiveClass*)g_type_class_peek_parent(klass);
sp_object_class->build = sp_feBlend_build;
sp_object_class->release = sp_feBlend_release;
static void
sp_feBlend_init(SPFeBlend *feBlend)
{
- debug("0x%p",feBlend);
}
/**
static void
sp_feBlend_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- debug("0x%p",object);
if (((SPObjectClass *) feBlend_parent_class)->build) {
((SPObjectClass *) feBlend_parent_class)->build(object, document, repr);
}
static void
sp_feBlend_release(SPObject *object)
{
- debug("0x%p",object);
-
if (((SPObjectClass *) feBlend_parent_class)->release)
((SPObjectClass *) feBlend_parent_class)->release(object);
}
static void
sp_feBlend_set(SPObject *object, unsigned int key, gchar const *value)
{
- debug("0x%p %s(%u): '%s'",object,
- sp_attribute_name(key),key,value);
SPFeBlend *feBlend = SP_FEBLEND(object);
switch(key) {\r
static void
sp_feBlend_update(SPObject *object, SPCtx *ctx, guint flags)
{
- debug("0x%p",object);
-
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
static Inkscape::XML::Node *
sp_feBlend_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
- debug("0x%p",object);
-
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
if (repr) {
diff --git a/src/sp-feblend.h b/src/sp-feblend.h
index 3119524ca33c1314380588e9559513ed9278d542..dea1100a3b86d54c04acff9640a4c61505ef80b2 100644 (file)
--- a/src/sp-feblend.h
+++ b/src/sp-feblend.h
/* FeBlend base class */
class SPFeBlendClass;
-struct SPFeBlend : public SPFilter {
+struct SPFeBlend : public SPFilterPrimitive {
/** BLEND ATTRIBUTES HERE */
};
struct SPFeBlendClass {
- SPFilterClass parent_class;
+ SPFilterPrimitiveClass parent_class;
};
GType sp_feBlend_get_type();
index 98333cc5188ee1d1eb10f3064ef001f15b677c34..02ba17b0d72c7a7ca371d46fe594d634a617b65d 100644 (file)
--- a/src/sp-fecolormatrix.cpp
+++ b/src/sp-fecolormatrix.cpp
#include "sp-fecolormatrix.h"
#include "xml/repr.h"
-//#define SP_MACROS_SILENT
-//#include "macros.h"
-
-#define DEBUG_FECOLORMATRIX
-#ifdef DEBUG_FECOLORMATRIX
-# define debug(f, a...) { g_print("%s(%d) %s:", \
- __FILE__,__LINE__,__FUNCTION__); \
- g_print(f, ## a); \
- g_print("\n"); \
- }
-#else
-# define debug(f, a...) /**/
-#endif
/* FeColorMatrix base class */
static void sp_feColorMatrix_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feColorMatrix_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
-static SPObjectClass *feColorMatrix_parent_class;
+static SPFilterPrimitiveClass *feColorMatrix_parent_class;
GType
sp_feColorMatrix_get_type()
(GInstanceInitFunc) sp_feColorMatrix_init,
NULL, /* value_table */
};
- feColorMatrix_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeColorMatrix", &feColorMatrix_info, (GTypeFlags)0);
+ feColorMatrix_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeColorMatrix", &feColorMatrix_info, (GTypeFlags)0);
}
return feColorMatrix_type;
}
{
SPObjectClass *sp_object_class = (SPObjectClass *)klass;
- feColorMatrix_parent_class = (SPObjectClass*)g_type_class_peek_parent(klass);
+ feColorMatrix_parent_class = (SPFilterPrimitiveClass*)g_type_class_peek_parent(klass);
sp_object_class->build = sp_feColorMatrix_build;
sp_object_class->release = sp_feColorMatrix_release;
static void
sp_feColorMatrix_init(SPFeColorMatrix *feColorMatrix)
{
- debug("0x%p",feColorMatrix);
}
/**
static void
sp_feColorMatrix_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- debug("0x%p",object);
if (((SPObjectClass *) feColorMatrix_parent_class)->build) {
((SPObjectClass *) feColorMatrix_parent_class)->build(object, document, repr);
}
static void
sp_feColorMatrix_release(SPObject *object)
{
- debug("0x%p",object);
-
if (((SPObjectClass *) feColorMatrix_parent_class)->release)
((SPObjectClass *) feColorMatrix_parent_class)->release(object);
}
static void
sp_feColorMatrix_set(SPObject *object, unsigned int key, gchar const *value)
{
- debug("0x%p %s(%u): '%s'",object,
- sp_attribute_name(key),key,value);
SPFeColorMatrix *feColorMatrix = SP_FECOLORMATRIX(object);
switch(key) {\r
static void
sp_feColorMatrix_update(SPObject *object, SPCtx *ctx, guint flags)
{
- debug("0x%p",object);
-
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
static Inkscape::XML::Node *
sp_feColorMatrix_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
- debug("0x%p",object);
-
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
if (repr) {
diff --git a/src/sp-fecolormatrix.h b/src/sp-fecolormatrix.h
index 8f3c8093a33d0e5b3ce8211c6e78254203dcb628..85623c6802bcb52d5902ed32eb104f4ab80012d2 100644 (file)
--- a/src/sp-fecolormatrix.h
+++ b/src/sp-fecolormatrix.h
/* FeColorMatrix base class */
class SPFeColorMatrixClass;
-struct SPFeColorMatrix : public SPFilter {
+struct SPFeColorMatrix : public SPFilterPrimitive {
/** COLORMATRIX ATTRIBUTES HERE */
};
struct SPFeColorMatrixClass {
- SPFilterClass parent_class;
+ SPFilterPrimitiveClass parent_class;
};
GType sp_feColorMatrix_get_type();
index 710faa2f57a301e1c53d32e8faa01818c0061b3f..739c24cdb8bfc5d79b9d2bf8123e516fac548730 100644 (file)
#include "sp-fecomponenttransfer.h"
#include "xml/repr.h"
-//#define SP_MACROS_SILENT
-//#include "macros.h"
-
-#define DEBUG_FECOMPONENTTRANSFER
-#ifdef DEBUG_FECOMPONENTTRANSFER
-# define debug(f, a...) { g_print("%s(%d) %s:", \
- __FILE__,__LINE__,__FUNCTION__); \
- g_print(f, ## a); \
- g_print("\n"); \
- }
-#else
-# define debug(f, a...) /**/
-#endif
/* FeComponentTransfer base class */
static void sp_feComponentTransfer_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feComponentTransfer_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
-static SPObjectClass *feComponentTransfer_parent_class;
+static SPFilterPrimitiveClass *feComponentTransfer_parent_class;
GType
sp_feComponentTransfer_get_type()
(GInstanceInitFunc) sp_feComponentTransfer_init,
NULL, /* value_table */
};
- feComponentTransfer_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeComponentTransfer", &feComponentTransfer_info, (GTypeFlags)0);
+ feComponentTransfer_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeComponentTransfer", &feComponentTransfer_info, (GTypeFlags)0);
}
return feComponentTransfer_type;
}
{
SPObjectClass *sp_object_class = (SPObjectClass *)klass;
- feComponentTransfer_parent_class = (SPObjectClass*)g_type_class_peek_parent(klass);
+ feComponentTransfer_parent_class = (SPFilterPrimitiveClass*)g_type_class_peek_parent(klass);
sp_object_class->build = sp_feComponentTransfer_build;
sp_object_class->release = sp_feComponentTransfer_release;
static void
sp_feComponentTransfer_init(SPFeComponentTransfer *feComponentTransfer)
{
- debug("0x%p",feComponentTransfer);
}
/**
static void
sp_feComponentTransfer_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- debug("0x%p",object);
if (((SPObjectClass *) feComponentTransfer_parent_class)->build) {
((SPObjectClass *) feComponentTransfer_parent_class)->build(object, document, repr);
}
static void
sp_feComponentTransfer_release(SPObject *object)
{
- debug("0x%p",object);
-
if (((SPObjectClass *) feComponentTransfer_parent_class)->release)
((SPObjectClass *) feComponentTransfer_parent_class)->release(object);
}
static void
sp_feComponentTransfer_set(SPObject *object, unsigned int key, gchar const *value)
{
- debug("0x%p %s(%u): '%s'",object,
- sp_attribute_name(key),key,value);
SPFeComponentTransfer *feComponentTransfer = SP_FECOMPONENTTRANSFER(object);
switch(key) {\r
@@ -144,8 +125,6 @@ sp_feComponentTransfer_set(SPObject *object, unsigned int key, gchar const *valu
static void
sp_feComponentTransfer_update(SPObject *object, SPCtx *ctx, guint flags)
{
- debug("0x%p",object);
-
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
static Inkscape::XML::Node *
sp_feComponentTransfer_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
- debug("0x%p",object);
-
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
if (repr) {
index 0fb400ffa5c73a1f20a0c5efdcad22da9b83591b..8c4544613da88f4b0cdcb6ba9a24bc21f35fa960 100644 (file)
/* FeComponentTransfer base class */
class SPFeComponentTransferClass;
-struct SPFeComponentTransfer : public SPFilter {
+struct SPFeComponentTransfer : public SPFilterPrimitive {
/** COMPONENTTRANSFER ATTRIBUTES HERE */
};
struct SPFeComponentTransferClass {
- SPFilterClass parent_class;
+ SPFilterPrimitiveClass parent_class;
};
GType sp_feComponentTransfer_get_type();
diff --git a/src/sp-fecomposite.cpp b/src/sp-fecomposite.cpp
index 621ea300aae43a26f9982954ef21501b357d5a64..9e6411bff2b5969e5db46b1a3d23d7386ab349c6 100644 (file)
--- a/src/sp-fecomposite.cpp
+++ b/src/sp-fecomposite.cpp
#include "sp-fecomposite.h"
#include "xml/repr.h"
-//#define SP_MACROS_SILENT
-//#include "macros.h"
-
-#define DEBUG_FECOMPOSITE
-#ifdef DEBUG_FECOMPOSITE
-# define debug(f, a...) { g_print("%s(%d) %s:", \
- __FILE__,__LINE__,__FUNCTION__); \
- g_print(f, ## a); \
- g_print("\n"); \
- }
-#else
-# define debug(f, a...) /**/
-#endif
/* FeComposite base class */
static void sp_feComposite_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feComposite_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
-static SPObjectClass *feComposite_parent_class;
+static SPFilterPrimitiveClass *feComposite_parent_class;
GType
sp_feComposite_get_type()
(GInstanceInitFunc) sp_feComposite_init,
NULL, /* value_table */
};
- feComposite_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeComposite", &feComposite_info, (GTypeFlags)0);
+ feComposite_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeComposite", &feComposite_info, (GTypeFlags)0);
}
return feComposite_type;
}
{
SPObjectClass *sp_object_class = (SPObjectClass *)klass;
- feComposite_parent_class = (SPObjectClass*)g_type_class_peek_parent(klass);
+ feComposite_parent_class = (SPFilterPrimitiveClass*)g_type_class_peek_parent(klass);
sp_object_class->build = sp_feComposite_build;
sp_object_class->release = sp_feComposite_release;
static void
sp_feComposite_init(SPFeComposite *feComposite)
{
- debug("0x%p",feComposite);
}
/**
static void
sp_feComposite_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- debug("0x%p",object);
if (((SPObjectClass *) feComposite_parent_class)->build) {
((SPObjectClass *) feComposite_parent_class)->build(object, document, repr);
}
static void
sp_feComposite_release(SPObject *object)
{
- debug("0x%p",object);
-
if (((SPObjectClass *) feComposite_parent_class)->release)
((SPObjectClass *) feComposite_parent_class)->release(object);
}
static void
sp_feComposite_set(SPObject *object, unsigned int key, gchar const *value)
{
- debug("0x%p %s(%u): '%s'",object,
- sp_attribute_name(key),key,value);
SPFeComposite *feComposite = SP_FECOMPOSITE(object);
switch(key) {\r
static void
sp_feComposite_update(SPObject *object, SPCtx *ctx, guint flags)
{
- debug("0x%p",object);
-
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
static Inkscape::XML::Node *
sp_feComposite_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
- debug("0x%p",object);
-
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
if (repr) {
diff --git a/src/sp-fecomposite.h b/src/sp-fecomposite.h
index 4683258278bf0795f12988ef07388098e9ad3154..4421ebbf254e59ca1c19d952d4c8530fb9777da1 100644 (file)
--- a/src/sp-fecomposite.h
+++ b/src/sp-fecomposite.h
/* FeComposite base class */
class SPFeCompositeClass;
-struct SPFeComposite : public SPFilter {
+struct SPFeComposite : public SPFilterPrimitive {
/** COMPOSITE ATTRIBUTES HERE */
};
struct SPFeCompositeClass {
- SPFilterClass parent_class;
+ SPFilterPrimitiveClass parent_class;
};
GType sp_feComposite_get_type();
index 0db0367427dd8cf1c7a1aae8a9701665e234933b..f7c50971b4e617992ddad7ab524b9df863ac0324 100644 (file)
#include "sp-feconvolvematrix.h"
#include "xml/repr.h"
-//#define SP_MACROS_SILENT
-//#include "macros.h"
-
-#define DEBUG_FECONVOLVEMATRIX
-#ifdef DEBUG_FECONVOLVEMATRIX
-# define debug(f, a...) { g_print("%s(%d) %s:", \
- __FILE__,__LINE__,__FUNCTION__); \
- g_print(f, ## a); \
- g_print("\n"); \
- }
-#else
-# define debug(f, a...) /**/
-#endif
/* FeConvolveMatrix base class */
static void sp_feConvolveMatrix_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feConvolveMatrix_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
-static SPObjectClass *feConvolveMatrix_parent_class;
+static SPFilterPrimitiveClass *feConvolveMatrix_parent_class;
GType
sp_feConvolveMatrix_get_type()
(GInstanceInitFunc) sp_feConvolveMatrix_init,
NULL, /* value_table */
};
- feConvolveMatrix_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeConvolveMatrix", &feConvolveMatrix_info, (GTypeFlags)0);
+ feConvolveMatrix_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeConvolveMatrix", &feConvolveMatrix_info, (GTypeFlags)0);
}
return feConvolveMatrix_type;
}
{
SPObjectClass *sp_object_class = (SPObjectClass *)klass;
- feConvolveMatrix_parent_class = (SPObjectClass*)g_type_class_peek_parent(klass);
+ feConvolveMatrix_parent_class = (SPFilterPrimitiveClass*)g_type_class_peek_parent(klass);
sp_object_class->build = sp_feConvolveMatrix_build;
sp_object_class->release = sp_feConvolveMatrix_release;
static void
sp_feConvolveMatrix_init(SPFeConvolveMatrix *feConvolveMatrix)
{
- debug("0x%p",feConvolveMatrix);
}
/**
static void
sp_feConvolveMatrix_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- debug("0x%p",object);
if (((SPObjectClass *) feConvolveMatrix_parent_class)->build) {
((SPObjectClass *) feConvolveMatrix_parent_class)->build(object, document, repr);
}
static void
sp_feConvolveMatrix_release(SPObject *object)
{
- debug("0x%p",object);
-
if (((SPObjectClass *) feConvolveMatrix_parent_class)->release)
((SPObjectClass *) feConvolveMatrix_parent_class)->release(object);
}
static void
sp_feConvolveMatrix_set(SPObject *object, unsigned int key, gchar const *value)
{
- debug("0x%p %s(%u): '%s'",object,
- sp_attribute_name(key),key,value);
SPFeConvolveMatrix *feConvolveMatrix = SP_FECONVOLVEMATRIX(object);
switch(key) {\r
static void
sp_feConvolveMatrix_update(SPObject *object, SPCtx *ctx, guint flags)
{
- debug("0x%p",object);
-
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
static Inkscape::XML::Node *
sp_feConvolveMatrix_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
- debug("0x%p",object);
-
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
if (repr) {
index 911f5d71c23a047f4dd9f8274f31e76f18564d99..d19666976947460c1e72aecc4cc118416357601c 100644 (file)
/* FeConvolveMatrix base class */
class SPFeConvolveMatrixClass;
-struct SPFeConvolveMatrix : public SPFilter {
+struct SPFeConvolveMatrix : public SPFilterPrimitive {
/** CONVOLVEMATRIX ATTRIBUTES HERE */
};
struct SPFeConvolveMatrixClass {
- SPFilterClass parent_class;
+ SPFilterPrimitiveClass parent_class;
};
GType sp_feConvolveMatrix_get_type();
index 5683b330d173e9490b7779ce46dd3007ba3e84f5..a84628aa99faae8ebae9e1de25f9ecefb8fc4c07 100644 (file)
#include "sp-fediffuselighting.h"
#include "xml/repr.h"
-//#define SP_MACROS_SILENT
-//#include "macros.h"
-
-#define DEBUG_FEDIFFUSELIGHTING
-#ifdef DEBUG_FEDIFFUSELIGHTING
-# define debug(f, a...) { g_print("%s(%d) %s:", \
- __FILE__,__LINE__,__FUNCTION__); \
- g_print(f, ## a); \
- g_print("\n"); \
- }
-#else
-# define debug(f, a...) /**/
-#endif
/* FeDiffuseLighting base class */
static void sp_feDiffuseLighting_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feDiffuseLighting_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
-static SPObjectClass *feDiffuseLighting_parent_class;
+static SPFilterPrimitiveClass *feDiffuseLighting_parent_class;
GType
sp_feDiffuseLighting_get_type()
(GInstanceInitFunc) sp_feDiffuseLighting_init,
NULL, /* value_table */
};
- feDiffuseLighting_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeDiffuseLighting", &feDiffuseLighting_info, (GTypeFlags)0);
+ feDiffuseLighting_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeDiffuseLighting", &feDiffuseLighting_info, (GTypeFlags)0);
}
return feDiffuseLighting_type;
}
{
SPObjectClass *sp_object_class = (SPObjectClass *)klass;
- feDiffuseLighting_parent_class = (SPObjectClass*)g_type_class_peek_parent(klass);
+ feDiffuseLighting_parent_class = (SPFilterPrimitiveClass*)g_type_class_peek_parent(klass);
sp_object_class->build = sp_feDiffuseLighting_build;
sp_object_class->release = sp_feDiffuseLighting_release;
static void
sp_feDiffuseLighting_init(SPFeDiffuseLighting *feDiffuseLighting)
{
- debug("0x%p",feDiffuseLighting);
}
/**
static void
sp_feDiffuseLighting_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- debug("0x%p",object);
if (((SPObjectClass *) feDiffuseLighting_parent_class)->build) {
((SPObjectClass *) feDiffuseLighting_parent_class)->build(object, document, repr);
}
static void
sp_feDiffuseLighting_release(SPObject *object)
{
- debug("0x%p",object);
-
if (((SPObjectClass *) feDiffuseLighting_parent_class)->release)
((SPObjectClass *) feDiffuseLighting_parent_class)->release(object);
}
static void
sp_feDiffuseLighting_set(SPObject *object, unsigned int key, gchar const *value)
{
- debug("0x%p %s(%u): '%s'",object,
- sp_attribute_name(key),key,value);
SPFeDiffuseLighting *feDiffuseLighting = SP_FEDIFFUSELIGHTING(object);
switch(key) {\r
@@ -144,8 +125,6 @@ sp_feDiffuseLighting_set(SPObject *object, unsigned int key, gchar const *value)
static void
sp_feDiffuseLighting_update(SPObject *object, SPCtx *ctx, guint flags)
{
- debug("0x%p",object);
-
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
static Inkscape::XML::Node *
sp_feDiffuseLighting_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
- debug("0x%p",object);
-
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
if (repr) {
index 598f380e3c6bd0bc1952fad4257151b83c9fb4c2..c937c2dd862c5f9a865dca42acbad78d1d25b697 100644 (file)
-#ifndef SP_FEDIFFUSELIGHTING_FNS_H
-#define SP_FEDIFFUSELIGHTING_FNS_H
-
-/** \file
- * Macros and fn declarations related to gaussian blur filter.
- */
-
-#include <glib-object.h>
-#include <glib/gtypes.h>
-
-namespace Inkscape {
-namespace XML {
-class Node;
-}
-}
-
-class SPFeDiffuseLighting;
-
-#define SP_TYPE_FEDIFFUSELIGHTING (sp_feDiffuseLighting_get_type())
-#define SP_FEDIFFUSELIGHTING(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SP_TYPE_FEDIFFUSELIGHTING, SPFeDiffuseLighting))
-#define SP_FEDIFFUSELIGHTING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), SP_TYPE_FEDIFFUSELIGHTING, SPFeDiffuseLightingClass))
-#define SP_IS_FEDIFFUSELIGHTING(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), SP_TYPE_FEDIFFUSELIGHTING))
-#define SP_IS_FEDIFFUSELIGHTING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), SP_TYPE_FEDIFFUSELIGHTING))
-
-GType sp_feDiffuseLighting_get_type();
-
-#endif /* !SP_FEDIFFUSELIGHTING_FNS_H */
-
-/*
- 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 :
#ifndef SP_FEDIFFUSELIGHTING_H_SEEN
#define SP_FEDIFFUSELIGHTING_H_SEEN
/* FeDiffuseLighting base class */
class SPFeDiffuseLightingClass;
-struct SPFeDiffuseLighting : public SPFilter {
+struct SPFeDiffuseLighting : public SPFilterPrimitive {
/** DIFFUSELIGHTING ATTRIBUTES HERE */
};
struct SPFeDiffuseLightingClass {
- SPFilterClass parent_class;
+ SPFilterPrimitiveClass parent_class;
};
GType sp_feDiffuseLighting_get_type();
index 43eb82043024ff3892705c5079a5051ca506ba53..51bba62e3805eeeb67804e4037947a1854eb1ee1 100644 (file)
#include "sp-fedisplacementmap.h"
#include "xml/repr.h"
-//#define SP_MACROS_SILENT
-//#include "macros.h"
-
-#define DEBUG_FEDISPLACEMENTMAP
-#ifdef DEBUG_FEDISPLACEMENTMAP
-# define debug(f, a...) { g_print("%s(%d) %s:", \
- __FILE__,__LINE__,__FUNCTION__); \
- g_print(f, ## a); \
- g_print("\n"); \
- }
-#else
-# define debug(f, a...) /**/
-#endif
/* FeDisplacementMap base class */
static void sp_feDisplacementMap_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feDisplacementMap_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
-static SPObjectClass *feDisplacementMap_parent_class;
+static SPFilterPrimitiveClass *feDisplacementMap_parent_class;
GType
sp_feDisplacementMap_get_type()
(GInstanceInitFunc) sp_feDisplacementMap_init,
NULL, /* value_table */
};
- feDisplacementMap_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeDisplacementMap", &feDisplacementMap_info, (GTypeFlags)0);
+ feDisplacementMap_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeDisplacementMap", &feDisplacementMap_info, (GTypeFlags)0);
}
return feDisplacementMap_type;
}
{
SPObjectClass *sp_object_class = (SPObjectClass *)klass;
- feDisplacementMap_parent_class = (SPObjectClass*)g_type_class_peek_parent(klass);
+ feDisplacementMap_parent_class = (SPFilterPrimitiveClass*)g_type_class_peek_parent(klass);
sp_object_class->build = sp_feDisplacementMap_build;
sp_object_class->release = sp_feDisplacementMap_release;
static void
sp_feDisplacementMap_init(SPFeDisplacementMap *feDisplacementMap)
{
- debug("0x%p",feDisplacementMap);
}
/**
static void
sp_feDisplacementMap_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- debug("0x%p",object);
if (((SPObjectClass *) feDisplacementMap_parent_class)->build) {
((SPObjectClass *) feDisplacementMap_parent_class)->build(object, document, repr);
}
static void
sp_feDisplacementMap_release(SPObject *object)
{
- debug("0x%p",object);
-
if (((SPObjectClass *) feDisplacementMap_parent_class)->release)
((SPObjectClass *) feDisplacementMap_parent_class)->release(object);
}
static void
sp_feDisplacementMap_set(SPObject *object, unsigned int key, gchar const *value)
{
- debug("0x%p %s(%u): '%s'",object,
- sp_attribute_name(key),key,value);
SPFeDisplacementMap *feDisplacementMap = SP_FEDISPLACEMENTMAP(object);
switch(key) {\r
@@ -144,8 +125,6 @@ sp_feDisplacementMap_set(SPObject *object, unsigned int key, gchar const *value)
static void
sp_feDisplacementMap_update(SPObject *object, SPCtx *ctx, guint flags)
{
- debug("0x%p",object);
-
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
static Inkscape::XML::Node *
sp_feDisplacementMap_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
- debug("0x%p",object);
-
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
if (repr) {
index 6800d448548569a57e381abdcc272e871f6d7edf..1e4eb284584ba2731aabe61899252db918966182 100644 (file)
/* FeDisplacementMap base class */
class SPFeDisplacementMapClass;
-struct SPFeDisplacementMap : public SPFilter {
+struct SPFeDisplacementMap : public SPFilterPrimitive {
/** DISPLACEMENTMAP ATTRIBUTES HERE */
};
struct SPFeDisplacementMapClass {
- SPFilterClass parent_class;
+ SPFilterPrimitiveClass parent_class;
};
GType sp_feDisplacementMap_get_type();
diff --git a/src/sp-feflood.cpp b/src/sp-feflood.cpp
index e10c871afd5767461a10f364e3ed44d798c24122..de7b658d75a4bc1cc699d596fa04854c4d6428fd 100644 (file)
--- a/src/sp-feflood.cpp
+++ b/src/sp-feflood.cpp
#include "sp-feflood.h"
#include "xml/repr.h"
-//#define SP_MACROS_SILENT
-//#include "macros.h"
-
-#define DEBUG_FEFLOOD
-#ifdef DEBUG_FEFLOOD
-# define debug(f, a...) { g_print("%s(%d) %s:", \
- __FILE__,__LINE__,__FUNCTION__); \
- g_print(f, ## a); \
- g_print("\n"); \
- }
-#else
-# define debug(f, a...) /**/
-#endif
/* FeFlood base class */
static void sp_feFlood_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feFlood_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
-static SPObjectClass *feFlood_parent_class;
+static SPFilterPrimitiveClass *feFlood_parent_class;
GType
sp_feFlood_get_type()
(GInstanceInitFunc) sp_feFlood_init,
NULL, /* value_table */
};
- feFlood_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeFlood", &feFlood_info, (GTypeFlags)0);
+ feFlood_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeFlood", &feFlood_info, (GTypeFlags)0);
}
return feFlood_type;
}
{
SPObjectClass *sp_object_class = (SPObjectClass *)klass;
- feFlood_parent_class = (SPObjectClass*)g_type_class_peek_parent(klass);
+ feFlood_parent_class = (SPFilterPrimitiveClass*)g_type_class_peek_parent(klass);
sp_object_class->build = sp_feFlood_build;
sp_object_class->release = sp_feFlood_release;
static void
sp_feFlood_init(SPFeFlood *feFlood)
{
- debug("0x%p",feFlood);
}
/**
static void
sp_feFlood_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- debug("0x%p",object);
if (((SPObjectClass *) feFlood_parent_class)->build) {
((SPObjectClass *) feFlood_parent_class)->build(object, document, repr);
}
static void
sp_feFlood_release(SPObject *object)
{
- debug("0x%p",object);
-
if (((SPObjectClass *) feFlood_parent_class)->release)
((SPObjectClass *) feFlood_parent_class)->release(object);
}
static void
sp_feFlood_set(SPObject *object, unsigned int key, gchar const *value)
{
- debug("0x%p %s(%u): '%s'",object,
- sp_attribute_name(key),key,value);
SPFeFlood *feFlood = SP_FEFLOOD(object);
switch(key) {\r
static void
sp_feFlood_update(SPObject *object, SPCtx *ctx, guint flags)
{
- debug("0x%p",object);
-
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
static Inkscape::XML::Node *
sp_feFlood_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
- debug("0x%p",object);
-
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
if (repr) {
diff --git a/src/sp-feflood.h b/src/sp-feflood.h
index 4fc5da31dbbb60e398c1d09b52627d2a7d81b652..87d674ab732b5de2db3d5b4a44cdd229d1f1c686 100644 (file)
--- a/src/sp-feflood.h
+++ b/src/sp-feflood.h
/* FeFlood base class */
class SPFeFloodClass;
-struct SPFeFlood : public SPFilter {
+struct SPFeFlood : public SPFilterPrimitive {
/** FLOOD ATTRIBUTES HERE */
};
struct SPFeFloodClass {
- SPFilterClass parent_class;
+ SPFilterPrimitiveClass parent_class;
};
GType sp_feFlood_get_type();
diff --git a/src/sp-feimage.cpp b/src/sp-feimage.cpp
index 08bb1f3e2e67c1994888361615eb108c6f594736..b7c857d4e374fdcb182b3cd977051803eaa5c758 100644 (file)
--- a/src/sp-feimage.cpp
+++ b/src/sp-feimage.cpp
-#define __SP_FEIMAGE_CPP__
+ #define __SP_FEIMAGE_CPP__
/** \file
* SVG <feImage> implementation.
#include "sp-feimage.h"
#include "xml/repr.h"
-//#define SP_MACROS_SILENT
-//#include "macros.h"
-
-#define DEBUG_FEIMAGE
-#ifdef DEBUG_FEIMAGE
-# define debug(f, a...) { g_print("%s(%d) %s:", \
- __FILE__,__LINE__,__FUNCTION__); \
- g_print(f, ## a); \
- g_print("\n"); \
- }
-#else
-# define debug(f, a...) /**/
-#endif
/* FeImage base class */
static void sp_feImage_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feImage_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
-static SPObjectClass *feImage_parent_class;
+static SPFilterPrimitiveClass *feImage_parent_class;
GType
sp_feImage_get_type()
(GInstanceInitFunc) sp_feImage_init,
NULL, /* value_table */
};
- feImage_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeImage", &feImage_info, (GTypeFlags)0);
+ feImage_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeImage", &feImage_info, (GTypeFlags)0);
}
return feImage_type;
}
{
SPObjectClass *sp_object_class = (SPObjectClass *)klass;
- feImage_parent_class = (SPObjectClass*)g_type_class_peek_parent(klass);
+ feImage_parent_class = (SPFilterPrimitiveClass*)g_type_class_peek_parent(klass);
sp_object_class->build = sp_feImage_build;
sp_object_class->release = sp_feImage_release;
static void
sp_feImage_init(SPFeImage *feImage)
{
- debug("0x%p",feImage);
}
/**
static void
sp_feImage_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- debug("0x%p",object);
if (((SPObjectClass *) feImage_parent_class)->build) {
((SPObjectClass *) feImage_parent_class)->build(object, document, repr);
}
static void
sp_feImage_release(SPObject *object)
{
- debug("0x%p",object);
if (((SPObjectClass *) feImage_parent_class)->release)
((SPObjectClass *) feImage_parent_class)->release(object);
static void
sp_feImage_set(SPObject *object, unsigned int key, gchar const *value)
{
- debug("0x%p %s(%u): '%s'",object,
- sp_attribute_name(key),key,value);
SPFeImage *feImage = SP_FEIMAGE(object);
switch(key) {\r
static void
sp_feImage_update(SPObject *object, SPCtx *ctx, guint flags)
{
- debug("0x%p",object);
-
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
static Inkscape::XML::Node *
sp_feImage_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
- debug("0x%p",object);
-
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
if (repr) {
diff --git a/src/sp-feimage.h b/src/sp-feimage.h
index 958c6232fcfc91cc6e090e7d272539e327242474..cb6f48f40f8981a8299c3349607a41ae54eadd63 100644 (file)
--- a/src/sp-feimage.h
+++ b/src/sp-feimage.h
/* FeImage base class */
class SPFeImageClass;
-struct SPFeImage : public SPFilter {
+struct SPFeImage : public SPFilterPrimitive {
/** IMAGE ATTRIBUTES HERE */
};
struct SPFeImageClass {
- SPFilterClass parent_class;
+ SPFilterPrimitiveClass parent_class;
};
GType sp_feImage_get_type();
diff --git a/src/sp-femerge.cpp b/src/sp-femerge.cpp
index 6904f5b52db541e6a867ba4678b4fe961de5d040..830fe21e43dd8d820c2c167e3e913d0a58762ccd 100644 (file)
--- a/src/sp-femerge.cpp
+++ b/src/sp-femerge.cpp
#include "sp-femerge.h"
#include "xml/repr.h"
-//#define SP_MACROS_SILENT
-//#include "macros.h"
-
-#define DEBUG_FEMERGE
-#ifdef DEBUG_FEMERGE
-# define debug(f, a...) { g_print("%s(%d) %s:", \
- __FILE__,__LINE__,__FUNCTION__); \
- g_print(f, ## a); \
- g_print("\n"); \
- }
-#else
-# define debug(f, a...) /**/
-#endif
/* FeMerge base class */
static void sp_feMerge_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feMerge_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
-static SPObjectClass *feMerge_parent_class;
+static SPFilterPrimitiveClass *feMerge_parent_class;
GType
sp_feMerge_get_type()
(GInstanceInitFunc) sp_feMerge_init,
NULL, /* value_table */
};
- feMerge_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeMerge", &feMerge_info, (GTypeFlags)0);
+ feMerge_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeMerge", &feMerge_info, (GTypeFlags)0);
}
return feMerge_type;
}
{
SPObjectClass *sp_object_class = (SPObjectClass *)klass;
- feMerge_parent_class = (SPObjectClass*)g_type_class_peek_parent(klass);
+ feMerge_parent_class = (SPFilterPrimitiveClass*)g_type_class_peek_parent(klass);
sp_object_class->build = sp_feMerge_build;
sp_object_class->release = sp_feMerge_release;
static void
sp_feMerge_init(SPFeMerge *feMerge)
{
- debug("0x%p",feMerge);
}
/**
static void
sp_feMerge_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- debug("0x%p",object);
if (((SPObjectClass *) feMerge_parent_class)->build) {
((SPObjectClass *) feMerge_parent_class)->build(object, document, repr);
}
static void
sp_feMerge_release(SPObject *object)
{
- debug("0x%p",object);
-
if (((SPObjectClass *) feMerge_parent_class)->release)
((SPObjectClass *) feMerge_parent_class)->release(object);
}
static void
sp_feMerge_set(SPObject *object, unsigned int key, gchar const *value)
{
- debug("0x%p %s(%u): '%s'",object,
- sp_attribute_name(key),key,value);
SPFeMerge *feMerge = SP_FEMERGE(object);
switch(key) {\r
static void
sp_feMerge_update(SPObject *object, SPCtx *ctx, guint flags)
{
- debug("0x%p",object);
-
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
static Inkscape::XML::Node *
sp_feMerge_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
- debug("0x%p",object);
-
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
if (repr) {
diff --git a/src/sp-femerge.h b/src/sp-femerge.h
index 41bdfa377938393b78d613498710c37074e08228..015f2e33c415f435a1fdcba4d8c6159e170f5102 100644 (file)
--- a/src/sp-femerge.h
+++ b/src/sp-femerge.h
/* FeMerge base class */
class SPFeMergeClass;
-struct SPFeMerge : public SPFilter {
+struct SPFeMerge : public SPFilterPrimitive {
/** MERGE ATTRIBUTES HERE */
};
struct SPFeMergeClass {
- SPFilterClass parent_class;
+ SPFilterPrimitiveClass parent_class;
};
GType sp_feMerge_get_type();
index 5d015232f3e0950de8bf55c1aaceee3b40446171..a7497560c4d66f091a50ae1b6701c6e3d978f2d7 100644 (file)
--- a/src/sp-femorphology.cpp
+++ b/src/sp-femorphology.cpp
#include "sp-femorphology.h"
#include "xml/repr.h"
-//#define SP_MACROS_SILENT
-//#include "macros.h"
-
-#define DEBUG_FEMORPHOLOGY
-#ifdef DEBUG_FEMORPHOLOGY
-# define debug(f, a...) { g_print("%s(%d) %s:", \
- __FILE__,__LINE__,__FUNCTION__); \
- g_print(f, ## a); \
- g_print("\n"); \
- }
-#else
-# define debug(f, a...) /**/
-#endif
/* FeMorphology base class */
static void sp_feMorphology_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feMorphology_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
-static SPObjectClass *feMorphology_parent_class;
+static SPFilterPrimitiveClass *feMorphology_parent_class;
GType
sp_feMorphology_get_type()
(GInstanceInitFunc) sp_feMorphology_init,
NULL, /* value_table */
};
- feMorphology_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeMorphology", &feMorphology_info, (GTypeFlags)0);
+ feMorphology_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeMorphology", &feMorphology_info, (GTypeFlags)0);
}
return feMorphology_type;
}
{
SPObjectClass *sp_object_class = (SPObjectClass *)klass;
- feMorphology_parent_class = (SPObjectClass*)g_type_class_peek_parent(klass);
+ feMorphology_parent_class = (SPFilterPrimitiveClass*)g_type_class_peek_parent(klass);
sp_object_class->build = sp_feMorphology_build;
sp_object_class->release = sp_feMorphology_release;
static void
sp_feMorphology_init(SPFeMorphology *feMorphology)
{
- debug("0x%p",feMorphology);
}
/**
static void
sp_feMorphology_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- debug("0x%p",object);
if (((SPObjectClass *) feMorphology_parent_class)->build) {
((SPObjectClass *) feMorphology_parent_class)->build(object, document, repr);
}
static void
sp_feMorphology_release(SPObject *object)
{
- debug("0x%p",object);
-
if (((SPObjectClass *) feMorphology_parent_class)->release)
((SPObjectClass *) feMorphology_parent_class)->release(object);
}
static void
sp_feMorphology_set(SPObject *object, unsigned int key, gchar const *value)
{
- debug("0x%p %s(%u): '%s'",object,
- sp_attribute_name(key),key,value);
SPFeMorphology *feMorphology = SP_FEMORPHOLOGY(object);
switch(key) {\r
static void
sp_feMorphology_update(SPObject *object, SPCtx *ctx, guint flags)
{
- debug("0x%p",object);
-
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
static Inkscape::XML::Node *
sp_feMorphology_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
- debug("0x%p",object);
-
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
if (repr) {
diff --git a/src/sp-femorphology.h b/src/sp-femorphology.h
index c810c0360a48af33c4911f11e242af88935b0fc0..b3196fe084c1a892cb01a5b2287009469c64505e 100644 (file)
--- a/src/sp-femorphology.h
+++ b/src/sp-femorphology.h
/* FeMorphology base class */
class SPFeMorphologyClass;
-struct SPFeMorphology : public SPFilter {
+struct SPFeMorphology : public SPFilterPrimitive {
/** MORPHOLOGY ATTRIBUTES HERE */
};
struct SPFeMorphologyClass {
- SPFilterClass parent_class;
+ SPFilterPrimitiveClass parent_class;
};
GType sp_feMorphology_get_type();
diff --git a/src/sp-feoffset.cpp b/src/sp-feoffset.cpp
index 3429ceb185261c220cc93a8ebc10fcae6a3e63bb..0f2f05062916bbf4edaf3145ffb83749a1bbc33c 100644 (file)
--- a/src/sp-feoffset.cpp
+++ b/src/sp-feoffset.cpp
#include "sp-feoffset.h"
#include "xml/repr.h"
-//#define SP_MACROS_SILENT
-//#include "macros.h"
-
-#define DEBUG_FEOFFSET
-#ifdef DEBUG_FEOFFSET
-# define debug(f, a...) { g_print("%s(%d) %s:", \
- __FILE__,__LINE__,__FUNCTION__); \
- g_print(f, ## a); \
- g_print("\n"); \
- }
-#else
-# define debug(f, a...) /**/
-#endif
/* FeOffset base class */
static void sp_feOffset_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feOffset_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
-static SPObjectClass *feOffset_parent_class;
+static SPFilterPrimitiveClass *feOffset_parent_class;
GType
sp_feOffset_get_type()
(GInstanceInitFunc) sp_feOffset_init,
NULL, /* value_table */
};
- feOffset_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeOffset", &feOffset_info, (GTypeFlags)0);
+ feOffset_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeOffset", &feOffset_info, (GTypeFlags)0);
}
return feOffset_type;
}
{
SPObjectClass *sp_object_class = (SPObjectClass *)klass;
- feOffset_parent_class = (SPObjectClass*)g_type_class_peek_parent(klass);
+ feOffset_parent_class = (SPFilterPrimitiveClass*)g_type_class_peek_parent(klass);
sp_object_class->build = sp_feOffset_build;
sp_object_class->release = sp_feOffset_release;
static void
sp_feOffset_init(SPFeOffset *feOffset)
{
- debug("0x%p",feOffset);
}
/**
static void
sp_feOffset_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- debug("0x%p",object);
if (((SPObjectClass *) feOffset_parent_class)->build) {
((SPObjectClass *) feOffset_parent_class)->build(object, document, repr);
}
static void
sp_feOffset_release(SPObject *object)
{
- debug("0x%p",object);
-
if (((SPObjectClass *) feOffset_parent_class)->release)
((SPObjectClass *) feOffset_parent_class)->release(object);
}
static void
sp_feOffset_set(SPObject *object, unsigned int key, gchar const *value)
{
- debug("0x%p %s(%u): '%s'",object,
- sp_attribute_name(key),key,value);
SPFeOffset *feOffset = SP_FEOFFSET(object);
switch(key) {\r
static void
sp_feOffset_update(SPObject *object, SPCtx *ctx, guint flags)
{
- debug("0x%p",object);
-
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
static Inkscape::XML::Node *
sp_feOffset_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
- debug("0x%p",object);
-
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
if (repr) {
diff --git a/src/sp-feoffset.h b/src/sp-feoffset.h
index 7a5c2b7837ac37a354659dd7a517a7beb882ecb9..2eda946c2c1b9d3561ada42054bb98819d3e16f4 100644 (file)
--- a/src/sp-feoffset.h
+++ b/src/sp-feoffset.h
/* FeOffset base class */
class SPFeOffsetClass;
-struct SPFeOffset : public SPFilter {
+struct SPFeOffset : public SPFilterPrimitive {
/** OFFSET ATTRIBUTES HERE */
};
struct SPFeOffsetClass {
- SPFilterClass parent_class;
+ SPFilterPrimitiveClass parent_class;
};
GType sp_feOffset_get_type();
index 4fe25d48ace54cdc2a6fbcdc02c63c462ca073c0..d03d8bf06662cb9df2f13fb7a6c3b9c4aac61a25 100644 (file)
#include "sp-fespecularlighting.h"
#include "xml/repr.h"
-//#define SP_MACROS_SILENT
-//#include "macros.h"
-
-#define DEBUG_FESPECULARLIGHTING
-#ifdef DEBUG_FESPECULARLIGHTING
-# define debug(f, a...) { g_print("%s(%d) %s:", \
- __FILE__,__LINE__,__FUNCTION__); \
- g_print(f, ## a); \
- g_print("\n"); \
- }
-#else
-# define debug(f, a...) /**/
-#endif
/* FeSpecularLighting base class */
static void sp_feSpecularLighting_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feSpecularLighting_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
-static SPObjectClass *feSpecularLighting_parent_class;
+static SPFilterPrimitiveClass *feSpecularLighting_parent_class;
GType
sp_feSpecularLighting_get_type()
(GInstanceInitFunc) sp_feSpecularLighting_init,
NULL, /* value_table */
};
- feSpecularLighting_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeSpecularLighting", &feSpecularLighting_info, (GTypeFlags)0);
+ feSpecularLighting_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeSpecularLighting", &feSpecularLighting_info, (GTypeFlags)0);
}
return feSpecularLighting_type;
}
{
SPObjectClass *sp_object_class = (SPObjectClass *)klass;
- feSpecularLighting_parent_class = (SPObjectClass*)g_type_class_peek_parent(klass);
+ feSpecularLighting_parent_class = (SPFilterPrimitiveClass*)g_type_class_peek_parent(klass);
sp_object_class->build = sp_feSpecularLighting_build;
sp_object_class->release = sp_feSpecularLighting_release;
static void
sp_feSpecularLighting_init(SPFeSpecularLighting *feSpecularLighting)
{
- debug("0x%p",feSpecularLighting);
}
/**
static void
sp_feSpecularLighting_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- debug("0x%p",object);
if (((SPObjectClass *) feSpecularLighting_parent_class)->build) {
((SPObjectClass *) feSpecularLighting_parent_class)->build(object, document, repr);
}
static void
sp_feSpecularLighting_release(SPObject *object)
{
- debug("0x%p",object);
-
if (((SPObjectClass *) feSpecularLighting_parent_class)->release)
((SPObjectClass *) feSpecularLighting_parent_class)->release(object);
}
static void
sp_feSpecularLighting_set(SPObject *object, unsigned int key, gchar const *value)
{
- debug("0x%p %s(%u): '%s'",object,
- sp_attribute_name(key),key,value);
SPFeSpecularLighting *feSpecularLighting = SP_FESPECULARLIGHTING(object);
switch(key) {\r
@@ -144,8 +125,6 @@ sp_feSpecularLighting_set(SPObject *object, unsigned int key, gchar const *value
static void
sp_feSpecularLighting_update(SPObject *object, SPCtx *ctx, guint flags)
{
- debug("0x%p",object);
-
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
static Inkscape::XML::Node *
sp_feSpecularLighting_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
- debug("0x%p",object);
-
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
if (repr) {
index 885215b8927db384d11536eac8e05cd004f8dfc1..3c0887f157f46c829dccf675646b472bb1e79810 100644 (file)
/* FeSpecularLighting base class */
class SPFeSpecularLightingClass;
-struct SPFeSpecularLighting : public SPFilter {
+struct SPFeSpecularLighting : public SPFilterPrimitive {
/** SPECULARLIGHTING ATTRIBUTES HERE */
};
struct SPFeSpecularLightingClass {
- SPFilterClass parent_class;
+ SPFilterPrimitiveClass parent_class;
};
GType sp_feSpecularLighting_get_type();
diff --git a/src/sp-fetile.cpp b/src/sp-fetile.cpp
index a11fbc020e3d0bbf2589c6e5f5d9ab29b39340eb..a00bdd1e1a662b019f08fc721ebacb5d8fa2d4c3 100644 (file)
--- a/src/sp-fetile.cpp
+++ b/src/sp-fetile.cpp
#include "sp-fetile.h"
#include "xml/repr.h"
-//#define SP_MACROS_SILENT
-//#include "macros.h"
-
-#define DEBUG_FETILE
-#ifdef DEBUG_FETILE
-# define debug(f, a...) { g_print("%s(%d) %s:", \
- __FILE__,__LINE__,__FUNCTION__); \
- g_print(f, ## a); \
- g_print("\n"); \
- }
-#else
-# define debug(f, a...) /**/
-#endif
/* FeTile base class */
static void sp_feTile_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feTile_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
-static SPObjectClass *feTile_parent_class;
+static SPFilterPrimitiveClass *feTile_parent_class;
GType
sp_feTile_get_type()
(GInstanceInitFunc) sp_feTile_init,
NULL, /* value_table */
};
- feTile_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeTile", &feTile_info, (GTypeFlags)0);
+ feTile_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeTile", &feTile_info, (GTypeFlags)0);
}
return feTile_type;
}
{
SPObjectClass *sp_object_class = (SPObjectClass *)klass;
- feTile_parent_class = (SPObjectClass*)g_type_class_peek_parent(klass);
+ feTile_parent_class = (SPFilterPrimitiveClass*)g_type_class_peek_parent(klass);
sp_object_class->build = sp_feTile_build;
sp_object_class->release = sp_feTile_release;
static void
sp_feTile_init(SPFeTile *feTile)
{
- debug("0x%p",feTile);
}
/**
static void
sp_feTile_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- debug("0x%p",object);
if (((SPObjectClass *) feTile_parent_class)->build) {
((SPObjectClass *) feTile_parent_class)->build(object, document, repr);
}
static void
sp_feTile_release(SPObject *object)
{
- debug("0x%p",object);
-
if (((SPObjectClass *) feTile_parent_class)->release)
((SPObjectClass *) feTile_parent_class)->release(object);
}
static void
sp_feTile_set(SPObject *object, unsigned int key, gchar const *value)
{
- debug("0x%p %s(%u): '%s'",object,
- sp_attribute_name(key),key,value);
SPFeTile *feTile = SP_FETILE(object);
switch(key) {\r
static void
sp_feTile_update(SPObject *object, SPCtx *ctx, guint flags)
{
- debug("0x%p",object);
-
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
static Inkscape::XML::Node *
sp_feTile_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
- debug("0x%p",object);
-
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
if (repr) {
diff --git a/src/sp-fetile.h b/src/sp-fetile.h
index 4cec1c3aabe47fccf9934e7d3ed18d2882a1d01f..b6234c3f2832023c33997182467f86733370739b 100644 (file)
--- a/src/sp-fetile.h
+++ b/src/sp-fetile.h
/* FeTile base class */
class SPFeTileClass;
-struct SPFeTile : public SPFilter {
+struct SPFeTile : public SPFilterPrimitive {
/** TILE ATTRIBUTES HERE */
};
struct SPFeTileClass {
- SPFilterClass parent_class;
+ SPFilterPrimitiveClass parent_class;
};
GType sp_feTile_get_type();
index 0122f1f20ae37c4b0aadc8e23bf8a47659666040..b1bfea613302c607d9bb6d3a4c8f28df37805007 100644 (file)
--- a/src/sp-feturbulence.cpp
+++ b/src/sp-feturbulence.cpp
#include "sp-feturbulence.h"
#include "xml/repr.h"
-//#define SP_MACROS_SILENT
-//#include "macros.h"
-
-#define DEBUG_FETURBULENCE
-#ifdef DEBUG_FETURBULENCE
-# define debug(f, a...) { g_print("%s(%d) %s:", \
- __FILE__,__LINE__,__FUNCTION__); \
- g_print(f, ## a); \
- g_print("\n"); \
- }
-#else
-# define debug(f, a...) /**/
-#endif
/* FeTurbulence base class */
static void sp_feTurbulence_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feTurbulence_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
-static SPObjectClass *feTurbulence_parent_class;
+static SPFilterPrimitiveClass *feTurbulence_parent_class;
GType
sp_feTurbulence_get_type()
(GInstanceInitFunc) sp_feTurbulence_init,
NULL, /* value_table */
};
- feTurbulence_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeTurbulence", &feTurbulence_info, (GTypeFlags)0);
+ feTurbulence_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeTurbulence", &feTurbulence_info, (GTypeFlags)0);
}
return feTurbulence_type;
}
{
SPObjectClass *sp_object_class = (SPObjectClass *)klass;
- feTurbulence_parent_class = (SPObjectClass*)g_type_class_peek_parent(klass);
+ feTurbulence_parent_class = (SPFilterPrimitiveClass*)g_type_class_peek_parent(klass);
sp_object_class->build = sp_feTurbulence_build;
sp_object_class->release = sp_feTurbulence_release;
static void
sp_feTurbulence_init(SPFeTurbulence *feTurbulence)
{
- debug("0x%p",feTurbulence);
}
/**
static void
sp_feTurbulence_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- debug("0x%p",object);
if (((SPObjectClass *) feTurbulence_parent_class)->build) {
((SPObjectClass *) feTurbulence_parent_class)->build(object, document, repr);
}
static void
sp_feTurbulence_release(SPObject *object)
{
- debug("0x%p",object);
-
if (((SPObjectClass *) feTurbulence_parent_class)->release)
((SPObjectClass *) feTurbulence_parent_class)->release(object);
}
static void
sp_feTurbulence_set(SPObject *object, unsigned int key, gchar const *value)
{
- debug("0x%p %s(%u): '%s'",object,
- sp_attribute_name(key),key,value);
SPFeTurbulence *feTurbulence = SP_FETURBULENCE(object);
switch(key) {\r
static void
sp_feTurbulence_update(SPObject *object, SPCtx *ctx, guint flags)
{
- debug("0x%p",object);
-
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
static Inkscape::XML::Node *
sp_feTurbulence_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
- debug("0x%p",object);
-
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
if (repr) {
diff --git a/src/sp-feturbulence.h b/src/sp-feturbulence.h
index 9040e7a994881e92a408efa20afbce7b553bc986..bf9ed2572607a1addd057bc8d0b5c01e2b47a490 100644 (file)
--- a/src/sp-feturbulence.h
+++ b/src/sp-feturbulence.h
/* FeTurbulence base class */
class SPFeTurbulenceClass;
-struct SPFeTurbulence : public SPFilter {
+struct SPFeTurbulence : public SPFilterPrimitive {
/** TURBULENCE ATTRIBUTES HERE */
};
struct SPFeTurbulenceClass {
- SPFilterClass parent_class;
+ SPFilterPrimitiveClass parent_class;
};
GType sp_feTurbulence_get_type();
diff --git a/src/sp-filter-fns.h b/src/sp-filter-fns.h
index 21913c995b819f49d508b739fcfe394084438404..4e1b012a362b5b4cc8c3e8c3fb48dbb92a1b2f89 100644 (file)
--- a/src/sp-filter-fns.h
+++ b/src/sp-filter-fns.h
#include <glib-object.h>
#include "libnr/nr-forward.h"
#include "sp-filter-units.h"
+#include "sp-filter-primitive.h"
class SPFilter;
//need to define function
void sp_filter_set_primitive_units(SPFilter *filter, SPFilterUnits filterUnits);
+SPFilterPrimitive *add_primitive(SPFilter *filter, SPFilterPrimitive *primitive);
+SPFilterPrimitive *get_primitive(SPFilter *filter, int index);
+
#endif /* !SEEN_SP_FILTER_FNS_H */
diff --git a/src/sp-filter-primitive.cpp b/src/sp-filter-primitive.cpp
--- /dev/null
@@ -0,0 +1,198 @@
+#define __SP_FILTER_PRIMITIVE_CPP__\r
+\r
+/** \file\r
+ * SVG <filter_primitive> implementation, used as an example for a base starting class\r
+ * when implementing new sp-objects.\r
+ *\r
+ * In vi, three global search-and-replaces will let you rename everything\r
+ * in this and the .h file:\r
+ *\r
+ * :%s/FILTER_PRIMITIVE/YOURNAME/g\r
+ * :%s/FilterPrimitive/Yourname/g\r
+ * :%s/filter_primitive/yourname/g\r
+ */\r
+/*\r
+ * Authors:\r
+ * Kees Cook <kees@outflux.net>\r
+ *\r
+ * Copyright (C) 2004 Kees Cook\r
+ *\r
+ * Released under GNU GPL, read the file 'COPYING' for more information\r
+ */\r
+\r
+#ifdef HAVE_CONFIG_H\r
+# include "config.h"\r
+#endif\r
+\r
+#include "attributes.h"\r
+#include "sp-filter-primitive.h"\r
+#include "xml/repr.h"\r
+\r
+\r
+/* FilterPrimitive base class */\r
+\r
+static void sp_filter_primitive_class_init(SPFilterPrimitiveClass *klass);\r
+static void sp_filter_primitive_init(SPFilterPrimitive *filter_primitive);\r
+\r
+static void sp_filter_primitive_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);\r
+static void sp_filter_primitive_release(SPObject *object);\r
+static void sp_filter_primitive_set(SPObject *object, unsigned int key, gchar const *value);\r
+static void sp_filter_primitive_update(SPObject *object, SPCtx *ctx, guint flags);\r
+static Inkscape::XML::Node *sp_filter_primitive_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);\r
+\r
+static SPObjectClass *filter_primitive_parent_class;\r
+\r
+GType\r
+sp_filter_primitive_get_type()\r
+{\r
+ static GType filter_primitive_type = 0;\r
+\r
+ if (!filter_primitive_type) {\r
+ GTypeInfo filter_primitive_info = {\r
+ sizeof(SPFilterPrimitiveClass),\r
+ NULL, NULL,\r
+ (GClassInitFunc) sp_filter_primitive_class_init,\r
+ NULL, NULL,\r
+ sizeof(SPFilterPrimitive),\r
+ 16,\r
+ (GInstanceInitFunc) sp_filter_primitive_init,\r
+ NULL, /* value_table */\r
+ };\r
+ filter_primitive_type = g_type_register_static(SP_TYPE_OBJECT, "SPFilterPrimitive", &filter_primitive_info, (GTypeFlags)0);\r
+ }\r
+ return filter_primitive_type;\r
+}\r
+\r
+static void\r
+sp_filter_primitive_class_init(SPFilterPrimitiveClass *klass)\r
+{\r
+ //GObjectClass *gobject_class = (GObjectClass *)klass;\r
+ SPObjectClass *sp_object_class = (SPObjectClass *)klass;\r
+\r
+ filter_primitive_parent_class = (SPObjectClass*)g_type_class_peek_parent(klass);\r
+\r
+ sp_object_class->build = sp_filter_primitive_build;\r
+ sp_object_class->release = sp_filter_primitive_release;\r
+ sp_object_class->write = sp_filter_primitive_write;\r
+ sp_object_class->set = sp_filter_primitive_set;\r
+ sp_object_class->update = sp_filter_primitive_update;\r
+}\r
+\r
+static void\r
+sp_filter_primitive_init(SPFilterPrimitive *filter_primitive)\r
+{\r
+}\r
+\r
+/**\r
+ * Reads the Inkscape::XML::Node, and initializes SPFilterPrimitive variables. For this to get called,\r
+ * our name must be associated with a repr via "sp_object_type_register". Best done through\r
+ * sp-object-repr.cpp's repr_name_entries array.\r
+ */\r
+static void\r
+sp_filter_primitive_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)\r
+{\r
+ if (((SPObjectClass *) filter_primitive_parent_class)->build) {\r
+ ((SPObjectClass *) filter_primitive_parent_class)->build(object, document, repr);\r
+ }\r
+\r
+ /*\r
+ Pay attention to certain settings here\r
+\r
+ sp_object_read_attr(object, "xlink:href");\r
+ sp_object_read_attr(object, "attributeName");\r
+ sp_object_read_attr(object, "attributeType");\r
+ sp_object_read_attr(object, "begin");\r
+ sp_object_read_attr(object, "dur");\r
+ sp_object_read_attr(object, "end");\r
+ sp_object_read_attr(object, "min");\r
+ sp_object_read_attr(object, "max");\r
+ sp_object_read_attr(object, "restart");\r
+ sp_object_read_attr(object, "repeatCount");\r
+ sp_object_read_attr(object, "repeatDur");\r
+ sp_object_read_attr(object, "fill");\r
+ */\r
+}\r
+\r
+/**\r
+ * Drops any allocated memory.\r
+ */\r
+static void\r
+sp_filter_primitive_release(SPObject *object)\r
+{\r
+\r
+ /* deal with our children and our selves here */\r
+\r
+ if (((SPObjectClass *) filter_primitive_parent_class)->release)\r
+ ((SPObjectClass *) filter_primitive_parent_class)->release(object);\r
+}\r
+\r
+/**\r
+ * Sets a specific value in the SPFilterPrimitive.\r
+ */\r
+static void\r
+sp_filter_primitive_set(SPObject *object, unsigned int key, gchar const *value)\r
+{\r
+ SPFilterPrimitive *filter_primitive = SP_FILTER_PRIMITIVE(object);\r
+\r
+ /* See if any parents need this value. */\r
+ if (((SPObjectClass *) filter_primitive_parent_class)->set) {\r
+ ((SPObjectClass *) filter_primitive_parent_class)->set(object, key, value);\r
+ }\r
+}\r
+\r
+/**\r
+ * Receives update notifications.\r
+ */\r
+static void\r
+sp_filter_primitive_update(SPObject *object, SPCtx *ctx, guint flags)\r
+{\r
+ //SPFilterPrimitive *filter_primitive = SP_FILTER_PRIMITIVE(object);\r
+\r
+ if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |\r
+ SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {\r
+\r
+ /* do something to trigger redisplay, updates? */\r
+\r
+ }\r
+\r
+ if (((SPObjectClass *) filter_primitive_parent_class)->update) {\r
+ ((SPObjectClass *) filter_primitive_parent_class)->update(object, ctx, flags);\r
+ }\r
+}\r
+\r
+/**\r
+ * Writes its settings to an incoming repr object, if any.\r
+ */\r
+static Inkscape::XML::Node *\r
+sp_filter_primitive_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)\r
+{\r
+ //SPFilterPrimitive *filterPrimitive = SP_FILTER_PRIMITIVE(object);\r
+\r
+ // Inkscape-only object, not copied during an "plain SVG" dump:\r
+ if (flags & SP_OBJECT_WRITE_EXT) {\r
+ if (repr) {\r
+ // is this sane?\r
+ repr->mergeFrom(SP_OBJECT_REPR(object), "id");\r
+ } else {\r
+ repr = SP_OBJECT_REPR(object)->duplicate();\r
+ }\r
+ }\r
+\r
+ if (((SPObjectClass *) filter_primitive_parent_class)->write) {\r
+ ((SPObjectClass *) filter_primitive_parent_class)->write(object, repr, flags);\r
+ }\r
+\r
+ return repr;\r
+}\r
+\r
+\r
+/*\r
+ Local Variables:\r
+ mode:c++\r
+ c-file-style:"stroustrup"\r
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))\r
+ indent-tabs-mode:nil\r
+ fill-column:99\r
+ End:\r
+*/\r
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :\r
diff --git a/src/sp-filter-primitive.h b/src/sp-filter-primitive.h
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef __SP_FILTER_PRIMITIVE_H__\r
+#define __SP_FILTER_PRIMITIVE_H__\r
+\r
+\r
+#include "sp-object.h"\r
+\r
+\r
+#define SP_TYPE_FILTER_PRIMITIVE (sp_filter_primitive_get_type ())\r
+#define SP_FILTER_PRIMITIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_FILTER_PRIMITIVE, SPFilterPrimitive))\r
+#define SP_FILTER_PRIMITIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_FILTER_PRIMITIVE, SPFilterPrimitiveClass))\r
+#define SP_IS_FILTER_PRIMITIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_FILTER_PRIMITIVE))\r
+#define SP_IS_FILTER_PRIMITIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_FILTER_PRIMITIVE))\r
+\r
+class SPFilterPrimitive;\r
+class SPFilterPrimitiveClass;\r
+\r
+struct SPFilterPrimitive : public SPObject {\r
+};\r
+\r
+struct SPFilterPrimitiveClass {\r
+ SPObjectClass sp_object_class;\r
+};\r
+\r
+GType sp_filter_primitive_get_type (void);\r
+\r
+#endif\r
diff --git a/src/sp-filter.cpp b/src/sp-filter.cpp
index d7229bda16c60c62a4ec92a90e18c070a25ec5f4..a210c615ae6dd7b311a60ab53dd767d44b209680 100644 (file)
--- a/src/sp-filter.cpp
+++ b/src/sp-filter.cpp
#include "macros.h"
-/*
- * For debugging purposes only
- */
-void printfilter(SPFilter *filter)
-{
- if(filter->filterUnits==SP_FILTER_UNITS_USERSPACEONUSE)
- g_print("filterUnits=SP_FILTER_UNITS_USERSPACEONUSE\n");
- else if(filter->filterUnits==SP_FILTER_UNITS_OBJECTBOUNDINGBOX)
- g_print("filterUnits=SP_FILTER_UNITS_OBJECTBOUNDINGBOX\n");
- else
- g_print("filterUnits=UNKNOWN!!!\n");
-
- if(filter->primitiveUnits==SP_FILTER_UNITS_USERSPACEONUSE)
- g_print("primitiveUnits=SP_FILTER_UNITS_USERSPACEONUSE\n");
- else if(filter->primitiveUnits==SP_FILTER_UNITS_OBJECTBOUNDINGBOX)
- g_print("primitiveUnits=SP_FILTER_UNITS_OBJECTBOUNDINGBOX\n");
- else
- g_print("primitiveUnits=UNKNOWN!!!\n");
-
-//TODO: print X, Y, W and H units
- g_print("x=%lf\n", filter->x.computed);
- g_print("y=%lf\n", filter->y.computed);
- g_print("width=%lf\n", filter->width.computed);
- g_print("height=%lf\n", filter->height.computed);
- g_print("filterRes=(%lf %lf)\n", filter->filterRes.getNumber(), filter->filterRes.getOptNumber());
-
-}
-
-
-
/* Filter base class */
static void sp_filter_class_init(SPFilterClass *klass);
static void sp_filter_release(SPObject *object);
static void sp_filter_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_filter_update(SPObject *object, SPCtx *ctx, guint flags);
+static void sp_filter_child_added(SPObject *object,\r
+ Inkscape::XML::Node *child,\r
+ Inkscape::XML::Node *ref);\r
+static void sp_filter_remove_child(SPObject *object, Inkscape::XML::Node *child);
static Inkscape::XML::Node *sp_filter_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
static void filter_ref_changed(SPObject *old_ref, SPObject *ref, SPFilter *filter);
sp_object_class->write = sp_filter_write;
sp_object_class->set = sp_filter_set;
sp_object_class->update = sp_filter_update;
+ sp_object_class->child_added = sp_filter_child_added;\r
+ sp_object_class->remove_child = sp_filter_remove_child;
}
static void
filter->primitiveUnits = SP_FILTER_UNITS_OBJECTBOUNDINGBOX;
filter->filterUnits_set = FALSE;
filter->primitiveUnits_set = FALSE;
+ filter->_primitive_count=0;
+
+ filter->_primitive_table_size = 1;
+ filter->_primitives = new SPFilterPrimitive*[1];
+ filter->_primitives[0] = NULL;
}
}
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
break;
- case SP_ATTR_X:
+ case SP_ATTR_X:
filter->x.readOrUnset(value);
- object->requestModified(SP_OBJECT_MODIFIED_FLAG);
+ object->requestModified(SP_OBJECT_MODIFIED_FLAG);
break;
- case SP_ATTR_Y:
- filter->y.readOrUnset(value);
- object->requestModified(SP_OBJECT_MODIFIED_FLAG);
+ case SP_ATTR_Y:
+ filter->y.readOrUnset(value);
+ object->requestModified(SP_OBJECT_MODIFIED_FLAG);
break;
- case SP_ATTR_WIDTH:
- filter->width.readOrUnset(value);
- object->requestModified(SP_OBJECT_MODIFIED_FLAG);
+ case SP_ATTR_WIDTH:
+ filter->width.readOrUnset(value);
+ object->requestModified(SP_OBJECT_MODIFIED_FLAG);
break;
- case SP_ATTR_HEIGHT:
- filter->height.readOrUnset(value);
- object->requestModified(SP_OBJECT_MODIFIED_FLAG);
+ case SP_ATTR_HEIGHT:
+ filter->height.readOrUnset(value);
+ object->requestModified(SP_OBJECT_MODIFIED_FLAG);
break;
- case SP_ATTR_FILTERRES:
- filter->filterRes.set(value);
+ case SP_ATTR_FILTERRES:
+ filter->filterRes.set(value);
break;
case SP_ATTR_XLINK_HREF:
if (value) {
repr->setAttribute("height", NULL);
}
- if (filter->filterRes._set) {
- char filterRes[32];
+ if (filter->filterRes.getNumber()>=0) {
+ char filterRes[32];
repr->setAttribute("filterRes", filter->filterRes.getValueString(filterRes));
} else {
repr->setAttribute("filterRes", NULL);
}
+void _enlarge_primitive_table(SPFilter * filter) {
+ SPFilterPrimitive **new_tbl = new SPFilterPrimitive*[filter->_primitive_table_size * 2];
+ for (int i = 0 ; i < filter->_primitive_count ; i++) {
+ new_tbl[i] = filter->_primitives[i];
+ }
+ filter->_primitive_table_size *= 2;
+ for (int i = filter->_primitive_count ; i < filter->_primitive_table_size ; i++) {
+ new_tbl[i] = NULL;
+ }
+ delete[] filter->_primitives;
+ filter->_primitives = new_tbl;
+}
+
+SPFilterPrimitive *add_primitive(SPFilter *filter, SPFilterPrimitive *primitive)
+{
+ if (filter->_primitive_count >= filter->_primitive_table_size) {
+ _enlarge_primitive_table(filter);
+ }
+ filter->_primitives[filter->_primitive_count] = primitive;
+ filter->_primitive_count++;
+ return primitive;
+}
+
+/**\r
+ * Callback for child_added event.\r
+ */\r
+static void\r
+sp_filter_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref)\r
+{/*\r
+ SPFilter *f = SP_FILTER(object);\r
+\r
+ if (((SPObjectClass *) filter_parent_class)->child_added)\r
+ (* ((SPObjectClass *) filter_parent_class)->child_added)(object, child, ref);\r
+\r
+ object->requestModified(SP_OBJECT_MODIFIED_FLAG);\r
+ */\r
+}\r
+\r
+/**\r
+ * Callback for remove_child event.\r
+ */\r
+static void\r
+sp_filter_remove_child(SPObject *object, Inkscape::XML::Node *child)\r
+{/*\r
+ SPFilter *f = SP_FILTER(object);\r
+\r
+ if (((SPObjectClass *) filter_parent_class)->remove_child)\r
+ (* ((SPObjectClass *) filter_parent_class)->remove_child)(object, child);\r
+\r
+ SPObject *ochild;\r
+\r
+ \r
+ object->requestModified(SP_OBJECT_MODIFIED_FLAG);\r
+ */\r
+}
+
+
/*
Local Variables:
mode:c++
diff --git a/src/sp-filter.h b/src/sp-filter.h
index 74cb1bfa8352f568d66259f5bc63c62e0b889bb1..68f7f0a1c4a7ed777befbd8e27b57e967df5ea1c 100644 (file)
--- a/src/sp-filter.h
+++ b/src/sp-filter.h
#include "number-opt-number.h"
#include "sp-object.h"
#include "sp-filter-units.h"
+#include "sp-filter-fns.h"
#include "svg/svg-length.h"
/* Filter base class */
NumberOptNumber filterRes;
/** HREF attribute */
SPFilterReference *href;
+
+ int _primitive_count;
+ int _primitive_table_size;
+ SPFilterPrimitive ** _primitives;
};
struct SPFilterClass {
SPObjectClass parent_class;
};
-#include "sp-filter-fns.h"
#endif /* !SP_FILTER_H_SEEN */
index 2dadd9e6e3bca3f0ece7bf6c7845dbabdf97cf77..030739263689c4b189edc0d368c3170f37cdfbf3 100644 (file)
#define SP_IS_GAUSSIANBLUR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), SP_TYPE_GAUSSIANBLUR))
GType sp_gaussianBlur_get_type();
+void sp_gaussianBlur_setDeviation(SPGaussianBlur *blur, float num);
+void sp_gaussianBlur_setDeviation(SPGaussianBlur *blur, float num, float optnum);
#endif /* !SP_GAUSSIANBLUR_FNS_H */
index 0e26fbbf4ef13a623a854752c255636f8ec453db..68f22c8d44fa740c2dc6805f452b8daf74238f0f 100644 (file)
--- a/src/sp-gaussian-blur.cpp
+++ b/src/sp-gaussian-blur.cpp
//#define SP_MACROS_SILENT
//#include "macros.h"
-#define DEBUG_GAUSSIANBLUR
-#ifdef DEBUG_GAUSSIANBLUR
-# define debug(f, a...) { g_print("%s(%d) %s:", \
- __FILE__,__LINE__,__FUNCTION__); \
- g_print(f, ## a); \
- g_print("\n"); \
- }
-#else
-# define debug(f, a...) /**/
-#endif
-
/* GaussianBlur base class */
static void sp_gaussianBlur_class_init(SPGaussianBlurClass *klass);
static void sp_gaussianBlur_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_gaussianBlur_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
-static SPObjectClass *gaussianBlur_parent_class;
+static SPFilterPrimitiveClass *gaussianBlur_parent_class;
GType
sp_gaussianBlur_get_type()
(GInstanceInitFunc) sp_gaussianBlur_init,
NULL, /* value_table */
};
- gaussianBlur_type = g_type_register_static(SP_TYPE_OBJECT, "SPGaussianBlur", &gaussianBlur_info, (GTypeFlags)0);
+ gaussianBlur_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPGaussianBlur", &gaussianBlur_info, (GTypeFlags)0);
}
return gaussianBlur_type;
}
{
SPObjectClass *sp_object_class = (SPObjectClass *)klass;
- gaussianBlur_parent_class = (SPObjectClass*)g_type_class_peek_parent(klass);
+ gaussianBlur_parent_class = (SPFilterPrimitiveClass *)g_type_class_peek_parent(klass);
sp_object_class->build = sp_gaussianBlur_build;
sp_object_class->release = sp_gaussianBlur_release;
static void
sp_gaussianBlur_init(SPGaussianBlur *gaussianBlur)
{
- debug("0x%p",gaussianBlur);
-
-// gaussianBlur->stdDeviation = 1;
}
/**
static void
sp_gaussianBlur_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- debug("0x%p",object);
if (((SPObjectClass *) gaussianBlur_parent_class)->build) {
((SPObjectClass *) gaussianBlur_parent_class)->build(object, document, repr);
}
@@ -115,7 +100,6 @@ sp_gaussianBlur_build(SPObject *object, SPDocument *document, Inkscape::XML::Nod
static void
sp_gaussianBlur_release(SPObject *object)
{
- debug("0x%p",object);
if (((SPObjectClass *) gaussianBlur_parent_class)->release)
((SPObjectClass *) gaussianBlur_parent_class)->release(object);
static void
sp_gaussianBlur_set(SPObject *object, unsigned int key, gchar const *value)
{
- debug("0x%p %s(%u): '%s'",object,
- sp_attribute_name(key),key,value);
SPGaussianBlur *gaussianBlur = SP_GAUSSIANBLUR(object);
switch(key) {
- case SP_ATTR_STDDEVIATION:
- gaussianBlur->stdDeviation.set(value);
+ case SP_ATTR_STDDEVIATION:
+ gaussianBlur->stdDeviation.set(value);
break;
default:
if (((SPObjectClass *) gaussianBlur_parent_class)->set)
static void
sp_gaussianBlur_update(SPObject *object, SPCtx *ctx, guint flags)
{
- debug("0x%p",object);
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
static Inkscape::XML::Node *
sp_gaussianBlur_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
- debug("0x%p",object);
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
@@ -189,6 +169,17 @@ sp_gaussianBlur_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
}
+void sp_gaussianBlur_setDeviation(SPGaussianBlur *blur, float num)
+{
+ blur->stdDeviation.setNumber(num);
+}
+void sp_gaussianBlur_setDeviation(SPGaussianBlur *blur, float num, float optnum)
+{
+ blur->stdDeviation.setNumber(num);
+ blur->stdDeviation.setOptNumber(optnum);
+}
+
+
/*
Local Variables:
mode:c++
diff --git a/src/sp-gaussian-blur.h b/src/sp-gaussian-blur.h
index e9ef50c8cd03698738850eca42162bd843fabcb6..c86ee328889cf2094281c8d8a94c611876680ee6 100644 (file)
--- a/src/sp-gaussian-blur.h
+++ b/src/sp-gaussian-blur.h
/* GaussianBlur base class */
class SPGaussianBlurClass;
-struct SPGaussianBlur : public SPFilter {
+struct SPGaussianBlur : public SPFilterPrimitive {
/** stdDeviation attribute */
NumberOptNumber stdDeviation;
};
struct SPGaussianBlurClass {
- SPFilterClass parent_class;
+ SPFilterPrimitiveClass parent_class;
};
GType sp_gaussianBlur_get_type();
diff --git a/src/sp-object-repr.cpp b/src/sp-object-repr.cpp
index 2ab53163a53f141bcbf219fe411942666929ec51..6180ea244ffe5ade21b71b4ccf48fa014d25c8b0 100644 (file)
--- a/src/sp-object-repr.cpp
+++ b/src/sp-object-repr.cpp
{ "svg:flowRoot", SP_TYPE_FLOWTEXT },
{ "svg:flowSpan", SP_TYPE_FLOWTSPAN },
{ "svg:g", SP_TYPE_GROUP },
- { "feBlend", SP_TYPE_FEBLEND },
- { "feColorMatrix", SP_TYPE_FECOLORMATRIX },
- { "feComponentTransfer", SP_TYPE_FECOMPONENTTRANSFER },
- { "feComposite", SP_TYPE_FECOMPOSITE },
- { "feConvolveMatrix", SP_TYPE_FECONVOLVEMATRIX },
- { "feDiffuseLighting", SP_TYPE_FEDIFFUSELIGHTING },
- { "feDisplacementMap", SP_TYPE_FEDISPLACEMENTMAP },
- { "feFlood", SP_TYPE_FEFLOOD },
- { "feGaussianBlur", SP_TYPE_GAUSSIANBLUR },
- { "feImage", SP_TYPE_FEIMAGE },
- { "feMerge", SP_TYPE_FEMERGE },
- { "feMorphology", SP_TYPE_FEMORPHOLOGY },
- { "feOffset", SP_TYPE_FEOFFSET },
- { "feSpecularLighting", SP_TYPE_FESPECULARLIGHTING },
- { "feTile", SP_TYPE_FETILE },
- { "feTurbulence", SP_TYPE_FETURBULENCE },
+ { "svg:feBlend", SP_TYPE_FEBLEND },
+ { "svg:feColorMatrix", SP_TYPE_FECOLORMATRIX },
+ { "svg:feComponentTransfer", SP_TYPE_FECOMPONENTTRANSFER },
+ { "svg:feComposite", SP_TYPE_FECOMPOSITE },
+ { "svg:feConvolveMatrix", SP_TYPE_FECONVOLVEMATRIX },
+ { "svg:feDiffuseLighting", SP_TYPE_FEDIFFUSELIGHTING },
+ { "svg:feDisplacementMap", SP_TYPE_FEDISPLACEMENTMAP },
+ { "svg:feFlood", SP_TYPE_FEFLOOD },
+ { "svg:feGaussianBlur", SP_TYPE_GAUSSIANBLUR },
+ { "svg:feImage", SP_TYPE_FEIMAGE },
+ { "svg:feMerge", SP_TYPE_FEMERGE },
+ { "svg:feMorphology", SP_TYPE_FEMORPHOLOGY },
+ { "svg:feOffset", SP_TYPE_FEOFFSET },
+ { "svg:feSpecularLighting", SP_TYPE_FESPECULARLIGHTING },
+ { "svg:feTile", SP_TYPE_FETILE },
+ { "svg:feTurbulence", SP_TYPE_FETURBULENCE },
{ "svg:image", SP_TYPE_IMAGE },
{ "svg:line", SP_TYPE_LINE },
{ "svg:linearGradient", SP_TYPE_LINEARGRADIENT },