/* $Id: colorselection.gen_h,v 1.44 2001/07/15 13:33:38 murrayc Exp $ */ /* colorselection.h * * Copyright (C) 1998-1999 The Gtk-- Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <gtk--/box.h> #include <gtk--/window.h> #include <gtk--/button.h> #include <gtk/gtkcolorsel.h> namespace Gtk { //: A widget used to select a color. //- The {\class Gtk::ColorSelection} is a widget that is used to select a color. It //- consists of a color wheel and number of sliders and entry boxes for //- color parameters such as hue, saturation, value, red, green, blue, //- and opacity. It is found on the standard color selection dialog box //- {Gtk::ColorSelectionDialog}. class ColorSelection : public VBox { public: typedef ColorSelection CppObjectType; typedef GtkColorSelection BaseObjectType; public: //: Returns the underlaying gtk+ object. GtkColorSelection* gtkobj(); const GtkColorSelection* gtkobj() const; //: Returns true if object is this type. static bool isA(Gtk::Object *object); virtual ~ColorSelection(); private: public: ColorSelection(); //: Sets the policy controlling when the color_changed signals are emitted. //- The available policies are: //- //- {\enum GTK_UPDATE_CONTINUOUS} - signals are sent continuously as the color selection changes. //- //- {\enum GTK_UPDATE_DISCONTINUOUS} - signals are sent only when the mouse button is released. //- //- {\enum GTK_UPDATE_DELAYED} - signals are sent when the mouse button is released or when the //- mouse has been motionless for a period of time. void set_update_policy(GtkUpdateType policy); //: Controls whether opacity can be set with the {\class Gtk::ColorSelection}. //- If this functionality is enabled, the necessary additional widgets are added //- to the {\class Gtk::ColorSelection} and the opacity value can be retrieved //- via the fourth value in the color array returned by the {get_color()} function. void set_opacity(gint use_opacity); // NOTE: mail gtk+ that second argument should be const. //: Sets the color in the {\class Gtk::ColorSelection}. //- The widgets are updated to reflect the new color. //- //- color: A color array consisting of 4 gfloat values for red, green, blue, and opacity. void set_color(const gdouble* color); //: Retrieve the currently selected color value. //- color: A color array consisting of 4 gfloat values for red, green, blue, and opacity. void get_color(gdouble* color) const; //: This signal is emitted when the color changes in the {\class Gtk::ColorSelection} according to its update policy. signal void color_changed(); protected: // impl functions virtual void color_changed_impl(); }; //: A standard dialog box for selecting a color. //- The {\class Gtk::ColorSelectionDialog} provides a standard dialog which allows //- the user to select a color much like the {\class Gtk::FileSelection} provides //- a standard dialog for file selection. class ColorSelectionDialog : public Window { public: typedef ColorSelectionDialog CppObjectType; typedef GtkColorSelectionDialog BaseObjectType; public: //: Returns the underlaying gtk+ object. GtkColorSelectionDialog* gtkobj(); const GtkColorSelectionDialog* gtkobj() const; //: Returns true if object is this type. static bool isA(Gtk::Object *object); virtual ~ColorSelectionDialog(); private: public: ColorSelectionDialog(const nstring &title); Gtk::ColorSelection* get_colorsel() const; Gtk::VBox* get_vbox() const; Gtk::Button* get_ok_button() const; Gtk::Button* get_reset_button() const; Gtk::Button* get_cancel_button() const; Gtk::Button* get_help_button() const; protected: // impl functions }; }