X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fwidget_coloredit.h;h=63dcfa6002f356d68927b694c449c12d0b4b62c8;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=77342aeeb47cb0c407cae29078d3d7b5c724c064;hpb=3a3c4bca3a17137bec5d7960560934b91ef4146e;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/widget_coloredit.h b/synfig-studio/trunk/src/gtkmm/widget_coloredit.h index 77342ae..63dcfa6 100644 --- a/synfig-studio/trunk/src/gtkmm/widget_coloredit.h +++ b/synfig-studio/trunk/src/gtkmm/widget_coloredit.h @@ -1,28 +1,29 @@ -/* === S I N F G =========================================================== */ +/* === S Y N F I G ========================================================= */ /*! \file widget_coloredit.h ** \brief Template Header ** -** $Id: widget_coloredit.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $ +** $Id$ ** ** \legal -** Copyright (c) 2002 Robert B. Quattlebaum Jr. +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** -** This software and associated documentation -** are CONFIDENTIAL and PROPRIETARY property of -** the above-mentioned copyright holder. +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. ** -** You may not copy, print, publish, or in any -** other way distribute this software without -** a prior written agreement with -** the copyright holder. +** This package is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. ** \endlegal */ /* ========================================================================= */ /* === S T A R T =========================================================== */ -#ifndef __SINFG_STUDIO_WIDGET_COLOREDIT_H -#define __SINFG_STUDIO_WIDGET_COLOREDIT_H +#ifndef __SYNFIG_STUDIO_WIDGET_COLOREDIT_H +#define __SYNFIG_STUDIO_WIDGET_COLOREDIT_H /* === H E A D E R S ======================================================= */ @@ -31,7 +32,7 @@ #include #include #include -#include +#include #include "widget_color.h" /* === M A C R O S ========================================================= */ @@ -60,17 +61,17 @@ public: TYPE_HUE, TYPE_SAT, TYPE_A, - + TYPE_END }; - + private: sigc::signal signal_slider_moved_; sigc::signal signal_activated_; Type type; - sinfg::Color color_; + synfig::Color color_; public: @@ -80,7 +81,7 @@ public: Type get_type()const { return type; } - const sinfg::Color& + const synfig::Color& get_color()const { return color_; } @@ -90,30 +91,30 @@ public: set_type(Type x); void - set_color(sinfg::Color x); + set_color(synfig::Color x); - static void adjust_color(Type type, sinfg::Color &color, float amount); + static void adjust_color(Type type, synfig::Color &color, float amount); private: - typedef void (*slider_color_func)(sinfg::Color &,float); - - static void slider_color_TYPE_R(sinfg::Color &color, float amount); - static void slider_color_TYPE_G(sinfg::Color &color, float amount); - static void slider_color_TYPE_B(sinfg::Color &color, float amount); - static void slider_color_TYPE_Y(sinfg::Color &color, float amount); - static void slider_color_TYPE_U(sinfg::Color &color, float amount); - static void slider_color_TYPE_V(sinfg::Color &color, float amount); - static void slider_color_TYPE_HUE(sinfg::Color &color, float amount); - static void slider_color_TYPE_SAT(sinfg::Color &color, float amount); - static void slider_color_TYPE_A(sinfg::Color &color, float amount); - + typedef void (*slider_color_func)(synfig::Color &,float); + + static void slider_color_TYPE_R(synfig::Color &color, float amount); + static void slider_color_TYPE_G(synfig::Color &color, float amount); + static void slider_color_TYPE_B(synfig::Color &color, float amount); + static void slider_color_TYPE_Y(synfig::Color &color, float amount); + static void slider_color_TYPE_U(synfig::Color &color, float amount); + static void slider_color_TYPE_V(synfig::Color &color, float amount); + static void slider_color_TYPE_HUE(synfig::Color &color, float amount); + static void slider_color_TYPE_SAT(synfig::Color &color, float amount); + static void slider_color_TYPE_A(synfig::Color &color, float amount); + bool redraw(GdkEventExpose*bleh); bool on_event(GdkEvent *event); }; // END of class ColorSlider - + class Widget_ColorEdit : public Gtk::Table { sigc::signal signal_activated_; @@ -122,19 +123,22 @@ class Widget_ColorEdit : public Gtk::Table ColorSlider *slider_R; ColorSlider *slider_G; ColorSlider *slider_B; + Gtk::Label *hex_color_label; + Gtk::Entry *hex_color; + ColorSlider *slider_A; ColorSlider *slider_Y; ColorSlider *slider_U; ColorSlider *slider_V; ColorSlider *slider_SAT; ColorSlider *slider_HUE; - + Widget_Color widget_color; - + bool hold_signals; - + bool clamp_; - + Gtk::SpinButton *spinbutton_R; Gtk::SpinButton *spinbutton_G; Gtk::SpinButton *spinbutton_B; @@ -144,13 +148,13 @@ class Widget_ColorEdit : public Gtk::Table Gtk::Adjustment G_adjustment; Gtk::Adjustment B_adjustment; Gtk::Adjustment A_adjustment; - - sinfg::Color color; + + synfig::Color color; Gtk::Notebook* notebook; protected: - + void on_value_changed(); public: @@ -160,22 +164,23 @@ public: sigc::signal& signal_activate() { return signal_activated_; } void on_slider_moved(ColorSlider::Type type, float amount); + void on_hex_edited(); //Glib::SignalProxy0 signal_activate() { return spinbutton_A->signal_activate(); } - + sigc::signal& signal_value_changed() { return signal_value_changed_; } - + void activated() { signal_activated_(); } void activate() { signal_activated_(); } - void set_value(const sinfg::Color &data); - const sinfg::Color &get_value(); - sinfg::Color get_value_raw(); + void set_value(const synfig::Color &data); + const synfig::Color &get_value(); + synfig::Color get_value_raw(); void set_has_frame(bool x); void set_digits(int x); Widget_ColorEdit(); ~Widget_ColorEdit(); }; // END of class Widget_ColorEdit - + }; // END of namespace studio /* === E N D =============================================================== */