fd340769ee2c5a5f138f66753141b31b982badde
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_TEXT,
58 PREFS_PAGE_TOOLS_GRADIENT,
59 PREFS_PAGE_TOOLS_CONNECTOR,
60 PREFS_PAGE_TOOLS_DROPPER,
61 PREFS_PAGE_WINDOWS,
62 PREFS_PAGE_CLONES,
63 PREFS_PAGE_MASKS,
64 PREFS_PAGE_FILTERS,
65 PREFS_PAGE_TRANSFORMS,
66 PREFS_PAGE_SELECTING,
67 PREFS_PAGE_IMPORTEXPORT,
68 PREFS_PAGE_CMS,
69 PREFS_PAGE_GRIDS,
70 PREFS_PAGE_MISC
71 };
73 using namespace Inkscape::UI::Widget;
75 namespace Inkscape {
76 namespace UI {
77 namespace Dialog {
79 class InkscapePreferences : public UI::Widget::Panel {
80 public:
81 virtual ~InkscapePreferences();
83 static InkscapePreferences &getInstance() { return *new InkscapePreferences(); }
85 protected:
86 Gtk::Frame _page_frame;
87 Gtk::Label _page_title;
88 Gtk::TreeView _page_list;
89 Glib::RefPtr<Gtk::TreeStore> _page_list_model;
91 //Pagelist model columns:
92 class PageListModelColumns : public Gtk::TreeModel::ColumnRecord
93 {
94 public:
95 PageListModelColumns()
96 { Gtk::TreeModelColumnRecord::add(_col_name); Gtk::TreeModelColumnRecord::add(_col_page); Gtk::TreeModelColumnRecord::add(_col_id); }
97 Gtk::TreeModelColumn<Glib::ustring> _col_name;
98 Gtk::TreeModelColumn<int> _col_id;
99 Gtk::TreeModelColumn<DialogPage*> _col_page;
100 };
101 PageListModelColumns _page_list_columns;
103 Gtk::TreeModel::Path _path_tools;
104 Gtk::TreeModel::Path _path_shapes;
106 DialogPage _page_mouse, _page_scrolling, _page_steps, _page_tools, _page_windows,
107 _page_clones, _page_mask, _page_transforms, _page_filters, _page_select,
108 _page_importexport, _page_cms, _page_grids, _page_misc;
109 DialogPage _page_selector, _page_node, _page_tweak, _page_zoom, _page_shapes, _page_pencil, _page_pen,
110 _page_calligraphy, _page_text, _page_gradient, _page_connector, _page_dropper;
111 DialogPage _page_rectangle, _page_3dbox, _page_ellipse, _page_star, _page_spiral, _page_paintbucket;
113 PrefSpinButton _mouse_sens, _mouse_thres;
114 PrefCheckButton _mouse_use_ext_input;
116 PrefSpinButton _scroll_wheel, _scroll_arrow_px, _scroll_arrow_acc, _scroll_auto_speed, _scroll_auto_thres;
117 PrefCheckButton _scroll_space;
118 PrefCheckButton _wheel_zoom;
120 PrefCombo _steps_rot_snap;
121 PrefCheckButton _steps_compass;
122 PrefSpinButton _steps_arrow, _steps_scale, _steps_inset, _steps_zoom;
124 PrefRadioButton _t_sel_trans_obj, _t_sel_trans_outl, _t_sel_cue_none, _t_sel_cue_mark,
125 _t_sel_cue_box, _t_sel_bbox_visual, _t_sel_bbox_geometric;
127 PrefSpinButton _t_pencil_tolerance;
129 PrefRadioButton _win_dockable, _win_floating;
130 PrefRadioButton _win_ontop_none, _win_ontop_normal, _win_ontop_agressive;
131 PrefRadioButton _win_save_geom_off, _win_save_geom, _win_save_geom_prefs;
132 PrefCheckButton _win_hide_task, _win_zoom_resize , _win_show_close;
134 // FIXME: Temporary Win32 special code to enable transient dialogs
135 #ifdef WIN32
136 PrefCheckButton _win_ontop_win32;
137 #endif
139 PrefCheckButton _calligrapy_use_abs_size;
140 PrefCheckButton _calligrapy_keep_selected;
142 PrefCheckButton _connector_ignore_text;
144 PrefRadioButton _clone_option_parallel, _clone_option_stay, _clone_option_transform,
145 _clone_option_unlink, _clone_option_delete;
147 PrefCheckButton _mask_mask_on_top;
148 PrefCheckButton _mask_mask_remove;
150 PrefRadioButton _blur_quality_best, _blur_quality_better, _blur_quality_normal, _blur_quality_worse, _blur_quality_worst;
152 PrefCheckButton _trans_scale_stroke, _trans_scale_corner, _trans_gradient,_trans_pattern;
153 PrefRadioButton _trans_optimized, _trans_preserved;
155 PrefRadioButton _sel_all;
156 PrefRadioButton _sel_current;
157 PrefRadioButton _sel_recursive;
158 PrefCheckButton _sel_hidden, _sel_locked;
159 PrefCheckButton _sel_layer_deselects;
161 PrefSpinButton _importexport_export, _misc_recent, _misc_simpl;
162 PrefCheckButton _misc_comment, _misc_forkvectors, _misc_scripts;
163 PrefCheckButton _misc_small_toolbar;
164 PrefCheckButton _misc_small_tools;
165 PrefCombo _misc_overs_bitmap;
167 Gtk::ComboBoxText _cms_display_profile;
168 PrefCheckButton _cms_from_display;
169 PrefCombo _cms_intent;
171 PrefCheckButton _cms_softproof;
172 PrefCheckButton _cms_gamutwarn;
173 Gtk::ColorButton _cms_gamutcolor;
174 Gtk::ComboBoxText _cms_proof_profile;
175 PrefCombo _cms_proof_intent;
176 PrefCheckButton _cms_proof_blackpoint;
177 PrefCheckButton _cms_proof_preserveblack;
179 Gtk::Notebook _grids_notebook;
180 DialogPage _grids_xy, _grids_axonom;
181 // CanvasXYGrid properties:
182 PrefUnit _grids_xy_units;
183 PrefSpinButton _grids_xy_origin_x;
184 PrefSpinButton _grids_xy_origin_y;
185 PrefSpinButton _grids_xy_spacing_x;
186 PrefSpinButton _grids_xy_spacing_y;
187 PrefColorPicker _grids_xy_color;
188 PrefColorPicker _grids_xy_empcolor;
189 PrefSpinButton _grids_xy_empspacing;
190 PrefCheckButton _grids_xy_dotted;
191 // CanvasAxonomGrid properties:
192 PrefUnit _grids_axonom_units;
193 PrefSpinButton _grids_axonom_origin_x;
194 PrefSpinButton _grids_axonom_origin_y;
195 PrefSpinButton _grids_axonom_spacing_y;
196 PrefSpinButton _grids_axonom_angle_x;
197 PrefSpinButton _grids_axonom_angle_z;
198 PrefColorPicker _grids_axonom_color;
199 PrefColorPicker _grids_axonom_empcolor;
200 PrefSpinButton _grids_axonom_empspacing;
202 PrefEntryButtonHBox _importexport_ocal_url;
203 PrefEntry _importexport_ocal_username;
204 PrefEntry _importexport_ocal_password;
206 int _max_dialog_width;
207 int _max_dialog_height;
208 int _sb_width;
209 DialogPage* _current_page;
211 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, int id);
212 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent, int id);
213 bool SetMaxDialogSize(const Gtk::TreeModel::iterator& iter);
214 bool PresentPage(const Gtk::TreeModel::iterator& iter);
216 static void AddSelcueCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
217 static void AddGradientCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
218 static void AddConvertGuidesCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
219 static void AddNewObjectsStyle(DialogPage& p, const std::string& prefs_path);
221 void on_pagelist_selection_changed();
222 void initPageMouse();
223 void initPageScrolling();
224 void initPageSteps();
225 void initPageTools();
226 void initPageWindows();
227 void initPageClones();
228 void initPageMasks();
229 void initPageTransforms();
230 void initPageFilters();
231 void initPageSelecting();
232 void initPageImportExport();
233 void initPageCMS();
234 void initPageGrids();
235 void initPageMisc();
237 void _presentPages();
239 private:
240 InkscapePreferences();
241 InkscapePreferences(InkscapePreferences const &d);
242 InkscapePreferences operator=(InkscapePreferences const &d);
243 };
245 } // namespace Dialog
246 } // namespace UI
247 } // namespace Inkscape
249 #endif //INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
251 /*
252 Local Variables:
253 mode:c++
254 c-file-style:"stroustrup"
255 c-file-offsets:((innamespace . 0)(inline-open . 0))
256 indent-tabs-mode:nil
257 fill-column:99
258 End:
259 */
260 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :