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_MISC
66 };
68 using namespace Inkscape::UI::Widget;
70 namespace Inkscape {
71 namespace UI {
72 namespace Dialog {
74 class InkscapePreferences : public Dialog {
75 public:
76 virtual ~InkscapePreferences();
78 static InkscapePreferences *create() {return new InkscapePreferences(); }
79 void present();
81 protected:
82 Gtk::Frame _page_frame;
83 Gtk::Label _page_title;
84 Gtk::TreeView _page_list;
85 Glib::RefPtr<Gtk::TreeStore> _page_list_model;
87 //Pagelist model columns:
88 class PageListModelColumns : public Gtk::TreeModel::ColumnRecord
89 {
90 public:
91 PageListModelColumns()
92 { Gtk::TreeModelColumnRecord::add(_col_name); Gtk::TreeModelColumnRecord::add(_col_page); Gtk::TreeModelColumnRecord::add(_col_id); }
93 Gtk::TreeModelColumn<Glib::ustring> _col_name;
94 Gtk::TreeModelColumn<int> _col_id;
95 Gtk::TreeModelColumn<DialogPage*> _col_page;
96 };
97 PageListModelColumns _page_list_columns;
99 Gtk::TreeModel::Path _path_tools;
100 Gtk::TreeModel::Path _path_shapes;
102 DialogPage _page_mouse, _page_scrolling, _page_steps, _page_tools, _page_windows,
103 _page_clones, _page_mask, _page_transforms, _page_filters, _page_select, _page_misc;
104 DialogPage _page_selector, _page_node, _page_zoom, _page_shapes, _page_pencil, _page_pen,
105 _page_calligraphy, _page_text, _page_gradient, _page_connector, _page_dropper;
106 DialogPage _page_rectangle, _page_3dbox, _page_ellipse, _page_star, _page_spiral, _page_paintbucket;
108 PrefSpinButton _mouse_sens, _mouse_thres;
109 PrefCheckButton _mouse_use_ext_input;
111 PrefSpinButton _scroll_wheel, _scroll_arrow_px, _scroll_arrow_acc, _scroll_auto_speed, _scroll_auto_thres;
112 PrefCheckButton _scroll_space;
113 PrefCheckButton _wheel_zoom;
115 PrefCombo _steps_rot_snap;
116 PrefCheckButton _steps_compass;
117 PrefSpinButton _steps_arrow, _steps_scale, _steps_inset, _steps_zoom;
119 PrefRadioButton _t_sel_trans_obj, _t_sel_trans_outl, _t_sel_cue_none, _t_sel_cue_mark,
120 _t_sel_cue_box, _t_sel_bbox_visual, _t_sel_bbox_geometric;
122 PrefSpinButton _t_pencil_tolerance;
124 PrefRadioButton _win_ontop_none, _win_ontop_normal, _win_ontop_agressive;
125 PrefRadioButton _win_save_geom_off, _win_save_geom, _win_save_geom_prefs;
126 PrefCheckButton _win_hide_task, _win_zoom_resize , _win_show_close;
128 // FIXME: Temporary Win32 special code to enable transient dialogs
129 #ifdef WIN32
130 PrefCheckButton _win_ontop_win32;
131 #endif
133 PrefCheckButton _calligrapy_use_abs_size;
134 PrefCheckButton _calligrapy_keep_selected;
136 PrefCheckButton _connector_ignore_text;
138 PrefRadioButton _clone_option_parallel, _clone_option_stay, _clone_option_transform,
139 _clone_option_unlink, _clone_option_delete;
141 PrefCheckButton _mask_mask_on_top;
142 PrefCheckButton _mask_mask_remove;
144 PrefRadioButton _blur_quality_best, _blur_quality_better, _blur_quality_normal, _blur_quality_worse, _blur_quality_worst;
146 PrefCheckButton _trans_scale_stroke, _trans_scale_corner, _trans_gradient,_trans_pattern;
147 PrefRadioButton _trans_optimized, _trans_preserved;
149 PrefRadioButton _sel_all;
150 PrefRadioButton _sel_current;
151 PrefRadioButton _sel_recursive;
152 PrefCheckButton _sel_hidden, _sel_locked;
153 PrefCheckButton _sel_layer_deselects;
155 PrefSpinButton _misc_export, _misc_recent, _misc_simpl;
156 PrefCheckButton _misc_imp_bitmap, _misc_comment, _misc_scripts;
157 PrefCheckButton _misc_small_toolbar;
158 PrefCombo _misc_overs_bitmap;
159 PrefEntry _misc_ocal_url;
160 PrefEntry _misc_ocal_username;
161 PrefEntry _misc_ocal_password;
163 int _max_dialog_width;
164 int _max_dialog_height;
165 int _sb_width;
166 DialogPage* _current_page;
168 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, int id);
169 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent, int id);
170 bool SetMaxDialogSize(const Gtk::TreeModel::iterator& iter);
171 bool PresentPage(const Gtk::TreeModel::iterator& iter);
173 static void AddSelcueCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
174 static void AddGradientCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
175 static void AddNewObjectsStyle(DialogPage& p, const std::string& prefs_path);
177 void on_pagelist_selection_changed();
178 void initPageMouse();
179 void initPageScrolling();
180 void initPageSteps();
181 void initPageTools();
182 void initPageWindows();
183 void initPageClones();
184 void initPageMasks();
185 void initPageTransforms();
186 void initPageFilters();
187 void initPageSelecting();
188 void initPageMisc();
190 private:
191 InkscapePreferences();
192 InkscapePreferences(InkscapePreferences const &d);
193 InkscapePreferences operator=(InkscapePreferences const &d);
194 };
196 } // namespace Dialog
197 } // namespace UI
198 } // namespace Inkscape
200 #endif //INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
202 /*
203 Local Variables:
204 mode:c++
205 c-file-style:"stroustrup"
206 c-file-offsets:((innamespace . 0)(inline-open . 0))
207 indent-tabs-mode:nil
208 fill-column:99
209 End:
210 */
211 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :