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.Box;
30 private import gtk.ColorChooserIF;
31 private import gtk.ColorChooserT;
32 private import gtk.Widget;
33 private import gtkc.gtk;
34 public  import gtkc.gtktypes;
35 
36 
37 /**
38  * The #GtkColorChooserWidget widget lets the user select a
39  * color. By default, the chooser presents a predefined palette
40  * of colors, plus a small number of settable custom colors.
41  * It is also possible to select a different color with the
42  * single-color editor. To enter the single-color editing mode,
43  * use the context menu of any color of the palette, or use the
44  * '+' 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 change the initially selected color, use gtk_color_chooser_set_rgba().
50  * To get the selected color use gtk_color_chooser_get_rgba().
51  * 
52  * The #GtkColorChooserWidget is used in the #GtkColorChooserDialog
53  * to provide a dialog for selecting colors.
54  * 
55  * # CSS names
56  * 
57  * GtkColorChooserWidget has a single CSS node with name colorchooser.
58  */
59 public class ColorChooserWidget : Box, ColorChooserIF
60 {
61 	/** the main Gtk struct */
62 	protected GtkColorChooserWidget* gtkColorChooserWidget;
63 
64 	/** Get the main Gtk struct */
65 	public GtkColorChooserWidget* getColorChooserWidgetStruct()
66 	{
67 		return gtkColorChooserWidget;
68 	}
69 
70 	/** the main Gtk struct as a void* */
71 	protected override void* getStruct()
72 	{
73 		return cast(void*)gtkColorChooserWidget;
74 	}
75 
76 	protected override void setStruct(GObject* obj)
77 	{
78 		gtkColorChooserWidget = cast(GtkColorChooserWidget*)obj;
79 		super.setStruct(obj);
80 	}
81 
82 	/**
83 	 * Sets our main struct and passes it to the parent class.
84 	 */
85 	public this (GtkColorChooserWidget* gtkColorChooserWidget, bool ownedRef = false)
86 	{
87 		this.gtkColorChooserWidget = gtkColorChooserWidget;
88 		super(cast(GtkBox*)gtkColorChooserWidget, ownedRef);
89 	}
90 
91 	// add the ColorChooser capabilities
92 	mixin ColorChooserT!(GtkColorChooserWidget);
93 
94 
95 	/** */
96 	public static GType getType()
97 	{
98 		return gtk_color_chooser_widget_get_type();
99 	}
100 
101 	/**
102 	 * Creates a new #GtkColorChooserWidget.
103 	 *
104 	 * Return: a new #GtkColorChooserWidget
105 	 *
106 	 * Since: 3.4
107 	 *
108 	 * Throws: ConstructionException GTK+ fails to create the object.
109 	 */
110 	public this()
111 	{
112 		auto p = gtk_color_chooser_widget_new();
113 		
114 		if(p is null)
115 		{
116 			throw new ConstructionException("null returned by new");
117 		}
118 		
119 		this(cast(GtkColorChooserWidget*) p);
120 	}
121 }