Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::UI::Toolbar::RectToolbar Class Reference

#include <rect-toolbar.h>

Inheritance diagram for Inkscape::UI::Toolbar::RectToolbar:
Inkscape::UI::Toolbar::Toolbar Inkscape::XML::NodeObserver Inkscape::UI::Toolbar::ToolbarWidget Inkscape::UI::DefocusTarget Inkscape::UI::Widget::Bin

Public Member Functions

 RectToolbar ()
 
 ~RectToolbar () override
 
void setDesktop (SPDesktop *desktop) override
 
void setActiveUnit (Util::Unit const *unit) override
 
- Public Member Functions inherited from Inkscape::UI::Toolbar::Toolbar
 ~Toolbar () override
 
SPDesktopgetDesktop () const
 
void onDefocus () override
 
- Public Member Functions inherited from Inkscape::UI::Toolbar::ToolbarWidget
 ~ToolbarWidget () override
 
- Public Member Functions inherited from Inkscape::UI::Widget::Bin
 Bin (Gtk::Widget *child=nullptr)
 
 Bin (BaseObjectType *cobject, Glib::RefPtr< Gtk::Builder > const &)
 
Gtk::Widget * get_child ()
 Gets the child widget, or nullptr if none.
 
Gtk::Widget const * get_child () const
 Gets the child widget, or nullptr if none.
 
void set_child (Gtk::Widget *child)
 Sets (parents) the child widget, or unsets (unparents) it if child is null.
 
void set_child (Gtk::Widget &child)
 Convenience function: Sets (parents) the child widget.
 
void unset_child ()
 Convenience function: Unsets (unparents) the child widget.
 
template<typename F >
sigc::connection connectBeforeResize (F &&slot)
 Register a handler to run immediately before a resize operation.
 
template<typename F >
sigc::connection connectAfterResize (F &&slot)
 Register a handler to run immediately after a resize operation.
 

Private Member Functions

 RectToolbar (Glib::RefPtr< Gtk::Builder > const &builder)
 
auto _getDerivedSpinButtons () const
 
void _valueChanged (DerivedSpinButton &btn)
 
void _attachRepr (XML::Node *repr, SPRect *rect)
 
void _detachRepr ()
 
void _selectionChanged (Selection *selection)
 
void _sensitivize ()
 
void _setDefaults ()
 
void notifyAttributeChanged (XML::Node &node, GQuark name, Util::ptr_shared old_value, Util::ptr_shared new_value) override
 Attribute change callback.
 
void _queueUpdate ()
 
void _cancelUpdate ()
 
void _update ()
 
- Private Member Functions inherited from Inkscape::XML::NodeObserver
virtual ~NodeObserver ()=default
 
virtual void notifyChildAdded (Node &node, Node &child, Node *prev)
 Child addition callback.
 
virtual void notifyChildRemoved (Node &node, Node &child, Node *prev)
 Child removal callback.
 
virtual void notifyChildOrderChanged (Node &node, Node &child, Node *old_prev, Node *new_prev)
 Child order change callback.
 
virtual void notifyContentChanged (Node &node, Util::ptr_shared old_content, Util::ptr_shared new_content)
 Content change callback.
 
virtual void notifyElementNameChanged (Node &node, GQuark old_name, GQuark new_name)
 Element name change callback.
 
 NodeObserver ()=default
 

Private Attributes

std::unique_ptr< UI::Widget::UnitTracker_tracker
 
Gtk::Label & _mode_item
 
Gtk::Button & _not_rounded
 
DerivedSpinButton & _width_item
 
DerivedSpinButton & _height_item
 
DerivedSpinButton & _rx_item
 
DerivedSpinButton & _ry_item
 
XML::Node_repr = nullptr
 
SPRect_rect = nullptr
 
OperationBlocker _blocker
 
bool _single = true
 
sigc::connection _selection_changed_conn
 
unsigned _tick_callback = 0
 

Additional Inherited Members

- Protected Member Functions inherited from Inkscape::UI::Toolbar::Toolbar
 ToolbarWidget (Gtk::Box &toolbar)
 
