alternative to assert
[gtkD.git] / gtkD / src / gtk / InputDialog.d
blob25d8a248da1489338323c76774a0884d852c65f9
1 /*
2 * This file is part of gtkD.
4 * gtkD 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 * gtkD 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 gtkD; 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 = GtkInputDialog.html
26 * outPack = gtk
27 * outFile = InputDialog
28 * strct = GtkInputDialog
29 * realStrct=
30 * ctorStrct=
31 * clss = InputDialog
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_input_dialog_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * structWrap:
46 * module aliases:
47 * local aliases:
50 module gtk.InputDialog;
52 version(noAssert)
54 version(Tango)
56 import tango.io.Stdout; // use the tango loging?
60 private import gtkc.gtktypes;
62 private import gtkc.gtk;
69 /**
70 * Description
71 * NOTE this widget is considered too specialized/little-used for
72 * GTK+, and will in the future be moved to some other package. If
73 * your application needs this widget, feel free to use it, as the
74 * widget does work and is useful in some applications; it's just not
75 * of general interest. However, we are not accepting new features for
76 * the widget, and it will eventually move out of the GTK+
77 * distribution.
78 * GtkInputDialog displays a dialog which allows the user
79 * to configure XInput extension devices. For each
80 * device, they can control the mode of the device
81 * (disabled, screen-relative, or window-relative),
82 * the mapping of axes to coordinates, and the
83 * mapping of the devices macro keys to key press
84 * events.
85 * GtkInputDialog contains two buttons to which
86 * the application can connect; one for closing
87 * the dialog, and one for saving the changes.
88 * No actions are bound to these by default.
89 * The changes that the user makes take effect
90 * immediately.
92 private import gtk.Dialog;
93 public class InputDialog : Dialog
96 /** the main Gtk struct */
97 protected GtkInputDialog* gtkInputDialog;
100 public GtkInputDialog* getInputDialogStruct()
102 return gtkInputDialog;
106 /** the main Gtk struct as a void* */
107 protected void* getStruct()
109 return cast(void*)gtkInputDialog;
113 * Sets our main struct and passes it to the parent class
115 public this (GtkInputDialog* gtkInputDialog)
117 version(noAssert)
119 if ( gtkInputDialog is null )
121 int zero = 0;
122 version(Tango)
124 Stdout("struct gtkInputDialog is null on constructor").newline;
126 else
128 printf("struct gtkInputDialog is null on constructor");
130 zero = zero / zero;
133 else
135 assert(gtkInputDialog !is null, "struct gtkInputDialog is null on constructor");
137 super(cast(GtkDialog*)gtkInputDialog);
138 this.gtkInputDialog = gtkInputDialog;
144 // imports for the signal processing
145 private import gobject.Signals;
146 private import gtkc.gdktypes;
147 int[char[]] connectedSignals;
149 void delegate(GdkDevice*, InputDialog)[] onDisableDeviceListeners;
150 void addOnDisableDevice(void delegate(GdkDevice*, InputDialog) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
152 if ( !("disable-device" in connectedSignals) )
154 Signals.connectData(
155 getStruct(),
156 "disable-device",
157 cast(GCallback)&callBackDisableDevice,
158 cast(void*)this,
159 null,
160 connectFlags);
161 connectedSignals["disable-device"] = 1;
163 onDisableDeviceListeners ~= dlg;
165 extern(C) static void callBackDisableDevice(GtkInputDialog* inputdialogStruct, GdkDevice* deviceid, InputDialog inputDialog)
167 bool consumed = false;
169 foreach ( void delegate(GdkDevice*, InputDialog) dlg ; inputDialog.onDisableDeviceListeners )
171 dlg(deviceid, inputDialog);
174 return consumed;
177 void delegate(GdkDevice*, InputDialog)[] onEnableDeviceListeners;
178 void addOnEnableDevice(void delegate(GdkDevice*, InputDialog) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
180 if ( !("enable-device" in connectedSignals) )
182 Signals.connectData(
183 getStruct(),
184 "enable-device",
185 cast(GCallback)&callBackEnableDevice,
186 cast(void*)this,
187 null,
188 connectFlags);
189 connectedSignals["enable-device"] = 1;
191 onEnableDeviceListeners ~= dlg;
193 extern(C) static void callBackEnableDevice(GtkInputDialog* inputdialogStruct, GdkDevice* deviceid, InputDialog inputDialog)
195 bool consumed = false;
197 foreach ( void delegate(GdkDevice*, InputDialog) dlg ; inputDialog.onEnableDeviceListeners )
199 dlg(deviceid, inputDialog);
202 return consumed;
208 * Creates a new GtkInputDialog.
209 * Returns:
210 * the new GtkInputDialog.
211 * Signal Details
212 * The "disable-device" signal
213 * void user_function (GtkInputDialog *inputdialog,
214 * GdkDevice *deviceid,
215 * gpointer user_data) : Run Last
216 * This signal is emitted when the user changes the
217 * mode of a device from a GDK_MODE_SCREEN or GDK_MODE_WINDOW
218 * to GDK_MODE_ENABLED.
219 * inputdialog:
220 * the object which received the signal.
221 * deviceid:
222 * The ID of the newly disabled device.
223 * user_data:
224 * user data set when the signal handler was connected.
226 public this ()
228 // GtkWidget* gtk_input_dialog_new (void);
229 this(cast(GtkInputDialog*)gtk_input_dialog_new() );