00001
00021
00022
00023
00024
00025 #ifndef __SYNFIG_STUDIO_WIDGET_COLOR_H
00026 #define __SYNFIG_STUDIO_WIDGET_COLOR_H
00027
00028
00029
00030 #include <gtkmm/box.h>
00031 #include <gtkmm/table.h>
00032 #include <gtkmm/spinbutton.h>
00033 #include <gtkmm/adjustment.h>
00034 #include <gtkmm/drawingarea.h>
00035 #include <synfig/color.h>
00036
00037
00038
00039
00040
00041
00042
00043 namespace studio {
00044
00045
00046 Gdk::Color colorconv_synfig2gdk(const synfig::Color &c);
00047
00048 void render_color_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const Gdk::Rectangle& ca,const synfig::Color &color);
00049
00050 class Widget_Color : public Gtk::DrawingArea
00051 {
00052 synfig::Color color;
00053
00054 sigc::signal<void> signal_activate_;
00055 sigc::signal<void> signal_secondary_;
00056
00057 protected:
00058
00059 public:
00060 sigc::signal<void>& signal_activate() { return signal_activate_; }
00061 sigc::signal<void>& signal_clicked() { return signal_activate_; }
00062 sigc::signal<void>& signal_secondary() { return signal_secondary_; }
00063
00064 void set_value(const synfig::Color &data);
00065 const synfig::Color &get_value();
00066 Widget_Color();
00067 ~Widget_Color();
00068 private:
00069 bool redraw(GdkEventExpose*bleh);
00070 bool on_event(GdkEvent *event);
00071
00072 };
00073
00074 };
00075
00076
00077
00078 #endif