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