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