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
27 * outFile = DisplayManager
28 * strct = GdkDisplayManager
31 * clss = DisplayManager
39 * - gdk_display_manager_
44 * - gdk.DisplayManager
50 * - GdkDevice* -> Device
51 * - GdkDisplay* -> Display
52 * - GdkDisplayManager* -> DisplayManager
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
;
69 * The purpose of the GdkDisplayManager singleton object is to offer
70 * notification when displays appear or disappear or the default display
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
;
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
) )
118 cast(GCallback
)&callBackDisplayOpened
,
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
);
141 * Returns the global GdkDisplayManager singleton; gdk_parse_pargs(),
142 * gdk_init(), or gdk_init_check() must have been called first.
144 * the singleton GdkDisplayManager object.
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.
156 * a GdkDisplayManager
158 * a GdkDisplay, or NULL if there is no default
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.
171 * a GdkDisplayManager
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.
185 * a GdkDisplayManager
187 * a newly allocated GSList of GdkDisplay objects.
188 * Free this list with g_slist_free() when you are done with it.
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
202 * the core pointer device; this is owned by the
203 * display and should not be freed.
206 * The "default-display" property
207 * "default-display" GdkDisplay : Read / Write
208 * The default display for GDK.
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.
216 * the object on which the signal is emitted
220 * user data set when the signal handler was connected.
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()) );