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 module gdk.X11;
26 
27 private import gdk.Display;
28 private import gdk.Window;
29 private import gdk.c.functions;
30 public  import gdk.c.types;
31 private import glib.ConstructionException;
32 private import glib.Str;
33 private import gobject.ObjectG;
34 public  import gtkc.gdktypes;
35 
36 
37 /** */
38 /**
39  * Looks up the #GdkWindow that wraps the given native window handle.
40  *
41  * Params:
42  *     display = the #GdkDisplay corresponding to the
43  *         window handle
44  *     window = an Xlib Window
45  *
46  * Return: the #GdkWindow wrapper for the native
47  *     window, or %NULL if there is none.
48  *
49  * Since: 2.24
50  */
51 public Window lookupForDisplay(Display display, uint window)
52 {
53 	auto p = gdk_x11_window_lookup_for_display((display is null) ? null : display.getDisplayStruct(), window);
54 
55 	if(p is null)
56 	{
57 		return null;
58 	}
59 
60 	return ObjectG.getDObject!(Window)(cast(GdkWindow*) p);
61 }
62 
63 /**
64  */
65 
66 /**
67  * Gets the number of the workspace @window is on.
68  *
69  * Returns: the current workspace of @window
70  *
71  * Since: 3.10
72  */
73 public uint getDesktop(Window window)
74 {
75 	return gdk_x11_window_get_desktop(cast(GdkWindow*)(window is null) ? null : window.getWindowStruct());
76 }
77 
78 /**
79  * Returns the X resource (window) belonging to a #GdkWindow.
80  *
81  * Returns: the ID of @drawable’s X resource.
82  */
83 public uint getXid(Window window)
84 {
85 	return gdk_x11_window_get_xid(cast(GdkWindow*)(window is null) ? null : window.getWindowStruct());
86 }
87 
88 /**
89  * Moves the window to the correct workspace when running under a
90  * window manager that supports multiple workspaces, as described
91  * in the [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification.
92  * Will not do anything if the window is already on all workspaces.
93  *
94  * Since: 2.8
95  */
96 public void moveToCurrentDesktop(Window window)
97 {
98 	gdk_x11_window_move_to_current_desktop(cast(GdkWindow*)(window is null) ? null : window.getWindowStruct());
99 }
100 
101 /**
102  * Moves the window to the given workspace when running unde a
103  * window manager that supports multiple workspaces, as described
104  * in the [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification.
105  *
106  * Params:
107  *     desktop = the number of the workspace to move the window to
108  *
109  * Since: 3.10
110  */
111 public void moveToDesktop(Window window, uint desktop)
112 {
113 	gdk_x11_window_move_to_desktop(cast(GdkWindow*)(window is null) ? null : window.getWindowStruct(), desktop);
114 }
115 
116 /**
117  * This is the same as gdk_window_set_shadow_width() but it only works
118  * on GdkX11Window.
119  *
120  * Deprecated: Use gdk_window_set_shadow_width() instead.
121  *
122  * Params:
123  *     left = The left extent
124  *     right = The right extent
125  *     top = The top extent
126  *     bottom = The bottom extent
127  *
128  * Since: 3.10
129  */
130 public void setFrameExtents(Window window, int left, int right, int top, int bottom)
131 {
132 	gdk_x11_window_set_frame_extents(cast(GdkWindow*)(window is null) ? null : window.getWindowStruct(), left, right, top, bottom);
133 }
134 
135 /**
136  * This function can be used to disable frame synchronization for a window.
137  * Normally frame synchronziation will be enabled or disabled based on whether
138  * the system has a compositor that supports frame synchronization, but if
139  * the window is not directly managed by the window manager, then frame
140  * synchronziation may need to be disabled. This is the case for a window
141  * embedded via the XEMBED protocol.
142  *
143  * Params:
144  *     frameSyncEnabled = whether frame-synchronization should be enabled
145  *
146  * Since: 3.8
147  */
148 public void setFrameSyncEnabled(Window window, bool frameSyncEnabled)
149 {
150 	gdk_x11_window_set_frame_sync_enabled(cast(GdkWindow*)(window is null) ? null : window.getWindowStruct(), frameSyncEnabled);
151 }
152 
153 /**
154  * Set a hint for the window manager, requesting that the titlebar
155  * should be hidden when the window is maximized.
156  *
157  * Note that this property is automatically updated by GTK+, so this
158  * function should only be used by applications which do not use GTK+
159  * to create toplevel windows.
160  *
161  * Params:
162  *     hideTitlebarWhenMaximized = whether to hide the titlebar when
163  *         maximized
164  *
165  * Since: 3.4
166  */
167 public void setHideTitlebarWhenMaximized(Window window, bool hideTitlebarWhenMaximized)
168 {
169 	gdk_x11_window_set_hide_titlebar_when_maximized(cast(GdkWindow*)(window is null) ? null : window.getWindowStruct(), hideTitlebarWhenMaximized);
170 }
171 
172 /**
173  * GTK+ applications can request a dark theme variant. In order to
174  * make other applications - namely window managers using GTK+ for
175  * themeing - aware of this choice, GTK+ uses this function to
176  * export the requested theme variant as _GTK_THEME_VARIANT property
177  * on toplevel windows.
178  *
179  * Note that this property is automatically updated by GTK+, so this
180  * function should only be used by applications which do not use GTK+
181  * to create toplevel windows.
182  *
183  * Params:
184  *     variant = the theme variant to export
185  *
186  * Since: 3.2
187  */
188 public void setThemeVariant(Window window, string variant)
189 {
190 	gdk_x11_window_set_theme_variant(cast(GdkWindow*)(window is null) ? null : window.getWindowStruct(), Str.toStringz(variant));
191 }
192 
193 /**
194  * The application can use this call to update the _NET_WM_USER_TIME
195  * property on a toplevel window.  This property stores an Xserver
196  * time which represents the time of the last user input event
197  * received for this window.  This property may be used by the window
198  * manager to alter the focus, stacking, and/or placement behavior of
199  * windows when they are mapped depending on whether the new window
200  * was created by a user action or is a "pop-up" window activated by a
201  * timer or some other event.
202  *
203  * Note that this property is automatically updated by GDK, so this
204  * function should only be used by applications which handle input
205  * events bypassing GDK.
206  *
207  * Params:
208  *     timestamp = An XServer timestamp to which the property should be set
209  *
210  * Since: 2.6
211  */
212 public void setUserTime(Window window, uint timestamp)
213 {
214 	gdk_x11_window_set_user_time(cast(GdkWindow*)(window is null) ? null : window.getWindowStruct(), timestamp);
215 }
216 
217 /**
218  * This function modifies or removes an arbitrary X11 window
219  * property of type UTF8_STRING.  If the given @window is
220  * not a toplevel window, it is ignored.
221  *
222  * Params:
223  *     name = Property name, will be interned as an X atom
224  *     value = Property value, or %NULL to delete
225  *
226  * Since: 3.4
227  */
228 public void setUtf8Property(Window window, string name, string value)
229 {
230 	gdk_x11_window_set_utf8_property(cast(GdkWindow*)(window is null) ? null : window.getWindowStruct(), Str.toStringz(name), Str.toStringz(value));
231 }