Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
document-resources.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
8#ifndef SEEN_DOC_RESOURCES_H
9#define SEEN_DOC_RESOURCES_H
10
11#include <giomm/liststore.h>
12#include <gtkmm/gridview.h>
13#include <gtkmm/listview.h>
14#include <gtkmm/singleselection.h>
15#include <boost/ptr_container/ptr_vector.hpp>
16#include <gtkmm/treeview.h>
17
20#include "ui/text_filter.h"
22#include "ui/widget/registry.h"
23
24namespace Glib {
25class ustring;
26} // namespace Glib
27
28namespace Gtk {
29class Builder;
30class Button;
31class CellEditable;
32class CellRendererText;
33class ColumnView;
34class IconView;
35class ListStore;
36class SearchEntry2;
37class TreeSelection;
38class TreeView;
39} // namespace Gtk
40
41namespace Inkscape::UI::Dialog {
42
43namespace details {
44
45struct Statistics {
46 std::size_t nodes = 0;
47 std::size_t groups = 0;
48 std::size_t layers = 0;
49 std::size_t paths = 0;
50 std::size_t images = 0;
51 std::size_t patterns = 0;
52 std::size_t symbols = 0;
53 std::size_t markers = 0;
54 std::size_t fonts = 0;
55 std::size_t filters = 0;
56 std::size_t svg_fonts = 0;
57 std::size_t colors = 0;
58 std::size_t gradients = 0;
59 std::size_t swatches = 0;
60 std::size_t metadata = 0;
61 std::size_t styles = 0;
62 std::size_t meshgradients = 0;
63 std::size_t colorprofiles = 0;
64 std::size_t external_uris = 0;
65};
66
67struct ResourceItem;
68
69} // namespace details
70
71class DocumentResources final : public DialogBase {
72public:
74
75private:
76 void documentReplaced() override;
77 void select_page(const Glib::ustring& id);
78 void refresh_page(const Glib::ustring& id);
80 void rebuild_stats();
82 void end_editing(const Glib::ustring& path, const Glib::ustring& new_text);
83 void selectionModified(Inkscape::Selection *selection, unsigned flags) override;
84 void update_buttons();
85 std::shared_ptr<details::ResourceItem> selected_item();
86 void clear_stores();
87
88 Glib::RefPtr<Gtk::Builder> _builder;
89 Glib::RefPtr<Gio::ListStoreBase> _item_store;
90 Glib::RefPtr<Gtk::TreeModelFilter> _categories;
91 Glib::RefPtr<Gtk::BoolFilter> _info_filter;
92 std::unique_ptr<TextMatchingFilter> _item_filter;
93 Glib::RefPtr<Gio::ListStoreBase> _info_store;
94 Gtk::CellRendererPixbuf _image_renderer;
96 sigc::scoped_connection _selection_change;
98 std::string _cur_page_id; // the last category that user selected
99 int _showing_resource = -1; // ID of the resource that's currently presented
100 std::unique_ptr<IconViewItemFactory> _item_factory;
101 Gtk::GridView& _gridview;
102 Glib::RefPtr<Gtk::SingleSelection> _item_selection_model;
103 Gtk::ColumnView& _listview;
104 Gtk::ListView& _selector;
105 Gtk::Button& _edit;
106 Gtk::Button& _select;
107 Gtk::Button& _delete;
108 Gtk::Button& _extract;
109 Gtk::SearchEntry2& _search;
110 boost::ptr_vector<Inkscape::UI::Widget::EntityEntry> _rdf_list;
112 Gtk::CellRendererText* _label_renderer;
113 sigc::scoped_connection _document_modified;
114 sigc::scoped_connection _idle_refresh;
115 Glib::RefPtr<Gtk::BoolFilter> _filter;
116 Glib::RefPtr<Gtk::SingleSelection> _selection_model;
117};
118
119} // namespace Inkscape::UI::Dialog
120
121#endif // SEEN_DOC_RESOURCES_H
122
123/*
124 Local Variables:
125 mode:c++
126 c-file-style:"stroustrup"
127 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
128 indent-tabs-mode:nil
129 fill-column:99
130 End:
131*/
132// vim:filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99:
The set of selected SPObjects for a given document and layer model.
Definition selection.h:80
DialogBase is the base class for the dialog system.
Definition dialog-base.h:40
Glib::RefPtr< Gtk::SingleSelection > _item_selection_model
std::unique_ptr< IconViewItemFactory > _item_factory
Glib::RefPtr< Gtk::BoolFilter > _info_filter
Glib::RefPtr< Gtk::TreeModelFilter > _categories
std::shared_ptr< details::ResourceItem > selected_item()
void end_editing(const Glib::ustring &path, const Glib::ustring &new_text)
std::unique_ptr< TextMatchingFilter > _item_filter
boost::ptr_vector< Inkscape::UI::Widget::EntityEntry > _rdf_list
Glib::RefPtr< Gio::ListStoreBase > _item_store
void selectionModified(Inkscape::Selection *selection, unsigned flags) override
Glib::RefPtr< Gtk::BoolFilter > _filter
Glib::RefPtr< Gtk::SingleSelection > _selection_model
Glib::RefPtr< Gio::ListStoreBase > _info_store
Glib::RefPtr< Gtk::Builder > _builder
Typed SVG document implementation.
Definition document.h:101
A base class for all dialogs.
Definition desktop.h:50
Dialog code.
Definition desktop.h:117