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
|
/** @file
* Desktop-bound selectable control object
*/
/* Authors:
* Krzysztof Kosiński <tweenk.pl@gmail.com>
*
* Copyright (C) 2009 Authors
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifndef SEEN_UI_TOOL_SELECTABLE_CONTROL_POINT_H
#define SEEN_UI_TOOL_SELECTABLE_CONTROL_POINT_H
#include <boost/enable_shared_from_this.hpp>
#include "ui/tool/control-point.h"
namespace Inkscape {
namespace UI {
class ControlPointSelection;
class SelectableControlPoint : public ControlPoint {
public:
struct ColorSet {
ControlPoint::ColorSet cpset;
ColorEntry selected_normal;
ColorEntry selected_mouseover;
ColorEntry selected_clicked;
};
~SelectableControlPoint();
bool selected() const;
void updateState() const { const_cast<SelectableControlPoint*>(this)->_setState(_state); }
virtual Geom::Rect bounds() {
return Geom::Rect(position(), position());
}
protected:
SelectableControlPoint(SPDesktop *d, Geom::Point const &initial_pos,
Gtk::AnchorType anchor, SPCtrlShapeType shape,
unsigned int size, ControlPointSelection &sel, ColorSet *cset = 0,
SPCanvasGroup *group = 0);
SelectableControlPoint(SPDesktop *d, Geom::Point const &initial_pos,
Gtk::AnchorType anchor, Glib::RefPtr<Gdk::Pixbuf> pixbuf,
ControlPointSelection &sel, ColorSet *cset = 0, SPCanvasGroup *group = 0);
virtual void _setState(State state);
virtual void dragged(Geom::Point &, GdkEventMotion *);
virtual bool grabbed(GdkEventMotion *);
virtual void ungrabbed(GdkEventButton *);
virtual bool clicked(GdkEventButton *);
ControlPointSelection &_selection;
private:
void _takeSelection();
};
} // namespace UI
} // namespace Inkscape
#endif
/*
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 :
|