Inkscape
Vector Graphics Editor
|
#include <layer-properties.h>
Classes | |
struct | ModelColumns |
struct | PositionDropdownColumns |
Static Public Member Functions | |
static void | showRename (SPDesktop *desktop, SPObject *layer) |
static void | showCreate (SPDesktop *desktop, SPObject *layer) |
static void | showMove (SPDesktop *desktop, SPObject *layer) |
Private Member Functions | |
LayerPropertiesDialog (LayerPropertiesDialogType type) | |
~LayerPropertiesDialog () override | |
void | _setDesktop (SPDesktop *desktop) |
void | _setLayer (SPObject *layer) |
void | _apply () |
Performs an action depending on the type of the dialog. | |
void | _setup_position_controls () |
Sets up the combo box for choosing the relative position of the new layer. | |
void | _setup_layers_controls () |
Sets up the tree view of current layers. | |
void | _prepareLabelRenderer (Gtk::TreeModel::const_iterator const &iter) |
Formats the label for a given layer row. | |
void | _addLayer (SPObject *layer, Gtk::TreeModel::Row *parentRow, SPObject *target, int level) |
Inserts the new layer into the document. | |
SPObject * | _selectedLayer () |
bool | on_key_pressed (Gtk::EventControllerKey const &controller, unsigned keyval, unsigned keycode, Gdk::ModifierType state) |
Gtk::EventSequenceState | on_click_pressed (int n_press, double x, double y) |
void | _doCreate () |
Creates a new layer based on the input entered in the dialog window. | |
void | _doMove () |
Moves selection to the chosen layer. | |
void | _doRename () |
Renames a layer based on the user input in the dialog window. | |
void | _setup () |
Sets up the dialog depending on its type. | |
Static Private Member Functions | |
static void | _showDialog (LayerPropertiesDialogType type, SPDesktop *desktop, SPObject *layer) |
Static member function which displays a modal dialog of the given type. | |
Private Attributes | |
LayerPropertiesDialogType | _type = LayerPropertiesDialogType::NONE |
SPDesktop * | _desktop = nullptr |
SPObject * | _layer = nullptr |
Gtk::Label | _layer_name_label |
Gtk::Entry | _layer_name_entry |
Gtk::Label | _layer_position_label |
Gtk::CheckButton | _layer_position_radio [3] |
Gtk::Grid | _layout_table |
bool | _position_visible = false |
Gtk::Box | _mainbox |
Gtk::Box | _buttonbox |
Gtk::TreeView | _tree |
ModelColumns | _model |
Glib::RefPtr< Gtk::TreeStore > | _store |
Gtk::ScrolledWindow | _scroller |
PositionDropdownColumns | _dropdown_columns |
Gtk::CellRendererText | _label_renderer |
Gtk::Button | _close_button |
Gtk::Button | _apply_button |
Definition at line 47 of file layer-properties.h.
|
explicitprivate |
Definition at line 34 of file layer-properties.cpp.
References _apply(), _apply_button, _buttonbox, _close_button, _layer_name_entry, _layer_name_label, _layout_table, and _mainbox.
|
overrideprivate |
Definition at line 84 of file layer-properties.cpp.
References _setDesktop(), and _setLayer().
|
private |
Inserts the new layer into the document.
Definition at line 332 of file layer-properties.cpp.
References _addLayer(), _desktop, _model, _store, _tree, child, Inkscape::DocumentSubset::childCount(), counter, Inkscape::UI::Dialog::LayerPropertiesDialog::ModelColumns::label, SPDesktop::layerManager(), Inkscape::UI::Dialog::LayerPropertiesDialog::ModelColumns::locked, Inkscape::DocumentSubset::nthChildOf(), Inkscape::UI::Dialog::LayerPropertiesDialog::ModelColumns::object, and Inkscape::UI::Dialog::LayerPropertiesDialog::ModelColumns::visible.
Referenced by _addLayer(), and _setup_layers_controls().
|
private |
Performs an action depending on the type of the dialog.
Definition at line 108 of file layer-properties.cpp.
References _doCreate(), _doMove(), _doRename(), _type, Inkscape::UI::Dialog::CREATE, Inkscape::UI::Dialog::MOVE, Inkscape::UI::Dialog::NONE, and Inkscape::UI::Dialog::RENAME.
Referenced by LayerPropertiesDialog(), on_click_pressed(), and on_key_pressed().
|
private |
Creates a new layer based on the input entered in the dialog window.
Definition at line 130 of file layer-properties.cpp.
References _desktop, _layer, _layer_name_entry, _layer_position_radio, _position_visible, Inkscape::ObjectSet::clear(), Inkscape::create_layer(), Inkscape::DocumentUndo::done(), Inkscape::MessageStack::flash(), Inkscape::Preferences::get(), SPDesktop::getDocument(), SPDocument::getRoot(), SPDesktop::getSelection(), index, SPDesktop::layerManager(), Inkscape::LPOS_ABOVE, Inkscape::LPOS_BELOW, Inkscape::LPOS_CHILD, SPDesktop::messageStack(), name, Inkscape::NORMAL_MESSAGE, Inkscape::LayerManager::renameLayer(), root, Inkscape::LayerManager::setCurrentLayer(), and Inkscape::Preferences::setInt().
Referenced by _apply().
|
private |
Moves selection to the chosen layer.
Definition at line 164 of file layer-properties.cpp.
References _desktop, _selectedLayer(), Inkscape::DocumentUndo::done(), SPDesktop::getDocument(), SPDesktop::getSelection(), and Inkscape::ObjectSet::toLayer().
Referenced by _apply().
|
private |
Renames a layer based on the user input in the dialog window.
Definition at line 173 of file layer-properties.cpp.
References _desktop, _layer_name_entry, Inkscape::LayerManager::currentLayer(), Inkscape::DocumentUndo::done(), Inkscape::MessageStack::flash(), SPDesktop::getDocument(), SPGroup::highlight_color(), SPItem::isHighlightSet(), SPDesktop::layerManager(), SPDesktop::messageStack(), name, Inkscape::NORMAL_MESSAGE, Inkscape::LayerManager::renameLayer(), and SPItem::setHighlight().
Referenced by _apply().
|
private |
Formats the label for a given layer row.
Definition at line 402 of file layer-properties.cpp.
References _dropdown_columns, _label_renderer, and Inkscape::UI::Dialog::LayerPropertiesDialog::PositionDropdownColumns::name.
|
private |
Definition at line 368 of file layer-properties.cpp.
References _model, _tree, and Inkscape::UI::Dialog::LayerPropertiesDialog::ModelColumns::object.
Referenced by _doMove().
|
inlineprivate |
Definition at line 118 of file layer-properties.h.
References _desktop, and desktop.
Referenced by ~LayerPropertiesDialog().
|
private |
Definition at line 407 of file layer-properties.cpp.
References _layer, sp_object_ref(), and sp_object_unref().
Referenced by ~LayerPropertiesDialog().
|
private |
Sets up the dialog depending on its type.
Definition at line 194 of file layer-properties.cpp.
References _apply_button, _desktop, _layer_name_entry, _setup_layers_controls(), _setup_position_controls(), _type, Inkscape::UI::Dialog::CREATE, Inkscape::LayerManager::currentLayer(), Inkscape::LayerManager::getLayerCount(), Inkscape::LayerManager::getNextLayerName(), SPObject::label(), SPDesktop::layerManager(), Inkscape::UI::Dialog::MOVE, name, Inkscape::UI::Dialog::NONE, and Inkscape::UI::Dialog::RENAME.
|
private |
Sets up the tree view of current layers.
Definition at line 268 of file layer-properties.cpp.
References _addLayer(), _desktop, _layer_name_entry, _layer_name_label, _layout_table, _model, _scroller, _store, _tree, Inkscape::LayerManager::currentLayer(), SPDesktop::doc(), SPDocument::getRoot(), key, Inkscape::UI::Dialog::LayerPropertiesDialog::ModelColumns::label, SPDesktop::layerManager(), Inkscape::UI::Dialog::LayerPropertiesDialog::ModelColumns::locked, on_click_pressed(), on_key_pressed(), root, Inkscape::UI::Controller::use_state(), and Inkscape::UI::Dialog::LayerPropertiesDialog::ModelColumns::visible.
Referenced by _setup().
|
private |
Sets up the combo box for choosing the relative position of the new layer.
Definition at line 233 of file layer-properties.cpp.
References _desktop, _layer, _layer_position_label, _layer_position_radio, _layout_table, _position_visible, Inkscape::Preferences::get(), SPDesktop::getDocument(), Inkscape::Preferences::getIntLimited(), SPDocument::getRoot(), Inkscape::LPOS_ABOVE, Inkscape::LPOS_BELOW, and Inkscape::LPOS_CHILD.
Referenced by _setup().
|
staticprivate |
Static member function which displays a modal dialog of the given type.
Definition at line 91 of file layer-properties.cpp.
References desktop, and SPDesktop::setWindowTransient().
Referenced by showCreate(), showMove(), and showRename().
|
private |
Definition at line 391 of file layer-properties.cpp.
References _apply().
Referenced by _setup_layers_controls().
|
private |
Definition at line 377 of file layer-properties.cpp.
References _apply(), and Inkscape::UI::Tools::get_latin_keyval().
Referenced by _setup_layers_controls().
|
inlinestatic |
Definition at line 53 of file layer-properties.h.
References _showDialog(), Inkscape::UI::Dialog::CREATE, and desktop.
Referenced by layer_new().
|
inlinestatic |
Definition at line 56 of file layer-properties.h.
References _showDialog(), desktop, and Inkscape::UI::Dialog::MOVE.
Referenced by selection_move_to_layer().
|
inlinestatic |
Definition at line 50 of file layer-properties.h.
References _showDialog(), desktop, and Inkscape::UI::Dialog::RENAME.
Referenced by layer_rename().
|
private |
Definition at line 116 of file layer-properties.h.
Referenced by _setup(), and LayerPropertiesDialog().
|
private |
Definition at line 105 of file layer-properties.h.
Referenced by LayerPropertiesDialog().
|
private |
Definition at line 115 of file layer-properties.h.
Referenced by LayerPropertiesDialog().
|
private |
Definition at line 65 of file layer-properties.h.
Referenced by _addLayer(), _doCreate(), _doMove(), _doRename(), _setDesktop(), _setup(), _setup_layers_controls(), and _setup_position_controls().
|
private |
Definition at line 112 of file layer-properties.h.
Referenced by _prepareLabelRenderer().
|
private |
Definition at line 113 of file layer-properties.h.
Referenced by _prepareLabelRenderer().
|
private |
Definition at line 66 of file layer-properties.h.
Referenced by _doCreate(), _setLayer(), and _setup_position_controls().
|
private |
Definition at line 81 of file layer-properties.h.
Referenced by _doCreate(), _doRename(), _setup(), _setup_layers_controls(), and LayerPropertiesDialog().
|
private |
Definition at line 80 of file layer-properties.h.
Referenced by _setup_layers_controls(), and LayerPropertiesDialog().
|
private |
Definition at line 82 of file layer-properties.h.
Referenced by _setup_position_controls().
|
private |
Definition at line 83 of file layer-properties.h.
Referenced by _doCreate(), and _setup_position_controls().
|
private |
Definition at line 84 of file layer-properties.h.
Referenced by _setup_layers_controls(), _setup_position_controls(), and LayerPropertiesDialog().
|
private |
Definition at line 104 of file layer-properties.h.
Referenced by LayerPropertiesDialog().
|
private |
Definition at line 108 of file layer-properties.h.
Referenced by _addLayer(), _selectedLayer(), and _setup_layers_controls().
|
private |
Definition at line 86 of file layer-properties.h.
Referenced by _doCreate(), and _setup_position_controls().
|
private |
Definition at line 110 of file layer-properties.h.
Referenced by _setup_layers_controls().
|
private |
Definition at line 109 of file layer-properties.h.
Referenced by _addLayer(), and _setup_layers_controls().
|
private |
Definition at line 107 of file layer-properties.h.
Referenced by _addLayer(), _selectedLayer(), and _setup_layers_controls().
|
private |
Definition at line 64 of file layer-properties.h.