Code

r19083@shi: ted | 2008-04-21 16:09:24 -0700
authorgouldtj <gouldtj@users.sourceforge.net>
Tue, 22 Apr 2008 22:25:06 +0000 (22:25 +0000)
committergouldtj <gouldtj@users.sourceforge.net>
Tue, 22 Apr 2008 22:25:06 +0000 (22:25 +0000)
 A directory for filter effects
 r19084@shi:  ted | 2008-04-21 20:03:59 -0700
 The basis for the filter interface for defining effects.
 r19085@shi:  ted | 2008-04-21 20:59:04 -0700
 Adding Sepia as an example
 r19086@shi:  ted | 2008-04-21 23:25:57 -0700
 Wiring everything in.  Cleaning it up so that it looks nice.
 r19087@shi:  ted | 2008-04-22 00:00:08 -0700
 Completeing more of the guts.  Not done, but the basic infrastructure is now in place.
 r19088@shi:  ted | 2008-04-22 00:19:38 -0700
 All the basic plumbing code.  It seems to work, except the document is wrong from the controlling filter guy.  That should be fixable.
 r19089@shi:  ted | 2008-04-22 00:31:36 -0700
 Whoo! Hoo! for simple stuff it seems to work.
 r19090@shi:  ted | 2008-04-22 10:36:16 -0700
 First pass at adding the filters from Mauve's example
 r19091@shi:  ted | 2008-04-22 10:37:24 -0700
 Fixing misspelling
 r19092@shi:  ted | 2008-04-22 12:32:18 -0700
 Should be appending instead of prepending these nodes.
 r19093@shi:  ted | 2008-04-22 13:37:34 -0700
 Basic filter with parameters working
 r19094@shi:  ted | 2008-04-22 14:27:20 -0700
 Changing it so that by default an effect will have a call to autogui that will work with live effects.  Basically this involved migrating the implementation of prefs_effect up from script.cpp to implementation.cpp
 r19102@shi:  ted | 2008-04-22 14:38:46 -0700
 Better defaults

 r19103@shi:  ted | 2008-04-22 14:42:07 -0700
 Adding filter stuff to be translated

35 files changed:
po/POTFILES.in
src/extension/implementation/implementation.cpp
src/extension/implementation/script.cpp
src/extension/implementation/script.h
src/extension/init.cpp
src/extension/internal/Makefile_insert
src/extension/internal/filter/BUILD_YOUR_OWN [new file with mode: 0644]
src/extension/internal/filter/apparition.h [new file with mode: 0644]
src/extension/internal/filter/bloom.h [new file with mode: 0644]
src/extension/internal/filter/clouds.h [new file with mode: 0644]
src/extension/internal/filter/crystal.h [new file with mode: 0644]
src/extension/internal/filter/cutout.h [new file with mode: 0644]
src/extension/internal/filter/drop-shadow.h [new file with mode: 0644]
src/extension/internal/filter/etched-glass.h [new file with mode: 0644]
src/extension/internal/filter/filter-all.cpp [new file with mode: 0644]
src/extension/internal/filter/filter.cpp [new file with mode: 0644]
src/extension/internal/filter/filter.h [new file with mode: 0644]
src/extension/internal/filter/fire.h [new file with mode: 0644]
src/extension/internal/filter/frost.h [new file with mode: 0644]
src/extension/internal/filter/ink-bleed.h [new file with mode: 0644]
src/extension/internal/filter/jelly-bean.h [new file with mode: 0644]
src/extension/internal/filter/jigsaw-piece.h [new file with mode: 0644]
src/extension/internal/filter/leopard-fur.h [new file with mode: 0644]
src/extension/internal/filter/metal.h [new file with mode: 0644]
src/extension/internal/filter/motion-blur.h [new file with mode: 0644]
src/extension/internal/filter/oil-slick.h [new file with mode: 0644]
src/extension/internal/filter/patterned-glass.h [new file with mode: 0644]
src/extension/internal/filter/ridged-border.h [new file with mode: 0644]
src/extension/internal/filter/ripple.h [new file with mode: 0644]
src/extension/internal/filter/roughen.h [new file with mode: 0644]
src/extension/internal/filter/rubber-stamp.h [new file with mode: 0644]
src/extension/internal/filter/sepia.h [new file with mode: 0644]
src/extension/internal/filter/snow.h [new file with mode: 0644]
src/extension/internal/filter/speckle.h [new file with mode: 0644]
src/extension/internal/filter/zebra.h [new file with mode: 0644]

index 9952e1054eae5a04f7b0bc0f43528f55c41a706e..fac6a11dc6dbc6bf0444e58e21275ff9ef577614 100644 (file)
@@ -88,6 +88,34 @@ src/extension/internal/cairo-ps-out.cpp
 src/extension/internal/clear-n_.h
 src/extension/internal/emf-win32-inout.cpp
 src/extension/internal/eps-out.cpp
+src/extension/internal/filter/apparition.h
+src/extension/internal/filter/bloom.h
+src/extension/internal/filter/clouds.h
+src/extension/internal/filter/crystal.h
+src/extension/internal/filter/cutout.h
+src/extension/internal/filter/drop-shadow.h
+src/extension/internal/filter/etched-glass.h
+src/extension/internal/filter/filter-all.cpp
+src/extension/internal/filter/filter.cpp
+src/extension/internal/filter/filter.h
+src/extension/internal/filter/fire.h
+src/extension/internal/filter/frost.h
+src/extension/internal/filter/ink-bleed.h
+src/extension/internal/filter/jelly-bean.h
+src/extension/internal/filter/jigsaw-piece.h
+src/extension/internal/filter/leopard-fur.h
+src/extension/internal/filter/metal.h
+src/extension/internal/filter/motion-blur.h
+src/extension/internal/filter/oil-slick.h
+src/extension/internal/filter/patterned-glass.h
+src/extension/internal/filter/ridged-border.h
+src/extension/internal/filter/ripple.h
+src/extension/internal/filter/roughen.h
+src/extension/internal/filter/rubber-stamp.h
+src/extension/internal/filter/sepia.h
+src/extension/internal/filter/snow.h
+src/extension/internal/filter/speckle.h
+src/extension/internal/filter/zebra.h
 src/extension/internal/gdkpixbuf-input.cpp
 src/extension/internal/gimpgrad.cpp
 src/extension/internal/grid.cpp
index 5fdb47835a4dca9861be89b8a76e4264a06ba4b5..6614604ff706e8428244deb6e4317009ed7af9d9 100644 (file)
 #include <extension/input.h>
 #include <extension/effect.h>
 
