Code

noop: rename a local var
[inkscape.git] / src / ui / dialog / inkscape-preferences.h
1 /** @file
2  * @brief Inkscape Preferences dialog
3  */
4 /* Authors:
5  *   Carl Hetherington
6  *   Marco Scholten
7  *   Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
8  *   Bruno Dilly <bruno.dilly@gmail.com>
9  *
10  * Copyright (C) 2004-2007 Authors
11  *
12  * Released under GNU GPL.  Read the file 'COPYING' for more information.
13  */
15 #ifndef INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
16 #define INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
18 #include <iostream>
19 #include <vector>
20 #include <gtkmm/base.h>
21 #include <gtkmm/table.h>
22 #include <gtkmm/colorbutton.h>
23 #include <gtkmm/comboboxtext.h>
24 #include <gtkmm/spinbutton.h>
25 #include <gtkmm/treestore.h>
26 #include <gtkmm/treeview.h>
27 #include <gtkmm/radiobutton.h>
28 #include <gtkmm/frame.h>
29 #include <gtkmm/notebook.h>
30 #include "ui/widget/preferences-widget.h"
31 #include <sigc++/sigc++.h>
32 #include <glibmm/i18n.h>
34 #include "ui/widget/panel.h"
36 // UPDATE THIS IF YOU'RE ADDING PREFS PAGES.
37 // Otherwise the commands that open the dialog with the new page will fail.
39 enum {
40     PREFS_PAGE_TOOLS,
41     PREFS_PAGE_TOOLS_SELECTOR,
42     PREFS_PAGE_TOOLS_NODE,
43     PREFS_PAGE_TOOLS_TWEAK,
44     PREFS_PAGE_TOOLS_ZOOM,
45     PREFS_PAGE_TOOLS_SHAPES,
46     PREFS_PAGE_TOOLS_SHAPES_RECT,
47     PREFS_PAGE_TOOLS_SHAPES_3DBOX,
48     PREFS_PAGE_TOOLS_SHAPES_ELLIPSE,
49     PREFS_PAGE_TOOLS_SHAPES_STAR,
50     PREFS_PAGE_TOOLS_SHAPES_SPIRAL,
51     PREFS_PAGE_TOOLS_PENCIL,
52     PREFS_PAGE_TOOLS_PEN,
53     PREFS_PAGE_TOOLS_CALLIGRAPHY,
54     PREFS_PAGE_TOOLS_PAINTBUCKET,
55     PREFS_PAGE_TOOLS_ERASER,
56     PREFS_PAGE_TOOLS_LPETOOL,
57     PREFS_PAGE_TOOLS_TEXT,
58     PREFS_PAGE_TOOLS_GRADIENT,
59     PREFS_PAGE_TOOLS_CONNECTOR,
60     PREFS_PAGE_TOOLS_DROPPER,
61     PREFS_PAGE_SELECTING,
62     PREFS_PAGE_TRANSFORMS,
63     PREFS_PAGE_CLONES,
64     PREFS_PAGE_MASKS,
65     PREFS_PAGE_FILTERS,
66     PREFS_PAGE_BITMAPS,
67     PREFS_PAGE_CMS,
68     PREFS_PAGE_GRIDS,
69     PREFS_PAGE_SVGOUTPUT,
70     PREFS_PAGE_AUTOSAVE,
71     PREFS_PAGE_IMPORTEXPORT,
72     PREFS_PAGE_MOUSE,
73     PREFS_PAGE_SCROLLING,
74     PREFS_PAGE_SNAPPING,
75     PREFS_PAGE_STEPS,
76     PREFS_PAGE_UI,
77     PREFS_PAGE_WINDOWS,
78     PREFS_PAGE_SPELLCHECK,
79     PREFS_PAGE_MISC
80 };
82 using namespace Inkscape::UI::Widget;
84 namespace Inkscape {
85 namespace UI {
86 namespace Dialog {
88 class InkscapePreferences : public UI::Widget::Panel {
89 public:
90     virtual ~InkscapePreferences();
92     static InkscapePreferences &getInstance() { return *new InkscapePreferences(); }
94 protected:
95     Gtk::Frame _page_frame;
96     Gtk::Label _page_title;
97     Gtk::TreeView _page_list;
98     Glib::RefPtr<Gtk::TreeStore> _page_list_model;
100     //Pagelist model columns:
101     class PageListModelColumns : public Gtk::TreeModel::ColumnRecord
102     {
103     public:
104         PageListModelColumns()
105         { Gtk::TreeModelColumnRecord::add(_col_name); Gtk::TreeModelColumnRecord::add(_col_page); Gtk::TreeModelColumnRecord::add(_col_id); }
106         Gtk::TreeModelColumn<Glib::ustring> _col_name;
107         Gtk::TreeModelColumn<int> _col_id;
108         Gtk::TreeModelColumn<DialogPage*> _col_page;
109     };
110     PageListModelColumns _page_list_columns;
112     Gtk::TreeModel::Path _path_tools;
113     Gtk::TreeModel::Path _path_shapes;
115     DialogPage _page_mouse, _page_scrolling, _page_snapping, _page_steps, _page_tools, _page_windows,
116         _page_clones, _page_mask, _page_transforms, _page_filters, _page_select,
117         _page_importexport, _page_cms, _page_grids, _page_svgoutput, _page_misc,
118         _page_ui, _page_autosave, _page_bitmaps, _page_spellcheck;
119     DialogPage _page_selector, _page_node, _page_tweak, _page_zoom, _page_shapes, _page_pencil, _page_pen,
120                _page_calligraphy, _page_text, _page_gradient, _page_connector, _page_dropper, _page_lpetool;
121     DialogPage _page_rectangle, _page_3dbox, _page_ellipse, _page_star, _page_spiral, _page_paintbucket, _page_eraser;
123     PrefSpinButton _mouse_sens, _mouse_thres;
124     PrefCheckButton _mouse_use_ext_input;
125     PrefCheckButton _mouse_switch_on_ext_input;
127     PrefSpinButton _scroll_wheel, _scroll_arrow_px, _scroll_arrow_acc, _scroll_auto_speed, _scroll_auto_thres;
128     PrefCheckButton _scroll_space;
129     PrefCheckButton _wheel_zoom;
130     
131     Gtk::HScale         *_slider_snapping_delay;
132     PrefCheckButton _snap_indicator, _snap_closest_only;
134     PrefCombo       _steps_rot_snap;
135     PrefCheckButton _steps_compass;
136     PrefSpinButton  _steps_arrow, _steps_scale, _steps_inset, _steps_zoom;
138     PrefRadioButton _t_sel_trans_obj, _t_sel_trans_outl, _t_sel_cue_none, _t_sel_cue_mark,
139                     _t_sel_cue_box, _t_bbox_visual, _t_bbox_geometric;
140     PrefCheckButton _t_cvg_keep_objects, _t_cvg_convert_whole_groups;
141     PrefCheckButton _t_node_pathflash_enabled;
142     PrefCheckButton _t_node_pathflash_unselected;
143     PrefSpinButton  _t_node_pathflash_timeout;
144     PrefColorPicker _t_node_pathoutline_color;
146     PrefRadioButton _win_dockable, _win_floating;
147     PrefRadioButton _win_ontop_none, _win_ontop_normal, _win_ontop_agressive;
148     PrefRadioButton _win_save_geom_off, _win_save_geom, _win_save_geom_prefs;
149     PrefCheckButton _win_hide_task, _win_zoom_resize , _win_show_close;
150         PrefSpinButton _win_trans_focus; /**< The dialog transparency setting for when the dialog is focused. */
151         PrefSpinButton _win_trans_blur;  /**< The dialog transparency setting for when the dialog is out of focus. */
152         PrefSpinButton _win_trans_time;  /**< How much time to go from one transparency setting to another */
154     PrefCheckButton _pencil_average_all_sketches;
156     PrefCheckButton _calligrapy_use_abs_size;
157     PrefCheckButton _calligrapy_keep_selected;
159     PrefCheckButton _connector_ignore_text;
161     PrefRadioButton _clone_option_parallel, _clone_option_stay, _clone_option_transform,
162                     _clone_option_unlink, _clone_option_delete;
163     PrefCheckButton _clone_relink_on_duplicate;
165     PrefCheckButton _mask_mask_on_top;
166     PrefCheckButton _mask_mask_remove;
168     PrefRadioButton _blur_quality_best, _blur_quality_better, _blur_quality_normal, _blur_quality_worse, _blur_quality_worst;
169     PrefRadioButton _filter_quality_best, _filter_quality_better, _filter_quality_normal, _filter_quality_worse, _filter_quality_worst;
170     PrefCheckButton _show_filters_info_box;
172     PrefCheckButton _trans_scale_stroke, _trans_scale_corner, _trans_gradient,_trans_pattern;
173     PrefRadioButton _trans_optimized, _trans_preserved;
175     PrefRadioButton _sel_all;
176     PrefRadioButton _sel_current;
177     PrefRadioButton _sel_recursive;
178     PrefCheckButton _sel_hidden, _sel_locked;
179     PrefCheckButton _sel_layer_deselects;
181     PrefSpinButton  _importexport_export, _misc_simpl;
182     PrefSlider          _snap_delay, _snap_weight;
183     PrefSpinButton  _misc_latency_skew;
184     PrefCheckButton _misc_comment, _misc_forkvectors, _misc_scripts, _misc_namedicon_delay;
186     // UI page
187     PrefCombo       _ui_languages;
188     PrefCombo       _misc_small_toolbar;
189     PrefCombo       _misc_small_secondary;
190     PrefCombo       _misc_small_tools;
191     PrefCheckButton _ui_colorsliders_top;
192     PrefSpinButton  _misc_recent;
193     ZoomCorrRulerSlider _ui_zoom_correction;
195     //Spellcheck
196     PrefCombo       _spell_language;
197     PrefCombo       _spell_language2;
198     PrefCombo       _spell_language3;
199     PrefCheckButton _spell_ignorenumbers;
200     PrefCheckButton _spell_ignoreallcaps;
201     
202     PrefCombo       _misc_overs_bitmap;
203     PrefCombo       _misc_bitmap_editor;
204     PrefCheckButton _misc_bitmap_autoreload;
205     PrefSpinButton  _bitmap_copy_res;
207     PrefCheckButton _autosave_autosave_enable;
208     PrefSpinButton  _autosave_autosave_interval;
209     PrefEntry       _autosave_autosave_path;
210     PrefSpinButton  _autosave_autosave_max;
212     Gtk::ComboBoxText   _cms_display_profile;
213     PrefCheckButton     _cms_from_display;
214     PrefCombo           _cms_intent;
216     PrefCheckButton     _cms_softproof;
217     PrefCheckButton     _cms_gamutwarn;
218     Gtk::ColorButton    _cms_gamutcolor;
219     Gtk::ComboBoxText   _cms_proof_profile;
220     PrefCombo           _cms_proof_intent;
221     PrefCheckButton     _cms_proof_blackpoint;
222     PrefCheckButton     _cms_proof_preserveblack;
224     Gtk::Notebook       _grids_notebook;
225     PrefCheckButton     _grids_no_emphasize_on_zoom;
226     DialogPage          _grids_xy, _grids_axonom;
227     // CanvasXYGrid properties:
228         PrefUnit            _grids_xy_units;
229         PrefSpinButton      _grids_xy_origin_x;
230         PrefSpinButton      _grids_xy_origin_y;
231         PrefSpinButton      _grids_xy_spacing_x;
232         PrefSpinButton      _grids_xy_spacing_y;
233         PrefColorPicker     _grids_xy_color;
234         PrefColorPicker     _grids_xy_empcolor;
235         PrefSpinButton      _grids_xy_empspacing;
236         PrefCheckButton     _grids_xy_dotted;
237     // CanvasAxonomGrid properties:
238         PrefUnit            _grids_axonom_units;
239         PrefSpinButton      _grids_axonom_origin_x;
240         PrefSpinButton      _grids_axonom_origin_y;
241         PrefSpinButton      _grids_axonom_spacing_y;
242         PrefSpinButton      _grids_axonom_angle_x;
243         PrefSpinButton      _grids_axonom_angle_z;
244         PrefColorPicker     _grids_axonom_color;
245         PrefColorPicker     _grids_axonom_empcolor;
246         PrefSpinButton      _grids_axonom_empspacing;
248     // SVG Output page:
249     PrefCheckButton   _svgoutput_usenamedcolors;
250     PrefSpinButton    _svgoutput_numericprecision;
251     PrefSpinButton    _svgoutput_minimumexponent;
252     PrefCheckButton   _svgoutput_inlineattrs;
253     PrefSpinButton    _svgoutput_indent;
254     PrefCheckButton   _svgoutput_allowrelativecoordinates;
255     PrefCheckButton   _svgoutput_forcerepeatcommands;
257     PrefEntryButtonHBox _importexport_ocal_url;
258     PrefEntry       _importexport_ocal_username;
259     PrefEntry       _importexport_ocal_password;
261     int _max_dialog_width;
262     int _max_dialog_height;
263     int _sb_width;
264     DialogPage* _current_page;
266     Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, int id);
267     Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent, int id);
268     bool SetMaxDialogSize(const Gtk::TreeModel::iterator& iter);
269     bool PresentPage(const Gtk::TreeModel::iterator& iter);
271     static void AddSelcueCheckbox(DialogPage& p, Glib::ustring const &prefs_path, bool def_value);
272     static void AddGradientCheckbox(DialogPage& p, Glib::ustring const &prefs_path, bool def_value);
273     static void AddConvertGuidesCheckbox(DialogPage& p, Glib::ustring const &prefs_path, bool def_value);
274     static void AddDotSizeSpinbutton(DialogPage& p, Glib::ustring const &prefs_path, double def_value);
275     static void AddNewObjectsStyle(DialogPage& p, Glib::ustring const &prefs_path, const gchar* banner = NULL);
277     void on_pagelist_selection_changed();
278     void on_reset_open_recent_clicked();
279     void initPageMouse();
280     void initPageScrolling();
281     void initPageSnapping();
282     void initPageSteps();
283     void initPageTools();
284     void initPageWindows();
285     void initPageClones();
286     void initPageMasks();
287     void initPageTransforms();
288     void initPageFilters();
289     void initPageSelecting();
290     void initPageImportExport();
291     void initPageCMS();
292     void initPageGrids();
293     void initPageSVGOutput();
294     void initPageUI();
295     void initPageSpellcheck();
296     void initPageAutosave();
297     void initPageBitmaps();
298     void initPageMisc();
299     void initPageI18n();
301     void _presentPages();
303 private:
304     InkscapePreferences();
305     InkscapePreferences(InkscapePreferences const &d);
306     InkscapePreferences operator=(InkscapePreferences const &d);
307 };
309 } // namespace Dialog
310 } // namespace UI
311 } // namespace Inkscape
313 #endif //INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
315 /*
316   Local Variables:
317   mode:c++
318   c-file-style:"stroustrup"
319   c-file-offsets:((innamespace . 0)(inline-open . 0))
320   indent-tabs-mode:nil
321   fill-column:99
322   End:
323 */
324 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :