1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module gtk.ColorChooserWidget; 26 27 private import glib.ConstructionException; 28 private import gobject.ObjectG; 29 private import gtk.ColorChooserIF; 30 private import gtk.ColorChooserT; 31 private import gtk.Widget; 32 private import gtk.c.functions; 33 public import gtk.c.types; 34 35 36 /** 37 * The `GtkColorChooserWidget` widget lets the user select a color. 38 * 39 * By default, the chooser presents a predefined palette of colors, 40 * plus a small number of settable custom colors. It is also possible 41 * to select a different color with the single-color editor. 42 * 43 * To enter the single-color editing mode, use the context menu of any 44 * color of the palette, or use the '+' button to add a new custom color. 45 * 46 * The chooser automatically remembers the last selection, as well 47 * as custom colors. 48 * 49 * To create a `GtkColorChooserWidget`, use [ctor@Gtk.ColorChooserWidget.new]. 50 * 51 * To change the initially selected color, use 52 * [method@Gtk.ColorChooser.set_rgba]. To get the selected color use 53 * [method@Gtk.ColorChooser.get_rgba]. 54 * 55 * The `GtkColorChooserWidget` is used in the [class@Gtk.ColorChooserDialog] 56 * to provide a dialog for selecting colors. 57 * 58 * # CSS names 59 * 60 * `GtkColorChooserWidget` has a single CSS node with name colorchooser. 61 */ 62 public class ColorChooserWidget : Widget, ColorChooserIF 63 { 64 /** the main Gtk struct */ 65 protected GtkColorChooserWidget* gtkColorChooserWidget; 66 67 /** Get the main Gtk struct */ 68 public GtkColorChooserWidget* getColorChooserWidgetStruct(bool transferOwnership = false) 69 { 70 if (transferOwnership) 71 ownedRef = false; 72 return gtkColorChooserWidget; 73 } 74 75 /** the main Gtk struct as a void* */ 76 protected override void* getStruct() 77 { 78 return cast(void*)gtkColorChooserWidget; 79 } 80 81 /** 82 * Sets our main struct and passes it to the parent class. 83 */ 84 public this (GtkColorChooserWidget* gtkColorChooserWidget, bool ownedRef = false) 85 { 86 this.gtkColorChooserWidget = gtkColorChooserWidget; 87 super(cast(GtkWidget*)gtkColorChooserWidget, ownedRef); 88 } 89 90 // add the ColorChooser capabilities 91 mixin ColorChooserT!(GtkColorChooserWidget); 92 93 94 /** */ 95 public static GType getType() 96 { 97 return gtk_color_chooser_widget_get_type(); 98 } 99 100 /** 101 * Creates a new `GtkColorChooserWidget`. 102 * 103 * Returns: a new `GtkColorChooserWidget` 104 * 105 * Throws: ConstructionException GTK+ fails to create the object. 106 */ 107 public this() 108 { 109 auto __p = gtk_color_chooser_widget_new(); 110 111 if(__p is null) 112 { 113 throw new ConstructionException("null returned by new"); 114 } 115 116 this(cast(GtkColorChooserWidget*) __p); 117 } 118 }