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_MISC
72 };
74 using namespace Inkscape::UI::Widget;
76 namespace Inkscape {
77 namespace UI {
78 namespace Dialog {
80 class InkscapePreferences : public UI::Widget::Panel {
81 public:
82 virtual ~InkscapePreferences();
84 static InkscapePreferences &getInstance() { return *new InkscapePreferences(); }
86 protected:
87 Gtk::Frame _page_frame;
88 Gtk::Label _page_title;
89 Gtk::TreeView _page_list;
90 Glib::RefPtr<Gtk::TreeStore> _page_list_model;
92 //Pagelist model columns:
93 class PageListModelColumns : public Gtk::TreeModel::ColumnRecord
94 {
95 public:
96 PageListModelColumns()
97 { Gtk::TreeModelColumnRecord::add(_col_name); Gtk::TreeModelColumnRecord::add(_col_page); Gtk::TreeModelColumnRecord::add(_col_id); }
98 Gtk::TreeModelColumn<Glib::ustring> _col_name;
99 Gtk::TreeModelColumn<int> _col_id;
100 Gtk::TreeModelColumn<DialogPage*> _col_page;
101 };
102 PageListModelColumns _page_list_columns;
104 Gtk::TreeModel::Path _path_tools;
105 Gtk::TreeModel::Path _path_shapes;
107 DialogPage _page_mouse, _page_scrolling, _page_steps, _page_tools, _page_windows,
108 _page_clones, _page_mask, _page_transforms, _page_filters, _page_select,
109 _page_importexport, _page_cms, _page_grids, _page_misc;
110 DialogPage _page_selector, _page_node, _page_tweak, _page_zoom, _page_shapes, _page_pencil, _page_pen,
111 _page_calligraphy, _page_text, _page_gradient, _page_connector, _page_dropper;
112 DialogPage _page_rectangle, _page_3dbox, _page_ellipse, _page_star, _page_spiral, _page_paintbucket, _page_eraser;
114 PrefSpinButton _mouse_sens, _mouse_thres;
115 PrefCheckButton _mouse_use_ext_input;
116 PrefCheckButton _mouse_switch_on_ext_input;
118 PrefSpinButton _scroll_wheel, _scroll_arrow_px, _scroll_arrow_acc, _scroll_auto_speed, _scroll_auto_thres;
119 PrefCheckButton _scroll_space;
120 PrefCheckButton _wheel_zoom;
122 PrefCombo _steps_rot_snap;
123 PrefCheckButton _steps_compass;
124 PrefSpinButton _steps_arrow, _steps_scale, _steps_inset, _steps_zoom;
126 PrefRadioButton _t_sel_trans_obj, _t_sel_trans_outl, _t_sel_cue_none, _t_sel_cue_mark,
127 _t_sel_cue_box, _t_bbox_visual, _t_bbox_geometric;
128 PrefCheckButton _t_cvg_keep_objects, _t_cvg_convert_whole_groups;
129 PrefCheckButton _t_node_pathflash_enabled;
130 PrefSpinButton _t_node_pathflash_timeout;
131 PrefColorPicker _t_node_pathoutline_color;
133 PrefSpinButton _t_pencil_tolerance;
135 PrefRadioButton _win_dockable, _win_floating;
136 PrefRadioButton _win_ontop_none, _win_ontop_normal, _win_ontop_agressive;
137 PrefRadioButton _win_save_geom_off, _win_save_geom, _win_save_geom_prefs;
138 PrefCheckButton _win_hide_task, _win_zoom_resize , _win_show_close;
140 PrefCheckButton _calligrapy_use_abs_size;
141 PrefCheckButton _calligrapy_keep_selected;
143 PrefCheckButton _connector_ignore_text;
145 PrefRadioButton _clone_option_parallel, _clone_option_stay, _clone_option_transform,
146 _clone_option_unlink, _clone_option_delete;
148 PrefCheckButton _mask_mask_on_top;
149 PrefCheckButton _mask_mask_remove;
151 PrefRadioButton _blur_quality_best, _blur_quality_better, _blur_quality_normal, _blur_quality_worse, _blur_quality_worst;
152 PrefCheckButton _show_filters_info_box;
154 PrefCheckButton _trans_scale_stroke, _trans_scale_corner, _trans_gradient,_trans_pattern;
155 PrefRadioButton _trans_optimized, _trans_preserved;
157 PrefRadioButton _sel_all;
158 PrefRadioButton _sel_current;
159 PrefRadioButton _sel_recursive;
160 PrefCheckButton _sel_hidden, _sel_locked;
161 PrefCheckButton _sel_layer_deselects;
163 PrefSpinButton _importexport_export, _misc_recent, _misc_simpl;
164 PrefCheckButton _misc_comment, _misc_forkvectors, _misc_scripts;
165 PrefCombo _misc_small_toolbar;
166 PrefCombo _misc_small_secondary;
167 PrefCombo _misc_small_tools;
168 PrefCombo _misc_overs_bitmap;
170 Gtk::ComboBoxText _cms_display_profile;
171 PrefCheckButton _cms_from_display;
172 PrefCombo _cms_intent;
174 PrefCheckButton _cms_softproof;
175 PrefCheckButton _cms_gamutwarn;
176 Gtk::ColorButton _cms_gamutcolor;
177 Gtk::ComboBoxText _cms_proof_profile;
178 PrefCombo _cms_proof_intent;
179 PrefCheckButton _cms_proof_blackpoint;
180 PrefCheckButton _cms_proof_preserveblack;
182 Gtk::Notebook _grids_notebook;
183 PrefCheckButton _grids_no_emphasize_on_zoom;
184 DialogPage _grids_xy, _grids_axonom;
185 // CanvasXYGrid properties:
186 PrefUnit _grids_xy_units;
187 PrefSpinButton _grids_xy_origin_x;
188 PrefSpinButton _grids_xy_origin_y;
189 PrefSpinButton _grids_xy_spacing_x;
190 PrefSpinButton _grids_xy_spacing_y;
191 PrefColorPicker _grids_xy_color;
192 PrefColorPicker _grids_xy_empcolor;
193 PrefSpinButton _grids_xy_empspacing;
194 PrefCheckButton _grids_xy_dotted;
195 // CanvasAxonomGrid properties:
196 PrefUnit _grids_axonom_units;
197 PrefSpinButton _grids_axonom_origin_x;
198 PrefSpinButton _grids_axonom_origin_y;
199 PrefSpinButton _grids_axonom_spacing_y;
200 PrefSpinButton _grids_axonom_angle_x;
201 PrefSpinButton _grids_axonom_angle_z;
202 PrefColorPicker _grids_axonom_color;
203 PrefColorPicker _grids_axonom_empcolor;
204 PrefSpinButton _grids_axonom_empspacing;
206 PrefEntryButtonHBox _importexport_ocal_url;
207 PrefEntry _importexport_ocal_username;
208 PrefEntry _importexport_ocal_password;
210 int _max_dialog_width;
211 int _max_dialog_height;
212 int _sb_width;
213 DialogPage* _current_page;
215 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, int id);
216 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent, int id);
217 bool SetMaxDialogSize(const Gtk::TreeModel::iterator& iter);
218 bool PresentPage(const Gtk::TreeModel::iterator& iter);
220 static void AddSelcueCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
221 static void AddGradientCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
222 static void AddConvertGuidesCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
223 static void AddDotSizeSpinbutton(DialogPage& p, const std::string& prefs_path, double def_value);
224 static void AddNewObjectsStyle(DialogPage& p, const std::string& prefs_path);
226 void on_pagelist_selection_changed();
227 void initPageMouse();
228 void initPageScrolling();
229 void initPageSteps();
230 void initPageTools();
231 void initPageWindows();
232 void initPageClones();
233 void initPageMasks();
234 void initPageTransforms();
235 void initPageFilters();
236 void initPageSelecting();
237 void initPageImportExport();
238 void initPageCMS();
239 void initPageGrids();
240 void initPageMisc();
242 void _presentPages();
244 private:
245 InkscapePreferences();
246 InkscapePreferences(InkscapePreferences const &d);
247 InkscapePreferences operator=(InkscapePreferences const &d);
248 };
250 } // namespace Dialog
251 } // namespace UI
252 } // namespace Inkscape
254 #endif //INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
256 /*
257 Local Variables:
258 mode:c++
259 c-file-style:"stroustrup"
260 c-file-offsets:((innamespace . 0)(inline-open . 0))
261 indent-tabs-mode:nil
262 fill-column:99
263 End:
264 */
265 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :