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 = GtkToggleAction.html
27 * outFile = ToggleAction
28 * strct = GtkToggleAction
39 * - gtk_toggle_action_
50 module gtk
.ToggleAction
;
52 private import gtk
.gtktypes
;
54 private import lib
.gtk
;
56 private import glib
.Str
;
60 * A GtkToggleAction corresponds roughly to a GtkCheckMenuItem. It has an
61 * "active" state specifying whether the action has been checked or not.
63 private import gtk
.Action
;
64 public class ToggleAction
: Action
67 /** the main Gtk struct */
68 protected GtkToggleAction
* gtkToggleAction
;
71 public GtkToggleAction
* getToggleActionStruct()
73 return gtkToggleAction
;
77 /** the main Gtk struct as a void* */
78 protected void* getStruct()
80 return cast(void*)gtkToggleAction
;
84 * Sets our main struct and passes it to the parent class
86 public this (GtkToggleAction
* gtkToggleAction
)
88 super(cast(GtkAction
*)gtkToggleAction
);
89 this.gtkToggleAction
= gtkToggleAction
;
95 // imports for the signal processing
96 private import gobject
.Signals
;
97 private import gdk
.gdktypes
;
98 int[char[]] connectedSignals
;
100 void delegate(ToggleAction
)[] onToggledListeners
;
101 void addOnToggled(void delegate(ToggleAction
) dlg
)
103 if ( !("toggled" in connectedSignals
) )
108 cast(GCallback
)&callBackToggled
,
111 cast(ConnectFlags
)0);
112 connectedSignals
["toggled"] = 1;
114 onToggledListeners
~= dlg
;
116 extern(C
) static void callBackToggled(GtkToggleAction
* toggleactionStruct
, ToggleAction toggleAction
)
118 bit consumed
= false;
120 foreach ( void delegate(ToggleAction
) dlg
; toggleAction
.onToggledListeners
)
131 * Creates a new GtkToggleAction object. To add the action to
132 * a GtkActionGroup and set the accelerator for the action,
133 * call gtk_action_group_add_action_with_accel().
135 * A unique name for the action
137 * The label displayed in menu items and on buttons
139 * A tooltip for the action
141 * The stock icon to display in widgets representing the action
143 * a new GtkToggleAction
146 public this (char[] name
, char[] label
, char[] tooltip
, char[] stockId
)
148 // GtkToggleAction* gtk_toggle_action_new (const gchar *name, const gchar *label, const gchar *tooltip, const gchar *stock_id);
149 this(cast(GtkToggleAction
*)gtk_toggle_action_new(Str
.toStringz(name
), Str
.toStringz(label
), Str
.toStringz(tooltip
), Str
.toStringz(stockId
)) );
153 * Emits the "toggled" signal on the toggle action.
158 public void toggled()
160 // void gtk_toggle_action_toggled (GtkToggleAction *action);
161 gtk_toggle_action_toggled(gtkToggleAction
);
165 * Sets the checked state on the toggle action.
169 * whether the action should be checked or not
172 public void setActive(int isActive
)
174 // void gtk_toggle_action_set_active (GtkToggleAction *action, gboolean is_active);
175 gtk_toggle_action_set_active(gtkToggleAction
, isActive
);
179 * Returns the checked state of the toggle action.
183 * the checked state of the toggle action
186 public int getActive()
188 // gboolean gtk_toggle_action_get_active (GtkToggleAction *action);
189 return gtk_toggle_action_get_active(gtkToggleAction
);
193 * Sets whether the action should have proxies like a radio action.
197 * whether the action should have proxies like a radio
201 public void setDrawAsRadio(int drawAsRadio
)
203 // void gtk_toggle_action_set_draw_as_radio (GtkToggleAction *action, gboolean draw_as_radio);
204 gtk_toggle_action_set_draw_as_radio(gtkToggleAction
, drawAsRadio
);
208 * Returns whether the action should have proxies like a radio action.
212 * whether the action should have proxies like a radio action.
215 * The "active" property
216 * "active" gboolean : Read / Write
217 * If the toggle action should be active in or not.
218 * Default value: FALSE
221 public int getDrawAsRadio()
223 // gboolean gtk_toggle_action_get_draw_as_radio (GtkToggleAction *action);
224 return gtk_toggle_action_get_draw_as_radio(gtkToggleAction
);