1 // SPDX-License-Identifier: GPL-2.0-or-later 2 #ifndef SEEN_STAR_TOOLBAR_H 3 #define SEEN_STAR_TOOLBAR_H 4 5 /** 6 * @file 7 * Star 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 RadioToolButton; 39 class ToolButton; 40 } 41 42 namespace Inkscape { 43 class Selection; 44 45 namespace XML { 46 class Node; 47 } 48 49 namespace UI { 50 namespace Tools { 51 class ToolBase; 52 } 53 54 namespace Widget { 55 class LabelToolItem; 56 class SpinButtonToolItem; 57 } 58 59 namespace Toolbar { 60 class StarToolbar : public Toolbar { 61 private: 62 UI::Widget::LabelToolItem *_mode_item; 63 std::vector<Gtk::RadioToolButton *> _flat_item_buttons; 64 UI::Widget::SpinButtonToolItem *_magnitude_item; 65 UI::Widget::SpinButtonToolItem *_spoke_item; 66 UI::Widget::SpinButtonToolItem *_roundedness_item; 67 UI::Widget::SpinButtonToolItem *_randomization_item; 68 Gtk::ToolButton *_reset_item; 69 70 XML::Node *_repr; 71 72 Glib::RefPtr<Gtk::Adjustment> _magnitude_adj; 73 Glib::RefPtr<Gtk::Adjustment> _spoke_adj; 74 Glib::RefPtr<Gtk::Adjustment> _roundedness_adj; 75 Glib::RefPtr<Gtk::Adjustment> _randomization_adj; 76 77 bool _freeze; 78 sigc::connection _changed; 79 80 void side_mode_changed(int mode); 81 void magnitude_value_changed(); 82 void proportion_value_changed(); 83 void rounded_value_changed(); 84 void randomized_value_changed(); 85 void defaults(); 86 void watch_ec(SPDesktop* desktop, Inkscape::UI::Tools::ToolBase* ec); 87 void selection_changed(Inkscape::Selection *selection); 88 89 protected: 90 StarToolbar(SPDesktop *desktop); 91 ~StarToolbar() override; 92 93 public: 94 static GtkWidget * create(SPDesktop *desktop); 95 96 static void event_attr_changed(Inkscape::XML::Node *repr, 97 gchar const *name, 98 gchar const *old_value, 99 gchar const *new_value, 100 bool is_interactive, 101 gpointer dataPointer); 102 }; 103 104 } 105 } 106 } 107 108 #endif /* !SEEN_SELECT_TOOLBAR_H */ 109