summaryrefslogtreecommitdiffstats
path: root/src/ui/tool/manipulator.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2009-11-29 15:33:18 +0000
committerKrzysztof Kosiński <tweenk.pl@gmail.com>2009-11-29 15:33:18 +0000
commit31bb8269c26a781036448ed8f8cd93cc84fb2118 (patch)
treec714ce9b38e9b75680b61e7e0992aa2ab40e2584 /src/ui/tool/manipulator.cpp
parentDeprecation warning fix on xcf export (diff)
downloadinkscape-31bb8269c26a781036448ed8f8cd93cc84fb2118.tar.gz
inkscape-31bb8269c26a781036448ed8f8cd93cc84fb2118.zip
First GSoC node tool commit to Bazaar
(bzr r8846.1.1)
Diffstat (limited to 'src/ui/tool/manipulator.cpp')
-rw-r--r--src/ui/tool/manipulator.cpp89
1 files changed, 89 insertions, 0 deletions
diff --git a/src/ui/tool/manipulator.cpp b/src/ui/tool/manipulator.cpp
new file mode 100644
index 000000000..b532fcab4
--- /dev/null
+++ b/src/ui/tool/manipulator.cpp
@@ -0,0 +1,89 @@
+/** @file
+ * Manipulator base class and manipulator group - implementation
+ */
+/* Authors:
+ * Krzysztof Kosiński <tweenk.pl@gmail.com>
+ *
+ * Copyright (C) 2009 Authors
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
+#include "ui/tool/manipulator.h"
+#include "ui/tool/node.h"
+
+namespace Inkscape {
+namespace UI {
+
+/*
+void Manipulator::_grabEvents()
+{
+ if (_group) _group->_grabEvents(boost::shared_ptr<Manipulator>(this));
+}
+void Manipulator::_ungrabEvents()
+{
+ if (_group) _group->_ungrabEvents(boost::shared_ptr<Manipulator>(this));
+}
+
+ManipulatorGroup::ManipulatorGroup(SPDesktop *d) :
+ _desktop(d)
+{
+}
+ManipulatorGroup::~ManipulatorGroup()
+{
+}
+
+void ManipulatorGroup::_grabEvents(boost::shared_ptr<Manipulator> m)
+{
+ if (!_grab) _grab = m;
+}
+void ManipulatorGroup::_ungrabEvents(boost::shared_ptr<Manipulator> m)
+{
+ if (_grab == m) _grab.reset();
+}
+
+void ManipulatorGroup::add(boost::shared_ptr<Manipulator> m)
+{
+ m->_group = this;
+ push_back(m);
+}
+void ManipulatorGroup::remove(boost::shared_ptr<Manipulator> m)
+{
+ for (std::list<boost::shared_ptr<Manipulator> >::iterator i = begin(); i != end(); ++i) {
+ if ((*i) == m) {
+ erase(i);
+ break;
+ }
+ }
+ m->_group = 0;
+}
+
+void ManipulatorGroup::clear()
+{
+ std::list<boost::shared_ptr<Manipulator> >::clear();
+}
+
+bool ManipulatorGroup::event(GdkEvent *event)
+{
+ if (_grab) {
+ return _grab->event(event);
+ }
+
+ for (std::list<boost::shared_ptr<Manipulator> >::iterator i = begin(); i != end(); ++i) {
+ if ((*i)->event(event) || _grab) return true;
+ }
+ return false;
+}*/
+
+} // namespace UI
+} // namespace Inkscape
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :