gdk4_macos/auto/macos_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
5use crate::ffi;
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9 #[doc(alias = "GdkMacosMonitor")]
10 pub struct MacosMonitor(Object<ffi::GdkMacosMonitor, ffi::GdkMacosMonitorClass>) @extends gdk::Monitor;
11
12 match fn {
13 type_ => || ffi::gdk_macos_monitor_get_type(),
14 }
15}
16
17impl MacosMonitor {
18 #[doc(alias = "gdk_macos_monitor_get_workarea")]
19 #[doc(alias = "get_workarea")]
20 pub fn workarea(monitor: &impl IsA<gdk::Monitor>) -> gdk::Rectangle {
21 assert_initialized_main_thread!();
22 unsafe {
23 let mut geometry = gdk::Rectangle::uninitialized();
24 ffi::gdk_macos_monitor_get_workarea(
25 monitor.as_ref().to_glib_none().0,
26 geometry.to_glib_none_mut().0,
27 );
28 geometry
29 }
30 }
31}