gtk/auto/
window.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    AccelGroup, Align, Application, Bin, Buildable, Container, ResizeMode, Widget, WindowGroup,
7    WindowPosition, WindowType,
8};
9use glib::{
10    prelude::*,
11    signal::{connect_raw, SignalHandlerId},
12    translate::*,
13};
14use std::{boxed::Box as Box_, fmt, mem, mem::transmute, ptr};
15
16glib::wrapper! {
17    #[doc(alias = "GtkWindow")]
18    pub struct Window(Object<ffi::GtkWindow, ffi::GtkWindowClass>) @extends Bin, Container, Widget, @implements Buildable;
19
20    match fn {
21        type_ => || ffi::gtk_window_get_type(),
22    }
23}
24
25impl Window {
26    pub const NONE: Option<&'static Window> = None;
27
28    #[doc(alias = "gtk_window_new")]
29    pub fn new(type_: WindowType) -> Window {
30        assert_initialized_main_thread!();
31        unsafe { Widget::from_glib_none(ffi::gtk_window_new(type_.into_glib())).unsafe_cast() }
32    }
33
34    // rustdoc-stripper-ignore-next
35    /// Creates a new builder-pattern struct instance to construct [`Window`] objects.
36    ///
37    /// This method returns an instance of [`WindowBuilder`](crate::builders::WindowBuilder) which can be used to create [`Window`] objects.
38    pub fn builder() -> WindowBuilder {
39        WindowBuilder::new()
40    }
41
42    #[doc(alias = "gtk_window_get_default_icon_list")]
43    #[doc(alias = "get_default_icon_list")]
44    pub fn default_icon_list() -> Vec<gdk_pixbuf::Pixbuf> {
45        assert_initialized_main_thread!();
46        unsafe {
47            FromGlibPtrContainer::from_glib_container(ffi::gtk_window_get_default_icon_list())
48        }
49    }
50
51    #[doc(alias = "gtk_window_get_default_icon_name")]
52    #[doc(alias = "get_default_icon_name")]
53    pub fn default_icon_name() -> Option<glib::GString> {
54        assert_initialized_main_thread!();
55        unsafe { from_glib_none(ffi::gtk_window_get_default_icon_name()) }
56    }
57
58    #[doc(alias = "gtk_window_list_toplevels")]
59    pub fn list_toplevels() -> Vec<Widget> {
60        assert_initialized_main_thread!();
61        unsafe { FromGlibPtrContainer::from_glib_container(ffi::gtk_window_list_toplevels()) }
62    }
63
64    #[doc(alias = "gtk_window_set_auto_startup_notification")]
65    pub fn set_auto_startup_notification(setting: bool) {
66        assert_initialized_main_thread!();
67        unsafe {
68            ffi::gtk_window_set_auto_startup_notification(setting.into_glib());
69        }
70    }
71
72    #[doc(alias = "gtk_window_set_default_icon")]
73    pub fn set_default_icon(icon: &gdk_pixbuf::Pixbuf) {
74        assert_initialized_main_thread!();
75        unsafe {
76            ffi::gtk_window_set_default_icon(icon.to_glib_none().0);
77        }
78    }
79
80    #[doc(alias = "gtk_window_set_default_icon_from_file")]
81    pub fn set_default_icon_from_file(
82        filename: impl AsRef<std::path::Path>,
83    ) -> Result<(), glib::Error> {
84        assert_initialized_main_thread!();
85        unsafe {
86            let mut error = ptr::null_mut();
87            let is_ok = ffi::gtk_window_set_default_icon_from_file(
88                filename.as_ref().to_glib_none().0,
89                &mut error,
90            );
91            debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
92            if error.is_null() {
93                Ok(())
94            } else {
95                Err(from_glib_full(error))
96            }
97        }
98    }
99
100    #[doc(alias = "gtk_window_set_default_icon_list")]
101    pub fn set_default_icon_list(list: &[gdk_pixbuf::Pixbuf]) {
102        assert_initialized_main_thread!();
103        unsafe {
104            ffi::gtk_window_set_default_icon_list(list.to_glib_container().0);
105        }
106    }
107
108    #[doc(alias = "gtk_window_set_default_icon_name")]
109    pub fn set_default_icon_name(name: &str) {
110        assert_initialized_main_thread!();
111        unsafe {
112            ffi::gtk_window_set_default_icon_name(name.to_glib_none().0);
113        }
114    }
115
116    #[doc(alias = "gtk_window_set_interactive_debugging")]
117    pub fn set_interactive_debugging(enable: bool) {
118        assert_initialized_main_thread!();
119        unsafe {
120            ffi::gtk_window_set_interactive_debugging(enable.into_glib());
121        }
122    }
123}
124
125impl Default for Window {
126    fn default() -> Self {
127        glib::object::Object::new::<Self>()
128    }
129}
130
131// rustdoc-stripper-ignore-next
132/// A [builder-pattern] type to construct [`Window`] objects.
133///
134/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
135#[must_use = "The builder must be built to be used"]
136pub struct WindowBuilder {
137    builder: glib::object::ObjectBuilder<'static, Window>,
138}
139
140impl WindowBuilder {
141    fn new() -> Self {
142        Self {
143            builder: glib::object::Object::builder(),
144        }
145    }
146
147    pub fn accept_focus(self, accept_focus: bool) -> Self {
148        Self {
149            builder: self.builder.property("accept-focus", accept_focus),
150        }
151    }
152
153    pub fn application(self, application: &impl IsA<Application>) -> Self {
154        Self {
155            builder: self
156                .builder
157                .property("application", application.clone().upcast()),
158        }
159    }
160
161    pub fn attached_to(self, attached_to: &impl IsA<Widget>) -> Self {
162        Self {
163            builder: self
164                .builder
165                .property("attached-to", attached_to.clone().upcast()),
166        }
167    }
168
169    pub fn decorated(self, decorated: bool) -> Self {
170        Self {
171            builder: self.builder.property("decorated", decorated),
172        }
173    }
174
175    pub fn default_height(self, default_height: i32) -> Self {
176        Self {
177            builder: self.builder.property("default-height", default_height),
178        }
179    }
180
181    pub fn default_width(self, default_width: i32) -> Self {
182        Self {
183            builder: self.builder.property("default-width", default_width),
184        }
185    }
186
187    pub fn deletable(self, deletable: bool) -> Self {
188        Self {
189            builder: self.builder.property("deletable", deletable),
190        }
191    }
192
193    pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self {
194        Self {
195            builder: self
196                .builder
197                .property("destroy-with-parent", destroy_with_parent),
198        }
199    }
200
201    pub fn focus_on_map(self, focus_on_map: bool) -> Self {
202        Self {
203            builder: self.builder.property("focus-on-map", focus_on_map),
204        }
205    }
206
207    pub fn focus_visible(self, focus_visible: bool) -> Self {
208        Self {
209            builder: self.builder.property("focus-visible", focus_visible),
210        }
211    }
212
213    pub fn gravity(self, gravity: gdk::Gravity) -> Self {
214        Self {
215            builder: self.builder.property("gravity", gravity),
216        }
217    }
218
219    pub fn hide_titlebar_when_maximized(self, hide_titlebar_when_maximized: bool) -> Self {
220        Self {
221            builder: self
222                .builder
223                .property("hide-titlebar-when-maximized", hide_titlebar_when_maximized),
224        }
225    }
226
227    pub fn icon(self, icon: &gdk_pixbuf::Pixbuf) -> Self {
228        Self {
229            builder: self.builder.property("icon", icon.clone()),
230        }
231    }
232
233    pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
234        Self {
235            builder: self.builder.property("icon-name", icon_name.into()),
236        }
237    }
238
239    pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self {
240        Self {
241            builder: self
242                .builder
243                .property("mnemonics-visible", mnemonics_visible),
244        }
245    }
246
247    pub fn modal(self, modal: bool) -> Self {
248        Self {
249            builder: self.builder.property("modal", modal),
250        }
251    }
252
253    pub fn resizable(self, resizable: bool) -> Self {
254        Self {
255            builder: self.builder.property("resizable", resizable),
256        }
257    }
258
259    pub fn role(self, role: impl Into<glib::GString>) -> Self {
260        Self {
261            builder: self.builder.property("role", role.into()),
262        }
263    }
264
265    pub fn screen(self, screen: &gdk::Screen) -> Self {
266        Self {
267            builder: self.builder.property("screen", screen.clone()),
268        }
269    }
270
271    pub fn skip_pager_hint(self, skip_pager_hint: bool) -> Self {
272        Self {
273            builder: self.builder.property("skip-pager-hint", skip_pager_hint),
274        }
275    }
276
277    pub fn skip_taskbar_hint(self, skip_taskbar_hint: bool) -> Self {
278        Self {
279            builder: self
280                .builder
281                .property("skip-taskbar-hint", skip_taskbar_hint),
282        }
283    }
284
285    pub fn startup_id(self, startup_id: impl Into<glib::GString>) -> Self {
286        Self {
287            builder: self.builder.property("startup-id", startup_id.into()),
288        }
289    }
290
291    pub fn title(self, title: impl Into<glib::GString>) -> Self {
292        Self {
293            builder: self.builder.property("title", title.into()),
294        }
295    }
296
297    pub fn transient_for(self, transient_for: &impl IsA<Window>) -> Self {
298        Self {
299            builder: self
300                .builder
301                .property("transient-for", transient_for.clone().upcast()),
302        }
303    }
304
305    pub fn type_(self, type_: WindowType) -> Self {
306        Self {
307            builder: self.builder.property("type", type_),
308        }
309    }
310
311    pub fn type_hint(self, type_hint: gdk::WindowTypeHint) -> Self {
312        Self {
313            builder: self.builder.property("type-hint", type_hint),
314        }
315    }
316
317    pub fn urgency_hint(self, urgency_hint: bool) -> Self {
318        Self {
319            builder: self.builder.property("urgency-hint", urgency_hint),
320        }
321    }
322
323    pub fn window_position(self, window_position: WindowPosition) -> Self {
324        Self {
325            builder: self.builder.property("window-position", window_position),
326        }
327    }
328
329    pub fn border_width(self, border_width: u32) -> Self {
330        Self {
331            builder: self.builder.property("border-width", border_width),
332        }
333    }
334
335    pub fn child(self, child: &impl IsA<Widget>) -> Self {
336        Self {
337            builder: self.builder.property("child", child.clone().upcast()),
338        }
339    }
340
341    pub fn resize_mode(self, resize_mode: ResizeMode) -> Self {
342        Self {
343            builder: self.builder.property("resize-mode", resize_mode),
344        }
345    }
346
347    pub fn app_paintable(self, app_paintable: bool) -> Self {
348        Self {
349            builder: self.builder.property("app-paintable", app_paintable),
350        }
351    }
352
353    pub fn can_default(self, can_default: bool) -> Self {
354        Self {
355            builder: self.builder.property("can-default", can_default),
356        }
357    }
358
359    pub fn can_focus(self, can_focus: bool) -> Self {
360        Self {
361            builder: self.builder.property("can-focus", can_focus),
362        }
363    }
364
365    pub fn events(self, events: gdk::EventMask) -> Self {
366        Self {
367            builder: self.builder.property("events", events),
368        }
369    }
370
371    pub fn expand(self, expand: bool) -> Self {
372        Self {
373            builder: self.builder.property("expand", expand),
374        }
375    }
376
377    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
378        Self {
379            builder: self.builder.property("focus-on-click", focus_on_click),
380        }
381    }
382
383    pub fn halign(self, halign: Align) -> Self {
384        Self {
385            builder: self.builder.property("halign", halign),
386        }
387    }
388
389    pub fn has_default(self, has_default: bool) -> Self {
390        Self {
391            builder: self.builder.property("has-default", has_default),
392        }
393    }
394
395    pub fn has_focus(self, has_focus: bool) -> Self {
396        Self {
397            builder: self.builder.property("has-focus", has_focus),
398        }
399    }
400
401    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
402        Self {
403            builder: self.builder.property("has-tooltip", has_tooltip),
404        }
405    }
406
407    pub fn height_request(self, height_request: i32) -> Self {
408        Self {
409            builder: self.builder.property("height-request", height_request),
410        }
411    }
412
413    pub fn hexpand(self, hexpand: bool) -> Self {
414        Self {
415            builder: self.builder.property("hexpand", hexpand),
416        }
417    }
418
419    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
420        Self {
421            builder: self.builder.property("hexpand-set", hexpand_set),
422        }
423    }
424
425    pub fn is_focus(self, is_focus: bool) -> Self {
426        Self {
427            builder: self.builder.property("is-focus", is_focus),
428        }
429    }
430
431    pub fn margin(self, margin: i32) -> Self {
432        Self {
433            builder: self.builder.property("margin", margin),
434        }
435    }
436
437    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
438        Self {
439            builder: self.builder.property("margin-bottom", margin_bottom),
440        }
441    }
442
443    pub fn margin_end(self, margin_end: i32) -> Self {
444        Self {
445            builder: self.builder.property("margin-end", margin_end),
446        }
447    }
448
449    pub fn margin_start(self, margin_start: i32) -> Self {
450        Self {
451            builder: self.builder.property("margin-start", margin_start),
452        }
453    }
454
455    pub fn margin_top(self, margin_top: i32) -> Self {
456        Self {
457            builder: self.builder.property("margin-top", margin_top),
458        }
459    }
460
461    pub fn name(self, name: impl Into<glib::GString>) -> Self {
462        Self {
463            builder: self.builder.property("name", name.into()),
464        }
465    }
466
467    pub fn no_show_all(self, no_show_all: bool) -> Self {
468        Self {
469            builder: self.builder.property("no-show-all", no_show_all),
470        }
471    }
472
473    pub fn opacity(self, opacity: f64) -> Self {
474        Self {
475            builder: self.builder.property("opacity", opacity),
476        }
477    }
478
479    pub fn parent(self, parent: &impl IsA<Container>) -> Self {
480        Self {
481            builder: self.builder.property("parent", parent.clone().upcast()),
482        }
483    }
484
485    pub fn receives_default(self, receives_default: bool) -> Self {
486        Self {
487            builder: self.builder.property("receives-default", receives_default),
488        }
489    }
490
491    pub fn sensitive(self, sensitive: bool) -> Self {
492        Self {
493            builder: self.builder.property("sensitive", sensitive),
494        }
495    }
496
497    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
498        Self {
499            builder: self
500                .builder
501                .property("tooltip-markup", tooltip_markup.into()),
502        }
503    }
504
505    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
506        Self {
507            builder: self.builder.property("tooltip-text", tooltip_text.into()),
508        }
509    }
510
511    pub fn valign(self, valign: Align) -> Self {
512        Self {
513            builder: self.builder.property("valign", valign),
514        }
515    }
516
517    pub fn vexpand(self, vexpand: bool) -> Self {
518        Self {
519            builder: self.builder.property("vexpand", vexpand),
520        }
521    }
522
523    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
524        Self {
525            builder: self.builder.property("vexpand-set", vexpand_set),
526        }
527    }
528
529    pub fn visible(self, visible: bool) -> Self {
530        Self {
531            builder: self.builder.property("visible", visible),
532        }
533    }
534
535    pub fn width_request(self, width_request: i32) -> Self {
536        Self {
537            builder: self.builder.property("width-request", width_request),
538        }
539    }
540
541    // rustdoc-stripper-ignore-next
542    /// Build the [`Window`].
543    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
544    pub fn build(self) -> Window {
545        self.builder.build()
546    }
547}
548
549mod sealed {
550    pub trait Sealed {}
551    impl<T: super::IsA<super::Window>> Sealed for T {}
552}
553
554pub trait GtkWindowExt: IsA<Window> + sealed::Sealed + 'static {
555    #[doc(alias = "gtk_window_activate_default")]
556    fn activate_default(&self) -> bool {
557        unsafe {
558            from_glib(ffi::gtk_window_activate_default(
559                self.as_ref().to_glib_none().0,
560            ))
561        }
562    }
563
564    #[doc(alias = "gtk_window_activate_focus")]
565    fn activate_focus(&self) -> bool {
566        unsafe {
567            from_glib(ffi::gtk_window_activate_focus(
568                self.as_ref().to_glib_none().0,
569            ))
570        }
571    }
572
573    #[doc(alias = "gtk_window_activate_key")]
574    fn activate_key(&self, event: &gdk::EventKey) -> bool {
575        unsafe {
576            from_glib(ffi::gtk_window_activate_key(
577                self.as_ref().to_glib_none().0,
578                mut_override(event.to_glib_none().0),
579            ))
580        }
581    }
582
583    #[doc(alias = "gtk_window_add_accel_group")]
584    fn add_accel_group(&self, accel_group: &impl IsA<AccelGroup>) {
585        unsafe {
586            ffi::gtk_window_add_accel_group(
587                self.as_ref().to_glib_none().0,
588                accel_group.as_ref().to_glib_none().0,
589            );
590        }
591    }
592
593    #[doc(alias = "gtk_window_add_mnemonic")]
594    fn add_mnemonic(&self, keyval: u32, target: &impl IsA<Widget>) {
595        unsafe {
596            ffi::gtk_window_add_mnemonic(
597                self.as_ref().to_glib_none().0,
598                keyval,
599                target.as_ref().to_glib_none().0,
600            );
601        }
602    }
603
604    #[doc(alias = "gtk_window_begin_move_drag")]
605    fn begin_move_drag(&self, button: i32, root_x: i32, root_y: i32, timestamp: u32) {
606        unsafe {
607            ffi::gtk_window_begin_move_drag(
608                self.as_ref().to_glib_none().0,
609                button,
610                root_x,
611                root_y,
612                timestamp,
613            );
614        }
615    }
616
617    #[doc(alias = "gtk_window_begin_resize_drag")]
618    fn begin_resize_drag(
619        &self,
620        edge: gdk::WindowEdge,
621        button: i32,
622        root_x: i32,
623        root_y: i32,
624        timestamp: u32,
625    ) {
626        unsafe {
627            ffi::gtk_window_begin_resize_drag(
628                self.as_ref().to_glib_none().0,
629                edge.into_glib(),
630                button,
631                root_x,
632                root_y,
633                timestamp,
634            );
635        }
636    }
637
638    #[doc(alias = "gtk_window_close")]
639    fn close(&self) {
640        unsafe {
641            ffi::gtk_window_close(self.as_ref().to_glib_none().0);
642        }
643    }
644
645    #[doc(alias = "gtk_window_deiconify")]
646    fn deiconify(&self) {
647        unsafe {
648            ffi::gtk_window_deiconify(self.as_ref().to_glib_none().0);
649        }
650    }
651
652    #[doc(alias = "gtk_window_fullscreen")]
653    fn fullscreen(&self) {
654        unsafe {
655            ffi::gtk_window_fullscreen(self.as_ref().to_glib_none().0);
656        }
657    }
658
659    #[doc(alias = "gtk_window_fullscreen_on_monitor")]
660    fn fullscreen_on_monitor(&self, screen: &gdk::Screen, monitor: i32) {
661        unsafe {
662            ffi::gtk_window_fullscreen_on_monitor(
663                self.as_ref().to_glib_none().0,
664                screen.to_glib_none().0,
665                monitor,
666            );
667        }
668    }
669
670    #[doc(alias = "gtk_window_get_accept_focus")]
671    #[doc(alias = "get_accept_focus")]
672    fn accepts_focus(&self) -> bool {
673        unsafe {
674            from_glib(ffi::gtk_window_get_accept_focus(
675                self.as_ref().to_glib_none().0,
676            ))
677        }
678    }
679
680    #[doc(alias = "gtk_window_get_application")]
681    #[doc(alias = "get_application")]
682    fn application(&self) -> Option<Application> {
683        unsafe {
684            from_glib_none(ffi::gtk_window_get_application(
685                self.as_ref().to_glib_none().0,
686            ))
687        }
688    }
689
690    #[doc(alias = "gtk_window_get_attached_to")]
691    #[doc(alias = "get_attached_to")]
692    fn attached_to(&self) -> Option<Widget> {
693        unsafe {
694            from_glib_none(ffi::gtk_window_get_attached_to(
695                self.as_ref().to_glib_none().0,
696            ))
697        }
698    }
699
700    #[doc(alias = "gtk_window_get_decorated")]
701    #[doc(alias = "get_decorated")]
702    fn is_decorated(&self) -> bool {
703        unsafe {
704            from_glib(ffi::gtk_window_get_decorated(
705                self.as_ref().to_glib_none().0,
706            ))
707        }
708    }
709
710    #[doc(alias = "gtk_window_get_default_size")]
711    #[doc(alias = "get_default_size")]
712    fn default_size(&self) -> (i32, i32) {
713        unsafe {
714            let mut width = mem::MaybeUninit::uninit();
715            let mut height = mem::MaybeUninit::uninit();
716            ffi::gtk_window_get_default_size(
717                self.as_ref().to_glib_none().0,
718                width.as_mut_ptr(),
719                height.as_mut_ptr(),
720            );
721            (width.assume_init(), height.assume_init())
722        }
723    }
724
725    #[doc(alias = "gtk_window_get_default_widget")]
726    #[doc(alias = "get_default_widget")]
727    fn default_widget(&self) -> Option<Widget> {
728        unsafe {
729            from_glib_none(ffi::gtk_window_get_default_widget(
730                self.as_ref().to_glib_none().0,
731            ))
732        }
733    }
734
735    #[doc(alias = "gtk_window_get_deletable")]
736    #[doc(alias = "get_deletable")]
737    fn is_deletable(&self) -> bool {
738        unsafe {
739            from_glib(ffi::gtk_window_get_deletable(
740                self.as_ref().to_glib_none().0,
741            ))
742        }
743    }
744
745    #[doc(alias = "gtk_window_get_destroy_with_parent")]
746    #[doc(alias = "get_destroy_with_parent")]
747    fn must_destroy_with_parent(&self) -> bool {
748        unsafe {
749            from_glib(ffi::gtk_window_get_destroy_with_parent(
750                self.as_ref().to_glib_none().0,
751            ))
752        }
753    }
754
755    #[doc(alias = "gtk_window_get_focus")]
756    #[doc(alias = "get_focus")]
757    fn focused_widget(&self) -> Option<Widget> {
758        unsafe { from_glib_none(ffi::gtk_window_get_focus(self.as_ref().to_glib_none().0)) }
759    }
760
761    #[doc(alias = "gtk_window_get_focus_on_map")]
762    #[doc(alias = "get_focus_on_map")]
763    fn gets_focus_on_map(&self) -> bool {
764        unsafe {
765            from_glib(ffi::gtk_window_get_focus_on_map(
766                self.as_ref().to_glib_none().0,
767            ))
768        }
769    }
770
771    #[doc(alias = "gtk_window_get_focus_visible")]
772    #[doc(alias = "get_focus_visible")]
773    fn gets_focus_visible(&self) -> bool {
774        unsafe {
775            from_glib(ffi::gtk_window_get_focus_visible(
776                self.as_ref().to_glib_none().0,
777            ))
778        }
779    }
780
781    #[doc(alias = "gtk_window_get_gravity")]
782    #[doc(alias = "get_gravity")]
783    fn gravity(&self) -> gdk::Gravity {
784        unsafe { from_glib(ffi::gtk_window_get_gravity(self.as_ref().to_glib_none().0)) }
785    }
786
787    #[doc(alias = "gtk_window_get_group")]
788    #[doc(alias = "get_group")]
789    fn group(&self) -> Option<WindowGroup> {
790        unsafe { from_glib_none(ffi::gtk_window_get_group(self.as_ref().to_glib_none().0)) }
791    }
792
793    #[doc(alias = "gtk_window_get_hide_titlebar_when_maximized")]
794    #[doc(alias = "get_hide_titlebar_when_maximized")]
795    fn hides_titlebar_when_maximized(&self) -> bool {
796        unsafe {
797            from_glib(ffi::gtk_window_get_hide_titlebar_when_maximized(
798                self.as_ref().to_glib_none().0,
799            ))
800        }
801    }
802
803    #[doc(alias = "gtk_window_get_icon")]
804    #[doc(alias = "get_icon")]
805    fn icon(&self) -> Option<gdk_pixbuf::Pixbuf> {
806        unsafe { from_glib_none(ffi::gtk_window_get_icon(self.as_ref().to_glib_none().0)) }
807    }
808
809    #[doc(alias = "gtk_window_get_icon_list")]
810    #[doc(alias = "get_icon_list")]
811    fn icon_list(&self) -> Vec<gdk_pixbuf::Pixbuf> {
812        unsafe {
813            FromGlibPtrContainer::from_glib_container(ffi::gtk_window_get_icon_list(
814                self.as_ref().to_glib_none().0,
815            ))
816        }
817    }
818
819    #[doc(alias = "gtk_window_get_icon_name")]
820    #[doc(alias = "get_icon_name")]
821    fn icon_name(&self) -> Option<glib::GString> {
822        unsafe {
823            from_glib_none(ffi::gtk_window_get_icon_name(
824                self.as_ref().to_glib_none().0,
825            ))
826        }
827    }
828
829    #[doc(alias = "gtk_window_get_mnemonic_modifier")]
830    #[doc(alias = "get_mnemonic_modifier")]
831    fn mnemonic_modifier(&self) -> gdk::ModifierType {
832        unsafe {
833            from_glib(ffi::gtk_window_get_mnemonic_modifier(
834                self.as_ref().to_glib_none().0,
835            ))
836        }
837    }
838
839    #[doc(alias = "gtk_window_get_mnemonics_visible")]
840    #[doc(alias = "get_mnemonics_visible")]
841    fn is_mnemonics_visible(&self) -> bool {
842        unsafe {
843            from_glib(ffi::gtk_window_get_mnemonics_visible(
844                self.as_ref().to_glib_none().0,
845            ))
846        }
847    }
848
849    #[doc(alias = "gtk_window_get_modal")]
850    #[doc(alias = "get_modal")]
851    fn is_modal(&self) -> bool {
852        unsafe { from_glib(ffi::gtk_window_get_modal(self.as_ref().to_glib_none().0)) }
853    }
854
855    #[doc(alias = "gtk_window_get_position")]
856    #[doc(alias = "get_position")]
857    fn position(&self) -> (i32, i32) {
858        unsafe {
859            let mut root_x = mem::MaybeUninit::uninit();
860            let mut root_y = mem::MaybeUninit::uninit();
861            ffi::gtk_window_get_position(
862                self.as_ref().to_glib_none().0,
863                root_x.as_mut_ptr(),
864                root_y.as_mut_ptr(),
865            );
866            (root_x.assume_init(), root_y.assume_init())
867        }
868    }
869
870    #[doc(alias = "gtk_window_get_resizable")]
871    #[doc(alias = "get_resizable")]
872    fn is_resizable(&self) -> bool {
873        unsafe {
874            from_glib(ffi::gtk_window_get_resizable(
875                self.as_ref().to_glib_none().0,
876            ))
877        }
878    }
879
880    #[doc(alias = "gtk_window_get_role")]
881    #[doc(alias = "get_role")]
882    fn role(&self) -> Option<glib::GString> {
883        unsafe { from_glib_none(ffi::gtk_window_get_role(self.as_ref().to_glib_none().0)) }
884    }
885
886    #[doc(alias = "gtk_window_get_screen")]
887    #[doc(alias = "get_screen")]
888    fn screen(&self) -> Option<gdk::Screen> {
889        unsafe { from_glib_none(ffi::gtk_window_get_screen(self.as_ref().to_glib_none().0)) }
890    }
891
892    #[doc(alias = "gtk_window_get_size")]
893    #[doc(alias = "get_size")]
894    fn size(&self) -> (i32, i32) {
895        unsafe {
896            let mut width = mem::MaybeUninit::uninit();
897            let mut height = mem::MaybeUninit::uninit();
898            ffi::gtk_window_get_size(
899                self.as_ref().to_glib_none().0,
900                width.as_mut_ptr(),
901                height.as_mut_ptr(),
902            );
903            (width.assume_init(), height.assume_init())
904        }
905    }
906
907    #[doc(alias = "gtk_window_get_skip_pager_hint")]
908    #[doc(alias = "get_skip_pager_hint")]
909    fn skips_pager_hint(&self) -> bool {
910        unsafe {
911            from_glib(ffi::gtk_window_get_skip_pager_hint(
912                self.as_ref().to_glib_none().0,
913            ))
914        }
915    }
916
917    #[doc(alias = "gtk_window_get_skip_taskbar_hint")]
918    #[doc(alias = "get_skip_taskbar_hint")]
919    fn skips_taskbar_hint(&self) -> bool {
920        unsafe {
921            from_glib(ffi::gtk_window_get_skip_taskbar_hint(
922                self.as_ref().to_glib_none().0,
923            ))
924        }
925    }
926
927    #[doc(alias = "gtk_window_get_title")]
928    #[doc(alias = "get_title")]
929    fn title(&self) -> Option<glib::GString> {
930        unsafe { from_glib_none(ffi::gtk_window_get_title(self.as_ref().to_glib_none().0)) }
931    }
932
933    #[doc(alias = "gtk_window_get_titlebar")]
934    #[doc(alias = "get_titlebar")]
935    fn titlebar(&self) -> Option<Widget> {
936        unsafe { from_glib_none(ffi::gtk_window_get_titlebar(self.as_ref().to_glib_none().0)) }
937    }
938
939    #[doc(alias = "gtk_window_get_transient_for")]
940    #[doc(alias = "get_transient_for")]
941    #[must_use]
942    fn transient_for(&self) -> Option<Window> {
943        unsafe {
944            from_glib_none(ffi::gtk_window_get_transient_for(
945                self.as_ref().to_glib_none().0,
946            ))
947        }
948    }
949
950    #[doc(alias = "gtk_window_get_type_hint")]
951    #[doc(alias = "get_type_hint")]
952    fn type_hint(&self) -> gdk::WindowTypeHint {
953        unsafe {
954            from_glib(ffi::gtk_window_get_type_hint(
955                self.as_ref().to_glib_none().0,
956            ))
957        }
958    }
959
960    #[doc(alias = "gtk_window_get_urgency_hint")]
961    #[doc(alias = "get_urgency_hint")]
962    fn is_urgency_hint(&self) -> bool {
963        unsafe {
964            from_glib(ffi::gtk_window_get_urgency_hint(
965                self.as_ref().to_glib_none().0,
966            ))
967        }
968    }
969
970    #[doc(alias = "gtk_window_get_window_type")]
971    #[doc(alias = "get_window_type")]
972    fn window_type(&self) -> WindowType {
973        unsafe {
974            from_glib(ffi::gtk_window_get_window_type(
975                self.as_ref().to_glib_none().0,
976            ))
977        }
978    }
979
980    #[doc(alias = "gtk_window_has_group")]
981    fn has_group(&self) -> bool {
982        unsafe { from_glib(ffi::gtk_window_has_group(self.as_ref().to_glib_none().0)) }
983    }
984
985    #[doc(alias = "gtk_window_has_toplevel_focus")]
986    fn has_toplevel_focus(&self) -> bool {
987        unsafe {
988            from_glib(ffi::gtk_window_has_toplevel_focus(
989                self.as_ref().to_glib_none().0,
990            ))
991        }
992    }
993
994    #[doc(alias = "gtk_window_iconify")]
995    fn iconify(&self) {
996        unsafe {
997            ffi::gtk_window_iconify(self.as_ref().to_glib_none().0);
998        }
999    }
1000
1001    #[doc(alias = "gtk_window_is_active")]
1002    fn is_active(&self) -> bool {
1003        unsafe { from_glib(ffi::gtk_window_is_active(self.as_ref().to_glib_none().0)) }
1004    }
1005
1006    #[doc(alias = "gtk_window_is_maximized")]
1007    fn is_maximized(&self) -> bool {
1008        unsafe { from_glib(ffi::gtk_window_is_maximized(self.as_ref().to_glib_none().0)) }
1009    }
1010
1011    #[doc(alias = "gtk_window_maximize")]
1012    fn maximize(&self) {
1013        unsafe {
1014            ffi::gtk_window_maximize(self.as_ref().to_glib_none().0);
1015        }
1016    }
1017
1018    #[doc(alias = "gtk_window_mnemonic_activate")]
1019    fn mnemonic_activate(&self, keyval: u32, modifier: gdk::ModifierType) -> bool {
1020        unsafe {
1021            from_glib(ffi::gtk_window_mnemonic_activate(
1022                self.as_ref().to_glib_none().0,
1023                keyval,
1024                modifier.into_glib(),
1025            ))
1026        }
1027    }
1028
1029    #[doc(alias = "gtk_window_move")]
1030    #[doc(alias = "move")]
1031    fn move_(&self, x: i32, y: i32) {
1032        unsafe {
1033            ffi::gtk_window_move(self.as_ref().to_glib_none().0, x, y);
1034        }
1035    }
1036
1037    #[doc(alias = "gtk_window_present")]
1038    fn present(&self) {
1039        unsafe {
1040            ffi::gtk_window_present(self.as_ref().to_glib_none().0);
1041        }
1042    }
1043
1044    #[doc(alias = "gtk_window_present_with_time")]
1045    fn present_with_time(&self, timestamp: u32) {
1046        unsafe {
1047            ffi::gtk_window_present_with_time(self.as_ref().to_glib_none().0, timestamp);
1048        }
1049    }
1050
1051    #[doc(alias = "gtk_window_propagate_key_event")]
1052    fn propagate_key_event(&self, event: &gdk::EventKey) -> bool {
1053        unsafe {
1054            from_glib(ffi::gtk_window_propagate_key_event(
1055                self.as_ref().to_glib_none().0,
1056                mut_override(event.to_glib_none().0),
1057            ))
1058        }
1059    }
1060
1061    #[doc(alias = "gtk_window_remove_accel_group")]
1062    fn remove_accel_group(&self, accel_group: &impl IsA<AccelGroup>) {
1063        unsafe {
1064            ffi::gtk_window_remove_accel_group(
1065                self.as_ref().to_glib_none().0,
1066                accel_group.as_ref().to_glib_none().0,
1067            );
1068        }
1069    }
1070
1071    #[doc(alias = "gtk_window_remove_mnemonic")]
1072    fn remove_mnemonic(&self, keyval: u32, target: &impl IsA<Widget>) {
1073        unsafe {
1074            ffi::gtk_window_remove_mnemonic(
1075                self.as_ref().to_glib_none().0,
1076                keyval,
1077                target.as_ref().to_glib_none().0,
1078            );
1079        }
1080    }
1081
1082    #[doc(alias = "gtk_window_resize")]
1083    fn resize(&self, width: i32, height: i32) {
1084        unsafe {
1085            ffi::gtk_window_resize(self.as_ref().to_glib_none().0, width, height);
1086        }
1087    }
1088
1089    #[doc(alias = "gtk_window_set_accept_focus")]
1090    fn set_accept_focus(&self, setting: bool) {
1091        unsafe {
1092            ffi::gtk_window_set_accept_focus(self.as_ref().to_glib_none().0, setting.into_glib());
1093        }
1094    }
1095
1096    #[doc(alias = "gtk_window_set_application")]
1097    fn set_application(&self, application: Option<&impl IsA<Application>>) {
1098        unsafe {
1099            ffi::gtk_window_set_application(
1100                self.as_ref().to_glib_none().0,
1101                application.map(|p| p.as_ref()).to_glib_none().0,
1102            );
1103        }
1104    }
1105
1106    #[doc(alias = "gtk_window_set_attached_to")]
1107    fn set_attached_to(&self, attach_widget: Option<&impl IsA<Widget>>) {
1108        unsafe {
1109            ffi::gtk_window_set_attached_to(
1110                self.as_ref().to_glib_none().0,
1111                attach_widget.map(|p| p.as_ref()).to_glib_none().0,
1112            );
1113        }
1114    }
1115
1116    #[doc(alias = "gtk_window_set_decorated")]
1117    fn set_decorated(&self, setting: bool) {
1118        unsafe {
1119            ffi::gtk_window_set_decorated(self.as_ref().to_glib_none().0, setting.into_glib());
1120        }
1121    }
1122
1123    #[doc(alias = "gtk_window_set_default")]
1124    fn set_default(&self, default_widget: Option<&impl IsA<Widget>>) {
1125        unsafe {
1126            ffi::gtk_window_set_default(
1127                self.as_ref().to_glib_none().0,
1128                default_widget.map(|p| p.as_ref()).to_glib_none().0,
1129            );
1130        }
1131    }
1132
1133    #[doc(alias = "gtk_window_set_default_size")]
1134    fn set_default_size(&self, width: i32, height: i32) {
1135        unsafe {
1136            ffi::gtk_window_set_default_size(self.as_ref().to_glib_none().0, width, height);
1137        }
1138    }
1139
1140    #[doc(alias = "gtk_window_set_deletable")]
1141    fn set_deletable(&self, setting: bool) {
1142        unsafe {
1143            ffi::gtk_window_set_deletable(self.as_ref().to_glib_none().0, setting.into_glib());
1144        }
1145    }
1146
1147    #[doc(alias = "gtk_window_set_destroy_with_parent")]
1148    fn set_destroy_with_parent(&self, setting: bool) {
1149        unsafe {
1150            ffi::gtk_window_set_destroy_with_parent(
1151                self.as_ref().to_glib_none().0,
1152                setting.into_glib(),
1153            );
1154        }
1155    }
1156
1157    #[doc(alias = "gtk_window_set_focus")]
1158    fn set_focus(&self, focus: Option<&impl IsA<Widget>>) {
1159        unsafe {
1160            ffi::gtk_window_set_focus(
1161                self.as_ref().to_glib_none().0,
1162                focus.map(|p| p.as_ref()).to_glib_none().0,
1163            );
1164        }
1165    }
1166
1167    #[doc(alias = "gtk_window_set_focus_on_map")]
1168    fn set_focus_on_map(&self, setting: bool) {
1169        unsafe {
1170            ffi::gtk_window_set_focus_on_map(self.as_ref().to_glib_none().0, setting.into_glib());
1171        }
1172    }
1173
1174    #[doc(alias = "gtk_window_set_focus_visible")]
1175    fn set_focus_visible(&self, setting: bool) {
1176        unsafe {
1177            ffi::gtk_window_set_focus_visible(self.as_ref().to_glib_none().0, setting.into_glib());
1178        }
1179    }
1180
1181    #[doc(alias = "gtk_window_set_geometry_hints")]
1182    fn set_geometry_hints(
1183        &self,
1184        geometry_widget: Option<&impl IsA<Widget>>,
1185        geometry: Option<&gdk::Geometry>,
1186        geom_mask: gdk::WindowHints,
1187    ) {
1188        unsafe {
1189            ffi::gtk_window_set_geometry_hints(
1190                self.as_ref().to_glib_none().0,
1191                geometry_widget.map(|p| p.as_ref()).to_glib_none().0,
1192                mut_override(geometry.to_glib_none().0),
1193                geom_mask.into_glib(),
1194            );
1195        }
1196    }
1197
1198    #[doc(alias = "gtk_window_set_gravity")]
1199    fn set_gravity(&self, gravity: gdk::Gravity) {
1200        unsafe {
1201            ffi::gtk_window_set_gravity(self.as_ref().to_glib_none().0, gravity.into_glib());
1202        }
1203    }
1204
1205    #[doc(alias = "gtk_window_set_has_user_ref_count")]
1206    fn set_has_user_ref_count(&self, setting: bool) {
1207        unsafe {
1208            ffi::gtk_window_set_has_user_ref_count(
1209                self.as_ref().to_glib_none().0,
1210                setting.into_glib(),
1211            );
1212        }
1213    }
1214
1215    #[doc(alias = "gtk_window_set_hide_titlebar_when_maximized")]
1216    fn set_hide_titlebar_when_maximized(&self, setting: bool) {
1217        unsafe {
1218            ffi::gtk_window_set_hide_titlebar_when_maximized(
1219                self.as_ref().to_glib_none().0,
1220                setting.into_glib(),
1221            );
1222        }
1223    }
1224
1225    #[doc(alias = "gtk_window_set_icon")]
1226    fn set_icon(&self, icon: Option<&gdk_pixbuf::Pixbuf>) {
1227        unsafe {
1228            ffi::gtk_window_set_icon(self.as_ref().to_glib_none().0, icon.to_glib_none().0);
1229        }
1230    }
1231
1232    #[doc(alias = "gtk_window_set_icon_from_file")]
1233    fn set_icon_from_file(&self, filename: impl AsRef<std::path::Path>) -> Result<(), glib::Error> {
1234        unsafe {
1235            let mut error = ptr::null_mut();
1236            let is_ok = ffi::gtk_window_set_icon_from_file(
1237                self.as_ref().to_glib_none().0,
1238                filename.as_ref().to_glib_none().0,
1239                &mut error,
1240            );
1241            debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
1242            if error.is_null() {
1243                Ok(())
1244            } else {
1245                Err(from_glib_full(error))
1246            }
1247        }
1248    }
1249
1250    #[doc(alias = "gtk_window_set_icon_list")]
1251    fn set_icon_list(&self, list: &[gdk_pixbuf::Pixbuf]) {
1252        unsafe {
1253            ffi::gtk_window_set_icon_list(self.as_ref().to_glib_none().0, list.to_glib_none().0);
1254        }
1255    }
1256
1257    #[doc(alias = "gtk_window_set_icon_name")]
1258    fn set_icon_name(&self, name: Option<&str>) {
1259        unsafe {
1260            ffi::gtk_window_set_icon_name(self.as_ref().to_glib_none().0, name.to_glib_none().0);
1261        }
1262    }
1263
1264    #[doc(alias = "gtk_window_set_keep_above")]
1265    fn set_keep_above(&self, setting: bool) {
1266        unsafe {
1267            ffi::gtk_window_set_keep_above(self.as_ref().to_glib_none().0, setting.into_glib());
1268        }
1269    }
1270
1271    #[doc(alias = "gtk_window_set_keep_below")]
1272    fn set_keep_below(&self, setting: bool) {
1273        unsafe {
1274            ffi::gtk_window_set_keep_below(self.as_ref().to_glib_none().0, setting.into_glib());
1275        }
1276    }
1277
1278    #[doc(alias = "gtk_window_set_mnemonic_modifier")]
1279    fn set_mnemonic_modifier(&self, modifier: gdk::ModifierType) {
1280        unsafe {
1281            ffi::gtk_window_set_mnemonic_modifier(
1282                self.as_ref().to_glib_none().0,
1283                modifier.into_glib(),
1284            );
1285        }
1286    }
1287
1288    #[doc(alias = "gtk_window_set_mnemonics_visible")]
1289    fn set_mnemonics_visible(&self, setting: bool) {
1290        unsafe {
1291            ffi::gtk_window_set_mnemonics_visible(
1292                self.as_ref().to_glib_none().0,
1293                setting.into_glib(),
1294            );
1295        }
1296    }
1297
1298    #[doc(alias = "gtk_window_set_modal")]
1299    fn set_modal(&self, modal: bool) {
1300        unsafe {
1301            ffi::gtk_window_set_modal(self.as_ref().to_glib_none().0, modal.into_glib());
1302        }
1303    }
1304
1305    #[doc(alias = "gtk_window_set_position")]
1306    fn set_position(&self, position: WindowPosition) {
1307        unsafe {
1308            ffi::gtk_window_set_position(self.as_ref().to_glib_none().0, position.into_glib());
1309        }
1310    }
1311
1312    #[doc(alias = "gtk_window_set_resizable")]
1313    fn set_resizable(&self, resizable: bool) {
1314        unsafe {
1315            ffi::gtk_window_set_resizable(self.as_ref().to_glib_none().0, resizable.into_glib());
1316        }
1317    }
1318
1319    #[doc(alias = "gtk_window_set_role")]
1320    fn set_role(&self, role: &str) {
1321        unsafe {
1322            ffi::gtk_window_set_role(self.as_ref().to_glib_none().0, role.to_glib_none().0);
1323        }
1324    }
1325
1326    #[doc(alias = "gtk_window_set_screen")]
1327    fn set_screen(&self, screen: &gdk::Screen) {
1328        unsafe {
1329            ffi::gtk_window_set_screen(self.as_ref().to_glib_none().0, screen.to_glib_none().0);
1330        }
1331    }
1332
1333    #[doc(alias = "gtk_window_set_skip_pager_hint")]
1334    fn set_skip_pager_hint(&self, setting: bool) {
1335        unsafe {
1336            ffi::gtk_window_set_skip_pager_hint(
1337                self.as_ref().to_glib_none().0,
1338                setting.into_glib(),
1339            );
1340        }
1341    }
1342
1343    #[doc(alias = "gtk_window_set_skip_taskbar_hint")]
1344    fn set_skip_taskbar_hint(&self, setting: bool) {
1345        unsafe {
1346            ffi::gtk_window_set_skip_taskbar_hint(
1347                self.as_ref().to_glib_none().0,
1348                setting.into_glib(),
1349            );
1350        }
1351    }
1352
1353    #[doc(alias = "gtk_window_set_startup_id")]
1354    fn set_startup_id(&self, startup_id: &str) {
1355        unsafe {
1356            ffi::gtk_window_set_startup_id(
1357                self.as_ref().to_glib_none().0,
1358                startup_id.to_glib_none().0,
1359            );
1360        }
1361    }
1362
1363    #[doc(alias = "gtk_window_set_title")]
1364    fn set_title(&self, title: &str) {
1365        unsafe {
1366            ffi::gtk_window_set_title(self.as_ref().to_glib_none().0, title.to_glib_none().0);
1367        }
1368    }
1369
1370    #[doc(alias = "gtk_window_set_titlebar")]
1371    fn set_titlebar(&self, titlebar: Option<&impl IsA<Widget>>) {
1372        unsafe {
1373            ffi::gtk_window_set_titlebar(
1374                self.as_ref().to_glib_none().0,
1375                titlebar.map(|p| p.as_ref()).to_glib_none().0,
1376            );
1377        }
1378    }
1379
1380    #[doc(alias = "gtk_window_set_transient_for")]
1381    fn set_transient_for(&self, parent: Option<&impl IsA<Window>>) {
1382        unsafe {
1383            ffi::gtk_window_set_transient_for(
1384                self.as_ref().to_glib_none().0,
1385                parent.map(|p| p.as_ref()).to_glib_none().0,
1386            );
1387        }
1388    }
1389
1390    #[doc(alias = "gtk_window_set_type_hint")]
1391    fn set_type_hint(&self, hint: gdk::WindowTypeHint) {
1392        unsafe {
1393            ffi::gtk_window_set_type_hint(self.as_ref().to_glib_none().0, hint.into_glib());
1394        }
1395    }
1396
1397    #[doc(alias = "gtk_window_set_urgency_hint")]
1398    fn set_urgency_hint(&self, setting: bool) {
1399        unsafe {
1400            ffi::gtk_window_set_urgency_hint(self.as_ref().to_glib_none().0, setting.into_glib());
1401        }
1402    }
1403
1404    #[doc(alias = "gtk_window_stick")]
1405    fn stick(&self) {
1406        unsafe {
1407            ffi::gtk_window_stick(self.as_ref().to_glib_none().0);
1408        }
1409    }
1410
1411    #[doc(alias = "gtk_window_unfullscreen")]
1412    fn unfullscreen(&self) {
1413        unsafe {
1414            ffi::gtk_window_unfullscreen(self.as_ref().to_glib_none().0);
1415        }
1416    }
1417
1418    #[doc(alias = "gtk_window_unmaximize")]
1419    fn unmaximize(&self) {
1420        unsafe {
1421            ffi::gtk_window_unmaximize(self.as_ref().to_glib_none().0);
1422        }
1423    }
1424
1425    #[doc(alias = "gtk_window_unstick")]
1426    fn unstick(&self) {
1427        unsafe {
1428            ffi::gtk_window_unstick(self.as_ref().to_glib_none().0);
1429        }
1430    }
1431
1432    #[doc(alias = "default-height")]
1433    fn default_height(&self) -> i32 {
1434        ObjectExt::property(self.as_ref(), "default-height")
1435    }
1436
1437    #[doc(alias = "default-height")]
1438    fn set_default_height(&self, default_height: i32) {
1439        ObjectExt::set_property(self.as_ref(), "default-height", default_height)
1440    }
1441
1442    #[doc(alias = "default-width")]
1443    fn default_width(&self) -> i32 {
1444        ObjectExt::property(self.as_ref(), "default-width")
1445    }
1446
1447    #[doc(alias = "default-width")]
1448    fn set_default_width(&self, default_width: i32) {
1449        ObjectExt::set_property(self.as_ref(), "default-width", default_width)
1450    }
1451
1452    #[doc(alias = "type")]
1453    fn type_(&self) -> WindowType {
1454        ObjectExt::property(self.as_ref(), "type")
1455    }
1456
1457    #[doc(alias = "window-position")]
1458    fn window_position(&self) -> WindowPosition {
1459        ObjectExt::property(self.as_ref(), "window-position")
1460    }
1461
1462    #[doc(alias = "window-position")]
1463    fn set_window_position(&self, window_position: WindowPosition) {
1464        ObjectExt::set_property(self.as_ref(), "window-position", window_position)
1465    }
1466
1467    #[doc(alias = "activate-default")]
1468    fn connect_activate_default<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1469        unsafe extern "C" fn activate_default_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
1470            this: *mut ffi::GtkWindow,
1471            f: glib::ffi::gpointer,
1472        ) {
1473            let f: &F = &*(f as *const F);
1474            f(Window::from_glib_borrow(this).unsafe_cast_ref())
1475        }
1476        unsafe {
1477            let f: Box_<F> = Box_::new(f);
1478            connect_raw(
1479                self.as_ptr() as *mut _,
1480                b"activate-default\0".as_ptr() as *const _,
1481                Some(transmute::<_, unsafe extern "C" fn()>(
1482                    activate_default_trampoline::<Self, F> as *const (),
1483                )),
1484                Box_::into_raw(f),
1485            )
1486        }
1487    }
1488
1489    fn emit_activate_default(&self) {
1490        self.emit_by_name::<()>("activate-default", &[]);
1491    }
1492
1493    #[doc(alias = "activate-focus")]
1494    fn connect_activate_focus<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1495        unsafe extern "C" fn activate_focus_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
1496            this: *mut ffi::GtkWindow,
1497            f: glib::ffi::gpointer,
1498        ) {
1499            let f: &F = &*(f as *const F);
1500            f(Window::from_glib_borrow(this).unsafe_cast_ref())
1501        }
1502        unsafe {
1503            let f: Box_<F> = Box_::new(f);
1504            connect_raw(
1505                self.as_ptr() as *mut _,
1506                b"activate-focus\0".as_ptr() as *const _,
1507                Some(transmute::<_, unsafe extern "C" fn()>(
1508                    activate_focus_trampoline::<Self, F> as *const (),
1509                )),
1510                Box_::into_raw(f),
1511            )
1512        }
1513    }
1514
1515    fn emit_activate_focus(&self) {
1516        self.emit_by_name::<()>("activate-focus", &[]);
1517    }
1518
1519    #[doc(alias = "enable-debugging")]
1520    fn connect_enable_debugging<F: Fn(&Self, bool) -> bool + 'static>(
1521        &self,
1522        f: F,
1523    ) -> SignalHandlerId {
1524        unsafe extern "C" fn enable_debugging_trampoline<
1525            P: IsA<Window>,
1526            F: Fn(&P, bool) -> bool + 'static,
1527        >(
1528            this: *mut ffi::GtkWindow,
1529            toggle: glib::ffi::gboolean,
1530            f: glib::ffi::gpointer,
1531        ) -> glib::ffi::gboolean {
1532            let f: &F = &*(f as *const F);
1533            f(
1534                Window::from_glib_borrow(this).unsafe_cast_ref(),
1535                from_glib(toggle),
1536            )
1537            .into_glib()
1538        }
1539        unsafe {
1540            let f: Box_<F> = Box_::new(f);
1541            connect_raw(
1542                self.as_ptr() as *mut _,
1543                b"enable-debugging\0".as_ptr() as *const _,
1544                Some(transmute::<_, unsafe extern "C" fn()>(
1545                    enable_debugging_trampoline::<Self, F> as *const (),
1546                )),
1547                Box_::into_raw(f),
1548            )
1549        }
1550    }
1551
1552    fn emit_enable_debugging(&self, toggle: bool) -> bool {
1553        self.emit_by_name("enable-debugging", &[&toggle])
1554    }
1555
1556    #[doc(alias = "keys-changed")]
1557    fn connect_keys_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1558        unsafe extern "C" fn keys_changed_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
1559            this: *mut ffi::GtkWindow,
1560            f: glib::ffi::gpointer,
1561        ) {
1562            let f: &F = &*(f as *const F);
1563            f(Window::from_glib_borrow(this).unsafe_cast_ref())
1564        }
1565        unsafe {
1566            let f: Box_<F> = Box_::new(f);
1567            connect_raw(
1568                self.as_ptr() as *mut _,
1569                b"keys-changed\0".as_ptr() as *const _,
1570                Some(transmute::<_, unsafe extern "C" fn()>(
1571                    keys_changed_trampoline::<Self, F> as *const (),
1572                )),
1573                Box_::into_raw(f),
1574            )
1575        }
1576    }
1577
1578    #[doc(alias = "set-focus")]
1579    fn connect_set_focus<F: Fn(&Self, Option<&Widget>) + 'static>(&self, f: F) -> SignalHandlerId {
1580        unsafe extern "C" fn set_focus_trampoline<
1581            P: IsA<Window>,
1582            F: Fn(&P, Option<&Widget>) + 'static,
1583        >(
1584            this: *mut ffi::GtkWindow,
1585            widget: *mut ffi::GtkWidget,
1586            f: glib::ffi::gpointer,
1587        ) {
1588            let f: &F = &*(f as *const F);
1589            f(
1590                Window::from_glib_borrow(this).unsafe_cast_ref(),
1591                Option::<Widget>::from_glib_borrow(widget).as_ref().as_ref(),
1592            )
1593        }
1594        unsafe {
1595            let f: Box_<F> = Box_::new(f);
1596            connect_raw(
1597                self.as_ptr() as *mut _,
1598                b"set-focus\0".as_ptr() as *const _,
1599                Some(transmute::<_, unsafe extern "C" fn()>(
1600                    set_focus_trampoline::<Self, F> as *const (),
1601                )),
1602                Box_::into_raw(f),
1603            )
1604        }
1605    }
1606
1607    #[doc(alias = "accept-focus")]
1608    fn connect_accept_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1609        unsafe extern "C" fn notify_accept_focus_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
1610            this: *mut ffi::GtkWindow,
1611            _param_spec: glib::ffi::gpointer,
1612            f: glib::ffi::gpointer,
1613        ) {
1614            let f: &F = &*(f as *const F);
1615            f(Window::from_glib_borrow(this).unsafe_cast_ref())
1616        }
1617        unsafe {
1618            let f: Box_<F> = Box_::new(f);
1619            connect_raw(
1620                self.as_ptr() as *mut _,
1621                b"notify::accept-focus\0".as_ptr() as *const _,
1622                Some(transmute::<_, unsafe extern "C" fn()>(
1623                    notify_accept_focus_trampoline::<Self, F> as *const (),
1624                )),
1625                Box_::into_raw(f),
1626            )
1627        }
1628    }
1629
1630    #[doc(alias = "application")]
1631    fn connect_application_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1632        unsafe extern "C" fn notify_application_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
1633            this: *mut ffi::GtkWindow,
1634            _param_spec: glib::ffi::gpointer,
1635            f: glib::ffi::gpointer,
1636        ) {
1637            let f: &F = &*(f as *const F);
1638            f(Window::from_glib_borrow(this).unsafe_cast_ref())
1639        }
1640        unsafe {
1641            let f: Box_<F> = Box_::new(f);
1642            connect_raw(
1643                self.as_ptr() as *mut _,
1644                b"notify::application\0".as_ptr() as *const _,
1645                Some(transmute::<_, unsafe extern "C" fn()>(
1646                    notify_application_trampoline::<Self, F> as *const (),
1647                )),
1648                Box_::into_raw(f),
1649            )
1650        }
1651    }
1652
1653    #[doc(alias = "attached-to")]
1654    fn connect_attached_to_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1655        unsafe extern "C" fn notify_attached_to_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
1656            this: *mut ffi::GtkWindow,
1657            _param_spec: glib::ffi::gpointer,
1658            f: glib::ffi::gpointer,
1659        ) {
1660            let f: &F = &*(f as *const F);
1661            f(Window::from_glib_borrow(this).unsafe_cast_ref())
1662        }
1663        unsafe {
1664            let f: Box_<F> = Box_::new(f);
1665            connect_raw(
1666                self.as_ptr() as *mut _,
1667                b"notify::attached-to\0".as_ptr() as *const _,
1668                Some(transmute::<_, unsafe extern "C" fn()>(
1669                    notify_attached_to_trampoline::<Self, F> as *const (),
1670                )),
1671                Box_::into_raw(f),
1672            )
1673        }
1674    }
1675
1676    #[doc(alias = "decorated")]
1677    fn connect_decorated_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1678        unsafe extern "C" fn notify_decorated_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
1679            this: *mut ffi::GtkWindow,
1680            _param_spec: glib::ffi::gpointer,
1681            f: glib::ffi::gpointer,
1682        ) {
1683            let f: &F = &*(f as *const F);
1684            f(Window::from_glib_borrow(this).unsafe_cast_ref())
1685        }
1686        unsafe {
1687            let f: Box_<F> = Box_::new(f);
1688            connect_raw(
1689                self.as_ptr() as *mut _,
1690                b"notify::decorated\0".as_ptr() as *const _,
1691                Some(transmute::<_, unsafe extern "C" fn()>(
1692                    notify_decorated_trampoline::<Self, F> as *const (),
1693                )),
1694                Box_::into_raw(f),
1695            )
1696        }
1697    }
1698
1699    #[doc(alias = "default-height")]
1700    fn connect_default_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1701        unsafe extern "C" fn notify_default_height_trampoline<
1702            P: IsA<Window>,
1703            F: Fn(&P) + 'static,
1704        >(
1705            this: *mut ffi::GtkWindow,
1706            _param_spec: glib::ffi::gpointer,
1707            f: glib::ffi::gpointer,
1708        ) {
1709            let f: &F = &*(f as *const F);
1710            f(Window::from_glib_borrow(this).unsafe_cast_ref())
1711        }
1712        unsafe {
1713            let f: Box_<F> = Box_::new(f);
1714            connect_raw(
1715                self.as_ptr() as *mut _,
1716                b"notify::default-height\0".as_ptr() as *const _,
1717                Some(transmute::<_, unsafe extern "C" fn()>(
1718                    notify_default_height_trampoline::<Self, F> as *const (),
1719                )),
1720                Box_::into_raw(f),
1721            )
1722        }
1723    }
1724
1725    #[doc(alias = "default-width")]
1726    fn connect_default_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1727        unsafe extern "C" fn notify_default_width_trampoline<
1728            P: IsA<Window>,
1729            F: Fn(&P) + 'static,
1730        >(
1731            this: *mut ffi::GtkWindow,
1732            _param_spec: glib::ffi::gpointer,
1733            f: glib::ffi::gpointer,
1734        ) {
1735            let f: &F = &*(f as *const F);
1736            f(Window::from_glib_borrow(this).unsafe_cast_ref())
1737        }
1738        unsafe {
1739            let f: Box_<F> = Box_::new(f);
1740            connect_raw(
1741                self.as_ptr() as *mut _,
1742                b"notify::default-width\0".as_ptr() as *const _,
1743                Some(transmute::<_, unsafe extern "C" fn()>(
1744                    notify_default_width_trampoline::<Self, F> as *const (),
1745                )),
1746                Box_::into_raw(f),
1747            )
1748        }
1749    }
1750
1751    #[doc(alias = "deletable")]
1752    fn connect_deletable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1753        unsafe extern "C" fn notify_deletable_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
1754            this: *mut ffi::GtkWindow,
1755            _param_spec: glib::ffi::gpointer,
1756            f: glib::ffi::gpointer,
1757        ) {
1758            let f: &F = &*(f as *const F);
1759            f(Window::from_glib_borrow(this).unsafe_cast_ref())
1760        }
1761        unsafe {
1762            let f: Box_<F> = Box_::new(f);
1763            connect_raw(
1764                self.as_ptr() as *mut _,
1765                b"notify::deletable\0".as_ptr() as *const _,
1766                Some(transmute::<_, unsafe extern "C" fn()>(
1767                    notify_deletable_trampoline::<Self, F> as *const (),
1768                )),
1769                Box_::into_raw(f),
1770            )
1771        }
1772    }
1773
1774    #[doc(alias = "destroy-with-parent")]
1775    fn connect_destroy_with_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1776        unsafe extern "C" fn notify_destroy_with_parent_trampoline<
1777            P: IsA<Window>,
1778            F: Fn(&P) + 'static,
1779        >(
1780            this: *mut ffi::GtkWindow,
1781            _param_spec: glib::ffi::gpointer,
1782            f: glib::ffi::gpointer,
1783        ) {
1784            let f: &F = &*(f as *const F);
1785            f(Window::from_glib_borrow(this).unsafe_cast_ref())
1786        }
1787        unsafe {
1788            let f: Box_<F> = Box_::new(f);
1789            connect_raw(
1790                self.as_ptr() as *mut _,
1791                b"notify::destroy-with-parent\0".as_ptr() as *const _,
1792                Some(transmute::<_, unsafe extern "C" fn()>(
1793                    notify_destroy_with_parent_trampoline::<Self, F> as *const (),
1794                )),
1795                Box_::into_raw(f),
1796            )
1797        }
1798    }
1799
1800    #[doc(alias = "focus-on-map")]
1801    fn connect_focus_on_map_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1802        unsafe extern "C" fn notify_focus_on_map_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
1803            this: *mut ffi::GtkWindow,
1804            _param_spec: glib::ffi::gpointer,
1805            f: glib::ffi::gpointer,
1806        ) {
1807            let f: &F = &*(f as *const F);
1808            f(Window::from_glib_borrow(this).unsafe_cast_ref())
1809        }
1810        unsafe {
1811            let f: Box_<F> = Box_::new(f);
1812            connect_raw(
1813                self.as_ptr() as *mut _,
1814                b"notify::focus-on-map\0".as_ptr() as *const _,
1815                Some(transmute::<_, unsafe extern "C" fn()>(
1816                    notify_focus_on_map_trampoline::<Self, F> as *const (),
1817                )),
1818                Box_::into_raw(f),
1819            )
1820        }
1821    }
1822
1823    #[doc(alias = "focus-visible")]
1824    fn connect_focus_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1825        unsafe extern "C" fn notify_focus_visible_trampoline<
1826            P: IsA<Window>,
1827            F: Fn(&P) + 'static,
1828        >(
1829            this: *mut ffi::GtkWindow,
1830            _param_spec: glib::ffi::gpointer,
1831            f: glib::ffi::gpointer,
1832        ) {
1833            let f: &F = &*(f as *const F);
1834            f(Window::from_glib_borrow(this).unsafe_cast_ref())
1835        }
1836        unsafe {
1837            let f: Box_<F> = Box_::new(f);
1838            connect_raw(
1839                self.as_ptr() as *mut _,
1840                b"notify::focus-visible\0".as_ptr() as *const _,
1841                Some(transmute::<_, unsafe extern "C" fn()>(
1842                    notify_focus_visible_trampoline::<Self, F> as *const (),
1843                )),
1844                Box_::into_raw(f),
1845            )
1846        }
1847    }
1848
1849    #[doc(alias = "gravity")]
1850    fn connect_gravity_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1851        unsafe extern "C" fn notify_gravity_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
1852            this: *mut ffi::GtkWindow,
1853            _param_spec: glib::ffi::gpointer,
1854            f: glib::ffi::gpointer,
1855        ) {
1856            let f: &F = &*(f as *const F);
1857            f(Window::from_glib_borrow(this).unsafe_cast_ref())
1858        }
1859        unsafe {
1860            let f: Box_<F> = Box_::new(f);
1861            connect_raw(
1862                self.as_ptr() as *mut _,
1863                b"notify::gravity\0".as_ptr() as *const _,
1864                Some(transmute::<_, unsafe extern "C" fn()>(
1865                    notify_gravity_trampoline::<Self, F> as *const (),
1866                )),
1867                Box_::into_raw(f),
1868            )
1869        }
1870    }
1871
1872    #[doc(alias = "has-toplevel-focus")]
1873    fn connect_has_toplevel_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1874        unsafe extern "C" fn notify_has_toplevel_focus_trampoline<
1875            P: IsA<Window>,
1876            F: Fn(&P) + 'static,
1877        >(
1878            this: *mut ffi::GtkWindow,
1879            _param_spec: glib::ffi::gpointer,
1880            f: glib::ffi::gpointer,
1881        ) {
1882            let f: &F = &*(f as *const F);
1883            f(Window::from_glib_borrow(this).unsafe_cast_ref())
1884        }
1885        unsafe {
1886            let f: Box_<F> = Box_::new(f);
1887            connect_raw(
1888                self.as_ptr() as *mut _,
1889                b"notify::has-toplevel-focus\0".as_ptr() as *const _,
1890                Some(transmute::<_, unsafe extern "C" fn()>(
1891                    notify_has_toplevel_focus_trampoline::<Self, F> as *const (),
1892                )),
1893                Box_::into_raw(f),
1894            )
1895        }
1896    }
1897
1898    #[doc(alias = "hide-titlebar-when-maximized")]
1899    fn connect_hide_titlebar_when_maximized_notify<F: Fn(&Self) + 'static>(
1900        &self,
1901        f: F,
1902    ) -> SignalHandlerId {
1903        unsafe extern "C" fn notify_hide_titlebar_when_maximized_trampoline<
1904            P: IsA<Window>,
1905            F: Fn(&P) + 'static,
1906        >(
1907            this: *mut ffi::GtkWindow,
1908            _param_spec: glib::ffi::gpointer,
1909            f: glib::ffi::gpointer,
1910        ) {
1911            let f: &F = &*(f as *const F);
1912            f(Window::from_glib_borrow(this).unsafe_cast_ref())
1913        }
1914        unsafe {
1915            let f: Box_<F> = Box_::new(f);
1916            connect_raw(
1917                self.as_ptr() as *mut _,
1918                b"notify::hide-titlebar-when-maximized\0".as_ptr() as *const _,
1919                Some(transmute::<_, unsafe extern "C" fn()>(
1920                    notify_hide_titlebar_when_maximized_trampoline::<Self, F> as *const (),
1921                )),
1922                Box_::into_raw(f),
1923            )
1924        }
1925    }
1926
1927    #[doc(alias = "icon")]
1928    fn connect_icon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1929        unsafe extern "C" fn notify_icon_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
1930            this: *mut ffi::GtkWindow,
1931            _param_spec: glib::ffi::gpointer,
1932            f: glib::ffi::gpointer,
1933        ) {
1934            let f: &F = &*(f as *const F);
1935            f(Window::from_glib_borrow(this).unsafe_cast_ref())
1936        }
1937        unsafe {
1938            let f: Box_<F> = Box_::new(f);
1939            connect_raw(
1940                self.as_ptr() as *mut _,
1941                b"notify::icon\0".as_ptr() as *const _,
1942                Some(transmute::<_, unsafe extern "C" fn()>(
1943                    notify_icon_trampoline::<Self, F> as *const (),
1944                )),
1945                Box_::into_raw(f),
1946            )
1947        }
1948    }
1949
1950    #[doc(alias = "icon-name")]
1951    fn connect_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1952        unsafe extern "C" fn notify_icon_name_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
1953            this: *mut ffi::GtkWindow,
1954            _param_spec: glib::ffi::gpointer,
1955            f: glib::ffi::gpointer,
1956        ) {
1957            let f: &F = &*(f as *const F);
1958            f(Window::from_glib_borrow(this).unsafe_cast_ref())
1959        }
1960        unsafe {
1961            let f: Box_<F> = Box_::new(f);
1962            connect_raw(
1963                self.as_ptr() as *mut _,
1964                b"notify::icon-name\0".as_ptr() as *const _,
1965                Some(transmute::<_, unsafe extern "C" fn()>(
1966                    notify_icon_name_trampoline::<Self, F> as *const (),
1967                )),
1968                Box_::into_raw(f),
1969            )
1970        }
1971    }
1972
1973    #[doc(alias = "is-active")]
1974    fn connect_is_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1975        unsafe extern "C" fn notify_is_active_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
1976            this: *mut ffi::GtkWindow,
1977            _param_spec: glib::ffi::gpointer,
1978            f: glib::ffi::gpointer,
1979        ) {
1980            let f: &F = &*(f as *const F);
1981            f(Window::from_glib_borrow(this).unsafe_cast_ref())
1982        }
1983        unsafe {
1984            let f: Box_<F> = Box_::new(f);
1985            connect_raw(
1986                self.as_ptr() as *mut _,
1987                b"notify::is-active\0".as_ptr() as *const _,
1988                Some(transmute::<_, unsafe extern "C" fn()>(
1989                    notify_is_active_trampoline::<Self, F> as *const (),
1990                )),
1991                Box_::into_raw(f),
1992            )
1993        }
1994    }
1995
1996    #[doc(alias = "is-maximized")]
1997    fn connect_is_maximized_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1998        unsafe extern "C" fn notify_is_maximized_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
1999            this: *mut ffi::GtkWindow,
2000            _param_spec: glib::ffi::gpointer,
2001            f: glib::ffi::gpointer,
2002        ) {
2003            let f: &F = &*(f as *const F);
2004            f(Window::from_glib_borrow(this).unsafe_cast_ref())
2005        }
2006        unsafe {
2007            let f: Box_<F> = Box_::new(f);
2008            connect_raw(
2009                self.as_ptr() as *mut _,
2010                b"notify::is-maximized\0".as_ptr() as *const _,
2011                Some(transmute::<_, unsafe extern "C" fn()>(
2012                    notify_is_maximized_trampoline::<Self, F> as *const (),
2013                )),
2014                Box_::into_raw(f),
2015            )
2016        }
2017    }
2018
2019    #[doc(alias = "mnemonics-visible")]
2020    fn connect_mnemonics_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2021        unsafe extern "C" fn notify_mnemonics_visible_trampoline<
2022            P: IsA<Window>,
2023            F: Fn(&P) + 'static,
2024        >(
2025            this: *mut ffi::GtkWindow,
2026            _param_spec: glib::ffi::gpointer,
2027            f: glib::ffi::gpointer,
2028        ) {
2029            let f: &F = &*(f as *const F);
2030            f(Window::from_glib_borrow(this).unsafe_cast_ref())
2031        }
2032        unsafe {
2033            let f: Box_<F> = Box_::new(f);
2034            connect_raw(
2035                self.as_ptr() as *mut _,
2036                b"notify::mnemonics-visible\0".as_ptr() as *const _,
2037                Some(transmute::<_, unsafe extern "C" fn()>(
2038                    notify_mnemonics_visible_trampoline::<Self, F> as *const (),
2039                )),
2040                Box_::into_raw(f),
2041            )
2042        }
2043    }
2044
2045    #[doc(alias = "modal")]
2046    fn connect_modal_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2047        unsafe extern "C" fn notify_modal_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
2048            this: *mut ffi::GtkWindow,
2049            _param_spec: glib::ffi::gpointer,
2050            f: glib::ffi::gpointer,
2051        ) {
2052            let f: &F = &*(f as *const F);
2053            f(Window::from_glib_borrow(this).unsafe_cast_ref())
2054        }
2055        unsafe {
2056            let f: Box_<F> = Box_::new(f);
2057            connect_raw(
2058                self.as_ptr() as *mut _,
2059                b"notify::modal\0".as_ptr() as *const _,
2060                Some(transmute::<_, unsafe extern "C" fn()>(
2061                    notify_modal_trampoline::<Self, F> as *const (),
2062                )),
2063                Box_::into_raw(f),
2064            )
2065        }
2066    }
2067
2068    #[doc(alias = "resizable")]
2069    fn connect_resizable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2070        unsafe extern "C" fn notify_resizable_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
2071            this: *mut ffi::GtkWindow,
2072            _param_spec: glib::ffi::gpointer,
2073            f: glib::ffi::gpointer,
2074        ) {
2075            let f: &F = &*(f as *const F);
2076            f(Window::from_glib_borrow(this).unsafe_cast_ref())
2077        }
2078        unsafe {
2079            let f: Box_<F> = Box_::new(f);
2080            connect_raw(
2081                self.as_ptr() as *mut _,
2082                b"notify::resizable\0".as_ptr() as *const _,
2083                Some(transmute::<_, unsafe extern "C" fn()>(
2084                    notify_resizable_trampoline::<Self, F> as *const (),
2085                )),
2086                Box_::into_raw(f),
2087            )
2088        }
2089    }
2090
2091    #[doc(alias = "role")]
2092    fn connect_role_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2093        unsafe extern "C" fn notify_role_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
2094            this: *mut ffi::GtkWindow,
2095            _param_spec: glib::ffi::gpointer,
2096            f: glib::ffi::gpointer,
2097        ) {
2098            let f: &F = &*(f as *const F);
2099            f(Window::from_glib_borrow(this).unsafe_cast_ref())
2100        }
2101        unsafe {
2102            let f: Box_<F> = Box_::new(f);
2103            connect_raw(
2104                self.as_ptr() as *mut _,
2105                b"notify::role\0".as_ptr() as *const _,
2106                Some(transmute::<_, unsafe extern "C" fn()>(
2107                    notify_role_trampoline::<Self, F> as *const (),
2108                )),
2109                Box_::into_raw(f),
2110            )
2111        }
2112    }
2113
2114    #[doc(alias = "screen")]
2115    fn connect_screen_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2116        unsafe extern "C" fn notify_screen_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
2117            this: *mut ffi::GtkWindow,
2118            _param_spec: glib::ffi::gpointer,
2119            f: glib::ffi::gpointer,
2120        ) {
2121            let f: &F = &*(f as *const F);
2122            f(Window::from_glib_borrow(this).unsafe_cast_ref())
2123        }
2124        unsafe {
2125            let f: Box_<F> = Box_::new(f);
2126            connect_raw(
2127                self.as_ptr() as *mut _,
2128                b"notify::screen\0".as_ptr() as *const _,
2129                Some(transmute::<_, unsafe extern "C" fn()>(
2130                    notify_screen_trampoline::<Self, F> as *const (),
2131                )),
2132                Box_::into_raw(f),
2133            )
2134        }
2135    }
2136
2137    #[doc(alias = "skip-pager-hint")]
2138    fn connect_skip_pager_hint_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2139        unsafe extern "C" fn notify_skip_pager_hint_trampoline<
2140            P: IsA<Window>,
2141            F: Fn(&P) + 'static,
2142        >(
2143            this: *mut ffi::GtkWindow,
2144            _param_spec: glib::ffi::gpointer,
2145            f: glib::ffi::gpointer,
2146        ) {
2147            let f: &F = &*(f as *const F);
2148            f(Window::from_glib_borrow(this).unsafe_cast_ref())
2149        }
2150        unsafe {
2151            let f: Box_<F> = Box_::new(f);
2152            connect_raw(
2153                self.as_ptr() as *mut _,
2154                b"notify::skip-pager-hint\0".as_ptr() as *const _,
2155                Some(transmute::<_, unsafe extern "C" fn()>(
2156                    notify_skip_pager_hint_trampoline::<Self, F> as *const (),
2157                )),
2158                Box_::into_raw(f),
2159            )
2160        }
2161    }
2162
2163    #[doc(alias = "skip-taskbar-hint")]
2164    fn connect_skip_taskbar_hint_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2165        unsafe extern "C" fn notify_skip_taskbar_hint_trampoline<
2166            P: IsA<Window>,
2167            F: Fn(&P) + 'static,
2168        >(
2169            this: *mut ffi::GtkWindow,
2170            _param_spec: glib::ffi::gpointer,
2171            f: glib::ffi::gpointer,
2172        ) {
2173            let f: &F = &*(f as *const F);
2174            f(Window::from_glib_borrow(this).unsafe_cast_ref())
2175        }
2176        unsafe {
2177            let f: Box_<F> = Box_::new(f);
2178            connect_raw(
2179                self.as_ptr() as *mut _,
2180                b"notify::skip-taskbar-hint\0".as_ptr() as *const _,
2181                Some(transmute::<_, unsafe extern "C" fn()>(
2182                    notify_skip_taskbar_hint_trampoline::<Self, F> as *const (),
2183                )),
2184                Box_::into_raw(f),
2185            )
2186        }
2187    }
2188
2189    #[doc(alias = "startup-id")]
2190    fn connect_startup_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2191        unsafe extern "C" fn notify_startup_id_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
2192            this: *mut ffi::GtkWindow,
2193            _param_spec: glib::ffi::gpointer,
2194            f: glib::ffi::gpointer,
2195        ) {
2196            let f: &F = &*(f as *const F);
2197            f(Window::from_glib_borrow(this).unsafe_cast_ref())
2198        }
2199        unsafe {
2200            let f: Box_<F> = Box_::new(f);
2201            connect_raw(
2202                self.as_ptr() as *mut _,
2203                b"notify::startup-id\0".as_ptr() as *const _,
2204                Some(transmute::<_, unsafe extern "C" fn()>(
2205                    notify_startup_id_trampoline::<Self, F> as *const (),
2206                )),
2207                Box_::into_raw(f),
2208            )
2209        }
2210    }
2211
2212    #[doc(alias = "title")]
2213    fn connect_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2214        unsafe extern "C" fn notify_title_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
2215            this: *mut ffi::GtkWindow,
2216            _param_spec: glib::ffi::gpointer,
2217            f: glib::ffi::gpointer,
2218        ) {
2219            let f: &F = &*(f as *const F);
2220            f(Window::from_glib_borrow(this).unsafe_cast_ref())
2221        }
2222        unsafe {
2223            let f: Box_<F> = Box_::new(f);
2224            connect_raw(
2225                self.as_ptr() as *mut _,
2226                b"notify::title\0".as_ptr() as *const _,
2227                Some(transmute::<_, unsafe extern "C" fn()>(
2228                    notify_title_trampoline::<Self, F> as *const (),
2229                )),
2230                Box_::into_raw(f),
2231            )
2232        }
2233    }
2234
2235    #[doc(alias = "transient-for")]
2236    fn connect_transient_for_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2237        unsafe extern "C" fn notify_transient_for_trampoline<
2238            P: IsA<Window>,
2239            F: Fn(&P) + 'static,
2240        >(
2241            this: *mut ffi::GtkWindow,
2242            _param_spec: glib::ffi::gpointer,
2243            f: glib::ffi::gpointer,
2244        ) {
2245            let f: &F = &*(f as *const F);
2246            f(Window::from_glib_borrow(this).unsafe_cast_ref())
2247        }
2248        unsafe {
2249            let f: Box_<F> = Box_::new(f);
2250            connect_raw(
2251                self.as_ptr() as *mut _,
2252                b"notify::transient-for\0".as_ptr() as *const _,
2253                Some(transmute::<_, unsafe extern "C" fn()>(
2254                    notify_transient_for_trampoline::<Self, F> as *const (),
2255                )),
2256                Box_::into_raw(f),
2257            )
2258        }
2259    }
2260
2261    #[doc(alias = "type-hint")]
2262    fn connect_type_hint_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2263        unsafe extern "C" fn notify_type_hint_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
2264            this: *mut ffi::GtkWindow,
2265            _param_spec: glib::ffi::gpointer,
2266            f: glib::ffi::gpointer,
2267        ) {
2268            let f: &F = &*(f as *const F);
2269            f(Window::from_glib_borrow(this).unsafe_cast_ref())
2270        }
2271        unsafe {
2272            let f: Box_<F> = Box_::new(f);
2273            connect_raw(
2274                self.as_ptr() as *mut _,
2275                b"notify::type-hint\0".as_ptr() as *const _,
2276                Some(transmute::<_, unsafe extern "C" fn()>(
2277                    notify_type_hint_trampoline::<Self, F> as *const (),
2278                )),
2279                Box_::into_raw(f),
2280            )
2281        }
2282    }
2283
2284    #[doc(alias = "urgency-hint")]
2285    fn connect_urgency_hint_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2286        unsafe extern "C" fn notify_urgency_hint_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
2287            this: *mut ffi::GtkWindow,
2288            _param_spec: glib::ffi::gpointer,
2289            f: glib::ffi::gpointer,
2290        ) {
2291            let f: &F = &*(f as *const F);
2292            f(Window::from_glib_borrow(this).unsafe_cast_ref())
2293        }
2294        unsafe {
2295            let f: Box_<F> = Box_::new(f);
2296            connect_raw(
2297                self.as_ptr() as *mut _,
2298                b"notify::urgency-hint\0".as_ptr() as *const _,
2299                Some(transmute::<_, unsafe extern "C" fn()>(
2300                    notify_urgency_hint_trampoline::<Self, F> as *const (),
2301                )),
2302                Box_::into_raw(f),
2303            )
2304        }
2305    }
2306
2307    #[doc(alias = "window-position")]
2308    fn connect_window_position_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2309        unsafe extern "C" fn notify_window_position_trampoline<
2310            P: IsA<Window>,
2311            F: Fn(&P) + 'static,
2312        >(
2313            this: *mut ffi::GtkWindow,
2314            _param_spec: glib::ffi::gpointer,
2315            f: glib::ffi::gpointer,
2316        ) {
2317            let f: &F = &*(f as *const F);
2318            f(Window::from_glib_borrow(this).unsafe_cast_ref())
2319        }
2320        unsafe {
2321            let f: Box_<F> = Box_::new(f);
2322            connect_raw(
2323                self.as_ptr() as *mut _,
2324                b"notify::window-position\0".as_ptr() as *const _,
2325                Some(transmute::<_, unsafe extern "C" fn()>(
2326                    notify_window_position_trampoline::<Self, F> as *const (),
2327                )),
2328                Box_::into_raw(f),
2329            )
2330        }
2331    }
2332}
2333
2334impl<O: IsA<Window>> GtkWindowExt for O {}
2335
2336impl fmt::Display for Window {
2337    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2338        f.write_str("Window")
2339    }
2340}