diff options
| author | Ted Gould <ted@gould.cx> | 2007-06-27 06:26:13 +0000 |
|---|---|---|
| committer | gouldtj <gouldtj@users.sourceforge.net> | 2007-06-27 06:26:13 +0000 |
| commit | 19d5db7e36ffb0c8c54b419897b7853219987f89 (patch) | |
| tree | 4f3340f83c083a202fe8b174cf6aa73389768075 /src/extension/effect.cpp | |
| parent | (bzr r3127) (diff) | |
| download | inkscape-19d5db7e36ffb0c8c54b419897b7853219987f89.tar.gz inkscape-19d5db7e36ffb0c8c54b419897b7853219987f89.zip | |
r15506@tres: ted | 2007-05-24 22:30:55 -0700
Wow, the basics are kinda working. Only for ints and floats, and it
seems to not like repeadative entry. But, it really is seeming very
feasible.
(bzr r3128)
Diffstat (limited to 'src/extension/effect.cpp')
| -rw-r--r-- | src/extension/effect.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index 80dc776e3..6ae9eae50 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -9,6 +9,10 @@ #include "inkscape-private.h" #include "helper/action.h" +#include "ui/view/view.h" +#include "desktop-handles.h" +#include "selection.h" +#include "sp-namedview.h" #include "document.h" #include "prefdialog.h" #include "implementation/implementation.h" @@ -17,6 +21,8 @@ #include "gtkmm/messagedialog.h" +#include "util/glib-list-iterators.h" + /* Inkscape::Extension::Effect */ namespace Inkscape { @@ -209,6 +215,7 @@ private: bool _canceled; Glib::RefPtr<Glib::MainLoop> _mainloop; Inkscape::UI::View::View * _doc; + std::list<Glib::ustring> _selected; public: void run (void); @@ -222,6 +229,21 @@ public: _canceled(false), _doc(doc) { + SPDesktop *desktop = (SPDesktop *)_doc; + sp_namedview_document_from_window(desktop); + + if (desktop != NULL) { + Inkscape::Util::GSListConstIterator<SPItem *> selected = + sp_desktop_selection(desktop)->itemList(); + while ( selected != NULL ) { + Glib::ustring selected_id; + selected_id = SP_OBJECT_ID(*selected); + _selected.insert(_selected.end(), selected_id); + std::cout << "Selected: " << selected_id << std::endl; + ++selected; + } + } + _mainloop = Glib::MainLoop::create(false); if (controls != NULL) { @@ -241,6 +263,7 @@ public: } void preferencesChange (void) { + std::cout << "Preferences are a changin'" << std::endl; if (_humanWait) { _mainloop->quit(); documentCancel(); @@ -338,6 +361,23 @@ private: Effect::set_last_effect(_effect); return; } + + void reselect (void) { + SPDocument * doc = _doc->doc(); + + SPDesktop *desktop = (SPDesktop *)_doc; + sp_namedview_document_from_window(desktop); + + if (desktop == NULL) { return; } + + Inkscape::Selection * selection = sp_desktop_selection(desktop); + + for (std::list<Glib::ustring>::iterator i = _selected.begin(); i != _selected.end(); i++) { + selection->add(doc->getObjectById(i->c_str())); + } + + return; + } }; void @@ -352,6 +392,7 @@ ExecutionEnv::run (void) { } if (_canceled) { sp_document_cancel(_doc->doc()); + reselect(); } } return; |
