1 /**
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/table.h>
21 #include <gtkmm/colorbutton.h>
22 #include <gtkmm/comboboxtext.h>
23 #include <gtkmm/spinbutton.h>
24 #include <gtkmm/treestore.h>
25 #include <gtkmm/treeview.h>
26 #include <gtkmm/radiobutton.h>
27 #include <gtkmm/frame.h>
28 #include <gtkmm/notebook.h>
29 #include "ui/widget/preferences-widget.h"
30 #include <sigc++/sigc++.h>
31 #include <glibmm/i18n.h>
33 #include "ui/widget/panel.h"
35 // UPDATE THIS IF YOU'RE ADDING PREFS PAGES.
36 // Otherwise the commands that open the dialog with the new page will fail.
38 enum {
39 PREFS_PAGE_MOUSE,
40 PREFS_PAGE_SCROLLING,
41 PREFS_PAGE_STEPS,
42 PREFS_PAGE_TOOLS,
43 PREFS_PAGE_TOOLS_SELECTOR,
44 PREFS_PAGE_TOOLS_NODE,
45 PREFS_PAGE_TOOLS_TWEAK,
46 PREFS_PAGE_TOOLS_ZOOM,
47 PREFS_PAGE_TOOLS_SHAPES,
48 PREFS_PAGE_TOOLS_SHAPES_RECT,
49 PREFS_PAGE_TOOLS_SHAPES_3DBOX,
50 PREFS_PAGE_TOOLS_SHAPES_ELLIPSE,
51 PREFS_PAGE_TOOLS_SHAPES_STAR,
52 PREFS_PAGE_TOOLS_SHAPES_SPIRAL,
53 PREFS_PAGE_TOOLS_PENCIL,
54 PREFS_PAGE_TOOLS_PEN,
55 PREFS_PAGE_TOOLS_CALLIGRAPHY,
56 PREFS_PAGE_TOOLS_PAINTBUCKET,
57 PREFS_PAGE_TOOLS_ERASER,
58 PREFS_PAGE_TOOLS_TEXT,
59 PREFS_PAGE_TOOLS_GRADIENT,
60 PREFS_PAGE_TOOLS_CONNECTOR,
61 PREFS_PAGE_TOOLS_DROPPER,
62 PREFS_PAGE_WINDOWS,
63 PREFS_PAGE_CLONES,
64 PREFS_PAGE_MASKS,
65 PREFS_PAGE_FILTERS,
66 PREFS_PAGE_TRANSFORMS,
67 PREFS_PAGE_SELECTING,
68 PREFS_PAGE_IMPORTEXPORT,
69 PREFS_PAGE_CMS,
70 PREFS_PAGE_GRIDS,
71 PREFS_PAGE_SVGOUTPUT,
72 PREFS_PAGE_MISC
73 };
75 using namespace Inkscape::UI::Widget;
77 namespace Inkscape {
78 namespace UI {
79 namespace Dialog {
81 class InkscapePreferences : public UI::Widget::Panel {
82 public:
83 virtual ~InkscapePreferences();
85 static InkscapePreferences &getInstance() { return *new InkscapePreferences(); }
87 protected:
88 Gtk::Frame _page_frame;
89 Gtk::Label _page_title;
90 Gtk::TreeView _page_list;
91 Glib::RefPtr<Gtk::TreeStore> _page_list_model;
93 //Pagelist model columns:
94 class PageListModelColumns : public Gtk::TreeModel::ColumnRecord
95 {
96 public:
97 PageListModelColumns()
98 { Gtk::TreeModelColumnRecord::add(_col_name); Gtk::TreeModelColumnRecord::add(_col_page); Gtk::TreeModelColumnRecord::add(_col_id); }
99 Gtk::TreeModelColumn<Glib::ustring> _col_name;
100 Gtk::TreeModelColumn<int> _col_id;
101 Gtk::TreeModelColumn<DialogPage*> _col_page;
102 };
103 PageListModelColumns _page_list_columns;
105 Gtk::TreeModel::Path _path_tools;
106 Gtk::TreeModel::Path _path_shapes;
108 DialogPage _page_mouse, _page_scrolling, _page_steps, _page_tools, _page_windows,
109 _page_clones, _page_mask, _page_transforms, _page_filters, _page_select,
110 _page_importexport, _page_cms, _page_grids, _page_svgoutput, _page_misc;
111 DialogPage _page_selector, _page_node, _page_tweak, _page_zoom, _page_shapes, _page_pencil, _page_pen,
112 _page_calligraphy, _page_text, _page_gradient, _page_connector, _page_dropper;
113 DialogPage _page_rectangle, _page_3dbox, _page_ellipse, _page_star, _page_spiral, _page_paintbucket, _page_eraser;
115 PrefSpinButton _mouse_sens, _mouse_thres;
116 PrefCheckButton _mouse_use_ext_input;
117 PrefCheckButton _mouse_switch_on_ext_input;
119 PrefSpinButton _scroll_wheel, _scroll_arrow_px, _scroll_arrow_acc, _scroll_auto_speed, _scroll_auto_thres;
120 PrefCheckButton _scroll_space;
121 PrefCheckButton _wheel_zoom;
123 PrefCombo _steps_rot_snap;
124 PrefCheckButton _steps_compass;
125 PrefSpinButton _steps_arrow, _steps_scale, _steps_inset, _steps_zoom;
127 PrefRadioButton _t_sel_trans_obj, _t_sel_trans_outl, _t_sel_cue_none, _t_sel_cue_mark,
128 _t_sel_cue_box, _t_bbox_visual, _t_bbox_geometric;
129 PrefCheckButton _t_cvg_keep_objects, _t_cvg_convert_whole_groups;
130 PrefCheckButton _t_node_pathflash_enabled;
131 PrefSpinButton _t_node_pathflash_timeout;
132 PrefColorPicker _t_node_pathoutline_color;
134 PrefSpinButton _t_pencil_tolerance;
136 PrefRadioButton _win_dockable, _win_floating;
137 PrefRadioButton _win_ontop_none, _win_ontop_normal, _win_ontop_agressive;
138 PrefRadioButton _win_save_geom_off, _win_save_geom, _win_save_geom_prefs;
139 PrefCheckButton _win_hide_task, _win_zoom_resize , _win_show_close;
141 PrefCheckButton _calligrapy_use_abs_size;
142 PrefCheckButton _calligrapy_keep_selected;
144 PrefCheckButton _connector_ignore_text;
146 PrefRadioButton _clone_option_parallel, _clone_option_stay, _clone_option_transform,
147 _clone_option_unlink, _clone_option_delete;
149 PrefCheckButton _mask_mask_on_top;
150 PrefCheckButton _mask_mask_remove;
152 PrefRadioButton _blur_quality_best, _blur_quality_better, _blur_quality_normal, _blur_quality_worse, _blur_quality_worst;
153 PrefCheckButton _show_filters_info_box;
155 PrefCheckButton _trans_scale_stroke, _trans_scale_corner, _trans_gradient,_trans_pattern;
156 PrefRadioButton _trans_optimized, _trans_preserved;
158 PrefRadioButton _sel_all;
159 PrefRadioButton _sel_current;
160 PrefRadioButton _sel_recursive;
161 PrefCheckButton _sel_hidden, _sel_locked;
162 PrefCheckButton _sel_layer_deselects;
164 PrefSpinButton _importexport_export, _misc_recent, _misc_simpl;
165 PrefCheckButton _misc_comment, _misc_forkvectors, _misc_scripts;
166 PrefCombo _misc_small_toolbar;
167 PrefCombo _misc_small_secondary;
168 PrefCombo _misc_small_tools;
169 PrefCombo _misc_overs_bitmap;
170 PrefCombo _misc_bitmap_editor;
171 PrefCheckButton _misc_bitmap_autoreload;
172 PrefCheckButton _misc_autosave_enable;
173 PrefSpinButton _misc_autosave_interval;
174 PrefEntry _misc_autosave_path;
175 PrefSpinButton _misc_autosave_max;
177 Gtk::ComboBoxText _cms_display_profile;
178 PrefCheckButton _cms_from_display;
179 PrefCombo _cms_intent;
181 PrefCheckButton _cms_softproof;
182 PrefCheckButton _cms_gamutwarn;
183 Gtk::ColorButton _cms_gamutcolor;
184 Gtk::ComboBoxText _cms_proof_profile;
185 PrefCombo _cms_proof_intent;
186 PrefCheckButton _cms_proof_blackpoint;
187 PrefCheckButton _cms_proof_preserveblack;
189 Gtk::Notebook _grids_notebook;
190 PrefCheckButton _grids_no_emphasize_on_zoom;
191 DialogPage _grids_xy, _grids_axonom;
192 // CanvasXYGrid properties:
193 PrefUnit _grids_xy_units;
194 PrefSpinButton _grids_xy_origin_x;
195 PrefSpinButton _grids_xy_origin_y;
196 PrefSpinButton _grids_xy_spacing_x;
197 PrefSpinButton _grids_xy_spacing_y;
198 PrefColorPicker _grids_xy_color;
199 PrefColorPicker _grids_xy_empcolor;
200 PrefSpinButton _grids_xy_empspacing;
201 PrefCheckButton _grids_xy_dotted;
202 // CanvasAxonomGrid properties:
203 PrefUnit _grids_axonom_units;
204 PrefSpinButton _grids_axonom_origin_x;
205 PrefSpinButton _grids_axonom_origin_y;
206 PrefSpinButton _grids_axonom_spacing_y;
207 PrefSpinButton _grids_axonom_angle_x;
208 PrefSpinButton _grids_axonom_angle_z;
209 PrefColorPicker _grids_axonom_color;
210 PrefColorPicker _grids_axonom_empcolor;
211 PrefSpinButton _grids_axonom_empspacing;
213 // SVG Output page:
214 PrefCheckButton _svgoutput_usenamedcolors;
215 PrefSpinButton _svgoutput_numericprecision;
216 PrefSpinButton _svgoutput_minimumexponent;
217 PrefCheckButton _svgoutput_inlineattrs;
218 PrefSpinButton _svgoutput_indent;
219 PrefCheckButton _svgoutput_allowrelativecoordinates;
220 PrefCheckButton _svgoutput_allowshorthands;
221 PrefCheckButton _svgoutput_forcerepeatcommands;
223 PrefEntryButtonHBox _importexport_ocal_url;
224 PrefEntry _importexport_ocal_username;
225 PrefEntry _importexport_ocal_password;
227 int _max_dialog_width;
228 int _max_dialog_height;
229 int _sb_width;
230 DialogPage* _current_page;
232 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, int id);
233 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent, int id);
234 bool SetMaxDialogSize(const Gtk::TreeModel::iterator& iter);
235 bool PresentPage(const Gtk::TreeModel::iterator& iter);
237 static void AddSelcueCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
238 static void AddGradientCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
239 static void AddConvertGuidesCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
240 static void AddDotSizeSpinbutton(DialogPage& p, const std::string& prefs_path, double def_value);
241 static void AddNewObjectsStyle(DialogPage& p, const std::string& prefs_path);
243 void on_pagelist_selection_changed();
244 void initPageMouse();
245 void initPageScrolling();
246 void initPageSteps();
247 void initPageTools();
248 void initPageWindows();
249 void initPageClones();
250 void initPageMasks();
251 void initPageTransforms();
252 void initPageFilters();
253 void initPageSelecting();
254 void initPageImportExport();
255 void initPageCMS();
256 void initPageGrids();
257 void initPageSVGOutput();
258 void initPageMisc();
260 void _presentPages();
262 private:
263 InkscapePreferences();
264 InkscapePreferences(InkscapePreferences const &d);
265 InkscapePreferences operator=(InkscapePreferences const &d);
266 };
268 } // namespace Dialog
269 } // namespace UI
270 } // namespace Inkscape
272 #endif //INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
274 /*
275 Local Variables:
276 mode:c++
277 c-file-style:"stroustrup"
278 c-file-offsets:((innamespace . 0)(inline-open . 0))
279 indent-tabs-mode:nil
280 fill-column:99
281 End:
282 */
283 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :