Code

c1999f946ca087c70834f771c1c5a64ab49626df
[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  *   Bruno Dilly <bruno.dilly@gmail.com>
9  *
10  * Copyright (C) 2004-2007 Authors
11  *
12  * Released under GNU GPL.  Read the file 'COPYING' for more information.
13  */
15 #ifndef INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
16 #define INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
18 #include <iostream>
19 #include <vector>
20 #include <gtkmm/table.h>
21 #include <gtkmm/comboboxtext.h>
22 #include <gtkmm/spinbutton.h>
23 #include <gtkmm/treestore.h>
24 #include <gtkmm/treeview.h>
25 #include <gtkmm/radiobutton.h>
26 #include <gtkmm/frame.h>
27 #include "ui/widget/preferences-widget.h"
28 #include <sigc++/sigc++.h>
29 #include <glibmm/i18n.h>
31 #include "dialog.h"
33 // UPDATE THIS IF YOU'RE ADDING PREFS PAGES.
34 // Otherwise the commands that open the dialog with the new page will fail.
36 enum {
37     PREFS_PAGE_MOUSE,
38     PREFS_PAGE_SCROLLING,
39     PREFS_PAGE_STEPS,
40     PREFS_PAGE_TOOLS,
41     PREFS_PAGE_TOOLS_SELECTOR,
42     PREFS_PAGE_TOOLS_NODE,
43     PREFS_PAGE_TOOLS_ZOOM,
44     PREFS_PAGE_TOOLS_SHAPES,
45     PREFS_PAGE_TOOLS_SHAPES_RECT,
46     PREFS_PAGE_TOOLS_SHAPES_3DBOX,
47     PREFS_PAGE_TOOLS_SHAPES_ELLIPSE,
48     PREFS_PAGE_TOOLS_SHAPES_STAR,
49     PREFS_PAGE_TOOLS_SHAPES_SPIRAL,
50     PREFS_PAGE_TOOLS_PENCIL,
51     PREFS_PAGE_TOOLS_PEN,
52     PREFS_PAGE_TOOLS_CALLIGRAPHY,
53     PREFS_PAGE_TOOLS_PAINTBUCKET,
54     PREFS_PAGE_TOOLS_TEXT,
55     PREFS_PAGE_TOOLS_GRADIENT,
56     PREFS_PAGE_TOOLS_CONNECTOR,
57     PREFS_PAGE_TOOLS_DROPPER,
58     PREFS_PAGE_WINDOWS,
59     PREFS_PAGE_CLONES,
60     PREFS_PAGE_MASKS,
61     PREFS_PAGE_FILTERS,
62     PREFS_PAGE_TRANSFORMS,
63     PREFS_PAGE_SELECTING,
64     PREFS_PAGE_MISC
65 };
67 using namespace Inkscape::UI::Widget;
69 namespace Inkscape {
70 namespace UI {
71 namespace Dialog {
73 class InkscapePreferences : public Dialog {
74 public:
75     virtual ~InkscapePreferences();
77     static InkscapePreferences *create() {return new InkscapePreferences(); }
78     void present();
80 protected:
81     Gtk::Frame _page_frame;
82     Gtk::Label _page_title;
83     Gtk::TreeView _page_list;  
84     Glib::RefPtr<Gtk::TreeStore> _page_list_model;
86     //Pagelist model columns:
87     class PageListModelColumns : public Gtk::TreeModel::ColumnRecord
88     {
89     public:
90         PageListModelColumns()
91         { Gtk::TreeModelColumnRecord::add(_col_name); Gtk::TreeModelColumnRecord::add(_col_page); Gtk::TreeModelColumnRecord::add(_col_id); }
92         Gtk::TreeModelColumn<Glib::ustring> _col_name;
93         Gtk::TreeModelColumn<int> _col_id;
94         Gtk::TreeModelColumn<DialogPage*> _col_page;
95     };
96     PageListModelColumns _page_list_columns;
98     Gtk::TreeModel::Path _path_tools;
99     Gtk::TreeModel::Path _path_shapes;
101     DialogPage _page_mouse, _page_scrolling, _page_steps, _page_tools, _page_windows,
102         _page_clones, _page_mask, _page_transforms, _page_filters, _page_select, _page_misc;
103     DialogPage _page_selector, _page_node, _page_zoom, _page_shapes, _page_pencil, _page_pen,
104                _page_calligraphy, _page_text, _page_gradient, _page_connector, _page_dropper;
105     DialogPage _page_rectangle, _page_3dbox, _page_ellipse, _page_star, _page_spiral, _page_paintbucket;
107     PrefSpinButton _mouse_sens, _mouse_thres;
108     PrefCheckButton _mouse_use_ext_input;
110     PrefSpinButton _scroll_wheel, _scroll_arrow_px, _scroll_arrow_acc, _scroll_auto_speed, _scroll_auto_thres;
111     PrefCheckButton _scroll_space;
112     PrefCheckButton _wheel_zoom;
114     PrefCombo       _steps_rot_snap;
115     PrefCheckButton _steps_compass;
116     PrefSpinButton  _steps_arrow, _steps_scale, _steps_inset, _steps_zoom;
118     PrefRadioButton _t_sel_trans_obj, _t_sel_trans_outl, _t_sel_cue_none, _t_sel_cue_mark,
119                     _t_sel_cue_box, _t_sel_bbox_visual, _t_sel_bbox_geometric;
121     PrefSpinButton  _t_pencil_tolerance;
123     PrefRadioButton _win_ontop_none, _win_ontop_normal, _win_ontop_agressive;
124     PrefRadioButton _win_save_geom_off, _win_save_geom, _win_save_geom_prefs;
125     PrefCheckButton _win_hide_task, _win_zoom_resize , _win_show_close;
127 // FIXME: Temporary Win32 special code to enable transient dialogs
128 #ifdef WIN32 
129     PrefCheckButton _win_ontop_win32;   
130 #endif    
132     PrefCheckButton _calligrapy_use_abs_size;
133     PrefCheckButton _calligrapy_keep_selected;
135     PrefCheckButton _connector_ignore_text;
136     
137     PrefRadioButton _clone_option_parallel, _clone_option_stay, _clone_option_transform,
138                     _clone_option_unlink, _clone_option_delete;
140     PrefCheckButton _mask_mask_on_top;
141     PrefCheckButton _mask_mask_remove;
143     PrefRadioButton _blur_quality_best, _blur_quality_better, _blur_quality_normal, _blur_quality_worse, _blur_quality_worst;
145     PrefCheckButton _trans_scale_stroke, _trans_scale_corner, _trans_gradient,_trans_pattern;
146     PrefRadioButton _trans_optimized, _trans_preserved;
148     PrefRadioButton _sel_all;
149     PrefRadioButton _sel_current;
150     PrefRadioButton _sel_recursive;
151     PrefCheckButton _sel_hidden, _sel_locked;
152     PrefCheckButton _sel_layer_deselects;
154     PrefSpinButton  _misc_export, _misc_recent, _misc_simpl;
155     PrefCheckButton _misc_imp_bitmap, _misc_comment, _misc_scripts;
156     PrefCheckButton _misc_small_toolbar;
157     PrefCombo       _misc_overs_bitmap;
158     PrefEntry       _misc_ocal_url;
159     PrefEntry       _misc_ocal_username;
160     PrefEntry       _misc_ocal_password;
162     int _max_dialog_width;
163     int _max_dialog_height;
164     int _sb_width;
165     DialogPage* _current_page;
167     Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, int id);
168     Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent, int id);
169     bool SetMaxDialogSize(const Gtk::TreeModel::iterator& iter);
170     bool PresentPage(const Gtk::TreeModel::iterator& iter);
172     static void AddSelcueCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
173     static void AddGradientCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
174     static void AddNewObjectsStyle(DialogPage& p, const std::string& prefs_path);
176     void on_pagelist_selection_changed();
177     void initPageMouse();
178     void initPageScrolling();
179     void initPageSteps();
180     void initPageTools();
181     void initPageWindows();
182     void initPageClones();
183     void initPageMasks();
184     void initPageTransforms();
185     void initPageFilters();
186     void initPageSelecting();
187     void initPageMisc();
189 private:
190     InkscapePreferences();
191     InkscapePreferences(InkscapePreferences const &d);
192     InkscapePreferences operator=(InkscapePreferences const &d);
193 };
195 } // namespace Dialog
196 } // namespace UI
197 } // namespace Inkscape
199 #endif //INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
201 /* 
202   Local Variables:
203   mode:c++
204   c-file-style:"stroustrup"
205   c-file-offsets:((innamespace . 0)(inline-open . 0))
206   indent-tabs-mode:nil
207   fill-column:99
208   End:
209 */
210 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :