From a95c2d655dfeed6218497fc6e01e78aeb2d35f55 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 22 Apr 2008 22:25:06 +0000 Subject: 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 (bzr r5490) --- src/extension/implementation/implementation.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/extension/implementation/implementation.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 -- cgit v1.2.3