initial version
[synfig.git] / synfig-studio / trunk / src / gtkmm / widget_color.h
1 /* === S I N F G =========================================================== */
2 /*!     \file widget_color.h
3 **      \brief Template Header
4 **
5 **      $Id: widget_color.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
6 **
7 **      \legal
8 **      Copyright (c) 2002 Robert B. Quattlebaum Jr.
9 **
10 **      This software and associated documentation
11 **      are CONFIDENTIAL and PROPRIETARY property of
12 **      the above-mentioned copyright holder.
13 **
14 **      You may not copy, print, publish, or in any
15 **      other way distribute this software without
16 **      a prior written agreement with
17 **      the copyright holder.
18 **      \endlegal
19 */
20 /* ========================================================================= */
21
22 /* === S T A R T =========================================================== */
23
24 #ifndef __SINFG_STUDIO_WIDGET_COLOR_H
25 #define __SINFG_STUDIO_WIDGET_COLOR_H
26
27 /* === H E A D E R S ======================================================= */
28
29 #include <gtkmm/box.h>
30 #include <gtkmm/table.h>
31 #include <gtkmm/spinbutton.h>
32 #include <gtkmm/adjustment.h>
33 #include <gtkmm/drawingarea.h>
34 #include <sinfg/color.h>
35
36 /* === M A C R O S ========================================================= */
37
38 /* === T Y P E D E F S ===================================================== */
39
40 /* === C L A S S E S & S T R U C T S ======================================= */
41
42 namespace studio {
43
44
45 Gdk::Color colorconv_sinfg2gdk(const sinfg::Color &c);
46         
47 void render_color_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const Gdk::Rectangle& ca,const sinfg::Color &color);
48
49 class Widget_Color : public Gtk::DrawingArea
50 {
51         sinfg::Color color;
52         
53         sigc::signal<void> signal_activate_;
54         sigc::signal<void> signal_secondary_;
55
56 protected:
57
58 public:
59         sigc::signal<void>& signal_activate() { return signal_activate_; }
60         sigc::signal<void>& signal_clicked() { return signal_activate_; }
61         sigc::signal<void>& signal_secondary() { return signal_secondary_; }
62         
63         void set_value(const sinfg::Color &data);
64         const sinfg::Color &get_value();
65         Widget_Color();
66         ~Widget_Color();
67 private:
68         bool redraw(GdkEventExpose*bleh);
69         bool on_event(GdkEvent *event);
70
71 }; // END of class Widget_Color
72         
73 }; // END of namespace studio
74
75 /* === E N D =============================================================== */
76
77 #endif