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 = GtkToggleToolButton.html
27 * outFile = ToggleToolButton
28 * strct = GtkToggleToolButton
30 * ctorStrct=GtkToolItem
31 * clss = ToggleToolButton
39 * - gtk_toggle_tool_button_
48 * - GtkToolItem* -> ToolItem
52 module gtk
.ToggleToolButton
;
54 private import gtk
.gtktypes
;
56 private import lib
.gtk
;
58 private import glib
.Str
;
59 private import gtk
.ToolItem
;
63 * A GtkToggleToolButton is a GtkToolItem that contains a toggle
65 * Use gtk_toggle_tool_button_new() to create a new
66 * GtkToggleToolButton. Use gtk_toggle_tool_button_new_from_stock() to
67 * create a new GtkToggleToolButton containing a stock item.
69 private import gtk
.ToolButton
;
70 public class ToggleToolButton
: ToolButton
73 /** the main Gtk struct */
74 protected GtkToggleToolButton
* gtkToggleToolButton
;
77 public GtkToggleToolButton
* getToggleToolButtonStruct()
79 return gtkToggleToolButton
;
83 /** the main Gtk struct as a void* */
84 protected void* getStruct()
86 return cast(void*)gtkToggleToolButton
;
90 * Sets our main struct and passes it to the parent class
92 public this (GtkToggleToolButton
* gtkToggleToolButton
)
94 super(cast(GtkToolButton
*)gtkToggleToolButton
);
95 this.gtkToggleToolButton
= gtkToggleToolButton
;
101 // imports for the signal processing
102 private import gobject
.Signals
;
103 private import gdk
.gdktypes
;
104 int[char[]] connectedSignals
;
106 void delegate(ToggleToolButton
)[] onToggledListeners
;
107 void addOnToggled(void delegate(ToggleToolButton
) dlg
)
109 if ( !("toggled" in connectedSignals
) )
114 cast(GCallback
)&callBackToggled
,
117 cast(ConnectFlags
)0);
118 connectedSignals
["toggled"] = 1;
120 onToggledListeners
~= dlg
;
122 extern(C
) static void callBackToggled(GtkToggleToolButton
* toggleToolButtonStruct
, ToggleToolButton toggleToolButton
)
124 bit consumed
= false;
126 foreach ( void delegate(ToggleToolButton
) dlg
; toggleToolButton
.onToggledListeners
)
128 dlg(toggleToolButton
);
137 * Returns a new GtkToggleToolButton
139 * a newly created GtkToggleToolButton
144 // GtkToolItem* gtk_toggle_tool_button_new (void);
145 this(cast(GtkToggleToolButton
*)gtk_toggle_tool_button_new() );
149 * Creates a new GtkToggleToolButton containing the image and text from a
150 * stock item. Some stock ids have preprocessor macros like GTK_STOCK_OK
151 * and GTK_STOCK_APPLY.
152 * It is an error if stock_id is not a name of a stock item.
154 * the name of the stock item
156 * A new GtkToggleToolButton
159 public this (char[] stockId
)
161 // GtkToolItem* gtk_toggle_tool_button_new_from_stock (const gchar *stock_id);
162 this(cast(GtkToggleToolButton
*)gtk_toggle_tool_button_new_from_stock(Str
.toStringz(stockId
)) );
166 * Sets the status of the toggle tool button. Set to TRUE if you
167 * want the GtkToggleButton to be 'pressed in', and FALSE to raise it.
168 * This action causes the toggled signal to be emitted.
170 * a GtkToggleToolButton
172 * whether button should be active
175 public void setActive(int isActive
)
177 // void gtk_toggle_tool_button_set_active (GtkToggleToolButton *button, gboolean is_active);
178 gtk_toggle_tool_button_set_active(gtkToggleToolButton
, isActive
);
182 * Queries a GtkToggleToolButton and returns its current state.
183 * Returns TRUE if the toggle button is pressed in and FALSE if it is raised.
185 * a GtkToggleToolButton
187 * TRUE if the toggle tool button is pressed in, FALSE if not
190 * The "active" property
191 * "active" gboolean : Read / Write
192 * If the toggle tool button should be pressed in or not.
193 * Default value: FALSE
196 * The "toggled" signal
197 * void user_function (GtkToggleToolButton *toggle_tool_button,
198 * gpointer user_data) : Run first
199 * Emitted whenever the toggle tool button changes state.
200 * toggle_tool_button:
201 * the object that emitted the signal
203 * user data set when the signal handler was connected.
205 * GtkToolbar, GtkToolButton, GtkSeparatorToolItem
207 * The parent class of GtkToggleToolButton. The properties
208 * "label_widget", "label", "icon_widget", and "stock_id" on
209 * GtkToolButton determine the label and icon used on
210 * GtkToggleToolButtons.
211 * A subclass of GtkToolItem that separates groups of
212 * items on a toolbar.
214 public int getActive()
216 // gboolean gtk_toggle_tool_button_get_active (GtkToggleToolButton *button);
217 return gtk_toggle_tool_button_get_active(gtkToggleToolButton
);