gdk4/auto/
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, Display, Rectangle, SubpixelLayout};
6use glib::{
7    object::ObjectType as _,
8    prelude::*,
9    signal::{connect_raw, SignalHandlerId},
10    translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15    /// Represents the individual outputs that are associated with a [`Display`][crate::Display].
16    ///
17    /// [`Display`][crate::Display] keeps a `GListModel` to enumerate and monitor
18    /// monitors with [`DisplayExt::monitors()`][crate::prelude::DisplayExt::monitors()]. You can use
19    /// [`DisplayExt::monitor_at_surface()`][crate::prelude::DisplayExt::monitor_at_surface()] to find a particular
20    /// monitor.
21    ///
22    /// ## Properties
23    ///
24    ///
25    /// #### `connector`
26    ///  The connector name.
27    ///
28    /// Readable
29    ///
30    ///
31    /// #### `description`
32    ///  A short description of the monitor, meant for display to the user.
33    ///
34    /// Readable
35    ///
36    ///
37    /// #### `display`
38    ///  The [`Display`][crate::Display] of the monitor.
39    ///
40    /// Readable | Writeable | Construct Only
41    ///
42    ///
43    /// #### `geometry`
44    ///  The geometry of the monitor.
45    ///
46    /// Readable
47    ///
48    ///
49    /// #### `height-mm`
50    ///  The height of the monitor, in millimeters.
51    ///
52    /// Readable
53    ///
54    ///
55    /// #### `manufacturer`
56    ///  The manufacturer name.
57    ///
58    /// Readable
59    ///
60    ///
61    /// #### `model`
62    ///  The model name.
63    ///
64    /// Readable
65    ///
66    ///
67    /// #### `refresh-rate`
68    ///  The refresh rate, in milli-Hertz.
69    ///
70    /// Readable
71    ///
72    ///
73    /// #### `scale`
74    ///  The scale of the monitor.
75    ///
76    /// Readable
77    ///
78    ///
79    /// #### `scale-factor`
80    ///  The scale factor.
81    ///
82    /// The scale factor is the next larger integer,
83    /// compared to [`scale`][struct@crate::Surface#scale].
84    ///
85    /// Readable
86    ///
87    ///
88    /// #### `subpixel-layout`
89    ///  The subpixel layout.
90    ///
91    /// Readable
92    ///
93    ///
94    /// #### `valid`
95    ///  Whether the object is still valid.
96    ///
97    /// Readable
98    ///
99    ///
100    /// #### `width-mm`
101    ///  The width of the monitor, in millimeters.
102    ///
103    /// Readable
104    ///
105    /// ## Signals
106    ///
107    ///
108    /// #### `invalidate`
109    ///  Emitted when the output represented by @monitor gets disconnected.
110    ///
111    ///
112    ///
113    /// # Implements
114    ///
115    /// [`MonitorExt`][trait@crate::prelude::MonitorExt]
116    #[doc(alias = "GdkMonitor")]
117    pub struct Monitor(Object<ffi::GdkMonitor, ffi::GdkMonitorClass>);
118
119    match fn {
120        type_ => || ffi::gdk_monitor_get_type(),
121    }
122}
123
124impl Monitor {
125    pub const NONE: Option<&'static Monitor> = None;
126}
127
128/// Trait containing all [`struct@Monitor`] methods.
129///
130/// # Implementors
131///
132/// [`Monitor`][struct@crate::Monitor]
133pub trait MonitorExt: IsA<Monitor> + 'static {
134    /// Gets the name of the monitor's connector, if available.
135    ///
136    /// These are strings such as "eDP-1", or "HDMI-2". They depend
137    /// on software and hardware configuration, and should not be
138    /// relied on as stable identifiers of a specific monitor.
139    ///
140    /// # Returns
141    ///
142    /// the name of the connector
143    #[doc(alias = "gdk_monitor_get_connector")]
144    #[doc(alias = "get_connector")]
145    fn connector(&self) -> Option<glib::GString> {
146        unsafe {
147            from_glib_none(ffi::gdk_monitor_get_connector(
148                self.as_ref().to_glib_none().0,
149            ))
150        }
151    }
152
153    /// Gets a string describing the monitor, if available.
154    ///
155    /// This can be used to identify a monitor in the UI.
156    ///
157    /// # Returns
158    ///
159    /// the monitor description
160    #[cfg(feature = "v4_10")]
161    #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
162    #[doc(alias = "gdk_monitor_get_description")]
163    #[doc(alias = "get_description")]
164    fn description(&self) -> Option<glib::GString> {
165        unsafe {
166            from_glib_none(ffi::gdk_monitor_get_description(
167                self.as_ref().to_glib_none().0,
168            ))
169        }
170    }
171
172    /// Gets the display that this monitor belongs to.
173    ///
174    /// # Returns
175    ///
176    /// the display
177    #[doc(alias = "gdk_monitor_get_display")]
178    #[doc(alias = "get_display")]
179    fn display(&self) -> Display {
180        unsafe { from_glib_none(ffi::gdk_monitor_get_display(self.as_ref().to_glib_none().0)) }
181    }
182
183    /// Retrieves the size and position of the monitor within the
184    /// display coordinate space.
185    ///
186    /// The returned geometry is in  ”application pixels”, not in
187    /// ”device pixels” (see [`scale()`][Self::scale()]).
188    ///
189    /// # Returns
190    ///
191    ///
192    /// ## `geometry`
193    /// a [`Rectangle`][crate::Rectangle] to be filled with the monitor geometry
194    #[doc(alias = "gdk_monitor_get_geometry")]
195    #[doc(alias = "get_geometry")]
196    fn geometry(&self) -> Rectangle {
197        unsafe {
198            let mut geometry = Rectangle::uninitialized();
199            ffi::gdk_monitor_get_geometry(
200                self.as_ref().to_glib_none().0,
201                geometry.to_glib_none_mut().0,
202            );
203            geometry
204        }
205    }
206
207    /// Gets the height in millimeters of the monitor.
208    ///
209    /// # Returns
210    ///
211    /// the physical height of the monitor
212    #[doc(alias = "gdk_monitor_get_height_mm")]
213    #[doc(alias = "get_height_mm")]
214    #[doc(alias = "height-mm")]
215    fn height_mm(&self) -> i32 {
216        unsafe { ffi::gdk_monitor_get_height_mm(self.as_ref().to_glib_none().0) }
217    }
218
219    /// Gets the name or PNP ID of the monitor's manufacturer.
220    ///
221    /// Note that this value might also vary depending on actual
222    /// display backend.
223    ///
224    /// The PNP ID registry is located at
225    /// [https://uefi.org/pnp_id_list](https://uefi.org/pnp_id_list).
226    ///
227    /// # Returns
228    ///
229    /// the name of the manufacturer
230    #[doc(alias = "gdk_monitor_get_manufacturer")]
231    #[doc(alias = "get_manufacturer")]
232    fn manufacturer(&self) -> Option<glib::GString> {
233        unsafe {
234            from_glib_none(ffi::gdk_monitor_get_manufacturer(
235                self.as_ref().to_glib_none().0,
236            ))
237        }
238    }
239
240    /// Gets the string identifying the monitor model, if available.
241    ///
242    /// # Returns
243    ///
244    /// the monitor model
245    #[doc(alias = "gdk_monitor_get_model")]
246    #[doc(alias = "get_model")]
247    fn model(&self) -> Option<glib::GString> {
248        unsafe { from_glib_none(ffi::gdk_monitor_get_model(self.as_ref().to_glib_none().0)) }
249    }
250
251    /// Gets the refresh rate of the monitor, if available.
252    ///
253    /// The value is in milli-Hertz, so a refresh rate of 60Hz
254    /// is returned as 60000.
255    ///
256    /// # Returns
257    ///
258    /// the refresh rate in milli-Hertz, or 0
259    #[doc(alias = "gdk_monitor_get_refresh_rate")]
260    #[doc(alias = "get_refresh_rate")]
261    #[doc(alias = "refresh-rate")]
262    fn refresh_rate(&self) -> i32 {
263        unsafe { ffi::gdk_monitor_get_refresh_rate(self.as_ref().to_glib_none().0) }
264    }
265
266    /// Gets the internal scale factor that maps from monitor coordinates
267    /// to device pixels.
268    ///
269    /// This can be used if you want to create pixel based data for a
270    /// particular monitor, but most of the time you’re drawing to a surface
271    /// where it is better to use [`SurfaceExt::scale()`][crate::prelude::SurfaceExt::scale()] instead.
272    ///
273    /// # Returns
274    ///
275    /// the scale
276    #[cfg(feature = "v4_14")]
277    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
278    #[doc(alias = "gdk_monitor_get_scale")]
279    #[doc(alias = "get_scale")]
280    fn scale(&self) -> f64 {
281        unsafe { ffi::gdk_monitor_get_scale(self.as_ref().to_glib_none().0) }
282    }
283
284    /// Gets the internal scale factor that maps from monitor coordinates
285    /// to device pixels.
286    ///
287    /// On traditional systems this is 1, but on very high density outputs
288    /// it can be a higher value (often 2).
289    ///
290    /// This can be used if you want to create pixel based data for a
291    /// particular monitor, but most of the time you’re drawing to a surface
292    /// where it is better to use [`SurfaceExt::scale_factor()`][crate::prelude::SurfaceExt::scale_factor()] instead.
293    ///
294    /// # Returns
295    ///
296    /// the scale factor
297    #[doc(alias = "gdk_monitor_get_scale_factor")]
298    #[doc(alias = "get_scale_factor")]
299    #[doc(alias = "scale-factor")]
300    fn scale_factor(&self) -> i32 {
301        unsafe { ffi::gdk_monitor_get_scale_factor(self.as_ref().to_glib_none().0) }
302    }
303
304    /// Gets information about the layout of red, green and blue
305    /// primaries for pixels.
306    ///
307    /// # Returns
308    ///
309    /// the subpixel layout
310    #[doc(alias = "gdk_monitor_get_subpixel_layout")]
311    #[doc(alias = "get_subpixel_layout")]
312    #[doc(alias = "subpixel-layout")]
313    fn subpixel_layout(&self) -> SubpixelLayout {
314        unsafe {
315            from_glib(ffi::gdk_monitor_get_subpixel_layout(
316                self.as_ref().to_glib_none().0,
317            ))
318        }
319    }
320
321    /// Gets the width in millimeters of the monitor.
322    ///
323    /// # Returns
324    ///
325    /// the physical width of the monitor
326    #[doc(alias = "gdk_monitor_get_width_mm")]
327    #[doc(alias = "get_width_mm")]
328    #[doc(alias = "width-mm")]
329    fn width_mm(&self) -> i32 {
330        unsafe { ffi::gdk_monitor_get_width_mm(self.as_ref().to_glib_none().0) }
331    }
332
333    /// Returns [`true`] if the @self object corresponds to a
334    /// physical monitor.
335    ///
336    /// The @self becomes invalid when the physical monitor
337    /// is unplugged or removed.
338    ///
339    /// # Returns
340    ///
341    /// [`true`] if the object corresponds to a physical monitor
342    #[doc(alias = "gdk_monitor_is_valid")]
343    #[doc(alias = "valid")]
344    fn is_valid(&self) -> bool {
345        unsafe { from_glib(ffi::gdk_monitor_is_valid(self.as_ref().to_glib_none().0)) }
346    }
347
348    /// Emitted when the output represented by @monitor gets disconnected.
349    #[doc(alias = "invalidate")]
350    fn connect_invalidate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
351        unsafe extern "C" fn invalidate_trampoline<P: IsA<Monitor>, F: Fn(&P) + 'static>(
352            this: *mut ffi::GdkMonitor,
353            f: glib::ffi::gpointer,
354        ) {
355            let f: &F = &*(f as *const F);
356            f(Monitor::from_glib_borrow(this).unsafe_cast_ref())
357        }
358        unsafe {
359            let f: Box_<F> = Box_::new(f);
360            connect_raw(
361                self.as_ptr() as *mut _,
362                c"invalidate".as_ptr() as *const _,
363                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
364                    invalidate_trampoline::<Self, F> as *const (),
365                )),
366                Box_::into_raw(f),
367            )
368        }
369    }
370
371    #[doc(alias = "connector")]
372    fn connect_connector_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
373        unsafe extern "C" fn notify_connector_trampoline<P: IsA<Monitor>, F: Fn(&P) + 'static>(
374            this: *mut ffi::GdkMonitor,
375            _param_spec: glib::ffi::gpointer,
376            f: glib::ffi::gpointer,
377        ) {
378            let f: &F = &*(f as *const F);
379            f(Monitor::from_glib_borrow(this).unsafe_cast_ref())
380        }
381        unsafe {
382            let f: Box_<F> = Box_::new(f);
383            connect_raw(
384                self.as_ptr() as *mut _,
385                c"notify::connector".as_ptr() as *const _,
386                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
387                    notify_connector_trampoline::<Self, F> as *const (),
388                )),
389                Box_::into_raw(f),
390            )
391        }
392    }
393
394    #[cfg(feature = "v4_10")]
395    #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
396    #[doc(alias = "description")]
397    fn connect_description_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
398        unsafe extern "C" fn notify_description_trampoline<P: IsA<Monitor>, F: Fn(&P) + 'static>(
399            this: *mut ffi::GdkMonitor,
400            _param_spec: glib::ffi::gpointer,
401            f: glib::ffi::gpointer,
402        ) {
403            let f: &F = &*(f as *const F);
404            f(Monitor::from_glib_borrow(this).unsafe_cast_ref())
405        }
406        unsafe {
407            let f: Box_<F> = Box_::new(f);
408            connect_raw(
409                self.as_ptr() as *mut _,
410                c"notify::description".as_ptr() as *const _,
411                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
412                    notify_description_trampoline::<Self, F> as *const (),
413                )),
414                Box_::into_raw(f),
415            )
416        }
417    }
418
419    #[doc(alias = "geometry")]
420    fn connect_geometry_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
421        unsafe extern "C" fn notify_geometry_trampoline<P: IsA<Monitor>, F: Fn(&P) + 'static>(
422            this: *mut ffi::GdkMonitor,
423            _param_spec: glib::ffi::gpointer,
424            f: glib::ffi::gpointer,
425        ) {
426            let f: &F = &*(f as *const F);
427            f(Monitor::from_glib_borrow(this).unsafe_cast_ref())
428        }
429        unsafe {
430            let f: Box_<F> = Box_::new(f);
431            connect_raw(
432                self.as_ptr() as *mut _,
433                c"notify::geometry".as_ptr() as *const _,
434                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
435                    notify_geometry_trampoline::<Self, F> as *const (),
436                )),
437                Box_::into_raw(f),
438            )
439        }
440    }
441
442    #[doc(alias = "height-mm")]
443    fn connect_height_mm_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
444        unsafe extern "C" fn notify_height_mm_trampoline<P: IsA<Monitor>, F: Fn(&P) + 'static>(
445            this: *mut ffi::GdkMonitor,
446            _param_spec: glib::ffi::gpointer,
447            f: glib::ffi::gpointer,
448        ) {
449            let f: &F = &*(f as *const F);
450            f(Monitor::from_glib_borrow(this).unsafe_cast_ref())
451        }
452        unsafe {
453            let f: Box_<F> = Box_::new(f);
454            connect_raw(
455                self.as_ptr() as *mut _,
456                c"notify::height-mm".as_ptr() as *const _,
457                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
458                    notify_height_mm_trampoline::<Self, F> as *const (),
459                )),
460                Box_::into_raw(f),
461            )
462        }
463    }
464
465    #[doc(alias = "manufacturer")]
466    fn connect_manufacturer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
467        unsafe extern "C" fn notify_manufacturer_trampoline<
468            P: IsA<Monitor>,
469            F: Fn(&P) + 'static,
470        >(
471            this: *mut ffi::GdkMonitor,
472            _param_spec: glib::ffi::gpointer,
473            f: glib::ffi::gpointer,
474        ) {
475            let f: &F = &*(f as *const F);
476            f(Monitor::from_glib_borrow(this).unsafe_cast_ref())
477        }
478        unsafe {
479            let f: Box_<F> = Box_::new(f);
480            connect_raw(
481                self.as_ptr() as *mut _,
482                c"notify::manufacturer".as_ptr() as *const _,
483                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
484                    notify_manufacturer_trampoline::<Self, F> as *const (),
485                )),
486                Box_::into_raw(f),
487            )
488        }
489    }
490
491    #[doc(alias = "model")]
492    fn connect_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
493        unsafe extern "C" fn notify_model_trampoline<P: IsA<Monitor>, F: Fn(&P) + 'static>(
494            this: *mut ffi::GdkMonitor,
495            _param_spec: glib::ffi::gpointer,
496            f: glib::ffi::gpointer,
497        ) {
498            let f: &F = &*(f as *const F);
499            f(Monitor::from_glib_borrow(this).unsafe_cast_ref())
500        }
501        unsafe {
502            let f: Box_<F> = Box_::new(f);
503            connect_raw(
504                self.as_ptr() as *mut _,
505                c"notify::model".as_ptr() as *const _,
506                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
507                    notify_model_trampoline::<Self, F> as *const (),
508                )),
509                Box_::into_raw(f),
510            )
511        }
512    }
513
514    #[doc(alias = "refresh-rate")]
515    fn connect_refresh_rate_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
516        unsafe extern "C" fn notify_refresh_rate_trampoline<
517            P: IsA<Monitor>,
518            F: Fn(&P) + 'static,
519        >(
520            this: *mut ffi::GdkMonitor,
521            _param_spec: glib::ffi::gpointer,
522            f: glib::ffi::gpointer,
523        ) {
524            let f: &F = &*(f as *const F);
525            f(Monitor::from_glib_borrow(this).unsafe_cast_ref())
526        }
527        unsafe {
528            let f: Box_<F> = Box_::new(f);
529            connect_raw(
530                self.as_ptr() as *mut _,
531                c"notify::refresh-rate".as_ptr() as *const _,
532                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
533                    notify_refresh_rate_trampoline::<Self, F> as *const (),
534                )),
535                Box_::into_raw(f),
536            )
537        }
538    }
539
540    #[cfg(feature = "v4_14")]
541    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
542    #[doc(alias = "scale")]
543    fn connect_scale_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
544        unsafe extern "C" fn notify_scale_trampoline<P: IsA<Monitor>, F: Fn(&P) + 'static>(
545            this: *mut ffi::GdkMonitor,
546            _param_spec: glib::ffi::gpointer,
547            f: glib::ffi::gpointer,
548        ) {
549            let f: &F = &*(f as *const F);
550            f(Monitor::from_glib_borrow(this).unsafe_cast_ref())
551        }
552        unsafe {
553            let f: Box_<F> = Box_::new(f);
554            connect_raw(
555                self.as_ptr() as *mut _,
556                c"notify::scale".as_ptr() as *const _,
557                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
558                    notify_scale_trampoline::<Self, F> as *const (),
559                )),
560                Box_::into_raw(f),
561            )
562        }
563    }
564
565    #[doc(alias = "scale-factor")]
566    fn connect_scale_factor_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
567        unsafe extern "C" fn notify_scale_factor_trampoline<
568            P: IsA<Monitor>,
569            F: Fn(&P) + 'static,
570        >(
571            this: *mut ffi::GdkMonitor,
572            _param_spec: glib::ffi::gpointer,
573            f: glib::ffi::gpointer,
574        ) {
575            let f: &F = &*(f as *const F);
576            f(Monitor::from_glib_borrow(this).unsafe_cast_ref())
577        }
578        unsafe {
579            let f: Box_<F> = Box_::new(f);
580            connect_raw(
581                self.as_ptr() as *mut _,
582                c"notify::scale-factor".as_ptr() as *const _,
583                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
584                    notify_scale_factor_trampoline::<Self, F> as *const (),
585                )),
586                Box_::into_raw(f),
587            )
588        }
589    }
590
591    #[doc(alias = "subpixel-layout")]
592    fn connect_subpixel_layout_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
593        unsafe extern "C" fn notify_subpixel_layout_trampoline<
594            P: IsA<Monitor>,
595            F: Fn(&P) + 'static,
596        >(
597            this: *mut ffi::GdkMonitor,
598            _param_spec: glib::ffi::gpointer,
599            f: glib::ffi::gpointer,
600        ) {
601            let f: &F = &*(f as *const F);
602            f(Monitor::from_glib_borrow(this).unsafe_cast_ref())
603        }
604        unsafe {
605            let f: Box_<F> = Box_::new(f);
606            connect_raw(
607                self.as_ptr() as *mut _,
608                c"notify::subpixel-layout".as_ptr() as *const _,
609                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
610                    notify_subpixel_layout_trampoline::<Self, F> as *const (),
611                )),
612                Box_::into_raw(f),
613            )
614        }
615    }
616
617    #[doc(alias = "valid")]
618    fn connect_valid_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
619        unsafe extern "C" fn notify_valid_trampoline<P: IsA<Monitor>, F: Fn(&P) + 'static>(
620            this: *mut ffi::GdkMonitor,
621            _param_spec: glib::ffi::gpointer,
622            f: glib::ffi::gpointer,
623        ) {
624            let f: &F = &*(f as *const F);
625            f(Monitor::from_glib_borrow(this).unsafe_cast_ref())
626        }
627        unsafe {
628            let f: Box_<F> = Box_::new(f);
629            connect_raw(
630                self.as_ptr() as *mut _,
631                c"notify::valid".as_ptr() as *const _,
632                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
633                    notify_valid_trampoline::<Self, F> as *const (),
634                )),
635                Box_::into_raw(f),
636            )
637        }
638    }
639
640    #[doc(alias = "width-mm")]
641    fn connect_width_mm_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
642        unsafe extern "C" fn notify_width_mm_trampoline<P: IsA<Monitor>, F: Fn(&P) + 'static>(
643            this: *mut ffi::GdkMonitor,
644            _param_spec: glib::ffi::gpointer,
645            f: glib::ffi::gpointer,
646        ) {
647            let f: &F = &*(f as *const F);
648            f(Monitor::from_glib_borrow(this).unsafe_cast_ref())
649        }
650        unsafe {
651            let f: Box_<F> = Box_::new(f);
652            connect_raw(
653                self.as_ptr() as *mut _,
654                c"notify::width-mm".as_ptr() as *const _,
655                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
656                    notify_width_mm_trampoline::<Self, F> as *const (),
657                )),
658                Box_::into_raw(f),
659            )
660        }
661    }
662}
663
664impl<O: IsA<Monitor>> MonitorExt for O {}