diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2009-11-29 15:33:18 +0000 |
|---|---|---|
| committer | Krzysztof Kosiński <tweenk.pl@gmail.com> | 2009-11-29 15:33:18 +0000 |
| commit | 31bb8269c26a781036448ed8f8cd93cc84fb2118 (patch) | |
| tree | c714ce9b38e9b75680b61e7e0992aa2ab40e2584 /src/ui/tool/selectable-control-point.h | |
| parent | Deprecation warning fix on xcf export (diff) | |
| download | inkscape-31bb8269c26a781036448ed8f8cd93cc84fb2118.tar.gz inkscape-31bb8269c26a781036448ed8f8cd93cc84fb2118.zip | |
First GSoC node tool commit to Bazaar
(bzr r8846.1.1)
Diffstat (limited to 'src/ui/tool/selectable-control-point.h')
| -rw-r--r-- | src/ui/tool/selectable-control-point.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/ui/tool/selectable-control-point.h b/src/ui/tool/selectable-control-point.h new file mode 100644 index 000000000..a432b68db --- /dev/null +++ b/src/ui/tool/selectable-control-point.h @@ -0,0 +1,71 @@ +/** @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); +private: + void _connectHandlers(); + void _takeSelection(); + + bool _clickedHandler(GdkEventButton *); + void _grabbedHandler(GdkEventMotion *); + + ControlPointSelection &_selection; +}; + +} // 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:encoding=utf-8:textwidth=99 : |
