c3a3c0c9e4788653bd94781c7c425fd7f60bf417
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 PrefCheckButton _calligrapy_use_abs_size;
119 PrefCheckButton _connector_ignore_text;
121 PrefRadioButton _clone_option_parallel, _clone_option_stay, _clone_option_transform,
122 _clone_option_unlink, _clone_option_delete;
124 PrefCheckButton _trans_scale_stroke, _trans_scale_corner, _trans_gradient,_trans_pattern;
125 PrefRadioButton _trans_optimized, _trans_preserved;
127 PrefRadioButton _sel_all;
128 PrefRadioButton _sel_current;
129 PrefRadioButton _sel_recursive;
130 PrefCheckButton _sel_hidden, _sel_locked;
132 PrefSpinButton _misc_export, _misc_recent, _misc_simpl;
133 PrefCheckButton _misc_imp_bitmap, _misc_comment, _misc_scripts;
134 PrefCombo _misc_overs_bitmap;
135 PrefCheckButton _misc_mask_on_top;
136 PrefCheckButton _misc_mask_remove;
138 int _max_dialog_width;
139 int _max_dialog_height;
140 int _sb_width;
141 DialogPage* _current_page;
143 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, int id);
144 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent, int id);
145 bool SetMaxDialogSize(const Gtk::TreeModel::iterator& iter);
146 bool PresentPage(const Gtk::TreeModel::iterator& iter);
148 static void AddSelcueCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
149 static void AddGradientCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
150 static void AddNewObjectsStyle(DialogPage& p, const std::string& prefs_path);
152 void on_pagelist_selection_changed();
153 void initPageMouse();
154 void initPageScrolling();
155 void initPageSteps();
156 void initPageTools();
157 void initPageWindows();
158 void initPageClones();
159 void initPageTransforms();
160 void initPageSelecting();
161 void initPageMisc();
163 private:
164 InkscapePreferences();
165 InkscapePreferences(InkscapePreferences const &d);
166 InkscapePreferences operator=(InkscapePreferences const &d);
167 };
169 } // namespace Dialog
170 } // namespace UI
171 } // namespace Inkscape
173 #endif //INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
175 /*
176 Local Variables:
177 mode:c++
178 c-file-style:"stroustrup"
179 c-file-offsets:((innamespace . 0)(inline-open . 0))
180 indent-tabs-mode:nil
181 fill-column:99
182 End:
183 */
184 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :