gdk4_x11/x11_screen.rs
1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::translate::*;
4#[cfg(feature = "xlib")]
5#[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
6use x11::xlib::{self, XID};
7
8#[cfg(not(feature = "xlib"))]
9use crate::XID;
10use crate::{ffi, X11Screen};
11
12impl X11Screen {
13 #[cfg(feature = "xlib")]
14 #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
15 #[doc(alias = "gdk_x11_screen_get_xscreen")]
16 #[doc(alias = "get_xscreen")]
17 #[allow(clippy::missing_safety_doc)]
18 pub unsafe fn xscreen(&self) -> *mut xlib::Screen {
19 ffi::gdk_x11_screen_get_xscreen(self.to_glib_none().0) as *mut xlib::Screen
20 }
21
22 #[doc(alias = "gdk_x11_screen_get_monitor_output")]
23 #[doc(alias = "get_monitor_output")]
24 pub fn monitor_output(&self, monitor_num: i32) -> XID {
25 unsafe { ffi::gdk_x11_screen_get_monitor_output(self.to_glib_none().0, monitor_num) }
26 }
27}