summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/inkscape-preferences.h
blob: 7bcbe7d498c9b7554278db642457d509fdfcf3ec (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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
/** @file
 * @brief Inkscape Preferences dialog
 */
/* Authors:
 *   Carl Hetherington
 *   Marco Scholten
 *   Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
 *   Bruno Dilly <bruno.dilly@gmail.com>
 *
 * Copyright (C) 2004-2007 Authors
 *
 * Released under GNU GPL.  Read the file 'COPYING' for more information.
 */

#ifndef INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
#define INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H

#include <iostream>
#include <vector>
#include <gtkmm/base.h>
#include <gtkmm/table.h>
#include <gtkmm/colorbutton.h>
#include <gtkmm/comboboxtext.h>
#include <gtkmm/spinbutton.h>
#include <gtkmm/treestore.h>
#include <gtkmm/treeview.h>
#include <gtkmm/radiobutton.h>
#include <gtkmm/frame.h>
#include <gtkmm/notebook.h>
#include "ui/widget/preferences-widget.h"
#include <sigc++/sigc++.h>
#include <glibmm/i18n.h>
#include <gtkmm/textview.h>
#include <gtkmm/scrolledwindow.h>

#include "ui/widget/panel.h"

// UPDATE THIS IF YOU'RE ADDING PREFS PAGES.
// Otherwise the commands that open the dialog with the new page will fail.

enum {
    PREFS_PAGE_TOOLS,
    PREFS_PAGE_TOOLS_SELECTOR,
    PREFS_PAGE_TOOLS_NODE,
    PREFS_PAGE_TOOLS_TWEAK,
    PREFS_PAGE_TOOLS_ZOOM,
    PREFS_PAGE_TOOLS_SHAPES,
    PREFS_PAGE_TOOLS_SHAPES_RECT,
    PREFS_PAGE_TOOLS_SHAPES_3DBOX,
    PREFS_PAGE_TOOLS_SHAPES_ELLIPSE,
    PREFS_PAGE_TOOLS_SHAPES_STAR,
    PREFS_PAGE_TOOLS_SHAPES_SPIRAL,
    PREFS_PAGE_TOOLS_PENCIL,
    PREFS_PAGE_TOOLS_PEN,
    PREFS_PAGE_TOOLS_CALLIGRAPHY,
    PREFS_PAGE_TOOLS_PAINTBUCKET,
    PREFS_PAGE_TOOLS_ERASER,
    PREFS_PAGE_TOOLS_LPETOOL,
    PREFS_PAGE_TOOLS_TEXT,
    PREFS_PAGE_TOOLS_GRADIENT,
    PREFS_PAGE_TOOLS_CONNECTOR,
    PREFS_PAGE_TOOLS_DROPPER,
    PREFS_PAGE_SELECTING,
    PREFS_PAGE_TRANSFORMS,
    PREFS_PAGE_CLONES,
    PREFS_PAGE_MASKS,
    PREFS_PAGE_FILTERS,
    PREFS_PAGE_BITMAPS,
    PREFS_PAGE_CMS,
    PREFS_PAGE_GRIDS,
    PREFS_PAGE_SVGOUTPUT,
    PREFS_PAGE_AUTOSAVE,
    PREFS_PAGE_IMPORTEXPORT,
    PREFS_PAGE_MOUSE,
    PREFS_PAGE_SCROLLING,
    PREFS_PAGE_SNAPPING,
    PREFS_PAGE_STEPS,
    PREFS_PAGE_UI,
    PREFS_PAGE_WINDOWS,
    PREFS_PAGE_SPELLCHECK,
    PREFS_PAGE_MISC
};

using namespace Inkscape::UI::Widget;

namespace Inkscape {
namespace UI {
namespace Dialog {

class InkscapePreferences : public UI::Widget::Panel {
public:
    virtual ~InkscapePreferences();

    static InkscapePreferences &getInstance() { return *new InkscapePreferences(); }

protected:
    Gtk::Frame _page_frame;
    Gtk::Label _page_title;
    Gtk::TreeView _page_list;
    Glib::RefPtr<Gtk::TreeStore> _page_list_model;

    //Pagelist model columns:
    class PageListModelColumns : public Gtk::TreeModel::ColumnRecord
    {
    public:
        PageListModelColumns()
        { Gtk::TreeModelColumnRecord::add(_col_name); Gtk::TreeModelColumnRecord::add(_col_page); Gtk::TreeModelColumnRecord::add(_col_id); }
        Gtk::TreeModelColumn<Glib::ustring> _col_name;
        Gtk::TreeModelColumn<int> _col_id;
        Gtk::TreeModelColumn<DialogPage*> _col_page;
    };
    PageListModelColumns _page_list_columns;

    Gtk::TreeModel::Path _path_tools;
    Gtk::TreeModel::Path _path_shapes;

    DialogPage _page_mouse, _page_scrolling, _page_snapping, _page_steps, _page_tools, _page_windows,
        _page_clones, _page_mask, _page_transforms, _page_filters, _page_select,
        _page_importexport, _page_cms, _page_grids, _page_svgoutput, _page_misc,
        _page_ui, _page_autosave, _page_bitmaps, _page_spellcheck;
    DialogPage _page_selector, _page_node, _page_tweak, _page_zoom, _page_shapes, _page_pencil, _page_pen,
               _page_calligraphy, _page_text, _page_gradient, _page_connector, _page_dropper, _page_lpetool;
    DialogPage _page_rectangle, _page_3dbox, _page_ellipse, _page_star, _page_spiral, _page_paintbucket, _page_eraser;

    PrefSpinButton _mouse_sens, _mouse_thres;
    PrefCheckButton _mouse_use_ext_input;
    PrefCheckButton _mouse_switch_on_ext_input;

    PrefSpinButton _scroll_wheel, _scroll_arrow_px, _scroll_arrow_acc, _scroll_auto_speed, _scroll_auto_thres;
    PrefCheckButton _scroll_space;
    PrefCheckButton _wheel_zoom;

    Gtk::HScale     *_slider_snapping_delay;
    PrefCheckButton _snap_indicator, _snap_closest_only;

    PrefCombo       _steps_rot_snap;
    PrefCheckButton _steps_compass;
    PrefSpinButton  _steps_arrow, _steps_scale, _steps_inset, _steps_zoom;

    PrefRadioButton _t_sel_trans_obj, _t_sel_trans_outl, _t_sel_cue_none, _t_sel_cue_mark,
                    _t_sel_cue_box, _t_bbox_visual, _t_bbox_geometric;
    PrefCheckButton _t_cvg_keep_objects, _t_cvg_convert_whole_groups;
    PrefCheckButton _t_node_pathflash_enabled;
    PrefCheckButton _t_node_pathflash_unselected;
    PrefSpinButton  _t_node_pathflash_timeout;
    PrefColorPicker _t_node_pathoutline_color;

    PrefRadioButton _win_dockable, _win_floating;
    PrefRadioButton _win_ontop_none, _win_ontop_normal, _win_ontop_agressive;
    PrefRadioButton _win_save_geom_off, _win_save_geom, _win_save_geom_prefs;
    PrefCheckButton _win_hide_task, _win_zoom_resize , _win_show_close;
    PrefSpinButton _win_trans_focus; /**< The dialog transparency setting for when the dialog is focused. */
    PrefSpinButton _win_trans_blur;  /**< The dialog transparency setting for when the dialog is out of focus. */
    PrefSpinButton _win_trans_time;  /**< How much time to go from one transparency setting to another */

    PrefCheckButton _pencil_average_all_sketches;

    PrefCheckButton _calligrapy_use_abs_size;
    PrefCheckButton _calligrapy_keep_selected;

    PrefCheckButton _connector_ignore_text;

    PrefRadioButton _clone_option_parallel, _clone_option_stay, _clone_option_transform,
                    _clone_option_unlink, _clone_option_delete;
    PrefCheckButton _clone_relink_on_duplicate;

    PrefCheckButton _mask_mask_on_top;
    PrefCheckButton _mask_mask_remove;

    PrefRadioButton _blur_quality_best, _blur_quality_better, _blur_quality_normal, _blur_quality_worse, _blur_quality_worst;
    PrefRadioButton _filter_quality_best, _filter_quality_better, _filter_quality_normal, _filter_quality_worse, _filter_quality_worst;
    PrefCheckButton _show_filters_info_box;

    PrefCheckButton _trans_scale_stroke, _trans_scale_corner, _trans_gradient,_trans_pattern;
    PrefRadioButton _trans_optimized, _trans_preserved;

    PrefRadioButton _sel_all;
    PrefRadioButton _sel_current;
    PrefRadioButton _sel_recursive;
    PrefCheckButton _sel_hidden, _sel_locked;
    PrefCheckButton _sel_layer_deselects;

    PrefSpinButton  _importexport_export, _misc_simpl;
    PrefSlider      _snap_delay, _snap_weight;
    PrefSpinButton  _misc_latency_skew;
    PrefCheckButton _misc_comment, _misc_forkvectors, _misc_scripts, _misc_namedicon_delay;
    Gtk::TextView   _misc_info;
    Gtk::ScrolledWindow _misc_info_scroll;


    // UI page
    PrefCombo       _ui_languages;
    PrefCombo       _misc_small_toolbar;
    PrefCombo       _misc_small_secondary;
    PrefCombo       _misc_small_tools;
    PrefCheckButton _ui_colorsliders_top;
    PrefSpinButton  _misc_recent;
    ZoomCorrRulerSlider _ui_zoom_correction;

    //Spellcheck
    PrefCombo       _spell_language;
    PrefCombo       _spell_language2;
    PrefCombo       _spell_language3;
    PrefCheckButton _spell_ignorenumbers;
    PrefCheckButton _spell_ignoreallcaps;

    PrefCombo       _misc_overs_bitmap;
    PrefCombo       _misc_bitmap_editor;
    PrefCheckButton _misc_bitmap_autoreload;
    PrefSpinButton  _bitmap_copy_res;

    PrefCheckButton _autosave_autosave_enable;
    PrefSpinButton  _autosave_autosave_interval;
    PrefEntry       _autosave_autosave_path;
    PrefSpinButton  _autosave_autosave_max;

    Gtk::ComboBoxText   _cms_display_profile;
    PrefCheckButton     _cms_from_display;
    PrefCombo           _cms_intent;

    PrefCheckButton     _cms_softproof;
    PrefCheckButton     _cms_gamutwarn;
    Gtk::ColorButton    _cms_gamutcolor;
    Gtk::ComboBoxText   _cms_proof_profile;
    PrefCombo           _cms_proof_intent;
    PrefCheckButton     _cms_proof_blackpoint;
    PrefCheckButton     _cms_proof_preserveblack;

    Gtk::Notebook       _grids_notebook;
    PrefCheckButton     _grids_no_emphasize_on_zoom;
    DialogPage          _grids_xy, _grids_axonom;
    // CanvasXYGrid properties:
        PrefUnit            _grids_xy_units;
        PrefSpinButton      _grids_xy_origin_x;
        PrefSpinButton      _grids_xy_origin_y;
        PrefSpinButton      _grids_xy_spacing_x;
        PrefSpinButton      _grids_xy_spacing_y;
        PrefColorPicker     _grids_xy_color;
        PrefColorPicker     _grids_xy_empcolor;
        PrefSpinButton      _grids_xy_empspacing;
        PrefCheckButton     _grids_xy_dotted;
    // CanvasAxonomGrid properties:
        PrefUnit            _grids_axonom_units;
        PrefSpinButton      _grids_axonom_origin_x;
        PrefSpinButton      _grids_axonom_origin_y;
        PrefSpinButton      _grids_axonom_spacing_y;
        PrefSpinButton      _grids_axonom_angle_x;
        PrefSpinButton      _grids_axonom_angle_z;
        PrefColorPicker     _grids_axonom_color;
        PrefColorPicker     _grids_axonom_empcolor;
        PrefSpinButton      _grids_axonom_empspacing;

    // SVG Output page:
    PrefCheckButton   _svgoutput_usenamedcolors;
    PrefSpinButton    _svgoutput_numericprecision;
    PrefSpinButton    _svgoutput_minimumexponent;
    PrefCheckButton   _svgoutput_inlineattrs;
    PrefSpinButton    _svgoutput_indent;
    PrefCheckButton   _svgoutput_allowrelativecoordinates;
    PrefCheckButton   _svgoutput_forcerepeatcommands;

    PrefEntryButtonHBox _importexport_ocal_url;
    PrefEntry       _importexport_ocal_username;
    PrefEntry       _importexport_ocal_password;

    int _max_dialog_width;
    int _max_dialog_height;
    int _sb_width;
    DialogPage* _current_page;

    Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, int id);
    Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent, int id);
    bool SetMaxDialogSize(const Gtk::TreeModel::iterator& iter);
    bool PresentPage(const Gtk::TreeModel::iterator& iter);

    static void AddSelcueCheckbox(DialogPage& p, Glib::ustring const &prefs_path, bool def_value);
    static void AddGradientCheckbox(DialogPage& p, Glib::ustring const &prefs_path, bool def_value);
    static void AddConvertGuidesCheckbox(DialogPage& p, Glib::ustring const &prefs_path, bool def_value);
    static void AddDotSizeSpinbutton(DialogPage& p, Glib::ustring const &prefs_path, double def_value);
    static void AddNewObjectsStyle(DialogPage& p, Glib::ustring const &prefs_path, const gchar* banner = NULL);

    void on_pagelist_selection_changed();
    void on_reset_open_recent_clicked();
    void initPageMouse();
    void initPageScrolling();
    void initPageSnapping();
    void initPageSteps();
    void initPageTools();
    void initPageWindows();
    void initPageClones();
    void initPageMasks();
    void initPageTransforms();
    void initPageFilters();
    void initPageSelecting();
    void initPageImportExport();
    void initPageCMS();
    void initPageGrids();
    void initPageSVGOutput();
    void initPageUI();
    void initPageSpellcheck();
    void initPageAutosave();
    void initPageBitmaps();
    void initPageMisc();
    void initPageI18n();

    void _presentPages();

private:
    InkscapePreferences();
    InkscapePreferences(InkscapePreferences const &d);
    InkscapePreferences operator=(InkscapePreferences const &d);
};

} // namespace Dialog
} // namespace UI
} // namespace Inkscape

#endif //INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H

/*
  Local Variables:
  mode:c++
  c-file-style:"stroustrup"
  c-file-offsets:((innamespace . 0)(inline-open . 0))
  indent-tabs-mode:nil
  fill-column:99
  End:
*/
// vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :