b532fcab4d761b4e279e54bcd22e7a291146f8ff
1 /** @file
2 * Manipulator base class and manipulator group - implementation
3 */
4 /* Authors:
5 * Krzysztof KosiĆski <tweenk.pl@gmail.com>
6 *
7 * Copyright (C) 2009 Authors
8 * Released under GNU GPL, read the file 'COPYING' for more information
9 */
11 #include "ui/tool/manipulator.h"
12 #include "ui/tool/node.h"
14 namespace Inkscape {
15 namespace UI {
17 /*
18 void Manipulator::_grabEvents()
19 {
20 if (_group) _group->_grabEvents(boost::shared_ptr<Manipulator>(this));
21 }
22 void Manipulator::_ungrabEvents()
23 {
24 if (_group) _group->_ungrabEvents(boost::shared_ptr<Manipulator>(this));
25 }
27 ManipulatorGroup::ManipulatorGroup(SPDesktop *d) :
28 _desktop(d)
29 {
30 }
31 ManipulatorGroup::~ManipulatorGroup()
32 {
33 }
35 void ManipulatorGroup::_grabEvents(boost::shared_ptr<Manipulator> m)
36 {
37 if (!_grab) _grab = m;
38 }
39 void ManipulatorGroup::_ungrabEvents(boost::shared_ptr<Manipulator> m)
40 {
41 if (_grab == m) _grab.reset();
42 }
44 void ManipulatorGroup::add(boost::shared_ptr<Manipulator> m)
45 {
46 m->_group = this;
47 push_back(m);
48 }
49 void ManipulatorGroup::remove(boost::shared_ptr<Manipulator> m)
50 {
51 for (std::list<boost::shared_ptr<Manipulator> >::iterator i = begin(); i != end(); ++i) {
52 if ((*i) == m) {
53 erase(i);
54 break;
55 }
56 }
57 m->_group = 0;
58 }
60 void ManipulatorGroup::clear()
61 {
62 std::list<boost::shared_ptr<Manipulator> >::clear();
63 }
65 bool ManipulatorGroup::event(GdkEvent *event)
66 {
67 if (_grab) {
68 return _grab->event(event);
69 }
71 for (std::list<boost::shared_ptr<Manipulator> >::iterator i = begin(); i != end(); ++i) {
72 if ((*i)->event(event) || _grab) return true;
73 }
74 return false;
75 }*/
77 } // namespace UI
78 } // namespace Inkscape
80 /*
81 Local Variables:
82 mode:c++
83 c-file-style:"stroustrup"
84 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
85 indent-tabs-mode:nil
86 fill-column:99
87 End:
88 */
89 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :