1 /**
2 * \brief LivePathEffect dialog
3 *
4 * Author:
5 * Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
6 *
7 * Copyright (C) 2007 Author
8 *
9 * Released under GNU GPL. Read the file 'COPYING' for more information.
10 */
12 #ifndef INKSCAPE_UI_DIALOG_LIVE_PATH_EFFECT_H
13 #define INKSCAPE_UI_DIALOG_LIVE_PATH_EFFECT_H
15 #include "ui/widget/panel.h"
16 #include "ui/widget/button.h"
18 #include <gtkmm/label.h>
19 #include <gtkmm/comboboxtext.h>
20 #include <gtkmm/frame.h>
21 #include <gtkmm/tooltips.h>
22 #include "ui/widget/combo-enums.h"
23 #include "live_effects/effect.h"
24 #include "live_effects/lpeobject-reference.h"
25 #include <gtkmm/liststore.h>
26 #include <gtkmm/treeview.h>
27 #include <gtkmm/scrolledwindow.h>
28 #include <gtkmm/buttonbox.h>
29 #include <gtkmm/toolbar.h>
32 class SPDesktop;
34 namespace Inkscape {
36 namespace UI {
37 namespace Dialog {
39 class LivePathEffectEditor : public UI::Widget::Panel {
40 public:
41 LivePathEffectEditor();
42 virtual ~LivePathEffectEditor();
44 static LivePathEffectEditor &getInstance() { return *new LivePathEffectEditor(); }
46 void onSelectionChanged(Inkscape::Selection *sel);
47 virtual void on_effect_selection_changed();
48 void setDesktop(SPDesktop *desktop);
50 private:
51 sigc::connection selection_changed_connection;
52 sigc::connection selection_modified_connection;
54 void set_sensitize_all(bool sensitive);
56 void showParams(LivePathEffect::Effect* effect);
57 void showText(Glib::ustring const &str);
58 void selectInList(LivePathEffect::Effect* effect);
60 // void add_entry(const char* name );
61 void effect_list_reload(SPLPEItem *lpeitem);
63 // callback methods for buttons on grids page.
64 void onApply();
65 void onRemove();
67 void onUp();
68 void onDown();
70 class ModelColumns : public Gtk::TreeModel::ColumnRecord
71 {
72 public:
73 ModelColumns()
74 {
75 add(col_name);
76 add(lperef);
77 add(col_visible);
78 }
79 virtual ~ModelColumns() {}
81 Gtk::TreeModelColumn<Glib::ustring> col_name;
82 Gtk::TreeModelColumn<LivePathEffect::LPEObjectReference *> lperef;
83 Gtk::TreeModelColumn<bool> col_visible;
84 };
86 bool lpe_list_locked;
88 Inkscape::UI::Widget::ComboBoxEnum<LivePathEffect::EffectType> combo_effecttype;
90 Gtk::Widget * effectwidget;
91 Gtk::Label explain_label;
92 Gtk::Frame effectapplication_frame;
93 Gtk::Frame effectcontrol_frame;
94 Gtk::Frame effectlist_frame;
95 Gtk::HBox effectapplication_hbox;
96 Gtk::VBox effectcontrol_vbox;
97 Gtk::VBox effectlist_vbox;
98 Gtk::Tooltips tooltips;
99 ModelColumns columns;
100 Gtk::ScrolledWindow scrolled_window;
101 Gtk::TreeView effectlist_view;
102 Glib::RefPtr<Gtk::ListStore> effectlist_store;
103 Glib::RefPtr<Gtk::TreeSelection> effectlist_selection;
105 void on_visibility_toggled( Glib::ustring const& str );
107 Gtk::Toolbar toolbar;
108 Gtk::ToolButton button_up;
109 Gtk::ToolButton button_down;
110 Gtk::Button button_apply;
111 Gtk::ToolButton button_remove;
112 /*Gtk::HButtonBox button_hbox;
113 Gtk::Button button_up;
114 Gtk::Button button_down;
115 Gtk::Button button_apply;
116 Gtk::Button button_remove;*/
118 SPDesktop * current_desktop;
120 SPLPEItem * current_lpeitem;
122 LivePathEffectEditor(LivePathEffectEditor const &d);
123 LivePathEffectEditor& operator=(LivePathEffectEditor const &d);
124 };
126 } // namespace Dialog
127 } // namespace UI
128 } // namespace Inkscape
130 #endif // INKSCAPE_UI_DIALOG_LIVE_PATH_EFFECT_H
132 /*
133 Local Variables:
134 mode:c++
135 c-file-style:"stroustrup"
136 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
137 indent-tabs-mode:nil
138 fill-column:99
139 End:
140 */
141 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :