blob: 8b4e0883233c67ff4f0e3f371c1f9ce20529198d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
|
// SPDX-License-Identifier: GPL-2.0-or-later
/** \file
* \brief Document Properties dialog
*/
/* Authors:
* Ralf Stephan <ralf@ark.in-berlin.de>
* Bryce W. Harrington <bryce@bryceharrington.org>
*
* Copyright (C) 2006-2008 Johan Engelen <johan@shouraizou.nl>
* Copyright (C) 2004, 2005 Authors
*
* Released under GNU GPL v2+, read the file 'COPYING' for more information.
*/
#ifndef INKSCAPE_UI_DIALOG_DOCUMENT_PREFERENCES_H
#define INKSCAPE_UI_DIALOG_DOCUMENT_PREFERENCES_H
#ifdef HAVE_CONFIG_H
# include "config.h" // only include where actually required!
#endif
#include <cstddef>
#include <sigc++/sigc++.h>
#include <gtkmm/comboboxtext.h>
#include <gtkmm/liststore.h>
#include <gtkmm/notebook.h>
#include <gtkmm/buttonbox.h>
#include <gtkmm/textview.h>
#include "ui/widget/page-sizer.h"
#include "ui/widget/registered-widget.h"
#include "ui/widget/registry.h"
#include "ui/widget/tolerance-slider.h"
#include "ui/widget/panel.h"
#include "ui/widget/licensor.h"
#include "xml/helper-observer.h"
namespace Inkscape {
namespace XML {
class Node;
}
namespace UI {
namespace Widget {
class EntityEntry;
class NotebookPage;
}
namespace Dialog {
typedef std::list<UI::Widget::EntityEntry*> RDElist;
class DocumentProperties : public UI::Widget::Panel {
public:
void update();
static DocumentProperties &getInstance();
static void destroy();
void update_gridspage();
protected:
void build_page();
void build_grid();
void build_guides();
void build_snap();
void build_gridspage();
void create_guides_around_page();
void delete_all_guides();
#if defined(HAVE_LIBLCMS2)
void build_cms();
#endif // defined(HAVE_LIBLCMS2)
void build_scripting();
void build_metadata();
void init();
virtual void on_response (int);
#if defined(HAVE_LIBLCMS2)
void populate_available_profiles();
void populate_linked_profiles_box();
void linkSelectedProfile();
void removeSelectedProfile();
void onColorProfileSelectRow();
void linked_profiles_list_button_release(GdkEventButton* event);
void cms_create_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem);
#endif // defined(HAVE_LIBLCMS2)
void external_scripts_list_button_release(GdkEventButton* event);
void embedded_scripts_list_button_release(GdkEventButton* event);
void populate_script_lists();
void addExternalScript();
void browseExternalScript();
void addEmbeddedScript();
void removeExternalScript();
void removeEmbeddedScript();
void changeEmbeddedScript();
void onExternalScriptSelectRow();
void onEmbeddedScriptSelectRow();
void editEmbeddedScript();
void external_create_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem);
void embedded_create_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem);
void load_default_metadata();
void save_default_metadata();
void _handleDocumentReplaced(SPDesktop* desktop, SPDocument *document);
void _handleActivateDesktop(SPDesktop *desktop);
void _handleDeactivateDesktop(SPDesktop *desktop);
Inkscape::XML::SignalObserver _emb_profiles_observer, _scripts_observer;
Gtk::Notebook _notebook;
UI::Widget::NotebookPage *_page_page;
UI::Widget::NotebookPage *_page_guides;
UI::Widget::NotebookPage *_page_snap;
UI::Widget::NotebookPage *_page_cms;
UI::Widget::NotebookPage *_page_scripting;
Gtk::Notebook _scripting_notebook;
UI::Widget::NotebookPage *_page_external_scripts;
UI::Widget::NotebookPage *_page_embedded_scripts;
UI::Widget::NotebookPage *_page_metadata1;
UI::Widget::NotebookPage *_page_metadata2;
Gtk::VBox _grids_vbox;
UI::Widget::Registry _wr;
//---------------------------------------------------------------
Gtk::Grid _rcb_doc_props_left;
Gtk::Grid _rcb_doc_props_right;
UI::Widget::RegisteredCheckButton _rcb_antialias;
UI::Widget::RegisteredCheckButton _rcb_checkerboard;
UI::Widget::RegisteredCheckButton _rcb_canb;
UI::Widget::RegisteredCheckButton _rcb_bord;
UI::Widget::RegisteredCheckButton _rcb_shad;
UI::Widget::RegisteredColorPicker _rcp_bg;
UI::Widget::RegisteredColorPicker _rcp_bord;
UI::Widget::RegisteredUnitMenu _rum_deflt;
UI::Widget::PageSizer _page_sizer;
//---------------------------------------------------------------
UI::Widget::RegisteredCheckButton _rcb_sgui;
UI::Widget::RegisteredCheckButton _rcb_lgui;
UI::Widget::RegisteredColorPicker _rcp_gui;
UI::Widget::RegisteredColorPicker _rcp_hgui;
Gtk::Button _create_guides_btn;
Gtk::Button _delete_guides_btn;
//---------------------------------------------------------------
UI::Widget::ToleranceSlider _rsu_sno;
UI::Widget::ToleranceSlider _rsu_sn;
UI::Widget::ToleranceSlider _rsu_gusn;
UI::Widget::RegisteredCheckButton _rcb_snclp;
UI::Widget::RegisteredCheckButton _rcb_snmsk;
UI::Widget::RegisteredCheckButton _rcb_perp;
UI::Widget::RegisteredCheckButton _rcb_tang;
//---------------------------------------------------------------
Gtk::Button _link_btn;
Gtk::Button _unlink_btn;
class AvailableProfilesColumns : public Gtk::TreeModel::ColumnRecord
{
public:
AvailableProfilesColumns()
{ add(fileColumn); add(nameColumn); add(separatorColumn); }
Gtk::TreeModelColumn<Glib::ustring> fileColumn;
Gtk::TreeModelColumn<Glib::ustring> nameColumn;
Gtk::TreeModelColumn<bool> separatorColumn;
};
AvailableProfilesColumns _AvailableProfilesListColumns;
Glib::RefPtr<Gtk::ListStore> _AvailableProfilesListStore;
Gtk::ComboBox _AvailableProfilesList;
bool _AvailableProfilesList_separator(const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::iterator& iter);
class LinkedProfilesColumns : public Gtk::TreeModel::ColumnRecord
{
public:
LinkedProfilesColumns()
{ add(nameColumn); add(previewColumn); }
Gtk::TreeModelColumn<Glib::ustring> nameColumn;
Gtk::TreeModelColumn<Glib::ustring> previewColumn;
};
LinkedProfilesColumns _LinkedProfilesListColumns;
Glib::RefPtr<Gtk::ListStore> _LinkedProfilesListStore;
Gtk::TreeView _LinkedProfilesList;
Gtk::ScrolledWindow _LinkedProfilesListScroller;
Gtk::Menu _EmbProfContextMenu;
//---------------------------------------------------------------
Gtk::Button _external_add_btn;
Gtk::Button _external_remove_btn;
Gtk::Button _embed_new_btn;
Gtk::Button _embed_remove_btn;
Gtk::ButtonBox _embed_button_box;
class ExternalScriptsColumns : public Gtk::TreeModel::ColumnRecord
{
public:
ExternalScriptsColumns()
{ add(filenameColumn); }
Gtk::TreeModelColumn<Glib::ustring> filenameColumn;
};
ExternalScriptsColumns _ExternalScriptsListColumns;
class EmbeddedScriptsColumns : public Gtk::TreeModel::ColumnRecord
{
public:
EmbeddedScriptsColumns()
{ add(idColumn); }
Gtk::TreeModelColumn<Glib::ustring> idColumn;
};
EmbeddedScriptsColumns _EmbeddedScriptsListColumns;
Glib::RefPtr<Gtk::ListStore> _ExternalScriptsListStore;
Glib::RefPtr<Gtk::ListStore> _EmbeddedScriptsListStore;
Gtk::TreeView _ExternalScriptsList;
Gtk::TreeView _EmbeddedScriptsList;
Gtk::ScrolledWindow _ExternalScriptsListScroller;
Gtk::ScrolledWindow _EmbeddedScriptsListScroller;
Gtk::Menu _ExternalScriptsContextMenu;
Gtk::Menu _EmbeddedScriptsContextMenu;
Gtk::Entry _script_entry;
Gtk::TextView _EmbeddedContent;
Gtk::ScrolledWindow _EmbeddedContentScroller;
//---------------------------------------------------------------
Gtk::Notebook _grids_notebook;
Gtk::HBox _grids_hbox_crea;
Gtk::Label _grids_label_crea;
Gtk::Button _grids_button_new;
Gtk::Button _grids_button_remove;
Gtk::ComboBoxText _grids_combo_gridtype;
Gtk::Label _grids_label_def;
Gtk::HBox _grids_space;
//---------------------------------------------------------------
RDElist _rdflist;
UI::Widget::Licensor _licensor;
Gtk::HBox& _createPageTabLabel(const Glib::ustring& label, const char *label_image);
private:
DocumentProperties();
~DocumentProperties() override;
// callback methods for buttons on grids page.
void onNewGrid();
void onRemoveGrid();
// callback for document unit change
void onDocUnitChange();
};
} // namespace Dialog
} // namespace UI
} // namespace Inkscape
#endif // INKSCAPE_UI_DIALOG_DOCUMENT_PREFERENCES_H
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
|