- Protected Member Functions inherited from Inkscape::UI::Toolbar::ToolbarWidget
 ToolbarWidget (Gtk::Box &toolbar)
 
void measure_vfunc (Gtk::Orientation orientation, int for_size, int &min, int &nat, int &min_baseline, int &nat_baseline) const override
 
void on_size_allocate (int width, int height, int baseline) override
 
void _initMenuBtns ()
 
- Protected Member Functions inherited from Inkscape::UI::Widget::Bin
void measure_vfunc (Gtk::Orientation orientation, int for_size, int &min, int &nat, int &min_baseline, int &nat_baseline) const override
 
- Protected Member Functions inherited from Inkscape::UI::DefocusTarget
 ~DefocusTarget ()=default
 
- Protected Attributes inherited from Inkscape::UI::Toolbar::Toolbar
SPDesktop_desktop = nullptr
 
- Protected Attributes inherited from Inkscape::UI::Toolbar::ToolbarWidget
Gtk::Box & _toolbar
 

Detailed Description

Definition at line 61 of file rect-toolbar.h.

Constructor & Destructor Documentation

◆ RectToolbar() [1/2]

Inkscape::UI::Toolbar::RectToolbar::RectToolbar ( )

Definition at line 75 of file rect-toolbar.cpp.

References Inkscape::UI::create_builder().

◆ ~RectToolbar()

Inkscape::UI::Toolbar::RectToolbar::~RectToolbar ( )
overridedefault

◆ RectToolbar() [2/2]

Member Function Documentation

◆ _attachRepr()

void Inkscape::UI::Toolbar::RectToolbar::_attachRepr ( XML::Node repr,
SPRect rect 
)
private

Definition at line 186 of file rect-toolbar.cpp.

References _rect, _repr, Inkscape::XML::Node::addObserver(), and Inkscape::GC::anchor().

Referenced by _selectionChanged().

◆ _cancelUpdate()

void Inkscape::UI::Toolbar::RectToolbar::_cancelUpdate ( )
private

Definition at line 318 of file rect-toolbar.cpp.

References _tick_callback.

Referenced by _detachRepr().

◆ _detachRepr()

void Inkscape::UI::Toolbar::RectToolbar::_detachRepr ( )
private

◆ _getDerivedSpinButtons()

auto Inkscape::UI::Toolbar::RectToolbar::_getDerivedSpinButtons ( ) const
inlineprivate

Definition at line 85 of file rect-toolbar.h.

References _height_item, _rx_item, _ry_item, and _width_item.

Referenced by _update(), and RectToolbar().

◆ _queueUpdate()

void Inkscape::UI::Toolbar::RectToolbar::_queueUpdate ( )
private

Definition at line 305 of file rect-toolbar.cpp.

References _tick_callback, and _update().

Referenced by _selectionChanged(), and notifyAttributeChanged().

◆ _selectionChanged()

void Inkscape::UI::Toolbar::RectToolbar::_selectionChanged ( Selection selection)
private

◆ _sensitivize()

void Inkscape::UI::Toolbar::RectToolbar::_sensitivize ( )
private

Definition at line 241 of file rect-toolbar.cpp.

References _not_rounded, _rx_item, _ry_item, and _single.

Referenced by _selectionChanged(), _setDefaults(), _update(), _valueChanged(), and setDesktop().

◆ _setDefaults()

void Inkscape::UI::Toolbar::RectToolbar::_setDefaults ( )
private

Definition at line 249 of file rect-toolbar.cpp.

References _rx_item, _ry_item, and _sensitivize().

Referenced by RectToolbar().

◆ _update()

void Inkscape::UI::Toolbar::RectToolbar::_update ( )
private

◆ _valueChanged()

◆ notifyAttributeChanged()

void Inkscape::UI::Toolbar::RectToolbar::notifyAttributeChanged ( XML::Node node,
GQuark  name,
Util::ptr_shared  old_value,
Util::ptr_shared  new_value 
)
overrideprivatevirtual

