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 * Conversion parameters: 26 * inFile = GtkColorChooserWidget.html 27 * outPack = gtk 28 * outFile = ColorChooserWidget 29 * strct = GtkColorChooserWidget 30 * realStrct= 31 * ctorStrct= 32 * clss = ColorChooserWidget 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * - ColorChooserIF 40 * prefixes: 41 * - gtk_color_chooser_widget_ 42 * omit structs: 43 * omit prefixes: 44 * omit code: 45 * omit signals: 46 * imports: 47 * - gtk.ColorChooserIF 48 * - gtk.ColorChooserT 49 * structWrap: 50 * module aliases: 51 * local aliases: 52 * overrides: 53 */ 54 55 module gtk.ColorChooserWidget; 56 57 public import gtkc.gtktypes; 58 59 private import gtkc.gtk; 60 private import glib.ConstructionException; 61 private import gobject.ObjectG; 62 63 private import gtk.ColorChooserIF; 64 private import gtk.ColorChooserT; 65 66 67 private import gtk.Box; 68 69 /** 70 * The GtkColorChooserWidget widget lets the user select a 71 * color. By default, the chooser presents a prefined palette 72 * of colors, plus a small number of settable custom colors. 73 * It is also possible to select a different color with the 74 * single-color editor. To enter the single-color editing mode, 75 * use the context menu of any color of the palette, or use the 76 * '+' button to add a new custom color. 77 * 78 * The chooser automatically remembers the last selection, as well 79 * as custom colors. 80 * 81 * To change the initially selected color, use gtk_color_chooser_set_rgba(). 82 * To get the selected font use gtk_color_chooser_get_rgba(). 83 * 84 * The GtkColorChooserWidget is used in the GtkColorChooserDialog 85 * to provide a dialog for selecting colors. 86 */ 87 public class ColorChooserWidget : Box, ColorChooserIF 88 { 89 90 /** the main Gtk struct */ 91 protected GtkColorChooserWidget* gtkColorChooserWidget; 92 93 94 /** Get the main Gtk struct */ 95 public GtkColorChooserWidget* getColorChooserWidgetStruct() 96 { 97 return gtkColorChooserWidget; 98 } 99 100 101 /** the main Gtk struct as a void* */ 102 protected override void* getStruct() 103 { 104 return cast(void*)gtkColorChooserWidget; 105 } 106 107 /** 108 * Sets our main struct and passes it to the parent class 109 */ 110 public this (GtkColorChooserWidget* gtkColorChooserWidget) 111 { 112 super(cast(GtkBox*)gtkColorChooserWidget); 113 this.gtkColorChooserWidget = gtkColorChooserWidget; 114 } 115 116 protected override void setStruct(GObject* obj) 117 { 118 super.setStruct(obj); 119 gtkColorChooserWidget = cast(GtkColorChooserWidget*)obj; 120 } 121 122 // add the ColorChooser capabilities 123 mixin ColorChooserT!(GtkColorChooserWidget); 124 125 /** 126 */ 127 128 /** 129 * Creates a new GtkColorChooserWidget. 130 * Throws: ConstructionException GTK+ fails to create the object. 131 */ 132 public this () 133 { 134 // GtkWidget * gtk_color_chooser_widget_new (void); 135 auto p = gtk_color_chooser_widget_new(); 136 if(p is null) 137 { 138 throw new ConstructionException("null returned by gtk_color_chooser_widget_new()"); 139 } 140 this(cast(GtkColorChooserWidget*) p); 141 } 142 }