1 // SPDX-License-Identifier: GPL-2.0-or-later
2 #ifndef SEEN_SPIRAL_TOOLBAR_H
3 #define SEEN_SPIRAL_TOOLBAR_H
4 
5 /**
6  * @file
7  * Spiral aux toolbar
8  */
9 /* Authors:
10  *   MenTaLguY <mental@rydia.net>
11  *   Lauris Kaplinski <lauris@kaplinski.com>
12  *   bulia byak <buliabyak@users.sf.net>
13  *   Frank Felfe <innerspace@iname.com>
14  *   John Cliff <simarilius@yahoo.com>
15  *   David Turner <novalis@gnu.org>
16  *   Josh Andler <scislac@scislac.com>
17  *   Jon A. Cruz <jon@joncruz.org>
18  *   Maximilian Albert <maximilian.albert@gmail.com>
19  *   Tavmjong Bah <tavmjong@free.fr>
20  *   Abhishek Sharma
21  *   Kris De Gussem <Kris.DeGussem@gmail.com>
22  *
23  * Copyright (C) 2004 David Turner
24  * Copyright (C) 2003 MenTaLguY
25  * Copyright (C) 1999-2011 authors
26  * Copyright (C) 2001-2002 Ximian, Inc.
27  *
28  * Released under GNU GPL v2+, read the file 'COPYING' for more information.
29  */
30 
31 #include "toolbar.h"
32 
33 #include <gtkmm/adjustment.h>
34 
35 class SPDesktop;
36 
37 namespace Gtk {
38 class ToolButton;
39 }
40 
41 namespace Inkscape {
42 class Selection;
43 
44 namespace XML {
45 class Node;
46 }
47 
48 namespace UI {
49 namespace Widget {
50 class LabelToolItem;
51 class SpinButtonToolItem;
52 }
53 
54 namespace Toolbar {
55 class SpiralToolbar : public Toolbar {
56 private:
57     UI::Widget::LabelToolItem *_mode_item;
58 
59     UI::Widget::SpinButtonToolItem *_revolution_item;
60     UI::Widget::SpinButtonToolItem *_expansion_item;
61     UI::Widget::SpinButtonToolItem *_t0_item;
62 
63     Gtk::ToolButton *_reset_item;
64 
65     Glib::RefPtr<Gtk::Adjustment> _revolution_adj;
66     Glib::RefPtr<Gtk::Adjustment> _expansion_adj;
67     Glib::RefPtr<Gtk::Adjustment> _t0_adj;
68 
69     bool _freeze;
70 
71     XML::Node *_repr;
72 
73     void value_changed(Glib::RefPtr<Gtk::Adjustment> &adj,
74                        Glib::ustring const           &value_name);
75     void defaults();
76     void selection_changed(Inkscape::Selection *selection);
77 
78     std::unique_ptr<sigc::connection> _connection;
79 
80 protected:
81     SpiralToolbar(SPDesktop *desktop);
82     ~SpiralToolbar() override;
83 
84 public:
85     static GtkWidget * create(SPDesktop *desktop);
86 
87     static void event_attr_changed(Inkscape::XML::Node *repr,
88                                    gchar const         *name,
89                                    gchar const         *old_value,
90                                    gchar const         *new_value,
91                                    bool                 is_interactive,
92                                    gpointer             data);
93 };
94 }
95 }
96 }
97 
98 #endif /* !SEEN_SPIRAL_TOOLBAR_H */
99