Code

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