1 /**
2 * \brief Inkscape Preferences dialog
3 *
4 * Authors:
5 * Carl Hetherington
6 * Marco Scholten
7 *
8 * Copyright (C) 2004, 2006 Authors
9 *
10 * Released under GNU GPL. Read the file 'COPYING' for more information.
11 */
13 #ifndef INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
14 #define INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
16 #include <iostream>
17 #include <vector>
18 #include <gtkmm/table.h>
19 #include <gtkmm/comboboxtext.h>
20 #include <gtkmm/spinbutton.h>
21 #include <gtkmm/treestore.h>
22 #include <gtkmm/treeview.h>
23 #include <gtkmm/radiobutton.h>
24 #include <gtkmm/frame.h>
25 #include "ui/widget/preferences-widget.h"
26 #include <sigc++/sigc++.h>
27 #include <glibmm/i18n.h>
29 #include "dialog.h"
31 // UPDATE THIS IF YOU'RE ADDING PREFS PAGES.
32 // Otherwise the commands that open the dialog with the new page will fail.
34 enum {
35 PREFS_PAGE_MOUSE,
36 PREFS_PAGE_SCROLLING,
37 PREFS_PAGE_STEPS,
38 PREFS_PAGE_TOOLS,
39 PREFS_PAGE_TOOLS_SELECTOR,
40 PREFS_PAGE_TOOLS_NODE,
41 PREFS_PAGE_TOOLS_ZOOM,
42 PREFS_PAGE_TOOLS_SHAPES,
43 PREFS_PAGE_TOOLS_SHAPES_RECT,
44 PREFS_PAGE_TOOLS_SHAPES_ELLIPSE,
45 PREFS_PAGE_TOOLS_SHAPES_STAR,
46 PREFS_PAGE_TOOLS_SHAPES_SPIRAL,
47 PREFS_PAGE_TOOLS_PENCIL,
48 PREFS_PAGE_TOOLS_PEN,
49 PREFS_PAGE_TOOLS_CALLIGRAPHY,
50 PREFS_PAGE_TOOLS_TEXT,
51 PREFS_PAGE_TOOLS_GRADIENT,
52 PREFS_PAGE_TOOLS_CONNECTOR,
53 PREFS_PAGE_TOOLS_DROPPER,
54 PREFS_PAGE_WINDOWS,
55 PREFS_PAGE_CLONES,
56 PREFS_PAGE_TRANSFORMS,
57 PREFS_PAGE_SELECTING,
58 PREFS_PAGE_MISC
59 };
61 using namespace Inkscape::UI::Widget;
63 namespace Inkscape {
64 namespace UI {
65 namespace Dialog {
67 class InkscapePreferences : public Dialog {
68 public:
69 virtual ~InkscapePreferences();
71 static InkscapePreferences *create() {return new InkscapePreferences(); }
72 void present();
74 protected:
75 Gtk::Frame _page_frame;
76 Gtk::Label _page_title;
77 Gtk::TreeView _page_list;
78 Glib::RefPtr<Gtk::TreeStore> _page_list_model;
80 //Pagelist model columns:
81 class PageListModelColumns : public Gtk::TreeModel::ColumnRecord
82 {
83 public:
84 PageListModelColumns()
85 { Gtk::TreeModelColumnRecord::add(_col_name); Gtk::TreeModelColumnRecord::add(_col_page); Gtk::TreeModelColumnRecord::add(_col_id); }
86 Gtk::TreeModelColumn<Glib::ustring> _col_name;
87 Gtk::TreeModelColumn<int> _col_id;
88 Gtk::TreeModelColumn<DialogPage*> _col_page;
89 };
90 PageListModelColumns _page_list_columns;
92 Gtk::TreeModel::Path _path_tools;
93 Gtk::TreeModel::Path _path_shapes;
95 DialogPage _page_mouse, _page_scrolling, _page_steps, _page_tools, _page_windows,
96 _page_clones, _page_transforms, _page_select, _page_misc;
97 DialogPage _page_selector, _page_node, _page_zoom, _page_shapes, _page_pencil, _page_pen,
98 _page_calligraphy, _page_text, _page_gradient, _page_connector, _page_dropper;
99 DialogPage _page_rectangle, _page_ellipse, _page_star, _page_spiral;
101 PrefSpinButton _mouse_sens, _mouse_thres;
103 PrefSpinButton _scroll_wheel, _scroll_arrow_px, _scroll_arrow_acc, _scroll_auto_speed, _scroll_auto_thres;
105 PrefCombo _steps_rot_snap;
106 PrefCheckButton _steps_compass;
107 PrefSpinButton _steps_arrow, _steps_scale, _steps_inset, _steps_zoom;
109 PrefRadioButton _t_sel_trans_obj, _t_sel_trans_outl, _t_sel_cue_none, _t_sel_cue_mark,
110 _t_sel_cue_box, _t_sel_org_edge, _t_sel_org_node;
112 PrefSpinButton _t_pencil_tolerance;
114 PrefRadioButton _win_ontop_none, _win_ontop_normal, _win_ontop_agressive;
115 PrefCheckButton _win_save_geom, _win_hide_task, _win_zoom_resize;
117 PrefRadioButton _clone_option_parallel, _clone_option_stay, _clone_option_transform,
118 _clone_option_unlink, _clone_option_delete;
120 PrefCheckButton _trans_scale_stroke, _trans_scale_corner, _trans_gradient,_trans_pattern;
121 PrefRadioButton _trans_optimized, _trans_preserved;
123 PrefCheckButton _sel_current, _sel_hidden, _sel_locked;
125 PrefSpinButton _misc_export, _misc_recent, _misc_simpl;
126 PrefCheckButton _misc_imp_bitmap, _misc_comment, _misc_scripts;
127 PrefCombo _misc_overs_bitmap;
128 PrefCheckButton _misc_mask_on_top;
129 PrefCheckButton _misc_mask_remove;
131 int _max_dialog_width;
132 int _max_dialog_height;
133 int _sb_width;
134 DialogPage* _current_page;
136 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, int id);
137 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent, int id);
138 bool SetMaxDialogSize(const Gtk::TreeModel::iterator& iter);
139 bool PresentPage(const Gtk::TreeModel::iterator& iter);
141 static void AddSelcueCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
142 static void AddGradientCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
143 static void AddNewObjectsStyle(DialogPage& p, const std::string& prefs_path);
145 void on_pagelist_selection_changed();
146 void initPageMouse();
147 void initPageScrolling();
148 void initPageSteps();
149 void initPageTools();
150 void initPageWindows();
151 void initPageClones();
152 void initPageTransforms();
153 void initPageSelecting();
154 void initPageMisc();
156 private:
157 InkscapePreferences();
158 InkscapePreferences(InkscapePreferences const &d);
159 InkscapePreferences operator=(InkscapePreferences const &d);
160 };
162 } // namespace Dialog
163 } // namespace UI
164 } // namespace Inkscape
166 #endif //INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
168 /*
169 Local Variables:
170 mode:c++
171 c-file-style:"stroustrup"
172 c-file-offsets:((innamespace . 0)(inline-open . 0))
173 indent-tabs-mode:nil
174 fill-column:99
175 End:
176 */
177 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :