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