Code

Option to keep selection when changing layers
[inkscape.git] / src / ui / dialog / inkscape-preferences.h
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 , _win_show_close;
117     PrefCheckButton _calligrapy_use_abs_size;
118     PrefCheckButton _calligrapy_keep_selected;
120     PrefCheckButton _connector_ignore_text;
121     
122     PrefRadioButton _clone_option_parallel, _clone_option_stay, _clone_option_transform,
123                     _clone_option_unlink, _clone_option_delete;
125     PrefCheckButton _trans_scale_stroke, _trans_scale_corner, _trans_gradient,_trans_pattern;
126     PrefRadioButton _trans_optimized, _trans_preserved;
128     PrefRadioButton _sel_all;
129     PrefRadioButton _sel_current;
130     PrefRadioButton _sel_recursive;
131     PrefCheckButton _sel_hidden, _sel_locked;
132     PrefCheckButton _sel_layer_deselects;
134     PrefSpinButton  _misc_export, _misc_recent, _misc_simpl;
135     PrefCheckButton _misc_imp_bitmap, _misc_comment, _misc_scripts;
136     PrefCombo       _misc_overs_bitmap;
137     PrefCheckButton _misc_mask_on_top;
138     PrefCheckButton _misc_mask_remove;
140     int _max_dialog_width;
141     int _max_dialog_height;
142     int _sb_width;
143     DialogPage* _current_page;
145     Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, int id);
146     Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent, int id);
147     bool SetMaxDialogSize(const Gtk::TreeModel::iterator& iter);
148     bool PresentPage(const Gtk::TreeModel::iterator& iter);
150     static void AddSelcueCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
151     static void AddGradientCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
152     static void AddNewObjectsStyle(DialogPage& p, const std::string& prefs_path);
154     void on_pagelist_selection_changed();
155     void initPageMouse();
156     void initPageScrolling();
157     void initPageSteps();
158     void initPageTools();
159     void initPageWindows();
160     void initPageClones();
161     void initPageTransforms();
162     void initPageSelecting();
163     void initPageMisc();
165 private:
166     InkscapePreferences();
167     InkscapePreferences(InkscapePreferences const &d);
168     InkscapePreferences operator=(InkscapePreferences const &d);
169 };
171 } // namespace Dialog
172 } // namespace UI
173 } // namespace Inkscape
175 #endif //INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
177 /* 
178   Local Variables:
179   mode:c++
180   c-file-style:"stroustrup"
181   c-file-offsets:((innamespace . 0)(inline-open . 0))
182   indent-tabs-mode:nil
183   fill-column:99
184   End:
185 */
186 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :