Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
document-properties.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
6/* Authors:
7 * bulia byak <buliabyak@users.sf.net>
8 * Bryce W. Harrington <bryce@bryceharrington.org>
9 * Lauris Kaplinski <lauris@kaplinski.com>
10 * Jon Phillips <jon@rejon.org>
11 * Ralf Stephan <ralf@ark.in-berlin.de> (Gtkmm)
12 * Diederik van Lierop <mail@diedenrezi.nl>
13 * Jon A. Cruz <jon@joncruz.org>
14 * Abhishek Sharma
15 *
16 * Copyright (C) 2006-2008 Johan Engelen <johan@shouraizou.nl>
17 * Copyright (C) 2000 - 2008 Authors
18 *
19 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
20 */
21
22#ifndef INKSCAPE_UI_DIALOG_DOCUMENT_PREFERENCES_H
23#define INKSCAPE_UI_DIALOG_DOCUMENT_PREFERENCES_H
24
25#ifdef HAVE_CONFIG_H
26#include "config.h" // only include where actually required!
27#endif
28
29#include <gtkmm/listbox.h>
30#include <gtkmm/sizegroup.h>
31#include <gtkmm/combobox.h>
32#include <gtkmm/notebook.h>
33#include <gtkmm/scrolledwindow.h>
34#include <gtkmm/textview.h>
35#include "object/sp-grid.h"
39#include "ui/widget/licensor.h"
41#include "xml/helper-observer.h"
42
43
44namespace Glib {
45class ustring;
46} // namespace Glib
47
48namespace Gtk {
49class ListStore;
50} // namespace gtk
51
52namespace Inkscape {
53
54namespace XML { class Node; }
55
56namespace UI {
57
58namespace Widget {
59class EntityEntry;
60class NotebookPage;
61class PageProperties;
62} // namespace Widget
63
64namespace Dialog {
65
67{
68public:
70
71 void update_widgets();
73 static void destroy();
74
75 void documentReplaced() override;
76
77 void update() override;
78 void rebuild_gridspage();
79
80private:
81 void build_page();
82 void build_grid();
83 void build_guides();
84 void build_snap();
85 void build_gridspage();
86 void build_cms();
87 void build_scripting();
88 void build_metadata();
89 void add_grid_widget(SPGrid *grid);
92 virtual void on_response (int);
99 void addExternalScript();
101 void addEmbeddedScript();
107 void editEmbeddedScript();
113 void set_content_scale(SPDesktop *desktop, double scale_x);
114 void set_document_scale(SPDesktop* desktop, double scale_x);
115 void set_viewbox_pos(SPDesktop* desktop, double x, double y);
116 void set_viewbox_size(SPDesktop* desktop, double width, double height);
117
120 Gtk::Notebook _notebook;
121
126
127 Gtk::Notebook _scripting_notebook;
130
133
134 Gtk::Box _grids_vbox;
135
137 //---------------------------------------------------------------
144 //---------------------------------------------------------------
146 //---------------------------------------------------------------
147 Gtk::Button _unlink_btn;
148 class AvailableProfilesColumns : public Gtk::TreeModel::ColumnRecord
149 {
150 public:
153 Gtk::TreeModelColumn<Glib::ustring> fileColumn;
154 Gtk::TreeModelColumn<Glib::ustring> nameColumn;
155 Gtk::TreeModelColumn<bool> separatorColumn;
156 };
158 Glib::RefPtr<Gtk::ListStore> _AvailableProfilesListStore;
160 bool _AvailableProfilesList_separator(Glib::RefPtr<Gtk::TreeModel> const &model,
161 Gtk::TreeModel::const_iterator const &iter);
162 class LinkedProfilesColumns : public Gtk::TreeModel::ColumnRecord
163 {
164 public:
167 Gtk::TreeModelColumn<Glib::ustring> nameColumn;
168 Gtk::TreeModelColumn<Glib::ustring> previewColumn;
169 };
171 Glib::RefPtr<Gtk::ListStore> _LinkedProfilesListStore;
172 Gtk::TreeView _LinkedProfilesList;
173 Gtk::ScrolledWindow _LinkedProfilesListScroller;
174
175 //---------------------------------------------------------------
176 Gtk::Button _external_add_btn;
178 Gtk::Button _embed_new_btn;
179 Gtk::Button _embed_remove_btn;
181
182 class ExternalScriptsColumns : public Gtk::TreeModel::ColumnRecord
183 {
184 public:
187 Gtk::TreeModelColumn<Glib::ustring> filenameColumn;
188 };
190 class EmbeddedScriptsColumns : public Gtk::TreeModel::ColumnRecord
191 {
192 public:
195 Gtk::TreeModelColumn<Glib::ustring> idColumn;
196 };
198 Glib::RefPtr<Gtk::ListStore> _ExternalScriptsListStore;
199 Glib::RefPtr<Gtk::ListStore> _EmbeddedScriptsListStore;
200 Gtk::TreeView _ExternalScriptsList;
201 Gtk::TreeView _EmbeddedScriptsList;
202 Gtk::ScrolledWindow _ExternalScriptsListScroller;
203 Gtk::ScrolledWindow _EmbeddedScriptsListScroller;
204 Gtk::Entry _script_entry;
205 Gtk::TextView _EmbeddedContent;
206 Gtk::ScrolledWindow _EmbeddedContentScroller;
207 //---------------------------------------------------------------
208 Gtk::ScrolledWindow _grids_wnd;
209 Gtk::ListBox _grids_list;
210 Glib::RefPtr<Gtk::SizeGroup> _grids_unified_size = Gtk::SizeGroup::create(Gtk::SizeGroup::Mode::HORIZONTAL);
211 Gtk::Label _no_grids;
214 sigc::scoped_connection _on_idle_scroll;
216 //---------------------------------------------------------------
217
218 using RDFList = std::vector<std::unique_ptr<UI::Widget::EntityEntry>>;
221
222 Gtk::Box& _createPageTabLabel(const Glib::ustring& label, const char *label_image);
223
224private:
225 // callback methods for buttons on grids page.
226 void onNewGrid(GridType type);
227
228 // callback for display unit change
230
232 {
233 public:
235 : _dialog(dialog)
236 {}
237
238 ~WatchConnection() override { disconnect(); }
239
241 void disconnect();
242
243 private:
247 Util::ptr_shared new_value) final;
248
251 };
252
253 // nodes connected to listeners
256
257 sigc::scoped_connection _cms_connection;
258};
259
260} // namespace Dialog
261
262} // namespace UI
263
264} // namespace Inkscape
265
266#endif // INKSCAPE_UI_DIALOG_DOCUMENT_PREFERENCES_H
267
268/*
269 Local Variables:
270 mode:c++
271 c-file-style:"stroustrup"
272 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
273 indent-tabs-mode:nil
274 fill-column:99
275 End:
276*/
277// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
DialogBase is the base class for the dialog system.
Definition dialog-base.h:40
void notifyChildRemoved(XML::Node &node, XML::Node &child, XML::Node *prev) final
Child removal callback.
void notifyAttributeChanged(XML::Node &node, GQuark name, Util::ptr_shared old_value, Util::ptr_shared new_value) final
Attribute change callback.
void notifyChildAdded(XML::Node &node, XML::Node &child, XML::Node *prev) final
Child addition callback.
static DocumentProperties & getInstance()
UI::Widget::NotebookPage * _page_external_scripts
void set_viewbox_pos(SPDesktop *desktop, double x, double y)
Gtk::Box & _createPageTabLabel(const Glib::ustring &label, const char *label_image)
bool _AvailableProfilesList_separator(Glib::RefPtr< Gtk::TreeModel > const &model, Gtk::TreeModel::const_iterator const &iter)
UI::Widget::RegisteredColorPicker _rcp_hgui
void populate_available_profiles()
Populates the available color profiles combo box.
Glib::RefPtr< Gtk::ListStore > _LinkedProfilesListStore
std::vector< std::unique_ptr< UI::Widget::EntityEntry > > RDFList
Glib::RefPtr< Gtk::ListStore > _AvailableProfilesListStore
Glib::RefPtr< Gtk::ListStore > _ExternalScriptsListStore
void rebuild_gridspage()
Called for updating the dialog.
UI::Widget::RegisteredColorPicker _rcp_gui
UI::Widget::RegisteredCheckButton _rcb_lgui
void display_unit_change(const Inkscape::Util::Unit *unit)
Inkscape::UI::Widget::IconComboBox _grid_type
void set_document_scale(SPDesktop *desktop, double scale_x)
Glib::RefPtr< Gtk::ListStore > _EmbeddedScriptsListStore
void set_viewbox_size(SPDesktop *desktop, double width, double height)
void build_gridspage()
Build grid page of dialog.
void linkSelectedProfile()
Links the selected color profile in the combo box to the document.
void update() override
The update() method is essential to Gtk state management.
AvailableProfilesColumns _AvailableProfilesListColumns
UI::Widget::NotebookPage * _page_embedded_scripts
Glib::RefPtr< Gtk::SizeGroup > _grids_unified_size
Inkscape::XML::SignalObserver _scripts_observer
void set_content_scale(SPDesktop *desktop, double scale_x)
void update_widgets()
Update dialog widgets from desktop.
UI::Widget::RegisteredCheckButton _rcb_sgui
Widget for specifying a document's license; part of document preferences dialog.
Definition licensor.h:44
A tabbed notebook page for dialogs.
Holds a single child widget while allowing a single popover to be displayed over it.
Definition popover-bin.h:19
Interface for XML node observers.
Interface for refcounted XML nodes.
Definition node.h:80
To do: update description of desktop.
Definition desktop.h:149
A base class for all dialogs.
TODO: insert short description here.
Inkscape::XML::Node * node
Widget for specifying a document's license; part of document preferences dialog.
Glib::ustring label
Definition desktop.h:50
static constexpr int height
Helper class to stream background task notifications as a series of messages.
Ocnode * child[8]
Definition quantize.cpp:33
GridType
Definition sp-grid.h:42
guint32 GQuark
double width
Glib::ustring name
Definition toolbars.cpp:55