1 // SPDX-License-Identifier: GPL-2.0-or-later
2 #ifndef SEEN_RECT_TOOLBAR_H
3 #define SEEN_RECT_TOOLBAR_H
4 
5 /**
6  * @file
7  * Rect 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 class SPItem;
37 class SPRect;
38 
39 namespace Gtk {
40 class Toolbutton;
41 }
42 
43 namespace Inkscape {
44 class Selection;
45 
46 namespace XML {
47 class Node;
48 }
49 
50 namespace UI {
51 namespace Tools {
52 class ToolBase;
53 }
54 
55 namespace Widget {
56 class LabelToolItem;
57 class SpinButtonToolItem;
58 class UnitTracker;
59 }
60 
61 namespace Toolbar {
62 class RectToolbar : public Toolbar {
63 private:
64     UI::Widget::UnitTracker *_tracker;
65 
66     XML::Node *_repr;
67     SPItem *_item;
68 
69     UI::Widget::LabelToolItem      *_mode_item;
70     UI::Widget::SpinButtonToolItem *_width_item;
71     UI::Widget::SpinButtonToolItem *_height_item;
72     UI::Widget::SpinButtonToolItem *_rx_item;
73     UI::Widget::SpinButtonToolItem *_ry_item;
74     Gtk::ToolButton *_not_rounded;
75 
76     Glib::RefPtr<Gtk::Adjustment> _width_adj;
77     Glib::RefPtr<Gtk::Adjustment> _height_adj;
78     Glib::RefPtr<Gtk::Adjustment> _rx_adj;
79     Glib::RefPtr<Gtk::Adjustment> _ry_adj;
80 
81     bool _freeze;
82     bool _single;
83 
84     void value_changed(Glib::RefPtr<Gtk::Adjustment>&  adj,
85                        gchar const                    *value_name,
86                        void (SPRect::*setter)(gdouble));
87 
88     void sensitivize();
89     void defaults();
90     void watch_ec(SPDesktop* desktop, Inkscape::UI::Tools::ToolBase* ec);
91     void selection_changed(Inkscape::Selection *selection);
92 
93 protected:
94     RectToolbar(SPDesktop *desktop);
95     ~RectToolbar() override;
96 
97 public:
98     static GtkWidget * create(SPDesktop *desktop);
99 
100     static void event_attr_changed(Inkscape::XML::Node *repr,
101                                    gchar const         *name,
102                                    gchar const         *old_value,
103                                    gchar const         *new_value,
104                                    bool                 is_interactive,
105                                    gpointer             data);
106 
107 };
108 
109 }
110 }
111 }
112 
113 #endif /* !SEEN_RECT_TOOLBAR_H */
114