Inkscape
Vector Graphics Editor
|
The Find class defines the Find and replace dialog. More...
#include <find.h>
Public Member Functions | |
Find () | |
~Find () override | |
void | desktopReplaced () override |
Called when the desktop has certainly changed. | |
void | selectionChanged (Selection *selection) override |
![]() | |
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 |
Protected Member Functions | |
void | onFind () |
Callbacks for pressing the dialog buttons. | |
void | onReplace () |
void | onExpander () |
void | onAction () |
void | onToggleAlltypes () |
void | onToggleCheck () |
void | onSearchinText () |
void | onSearchinProperty () |
void | searchinToggle (bool on) |
Toggle all the properties checkboxes. | |
bool | item_id_match (SPItem *item, const gchar *id, bool exact, bool casematch, bool replace=false) |
Returns true if the SPItem 'item' has the same id. | |
bool | item_text_match (SPItem *item, const gchar *text, bool exact, bool casematch, bool replace=false) |
Returns true if the SPItem 'item' has the same text content. | |
bool | item_style_match (SPItem *item, const gchar *text, bool exact, bool casematch, bool replace=false) |
Returns true if the SPItem 'item' has the same text in the style attribute. | |
bool | item_desc_match (SPItem *item, const gchar *text, bool exact, bool casematch, bool replace=false) |
Returns true if the SPItem 'item' has a <title> or <desc> child that matches. | |
bool | item_title_match (SPItem *item, const gchar *text, bool exact, bool casematch, bool replace=false) |
bool | item_attr_match (SPItem *item, const gchar *name, bool exact, bool casematch, bool replace=false) |
Returns true if found the SPItem 'item' has the same attribute name. | |
bool | item_attrvalue_match (SPItem *item, const gchar *name, bool exact, bool casematch, bool replace=false) |
Returns true if the SPItem 'item' has the same attribute value. | |
bool | item_font_match (SPItem *item, const gchar *name, bool exact, bool casematch, bool replace=false) |
Returns true if the SPItem 'item' has the same font values. | |
std::vector< SPItem * > | filter_fields (std::vector< SPItem * > &l, bool exact, bool casematch) |
Function to filter a list of items based on the item type by calling each item_XXX_match function. | |
bool | item_type_match (SPItem *item) |
std::vector< SPItem * > | filter_types (std::vector< SPItem * > &l) |
std::vector< SPItem * > & | filter_list (std::vector< SPItem * > &l, bool exact, bool casematch) |
bool | find_strcmp (const gchar *str, const gchar *find, bool exact, bool casematch) |
Find a string within a string and returns true if found with options for exact and casematching. | |
gsize | find_strcmp_pos (const gchar *str, const gchar *find, bool exact, bool casematch, gsize start=0) |
Find a string within a string and return the position with options for exact, casematching and search start location. | |
Glib::ustring | find_replace (const gchar *str, const gchar *find, const gchar *replace, bool exact, bool casematch, bool replaceall) |
Replace a string with another string with options for exact and casematching and replace once/all. | |
std::vector< SPItem * > & | all_items (SPObject *r, std::vector< SPItem * > &l, bool hidden, bool locked) |
recursive function to return a list of all the items in the SPObject tree | |
std::vector< SPItem * > & | all_selection_items (Inkscape::Selection *s, std::vector< SPItem * > &l, SPObject *ancestor, bool hidden, bool locked) |
to return a list of all the selected items | |
void | squeeze_window () |
Shrink the dialog size when the expander widget is closed Currently not working, no known way to do this. | |
![]() | |
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 | |
Private Attributes | |
UI::Widget::Entry | entry_find |
UI::Widget::Entry | entry_replace |
Glib::RefPtr< Gtk::SizeGroup > | label_group |
Gtk::CheckButton | check_scope_all |
Scope and search in widgets. | |
Gtk::CheckButton | check_scope_layer |
Gtk::CheckButton | check_scope_selection |
Gtk::CheckButton | check_searchin_text |
Gtk::CheckButton | check_searchin_property |
Gtk::Box | hbox_searchin |
Gtk::Box | vbox_scope |
Gtk::Box | vbox_searchin |
UI::Widget::Frame | frame_searchin |
UI::Widget::Frame | frame_scope |
Gtk::CheckButton | check_case_sensitive |
General option widgets. | |
Gtk::CheckButton | check_exact_match |
Gtk::CheckButton | check_include_hidden |
Gtk::CheckButton | check_include_locked |
Gtk::Box | vbox_options1 |
Gtk::Box | vbox_options2 |
Gtk::Box | hbox_options |
Gtk::Box | vbox_expander |
Gtk::Expander | expander_options |
UI::Widget::Frame | frame_options |
Gtk::CheckButton | check_ids |
Property type widgets. | |
Gtk::CheckButton | check_attributename |
Gtk::CheckButton | check_attributevalue |
Gtk::CheckButton | check_style |
Gtk::CheckButton | check_font |
Gtk::CheckButton | check_desc |
Gtk::CheckButton | check_title |
Gtk::Box | hbox_properties |
Gtk::Box | vbox_properties1 |
Gtk::Box | vbox_properties2 |
UI::Widget::Frame | frame_properties |
std::vector< Gtk::CheckButton * > | checkProperties |
A vector of all the properties widgets for easy processing. | |
Gtk::CheckButton | check_alltypes |
Object type widgets. | |
Gtk::CheckButton | check_rects |
Gtk::CheckButton | check_ellipses |
Gtk::CheckButton | check_stars |
Gtk::CheckButton | check_spirals |
Gtk::CheckButton | check_paths |
Gtk::CheckButton | check_texts |
Gtk::CheckButton | check_groups |
Gtk::CheckButton | check_clones |
Gtk::CheckButton | check_images |
Gtk::CheckButton | check_offsets |
Gtk::Box | vbox_types1 |
Gtk::Box | vbox_types2 |
Gtk::Box | hbox_types |
UI::Widget::Frame | frame_types |
Glib::RefPtr< Gtk::SizeGroup > | _left_size_group |
Glib::RefPtr< Gtk::SizeGroup > | _right_size_group |
std::vector< Gtk::CheckButton * > | checkTypes |
A vector of all the check option widgets for easy processing. | |
Gtk::Label | status |
Action Buttons and status. | |
Gtk::Button | button_find |
Gtk::Button | button_replace |
Gtk::Box | box_buttons |
Gtk::Box | hboxbutton_row |
bool | _action_replace |
Finding or replacing. | |
bool | blocked |
Additional Inherited Members | |
![]() | |
Glib::ustring | _name |
Glib::ustring const | _prefs_path |
Glib::ustring const | _dialog_type |
The Find class defines the Find and replace dialog.
The Find and replace dialog allows you to search within the current document for specific text or properties of items. Matches items are highlighted and can be replaced as well. Scope can be limited to the entire document, current layer or selected items. Other options allow searching on specific object types and properties.
Inkscape::UI::Dialog::Find::Find | ( | ) |
Definition at line 50 of file find.cpp.
References _left_size_group, _right_size_group, box_buttons, button_find, button_replace, check_alltypes, check_attributename, check_attributevalue, check_case_sensitive, check_clones, check_desc, check_ellipses, check_exact_match, check_font, check_groups, check_ids, check_images, check_include_hidden, check_include_locked, check_offsets, check_paths, check_rects, check_scope_all, check_scope_layer, check_scope_selection, check_searchin_property, check_searchin_text, check_spirals, check_stars, check_style, check_texts, check_title, checkProperties, checkTypes, entry_find, entry_replace, expander_options, frame_options, frame_properties, frame_scope, frame_searchin, frame_types, Inkscape::UI::Widget::Entry::getEntry(), Inkscape::UI::Widget::Labelled::getLabel(), hbox_options, hbox_properties, hbox_searchin, hbox_types, hboxbutton_row, label_group, onExpander(), onFind(), onReplace(), onSearchinProperty(), onSearchinText(), onToggleAlltypes(), onToggleCheck(), Inkscape::UI::pack_end(), Inkscape::UI::pack_start(), Inkscape::UI::shrink, status, vbox_expander, vbox_options1, vbox_options2, vbox_properties1, vbox_properties2, vbox_scope, vbox_searchin, vbox_types1, and vbox_types2.
|
overridedefault |
|
protected |
recursive function to return a list of all the items in the SPObject tree
Definition at line 891 of file find.cpp.
References all_items(), child, SPObject::children, SPObject::cloned, Inkscape::UI::Dialog::DialogBase::desktop, Inkscape::UI::Dialog::DialogBase::getDesktop(), SPObject::getRepr(), Inkscape::LayerManager::isLayer(), SPItem::isLocked(), item, SPDesktop::itemIsHidden(), SPDesktop::layerManager(), and Inkscape::XML::Node::name().
Referenced by all_items(), all_selection_items(), and onAction().
|
protected |
to return a list of all the selected items
Definition at line 914 of file find.cpp.
References all_items(), SPObject::cloned, Inkscape::UI::Dialog::DialogBase::desktop, Inkscape::UI::Dialog::DialogBase::getDesktop(), SPObject::isAncestorOf(), Inkscape::LayerManager::isLayer(), SPItem::isLocked(), item, SPDesktop::itemIsHidden(), Inkscape::ObjectSet::items(), and SPDesktop::layerManager().
Referenced by onAction().
|
overridevirtual |
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 372 of file find.cpp.
References entry_find, Inkscape::UI::Widget::Entry::getEntry(), Inkscape::UI::Dialog::DialogBase::getSelection(), item, Inkscape::UI::Dialog::DialogBase::selection, Inkscape::ObjectSet::singleItem(), and sp_te_get_string_multiline().
|
protected |
Function to filter a list of items based on the item type by calling each item_XXX_match function.
Definition at line 670 of file find.cpp.
References _action_replace, check_attributename, check_attributevalue, check_desc, check_font, check_ids, check_searchin_property, check_searchin_text, check_style, check_title, entry_find, Inkscape::UI::Widget::Entry::getEntry(), item, item_attr_match(), item_attrvalue_match(), item_desc_match(), item_font_match(), item_id_match(), item_style_match(), item_text_match(), and item_title_match().
Referenced by filter_list().
|
protected |
Definition at line 884 of file find.cpp.
References filter_fields(), and filter_types().
Referenced by onAction().
|
protected |
Definition at line 869 of file find.cpp.
References item, and item_type_match().
Referenced by filter_list().
|
protected |
Replace a string with another string with options for exact and casematching and replace once/all.
Definition at line 396 of file find.cpp.
References find_strcmp_pos().
Referenced by item_attrvalue_match(), item_desc_match(), item_font_match(), item_id_match(), item_style_match(), and item_title_match().
|
protected |
Find a string within a string and returns true if found with options for exact and casematching.
Definition at line 439 of file find.cpp.
References find_strcmp_pos().
Referenced by item_attrvalue_match(), item_desc_match(), item_font_match(), item_id_match(), item_style_match(), item_text_match(), and item_title_match().
|
protected |
Find a string within a string and return the position with options for exact, casematching and search start location.
Definition at line 416 of file find.cpp.
References Inkscape::UI::start.
Referenced by find_replace(), find_strcmp(), and item_text_match().
|
protected |
Returns true if found the SPItem 'item' has the same attribute name.
item | the SPItem to check |
name | the value to compare with |
exact | do an exact match |
casematch | match the text case exactly |
replace | replace the value if found |
Definition at line 560 of file find.cpp.
References Inkscape::XML::Node::attribute(), SPObject::getRepr(), item, and Inkscape::XML::Node::matchAttributeName().
Referenced by filter_fields().
|
protected |
Returns true if the SPItem 'item' has the same attribute value.
item | the SPItem to check |
name | the value to compare with |
exact | do an exact match |
casematch | match the text case exactly |
replace | replace the value if found |
Definition at line 584 of file find.cpp.
References Inkscape::XML::Node::attribute(), Inkscape::XML::Node::attributeList(), entry_replace, find_replace(), find_strcmp(), Inkscape::UI::Widget::Entry::getEntry(), SPObject::getRepr(), item, key, and SPObject::setAttribute().
Referenced by filter_fields().
|
protected |
Returns true if the SPItem 'item' has a <title> or <desc> child that matches.
item | the SPItem to check |
name | the value to compare with |
exact | do an exact match |
casematch | match the text case exactly |
replace | replace the value if found |
Definition at line 444 of file find.cpp.
References SPObject::desc(), entry_replace, find_replace(), find_strcmp(), Inkscape::UI::Widget::Entry::getEntry(), item, and SPObject::setDesc().
Referenced by filter_fields().
|
protected |
Returns true if the SPItem 'item' has the same font values.
item | the SPItem to check |
name | the value to compare with |
exact | do an exact match |
casematch | match the text case exactly |
replace | replace the value if found |
Definition at line 615 of file find.cpp.
References _action_replace, Inkscape::XML::Node::attribute(), entry_replace, find_replace(), find_strcmp(), Inkscape::UI::Widget::Entry::getEntry(), SPObject::getRepr(), item, and SPObject::setAttribute().
Referenced by filter_fields().
|
protected |
Returns true if the SPItem 'item' has the same id.
item | the SPItem to check |
id | the value to compare with |
exact | do an exact match |
casematch | match the text case exactly |
replace | replace the value if found |
Definition at line 509 of file find.cpp.
References Inkscape::XML::Node::attribute(), entry_replace, find_replace(), find_strcmp(), Inkscape::UI::Widget::Entry::getEntry(), SPObject::getRepr(), item, and SPObject::setAttribute().
Referenced by filter_fields().
|
protected |
Returns true if the SPItem 'item' has the same text in the style attribute.
item | the SPItem to check |
name | the value to compare with |
exact | do an exact match |
casematch | match the text case exactly |
replace | replace the value if found |
Definition at line 534 of file find.cpp.
References Inkscape::XML::Node::attribute(), entry_replace, find_replace(), find_strcmp(), Inkscape::UI::Widget::Entry::getEntry(), SPObject::getRepr(), item, and SPObject::setAttribute().
Referenced by filter_fields().
|
protected |
Returns true if the SPItem 'item' has the same text content.
item | the SPItem to check |
name | the value to compare with |
exact | do an exact match |
casematch | match the text case exactly |
replace | replace the value if found |
Definition at line 468 of file find.cpp.
References Inkscape::Text::Layout::charIndexToIterator(), entry_replace, find_strcmp(), find_strcmp_pos(), Inkscape::UI::Widget::Entry::getEntry(), SPObject::getRepr(), item, sp_te_get_string_multiline(), sp_te_replace(), and te_get_layout().
Referenced by filter_fields().
|
protected |
Definition at line 456 of file find.cpp.
References entry_replace, find_replace(), find_strcmp(), Inkscape::UI::Widget::Entry::getEntry(), item, SPObject::setTitle(), and SPObject::title().
Referenced by filter_fields().
|
protected |
Definition at line 827 of file find.cpp.
References check_alltypes, check_clones, check_ellipses, check_groups, check_images, check_offsets, check_paths, check_rects, check_spirals, check_stars, check_texts, Inkscape::UI::Dialog::DialogBase::getDesktop(), and item.
Referenced by filter_types().
|
protected |
Definition at line 964 of file find.cpp.
References _action_replace, all_items(), all_selection_items(), blocked, button_replace, check_attributename, check_case_sensitive, check_exact_match, check_include_hidden, check_include_locked, check_scope_layer, check_scope_selection, Inkscape::ObjectSet::clear(), Inkscape::LayerManager::currentLayer(), Inkscape::UI::Dialog::DialogBase::desktop, Inkscape::DocumentUndo::done(), filter_list(), Inkscape::MessageStack::flash(), Inkscape::MessageStack::flashF(), Inkscape::UI::Dialog::DialogBase::getDesktop(), SPDesktop::getDocument(), SPDocument::getRoot(), SPDesktop::getSelection(), item, SPDesktop::layerManager(), SPDesktop::messageStack(), Inkscape::NORMAL_MESSAGE, scroll_to_show_item(), Inkscape::UI::Dialog::DialogBase::selection, Inkscape::ObjectSet::setList(), status, and Inkscape::WARNING_MESSAGE.
Referenced by onFind(), and onReplace().
|
protected |
Definition at line 1107 of file find.cpp.
References expander_options, and squeeze_window().
Referenced by Find().
|
protected |
Callbacks for pressing the dialog buttons.
Definition at line 942 of file find.cpp.
References _action_replace, entry_find, Inkscape::UI::Widget::Entry::getEntry(), and onAction().
Referenced by Find().
|
protected |
Definition at line 951 of file find.cpp.
References _action_replace, entry_find, Inkscape::UI::Widget::Entry::getEntry(), onAction(), and status.
Referenced by Find().
|
protected |
Definition at line 1094 of file find.cpp.
References onToggleCheck(), and searchinToggle().
Referenced by Find().
|
protected |
Definition at line 1088 of file find.cpp.
References onToggleCheck(), and searchinToggle().
Referenced by Find().
|
protected |
Definition at line 1078 of file find.cpp.
References check_alltypes, checkTypes, and onToggleCheck().
Referenced by Find().
|
protected |
Definition at line 1034 of file find.cpp.
References button_find, button_replace, check_alltypes, check_searchin_property, checkProperties, checkTypes, and status.
Referenced by Find(), onSearchinProperty(), onSearchinText(), and onToggleAlltypes().
|
protected |
Toggle all the properties checkboxes.
Definition at line 1100 of file find.cpp.
References checkProperties.
Referenced by onSearchinProperty(), and onSearchinText().
|
overridevirtual |
Reimplemented from Inkscape::UI::Dialog::DialogBase.
|
protected |
Shrink the dialog size when the expander widget is closed Currently not working, no known way to do this.
Definition at line 1117 of file find.cpp.
Referenced by onExpander().
|
private |
Finding or replacing.
Definition at line 291 of file find.h.
Referenced by filter_fields(), item_font_match(), onAction(), onFind(), and onReplace().
|
private |
|
private |
|
private |
Definition at line 292 of file find.h.
Referenced by onAction(), and selectionChanged().
|
private |
|
private |
Definition at line 283 of file find.h.
Referenced by Find(), and onToggleCheck().
|
private |
Definition at line 284 of file find.h.
Referenced by Find(), onAction(), and onToggleCheck().
|
private |
Object type widgets.
Definition at line 253 of file find.h.
Referenced by Find(), item_type_match(), onToggleAlltypes(), and onToggleCheck().
|
private |
Definition at line 234 of file find.h.
Referenced by filter_fields(), Find(), and onAction().
|
private |
Definition at line 235 of file find.h.
Referenced by filter_fields(), and Find().
|
private |
General option widgets.
Definition at line 219 of file find.h.
Referenced by Find(), and onAction().
|
private |
Definition at line 261 of file find.h.
Referenced by Find(), and item_type_match().
|
private |
Definition at line 238 of file find.h.
Referenced by filter_fields(), and Find().
|
private |
Definition at line 255 of file find.h.
Referenced by Find(), and item_type_match().
|
private |
Definition at line 220 of file find.h.
Referenced by Find(), and onAction().
|
private |
Definition at line 237 of file find.h.
Referenced by filter_fields(), and Find().
|
private |
Definition at line 260 of file find.h.
Referenced by Find(), and item_type_match().
|
private |
Property type widgets.
Definition at line 233 of file find.h.
Referenced by filter_fields(), and Find().
|
private |
Definition at line 262 of file find.h.
Referenced by Find(), and item_type_match().
|
private |
Definition at line 221 of file find.h.
Referenced by Find(), and onAction().
|
private |
Definition at line 222 of file find.h.
Referenced by Find(), and onAction().
|
private |
Definition at line 263 of file find.h.
Referenced by Find(), and item_type_match().
|
private |
Definition at line 258 of file find.h.
Referenced by Find(), and item_type_match().
|
private |
Definition at line 254 of file find.h.
Referenced by Find(), and item_type_match().
|
private |
|
private |
Definition at line 206 of file find.h.
Referenced by Find(), and onAction().
|
private |
Definition at line 207 of file find.h.
Referenced by Find(), and onAction().
|
private |
Definition at line 209 of file find.h.
Referenced by filter_fields(), Find(), and onToggleCheck().
|
private |
Definition at line 208 of file find.h.
Referenced by filter_fields(), and Find().
|
private |
Definition at line 257 of file find.h.
Referenced by Find(), and item_type_match().
|
private |
Definition at line 256 of file find.h.
Referenced by Find(), and item_type_match().
|
private |
Definition at line 236 of file find.h.
Referenced by filter_fields(), and Find().
|
private |
Definition at line 259 of file find.h.
Referenced by Find(), and item_type_match().
|
private |
Definition at line 239 of file find.h.
Referenced by filter_fields(), and Find().
|
private |
A vector of all the properties widgets for easy processing.
Definition at line 248 of file find.h.
Referenced by Find(), onToggleCheck(), and searchinToggle().
|
private |
A vector of all the check option widgets for easy processing.
Definition at line 275 of file find.h.
Referenced by Find(), onToggleAlltypes(), and onToggleCheck().
|
private |
Definition at line 198 of file find.h.
Referenced by desktopReplaced(), filter_fields(), Find(), onFind(), and onReplace().
|
private |
Definition at line 199 of file find.h.
Referenced by Find(), item_attrvalue_match(), item_desc_match(), item_font_match(), item_id_match(), item_style_match(), item_text_match(), and item_title_match().
|
private |
Definition at line 227 of file find.h.
Referenced by Find(), and onExpander().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Action Buttons and status.
Definition at line 282 of file find.h.
Referenced by Find(), onAction(), onReplace(), onToggleCheck(), and selectionChanged().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |