1 /* === S Y N F I G ========================================================= */
2 /*! \file widgets/widget_gradient.h
3 ** \brief Template Header
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === S T A R T =========================================================== */
25 #ifndef __SYNFIG_STUDIO_WIDGET_GRADIENT_H
26 #define __SYNFIG_STUDIO_WIDGET_GRADIENT_H
28 /* === H E A D E R S ======================================================= */
30 #include <gtkmm/drawingarea.h>
31 #include <synfig/gradient.h>
33 /* === M A C R O S ========================================================= */
35 /* === T Y P E D E F S ===================================================== */
37 /* === C L A S S E S & S T R U C T S ======================================= */
41 void render_gradient_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const Gdk::Rectangle& ca,const synfig::Gradient &gradient);
43 class Widget_Gradient : public Gtk::DrawingArea
45 sigc::signal<void> signal_value_changed_;
46 sigc::signal<void> signal_clicked_;
48 sigc::signal<void,synfig::Gradient::CPoint> signal_cpoint_selected_;
50 synfig::Gradient gradient_;
56 synfig::Gradient::CPoint selected_cpoint;
58 void popup_menu(float x);
60 void insert_cpoint(float x);
62 void remove_cpoint(float x);
70 sigc::signal<void>& signal_value_changed() { return signal_value_changed_; }
71 sigc::signal<void>& signal_clicked() { return signal_clicked_; }
73 sigc::signal<void,synfig::Gradient::CPoint>& signal_cpoint_selected() { return signal_cpoint_selected_; }
75 void set_value(const synfig::Gradient& x);
77 const synfig::Gradient& get_value()const { return gradient_; }
79 void set_editable(bool x=true) { editable_=x; }
81 bool get_editable()const { return editable_; }
85 void set_selected_cpoint(const synfig::Gradient::CPoint &x);
87 const synfig::Gradient::CPoint& get_selected_cpoint() { return selected_cpoint; }
89 void update_cpoint(const synfig::Gradient::CPoint &x);
93 bool redraw(GdkEventExpose*bleh=NULL);
95 bool on_event(GdkEvent *event);
96 }; // END of class BlackLevelSelector
98 }; // END of namespace studio
100 /* === E N D =============================================================== */