Skip to main content

gtk/auto/
invisible.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::{Align, Buildable, Container, Widget};
6use glib::{
7    prelude::*,
8    signal::{connect_raw, SignalHandlerId},
9    translate::*,
10};
11use std::{boxed::Box as Box_, fmt, mem::transmute};
12
13glib::wrapper! {
14    /// The [`Invisible`][crate::Invisible] widget is used internally in GTK+, and is probably not
15    /// very useful for application developers.
16    ///
17    /// It is used for reliable pointer grabs and selection handling in the code
18    /// for drag-and-drop.
19    ///
20    /// ## Properties
21    ///
22    ///
23    /// #### `screen`
24    ///  Readable | Writeable
25    /// <details><summary><h4>Widget</h4></summary>
26    ///
27    ///
28    /// #### `app-paintable`
29    ///  Readable | Writeable
30    ///
31    ///
32    /// #### `can-default`
33    ///  Readable | Writeable
34    ///
35    ///
36    /// #### `can-focus`
37    ///  Readable | Writeable
38    ///
39    ///
40    /// #### `composite-child`
41    ///  Readable
42    ///
43    ///
44    /// #### `double-buffered`
45    ///  Whether the widget is double buffered.
46    ///
47    /// Readable | Writeable
48    ///
49    ///
50    /// #### `events`
51    ///  Readable | Writeable
52    ///
53    ///
54    /// #### `expand`
55    ///  Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
56    ///
57    /// Readable | Writeable
58    ///
59    ///
60    /// #### `focus-on-click`
61    ///  Whether the widget should grab focus when it is clicked with the mouse.
62    ///
63    /// This property is only relevant for widgets that can take focus.
64    ///
65    /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
66    /// GtkComboBox) implemented this property individually.
67    ///
68    /// Readable | Writeable
69    ///
70    ///
71    /// #### `halign`
72    ///  How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
73    ///
74    /// Readable | Writeable
75    ///
76    ///
77    /// #### `has-default`
78    ///  Readable | Writeable
79    ///
80    ///
81    /// #### `has-focus`
82    ///  Readable | Writeable
83    ///
84    ///
85    /// #### `has-tooltip`
86    ///  Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
87    /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
88    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
89    /// whether it will provide a tooltip or not.
90    ///
91    /// Note that setting this property to [`true`] for the first time will change
92    /// the event masks of the GdkWindows of this widget to include leave-notify
93    /// and motion-notify events. This cannot and will not be undone when the
94    /// property is set to [`false`] again.
95    ///
96    /// Readable | Writeable
97    ///
98    ///
99    /// #### `height-request`
100    ///  Readable | Writeable
101    ///
102    ///
103    /// #### `hexpand`
104    ///  Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
105    ///
106    /// Readable | Writeable
107    ///
108    ///
109    /// #### `hexpand-set`
110    ///  Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
111    ///
112    /// Readable | Writeable
113    ///
114    ///
115    /// #### `is-focus`
116    ///  Readable | Writeable
117    ///
118    ///
119    /// #### `margin`
120    ///  Sets all four sides' margin at once. If read, returns max
121    /// margin on any side.
122    ///
123    /// Readable | Writeable
124    ///
125    ///
126    /// #### `margin-bottom`
127    ///  Margin on bottom side of widget.
128    ///
129    /// This property adds margin outside of the widget's normal size
130    /// request, the margin will be added in addition to the size from
131    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
132    ///
133    /// Readable | Writeable
134    ///
135    ///
136    /// #### `margin-end`
137    ///  Margin on end of widget, horizontally. This property supports
138    /// left-to-right and right-to-left text directions.
139    ///
140    /// This property adds margin outside of the widget's normal size
141    /// request, the margin will be added in addition to the size from
142    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
143    ///
144    /// Readable | Writeable
145    ///
146    ///
147    /// #### `margin-left`
148    ///  Margin on left side of widget.
149    ///
150    /// This property adds margin outside of the widget's normal size
151    /// request, the margin will be added in addition to the size from
152    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
153    ///
154    /// Readable | Writeable
155    ///
156    ///
157    /// #### `margin-right`
158    ///  Margin on right side of widget.
159    ///
160    /// This property adds margin outside of the widget's normal size
161    /// request, the margin will be added in addition to the size from
162    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
163    ///
164    /// Readable | Writeable
165    ///
166    ///
167    /// #### `margin-start`
168    ///  Margin on start of widget, horizontally. This property supports
169    /// left-to-right and right-to-left text directions.
170    ///
171    /// This property adds margin outside of the widget's normal size
172    /// request, the margin will be added in addition to the size from
173    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
174    ///
175    /// Readable | Writeable
176    ///
177    ///
178    /// #### `margin-top`
179    ///  Margin on top side of widget.
180    ///
181    /// This property adds margin outside of the widget's normal size
182    /// request, the margin will be added in addition to the size from
183    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
184    ///
185    /// Readable | Writeable
186    ///
187    ///
188    /// #### `name`
189    ///  Readable | Writeable
190    ///
191    ///
192    /// #### `no-show-all`
193    ///  Readable | Writeable
194    ///
195    ///
196    /// #### `opacity`
197    ///  The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
198    /// more details about window opacity.
199    ///
200    /// Before 3.8 this was only available in GtkWindow
201    ///
202    /// Readable | Writeable
203    ///
204    ///
205    /// #### `parent`
206    ///  Readable | Writeable
207    ///
208    ///
209    /// #### `receives-default`
210    ///  Readable | Writeable
211    ///
212    ///
213    /// #### `scale-factor`
214    ///  The scale factor of the widget. See [`WidgetExt::scale_factor()`][crate::prelude::WidgetExt::scale_factor()] for
215    /// more details about widget scaling.
216    ///
217    /// Readable
218    ///
219    ///
220    /// #### `sensitive`
221    ///  Readable | Writeable
222    ///
223    ///
224    /// #### `style`
225    ///  The style of the widget, which contains information about how it will look (colors, etc).
226    ///
227    /// Readable | Writeable
228    ///
229    ///
230    /// #### `tooltip-markup`
231    ///  Sets the text of tooltip to be the given string, which is marked up
232    /// with the [Pango text markup language][PangoMarkupFormat].
233    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
234    ///
235    /// This is a convenience property which will take care of getting the
236    /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
237    /// will automatically be set to [`true`] and there will be taken care of
238    /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
239    ///
240    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
241    /// are set, the last one wins.
242    ///
243    /// Readable | Writeable
244    ///
245    ///
246    /// #### `tooltip-text`
247    ///  Sets the text of tooltip to be the given string.
248    ///
249    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
250    ///
251    /// This is a convenience property which will take care of getting the
252    /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
253    /// will automatically be set to [`true`] and there will be taken care of
254    /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
255    ///
256    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
257    /// are set, the last one wins.
258    ///
259    /// Readable | Writeable
260    ///
261    ///
262    /// #### `valign`
263    ///  How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
264    ///
265    /// Readable | Writeable
266    ///
267    ///
268    /// #### `vexpand`
269    ///  Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
270    ///
271    /// Readable | Writeable
272    ///
273    ///
274    /// #### `vexpand-set`
275    ///  Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
276    ///
277    /// Readable | Writeable
278    ///
279    ///
280    /// #### `visible`
281    ///  Readable | Writeable
282    ///
283    ///
284    /// #### `width-request`
285    ///  Readable | Writeable
286    ///
287    ///
288    /// #### `window`
289    ///  The widget's window if it is realized, [`None`] otherwise.
290    ///
291    /// Readable
292    /// </details>
293    ///
294    /// # Implements
295    ///
296    /// [`InvisibleExt`][trait@crate::prelude::InvisibleExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`InvisibleExtManual`][trait@crate::prelude::InvisibleExtManual], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`BuildableExtManual`][trait@crate::prelude::BuildableExtManual]
297    #[doc(alias = "GtkInvisible")]
298    pub struct Invisible(Object<ffi::GtkInvisible, ffi::GtkInvisibleClass>) @extends Widget, @implements Buildable;
299
300    match fn {
301        type_ => || ffi::gtk_invisible_get_type(),
302    }
303}
304
305impl Invisible {
306    pub const NONE: Option<&'static Invisible> = None;
307
308    /// Creates a new [`Invisible`][crate::Invisible].
309    ///
310    /// # Returns
311    ///
312    /// a new [`Invisible`][crate::Invisible].
313    #[doc(alias = "gtk_invisible_new")]
314    pub fn new() -> Invisible {
315        assert_initialized_main_thread!();
316        unsafe { Widget::from_glib_none(ffi::gtk_invisible_new()).unsafe_cast() }
317    }
318
319    /// Creates a new [`Invisible`][crate::Invisible] object for a specified screen
320    /// ## `screen`
321    /// a [`gdk::Screen`][crate::gdk::Screen] which identifies on which
322    ///  the new [`Invisible`][crate::Invisible] will be created.
323    ///
324    /// # Returns
325    ///
326    /// a newly created [`Invisible`][crate::Invisible] object
327    #[doc(alias = "gtk_invisible_new_for_screen")]
328    #[doc(alias = "new_for_screen")]
329    pub fn for_screen(screen: &gdk::Screen) -> Invisible {
330        assert_initialized_main_thread!();
331        unsafe {
332            Widget::from_glib_none(ffi::gtk_invisible_new_for_screen(screen.to_glib_none().0))
333                .unsafe_cast()
334        }
335    }
336
337    // rustdoc-stripper-ignore-next
338    /// Creates a new builder-pattern struct instance to construct [`Invisible`] objects.
339    ///
340    /// This method returns an instance of [`InvisibleBuilder`](crate::builders::InvisibleBuilder) which can be used to create [`Invisible`] objects.
341    pub fn builder() -> InvisibleBuilder {
342        InvisibleBuilder::new()
343    }
344}
345
346impl Default for Invisible {
347    fn default() -> Self {
348        Self::new()
349    }
350}
351
352// rustdoc-stripper-ignore-next
353/// A [builder-pattern] type to construct [`Invisible`] objects.
354///
355/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
356#[must_use = "The builder must be built to be used"]
357pub struct InvisibleBuilder {
358    builder: glib::object::ObjectBuilder<'static, Invisible>,
359}
360
361impl InvisibleBuilder {
362    fn new() -> Self {
363        Self {
364            builder: glib::object::Object::builder(),
365        }
366    }
367
368    pub fn screen(self, screen: &gdk::Screen) -> Self {
369        Self {
370            builder: self.builder.property("screen", screen.clone()),
371        }
372    }
373
374    pub fn app_paintable(self, app_paintable: bool) -> Self {
375        Self {
376            builder: self.builder.property("app-paintable", app_paintable),
377        }
378    }
379
380    pub fn can_default(self, can_default: bool) -> Self {
381        Self {
382            builder: self.builder.property("can-default", can_default),
383        }
384    }
385
386    pub fn can_focus(self, can_focus: bool) -> Self {
387        Self {
388            builder: self.builder.property("can-focus", can_focus),
389        }
390    }
391
392    pub fn events(self, events: gdk::EventMask) -> Self {
393        Self {
394            builder: self.builder.property("events", events),
395        }
396    }
397
398    /// Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
399    pub fn expand(self, expand: bool) -> Self {
400        Self {
401            builder: self.builder.property("expand", expand),
402        }
403    }
404
405    /// Whether the widget should grab focus when it is clicked with the mouse.
406    ///
407    /// This property is only relevant for widgets that can take focus.
408    ///
409    /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
410    /// GtkComboBox) implemented this property individually.
411    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
412        Self {
413            builder: self.builder.property("focus-on-click", focus_on_click),
414        }
415    }
416
417    /// How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
418    pub fn halign(self, halign: Align) -> Self {
419        Self {
420            builder: self.builder.property("halign", halign),
421        }
422    }
423
424    pub fn has_default(self, has_default: bool) -> Self {
425        Self {
426            builder: self.builder.property("has-default", has_default),
427        }
428    }
429
430    pub fn has_focus(self, has_focus: bool) -> Self {
431        Self {
432            builder: self.builder.property("has-focus", has_focus),
433        }
434    }
435
436    /// Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
437    /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
438    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
439    /// whether it will provide a tooltip or not.
440    ///
441    /// Note that setting this property to [`true`] for the first time will change
442    /// the event masks of the GdkWindows of this widget to include leave-notify
443    /// and motion-notify events. This cannot and will not be undone when the
444    /// property is set to [`false`] again.
445    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
446        Self {
447            builder: self.builder.property("has-tooltip", has_tooltip),
448        }
449    }
450
451    pub fn height_request(self, height_request: i32) -> Self {
452        Self {
453            builder: self.builder.property("height-request", height_request),
454        }
455    }
456
457    /// Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
458    pub fn hexpand(self, hexpand: bool) -> Self {
459        Self {
460            builder: self.builder.property("hexpand", hexpand),
461        }
462    }
463
464    /// Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
465    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
466        Self {
467            builder: self.builder.property("hexpand-set", hexpand_set),
468        }
469    }
470
471    pub fn is_focus(self, is_focus: bool) -> Self {
472        Self {
473            builder: self.builder.property("is-focus", is_focus),
474        }
475    }
476
477    /// Sets all four sides' margin at once. If read, returns max
478    /// margin on any side.
479    pub fn margin(self, margin: i32) -> Self {
480        Self {
481            builder: self.builder.property("margin", margin),
482        }
483    }
484
485    /// Margin on bottom side of widget.
486    ///
487    /// This property adds margin outside of the widget's normal size
488    /// request, the margin will be added in addition to the size from
489    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
490    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
491        Self {
492            builder: self.builder.property("margin-bottom", margin_bottom),
493        }
494    }
495
496    /// Margin on end of widget, horizontally. This property supports
497    /// left-to-right and right-to-left text directions.
498    ///
499    /// This property adds margin outside of the widget's normal size
500    /// request, the margin will be added in addition to the size from
501    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
502    pub fn margin_end(self, margin_end: i32) -> Self {
503        Self {
504            builder: self.builder.property("margin-end", margin_end),
505        }
506    }
507
508    /// Margin on start of widget, horizontally. This property supports
509    /// left-to-right and right-to-left text directions.
510    ///
511    /// This property adds margin outside of the widget's normal size
512    /// request, the margin will be added in addition to the size from
513    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
514    pub fn margin_start(self, margin_start: i32) -> Self {
515        Self {
516            builder: self.builder.property("margin-start", margin_start),
517        }
518    }
519
520    /// Margin on top side of widget.
521    ///
522    /// This property adds margin outside of the widget's normal size
523    /// request, the margin will be added in addition to the size from
524    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
525    pub fn margin_top(self, margin_top: i32) -> Self {
526        Self {
527            builder: self.builder.property("margin-top", margin_top),
528        }
529    }
530
531    pub fn name(self, name: impl Into<glib::GString>) -> Self {
532        Self {
533            builder: self.builder.property("name", name.into()),
534        }
535    }
536
537    pub fn no_show_all(self, no_show_all: bool) -> Self {
538        Self {
539            builder: self.builder.property("no-show-all", no_show_all),
540        }
541    }
542
543    /// The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
544    /// more details about window opacity.
545    ///
546    /// Before 3.8 this was only available in GtkWindow
547    pub fn opacity(self, opacity: f64) -> Self {
548        Self {
549            builder: self.builder.property("opacity", opacity),
550        }
551    }
552
553    pub fn parent(self, parent: &impl IsA<Container>) -> Self {
554        Self {
555            builder: self.builder.property("parent", parent.clone().upcast()),
556        }
557    }
558
559    pub fn receives_default(self, receives_default: bool) -> Self {
560        Self {
561            builder: self.builder.property("receives-default", receives_default),
562        }
563    }
564
565    pub fn sensitive(self, sensitive: bool) -> Self {
566        Self {
567            builder: self.builder.property("sensitive", sensitive),
568        }
569    }
570
571    /// Sets the text of tooltip to be the given string, which is marked up
572    /// with the [Pango text markup language][PangoMarkupFormat].
573    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
574    ///
575    /// This is a convenience property which will take care of getting the
576    /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
577    /// will automatically be set to [`true`] and there will be taken care of
578    /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
579    ///
580    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
581    /// are set, the last one wins.
582    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
583        Self {
584            builder: self
585                .builder
586                .property("tooltip-markup", tooltip_markup.into()),
587        }
588    }
589
590    /// Sets the text of tooltip to be the given string.
591    ///
592    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
593    ///
594    /// This is a convenience property which will take care of getting the
595    /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
596    /// will automatically be set to [`true`] and there will be taken care of
597    /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
598    ///
599    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
600    /// are set, the last one wins.
601    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
602        Self {
603            builder: self.builder.property("tooltip-text", tooltip_text.into()),
604        }
605    }
606
607    /// How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
608    pub fn valign(self, valign: Align) -> Self {
609        Self {
610            builder: self.builder.property("valign", valign),
611        }
612    }
613
614    /// Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
615    pub fn vexpand(self, vexpand: bool) -> Self {
616        Self {
617            builder: self.builder.property("vexpand", vexpand),
618        }
619    }
620
621    /// Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
622    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
623        Self {
624            builder: self.builder.property("vexpand-set", vexpand_set),
625        }
626    }
627
628    pub fn visible(self, visible: bool) -> Self {
629        Self {
630            builder: self.builder.property("visible", visible),
631        }
632    }
633
634    pub fn width_request(self, width_request: i32) -> Self {
635        Self {
636            builder: self.builder.property("width-request", width_request),
637        }
638    }
639
640    // rustdoc-stripper-ignore-next
641    /// Build the [`Invisible`].
642    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
643    pub fn build(self) -> Invisible {
644        self.builder.build()
645    }
646}
647
648mod sealed {
649    pub trait Sealed {}
650    impl<T: super::IsA<super::Invisible>> Sealed for T {}
651}
652
653/// Trait containing all [`struct@Invisible`] methods.
654///
655/// # Implementors
656///
657/// [`Invisible`][struct@crate::Invisible]
658pub trait InvisibleExt: IsA<Invisible> + sealed::Sealed + 'static {
659    /// Sets the [`gdk::Screen`][crate::gdk::Screen] where the [`Invisible`][crate::Invisible] object will be displayed.
660    /// ## `screen`
661    /// a [`gdk::Screen`][crate::gdk::Screen].
662    #[doc(alias = "gtk_invisible_set_screen")]
663    fn set_screen(&self, screen: &gdk::Screen) {
664        unsafe {
665            ffi::gtk_invisible_set_screen(self.as_ref().to_glib_none().0, screen.to_glib_none().0);
666        }
667    }
668
669    #[doc(alias = "screen")]
670    fn connect_screen_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
671        unsafe extern "C" fn notify_screen_trampoline<P: IsA<Invisible>, F: Fn(&P) + 'static>(
672            this: *mut ffi::GtkInvisible,
673            _param_spec: glib::ffi::gpointer,
674            f: glib::ffi::gpointer,
675        ) {
676            let f: &F = &*(f as *const F);
677            f(Invisible::from_glib_borrow(this).unsafe_cast_ref())
678        }
679        unsafe {
680            let f: Box_<F> = Box_::new(f);
681            connect_raw(
682                self.as_ptr() as *mut _,
683                b"notify::screen\0".as_ptr() as *const _,
684                Some(transmute::<_, unsafe extern "C" fn()>(
685                    notify_screen_trampoline::<Self, F> as *const (),
686                )),
687                Box_::into_raw(f),
688            )
689        }
690    }
691}
692
693impl<O: IsA<Invisible>> InvisibleExt for O {}
694
695impl fmt::Display for Invisible {
696    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
697        f.write_str("Invisible")
698    }
699}