1 #ifndef __FILTER_EFFECT_CHOOSER_H__
2 #define __FILTER_EFFECT_CHOOSER_H__
4 /*
5 * Filter effect selection selection widget
6 *
7 * Author:
8 * Nicholas Bishop <nicholasbishop@gmail.com>
9 *
10 * Copyright (C) 2007 Authors
11 *
12 * Released under GNU GPL, read the file 'COPYING' for more information
13 */
15 #include <gtkmm/box.h>
16 #include <gtkmm/combobox.h>
17 #include <gtkmm/liststore.h>
18 #include <gtkmm/treeview.h>
20 #include "combo-enums.h"
21 #include "filter-enums.h"
22 #include "labelled.h"
23 #include "spin-slider.h"
24 #include "sp-filter.h"
26 namespace Inkscape {
27 namespace UI {
28 namespace Widget {
30 class FilterEffectChooser
31 {
32 public:
33 virtual ~FilterEffectChooser();
35 protected:
36 FilterEffectChooser();
38 class Columns : public Gtk::TreeModel::ColumnRecord
39 {
40 public:
41 Columns()
42 {
43 add(filter);
44 add(label);
45 add(sel);
46 }
48 Gtk::TreeModelColumn<SPFilter*> filter;
49 Gtk::TreeModelColumn<Glib::ustring> label;
50 Gtk::TreeModelColumn<int> sel;
51 };
53 virtual void update_filters();
55 Glib::RefPtr<Gtk::ListStore> _model;
56 Columns _columns;
57 private:
58 static void on_activate_desktop(Inkscape::Application*, SPDesktop*, FilterEffectChooser*);
59 void on_document_replaced(SPDesktop*, SPDocument*);
61 sigc::connection _doc_replaced;
62 sigc::connection _resource_changed;
64 Gtk::TreeView::Column _filter_column;
65 };
67 /* Allows basic control over feBlend and feGaussianBlur effects,
68 with an option to use the full filter effect controls. */
69 class SimpleFilterModifier : public Gtk::VBox
70 {
71 public:
72 SimpleFilterModifier();
74 sigc::signal<void>& signal_blend_blur_changed();
76 const Glib::ustring get_blend_mode();
77 // Uses blend mode enum values, or -1 for a complex filter
78 void set_blend_mode(const int);
80 double get_blur_value() const;
81 void set_blur_value(const double);
82 void set_blur_sensitive(const bool);
83 private:
84 Gtk::HBox _hb_blend;
85 Gtk::VBox _vb_blur;
86 Gtk::Label _lb_blend, _lb_blur;
87 ComboBoxEnum<NR::FilterBlendMode> _blend;
88 SpinSlider _blur;
90 sigc::signal<void> _signal_blend_blur_changed;
91 };
93 }
94 }
95 }
97 #endif
99 /*
100 Local Variables:
101 mode:c++
102 c-file-style:"stroustrup"
103 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
104 indent-tabs-mode:nil
105 fill-column:99
106 End:
107 */
108 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :