gdk4_x11/auto/x11_surface.rs
1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4#![allow(deprecated)]
5
6use crate::ffi;
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10 ///
11 ///
12 /// # Implements
13 ///
14 /// [`trait@gdk::prelude::SurfaceExt`]
15 #[doc(alias = "GdkX11Surface")]
16 pub struct X11Surface(Object<ffi::GdkX11Surface, ffi::GdkX11SurfaceClass>) @extends gdk::Surface;
17
18 match fn {
19 type_ => || ffi::gdk_x11_surface_get_type(),
20 }
21}
22
23impl X11Surface {
24 /// Gets the number of the workspace @self is on.
25 ///
26 /// # Deprecated since 4.18
27 ///
28 ///
29 /// # Returns
30 ///
31 /// the current workspace of @self
32 #[cfg_attr(feature = "v4_18", deprecated = "Since 4.18")]
33 #[allow(deprecated)]
34 #[doc(alias = "gdk_x11_surface_get_desktop")]
35 #[doc(alias = "get_desktop")]
36 pub fn desktop(&self) -> u32 {
37 unsafe { ffi::gdk_x11_surface_get_desktop(self.to_glib_none().0) }
38 }
39
40 /// Returns the group this surface belongs to.
41 ///
42 /// # Deprecated since 4.18
43 ///
44 ///
45 /// # Returns
46 ///
47 /// The group of this surface;
48 #[cfg_attr(feature = "v4_18", deprecated = "Since 4.18")]
49 #[allow(deprecated)]
50 #[doc(alias = "gdk_x11_surface_get_group")]
51 #[doc(alias = "get_group")]
52 pub fn group(&self) -> Option<gdk::Surface> {
53 unsafe { from_glib_none(ffi::gdk_x11_surface_get_group(self.to_glib_none().0)) }
54 }
55
56 /// Moves the surface to the correct workspace when running under a
57 /// window manager that supports multiple workspaces, as described
58 /// in the [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification.
59 /// Will not do anything if the surface is already on all workspaces.
60 ///
61 /// # Deprecated since 4.18
62 ///
63 #[cfg_attr(feature = "v4_18", deprecated = "Since 4.18")]
64 #[allow(deprecated)]
65 #[doc(alias = "gdk_x11_surface_move_to_current_desktop")]
66 pub fn move_to_current_desktop(&self) {
67 unsafe {
68 ffi::gdk_x11_surface_move_to_current_desktop(self.to_glib_none().0);
69 }
70 }
71
72 /// Moves the surface to the given workspace when running unde a
73 /// window manager that supports multiple workspaces, as described
74 /// in the [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification.
75 ///
76 /// # Deprecated since 4.18
77 ///
78 /// ## `desktop`
79 /// the number of the workspace to move the surface to
80 #[cfg_attr(feature = "v4_18", deprecated = "Since 4.18")]
81 #[allow(deprecated)]
82 #[doc(alias = "gdk_x11_surface_move_to_desktop")]
83 pub fn move_to_desktop(&self, desktop: u32) {
84 unsafe {
85 ffi::gdk_x11_surface_move_to_desktop(self.to_glib_none().0, desktop);
86 }
87 }
88
89 /// This function can be used to disable frame synchronization for a surface.
90 /// Normally frame synchronziation will be enabled or disabled based on whether
91 /// the system has a compositor that supports frame synchronization, but if
92 /// the surface is not directly managed by the window manager, then frame
93 /// synchronziation may need to be disabled. This is the case for a surface
94 /// embedded via the XEMBED protocol.
95 ///
96 /// # Deprecated since 4.18
97 ///
98 /// ## `frame_sync_enabled`
99 /// whether frame-synchronization should be enabled
100 #[cfg_attr(feature = "v4_18", deprecated = "Since 4.18")]
101 #[allow(deprecated)]
102 #[doc(alias = "gdk_x11_surface_set_frame_sync_enabled")]
103 pub fn set_frame_sync_enabled(&self, frame_sync_enabled: bool) {
104 unsafe {
105 ffi::gdk_x11_surface_set_frame_sync_enabled(
106 self.to_glib_none().0,
107 frame_sync_enabled.into_glib(),
108 );
109 }
110 }
111
112 /// Sets the group leader of @self to be @leader.
113 /// See the ICCCM for details.
114 ///
115 /// # Deprecated since 4.18
116 ///
117 /// ## `leader`
118 /// a [`gdk::Surface`][crate::gdk::Surface]
119 #[cfg_attr(feature = "v4_18", deprecated = "Since 4.18")]
120 #[allow(deprecated)]
121 #[doc(alias = "gdk_x11_surface_set_group")]
122 pub fn set_group(&self, leader: &impl IsA<gdk::Surface>) {
123 unsafe {
124 ffi::gdk_x11_surface_set_group(self.to_glib_none().0, leader.as_ref().to_glib_none().0);
125 }
126 }
127
128 /// Sets a hint on @self that pagers should not
129 /// display it. See the EWMH for details.
130 ///
131 /// # Deprecated since 4.18
132 ///
133 /// ## `skips_pager`
134 /// [`true`] to skip pagers
135 #[cfg_attr(feature = "v4_18", deprecated = "Since 4.18")]
136 #[allow(deprecated)]
137 #[doc(alias = "gdk_x11_surface_set_skip_pager_hint")]
138 pub fn set_skip_pager_hint(&self, skips_pager: bool) {
139 unsafe {
140 ffi::gdk_x11_surface_set_skip_pager_hint(
141 self.to_glib_none().0,
142 skips_pager.into_glib(),
143 );
144 }
145 }
146
147 /// Sets a hint on @self that taskbars should not
148 /// display it. See the EWMH for details.
149 ///
150 /// # Deprecated since 4.18
151 ///
152 /// ## `skips_taskbar`
153 /// [`true`] to skip taskbars
154 #[cfg_attr(feature = "v4_18", deprecated = "Since 4.18")]
155 #[allow(deprecated)]
156 #[doc(alias = "gdk_x11_surface_set_skip_taskbar_hint")]
157 pub fn set_skip_taskbar_hint(&self, skips_taskbar: bool) {
158 unsafe {
159 ffi::gdk_x11_surface_set_skip_taskbar_hint(
160 self.to_glib_none().0,
161 skips_taskbar.into_glib(),
162 );
163 }
164 }
165
166 /// GTK applications can request a dark theme variant. In order to
167 /// make other applications - namely window managers using GTK for
168 /// themeing - aware of this choice, GTK uses this function to
169 /// export the requested theme variant as _GTK_THEME_VARIANT property
170 /// on toplevel surfaces.
171 ///
172 /// Note that this property is automatically updated by GTK, so this
173 /// function should only be used by applications which do not use GTK
174 /// to create toplevel surfaces.
175 ///
176 /// # Deprecated since 4.18
177 ///
178 /// ## `variant`
179 /// the theme variant to export
180 #[cfg_attr(feature = "v4_18", deprecated = "Since 4.18")]
181 #[allow(deprecated)]
182 #[doc(alias = "gdk_x11_surface_set_theme_variant")]
183 pub fn set_theme_variant(&self, variant: &str) {
184 unsafe {
185 ffi::gdk_x11_surface_set_theme_variant(self.to_glib_none().0, variant.to_glib_none().0);
186 }
187 }
188
189 /// Sets a hint on @self that it needs user attention.
190 /// See the ICCCM for details.
191 ///
192 /// # Deprecated since 4.18
193 ///
194 /// ## `urgent`
195 /// [`true`] to indicate urgenct attention needed
196 #[cfg_attr(feature = "v4_18", deprecated = "Since 4.18")]
197 #[allow(deprecated)]
198 #[doc(alias = "gdk_x11_surface_set_urgency_hint")]
199 pub fn set_urgency_hint(&self, urgent: bool) {
200 unsafe {
201 ffi::gdk_x11_surface_set_urgency_hint(self.to_glib_none().0, urgent.into_glib());
202 }
203 }
204
205 /// The application can use this call to update the _NET_WM_USER_TIME
206 /// property on a toplevel surface. This property stores an Xserver
207 /// time which represents the time of the last user input event
208 /// received for this surface. This property may be used by the window
209 /// manager to alter the focus, stacking, and/or placement behavior of
210 /// surfaces when they are mapped depending on whether the new surface
211 /// was created by a user action or is a "pop-up" surface activated by a
212 /// timer or some other event.
213 ///
214 /// Note that this property is automatically updated by GDK, so this
215 /// function should only be used by applications which handle input
216 /// events bypassing GDK.
217 ///
218 /// # Deprecated since 4.18
219 ///
220 /// ## `timestamp`
221 /// An XServer timestamp to which the property should be set
222 #[cfg_attr(feature = "v4_18", deprecated = "Since 4.18")]
223 #[allow(deprecated)]
224 #[doc(alias = "gdk_x11_surface_set_user_time")]
225 pub fn set_user_time(&self, timestamp: u32) {
226 unsafe {
227 ffi::gdk_x11_surface_set_user_time(self.to_glib_none().0, timestamp);
228 }
229 }
230
231 /// This function modifies or removes an arbitrary X11 window
232 /// property of type UTF8_STRING. If the given @self is
233 /// not a toplevel surface, it is ignored.
234 ///
235 /// # Deprecated since 4.18
236 ///
237 /// ## `name`
238 /// Property name, will be interned as an X atom
239 /// ## `value`
240 /// Property value, or [`None`] to delete
241 #[cfg_attr(feature = "v4_18", deprecated = "Since 4.18")]
242 #[allow(deprecated)]
243 #[doc(alias = "gdk_x11_surface_set_utf8_property")]
244 pub fn set_utf8_property(&self, name: &str, value: Option<&str>) {
245 unsafe {
246 ffi::gdk_x11_surface_set_utf8_property(
247 self.to_glib_none().0,
248 name.to_glib_none().0,
249 value.to_glib_none().0,
250 );
251 }
252 }
253}