+#include "selection.h"
+#include "desktop.h"
+#include "desktop-handles.h"
+#include "ui/view/view.h"
+#include "util/glib-list-iterators.h"
+
 namespace Inkscape {
 namespace Extension {
 namespace Implementation {
@@ -91,8 +97,21 @@ Implementation::save(Inkscape::Extension::Output */*module*/, SPDocument */*doc*
 } /* Implementation::save */
 
 Gtk::Widget *
-Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View */*view*/, sigc::signal<void> * /*changeSignal*/, ImplementationDocumentCache * /*docCache*/) {
-    return module->autogui(NULL, NULL);
+Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view, sigc::signal<void> * changeSignal, ImplementationDocumentCache * docCache) {
+    if (module->param_visible_count() == 0) return NULL;
+
+    SPDocument * current_document = view->doc();
+
+    using Inkscape::Util::GSListConstIterator;
+    GSListConstIterator<SPItem *> selected =
+           sp_desktop_selection((SPDesktop *)view)->itemList();
+    Inkscape::XML::Node * first_select = NULL;
+    if (selected != NULL) {
+        const SPItem * item = *selected;
+        first_select = SP_OBJECT_REPR(item);
+    }
+
+    return module->autogui(current_document, first_select, changeSignal);
 } /* Implementation::prefs_effect */
 
 void
index 67e35149685bd71aabb6e13dc658b92abaaf4063..4eeb3f27f92d1f195ae7694b59df778ee3d1211a 100644 (file)
@@ -540,38 +540,6 @@ Script::prefs_output(Inkscape::Extension::Output *module)
     return module->autogui(NULL, NULL);
 }
 
-
-
-/**
-    \return   A dialog for preferences
-    \brief    A stub funtion right now
-    \param    module    Module who's preferences need getting
-
-    This function should really do something, right now it doesn't.
-*/
-Gtk::Widget *
-Script::prefs_effect( Inkscape::Extension::Effect *module,
-                      Inkscape::UI::View::View *view,
-                      sigc::signal<void> * changeSignal,
-                      ImplementationDocumentCache * /*docCache*/ )
-{
-    SPDocument * current_document = view->doc();
-
-    using Inkscape::Util::GSListConstIterator;
-    GSListConstIterator<SPItem *> selected =
-           sp_desktop_selection((SPDesktop *)view)->itemList();
-    Inkscape::XML::Node * first_select = NULL;
-    if (selected != NULL) {
-        const SPItem * item = *selected;
-        first_select = SP_OBJECT_REPR(item);
-    }
-
-    return module->autogui(current_document, first_select, changeSignal);
-}
-
-
-
-
 /**
     \return  A new document that has been opened
     \brief   This function uses a filename that is put in, and calls
index c2a717a04ae7181a01658362ad9828ab1925d8fc..226a6beb2d69d44380a1c1b9eb88bc9a9d7eae8f 100644 (file)
@@ -87,13 +87,6 @@ public:
     virtual void save(Inkscape::Extension::Output *module,
                       SPDocument *doc,
                       gchar const *filename);
-    /**
-     *
-     */
-    virtual Gtk::Widget *prefs_effect(Inkscape::Extension::Effect *module,
-                                      Inkscape::UI::View::View * view,
-                                      sigc::signal<void> * changeSignal,
-                                                                         ImplementationDocumentCache * docCache);
 
     /**
      *
index 97179f3d80d5d810c861141254e88c3dd82568e9..a1d88d7ec2e6de6e725cda674fefcb84e438da50 100644 (file)
@@ -98,6 +98,8 @@
 #include "internal/bitmap/wave.h"
 #endif /* WITH_IMAGE_MAGICK */
 
+#include "internal/filter/filter.h"
+
 extern gboolean inkscape_app_use_gui( Inkscape::Application const *app );
 
 namespace Inkscape {
@@ -230,6 +232,8 @@ init()
     Internal::Bitmap::Wave::init();
 #endif /* WITH_IMAGE_MAGICK */
 
+       Internal::Filter::Filter::filters_all();
+
     /* Load search path for extensions */
     if (Inkscape::Extension::Extension::search_path.size() == 0)
     {
index 8fcbfc31c35cb54d9bc24d1797b34af4efb83637..bca2b0a6d9dc28fadf3709e72447e24f386e7fc1 100644 (file)
@@ -137,5 +137,9 @@ extension_internal_libinternal_a_SOURCES =  \
        extension/internal/latex-pstricks-out.cpp       \
        extension/internal/latex-pstricks-out.h \
        $(extension_internal_libwpg) \
-       $(extension_internal_image_magick_sources)
+       $(extension_internal_image_magick_sources) \
+       \
+       extension/internal/filter/filter-all.cpp \
+       extension/internal/filter/filter.cpp \
+       extension/internal/filter/filter.h
 
diff --git a/src/extension/internal/filter/BUILD_YOUR_OWN b/src/extension/internal/filter/BUILD_YOUR_OWN
new file mode 100644 (file)
index 0000000..ba6ca5a
--- /dev/null
@@ -0,0 +1,2 @@
+This directory contains filter effects.  They're designed to be simle.
+Very, very simple.  Here is how to build your own.
diff --git a/src/extension/internal/filter/apparition.h b/src/extension/internal/filter/apparition.h
new file mode 100644 (file)
index 0000000..b6f00ad
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_APPARITION_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_APPARITION_H__
+/* Change the 'APPARITION' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class Apparition : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("apparition",     /* ID -- should be unique */
+                           N_("Apparition"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("I'm not sure what this word means"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feMorphology result=\"result0\" in=\"SourceGraphic\" radius=\"4\"/>\n"
+                        "<feGaussianBlur stdDeviation=\"9.2439050131926113\" in=\"result0\"/>\n"
+                        "<feComposite in=\"SourceGraphic\" operator=\"in\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'APPARITION' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_APPARITION_H__ */
diff --git a/src/extension/internal/filter/bloom.h b/src/extension/internal/filter/bloom.h
new file mode 100644 (file)
index 0000000..f161edf
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_BLOOM_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_BLOOM_H__
+/* Change the 'BLOOM' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class Bloom : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("bloom",     /* ID -- should be unique */
+                           N_("Bloom"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Not sure, nobody tell me these things"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feGaussianBlur stdDeviation=\"2.1526428571428569\" in=\"SourceAlpha\" result=\"result1\"/>\n"
+                        "<feSpecularLighting surfaceScale=\"5\" specularConstant=\"2\" specularExponent=\"18.063876651982376\" result=\"result0\">\n"
+                          "<feDistantLight elevation=\"24\" azimuth=\"225\"/>\n"
+                        "</feSpecularLighting>\n"
+                        "<feComposite in2=\"SourceAlpha\" operator=\"in\" result=\"result6\"/>\n"
+                        "<feMorphology operator=\"dilate\" radius=\"5.7142857142857144\"/>\n"
+                        "<feGaussianBlur stdDeviation=\"5.7237142857142853\" result=\"result11\"/>\n"
+                        "<feDiffuseLighting in=\"result1\" diffuseConstant=\"2.0099999999999998\" result=\"result3\" surfaceScale=\"5\">\n"
+                          "<feDistantLight azimuth=\"225\" elevation=\"25\"/>\n"
+                        "</feDiffuseLighting>\n"
+                        "<feBlend blend=\"normal\" in2=\"SourceGraphic\" in=\"result3\" mode=\"multiply\" result=\"result7\"/>\n"
+                        "<feComposite in2=\"SourceAlpha\" operator=\"in\" in=\"result7\"/>\n"
+                        "<feBlend blend=\"normal\" in=\"result6\" mode=\"lighten\" result=\"result9\"/>\n"
+                        "<feComposite in=\"result11\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'BLOOM' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_BLOOM_H__ */
diff --git a/src/extension/internal/filter/clouds.h b/src/extension/internal/filter/clouds.h
new file mode 100644 (file)
index 0000000..a057dd6
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_CLOUDS_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_CLOUDS_H__
+/* Change the 'CLOUDS' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class Clouds : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("clouds",     /* ID -- should be unique */
+                           N_("Clouds"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Yes, more descriptions"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feTurbulence type=\"fractalNoise\" baseFrequency=\"0.040293040293040296 0.10695970695970697\" numOctaves=\"3\"/>\n"
+                        "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 5 -2.7\" result=\"result0\"/>\n"
+                        "<feFlood flood-color=\"rgb(255,255,255)\" flood-opacity=\"1\"/>\n"
+                        "<feComposite in2=\"result0\" operator=\"in\"/>\n"
+                        "<feComposite in2=\"SourceGraphic\" operator=\"atop\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'CLOUDS' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_CLOUDS_H__ */
diff --git a/src/extension/internal/filter/crystal.h b/src/extension/internal/filter/crystal.h
new file mode 100644 (file)
index 0000000..05922a2
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_CRYSTAL_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_CRYSTAL_H__
+/* Change the 'CRYSTAL' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class Crystal : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("crystal",     /* ID -- should be unique */
+                           N_("Crystal"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Artist, insert data here"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feBlend mode=\"multiply\" in2=\"BackgroundImage\" blend=\"normal\" in=\"SourceGraphic\" result=\"result0\"/>\n"
+                        "<feGaussianBlur stdDeviation=\"3.7133333333333329\" in=\"SourceAlpha\" result=\"result1\"/>\n"
+                        "<feSpecularLighting specularExponent=\"128\" specularConstant=\"1.7636684303350969\" surfaceScale=\"3\">\n"
+                          "<feDistantLight azimuth=\"225\" elevation=\"45\"/>\n"
+                        "</feSpecularLighting>\n"
+                        "<feComposite in2=\"SourceAlpha\" operator=\"in\" result=\"result3\"/>\n"
+                        "<feSpecularLighting in=\"result1\" specularExponent=\"128\" specularConstant=\"3.5273368606701938\" surfaceScale=\"-5\">\n"
+                          "<feDistantLight azimuth=\"225\" elevation=\"32\"/>\n"
+                        "</feSpecularLighting>\n"
+                        "<feComposite in2=\"SourceAlpha\" operator=\"in\" result=\"result2\"/>\n"
+                        "<feMerge>\n"
+                          "<feMergeNode inkscape:collect=\"always\" in=\"result0\"/>\n"
+                          "<feMergeNode inkscape:collect=\"always\" in=\"result3\"/>\n"
+                          "<feMergeNode inkscape:collect=\"always\" in=\"result2\"/>\n"
+                        "</feMerge>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'CRYSTAL' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_CRYSTAL_H__ */
diff --git a/src/extension/internal/filter/cutout.h b/src/extension/internal/filter/cutout.h
new file mode 100644 (file)
index 0000000..7a48eca
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_CUTOUT_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_CUTOUT_H__
+/* Change the 'CUTOUT' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class Cutout : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("cutout",     /* ID -- should be unique */
+                           N_("Coutout"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Artist text"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feGaussianBlur stdDeviation=\"4.2312137203166218\" in=\"SourceAlpha\"/>\n"
+                        "<feOffset dx=\"5\" dy=\"5\" />\n"
+                        "<feComposite in=\"SourceGraphic\" operator=\"out\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'CUTOUT' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_CUTOUT_H__ */
diff --git a/src/extension/internal/filter/drop-shadow.h b/src/extension/internal/filter/drop-shadow.h
new file mode 100644 (file)
index 0000000..b19adff
--- /dev/null
@@ -0,0 +1,81 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_DROP_SHADOW_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_DROP_SHADOW_H__
+/* Change the 'DROP_SHADOW' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+#include "extension/internal/clear-n_.h"
+#include "extension/system.h"
+#include "extension/extension.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class DropShadow : public Inkscape::Extension::Internal::Filter::Filter {
+       int myvar;
+protected:
+       virtual gchar const * get_filter_text (Inkscape::Extension::Extension * ext);
+
+public:
+       DropShadow ( ) : Filter() { };
+       //virtual ~DropShadow ( ) { if (_filter != NULL) g_free(_filter); return; }
+
+       static void init (void) {
+               Inkscape::Extension::build_from_mem(
+                       "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
+                               "<name>" N_("Drop Shadow") "</name>\n"
+                               "<id>org.inkscape.effect.filter.drop-shadow</id>\n"
+                               "<param name=\"blur\" gui-text=\"" N_("Amount of Blur") "\" type=\"float\" min=\"0.0\" max=\"50.0\">2.0</param>\n"
+                               "<param name=\"xoffset\" gui-text=\"" N_("Horizontal Offset") "\" type=\"float\" min=\"-50.0\" max=\"50.0\">4.0</param>\n"
+                               "<param name=\"yoffset\" gui-text=\"" N_("Vertical Offset") "\" type=\"float\" min=\"-50.0\" max=\"50.0\">4.0</param>\n"
+                               "<effect>\n"
+                                       "<object-type>all</object-type>\n"
+                                       "<effects-menu>\n"
+                                               "<submenu name=\"" N_("Filter") "\" />\n"
+                                       "</effects-menu>\n"
+                                       "<menu-tip>" N_("I hate text") "</menu-tip>\n"
+                               "</effect>\n"
+                       "</inkscape-extension>\n", new DropShadow());
+       };
+
+};
+
+gchar const *
+DropShadow::get_filter_text (Inkscape::Extension::Extension * ext)
+{
+       if (_filter != NULL) g_free((void *)_filter);
+
+       float blur = ext->get_param_float("blur");
+       float x = ext->get_param_float("xoffset");
+       float y = ext->get_param_float("yoffset");
+
+       _filter = g_strdup_printf(
+               "<filter>\n"
+                       "<feGaussianBlur in=\"SourceAlpha\" stdDeviation=\"%f\" result=\"blur\"/>\n"
+                       "<feOffset in=\"blur\" dx=\"%f\" dy=\"%f\" result=\"offsetBlur\"/>\n"
+                       "<feMerge>\n"
+                               "<feMergeNode in=\"offsetBlur\"/>\n"
+                               "<feMergeNode in=\"SourceGraphic\"/>\n"
+                       "</feMerge>\n"
+               "</filter>\n", blur, x, y);
+
+       return _filter;
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'DROP_SHADOW' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_DROP_SHADOW_H__ */
diff --git a/src/extension/internal/filter/etched-glass.h b/src/extension/internal/filter/etched-glass.h
new file mode 100644 (file)
index 0000000..a288042
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_ETCHED_GLASS_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_ETCHED_GLASS_H__
+/* Change the 'ETCHED_GLASS' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class EtchedGlass : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("etched-glass",     /* ID -- should be unique */
+                           N_("Etched Glass"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Artist text"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feGaussianBlur stdDeviation=\"6.3056666666666654\" in=\"BackgroundImage\"/>\n"
+                        "<feComposite in2=\"SourceAlpha\" operator=\"in\"/>\n"
+                        "<feBlend blend=\"normal\" in2=\"SourceGraphic\" mode=\"multiply\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'ETCHED_GLASS' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_ETCHED_GLASS_H__ */
diff --git a/src/extension/internal/filter/filter-all.cpp b/src/extension/internal/filter/filter-all.cpp
new file mode 100644 (file)
index 0000000..917730e
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
+#include "filter.h"
+
+/* Put your filter here */
+#include "apparition.h"
+#include "bloom.h"
+#include "clouds.h"
+#include "crystal.h"
+#include "cutout.h"
+#include "drop-shadow.h"
+#include "etched-glass.h"
+#include "fire.h"
+#include "frost.h"
+#include "ink-bleed.h"
+#include "jelly-bean.h"
+#include "jigsaw-piece.h"
+#include "leopard-fur.h"
+#include "metal.h"
+#include "motion-blur.h"
+#include "oil-slick.h"
+#include "patterned-glass.h"
+#include "ridged-border.h"
+#include "ripple.h"
+#include "roughen.h"
+#include "rubber-stamp.h"
+#include "sepia.h"
+#include "snow.h"
+#include "speckle.h"
+#include "zebra.h"
+
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+
+void
+Filter::filters_all (void )
+{
+       Apparition::init();
+       Bloom::init();
+       Clouds::init();
+       Crystal::init();
+       Cutout::init();
+       DropShadow::init();
+       EtchedGlass::init();
+       Fire::init();
+       Frost::init();
+       InkBleed::init();
+       JellyBean::init();
+       JigsawPiece::init();
+       LeopardFur::init();
+       Metal::init();
+       MotionBlur::init();
+       OilSlick::init();
+       PatternedGlass::init();
+       RidgedBorder::init();
+       Ripple::init();
+       Roughen::init();
+       RubberStamp::init();
+       Sepia::init();
+       Snow::init();
+       Speckle::init();
+       Zebra::init();
+
+       return;
+}
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
diff --git a/src/extension/internal/filter/filter.cpp b/src/extension/internal/filter/filter.cpp
new file mode 100644 (file)
index 0000000..e87290a
--- /dev/null
@@ -0,0 +1,164 @@
+/*
+ * Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Copyright (C) 2008 Authors
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
+#include "desktop.h"
+#include "selection.h"
+#include "document-private.h"
+#include "sp-item.h"
+#include "util/glib-list-iterators.h"
+#include "extension/extension.h"
+#include "extension/effect.h"
+#include "extension/system.h"
+#include "xml/repr.h"
+#include "xml/simple-node.h"
+#include "xml/attribute-record.h"
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+Filter::Filter() :
+               Inkscape::Extension::Implementation::Implementation(),
+               _filter(NULL) {
+       return;
+}
+
+Filter::Filter(gchar const * filter) :
+               Inkscape::Extension::Implementation::Implementation(),
+               _filter(filter) {
+       return;
+}
+
+Filter::~Filter (void) {
+       if (_filter != NULL) {
+               _filter = NULL;
+       }
+
+       return;
+}
+
+bool
+Filter::load (Inkscape::Extension::Extension *module)
+{
+       return true;
+}
+
+Inkscape::Extension::Implementation::ImplementationDocumentCache *
+Filter::newDocCache (Inkscape::Extension::Extension * ext, Inkscape::UI::View::View * doc)
+{
+       return NULL;
+}
+
+gchar const *
+Filter::get_filter_text (Inkscape::Extension::Extension * ext)
+{
+       return _filter;
+}
+
+Inkscape::XML::Document *
+Filter::get_filter (Inkscape::Extension::Extension * ext) {
+       gchar const * filter = get_filter_text(ext);
+       return sp_repr_read_mem(filter, strlen(filter), NULL);
+}
+
+void 
+Filter::merge_filters (Inkscape::XML::Node * to, Inkscape::XML::Node * from, Inkscape::XML::Document * doc)
+{
+       if (from == NULL) return;
+
+       // copy attributes
+    for ( Inkscape::Util::List<Inkscape::XML::AttributeRecord const> iter = from->attributeList() ;
+          iter ; ++iter ) {
+               gchar const * attr = g_quark_to_string(iter->key);
+               //printf("Attribute List: %s\n", attr);
+               if (!strcmp(attr, "id")) continue; // nope, don't copy that one!
+               to->setAttribute(attr, from->attribute(attr));
+       }
+
+       // for each child call recursively
+       for (Inkscape::XML::Node * from_child = from->firstChild();
+                 from_child != NULL ; from_child = from_child->next()) {
+               Glib::ustring name = "svg:";
+               name += from_child->name();
+               
+               Inkscape::XML::Node * to_child = doc->createElement(name.c_str());
+               to->appendChild(to_child);
+               merge_filters(to_child, from_child, doc);
+       }
+
+       return;
+}
+
+void
+Filter::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *document, Inkscape::Extension::Implementation::ImplementationDocumentCache * docCache)
+{
+       //printf("Calling filter effect\n");
+    Inkscape::Selection * selection = ((SPDesktop *)document)->selection;
+
+    using Inkscape::Util::GSListConstIterator;
+    // TODO need to properly refcount the items, at least
+    std::list<SPItem *> items;
+    items.insert<GSListConstIterator<SPItem *> >(items.end(), selection->itemList(), NULL);
+
+       Inkscape::XML::Document * xmldoc = sp_document_repr_doc(document->doc());
+       Inkscape::XML::Node * defsrepr = SP_OBJECT_REPR(SP_DOCUMENT_DEFS(document->doc()));
+
+    for(std::list<SPItem *>::iterator item = items.begin();
+            item != items.end(); item++) {
+        SPItem * spitem = *item;
+               Inkscape::XML::Node * node = SP_OBJECT_REPR(spitem);
+
+               SPCSSAttr * css = sp_repr_css_attr(node, "style");
+               gchar const * filter = sp_repr_css_property(css, "filter", NULL);
+
+               if (filter == NULL) {
+                       Inkscape::XML::Node * newfilterroot = xmldoc->createElement("svg:filter");
+                       defsrepr->appendChild(newfilterroot);
+                       Glib::ustring url = "url(#"; url += newfilterroot->attribute("id"); url += ")";
+
+                       merge_filters(newfilterroot, get_filter(module)->root(), xmldoc);
+
+                       sp_repr_css_set_property(css, "filter", url.c_str());
+                       sp_repr_css_set(node, css, "style");
+               }
+    }
+
+    return;
+}
+
+#include "extension/internal/clear-n_.h"
+
+void
+Filter::filter_init (gchar const * id, gchar const * name, gchar const * tip, gchar const * filter)
+{
+       gchar * xml_str = g_strdup_printf(
+        "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
+            "<name>%s</name>\n"
+            "<id>org.inkscape.effect.filter.%s</id>\n"
+            "<effect>\n"
+                "<object-type>all</object-type>\n"
+                "<effects-menu>\n"
+                    "<submenu name=\"" N_("Filter") "\" />\n"
+                "</effects-menu>\n"
+                "<menu-tip>%s</menu-tip>\n"
+            "</effect>\n"
+        "</inkscape-extension>\n", name, id, tip);
+    Inkscape::Extension::build_from_mem(xml_str, new Filter::Filter(filter));
+       g_free(xml_str);
+    return;
+}
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
diff --git a/src/extension/internal/filter/filter.h b/src/extension/internal/filter/filter.h
new file mode 100644 (file)
index 0000000..851beb8
--- /dev/null
@@ -0,0 +1,48 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_FILTER_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_FILTER_H__
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
+#include <glibmm/i18n.h>
+
+#include "extension/implementation/implementation.h"
+#include "extension/extension-forward.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class Filter : public Inkscape::Extension::Implementation::Implementation {
+protected:
+       gchar const * _filter;
+       virtual gchar const * get_filter_text (Inkscape::Extension::Extension * ext);
+
+private:
+       Inkscape::XML::Document * get_filter (Inkscape::Extension::Extension * ext);
+       void merge_filters (Inkscape::XML::Node * to, Inkscape::XML::Node * from, Inkscape::XML::Document * doc);
+
+public:
+       Filter();
+       Filter(gchar const * filter);
+       virtual ~Filter();
+
+       bool load(Inkscape::Extension::Extension *module);
+       Inkscape::Extension::Implementation::ImplementationDocumentCache * newDocCache (Inkscape::Extension::Extension * ext, Inkscape::UI::View::View * doc);
+       void effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *document, Inkscape::Extension::Implementation::ImplementationDocumentCache * docCache);
+
+       static void filter_init(gchar const * id, gchar const * name, gchar const * tip, gchar const * filter);
+       static void filters_all(void);
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_FILTER_H__ */
diff --git a/src/extension/internal/filter/fire.h b/src/extension/internal/filter/fire.h
new file mode 100644 (file)
index 0000000..7816f19
--- /dev/null
@@ -0,0 +1,54 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_FIRE_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_FIRE_H__
+/* Change the 'FIRE' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class Fire : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("fire",     /* ID -- should be unique */
+                           N_("Fire"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Artist on fire"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter x=\"-0.080000000000000029\" height=\"1.3900000000000001\" width=\"1.21\" y=\"-0.22000000000000008\">\n"
+                        "<feMorphology operator=\"dilate\" radius=\"2.4128686327077746\" result=\"result1\"/>\n"
+                        "<feTurbulence numOctaves=\"1\" baseFrequency=\"0.0900804289544236 0.027882037533512066\"/>\n"
+                        "<feColorMatrix values=\"2 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 1 0\" result=\"result2\" type=\"matrix\"/>\n"
+                        "<feDisplacementMap in=\"result1\" xChannelSelector=\"R\" yChannelSelector=\"G\" scale=\"10.319410319410318\" result=\"result4\"/>\n"
+                        "<feFlood flood-color=\"rgb(255,159,54)\" flood-opacity=\"1\" result=\"result3\"/>\n"
+                        "<feMorphology in=\"result4\" result=\"result7\" radius=\"3.755868544600939\"/>\n"
+                        "<feGaussianBlur stdDeviation=\"2.3571830985915487\" in=\"result7\" result=\"result7\"/>\n"
+                        "<feComposite operator=\"in\" in=\"result3\" in2=\"result4\" result=\"result5\"/>\n"
+                        "<feComposite in2=\"result7\" operator=\"out\"/>\n"
+                        "<feOffset dx=\"-4.5\" dy=\"-7\" result=\"result6\"/>\n"
+                        "<feGaussianBlur stdDeviation=\"4.8352546916890073\" result=\"result7\"/>\n"
+                        "<feComposite in2=\"result6\" in=\"SourceGraphic\"/>\n"
+                        "<feComposite in2=\"result7\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'FIRE' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_FIRE_H__ */
diff --git a/src/extension/internal/filter/frost.h b/src/extension/internal/filter/frost.h
new file mode 100644 (file)
index 0000000..9c5dcb2
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_FROST_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_FROST_H__
+/* Change the 'FROST' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class Frost : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("frost",     /* ID -- should be unique */
+                           N_("Frost"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Artist text"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feTurbulence baseFrequency=\"0.14299516908212559\" numOctaves=\"5\" type=\"fractalNoise\" />\n"
+                        "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 5 -3\"/>\n"
+                        "<feComposite in2=\"SourceAlpha\" operator=\"in\"/>\n"
+                        "<feMorphology result=\"result3\" radius=\"2.6570048309178742\" operator=\"dilate\" />\n"
+                        "<feTurbulence baseFrequency=\"0.12077294685990339\" numOctaves=\"2\" />\n"
+                        "<feDisplacementMap result=\"result4\" scale=\"10.044642857142858\" yChannelSelector=\"A\" xChannelSelector=\"R\" in=\"result3\" />\n"
+                        "<feFlood flood-color=\"rgb(255,255,255)\" flood-opacity=\"1\"/>\n"
+                        "<feComposite in2=\"result4\" operator=\"in\" result=\"result2\"/>\n"
+                        "<feComposite in2=\"SourceGraphic\" operator=\"over\" in=\"result2\" />\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'FROST' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_FROST_H__ */
diff --git a/src/extension/internal/filter/ink-bleed.h b/src/extension/internal/filter/ink-bleed.h
new file mode 100644 (file)
index 0000000..6168b38
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_INK_BLEED_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_INK_BLEED_H__
+/* Change the 'INK_BLEED' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class InkBleed : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("ink-bleed",     /* ID -- should be unique */
+                           N_("InkBleed"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Artist Text"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feGaussianBlur stdDeviation=\"1.3291292875989447\" in=\"SourceGraphic\" result=\"result1\"/>\n"
+                        "<feTurbulence baseFrequency=\"0.033773087071240104\" numOctaves=\"4\" result=\"result0\"/>\n"
+                        "<feDisplacementMap in2=\"result0\" in=\"result1\" xChannelSelector=\"R\" yChannelSelector=\"G\" scale=\"19.612590799031477\" result=\"result2\"/>\n"
+                        "<feColorMatrix result=\"result3\" values=\"2 0 0 0 0 0 2 0 0 0 0 0 2 0 0 0 0 0 0.7 0\"/>\n"
+                        "<feGaussianBlur stdDeviation=\"1.0653034300791555\" in=\"SourceGraphic\" result=\"result4\"/>\n"
+                        "<feComposite in2=\"result3\" in=\"result4\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'INK_BLEED' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_INK_BLEED_H__ */
diff --git a/src/extension/internal/filter/jelly-bean.h b/src/extension/internal/filter/jelly-bean.h
new file mode 100644 (file)
index 0000000..d063ac9
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_JELLY_BEAN_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_JELLY_BEAN_H__
+/* Change the 'JELLY_BEAN' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class JellyBean : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("jelly-bean",     /* ID -- should be unique */
+                           N_("Jelly Bean"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Mmmm, yummy."),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feColorMatrix in=\"SourceGraphic\" result=\"result0\" values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.85 0\"/>\n"
+                        "<feGaussianBlur stdDeviation=\"7.0222857142857134\" in=\"SourceAlpha\"/>\n"
+                        "<feSpecularLighting specularExponent=\"7.971360381861575\" specularConstant=\"0.80000000000000004\" surfaceScale=\"10\">\n"
+                          "<feDistantLight azimuth=\"225\" elevation=\"17\"/>\n"
+                        "</feSpecularLighting>\n"
+                        "<feComposite in2=\"result0\" operator=\"atop\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'JELLY_BEAN' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_JELLY_BEAN_H__ */
diff --git a/src/extension/internal/filter/jigsaw-piece.h b/src/extension/internal/filter/jigsaw-piece.h
new file mode 100644 (file)
index 0000000..654c1e0
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_JIGSAW_PIECE_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_JIGSAW_PIECE_H__
+/* Change the 'JIGSAW_PIECE' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class JigsawPiece : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("jigsaw-piece",     /* ID -- should be unique */
+                           N_("JigsawPiece"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("It's a puzzle, no hints"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feSpecularLighting specularExponent=\"18.527845036319611\" specularConstant=\"2\" surfaceScale=\"1\" in=\"SourceAlpha\">\n"
+                          "<feDistantLight azimuth=\"225\" elevation=\"30\"/>\n"
+                        "</feSpecularLighting>\n"
+                        "<feComposite in2=\"SourceGraphic\" operator=\"atop\" result=\"result0\"/>\n"
+                        "<feMorphology operator=\"dilate\" in=\"SourceAlpha\" result=\"result1\" radius=\"2\"/>\n"
+                        "<feComposite in2=\"result1\" in=\"result0\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'JIGSAW_PIECE' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_JIGSAW_PIECE_H__ */
diff --git a/src/extension/internal/filter/leopard-fur.h b/src/extension/internal/filter/leopard-fur.h
new file mode 100644 (file)
index 0000000..7e160c0
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_LEOPARD_FUR_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_LEOPARD_FUR_H__
+/* Change the 'LEOPARD_FUR' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class LeopardFur : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("leopard-fur",     /* ID -- should be unique */
+                           N_("Leopard Fur"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Purrrr, quiet the kitty is sleeping"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feTurbulence baseFrequency=\"0.14299516908212559\" numOctaves=\"5\" type=\"fractalNoise\"/>\n"
+                        "<feColorMatrix values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 -3.45\"/>\n"
+                        "<feComposite result=\"result3\" in2=\"SourceAlpha\" operator=\"in\"/>\n"
+                        "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 6 0\"/>\n"
+                        "<feMorphology result=\"result3\" radius=\"1.8181818181818181\" operator=\"dilate\"/>\n"
+                        "<feGaussianBlur result=\"result3\" stdDeviation=\"1\"/>\n"
+                        "<feGaussianBlur stdDeviation=\"2.7287613293051356\"/>\n"
+                        "<feComposite in2=\"result3\" result=\"result1\" operator=\"out\"/>\n"
+                        "<feColorMatrix result=\"result3\" values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0\"/>\n"
+                        "<feFlood result=\"result2\" flood-opacity=\"1\" flood-color=\"rgb(209,151,45)\" />\n"
+                        "<feComposite operator=\"in\" in=\"result2\" in2=\"SourceGraphic\" />\n"
+                        "<feComposite in=\"result3\" result=\"result3\" operator=\"atop\" />\n"
+                        "<feGaussianBlur stdDeviation=\"7.1521428571428558\" in=\"SourceAlpha\"/>\n"
+                        "<feDiffuseLighting diffuseConstant=\"1.9197207678883073\" surfaceScale=\"10.600706713780937\">\n"
+                          "<feDistantLight azimuth=\"225\" elevation=\"48\"/>\n"
+                        "</feDiffuseLighting>\n"
+                        "<feBlend blend=\"normal\" in2=\"result3\" mode=\"multiply\" result=\"result3\"/>\n"
+                        "<feComposite in2=\"SourceAlpha\" operator=\"in\" result=\"result3\"/>\n"
+                        "<feTurbulence baseFrequency=\"0.10577777777777778\" numOctaves=\"3\" />\n"
+                        "<feDisplacementMap scale=\"4.5454545454545459\" yChannelSelector=\"G\" xChannelSelector=\"R\" in=\"result3\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'LEOPARD_FUR' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_LEOPARD_FUR_H__ */
diff --git a/src/extension/internal/filter/metal.h b/src/extension/internal/filter/metal.h
new file mode 100644 (file)
index 0000000..b0d41a1
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_METAL_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_METAL_H__
+/* Change the 'METAL' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class Metal : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("metal",     /* ID -- should be unique */
+                           N_("Metal"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Iron Man vector objects"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feColorMatrix result=\"result1\" in=\"SourceGraphic\" type=\"saturate\" values=\"0.369458\"/>\n"
+                        "<feGaussianBlur in=\"SourceAlpha\" stdDeviation=\"7.0222857142857134\"/>\n"
+                        "<feSpecularLighting surfaceScale=\"10\" specularConstant=\"3.8834951456310676\" specularExponent=\"7.971360381861575\">\n"
+                          "<feDistantLight elevation=\"17\" azimuth=\"225\" />\n"
+                        "</feSpecularLighting>\n"
+                        "<feComposite operator=\"atop\" in2=\"result1\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'METAL' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_METAL_H__ */
diff --git a/src/extension/internal/filter/motion-blur.h b/src/extension/internal/filter/motion-blur.h
new file mode 100644 (file)
index 0000000..85a5df4
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_MOTION_BLUR_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_MOTION_BLUR_H__
+/* Change the 'MOTION_BLUR' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class MotionBlur : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("motion-blur",     /* ID -- should be unique */
+                           N_("Motion Blur"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Hmm, fast vectors"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feGaussianBlur stdDeviation=\"5 0.01\" in=\"SourceGraphic\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'MOTION_BLUR' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_MOTION_BLUR_H__ */
diff --git a/src/extension/internal/filter/oil-slick.h b/src/extension/internal/filter/oil-slick.h
new file mode 100644 (file)
index 0000000..cc24aca
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_OIL_SLICK_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_OIL_SLICK_H__
+/* Change the 'OIL_SLICK' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class OilSlick : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("oil-slick",     /* ID -- should be unique */
+                           N_("OilSlick"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Ooops!  Slippery!"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feTurbulence type=\"fractalNoise\" numOctaves=\"5\" baseFrequency=\"0.14299516908212559\"/>\n"
+                        "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 5 -3\"/>\n"
+                        "<feMorphology operator=\"dilate\" radius=\"2.6570048309178742\" result=\"result3\"/>\n"
+                        "<feTurbulence numOctaves=\"2\" baseFrequency=\"0.12077294685990339\"/>\n"
+                        "<feDisplacementMap in=\"result3\" xChannelSelector=\"R\" yChannelSelector=\"A\" scale=\"18.526785714285715\" result=\"result4\"/>\n"
+                        "<feComposite in=\"result4\" operator=\"atop\" in2=\"SourceGraphic\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'OIL_SLICK' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_OIL_SLICK_H__ */
diff --git a/src/extension/internal/filter/patterned-glass.h b/src/extension/internal/filter/patterned-glass.h
new file mode 100644 (file)
index 0000000..0ded94a
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_PATTERNED_GLASS_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_PATTERNED_GLASS_H__
+/* Change the 'PATTERNED_GLASS' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class PatternedGlass : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("patterned-glass",     /* ID -- should be unique */
+                           N_("PatternedGlass"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Doesn't work, bug"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feTurbulence numOctaves=\"1\" baseFrequency=\"0.10861423220973783\"/>\n"
+                        "<feDisplacementMap in=\"BackgroundImage\" xChannelSelector=\"R\" yChannelSelector=\"G\" scale=\"11.795774647887324\"/>\n"
+                        "<feComposite in2=\"SourceAlpha\" operator=\"in\"/>\n"
+                        "<feBlend blend=\"normal\" in=\"SourceGraphic\" mode=\"multiply\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'PATTERNED_GLASS' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_PATTERNED_GLASS_H__ */
diff --git a/src/extension/internal/filter/ridged-border.h b/src/extension/internal/filter/ridged-border.h
new file mode 100644 (file)
index 0000000..855f36b
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_RIDGED_BORDER_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_RIDGED_BORDER_H__
+/* Change the 'RIDGED_BORDER' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class RidgedBorder : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("ridged-border",     /* ID -- should be unique */
+                           N_("Ridged Border"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Artist text"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feMorphology in=\"SourceAlpha\" radius=\"4.2857142857142856\"/>\n"
+                        "<feComposite in=\"SourceGraphic\" operator=\"out\"/>\n"
+                        "<feGaussianBlur stdDeviation=\"1.2003571428571427\" result=\"result0\"/>\n"
+                        "<feDiffuseLighting diffuseConstant=\"1\">\n"
+                          "<feDistantLight azimuth=\"225\" elevation=\"66\"/>\n"
+                        "</feDiffuseLighting>\n"
+                        "<feBlend blend=\"normal\" in2=\"SourceGraphic\" mode=\"multiply\"/>\n"
+                        "<feComposite in2=\"SourceAlpha\" operator=\"in\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'RIDGED_BORDER' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_RIDGED_BORDER_H__ */
diff --git a/src/extension/internal/filter/ripple.h b/src/extension/internal/filter/ripple.h
new file mode 100644 (file)
index 0000000..39bef1e
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_RIPPLE_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_RIPPLE_H__
+/* Change the 'RIPPLE' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class Ripple : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("ripple",     /* ID -- should be unique */
+                           N_("Ripple"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("You're 80% water"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feTurbulence baseFrequency=\"0.001904761904761905 0.10666666666666667\" numOctaves=\"1\"/>\n"
+                        "<feColorMatrix values=\"2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0.5\"/>\n"
+                        "<feDisplacementMap in=\"SourceGraphic\" scale=\"14.317180616740089\" xChannelSelector=\"R\" yChannelSelector=\"A\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'RIPPLE' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_RIPPLE_H__ */
diff --git a/src/extension/internal/filter/roughen.h b/src/extension/internal/filter/roughen.h
new file mode 100644 (file)
index 0000000..421c2e6
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_ROUGHEN_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_ROUGHEN_H__
+/* Change the 'ROUGHEN' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class Roughen : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("roughen",     /* ID -- should be unique */
+                           N_("Roughen"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Like Brad Pitt's stubble"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                       "<feTurbulence baseFrequency=\"0.040000000000000001\" in=\"SourceAlpha\" type=\"turbulence\" seed=\"0\" numOctaves=\"3\"/>\n"
+                       "<feDisplacementMap in=\"SourceGraphic\" xChannelSelector=\"R\" yChannelSelector=\"G\" scale=\"6.6339066339066335\" numOctaves=\"2\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'ROUGHEN' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_ROUGHEN_H__ */
diff --git a/src/extension/internal/filter/rubber-stamp.h b/src/extension/internal/filter/rubber-stamp.h
new file mode 100644 (file)
index 0000000..429beb6
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_RUBBER_STAMP_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_RUBBER_STAMP_H__
+/* Change the 'RUBBER_STAMP' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class RubberStamp : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("rubber-stamp",     /* ID -- should be unique */
+                           N_("RubberStamp"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Use this to forge your passport"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feTurbulence type=\"fractalNoise\" numOctaves=\"4\" baseFrequency=\"0.064033264033264037\" in=\"SourceGraphic\" result=\"result1\"/>\n"
+                        "<feGaussianBlur stdDeviation=\"4.8612668463611852\" in=\"SourceAlpha\"/>\n"
+                        "<feComposite in=\"SourceAlpha\" operator=\"out\"/>\n"
+                        "<feComposite in2=\"result1\"/>\n"
+                        "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -9\" numOctaves=\"3\" result=\"result1\"/>\n"
+                        "<feComposite in=\"SourceGraphic\" operator=\"in\" result=\"result1\"/>\n"
+                        "<feTurbulence numOctaves=\"1\" baseFrequency=\"0.03231597845601436\"/>\n"
+                        "<feDisplacementMap in=\"result1\" xChannelSelector=\"R\" yChannelSelector=\"G\" scale=\"4.0609137055837561\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'RUBBER_STAMP' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_RUBBER_STAMP_H__ */
diff --git a/src/extension/internal/filter/sepia.h b/src/extension/internal/filter/sepia.h
new file mode 100644 (file)
index 0000000..1472bb5
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_SEPIA_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_SEPIA_H__
+/* Change the 'SEPIA' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class Sepia : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("sepia",     /* ID -- should be unique */
+                           N_("Sepia"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Turn all the colors to be sepia tones"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                                           "<feColorMatrix values=\"0.14 0.45 0.05 0 0 0.12 0.39 0.04 0 0 0.08 0.28 0.03 0 0 0 0 0 1 0\" />\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'SEPIA' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_SEPIA_H__ */
diff --git a/src/extension/internal/filter/snow.h b/src/extension/internal/filter/snow.h
new file mode 100644 (file)
index 0000000..0b99cbc
--- /dev/null
@@ -0,0 +1,53 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_SNOW_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_SNOW_H__
+/* Change the 'SNOW' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class Snow : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("snow",     /* ID -- should be unique */
+                           N_("Snow"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("When the weather outside is frightening..."),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feConvolveMatrix order=\"3 3\" kernelMatrix=\"1 1 1 0 0 0 -1 -1 -1\" preserveAlpha=\"false\" divisor=\"3\"/>\n"
+                        "<feMorphology operator=\"dilate\" radius=\"1 3.2345013477088949\"/>\n"
+                        "<feGaussianBlur stdDeviation=\"1.6270889487870621\" result=\"result0\"/>\n"
+                        "<feColorMatrix values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 0\" result=\"result1\"/>\n"
+                        "<feOffset dx=\"0\" dy=\"1\" result=\"result5\"/>\n"
+                        "<feDiffuseLighting in=\"result0\" diffuseConstant=\"2.2613065326633168\" surfaceScale=\"1\">\n"
+                          "<feDistantLight azimuth=\"225\" elevation=\"32\"/>\n"
+                        "</feDiffuseLighting>\n"
+                        "<feComposite in2=\"result1\" operator=\"in\" result=\"result2\"/>\n"
+                        "<feColorMatrix values=\"0.4 0 0 0 0.6 0 0.4 0 0 0.6 0 0 0 0 1 0 0 0 1 0\" result=\"result4\"/>\n"
+                        "<feComposite in2=\"result5\" in=\"result4\"/>\n"
+                        "<feComposite in2=\"SourceGraphic\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'SNOW' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_SNOW_H__ */
diff --git a/src/extension/internal/filter/speckle.h b/src/extension/internal/filter/speckle.h
new file mode 100644 (file)
index 0000000..b0a9733
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_SPECKLE_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_SPECKLE_H__
+/* Change the 'SPECKLE' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class Speckle : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("speckle",     /* ID -- should be unique */
+                           N_("Speckle"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("You look cute with speckles"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                       "<feTurbulence type=\"fractalNoise\" baseFrequency=\"0.20952380952380956\" numOctaves=\"1\" result=\"result1\"/>\n"
+                       "<feColorMatrix type=\"luminanceToAlpha\" in=\"SourceGraphic\" result=\"result0\"/>\n"
+                       "<feColorMatrix result=\"result2\" values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.8 0\"/>\n"
+                       "<feComposite in2=\"result2\" operator=\"over\" in=\"result1\"/>\n"
+                       "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -14\"/>\n"
+                       "<feComposite in=\"SourceGraphic\" operator=\"out\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'SPECKLE' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_SPECKLE_H__ */
diff --git a/src/extension/internal/filter/zebra.h b/src/extension/internal/filter/zebra.h
new file mode 100644 (file)
index 0000000..0292808
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_ZEBRA_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_ZEBRA_H__
+/* Change the 'ZEBRA' above to be your file name */
+
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+/* ^^^ Change the copyright to be you and your e-mail address ^^^ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class Zebra : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("zebra",     /* ID -- should be unique */
+                           N_("Zebra Stripes"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Paint your object with zebra stripes"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feColorMatrix type=\"matrix\" values=\"0.15 0.3 0.05 0 0.5 0.15 0.3 0.05 0 0.5 0.15 0.3 0.05 0 0.5 0 0 0 1 0\" result=\"result0\"/>\n"
+                        "<feTurbulence numOctaves=\"1\" baseFrequency=\"0.078388278388278387 0.012454212454212455\"/>\n"
+                        "<feColorMatrix values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 -0.8\"/>\n"
+                        "<feComposite in2=\"result0\" operator=\"atop\"/>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+/* Change the 'ZEBRA' below to be your file name */
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_ZEBRA_H__ */