fc3adb20a3a783f4d68f21ab3312b7a48fc007b4
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 *
9 * Copyright (C) 2004-2007 Authors
10 *
11 * Released under GNU GPL. Read the file 'COPYING' for more information.
12 */
14 #ifndef INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
15 #define INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
17 #include <iostream>
18 #include <vector>
19 #include <gtkmm/table.h>
20 #include <gtkmm/comboboxtext.h>
21 #include <gtkmm/spinbutton.h>
22 #include <gtkmm/treestore.h>
23 #include <gtkmm/treeview.h>
24 #include <gtkmm/radiobutton.h>
25 #include <gtkmm/frame.h>
26 #include "ui/widget/preferences-widget.h"
27 #include <sigc++/sigc++.h>
28 #include <glibmm/i18n.h>
30 #include "dialog.h"
32 // UPDATE THIS IF YOU'RE ADDING PREFS PAGES.
33 // Otherwise the commands that open the dialog with the new page will fail.
35 enum {
36 PREFS_PAGE_MOUSE,
37 PREFS_PAGE_SCROLLING,
38 PREFS_PAGE_STEPS,
39 PREFS_PAGE_TOOLS,
40 PREFS_PAGE_TOOLS_SELECTOR,
41 PREFS_PAGE_TOOLS_NODE,
42 PREFS_PAGE_TOOLS_ZOOM,
43 PREFS_PAGE_TOOLS_SHAPES,
44 PREFS_PAGE_TOOLS_SHAPES_RECT,
45 PREFS_PAGE_TOOLS_SHAPES_3DBOX,
46 PREFS_PAGE_TOOLS_SHAPES_ELLIPSE,
47 PREFS_PAGE_TOOLS_SHAPES_STAR,
48 PREFS_PAGE_TOOLS_SHAPES_SPIRAL,
49 PREFS_PAGE_TOOLS_PENCIL,
50 PREFS_PAGE_TOOLS_PEN,
51 PREFS_PAGE_TOOLS_CALLIGRAPHY,
52 PREFS_PAGE_TOOLS_PAINTBUCKET,
53 PREFS_PAGE_TOOLS_TEXT,
54 PREFS_PAGE_TOOLS_GRADIENT,
55 PREFS_PAGE_TOOLS_CONNECTOR,
56 PREFS_PAGE_TOOLS_DROPPER,
57 PREFS_PAGE_WINDOWS,
58 PREFS_PAGE_CLONES,
59 PREFS_PAGE_MASKS,
60 PREFS_PAGE_FILTERS,
61 PREFS_PAGE_TRANSFORMS,
62 PREFS_PAGE_SELECTING,
63 PREFS_PAGE_MISC
64 };
66 using namespace Inkscape::UI::Widget;
68 namespace Inkscape {
69 namespace UI {
70 namespace Dialog {
72 class InkscapePreferences : public Dialog {
73 public:
74 virtual ~InkscapePreferences();
76 static InkscapePreferences *create() {return new InkscapePreferences(); }
77 void present();
79 protected:
80 Gtk::Frame _page_frame;
81 Gtk::Label _page_title;
82 Gtk::TreeView _page_list;
83 Glib::RefPtr<Gtk::TreeStore> _page_list_model;
85 //Pagelist model columns:
86 class PageListModelColumns : public Gtk::TreeModel::ColumnRecord
87 {
88 public:
89 PageListModelColumns()
90 { Gtk::TreeModelColumnRecord::add(_col_name); Gtk::TreeModelColumnRecord::add(_col_page); Gtk::TreeModelColumnRecord::add(_col_id); }
91 Gtk::TreeModelColumn<Glib::ustring> _col_name;
92 Gtk::TreeModelColumn<int> _col_id;
93 Gtk::TreeModelColumn<DialogPage*> _col_page;
94 };
95 PageListModelColumns _page_list_columns;
97 Gtk::TreeModel::Path _path_tools;
98 Gtk::TreeModel::Path _path_shapes;
100 DialogPage _page_mouse, _page_scrolling, _page_steps, _page_tools, _page_windows,
101 _page_clones, _page_mask, _page_transforms, _page_filters, _page_select, _page_misc;
102 DialogPage _page_selector, _page_node, _page_zoom, _page_shapes, _page_pencil, _page_pen,
103 _page_calligraphy, _page_text, _page_gradient, _page_connector, _page_dropper;
104 DialogPage _page_rectangle, _page_3dbox, _page_ellipse, _page_star, _page_spiral, _page_paintbucket;
106 PrefSpinButton _mouse_sens, _mouse_thres;
107 PrefCheckButton _mouse_use_ext_input;
109 PrefSpinButton _scroll_wheel, _scroll_arrow_px, _scroll_arrow_acc, _scroll_auto_speed, _scroll_auto_thres;
110 PrefCheckButton _scroll_space;
111 PrefCheckButton _wheel_zoom;
113 PrefCombo _steps_rot_snap;
114 PrefCheckButton _steps_compass;
115 PrefSpinButton _steps_arrow, _steps_scale, _steps_inset, _steps_zoom;
117 PrefRadioButton _t_sel_trans_obj, _t_sel_trans_outl, _t_sel_cue_none, _t_sel_cue_mark,
118 _t_sel_cue_box, _t_sel_bbox_visual, _t_sel_bbox_geometric;
120 PrefSpinButton _t_pencil_tolerance;
122 PrefRadioButton _win_ontop_none, _win_ontop_normal, _win_ontop_agressive;
123 PrefRadioButton _win_save_geom_off, _win_save_geom, _win_save_geom_prefs;
124 PrefCheckButton _win_hide_task, _win_zoom_resize , _win_show_close;
126 // FIXME: Temporary Win32 special code to enable transient dialogs
127 #ifdef WIN32
128 PrefCheckButton _win_ontop_win32;
129 #endif
131 PrefCheckButton _calligrapy_use_abs_size;
132 PrefCheckButton _calligrapy_keep_selected;
134 PrefCheckButton _connector_ignore_text;
136 PrefRadioButton _clone_option_parallel, _clone_option_stay, _clone_option_transform,
137 _clone_option_unlink, _clone_option_delete;
139 PrefCheckButton _mask_mask_on_top;
140 PrefCheckButton _mask_mask_remove;
142 PrefRadioButton _blur_quality_best, _blur_quality_better, _blur_quality_normal, _blur_quality_worse, _blur_quality_worst;
144 PrefCheckButton _trans_scale_stroke, _trans_scale_corner, _trans_gradient,_trans_pattern;
145 PrefRadioButton _trans_optimized, _trans_preserved;
147 PrefRadioButton _sel_all;
148 PrefRadioButton _sel_current;
149 PrefRadioButton _sel_recursive;
150 PrefCheckButton _sel_hidden, _sel_locked;
151 PrefCheckButton _sel_layer_deselects;
153 PrefSpinButton _misc_export, _misc_recent, _misc_simpl;
154 PrefCheckButton _misc_imp_bitmap, _misc_comment, _misc_scripts;
155 PrefCheckButton _misc_small_toolbar;
156 PrefCombo _misc_overs_bitmap;
158 int _max_dialog_width;
159 int _max_dialog_height;
160 int _sb_width;
161 DialogPage* _current_page;
163 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, int id);
164 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent, int id);
165 bool SetMaxDialogSize(const Gtk::TreeModel::iterator& iter);
166 bool PresentPage(const Gtk::TreeModel::iterator& iter);
168 static void AddSelcueCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
169 static void AddGradientCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
170 static void AddNewObjectsStyle(DialogPage& p, const std::string& prefs_path);
172 void on_pagelist_selection_changed();
173 void initPageMouse();
174 void initPageScrolling();
175 void initPageSteps();
176 void initPageTools();
177 void initPageWindows();
178 void initPageClones();
179 void initPageMasks();
180 void initPageTransforms();
181 void initPageFilters();
182 void initPageSelecting();
183 void initPageMisc();
185 private:
186 InkscapePreferences();
187 InkscapePreferences(InkscapePreferences const &d);
188 InkscapePreferences operator=(InkscapePreferences const &d);
189 };
191 } // namespace Dialog
192 } // namespace UI
193 } // namespace Inkscape
195 #endif //INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
197 /*
198 Local Variables:
199 mode:c++
200 c-file-style:"stroustrup"
201 c-file-offsets:((innamespace . 0)(inline-open . 0))
202 indent-tabs-mode:nil
203 fill-column:99
204 End:
205 */
206 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :