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