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 using namespace Inkscape::UI::Widget;
33 namespace Inkscape {
34 namespace UI {
35 namespace Dialog {
37 class InkscapePreferences : public Dialog {
38 public:
39 virtual ~InkscapePreferences();
41 static InkscapePreferences *create() {return new InkscapePreferences(); }
43 protected:
44 Gtk::Frame _page_frame;
45 Gtk::Label _page_title;
46 Gtk::TreeView _page_list;
47 Glib::RefPtr<Gtk::TreeStore> _page_list_model;
49 //Pagelist model columns:
50 class PageListModelColumns : public Gtk::TreeModel::ColumnRecord
51 {
52 public:
53 PageListModelColumns()
54 { Gtk::TreeModelColumnRecord::add(_col_id); Gtk::TreeModelColumnRecord::add(_col_page); }
55 Gtk::TreeModelColumn<Glib::ustring> _col_id;
56 Gtk::TreeModelColumn<DialogPage*> _col_page;
57 };
58 PageListModelColumns _page_list_columns;
60 DialogPage _page_mouse, _page_scrolling, _page_steps, _page_tools, _page_windows,
61 _page_clones, _page_transforms, _page_select, _page_misc;
62 DialogPage _page_selector, _page_node, _page_zoom, _page_shapes, _page_pencil, _page_pen,
63 _page_calligraphy, _page_text, _page_gradient, _page_connector, _page_dropper;
64 DialogPage _page_rectangle, _page_ellipse, _page_star, _page_spiral;
66 PrefSpinButton _mouse_sens, _mouse_thres;
68 PrefSpinButton _scroll_wheel, _scroll_arrow_px, _scroll_arrow_acc, _scroll_auto_speed, _scroll_auto_thres;
70 PrefCombo _steps_rot_snap;
71 PrefCheckButton _steps_compass;
72 PrefSpinButton _steps_arrow, _steps_scale, _steps_inset, _steps_zoom;
74 PrefRadioButton _t_sel_trans_obj, _t_sel_trans_outl, _t_sel_cue_none, _t_sel_cue_mark,
75 _t_sel_cue_box, _t_sel_org_edge, _t_sel_org_node;
77 PrefSpinButton _t_pencil_tolerance;
79 PrefRadioButton _win_ontop_none, _win_ontop_normal, _win_ontop_agressive;
80 PrefCheckButton _win_save_geom, _win_hide_task, _win_zoom_resize;
82 PrefRadioButton _clone_option_parallel, _clone_option_stay, _clone_option_transform,
83 _clone_option_unlink, _clone_option_delete;
85 PrefCheckButton _trans_scale_stroke, _trans_scale_corner, _trans_gradient,_trans_pattern;
86 PrefRadioButton _trans_optimized, _trans_preserved;
88 PrefCheckButton _sel_current, _sel_hidden, _sel_locked;
90 PrefSpinButton _misc_export, _misc_recent, _misc_simpl;
91 PrefCheckButton _misc_imp_bitmap, _misc_comment, _misc_scripts;
92 PrefCombo _misc_overs_bitmap;
94 int _max_dialog_width;
95 int _max_dialog_height;
96 int _sb_width;
97 DialogPage* _current_page;
99 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title);
100 Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent);
101 bool SetMaxDialogSize(const Gtk::TreeModel::iterator& iter);
103 static void AddSelcueCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
104 static void AddGradientCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
105 static void AddNewObjectsStyle(DialogPage& p, const std::string& prefs_path);
107 void on_pagelist_selection_changed();
108 void initPageMouse();
109 void initPageScrolling();
110 void initPageSteps();
111 void initPageTools();
112 void initPageWindows();
113 void initPageClones();
114 void initPageTransforms();
115 void initPageSelecting();
116 void initPageMisc();
118 private:
119 InkscapePreferences();
120 InkscapePreferences(InkscapePreferences const &d);
121 InkscapePreferences operator=(InkscapePreferences const &d);
122 };
124 } // namespace Dialog
125 } // namespace UI
126 } // namespace Inkscape
128 #endif //INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
130 /*
131 Local Variables:
132 mode:c++
133 c-file-style:"stroustrup"
134 c-file-offsets:((innamespace . 0)(inline-open . 0))
135 indent-tabs-mode:nil
136 fill-column:99
137 End:
138 */
139 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :