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 "ui/widget/preferences-widget.h"
29 #include <sigc++/sigc++.h>
30 #include <glibmm/i18n.h>
32 #include "ui/widget/panel.h"
34 // UPDATE THIS IF YOU'RE ADDING PREFS PAGES.
35 // Otherwise the commands that open the dialog with the new page will fail.
37 enum {
38 PREFS_PAGE_MOUSE,
39 PREFS_PAGE_SCROLLING,
40 PREFS_PAGE_STEPS,
41 PREFS_PAGE_TOOLS,
42 PREFS_PAGE_TOOLS_SELECTOR,
43 PREFS_PAGE_TOOLS_NODE,
44 PREFS_PAGE_TOOLS_TWEAK,
45 PREFS_PAGE_TOOLS_ZOOM,
46 PREFS_PAGE_TOOLS_SHAPES,
47 PREFS_PAGE_TOOLS_SHAPES_RECT,
48 PREFS_PAGE_TOOLS_SHAPES_3DBOX,
49 PREFS_PAGE_TOOLS_SHAPES_ELLIPSE,
50 PREFS_PAGE_TOOLS_SHAPES_STAR,
51 PREFS_PAGE_TOOLS_SHAPES_SPIRAL,
52 PREFS_PAGE_TOOLS_PENCIL,
53 PREFS_PAGE_TOOLS_PEN,
54 PREFS_PAGE_TOOLS_CALLIGRAPHY,
55 PREFS_PAGE_TOOLS_PAINTBUCKET,
56 PREFS_PAGE_TOOLS_TEXT,
57 PREFS_PAGE_TOOLS_GRADIENT,
58 PREFS_PAGE_TOOLS_CONNECTOR,
59 PREFS_PAGE_TOOLS_DROPPER,
60 PREFS_PAGE_WINDOWS,
61 PREFS_PAGE_CLONES,
62 PREFS_PAGE_MASKS,
63 PREFS_PAGE_FILTERS,
64 PREFS_PAGE_TRANSFORMS,
65 PREFS_PAGE_SELECTING,
66 PREFS_PAGE_IMPORTEXPORT,
67 PREFS_PAGE_CMS,
68 PREFS_PAGE_MISC
69 };
71 using namespace Inkscape::UI::Widget;
73 namespace Inkscape {
74 namespace UI {
75 namespace Dialog {
77 class InkscapePreferences : public UI::Widget::Panel {
78 public:
79 virtual ~InkscapePreferences();
81 static InkscapePreferences &getInstance() { return *new InkscapePreferences(); }
83 protected:
84 Gtk::Frame _page_frame;
85 Gtk::Label _page_title;
86 Gtk::TreeView _page_list;
87 Glib::RefPtr<Gtk::TreeStore> _page_list_model;
89 //Pagelist model columns:
90 class PageListModelColumns : public Gtk::TreeModel::ColumnRecord
91 {
92 public:
93 PageListModelColumns()
94 { Gtk::TreeModelColumnRecord::add(_col_name); Gtk::TreeModelColumnRecord::add(_col_page); Gtk::TreeModelColumnRecord::add(_col_id); }
95 Gtk::TreeModelColumn<Glib::ustring> _col_name;
96 Gtk::TreeModelColumn<int> _col_id;
97 Gtk::TreeModelColumn<DialogPage*> _col_page;
98 };
99 PageListModelColumns _page_list_columns;
101 Gtk::TreeModel::Path _path_tools;
102 Gtk::TreeModel::Path _path_shapes;
104 DialogPage _page_mouse, _page_scrolling, _page_steps, _page_tools, _page_windows,
105 _page_clones, _page_mask, _page_transforms, _page_filters, _page_select,
106 _page_importexport, _page_cms, _page_misc;
107 DialogPage _page_selector, _page_node, _page_zoom, _page_shapes, _page_pencil, _page_pen,
108 _page_calligraphy, _page_text, _page_gradient, _page_connector, _page_dropper;
109 DialogPage _page_rectangle, _page_3dbox, _page_ellipse, _page_star, _page_spiral, _page_paintbucket;
111 PrefSpinButton _mouse_sens, _mouse_thres;
112 PrefCheckButton _mouse_use_ext_input;
114 PrefSpinButton _scroll_wheel, _scroll_arrow_px, _scroll_arrow_acc, _scroll_auto_speed, _scroll_auto_thres;
115 PrefCheckButton _scroll_space;
116 PrefCheckButton _wheel_zoom;
118 PrefCombo _steps_rot_snap;
119 PrefCheckButton _steps_compass;
120 PrefSpinButton _steps_arrow, _steps_scale, _steps_inset, _steps_zoom;
122 PrefRadioButton _t_sel_trans_obj, _t_sel_trans_outl, _t_sel_cue_none, _t_sel_cue_mark,
123 _t_sel_cue_box, _t_sel_bbox_visual, _t_sel_bbox_geometric;
125 PrefSpinButton _t_pencil_tolerance;
127 PrefRadioButton _win_dockable, _win_floating;
128 PrefRadioButton _win_ontop_none, _win_ontop_normal, _win_ontop_agressive;
129 PrefRadioButton _win_save_geom_off, _win_save_geom, _win_save_geom_prefs;
130 PrefCheckButton _win_hide_task, _win_zoom_resize , _win_show_close;
132 // FIXME: Temporary Win32 special code to enable transient dialogs
133 #ifdef WIN32
134 PrefCheckButton _win_ontop_win32;
135 #endif
137 PrefCheckButton _calligrapy_use_abs_size;
138 PrefCheckButton _calligrapy_keep_selected;
140 PrefCheckButton _connector_ignore_text;
142 PrefRadioButton _clone_option_parallel, _clone_option_stay, _clone_option_transform,
143 _clone_option_unlink, _clone_option_delete;
145 PrefCheckButton _mask_mask_on_top;
146 PrefCheckButton _mask_mask_remove;
148 PrefRadioButton _blur_quality_best, _blur_quality_better, _blur_quality_normal, _blur_quality_worse, _blur_quality_worst;
150 PrefCheckButton _trans_scale_stroke, _trans_scale_corner, _trans_gradient,_trans_pattern;
151 PrefRadioButton _trans_optimized, _trans_preserved;
153 PrefRadioButton _sel_all;
154 PrefRadioButton _sel_current;
155 PrefRadioButton _sel_recursive;
156 PrefCheckButton _sel_hidden, _sel_locked;
157 PrefCheckButton _sel_layer_deselects;
159 PrefSpinButton _importexport_export, _misc_recent, _misc_simpl;
160 PrefCheckButton _misc_comment, _misc_forkvectors, _misc_scripts;
161 PrefCheckButton _misc_small_toolbar;
162 PrefCheckButton _misc_small_tools;
163 PrefCombo _misc_overs_bitmap;
165 Gtk::ComboBoxText _cms_display_profile;
166 PrefCheckButton _cms_from_display;
167 PrefCombo _cms_intent;
169 PrefCheckButton _cms_softproof;
170 PrefCheckButton _cms_gamutwarn;
171 Gtk::ColorButton _cms_gamutcolor;
172 Gtk::ComboBoxText _cms_proof_profile;
173 PrefCombo _cms_proof_intent;
174 PrefCheckButton _cms_proof_blackpoint;
175 PrefCheckButton _cms_proof_preserveblack;
177 PrefEntryButtonHBox _importexport_ocal_url;
178 PrefEntry _importexport_ocal_username;
179 PrefEntry _importexport_ocal_password;
181 int _max_dialog_width;
182 int _max_dialog_height;
183 int _sb_width;
184 DialogPage* _current_page;
186 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, int id);
187 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent, int id);
188 bool SetMaxDialogSize(const Gtk::TreeModel::iterator& iter);
189 bool PresentPage(const Gtk::TreeModel::iterator& iter);
191 static void AddSelcueCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
192 static void AddGradientCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
193 static void AddNewObjectsStyle(DialogPage& p, const std::string& prefs_path);
195 void on_pagelist_selection_changed();
196 void initPageMouse();
197 void initPageScrolling();
198 void initPageSteps();
199 void initPageTools();
200 void initPageWindows();
201 void initPageClones();
202 void initPageMasks();
203 void initPageTransforms();
204 void initPageFilters();
205 void initPageSelecting();
206 void initPageImportExport();
207 void initPageCMS();
208 void initPageMisc();
210 void _presentPages();
212 private:
213 InkscapePreferences();
214 InkscapePreferences(InkscapePreferences const &d);
215 InkscapePreferences operator=(InkscapePreferences const &d);
216 };
218 } // namespace Dialog
219 } // namespace UI
220 } // namespace Inkscape
222 #endif //INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
224 /*
225 Local Variables:
226 mode:c++
227 c-file-style:"stroustrup"
228 c-file-offsets:((innamespace . 0)(inline-open . 0))
229 indent-tabs-mode:nil
230 fill-column:99
231 End:
232 */
233 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :