Code

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