6798de21d40e9f8f5649fc5951a84e9bd2109582
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/comboboxtext.h>
22 #include <gtkmm/spinbutton.h>
23 #include <gtkmm/treestore.h>
24 #include <gtkmm/treeview.h>
25 #include <gtkmm/radiobutton.h>
26 #include <gtkmm/frame.h>
27 #include "ui/widget/preferences-widget.h"
28 #include <sigc++/sigc++.h>
29 #include <glibmm/i18n.h>
31 #include "dialog.h"
33 // UPDATE THIS IF YOU'RE ADDING PREFS PAGES.
34 // Otherwise the commands that open the dialog with the new page will fail.
36 enum {
37 PREFS_PAGE_MOUSE,
38 PREFS_PAGE_SCROLLING,
39 PREFS_PAGE_STEPS,
40 PREFS_PAGE_TOOLS,
41 PREFS_PAGE_TOOLS_SELECTOR,
42 PREFS_PAGE_TOOLS_NODE,
43 PREFS_PAGE_TOOLS_TWEAK,
44 PREFS_PAGE_TOOLS_ZOOM,
45 PREFS_PAGE_TOOLS_SHAPES,
46 PREFS_PAGE_TOOLS_SHAPES_RECT,
47 PREFS_PAGE_TOOLS_SHAPES_3DBOX,
48 PREFS_PAGE_TOOLS_SHAPES_ELLIPSE,
49 PREFS_PAGE_TOOLS_SHAPES_STAR,
50 PREFS_PAGE_TOOLS_SHAPES_SPIRAL,
51 PREFS_PAGE_TOOLS_PENCIL,
52 PREFS_PAGE_TOOLS_PEN,
53 PREFS_PAGE_TOOLS_CALLIGRAPHY,
54 PREFS_PAGE_TOOLS_PAINTBUCKET,
55 PREFS_PAGE_TOOLS_TEXT,
56 PREFS_PAGE_TOOLS_GRADIENT,
57 PREFS_PAGE_TOOLS_CONNECTOR,
58 PREFS_PAGE_TOOLS_DROPPER,
59 PREFS_PAGE_WINDOWS,
60 PREFS_PAGE_CLONES,
61 PREFS_PAGE_MASKS,
62 PREFS_PAGE_FILTERS,
63 PREFS_PAGE_TRANSFORMS,
64 PREFS_PAGE_SELECTING,
65 PREFS_PAGE_IMPORTEXPORT,
66 PREFS_PAGE_MISC
67 };
69 using namespace Inkscape::UI::Widget;
71 namespace Inkscape {
72 namespace UI {
73 namespace Dialog {
75 class InkscapePreferences : public Dialog {
76 public:
77 virtual ~InkscapePreferences();
79 static InkscapePreferences *create(Behavior::BehaviorFactory behavior_factory)
80 { return new InkscapePreferences(behavior_factory); }
82 void present();
84 protected:
85 Gtk::Frame _page_frame;
86 Gtk::Label _page_title;
87 Gtk::TreeView _page_list;
88 Glib::RefPtr<Gtk::TreeStore> _page_list_model;
90 //Pagelist model columns:
91 class PageListModelColumns : public Gtk::TreeModel::ColumnRecord
92 {
93 public:
94 PageListModelColumns()
95 { Gtk::TreeModelColumnRecord::add(_col_name); Gtk::TreeModelColumnRecord::add(_col_page); Gtk::TreeModelColumnRecord::add(_col_id); }
96 Gtk::TreeModelColumn<Glib::ustring> _col_name;
97 Gtk::TreeModelColumn<int> _col_id;
98 Gtk::TreeModelColumn<DialogPage*> _col_page;
99 };
100 PageListModelColumns _page_list_columns;
102 Gtk::TreeModel::Path _path_tools;
103 Gtk::TreeModel::Path _path_shapes;
105 DialogPage _page_mouse, _page_scrolling, _page_steps, _page_tools, _page_windows,
106 _page_clones, _page_mask, _page_transforms, _page_filters, _page_select,
107 _page_importexport, _page_misc;
108 DialogPage _page_selector, _page_node, _page_zoom, _page_shapes, _page_pencil, _page_pen,
109 _page_calligraphy, _page_text, _page_gradient, _page_connector, _page_dropper;
110 DialogPage _page_rectangle, _page_3dbox, _page_ellipse, _page_star, _page_spiral, _page_paintbucket;
112 PrefSpinButton _mouse_sens, _mouse_thres;
113 PrefCheckButton _mouse_use_ext_input;
115 PrefSpinButton _scroll_wheel, _scroll_arrow_px, _scroll_arrow_acc, _scroll_auto_speed, _scroll_auto_thres;
116 PrefCheckButton _scroll_space;
117 PrefCheckButton _wheel_zoom;
119 PrefCombo _steps_rot_snap;
120 PrefCheckButton _steps_compass;
121 PrefSpinButton _steps_arrow, _steps_scale, _steps_inset, _steps_zoom;
123 PrefRadioButton _t_sel_trans_obj, _t_sel_trans_outl, _t_sel_cue_none, _t_sel_cue_mark,
124 _t_sel_cue_box, _t_sel_bbox_visual, _t_sel_bbox_geometric;
126 PrefSpinButton _t_pencil_tolerance;
128 PrefRadioButton _win_dockable, _win_floating;
129 PrefRadioButton _win_ontop_none, _win_ontop_normal, _win_ontop_agressive;
130 PrefRadioButton _win_save_geom_off, _win_save_geom, _win_save_geom_prefs;
131 PrefCheckButton _win_hide_task, _win_zoom_resize , _win_show_close;
133 // FIXME: Temporary Win32 special code to enable transient dialogs
134 #ifdef WIN32
135 PrefCheckButton _win_ontop_win32;
136 #endif
138 PrefCheckButton _calligrapy_use_abs_size;
139 PrefCheckButton _calligrapy_keep_selected;
141 PrefCheckButton _connector_ignore_text;
143 PrefRadioButton _clone_option_parallel, _clone_option_stay, _clone_option_transform,
144 _clone_option_unlink, _clone_option_delete;
146 PrefCheckButton _mask_mask_on_top;
147 PrefCheckButton _mask_mask_remove;
149 PrefRadioButton _blur_quality_best, _blur_quality_better, _blur_quality_normal, _blur_quality_worse, _blur_quality_worst;
151 PrefCheckButton _trans_scale_stroke, _trans_scale_corner, _trans_gradient,_trans_pattern;
152 PrefRadioButton _trans_optimized, _trans_preserved;
154 PrefRadioButton _sel_all;
155 PrefRadioButton _sel_current;
156 PrefRadioButton _sel_recursive;
157 PrefCheckButton _sel_hidden, _sel_locked;
158 PrefCheckButton _sel_layer_deselects;
160 PrefSpinButton _importexport_export, _misc_recent, _misc_simpl;
161 PrefCheckButton _importexport_imp_bitmap, _misc_comment, _misc_scripts;
162 PrefCheckButton _misc_small_toolbar;
163 PrefCombo _misc_overs_bitmap;
164 PrefEntryButtonHBox _importexport_ocal_url;
165 PrefEntry _importexport_ocal_username;
166 PrefEntry _importexport_ocal_password;
168 int _max_dialog_width;
169 int _max_dialog_height;
170 int _sb_width;
171 DialogPage* _current_page;
173 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, int id);
174 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent, int id);
175 bool SetMaxDialogSize(const Gtk::TreeModel::iterator& iter);
176 bool PresentPage(const Gtk::TreeModel::iterator& iter);
178 static void AddSelcueCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
179 static void AddGradientCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
180 static void AddNewObjectsStyle(DialogPage& p, const std::string& prefs_path);
182 void on_pagelist_selection_changed();
183 void initPageMouse();
184 void initPageScrolling();
185 void initPageSteps();
186 void initPageTools();
187 void initPageWindows();
188 void initPageClones();
189 void initPageMasks();
190 void initPageTransforms();
191 void initPageFilters();
192 void initPageSelecting();
193 void initPageImportExport();
194 void initPageMisc();
196 private:
197 InkscapePreferences(Behavior::BehaviorFactory behavior_factory);
198 InkscapePreferences(InkscapePreferences const &d);
199 InkscapePreferences operator=(InkscapePreferences const &d);
200 };
202 } // namespace Dialog
203 } // namespace UI
204 } // namespace Inkscape
206 #endif //INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
208 /*
209 Local Variables:
210 mode:c++
211 c-file-style:"stroustrup"
212 c-file-offsets:((innamespace . 0)(inline-open . 0))
213 indent-tabs-mode:nil
214 fill-column:99
215 End:
216 */
217 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :