From 66d02cbd41dc86275d0c1c47884eb8f6a227981d Mon Sep 17 00:00:00 2001 From: gouldtj Date: Tue, 22 Apr 2008 22:25:06 +0000 Subject: [PATCH] r19083@shi: ted | 2008-04-21 16:09:24 -0700 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 --- po/POTFILES.in | 28 +++ .../implementation/implementation.cpp | 23 ++- src/extension/implementation/script.cpp | 32 ---- src/extension/implementation/script.h | 7 - src/extension/init.cpp | 4 + src/extension/internal/Makefile_insert | 6 +- src/extension/internal/filter/BUILD_YOUR_OWN | 2 + src/extension/internal/filter/apparition.h | 44 +++++ src/extension/internal/filter/bloom.h | 55 ++++++ src/extension/internal/filter/clouds.h | 46 +++++ src/extension/internal/filter/crystal.h | 56 ++++++ src/extension/internal/filter/cutout.h | 44 +++++ src/extension/internal/filter/drop-shadow.h | 81 +++++++++ src/extension/internal/filter/etched-glass.h | 44 +++++ src/extension/internal/filter/filter-all.cpp | 79 +++++++++ src/extension/internal/filter/filter.cpp | 164 ++++++++++++++++++ src/extension/internal/filter/filter.h | 48 +++++ src/extension/internal/filter/fire.h | 54 ++++++ src/extension/internal/filter/frost.h | 50 ++++++ src/extension/internal/filter/ink-bleed.h | 47 +++++ src/extension/internal/filter/jelly-bean.h | 47 +++++ src/extension/internal/filter/jigsaw-piece.h | 47 +++++ src/extension/internal/filter/leopard-fur.h | 61 +++++++ src/extension/internal/filter/metal.h | 47 +++++ src/extension/internal/filter/motion-blur.h | 42 +++++ src/extension/internal/filter/oil-slick.h | 47 +++++ .../internal/filter/patterned-glass.h | 45 +++++ src/extension/internal/filter/ridged-border.h | 49 ++++++ src/extension/internal/filter/ripple.h | 44 +++++ src/extension/internal/filter/roughen.h | 43 +++++ src/extension/internal/filter/rubber-stamp.h | 49 ++++++ src/extension/internal/filter/sepia.h | 42 +++++ src/extension/internal/filter/snow.h | 53 ++++++ src/extension/internal/filter/speckle.h | 47 +++++ src/extension/internal/filter/zebra.h | 45 +++++ 35 files changed, 1580 insertions(+), 42 deletions(-) create mode 100644 src/extension/internal/filter/BUILD_YOUR_OWN create mode 100644 src/extension/internal/filter/apparition.h create mode 100644 src/extension/internal/filter/bloom.h create mode 100644 src/extension/internal/filter/clouds.h create mode 100644 src/extension/internal/filter/crystal.h create mode 100644 src/extension/internal/filter/cutout.h create mode 100644 src/extension/internal/filter/drop-shadow.h create mode 100644 src/extension/internal/filter/etched-glass.h create mode 100644 src/extension/internal/filter/filter-all.cpp create mode 100644 src/extension/internal/filter/filter.cpp create mode 100644 src/extension/internal/filter/filter.h create mode 100644 src/extension/internal/filter/fire.h create mode 100644 src/extension/internal/filter/frost.h create mode 100644 src/extension/internal/filter/ink-bleed.h create mode 100644 src/extension/internal/filter/jelly-bean.h create mode 100644 src/extension/internal/filter/jigsaw-piece.h create mode 100644 src/extension/internal/filter/leopard-fur.h create mode 100644 src/extension/internal/filter/metal.h create mode 100644 src/extension/internal/filter/motion-blur.h create mode 100644 src/extension/internal/filter/oil-slick.h create mode 100644 src/extension/internal/filter/patterned-glass.h create mode 100644 src/extension/internal/filter/ridged-border.h create mode 100644 src/extension/internal/filter/ripple.h create mode 100644 src/extension/internal/filter/roughen.h create mode 100644 src/extension/internal/filter/rubber-stamp.h create mode 100644 src/extension/internal/filter/sepia.h create mode 100644 src/extension/internal/filter/snow.h create mode 100644 src/extension/internal/filter/speckle.h create mode 100644 src/extension/internal/filter/zebra.h diff --git a/po/POTFILES.in b/po/POTFILES.in index 9952e1054..fac6a11dc 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -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 diff --git a/src/extension/implementation/implementation.cpp b/src/extension/implementation/implementation.cpp index 5fdb47835..6614604ff 100644 --- a/src/extension/implementation/implementation.cpp +++ b/src/extension/implementation/implementation.cpp @@ -19,6 +19,12 @@ #include #include +#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 * /*changeSignal*/, ImplementationDocumentCache * /*docCache*/) { - return module->autogui(NULL, NULL); +Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view, sigc::signal * changeSignal, ImplementationDocumentCache * docCache) { + if (module->param_visible_count() == 0) return NULL; + + SPDocument * current_document = view->doc(); + + using Inkscape::Util::GSListConstIterator; + GSListConstIterator 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 diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 67e351496..4eeb3f27f 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -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 * changeSignal, - ImplementationDocumentCache * /*docCache*/ ) -{ - SPDocument * current_document = view->doc(); - - using Inkscape::Util::GSListConstIterator; - GSListConstIterator 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 diff --git a/src/extension/implementation/script.h b/src/extension/implementation/script.h index c2a717a04..226a6beb2 100644 --- a/src/extension/implementation/script.h +++ b/src/extension/implementation/script.h @@ -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 * changeSignal, - ImplementationDocumentCache * docCache); /** * diff --git a/src/extension/init.cpp b/src/extension/init.cpp index 97179f3d8..a1d88d7ec 100644 --- a/src/extension/init.cpp +++ b/src/extension/init.cpp @@ -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) { diff --git a/src/extension/internal/Makefile_insert b/src/extension/internal/Makefile_insert index 8fcbfc31c..bca2b0a6d 100644 --- a/src/extension/internal/Makefile_insert +++ b/src/extension/internal/Makefile_insert @@ -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 index 000000000..ba6ca5a43 --- /dev/null +++ b/src/extension/internal/filter/BUILD_YOUR_OWN @@ -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 index 000000000..b6f00add5 --- /dev/null +++ b/src/extension/internal/filter/apparition.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..f161edf2f --- /dev/null +++ b/src/extension/internal/filter/bloom.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..a057dd644 --- /dev/null +++ b/src/extension/internal/filter/clouds.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..05922a23a --- /dev/null +++ b/src/extension/internal/filter/crystal.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..7a48eca9a --- /dev/null +++ b/src/extension/internal/filter/cutout.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..b19adffa2 --- /dev/null +++ b/src/extension/internal/filter/drop-shadow.h @@ -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 + * + * 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( + "\n" + "" N_("Drop Shadow") "\n" + "org.inkscape.effect.filter.drop-shadow\n" + "2.0\n" + "4.0\n" + "4.0\n" + "\n" + "all\n" + "\n" + "\n" + "\n" + "" N_("I hate text") "\n" + "\n" + "\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( + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\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 index 000000000..a28804286 --- /dev/null +++ b/src/extension/internal/filter/etched-glass.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..917730e2c --- /dev/null +++ b/src/extension/internal/filter/filter-all.cpp @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2008 Authors: + * Ted Gould + * + * 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 index 000000000..e87290ab4 --- /dev/null +++ b/src/extension/internal/filter/filter.cpp @@ -0,0 +1,164 @@ +/* + * Authors: + * Ted Gould + * + * 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 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 items; + items.insert >(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::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( + "\n" + "%s\n" + "org.inkscape.effect.filter.%s\n" + "\n" + "all\n" + "\n" + "\n" + "\n" + "%s\n" + "\n" + "\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 index 000000000..851beb833 --- /dev/null +++ b/src/extension/internal/filter/filter.h @@ -0,0 +1,48 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_FILTER_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_FILTER_H__ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#include + +#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 index 000000000..7816f19bb --- /dev/null +++ b/src/extension/internal/filter/fire.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..9c5dcb25a --- /dev/null +++ b/src/extension/internal/filter/frost.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..6168b38e7 --- /dev/null +++ b/src/extension/internal/filter/ink-bleed.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..d063ac900 --- /dev/null +++ b/src/extension/internal/filter/jelly-bean.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..654c1e051 --- /dev/null +++ b/src/extension/internal/filter/jigsaw-piece.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..7e160c0a2 --- /dev/null +++ b/src/extension/internal/filter/leopard-fur.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..b0d41a1af --- /dev/null +++ b/src/extension/internal/filter/metal.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..85a5df4b8 --- /dev/null +++ b/src/extension/internal/filter/motion-blur.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..cc24aca07 --- /dev/null +++ b/src/extension/internal/filter/oil-slick.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..0ded94a81 --- /dev/null +++ b/src/extension/internal/filter/patterned-glass.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..855f36b36 --- /dev/null +++ b/src/extension/internal/filter/ridged-border.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..39bef1e0f --- /dev/null +++ b/src/extension/internal/filter/ripple.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..421c2e60c --- /dev/null +++ b/src/extension/internal/filter/roughen.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..429beb618 --- /dev/null +++ b/src/extension/internal/filter/rubber-stamp.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..1472bb543 --- /dev/null +++ b/src/extension/internal/filter/sepia.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..0b99cbc86 --- /dev/null +++ b/src/extension/internal/filter/snow.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..b0a9733e2 --- /dev/null +++ b/src/extension/internal/filter/speckle.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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 index 000000000..0292808e4 --- /dev/null +++ b/src/extension/internal/filter/zebra.h @@ -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 + * + * 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_() */ + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"); + /* The XML of the filter that should be added. There + * should be a 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__ */ -- 2.30.2