a6da63617d3cba7145fc912450e607e58163acbc
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 "dialog.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 Dialog {
78 public:
79 virtual ~InkscapePreferences();
81 static InkscapePreferences *create(Behavior::BehaviorFactory behavior_factory)
82 { return new InkscapePreferences(behavior_factory); }
84 void present();
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_misc;
110 DialogPage _page_selector, _page_node, _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;
114 PrefSpinButton _mouse_sens, _mouse_thres;
115 PrefCheckButton _mouse_use_ext_input;
117 PrefSpinButton _scroll_wheel, _scroll_arrow_px, _scroll_arrow_acc, _scroll_auto_speed, _scroll_auto_thres;
118 PrefCheckButton _scroll_space;
119 PrefCheckButton _wheel_zoom;
121 PrefCombo _steps_rot_snap;
122 PrefCheckButton _steps_compass;
123 PrefSpinButton _steps_arrow, _steps_scale, _steps_inset, _steps_zoom;
125 PrefRadioButton _t_sel_trans_obj, _t_sel_trans_outl, _t_sel_cue_none, _t_sel_cue_mark,
126 _t_sel_cue_box, _t_sel_bbox_visual, _t_sel_bbox_geometric;
128 PrefSpinButton _t_pencil_tolerance;
130 PrefRadioButton _win_dockable, _win_floating;
131 PrefRadioButton _win_ontop_none, _win_ontop_normal, _win_ontop_agressive;
132 PrefRadioButton _win_save_geom_off, _win_save_geom, _win_save_geom_prefs;
133 PrefCheckButton _win_hide_task, _win_zoom_resize , _win_show_close;
135 // FIXME: Temporary Win32 special code to enable transient dialogs
136 #ifdef WIN32
137 PrefCheckButton _win_ontop_win32;
138 #endif
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;
153 PrefCheckButton _trans_scale_stroke, _trans_scale_corner, _trans_gradient,_trans_pattern;
154 PrefRadioButton _trans_optimized, _trans_preserved;
156 PrefRadioButton _sel_all;
157 PrefRadioButton _sel_current;
158 PrefRadioButton _sel_recursive;
159 PrefCheckButton _sel_hidden, _sel_locked;
160 PrefCheckButton _sel_layer_deselects;
162 PrefSpinButton _importexport_export, _misc_recent, _misc_simpl;
163 PrefCheckButton _misc_comment, _misc_forkvectors, _misc_scripts;
164 PrefCheckButton _misc_small_toolbar;
165 PrefCheckButton _misc_small_tools;
166 PrefCombo _misc_overs_bitmap;
168 PrefCheckButton _cms_display;
169 Gtk::ComboBoxText _cms_display_profile;
170 PrefCombo _cms_intent;
172 PrefCheckButton _cms_softproof;
173 PrefCheckButton _cms_gamutwarn;
174 Gtk::ColorButton _cms_gamutcolor;
175 Gtk::ComboBoxText _cms_proof_profile;
176 PrefCombo _cms_proof_intent;
177 PrefCheckButton _cms_proof_blackpoint;
178 PrefCheckButton _cms_proof_preserveblack;
180 PrefEntryButtonHBox _importexport_ocal_url;
181 PrefEntry _importexport_ocal_username;
182 PrefEntry _importexport_ocal_password;
184 int _max_dialog_width;
185 int _max_dialog_height;
186 int _sb_width;
187 DialogPage* _current_page;
189 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, int id);
190 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent, int id);
191 bool SetMaxDialogSize(const Gtk::TreeModel::iterator& iter);
192 bool PresentPage(const Gtk::TreeModel::iterator& iter);
194 static void AddSelcueCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
195 static void AddGradientCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
196 static void AddNewObjectsStyle(DialogPage& p, const std::string& prefs_path);
198 void on_pagelist_selection_changed();
199 void initPageMouse();
200 void initPageScrolling();
201 void initPageSteps();
202 void initPageTools();
203 void initPageWindows();
204 void initPageClones();
205 void initPageMasks();
206 void initPageTransforms();
207 void initPageFilters();
208 void initPageSelecting();
209 void initPageImportExport();
210 void initPageCMS();
211 void initPageMisc();
213 private:
214 InkscapePreferences(Behavior::BehaviorFactory behavior_factory);
215 InkscapePreferences(InkscapePreferences const &d);
216 InkscapePreferences operator=(InkscapePreferences const &d);
217 };
219 } // namespace Dialog
220 } // namespace UI
221 } // namespace Inkscape
223 #endif //INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
225 /*
226 Local Variables:
227 mode:c++
228 c-file-style:"stroustrup"
229 c-file-offsets:((innamespace . 0)(inline-open . 0))
230 indent-tabs-mode:nil
231 fill-column:99
232 End:
233 */
234 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :