1 /**
2 * \brief widget adjustable by dragging it to rotate away from a zero-change axis
3 *
4 * Authors:
5 * buliabyak@gmail.com
6 *
7 * Copyright (C) 2007 authors
8 *
9 * Released under GNU GPL. Read the file 'COPYING' for more information.
10 */
12 #ifndef INKSCAPE_UI_ROTATEABLE_H
13 #define INKSCAPE_UI_ROTATEABLE_H
15 #include <gtkmm/box.h>
16 #include <gtkmm/eventbox.h>
17 #include <glibmm/i18n.h>
19 namespace Inkscape {
20 namespace UI {
21 namespace Widget {
23 class Rotateable: public Gtk::EventBox
24 {
25 public:
26 Rotateable();
28 ~Rotateable();
30 bool on_click(GdkEventButton *event);
31 bool on_motion(GdkEventMotion *event);
32 bool on_release(GdkEventButton *event);
34 double axis;
35 double current_axis;
36 double maxdecl;
38 private:
39 double drag_started_x;
40 double drag_started_y;
41 guint modifier;
42 bool dragging;
43 bool working;
45 guint get_single_modifier(guint old, guint state);
47 virtual void do_motion (double /*by*/, guint /*state*/) {}
48 virtual void do_release (double /*by*/, guint /*state*/) {}
49 };
51 } // namespace Widget
52 } // namespace UI
53 } // namespace Inkscape
55 #endif // INKSCAPE_UI_ROTATEABLE_H
57 /*
58 Local Variables:
59 mode:c++
60 c-file-style:"stroustrup"
61 c-file-offsets:((innamespace . 0)(inline-open . 0))
62 indent-tabs-mode:nil
63 fill-column:99
64 End:
65 */
66 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :