| 1 |
/* Copyright (C) 1998-2002 The gtkmm Development Team |
| 2 |
* |
| 3 |
* This library is free software; you can redistribute it and/or |
| 4 |
* modify it under the terms of the GNU Lesser General Public |
| 5 |
* License as published by the Free Software Foundation; either |
| 6 |
* version 2.1 of the License, or (at your option) any later version. |
| 7 |
* |
| 8 |
* This library is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 |
* Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public |
| 14 |
* License along with this library; if not, see <https://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
// To exclude this file from the documentation when build-deprecated-api=false. |
| 18 |
_CONFIGINCLUDE(gtkmmconfig.h) |
| 19 |
|
| 20 |
_DEFS(gtkmm,gtk) |
| 21 |
_PINCLUDE(gtkmm/private/hvbox_p.h) |
| 22 |
_PINCLUDE(gtkmm/private/dialog_p.h) |
| 23 |
|
| 24 |
#m4 _PUSH(SECTION_CC_PRE_INCLUDES) |
| 25 |
#undef GTK_DISABLE_DEPRECATED |
| 26 |
#define GDK_DISABLE_DEPRECATION_WARNINGS 1 |
| 27 |
#m4 _POP() |
| 28 |
|
| 29 |
#include <vector> |
| 30 |
|
| 31 |
#include <gtkmm/box.h> |
| 32 |
#include <gtkmm/dialog.h> |
| 33 |
#include <gtkmm/button.h> |
| 34 |
|
| 35 |
namespace Gtk |
| 36 |
{ |
| 37 |
|
| 38 |
/** A widget used to select a color. |
| 39 |
* |
| 40 |
* This widget is used to select a color. It |
| 41 |
* consists of a color wheel and number of sliders and entry boxes for color |
| 42 |
* parameters such as hue, saturation, value, red, green, blue, and opacity. |
| 43 |
* |
| 44 |
* It is found on the standard color selection dialog box |
| 45 |
* Gtk::ColorSelectionDialog. |
| 46 |
* |
| 47 |
* @ingroup Widgets |
| 48 |
* @deprecated Use ColorButton or ColorChooserDialog instead. |
| 49 |
*/ |
| 50 |
class GTKMM_API ColorSelection : public VBox |
| 51 |
{ |
| 52 |
_CLASS_GTKOBJECT(ColorSelection,GtkColorSelection,GTK_COLOR_SELECTION,Gtk::VBox,GtkVBox,,,GTKMM_API) |
| 53 |
_IS_DEPRECATED |
| 54 |
_IGNORE(gtk_color_selection_get_current_color, gtk_color_selection_get_previous_color) |
| 55 |
public: |
| 56 |
_CTOR_DEFAULT() |
| 57 |
|
| 58 |
_WRAP_METHOD(bool get_has_opacity_control() const, gtk_color_selection_get_has_opacity_control) |
| 59 |
_WRAP_METHOD(void set_has_opacity_control(bool has_opacity = true), gtk_color_selection_set_has_opacity_control) |
| 60 |
_WRAP_METHOD(bool get_has_palette() const, gtk_color_selection_get_has_palette) |
| 61 |
_WRAP_METHOD(void set_has_palette(bool has_palette = true), gtk_color_selection_set_has_palette) |
| 62 |
_WRAP_METHOD(void set_current_color(const Gdk::Color& color), gtk_color_selection_set_current_color, deprecated "Use set_current_rgba() instead.") |
| 63 |
_WRAP_METHOD(void set_current_alpha(guint16 alpha), gtk_color_selection_set_current_alpha) |
| 64 |
Gdk::Color get_current_color() const; |
| 65 |
_WRAP_METHOD(guint16 get_current_alpha() const, gtk_color_selection_get_current_alpha) |
| 66 |
_WRAP_METHOD(void set_previous_color(const Gdk::Color& color), gtk_color_selection_set_previous_color) |
| 67 |
_WRAP_METHOD(void set_previous_alpha(guint16 alpha), gtk_color_selection_set_previous_alpha) |
| 68 |
Gdk::Color get_previous_color() const; |
| 69 |
_WRAP_METHOD(guint16 get_previous_alpha() const, gtk_color_selection_get_previous_alpha) |
| 70 |
|
| 71 |
_IGNORE(gtk_color_selection_get_previous_rgba, gtk_color_selection_get_current_rgba) |
| 72 |
|
| 73 |
|
| 74 |
Gdk::RGBA get_current_rgba() const; |
| 75 |
Gdk::RGBA get_previous_rgba() const; |
| 76 |
|
| 77 |
_WRAP_METHOD(void set_current_rgba(const Gdk::RGBA& rgba), gtk_color_selection_set_current_rgba) |
| 78 |
_WRAP_METHOD(void set_previous_rgba(const Gdk::RGBA& rgba), gtk_color_selection_set_previous_rgba) |
| 79 |
|
| 80 |
_WRAP_METHOD(bool is_adjusting() const, gtk_color_selection_is_adjusting) |
| 81 |
|
| 82 |
static std::vector<Gdk::Color> palette_from_string(const Glib::ustring& str); |
| 83 |
static Glib::ustring palette_to_string(const std::vector<Gdk::Color>& colors); |
| 84 |
|
| 85 |
typedef sigc::slot<void, const Glib::RefPtr<Gdk::Screen>&, |
| 86 |
const std::vector<Gdk::Color>&> SlotChangePaletteHook; |
| 87 |
|
| 88 |
static SlotChangePaletteHook set_change_palette_hook(const SlotChangePaletteHook& slot); |
| 89 |
|
| 90 |
_WRAP_SIGNAL(void color_changed(), "color_changed") |
| 91 |
|
| 92 |
_WRAP_PROPERTY("has-palette", bool) |
| 93 |
_WRAP_PROPERTY("has-opacity-control", bool) |
| 94 |
_WRAP_PROPERTY("current-color", Gdk::Color) |
| 95 |
_WRAP_PROPERTY("current-alpha", guint) |
| 96 |
//The whole class was deprecated before this was added: _WRAP_PROPERTY("current-rgba", Gdk::RGBA) |
| 97 |
}; |
| 98 |
|
| 99 |
/** This dialog allows the user to select a color. |
| 100 |
* |
| 101 |
* A ColorSelectionDialog looks like this: |
| 102 |
* @image html colorselectiondialog1.png |
| 103 |
* |
| 104 |
* @ingroup Dialogs |
| 105 |
* @deprecated Use ColorChooserDialog instead. |
| 106 |
*/ |
| 107 |
class GTKMM_API ColorSelectionDialog : public Dialog |
| 108 |
{ |
| 109 |
_CLASS_GTKOBJECT(ColorSelectionDialog,GtkColorSelectionDialog,GTK_COLOR_SELECTION_DIALOG,Gtk::Dialog,GtkDialog,,,GTKMM_API) |
| 110 |
_UNMANAGEABLE() |
| 111 |
_IS_DEPRECATED |
| 112 |
public: |
| 113 |
|
| 114 |
_CTOR_DEFAULT() |
| 115 |
_WRAP_CTOR(ColorSelectionDialog(const Glib::ustring& title), gtk_color_selection_dialog_new) |
| 116 |
|
| 117 |
_WRAP_METHOD(ColorSelection* get_color_selection(), gtk_color_selection_dialog_get_color_selection) |
| 118 |
_WRAP_METHOD(const ColorSelection* get_color_selection() const, gtk_color_selection_dialog_get_color_selection) |
| 119 |
|
| 120 |
_WRAP_PROPERTY("color-selection", ColorSelection*) |
| 121 |
_WRAP_PROPERTY("ok-button", Button*) |
| 122 |
_WRAP_PROPERTY("cancel-button", Button*) |
| 123 |
_WRAP_PROPERTY("help-button", Button*) |
| 124 |
}; |
| 125 |
|
| 126 |
} // namespace Gtk |