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 = GtkColorSelectionDialog.html 27 * outPack = gtk 28 * outFile = ColorSelectionDialog 29 * strct = GtkColorSelectionDialog 30 * realStrct= 31 * ctorStrct= 32 * clss = ColorSelectionDialog 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_color_selection_dialog_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * - gtk_color_selection_dialog_get_color_selection 45 * omit signals: 46 * imports: 47 * - glib.Str 48 * - gtk.ColorSelection 49 * structWrap: 50 * module aliases: 51 * local aliases: 52 * overrides: 53 */ 54 55 module gtk.ColorSelectionDialog; 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 glib.Str; 64 private import gtk.ColorSelection; 65 66 67 private import gtk.Dialog; 68 69 /** 70 * The GtkColorSelectionDialog provides a standard dialog which 71 * allows the user to select a color much like the GtkFileChooserDialog 72 * provides a standard dialog for file selection. 73 * 74 * Use gtk_color_selection_dialog_get_color_selection() to get the 75 * GtkColorSelection widget contained within the dialog. Use this widget 76 * and its gtk_color_selection_get_current_color() 77 * function to gain access to the selected color. Connect a handler 78 * for this widget's "color-changed" signal to be notified 79 * when the color changes. 80 * 81 * GtkColorSelectionDialog as GtkBuildable 82 * 83 * The GtkColorSelectionDialog implementation of the GtkBuildable interface 84 * exposes the embedded GtkColorSelection as internal child with the 85 * name "color_selection". It also exposes the buttons with the names 86 * "ok_button", "cancel_button" and "help_button". 87 */ 88 public class ColorSelectionDialog : Dialog 89 { 90 91 /** the main Gtk struct */ 92 protected GtkColorSelectionDialog* gtkColorSelectionDialog; 93 94 95 /** Get the main Gtk struct */ 96 public GtkColorSelectionDialog* getColorSelectionDialogStruct() 97 { 98 return gtkColorSelectionDialog; 99 } 100 101 102 /** the main Gtk struct as a void* */ 103 protected override void* getStruct() 104 { 105 return cast(void*)gtkColorSelectionDialog; 106 } 107 108 /** 109 * Sets our main struct and passes it to the parent class 110 */ 111 public this (GtkColorSelectionDialog* gtkColorSelectionDialog) 112 { 113 super(cast(GtkDialog*)gtkColorSelectionDialog); 114 this.gtkColorSelectionDialog = gtkColorSelectionDialog; 115 } 116 117 protected override void setStruct(GObject* obj) 118 { 119 super.setStruct(obj); 120 gtkColorSelectionDialog = cast(GtkColorSelectionDialog*)obj; 121 } 122 123 /** 124 * Retrieves the GtkColorSelection widget embedded in the dialog. 125 * Since 2.14 126 * Returns: the embedded GtkColorSelection 127 */ 128 public ColorSelection getColorSelection() 129 { 130 // GtkWidget* gtk_color_selection_dialog_get_color_selection (GtkColorSelectionDialog *colorsel); 131 auto p = gtk_color_selection_dialog_get_color_selection(gtkColorSelectionDialog); 132 if(p is null) 133 { 134 return null; 135 } 136 return new ColorSelection(cast(GtkColorSelection*) p); 137 } 138 139 /** 140 */ 141 142 /** 143 * Creates a new GtkColorSelectionDialog. 144 * Params: 145 * title = a string containing the title text for the dialog. 146 * Throws: ConstructionException GTK+ fails to create the object. 147 */ 148 public this (string title) 149 { 150 // GtkWidget * gtk_color_selection_dialog_new (const gchar *title); 151 auto p = gtk_color_selection_dialog_new(Str.toStringz(title)); 152 if(p is null) 153 { 154 throw new ConstructionException("null returned by gtk_color_selection_dialog_new(Str.toStringz(title))"); 155 } 156 this(cast(GtkColorSelectionDialog*) p); 157 } 158 }