gdk4_x11/auto/x11_monitor.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::translate::*;
8
9glib::wrapper! {
10 ///
11 ///
12 /// # Implements
13 ///
14 /// [`trait@gdk::prelude::MonitorExt`]
15 #[doc(alias = "GdkX11Monitor")]
16 pub struct X11Monitor(Object<ffi::GdkX11Monitor, ffi::GdkX11MonitorClass>) @extends gdk::Monitor;
17
18 match fn {
19 type_ => || ffi::gdk_x11_monitor_get_type(),
20 }
21}
22
23impl X11Monitor {
24 /// Retrieves the size and position of the “work area” on a monitor
25 /// within the display coordinate space.
26 ///
27 /// The returned geometry is in ”application pixels”, not in ”device pixels”
28 /// (see `Gdk::Monitor::get_scale_factor()`).
29 ///
30 /// # Deprecated since 4.18
31 ///
32 ///
33 /// # Returns
34 ///
35 ///
36 /// ## `workarea`
37 /// a [`gdk::Rectangle`][crate::gdk::Rectangle] to be filled with the monitor workarea
38 #[cfg_attr(feature = "v4_18", deprecated = "Since 4.18")]
39 #[allow(deprecated)]
40 #[doc(alias = "gdk_x11_monitor_get_workarea")]
41 #[doc(alias = "get_workarea")]
42 pub fn workarea(&self) -> gdk::Rectangle {
43 unsafe {
44 let mut workarea = gdk::Rectangle::uninitialized();
45 ffi::gdk_x11_monitor_get_workarea(self.to_glib_none().0, workarea.to_glib_none_mut().0);
46 workarea
47 }
48 }
49}