Inkscape
Vector Graphics Editor
|
A dialog widget to view and edit the document xml. More...
#include <xml-tree.h>
Public Member Functions | |
XmlTree () | |
~XmlTree () final | |
void | setSyntaxStyle (Inkscape::UI::Syntax::XMLStyles const &new_style) |
![]() | |
DialogBase (char const *prefs_path=nullptr, Glib::ustring dialog_type={}) | |
DialogBase constructor. | |
DialogBase (DialogBase const &)=delete | |
DialogBase & | operator= (DialogBase const &)=delete |
~DialogBase () override | |
virtual void | update () |
The update() method is essential to Gtk state management. | |
void | setDesktop (SPDesktop *new_desktop) |
Called when the desktop might have changed for this dialog. | |
void | on_map () override |
Glib::ustring const & | get_name () const |
Glib::ustring const & | getPrefsPath () const |
Glib::ustring const & | get_type () const |
const Glib::ustring & | get_icon () const |
void | blink () |
Highlight notebook where dialog already exists. | |
virtual void | focus_dialog () |
void | defocus_dialog () |
bool | getShowing () |
void | fix_inner_scroll (Gtk::ScrolledWindow &scrollwin) |
SPDesktop * | getDesktop () const |
Private Types | |
enum | DialogLayout : int { Auto = 0 , Horizontal , Vertical } |
Private Member Functions | |
void | unsetDocument () |
void | documentReplaced () final |
void | selectionChanged (Selection *selection) final |
void | desktopReplaced () final |
Called when the desktop has certainly changed. | |
bool | xml_tree_node_mutable (Inkscape::XML::Node *node) |
Is the selected tree node editable. | |
void | set_tree_select (Inkscape::XML::Node *repr, bool edit=false) |
Select a node in the xml tree. | |
void | propagate_tree_select (Inkscape::XML::Node *repr) |
Set the attribute list to match the selected node in the tree. | |
Inkscape::XML::Node * | get_dt_select () |
Find the current desktop selection. | |
void | set_dt_select (Inkscape::XML::Node *repr) |
Select the current desktop selection. | |
bool | deferred_on_tree_select_row () |
void | on_tree_select_row_enable (Inkscape::XML::Node *node) |
Enable widgets based on current selections. | |
void | on_tree_unselect_row_disable () |
void | on_tree_unselect_row_hide () |
void | on_attr_unselect_row_disable () |
void | onNameChanged () |
void | onCreateNameChanged () |
void | cmd_new_element_node () |
Callbacks for toolbar buttons being pressed. | |
void | cmd_new_text_node () |
void | cmd_duplicate_node () |
void | cmd_delete_node () |
void | cmd_raise_node () |
void | cmd_lower_node () |
void | cmd_indent_node () |
void | cmd_unindent_node () |
void | _resized () |
bool | in_dt_coordsys (SPObject const &item) |
Returns true iff item is suitable to be included in the selection, in particular whether it has a bounding box in the desktop coordinate system for rendering resize handles. | |
void | rebuildTree () |
void | stopNodeEditing (bool ok, Glib::ustring const &path, Glib::ustring name) |
void | startNodeEditing (Gtk::CellEditable *cell, Glib::ustring const &path) |
Static Private Member Functions | |
static void | _set_status_message (Inkscape::MessageType type, const gchar *message, GtkWidget *dialog) |
Callbacks for changes in desktop selection and current document. | |
Private Attributes | |
sigc::scoped_connection | _tree_select_idle |
Callback for deferring the on_tree_select_row response in order to skip invalid intermediate selection states. | |
gint | blocked = 0 |
Flag to ensure only one operation is performed at once. | |
Inkscape::XML::Node * | selected_repr = nullptr |
Signal handlers. | |
Inkscape::UI::Widget::XmlTreeView * | _xml_treeview = nullptr |
AttrDialog * | attributes |
Gtk::Box * | _attrbox |
Glib::RefPtr< Gtk::Builder > | _builder |
UI::Widget::Bin | _bin |
Gtk::Entry * | name_entry |
Gtk::Button * | create_button |
Gtk::Paned & | _paned |
Gtk::Switch | _attrswitch |
Gtk::Label | status |
Gtk::Button & | xml_element_new_button |
Gtk::Button & | xml_text_new_button |
Gtk::Button & | xml_node_delete_button |
Gtk::Button & | xml_node_duplicate_button |
Gtk::Button & | unindent_node_button |
Gtk::Button & | indent_node_button |
Gtk::Button & | raise_node_button |
Gtk::Button & | lower_node_button |
DialogLayout | _layout = Auto |
Pref< Glib::ustring > | _syntax_theme |
Pref< bool > | _mono_font |
Inkscape::XML::Node * | _dummy = nullptr |
Inkscape::XML::Node * | _node_parent = nullptr |
Additional Inherited Members | |
![]() | |
InkscapeApplication * | getApp () const |
SPDocument * | getDocument () const |
Selection * | getSelection () const |
void | setShowing (bool showing) |
function called from notebook dialog that performs an update of the dialog and sets the dialog showing state true | |
![]() | |
Glib::ustring | _name |
Glib::ustring const | _prefs_path |
Glib::ustring const | _dialog_type |
A dialog widget to view and edit the document xml.
Definition at line 56 of file xml-tree.h.
|
private |
Enumerator | |
---|---|
Auto | |
Horizontal | |
Vertical |
Definition at line 174 of file xml-tree.h.
Inkscape::UI::Dialog::XmlTree::XmlTree | ( | ) |
Definition at line 65 of file xml-tree.cpp.
References _bin, _builder, _layout, _mono_font, _paned, _resized(), _syntax_theme, _tree_select_idle, _xml_treeview, Inkscape::PrefBase< T >::action, Inkscape::append(), attributes, Auto, blocked, Inkscape::UI::Syntax::build_xml_styles(), cmd_delete_node(), cmd_duplicate_node(), cmd_indent_node(), cmd_lower_node(), cmd_new_element_node(), cmd_new_text_node(), cmd_raise_node(), cmd_unindent_node(), Inkscape::UI::Widget::Bin::connectBeforeResize(), Inkscape::UI::create_builder(), deferred_on_tree_select_row(), Inkscape::UI::Dialog::DialogBase::fix_inner_scroll(), Inkscape::Preferences::get(), Inkscape::UI::Widget::XmlTreeView::get_renderer(), Inkscape::UI::Dialog::AttrDialog::get_scrolled_window(), Inkscape::UI::Dialog::AttrDialog::get_status_box(), Inkscape::UI::get_widget(), Inkscape::UI::Dialog::DialogBase::getDesktop(), Inkscape::Preferences::getInt(), Inkscape::Preferences::getIntLimited(), Inkscape::UI::Widget::height, Horizontal, indent_node_button, lower_node_button, name, raise_node_button, rebuildTree(), Inkscape::UI::Widget::Bin::set_child(), Inkscape::UI::Dialog::AttrDialog::set_mono_font(), Inkscape::Preferences::setInt(), setSyntaxStyle(), startNodeEditing(), stopNodeEditing(), unindent_node_button, Vertical, width, xml_element_new_button, xml_node_delete_button, xml_node_duplicate_button, and xml_text_new_button.
|
final |
Definition at line 239 of file xml-tree.cpp.
References unsetDocument().
|
private |
Definition at line 252 of file xml-tree.cpp.
References _paned, Inkscape::Preferences::get(), and Inkscape::Preferences::setInt().
Referenced by XmlTree().
|
staticprivate |
Callbacks for changes in desktop selection and current document.
Definition at line 397 of file xml-tree.cpp.
|
private |
Definition at line 628 of file xml-tree.cpp.
References Inkscape::UI::Dialog::DialogBase::document, Inkscape::DocumentUndo::done(), Inkscape::UI::Dialog::DialogBase::getDocument(), SPDocument::getObjectByRepr(), parent, Inkscape::XML::Node::parent(), SPObject::requestDisplayUpdate(), selected_repr, SPDocument::setXMLDialogSelectedObject(), and sp_repr_unparent().
Referenced by XmlTree().
|
private |
Definition at line 611 of file xml-tree.cpp.
References _xml_treeview, Inkscape::XML::Node::addChild(), Inkscape::UI::Dialog::DialogBase::document, Inkscape::DocumentUndo::done(), Inkscape::XML::Node::duplicate(), Inkscape::UI::Dialog::DialogBase::getDocument(), parent, Inkscape::XML::Node::parent(), Inkscape::UI::Widget::XmlTreeView::select_node(), and selected_repr.
Referenced by XmlTree().
|
private |
Definition at line 701 of file xml-tree.cpp.
References Inkscape::XML::Node::addChild(), Inkscape::UI::Dialog::DialogBase::document, Inkscape::DocumentUndo::done(), Inkscape::XML::ELEMENT_NODE, Inkscape::XML::Node::firstChild(), Inkscape::UI::Dialog::DialogBase::getDocument(), Inkscape::XML::Node::next(), parent, Inkscape::XML::Node::parent(), ref, Inkscape::XML::Node::removeChild(), selected_repr, set_dt_select(), set_tree_select(), and Inkscape::XML::Node::type().
Referenced by XmlTree().
|
private |
Definition at line 682 of file xml-tree.cpp.
References Inkscape::XML::Node::changeOrder(), Inkscape::UI::Dialog::DialogBase::document, Inkscape::DocumentUndo::done(), Inkscape::UI::Dialog::DialogBase::getDocument(), Inkscape::XML::Node::next(), parent, Inkscape::XML::Node::parent(), selected_repr, set_dt_select(), and set_tree_select().
Referenced by XmlTree().
|
private |
Callbacks for toolbar buttons being pressed.
Definition at line 508 of file xml-tree.cpp.
References _dummy, _node_parent, _xml_treeview, Inkscape::XML::Node::appendChild(), Inkscape::UI::Dialog::DialogBase::document, Inkscape::UI::Widget::XmlTreeView::get_renderer(), Inkscape::UI::Dialog::DialogBase::getDocument(), SPDocument::getReprDoc(), selected_repr, and set_tree_select().
Referenced by XmlTree().
|
private |
Definition at line 593 of file xml-tree.cpp.
References Inkscape::XML::Node::appendChild(), Inkscape::XML::Document::createTextNode(), Inkscape::UI::Dialog::DialogBase::document, Inkscape::DocumentUndo::done(), Inkscape::UI::Dialog::DialogBase::getDocument(), SPDocument::getReprDoc(), selected_repr, set_dt_select(), and set_tree_select().
Referenced by XmlTree().
|
private |
Definition at line 653 of file xml-tree.cpp.
References Inkscape::XML::Node::changeOrder(), Inkscape::UI::Dialog::DialogBase::document, Inkscape::DocumentUndo::done(), Inkscape::XML::Node::firstChild(), Inkscape::UI::Dialog::DialogBase::getDocument(), Inkscape::XML::Node::next(), parent, Inkscape::XML::Node::parent(), ref, selected_repr, set_dt_select(), and set_tree_select().
Referenced by XmlTree().
|
private |
Definition at line 737 of file xml-tree.cpp.
References Inkscape::XML::Node::addChild(), Inkscape::UI::Dialog::DialogBase::document, Inkscape::DocumentUndo::done(), Inkscape::UI::Dialog::DialogBase::getDocument(), parent, Inkscape::XML::Node::parent(), selected_repr, set_dt_select(), and set_tree_select().
Referenced by XmlTree().
|
private |
Definition at line 370 of file xml-tree.cpp.
References _xml_treeview, Inkscape::UI::Widget::XmlTreeView::get_repr(), on_tree_select_row_enable(), on_tree_unselect_row_disable(), propagate_tree_select(), selected_repr, Inkscape::UI::Dialog::DialogBase::selection, and set_dt_select().
Referenced by XmlTree().
|
finalprivatevirtual |
Called when the desktop has certainly changed.
It may have changed to nullptr when destructing the dialog, so the override should expect nullptr too.
Reimplemented from Inkscape::UI::Dialog::DialogBase.
Definition at line 788 of file xml-tree.cpp.
References attributes, Inkscape::UI::Dialog::DialogBase::getDesktop(), and Inkscape::UI::Dialog::DialogBase::setDesktop().
|
finalprivatevirtual |
Reimplemented from Inkscape::UI::Dialog::DialogBase.
Definition at line 263 of file xml-tree.cpp.
References _xml_treeview, Inkscape::UI::Widget::XmlTreeView::build_tree(), Inkscape::UI::Dialog::DialogBase::document, Inkscape::UI::Dialog::DialogBase::getDocument(), SPDocument::getReprRoot(), set_tree_select(), SPDocument::setXMLDialogSelectedObject(), and unsetDocument().
|
private |
Find the current desktop selection.
Definition at line 315 of file xml-tree.cpp.
References Inkscape::UI::Dialog::DialogBase::getSelection(), Inkscape::UI::Dialog::DialogBase::selection, and Inkscape::ObjectSet::singleRepr().
Referenced by selectionChanged().
|
private |
Returns true iff item is suitable to be included in the selection, in particular whether it has a bounding box in the desktop coordinate system for rendering resize handles.
Descendents of <defs> nodes (markers etc.) return false, for example.
Definition at line 768 of file xml-tree.cpp.
References child, item, parent, and SPObject::parent.
Referenced by set_dt_select().
|
private |
|
private |
Enable widgets based on current selections.
Definition at line 404 of file xml-tree.cpp.
References Inkscape::XML::ELEMENT_NODE, Inkscape::XML::Node::firstChild(), indent_node_button, lower_node_button, Inkscape::XML::Node::next(), node, parent, Inkscape::XML::Node::parent(), raise_node_button, Inkscape::XML::Node::type(), unindent_node_button, xml_element_new_button, xml_node_delete_button, xml_node_duplicate_button, xml_text_new_button, and xml_tree_node_mutable().
Referenced by deferred_on_tree_select_row().
|
private |
Definition at line 489 of file xml-tree.cpp.
References indent_node_button, lower_node_button, raise_node_button, unindent_node_button, xml_element_new_button, xml_node_delete_button, xml_node_duplicate_button, and xml_text_new_button.
Referenced by deferred_on_tree_select_row().
|
private |
|
private |
Definition at line 501 of file xml-tree.cpp.
References create_button, and name_entry.
|
private |
|
private |
Set the attribute list to match the selected node in the tree.
Definition at line 301 of file xml-tree.cpp.
References attributes, Inkscape::XML::COMMENT_NODE, Inkscape::XML::ELEMENT_NODE, Inkscape::UI::Dialog::AttrDialog::setRepr(), Inkscape::XML::TEXT_NODE, and Inkscape::XML::Node::type().
Referenced by deferred_on_tree_select_row(), and set_tree_select().
|
private |
Definition at line 244 of file xml-tree.cpp.
References _xml_treeview, Inkscape::UI::Widget::XmlTreeView::build_tree(), Inkscape::UI::Dialog::DialogBase::document, Inkscape::UI::Dialog::DialogBase::getDocument(), SPDocument::getReprRoot(), and set_tree_select().
Referenced by XmlTree().
|
finalprivatevirtual |
Reimplemented from Inkscape::UI::Dialog::DialogBase.
Definition at line 278 of file xml-tree.cpp.
References blocked, get_dt_select(), node, and set_tree_select().
|
private |
Select the current desktop selection.
Definition at line 333 of file xml-tree.cpp.
References blocked, Inkscape::UI::Dialog::DialogBase::document, Inkscape::XML::ELEMENT_NODE, Inkscape::UI::Dialog::DialogBase::getDesktop(), Inkscape::UI::Dialog::DialogBase::getDocument(), SPDocument::getObjectByRepr(), Inkscape::UI::Dialog::DialogBase::getSelection(), in_dt_coordsys(), Inkscape::UI::Dialog::isRealLayer(), SPDesktop::layerManager(), SPObject::parent, Inkscape::XML::Node::parent(), Inkscape::Selection::set(), Inkscape::LayerManager::setCurrentLayer(), SPDocument::setXMLDialogSelectedObject(), and Inkscape::XML::Node::type().
Referenced by cmd_indent_node(), cmd_lower_node(), cmd_new_text_node(), cmd_raise_node(), cmd_unindent_node(), deferred_on_tree_select_row(), and stopNodeEditing().
|
private |
Select a node in the xml tree.
Definition at line 287 of file xml-tree.cpp.
References _xml_treeview, Inkscape::UI::Dialog::DialogBase::document, Inkscape::UI::Dialog::DialogBase::getDocument(), propagate_tree_select(), Inkscape::UI::Widget::XmlTreeView::select_node(), selected_repr, and SPDocument::setXMLDialogSelectedObject().
Referenced by cmd_indent_node(), cmd_lower_node(), cmd_new_element_node(), cmd_new_text_node(), cmd_raise_node(), cmd_unindent_node(), documentReplaced(), rebuildTree(), selectionChanged(), and stopNodeEditing().
void Inkscape::UI::Dialog::XmlTree::setSyntaxStyle | ( | Inkscape::UI::Syntax::XMLStyles const & | new_style | ) |
Definition at line 795 of file xml-tree.cpp.
References _xml_treeview, and Inkscape::UI::Widget::XmlTreeView::set_style().
Referenced by XmlTree().
|
private |
Definition at line 528 of file xml-tree.cpp.
Referenced by XmlTree().
|
private |
Definition at line 538 of file xml-tree.cpp.
References _dummy, _node_parent, _xml_treeview, Inkscape::XML::Node::appendChild(), Inkscape::XML::Document::createElement(), Inkscape::UI::Dialog::DialogBase::document, Inkscape::DocumentUndo::done(), Inkscape::UI::Widget::XmlTreeView::get_renderer(), Inkscape::UI::Dialog::DialogBase::getDocument(), SPDocument::getObjectByRepr(), SPDocument::getReprDoc(), parent, Inkscape::XML::Node::parent(), SPObject::requestDisplayUpdate(), set_dt_select(), set_tree_select(), SPDocument::setXMLDialogSelectedObject(), sp_repr_unparent(), and Inkscape::Util::trim().
Referenced by XmlTree().
|
private |
Definition at line 258 of file xml-tree.cpp.
References _tree_select_idle.
Referenced by documentReplaced(), and ~XmlTree().
|
private |
Is the selected tree node editable.
Definition at line 464 of file xml-tree.cpp.
References Inkscape::XML::Node::name(), node, parent, and Inkscape::XML::Node::parent().
Referenced by on_tree_select_row_enable().
|
private |
Definition at line 152 of file xml-tree.h.
|
private |
Definition at line 162 of file xml-tree.h.
|
private |
Definition at line 156 of file xml-tree.h.
Referenced by XmlTree().
|
private |
Definition at line 155 of file xml-tree.h.
Referenced by XmlTree().
|
private |
Definition at line 179 of file xml-tree.h.
Referenced by cmd_new_element_node(), and stopNodeEditing().
|
private |
Definition at line 175 of file xml-tree.h.
Referenced by XmlTree().
|
private |
Definition at line 178 of file xml-tree.h.
Referenced by XmlTree().
|
private |
Definition at line 180 of file xml-tree.h.
Referenced by cmd_new_element_node(), and stopNodeEditing().
|
private |
Definition at line 159 of file xml-tree.h.
Referenced by _resized(), and XmlTree().
|
private |
Definition at line 177 of file xml-tree.h.
Referenced by XmlTree().
|
private |
Callback for deferring the on_tree_select_row
response in order to skip invalid intermediate selection states.
In particular, gtk_tree_store_remove
makes an undesired selection that we will immediately revert and don't want to an early response for.
Definition at line 101 of file xml-tree.h.
Referenced by unsetDocument(), and XmlTree().
|
private |
Definition at line 150 of file xml-tree.h.
Referenced by cmd_duplicate_node(), cmd_new_element_node(), deferred_on_tree_select_row(), documentReplaced(), rebuildTree(), set_tree_select(), setSyntaxStyle(), stopNodeEditing(), and XmlTree().
|
private |
Definition at line 151 of file xml-tree.h.
Referenced by desktopReplaced(), propagate_tree_select(), and XmlTree().
|
private |
Flag to ensure only one operation is performed at once.
Definition at line 142 of file xml-tree.h.
Referenced by selectionChanged(), set_dt_select(), and XmlTree().
|
private |
Definition at line 158 of file xml-tree.h.
Referenced by onCreateNameChanged().
|
private |
Definition at line 169 of file xml-tree.h.
Referenced by on_tree_select_row_enable(), on_tree_unselect_row_disable(), and XmlTree().
|
private |
Definition at line 171 of file xml-tree.h.
Referenced by on_tree_select_row_enable(), on_tree_unselect_row_disable(), and XmlTree().
|
private |
Definition at line 157 of file xml-tree.h.
Referenced by onCreateNameChanged().
|
private |
Definition at line 170 of file xml-tree.h.
Referenced by on_tree_select_row_enable(), on_tree_unselect_row_disable(), and XmlTree().
|
private |
Signal handlers.
Definition at line 147 of file xml-tree.h.
Referenced by cmd_delete_node(), cmd_duplicate_node(), cmd_indent_node(), cmd_lower_node(), cmd_new_element_node(), cmd_new_text_node(), cmd_raise_node(), cmd_unindent_node(), deferred_on_tree_select_row(), and set_tree_select().
|
private |
Definition at line 163 of file xml-tree.h.
|
private |
Definition at line 168 of file xml-tree.h.
Referenced by on_tree_select_row_enable(), on_tree_unselect_row_disable(), and XmlTree().
|
private |
Definition at line 164 of file xml-tree.h.
Referenced by on_tree_select_row_enable(), on_tree_unselect_row_disable(), and XmlTree().
|
private |
Definition at line 166 of file xml-tree.h.
Referenced by on_tree_select_row_enable(), on_tree_unselect_row_disable(), and XmlTree().
|
private |
Definition at line 167 of file xml-tree.h.
Referenced by on_tree_select_row_enable(), on_tree_unselect_row_disable(), and XmlTree().
|
private |
Definition at line 165 of file xml-tree.h.
Referenced by on_tree_select_row_enable(), on_tree_unselect_row_disable(), and XmlTree().