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 = GtkRadioToolButton.html 27 * outPack = gtk 28 * outFile = RadioToolButton 29 * strct = GtkRadioToolButton 30 * realStrct= 31 * ctorStrct=GtkToolItem 32 * clss = RadioToolButton 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_radio_tool_button_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - glib.Str 47 * - glib.ListSG 48 * structWrap: 49 * - GSList* -> ListSG 50 * - GtkRadioToolButton* -> RadioToolButton 51 * module aliases: 52 * local aliases: 53 * overrides: 54 */ 55 56 module gtk.RadioToolButton; 57 58 public import gtkc.gtktypes; 59 60 private import gtkc.gtk; 61 private import glib.ConstructionException; 62 private import gobject.ObjectG; 63 64 65 private import glib.Str; 66 private import glib.ListSG; 67 68 69 70 private import gtk.ToggleToolButton; 71 72 /** 73 * A GtkRadioToolButton is a GtkToolItem that contains a radio button, 74 * that is, a button that is part of a group of toggle buttons where only 75 * one button can be active at a time. 76 * 77 * Use gtk_radio_tool_button_new() to create a new 78 * GtkRadioToolButton. Use gtk_radio_tool_button_new_from_widget() to 79 * create a new GtkRadioToolButton that is part of the same group as an 80 * existing GtkRadioToolButton. 81 */ 82 public class RadioToolButton : ToggleToolButton 83 { 84 85 /** the main Gtk struct */ 86 protected GtkRadioToolButton* gtkRadioToolButton; 87 88 89 public GtkRadioToolButton* getRadioToolButtonStruct() 90 { 91 return gtkRadioToolButton; 92 } 93 94 95 /** the main Gtk struct as a void* */ 96 protected override void* getStruct() 97 { 98 return cast(void*)gtkRadioToolButton; 99 } 100 101 /** 102 * Sets our main struct and passes it to the parent class 103 */ 104 public this (GtkRadioToolButton* gtkRadioToolButton) 105 { 106 super(cast(GtkToggleToolButton*)gtkRadioToolButton); 107 this.gtkRadioToolButton = gtkRadioToolButton; 108 } 109 110 protected override void setStruct(GObject* obj) 111 { 112 super.setStruct(obj); 113 gtkRadioToolButton = cast(GtkRadioToolButton*)obj; 114 } 115 116 /** 117 */ 118 119 /** 120 * Creates a new GtkRadioToolButton, adding it to group. 121 * Since 2.4 122 * Params: 123 * group = An 124 * existing radio button group, or NULL if you are creating a new group. [allow-none][transfer none][element-type GtkRadioButton] 125 * Throws: ConstructionException GTK+ fails to create the object. 126 */ 127 public this (ListSG group) 128 { 129 // GtkToolItem * gtk_radio_tool_button_new (GSList *group); 130 auto p = gtk_radio_tool_button_new((group is null) ? null : group.getListSGStruct()); 131 if(p is null) 132 { 133 throw new ConstructionException("null returned by gtk_radio_tool_button_new((group is null) ? null : group.getListSGStruct())"); 134 } 135 this(cast(GtkRadioToolButton*) p); 136 } 137 138 /** 139 * Warning 140 * gtk_radio_tool_button_new_from_stock has been deprecated since version 3.10 and should not be used in newly-written code. Use gtk_radio_tool_button_new() instead. 141 * Creates a new GtkRadioToolButton, adding it to group. 142 * The new GtkRadioToolButton will contain an icon and label from the 143 * stock item indicated by stock_id. 144 * Since 2.4 145 * Params: 146 * group = an existing radio button 147 * group, or NULL if you are creating a new group. [allow-none][element-type GtkRadioButton] 148 * stockId = the name of a stock item 149 * Throws: ConstructionException GTK+ fails to create the object. 150 */ 151 public this (ListSG group, string stockId) 152 { 153 // GtkToolItem * gtk_radio_tool_button_new_from_stock (GSList *group, const gchar *stock_id); 154 auto p = gtk_radio_tool_button_new_from_stock((group is null) ? null : group.getListSGStruct(), Str.toStringz(stockId)); 155 if(p is null) 156 { 157 throw new ConstructionException("null returned by gtk_radio_tool_button_new_from_stock((group is null) ? null : group.getListSGStruct(), Str.toStringz(stockId))"); 158 } 159 this(cast(GtkRadioToolButton*) p); 160 } 161 162 /** 163 * Creates a new GtkRadioToolButton adding it to the same group as gruup 164 * Since 2.4 165 * Params: 166 * group = An existing GtkRadioToolButton, or NULL. [allow-none] 167 * Throws: ConstructionException GTK+ fails to create the object. 168 */ 169 public this (RadioToolButton group) 170 { 171 // GtkToolItem * gtk_radio_tool_button_new_from_widget (GtkRadioToolButton *group); 172 auto p = gtk_radio_tool_button_new_from_widget((group is null) ? null : group.getRadioToolButtonStruct()); 173 if(p is null) 174 { 175 throw new ConstructionException("null returned by gtk_radio_tool_button_new_from_widget((group is null) ? null : group.getRadioToolButtonStruct())"); 176 } 177 this(cast(GtkRadioToolButton*) p); 178 } 179 180 /** 181 * Warning 182 * gtk_radio_tool_button_new_with_stock_from_widget has been deprecated since version 3.10 and should not be used in newly-written code. gtk_radio_tool_button_new_from_widget 183 * Creates a new GtkRadioToolButton adding it to the same group as group. 184 * The new GtkRadioToolButton will contain an icon and label from the 185 * stock item indicated by stock_id. 186 * Since 2.4 187 * Params: 188 * group = An existing GtkRadioToolButton. [allow-none] 189 * stockId = the name of a stock item 190 * Throws: ConstructionException GTK+ fails to create the object. 191 */ 192 public this (RadioToolButton group, string stockId) 193 { 194 // GtkToolItem * gtk_radio_tool_button_new_with_stock_from_widget (GtkRadioToolButton *group, const gchar *stock_id); 195 auto p = gtk_radio_tool_button_new_with_stock_from_widget((group is null) ? null : group.getRadioToolButtonStruct(), Str.toStringz(stockId)); 196 if(p is null) 197 { 198 throw new ConstructionException("null returned by gtk_radio_tool_button_new_with_stock_from_widget((group is null) ? null : group.getRadioToolButtonStruct(), Str.toStringz(stockId))"); 199 } 200 this(cast(GtkRadioToolButton*) p); 201 } 202 203 /** 204 * Returns the radio button group button belongs to. 205 * Since 2.4 206 * Returns: The group button belongs to. [transfer none][element-type GtkRadioButton] 207 */ 208 public ListSG getGroup() 209 { 210 // GSList * gtk_radio_tool_button_get_group (GtkRadioToolButton *button); 211 auto p = gtk_radio_tool_button_get_group(gtkRadioToolButton); 212 213 if(p is null) 214 { 215 return null; 216 } 217 218 return ObjectG.getDObject!(ListSG)(cast(GSList*) p); 219 } 220 221 /** 222 * Adds button to group, removing it from the group it belonged to before. 223 * Since 2.4 224 * Params: 225 * group = an existing radio button group. [transfer none][element-type GtkRadioButton] 226 */ 227 public void setGroup(ListSG group) 228 { 229 // void gtk_radio_tool_button_set_group (GtkRadioToolButton *button, GSList *group); 230 gtk_radio_tool_button_set_group(gtkRadioToolButton, (group is null) ? null : group.getListSGStruct()); 231 } 232 }