gtk4/auto/
widget.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#![allow(deprecated)]
5
6use crate::{
7    ffi, Accessible, Align, Allocation, Buildable, ConstraintTarget, DirectionType,
8    EventController, LayoutManager, Native, Orientation, Overflow, PickFlags, Requisition, Root,
9    Settings, SizeRequestMode, Snapshot, StateFlags, StyleContext, TextDirection, Tooltip,
10};
11use glib::{
12    object::ObjectType as _,
13    prelude::*,
14    signal::{connect_raw, SignalHandlerId},
15    translate::*,
16};
17use std::boxed::Box as Box_;
18
19glib::wrapper! {
20    #[doc(alias = "GtkWidget")]
21    pub struct Widget(Object<ffi::GtkWidget, ffi::GtkWidgetClass>) @implements Accessible, Buildable, ConstraintTarget;
22
23    match fn {
24        type_ => || ffi::gtk_widget_get_type(),
25    }
26}
27
28impl Widget {
29    pub const NONE: Option<&'static Widget> = None;
30
31    #[doc(alias = "gtk_widget_get_default_direction")]
32    #[doc(alias = "get_default_direction")]
33    pub fn default_direction() -> TextDirection {
34        assert_initialized_main_thread!();
35        unsafe { from_glib(ffi::gtk_widget_get_default_direction()) }
36    }
37
38    #[doc(alias = "gtk_widget_set_default_direction")]
39    pub fn set_default_direction(dir: TextDirection) {
40        assert_initialized_main_thread!();
41        unsafe {
42            ffi::gtk_widget_set_default_direction(dir.into_glib());
43        }
44    }
45}
46
47impl std::fmt::Display for Widget {
48    #[inline]
49    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
50        f.write_str(&WidgetExt::widget_name(self))
51    }
52}
53
54mod sealed {
55    pub trait Sealed {}
56    impl<T: super::IsA<super::Widget>> Sealed for T {}
57}
58
59pub trait WidgetExt: IsA<Widget> + sealed::Sealed + 'static {
60    #[doc(alias = "gtk_widget_action_set_enabled")]
61    fn action_set_enabled(&self, action_name: &str, enabled: bool) {
62        unsafe {
63            ffi::gtk_widget_action_set_enabled(
64                self.as_ref().to_glib_none().0,
65                action_name.to_glib_none().0,
66                enabled.into_glib(),
67            );
68        }
69    }
70
71    #[doc(alias = "gtk_widget_activate")]
72    fn activate(&self) -> bool {
73        unsafe { from_glib(ffi::gtk_widget_activate(self.as_ref().to_glib_none().0)) }
74    }
75
76    #[doc(alias = "gtk_widget_activate_action_variant")]
77    #[doc(alias = "activate_action_variant")]
78    fn activate_action(
79        &self,
80        name: &str,
81        args: Option<&glib::Variant>,
82    ) -> Result<(), glib::error::BoolError> {
83        unsafe {
84            glib::result_from_gboolean!(
85                ffi::gtk_widget_activate_action_variant(
86                    self.as_ref().to_glib_none().0,
87                    name.to_glib_none().0,
88                    args.to_glib_none().0
89                ),
90                "Action does not exist"
91            )
92        }
93    }
94
95    #[doc(alias = "gtk_widget_activate_default")]
96    fn activate_default(&self) {
97        unsafe {
98            ffi::gtk_widget_activate_default(self.as_ref().to_glib_none().0);
99        }
100    }
101
102    #[doc(alias = "gtk_widget_add_controller")]
103    fn add_controller(&self, controller: impl IsA<EventController>) {
104        unsafe {
105            ffi::gtk_widget_add_controller(
106                self.as_ref().to_glib_none().0,
107                controller.upcast().into_glib_ptr(),
108            );
109        }
110    }
111
112    #[doc(alias = "gtk_widget_add_css_class")]
113    fn add_css_class(&self, css_class: &str) {
114        unsafe {
115            ffi::gtk_widget_add_css_class(
116                self.as_ref().to_glib_none().0,
117                css_class.to_glib_none().0,
118            );
119        }
120    }
121
122    #[doc(alias = "gtk_widget_add_mnemonic_label")]
123    fn add_mnemonic_label(&self, label: &impl IsA<Widget>) {
124        unsafe {
125            ffi::gtk_widget_add_mnemonic_label(
126                self.as_ref().to_glib_none().0,
127                label.as_ref().to_glib_none().0,
128            );
129        }
130    }
131
132    #[doc(alias = "gtk_widget_allocate")]
133    fn allocate(&self, width: i32, height: i32, baseline: i32, transform: Option<gsk::Transform>) {
134        unsafe {
135            ffi::gtk_widget_allocate(
136                self.as_ref().to_glib_none().0,
137                width,
138                height,
139                baseline,
140                transform.into_glib_ptr(),
141            );
142        }
143    }
144
145    #[doc(alias = "gtk_widget_child_focus")]
146    fn child_focus(&self, direction: DirectionType) -> bool {
147        unsafe {
148            from_glib(ffi::gtk_widget_child_focus(
149                self.as_ref().to_glib_none().0,
150                direction.into_glib(),
151            ))
152        }
153    }
154
155    #[doc(alias = "gtk_widget_compute_bounds")]
156    fn compute_bounds(&self, target: &impl IsA<Widget>) -> Option<graphene::Rect> {
157        unsafe {
158            let mut out_bounds = graphene::Rect::uninitialized();
159            let ret = from_glib(ffi::gtk_widget_compute_bounds(
160                self.as_ref().to_glib_none().0,
161                target.as_ref().to_glib_none().0,
162                out_bounds.to_glib_none_mut().0,
163            ));
164            if ret {
165                Some(out_bounds)
166            } else {
167                None
168            }
169        }
170    }
171
172    #[doc(alias = "gtk_widget_compute_expand")]
173    fn compute_expand(&self, orientation: Orientation) -> bool {
174        unsafe {
175            from_glib(ffi::gtk_widget_compute_expand(
176                self.as_ref().to_glib_none().0,
177                orientation.into_glib(),
178            ))
179        }
180    }
181
182    #[doc(alias = "gtk_widget_compute_point")]
183    fn compute_point(
184        &self,
185        target: &impl IsA<Widget>,
186        point: &graphene::Point,
187    ) -> Option<graphene::Point> {
188        unsafe {
189            let mut out_point = graphene::Point::uninitialized();
190            let ret = from_glib(ffi::gtk_widget_compute_point(
191                self.as_ref().to_glib_none().0,
192                target.as_ref().to_glib_none().0,
193                point.to_glib_none().0,
194                out_point.to_glib_none_mut().0,
195            ));
196            if ret {
197                Some(out_point)
198            } else {
199                None
200            }
201        }
202    }
203
204    #[doc(alias = "gtk_widget_compute_transform")]
205    fn compute_transform(&self, target: &impl IsA<Widget>) -> Option<graphene::Matrix> {
206        unsafe {
207            let mut out_transform = graphene::Matrix::uninitialized();
208            let ret = from_glib(ffi::gtk_widget_compute_transform(
209                self.as_ref().to_glib_none().0,
210                target.as_ref().to_glib_none().0,
211                out_transform.to_glib_none_mut().0,
212            ));
213            if ret {
214                Some(out_transform)
215            } else {
216                None
217            }
218        }
219    }
220
221    #[doc(alias = "gtk_widget_contains")]
222    fn contains(&self, x: f64, y: f64) -> bool {
223        unsafe {
224            from_glib(ffi::gtk_widget_contains(
225                self.as_ref().to_glib_none().0,
226                x,
227                y,
228            ))
229        }
230    }
231
232    #[doc(alias = "gtk_widget_create_pango_context")]
233    fn create_pango_context(&self) -> pango::Context {
234        unsafe {
235            from_glib_full(ffi::gtk_widget_create_pango_context(
236                self.as_ref().to_glib_none().0,
237            ))
238        }
239    }
240
241    #[doc(alias = "gtk_widget_create_pango_layout")]
242    fn create_pango_layout(&self, text: Option<&str>) -> pango::Layout {
243        unsafe {
244            from_glib_full(ffi::gtk_widget_create_pango_layout(
245                self.as_ref().to_glib_none().0,
246                text.to_glib_none().0,
247            ))
248        }
249    }
250
251    #[doc(alias = "gtk_drag_check_threshold")]
252    fn drag_check_threshold(
253        &self,
254        start_x: i32,
255        start_y: i32,
256        current_x: i32,
257        current_y: i32,
258    ) -> bool {
259        unsafe {
260            from_glib(ffi::gtk_drag_check_threshold(
261                self.as_ref().to_glib_none().0,
262                start_x,
263                start_y,
264                current_x,
265                current_y,
266            ))
267        }
268    }
269
270    #[doc(alias = "gtk_widget_error_bell")]
271    fn error_bell(&self) {
272        unsafe {
273            ffi::gtk_widget_error_bell(self.as_ref().to_glib_none().0);
274        }
275    }
276
277    #[cfg_attr(feature = "v4_12", deprecated = "Since 4.12")]
278    #[allow(deprecated)]
279    #[doc(alias = "gtk_widget_get_allocated_baseline")]
280    #[doc(alias = "get_allocated_baseline")]
281    fn allocated_baseline(&self) -> i32 {
282        unsafe { ffi::gtk_widget_get_allocated_baseline(self.as_ref().to_glib_none().0) }
283    }
284
285    #[cfg_attr(feature = "v4_12", deprecated = "Since 4.12")]
286    #[allow(deprecated)]
287    #[doc(alias = "gtk_widget_get_allocated_height")]
288    #[doc(alias = "get_allocated_height")]
289    fn allocated_height(&self) -> i32 {
290        unsafe { ffi::gtk_widget_get_allocated_height(self.as_ref().to_glib_none().0) }
291    }
292
293    #[cfg_attr(feature = "v4_12", deprecated = "Since 4.12")]
294    #[allow(deprecated)]
295    #[doc(alias = "gtk_widget_get_allocated_width")]
296    #[doc(alias = "get_allocated_width")]
297    fn allocated_width(&self) -> i32 {
298        unsafe { ffi::gtk_widget_get_allocated_width(self.as_ref().to_glib_none().0) }
299    }
300
301    #[cfg_attr(feature = "v4_12", deprecated = "Since 4.12")]
302    #[allow(deprecated)]
303    #[doc(alias = "gtk_widget_get_allocation")]
304    #[doc(alias = "get_allocation")]
305    fn allocation(&self) -> Allocation {
306        unsafe {
307            let mut allocation = Allocation::uninitialized();
308            ffi::gtk_widget_get_allocation(
309                self.as_ref().to_glib_none().0,
310                allocation.to_glib_none_mut().0,
311            );
312            allocation
313        }
314    }
315
316    #[doc(alias = "gtk_widget_get_ancestor")]
317    #[doc(alias = "get_ancestor")]
318    #[must_use]
319    fn ancestor(&self, widget_type: glib::types::Type) -> Option<Widget> {
320        unsafe {
321            from_glib_none(ffi::gtk_widget_get_ancestor(
322                self.as_ref().to_glib_none().0,
323                widget_type.into_glib(),
324            ))
325        }
326    }
327
328    #[cfg(feature = "v4_12")]
329    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
330    #[doc(alias = "gtk_widget_get_baseline")]
331    #[doc(alias = "get_baseline")]
332    fn baseline(&self) -> i32 {
333        unsafe { ffi::gtk_widget_get_baseline(self.as_ref().to_glib_none().0) }
334    }
335
336    #[doc(alias = "gtk_widget_get_can_focus")]
337    #[doc(alias = "get_can_focus")]
338    #[doc(alias = "can-focus")]
339    fn can_focus(&self) -> bool {
340        unsafe {
341            from_glib(ffi::gtk_widget_get_can_focus(
342                self.as_ref().to_glib_none().0,
343            ))
344        }
345    }
346
347    #[doc(alias = "gtk_widget_get_can_target")]
348    #[doc(alias = "get_can_target")]
349    #[doc(alias = "can-target")]
350    fn can_target(&self) -> bool {
351        unsafe {
352            from_glib(ffi::gtk_widget_get_can_target(
353                self.as_ref().to_glib_none().0,
354            ))
355        }
356    }
357
358    #[doc(alias = "gtk_widget_get_child_visible")]
359    #[doc(alias = "get_child_visible")]
360    fn is_child_visible(&self) -> bool {
361        unsafe {
362            from_glib(ffi::gtk_widget_get_child_visible(
363                self.as_ref().to_glib_none().0,
364            ))
365        }
366    }
367
368    #[doc(alias = "gtk_widget_get_clipboard")]
369    #[doc(alias = "get_clipboard")]
370    fn clipboard(&self) -> gdk::Clipboard {
371        unsafe {
372            from_glib_none(ffi::gtk_widget_get_clipboard(
373                self.as_ref().to_glib_none().0,
374            ))
375        }
376    }
377
378    #[cfg(feature = "v4_10")]
379    #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
380    #[doc(alias = "gtk_widget_get_color")]
381    #[doc(alias = "get_color")]
382    fn color(&self) -> gdk::RGBA {
383        unsafe {
384            let mut color = gdk::RGBA::uninitialized();
385            ffi::gtk_widget_get_color(self.as_ref().to_glib_none().0, color.to_glib_none_mut().0);
386            color
387        }
388    }
389
390    #[doc(alias = "gtk_widget_get_css_classes")]
391    #[doc(alias = "get_css_classes")]
392    #[doc(alias = "css-classes")]
393    fn css_classes(&self) -> Vec<glib::GString> {
394        unsafe {
395            FromGlibPtrContainer::from_glib_full(ffi::gtk_widget_get_css_classes(
396                self.as_ref().to_glib_none().0,
397            ))
398        }
399    }
400
401    #[doc(alias = "gtk_widget_get_css_name")]
402    #[doc(alias = "get_css_name")]
403    #[doc(alias = "css-name")]
404    fn css_name(&self) -> glib::GString {
405        unsafe { from_glib_none(ffi::gtk_widget_get_css_name(self.as_ref().to_glib_none().0)) }
406    }
407
408    #[doc(alias = "gtk_widget_get_cursor")]
409    #[doc(alias = "get_cursor")]
410    fn cursor(&self) -> Option<gdk::Cursor> {
411        unsafe { from_glib_none(ffi::gtk_widget_get_cursor(self.as_ref().to_glib_none().0)) }
412    }
413
414    #[doc(alias = "gtk_widget_get_direction")]
415    #[doc(alias = "get_direction")]
416    fn direction(&self) -> TextDirection {
417        unsafe {
418            from_glib(ffi::gtk_widget_get_direction(
419                self.as_ref().to_glib_none().0,
420            ))
421        }
422    }
423
424    #[doc(alias = "gtk_widget_get_display")]
425    #[doc(alias = "get_display")]
426    fn display(&self) -> gdk::Display {
427        unsafe { from_glib_none(ffi::gtk_widget_get_display(self.as_ref().to_glib_none().0)) }
428    }
429
430    #[doc(alias = "gtk_widget_get_first_child")]
431    #[doc(alias = "get_first_child")]
432    #[must_use]
433    fn first_child(&self) -> Option<Widget> {
434        unsafe {
435            from_glib_none(ffi::gtk_widget_get_first_child(
436                self.as_ref().to_glib_none().0,
437            ))
438        }
439    }
440
441    #[doc(alias = "gtk_widget_get_focus_child")]
442    #[doc(alias = "get_focus_child")]
443    #[must_use]
444    fn focus_child(&self) -> Option<Widget> {
445        unsafe {
446            from_glib_none(ffi::gtk_widget_get_focus_child(
447                self.as_ref().to_glib_none().0,
448            ))
449        }
450    }
451
452    #[doc(alias = "gtk_widget_get_focus_on_click")]
453    #[doc(alias = "get_focus_on_click")]
454    #[doc(alias = "focus-on-click")]
455    fn gets_focus_on_click(&self) -> bool {
456        unsafe {
457            from_glib(ffi::gtk_widget_get_focus_on_click(
458                self.as_ref().to_glib_none().0,
459            ))
460        }
461    }
462
463    #[doc(alias = "gtk_widget_get_focusable")]
464    #[doc(alias = "get_focusable")]
465    #[doc(alias = "focusable")]
466    fn is_focusable(&self) -> bool {
467        unsafe {
468            from_glib(ffi::gtk_widget_get_focusable(
469                self.as_ref().to_glib_none().0,
470            ))
471        }
472    }
473
474    #[doc(alias = "gtk_widget_get_font_map")]
475    #[doc(alias = "get_font_map")]
476    fn font_map(&self) -> Option<pango::FontMap> {
477        unsafe { from_glib_none(ffi::gtk_widget_get_font_map(self.as_ref().to_glib_none().0)) }
478    }
479
480    #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")]
481    #[allow(deprecated)]
482    #[doc(alias = "gtk_widget_get_font_options")]
483    #[doc(alias = "get_font_options")]
484    fn font_options(&self) -> Option<cairo::FontOptions> {
485        unsafe {
486            from_glib_none(ffi::gtk_widget_get_font_options(
487                self.as_ref().to_glib_none().0,
488            ))
489        }
490    }
491
492    #[doc(alias = "gtk_widget_get_frame_clock")]
493    #[doc(alias = "get_frame_clock")]
494    fn frame_clock(&self) -> Option<gdk::FrameClock> {
495        unsafe {
496            from_glib_none(ffi::gtk_widget_get_frame_clock(
497                self.as_ref().to_glib_none().0,
498            ))
499        }
500    }
501
502    #[doc(alias = "gtk_widget_get_halign")]
503    #[doc(alias = "get_halign")]
504    fn halign(&self) -> Align {
505        unsafe { from_glib(ffi::gtk_widget_get_halign(self.as_ref().to_glib_none().0)) }
506    }
507
508    #[doc(alias = "gtk_widget_get_has_tooltip")]
509    #[doc(alias = "get_has_tooltip")]
510    #[doc(alias = "has-tooltip")]
511    fn has_tooltip(&self) -> bool {
512        unsafe {
513            from_glib(ffi::gtk_widget_get_has_tooltip(
514                self.as_ref().to_glib_none().0,
515            ))
516        }
517    }
518
519    #[doc(alias = "gtk_widget_get_height")]
520    #[doc(alias = "get_height")]
521    fn height(&self) -> i32 {
522        unsafe { ffi::gtk_widget_get_height(self.as_ref().to_glib_none().0) }
523    }
524
525    #[doc(alias = "gtk_widget_get_hexpand")]
526    #[doc(alias = "get_hexpand")]
527    #[doc(alias = "hexpand")]
528    fn hexpands(&self) -> bool {
529        unsafe { from_glib(ffi::gtk_widget_get_hexpand(self.as_ref().to_glib_none().0)) }
530    }
531
532    #[doc(alias = "gtk_widget_get_hexpand_set")]
533    #[doc(alias = "get_hexpand_set")]
534    #[doc(alias = "hexpand-set")]
535    fn is_hexpand_set(&self) -> bool {
536        unsafe {
537            from_glib(ffi::gtk_widget_get_hexpand_set(
538                self.as_ref().to_glib_none().0,
539            ))
540        }
541    }
542
543    #[doc(alias = "gtk_widget_get_last_child")]
544    #[doc(alias = "get_last_child")]
545    #[must_use]
546    fn last_child(&self) -> Option<Widget> {
547        unsafe {
548            from_glib_none(ffi::gtk_widget_get_last_child(
549                self.as_ref().to_glib_none().0,
550            ))
551        }
552    }
553
554    #[doc(alias = "gtk_widget_get_layout_manager")]
555    #[doc(alias = "get_layout_manager")]
556    #[doc(alias = "layout-manager")]
557    fn layout_manager(&self) -> Option<LayoutManager> {
558        unsafe {
559            from_glib_none(ffi::gtk_widget_get_layout_manager(
560                self.as_ref().to_glib_none().0,
561            ))
562        }
563    }
564
565    #[cfg(feature = "v4_18")]
566    #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
567    #[doc(alias = "gtk_widget_get_limit_events")]
568    #[doc(alias = "get_limit_events")]
569    #[doc(alias = "limit-events")]
570    fn is_limit_events(&self) -> bool {
571        unsafe {
572            from_glib(ffi::gtk_widget_get_limit_events(
573                self.as_ref().to_glib_none().0,
574            ))
575        }
576    }
577
578    #[doc(alias = "gtk_widget_get_mapped")]
579    #[doc(alias = "get_mapped")]
580    fn is_mapped(&self) -> bool {
581        unsafe { from_glib(ffi::gtk_widget_get_mapped(self.as_ref().to_glib_none().0)) }
582    }
583
584    #[doc(alias = "gtk_widget_get_margin_bottom")]
585    #[doc(alias = "get_margin_bottom")]
586    #[doc(alias = "margin-bottom")]
587    fn margin_bottom(&self) -> i32 {
588        unsafe { ffi::gtk_widget_get_margin_bottom(self.as_ref().to_glib_none().0) }
589    }
590
591    #[doc(alias = "gtk_widget_get_margin_end")]
592    #[doc(alias = "get_margin_end")]
593    #[doc(alias = "margin-end")]
594    fn margin_end(&self) -> i32 {
595        unsafe { ffi::gtk_widget_get_margin_end(self.as_ref().to_glib_none().0) }
596    }
597
598    #[doc(alias = "gtk_widget_get_margin_start")]
599    #[doc(alias = "get_margin_start")]
600    #[doc(alias = "margin-start")]
601    fn margin_start(&self) -> i32 {
602        unsafe { ffi::gtk_widget_get_margin_start(self.as_ref().to_glib_none().0) }
603    }
604
605    #[doc(alias = "gtk_widget_get_margin_top")]
606    #[doc(alias = "get_margin_top")]
607    #[doc(alias = "margin-top")]
608    fn margin_top(&self) -> i32 {
609        unsafe { ffi::gtk_widget_get_margin_top(self.as_ref().to_glib_none().0) }
610    }
611
612    #[doc(alias = "gtk_widget_get_name")]
613    #[doc(alias = "get_name")]
614    #[doc(alias = "name")]
615    fn widget_name(&self) -> glib::GString {
616        unsafe { from_glib_none(ffi::gtk_widget_get_name(self.as_ref().to_glib_none().0)) }
617    }
618
619    #[doc(alias = "gtk_widget_get_native")]
620    #[doc(alias = "get_native")]
621    fn native(&self) -> Option<Native> {
622        unsafe { from_glib_none(ffi::gtk_widget_get_native(self.as_ref().to_glib_none().0)) }
623    }
624
625    #[doc(alias = "gtk_widget_get_next_sibling")]
626    #[doc(alias = "get_next_sibling")]
627    #[must_use]
628    fn next_sibling(&self) -> Option<Widget> {
629        unsafe {
630            from_glib_none(ffi::gtk_widget_get_next_sibling(
631                self.as_ref().to_glib_none().0,
632            ))
633        }
634    }
635
636    #[doc(alias = "gtk_widget_get_opacity")]
637    #[doc(alias = "get_opacity")]
638    fn opacity(&self) -> f64 {
639        unsafe { ffi::gtk_widget_get_opacity(self.as_ref().to_glib_none().0) }
640    }
641
642    #[doc(alias = "gtk_widget_get_overflow")]
643    #[doc(alias = "get_overflow")]
644    fn overflow(&self) -> Overflow {
645        unsafe { from_glib(ffi::gtk_widget_get_overflow(self.as_ref().to_glib_none().0)) }
646    }
647
648    #[doc(alias = "gtk_widget_get_pango_context")]
649    #[doc(alias = "get_pango_context")]
650    fn pango_context(&self) -> pango::Context {
651        unsafe {
652            from_glib_none(ffi::gtk_widget_get_pango_context(
653                self.as_ref().to_glib_none().0,
654            ))
655        }
656    }
657
658    #[doc(alias = "gtk_widget_get_parent")]
659    #[doc(alias = "get_parent")]
660    #[must_use]
661    fn parent(&self) -> Option<Widget> {
662        unsafe { from_glib_none(ffi::gtk_widget_get_parent(self.as_ref().to_glib_none().0)) }
663    }
664
665    #[doc(alias = "gtk_widget_get_preferred_size")]
666    #[doc(alias = "get_preferred_size")]
667    fn preferred_size(&self) -> (Requisition, Requisition) {
668        unsafe {
669            let mut minimum_size = Requisition::uninitialized();
670            let mut natural_size = Requisition::uninitialized();
671            ffi::gtk_widget_get_preferred_size(
672                self.as_ref().to_glib_none().0,
673                minimum_size.to_glib_none_mut().0,
674                natural_size.to_glib_none_mut().0,
675            );
676            (minimum_size, natural_size)
677        }
678    }
679
680    #[doc(alias = "gtk_widget_get_prev_sibling")]
681    #[doc(alias = "get_prev_sibling")]
682    #[must_use]
683    fn prev_sibling(&self) -> Option<Widget> {
684        unsafe {
685            from_glib_none(ffi::gtk_widget_get_prev_sibling(
686                self.as_ref().to_glib_none().0,
687            ))
688        }
689    }
690
691    #[doc(alias = "gtk_widget_get_primary_clipboard")]
692    #[doc(alias = "get_primary_clipboard")]
693    fn primary_clipboard(&self) -> gdk::Clipboard {
694        unsafe {
695            from_glib_none(ffi::gtk_widget_get_primary_clipboard(
696                self.as_ref().to_glib_none().0,
697            ))
698        }
699    }
700
701    #[doc(alias = "gtk_widget_get_realized")]
702    #[doc(alias = "get_realized")]
703    fn is_realized(&self) -> bool {
704        unsafe { from_glib(ffi::gtk_widget_get_realized(self.as_ref().to_glib_none().0)) }
705    }
706
707    #[doc(alias = "gtk_widget_get_receives_default")]
708    #[doc(alias = "get_receives_default")]
709    #[doc(alias = "receives-default")]
710    fn receives_default(&self) -> bool {
711        unsafe {
712            from_glib(ffi::gtk_widget_get_receives_default(
713                self.as_ref().to_glib_none().0,
714            ))
715        }
716    }
717
718    #[doc(alias = "gtk_widget_get_request_mode")]
719    #[doc(alias = "get_request_mode")]
720    fn request_mode(&self) -> SizeRequestMode {
721        unsafe {
722            from_glib(ffi::gtk_widget_get_request_mode(
723                self.as_ref().to_glib_none().0,
724            ))
725        }
726    }
727
728    #[doc(alias = "gtk_widget_get_root")]
729    #[doc(alias = "get_root")]
730    fn root(&self) -> Option<Root> {
731        unsafe { from_glib_none(ffi::gtk_widget_get_root(self.as_ref().to_glib_none().0)) }
732    }
733
734    #[doc(alias = "gtk_widget_get_scale_factor")]
735    #[doc(alias = "get_scale_factor")]
736    #[doc(alias = "scale-factor")]
737    fn scale_factor(&self) -> i32 {
738        unsafe { ffi::gtk_widget_get_scale_factor(self.as_ref().to_glib_none().0) }
739    }
740
741    #[doc(alias = "gtk_widget_get_sensitive")]
742    #[doc(alias = "sensitive")]
743    fn get_sensitive(&self) -> bool {
744        unsafe {
745            from_glib(ffi::gtk_widget_get_sensitive(
746                self.as_ref().to_glib_none().0,
747            ))
748        }
749    }
750
751    #[doc(alias = "gtk_widget_get_settings")]
752    #[doc(alias = "get_settings")]
753    fn settings(&self) -> Settings {
754        unsafe { from_glib_none(ffi::gtk_widget_get_settings(self.as_ref().to_glib_none().0)) }
755    }
756
757    #[doc(alias = "gtk_widget_get_size")]
758    #[doc(alias = "get_size")]
759    fn size(&self, orientation: Orientation) -> i32 {
760        unsafe { ffi::gtk_widget_get_size(self.as_ref().to_glib_none().0, orientation.into_glib()) }
761    }
762
763    #[doc(alias = "gtk_widget_get_size_request")]
764    #[doc(alias = "get_size_request")]
765    fn size_request(&self) -> (i32, i32) {
766        unsafe {
767            let mut width = std::mem::MaybeUninit::uninit();
768            let mut height = std::mem::MaybeUninit::uninit();
769            ffi::gtk_widget_get_size_request(
770                self.as_ref().to_glib_none().0,
771                width.as_mut_ptr(),
772                height.as_mut_ptr(),
773            );
774            (width.assume_init(), height.assume_init())
775        }
776    }
777
778    #[doc(alias = "gtk_widget_get_state_flags")]
779    #[doc(alias = "get_state_flags")]
780    fn state_flags(&self) -> StateFlags {
781        unsafe {
782            from_glib(ffi::gtk_widget_get_state_flags(
783                self.as_ref().to_glib_none().0,
784            ))
785        }
786    }
787
788    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
789    #[allow(deprecated)]
790    #[doc(alias = "gtk_widget_get_style_context")]
791    #[doc(alias = "get_style_context")]
792    fn style_context(&self) -> StyleContext {
793        unsafe {
794            from_glib_none(ffi::gtk_widget_get_style_context(
795                self.as_ref().to_glib_none().0,
796            ))
797        }
798    }
799
800    #[doc(alias = "gtk_widget_get_tooltip_markup")]
801    #[doc(alias = "get_tooltip_markup")]
802    #[doc(alias = "tooltip-markup")]
803    fn tooltip_markup(&self) -> Option<glib::GString> {
804        unsafe {
805            from_glib_none(ffi::gtk_widget_get_tooltip_markup(
806                self.as_ref().to_glib_none().0,
807            ))
808        }
809    }
810
811    #[doc(alias = "gtk_widget_get_tooltip_text")]
812    #[doc(alias = "get_tooltip_text")]
813    #[doc(alias = "tooltip-text")]
814    fn tooltip_text(&self) -> Option<glib::GString> {
815        unsafe {
816            from_glib_none(ffi::gtk_widget_get_tooltip_text(
817                self.as_ref().to_glib_none().0,
818            ))
819        }
820    }
821
822    #[doc(alias = "gtk_widget_get_valign")]
823    #[doc(alias = "get_valign")]
824    fn valign(&self) -> Align {
825        unsafe { from_glib(ffi::gtk_widget_get_valign(self.as_ref().to_glib_none().0)) }
826    }
827
828    #[doc(alias = "gtk_widget_get_vexpand")]
829    #[doc(alias = "get_vexpand")]
830    #[doc(alias = "vexpand")]
831    fn vexpands(&self) -> bool {
832        unsafe { from_glib(ffi::gtk_widget_get_vexpand(self.as_ref().to_glib_none().0)) }
833    }
834
835    #[doc(alias = "gtk_widget_get_vexpand_set")]
836    #[doc(alias = "get_vexpand_set")]
837    #[doc(alias = "vexpand-set")]
838    fn is_vexpand_set(&self) -> bool {
839        unsafe {
840            from_glib(ffi::gtk_widget_get_vexpand_set(
841                self.as_ref().to_glib_none().0,
842            ))
843        }
844    }
845
846    #[doc(alias = "gtk_widget_get_visible")]
847    #[doc(alias = "visible")]
848    fn get_visible(&self) -> bool {
849        unsafe { from_glib(ffi::gtk_widget_get_visible(self.as_ref().to_glib_none().0)) }
850    }
851
852    #[doc(alias = "gtk_widget_get_width")]
853    #[doc(alias = "get_width")]
854    fn width(&self) -> i32 {
855        unsafe { ffi::gtk_widget_get_width(self.as_ref().to_glib_none().0) }
856    }
857
858    #[doc(alias = "gtk_widget_grab_focus")]
859    fn grab_focus(&self) -> bool {
860        unsafe { from_glib(ffi::gtk_widget_grab_focus(self.as_ref().to_glib_none().0)) }
861    }
862
863    #[doc(alias = "gtk_widget_has_css_class")]
864    fn has_css_class(&self, css_class: &str) -> bool {
865        unsafe {
866            from_glib(ffi::gtk_widget_has_css_class(
867                self.as_ref().to_glib_none().0,
868                css_class.to_glib_none().0,
869            ))
870        }
871    }
872
873    #[doc(alias = "gtk_widget_has_default")]
874    #[doc(alias = "has-default")]
875    fn has_default(&self) -> bool {
876        unsafe { from_glib(ffi::gtk_widget_has_default(self.as_ref().to_glib_none().0)) }
877    }
878
879    #[doc(alias = "gtk_widget_has_focus")]
880    #[doc(alias = "has-focus")]
881    fn has_focus(&self) -> bool {
882        unsafe { from_glib(ffi::gtk_widget_has_focus(self.as_ref().to_glib_none().0)) }
883    }
884
885    #[doc(alias = "gtk_widget_has_visible_focus")]
886    fn has_visible_focus(&self) -> bool {
887        unsafe {
888            from_glib(ffi::gtk_widget_has_visible_focus(
889                self.as_ref().to_glib_none().0,
890            ))
891        }
892    }
893
894    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
895    #[allow(deprecated)]
896    #[doc(alias = "gtk_widget_hide")]
897    fn hide(&self) {
898        unsafe {
899            ffi::gtk_widget_hide(self.as_ref().to_glib_none().0);
900        }
901    }
902
903    #[doc(alias = "gtk_widget_in_destruction")]
904    fn in_destruction(&self) -> bool {
905        unsafe {
906            from_glib(ffi::gtk_widget_in_destruction(
907                self.as_ref().to_glib_none().0,
908            ))
909        }
910    }
911
912    #[doc(alias = "gtk_widget_insert_action_group")]
913    fn insert_action_group(&self, name: &str, group: Option<&impl IsA<gio::ActionGroup>>) {
914        unsafe {
915            ffi::gtk_widget_insert_action_group(
916                self.as_ref().to_glib_none().0,
917                name.to_glib_none().0,
918                group.map(|p| p.as_ref()).to_glib_none().0,
919            );
920        }
921    }
922
923    #[doc(alias = "gtk_widget_insert_after")]
924    fn insert_after(&self, parent: &impl IsA<Widget>, previous_sibling: Option<&impl IsA<Widget>>) {
925        unsafe {
926            ffi::gtk_widget_insert_after(
927                self.as_ref().to_glib_none().0,
928                parent.as_ref().to_glib_none().0,
929                previous_sibling.map(|p| p.as_ref()).to_glib_none().0,
930            );
931        }
932    }
933
934    #[doc(alias = "gtk_widget_insert_before")]
935    fn insert_before(&self, parent: &impl IsA<Widget>, next_sibling: Option<&impl IsA<Widget>>) {
936        unsafe {
937            ffi::gtk_widget_insert_before(
938                self.as_ref().to_glib_none().0,
939                parent.as_ref().to_glib_none().0,
940                next_sibling.map(|p| p.as_ref()).to_glib_none().0,
941            );
942        }
943    }
944
945    #[doc(alias = "gtk_widget_is_ancestor")]
946    fn is_ancestor(&self, ancestor: &impl IsA<Widget>) -> bool {
947        unsafe {
948            from_glib(ffi::gtk_widget_is_ancestor(
949                self.as_ref().to_glib_none().0,
950                ancestor.as_ref().to_glib_none().0,
951            ))
952        }
953    }
954
955    #[doc(alias = "gtk_widget_is_drawable")]
956    fn is_drawable(&self) -> bool {
957        unsafe { from_glib(ffi::gtk_widget_is_drawable(self.as_ref().to_glib_none().0)) }
958    }
959
960    #[doc(alias = "gtk_widget_is_focus")]
961    fn is_focus(&self) -> bool {
962        unsafe { from_glib(ffi::gtk_widget_is_focus(self.as_ref().to_glib_none().0)) }
963    }
964
965    #[doc(alias = "gtk_widget_is_sensitive")]
966    #[doc(alias = "sensitive")]
967    fn is_sensitive(&self) -> bool {
968        unsafe { from_glib(ffi::gtk_widget_is_sensitive(self.as_ref().to_glib_none().0)) }
969    }
970
971    #[doc(alias = "gtk_widget_is_visible")]
972    #[doc(alias = "visible")]
973    fn is_visible(&self) -> bool {
974        unsafe { from_glib(ffi::gtk_widget_is_visible(self.as_ref().to_glib_none().0)) }
975    }
976
977    #[doc(alias = "gtk_widget_keynav_failed")]
978    fn keynav_failed(&self, direction: DirectionType) -> bool {
979        unsafe {
980            from_glib(ffi::gtk_widget_keynav_failed(
981                self.as_ref().to_glib_none().0,
982                direction.into_glib(),
983            ))
984        }
985    }
986
987    #[doc(alias = "gtk_widget_list_mnemonic_labels")]
988    fn list_mnemonic_labels(&self) -> Vec<Widget> {
989        unsafe {
990            FromGlibPtrContainer::from_glib_container(ffi::gtk_widget_list_mnemonic_labels(
991                self.as_ref().to_glib_none().0,
992            ))
993        }
994    }
995
996    #[doc(alias = "gtk_widget_map")]
997    fn map(&self) {
998        unsafe {
999            ffi::gtk_widget_map(self.as_ref().to_glib_none().0);
1000        }
1001    }
1002
1003    #[doc(alias = "gtk_widget_measure")]
1004    fn measure(&self, orientation: Orientation, for_size: i32) -> (i32, i32, i32, i32) {
1005        unsafe {
1006            let mut minimum = std::mem::MaybeUninit::uninit();
1007            let mut natural = std::mem::MaybeUninit::uninit();
1008            let mut minimum_baseline = std::mem::MaybeUninit::uninit();
1009            let mut natural_baseline = std::mem::MaybeUninit::uninit();
1010            ffi::gtk_widget_measure(
1011                self.as_ref().to_glib_none().0,
1012                orientation.into_glib(),
1013                for_size,
1014                minimum.as_mut_ptr(),
1015                natural.as_mut_ptr(),
1016                minimum_baseline.as_mut_ptr(),
1017                natural_baseline.as_mut_ptr(),
1018            );
1019            (
1020                minimum.assume_init(),
1021                natural.assume_init(),
1022                minimum_baseline.assume_init(),
1023                natural_baseline.assume_init(),
1024            )
1025        }
1026    }
1027
1028    #[doc(alias = "gtk_widget_mnemonic_activate")]
1029    fn mnemonic_activate(&self, group_cycling: bool) -> bool {
1030        unsafe {
1031            from_glib(ffi::gtk_widget_mnemonic_activate(
1032                self.as_ref().to_glib_none().0,
1033                group_cycling.into_glib(),
1034            ))
1035        }
1036    }
1037
1038    #[doc(alias = "gtk_widget_observe_children")]
1039    fn observe_children(&self) -> gio::ListModel {
1040        unsafe {
1041            from_glib_full(ffi::gtk_widget_observe_children(
1042                self.as_ref().to_glib_none().0,
1043            ))
1044        }
1045    }
1046
1047    #[doc(alias = "gtk_widget_observe_controllers")]
1048    fn observe_controllers(&self) -> gio::ListModel {
1049        unsafe {
1050            from_glib_full(ffi::gtk_widget_observe_controllers(
1051                self.as_ref().to_glib_none().0,
1052            ))
1053        }
1054    }
1055
1056    #[doc(alias = "gtk_widget_pick")]
1057    #[must_use]
1058    fn pick(&self, x: f64, y: f64, flags: PickFlags) -> Option<Widget> {
1059        unsafe {
1060            from_glib_none(ffi::gtk_widget_pick(
1061                self.as_ref().to_glib_none().0,
1062                x,
1063                y,
1064                flags.into_glib(),
1065            ))
1066        }
1067    }
1068
1069    #[doc(alias = "gtk_widget_queue_allocate")]
1070    fn queue_allocate(&self) {
1071        unsafe {
1072            ffi::gtk_widget_queue_allocate(self.as_ref().to_glib_none().0);
1073        }
1074    }
1075
1076    #[doc(alias = "gtk_widget_queue_draw")]
1077    fn queue_draw(&self) {
1078        unsafe {
1079            ffi::gtk_widget_queue_draw(self.as_ref().to_glib_none().0);
1080        }
1081    }
1082
1083    #[doc(alias = "gtk_widget_queue_resize")]
1084    fn queue_resize(&self) {
1085        unsafe {
1086            ffi::gtk_widget_queue_resize(self.as_ref().to_glib_none().0);
1087        }
1088    }
1089
1090    #[doc(alias = "gtk_widget_realize")]
1091    fn realize(&self) {
1092        unsafe {
1093            ffi::gtk_widget_realize(self.as_ref().to_glib_none().0);
1094        }
1095    }
1096
1097    #[doc(alias = "gtk_widget_remove_controller")]
1098    fn remove_controller(&self, controller: &impl IsA<EventController>) {
1099        unsafe {
1100            ffi::gtk_widget_remove_controller(
1101                self.as_ref().to_glib_none().0,
1102                controller.as_ref().to_glib_none().0,
1103            );
1104        }
1105    }
1106
1107    #[doc(alias = "gtk_widget_remove_css_class")]
1108    fn remove_css_class(&self, css_class: &str) {
1109        unsafe {
1110            ffi::gtk_widget_remove_css_class(
1111                self.as_ref().to_glib_none().0,
1112                css_class.to_glib_none().0,
1113            );
1114        }
1115    }
1116
1117    #[doc(alias = "gtk_widget_remove_mnemonic_label")]
1118    fn remove_mnemonic_label(&self, label: &impl IsA<Widget>) {
1119        unsafe {
1120            ffi::gtk_widget_remove_mnemonic_label(
1121                self.as_ref().to_glib_none().0,
1122                label.as_ref().to_glib_none().0,
1123            );
1124        }
1125    }
1126
1127    #[doc(alias = "gtk_widget_set_can_focus")]
1128    #[doc(alias = "can-focus")]
1129    fn set_can_focus(&self, can_focus: bool) {
1130        unsafe {
1131            ffi::gtk_widget_set_can_focus(self.as_ref().to_glib_none().0, can_focus.into_glib());
1132        }
1133    }
1134
1135    #[doc(alias = "gtk_widget_set_can_target")]
1136    #[doc(alias = "can-target")]
1137    fn set_can_target(&self, can_target: bool) {
1138        unsafe {
1139            ffi::gtk_widget_set_can_target(self.as_ref().to_glib_none().0, can_target.into_glib());
1140        }
1141    }
1142
1143    #[doc(alias = "gtk_widget_set_child_visible")]
1144    fn set_child_visible(&self, child_visible: bool) {
1145        unsafe {
1146            ffi::gtk_widget_set_child_visible(
1147                self.as_ref().to_glib_none().0,
1148                child_visible.into_glib(),
1149            );
1150        }
1151    }
1152
1153    #[doc(alias = "gtk_widget_set_css_classes")]
1154    #[doc(alias = "css-classes")]
1155    fn set_css_classes(&self, classes: &[&str]) {
1156        unsafe {
1157            ffi::gtk_widget_set_css_classes(
1158                self.as_ref().to_glib_none().0,
1159                classes.to_glib_none().0,
1160            );
1161        }
1162    }
1163
1164    #[doc(alias = "gtk_widget_set_cursor")]
1165    #[doc(alias = "cursor")]
1166    fn set_cursor(&self, cursor: Option<&gdk::Cursor>) {
1167        unsafe {
1168            ffi::gtk_widget_set_cursor(self.as_ref().to_glib_none().0, cursor.to_glib_none().0);
1169        }
1170    }
1171
1172    #[doc(alias = "gtk_widget_set_cursor_from_name")]
1173    fn set_cursor_from_name(&self, name: Option<&str>) {
1174        unsafe {
1175            ffi::gtk_widget_set_cursor_from_name(
1176                self.as_ref().to_glib_none().0,
1177                name.to_glib_none().0,
1178            );
1179        }
1180    }
1181
1182    #[doc(alias = "gtk_widget_set_direction")]
1183    fn set_direction(&self, dir: TextDirection) {
1184        unsafe {
1185            ffi::gtk_widget_set_direction(self.as_ref().to_glib_none().0, dir.into_glib());
1186        }
1187    }
1188
1189    #[doc(alias = "gtk_widget_set_focus_child")]
1190    fn set_focus_child(&self, child: Option<&impl IsA<Widget>>) {
1191        unsafe {
1192            ffi::gtk_widget_set_focus_child(
1193                self.as_ref().to_glib_none().0,
1194                child.map(|p| p.as_ref()).to_glib_none().0,
1195            );
1196        }
1197    }
1198
1199    #[doc(alias = "gtk_widget_set_focus_on_click")]
1200    #[doc(alias = "focus-on-click")]
1201    fn set_focus_on_click(&self, focus_on_click: bool) {
1202        unsafe {
1203            ffi::gtk_widget_set_focus_on_click(
1204                self.as_ref().to_glib_none().0,
1205                focus_on_click.into_glib(),
1206            );
1207        }
1208    }
1209
1210    #[doc(alias = "gtk_widget_set_focusable")]
1211    #[doc(alias = "focusable")]
1212    fn set_focusable(&self, focusable: bool) {
1213        unsafe {
1214            ffi::gtk_widget_set_focusable(self.as_ref().to_glib_none().0, focusable.into_glib());
1215        }
1216    }
1217
1218    #[doc(alias = "gtk_widget_set_font_map")]
1219    fn set_font_map(&self, font_map: Option<&impl IsA<pango::FontMap>>) {
1220        unsafe {
1221            ffi::gtk_widget_set_font_map(
1222                self.as_ref().to_glib_none().0,
1223                font_map.map(|p| p.as_ref()).to_glib_none().0,
1224            );
1225        }
1226    }
1227
1228    #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")]
1229    #[allow(deprecated)]
1230    #[doc(alias = "gtk_widget_set_font_options")]
1231    fn set_font_options(&self, options: Option<&cairo::FontOptions>) {
1232        unsafe {
1233            ffi::gtk_widget_set_font_options(
1234                self.as_ref().to_glib_none().0,
1235                options.to_glib_none().0,
1236            );
1237        }
1238    }
1239
1240    #[doc(alias = "gtk_widget_set_halign")]
1241    #[doc(alias = "halign")]
1242    fn set_halign(&self, align: Align) {
1243        unsafe {
1244            ffi::gtk_widget_set_halign(self.as_ref().to_glib_none().0, align.into_glib());
1245        }
1246    }
1247
1248    #[doc(alias = "gtk_widget_set_has_tooltip")]
1249    #[doc(alias = "has-tooltip")]
1250    fn set_has_tooltip(&self, has_tooltip: bool) {
1251        unsafe {
1252            ffi::gtk_widget_set_has_tooltip(
1253                self.as_ref().to_glib_none().0,
1254                has_tooltip.into_glib(),
1255            );
1256        }
1257    }
1258
1259    #[doc(alias = "gtk_widget_set_hexpand")]
1260    #[doc(alias = "hexpand")]
1261    fn set_hexpand(&self, expand: bool) {
1262        unsafe {
1263            ffi::gtk_widget_set_hexpand(self.as_ref().to_glib_none().0, expand.into_glib());
1264        }
1265    }
1266
1267    #[doc(alias = "gtk_widget_set_hexpand_set")]
1268    #[doc(alias = "hexpand-set")]
1269    fn set_hexpand_set(&self, set: bool) {
1270        unsafe {
1271            ffi::gtk_widget_set_hexpand_set(self.as_ref().to_glib_none().0, set.into_glib());
1272        }
1273    }
1274
1275    #[doc(alias = "gtk_widget_set_layout_manager")]
1276    #[doc(alias = "layout-manager")]
1277    fn set_layout_manager(&self, layout_manager: Option<impl IsA<LayoutManager>>) {
1278        unsafe {
1279            ffi::gtk_widget_set_layout_manager(
1280                self.as_ref().to_glib_none().0,
1281                layout_manager.map(|p| p.upcast()).into_glib_ptr(),
1282            );
1283        }
1284    }
1285
1286    #[cfg(feature = "v4_18")]
1287    #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
1288    #[doc(alias = "gtk_widget_set_limit_events")]
1289    #[doc(alias = "limit-events")]
1290    fn set_limit_events(&self, limit_events: bool) {
1291        unsafe {
1292            ffi::gtk_widget_set_limit_events(
1293                self.as_ref().to_glib_none().0,
1294                limit_events.into_glib(),
1295            );
1296        }
1297    }
1298
1299    #[doc(alias = "gtk_widget_set_margin_bottom")]
1300    #[doc(alias = "margin-bottom")]
1301    fn set_margin_bottom(&self, margin: i32) {
1302        unsafe {
1303            ffi::gtk_widget_set_margin_bottom(self.as_ref().to_glib_none().0, margin);
1304        }
1305    }
1306
1307    #[doc(alias = "gtk_widget_set_margin_end")]
1308    #[doc(alias = "margin-end")]
1309    fn set_margin_end(&self, margin: i32) {
1310        unsafe {
1311            ffi::gtk_widget_set_margin_end(self.as_ref().to_glib_none().0, margin);
1312        }
1313    }
1314
1315    #[doc(alias = "gtk_widget_set_margin_start")]
1316    #[doc(alias = "margin-start")]
1317    fn set_margin_start(&self, margin: i32) {
1318        unsafe {
1319            ffi::gtk_widget_set_margin_start(self.as_ref().to_glib_none().0, margin);
1320        }
1321    }
1322
1323    #[doc(alias = "gtk_widget_set_margin_top")]
1324    #[doc(alias = "margin-top")]
1325    fn set_margin_top(&self, margin: i32) {
1326        unsafe {
1327            ffi::gtk_widget_set_margin_top(self.as_ref().to_glib_none().0, margin);
1328        }
1329    }
1330
1331    #[doc(alias = "gtk_widget_set_name")]
1332    #[doc(alias = "set_name")]
1333    #[doc(alias = "name")]
1334    fn set_widget_name(&self, name: &str) {
1335        unsafe {
1336            ffi::gtk_widget_set_name(self.as_ref().to_glib_none().0, name.to_glib_none().0);
1337        }
1338    }
1339
1340    #[doc(alias = "gtk_widget_set_opacity")]
1341    #[doc(alias = "opacity")]
1342    fn set_opacity(&self, opacity: f64) {
1343        unsafe {
1344            ffi::gtk_widget_set_opacity(self.as_ref().to_glib_none().0, opacity);
1345        }
1346    }
1347
1348    #[doc(alias = "gtk_widget_set_overflow")]
1349    #[doc(alias = "overflow")]
1350    fn set_overflow(&self, overflow: Overflow) {
1351        unsafe {
1352            ffi::gtk_widget_set_overflow(self.as_ref().to_glib_none().0, overflow.into_glib());
1353        }
1354    }
1355
1356    #[doc(alias = "gtk_widget_set_parent")]
1357    fn set_parent(&self, parent: &impl IsA<Widget>) {
1358        unsafe {
1359            ffi::gtk_widget_set_parent(
1360                self.as_ref().to_glib_none().0,
1361                parent.as_ref().to_glib_none().0,
1362            );
1363        }
1364    }
1365
1366    #[doc(alias = "gtk_widget_set_receives_default")]
1367    #[doc(alias = "receives-default")]
1368    fn set_receives_default(&self, receives_default: bool) {
1369        unsafe {
1370            ffi::gtk_widget_set_receives_default(
1371                self.as_ref().to_glib_none().0,
1372                receives_default.into_glib(),
1373            );
1374        }
1375    }
1376
1377    #[doc(alias = "gtk_widget_set_sensitive")]
1378    #[doc(alias = "sensitive")]
1379    fn set_sensitive(&self, sensitive: bool) {
1380        unsafe {
1381            ffi::gtk_widget_set_sensitive(self.as_ref().to_glib_none().0, sensitive.into_glib());
1382        }
1383    }
1384
1385    #[doc(alias = "gtk_widget_set_size_request")]
1386    fn set_size_request(&self, width: i32, height: i32) {
1387        unsafe {
1388            ffi::gtk_widget_set_size_request(self.as_ref().to_glib_none().0, width, height);
1389        }
1390    }
1391
1392    #[doc(alias = "gtk_widget_set_state_flags")]
1393    fn set_state_flags(&self, flags: StateFlags, clear: bool) {
1394        unsafe {
1395            ffi::gtk_widget_set_state_flags(
1396                self.as_ref().to_glib_none().0,
1397                flags.into_glib(),
1398                clear.into_glib(),
1399            );
1400        }
1401    }
1402
1403    #[doc(alias = "gtk_widget_set_tooltip_markup")]
1404    #[doc(alias = "tooltip-markup")]
1405    fn set_tooltip_markup(&self, markup: Option<&str>) {
1406        unsafe {
1407            ffi::gtk_widget_set_tooltip_markup(
1408                self.as_ref().to_glib_none().0,
1409                markup.to_glib_none().0,
1410            );
1411        }
1412    }
1413
1414    #[doc(alias = "gtk_widget_set_tooltip_text")]
1415    #[doc(alias = "tooltip-text")]
1416    fn set_tooltip_text(&self, text: Option<&str>) {
1417        unsafe {
1418            ffi::gtk_widget_set_tooltip_text(self.as_ref().to_glib_none().0, text.to_glib_none().0);
1419        }
1420    }
1421
1422    #[doc(alias = "gtk_widget_set_valign")]
1423    #[doc(alias = "valign")]
1424    fn set_valign(&self, align: Align) {
1425        unsafe {
1426            ffi::gtk_widget_set_valign(self.as_ref().to_glib_none().0, align.into_glib());
1427        }
1428    }
1429
1430    #[doc(alias = "gtk_widget_set_vexpand")]
1431    #[doc(alias = "vexpand")]
1432    fn set_vexpand(&self, expand: bool) {
1433        unsafe {
1434            ffi::gtk_widget_set_vexpand(self.as_ref().to_glib_none().0, expand.into_glib());
1435        }
1436    }
1437
1438    #[doc(alias = "gtk_widget_set_vexpand_set")]
1439    #[doc(alias = "vexpand-set")]
1440    fn set_vexpand_set(&self, set: bool) {
1441        unsafe {
1442            ffi::gtk_widget_set_vexpand_set(self.as_ref().to_glib_none().0, set.into_glib());
1443        }
1444    }
1445
1446    #[doc(alias = "gtk_widget_set_visible")]
1447    #[doc(alias = "visible")]
1448    fn set_visible(&self, visible: bool) {
1449        unsafe {
1450            ffi::gtk_widget_set_visible(self.as_ref().to_glib_none().0, visible.into_glib());
1451        }
1452    }
1453
1454    #[doc(alias = "gtk_widget_should_layout")]
1455    fn should_layout(&self) -> bool {
1456        unsafe {
1457            from_glib(ffi::gtk_widget_should_layout(
1458                self.as_ref().to_glib_none().0,
1459            ))
1460        }
1461    }
1462
1463    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1464    #[allow(deprecated)]
1465    #[doc(alias = "gtk_widget_show")]
1466    fn show(&self) {
1467        unsafe {
1468            ffi::gtk_widget_show(self.as_ref().to_glib_none().0);
1469        }
1470    }
1471
1472    #[doc(alias = "gtk_widget_size_allocate")]
1473    fn size_allocate(&self, allocation: &Allocation, baseline: i32) {
1474        unsafe {
1475            ffi::gtk_widget_size_allocate(
1476                self.as_ref().to_glib_none().0,
1477                allocation.to_glib_none().0,
1478                baseline,
1479            );
1480        }
1481    }
1482
1483    #[doc(alias = "gtk_widget_snapshot_child")]
1484    fn snapshot_child(&self, child: &impl IsA<Widget>, snapshot: &impl IsA<Snapshot>) {
1485        unsafe {
1486            ffi::gtk_widget_snapshot_child(
1487                self.as_ref().to_glib_none().0,
1488                child.as_ref().to_glib_none().0,
1489                snapshot.as_ref().to_glib_none().0,
1490            );
1491        }
1492    }
1493
1494    #[cfg_attr(feature = "v4_12", deprecated = "Since 4.12")]
1495    #[allow(deprecated)]
1496    #[doc(alias = "gtk_widget_translate_coordinates")]
1497    fn translate_coordinates(
1498        &self,
1499        dest_widget: &impl IsA<Widget>,
1500        src_x: f64,
1501        src_y: f64,
1502    ) -> Option<(f64, f64)> {
1503        unsafe {
1504            let mut dest_x = std::mem::MaybeUninit::uninit();
1505            let mut dest_y = std::mem::MaybeUninit::uninit();
1506            let ret = from_glib(ffi::gtk_widget_translate_coordinates(
1507                self.as_ref().to_glib_none().0,
1508                dest_widget.as_ref().to_glib_none().0,
1509                src_x,
1510                src_y,
1511                dest_x.as_mut_ptr(),
1512                dest_y.as_mut_ptr(),
1513            ));
1514            if ret {
1515                Some((dest_x.assume_init(), dest_y.assume_init()))
1516            } else {
1517                None
1518            }
1519        }
1520    }
1521
1522    #[doc(alias = "gtk_widget_trigger_tooltip_query")]
1523    fn trigger_tooltip_query(&self) {
1524        unsafe {
1525            ffi::gtk_widget_trigger_tooltip_query(self.as_ref().to_glib_none().0);
1526        }
1527    }
1528
1529    #[doc(alias = "gtk_widget_unmap")]
1530    fn unmap(&self) {
1531        unsafe {
1532            ffi::gtk_widget_unmap(self.as_ref().to_glib_none().0);
1533        }
1534    }
1535
1536    #[doc(alias = "gtk_widget_unparent")]
1537    fn unparent(&self) {
1538        unsafe {
1539            ffi::gtk_widget_unparent(self.as_ref().to_glib_none().0);
1540        }
1541    }
1542
1543    #[doc(alias = "gtk_widget_unrealize")]
1544    fn unrealize(&self) {
1545        unsafe {
1546            ffi::gtk_widget_unrealize(self.as_ref().to_glib_none().0);
1547        }
1548    }
1549
1550    #[doc(alias = "gtk_widget_unset_state_flags")]
1551    fn unset_state_flags(&self, flags: StateFlags) {
1552        unsafe {
1553            ffi::gtk_widget_unset_state_flags(self.as_ref().to_glib_none().0, flags.into_glib());
1554        }
1555    }
1556
1557    #[doc(alias = "height-request")]
1558    fn height_request(&self) -> i32 {
1559        ObjectExt::property(self.as_ref(), "height-request")
1560    }
1561
1562    #[doc(alias = "height-request")]
1563    fn set_height_request(&self, height_request: i32) {
1564        ObjectExt::set_property(self.as_ref(), "height-request", height_request)
1565    }
1566
1567    #[doc(alias = "width-request")]
1568    fn width_request(&self) -> i32 {
1569        ObjectExt::property(self.as_ref(), "width-request")
1570    }
1571
1572    #[doc(alias = "width-request")]
1573    fn set_width_request(&self, width_request: i32) {
1574        ObjectExt::set_property(self.as_ref(), "width-request", width_request)
1575    }
1576
1577    #[doc(alias = "destroy")]
1578    fn connect_destroy<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1579        unsafe extern "C" fn destroy_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
1580            this: *mut ffi::GtkWidget,
1581            f: glib::ffi::gpointer,
1582        ) {
1583            let f: &F = &*(f as *const F);
1584            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
1585        }
1586        unsafe {
1587            let f: Box_<F> = Box_::new(f);
1588            connect_raw(
1589                self.as_ptr() as *mut _,
1590                b"destroy\0".as_ptr() as *const _,
1591                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1592                    destroy_trampoline::<Self, F> as *const (),
1593                )),
1594                Box_::into_raw(f),
1595            )
1596        }
1597    }
1598
1599    #[doc(alias = "direction-changed")]
1600    fn connect_direction_changed<F: Fn(&Self, TextDirection) + 'static>(
1601        &self,
1602        f: F,
1603    ) -> SignalHandlerId {
1604        unsafe extern "C" fn direction_changed_trampoline<
1605            P: IsA<Widget>,
1606            F: Fn(&P, TextDirection) + 'static,
1607        >(
1608            this: *mut ffi::GtkWidget,
1609            previous_direction: ffi::GtkTextDirection,
1610            f: glib::ffi::gpointer,
1611        ) {
1612            let f: &F = &*(f as *const F);
1613            f(
1614                Widget::from_glib_borrow(this).unsafe_cast_ref(),
1615                from_glib(previous_direction),
1616            )
1617        }
1618        unsafe {
1619            let f: Box_<F> = Box_::new(f);
1620            connect_raw(
1621                self.as_ptr() as *mut _,
1622                b"direction-changed\0".as_ptr() as *const _,
1623                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1624                    direction_changed_trampoline::<Self, F> as *const (),
1625                )),
1626                Box_::into_raw(f),
1627            )
1628        }
1629    }
1630
1631    #[doc(alias = "hide")]
1632    fn connect_hide<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1633        unsafe extern "C" fn hide_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
1634            this: *mut ffi::GtkWidget,
1635            f: glib::ffi::gpointer,
1636        ) {
1637            let f: &F = &*(f as *const F);
1638            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
1639        }
1640        unsafe {
1641            let f: Box_<F> = Box_::new(f);
1642            connect_raw(
1643                self.as_ptr() as *mut _,
1644                b"hide\0".as_ptr() as *const _,
1645                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1646                    hide_trampoline::<Self, F> as *const (),
1647                )),
1648                Box_::into_raw(f),
1649            )
1650        }
1651    }
1652
1653    #[doc(alias = "keynav-failed")]
1654    fn connect_keynav_failed<F: Fn(&Self, DirectionType) -> glib::Propagation + 'static>(
1655        &self,
1656        f: F,
1657    ) -> SignalHandlerId {
1658        unsafe extern "C" fn keynav_failed_trampoline<
1659            P: IsA<Widget>,
1660            F: Fn(&P, DirectionType) -> glib::Propagation + 'static,
1661        >(
1662            this: *mut ffi::GtkWidget,
1663            direction: ffi::GtkDirectionType,
1664            f: glib::ffi::gpointer,
1665        ) -> glib::ffi::gboolean {
1666            let f: &F = &*(f as *const F);
1667            f(
1668                Widget::from_glib_borrow(this).unsafe_cast_ref(),
1669                from_glib(direction),
1670            )
1671            .into_glib()
1672        }
1673        unsafe {
1674            let f: Box_<F> = Box_::new(f);
1675            connect_raw(
1676                self.as_ptr() as *mut _,
1677                b"keynav-failed\0".as_ptr() as *const _,
1678                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1679                    keynav_failed_trampoline::<Self, F> as *const (),
1680                )),
1681                Box_::into_raw(f),
1682            )
1683        }
1684    }
1685
1686    #[doc(alias = "map")]
1687    fn connect_map<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1688        unsafe extern "C" fn map_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
1689            this: *mut ffi::GtkWidget,
1690            f: glib::ffi::gpointer,
1691        ) {
1692            let f: &F = &*(f as *const F);
1693            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
1694        }
1695        unsafe {
1696            let f: Box_<F> = Box_::new(f);
1697            connect_raw(
1698                self.as_ptr() as *mut _,
1699                b"map\0".as_ptr() as *const _,
1700                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1701                    map_trampoline::<Self, F> as *const (),
1702                )),
1703                Box_::into_raw(f),
1704            )
1705        }
1706    }
1707
1708    #[doc(alias = "mnemonic-activate")]
1709    fn connect_mnemonic_activate<F: Fn(&Self, bool) -> glib::Propagation + 'static>(
1710        &self,
1711        f: F,
1712    ) -> SignalHandlerId {
1713        unsafe extern "C" fn mnemonic_activate_trampoline<
1714            P: IsA<Widget>,
1715            F: Fn(&P, bool) -> glib::Propagation + 'static,
1716        >(
1717            this: *mut ffi::GtkWidget,
1718            group_cycling: glib::ffi::gboolean,
1719            f: glib::ffi::gpointer,
1720        ) -> glib::ffi::gboolean {
1721            let f: &F = &*(f as *const F);
1722            f(
1723                Widget::from_glib_borrow(this).unsafe_cast_ref(),
1724                from_glib(group_cycling),
1725            )
1726            .into_glib()
1727        }
1728        unsafe {
1729            let f: Box_<F> = Box_::new(f);
1730            connect_raw(
1731                self.as_ptr() as *mut _,
1732                b"mnemonic-activate\0".as_ptr() as *const _,
1733                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1734                    mnemonic_activate_trampoline::<Self, F> as *const (),
1735                )),
1736                Box_::into_raw(f),
1737            )
1738        }
1739    }
1740
1741    #[doc(alias = "move-focus")]
1742    fn connect_move_focus<F: Fn(&Self, DirectionType) + 'static>(&self, f: F) -> SignalHandlerId {
1743        unsafe extern "C" fn move_focus_trampoline<
1744            P: IsA<Widget>,
1745            F: Fn(&P, DirectionType) + 'static,
1746        >(
1747            this: *mut ffi::GtkWidget,
1748            direction: ffi::GtkDirectionType,
1749            f: glib::ffi::gpointer,
1750        ) {
1751            let f: &F = &*(f as *const F);
1752            f(
1753                Widget::from_glib_borrow(this).unsafe_cast_ref(),
1754                from_glib(direction),
1755            )
1756        }
1757        unsafe {
1758            let f: Box_<F> = Box_::new(f);
1759            connect_raw(
1760                self.as_ptr() as *mut _,
1761                b"move-focus\0".as_ptr() as *const _,
1762                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1763                    move_focus_trampoline::<Self, F> as *const (),
1764                )),
1765                Box_::into_raw(f),
1766            )
1767        }
1768    }
1769
1770    fn emit_move_focus(&self, direction: DirectionType) {
1771        self.emit_by_name::<()>("move-focus", &[&direction]);
1772    }
1773
1774    #[doc(alias = "query-tooltip")]
1775    fn connect_query_tooltip<F: Fn(&Self, i32, i32, bool, &Tooltip) -> bool + 'static>(
1776        &self,
1777        f: F,
1778    ) -> SignalHandlerId {
1779        unsafe extern "C" fn query_tooltip_trampoline<
1780            P: IsA<Widget>,
1781            F: Fn(&P, i32, i32, bool, &Tooltip) -> bool + 'static,
1782        >(
1783            this: *mut ffi::GtkWidget,
1784            x: std::ffi::c_int,
1785            y: std::ffi::c_int,
1786            keyboard_mode: glib::ffi::gboolean,
1787            tooltip: *mut ffi::GtkTooltip,
1788            f: glib::ffi::gpointer,
1789        ) -> glib::ffi::gboolean {
1790            let f: &F = &*(f as *const F);
1791            f(
1792                Widget::from_glib_borrow(this).unsafe_cast_ref(),
1793                x,
1794                y,
1795                from_glib(keyboard_mode),
1796                &from_glib_borrow(tooltip),
1797            )
1798            .into_glib()
1799        }
1800        unsafe {
1801            let f: Box_<F> = Box_::new(f);
1802            connect_raw(
1803                self.as_ptr() as *mut _,
1804                b"query-tooltip\0".as_ptr() as *const _,
1805                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1806                    query_tooltip_trampoline::<Self, F> as *const (),
1807                )),
1808                Box_::into_raw(f),
1809            )
1810        }
1811    }
1812
1813    #[doc(alias = "realize")]
1814    fn connect_realize<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1815        unsafe extern "C" fn realize_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
1816            this: *mut ffi::GtkWidget,
1817            f: glib::ffi::gpointer,
1818        ) {
1819            let f: &F = &*(f as *const F);
1820            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
1821        }
1822        unsafe {
1823            let f: Box_<F> = Box_::new(f);
1824            connect_raw(
1825                self.as_ptr() as *mut _,
1826                b"realize\0".as_ptr() as *const _,
1827                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1828                    realize_trampoline::<Self, F> as *const (),
1829                )),
1830                Box_::into_raw(f),
1831            )
1832        }
1833    }
1834
1835    #[doc(alias = "show")]
1836    fn connect_show<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1837        unsafe extern "C" fn show_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
1838            this: *mut ffi::GtkWidget,
1839            f: glib::ffi::gpointer,
1840        ) {
1841            let f: &F = &*(f as *const F);
1842            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
1843        }
1844        unsafe {
1845            let f: Box_<F> = Box_::new(f);
1846            connect_raw(
1847                self.as_ptr() as *mut _,
1848                b"show\0".as_ptr() as *const _,
1849                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1850                    show_trampoline::<Self, F> as *const (),
1851                )),
1852                Box_::into_raw(f),
1853            )
1854        }
1855    }
1856
1857    #[doc(alias = "state-flags-changed")]
1858    fn connect_state_flags_changed<F: Fn(&Self, StateFlags) + 'static>(
1859        &self,
1860        f: F,
1861    ) -> SignalHandlerId {
1862        unsafe extern "C" fn state_flags_changed_trampoline<
1863            P: IsA<Widget>,
1864            F: Fn(&P, StateFlags) + 'static,
1865        >(
1866            this: *mut ffi::GtkWidget,
1867            flags: ffi::GtkStateFlags,
1868            f: glib::ffi::gpointer,
1869        ) {
1870            let f: &F = &*(f as *const F);
1871            f(
1872                Widget::from_glib_borrow(this).unsafe_cast_ref(),
1873                from_glib(flags),
1874            )
1875        }
1876        unsafe {
1877            let f: Box_<F> = Box_::new(f);
1878            connect_raw(
1879                self.as_ptr() as *mut _,
1880                b"state-flags-changed\0".as_ptr() as *const _,
1881                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1882                    state_flags_changed_trampoline::<Self, F> as *const (),
1883                )),
1884                Box_::into_raw(f),
1885            )
1886        }
1887    }
1888
1889    #[doc(alias = "unmap")]
1890    fn connect_unmap<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1891        unsafe extern "C" fn unmap_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
1892            this: *mut ffi::GtkWidget,
1893            f: glib::ffi::gpointer,
1894        ) {
1895            let f: &F = &*(f as *const F);
1896            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
1897        }
1898        unsafe {
1899            let f: Box_<F> = Box_::new(f);
1900            connect_raw(
1901                self.as_ptr() as *mut _,
1902                b"unmap\0".as_ptr() as *const _,
1903                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1904                    unmap_trampoline::<Self, F> as *const (),
1905                )),
1906                Box_::into_raw(f),
1907            )
1908        }
1909    }
1910
1911    #[doc(alias = "unrealize")]
1912    fn connect_unrealize<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1913        unsafe extern "C" fn unrealize_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
1914            this: *mut ffi::GtkWidget,
1915            f: glib::ffi::gpointer,
1916        ) {
1917            let f: &F = &*(f as *const F);
1918            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
1919        }
1920        unsafe {
1921            let f: Box_<F> = Box_::new(f);
1922            connect_raw(
1923                self.as_ptr() as *mut _,
1924                b"unrealize\0".as_ptr() as *const _,
1925                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1926                    unrealize_trampoline::<Self, F> as *const (),
1927                )),
1928                Box_::into_raw(f),
1929            )
1930        }
1931    }
1932
1933    #[doc(alias = "can-focus")]
1934    fn connect_can_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1935        unsafe extern "C" fn notify_can_focus_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
1936            this: *mut ffi::GtkWidget,
1937            _param_spec: glib::ffi::gpointer,
1938            f: glib::ffi::gpointer,
1939        ) {
1940            let f: &F = &*(f as *const F);
1941            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
1942        }
1943        unsafe {
1944            let f: Box_<F> = Box_::new(f);
1945            connect_raw(
1946                self.as_ptr() as *mut _,
1947                b"notify::can-focus\0".as_ptr() as *const _,
1948                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1949                    notify_can_focus_trampoline::<Self, F> as *const (),
1950                )),
1951                Box_::into_raw(f),
1952            )
1953        }
1954    }
1955
1956    #[doc(alias = "can-target")]
1957    fn connect_can_target_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1958        unsafe extern "C" fn notify_can_target_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
1959            this: *mut ffi::GtkWidget,
1960            _param_spec: glib::ffi::gpointer,
1961            f: glib::ffi::gpointer,
1962        ) {
1963            let f: &F = &*(f as *const F);
1964            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
1965        }
1966        unsafe {
1967            let f: Box_<F> = Box_::new(f);
1968            connect_raw(
1969                self.as_ptr() as *mut _,
1970                b"notify::can-target\0".as_ptr() as *const _,
1971                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1972                    notify_can_target_trampoline::<Self, F> as *const (),
1973                )),
1974                Box_::into_raw(f),
1975            )
1976        }
1977    }
1978
1979    #[doc(alias = "css-classes")]
1980    fn connect_css_classes_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1981        unsafe extern "C" fn notify_css_classes_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
1982            this: *mut ffi::GtkWidget,
1983            _param_spec: glib::ffi::gpointer,
1984            f: glib::ffi::gpointer,
1985        ) {
1986            let f: &F = &*(f as *const F);
1987            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
1988        }
1989        unsafe {
1990            let f: Box_<F> = Box_::new(f);
1991            connect_raw(
1992                self.as_ptr() as *mut _,
1993                b"notify::css-classes\0".as_ptr() as *const _,
1994                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1995                    notify_css_classes_trampoline::<Self, F> as *const (),
1996                )),
1997                Box_::into_raw(f),
1998            )
1999        }
2000    }
2001
2002    #[doc(alias = "cursor")]
2003    fn connect_cursor_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2004        unsafe extern "C" fn notify_cursor_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2005            this: *mut ffi::GtkWidget,
2006            _param_spec: glib::ffi::gpointer,
2007            f: glib::ffi::gpointer,
2008        ) {
2009            let f: &F = &*(f as *const F);
2010            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2011        }
2012        unsafe {
2013            let f: Box_<F> = Box_::new(f);
2014            connect_raw(
2015                self.as_ptr() as *mut _,
2016                b"notify::cursor\0".as_ptr() as *const _,
2017                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2018                    notify_cursor_trampoline::<Self, F> as *const (),
2019                )),
2020                Box_::into_raw(f),
2021            )
2022        }
2023    }
2024
2025    #[doc(alias = "focus-on-click")]
2026    fn connect_focus_on_click_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2027        unsafe extern "C" fn notify_focus_on_click_trampoline<
2028            P: IsA<Widget>,
2029            F: Fn(&P) + 'static,
2030        >(
2031            this: *mut ffi::GtkWidget,
2032            _param_spec: glib::ffi::gpointer,
2033            f: glib::ffi::gpointer,
2034        ) {
2035            let f: &F = &*(f as *const F);
2036            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2037        }
2038        unsafe {
2039            let f: Box_<F> = Box_::new(f);
2040            connect_raw(
2041                self.as_ptr() as *mut _,
2042                b"notify::focus-on-click\0".as_ptr() as *const _,
2043                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2044                    notify_focus_on_click_trampoline::<Self, F> as *const (),
2045                )),
2046                Box_::into_raw(f),
2047            )
2048        }
2049    }
2050
2051    #[doc(alias = "focusable")]
2052    fn connect_focusable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2053        unsafe extern "C" fn notify_focusable_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2054            this: *mut ffi::GtkWidget,
2055            _param_spec: glib::ffi::gpointer,
2056            f: glib::ffi::gpointer,
2057        ) {
2058            let f: &F = &*(f as *const F);
2059            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2060        }
2061        unsafe {
2062            let f: Box_<F> = Box_::new(f);
2063            connect_raw(
2064                self.as_ptr() as *mut _,
2065                b"notify::focusable\0".as_ptr() as *const _,
2066                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2067                    notify_focusable_trampoline::<Self, F> as *const (),
2068                )),
2069                Box_::into_raw(f),
2070            )
2071        }
2072    }
2073
2074    #[doc(alias = "halign")]
2075    fn connect_halign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2076        unsafe extern "C" fn notify_halign_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2077            this: *mut ffi::GtkWidget,
2078            _param_spec: glib::ffi::gpointer,
2079            f: glib::ffi::gpointer,
2080        ) {
2081            let f: &F = &*(f as *const F);
2082            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2083        }
2084        unsafe {
2085            let f: Box_<F> = Box_::new(f);
2086            connect_raw(
2087                self.as_ptr() as *mut _,
2088                b"notify::halign\0".as_ptr() as *const _,
2089                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2090                    notify_halign_trampoline::<Self, F> as *const (),
2091                )),
2092                Box_::into_raw(f),
2093            )
2094        }
2095    }
2096
2097    #[doc(alias = "has-default")]
2098    fn connect_has_default_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2099        unsafe extern "C" fn notify_has_default_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2100            this: *mut ffi::GtkWidget,
2101            _param_spec: glib::ffi::gpointer,
2102            f: glib::ffi::gpointer,
2103        ) {
2104            let f: &F = &*(f as *const F);
2105            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2106        }
2107        unsafe {
2108            let f: Box_<F> = Box_::new(f);
2109            connect_raw(
2110                self.as_ptr() as *mut _,
2111                b"notify::has-default\0".as_ptr() as *const _,
2112                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2113                    notify_has_default_trampoline::<Self, F> as *const (),
2114                )),
2115                Box_::into_raw(f),
2116            )
2117        }
2118    }
2119
2120    #[doc(alias = "has-focus")]
2121    fn connect_has_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2122        unsafe extern "C" fn notify_has_focus_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2123            this: *mut ffi::GtkWidget,
2124            _param_spec: glib::ffi::gpointer,
2125            f: glib::ffi::gpointer,
2126        ) {
2127            let f: &F = &*(f as *const F);
2128            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2129        }
2130        unsafe {
2131            let f: Box_<F> = Box_::new(f);
2132            connect_raw(
2133                self.as_ptr() as *mut _,
2134                b"notify::has-focus\0".as_ptr() as *const _,
2135                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2136                    notify_has_focus_trampoline::<Self, F> as *const (),
2137                )),
2138                Box_::into_raw(f),
2139            )
2140        }
2141    }
2142
2143    #[doc(alias = "has-tooltip")]
2144    fn connect_has_tooltip_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2145        unsafe extern "C" fn notify_has_tooltip_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2146            this: *mut ffi::GtkWidget,
2147            _param_spec: glib::ffi::gpointer,
2148            f: glib::ffi::gpointer,
2149        ) {
2150            let f: &F = &*(f as *const F);
2151            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2152        }
2153        unsafe {
2154            let f: Box_<F> = Box_::new(f);
2155            connect_raw(
2156                self.as_ptr() as *mut _,
2157                b"notify::has-tooltip\0".as_ptr() as *const _,
2158                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2159                    notify_has_tooltip_trampoline::<Self, F> as *const (),
2160                )),
2161                Box_::into_raw(f),
2162            )
2163        }
2164    }
2165
2166    #[doc(alias = "height-request")]
2167    fn connect_height_request_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2168        unsafe extern "C" fn notify_height_request_trampoline<
2169            P: IsA<Widget>,
2170            F: Fn(&P) + 'static,
2171        >(
2172            this: *mut ffi::GtkWidget,
2173            _param_spec: glib::ffi::gpointer,
2174            f: glib::ffi::gpointer,
2175        ) {
2176            let f: &F = &*(f as *const F);
2177            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2178        }
2179        unsafe {
2180            let f: Box_<F> = Box_::new(f);
2181            connect_raw(
2182                self.as_ptr() as *mut _,
2183                b"notify::height-request\0".as_ptr() as *const _,
2184                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2185                    notify_height_request_trampoline::<Self, F> as *const (),
2186                )),
2187                Box_::into_raw(f),
2188            )
2189        }
2190    }
2191
2192    #[doc(alias = "hexpand")]
2193    fn connect_hexpand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2194        unsafe extern "C" fn notify_hexpand_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2195            this: *mut ffi::GtkWidget,
2196            _param_spec: glib::ffi::gpointer,
2197            f: glib::ffi::gpointer,
2198        ) {
2199            let f: &F = &*(f as *const F);
2200            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2201        }
2202        unsafe {
2203            let f: Box_<F> = Box_::new(f);
2204            connect_raw(
2205                self.as_ptr() as *mut _,
2206                b"notify::hexpand\0".as_ptr() as *const _,
2207                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2208                    notify_hexpand_trampoline::<Self, F> as *const (),
2209                )),
2210                Box_::into_raw(f),
2211            )
2212        }
2213    }
2214
2215    #[doc(alias = "hexpand-set")]
2216    fn connect_hexpand_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2217        unsafe extern "C" fn notify_hexpand_set_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2218            this: *mut ffi::GtkWidget,
2219            _param_spec: glib::ffi::gpointer,
2220            f: glib::ffi::gpointer,
2221        ) {
2222            let f: &F = &*(f as *const F);
2223            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2224        }
2225        unsafe {
2226            let f: Box_<F> = Box_::new(f);
2227            connect_raw(
2228                self.as_ptr() as *mut _,
2229                b"notify::hexpand-set\0".as_ptr() as *const _,
2230                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2231                    notify_hexpand_set_trampoline::<Self, F> as *const (),
2232                )),
2233                Box_::into_raw(f),
2234            )
2235        }
2236    }
2237
2238    #[doc(alias = "layout-manager")]
2239    fn connect_layout_manager_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2240        unsafe extern "C" fn notify_layout_manager_trampoline<
2241            P: IsA<Widget>,
2242            F: Fn(&P) + 'static,
2243        >(
2244            this: *mut ffi::GtkWidget,
2245            _param_spec: glib::ffi::gpointer,
2246            f: glib::ffi::gpointer,
2247        ) {
2248            let f: &F = &*(f as *const F);
2249            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2250        }
2251        unsafe {
2252            let f: Box_<F> = Box_::new(f);
2253            connect_raw(
2254                self.as_ptr() as *mut _,
2255                b"notify::layout-manager\0".as_ptr() as *const _,
2256                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2257                    notify_layout_manager_trampoline::<Self, F> as *const (),
2258                )),
2259                Box_::into_raw(f),
2260            )
2261        }
2262    }
2263
2264    #[cfg(feature = "v4_18")]
2265    #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
2266    #[doc(alias = "limit-events")]
2267    fn connect_limit_events_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2268        unsafe extern "C" fn notify_limit_events_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2269            this: *mut ffi::GtkWidget,
2270            _param_spec: glib::ffi::gpointer,
2271            f: glib::ffi::gpointer,
2272        ) {
2273            let f: &F = &*(f as *const F);
2274            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2275        }
2276        unsafe {
2277            let f: Box_<F> = Box_::new(f);
2278            connect_raw(
2279                self.as_ptr() as *mut _,
2280                b"notify::limit-events\0".as_ptr() as *const _,
2281                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2282                    notify_limit_events_trampoline::<Self, F> as *const (),
2283                )),
2284                Box_::into_raw(f),
2285            )
2286        }
2287    }
2288
2289    #[doc(alias = "margin-bottom")]
2290    fn connect_margin_bottom_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2291        unsafe extern "C" fn notify_margin_bottom_trampoline<
2292            P: IsA<Widget>,
2293            F: Fn(&P) + 'static,
2294        >(
2295            this: *mut ffi::GtkWidget,
2296            _param_spec: glib::ffi::gpointer,
2297            f: glib::ffi::gpointer,
2298        ) {
2299            let f: &F = &*(f as *const F);
2300            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2301        }
2302        unsafe {
2303            let f: Box_<F> = Box_::new(f);
2304            connect_raw(
2305                self.as_ptr() as *mut _,
2306                b"notify::margin-bottom\0".as_ptr() as *const _,
2307                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2308                    notify_margin_bottom_trampoline::<Self, F> as *const (),
2309                )),
2310                Box_::into_raw(f),
2311            )
2312        }
2313    }
2314
2315    #[doc(alias = "margin-end")]
2316    fn connect_margin_end_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2317        unsafe extern "C" fn notify_margin_end_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2318            this: *mut ffi::GtkWidget,
2319            _param_spec: glib::ffi::gpointer,
2320            f: glib::ffi::gpointer,
2321        ) {
2322            let f: &F = &*(f as *const F);
2323            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2324        }
2325        unsafe {
2326            let f: Box_<F> = Box_::new(f);
2327            connect_raw(
2328                self.as_ptr() as *mut _,
2329                b"notify::margin-end\0".as_ptr() as *const _,
2330                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2331                    notify_margin_end_trampoline::<Self, F> as *const (),
2332                )),
2333                Box_::into_raw(f),
2334            )
2335        }
2336    }
2337
2338    #[doc(alias = "margin-start")]
2339    fn connect_margin_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2340        unsafe extern "C" fn notify_margin_start_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2341            this: *mut ffi::GtkWidget,
2342            _param_spec: glib::ffi::gpointer,
2343            f: glib::ffi::gpointer,
2344        ) {
2345            let f: &F = &*(f as *const F);
2346            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2347        }
2348        unsafe {
2349            let f: Box_<F> = Box_::new(f);
2350            connect_raw(
2351                self.as_ptr() as *mut _,
2352                b"notify::margin-start\0".as_ptr() as *const _,
2353                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2354                    notify_margin_start_trampoline::<Self, F> as *const (),
2355                )),
2356                Box_::into_raw(f),
2357            )
2358        }
2359    }
2360
2361    #[doc(alias = "margin-top")]
2362    fn connect_margin_top_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2363        unsafe extern "C" fn notify_margin_top_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2364            this: *mut ffi::GtkWidget,
2365            _param_spec: glib::ffi::gpointer,
2366            f: glib::ffi::gpointer,
2367        ) {
2368            let f: &F = &*(f as *const F);
2369            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2370        }
2371        unsafe {
2372            let f: Box_<F> = Box_::new(f);
2373            connect_raw(
2374                self.as_ptr() as *mut _,
2375                b"notify::margin-top\0".as_ptr() as *const _,
2376                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2377                    notify_margin_top_trampoline::<Self, F> as *const (),
2378                )),
2379                Box_::into_raw(f),
2380            )
2381        }
2382    }
2383
2384    #[doc(alias = "name")]
2385    fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2386        unsafe extern "C" fn notify_name_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2387            this: *mut ffi::GtkWidget,
2388            _param_spec: glib::ffi::gpointer,
2389            f: glib::ffi::gpointer,
2390        ) {
2391            let f: &F = &*(f as *const F);
2392            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2393        }
2394        unsafe {
2395            let f: Box_<F> = Box_::new(f);
2396            connect_raw(
2397                self.as_ptr() as *mut _,
2398                b"notify::name\0".as_ptr() as *const _,
2399                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2400                    notify_name_trampoline::<Self, F> as *const (),
2401                )),
2402                Box_::into_raw(f),
2403            )
2404        }
2405    }
2406
2407    #[doc(alias = "opacity")]
2408    fn connect_opacity_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2409        unsafe extern "C" fn notify_opacity_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2410            this: *mut ffi::GtkWidget,
2411            _param_spec: glib::ffi::gpointer,
2412            f: glib::ffi::gpointer,
2413        ) {
2414            let f: &F = &*(f as *const F);
2415            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2416        }
2417        unsafe {
2418            let f: Box_<F> = Box_::new(f);
2419            connect_raw(
2420                self.as_ptr() as *mut _,
2421                b"notify::opacity\0".as_ptr() as *const _,
2422                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2423                    notify_opacity_trampoline::<Self, F> as *const (),
2424                )),
2425                Box_::into_raw(f),
2426            )
2427        }
2428    }
2429
2430    #[doc(alias = "overflow")]
2431    fn connect_overflow_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2432        unsafe extern "C" fn notify_overflow_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2433            this: *mut ffi::GtkWidget,
2434            _param_spec: glib::ffi::gpointer,
2435            f: glib::ffi::gpointer,
2436        ) {
2437            let f: &F = &*(f as *const F);
2438            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2439        }
2440        unsafe {
2441            let f: Box_<F> = Box_::new(f);
2442            connect_raw(
2443                self.as_ptr() as *mut _,
2444                b"notify::overflow\0".as_ptr() as *const _,
2445                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2446                    notify_overflow_trampoline::<Self, F> as *const (),
2447                )),
2448                Box_::into_raw(f),
2449            )
2450        }
2451    }
2452
2453    #[doc(alias = "parent")]
2454    fn connect_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2455        unsafe extern "C" fn notify_parent_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2456            this: *mut ffi::GtkWidget,
2457            _param_spec: glib::ffi::gpointer,
2458            f: glib::ffi::gpointer,
2459        ) {
2460            let f: &F = &*(f as *const F);
2461            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2462        }
2463        unsafe {
2464            let f: Box_<F> = Box_::new(f);
2465            connect_raw(
2466                self.as_ptr() as *mut _,
2467                b"notify::parent\0".as_ptr() as *const _,
2468                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2469                    notify_parent_trampoline::<Self, F> as *const (),
2470                )),
2471                Box_::into_raw(f),
2472            )
2473        }
2474    }
2475
2476    #[doc(alias = "receives-default")]
2477    fn connect_receives_default_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2478        unsafe extern "C" fn notify_receives_default_trampoline<
2479            P: IsA<Widget>,
2480            F: Fn(&P) + 'static,
2481        >(
2482            this: *mut ffi::GtkWidget,
2483            _param_spec: glib::ffi::gpointer,
2484            f: glib::ffi::gpointer,
2485        ) {
2486            let f: &F = &*(f as *const F);
2487            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2488        }
2489        unsafe {
2490            let f: Box_<F> = Box_::new(f);
2491            connect_raw(
2492                self.as_ptr() as *mut _,
2493                b"notify::receives-default\0".as_ptr() as *const _,
2494                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2495                    notify_receives_default_trampoline::<Self, F> as *const (),
2496                )),
2497                Box_::into_raw(f),
2498            )
2499        }
2500    }
2501
2502    #[doc(alias = "root")]
2503    fn connect_root_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2504        unsafe extern "C" fn notify_root_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2505            this: *mut ffi::GtkWidget,
2506            _param_spec: glib::ffi::gpointer,
2507            f: glib::ffi::gpointer,
2508        ) {
2509            let f: &F = &*(f as *const F);
2510            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2511        }
2512        unsafe {
2513            let f: Box_<F> = Box_::new(f);
2514            connect_raw(
2515                self.as_ptr() as *mut _,
2516                b"notify::root\0".as_ptr() as *const _,
2517                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2518                    notify_root_trampoline::<Self, F> as *const (),
2519                )),
2520                Box_::into_raw(f),
2521            )
2522        }
2523    }
2524
2525    #[doc(alias = "scale-factor")]
2526    fn connect_scale_factor_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2527        unsafe extern "C" fn notify_scale_factor_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2528            this: *mut ffi::GtkWidget,
2529            _param_spec: glib::ffi::gpointer,
2530            f: glib::ffi::gpointer,
2531        ) {
2532            let f: &F = &*(f as *const F);
2533            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2534        }
2535        unsafe {
2536            let f: Box_<F> = Box_::new(f);
2537            connect_raw(
2538                self.as_ptr() as *mut _,
2539                b"notify::scale-factor\0".as_ptr() as *const _,
2540                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2541                    notify_scale_factor_trampoline::<Self, F> as *const (),
2542                )),
2543                Box_::into_raw(f),
2544            )
2545        }
2546    }
2547
2548    #[doc(alias = "sensitive")]
2549    fn connect_sensitive_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2550        unsafe extern "C" fn notify_sensitive_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2551            this: *mut ffi::GtkWidget,
2552            _param_spec: glib::ffi::gpointer,
2553            f: glib::ffi::gpointer,
2554        ) {
2555            let f: &F = &*(f as *const F);
2556            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2557        }
2558        unsafe {
2559            let f: Box_<F> = Box_::new(f);
2560            connect_raw(
2561                self.as_ptr() as *mut _,
2562                b"notify::sensitive\0".as_ptr() as *const _,
2563                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2564                    notify_sensitive_trampoline::<Self, F> as *const (),
2565                )),
2566                Box_::into_raw(f),
2567            )
2568        }
2569    }
2570
2571    #[doc(alias = "tooltip-markup")]
2572    fn connect_tooltip_markup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2573        unsafe extern "C" fn notify_tooltip_markup_trampoline<
2574            P: IsA<Widget>,
2575            F: Fn(&P) + 'static,
2576        >(
2577            this: *mut ffi::GtkWidget,
2578            _param_spec: glib::ffi::gpointer,
2579            f: glib::ffi::gpointer,
2580        ) {
2581            let f: &F = &*(f as *const F);
2582            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2583        }
2584        unsafe {
2585            let f: Box_<F> = Box_::new(f);
2586            connect_raw(
2587                self.as_ptr() as *mut _,
2588                b"notify::tooltip-markup\0".as_ptr() as *const _,
2589                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2590                    notify_tooltip_markup_trampoline::<Self, F> as *const (),
2591                )),
2592                Box_::into_raw(f),
2593            )
2594        }
2595    }
2596
2597    #[doc(alias = "tooltip-text")]
2598    fn connect_tooltip_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2599        unsafe extern "C" fn notify_tooltip_text_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2600            this: *mut ffi::GtkWidget,
2601            _param_spec: glib::ffi::gpointer,
2602            f: glib::ffi::gpointer,
2603        ) {
2604            let f: &F = &*(f as *const F);
2605            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2606        }
2607        unsafe {
2608            let f: Box_<F> = Box_::new(f);
2609            connect_raw(
2610                self.as_ptr() as *mut _,
2611                b"notify::tooltip-text\0".as_ptr() as *const _,
2612                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2613                    notify_tooltip_text_trampoline::<Self, F> as *const (),
2614                )),
2615                Box_::into_raw(f),
2616            )
2617        }
2618    }
2619
2620    #[doc(alias = "valign")]
2621    fn connect_valign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2622        unsafe extern "C" fn notify_valign_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2623            this: *mut ffi::GtkWidget,
2624            _param_spec: glib::ffi::gpointer,
2625            f: glib::ffi::gpointer,
2626        ) {
2627            let f: &F = &*(f as *const F);
2628            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2629        }
2630        unsafe {
2631            let f: Box_<F> = Box_::new(f);
2632            connect_raw(
2633                self.as_ptr() as *mut _,
2634                b"notify::valign\0".as_ptr() as *const _,
2635                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2636                    notify_valign_trampoline::<Self, F> as *const (),
2637                )),
2638                Box_::into_raw(f),
2639            )
2640        }
2641    }
2642
2643    #[doc(alias = "vexpand")]
2644    fn connect_vexpand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2645        unsafe extern "C" fn notify_vexpand_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2646            this: *mut ffi::GtkWidget,
2647            _param_spec: glib::ffi::gpointer,
2648            f: glib::ffi::gpointer,
2649        ) {
2650            let f: &F = &*(f as *const F);
2651            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2652        }
2653        unsafe {
2654            let f: Box_<F> = Box_::new(f);
2655            connect_raw(
2656                self.as_ptr() as *mut _,
2657                b"notify::vexpand\0".as_ptr() as *const _,
2658                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2659                    notify_vexpand_trampoline::<Self, F> as *const (),
2660                )),
2661                Box_::into_raw(f),
2662            )
2663        }
2664    }
2665
2666    #[doc(alias = "vexpand-set")]
2667    fn connect_vexpand_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2668        unsafe extern "C" fn notify_vexpand_set_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2669            this: *mut ffi::GtkWidget,
2670            _param_spec: glib::ffi::gpointer,
2671            f: glib::ffi::gpointer,
2672        ) {
2673            let f: &F = &*(f as *const F);
2674            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2675        }
2676        unsafe {
2677            let f: Box_<F> = Box_::new(f);
2678            connect_raw(
2679                self.as_ptr() as *mut _,
2680                b"notify::vexpand-set\0".as_ptr() as *const _,
2681                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2682                    notify_vexpand_set_trampoline::<Self, F> as *const (),
2683                )),
2684                Box_::into_raw(f),
2685            )
2686        }
2687    }
2688
2689    #[doc(alias = "visible")]
2690    fn connect_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2691        unsafe extern "C" fn notify_visible_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2692            this: *mut ffi::GtkWidget,
2693            _param_spec: glib::ffi::gpointer,
2694            f: glib::ffi::gpointer,
2695        ) {
2696            let f: &F = &*(f as *const F);
2697            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2698        }
2699        unsafe {
2700            let f: Box_<F> = Box_::new(f);
2701            connect_raw(
2702                self.as_ptr() as *mut _,
2703                b"notify::visible\0".as_ptr() as *const _,
2704                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2705                    notify_visible_trampoline::<Self, F> as *const (),
2706                )),
2707                Box_::into_raw(f),
2708            )
2709        }
2710    }
2711
2712    #[doc(alias = "width-request")]
2713    fn connect_width_request_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2714        unsafe extern "C" fn notify_width_request_trampoline<
2715            P: IsA<Widget>,
2716            F: Fn(&P) + 'static,
2717        >(
2718            this: *mut ffi::GtkWidget,
2719            _param_spec: glib::ffi::gpointer,
2720            f: glib::ffi::gpointer,
2721        ) {
2722            let f: &F = &*(f as *const F);
2723            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2724        }
2725        unsafe {
2726            let f: Box_<F> = Box_::new(f);
2727            connect_raw(
2728                self.as_ptr() as *mut _,
2729                b"notify::width-request\0".as_ptr() as *const _,
2730                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2731                    notify_width_request_trampoline::<Self, F> as *const (),
2732                )),
2733                Box_::into_raw(f),
2734            )
2735        }
2736    }
2737}
2738
2739impl<O: IsA<Widget>> WidgetExt for O {}