2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkRadioAction.html
27 * outFile = RadioAction
28 * strct = GtkRadioAction
52 module gtk
.RadioAction
;
54 private import gtk
.gtktypes
;
56 private import lib
.gtk
;
58 private import glib
.Str
;
59 private import glib
.ListSG
;
63 * A GtkRadioAction is similar to GtkRadioMenuItem. A number of radio
64 * actions can be linked together so that only one may be active at any
67 private import gtk
.ToggleAction
;
68 public class RadioAction
: ToggleAction
71 /** the main Gtk struct */
72 protected GtkRadioAction
* gtkRadioAction
;
75 public GtkRadioAction
* getRadioActionStruct()
77 return gtkRadioAction
;
81 /** the main Gtk struct as a void* */
82 protected void* getStruct()
84 return cast(void*)gtkRadioAction
;
88 * Sets our main struct and passes it to the parent class
90 public this (GtkRadioAction
* gtkRadioAction
)
92 super(cast(GtkToggleAction
*)gtkRadioAction
);
93 this.gtkRadioAction
= gtkRadioAction
;
99 // imports for the signal processing
100 private import gobject
.Signals
;
101 private import gdk
.gdktypes
;
102 int[char[]] connectedSignals
;
104 void delegate(GtkRadioAction
*, RadioAction
)[] onChangedListeners
;
105 void addOnChanged(void delegate(GtkRadioAction
*, RadioAction
) dlg
)
107 if ( !("changed" in connectedSignals
) )
112 cast(GCallback
)&callBackChanged
,
115 cast(ConnectFlags
)0);
116 connectedSignals
["changed"] = 1;
118 onChangedListeners
~= dlg
;
120 extern(C
) static void callBackChanged(GtkRadioAction
* actionStruct
, GtkRadioAction
* current
, RadioAction radioAction
)
122 bit consumed
= false;
124 foreach ( void delegate(GtkRadioAction
*, RadioAction
) dlg
; radioAction
.onChangedListeners
)
126 dlg(current
, radioAction
);
135 * Creates a new GtkRadioAction object. To add the action to
136 * a GtkActionGroup and set the accelerator for the action,
137 * call gtk_action_group_add_action_with_accel().
139 * A unique name for the action
141 * The label displayed in menu items and on buttons
143 * A tooltip for this action
145 * The stock icon to display in widgets representing this action
147 * The value which gtk_radio_action_get_current_value() should return
148 * if this action is selected.
150 * a new GtkRadioAction
153 public this (char[] name
, char[] label
, char[] tooltip
, char[] stockId
, int value
)
155 // GtkRadioAction* gtk_radio_action_new (const gchar *name, const gchar *label, const gchar *tooltip, const gchar *stock_id, gint value);
156 this(cast(GtkRadioAction
*)gtk_radio_action_new(Str
.toStringz(name
), Str
.toStringz(label
), Str
.toStringz(tooltip
), Str
.toStringz(stockId
), value
) );
160 * Returns the list representing the radio group for this object.
161 * Note that the returned list is only valid until the next change
163 * A common way to set up a group of radio group is the following:
164 * GSList *group = NULL;
165 * GtkRadioAction *action;
166 * while (/+* more actions to add +/)
168 * action = gtk_radio_action_new (...);
169 * gtk_radio_action_set_group (action, group);
170 * group = gtk_radio_action_get_group (action);
175 * the list representing the radio group for this object
178 public ListSG
getGroup()
180 // GSList* gtk_radio_action_get_group (GtkRadioAction *action);
181 return new ListSG( gtk_radio_action_get_group(gtkRadioAction
) );
185 * Sets the radio group for the radio action object.
189 * a list representing a radio group
192 public void setGroup(ListSG group
)
194 // void gtk_radio_action_set_group (GtkRadioAction *action, GSList *group);
195 gtk_radio_action_set_group(gtkRadioAction
, (group
is null) ?
null : group
.getListSGStruct());
199 * Obtains the value property of the currently active member of
200 * the group to which action belongs.
204 * The value of the currently active group member
207 public int getCurrentValue()
209 // gint gtk_radio_action_get_current_value (GtkRadioAction *action);
210 return gtk_radio_action_get_current_value(gtkRadioAction
);
214 * Sets the currently active group member to the member with value
215 * property current_value.
222 * The "current-value" property
223 * "current-value" gint : Read / Write
224 * The value property of the currently active member of the group to which
225 * this action belongs.
229 public void setCurrentValue(int currentValue
)
231 // void gtk_radio_action_set_current_value (GtkRadioAction *action, gint current_value);
232 gtk_radio_action_set_current_value(gtkRadioAction
, currentValue
);