Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
rotateable.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Authors:
4 * buliabyak@gmail.com
5 *
6 * Copyright (C) 2007 authors
7 *
8 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
9 */
10
11#ifndef INKSCAPE_UI_ROTATEABLE_H
12#define INKSCAPE_UI_ROTATEABLE_H
13
14#include <gtk/gtk.h> // GtkEventController*
15#include <gtkmm/box.h>
16#include <gtkmm/gesture.h> // Gtk::EventSequenceState
17
18namespace Gtk {
19class GestureClick;
20class EventControllerMotion;
21class EventControllerScroll;
22} // namespace Gtk
23
24namespace Inkscape::UI::Widget {
25
29class Rotateable: public Gtk::Box
30{
31public:
32 Rotateable();
33 ~Rotateable() override;
34
35 double axis;
37 double maxdecl;
39
40private:
43 unsigned modifier;
45 bool working;
46
47 static unsigned get_single_modifier(unsigned old, unsigned state);
48
49 Gtk::EventSequenceState on_click (Gtk::GestureClick const &click,
50 int n_press, double x, double y);
51 Gtk::EventSequenceState on_release(Gtk::GestureClick const &click,
52 int n_press, double x, double y);
53 void on_motion(Gtk::EventControllerMotion const &motion, double x, double y);
54 bool on_scroll(Gtk::EventControllerScroll const &scroll, double dx, double dy);
55
56 virtual void do_motion (double /*by*/, unsigned /*state*/) {}
57 virtual void do_release(double /*by*/, unsigned /*state*/) {}
58 virtual void do_scroll (double /*by*/, unsigned /*state*/) {}
59};
60
61} // namespace Inkscape::UI::Widget
62
63#endif // INKSCAPE_UI_ROTATEABLE_H
64
65/*
66 Local Variables:
67 mode:c++
68 c-file-style:"stroustrup"
69 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
70 indent-tabs-mode:nil
71 fill-column:99
72 End:
73*/
74// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
Widget adjustable by dragging it to rotate away from a zero-change axis.
Definition rotateable.h:30
void on_motion(Gtk::EventControllerMotion const &motion, double x, double y)
bool on_scroll(Gtk::EventControllerScroll const &scroll, double dx, double dy)
virtual void do_release(double, unsigned)
Definition rotateable.h:57
virtual void do_motion(double, unsigned)
Definition rotateable.h:56
static unsigned get_single_modifier(unsigned old, unsigned state)
Gtk::EventSequenceState on_click(Gtk::GestureClick const &click, int n_press, double x, double y)
Gtk::EventSequenceState on_release(Gtk::GestureClick const &click, int n_press, double x, double y)
virtual void do_scroll(double, unsigned)
Definition rotateable.h:58
Definition desktop.h:50
Custom widgets.
Definition desktop.h:126