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  = GtkInputDialog.html
27  * outPack = gtk
28  * outFile = InputDialog
29  * strct   = GtkInputDialog
30  * realStrct=
31  * ctorStrct=
32  * clss    = InputDialog
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_input_dialog_
41  * 	- gtk_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- gtk.Button
48  * structWrap:
49  * module aliases:
50  * local aliases:
51  * overrides:
52  */
53 
54 module gtk.InputDialog;
55 
56 public  import gtkc.gtktypes;
57 
58 private import gtkc.gtk;
59 private import glib.ConstructionException;
60 private import gobject.ObjectG;
61 
62 private import gobject.Signals;
63 public  import gtkc.gdktypes;
64 
65 private import gtk.Button;
66 
67 
68 
69 private import gtk.Dialog;
70 
71 /**
72  * Description
73  * GtkInputDialog displays a dialog which allows the user
74  * to configure XInput extension devices. For each
75  * device, they can control the mode of the device
76  * (disabled, screen-relative, or window-relative),
77  * the mapping of axes to coordinates, and the
78  * mapping of the devices macro keys to key press
79  * events.
80  * GtkInputDialog contains two buttons to which
81  * the application can connect; one for closing
82  * the dialog, and one for saving the changes.
83  * No actions are bound to these by default.
84  * The changes that the user makes take effect
85  * immediately.
86  * As of GTK+ 2.20, GtkInputDialog has been deprecated since it is too specialized.
87  */
88 public class InputDialog : Dialog
89 {
90 	
91 	/** the main Gtk struct */
92 	protected GtkInputDialog* gtkInputDialog;
93 	
94 	
95 	public GtkInputDialog* getInputDialogStruct()
96 	{
97 		return gtkInputDialog;
98 	}
99 	
100 	
101 	/** the main Gtk struct as a void* */
102 	protected override void* getStruct()
103 	{
104 		return cast(void*)gtkInputDialog;
105 	}
106 	
107 	/**
108 	 * Sets our main struct and passes it to the parent class
109 	 */
110 	public this (GtkInputDialog* gtkInputDialog)
111 	{
112 		super(cast(GtkDialog*)gtkInputDialog);
113 		this.gtkInputDialog = gtkInputDialog;
114 	}
115 	
116 	protected override void setStruct(GObject* obj)
117 	{
118 		super.setStruct(obj);
119 		gtkInputDialog = cast(GtkInputDialog*)obj;
120 	}
121 	
122 	Button getCloseButton()
123 	{
124 		int* pt =cast(int*)getStruct();
125 		pt += 172/4;
126 		return new Button(cast(GtkButton*)(*pt));
127 	}
128 	
129 	Button getSaveButton()
130 	{
131 		int* pt =cast(int*)getStruct();
132 		pt += 176/4;
133 		return new Button(cast(GtkButton*)(*pt));
134 	}
135 	
136 	/**
137 	 */
138 	int[string] connectedSignals;
139 	
140 	void delegate(GdkDevice*, InputDialog)[] onDisableDeviceListeners;
141 	/**
142 	 * This signal is emitted when the user changes the
143 	 * mode of a device from a GDK_MODE_SCREEN or GDK_MODE_WINDOW
144 	 * to GDK_MODE_ENABLED.
145 	 */
146 	void addOnDisableDevice(void delegate(GdkDevice*, InputDialog) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
147 	{
148 		if ( !("disable-device" in connectedSignals) )
149 		{
150 			Signals.connectData(
151 			getStruct(),
152 			"disable-device",
153 			cast(GCallback)&callBackDisableDevice,
154 			cast(void*)this,
155 			null,
156 			connectFlags);
157 			connectedSignals["disable-device"] = 1;
158 		}
159 		onDisableDeviceListeners ~= dlg;
160 	}
161 	extern(C) static void callBackDisableDevice(GtkInputDialog* inputdialogStruct, GdkDevice* arg1, InputDialog _inputDialog)
162 	{
163 		foreach ( void delegate(GdkDevice*, InputDialog) dlg ; _inputDialog.onDisableDeviceListeners )
164 		{
165 			dlg(arg1, _inputDialog);
166 		}
167 	}
168 	
169 	void delegate(GdkDevice*, InputDialog)[] onEnableDeviceListeners;
170 	/**
171 	 * This signal is emitted when the user changes the
172 	 * mode of a device from GDK_MODE_DISABLED to a
173 	 * GDK_MODE_SCREEN or GDK_MODE_WINDOW.
174 	 */
175 	void addOnEnableDevice(void delegate(GdkDevice*, InputDialog) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
176 	{
177 		if ( !("enable-device" in connectedSignals) )
178 		{
179 			Signals.connectData(
180 			getStruct(),
181 			"enable-device",
182 			cast(GCallback)&callBackEnableDevice,
183 			cast(void*)this,
184 			null,
185 			connectFlags);
186 			connectedSignals["enable-device"] = 1;
187 		}
188 		onEnableDeviceListeners ~= dlg;
189 	}
190 	extern(C) static void callBackEnableDevice(GtkInputDialog* inputdialogStruct, GdkDevice* arg1, InputDialog _inputDialog)
191 	{
192 		foreach ( void delegate(GdkDevice*, InputDialog) dlg ; _inputDialog.onEnableDeviceListeners )
193 		{
194 			dlg(arg1, _inputDialog);
195 		}
196 	}
197 	
198 	
199 	/**
200 	 * Warning
201 	 * gtk_input_dialog_new has been deprecated since version 2.20 and should not be used in newly-written code. Don't use this widget anymore.
202 	 * Creates a new GtkInputDialog.
203 	 * Throws: ConstructionException GTK+ fails to create the object.
204 	 */
205 	public this ()
206 	{
207 		// GtkWidget * gtk_input_dialog_new (void);
208 		auto p = gtk_input_dialog_new();
209 		if(p is null)
210 		{
211 			throw new ConstructionException("null returned by gtk_input_dialog_new()");
212 		}
213 		this(cast(GtkInputDialog*) p);
214 	}
215 }