Skip to main content

gtk/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
5use crate::{
6    AccelFlags, AccelGroup, Align, Allocation, Buildable, Clipboard, DirectionType, DragResult,
7    Orientation, Requisition, SelectionData, Settings, SizeRequestMode, StateFlags, StyleContext,
8    TargetList, TextDirection, Tooltip, WidgetHelpType, WidgetPath, Window, ffi,
9};
10use glib::{
11    object::ObjectType as _,
12    prelude::*,
13    signal::{SignalHandlerId, connect_raw},
14    translate::*,
15};
16use std::boxed::Box as Box_;
17
18glib::wrapper! {
19    #[doc(alias = "GtkWidget")]
20    pub struct Widget(Object<ffi::GtkWidget, ffi::GtkWidgetClass>) @implements Buildable;
21
22    match fn {
23        type_ => || ffi::gtk_widget_get_type(),
24    }
25}
26
27impl Widget {
28    pub const NONE: Option<&'static Widget> = None;
29
30    //#[doc(alias = "gtk_widget_new")]
31    //pub fn new(type_: glib::types::Type, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) -> Widget {
32    //    unsafe { TODO: call ffi:gtk_widget_new() }
33    //}
34
35    #[doc(alias = "gtk_widget_get_default_direction")]
36    #[doc(alias = "get_default_direction")]
37    pub fn default_direction() -> TextDirection {
38        assert_initialized_main_thread!();
39        unsafe { from_glib(ffi::gtk_widget_get_default_direction()) }
40    }
41
42    #[doc(alias = "gtk_widget_set_default_direction")]
43    pub fn set_default_direction(dir: TextDirection) {
44        assert_initialized_main_thread!();
45        unsafe {
46            ffi::gtk_widget_set_default_direction(dir.into_glib());
47        }
48    }
49}
50
51impl std::fmt::Display for Widget {
52    #[inline]
53    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
54        f.write_str(&WidgetExt::widget_name(self))
55    }
56}
57
58pub trait WidgetExt: IsA<Widget> + 'static {
59    #[doc(alias = "gtk_widget_activate")]
60    fn activate(&self) -> bool {
61        unsafe { from_glib(ffi::gtk_widget_activate(self.as_ref().to_glib_none().0)) }
62    }
63
64    #[doc(alias = "gtk_widget_add_accelerator")]
65    fn add_accelerator(
66        &self,
67        accel_signal: &str,
68        accel_group: &impl IsA<AccelGroup>,
69        accel_key: u32,
70        accel_mods: gdk::ModifierType,
71        accel_flags: AccelFlags,
72    ) {
73        unsafe {
74            ffi::gtk_widget_add_accelerator(
75                self.as_ref().to_glib_none().0,
76                accel_signal.to_glib_none().0,
77                accel_group.as_ref().to_glib_none().0,
78                accel_key,
79                accel_mods.into_glib(),
80                accel_flags.into_glib(),
81            );
82        }
83    }
84
85    #[doc(alias = "gtk_widget_add_device_events")]
86    fn add_device_events(&self, device: &gdk::Device, events: gdk::EventMask) {
87        unsafe {
88            ffi::gtk_widget_add_device_events(
89                self.as_ref().to_glib_none().0,
90                device.to_glib_none().0,
91                events.into_glib(),
92            );
93        }
94    }
95
96    #[doc(alias = "gtk_widget_add_mnemonic_label")]
97    fn add_mnemonic_label(&self, label: &impl IsA<Widget>) {
98        unsafe {
99            ffi::gtk_widget_add_mnemonic_label(
100                self.as_ref().to_glib_none().0,
101                label.as_ref().to_glib_none().0,
102            );
103        }
104    }
105
106    #[doc(alias = "gtk_widget_child_focus")]
107    fn child_focus(&self, direction: DirectionType) -> bool {
108        unsafe {
109            from_glib(ffi::gtk_widget_child_focus(
110                self.as_ref().to_glib_none().0,
111                direction.into_glib(),
112            ))
113        }
114    }
115
116    #[doc(alias = "gtk_widget_child_notify")]
117    fn child_notify(&self, child_property: &str) {
118        unsafe {
119            ffi::gtk_widget_child_notify(
120                self.as_ref().to_glib_none().0,
121                child_property.to_glib_none().0,
122            );
123        }
124    }
125
126    #[doc(alias = "gtk_widget_compute_expand")]
127    fn compute_expand(&self, orientation: Orientation) -> bool {
128        unsafe {
129            from_glib(ffi::gtk_widget_compute_expand(
130                self.as_ref().to_glib_none().0,
131                orientation.into_glib(),
132            ))
133        }
134    }
135
136    #[doc(alias = "gtk_widget_create_pango_context")]
137    fn create_pango_context(&self) -> pango::Context {
138        unsafe {
139            from_glib_full(ffi::gtk_widget_create_pango_context(
140                self.as_ref().to_glib_none().0,
141            ))
142        }
143    }
144
145    #[doc(alias = "gtk_widget_create_pango_layout")]
146    fn create_pango_layout(&self, text: Option<&str>) -> pango::Layout {
147        unsafe {
148            from_glib_full(ffi::gtk_widget_create_pango_layout(
149                self.as_ref().to_glib_none().0,
150                text.to_glib_none().0,
151            ))
152        }
153    }
154
155    //#[doc(alias = "gtk_widget_destroyed")]
156    //fn destroyed(&self, widget_pointer: /*Unimplemented*/Widget) {
157    //    unsafe { TODO: call ffi:gtk_widget_destroyed() }
158    //}
159
160    #[doc(alias = "gtk_widget_device_is_shadowed")]
161    fn device_is_shadowed(&self, device: &gdk::Device) -> bool {
162        unsafe {
163            from_glib(ffi::gtk_widget_device_is_shadowed(
164                self.as_ref().to_glib_none().0,
165                device.to_glib_none().0,
166            ))
167        }
168    }
169
170    #[doc(alias = "gtk_drag_begin_with_coordinates")]
171    fn drag_begin_with_coordinates(
172        &self,
173        targets: &TargetList,
174        actions: gdk::DragAction,
175        button: i32,
176        event: Option<&gdk::Event>,
177        x: i32,
178        y: i32,
179    ) -> Option<gdk::DragContext> {
180        unsafe {
181            from_glib_none(ffi::gtk_drag_begin_with_coordinates(
182                self.as_ref().to_glib_none().0,
183                targets.to_glib_none().0,
184                actions.into_glib(),
185                button,
186                mut_override(event.to_glib_none().0),
187                x,
188                y,
189            ))
190        }
191    }
192
193    #[doc(alias = "gtk_drag_check_threshold")]
194    fn drag_check_threshold(
195        &self,
196        start_x: i32,
197        start_y: i32,
198        current_x: i32,
199        current_y: i32,
200    ) -> bool {
201        unsafe {
202            from_glib(ffi::gtk_drag_check_threshold(
203                self.as_ref().to_glib_none().0,
204                start_x,
205                start_y,
206                current_x,
207                current_y,
208            ))
209        }
210    }
211
212    #[doc(alias = "gtk_drag_dest_add_image_targets")]
213    fn drag_dest_add_image_targets(&self) {
214        unsafe {
215            ffi::gtk_drag_dest_add_image_targets(self.as_ref().to_glib_none().0);
216        }
217    }
218
219    #[doc(alias = "gtk_drag_dest_add_text_targets")]
220    fn drag_dest_add_text_targets(&self) {
221        unsafe {
222            ffi::gtk_drag_dest_add_text_targets(self.as_ref().to_glib_none().0);
223        }
224    }
225
226    #[doc(alias = "gtk_drag_dest_add_uri_targets")]
227    fn drag_dest_add_uri_targets(&self) {
228        unsafe {
229            ffi::gtk_drag_dest_add_uri_targets(self.as_ref().to_glib_none().0);
230        }
231    }
232
233    #[doc(alias = "gtk_drag_dest_find_target")]
234    fn drag_dest_find_target(
235        &self,
236        context: &gdk::DragContext,
237        target_list: Option<&TargetList>,
238    ) -> Option<gdk::Atom> {
239        unsafe {
240            from_glib_none(ffi::gtk_drag_dest_find_target(
241                self.as_ref().to_glib_none().0,
242                context.to_glib_none().0,
243                target_list.to_glib_none().0,
244            ))
245        }
246    }
247
248    #[doc(alias = "gtk_drag_dest_get_target_list")]
249    fn drag_dest_get_target_list(&self) -> Option<TargetList> {
250        unsafe {
251            from_glib_none(ffi::gtk_drag_dest_get_target_list(
252                self.as_ref().to_glib_none().0,
253            ))
254        }
255    }
256
257    #[doc(alias = "gtk_drag_dest_get_track_motion")]
258    fn drag_dest_get_track_motion(&self) -> bool {
259        unsafe {
260            from_glib(ffi::gtk_drag_dest_get_track_motion(
261                self.as_ref().to_glib_none().0,
262            ))
263        }
264    }
265
266    #[doc(alias = "gtk_drag_dest_set_target_list")]
267    fn drag_dest_set_target_list(&self, target_list: Option<&TargetList>) {
268        unsafe {
269            ffi::gtk_drag_dest_set_target_list(
270                self.as_ref().to_glib_none().0,
271                target_list.to_glib_none().0,
272            );
273        }
274    }
275
276    #[doc(alias = "gtk_drag_dest_set_track_motion")]
277    fn drag_dest_set_track_motion(&self, track_motion: bool) {
278        unsafe {
279            ffi::gtk_drag_dest_set_track_motion(
280                self.as_ref().to_glib_none().0,
281                track_motion.into_glib(),
282            );
283        }
284    }
285
286    #[doc(alias = "gtk_drag_dest_unset")]
287    fn drag_dest_unset(&self) {
288        unsafe {
289            ffi::gtk_drag_dest_unset(self.as_ref().to_glib_none().0);
290        }
291    }
292
293    #[doc(alias = "gtk_drag_get_data")]
294    fn drag_get_data(&self, context: &gdk::DragContext, target: &gdk::Atom, time_: u32) {
295        unsafe {
296            ffi::gtk_drag_get_data(
297                self.as_ref().to_glib_none().0,
298                context.to_glib_none().0,
299                target.to_glib_none().0,
300                time_,
301            );
302        }
303    }
304
305    #[doc(alias = "gtk_drag_highlight")]
306    fn drag_highlight(&self) {
307        unsafe {
308            ffi::gtk_drag_highlight(self.as_ref().to_glib_none().0);
309        }
310    }
311
312    #[doc(alias = "gtk_drag_source_add_image_targets")]
313    fn drag_source_add_image_targets(&self) {
314        unsafe {
315            ffi::gtk_drag_source_add_image_targets(self.as_ref().to_glib_none().0);
316        }
317    }
318
319    #[doc(alias = "gtk_drag_source_add_text_targets")]
320    fn drag_source_add_text_targets(&self) {
321        unsafe {
322            ffi::gtk_drag_source_add_text_targets(self.as_ref().to_glib_none().0);
323        }
324    }
325
326    #[doc(alias = "gtk_drag_source_add_uri_targets")]
327    fn drag_source_add_uri_targets(&self) {
328        unsafe {
329            ffi::gtk_drag_source_add_uri_targets(self.as_ref().to_glib_none().0);
330        }
331    }
332
333    #[doc(alias = "gtk_drag_source_get_target_list")]
334    fn drag_source_get_target_list(&self) -> Option<TargetList> {
335        unsafe {
336            from_glib_none(ffi::gtk_drag_source_get_target_list(
337                self.as_ref().to_glib_none().0,
338            ))
339        }
340    }
341
342    #[doc(alias = "gtk_drag_source_set_icon_gicon")]
343    fn drag_source_set_icon_gicon(&self, icon: &impl IsA<gio::Icon>) {
344        unsafe {
345            ffi::gtk_drag_source_set_icon_gicon(
346                self.as_ref().to_glib_none().0,
347                icon.as_ref().to_glib_none().0,
348            );
349        }
350    }
351
352    #[doc(alias = "gtk_drag_source_set_icon_name")]
353    fn drag_source_set_icon_name(&self, icon_name: &str) {
354        unsafe {
355            ffi::gtk_drag_source_set_icon_name(
356                self.as_ref().to_glib_none().0,
357                icon_name.to_glib_none().0,
358            );
359        }
360    }
361
362    #[doc(alias = "gtk_drag_source_set_icon_pixbuf")]
363    fn drag_source_set_icon_pixbuf(&self, pixbuf: &gdk_pixbuf::Pixbuf) {
364        unsafe {
365            ffi::gtk_drag_source_set_icon_pixbuf(
366                self.as_ref().to_glib_none().0,
367                pixbuf.to_glib_none().0,
368            );
369        }
370    }
371
372    #[doc(alias = "gtk_drag_source_set_target_list")]
373    fn drag_source_set_target_list(&self, target_list: Option<&TargetList>) {
374        unsafe {
375            ffi::gtk_drag_source_set_target_list(
376                self.as_ref().to_glib_none().0,
377                target_list.to_glib_none().0,
378            );
379        }
380    }
381
382    #[doc(alias = "gtk_drag_source_unset")]
383    fn drag_source_unset(&self) {
384        unsafe {
385            ffi::gtk_drag_source_unset(self.as_ref().to_glib_none().0);
386        }
387    }
388
389    #[doc(alias = "gtk_drag_unhighlight")]
390    fn drag_unhighlight(&self) {
391        unsafe {
392            ffi::gtk_drag_unhighlight(self.as_ref().to_glib_none().0);
393        }
394    }
395
396    #[doc(alias = "gtk_widget_draw")]
397    fn draw(&self, cr: &cairo::Context) {
398        unsafe {
399            ffi::gtk_widget_draw(
400                self.as_ref().to_glib_none().0,
401                mut_override(cr.to_glib_none().0),
402            );
403        }
404    }
405
406    #[doc(alias = "gtk_widget_error_bell")]
407    fn error_bell(&self) {
408        unsafe {
409            ffi::gtk_widget_error_bell(self.as_ref().to_glib_none().0);
410        }
411    }
412
413    #[doc(alias = "gtk_widget_event")]
414    fn event(&self, event: &gdk::Event) -> bool {
415        unsafe {
416            from_glib(ffi::gtk_widget_event(
417                self.as_ref().to_glib_none().0,
418                mut_override(event.to_glib_none().0),
419            ))
420        }
421    }
422
423    #[doc(alias = "gtk_widget_freeze_child_notify")]
424    fn freeze_child_notify(&self) {
425        unsafe {
426            ffi::gtk_widget_freeze_child_notify(self.as_ref().to_glib_none().0);
427        }
428    }
429
430    #[doc(alias = "gtk_widget_get_accessible")]
431    #[doc(alias = "get_accessible")]
432    fn accessible(&self) -> Option<atk::Object> {
433        unsafe {
434            from_glib_none(ffi::gtk_widget_get_accessible(
435                self.as_ref().to_glib_none().0,
436            ))
437        }
438    }
439
440    #[doc(alias = "gtk_widget_get_action_group")]
441    #[doc(alias = "get_action_group")]
442    fn action_group(&self, prefix: &str) -> Option<gio::ActionGroup> {
443        unsafe {
444            from_glib_none(ffi::gtk_widget_get_action_group(
445                self.as_ref().to_glib_none().0,
446                prefix.to_glib_none().0,
447            ))
448        }
449    }
450
451    #[doc(alias = "gtk_widget_get_allocated_baseline")]
452    #[doc(alias = "get_allocated_baseline")]
453    fn allocated_baseline(&self) -> i32 {
454        unsafe { ffi::gtk_widget_get_allocated_baseline(self.as_ref().to_glib_none().0) }
455    }
456
457    #[doc(alias = "gtk_widget_get_allocated_height")]
458    #[doc(alias = "get_allocated_height")]
459    fn allocated_height(&self) -> i32 {
460        unsafe { ffi::gtk_widget_get_allocated_height(self.as_ref().to_glib_none().0) }
461    }
462
463    #[doc(alias = "gtk_widget_get_allocated_size")]
464    #[doc(alias = "get_allocated_size")]
465    fn allocated_size(&self) -> (Allocation, i32) {
466        unsafe {
467            let mut allocation = Allocation::uninitialized();
468            let mut baseline = std::mem::MaybeUninit::uninit();
469            ffi::gtk_widget_get_allocated_size(
470                self.as_ref().to_glib_none().0,
471                allocation.to_glib_none_mut().0,
472                baseline.as_mut_ptr(),
473            );
474            (allocation, baseline.assume_init())
475        }
476    }
477
478    #[doc(alias = "gtk_widget_get_allocated_width")]
479    #[doc(alias = "get_allocated_width")]
480    fn allocated_width(&self) -> i32 {
481        unsafe { ffi::gtk_widget_get_allocated_width(self.as_ref().to_glib_none().0) }
482    }
483
484    #[doc(alias = "gtk_widget_get_allocation")]
485    #[doc(alias = "get_allocation")]
486    fn allocation(&self) -> Allocation {
487        unsafe {
488            let mut allocation = Allocation::uninitialized();
489            ffi::gtk_widget_get_allocation(
490                self.as_ref().to_glib_none().0,
491                allocation.to_glib_none_mut().0,
492            );
493            allocation
494        }
495    }
496
497    #[doc(alias = "gtk_widget_get_ancestor")]
498    #[doc(alias = "get_ancestor")]
499    #[must_use]
500    fn ancestor(&self, widget_type: glib::types::Type) -> Option<Widget> {
501        unsafe {
502            from_glib_none(ffi::gtk_widget_get_ancestor(
503                self.as_ref().to_glib_none().0,
504                widget_type.into_glib(),
505            ))
506        }
507    }
508
509    #[doc(alias = "gtk_widget_get_app_paintable")]
510    #[doc(alias = "get_app_paintable")]
511    #[doc(alias = "app-paintable")]
512    fn is_app_paintable(&self) -> bool {
513        unsafe {
514            from_glib(ffi::gtk_widget_get_app_paintable(
515                self.as_ref().to_glib_none().0,
516            ))
517        }
518    }
519
520    #[doc(alias = "gtk_widget_get_can_default")]
521    #[doc(alias = "get_can_default")]
522    #[doc(alias = "can-default")]
523    fn can_default(&self) -> bool {
524        unsafe {
525            from_glib(ffi::gtk_widget_get_can_default(
526                self.as_ref().to_glib_none().0,
527            ))
528        }
529    }
530
531    #[doc(alias = "gtk_widget_get_can_focus")]
532    #[doc(alias = "get_can_focus")]
533    #[doc(alias = "can-focus")]
534    fn can_focus(&self) -> bool {
535        unsafe {
536            from_glib(ffi::gtk_widget_get_can_focus(
537                self.as_ref().to_glib_none().0,
538            ))
539        }
540    }
541
542    #[doc(alias = "gtk_widget_get_child_visible")]
543    #[doc(alias = "get_child_visible")]
544    fn is_child_visible(&self) -> bool {
545        unsafe {
546            from_glib(ffi::gtk_widget_get_child_visible(
547                self.as_ref().to_glib_none().0,
548            ))
549        }
550    }
551
552    #[doc(alias = "gtk_widget_get_clip")]
553    #[doc(alias = "get_clip")]
554    fn clip(&self) -> Allocation {
555        unsafe {
556            let mut clip = Allocation::uninitialized();
557            ffi::gtk_widget_get_clip(self.as_ref().to_glib_none().0, clip.to_glib_none_mut().0);
558            clip
559        }
560    }
561
562    #[doc(alias = "gtk_widget_get_clipboard")]
563    #[doc(alias = "get_clipboard")]
564    fn clipboard(&self, selection: &gdk::Atom) -> Clipboard {
565        unsafe {
566            from_glib_none(ffi::gtk_widget_get_clipboard(
567                self.as_ref().to_glib_none().0,
568                selection.to_glib_none().0,
569            ))
570        }
571    }
572
573    #[doc(alias = "gtk_widget_get_device_enabled")]
574    #[doc(alias = "get_device_enabled")]
575    fn device_is_enabled(&self, device: &gdk::Device) -> bool {
576        unsafe {
577            from_glib(ffi::gtk_widget_get_device_enabled(
578                self.as_ref().to_glib_none().0,
579                device.to_glib_none().0,
580            ))
581        }
582    }
583
584    #[doc(alias = "gtk_widget_get_device_events")]
585    #[doc(alias = "get_device_events")]
586    fn device_events(&self, device: &gdk::Device) -> gdk::EventMask {
587        unsafe {
588            from_glib(ffi::gtk_widget_get_device_events(
589                self.as_ref().to_glib_none().0,
590                device.to_glib_none().0,
591            ))
592        }
593    }
594
595    #[doc(alias = "gtk_widget_get_direction")]
596    #[doc(alias = "get_direction")]
597    fn direction(&self) -> TextDirection {
598        unsafe {
599            from_glib(ffi::gtk_widget_get_direction(
600                self.as_ref().to_glib_none().0,
601            ))
602        }
603    }
604
605    #[doc(alias = "gtk_widget_get_display")]
606    #[doc(alias = "get_display")]
607    fn display(&self) -> gdk::Display {
608        unsafe { from_glib_none(ffi::gtk_widget_get_display(self.as_ref().to_glib_none().0)) }
609    }
610
611    #[doc(alias = "gtk_widget_get_double_buffered")]
612    #[doc(alias = "get_double_buffered")]
613    #[doc(alias = "double-buffered")]
614    fn is_double_buffered(&self) -> bool {
615        unsafe {
616            from_glib(ffi::gtk_widget_get_double_buffered(
617                self.as_ref().to_glib_none().0,
618            ))
619        }
620    }
621
622    #[doc(alias = "gtk_widget_get_focus_on_click")]
623    #[doc(alias = "get_focus_on_click")]
624    #[doc(alias = "focus-on-click")]
625    fn gets_focus_on_click(&self) -> bool {
626        unsafe {
627            from_glib(ffi::gtk_widget_get_focus_on_click(
628                self.as_ref().to_glib_none().0,
629            ))
630        }
631    }
632
633    #[doc(alias = "gtk_widget_get_font_map")]
634    #[doc(alias = "get_font_map")]
635    fn font_map(&self) -> Option<pango::FontMap> {
636        unsafe { from_glib_none(ffi::gtk_widget_get_font_map(self.as_ref().to_glib_none().0)) }
637    }
638
639    #[doc(alias = "gtk_widget_get_font_options")]
640    #[doc(alias = "get_font_options")]
641    fn font_options(&self) -> Option<cairo::FontOptions> {
642        unsafe {
643            from_glib_none(ffi::gtk_widget_get_font_options(
644                self.as_ref().to_glib_none().0,
645            ))
646        }
647    }
648
649    #[doc(alias = "gtk_widget_get_frame_clock")]
650    #[doc(alias = "get_frame_clock")]
651    fn frame_clock(&self) -> Option<gdk::FrameClock> {
652        unsafe {
653            from_glib_none(ffi::gtk_widget_get_frame_clock(
654                self.as_ref().to_glib_none().0,
655            ))
656        }
657    }
658
659    #[doc(alias = "gtk_widget_get_halign")]
660    #[doc(alias = "get_halign")]
661    fn halign(&self) -> Align {
662        unsafe { from_glib(ffi::gtk_widget_get_halign(self.as_ref().to_glib_none().0)) }
663    }
664
665    #[doc(alias = "gtk_widget_get_has_tooltip")]
666    #[doc(alias = "get_has_tooltip")]
667    #[doc(alias = "has-tooltip")]
668    fn has_tooltip(&self) -> bool {
669        unsafe {
670            from_glib(ffi::gtk_widget_get_has_tooltip(
671                self.as_ref().to_glib_none().0,
672            ))
673        }
674    }
675
676    #[doc(alias = "gtk_widget_get_has_window")]
677    #[doc(alias = "get_has_window")]
678    fn has_window(&self) -> bool {
679        unsafe {
680            from_glib(ffi::gtk_widget_get_has_window(
681                self.as_ref().to_glib_none().0,
682            ))
683        }
684    }
685
686    #[doc(alias = "gtk_widget_get_hexpand")]
687    #[doc(alias = "get_hexpand")]
688    #[doc(alias = "hexpand")]
689    fn hexpands(&self) -> bool {
690        unsafe { from_glib(ffi::gtk_widget_get_hexpand(self.as_ref().to_glib_none().0)) }
691    }
692
693    #[doc(alias = "gtk_widget_get_hexpand_set")]
694    #[doc(alias = "get_hexpand_set")]
695    #[doc(alias = "hexpand-set")]
696    fn is_hexpand_set(&self) -> bool {
697        unsafe {
698            from_glib(ffi::gtk_widget_get_hexpand_set(
699                self.as_ref().to_glib_none().0,
700            ))
701        }
702    }
703
704    #[doc(alias = "gtk_widget_get_mapped")]
705    #[doc(alias = "get_mapped")]
706    fn is_mapped(&self) -> bool {
707        unsafe { from_glib(ffi::gtk_widget_get_mapped(self.as_ref().to_glib_none().0)) }
708    }
709
710    #[doc(alias = "gtk_widget_get_margin_bottom")]
711    #[doc(alias = "get_margin_bottom")]
712    #[doc(alias = "margin-bottom")]
713    fn margin_bottom(&self) -> i32 {
714        unsafe { ffi::gtk_widget_get_margin_bottom(self.as_ref().to_glib_none().0) }
715    }
716
717    #[doc(alias = "gtk_widget_get_margin_end")]
718    #[doc(alias = "get_margin_end")]
719    #[doc(alias = "margin-end")]
720    fn margin_end(&self) -> i32 {
721        unsafe { ffi::gtk_widget_get_margin_end(self.as_ref().to_glib_none().0) }
722    }
723
724    #[doc(alias = "gtk_widget_get_margin_start")]
725    #[doc(alias = "get_margin_start")]
726    #[doc(alias = "margin-start")]
727    fn margin_start(&self) -> i32 {
728        unsafe { ffi::gtk_widget_get_margin_start(self.as_ref().to_glib_none().0) }
729    }
730
731    #[doc(alias = "gtk_widget_get_margin_top")]
732    #[doc(alias = "get_margin_top")]
733    #[doc(alias = "margin-top")]
734    fn margin_top(&self) -> i32 {
735        unsafe { ffi::gtk_widget_get_margin_top(self.as_ref().to_glib_none().0) }
736    }
737
738    #[doc(alias = "gtk_widget_get_modifier_mask")]
739    #[doc(alias = "get_modifier_mask")]
740    fn modifier_mask(&self, intent: gdk::ModifierIntent) -> gdk::ModifierType {
741        unsafe {
742            from_glib(ffi::gtk_widget_get_modifier_mask(
743                self.as_ref().to_glib_none().0,
744                intent.into_glib(),
745            ))
746        }
747    }
748
749    #[doc(alias = "gtk_widget_get_name")]
750    #[doc(alias = "get_name")]
751    #[doc(alias = "name")]
752    fn widget_name(&self) -> glib::GString {
753        unsafe { from_glib_none(ffi::gtk_widget_get_name(self.as_ref().to_glib_none().0)) }
754    }
755
756    #[doc(alias = "gtk_widget_get_no_show_all")]
757    #[doc(alias = "get_no_show_all")]
758    #[doc(alias = "no-show-all")]
759    fn is_no_show_all(&self) -> bool {
760        unsafe {
761            from_glib(ffi::gtk_widget_get_no_show_all(
762                self.as_ref().to_glib_none().0,
763            ))
764        }
765    }
766
767    #[doc(alias = "gtk_widget_get_opacity")]
768    #[doc(alias = "get_opacity")]
769    fn opacity(&self) -> f64 {
770        unsafe { ffi::gtk_widget_get_opacity(self.as_ref().to_glib_none().0) }
771    }
772
773    #[doc(alias = "gtk_widget_get_pango_context")]
774    #[doc(alias = "get_pango_context")]
775    fn pango_context(&self) -> pango::Context {
776        unsafe {
777            from_glib_none(ffi::gtk_widget_get_pango_context(
778                self.as_ref().to_glib_none().0,
779            ))
780        }
781    }
782
783    #[doc(alias = "gtk_widget_get_parent")]
784    #[doc(alias = "get_parent")]
785    #[must_use]
786    fn parent(&self) -> Option<Widget> {
787        unsafe { from_glib_none(ffi::gtk_widget_get_parent(self.as_ref().to_glib_none().0)) }
788    }
789
790    #[doc(alias = "gtk_widget_get_parent_window")]
791    #[doc(alias = "get_parent_window")]
792    fn parent_window(&self) -> Option<gdk::Window> {
793        unsafe {
794            from_glib_none(ffi::gtk_widget_get_parent_window(
795                self.as_ref().to_glib_none().0,
796            ))
797        }
798    }
799
800    #[doc(alias = "gtk_widget_get_path")]
801    #[doc(alias = "get_path")]
802    fn path(&self) -> WidgetPath {
803        unsafe { from_glib_none(ffi::gtk_widget_get_path(self.as_ref().to_glib_none().0)) }
804    }
805
806    #[doc(alias = "gtk_widget_get_preferred_height")]
807    #[doc(alias = "get_preferred_height")]
808    fn preferred_height(&self) -> (i32, i32) {
809        unsafe {
810            let mut minimum_height = std::mem::MaybeUninit::uninit();
811            let mut natural_height = std::mem::MaybeUninit::uninit();
812            ffi::gtk_widget_get_preferred_height(
813                self.as_ref().to_glib_none().0,
814                minimum_height.as_mut_ptr(),
815                natural_height.as_mut_ptr(),
816            );
817            (minimum_height.assume_init(), natural_height.assume_init())
818        }
819    }
820
821    #[doc(alias = "gtk_widget_get_preferred_height_and_baseline_for_width")]
822    #[doc(alias = "get_preferred_height_and_baseline_for_width")]
823    fn preferred_height_and_baseline_for_width(&self, width: i32) -> (i32, i32, i32, i32) {
824        unsafe {
825            let mut minimum_height = std::mem::MaybeUninit::uninit();
826            let mut natural_height = std::mem::MaybeUninit::uninit();
827            let mut minimum_baseline = std::mem::MaybeUninit::uninit();
828            let mut natural_baseline = std::mem::MaybeUninit::uninit();
829            ffi::gtk_widget_get_preferred_height_and_baseline_for_width(
830                self.as_ref().to_glib_none().0,
831                width,
832                minimum_height.as_mut_ptr(),
833                natural_height.as_mut_ptr(),
834                minimum_baseline.as_mut_ptr(),
835                natural_baseline.as_mut_ptr(),
836            );
837            (
838                minimum_height.assume_init(),
839                natural_height.assume_init(),
840                minimum_baseline.assume_init(),
841                natural_baseline.assume_init(),
842            )
843        }
844    }
845
846    #[doc(alias = "gtk_widget_get_preferred_height_for_width")]
847    #[doc(alias = "get_preferred_height_for_width")]
848    fn preferred_height_for_width(&self, width: i32) -> (i32, i32) {
849        unsafe {
850            let mut minimum_height = std::mem::MaybeUninit::uninit();
851            let mut natural_height = std::mem::MaybeUninit::uninit();
852            ffi::gtk_widget_get_preferred_height_for_width(
853                self.as_ref().to_glib_none().0,
854                width,
855                minimum_height.as_mut_ptr(),
856                natural_height.as_mut_ptr(),
857            );
858            (minimum_height.assume_init(), natural_height.assume_init())
859        }
860    }
861
862    #[doc(alias = "gtk_widget_get_preferred_size")]
863    #[doc(alias = "get_preferred_size")]
864    fn preferred_size(&self) -> (Requisition, Requisition) {
865        unsafe {
866            let mut minimum_size = Requisition::uninitialized();
867            let mut natural_size = Requisition::uninitialized();
868            ffi::gtk_widget_get_preferred_size(
869                self.as_ref().to_glib_none().0,
870                minimum_size.to_glib_none_mut().0,
871                natural_size.to_glib_none_mut().0,
872            );
873            (minimum_size, natural_size)
874        }
875    }
876
877    #[doc(alias = "gtk_widget_get_preferred_width")]
878    #[doc(alias = "get_preferred_width")]
879    fn preferred_width(&self) -> (i32, i32) {
880        unsafe {
881            let mut minimum_width = std::mem::MaybeUninit::uninit();
882            let mut natural_width = std::mem::MaybeUninit::uninit();
883            ffi::gtk_widget_get_preferred_width(
884                self.as_ref().to_glib_none().0,
885                minimum_width.as_mut_ptr(),
886                natural_width.as_mut_ptr(),
887            );
888            (minimum_width.assume_init(), natural_width.assume_init())
889        }
890    }
891
892    #[doc(alias = "gtk_widget_get_preferred_width_for_height")]
893    #[doc(alias = "get_preferred_width_for_height")]
894    fn preferred_width_for_height(&self, height: i32) -> (i32, i32) {
895        unsafe {
896            let mut minimum_width = std::mem::MaybeUninit::uninit();
897            let mut natural_width = std::mem::MaybeUninit::uninit();
898            ffi::gtk_widget_get_preferred_width_for_height(
899                self.as_ref().to_glib_none().0,
900                height,
901                minimum_width.as_mut_ptr(),
902                natural_width.as_mut_ptr(),
903            );
904            (minimum_width.assume_init(), natural_width.assume_init())
905        }
906    }
907
908    #[doc(alias = "gtk_widget_get_realized")]
909    #[doc(alias = "get_realized")]
910    fn is_realized(&self) -> bool {
911        unsafe { from_glib(ffi::gtk_widget_get_realized(self.as_ref().to_glib_none().0)) }
912    }
913
914    #[doc(alias = "gtk_widget_get_receives_default")]
915    #[doc(alias = "get_receives_default")]
916    #[doc(alias = "receives-default")]
917    fn receives_default(&self) -> bool {
918        unsafe {
919            from_glib(ffi::gtk_widget_get_receives_default(
920                self.as_ref().to_glib_none().0,
921            ))
922        }
923    }
924
925    #[doc(alias = "gtk_widget_get_request_mode")]
926    #[doc(alias = "get_request_mode")]
927    fn request_mode(&self) -> SizeRequestMode {
928        unsafe {
929            from_glib(ffi::gtk_widget_get_request_mode(
930                self.as_ref().to_glib_none().0,
931            ))
932        }
933    }
934
935    #[doc(alias = "gtk_widget_get_scale_factor")]
936    #[doc(alias = "get_scale_factor")]
937    #[doc(alias = "scale-factor")]
938    fn scale_factor(&self) -> i32 {
939        unsafe { ffi::gtk_widget_get_scale_factor(self.as_ref().to_glib_none().0) }
940    }
941
942    #[doc(alias = "gtk_widget_get_screen")]
943    #[doc(alias = "get_screen")]
944    fn screen(&self) -> Option<gdk::Screen> {
945        unsafe { from_glib_none(ffi::gtk_widget_get_screen(self.as_ref().to_glib_none().0)) }
946    }
947
948    #[doc(alias = "gtk_widget_get_sensitive")]
949    #[doc(alias = "sensitive")]
950    fn get_sensitive(&self) -> bool {
951        unsafe {
952            from_glib(ffi::gtk_widget_get_sensitive(
953                self.as_ref().to_glib_none().0,
954            ))
955        }
956    }
957
958    #[doc(alias = "gtk_widget_get_settings")]
959    #[doc(alias = "get_settings")]
960    fn settings(&self) -> Option<Settings> {
961        unsafe { from_glib_none(ffi::gtk_widget_get_settings(self.as_ref().to_glib_none().0)) }
962    }
963
964    #[doc(alias = "gtk_widget_get_size_request")]
965    #[doc(alias = "get_size_request")]
966    fn size_request(&self) -> (i32, i32) {
967        unsafe {
968            let mut width = std::mem::MaybeUninit::uninit();
969            let mut height = std::mem::MaybeUninit::uninit();
970            ffi::gtk_widget_get_size_request(
971                self.as_ref().to_glib_none().0,
972                width.as_mut_ptr(),
973                height.as_mut_ptr(),
974            );
975            (width.assume_init(), height.assume_init())
976        }
977    }
978
979    #[doc(alias = "gtk_widget_get_state_flags")]
980    #[doc(alias = "get_state_flags")]
981    fn state_flags(&self) -> StateFlags {
982        unsafe {
983            from_glib(ffi::gtk_widget_get_state_flags(
984                self.as_ref().to_glib_none().0,
985            ))
986        }
987    }
988
989    #[doc(alias = "gtk_widget_get_style_context")]
990    #[doc(alias = "get_style_context")]
991    fn style_context(&self) -> StyleContext {
992        unsafe {
993            from_glib_none(ffi::gtk_widget_get_style_context(
994                self.as_ref().to_glib_none().0,
995            ))
996        }
997    }
998
999    #[doc(alias = "gtk_widget_get_support_multidevice")]
1000    #[doc(alias = "get_support_multidevice")]
1001    fn supports_multidevice(&self) -> bool {
1002        unsafe {
1003            from_glib(ffi::gtk_widget_get_support_multidevice(
1004                self.as_ref().to_glib_none().0,
1005            ))
1006        }
1007    }
1008
1009    #[doc(alias = "gtk_widget_get_template_child")]
1010    #[doc(alias = "get_template_child")]
1011    fn template_child(&self, widget_type: glib::types::Type, name: &str) -> Option<glib::Object> {
1012        unsafe {
1013            from_glib_none(ffi::gtk_widget_get_template_child(
1014                self.as_ref().to_glib_none().0,
1015                widget_type.into_glib(),
1016                name.to_glib_none().0,
1017            ))
1018        }
1019    }
1020
1021    #[doc(alias = "gtk_widget_get_tooltip_markup")]
1022    #[doc(alias = "get_tooltip_markup")]
1023    #[doc(alias = "tooltip-markup")]
1024    fn tooltip_markup(&self) -> Option<glib::GString> {
1025        unsafe {
1026            from_glib_full(ffi::gtk_widget_get_tooltip_markup(
1027                self.as_ref().to_glib_none().0,
1028            ))
1029        }
1030    }
1031
1032    #[doc(alias = "gtk_widget_get_tooltip_text")]
1033    #[doc(alias = "get_tooltip_text")]
1034    #[doc(alias = "tooltip-text")]
1035    fn tooltip_text(&self) -> Option<glib::GString> {
1036        unsafe {
1037            from_glib_full(ffi::gtk_widget_get_tooltip_text(
1038                self.as_ref().to_glib_none().0,
1039            ))
1040        }
1041    }
1042
1043    #[doc(alias = "gtk_widget_get_tooltip_window")]
1044    #[doc(alias = "get_tooltip_window")]
1045    fn tooltip_window(&self) -> Option<Window> {
1046        unsafe {
1047            from_glib_none(ffi::gtk_widget_get_tooltip_window(
1048                self.as_ref().to_glib_none().0,
1049            ))
1050        }
1051    }
1052
1053    #[doc(alias = "gtk_widget_get_toplevel")]
1054    #[doc(alias = "get_toplevel")]
1055    #[must_use]
1056    fn toplevel(&self) -> Option<Widget> {
1057        unsafe { from_glib_none(ffi::gtk_widget_get_toplevel(self.as_ref().to_glib_none().0)) }
1058    }
1059
1060    #[doc(alias = "gtk_widget_get_valign")]
1061    #[doc(alias = "get_valign")]
1062    fn valign(&self) -> Align {
1063        unsafe { from_glib(ffi::gtk_widget_get_valign(self.as_ref().to_glib_none().0)) }
1064    }
1065
1066    #[doc(alias = "gtk_widget_get_valign_with_baseline")]
1067    #[doc(alias = "get_valign_with_baseline")]
1068    fn valign_with_baseline(&self) -> Align {
1069        unsafe {
1070            from_glib(ffi::gtk_widget_get_valign_with_baseline(
1071                self.as_ref().to_glib_none().0,
1072            ))
1073        }
1074    }
1075
1076    #[doc(alias = "gtk_widget_get_vexpand")]
1077    #[doc(alias = "get_vexpand")]
1078    #[doc(alias = "vexpand")]
1079    fn vexpands(&self) -> bool {
1080        unsafe { from_glib(ffi::gtk_widget_get_vexpand(self.as_ref().to_glib_none().0)) }
1081    }
1082
1083    #[doc(alias = "gtk_widget_get_vexpand_set")]
1084    #[doc(alias = "get_vexpand_set")]
1085    #[doc(alias = "vexpand-set")]
1086    fn is_vexpand_set(&self) -> bool {
1087        unsafe {
1088            from_glib(ffi::gtk_widget_get_vexpand_set(
1089                self.as_ref().to_glib_none().0,
1090            ))
1091        }
1092    }
1093
1094    #[doc(alias = "gtk_widget_get_visible")]
1095    #[doc(alias = "visible")]
1096    fn get_visible(&self) -> bool {
1097        unsafe { from_glib(ffi::gtk_widget_get_visible(self.as_ref().to_glib_none().0)) }
1098    }
1099
1100    #[doc(alias = "gtk_widget_get_visual")]
1101    #[doc(alias = "get_visual")]
1102    fn visual(&self) -> Option<gdk::Visual> {
1103        unsafe { from_glib_none(ffi::gtk_widget_get_visual(self.as_ref().to_glib_none().0)) }
1104    }
1105
1106    #[doc(alias = "gtk_widget_get_window")]
1107    #[doc(alias = "get_window")]
1108    fn window(&self) -> Option<gdk::Window> {
1109        unsafe { from_glib_none(ffi::gtk_widget_get_window(self.as_ref().to_glib_none().0)) }
1110    }
1111
1112    #[doc(alias = "gtk_grab_add")]
1113    fn grab_add(&self) {
1114        unsafe {
1115            ffi::gtk_grab_add(self.as_ref().to_glib_none().0);
1116        }
1117    }
1118
1119    #[doc(alias = "gtk_widget_grab_default")]
1120    fn grab_default(&self) {
1121        unsafe {
1122            ffi::gtk_widget_grab_default(self.as_ref().to_glib_none().0);
1123        }
1124    }
1125
1126    #[doc(alias = "gtk_widget_grab_focus")]
1127    fn grab_focus(&self) {
1128        unsafe {
1129            ffi::gtk_widget_grab_focus(self.as_ref().to_glib_none().0);
1130        }
1131    }
1132
1133    #[doc(alias = "gtk_grab_remove")]
1134    fn grab_remove(&self) {
1135        unsafe {
1136            ffi::gtk_grab_remove(self.as_ref().to_glib_none().0);
1137        }
1138    }
1139
1140    #[doc(alias = "gtk_widget_has_default")]
1141    fn has_default(&self) -> bool {
1142        unsafe { from_glib(ffi::gtk_widget_has_default(self.as_ref().to_glib_none().0)) }
1143    }
1144
1145    #[doc(alias = "gtk_widget_has_focus")]
1146    fn has_focus(&self) -> bool {
1147        unsafe { from_glib(ffi::gtk_widget_has_focus(self.as_ref().to_glib_none().0)) }
1148    }
1149
1150    #[doc(alias = "gtk_widget_has_grab")]
1151    fn has_grab(&self) -> bool {
1152        unsafe { from_glib(ffi::gtk_widget_has_grab(self.as_ref().to_glib_none().0)) }
1153    }
1154
1155    #[doc(alias = "gtk_widget_has_screen")]
1156    fn has_screen(&self) -> bool {
1157        unsafe { from_glib(ffi::gtk_widget_has_screen(self.as_ref().to_glib_none().0)) }
1158    }
1159
1160    #[doc(alias = "gtk_widget_has_visible_focus")]
1161    fn has_visible_focus(&self) -> bool {
1162        unsafe {
1163            from_glib(ffi::gtk_widget_has_visible_focus(
1164                self.as_ref().to_glib_none().0,
1165            ))
1166        }
1167    }
1168
1169    #[doc(alias = "gtk_widget_hide")]
1170    fn hide(&self) {
1171        unsafe {
1172            ffi::gtk_widget_hide(self.as_ref().to_glib_none().0);
1173        }
1174    }
1175
1176    #[doc(alias = "gtk_widget_in_destruction")]
1177    fn in_destruction(&self) -> bool {
1178        unsafe {
1179            from_glib(ffi::gtk_widget_in_destruction(
1180                self.as_ref().to_glib_none().0,
1181            ))
1182        }
1183    }
1184
1185    #[doc(alias = "gtk_widget_init_template")]
1186    fn init_template(&self) {
1187        unsafe {
1188            ffi::gtk_widget_init_template(self.as_ref().to_glib_none().0);
1189        }
1190    }
1191
1192    #[doc(alias = "gtk_widget_input_shape_combine_region")]
1193    fn input_shape_combine_region(&self, region: Option<&cairo::Region>) {
1194        unsafe {
1195            ffi::gtk_widget_input_shape_combine_region(
1196                self.as_ref().to_glib_none().0,
1197                mut_override(region.to_glib_none().0),
1198            );
1199        }
1200    }
1201
1202    #[doc(alias = "gtk_widget_insert_action_group")]
1203    fn insert_action_group(&self, name: &str, group: Option<&impl IsA<gio::ActionGroup>>) {
1204        unsafe {
1205            ffi::gtk_widget_insert_action_group(
1206                self.as_ref().to_glib_none().0,
1207                name.to_glib_none().0,
1208                group.map(|p| p.as_ref()).to_glib_none().0,
1209            );
1210        }
1211    }
1212
1213    #[doc(alias = "gtk_widget_is_ancestor")]
1214    fn is_ancestor(&self, ancestor: &impl IsA<Widget>) -> bool {
1215        unsafe {
1216            from_glib(ffi::gtk_widget_is_ancestor(
1217                self.as_ref().to_glib_none().0,
1218                ancestor.as_ref().to_glib_none().0,
1219            ))
1220        }
1221    }
1222
1223    #[doc(alias = "gtk_widget_is_drawable")]
1224    fn is_drawable(&self) -> bool {
1225        unsafe { from_glib(ffi::gtk_widget_is_drawable(self.as_ref().to_glib_none().0)) }
1226    }
1227
1228    #[doc(alias = "gtk_widget_is_focus")]
1229    fn is_focus(&self) -> bool {
1230        unsafe { from_glib(ffi::gtk_widget_is_focus(self.as_ref().to_glib_none().0)) }
1231    }
1232
1233    #[doc(alias = "gtk_widget_is_sensitive")]
1234    fn is_sensitive(&self) -> bool {
1235        unsafe { from_glib(ffi::gtk_widget_is_sensitive(self.as_ref().to_glib_none().0)) }
1236    }
1237
1238    #[doc(alias = "gtk_widget_is_toplevel")]
1239    fn is_toplevel(&self) -> bool {
1240        unsafe { from_glib(ffi::gtk_widget_is_toplevel(self.as_ref().to_glib_none().0)) }
1241    }
1242
1243    #[doc(alias = "gtk_widget_is_visible")]
1244    fn is_visible(&self) -> bool {
1245        unsafe { from_glib(ffi::gtk_widget_is_visible(self.as_ref().to_glib_none().0)) }
1246    }
1247
1248    #[doc(alias = "gtk_widget_keynav_failed")]
1249    fn keynav_failed(&self, direction: DirectionType) -> bool {
1250        unsafe {
1251            from_glib(ffi::gtk_widget_keynav_failed(
1252                self.as_ref().to_glib_none().0,
1253                direction.into_glib(),
1254            ))
1255        }
1256    }
1257
1258    #[doc(alias = "gtk_widget_list_accel_closures")]
1259    fn list_accel_closures(&self) -> Vec<glib::Closure> {
1260        unsafe {
1261            FromGlibPtrContainer::from_glib_container(ffi::gtk_widget_list_accel_closures(
1262                self.as_ref().to_glib_none().0,
1263            ))
1264        }
1265    }
1266
1267    #[doc(alias = "gtk_widget_list_action_prefixes")]
1268    fn list_action_prefixes(&self) -> Vec<glib::GString> {
1269        unsafe {
1270            FromGlibPtrContainer::from_glib_container(ffi::gtk_widget_list_action_prefixes(
1271                self.as_ref().to_glib_none().0,
1272            ))
1273        }
1274    }
1275
1276    #[doc(alias = "gtk_widget_list_mnemonic_labels")]
1277    fn list_mnemonic_labels(&self) -> Vec<Widget> {
1278        unsafe {
1279            FromGlibPtrContainer::from_glib_container(ffi::gtk_widget_list_mnemonic_labels(
1280                self.as_ref().to_glib_none().0,
1281            ))
1282        }
1283    }
1284
1285    #[doc(alias = "gtk_widget_map")]
1286    fn map(&self) {
1287        unsafe {
1288            ffi::gtk_widget_map(self.as_ref().to_glib_none().0);
1289        }
1290    }
1291
1292    #[doc(alias = "gtk_widget_mnemonic_activate")]
1293    fn mnemonic_activate(&self, group_cycling: bool) -> bool {
1294        unsafe {
1295            from_glib(ffi::gtk_widget_mnemonic_activate(
1296                self.as_ref().to_glib_none().0,
1297                group_cycling.into_glib(),
1298            ))
1299        }
1300    }
1301
1302    #[doc(alias = "gtk_widget_queue_allocate")]
1303    fn queue_allocate(&self) {
1304        unsafe {
1305            ffi::gtk_widget_queue_allocate(self.as_ref().to_glib_none().0);
1306        }
1307    }
1308
1309    #[doc(alias = "gtk_widget_queue_compute_expand")]
1310    fn queue_compute_expand(&self) {
1311        unsafe {
1312            ffi::gtk_widget_queue_compute_expand(self.as_ref().to_glib_none().0);
1313        }
1314    }
1315
1316    #[doc(alias = "gtk_widget_queue_draw")]
1317    fn queue_draw(&self) {
1318        unsafe {
1319            ffi::gtk_widget_queue_draw(self.as_ref().to_glib_none().0);
1320        }
1321    }
1322
1323    #[doc(alias = "gtk_widget_queue_draw_area")]
1324    fn queue_draw_area(&self, x: i32, y: i32, width: i32, height: i32) {
1325        unsafe {
1326            ffi::gtk_widget_queue_draw_area(self.as_ref().to_glib_none().0, x, y, width, height);
1327        }
1328    }
1329
1330    #[doc(alias = "gtk_widget_queue_draw_region")]
1331    fn queue_draw_region(&self, region: &cairo::Region) {
1332        unsafe {
1333            ffi::gtk_widget_queue_draw_region(
1334                self.as_ref().to_glib_none().0,
1335                region.to_glib_none().0,
1336            );
1337        }
1338    }
1339
1340    #[doc(alias = "gtk_widget_queue_resize")]
1341    fn queue_resize(&self) {
1342        unsafe {
1343            ffi::gtk_widget_queue_resize(self.as_ref().to_glib_none().0);
1344        }
1345    }
1346
1347    #[doc(alias = "gtk_widget_queue_resize_no_redraw")]
1348    fn queue_resize_no_redraw(&self) {
1349        unsafe {
1350            ffi::gtk_widget_queue_resize_no_redraw(self.as_ref().to_glib_none().0);
1351        }
1352    }
1353
1354    #[doc(alias = "gtk_widget_realize")]
1355    fn realize(&self) {
1356        unsafe {
1357            ffi::gtk_widget_realize(self.as_ref().to_glib_none().0);
1358        }
1359    }
1360
1361    #[doc(alias = "gtk_widget_register_window")]
1362    fn register_window(&self, window: &gdk::Window) {
1363        unsafe {
1364            ffi::gtk_widget_register_window(
1365                self.as_ref().to_glib_none().0,
1366                window.to_glib_none().0,
1367            );
1368        }
1369    }
1370
1371    #[doc(alias = "gtk_widget_remove_accelerator")]
1372    fn remove_accelerator(
1373        &self,
1374        accel_group: &impl IsA<AccelGroup>,
1375        accel_key: u32,
1376        accel_mods: gdk::ModifierType,
1377    ) -> bool {
1378        unsafe {
1379            from_glib(ffi::gtk_widget_remove_accelerator(
1380                self.as_ref().to_glib_none().0,
1381                accel_group.as_ref().to_glib_none().0,
1382                accel_key,
1383                accel_mods.into_glib(),
1384            ))
1385        }
1386    }
1387
1388    #[doc(alias = "gtk_widget_remove_mnemonic_label")]
1389    fn remove_mnemonic_label(&self, label: &impl IsA<Widget>) {
1390        unsafe {
1391            ffi::gtk_widget_remove_mnemonic_label(
1392                self.as_ref().to_glib_none().0,
1393                label.as_ref().to_glib_none().0,
1394            );
1395        }
1396    }
1397
1398    #[doc(alias = "gtk_widget_reset_style")]
1399    fn reset_style(&self) {
1400        unsafe {
1401            ffi::gtk_widget_reset_style(self.as_ref().to_glib_none().0);
1402        }
1403    }
1404
1405    #[doc(alias = "gtk_widget_send_focus_change")]
1406    fn send_focus_change(&self, event: &gdk::Event) -> bool {
1407        unsafe {
1408            from_glib(ffi::gtk_widget_send_focus_change(
1409                self.as_ref().to_glib_none().0,
1410                mut_override(event.to_glib_none().0),
1411            ))
1412        }
1413    }
1414
1415    #[doc(alias = "gtk_widget_set_accel_path")]
1416    fn set_accel_path(&self, accel_path: Option<&str>, accel_group: Option<&impl IsA<AccelGroup>>) {
1417        unsafe {
1418            ffi::gtk_widget_set_accel_path(
1419                self.as_ref().to_glib_none().0,
1420                accel_path.to_glib_none().0,
1421                accel_group.map(|p| p.as_ref()).to_glib_none().0,
1422            );
1423        }
1424    }
1425
1426    #[doc(alias = "gtk_widget_set_allocation")]
1427    fn set_allocation(&self, allocation: &Allocation) {
1428        unsafe {
1429            ffi::gtk_widget_set_allocation(
1430                self.as_ref().to_glib_none().0,
1431                allocation.to_glib_none().0,
1432            );
1433        }
1434    }
1435
1436    #[doc(alias = "gtk_widget_set_app_paintable")]
1437    #[doc(alias = "app-paintable")]
1438    fn set_app_paintable(&self, app_paintable: bool) {
1439        unsafe {
1440            ffi::gtk_widget_set_app_paintable(
1441                self.as_ref().to_glib_none().0,
1442                app_paintable.into_glib(),
1443            );
1444        }
1445    }
1446
1447    #[doc(alias = "gtk_widget_set_can_default")]
1448    #[doc(alias = "can-default")]
1449    fn set_can_default(&self, can_default: bool) {
1450        unsafe {
1451            ffi::gtk_widget_set_can_default(
1452                self.as_ref().to_glib_none().0,
1453                can_default.into_glib(),
1454            );
1455        }
1456    }
1457
1458    #[doc(alias = "gtk_widget_set_can_focus")]
1459    #[doc(alias = "can-focus")]
1460    fn set_can_focus(&self, can_focus: bool) {
1461        unsafe {
1462            ffi::gtk_widget_set_can_focus(self.as_ref().to_glib_none().0, can_focus.into_glib());
1463        }
1464    }
1465
1466    #[doc(alias = "gtk_widget_set_child_visible")]
1467    fn set_child_visible(&self, is_visible: bool) {
1468        unsafe {
1469            ffi::gtk_widget_set_child_visible(
1470                self.as_ref().to_glib_none().0,
1471                is_visible.into_glib(),
1472            );
1473        }
1474    }
1475
1476    #[doc(alias = "gtk_widget_set_clip")]
1477    fn set_clip(&self, clip: &Allocation) {
1478        unsafe {
1479            ffi::gtk_widget_set_clip(self.as_ref().to_glib_none().0, clip.to_glib_none().0);
1480        }
1481    }
1482
1483    #[doc(alias = "gtk_widget_set_device_enabled")]
1484    fn set_device_enabled(&self, device: &gdk::Device, enabled: bool) {
1485        unsafe {
1486            ffi::gtk_widget_set_device_enabled(
1487                self.as_ref().to_glib_none().0,
1488                device.to_glib_none().0,
1489                enabled.into_glib(),
1490            );
1491        }
1492    }
1493
1494    #[doc(alias = "gtk_widget_set_device_events")]
1495    fn set_device_events(&self, device: &gdk::Device, events: gdk::EventMask) {
1496        unsafe {
1497            ffi::gtk_widget_set_device_events(
1498                self.as_ref().to_glib_none().0,
1499                device.to_glib_none().0,
1500                events.into_glib(),
1501            );
1502        }
1503    }
1504
1505    #[doc(alias = "gtk_widget_set_direction")]
1506    fn set_direction(&self, dir: TextDirection) {
1507        unsafe {
1508            ffi::gtk_widget_set_direction(self.as_ref().to_glib_none().0, dir.into_glib());
1509        }
1510    }
1511
1512    #[doc(alias = "gtk_widget_set_focus_on_click")]
1513    #[doc(alias = "focus-on-click")]
1514    fn set_focus_on_click(&self, focus_on_click: bool) {
1515        unsafe {
1516            ffi::gtk_widget_set_focus_on_click(
1517                self.as_ref().to_glib_none().0,
1518                focus_on_click.into_glib(),
1519            );
1520        }
1521    }
1522
1523    #[doc(alias = "gtk_widget_set_font_map")]
1524    fn set_font_map(&self, font_map: Option<&impl IsA<pango::FontMap>>) {
1525        unsafe {
1526            ffi::gtk_widget_set_font_map(
1527                self.as_ref().to_glib_none().0,
1528                font_map.map(|p| p.as_ref()).to_glib_none().0,
1529            );
1530        }
1531    }
1532
1533    #[doc(alias = "gtk_widget_set_font_options")]
1534    fn set_font_options(&self, options: Option<&cairo::FontOptions>) {
1535        unsafe {
1536            ffi::gtk_widget_set_font_options(
1537                self.as_ref().to_glib_none().0,
1538                options.to_glib_none().0,
1539            );
1540        }
1541    }
1542
1543    #[doc(alias = "gtk_widget_set_halign")]
1544    #[doc(alias = "halign")]
1545    fn set_halign(&self, align: Align) {
1546        unsafe {
1547            ffi::gtk_widget_set_halign(self.as_ref().to_glib_none().0, align.into_glib());
1548        }
1549    }
1550
1551    #[doc(alias = "gtk_widget_set_has_tooltip")]
1552    #[doc(alias = "has-tooltip")]
1553    fn set_has_tooltip(&self, has_tooltip: bool) {
1554        unsafe {
1555            ffi::gtk_widget_set_has_tooltip(
1556                self.as_ref().to_glib_none().0,
1557                has_tooltip.into_glib(),
1558            );
1559        }
1560    }
1561
1562    #[doc(alias = "gtk_widget_set_has_window")]
1563    fn set_has_window(&self, has_window: bool) {
1564        unsafe {
1565            ffi::gtk_widget_set_has_window(self.as_ref().to_glib_none().0, has_window.into_glib());
1566        }
1567    }
1568
1569    #[doc(alias = "gtk_widget_set_hexpand")]
1570    #[doc(alias = "hexpand")]
1571    fn set_hexpand(&self, expand: bool) {
1572        unsafe {
1573            ffi::gtk_widget_set_hexpand(self.as_ref().to_glib_none().0, expand.into_glib());
1574        }
1575    }
1576
1577    #[doc(alias = "gtk_widget_set_hexpand_set")]
1578    #[doc(alias = "hexpand-set")]
1579    fn set_hexpand_set(&self, set: bool) {
1580        unsafe {
1581            ffi::gtk_widget_set_hexpand_set(self.as_ref().to_glib_none().0, set.into_glib());
1582        }
1583    }
1584
1585    #[doc(alias = "gtk_widget_set_mapped")]
1586    fn set_mapped(&self, mapped: bool) {
1587        unsafe {
1588            ffi::gtk_widget_set_mapped(self.as_ref().to_glib_none().0, mapped.into_glib());
1589        }
1590    }
1591
1592    #[doc(alias = "gtk_widget_set_margin_bottom")]
1593    #[doc(alias = "margin-bottom")]
1594    fn set_margin_bottom(&self, margin: i32) {
1595        unsafe {
1596            ffi::gtk_widget_set_margin_bottom(self.as_ref().to_glib_none().0, margin);
1597        }
1598    }
1599
1600    #[doc(alias = "gtk_widget_set_margin_end")]
1601    #[doc(alias = "margin-end")]
1602    fn set_margin_end(&self, margin: i32) {
1603        unsafe {
1604            ffi::gtk_widget_set_margin_end(self.as_ref().to_glib_none().0, margin);
1605        }
1606    }
1607
1608    #[doc(alias = "gtk_widget_set_margin_start")]
1609    #[doc(alias = "margin-start")]
1610    fn set_margin_start(&self, margin: i32) {
1611        unsafe {
1612            ffi::gtk_widget_set_margin_start(self.as_ref().to_glib_none().0, margin);
1613        }
1614    }
1615
1616    #[doc(alias = "gtk_widget_set_margin_top")]
1617    #[doc(alias = "margin-top")]
1618    fn set_margin_top(&self, margin: i32) {
1619        unsafe {
1620            ffi::gtk_widget_set_margin_top(self.as_ref().to_glib_none().0, margin);
1621        }
1622    }
1623
1624    #[doc(alias = "gtk_widget_set_name")]
1625    #[doc(alias = "set_name")]
1626    #[doc(alias = "name")]
1627    fn set_widget_name(&self, name: &str) {
1628        unsafe {
1629            ffi::gtk_widget_set_name(self.as_ref().to_glib_none().0, name.to_glib_none().0);
1630        }
1631    }
1632
1633    #[doc(alias = "gtk_widget_set_no_show_all")]
1634    #[doc(alias = "no-show-all")]
1635    fn set_no_show_all(&self, no_show_all: bool) {
1636        unsafe {
1637            ffi::gtk_widget_set_no_show_all(
1638                self.as_ref().to_glib_none().0,
1639                no_show_all.into_glib(),
1640            );
1641        }
1642    }
1643
1644    #[doc(alias = "gtk_widget_set_opacity")]
1645    #[doc(alias = "opacity")]
1646    fn set_opacity(&self, opacity: f64) {
1647        unsafe {
1648            ffi::gtk_widget_set_opacity(self.as_ref().to_glib_none().0, opacity);
1649        }
1650    }
1651
1652    #[doc(alias = "gtk_widget_set_parent")]
1653    #[doc(alias = "parent")]
1654    fn set_parent(&self, parent: &impl IsA<Widget>) {
1655        unsafe {
1656            ffi::gtk_widget_set_parent(
1657                self.as_ref().to_glib_none().0,
1658                parent.as_ref().to_glib_none().0,
1659            );
1660        }
1661    }
1662
1663    #[doc(alias = "gtk_widget_set_parent_window")]
1664    fn set_parent_window(&self, parent_window: &gdk::Window) {
1665        unsafe {
1666            ffi::gtk_widget_set_parent_window(
1667                self.as_ref().to_glib_none().0,
1668                parent_window.to_glib_none().0,
1669            );
1670        }
1671    }
1672
1673    #[doc(alias = "gtk_widget_set_realized")]
1674    fn set_realized(&self, realized: bool) {
1675        unsafe {
1676            ffi::gtk_widget_set_realized(self.as_ref().to_glib_none().0, realized.into_glib());
1677        }
1678    }
1679
1680    #[doc(alias = "gtk_widget_set_receives_default")]
1681    #[doc(alias = "receives-default")]
1682    fn set_receives_default(&self, receives_default: bool) {
1683        unsafe {
1684            ffi::gtk_widget_set_receives_default(
1685                self.as_ref().to_glib_none().0,
1686                receives_default.into_glib(),
1687            );
1688        }
1689    }
1690
1691    #[doc(alias = "gtk_widget_set_redraw_on_allocate")]
1692    fn set_redraw_on_allocate(&self, redraw_on_allocate: bool) {
1693        unsafe {
1694            ffi::gtk_widget_set_redraw_on_allocate(
1695                self.as_ref().to_glib_none().0,
1696                redraw_on_allocate.into_glib(),
1697            );
1698        }
1699    }
1700
1701    #[doc(alias = "gtk_widget_set_sensitive")]
1702    #[doc(alias = "sensitive")]
1703    fn set_sensitive(&self, sensitive: bool) {
1704        unsafe {
1705            ffi::gtk_widget_set_sensitive(self.as_ref().to_glib_none().0, sensitive.into_glib());
1706        }
1707    }
1708
1709    #[doc(alias = "gtk_widget_set_size_request")]
1710    fn set_size_request(&self, width: i32, height: i32) {
1711        unsafe {
1712            ffi::gtk_widget_set_size_request(self.as_ref().to_glib_none().0, width, height);
1713        }
1714    }
1715
1716    #[doc(alias = "gtk_widget_set_state_flags")]
1717    fn set_state_flags(&self, flags: StateFlags, clear: bool) {
1718        unsafe {
1719            ffi::gtk_widget_set_state_flags(
1720                self.as_ref().to_glib_none().0,
1721                flags.into_glib(),
1722                clear.into_glib(),
1723            );
1724        }
1725    }
1726
1727    #[doc(alias = "gtk_widget_set_support_multidevice")]
1728    fn set_support_multidevice(&self, support_multidevice: bool) {
1729        unsafe {
1730            ffi::gtk_widget_set_support_multidevice(
1731                self.as_ref().to_glib_none().0,
1732                support_multidevice.into_glib(),
1733            );
1734        }
1735    }
1736
1737    #[doc(alias = "gtk_widget_set_tooltip_markup")]
1738    #[doc(alias = "tooltip-markup")]
1739    fn set_tooltip_markup(&self, markup: Option<&str>) {
1740        unsafe {
1741            ffi::gtk_widget_set_tooltip_markup(
1742                self.as_ref().to_glib_none().0,
1743                markup.to_glib_none().0,
1744            );
1745        }
1746    }
1747
1748    #[doc(alias = "gtk_widget_set_tooltip_text")]
1749    #[doc(alias = "tooltip-text")]
1750    fn set_tooltip_text(&self, text: Option<&str>) {
1751        unsafe {
1752            ffi::gtk_widget_set_tooltip_text(self.as_ref().to_glib_none().0, text.to_glib_none().0);
1753        }
1754    }
1755
1756    #[doc(alias = "gtk_widget_set_tooltip_window")]
1757    fn set_tooltip_window(&self, custom_window: Option<&impl IsA<Window>>) {
1758        unsafe {
1759            ffi::gtk_widget_set_tooltip_window(
1760                self.as_ref().to_glib_none().0,
1761                custom_window.map(|p| p.as_ref()).to_glib_none().0,
1762            );
1763        }
1764    }
1765
1766    #[doc(alias = "gtk_widget_set_valign")]
1767    #[doc(alias = "valign")]
1768    fn set_valign(&self, align: Align) {
1769        unsafe {
1770            ffi::gtk_widget_set_valign(self.as_ref().to_glib_none().0, align.into_glib());
1771        }
1772    }
1773
1774    #[doc(alias = "gtk_widget_set_vexpand")]
1775    #[doc(alias = "vexpand")]
1776    fn set_vexpand(&self, expand: bool) {
1777        unsafe {
1778            ffi::gtk_widget_set_vexpand(self.as_ref().to_glib_none().0, expand.into_glib());
1779        }
1780    }
1781
1782    #[doc(alias = "gtk_widget_set_vexpand_set")]
1783    #[doc(alias = "vexpand-set")]
1784    fn set_vexpand_set(&self, set: bool) {
1785        unsafe {
1786            ffi::gtk_widget_set_vexpand_set(self.as_ref().to_glib_none().0, set.into_glib());
1787        }
1788    }
1789
1790    #[doc(alias = "gtk_widget_set_visible")]
1791    #[doc(alias = "visible")]
1792    fn set_visible(&self, visible: bool) {
1793        unsafe {
1794            ffi::gtk_widget_set_visible(self.as_ref().to_glib_none().0, visible.into_glib());
1795        }
1796    }
1797
1798    #[doc(alias = "gtk_widget_set_visual")]
1799    fn set_visual(&self, visual: Option<&gdk::Visual>) {
1800        unsafe {
1801            ffi::gtk_widget_set_visual(self.as_ref().to_glib_none().0, visual.to_glib_none().0);
1802        }
1803    }
1804
1805    #[doc(alias = "gtk_widget_set_window")]
1806    fn set_window(&self, window: gdk::Window) {
1807        unsafe {
1808            ffi::gtk_widget_set_window(self.as_ref().to_glib_none().0, window.into_glib_ptr());
1809        }
1810    }
1811
1812    #[doc(alias = "gtk_widget_shape_combine_region")]
1813    fn shape_combine_region(&self, region: Option<&cairo::Region>) {
1814        unsafe {
1815            ffi::gtk_widget_shape_combine_region(
1816                self.as_ref().to_glib_none().0,
1817                mut_override(region.to_glib_none().0),
1818            );
1819        }
1820    }
1821
1822    #[doc(alias = "gtk_widget_show")]
1823    fn show(&self) {
1824        unsafe {
1825            ffi::gtk_widget_show(self.as_ref().to_glib_none().0);
1826        }
1827    }
1828
1829    #[doc(alias = "gtk_widget_show_all")]
1830    fn show_all(&self) {
1831        unsafe {
1832            ffi::gtk_widget_show_all(self.as_ref().to_glib_none().0);
1833        }
1834    }
1835
1836    #[doc(alias = "gtk_widget_show_now")]
1837    fn show_now(&self) {
1838        unsafe {
1839            ffi::gtk_widget_show_now(self.as_ref().to_glib_none().0);
1840        }
1841    }
1842
1843    #[doc(alias = "gtk_widget_size_allocate")]
1844    fn size_allocate(&self, allocation: &Allocation) {
1845        unsafe {
1846            ffi::gtk_widget_size_allocate(
1847                self.as_ref().to_glib_none().0,
1848                mut_override(allocation.to_glib_none().0),
1849            );
1850        }
1851    }
1852
1853    #[doc(alias = "gtk_widget_size_allocate_with_baseline")]
1854    fn size_allocate_with_baseline(&self, allocation: &mut Allocation, baseline: i32) {
1855        unsafe {
1856            ffi::gtk_widget_size_allocate_with_baseline(
1857                self.as_ref().to_glib_none().0,
1858                allocation.to_glib_none_mut().0,
1859                baseline,
1860            );
1861        }
1862    }
1863
1864    //#[doc(alias = "gtk_widget_style_get")]
1865    //fn style_get(&self, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) {
1866    //    unsafe { TODO: call ffi:gtk_widget_style_get() }
1867    //}
1868
1869    #[doc(alias = "gtk_widget_style_get_property")]
1870    fn style_get_property(&self, property_name: &str) -> glib::Value {
1871        unsafe {
1872            let mut value = glib::Value::uninitialized();
1873            ffi::gtk_widget_style_get_property(
1874                self.as_ref().to_glib_none().0,
1875                property_name.to_glib_none().0,
1876                value.to_glib_none_mut().0,
1877            );
1878            value
1879        }
1880    }
1881
1882    //#[doc(alias = "gtk_widget_style_get_valist")]
1883    //fn style_get_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) {
1884    //    unsafe { TODO: call ffi:gtk_widget_style_get_valist() }
1885    //}
1886
1887    #[doc(alias = "gtk_widget_thaw_child_notify")]
1888    fn thaw_child_notify(&self) {
1889        unsafe {
1890            ffi::gtk_widget_thaw_child_notify(self.as_ref().to_glib_none().0);
1891        }
1892    }
1893
1894    #[doc(alias = "gtk_widget_translate_coordinates")]
1895    fn translate_coordinates(
1896        &self,
1897        dest_widget: &impl IsA<Widget>,
1898        src_x: i32,
1899        src_y: i32,
1900    ) -> Option<(i32, i32)> {
1901        unsafe {
1902            let mut dest_x = std::mem::MaybeUninit::uninit();
1903            let mut dest_y = std::mem::MaybeUninit::uninit();
1904            let ret = from_glib(ffi::gtk_widget_translate_coordinates(
1905                self.as_ref().to_glib_none().0,
1906                dest_widget.as_ref().to_glib_none().0,
1907                src_x,
1908                src_y,
1909                dest_x.as_mut_ptr(),
1910                dest_y.as_mut_ptr(),
1911            ));
1912            if ret {
1913                Some((dest_x.assume_init(), dest_y.assume_init()))
1914            } else {
1915                None
1916            }
1917        }
1918    }
1919
1920    #[doc(alias = "gtk_widget_trigger_tooltip_query")]
1921    fn trigger_tooltip_query(&self) {
1922        unsafe {
1923            ffi::gtk_widget_trigger_tooltip_query(self.as_ref().to_glib_none().0);
1924        }
1925    }
1926
1927    #[doc(alias = "gtk_widget_unmap")]
1928    fn unmap(&self) {
1929        unsafe {
1930            ffi::gtk_widget_unmap(self.as_ref().to_glib_none().0);
1931        }
1932    }
1933
1934    #[doc(alias = "gtk_widget_unparent")]
1935    fn unparent(&self) {
1936        unsafe {
1937            ffi::gtk_widget_unparent(self.as_ref().to_glib_none().0);
1938        }
1939    }
1940
1941    #[doc(alias = "gtk_widget_unrealize")]
1942    fn unrealize(&self) {
1943        unsafe {
1944            ffi::gtk_widget_unrealize(self.as_ref().to_glib_none().0);
1945        }
1946    }
1947
1948    #[doc(alias = "gtk_widget_unregister_window")]
1949    fn unregister_window(&self, window: &gdk::Window) {
1950        unsafe {
1951            ffi::gtk_widget_unregister_window(
1952                self.as_ref().to_glib_none().0,
1953                window.to_glib_none().0,
1954            );
1955        }
1956    }
1957
1958    #[doc(alias = "gtk_widget_unset_state_flags")]
1959    fn unset_state_flags(&self, flags: StateFlags) {
1960        unsafe {
1961            ffi::gtk_widget_unset_state_flags(self.as_ref().to_glib_none().0, flags.into_glib());
1962        }
1963    }
1964
1965    #[doc(alias = "composite-child")]
1966    fn is_composite_child(&self) -> bool {
1967        ObjectExt::property(self.as_ref(), "composite-child")
1968    }
1969
1970    fn expands(&self) -> bool {
1971        ObjectExt::property(self.as_ref(), "expand")
1972    }
1973
1974    fn set_expand(&self, expand: bool) {
1975        ObjectExt::set_property(self.as_ref(), "expand", expand)
1976    }
1977
1978    #[doc(alias = "has-default")]
1979    fn set_has_default(&self, has_default: bool) {
1980        ObjectExt::set_property(self.as_ref(), "has-default", has_default)
1981    }
1982
1983    #[doc(alias = "has-focus")]
1984    fn set_has_focus(&self, has_focus: bool) {
1985        ObjectExt::set_property(self.as_ref(), "has-focus", has_focus)
1986    }
1987
1988    #[doc(alias = "height-request")]
1989    fn height_request(&self) -> i32 {
1990        ObjectExt::property(self.as_ref(), "height-request")
1991    }
1992
1993    #[doc(alias = "height-request")]
1994    fn set_height_request(&self, height_request: i32) {
1995        ObjectExt::set_property(self.as_ref(), "height-request", height_request)
1996    }
1997
1998    #[doc(alias = "is-focus")]
1999    fn set_is_focus(&self, is_focus: bool) {
2000        ObjectExt::set_property(self.as_ref(), "is-focus", is_focus)
2001    }
2002
2003    fn margin(&self) -> i32 {
2004        ObjectExt::property(self.as_ref(), "margin")
2005    }
2006
2007    fn set_margin(&self, margin: i32) {
2008        ObjectExt::set_property(self.as_ref(), "margin", margin)
2009    }
2010
2011    #[doc(alias = "width-request")]
2012    fn width_request(&self) -> i32 {
2013        ObjectExt::property(self.as_ref(), "width-request")
2014    }
2015
2016    #[doc(alias = "width-request")]
2017    fn set_width_request(&self, width_request: i32) {
2018        ObjectExt::set_property(self.as_ref(), "width-request", width_request)
2019    }
2020
2021    #[doc(alias = "accel-closures-changed")]
2022    fn connect_accel_closures_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2023        unsafe extern "C" fn accel_closures_changed_trampoline<
2024            P: IsA<Widget>,
2025            F: Fn(&P) + 'static,
2026        >(
2027            this: *mut ffi::GtkWidget,
2028            f: glib::ffi::gpointer,
2029        ) {
2030            unsafe {
2031                let f: &F = &*(f as *const F);
2032                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2033            }
2034        }
2035        unsafe {
2036            let f: Box_<F> = Box_::new(f);
2037            connect_raw(
2038                self.as_ptr() as *mut _,
2039                c"accel-closures-changed".as_ptr(),
2040                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2041                    accel_closures_changed_trampoline::<Self, F> as *const (),
2042                )),
2043                Box_::into_raw(f),
2044            )
2045        }
2046    }
2047
2048    #[doc(alias = "button-press-event")]
2049    fn connect_button_press_event<
2050        F: Fn(&Self, &gdk::EventButton) -> glib::Propagation + 'static,
2051    >(
2052        &self,
2053        f: F,
2054    ) -> SignalHandlerId {
2055        unsafe extern "C" fn button_press_event_trampoline<
2056            P: IsA<Widget>,
2057            F: Fn(&P, &gdk::EventButton) -> glib::Propagation + 'static,
2058        >(
2059            this: *mut ffi::GtkWidget,
2060            event: *mut gdk::ffi::GdkEventButton,
2061            f: glib::ffi::gpointer,
2062        ) -> glib::ffi::gboolean {
2063            unsafe {
2064                let f: &F = &*(f as *const F);
2065                f(
2066                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2067                    &from_glib_borrow(event),
2068                )
2069                .into_glib()
2070            }
2071        }
2072        unsafe {
2073            let f: Box_<F> = Box_::new(f);
2074            connect_raw(
2075                self.as_ptr() as *mut _,
2076                c"button-press-event".as_ptr(),
2077                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2078                    button_press_event_trampoline::<Self, F> as *const (),
2079                )),
2080                Box_::into_raw(f),
2081            )
2082        }
2083    }
2084
2085    #[doc(alias = "button-release-event")]
2086    fn connect_button_release_event<
2087        F: Fn(&Self, &gdk::EventButton) -> glib::Propagation + 'static,
2088    >(
2089        &self,
2090        f: F,
2091    ) -> SignalHandlerId {
2092        unsafe extern "C" fn button_release_event_trampoline<
2093            P: IsA<Widget>,
2094            F: Fn(&P, &gdk::EventButton) -> glib::Propagation + 'static,
2095        >(
2096            this: *mut ffi::GtkWidget,
2097            event: *mut gdk::ffi::GdkEventButton,
2098            f: glib::ffi::gpointer,
2099        ) -> glib::ffi::gboolean {
2100            unsafe {
2101                let f: &F = &*(f as *const F);
2102                f(
2103                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2104                    &from_glib_borrow(event),
2105                )
2106                .into_glib()
2107            }
2108        }
2109        unsafe {
2110            let f: Box_<F> = Box_::new(f);
2111            connect_raw(
2112                self.as_ptr() as *mut _,
2113                c"button-release-event".as_ptr(),
2114                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2115                    button_release_event_trampoline::<Self, F> as *const (),
2116                )),
2117                Box_::into_raw(f),
2118            )
2119        }
2120    }
2121
2122    #[doc(alias = "child-notify")]
2123    fn connect_child_notify<F: Fn(&Self, &glib::ParamSpec) + 'static>(
2124        &self,
2125        detail: Option<&str>,
2126        f: F,
2127    ) -> SignalHandlerId {
2128        unsafe extern "C" fn child_notify_trampoline<
2129            P: IsA<Widget>,
2130            F: Fn(&P, &glib::ParamSpec) + 'static,
2131        >(
2132            this: *mut ffi::GtkWidget,
2133            child_property: *mut glib::gobject_ffi::GParamSpec,
2134            f: glib::ffi::gpointer,
2135        ) {
2136            unsafe {
2137                let f: &F = &*(f as *const F);
2138                f(
2139                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2140                    &from_glib_borrow(child_property),
2141                )
2142            }
2143        }
2144        unsafe {
2145            let f: Box_<F> = Box_::new(f);
2146            let detailed_signal_name = detail.map(|name| format!("child-notify::{name}\0"));
2147            let signal_name = detailed_signal_name.as_ref().map_or(c"child-notify", |n| {
2148                std::ffi::CStr::from_bytes_with_nul_unchecked(n.as_bytes())
2149            });
2150            connect_raw(
2151                self.as_ptr() as *mut _,
2152                signal_name.as_ptr(),
2153                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2154                    child_notify_trampoline::<Self, F> as *const (),
2155                )),
2156                Box_::into_raw(f),
2157            )
2158        }
2159    }
2160
2161    #[doc(alias = "configure-event")]
2162    fn connect_configure_event<F: Fn(&Self, &gdk::EventConfigure) -> bool + 'static>(
2163        &self,
2164        f: F,
2165    ) -> SignalHandlerId {
2166        unsafe extern "C" fn configure_event_trampoline<
2167            P: IsA<Widget>,
2168            F: Fn(&P, &gdk::EventConfigure) -> bool + 'static,
2169        >(
2170            this: *mut ffi::GtkWidget,
2171            event: *mut gdk::ffi::GdkEventConfigure,
2172            f: glib::ffi::gpointer,
2173        ) -> glib::ffi::gboolean {
2174            unsafe {
2175                let f: &F = &*(f as *const F);
2176                f(
2177                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2178                    &from_glib_borrow(event),
2179                )
2180                .into_glib()
2181            }
2182        }
2183        unsafe {
2184            let f: Box_<F> = Box_::new(f);
2185            connect_raw(
2186                self.as_ptr() as *mut _,
2187                c"configure-event".as_ptr(),
2188                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2189                    configure_event_trampoline::<Self, F> as *const (),
2190                )),
2191                Box_::into_raw(f),
2192            )
2193        }
2194    }
2195
2196    #[doc(alias = "damage-event")]
2197    fn connect_damage_event<F: Fn(&Self, &gdk::EventExpose) -> bool + 'static>(
2198        &self,
2199        f: F,
2200    ) -> SignalHandlerId {
2201        unsafe extern "C" fn damage_event_trampoline<
2202            P: IsA<Widget>,
2203            F: Fn(&P, &gdk::EventExpose) -> bool + 'static,
2204        >(
2205            this: *mut ffi::GtkWidget,
2206            event: *mut gdk::ffi::GdkEventExpose,
2207            f: glib::ffi::gpointer,
2208        ) -> glib::ffi::gboolean {
2209            unsafe {
2210                let f: &F = &*(f as *const F);
2211                f(
2212                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2213                    &from_glib_borrow(event),
2214                )
2215                .into_glib()
2216            }
2217        }
2218        unsafe {
2219            let f: Box_<F> = Box_::new(f);
2220            connect_raw(
2221                self.as_ptr() as *mut _,
2222                c"damage-event".as_ptr(),
2223                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2224                    damage_event_trampoline::<Self, F> as *const (),
2225                )),
2226                Box_::into_raw(f),
2227            )
2228        }
2229    }
2230
2231    #[doc(alias = "delete-event")]
2232    fn connect_delete_event<F: Fn(&Self, &gdk::Event) -> glib::Propagation + 'static>(
2233        &self,
2234        f: F,
2235    ) -> SignalHandlerId {
2236        unsafe extern "C" fn delete_event_trampoline<
2237            P: IsA<Widget>,
2238            F: Fn(&P, &gdk::Event) -> glib::Propagation + 'static,
2239        >(
2240            this: *mut ffi::GtkWidget,
2241            event: *mut gdk::ffi::GdkEvent,
2242            f: glib::ffi::gpointer,
2243        ) -> glib::ffi::gboolean {
2244            unsafe {
2245                let f: &F = &*(f as *const F);
2246                f(
2247                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2248                    &from_glib_none(event),
2249                )
2250                .into_glib()
2251            }
2252        }
2253        unsafe {
2254            let f: Box_<F> = Box_::new(f);
2255            connect_raw(
2256                self.as_ptr() as *mut _,
2257                c"delete-event".as_ptr(),
2258                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2259                    delete_event_trampoline::<Self, F> as *const (),
2260                )),
2261                Box_::into_raw(f),
2262            )
2263        }
2264    }
2265
2266    #[doc(alias = "destroy")]
2267    fn connect_destroy<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2268        unsafe extern "C" fn destroy_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2269            this: *mut ffi::GtkWidget,
2270            f: glib::ffi::gpointer,
2271        ) {
2272            unsafe {
2273                let f: &F = &*(f as *const F);
2274                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2275            }
2276        }
2277        unsafe {
2278            let f: Box_<F> = Box_::new(f);
2279            connect_raw(
2280                self.as_ptr() as *mut _,
2281                c"destroy".as_ptr(),
2282                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2283                    destroy_trampoline::<Self, F> as *const (),
2284                )),
2285                Box_::into_raw(f),
2286            )
2287        }
2288    }
2289
2290    #[doc(alias = "destroy-event")]
2291    fn connect_destroy_event<F: Fn(&Self, &gdk::Event) -> glib::Propagation + 'static>(
2292        &self,
2293        f: F,
2294    ) -> SignalHandlerId {
2295        unsafe extern "C" fn destroy_event_trampoline<
2296            P: IsA<Widget>,
2297            F: Fn(&P, &gdk::Event) -> glib::Propagation + 'static,
2298        >(
2299            this: *mut ffi::GtkWidget,
2300            event: *mut gdk::ffi::GdkEvent,
2301            f: glib::ffi::gpointer,
2302        ) -> glib::ffi::gboolean {
2303            unsafe {
2304                let f: &F = &*(f as *const F);
2305                f(
2306                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2307                    &from_glib_none(event),
2308                )
2309                .into_glib()
2310            }
2311        }
2312        unsafe {
2313            let f: Box_<F> = Box_::new(f);
2314            connect_raw(
2315                self.as_ptr() as *mut _,
2316                c"destroy-event".as_ptr(),
2317                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2318                    destroy_event_trampoline::<Self, F> as *const (),
2319                )),
2320                Box_::into_raw(f),
2321            )
2322        }
2323    }
2324
2325    #[doc(alias = "direction-changed")]
2326    fn connect_direction_changed<F: Fn(&Self, TextDirection) + 'static>(
2327        &self,
2328        f: F,
2329    ) -> SignalHandlerId {
2330        unsafe extern "C" fn direction_changed_trampoline<
2331            P: IsA<Widget>,
2332            F: Fn(&P, TextDirection) + 'static,
2333        >(
2334            this: *mut ffi::GtkWidget,
2335            previous_direction: ffi::GtkTextDirection,
2336            f: glib::ffi::gpointer,
2337        ) {
2338            unsafe {
2339                let f: &F = &*(f as *const F);
2340                f(
2341                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2342                    from_glib(previous_direction),
2343                )
2344            }
2345        }
2346        unsafe {
2347            let f: Box_<F> = Box_::new(f);
2348            connect_raw(
2349                self.as_ptr() as *mut _,
2350                c"direction-changed".as_ptr(),
2351                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2352                    direction_changed_trampoline::<Self, F> as *const (),
2353                )),
2354                Box_::into_raw(f),
2355            )
2356        }
2357    }
2358
2359    #[doc(alias = "drag-begin")]
2360    fn connect_drag_begin<F: Fn(&Self, &gdk::DragContext) + 'static>(
2361        &self,
2362        f: F,
2363    ) -> SignalHandlerId {
2364        unsafe extern "C" fn drag_begin_trampoline<
2365            P: IsA<Widget>,
2366            F: Fn(&P, &gdk::DragContext) + 'static,
2367        >(
2368            this: *mut ffi::GtkWidget,
2369            context: *mut gdk::ffi::GdkDragContext,
2370            f: glib::ffi::gpointer,
2371        ) {
2372            unsafe {
2373                let f: &F = &*(f as *const F);
2374                f(
2375                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2376                    &from_glib_borrow(context),
2377                )
2378            }
2379        }
2380        unsafe {
2381            let f: Box_<F> = Box_::new(f);
2382            connect_raw(
2383                self.as_ptr() as *mut _,
2384                c"drag-begin".as_ptr(),
2385                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2386                    drag_begin_trampoline::<Self, F> as *const (),
2387                )),
2388                Box_::into_raw(f),
2389            )
2390        }
2391    }
2392
2393    #[doc(alias = "drag-data-delete")]
2394    fn connect_drag_data_delete<F: Fn(&Self, &gdk::DragContext) + 'static>(
2395        &self,
2396        f: F,
2397    ) -> SignalHandlerId {
2398        unsafe extern "C" fn drag_data_delete_trampoline<
2399            P: IsA<Widget>,
2400            F: Fn(&P, &gdk::DragContext) + 'static,
2401        >(
2402            this: *mut ffi::GtkWidget,
2403            context: *mut gdk::ffi::GdkDragContext,
2404            f: glib::ffi::gpointer,
2405        ) {
2406            unsafe {
2407                let f: &F = &*(f as *const F);
2408                f(
2409                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2410                    &from_glib_borrow(context),
2411                )
2412            }
2413        }
2414        unsafe {
2415            let f: Box_<F> = Box_::new(f);
2416            connect_raw(
2417                self.as_ptr() as *mut _,
2418                c"drag-data-delete".as_ptr(),
2419                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2420                    drag_data_delete_trampoline::<Self, F> as *const (),
2421                )),
2422                Box_::into_raw(f),
2423            )
2424        }
2425    }
2426
2427    #[doc(alias = "drag-data-get")]
2428    fn connect_drag_data_get<
2429        F: Fn(&Self, &gdk::DragContext, &SelectionData, u32, u32) + 'static,
2430    >(
2431        &self,
2432        f: F,
2433    ) -> SignalHandlerId {
2434        unsafe extern "C" fn drag_data_get_trampoline<
2435            P: IsA<Widget>,
2436            F: Fn(&P, &gdk::DragContext, &SelectionData, u32, u32) + 'static,
2437        >(
2438            this: *mut ffi::GtkWidget,
2439            context: *mut gdk::ffi::GdkDragContext,
2440            data: *mut ffi::GtkSelectionData,
2441            info: std::ffi::c_uint,
2442            time: std::ffi::c_uint,
2443            f: glib::ffi::gpointer,
2444        ) {
2445            unsafe {
2446                let f: &F = &*(f as *const F);
2447                f(
2448                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2449                    &from_glib_borrow(context),
2450                    &from_glib_borrow(data),
2451                    info,
2452                    time,
2453                )
2454            }
2455        }
2456        unsafe {
2457            let f: Box_<F> = Box_::new(f);
2458            connect_raw(
2459                self.as_ptr() as *mut _,
2460                c"drag-data-get".as_ptr(),
2461                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2462                    drag_data_get_trampoline::<Self, F> as *const (),
2463                )),
2464                Box_::into_raw(f),
2465            )
2466        }
2467    }
2468
2469    #[doc(alias = "drag-data-received")]
2470    fn connect_drag_data_received<
2471        F: Fn(&Self, &gdk::DragContext, i32, i32, &SelectionData, u32, u32) + 'static,
2472    >(
2473        &self,
2474        f: F,
2475    ) -> SignalHandlerId {
2476        unsafe extern "C" fn drag_data_received_trampoline<
2477            P: IsA<Widget>,
2478            F: Fn(&P, &gdk::DragContext, i32, i32, &SelectionData, u32, u32) + 'static,
2479        >(
2480            this: *mut ffi::GtkWidget,
2481            context: *mut gdk::ffi::GdkDragContext,
2482            x: std::ffi::c_int,
2483            y: std::ffi::c_int,
2484            data: *mut ffi::GtkSelectionData,
2485            info: std::ffi::c_uint,
2486            time: std::ffi::c_uint,
2487            f: glib::ffi::gpointer,
2488        ) {
2489            unsafe {
2490                let f: &F = &*(f as *const F);
2491                f(
2492                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2493                    &from_glib_borrow(context),
2494                    x,
2495                    y,
2496                    &from_glib_borrow(data),
2497                    info,
2498                    time,
2499                )
2500            }
2501        }
2502        unsafe {
2503            let f: Box_<F> = Box_::new(f);
2504            connect_raw(
2505                self.as_ptr() as *mut _,
2506                c"drag-data-received".as_ptr(),
2507                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2508                    drag_data_received_trampoline::<Self, F> as *const (),
2509                )),
2510                Box_::into_raw(f),
2511            )
2512        }
2513    }
2514
2515    #[doc(alias = "drag-drop")]
2516    fn connect_drag_drop<F: Fn(&Self, &gdk::DragContext, i32, i32, u32) -> bool + 'static>(
2517        &self,
2518        f: F,
2519    ) -> SignalHandlerId {
2520        unsafe extern "C" fn drag_drop_trampoline<
2521            P: IsA<Widget>,
2522            F: Fn(&P, &gdk::DragContext, i32, i32, u32) -> bool + 'static,
2523        >(
2524            this: *mut ffi::GtkWidget,
2525            context: *mut gdk::ffi::GdkDragContext,
2526            x: std::ffi::c_int,
2527            y: std::ffi::c_int,
2528            time: std::ffi::c_uint,
2529            f: glib::ffi::gpointer,
2530        ) -> glib::ffi::gboolean {
2531            unsafe {
2532                let f: &F = &*(f as *const F);
2533                f(
2534                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2535                    &from_glib_borrow(context),
2536                    x,
2537                    y,
2538                    time,
2539                )
2540                .into_glib()
2541            }
2542        }
2543        unsafe {
2544            let f: Box_<F> = Box_::new(f);
2545            connect_raw(
2546                self.as_ptr() as *mut _,
2547                c"drag-drop".as_ptr(),
2548                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2549                    drag_drop_trampoline::<Self, F> as *const (),
2550                )),
2551                Box_::into_raw(f),
2552            )
2553        }
2554    }
2555
2556    #[doc(alias = "drag-end")]
2557    fn connect_drag_end<F: Fn(&Self, &gdk::DragContext) + 'static>(&self, f: F) -> SignalHandlerId {
2558        unsafe extern "C" fn drag_end_trampoline<
2559            P: IsA<Widget>,
2560            F: Fn(&P, &gdk::DragContext) + 'static,
2561        >(
2562            this: *mut ffi::GtkWidget,
2563            context: *mut gdk::ffi::GdkDragContext,
2564            f: glib::ffi::gpointer,
2565        ) {
2566            unsafe {
2567                let f: &F = &*(f as *const F);
2568                f(
2569                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2570                    &from_glib_borrow(context),
2571                )
2572            }
2573        }
2574        unsafe {
2575            let f: Box_<F> = Box_::new(f);
2576            connect_raw(
2577                self.as_ptr() as *mut _,
2578                c"drag-end".as_ptr(),
2579                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2580                    drag_end_trampoline::<Self, F> as *const (),
2581                )),
2582                Box_::into_raw(f),
2583            )
2584        }
2585    }
2586
2587    #[doc(alias = "drag-failed")]
2588    fn connect_drag_failed<
2589        F: Fn(&Self, &gdk::DragContext, DragResult) -> glib::Propagation + 'static,
2590    >(
2591        &self,
2592        f: F,
2593    ) -> SignalHandlerId {
2594        unsafe extern "C" fn drag_failed_trampoline<
2595            P: IsA<Widget>,
2596            F: Fn(&P, &gdk::DragContext, DragResult) -> glib::Propagation + 'static,
2597        >(
2598            this: *mut ffi::GtkWidget,
2599            context: *mut gdk::ffi::GdkDragContext,
2600            result: ffi::GtkDragResult,
2601            f: glib::ffi::gpointer,
2602        ) -> glib::ffi::gboolean {
2603            unsafe {
2604                let f: &F = &*(f as *const F);
2605                f(
2606                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2607                    &from_glib_borrow(context),
2608                    from_glib(result),
2609                )
2610                .into_glib()
2611            }
2612        }
2613        unsafe {
2614            let f: Box_<F> = Box_::new(f);
2615            connect_raw(
2616                self.as_ptr() as *mut _,
2617                c"drag-failed".as_ptr(),
2618                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2619                    drag_failed_trampoline::<Self, F> as *const (),
2620                )),
2621                Box_::into_raw(f),
2622            )
2623        }
2624    }
2625
2626    #[doc(alias = "drag-leave")]
2627    fn connect_drag_leave<F: Fn(&Self, &gdk::DragContext, u32) + 'static>(
2628        &self,
2629        f: F,
2630    ) -> SignalHandlerId {
2631        unsafe extern "C" fn drag_leave_trampoline<
2632            P: IsA<Widget>,
2633            F: Fn(&P, &gdk::DragContext, u32) + 'static,
2634        >(
2635            this: *mut ffi::GtkWidget,
2636            context: *mut gdk::ffi::GdkDragContext,
2637            time: std::ffi::c_uint,
2638            f: glib::ffi::gpointer,
2639        ) {
2640            unsafe {
2641                let f: &F = &*(f as *const F);
2642                f(
2643                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2644                    &from_glib_borrow(context),
2645                    time,
2646                )
2647            }
2648        }
2649        unsafe {
2650            let f: Box_<F> = Box_::new(f);
2651            connect_raw(
2652                self.as_ptr() as *mut _,
2653                c"drag-leave".as_ptr(),
2654                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2655                    drag_leave_trampoline::<Self, F> as *const (),
2656                )),
2657                Box_::into_raw(f),
2658            )
2659        }
2660    }
2661
2662    #[doc(alias = "drag-motion")]
2663    fn connect_drag_motion<F: Fn(&Self, &gdk::DragContext, i32, i32, u32) -> bool + 'static>(
2664        &self,
2665        f: F,
2666    ) -> SignalHandlerId {
2667        unsafe extern "C" fn drag_motion_trampoline<
2668            P: IsA<Widget>,
2669            F: Fn(&P, &gdk::DragContext, i32, i32, u32) -> bool + 'static,
2670        >(
2671            this: *mut ffi::GtkWidget,
2672            context: *mut gdk::ffi::GdkDragContext,
2673            x: std::ffi::c_int,
2674            y: std::ffi::c_int,
2675            time: std::ffi::c_uint,
2676            f: glib::ffi::gpointer,
2677        ) -> glib::ffi::gboolean {
2678            unsafe {
2679                let f: &F = &*(f as *const F);
2680                f(
2681                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2682                    &from_glib_borrow(context),
2683                    x,
2684                    y,
2685                    time,
2686                )
2687                .into_glib()
2688            }
2689        }
2690        unsafe {
2691            let f: Box_<F> = Box_::new(f);
2692            connect_raw(
2693                self.as_ptr() as *mut _,
2694                c"drag-motion".as_ptr(),
2695                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2696                    drag_motion_trampoline::<Self, F> as *const (),
2697                )),
2698                Box_::into_raw(f),
2699            )
2700        }
2701    }
2702
2703    #[doc(alias = "draw")]
2704    fn connect_draw<F: Fn(&Self, &cairo::Context) -> glib::Propagation + 'static>(
2705        &self,
2706        f: F,
2707    ) -> SignalHandlerId {
2708        unsafe extern "C" fn draw_trampoline<
2709            P: IsA<Widget>,
2710            F: Fn(&P, &cairo::Context) -> glib::Propagation + 'static,
2711        >(
2712            this: *mut ffi::GtkWidget,
2713            cr: *mut cairo::ffi::cairo_t,
2714            f: glib::ffi::gpointer,
2715        ) -> glib::ffi::gboolean {
2716            unsafe {
2717                let f: &F = &*(f as *const F);
2718                f(
2719                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2720                    &from_glib_borrow(cr),
2721                )
2722                .into_glib()
2723            }
2724        }
2725        unsafe {
2726            let f: Box_<F> = Box_::new(f);
2727            connect_raw(
2728                self.as_ptr() as *mut _,
2729                c"draw".as_ptr(),
2730                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2731                    draw_trampoline::<Self, F> as *const (),
2732                )),
2733                Box_::into_raw(f),
2734            )
2735        }
2736    }
2737
2738    #[doc(alias = "enter-notify-event")]
2739    fn connect_enter_notify_event<
2740        F: Fn(&Self, &gdk::EventCrossing) -> glib::Propagation + 'static,
2741    >(
2742        &self,
2743        f: F,
2744    ) -> SignalHandlerId {
2745        unsafe extern "C" fn enter_notify_event_trampoline<
2746            P: IsA<Widget>,
2747            F: Fn(&P, &gdk::EventCrossing) -> glib::Propagation + 'static,
2748        >(
2749            this: *mut ffi::GtkWidget,
2750            event: *mut gdk::ffi::GdkEventCrossing,
2751            f: glib::ffi::gpointer,
2752        ) -> glib::ffi::gboolean {
2753            unsafe {
2754                let f: &F = &*(f as *const F);
2755                f(
2756                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2757                    &from_glib_borrow(event),
2758                )
2759                .into_glib()
2760            }
2761        }
2762        unsafe {
2763            let f: Box_<F> = Box_::new(f);
2764            connect_raw(
2765                self.as_ptr() as *mut _,
2766                c"enter-notify-event".as_ptr(),
2767                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2768                    enter_notify_event_trampoline::<Self, F> as *const (),
2769                )),
2770                Box_::into_raw(f),
2771            )
2772        }
2773    }
2774
2775    #[doc(alias = "event")]
2776    fn connect_event<F: Fn(&Self, &gdk::Event) -> glib::Propagation + 'static>(
2777        &self,
2778        f: F,
2779    ) -> SignalHandlerId {
2780        unsafe extern "C" fn event_trampoline<
2781            P: IsA<Widget>,
2782            F: Fn(&P, &gdk::Event) -> glib::Propagation + 'static,
2783        >(
2784            this: *mut ffi::GtkWidget,
2785            event: *mut gdk::ffi::GdkEvent,
2786            f: glib::ffi::gpointer,
2787        ) -> glib::ffi::gboolean {
2788            unsafe {
2789                let f: &F = &*(f as *const F);
2790                f(
2791                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2792                    &from_glib_none(event),
2793                )
2794                .into_glib()
2795            }
2796        }
2797        unsafe {
2798            let f: Box_<F> = Box_::new(f);
2799            connect_raw(
2800                self.as_ptr() as *mut _,
2801                c"event".as_ptr(),
2802                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2803                    event_trampoline::<Self, F> as *const (),
2804                )),
2805                Box_::into_raw(f),
2806            )
2807        }
2808    }
2809
2810    #[doc(alias = "event-after")]
2811    fn connect_event_after<F: Fn(&Self, &gdk::Event) + 'static>(&self, f: F) -> SignalHandlerId {
2812        unsafe extern "C" fn event_after_trampoline<
2813            P: IsA<Widget>,
2814            F: Fn(&P, &gdk::Event) + 'static,
2815        >(
2816            this: *mut ffi::GtkWidget,
2817            event: *mut gdk::ffi::GdkEvent,
2818            f: glib::ffi::gpointer,
2819        ) {
2820            unsafe {
2821                let f: &F = &*(f as *const F);
2822                f(
2823                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2824                    &from_glib_none(event),
2825                )
2826            }
2827        }
2828        unsafe {
2829            let f: Box_<F> = Box_::new(f);
2830            connect_raw(
2831                self.as_ptr() as *mut _,
2832                c"event-after".as_ptr(),
2833                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2834                    event_after_trampoline::<Self, F> as *const (),
2835                )),
2836                Box_::into_raw(f),
2837            )
2838        }
2839    }
2840
2841    #[doc(alias = "focus")]
2842    fn connect_focus<F: Fn(&Self, DirectionType) -> glib::Propagation + 'static>(
2843        &self,
2844        f: F,
2845    ) -> SignalHandlerId {
2846        unsafe extern "C" fn focus_trampoline<
2847            P: IsA<Widget>,
2848            F: Fn(&P, DirectionType) -> glib::Propagation + 'static,
2849        >(
2850            this: *mut ffi::GtkWidget,
2851            direction: ffi::GtkDirectionType,
2852            f: glib::ffi::gpointer,
2853        ) -> glib::ffi::gboolean {
2854            unsafe {
2855                let f: &F = &*(f as *const F);
2856                f(
2857                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2858                    from_glib(direction),
2859                )
2860                .into_glib()
2861            }
2862        }
2863        unsafe {
2864            let f: Box_<F> = Box_::new(f);
2865            connect_raw(
2866                self.as_ptr() as *mut _,
2867                c"focus".as_ptr(),
2868                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2869                    focus_trampoline::<Self, F> as *const (),
2870                )),
2871                Box_::into_raw(f),
2872            )
2873        }
2874    }
2875
2876    #[doc(alias = "focus-in-event")]
2877    fn connect_focus_in_event<F: Fn(&Self, &gdk::EventFocus) -> glib::Propagation + 'static>(
2878        &self,
2879        f: F,
2880    ) -> SignalHandlerId {
2881        unsafe extern "C" fn focus_in_event_trampoline<
2882            P: IsA<Widget>,
2883            F: Fn(&P, &gdk::EventFocus) -> glib::Propagation + 'static,
2884        >(
2885            this: *mut ffi::GtkWidget,
2886            event: *mut gdk::ffi::GdkEventFocus,
2887            f: glib::ffi::gpointer,
2888        ) -> glib::ffi::gboolean {
2889            unsafe {
2890                let f: &F = &*(f as *const F);
2891                f(
2892                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2893                    &from_glib_borrow(event),
2894                )
2895                .into_glib()
2896            }
2897        }
2898        unsafe {
2899            let f: Box_<F> = Box_::new(f);
2900            connect_raw(
2901                self.as_ptr() as *mut _,
2902                c"focus-in-event".as_ptr(),
2903                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2904                    focus_in_event_trampoline::<Self, F> as *const (),
2905                )),
2906                Box_::into_raw(f),
2907            )
2908        }
2909    }
2910
2911    #[doc(alias = "focus-out-event")]
2912    fn connect_focus_out_event<F: Fn(&Self, &gdk::EventFocus) -> glib::Propagation + 'static>(
2913        &self,
2914        f: F,
2915    ) -> SignalHandlerId {
2916        unsafe extern "C" fn focus_out_event_trampoline<
2917            P: IsA<Widget>,
2918            F: Fn(&P, &gdk::EventFocus) -> glib::Propagation + 'static,
2919        >(
2920            this: *mut ffi::GtkWidget,
2921            event: *mut gdk::ffi::GdkEventFocus,
2922            f: glib::ffi::gpointer,
2923        ) -> glib::ffi::gboolean {
2924            unsafe {
2925                let f: &F = &*(f as *const F);
2926                f(
2927                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2928                    &from_glib_borrow(event),
2929                )
2930                .into_glib()
2931            }
2932        }
2933        unsafe {
2934            let f: Box_<F> = Box_::new(f);
2935            connect_raw(
2936                self.as_ptr() as *mut _,
2937                c"focus-out-event".as_ptr(),
2938                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2939                    focus_out_event_trampoline::<Self, F> as *const (),
2940                )),
2941                Box_::into_raw(f),
2942            )
2943        }
2944    }
2945
2946    #[doc(alias = "grab-broken-event")]
2947    fn connect_grab_broken_event<
2948        F: Fn(&Self, &gdk::EventGrabBroken) -> glib::Propagation + 'static,
2949    >(
2950        &self,
2951        f: F,
2952    ) -> SignalHandlerId {
2953        unsafe extern "C" fn grab_broken_event_trampoline<
2954            P: IsA<Widget>,
2955            F: Fn(&P, &gdk::EventGrabBroken) -> glib::Propagation + 'static,
2956        >(
2957            this: *mut ffi::GtkWidget,
2958            event: *mut gdk::ffi::GdkEventGrabBroken,
2959            f: glib::ffi::gpointer,
2960        ) -> glib::ffi::gboolean {
2961            unsafe {
2962                let f: &F = &*(f as *const F);
2963                f(
2964                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
2965                    &from_glib_borrow(event),
2966                )
2967                .into_glib()
2968            }
2969        }
2970        unsafe {
2971            let f: Box_<F> = Box_::new(f);
2972            connect_raw(
2973                self.as_ptr() as *mut _,
2974                c"grab-broken-event".as_ptr(),
2975                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2976                    grab_broken_event_trampoline::<Self, F> as *const (),
2977                )),
2978                Box_::into_raw(f),
2979            )
2980        }
2981    }
2982
2983    #[doc(alias = "grab-focus")]
2984    fn connect_grab_focus<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2985        unsafe extern "C" fn grab_focus_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
2986            this: *mut ffi::GtkWidget,
2987            f: glib::ffi::gpointer,
2988        ) {
2989            unsafe {
2990                let f: &F = &*(f as *const F);
2991                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
2992            }
2993        }
2994        unsafe {
2995            let f: Box_<F> = Box_::new(f);
2996            connect_raw(
2997                self.as_ptr() as *mut _,
2998                c"grab-focus".as_ptr(),
2999                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3000                    grab_focus_trampoline::<Self, F> as *const (),
3001                )),
3002                Box_::into_raw(f),
3003            )
3004        }
3005    }
3006
3007    fn emit_grab_focus(&self) {
3008        self.emit_by_name::<()>("grab-focus", &[]);
3009    }
3010
3011    #[doc(alias = "grab-notify")]
3012    fn connect_grab_notify<F: Fn(&Self, bool) + 'static>(&self, f: F) -> SignalHandlerId {
3013        unsafe extern "C" fn grab_notify_trampoline<P: IsA<Widget>, F: Fn(&P, bool) + 'static>(
3014            this: *mut ffi::GtkWidget,
3015            was_grabbed: glib::ffi::gboolean,
3016            f: glib::ffi::gpointer,
3017        ) {
3018            unsafe {
3019                let f: &F = &*(f as *const F);
3020                f(
3021                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3022                    from_glib(was_grabbed),
3023                )
3024            }
3025        }
3026        unsafe {
3027            let f: Box_<F> = Box_::new(f);
3028            connect_raw(
3029                self.as_ptr() as *mut _,
3030                c"grab-notify".as_ptr(),
3031                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3032                    grab_notify_trampoline::<Self, F> as *const (),
3033                )),
3034                Box_::into_raw(f),
3035            )
3036        }
3037    }
3038
3039    #[doc(alias = "hide")]
3040    fn connect_hide<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3041        unsafe extern "C" fn hide_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
3042            this: *mut ffi::GtkWidget,
3043            f: glib::ffi::gpointer,
3044        ) {
3045            unsafe {
3046                let f: &F = &*(f as *const F);
3047                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
3048            }
3049        }
3050        unsafe {
3051            let f: Box_<F> = Box_::new(f);
3052            connect_raw(
3053                self.as_ptr() as *mut _,
3054                c"hide".as_ptr(),
3055                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3056                    hide_trampoline::<Self, F> as *const (),
3057                )),
3058                Box_::into_raw(f),
3059            )
3060        }
3061    }
3062
3063    #[doc(alias = "hierarchy-changed")]
3064    fn connect_hierarchy_changed<F: Fn(&Self, Option<&Widget>) + 'static>(
3065        &self,
3066        f: F,
3067    ) -> SignalHandlerId {
3068        unsafe extern "C" fn hierarchy_changed_trampoline<
3069            P: IsA<Widget>,
3070            F: Fn(&P, Option<&Widget>) + 'static,
3071        >(
3072            this: *mut ffi::GtkWidget,
3073            previous_toplevel: *mut ffi::GtkWidget,
3074            f: glib::ffi::gpointer,
3075        ) {
3076            unsafe {
3077                let f: &F = &*(f as *const F);
3078                f(
3079                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3080                    Option::<Widget>::from_glib_borrow(previous_toplevel)
3081                        .as_ref()
3082                        .as_ref(),
3083                )
3084            }
3085        }
3086        unsafe {
3087            let f: Box_<F> = Box_::new(f);
3088            connect_raw(
3089                self.as_ptr() as *mut _,
3090                c"hierarchy-changed".as_ptr(),
3091                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3092                    hierarchy_changed_trampoline::<Self, F> as *const (),
3093                )),
3094                Box_::into_raw(f),
3095            )
3096        }
3097    }
3098
3099    #[doc(alias = "key-press-event")]
3100    fn connect_key_press_event<F: Fn(&Self, &gdk::EventKey) -> glib::Propagation + 'static>(
3101        &self,
3102        f: F,
3103    ) -> SignalHandlerId {
3104        unsafe extern "C" fn key_press_event_trampoline<
3105            P: IsA<Widget>,
3106            F: Fn(&P, &gdk::EventKey) -> glib::Propagation + 'static,
3107        >(
3108            this: *mut ffi::GtkWidget,
3109            event: *mut gdk::ffi::GdkEventKey,
3110            f: glib::ffi::gpointer,
3111        ) -> glib::ffi::gboolean {
3112            unsafe {
3113                let f: &F = &*(f as *const F);
3114                f(
3115                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3116                    &from_glib_borrow(event),
3117                )
3118                .into_glib()
3119            }
3120        }
3121        unsafe {
3122            let f: Box_<F> = Box_::new(f);
3123            connect_raw(
3124                self.as_ptr() as *mut _,
3125                c"key-press-event".as_ptr(),
3126                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3127                    key_press_event_trampoline::<Self, F> as *const (),
3128                )),
3129                Box_::into_raw(f),
3130            )
3131        }
3132    }
3133
3134    #[doc(alias = "key-release-event")]
3135    fn connect_key_release_event<F: Fn(&Self, &gdk::EventKey) -> glib::Propagation + 'static>(
3136        &self,
3137        f: F,
3138    ) -> SignalHandlerId {
3139        unsafe extern "C" fn key_release_event_trampoline<
3140            P: IsA<Widget>,
3141            F: Fn(&P, &gdk::EventKey) -> glib::Propagation + 'static,
3142        >(
3143            this: *mut ffi::GtkWidget,
3144            event: *mut gdk::ffi::GdkEventKey,
3145            f: glib::ffi::gpointer,
3146        ) -> glib::ffi::gboolean {
3147            unsafe {
3148                let f: &F = &*(f as *const F);
3149                f(
3150                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3151                    &from_glib_borrow(event),
3152                )
3153                .into_glib()
3154            }
3155        }
3156        unsafe {
3157            let f: Box_<F> = Box_::new(f);
3158            connect_raw(
3159                self.as_ptr() as *mut _,
3160                c"key-release-event".as_ptr(),
3161                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3162                    key_release_event_trampoline::<Self, F> as *const (),
3163                )),
3164                Box_::into_raw(f),
3165            )
3166        }
3167    }
3168
3169    #[doc(alias = "keynav-failed")]
3170    fn connect_keynav_failed<F: Fn(&Self, DirectionType) -> glib::Propagation + 'static>(
3171        &self,
3172        f: F,
3173    ) -> SignalHandlerId {
3174        unsafe extern "C" fn keynav_failed_trampoline<
3175            P: IsA<Widget>,
3176            F: Fn(&P, DirectionType) -> glib::Propagation + 'static,
3177        >(
3178            this: *mut ffi::GtkWidget,
3179            direction: ffi::GtkDirectionType,
3180            f: glib::ffi::gpointer,
3181        ) -> glib::ffi::gboolean {
3182            unsafe {
3183                let f: &F = &*(f as *const F);
3184                f(
3185                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3186                    from_glib(direction),
3187                )
3188                .into_glib()
3189            }
3190        }
3191        unsafe {
3192            let f: Box_<F> = Box_::new(f);
3193            connect_raw(
3194                self.as_ptr() as *mut _,
3195                c"keynav-failed".as_ptr(),
3196                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3197                    keynav_failed_trampoline::<Self, F> as *const (),
3198                )),
3199                Box_::into_raw(f),
3200            )
3201        }
3202    }
3203
3204    #[doc(alias = "leave-notify-event")]
3205    fn connect_leave_notify_event<
3206        F: Fn(&Self, &gdk::EventCrossing) -> glib::Propagation + 'static,
3207    >(
3208        &self,
3209        f: F,
3210    ) -> SignalHandlerId {
3211        unsafe extern "C" fn leave_notify_event_trampoline<
3212            P: IsA<Widget>,
3213            F: Fn(&P, &gdk::EventCrossing) -> glib::Propagation + 'static,
3214        >(
3215            this: *mut ffi::GtkWidget,
3216            event: *mut gdk::ffi::GdkEventCrossing,
3217            f: glib::ffi::gpointer,
3218        ) -> glib::ffi::gboolean {
3219            unsafe {
3220                let f: &F = &*(f as *const F);
3221                f(
3222                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3223                    &from_glib_borrow(event),
3224                )
3225                .into_glib()
3226            }
3227        }
3228        unsafe {
3229            let f: Box_<F> = Box_::new(f);
3230            connect_raw(
3231                self.as_ptr() as *mut _,
3232                c"leave-notify-event".as_ptr(),
3233                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3234                    leave_notify_event_trampoline::<Self, F> as *const (),
3235                )),
3236                Box_::into_raw(f),
3237            )
3238        }
3239    }
3240
3241    #[doc(alias = "map")]
3242    fn connect_map<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3243        unsafe extern "C" fn map_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
3244            this: *mut ffi::GtkWidget,
3245            f: glib::ffi::gpointer,
3246        ) {
3247            unsafe {
3248                let f: &F = &*(f as *const F);
3249                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
3250            }
3251        }
3252        unsafe {
3253            let f: Box_<F> = Box_::new(f);
3254            connect_raw(
3255                self.as_ptr() as *mut _,
3256                c"map".as_ptr(),
3257                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3258                    map_trampoline::<Self, F> as *const (),
3259                )),
3260                Box_::into_raw(f),
3261            )
3262        }
3263    }
3264
3265    #[doc(alias = "mnemonic-activate")]
3266    fn connect_mnemonic_activate<F: Fn(&Self, bool) -> glib::Propagation + 'static>(
3267        &self,
3268        f: F,
3269    ) -> SignalHandlerId {
3270        unsafe extern "C" fn mnemonic_activate_trampoline<
3271            P: IsA<Widget>,
3272            F: Fn(&P, bool) -> glib::Propagation + 'static,
3273        >(
3274            this: *mut ffi::GtkWidget,
3275            group_cycling: glib::ffi::gboolean,
3276            f: glib::ffi::gpointer,
3277        ) -> glib::ffi::gboolean {
3278            unsafe {
3279                let f: &F = &*(f as *const F);
3280                f(
3281                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3282                    from_glib(group_cycling),
3283                )
3284                .into_glib()
3285            }
3286        }
3287        unsafe {
3288            let f: Box_<F> = Box_::new(f);
3289            connect_raw(
3290                self.as_ptr() as *mut _,
3291                c"mnemonic-activate".as_ptr(),
3292                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3293                    mnemonic_activate_trampoline::<Self, F> as *const (),
3294                )),
3295                Box_::into_raw(f),
3296            )
3297        }
3298    }
3299
3300    #[doc(alias = "motion-notify-event")]
3301    fn connect_motion_notify_event<
3302        F: Fn(&Self, &gdk::EventMotion) -> glib::Propagation + 'static,
3303    >(
3304        &self,
3305        f: F,
3306    ) -> SignalHandlerId {
3307        unsafe extern "C" fn motion_notify_event_trampoline<
3308            P: IsA<Widget>,
3309            F: Fn(&P, &gdk::EventMotion) -> glib::Propagation + 'static,
3310        >(
3311            this: *mut ffi::GtkWidget,
3312            event: *mut gdk::ffi::GdkEventMotion,
3313            f: glib::ffi::gpointer,
3314        ) -> glib::ffi::gboolean {
3315            unsafe {
3316                let f: &F = &*(f as *const F);
3317                f(
3318                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3319                    &from_glib_borrow(event),
3320                )
3321                .into_glib()
3322            }
3323        }
3324        unsafe {
3325            let f: Box_<F> = Box_::new(f);
3326            connect_raw(
3327                self.as_ptr() as *mut _,
3328                c"motion-notify-event".as_ptr(),
3329                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3330                    motion_notify_event_trampoline::<Self, F> as *const (),
3331                )),
3332                Box_::into_raw(f),
3333            )
3334        }
3335    }
3336
3337    #[doc(alias = "move-focus")]
3338    fn connect_move_focus<F: Fn(&Self, DirectionType) + 'static>(&self, f: F) -> SignalHandlerId {
3339        unsafe extern "C" fn move_focus_trampoline<
3340            P: IsA<Widget>,
3341            F: Fn(&P, DirectionType) + 'static,
3342        >(
3343            this: *mut ffi::GtkWidget,
3344            direction: ffi::GtkDirectionType,
3345            f: glib::ffi::gpointer,
3346        ) {
3347            unsafe {
3348                let f: &F = &*(f as *const F);
3349                f(
3350                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3351                    from_glib(direction),
3352                )
3353            }
3354        }
3355        unsafe {
3356            let f: Box_<F> = Box_::new(f);
3357            connect_raw(
3358                self.as_ptr() as *mut _,
3359                c"move-focus".as_ptr(),
3360                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3361                    move_focus_trampoline::<Self, F> as *const (),
3362                )),
3363                Box_::into_raw(f),
3364            )
3365        }
3366    }
3367
3368    fn emit_move_focus(&self, direction: DirectionType) {
3369        self.emit_by_name::<()>("move-focus", &[&direction]);
3370    }
3371
3372    #[doc(alias = "parent-set")]
3373    fn connect_parent_set<F: Fn(&Self, Option<&Widget>) + 'static>(&self, f: F) -> SignalHandlerId {
3374        unsafe extern "C" fn parent_set_trampoline<
3375            P: IsA<Widget>,
3376            F: Fn(&P, Option<&Widget>) + 'static,
3377        >(
3378            this: *mut ffi::GtkWidget,
3379            old_parent: *mut ffi::GtkWidget,
3380            f: glib::ffi::gpointer,
3381        ) {
3382            unsafe {
3383                let f: &F = &*(f as *const F);
3384                f(
3385                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3386                    Option::<Widget>::from_glib_borrow(old_parent)
3387                        .as_ref()
3388                        .as_ref(),
3389                )
3390            }
3391        }
3392        unsafe {
3393            let f: Box_<F> = Box_::new(f);
3394            connect_raw(
3395                self.as_ptr() as *mut _,
3396                c"parent-set".as_ptr(),
3397                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3398                    parent_set_trampoline::<Self, F> as *const (),
3399                )),
3400                Box_::into_raw(f),
3401            )
3402        }
3403    }
3404
3405    #[doc(alias = "popup-menu")]
3406    fn connect_popup_menu<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId {
3407        unsafe extern "C" fn popup_menu_trampoline<P: IsA<Widget>, F: Fn(&P) -> bool + 'static>(
3408            this: *mut ffi::GtkWidget,
3409            f: glib::ffi::gpointer,
3410        ) -> glib::ffi::gboolean {
3411            unsafe {
3412                let f: &F = &*(f as *const F);
3413                f(Widget::from_glib_borrow(this).unsafe_cast_ref()).into_glib()
3414            }
3415        }
3416        unsafe {
3417            let f: Box_<F> = Box_::new(f);
3418            connect_raw(
3419                self.as_ptr() as *mut _,
3420                c"popup-menu".as_ptr(),
3421                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3422                    popup_menu_trampoline::<Self, F> as *const (),
3423                )),
3424                Box_::into_raw(f),
3425            )
3426        }
3427    }
3428
3429    fn emit_popup_menu(&self) -> bool {
3430        self.emit_by_name("popup-menu", &[])
3431    }
3432
3433    #[doc(alias = "property-notify-event")]
3434    fn connect_property_notify_event<
3435        F: Fn(&Self, &gdk::EventProperty) -> glib::Propagation + 'static,
3436    >(
3437        &self,
3438        f: F,
3439    ) -> SignalHandlerId {
3440        unsafe extern "C" fn property_notify_event_trampoline<
3441            P: IsA<Widget>,
3442            F: Fn(&P, &gdk::EventProperty) -> glib::Propagation + 'static,
3443        >(
3444            this: *mut ffi::GtkWidget,
3445            event: *mut gdk::ffi::GdkEventProperty,
3446            f: glib::ffi::gpointer,
3447        ) -> glib::ffi::gboolean {
3448            unsafe {
3449                let f: &F = &*(f as *const F);
3450                f(
3451                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3452                    &from_glib_borrow(event),
3453                )
3454                .into_glib()
3455            }
3456        }
3457        unsafe {
3458            let f: Box_<F> = Box_::new(f);
3459            connect_raw(
3460                self.as_ptr() as *mut _,
3461                c"property-notify-event".as_ptr(),
3462                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3463                    property_notify_event_trampoline::<Self, F> as *const (),
3464                )),
3465                Box_::into_raw(f),
3466            )
3467        }
3468    }
3469
3470    #[doc(alias = "proximity-in-event")]
3471    fn connect_proximity_in_event<
3472        F: Fn(&Self, &gdk::EventProximity) -> glib::Propagation + 'static,
3473    >(
3474        &self,
3475        f: F,
3476    ) -> SignalHandlerId {
3477        unsafe extern "C" fn proximity_in_event_trampoline<
3478            P: IsA<Widget>,
3479            F: Fn(&P, &gdk::EventProximity) -> glib::Propagation + 'static,
3480        >(
3481            this: *mut ffi::GtkWidget,
3482            event: *mut gdk::ffi::GdkEventProximity,
3483            f: glib::ffi::gpointer,
3484        ) -> glib::ffi::gboolean {
3485            unsafe {
3486                let f: &F = &*(f as *const F);
3487                f(
3488                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3489                    &from_glib_borrow(event),
3490                )
3491                .into_glib()
3492            }
3493        }
3494        unsafe {
3495            let f: Box_<F> = Box_::new(f);
3496            connect_raw(
3497                self.as_ptr() as *mut _,
3498                c"proximity-in-event".as_ptr(),
3499                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3500                    proximity_in_event_trampoline::<Self, F> as *const (),
3501                )),
3502                Box_::into_raw(f),
3503            )
3504        }
3505    }
3506
3507    #[doc(alias = "proximity-out-event")]
3508    fn connect_proximity_out_event<
3509        F: Fn(&Self, &gdk::EventProximity) -> glib::Propagation + 'static,
3510    >(
3511        &self,
3512        f: F,
3513    ) -> SignalHandlerId {
3514        unsafe extern "C" fn proximity_out_event_trampoline<
3515            P: IsA<Widget>,
3516            F: Fn(&P, &gdk::EventProximity) -> glib::Propagation + 'static,
3517        >(
3518            this: *mut ffi::GtkWidget,
3519            event: *mut gdk::ffi::GdkEventProximity,
3520            f: glib::ffi::gpointer,
3521        ) -> glib::ffi::gboolean {
3522            unsafe {
3523                let f: &F = &*(f as *const F);
3524                f(
3525                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3526                    &from_glib_borrow(event),
3527                )
3528                .into_glib()
3529            }
3530        }
3531        unsafe {
3532            let f: Box_<F> = Box_::new(f);
3533            connect_raw(
3534                self.as_ptr() as *mut _,
3535                c"proximity-out-event".as_ptr(),
3536                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3537                    proximity_out_event_trampoline::<Self, F> as *const (),
3538                )),
3539                Box_::into_raw(f),
3540            )
3541        }
3542    }
3543
3544    #[doc(alias = "query-tooltip")]
3545    fn connect_query_tooltip<F: Fn(&Self, i32, i32, bool, &Tooltip) -> bool + 'static>(
3546        &self,
3547        f: F,
3548    ) -> SignalHandlerId {
3549        unsafe extern "C" fn query_tooltip_trampoline<
3550            P: IsA<Widget>,
3551            F: Fn(&P, i32, i32, bool, &Tooltip) -> bool + 'static,
3552        >(
3553            this: *mut ffi::GtkWidget,
3554            x: std::ffi::c_int,
3555            y: std::ffi::c_int,
3556            keyboard_mode: glib::ffi::gboolean,
3557            tooltip: *mut ffi::GtkTooltip,
3558            f: glib::ffi::gpointer,
3559        ) -> glib::ffi::gboolean {
3560            unsafe {
3561                let f: &F = &*(f as *const F);
3562                f(
3563                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3564                    x,
3565                    y,
3566                    from_glib(keyboard_mode),
3567                    &from_glib_borrow(tooltip),
3568                )
3569                .into_glib()
3570            }
3571        }
3572        unsafe {
3573            let f: Box_<F> = Box_::new(f);
3574            connect_raw(
3575                self.as_ptr() as *mut _,
3576                c"query-tooltip".as_ptr(),
3577                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3578                    query_tooltip_trampoline::<Self, F> as *const (),
3579                )),
3580                Box_::into_raw(f),
3581            )
3582        }
3583    }
3584
3585    #[doc(alias = "realize")]
3586    fn connect_realize<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3587        unsafe extern "C" fn realize_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
3588            this: *mut ffi::GtkWidget,
3589            f: glib::ffi::gpointer,
3590        ) {
3591            unsafe {
3592                let f: &F = &*(f as *const F);
3593                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
3594            }
3595        }
3596        unsafe {
3597            let f: Box_<F> = Box_::new(f);
3598            connect_raw(
3599                self.as_ptr() as *mut _,
3600                c"realize".as_ptr(),
3601                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3602                    realize_trampoline::<Self, F> as *const (),
3603                )),
3604                Box_::into_raw(f),
3605            )
3606        }
3607    }
3608
3609    #[doc(alias = "screen-changed")]
3610    fn connect_screen_changed<F: Fn(&Self, Option<&gdk::Screen>) + 'static>(
3611        &self,
3612        f: F,
3613    ) -> SignalHandlerId {
3614        unsafe extern "C" fn screen_changed_trampoline<
3615            P: IsA<Widget>,
3616            F: Fn(&P, Option<&gdk::Screen>) + 'static,
3617        >(
3618            this: *mut ffi::GtkWidget,
3619            previous_screen: *mut gdk::ffi::GdkScreen,
3620            f: glib::ffi::gpointer,
3621        ) {
3622            unsafe {
3623                let f: &F = &*(f as *const F);
3624                f(
3625                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3626                    Option::<gdk::Screen>::from_glib_borrow(previous_screen)
3627                        .as_ref()
3628                        .as_ref(),
3629                )
3630            }
3631        }
3632        unsafe {
3633            let f: Box_<F> = Box_::new(f);
3634            connect_raw(
3635                self.as_ptr() as *mut _,
3636                c"screen-changed".as_ptr(),
3637                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3638                    screen_changed_trampoline::<Self, F> as *const (),
3639                )),
3640                Box_::into_raw(f),
3641            )
3642        }
3643    }
3644
3645    #[doc(alias = "scroll-event")]
3646    fn connect_scroll_event<F: Fn(&Self, &gdk::EventScroll) -> glib::Propagation + 'static>(
3647        &self,
3648        f: F,
3649    ) -> SignalHandlerId {
3650        unsafe extern "C" fn scroll_event_trampoline<
3651            P: IsA<Widget>,
3652            F: Fn(&P, &gdk::EventScroll) -> glib::Propagation + 'static,
3653        >(
3654            this: *mut ffi::GtkWidget,
3655            event: *mut gdk::ffi::GdkEventScroll,
3656            f: glib::ffi::gpointer,
3657        ) -> glib::ffi::gboolean {
3658            unsafe {
3659                let f: &F = &*(f as *const F);
3660                f(
3661                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3662                    &from_glib_borrow(event),
3663                )
3664                .into_glib()
3665            }
3666        }
3667        unsafe {
3668            let f: Box_<F> = Box_::new(f);
3669            connect_raw(
3670                self.as_ptr() as *mut _,
3671                c"scroll-event".as_ptr(),
3672                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3673                    scroll_event_trampoline::<Self, F> as *const (),
3674                )),
3675                Box_::into_raw(f),
3676            )
3677        }
3678    }
3679
3680    #[doc(alias = "selection-clear-event")]
3681    fn connect_selection_clear_event<
3682        F: Fn(&Self, &gdk::EventSelection) -> glib::Propagation + 'static,
3683    >(
3684        &self,
3685        f: F,
3686    ) -> SignalHandlerId {
3687        unsafe extern "C" fn selection_clear_event_trampoline<
3688            P: IsA<Widget>,
3689            F: Fn(&P, &gdk::EventSelection) -> glib::Propagation + 'static,
3690        >(
3691            this: *mut ffi::GtkWidget,
3692            event: *mut gdk::ffi::GdkEventSelection,
3693            f: glib::ffi::gpointer,
3694        ) -> glib::ffi::gboolean {
3695            unsafe {
3696                let f: &F = &*(f as *const F);
3697                f(
3698                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3699                    &from_glib_borrow(event),
3700                )
3701                .into_glib()
3702            }
3703        }
3704        unsafe {
3705            let f: Box_<F> = Box_::new(f);
3706            connect_raw(
3707                self.as_ptr() as *mut _,
3708                c"selection-clear-event".as_ptr(),
3709                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3710                    selection_clear_event_trampoline::<Self, F> as *const (),
3711                )),
3712                Box_::into_raw(f),
3713            )
3714        }
3715    }
3716
3717    #[doc(alias = "selection-get")]
3718    fn connect_selection_get<F: Fn(&Self, &SelectionData, u32, u32) + 'static>(
3719        &self,
3720        f: F,
3721    ) -> SignalHandlerId {
3722        unsafe extern "C" fn selection_get_trampoline<
3723            P: IsA<Widget>,
3724            F: Fn(&P, &SelectionData, u32, u32) + 'static,
3725        >(
3726            this: *mut ffi::GtkWidget,
3727            data: *mut ffi::GtkSelectionData,
3728            info: std::ffi::c_uint,
3729            time: std::ffi::c_uint,
3730            f: glib::ffi::gpointer,
3731        ) {
3732            unsafe {
3733                let f: &F = &*(f as *const F);
3734                f(
3735                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3736                    &from_glib_borrow(data),
3737                    info,
3738                    time,
3739                )
3740            }
3741        }
3742        unsafe {
3743            let f: Box_<F> = Box_::new(f);
3744            connect_raw(
3745                self.as_ptr() as *mut _,
3746                c"selection-get".as_ptr(),
3747                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3748                    selection_get_trampoline::<Self, F> as *const (),
3749                )),
3750                Box_::into_raw(f),
3751            )
3752        }
3753    }
3754
3755    #[doc(alias = "selection-notify-event")]
3756    fn connect_selection_notify_event<
3757        F: Fn(&Self, &gdk::EventSelection) -> glib::Propagation + 'static,
3758    >(
3759        &self,
3760        f: F,
3761    ) -> SignalHandlerId {
3762        unsafe extern "C" fn selection_notify_event_trampoline<
3763            P: IsA<Widget>,
3764            F: Fn(&P, &gdk::EventSelection) -> glib::Propagation + 'static,
3765        >(
3766            this: *mut ffi::GtkWidget,
3767            event: *mut gdk::ffi::GdkEventSelection,
3768            f: glib::ffi::gpointer,
3769        ) -> glib::ffi::gboolean {
3770            unsafe {
3771                let f: &F = &*(f as *const F);
3772                f(
3773                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3774                    &from_glib_borrow(event),
3775                )
3776                .into_glib()
3777            }
3778        }
3779        unsafe {
3780            let f: Box_<F> = Box_::new(f);
3781            connect_raw(
3782                self.as_ptr() as *mut _,
3783                c"selection-notify-event".as_ptr(),
3784                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3785                    selection_notify_event_trampoline::<Self, F> as *const (),
3786                )),
3787                Box_::into_raw(f),
3788            )
3789        }
3790    }
3791
3792    #[doc(alias = "selection-received")]
3793    fn connect_selection_received<F: Fn(&Self, &SelectionData, u32) + 'static>(
3794        &self,
3795        f: F,
3796    ) -> SignalHandlerId {
3797        unsafe extern "C" fn selection_received_trampoline<
3798            P: IsA<Widget>,
3799            F: Fn(&P, &SelectionData, u32) + 'static,
3800        >(
3801            this: *mut ffi::GtkWidget,
3802            data: *mut ffi::GtkSelectionData,
3803            time: std::ffi::c_uint,
3804            f: glib::ffi::gpointer,
3805        ) {
3806            unsafe {
3807                let f: &F = &*(f as *const F);
3808                f(
3809                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3810                    &from_glib_borrow(data),
3811                    time,
3812                )
3813            }
3814        }
3815        unsafe {
3816            let f: Box_<F> = Box_::new(f);
3817            connect_raw(
3818                self.as_ptr() as *mut _,
3819                c"selection-received".as_ptr(),
3820                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3821                    selection_received_trampoline::<Self, F> as *const (),
3822                )),
3823                Box_::into_raw(f),
3824            )
3825        }
3826    }
3827
3828    #[doc(alias = "selection-request-event")]
3829    fn connect_selection_request_event<
3830        F: Fn(&Self, &gdk::EventSelection) -> glib::Propagation + 'static,
3831    >(
3832        &self,
3833        f: F,
3834    ) -> SignalHandlerId {
3835        unsafe extern "C" fn selection_request_event_trampoline<
3836            P: IsA<Widget>,
3837            F: Fn(&P, &gdk::EventSelection) -> glib::Propagation + 'static,
3838        >(
3839            this: *mut ffi::GtkWidget,
3840            event: *mut gdk::ffi::GdkEventSelection,
3841            f: glib::ffi::gpointer,
3842        ) -> glib::ffi::gboolean {
3843            unsafe {
3844                let f: &F = &*(f as *const F);
3845                f(
3846                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3847                    &from_glib_borrow(event),
3848                )
3849                .into_glib()
3850            }
3851        }
3852        unsafe {
3853            let f: Box_<F> = Box_::new(f);
3854            connect_raw(
3855                self.as_ptr() as *mut _,
3856                c"selection-request-event".as_ptr(),
3857                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3858                    selection_request_event_trampoline::<Self, F> as *const (),
3859                )),
3860                Box_::into_raw(f),
3861            )
3862        }
3863    }
3864
3865    #[doc(alias = "show")]
3866    fn connect_show<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3867        unsafe extern "C" fn show_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
3868            this: *mut ffi::GtkWidget,
3869            f: glib::ffi::gpointer,
3870        ) {
3871            unsafe {
3872                let f: &F = &*(f as *const F);
3873                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
3874            }
3875        }
3876        unsafe {
3877            let f: Box_<F> = Box_::new(f);
3878            connect_raw(
3879                self.as_ptr() as *mut _,
3880                c"show".as_ptr(),
3881                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3882                    show_trampoline::<Self, F> as *const (),
3883                )),
3884                Box_::into_raw(f),
3885            )
3886        }
3887    }
3888
3889    #[doc(alias = "show-help")]
3890    fn connect_show_help<F: Fn(&Self, WidgetHelpType) -> bool + 'static>(
3891        &self,
3892        f: F,
3893    ) -> SignalHandlerId {
3894        unsafe extern "C" fn show_help_trampoline<
3895            P: IsA<Widget>,
3896            F: Fn(&P, WidgetHelpType) -> bool + 'static,
3897        >(
3898            this: *mut ffi::GtkWidget,
3899            help_type: ffi::GtkWidgetHelpType,
3900            f: glib::ffi::gpointer,
3901        ) -> glib::ffi::gboolean {
3902            unsafe {
3903                let f: &F = &*(f as *const F);
3904                f(
3905                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3906                    from_glib(help_type),
3907                )
3908                .into_glib()
3909            }
3910        }
3911        unsafe {
3912            let f: Box_<F> = Box_::new(f);
3913            connect_raw(
3914                self.as_ptr() as *mut _,
3915                c"show-help".as_ptr(),
3916                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3917                    show_help_trampoline::<Self, F> as *const (),
3918                )),
3919                Box_::into_raw(f),
3920            )
3921        }
3922    }
3923
3924    fn emit_show_help(&self, help_type: WidgetHelpType) -> bool {
3925        self.emit_by_name("show-help", &[&help_type])
3926    }
3927
3928    #[doc(alias = "size-allocate")]
3929    fn connect_size_allocate<F: Fn(&Self, &Allocation) + 'static>(&self, f: F) -> SignalHandlerId {
3930        unsafe extern "C" fn size_allocate_trampoline<
3931            P: IsA<Widget>,
3932            F: Fn(&P, &Allocation) + 'static,
3933        >(
3934            this: *mut ffi::GtkWidget,
3935            allocation: *mut ffi::GtkAllocation,
3936            f: glib::ffi::gpointer,
3937        ) {
3938            unsafe {
3939                let f: &F = &*(f as *const F);
3940                f(
3941                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3942                    &from_glib_none(allocation),
3943                )
3944            }
3945        }
3946        unsafe {
3947            let f: Box_<F> = Box_::new(f);
3948            connect_raw(
3949                self.as_ptr() as *mut _,
3950                c"size-allocate".as_ptr(),
3951                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3952                    size_allocate_trampoline::<Self, F> as *const (),
3953                )),
3954                Box_::into_raw(f),
3955            )
3956        }
3957    }
3958
3959    #[doc(alias = "state-flags-changed")]
3960    fn connect_state_flags_changed<F: Fn(&Self, StateFlags) + 'static>(
3961        &self,
3962        f: F,
3963    ) -> SignalHandlerId {
3964        unsafe extern "C" fn state_flags_changed_trampoline<
3965            P: IsA<Widget>,
3966            F: Fn(&P, StateFlags) + 'static,
3967        >(
3968            this: *mut ffi::GtkWidget,
3969            flags: ffi::GtkStateFlags,
3970            f: glib::ffi::gpointer,
3971        ) {
3972            unsafe {
3973                let f: &F = &*(f as *const F);
3974                f(
3975                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
3976                    from_glib(flags),
3977                )
3978            }
3979        }
3980        unsafe {
3981            let f: Box_<F> = Box_::new(f);
3982            connect_raw(
3983                self.as_ptr() as *mut _,
3984                c"state-flags-changed".as_ptr(),
3985                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3986                    state_flags_changed_trampoline::<Self, F> as *const (),
3987                )),
3988                Box_::into_raw(f),
3989            )
3990        }
3991    }
3992
3993    #[doc(alias = "style-updated")]
3994    fn connect_style_updated<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3995        unsafe extern "C" fn style_updated_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
3996            this: *mut ffi::GtkWidget,
3997            f: glib::ffi::gpointer,
3998        ) {
3999            unsafe {
4000                let f: &F = &*(f as *const F);
4001                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4002            }
4003        }
4004        unsafe {
4005            let f: Box_<F> = Box_::new(f);
4006            connect_raw(
4007                self.as_ptr() as *mut _,
4008                c"style-updated".as_ptr(),
4009                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4010                    style_updated_trampoline::<Self, F> as *const (),
4011                )),
4012                Box_::into_raw(f),
4013            )
4014        }
4015    }
4016
4017    #[doc(alias = "touch-event")]
4018    fn connect_touch_event<F: Fn(&Self, &gdk::Event) -> glib::Propagation + 'static>(
4019        &self,
4020        f: F,
4021    ) -> SignalHandlerId {
4022        unsafe extern "C" fn touch_event_trampoline<
4023            P: IsA<Widget>,
4024            F: Fn(&P, &gdk::Event) -> glib::Propagation + 'static,
4025        >(
4026            this: *mut ffi::GtkWidget,
4027            object: *mut gdk::ffi::GdkEvent,
4028            f: glib::ffi::gpointer,
4029        ) -> glib::ffi::gboolean {
4030            unsafe {
4031                let f: &F = &*(f as *const F);
4032                f(
4033                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
4034                    &from_glib_none(object),
4035                )
4036                .into_glib()
4037            }
4038        }
4039        unsafe {
4040            let f: Box_<F> = Box_::new(f);
4041            connect_raw(
4042                self.as_ptr() as *mut _,
4043                c"touch-event".as_ptr(),
4044                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4045                    touch_event_trampoline::<Self, F> as *const (),
4046                )),
4047                Box_::into_raw(f),
4048            )
4049        }
4050    }
4051
4052    #[doc(alias = "unmap")]
4053    fn connect_unmap<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4054        unsafe extern "C" fn unmap_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4055            this: *mut ffi::GtkWidget,
4056            f: glib::ffi::gpointer,
4057        ) {
4058            unsafe {
4059                let f: &F = &*(f as *const F);
4060                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4061            }
4062        }
4063        unsafe {
4064            let f: Box_<F> = Box_::new(f);
4065            connect_raw(
4066                self.as_ptr() as *mut _,
4067                c"unmap".as_ptr(),
4068                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4069                    unmap_trampoline::<Self, F> as *const (),
4070                )),
4071                Box_::into_raw(f),
4072            )
4073        }
4074    }
4075
4076    #[doc(alias = "unrealize")]
4077    fn connect_unrealize<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4078        unsafe extern "C" fn unrealize_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4079            this: *mut ffi::GtkWidget,
4080            f: glib::ffi::gpointer,
4081        ) {
4082            unsafe {
4083                let f: &F = &*(f as *const F);
4084                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4085            }
4086        }
4087        unsafe {
4088            let f: Box_<F> = Box_::new(f);
4089            connect_raw(
4090                self.as_ptr() as *mut _,
4091                c"unrealize".as_ptr(),
4092                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4093                    unrealize_trampoline::<Self, F> as *const (),
4094                )),
4095                Box_::into_raw(f),
4096            )
4097        }
4098    }
4099
4100    #[doc(alias = "window-state-event")]
4101    fn connect_window_state_event<
4102        F: Fn(&Self, &gdk::EventWindowState) -> glib::Propagation + 'static,
4103    >(
4104        &self,
4105        f: F,
4106    ) -> SignalHandlerId {
4107        unsafe extern "C" fn window_state_event_trampoline<
4108            P: IsA<Widget>,
4109            F: Fn(&P, &gdk::EventWindowState) -> glib::Propagation + 'static,
4110        >(
4111            this: *mut ffi::GtkWidget,
4112            event: *mut gdk::ffi::GdkEventWindowState,
4113            f: glib::ffi::gpointer,
4114        ) -> glib::ffi::gboolean {
4115            unsafe {
4116                let f: &F = &*(f as *const F);
4117                f(
4118                    Widget::from_glib_borrow(this).unsafe_cast_ref(),
4119                    &from_glib_borrow(event),
4120                )
4121                .into_glib()
4122            }
4123        }
4124        unsafe {
4125            let f: Box_<F> = Box_::new(f);
4126            connect_raw(
4127                self.as_ptr() as *mut _,
4128                c"window-state-event".as_ptr(),
4129                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4130                    window_state_event_trampoline::<Self, F> as *const (),
4131                )),
4132                Box_::into_raw(f),
4133            )
4134        }
4135    }
4136
4137    #[doc(alias = "app-paintable")]
4138    fn connect_app_paintable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4139        unsafe extern "C" fn notify_app_paintable_trampoline<
4140            P: IsA<Widget>,
4141            F: Fn(&P) + 'static,
4142        >(
4143            this: *mut ffi::GtkWidget,
4144            _param_spec: glib::ffi::gpointer,
4145            f: glib::ffi::gpointer,
4146        ) {
4147            unsafe {
4148                let f: &F = &*(f as *const F);
4149                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4150            }
4151        }
4152        unsafe {
4153            let f: Box_<F> = Box_::new(f);
4154            connect_raw(
4155                self.as_ptr() as *mut _,
4156                c"notify::app-paintable".as_ptr(),
4157                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4158                    notify_app_paintable_trampoline::<Self, F> as *const (),
4159                )),
4160                Box_::into_raw(f),
4161            )
4162        }
4163    }
4164
4165    #[doc(alias = "can-default")]
4166    fn connect_can_default_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4167        unsafe extern "C" fn notify_can_default_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4168            this: *mut ffi::GtkWidget,
4169            _param_spec: glib::ffi::gpointer,
4170            f: glib::ffi::gpointer,
4171        ) {
4172            unsafe {
4173                let f: &F = &*(f as *const F);
4174                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4175            }
4176        }
4177        unsafe {
4178            let f: Box_<F> = Box_::new(f);
4179            connect_raw(
4180                self.as_ptr() as *mut _,
4181                c"notify::can-default".as_ptr(),
4182                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4183                    notify_can_default_trampoline::<Self, F> as *const (),
4184                )),
4185                Box_::into_raw(f),
4186            )
4187        }
4188    }
4189
4190    #[doc(alias = "can-focus")]
4191    fn connect_can_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4192        unsafe extern "C" fn notify_can_focus_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4193            this: *mut ffi::GtkWidget,
4194            _param_spec: glib::ffi::gpointer,
4195            f: glib::ffi::gpointer,
4196        ) {
4197            unsafe {
4198                let f: &F = &*(f as *const F);
4199                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4200            }
4201        }
4202        unsafe {
4203            let f: Box_<F> = Box_::new(f);
4204            connect_raw(
4205                self.as_ptr() as *mut _,
4206                c"notify::can-focus".as_ptr(),
4207                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4208                    notify_can_focus_trampoline::<Self, F> as *const (),
4209                )),
4210                Box_::into_raw(f),
4211            )
4212        }
4213    }
4214
4215    #[doc(alias = "composite-child")]
4216    fn connect_composite_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4217        unsafe extern "C" fn notify_composite_child_trampoline<
4218            P: IsA<Widget>,
4219            F: Fn(&P) + 'static,
4220        >(
4221            this: *mut ffi::GtkWidget,
4222            _param_spec: glib::ffi::gpointer,
4223            f: glib::ffi::gpointer,
4224        ) {
4225            unsafe {
4226                let f: &F = &*(f as *const F);
4227                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4228            }
4229        }
4230        unsafe {
4231            let f: Box_<F> = Box_::new(f);
4232            connect_raw(
4233                self.as_ptr() as *mut _,
4234                c"notify::composite-child".as_ptr(),
4235                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4236                    notify_composite_child_trampoline::<Self, F> as *const (),
4237                )),
4238                Box_::into_raw(f),
4239            )
4240        }
4241    }
4242
4243    #[doc(alias = "events")]
4244    fn connect_events_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4245        unsafe extern "C" fn notify_events_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4246            this: *mut ffi::GtkWidget,
4247            _param_spec: glib::ffi::gpointer,
4248            f: glib::ffi::gpointer,
4249        ) {
4250            unsafe {
4251                let f: &F = &*(f as *const F);
4252                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4253            }
4254        }
4255        unsafe {
4256            let f: Box_<F> = Box_::new(f);
4257            connect_raw(
4258                self.as_ptr() as *mut _,
4259                c"notify::events".as_ptr(),
4260                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4261                    notify_events_trampoline::<Self, F> as *const (),
4262                )),
4263                Box_::into_raw(f),
4264            )
4265        }
4266    }
4267
4268    #[doc(alias = "expand")]
4269    fn connect_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4270        unsafe extern "C" fn notify_expand_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4271            this: *mut ffi::GtkWidget,
4272            _param_spec: glib::ffi::gpointer,
4273            f: glib::ffi::gpointer,
4274        ) {
4275            unsafe {
4276                let f: &F = &*(f as *const F);
4277                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4278            }
4279        }
4280        unsafe {
4281            let f: Box_<F> = Box_::new(f);
4282            connect_raw(
4283                self.as_ptr() as *mut _,
4284                c"notify::expand".as_ptr(),
4285                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4286                    notify_expand_trampoline::<Self, F> as *const (),
4287                )),
4288                Box_::into_raw(f),
4289            )
4290        }
4291    }
4292
4293    #[doc(alias = "focus-on-click")]
4294    fn connect_focus_on_click_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4295        unsafe extern "C" fn notify_focus_on_click_trampoline<
4296            P: IsA<Widget>,
4297            F: Fn(&P) + 'static,
4298        >(
4299            this: *mut ffi::GtkWidget,
4300            _param_spec: glib::ffi::gpointer,
4301            f: glib::ffi::gpointer,
4302        ) {
4303            unsafe {
4304                let f: &F = &*(f as *const F);
4305                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4306            }
4307        }
4308        unsafe {
4309            let f: Box_<F> = Box_::new(f);
4310            connect_raw(
4311                self.as_ptr() as *mut _,
4312                c"notify::focus-on-click".as_ptr(),
4313                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4314                    notify_focus_on_click_trampoline::<Self, F> as *const (),
4315                )),
4316                Box_::into_raw(f),
4317            )
4318        }
4319    }
4320
4321    #[doc(alias = "halign")]
4322    fn connect_halign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4323        unsafe extern "C" fn notify_halign_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4324            this: *mut ffi::GtkWidget,
4325            _param_spec: glib::ffi::gpointer,
4326            f: glib::ffi::gpointer,
4327        ) {
4328            unsafe {
4329                let f: &F = &*(f as *const F);
4330                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4331            }
4332        }
4333        unsafe {
4334            let f: Box_<F> = Box_::new(f);
4335            connect_raw(
4336                self.as_ptr() as *mut _,
4337                c"notify::halign".as_ptr(),
4338                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4339                    notify_halign_trampoline::<Self, F> as *const (),
4340                )),
4341                Box_::into_raw(f),
4342            )
4343        }
4344    }
4345
4346    #[doc(alias = "has-default")]
4347    fn connect_has_default_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4348        unsafe extern "C" fn notify_has_default_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4349            this: *mut ffi::GtkWidget,
4350            _param_spec: glib::ffi::gpointer,
4351            f: glib::ffi::gpointer,
4352        ) {
4353            unsafe {
4354                let f: &F = &*(f as *const F);
4355                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4356            }
4357        }
4358        unsafe {
4359            let f: Box_<F> = Box_::new(f);
4360            connect_raw(
4361                self.as_ptr() as *mut _,
4362                c"notify::has-default".as_ptr(),
4363                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4364                    notify_has_default_trampoline::<Self, F> as *const (),
4365                )),
4366                Box_::into_raw(f),
4367            )
4368        }
4369    }
4370
4371    #[doc(alias = "has-focus")]
4372    fn connect_has_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4373        unsafe extern "C" fn notify_has_focus_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4374            this: *mut ffi::GtkWidget,
4375            _param_spec: glib::ffi::gpointer,
4376            f: glib::ffi::gpointer,
4377        ) {
4378            unsafe {
4379                let f: &F = &*(f as *const F);
4380                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4381            }
4382        }
4383        unsafe {
4384            let f: Box_<F> = Box_::new(f);
4385            connect_raw(
4386                self.as_ptr() as *mut _,
4387                c"notify::has-focus".as_ptr(),
4388                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4389                    notify_has_focus_trampoline::<Self, F> as *const (),
4390                )),
4391                Box_::into_raw(f),
4392            )
4393        }
4394    }
4395
4396    #[doc(alias = "has-tooltip")]
4397    fn connect_has_tooltip_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4398        unsafe extern "C" fn notify_has_tooltip_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4399            this: *mut ffi::GtkWidget,
4400            _param_spec: glib::ffi::gpointer,
4401            f: glib::ffi::gpointer,
4402        ) {
4403            unsafe {
4404                let f: &F = &*(f as *const F);
4405                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4406            }
4407        }
4408        unsafe {
4409            let f: Box_<F> = Box_::new(f);
4410            connect_raw(
4411                self.as_ptr() as *mut _,
4412                c"notify::has-tooltip".as_ptr(),
4413                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4414                    notify_has_tooltip_trampoline::<Self, F> as *const (),
4415                )),
4416                Box_::into_raw(f),
4417            )
4418        }
4419    }
4420
4421    #[doc(alias = "height-request")]
4422    fn connect_height_request_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4423        unsafe extern "C" fn notify_height_request_trampoline<
4424            P: IsA<Widget>,
4425            F: Fn(&P) + 'static,
4426        >(
4427            this: *mut ffi::GtkWidget,
4428            _param_spec: glib::ffi::gpointer,
4429            f: glib::ffi::gpointer,
4430        ) {
4431            unsafe {
4432                let f: &F = &*(f as *const F);
4433                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4434            }
4435        }
4436        unsafe {
4437            let f: Box_<F> = Box_::new(f);
4438            connect_raw(
4439                self.as_ptr() as *mut _,
4440                c"notify::height-request".as_ptr(),
4441                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4442                    notify_height_request_trampoline::<Self, F> as *const (),
4443                )),
4444                Box_::into_raw(f),
4445            )
4446        }
4447    }
4448
4449    #[doc(alias = "hexpand")]
4450    fn connect_hexpand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4451        unsafe extern "C" fn notify_hexpand_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4452            this: *mut ffi::GtkWidget,
4453            _param_spec: glib::ffi::gpointer,
4454            f: glib::ffi::gpointer,
4455        ) {
4456            unsafe {
4457                let f: &F = &*(f as *const F);
4458                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4459            }
4460        }
4461        unsafe {
4462            let f: Box_<F> = Box_::new(f);
4463            connect_raw(
4464                self.as_ptr() as *mut _,
4465                c"notify::hexpand".as_ptr(),
4466                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4467                    notify_hexpand_trampoline::<Self, F> as *const (),
4468                )),
4469                Box_::into_raw(f),
4470            )
4471        }
4472    }
4473
4474    #[doc(alias = "hexpand-set")]
4475    fn connect_hexpand_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4476        unsafe extern "C" fn notify_hexpand_set_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4477            this: *mut ffi::GtkWidget,
4478            _param_spec: glib::ffi::gpointer,
4479            f: glib::ffi::gpointer,
4480        ) {
4481            unsafe {
4482                let f: &F = &*(f as *const F);
4483                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4484            }
4485        }
4486        unsafe {
4487            let f: Box_<F> = Box_::new(f);
4488            connect_raw(
4489                self.as_ptr() as *mut _,
4490                c"notify::hexpand-set".as_ptr(),
4491                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4492                    notify_hexpand_set_trampoline::<Self, F> as *const (),
4493                )),
4494                Box_::into_raw(f),
4495            )
4496        }
4497    }
4498
4499    #[doc(alias = "is-focus")]
4500    fn connect_is_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4501        unsafe extern "C" fn notify_is_focus_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4502            this: *mut ffi::GtkWidget,
4503            _param_spec: glib::ffi::gpointer,
4504            f: glib::ffi::gpointer,
4505        ) {
4506            unsafe {
4507                let f: &F = &*(f as *const F);
4508                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4509            }
4510        }
4511        unsafe {
4512            let f: Box_<F> = Box_::new(f);
4513            connect_raw(
4514                self.as_ptr() as *mut _,
4515                c"notify::is-focus".as_ptr(),
4516                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4517                    notify_is_focus_trampoline::<Self, F> as *const (),
4518                )),
4519                Box_::into_raw(f),
4520            )
4521        }
4522    }
4523
4524    #[doc(alias = "margin")]
4525    fn connect_margin_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4526        unsafe extern "C" fn notify_margin_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4527            this: *mut ffi::GtkWidget,
4528            _param_spec: glib::ffi::gpointer,
4529            f: glib::ffi::gpointer,
4530        ) {
4531            unsafe {
4532                let f: &F = &*(f as *const F);
4533                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4534            }
4535        }
4536        unsafe {
4537            let f: Box_<F> = Box_::new(f);
4538            connect_raw(
4539                self.as_ptr() as *mut _,
4540                c"notify::margin".as_ptr(),
4541                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4542                    notify_margin_trampoline::<Self, F> as *const (),
4543                )),
4544                Box_::into_raw(f),
4545            )
4546        }
4547    }
4548
4549    #[doc(alias = "margin-bottom")]
4550    fn connect_margin_bottom_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4551        unsafe extern "C" fn notify_margin_bottom_trampoline<
4552            P: IsA<Widget>,
4553            F: Fn(&P) + 'static,
4554        >(
4555            this: *mut ffi::GtkWidget,
4556            _param_spec: glib::ffi::gpointer,
4557            f: glib::ffi::gpointer,
4558        ) {
4559            unsafe {
4560                let f: &F = &*(f as *const F);
4561                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4562            }
4563        }
4564        unsafe {
4565            let f: Box_<F> = Box_::new(f);
4566            connect_raw(
4567                self.as_ptr() as *mut _,
4568                c"notify::margin-bottom".as_ptr(),
4569                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4570                    notify_margin_bottom_trampoline::<Self, F> as *const (),
4571                )),
4572                Box_::into_raw(f),
4573            )
4574        }
4575    }
4576
4577    #[doc(alias = "margin-end")]
4578    fn connect_margin_end_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4579        unsafe extern "C" fn notify_margin_end_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4580            this: *mut ffi::GtkWidget,
4581            _param_spec: glib::ffi::gpointer,
4582            f: glib::ffi::gpointer,
4583        ) {
4584            unsafe {
4585                let f: &F = &*(f as *const F);
4586                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4587            }
4588        }
4589        unsafe {
4590            let f: Box_<F> = Box_::new(f);
4591            connect_raw(
4592                self.as_ptr() as *mut _,
4593                c"notify::margin-end".as_ptr(),
4594                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4595                    notify_margin_end_trampoline::<Self, F> as *const (),
4596                )),
4597                Box_::into_raw(f),
4598            )
4599        }
4600    }
4601
4602    #[doc(alias = "margin-start")]
4603    fn connect_margin_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4604        unsafe extern "C" fn notify_margin_start_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4605            this: *mut ffi::GtkWidget,
4606            _param_spec: glib::ffi::gpointer,
4607            f: glib::ffi::gpointer,
4608        ) {
4609            unsafe {
4610                let f: &F = &*(f as *const F);
4611                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4612            }
4613        }
4614        unsafe {
4615            let f: Box_<F> = Box_::new(f);
4616            connect_raw(
4617                self.as_ptr() as *mut _,
4618                c"notify::margin-start".as_ptr(),
4619                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4620                    notify_margin_start_trampoline::<Self, F> as *const (),
4621                )),
4622                Box_::into_raw(f),
4623            )
4624        }
4625    }
4626
4627    #[doc(alias = "margin-top")]
4628    fn connect_margin_top_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4629        unsafe extern "C" fn notify_margin_top_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4630            this: *mut ffi::GtkWidget,
4631            _param_spec: glib::ffi::gpointer,
4632            f: glib::ffi::gpointer,
4633        ) {
4634            unsafe {
4635                let f: &F = &*(f as *const F);
4636                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4637            }
4638        }
4639        unsafe {
4640            let f: Box_<F> = Box_::new(f);
4641            connect_raw(
4642                self.as_ptr() as *mut _,
4643                c"notify::margin-top".as_ptr(),
4644                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4645                    notify_margin_top_trampoline::<Self, F> as *const (),
4646                )),
4647                Box_::into_raw(f),
4648            )
4649        }
4650    }
4651
4652    #[doc(alias = "name")]
4653    fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4654        unsafe extern "C" fn notify_name_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4655            this: *mut ffi::GtkWidget,
4656            _param_spec: glib::ffi::gpointer,
4657            f: glib::ffi::gpointer,
4658        ) {
4659            unsafe {
4660                let f: &F = &*(f as *const F);
4661                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4662            }
4663        }
4664        unsafe {
4665            let f: Box_<F> = Box_::new(f);
4666            connect_raw(
4667                self.as_ptr() as *mut _,
4668                c"notify::name".as_ptr(),
4669                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4670                    notify_name_trampoline::<Self, F> as *const (),
4671                )),
4672                Box_::into_raw(f),
4673            )
4674        }
4675    }
4676
4677    #[doc(alias = "no-show-all")]
4678    fn connect_no_show_all_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4679        unsafe extern "C" fn notify_no_show_all_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4680            this: *mut ffi::GtkWidget,
4681            _param_spec: glib::ffi::gpointer,
4682            f: glib::ffi::gpointer,
4683        ) {
4684            unsafe {
4685                let f: &F = &*(f as *const F);
4686                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4687            }
4688        }
4689        unsafe {
4690            let f: Box_<F> = Box_::new(f);
4691            connect_raw(
4692                self.as_ptr() as *mut _,
4693                c"notify::no-show-all".as_ptr(),
4694                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4695                    notify_no_show_all_trampoline::<Self, F> as *const (),
4696                )),
4697                Box_::into_raw(f),
4698            )
4699        }
4700    }
4701
4702    #[doc(alias = "opacity")]
4703    fn connect_opacity_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4704        unsafe extern "C" fn notify_opacity_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4705            this: *mut ffi::GtkWidget,
4706            _param_spec: glib::ffi::gpointer,
4707            f: glib::ffi::gpointer,
4708        ) {
4709            unsafe {
4710                let f: &F = &*(f as *const F);
4711                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4712            }
4713        }
4714        unsafe {
4715            let f: Box_<F> = Box_::new(f);
4716            connect_raw(
4717                self.as_ptr() as *mut _,
4718                c"notify::opacity".as_ptr(),
4719                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4720                    notify_opacity_trampoline::<Self, F> as *const (),
4721                )),
4722                Box_::into_raw(f),
4723            )
4724        }
4725    }
4726
4727    #[doc(alias = "parent")]
4728    fn connect_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4729        unsafe extern "C" fn notify_parent_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4730            this: *mut ffi::GtkWidget,
4731            _param_spec: glib::ffi::gpointer,
4732            f: glib::ffi::gpointer,
4733        ) {
4734            unsafe {
4735                let f: &F = &*(f as *const F);
4736                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4737            }
4738        }
4739        unsafe {
4740            let f: Box_<F> = Box_::new(f);
4741            connect_raw(
4742                self.as_ptr() as *mut _,
4743                c"notify::parent".as_ptr(),
4744                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4745                    notify_parent_trampoline::<Self, F> as *const (),
4746                )),
4747                Box_::into_raw(f),
4748            )
4749        }
4750    }
4751
4752    #[doc(alias = "receives-default")]
4753    fn connect_receives_default_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4754        unsafe extern "C" fn notify_receives_default_trampoline<
4755            P: IsA<Widget>,
4756            F: Fn(&P) + 'static,
4757        >(
4758            this: *mut ffi::GtkWidget,
4759            _param_spec: glib::ffi::gpointer,
4760            f: glib::ffi::gpointer,
4761        ) {
4762            unsafe {
4763                let f: &F = &*(f as *const F);
4764                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4765            }
4766        }
4767        unsafe {
4768            let f: Box_<F> = Box_::new(f);
4769            connect_raw(
4770                self.as_ptr() as *mut _,
4771                c"notify::receives-default".as_ptr(),
4772                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4773                    notify_receives_default_trampoline::<Self, F> as *const (),
4774                )),
4775                Box_::into_raw(f),
4776            )
4777        }
4778    }
4779
4780    #[doc(alias = "scale-factor")]
4781    fn connect_scale_factor_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4782        unsafe extern "C" fn notify_scale_factor_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4783            this: *mut ffi::GtkWidget,
4784            _param_spec: glib::ffi::gpointer,
4785            f: glib::ffi::gpointer,
4786        ) {
4787            unsafe {
4788                let f: &F = &*(f as *const F);
4789                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4790            }
4791        }
4792        unsafe {
4793            let f: Box_<F> = Box_::new(f);
4794            connect_raw(
4795                self.as_ptr() as *mut _,
4796                c"notify::scale-factor".as_ptr(),
4797                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4798                    notify_scale_factor_trampoline::<Self, F> as *const (),
4799                )),
4800                Box_::into_raw(f),
4801            )
4802        }
4803    }
4804
4805    #[doc(alias = "sensitive")]
4806    fn connect_sensitive_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4807        unsafe extern "C" fn notify_sensitive_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4808            this: *mut ffi::GtkWidget,
4809            _param_spec: glib::ffi::gpointer,
4810            f: glib::ffi::gpointer,
4811        ) {
4812            unsafe {
4813                let f: &F = &*(f as *const F);
4814                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4815            }
4816        }
4817        unsafe {
4818            let f: Box_<F> = Box_::new(f);
4819            connect_raw(
4820                self.as_ptr() as *mut _,
4821                c"notify::sensitive".as_ptr(),
4822                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4823                    notify_sensitive_trampoline::<Self, F> as *const (),
4824                )),
4825                Box_::into_raw(f),
4826            )
4827        }
4828    }
4829
4830    #[doc(alias = "tooltip-markup")]
4831    fn connect_tooltip_markup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4832        unsafe extern "C" fn notify_tooltip_markup_trampoline<
4833            P: IsA<Widget>,
4834            F: Fn(&P) + 'static,
4835        >(
4836            this: *mut ffi::GtkWidget,
4837            _param_spec: glib::ffi::gpointer,
4838            f: glib::ffi::gpointer,
4839        ) {
4840            unsafe {
4841                let f: &F = &*(f as *const F);
4842                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4843            }
4844        }
4845        unsafe {
4846            let f: Box_<F> = Box_::new(f);
4847            connect_raw(
4848                self.as_ptr() as *mut _,
4849                c"notify::tooltip-markup".as_ptr(),
4850                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4851                    notify_tooltip_markup_trampoline::<Self, F> as *const (),
4852                )),
4853                Box_::into_raw(f),
4854            )
4855        }
4856    }
4857
4858    #[doc(alias = "tooltip-text")]
4859    fn connect_tooltip_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4860        unsafe extern "C" fn notify_tooltip_text_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4861            this: *mut ffi::GtkWidget,
4862            _param_spec: glib::ffi::gpointer,
4863            f: glib::ffi::gpointer,
4864        ) {
4865            unsafe {
4866                let f: &F = &*(f as *const F);
4867                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4868            }
4869        }
4870        unsafe {
4871            let f: Box_<F> = Box_::new(f);
4872            connect_raw(
4873                self.as_ptr() as *mut _,
4874                c"notify::tooltip-text".as_ptr(),
4875                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4876                    notify_tooltip_text_trampoline::<Self, F> as *const (),
4877                )),
4878                Box_::into_raw(f),
4879            )
4880        }
4881    }
4882
4883    #[doc(alias = "valign")]
4884    fn connect_valign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4885        unsafe extern "C" fn notify_valign_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4886            this: *mut ffi::GtkWidget,
4887            _param_spec: glib::ffi::gpointer,
4888            f: glib::ffi::gpointer,
4889        ) {
4890            unsafe {
4891                let f: &F = &*(f as *const F);
4892                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4893            }
4894        }
4895        unsafe {
4896            let f: Box_<F> = Box_::new(f);
4897            connect_raw(
4898                self.as_ptr() as *mut _,
4899                c"notify::valign".as_ptr(),
4900                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4901                    notify_valign_trampoline::<Self, F> as *const (),
4902                )),
4903                Box_::into_raw(f),
4904            )
4905        }
4906    }
4907
4908    #[doc(alias = "vexpand")]
4909    fn connect_vexpand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4910        unsafe extern "C" fn notify_vexpand_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4911            this: *mut ffi::GtkWidget,
4912            _param_spec: glib::ffi::gpointer,
4913            f: glib::ffi::gpointer,
4914        ) {
4915            unsafe {
4916                let f: &F = &*(f as *const F);
4917                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4918            }
4919        }
4920        unsafe {
4921            let f: Box_<F> = Box_::new(f);
4922            connect_raw(
4923                self.as_ptr() as *mut _,
4924                c"notify::vexpand".as_ptr(),
4925                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4926                    notify_vexpand_trampoline::<Self, F> as *const (),
4927                )),
4928                Box_::into_raw(f),
4929            )
4930        }
4931    }
4932
4933    #[doc(alias = "vexpand-set")]
4934    fn connect_vexpand_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4935        unsafe extern "C" fn notify_vexpand_set_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4936            this: *mut ffi::GtkWidget,
4937            _param_spec: glib::ffi::gpointer,
4938            f: glib::ffi::gpointer,
4939        ) {
4940            unsafe {
4941                let f: &F = &*(f as *const F);
4942                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4943            }
4944        }
4945        unsafe {
4946            let f: Box_<F> = Box_::new(f);
4947            connect_raw(
4948                self.as_ptr() as *mut _,
4949                c"notify::vexpand-set".as_ptr(),
4950                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4951                    notify_vexpand_set_trampoline::<Self, F> as *const (),
4952                )),
4953                Box_::into_raw(f),
4954            )
4955        }
4956    }
4957
4958    #[doc(alias = "visible")]
4959    fn connect_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4960        unsafe extern "C" fn notify_visible_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
4961            this: *mut ffi::GtkWidget,
4962            _param_spec: glib::ffi::gpointer,
4963            f: glib::ffi::gpointer,
4964        ) {
4965            unsafe {
4966                let f: &F = &*(f as *const F);
4967                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4968            }
4969        }
4970        unsafe {
4971            let f: Box_<F> = Box_::new(f);
4972            connect_raw(
4973                self.as_ptr() as *mut _,
4974                c"notify::visible".as_ptr(),
4975                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4976                    notify_visible_trampoline::<Self, F> as *const (),
4977                )),
4978                Box_::into_raw(f),
4979            )
4980        }
4981    }
4982
4983    #[doc(alias = "width-request")]
4984    fn connect_width_request_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4985        unsafe extern "C" fn notify_width_request_trampoline<
4986            P: IsA<Widget>,
4987            F: Fn(&P) + 'static,
4988        >(
4989            this: *mut ffi::GtkWidget,
4990            _param_spec: glib::ffi::gpointer,
4991            f: glib::ffi::gpointer,
4992        ) {
4993            unsafe {
4994                let f: &F = &*(f as *const F);
4995                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
4996            }
4997        }
4998        unsafe {
4999            let f: Box_<F> = Box_::new(f);
5000            connect_raw(
5001                self.as_ptr() as *mut _,
5002                c"notify::width-request".as_ptr(),
5003                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5004                    notify_width_request_trampoline::<Self, F> as *const (),
5005                )),
5006                Box_::into_raw(f),
5007            )
5008        }
5009    }
5010
5011    #[doc(alias = "window")]
5012    fn connect_window_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5013        unsafe extern "C" fn notify_window_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
5014            this: *mut ffi::GtkWidget,
5015            _param_spec: glib::ffi::gpointer,
5016            f: glib::ffi::gpointer,
5017        ) {
5018            unsafe {
5019                let f: &F = &*(f as *const F);
5020                f(Widget::from_glib_borrow(this).unsafe_cast_ref())
5021            }
5022        }
5023        unsafe {
5024            let f: Box_<F> = Box_::new(f);
5025            connect_raw(
5026                self.as_ptr() as *mut _,
5027                c"notify::window".as_ptr(),
5028                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
5029                    notify_window_trampoline::<Self, F> as *const (),
5030                )),
5031                Box_::into_raw(f),
5032            )
5033        }
5034    }
5035}
5036
5037impl<O: IsA<Widget>> WidgetExt for O {}