Attribute change callback.

This method is called whenever one of a node's attributes is changed.

Parameters
nodeThe changed XML node
nameGQuark corresponding to the attribute's name
old_valueOld value of the modified attribute. Is a nullptr when the attribute is added.
new_valueNew value of the modified attribute. Is a nullptr when the attribute is removed.

Reimplemented from Inkscape::XML::NodeObserver.

Definition at line 290 of file rect-toolbar.cpp.

References _blocker, _queueUpdate(), _rect, _repr, and OperationBlocker::pending().

◆ setActiveUnit()

void Inkscape::UI::Toolbar::RectToolbar::setActiveUnit ( Util::Unit const *  unit)
overridevirtual

Reimplemented from Inkscape::UI::Toolbar::Toolbar.

Definition at line 181 of file rect-toolbar.cpp.

References _tracker.

◆ setDesktop()

Member Data Documentation

◆ _blocker

OperationBlocker Inkscape::UI::Toolbar::RectToolbar::_blocker
private

Definition at line 93 of file rect-toolbar.h.

Referenced by _update(), _valueChanged(), and notifyAttributeChanged().

◆ _height_item

DerivedSpinButton& Inkscape::UI::Toolbar::RectToolbar::_height_item
private

Definition at line 82 of file rect-toolbar.h.

Referenced by _getDerivedSpinButtons(), _selectionChanged(), and RectToolbar().

◆ _mode_item

Gtk::Label& Inkscape::UI::Toolbar::RectToolbar::_mode_item
private

Definition at line 77 of file rect-toolbar.h.

Referenced by _selectionChanged().

◆ _not_rounded

Gtk::Button& Inkscape::UI::Toolbar::RectToolbar::_not_rounded
private

Definition at line 78 of file rect-toolbar.h.

Referenced by _sensitivize(), and RectToolbar().

◆ _rect

SPRect* Inkscape::UI::Toolbar::RectToolbar::_rect = nullptr
private

Definition at line 89 of file rect-toolbar.h.

Referenced by _attachRepr(), _detachRepr(), _update(), and notifyAttributeChanged().

◆ _repr

XML::Node* Inkscape::UI::Toolbar::RectToolbar::_repr = nullptr
private

◆ _rx_item

DerivedSpinButton& Inkscape::UI::Toolbar::RectToolbar::_rx_item
private

Definition at line 83 of file rect-toolbar.h.

Referenced by _getDerivedSpinButtons(), _sensitivize(), _setDefaults(), and RectToolbar().

◆ _ry_item

DerivedSpinButton& Inkscape::UI::Toolbar::RectToolbar::_ry_item
private

Definition at line 84 of file rect-toolbar.h.

Referenced by _getDerivedSpinButtons(), _sensitivize(), _setDefaults(), and RectToolbar().

◆ _selection_changed_conn

sigc::connection Inkscape::UI::Toolbar::RectToolbar::_selection_changed_conn
private

Definition at line 96 of file rect-toolbar.h.

Referenced by setDesktop().

◆ _single

bool Inkscape::UI::Toolbar::RectToolbar::_single = true
private

Definition at line 94 of file rect-toolbar.h.

Referenced by _selectionChanged(), and _sensitivize().

◆ _tick_callback

unsigned Inkscape::UI::Toolbar::RectToolbar::_tick_callback = 0
private

Definition at line 106 of file rect-toolbar.h.

Referenced by _cancelUpdate(), and _queueUpdate().

◆ _tracker

std::unique_ptr<UI::Widget::UnitTracker> Inkscape::UI::Toolbar::RectToolbar::_tracker
private

Definition at line 75 of file rect-toolbar.h.

Referenced by _update(), _valueChanged(), RectToolbar(), and setActiveUnit().

◆ _width_item

DerivedSpinButton& Inkscape::UI::Toolbar::RectToolbar::_width_item
private

Definition at line 81 of file rect-toolbar.h.

Referenced by _getDerivedSpinButtons(), _selectionChanged(), and RectToolbar().


The documentation for this class was generated from the following files: