X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fui%2Fdialog%2Ffilter-effects-dialog.h;h=ccffb2a67d78be6356540bf913328b11d05dcca2;hb=9acbda558d50be3b21e4b384be758bc12a461072;hp=743ce02395784cb6ebbed8950366a7e6c6fdd18a;hpb=a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799;p=inkscape.git diff --git a/src/ui/dialog/filter-effects-dialog.h b/src/ui/dialog/filter-effects-dialog.h index 743ce0239..ccffb2a67 100644 --- a/src/ui/dialog/filter-effects-dialog.h +++ b/src/ui/dialog/filter-effects-dialog.h @@ -1,8 +1,9 @@ -/** - * \brief Filter Effects dialog - * - * Authors: +/** @file + * @brief Filter Effects dialog + */ +/* Authors: * Nicholas Bishop + * Rodrigo Kumpera * * Copyright (C) 2007 Authors * @@ -12,6 +13,8 @@ #ifndef INKSCAPE_UI_DIALOG_FILTER_EFFECTS_H #define INKSCAPE_UI_DIALOG_FILTER_EFFECTS_H +#include + #include #include #include @@ -21,11 +24,12 @@ #include #include #include +#include #include #include #include "attributes.h" -#include "dialog.h" +#include "ui/widget/panel.h" #include "sp-filter.h" #include "ui/widget/combo-enums.h" #include "ui/widget/spin-slider.h" @@ -38,16 +42,18 @@ namespace Dialog { class DualSpinButton; class MultiSpinButton; -class FilterEffectsDialog : public Dialog { +class FilterEffectsDialog : public UI::Widget::Panel { public: - FilterEffectsDialog(Behavior::BehaviorFactory behavior_factory); + FilterEffectsDialog(); ~FilterEffectsDialog(); - static FilterEffectsDialog *create(Behavior::BehaviorFactory behavior_factory) - { return new FilterEffectsDialog(behavior_factory); } + static FilterEffectsDialog &getInstance() + { return *new FilterEffectsDialog(); } void set_attrs_locked(const bool); +protected: + virtual void show_all_vfunc(); private: class SignalObserver; @@ -80,27 +86,8 @@ private: Gtk::TreeModelColumn sel; }; - class CellRendererSel : public Gtk::CellRenderer - { - public: - CellRendererSel(); - - Glib::PropertyProxy property_sel() - { - return _sel.get_proxy(); - } - protected: - virtual void get_size_vfunc(Gtk::Widget&, const Gdk::Rectangle*, - int*, int*, int*, int*) const; - virtual void render_vfunc(const Glib::RefPtr& win, Gtk::Widget& w, - const Gdk::Rectangle& bg_area, const Gdk::Rectangle& cell_area, - const Gdk::Rectangle& expose_area, Gtk::CellRendererState flags); - private: - const int _size; - Glib::Property _sel; - }; - static void on_activate_desktop(Application*, SPDesktop*, FilterModifier*); + static void on_deactivate_desktop(Application*, SPDesktop*, FilterModifier*); void on_document_replaced(SPDesktop*, SPDocument*) { update_filters(); @@ -111,8 +98,10 @@ private: void update_selection(Selection *); void on_filter_selection_changed(); + void on_name_edited(const Glib::ustring&, const Glib::ustring&); + void on_selection_toggled(const Glib::ustring&); + void update_filters(); - void filter_list_button_press(GdkEventButton*); void filter_list_button_release(GdkEventButton*); void add_filter(); void remove_filter(); @@ -126,7 +115,7 @@ private: Gtk::TreeView _list; Glib::RefPtr _model; Columns _columns; - CellRendererSel _cell_sel; + Gtk::CellRendererToggle _cell_toggle; Gtk::Button _add; Glib::RefPtr _menu; sigc::signal _signal_filter_changed; @@ -181,6 +170,7 @@ private: SPFilterPrimitive* get_selected(); void select(SPFilterPrimitive *prim); + void remove_selected(); int primitive_count() const; protected: @@ -216,7 +206,6 @@ private: std::auto_ptr _observer; }; - FilterEffectsDialog(); void init_settings_widgets(); // Handlers @@ -227,29 +216,37 @@ private: void set_attr_direct(const AttrWidget*); void set_child_attr_direct(const AttrWidget*); + void set_filternode_attr(const AttrWidget*); void set_attr(SPObject*, const SPAttributeEnum, const gchar* val); void update_settings_view(); + void update_filter_general_settings_view(); void update_settings_sensitivity(); void update_color_matrix(); + void update_primitive_infobox(); - // Filter effect selection - FilterModifier _filter_modifier; + // Primitives Info Box + Gtk::Label _infobox_desc; + Gtk::Image _infobox_icon; // View/add primitives Gtk::VBox _primitive_box; - PrimitiveList _primitive_list; UI::Widget::ComboBoxEnum _add_primitive_type; Gtk::Button _add_primitive; // Bottom pane (filter effect primitive settings) - Gtk::VBox _settings_box; + Gtk::Notebook _settings_tabs; + Gtk::VBox _settings_tab2; + Gtk::VBox _settings_tab1; Gtk::Label _empty_settings; + Gtk::Label _no_filter_selected; + bool _settings_initialized; class Settings; class MatrixAttr; class ColorMatrixValues; class LightSourceControl; Settings* _settings; + Settings* _filter_general_settings; Glib::RefPtr _sizegroup; // Color Matrix @@ -268,6 +265,11 @@ private: bool _locked; bool _attr_lock; + // These go last since they depend on the prior initialization of + // other FilterEffectsDialog members + FilterModifier _filter_modifier; + PrimitiveList _primitive_list; + FilterEffectsDialog(FilterEffectsDialog const &d); FilterEffectsDialog& operator=(FilterEffectsDialog const &d); };