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_ELLIPSE,
46 PREFS_PAGE_TOOLS_SHAPES_STAR,
47 PREFS_PAGE_TOOLS_SHAPES_SPIRAL,
48 PREFS_PAGE_TOOLS_PENCIL,
49 PREFS_PAGE_TOOLS_PEN,
50 PREFS_PAGE_TOOLS_CALLIGRAPHY,
51 PREFS_PAGE_TOOLS_TEXT,
52 PREFS_PAGE_TOOLS_GRADIENT,
53 PREFS_PAGE_TOOLS_CONNECTOR,
54 PREFS_PAGE_TOOLS_DROPPER,
55 PREFS_PAGE_TOOLS_FLOOD,
56 PREFS_PAGE_WINDOWS,
57 PREFS_PAGE_CLONES,
58 PREFS_PAGE_FILTERS,
59 PREFS_PAGE_TRANSFORMS,
60 PREFS_PAGE_SELECTING,
61 PREFS_PAGE_MISC
62 };
64 using namespace Inkscape::UI::Widget;
66 namespace Inkscape {
67 namespace UI {
68 namespace Dialog {
70 class InkscapePreferences : public Dialog {
71 public:
72 virtual ~InkscapePreferences();
74 static InkscapePreferences *create() {return new InkscapePreferences(); }
75 void present();
77 protected:
78 Gtk::Frame _page_frame;
79 Gtk::Label _page_title;
80 Gtk::TreeView _page_list;
81 Glib::RefPtr<Gtk::TreeStore> _page_list_model;
83 //Pagelist model columns:
84 class PageListModelColumns : public Gtk::TreeModel::ColumnRecord
85 {
86 public:
87 PageListModelColumns()
88 { Gtk::TreeModelColumnRecord::add(_col_name); Gtk::TreeModelColumnRecord::add(_col_page); Gtk::TreeModelColumnRecord::add(_col_id); }
89 Gtk::TreeModelColumn<Glib::ustring> _col_name;
90 Gtk::TreeModelColumn<int> _col_id;
91 Gtk::TreeModelColumn<DialogPage*> _col_page;
92 };
93 PageListModelColumns _page_list_columns;
95 Gtk::TreeModel::Path _path_tools;
96 Gtk::TreeModel::Path _path_shapes;
98 DialogPage _page_mouse, _page_scrolling, _page_steps, _page_tools, _page_windows,
99 _page_clones, _page_transforms, _page_filters, _page_select, _page_misc;
100 DialogPage _page_selector, _page_node, _page_zoom, _page_shapes, _page_pencil, _page_pen,
101 _page_calligraphy, _page_text, _page_gradient, _page_connector, _page_dropper;
102 DialogPage _page_rectangle, _page_ellipse, _page_star, _page_spiral, _page_flood;
104 PrefSpinButton _mouse_sens, _mouse_thres;
106 PrefSpinButton _scroll_wheel, _scroll_arrow_px, _scroll_arrow_acc, _scroll_auto_speed, _scroll_auto_thres;
108 PrefCombo _steps_rot_snap;
109 PrefCheckButton _steps_compass;
110 PrefSpinButton _steps_arrow, _steps_scale, _steps_inset, _steps_zoom;
112 PrefRadioButton _t_sel_trans_obj, _t_sel_trans_outl, _t_sel_cue_none, _t_sel_cue_mark,
113 _t_sel_cue_box, _t_sel_org_edge, _t_sel_org_node;
115 PrefSpinButton _t_pencil_tolerance;
117 PrefRadioButton _win_ontop_none, _win_ontop_normal, _win_ontop_agressive;
118 PrefCheckButton _win_save_geom, _win_hide_task, _win_zoom_resize , _win_show_close;
120 // FIXME: Temporary Win32 special code to enable transient dialogs
121 #ifdef WIN32
122 PrefCheckButton _win_ontop_win32;
123 #endif
125 PrefCheckButton _calligrapy_use_abs_size;
126 PrefCheckButton _calligrapy_keep_selected;
128 PrefCheckButton _connector_ignore_text;
130 PrefRadioButton _clone_option_parallel, _clone_option_stay, _clone_option_transform,
131 _clone_option_unlink, _clone_option_delete;
133 PrefRadioButton _blur_quality_best, _blur_quality_better, _blur_quality_normal, _blur_quality_worse, _blur_quality_worst;
135 PrefCheckButton _trans_scale_stroke, _trans_scale_corner, _trans_gradient,_trans_pattern;
136 PrefRadioButton _trans_optimized, _trans_preserved;
138 PrefRadioButton _sel_all;
139 PrefRadioButton _sel_current;
140 PrefRadioButton _sel_recursive;
141 PrefCheckButton _sel_hidden, _sel_locked;
142 PrefCheckButton _sel_layer_deselects;
144 PrefSpinButton _misc_export, _misc_recent, _misc_simpl;
145 PrefCheckButton _misc_imp_bitmap, _misc_comment, _misc_scripts;
146 PrefCombo _misc_overs_bitmap;
147 PrefCheckButton _misc_mask_on_top;
148 PrefCheckButton _misc_mask_remove;
149 PrefCheckButton _misc_use_ext_input;
151 int _max_dialog_width;
152 int _max_dialog_height;
153 int _sb_width;
154 DialogPage* _current_page;
156 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, int id);
157 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent, int id);
158 bool SetMaxDialogSize(const Gtk::TreeModel::iterator& iter);
159 bool PresentPage(const Gtk::TreeModel::iterator& iter);
161 static void AddSelcueCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
162 static void AddGradientCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
163 static void AddNewObjectsStyle(DialogPage& p, const std::string& prefs_path);
165 void on_pagelist_selection_changed();
166 void initPageMouse();
167 void initPageScrolling();
168 void initPageSteps();
169 void initPageTools();
170 void initPageWindows();
171 void initPageClones();
172 void initPageTransforms();
173 void initPageFilters();
174 void initPageSelecting();
175 void initPageMisc();
177 private:
178 InkscapePreferences();
179 InkscapePreferences(InkscapePreferences const &d);
180 InkscapePreferences operator=(InkscapePreferences const &d);
181 };
183 } // namespace Dialog
184 } // namespace UI
185 } // namespace Inkscape
187 #endif //INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
189 /*
190 Local Variables:
191 mode:c++
192 c-file-style:"stroustrup"
193 c-file-offsets:((innamespace . 0)(inline-open . 0))
194 indent-tabs-mode:nil
195 fill-column:99
196 End:
197 */
198 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :