Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
rect-toolbar.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef INKSCAPE_UI_TOOLBAR_RECT_TOOLBAR_H
3#define INKSCAPE_UI_TOOLBAR_RECT_TOOLBAR_H
4
8/* Authors:
9 * MenTaLguY <mental@rydia.net>
10 * Lauris Kaplinski <lauris@kaplinski.com>
11 * bulia byak <buliabyak@users.sf.net>
12 * Frank Felfe <innerspace@iname.com>
13 * John Cliff <simarilius@yahoo.com>
14 * David Turner <novalis@gnu.org>
15 * Josh Andler <scislac@scislac.com>
16 * Jon A. Cruz <jon@joncruz.org>
17 * Maximilian Albert <maximilian.albert@gmail.com>
18 * Tavmjong Bah <tavmjong@free.fr>
19 * Abhishek Sharma
20 * Kris De Gussem <Kris.DeGussem@gmail.com>
21 * Vaibhav Malik <vaibhavmalik2018@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 <array>
32
33#include "toolbar.h"
35#include "xml/node-observer.h"
36
37namespace Gtk {
38class Builder;
39class Button;
40class Label;
41class Adjustment;
42} // namespace Gtk
43
44class SPRect;
45
46namespace Inkscape {
47class Selection;
48namespace UI {
49namespace Tools { class ToolBase; }
50namespace Widget {
51class Label;
52class SpinButton;
53class UnitTracker;
54} // namespace Widget
55} // namespace UI
56namespace XML { class Node; }
57} // namespace Inkscape
58
59namespace Inkscape::UI::Toolbar {
60
62 : public Toolbar
63 , private XML::NodeObserver
64{
65public:
67 ~RectToolbar() override;
68
69 void setDesktop(SPDesktop *desktop) override;
70 void setActiveUnit(Util::Unit const *unit) override;
71
72private:
73 RectToolbar(Glib::RefPtr<Gtk::Builder> const &builder);
74
75 std::unique_ptr<UI::Widget::UnitTracker> _tracker;
76
77 Gtk::Label &_mode_item;
78 Gtk::Button &_not_rounded;
79
80 struct DerivedSpinButton;
81 DerivedSpinButton &_width_item;
82 DerivedSpinButton &_height_item;
83 DerivedSpinButton &_rx_item;
84 DerivedSpinButton &_ry_item;
85 auto _getDerivedSpinButtons() const { return std::to_array({&_rx_item, &_ry_item, &_width_item, &_height_item}); }
86 void _valueChanged(DerivedSpinButton &btn);
87
88 XML::Node *_repr = nullptr;
89 SPRect *_rect = nullptr;
90 void _attachRepr(XML::Node *repr, SPRect *rect);
91 void _detachRepr();
92
94 bool _single = true;
95
96 sigc::connection _selection_changed_conn;
97 void _selectionChanged(Selection *selection);
98
99 void _sensitivize();
100 void _setDefaults();
101
103 void _queueUpdate();
104 void _cancelUpdate();
105 void _update();
106 unsigned _tick_callback = 0;
107};
108
109} // namespace Inkscape::UI::Toolbar
110
111#endif // INKSCAPE_UI_TOOLBAR_RECT_TOOLBAR_H
The set of selected SPObjects for a given document and layer model.
Definition selection.h:80
std::unique_ptr< UI::Widget::UnitTracker > _tracker
void _valueChanged(DerivedSpinButton &btn)
void setDesktop(SPDesktop *desktop) override
void setActiveUnit(Util::Unit const *unit) override
sigc::connection _selection_changed_conn
void _attachRepr(XML::Node *repr, SPRect *rect)
void _selectionChanged(Selection *selection)
void notifyAttributeChanged(XML::Node &node, GQuark name, Util::ptr_shared old_value, Util::ptr_shared new_value) override
Attribute change callback.
Base class for all tool toolbars.
Definition toolbar.h:72
Interface for XML node observers.
Interface for refcounted XML nodes.
Definition node.h:80
To do: update description of desktop.
Definition desktop.h:149
Inkscape::XML::Node * node
Definition desktop.h:50
Helper class to stream background task notifications as a series of messages.
Interface for XML node observers.
guint32 GQuark
SPDesktop * desktop
TODO: insert short description here.
Glib::ustring name
Definition toolbars.cpp:55
Glib::RefPtr< Gtk::Builder > builder