summaryrefslogtreecommitdiffstats
path: root/src/ui/tool/manipulator.cpp
blob: a68de5e98ee2c2bfef748c5bc6167b352ede4efd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// SPDX-License-Identifier: GPL-2.0-or-later
/** @file
 * Manipulator base class and manipulator group - implementation
 */
/* Authors:
 *   Krzysztof Kosiński <tweenk.pl@gmail.com>
 *
 * Copyright (C) 2009 Authors
 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
 */

//#include "ui/tool/node.h"
//#include "ui/tool/manipulator.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:fileencoding=utf-8:textwidth=99 :