2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_COLORSELECTION_H
4 #define _GTKMM_COLORSELECTION_H
11 /* Copyright (C) 1998-2002 The gtkmm Development Team
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Library General Public
15 * License as published by the Free Software Foundation; either
16 * version 2 of the License, or (at your option) any later version.
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Library General Public License for more details.
23 * You should have received a copy of the GNU Library General Public
24 * License along with this library; if not, write to the Free
25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <gtkmm/box.h>
30 #include <gtkmm/dialog.h>
31 #include <gtkmm/button.h>
34 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35 typedef struct _GtkColorSelection GtkColorSelection;
36 typedef struct _GtkColorSelectionClass GtkColorSelectionClass;
37 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
41 { class ColorSelection_Class; } // namespace Gtk
42 #ifndef DOXYGEN_SHOULD_SKIP_THIS
43 typedef struct _GtkColorSelectionDialog GtkColorSelectionDialog;
44 typedef struct _GtkColorSelectionDialogClass GtkColorSelectionDialogClass;
45 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
49 { class ColorSelectionDialog_Class; } // namespace Gtk
53 /** A widget used to select a color.
55 * This widget is used to select a color. It
56 * consists of a color wheel and number of sliders and entry boxes for color
57 * parameters such as hue, saturation, value, red, green, blue, and opacity.
59 * It is found on the standard color selection dialog box
60 * Gtk::ColorSelectionDialog.
65 class ColorSelection : public VBox
68 #ifndef DOXYGEN_SHOULD_SKIP_THIS
69 typedef ColorSelection CppObjectType;
70 typedef ColorSelection_Class CppClassType;
71 typedef GtkColorSelection BaseObjectType;
72 typedef GtkColorSelectionClass BaseClassType;
73 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
75 virtual ~ColorSelection();
77 #ifndef DOXYGEN_SHOULD_SKIP_THIS
80 friend class ColorSelection_Class;
81 static CppClassType colorselection_class_;
84 ColorSelection(const ColorSelection&);
85 ColorSelection& operator=(const ColorSelection&);
88 explicit ColorSelection(const Glib::ConstructParams& construct_params);
89 explicit ColorSelection(GtkColorSelection* castitem);
91 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
94 #ifndef DOXYGEN_SHOULD_SKIP_THIS
95 static GType get_type() G_GNUC_CONST;
96 static GType get_base_type() G_GNUC_CONST;
99 ///Provides access to the underlying C GtkObject.
100 GtkColorSelection* gobj() { return reinterpret_cast<GtkColorSelection*>(gobject_); }
102 ///Provides access to the underlying C GtkObject.
103 const GtkColorSelection* gobj() const { return reinterpret_cast<GtkColorSelection*>(gobject_); }
107 //C++ methods used to invoke GTK+ virtual functions:
108 #ifdef GLIBMM_VFUNCS_ENABLED
109 #endif //GLIBMM_VFUNCS_ENABLED
112 //GTK+ Virtual Functions (override these to change behaviour):
113 #ifdef GLIBMM_VFUNCS_ENABLED
114 #endif //GLIBMM_VFUNCS_ENABLED
116 //Default Signal Handlers::
117 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
118 virtual void on_color_changed();
119 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
129 /** Determines whether the colorsel has an opacity control.
130 * @return <tt>true</tt> if the @a colorsel has an opacity control. <tt>false</tt> if it does't.
132 bool get_has_opacity_control() const;
134 /** Sets the @a colorsel to use or not use opacity.
135 * @param has_opacity <tt>true</tt> if @a colorsel can set the opacity, <tt>false</tt> otherwise.
137 void set_has_opacity_control(bool has_opacity = true);
139 /** Determines whether the color selector has a color palette.
140 * @return <tt>true</tt> if the selector has a palette. <tt>false</tt> if it hasn't.
142 bool get_has_palette() const;
144 /** Shows and hides the palette based upon the value of @a has_palette .
145 * @param has_palette <tt>true</tt> if palette is to be visible, <tt>false</tt> otherwise.
147 void set_has_palette(bool has_palette = true);
149 /** Sets the current color to be @a color . The first time this is called, it will
150 * also set the original color to be @a color too.
151 * @param color A Gdk::Color to set the current color with.
153 void set_current_color(const Gdk::Color& color);
155 /** Sets the current opacity to be @a alpha . The first time this is called, it will
156 * also set the original opacity to be @a alpha too.
157 * @param alpha An integer between 0 and 65535.
159 void set_current_alpha(guint16 alpha);
160 Gdk::Color get_current_color() const;
162 /** Return value: an integer between 0 and 65535.
163 * @return An integer between 0 and 65535.
165 guint16 get_current_alpha() const;
167 /** Sets the 'previous' color to be @a color . This function should be called with
168 * some hesitations, as it might seem confusing to have that color change.
169 * Calling set_current_color() will also set this color the first
171 * @param color A Gdk::Color to set the previous color with.
173 void set_previous_color(const Gdk::Color& color);
175 /** Sets the 'previous' alpha to be @a alpha . This function should be called with
176 * some hesitations, as it might seem confusing to have that alpha change.
177 * @param alpha An integer between 0 and 65535.
179 void set_previous_alpha(guint16 alpha);
180 Gdk::Color get_previous_color() const;
182 /** Return value: an integer between 0 and 65535.
183 * @return An integer between 0 and 65535.
185 guint16 get_previous_alpha() const;
188 /** Gets the current state of the @a colorsel .
189 * @return <tt>true</tt> if the user is currently dragging a color around, and <tt>false</tt>
190 * if the selection has stopped.
192 bool is_adjusting() const;
194 static Gdk::ArrayHandle_Color palette_from_string(const Glib::ustring& str);
195 static Glib::ustring palette_to_string(const Gdk::ArrayHandle_Color& colors);
197 typedef sigc::slot<void, const Glib::RefPtr<Gdk::Screen>&,
198 const Gdk::ArrayHandle_Color&> SlotChangePaletteHook;
200 static SlotChangePaletteHook set_change_palette_hook(const SlotChangePaletteHook& slot);
205 * <tt>void on_my_%color_changed()</tt>
208 Glib::SignalProxy0< void > signal_color_changed();
211 #ifdef GLIBMM_PROPERTIES_ENABLED
212 /** Whether a palette should be used.
214 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
215 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
216 * the value of the property changes.
218 Glib::PropertyProxy<bool> property_has_palette() ;
219 #endif //#GLIBMM_PROPERTIES_ENABLED
221 #ifdef GLIBMM_PROPERTIES_ENABLED
222 /** Whether a palette should be used.
224 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
225 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
226 * the value of the property changes.
228 Glib::PropertyProxy_ReadOnly<bool> property_has_palette() const;
229 #endif //#GLIBMM_PROPERTIES_ENABLED
231 #ifdef GLIBMM_PROPERTIES_ENABLED
232 /** Whether the color selector should allow setting opacity.
234 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
235 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
236 * the value of the property changes.
238 Glib::PropertyProxy<bool> property_has_opacity_control() ;
239 #endif //#GLIBMM_PROPERTIES_ENABLED
241 #ifdef GLIBMM_PROPERTIES_ENABLED
242 /** Whether the color selector should allow setting opacity.
244 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
245 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
246 * the value of the property changes.
248 Glib::PropertyProxy_ReadOnly<bool> property_has_opacity_control() const;
249 #endif //#GLIBMM_PROPERTIES_ENABLED
251 #ifdef GLIBMM_PROPERTIES_ENABLED
252 /** The current color.
254 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
255 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
256 * the value of the property changes.
258 Glib::PropertyProxy<Gdk::Color> property_current_color() ;
259 #endif //#GLIBMM_PROPERTIES_ENABLED
261 #ifdef GLIBMM_PROPERTIES_ENABLED
262 /** The current color.
264 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
265 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
266 * the value of the property changes.
268 Glib::PropertyProxy_ReadOnly<Gdk::Color> property_current_color() const;
269 #endif //#GLIBMM_PROPERTIES_ENABLED
271 #ifdef GLIBMM_PROPERTIES_ENABLED
272 /** The current opacity value (0 fully transparent, 65535 fully opaque).
274 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
275 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
276 * the value of the property changes.
278 Glib::PropertyProxy<guint> property_current_alpha() ;
279 #endif //#GLIBMM_PROPERTIES_ENABLED
281 #ifdef GLIBMM_PROPERTIES_ENABLED
282 /** The current opacity value (0 fully transparent, 65535 fully opaque).
284 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
285 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
286 * the value of the property changes.
288 Glib::PropertyProxy_ReadOnly<guint> property_current_alpha() const;
289 #endif //#GLIBMM_PROPERTIES_ENABLED
294 /** This dialog allows the user to select a color.
298 class ColorSelectionDialog : public Dialog
301 #ifndef DOXYGEN_SHOULD_SKIP_THIS
302 typedef ColorSelectionDialog CppObjectType;
303 typedef ColorSelectionDialog_Class CppClassType;
304 typedef GtkColorSelectionDialog BaseObjectType;
305 typedef GtkColorSelectionDialogClass BaseClassType;
306 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
308 virtual ~ColorSelectionDialog();
310 #ifndef DOXYGEN_SHOULD_SKIP_THIS
313 friend class ColorSelectionDialog_Class;
314 static CppClassType colorselectiondialog_class_;
317 ColorSelectionDialog(const ColorSelectionDialog&);
318 ColorSelectionDialog& operator=(const ColorSelectionDialog&);
321 explicit ColorSelectionDialog(const Glib::ConstructParams& construct_params);
322 explicit ColorSelectionDialog(GtkColorSelectionDialog* castitem);
324 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
327 #ifndef DOXYGEN_SHOULD_SKIP_THIS
328 static GType get_type() G_GNUC_CONST;
329 static GType get_base_type() G_GNUC_CONST;
332 ///Provides access to the underlying C GtkObject.
333 GtkColorSelectionDialog* gobj() { return reinterpret_cast<GtkColorSelectionDialog*>(gobject_); }
335 ///Provides access to the underlying C GtkObject.
336 const GtkColorSelectionDialog* gobj() const { return reinterpret_cast<GtkColorSelectionDialog*>(gobject_); }
340 //C++ methods used to invoke GTK+ virtual functions:
341 #ifdef GLIBMM_VFUNCS_ENABLED
342 #endif //GLIBMM_VFUNCS_ENABLED
345 //GTK+ Virtual Functions (override these to change behaviour):
346 #ifdef GLIBMM_VFUNCS_ENABLED
347 #endif //GLIBMM_VFUNCS_ENABLED
349 //Default Signal Handlers::
350 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
351 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
359 ColorSelectionDialog();
360 explicit ColorSelectionDialog(const Glib::ustring& title);
362 ColorSelection* get_colorsel();
363 const ColorSelection* get_colorsel() const;
364 Button* get_ok_button();
365 const Button* get_ok_button() const;
366 Button* get_cancel_button();
367 const Button* get_cancel_button() const;
368 Button* get_help_button();
369 const Button* get_help_button() const;
379 /** A Glib::wrap() method for this object.
381 * @param object The C instance.
382 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
383 * @result A C++ instance that wraps this C instance.
385 * @relates Gtk::ColorSelection
387 Gtk::ColorSelection* wrap(GtkColorSelection* object, bool take_copy = false);
393 /** A Glib::wrap() method for this object.
395 * @param object The C instance.
396 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
397 * @result A C++ instance that wraps this C instance.
399 * @relates Gtk::ColorSelectionDialog
401 Gtk::ColorSelectionDialog* wrap(GtkColorSelectionDialog* object, bool take_copy = false);
405 #endif /* _GTKMM_COLORSELECTION_H */