I've no idea here...
[gtkD.git] / src / gdk / DisplayManager.d
blob805c87bb35453f4900dd8da9a6908a9c1059f566
1 /*
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 = GdkDisplayManager.html
26 * outPack = gdk
27 * outFile = DisplayManager
28 * strct = GdkDisplayManager
29 * realStrct=
30 * ctorStrct=
31 * clss = DisplayManager
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gdk_display_manager_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - gdk.DisplayManager
45 * - gdk.Display
46 * - glib.ListSG
47 * - gdk.Device
48 * structWrap:
49 * - GSList* -> ListSG
50 * - GdkDevice* -> Device
51 * - GdkDisplay* -> Display
52 * - GdkDisplayManager* -> DisplayManager
53 * local aliases:
56 module gdk.DisplayManager;
58 private import gdk.gdktypes;
60 private import lib.gdk;
62 private import gdk.DisplayManager;
63 private import gdk.Display;
64 private import glib.ListSG;
65 private import gdk.Device;
67 /**
68 * Description
69 * The purpose of the GdkDisplayManager singleton object is to offer
70 * notification when displays appear or disappear or the default display
71 * changes.
73 private import gobject.ObjectG;
74 public class DisplayManager : ObjectG
77 /** the main Gtk struct */
78 protected GdkDisplayManager* gdkDisplayManager;
81 public GdkDisplayManager* getDisplayManagerStruct()
83 return gdkDisplayManager;
87 /** the main Gtk struct as a void* */
88 protected void* getStruct()
90 return cast(void*)gdkDisplayManager;
93 /**
94 * Sets our main struct and passes it to the parent class
96 public this (GdkDisplayManager* gdkDisplayManager)
98 super(cast(GObject*)gdkDisplayManager);
99 this.gdkDisplayManager = gdkDisplayManager;
105 // imports for the signal processing
106 private import gobject.Signals;
107 private import gdk.gdktypes;
108 int[char[]] connectedSignals;
110 void delegate(Display, DisplayManager)[] onDisplayOpenedListeners;
111 void addOnDisplayOpened(void delegate(Display, DisplayManager) dlg)
113 if ( !("display-opened" in connectedSignals) )
115 Signals.connectData(
116 getStruct(),
117 "display-opened",
118 cast(GCallback)&callBackDisplayOpened,
119 this,
120 null,
121 cast(ConnectFlags)0);
122 connectedSignals["display-opened"] = 1;
124 onDisplayOpenedListeners ~= dlg;
126 extern(C) static void callBackDisplayOpened(GdkDisplayManager* displayManagerStruct, GdkDisplay* display, DisplayManager displayManager)
128 bit consumed = false;
130 foreach ( void delegate(Display, DisplayManager) dlg ; displayManager.onDisplayOpenedListeners )
132 dlg(new Display(display), displayManager);
135 return consumed;
141 * Returns the global GdkDisplayManager singleton; gdk_parse_pargs(),
142 * gdk_init(), or gdk_init_check() must have been called first.
143 * Returns:
144 * the singleton GdkDisplayManager object.
145 * Since 2.2
147 public static DisplayManager get()
149 // GdkDisplayManager* gdk_display_manager_get (void);
150 return new DisplayManager( gdk_display_manager_get() );
154 * Gets the default GdkDisplay.
155 * display_manager:
156 * a GdkDisplayManager
157 * Returns:
158 * a GdkDisplay, or NULL if there is no default
159 * display.
160 * Since 2.2
162 public Display getDefaultDisplay()
164 // GdkDisplay* gdk_display_manager_get_default_display (GdkDisplayManager *display_manager);
165 return new Display( gdk_display_manager_get_default_display(gdkDisplayManager) );
169 * Sets display as the default display.
170 * display_manager:
171 * a GdkDisplayManager
172 * display:
173 * a GdkDisplay
174 * Since 2.2
176 public void setDefaultDisplay(Display display)
178 // void gdk_display_manager_set_default_display (GdkDisplayManager *display_manager, GdkDisplay *display);
179 gdk_display_manager_set_default_display(gdkDisplayManager, (display is null) ? null : display.getDisplayStruct());
183 * List all currently open displays.
184 * display_manager:
185 * a GdkDisplayManager
186 * Returns:
187 * a newly allocated GSList of GdkDisplay objects.
188 * Free this list with g_slist_free() when you are done with it.
189 * Since 2.2
191 public ListSG listDisplays()
193 // GSList* gdk_display_manager_list_displays (GdkDisplayManager *display_manager);
194 return new ListSG( gdk_display_manager_list_displays(gdkDisplayManager) );
198 * Returns the core pointer device for the given display
199 * display:
200 * a GdkDisplay
201 * Returns:
202 * the core pointer device; this is owned by the
203 * display and should not be freed.
204 * Since 2.2
205 * Property Details
206 * The "default-display" property
207 * "default-display" GdkDisplay : Read / Write
208 * The default display for GDK.
209 * Signal Details
210 * The "display-opened" signal
211 * void user_function (GdkDisplayManager *display_manager,
212 * GdkDisplay *display,
213 * gpointer user_data) : Run last
214 * The ::display_opened signal is emitted when a display is opened.
215 * display_manager:
216 * the object on which the signal is emitted
217 * display:
218 * the opened display
219 * user_data:
220 * user data set when the signal handler was connected.
221 * Since 2.2
223 public static Device gdkDisplayGetCorePointer(Display display)
225 // GdkDevice* gdk_display_get_core_pointer (GdkDisplay *display);
226 return new Device( gdk_display_get_core_pointer((display is null) ? null : display.getDisplayStruct()) );