1 // SPDX-License-Identifier: GPL-2.0-or-later
2 #ifndef SEEN_NODE_TOOLBAR_H
3 #define SEEN_NODE_TOOLBAR_H
4 
5 /**
6  * @file
7  * Node 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 #include "2geom/coord.h"
33 
34 class SPDesktop;
35 
36 namespace Inkscape {
37 class Selection;
38 
39 namespace UI {
40 class SimplePrefPusher;
41 
42 namespace Tools {
43 class ToolBase;
44 }
45 
46 namespace Widget {
47 class SpinButtonToolItem;
48 class UnitTracker;
49 }
50 
51 namespace Toolbar {
52 class NodeToolbar : public Toolbar {
53 private:
54     std::unique_ptr<UI::Widget::UnitTracker> _tracker;
55 
56     std::unique_ptr<UI::SimplePrefPusher> _pusher_show_transform_handles;
57     std::unique_ptr<UI::SimplePrefPusher> _pusher_show_handles;
58     std::unique_ptr<UI::SimplePrefPusher> _pusher_show_outline;
59     std::unique_ptr<UI::SimplePrefPusher> _pusher_edit_clipping_paths;
60     std::unique_ptr<UI::SimplePrefPusher> _pusher_edit_masks;
61 
62     Gtk::ToggleToolButton *_object_edit_clip_path_item;
63     Gtk::ToggleToolButton *_object_edit_mask_path_item;
64     Gtk::ToggleToolButton *_show_transform_handles_item;
65     Gtk::ToggleToolButton *_show_handles_item;
66     Gtk::ToggleToolButton *_show_helper_path_item;
67 
68     Gtk::ToolButton *_nodes_lpeedit_item;
69 
70     UI::Widget::SpinButtonToolItem *_nodes_x_item;
71     UI::Widget::SpinButtonToolItem *_nodes_y_item;
72 
73     Glib::RefPtr<Gtk::Adjustment> _nodes_x_adj;
74     Glib::RefPtr<Gtk::Adjustment> _nodes_y_adj;
75 
76     bool _freeze;
77 
78     sigc::connection c_selection_changed;
79     sigc::connection c_selection_modified;
80     sigc::connection c_subselection_changed;
81 
82     void value_changed(Geom::Dim2 d);
83     void sel_changed(Inkscape::Selection *selection);
84     void sel_modified(Inkscape::Selection *selection, guint /*flags*/);
85     void coord_changed(gpointer shape_editor);
86     void watch_ec(SPDesktop* desktop, Inkscape::UI::Tools::ToolBase* ec);
87     void edit_add();
88     void edit_add_min_x();
89     void edit_add_max_x();
90     void edit_add_min_y();
91     void edit_add_max_y();
92     void edit_delete();
93     void edit_join();
94     void edit_break();
95     void edit_join_segment();
96     void edit_delete_segment();
97     void edit_cusp();
98     void edit_smooth();
99     void edit_symmetrical();
100     void edit_auto();
101     void edit_toline();
102     void edit_tocurve();
103     void on_pref_toggled(Gtk::ToggleToolButton *item,
104                          const Glib::ustring&   path);
105 
106 protected:
107     NodeToolbar(SPDesktop *desktop);
108 
109 public:
110     static GtkWidget * create(SPDesktop *desktop);
111 };
112 }
113 }
114 }
115 #endif /* !SEEN_SELECT_TOOLBAR_H */
116