16#ifndef SEEN_UI_DIALOG_STYLEDIALOG_H
17#define SEEN_UI_DIALOG_STYLEDIALOG_H
19#include <gtkmm/scrolledwindow.h>
20#include <gtkmm/treepath.h>
80 using AttrProp = std::map<Glib::ustring, Glib::ustring>;
118 class CSSData :
public Gtk::TreeModel::ColumnRecord {
129 Glib::RefPtr<Gtk::Adjustment>
_vadj;
138 Glib::ustring selector, Glib::ustring
const &new_selector = {});
142 void _addRow(Glib::RefPtr<Gtk::TreeStore>
const &
store, Gtk::TreeView *css_tree,
143 Glib::ustring
const &selector,
int pos);
145 void _onPropDelete(Glib::ustring
const &path, Glib::RefPtr<Gtk::TreeStore>
const &
store);
147 void _nameEdited(
const Glib::ustring &path,
const Glib::ustring &
name, Glib::RefPtr<Gtk::TreeStore>
store,
148 Gtk::TreeView *css_tree);
156 void _onLinkObj(Glib::ustring
const &path, Glib::RefPtr<Gtk::TreeStore>
const &
store);
158 void _valueEdited(
const Glib::ustring &path,
const Glib::ustring &value, Glib::RefPtr<Gtk::TreeStore>
store);
159 void _startNameEdit(Gtk::CellEditable *cell,
const Glib::ustring &path);
160 void _startValueEdit(Gtk::CellEditable *cell,
const Glib::ustring &path, Glib::RefPtr<Gtk::TreeStore>
store);
177 std::vector<SPObject *>
_getObjVec(Glib::ustring selector);
The set of selected SPObjects for a given document and layer model.
DialogBase is the base class for the dialog system.
Gtk::TreeModelColumn< Glib::ustring > _colCSSData
Gtk::TreeModelColumn< bool > _colActive
Gtk::TreeModelColumn< SPObject * > _colHref
Gtk::TreeModelColumn< bool > _colStrike
Gtk::TreeModelColumn< Glib::ustring > _colOwner
Gtk::TreeModelColumn< int > _colSelectorPos
Gtk::TreeModelColumn< Glib::ustring > _colSelector
Gtk::TreeModelColumn< Glib::ustring > _colValue
Gtk::TreeModelColumn< Glib::ustring > _colName
Gtk::TreeModelColumn< bool > _colLinked
The StyleDialog class A list of CSS selectors will show up in this dialog.
Inkscape::XML::Node * _textNode
Gtk::TreeModel::Path _current_path
Inkscape::XML::Node * _getStyleTextNode(bool create_if_missing=false)
Glib::ustring _current_selector
void _startValueEdit(Gtk::CellEditable *cell, const Glib::ustring &path, Glib::RefPtr< Gtk::TreeStore > store)
Gtk::TreeView * _current_css_tree
void _startNameEdit(Gtk::CellEditable *cell, const Glib::ustring &path)
void _setEditingEntry(Gtk::Entry *entry, Glib::ustring endChars)
std::unique_ptr< XML::NodeObserver > const m_nodewatcher
void _onTreeViewKeyReleased(unsigned keyval, unsigned keycode, Gdk::ModifierType state)
void documentReplaced() final
Handle document replaced.
void _writeStyleElement(Glib::RefPtr< Gtk::TreeStore > const &store, Glib::ustring selector, Glib::ustring const &new_selector={})
Update the content of the style element as selectors (or objects) are added/removed.
void readStyleElement()
Fill the Gtk::TreeStore from the svg:style element.
void _activeToggled(const Glib::ustring &path, Glib::RefPtr< Gtk::TreeStore > const &store)
StyleDialog()
Constructor A treeview and a set of two buttons are added to the dialog.
void _nameEdited(const Glib::ustring &path, const Glib::ustring &name, Glib::RefPtr< Gtk::TreeStore > store, Gtk::TreeView *css_tree)
StyleDialog::nameEdited.
void _setAutocompletion(Gtk::Entry *entry, SPStyleEnum const cssenum[])
void _nodeChanged(Inkscape::XML::Node &repr)
AttrProp parseStyle(Glib::ustring style_string)
StyleDialog::parseStyle.
Inkscape::XML::Node * m_root
Glib::RefPtr< Gtk::Adjustment > _vadj
void _onPropDelete(Glib::ustring const &path, Glib::RefPtr< Gtk::TreeStore > const &store)
StyleDialog::_onPropDelete.
void _closeDialog(Gtk::Dialog *textDialogPtr)
void setCurrentSelector(Glib::ustring current_selector)
void selectionChanged(Selection *selection) final
std::map< Glib::ustring, Glib::ustring > AttrProp
std::vector< SPObject * > _getObjVec(Glib::ustring selector)
void _valueEdited(const Glib::ustring &path, const Glib::ustring &value, Glib::RefPtr< Gtk::TreeStore > store)
StyleDialog::valueEdited.
Gtk::TreeViewColumn * _current_value_col
std::unique_ptr< XML::NodeObserver > const m_styletextwatcher
Gtk::ScrolledWindow _scrolledWindow
void _nodeAdded(Inkscape::XML::Node &repr)
void _onLinkObj(Glib::ustring const &path, Glib::RefPtr< Gtk::TreeStore > const &store)
bool _on_foreach_iter(const Gtk::TreeModel::iterator &iter)
Gtk::Entry * _editingEntry
void _nodeRemoved(Inkscape::XML::Node &repr)
void _onTreeViewFocusLeave()
void _addRow(Glib::RefPtr< Gtk::TreeStore > const &store, Gtk::TreeView *css_tree, Glib::ustring const &selector, int pos)
void _addTreeViewHandlers(Gtk::TreeView &treeview)
void _addOwnerStyle(Glib::ustring name, Glib::ustring selector)
Interface for refcounted XML nodes.
SPObject is an abstract base class of all of the document nodes at the SVG document level.
A base class for all dialogs.
XML::Node * get_first_style_text_node(XML::Node *root, bool create_if_missing)
Get the first <style> element's first text node.
Helper class to stream background task notifications as a series of messages.