1use gdk;
6use gdk_pixbuf;
7use gio;
8use glib::object::Cast;
9use glib::object::IsA;
10use glib::signal::connect_raw;
11use glib::signal::SignalHandlerId;
12use glib::translate::*;
13use glib::StaticType;
14use glib::ToValue;
15use glib_sys;
16use gtk_sys;
17use std::boxed::Box as Box_;
18use std::fmt;
19use std::mem::transmute;
20use Align;
21use Application;
22use Bin;
23use Buildable;
24use Container;
25use ResizeMode;
26#[cfg(any(feature = "v3_20", feature = "dox"))]
27use ShortcutsWindow;
28use Widget;
29use Window;
30use WindowPosition;
31use WindowType;
32
33glib_wrapper! {
34 pub struct ApplicationWindow(Object<gtk_sys::GtkApplicationWindow, gtk_sys::GtkApplicationWindowClass, ApplicationWindowClass>) @extends Window, Bin, Container, Widget, @implements Buildable, gio::ActionGroup, gio::ActionMap;
35
36 match fn {
37 get_type => || gtk_sys::gtk_application_window_get_type(),
38 }
39}
40
41pub struct ApplicationWindowBuilder {
42 show_menubar: Option<bool>,
43 accept_focus: Option<bool>,
44 application: Option<Application>,
45 attached_to: Option<Widget>,
46 decorated: Option<bool>,
47 default_height: Option<i32>,
48 default_width: Option<i32>,
49 deletable: Option<bool>,
50 destroy_with_parent: Option<bool>,
51 focus_on_map: Option<bool>,
52 focus_visible: Option<bool>,
53 gravity: Option<gdk::Gravity>,
54 hide_titlebar_when_maximized: Option<bool>,
55 icon: Option<gdk_pixbuf::Pixbuf>,
56 icon_name: Option<String>,
57 mnemonics_visible: Option<bool>,
58 modal: Option<bool>,
59 resizable: Option<bool>,
60 role: Option<String>,
61 screen: Option<gdk::Screen>,
62 skip_pager_hint: Option<bool>,
63 skip_taskbar_hint: Option<bool>,
64 startup_id: Option<String>,
65 title: Option<String>,
66 transient_for: Option<Window>,
67 type_: Option<WindowType>,
68 type_hint: Option<gdk::WindowTypeHint>,
69 urgency_hint: Option<bool>,
70 window_position: Option<WindowPosition>,
71 border_width: Option<u32>,
72 child: Option<Widget>,
73 resize_mode: Option<ResizeMode>,
74 app_paintable: Option<bool>,
75 can_default: Option<bool>,
76 can_focus: Option<bool>,
77 events: Option<gdk::EventMask>,
78 expand: Option<bool>,
79 #[cfg(any(feature = "v3_20", feature = "dox"))]
80 focus_on_click: Option<bool>,
81 halign: Option<Align>,
82 has_default: Option<bool>,
83 has_focus: Option<bool>,
84 has_tooltip: Option<bool>,
85 height_request: Option<i32>,
86 hexpand: Option<bool>,
87 hexpand_set: Option<bool>,
88 is_focus: Option<bool>,
89 margin: Option<i32>,
90 margin_bottom: Option<i32>,
91 margin_end: Option<i32>,
92 margin_start: Option<i32>,
93 margin_top: Option<i32>,
94 name: Option<String>,
95 no_show_all: Option<bool>,
96 opacity: Option<f64>,
97 parent: Option<Container>,
98 receives_default: Option<bool>,
99 sensitive: Option<bool>,
100 tooltip_markup: Option<String>,
102 tooltip_text: Option<String>,
103 valign: Option<Align>,
104 vexpand: Option<bool>,
105 vexpand_set: Option<bool>,
106 visible: Option<bool>,
107 width_request: Option<i32>,
108}
109
110impl ApplicationWindowBuilder {
111 pub fn new() -> Self {
112 Self {
113 show_menubar: None,
114 accept_focus: None,
115 application: None,
116 attached_to: None,
117 decorated: None,
118 default_height: None,
119 default_width: None,
120 deletable: None,
121 destroy_with_parent: None,
122 focus_on_map: None,
123 focus_visible: None,
124 gravity: None,
125 hide_titlebar_when_maximized: None,
126 icon: None,
127 icon_name: None,
128 mnemonics_visible: None,
129 modal: None,
130 resizable: None,
131 role: None,
132 screen: None,
133 skip_pager_hint: None,
134 skip_taskbar_hint: None,
135 startup_id: None,
136 title: None,
137 transient_for: None,
138 type_: None,
139 type_hint: None,
140 urgency_hint: None,
141 window_position: None,
142 border_width: None,
143 child: None,
144 resize_mode: None,
145 app_paintable: None,
146 can_default: None,
147 can_focus: None,
148 events: None,
149 expand: None,
150 #[cfg(any(feature = "v3_20", feature = "dox"))]
151 focus_on_click: None,
152 halign: None,
153 has_default: None,
154 has_focus: None,
155 has_tooltip: None,
156 height_request: None,
157 hexpand: None,
158 hexpand_set: None,
159 is_focus: None,
160 margin: None,
161 margin_bottom: None,
162 margin_end: None,
163 margin_start: None,
164 margin_top: None,
165 name: None,
166 no_show_all: None,
167 opacity: None,
168 parent: None,
169 receives_default: None,
170 sensitive: None,
171 tooltip_markup: None,
172 tooltip_text: None,
173 valign: None,
174 vexpand: None,
175 vexpand_set: None,
176 visible: None,
177 width_request: None,
178 }
179 }
180
181 pub fn build(self) -> ApplicationWindow {
182 let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
183 if let Some(ref show_menubar) = self.show_menubar {
184 properties.push(("show-menubar", show_menubar));
185 }
186 if let Some(ref accept_focus) = self.accept_focus {
187 properties.push(("accept-focus", accept_focus));
188 }
189 if let Some(ref application) = self.application {
190 properties.push(("application", application));
191 }
192 if let Some(ref attached_to) = self.attached_to {
193 properties.push(("attached-to", attached_to));
194 }
195 if let Some(ref decorated) = self.decorated {
196 properties.push(("decorated", decorated));
197 }
198 if let Some(ref default_height) = self.default_height {
199 properties.push(("default-height", default_height));
200 }
201 if let Some(ref default_width) = self.default_width {
202 properties.push(("default-width", default_width));
203 }
204 if let Some(ref deletable) = self.deletable {
205 properties.push(("deletable", deletable));
206 }
207 if let Some(ref destroy_with_parent) = self.destroy_with_parent {
208 properties.push(("destroy-with-parent", destroy_with_parent));
209 }
210 if let Some(ref focus_on_map) = self.focus_on_map {
211 properties.push(("focus-on-map", focus_on_map));
212 }
213 if let Some(ref focus_visible) = self.focus_visible {
214 properties.push(("focus-visible", focus_visible));
215 }
216 if let Some(ref gravity) = self.gravity {
217 properties.push(("gravity", gravity));
218 }
219 if let Some(ref hide_titlebar_when_maximized) = self.hide_titlebar_when_maximized {
220 properties.push(("hide-titlebar-when-maximized", hide_titlebar_when_maximized));
221 }
222 if let Some(ref icon) = self.icon {
223 properties.push(("icon", icon));
224 }
225 if let Some(ref icon_name) = self.icon_name {
226 properties.push(("icon-name", icon_name));
227 }
228 if let Some(ref mnemonics_visible) = self.mnemonics_visible {
229 properties.push(("mnemonics-visible", mnemonics_visible));
230 }
231 if let Some(ref modal) = self.modal {
232 properties.push(("modal", modal));
233 }
234 if let Some(ref resizable) = self.resizable {
235 properties.push(("resizable", resizable));
236 }
237 if let Some(ref role) = self.role {
238 properties.push(("role", role));
239 }
240 if let Some(ref screen) = self.screen {
241 properties.push(("screen", screen));
242 }
243 if let Some(ref skip_pager_hint) = self.skip_pager_hint {
244 properties.push(("skip-pager-hint", skip_pager_hint));
245 }
246 if let Some(ref skip_taskbar_hint) = self.skip_taskbar_hint {
247 properties.push(("skip-taskbar-hint", skip_taskbar_hint));
248 }
249 if let Some(ref startup_id) = self.startup_id {
250 properties.push(("startup-id", startup_id));
251 }
252 if let Some(ref title) = self.title {
253 properties.push(("title", title));
254 }
255 if let Some(ref transient_for) = self.transient_for {
256 properties.push(("transient-for", transient_for));
257 }
258 if let Some(ref type_) = self.type_ {
259 properties.push(("type", type_));
260 }
261 if let Some(ref type_hint) = self.type_hint {
262 properties.push(("type-hint", type_hint));
263 }
264 if let Some(ref urgency_hint) = self.urgency_hint {
265 properties.push(("urgency-hint", urgency_hint));
266 }
267 if let Some(ref window_position) = self.window_position {
268 properties.push(("window-position", window_position));
269 }
270 if let Some(ref border_width) = self.border_width {
271 properties.push(("border-width", border_width));
272 }
273 if let Some(ref child) = self.child {
274 properties.push(("child", child));
275 }
276 if let Some(ref resize_mode) = self.resize_mode {
277 properties.push(("resize-mode", resize_mode));
278 }
279 if let Some(ref app_paintable) = self.app_paintable {
280 properties.push(("app-paintable", app_paintable));
281 }
282 if let Some(ref can_default) = self.can_default {
283 properties.push(("can-default", can_default));
284 }
285 if let Some(ref can_focus) = self.can_focus {
286 properties.push(("can-focus", can_focus));
287 }
288 if let Some(ref events) = self.events {
289 properties.push(("events", events));
290 }
291 if let Some(ref expand) = self.expand {
292 properties.push(("expand", expand));
293 }
294 #[cfg(any(feature = "v3_20", feature = "dox"))]
295 {
296 if let Some(ref focus_on_click) = self.focus_on_click {
297 properties.push(("focus-on-click", focus_on_click));
298 }
299 }
300 if let Some(ref halign) = self.halign {
301 properties.push(("halign", halign));
302 }
303 if let Some(ref has_default) = self.has_default {
304 properties.push(("has-default", has_default));
305 }
306 if let Some(ref has_focus) = self.has_focus {
307 properties.push(("has-focus", has_focus));
308 }
309 if let Some(ref has_tooltip) = self.has_tooltip {
310 properties.push(("has-tooltip", has_tooltip));
311 }
312 if let Some(ref height_request) = self.height_request {
313 properties.push(("height-request", height_request));
314 }
315 if let Some(ref hexpand) = self.hexpand {
316 properties.push(("hexpand", hexpand));
317 }
318 if let Some(ref hexpand_set) = self.hexpand_set {
319 properties.push(("hexpand-set", hexpand_set));
320 }
321 if let Some(ref is_focus) = self.is_focus {
322 properties.push(("is-focus", is_focus));
323 }
324 if let Some(ref margin) = self.margin {
325 properties.push(("margin", margin));
326 }
327 if let Some(ref margin_bottom) = self.margin_bottom {
328 properties.push(("margin-bottom", margin_bottom));
329 }
330 if let Some(ref margin_end) = self.margin_end {
331 properties.push(("margin-end", margin_end));
332 }
333 if let Some(ref margin_start) = self.margin_start {
334 properties.push(("margin-start", margin_start));
335 }
336 if let Some(ref margin_top) = self.margin_top {
337 properties.push(("margin-top", margin_top));
338 }
339 if let Some(ref name) = self.name {
340 properties.push(("name", name));
341 }
342 if let Some(ref no_show_all) = self.no_show_all {
343 properties.push(("no-show-all", no_show_all));
344 }
345 if let Some(ref opacity) = self.opacity {
346 properties.push(("opacity", opacity));
347 }
348 if let Some(ref parent) = self.parent {
349 properties.push(("parent", parent));
350 }
351 if let Some(ref receives_default) = self.receives_default {
352 properties.push(("receives-default", receives_default));
353 }
354 if let Some(ref sensitive) = self.sensitive {
355 properties.push(("sensitive", sensitive));
356 }
357 if let Some(ref tooltip_markup) = self.tooltip_markup {
358 properties.push(("tooltip-markup", tooltip_markup));
359 }
360 if let Some(ref tooltip_text) = self.tooltip_text {
361 properties.push(("tooltip-text", tooltip_text));
362 }
363 if let Some(ref valign) = self.valign {
364 properties.push(("valign", valign));
365 }
366 if let Some(ref vexpand) = self.vexpand {
367 properties.push(("vexpand", vexpand));
368 }
369 if let Some(ref vexpand_set) = self.vexpand_set {
370 properties.push(("vexpand-set", vexpand_set));
371 }
372 if let Some(ref visible) = self.visible {
373 properties.push(("visible", visible));
374 }
375 if let Some(ref width_request) = self.width_request {
376 properties.push(("width-request", width_request));
377 }
378 glib::Object::new(ApplicationWindow::static_type(), &properties)
379 .expect("object new")
380 .downcast()
381 .expect("downcast")
382 }
383
384 pub fn show_menubar(mut self, show_menubar: bool) -> Self {
385 self.show_menubar = Some(show_menubar);
386 self
387 }
388
389 pub fn accept_focus(mut self, accept_focus: bool) -> Self {
390 self.accept_focus = Some(accept_focus);
391 self
392 }
393
394 pub fn application(mut self, application: &Application) -> Self {
395 self.application = Some(application.clone());
396 self
397 }
398
399 pub fn attached_to(mut self, attached_to: &Widget) -> Self {
400 self.attached_to = Some(attached_to.clone());
401 self
402 }
403
404 pub fn decorated(mut self, decorated: bool) -> Self {
405 self.decorated = Some(decorated);
406 self
407 }
408
409 pub fn default_height(mut self, default_height: i32) -> Self {
410 self.default_height = Some(default_height);
411 self
412 }
413
414 pub fn default_width(mut self, default_width: i32) -> Self {
415 self.default_width = Some(default_width);
416 self
417 }
418
419 pub fn deletable(mut self, deletable: bool) -> Self {
420 self.deletable = Some(deletable);
421 self
422 }
423
424 pub fn destroy_with_parent(mut self, destroy_with_parent: bool) -> Self {
425 self.destroy_with_parent = Some(destroy_with_parent);
426 self
427 }
428
429 pub fn focus_on_map(mut self, focus_on_map: bool) -> Self {
430 self.focus_on_map = Some(focus_on_map);
431 self
432 }
433
434 pub fn focus_visible(mut self, focus_visible: bool) -> Self {
435 self.focus_visible = Some(focus_visible);
436 self
437 }
438
439 pub fn gravity(mut self, gravity: gdk::Gravity) -> Self {
440 self.gravity = Some(gravity);
441 self
442 }
443
444 pub fn hide_titlebar_when_maximized(mut self, hide_titlebar_when_maximized: bool) -> Self {
445 self.hide_titlebar_when_maximized = Some(hide_titlebar_when_maximized);
446 self
447 }
448
449 pub fn icon(mut self, icon: &gdk_pixbuf::Pixbuf) -> Self {
450 self.icon = Some(icon.clone());
451 self
452 }
453
454 pub fn icon_name(mut self, icon_name: &str) -> Self {
455 self.icon_name = Some(icon_name.to_string());
456 self
457 }
458
459 pub fn mnemonics_visible(mut self, mnemonics_visible: bool) -> Self {
460 self.mnemonics_visible = Some(mnemonics_visible);
461 self
462 }
463
464 pub fn modal(mut self, modal: bool) -> Self {
465 self.modal = Some(modal);
466 self
467 }
468
469 pub fn resizable(mut self, resizable: bool) -> Self {
470 self.resizable = Some(resizable);
471 self
472 }
473
474 pub fn role(mut self, role: &str) -> Self {
475 self.role = Some(role.to_string());
476 self
477 }
478
479 pub fn screen(mut self, screen: &gdk::Screen) -> Self {
480 self.screen = Some(screen.clone());
481 self
482 }
483
484 pub fn skip_pager_hint(mut self, skip_pager_hint: bool) -> Self {
485 self.skip_pager_hint = Some(skip_pager_hint);
486 self
487 }
488
489 pub fn skip_taskbar_hint(mut self, skip_taskbar_hint: bool) -> Self {
490 self.skip_taskbar_hint = Some(skip_taskbar_hint);
491 self
492 }
493
494 pub fn startup_id(mut self, startup_id: &str) -> Self {
495 self.startup_id = Some(startup_id.to_string());
496 self
497 }
498
499 pub fn title(mut self, title: &str) -> Self {
500 self.title = Some(title.to_string());
501 self
502 }
503
504 pub fn transient_for(mut self, transient_for: &Window) -> Self {
505 self.transient_for = Some(transient_for.clone());
506 self
507 }
508
509 pub fn type_(mut self, type_: WindowType) -> Self {
510 self.type_ = Some(type_);
511 self
512 }
513
514 pub fn type_hint(mut self, type_hint: gdk::WindowTypeHint) -> Self {
515 self.type_hint = Some(type_hint);
516 self
517 }
518
519 pub fn urgency_hint(mut self, urgency_hint: bool) -> Self {
520 self.urgency_hint = Some(urgency_hint);
521 self
522 }
523
524 pub fn window_position(mut self, window_position: WindowPosition) -> Self {
525 self.window_position = Some(window_position);
526 self
527 }
528
529 pub fn border_width(mut self, border_width: u32) -> Self {
530 self.border_width = Some(border_width);
531 self
532 }
533
534 pub fn child(mut self, child: &Widget) -> Self {
535 self.child = Some(child.clone());
536 self
537 }
538
539 pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self {
540 self.resize_mode = Some(resize_mode);
541 self
542 }
543
544 pub fn app_paintable(mut self, app_paintable: bool) -> Self {
545 self.app_paintable = Some(app_paintable);
546 self
547 }
548
549 pub fn can_default(mut self, can_default: bool) -> Self {
550 self.can_default = Some(can_default);
551 self
552 }
553
554 pub fn can_focus(mut self, can_focus: bool) -> Self {
555 self.can_focus = Some(can_focus);
556 self
557 }
558
559 pub fn events(mut self, events: gdk::EventMask) -> Self {
560 self.events = Some(events);
561 self
562 }
563
564 pub fn expand(mut self, expand: bool) -> Self {
565 self.expand = Some(expand);
566 self
567 }
568
569 #[cfg(any(feature = "v3_20", feature = "dox"))]
570 pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
571 self.focus_on_click = Some(focus_on_click);
572 self
573 }
574
575 pub fn halign(mut self, halign: Align) -> Self {
576 self.halign = Some(halign);
577 self
578 }
579
580 pub fn has_default(mut self, has_default: bool) -> Self {
581 self.has_default = Some(has_default);
582 self
583 }
584
585 pub fn has_focus(mut self, has_focus: bool) -> Self {
586 self.has_focus = Some(has_focus);
587 self
588 }
589
590 pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
591 self.has_tooltip = Some(has_tooltip);
592 self
593 }
594
595 pub fn height_request(mut self, height_request: i32) -> Self {
596 self.height_request = Some(height_request);
597 self
598 }
599
600 pub fn hexpand(mut self, hexpand: bool) -> Self {
601 self.hexpand = Some(hexpand);
602 self
603 }
604
605 pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
606 self.hexpand_set = Some(hexpand_set);
607 self
608 }
609
610 pub fn is_focus(mut self, is_focus: bool) -> Self {
611 self.is_focus = Some(is_focus);
612 self
613 }
614
615 pub fn margin(mut self, margin: i32) -> Self {
616 self.margin = Some(margin);
617 self
618 }
619
620 pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
621 self.margin_bottom = Some(margin_bottom);
622 self
623 }
624
625 pub fn margin_end(mut self, margin_end: i32) -> Self {
626 self.margin_end = Some(margin_end);
627 self
628 }
629
630 pub fn margin_start(mut self, margin_start: i32) -> Self {
631 self.margin_start = Some(margin_start);
632 self
633 }
634
635 pub fn margin_top(mut self, margin_top: i32) -> Self {
636 self.margin_top = Some(margin_top);
637 self
638 }
639
640 pub fn name(mut self, name: &str) -> Self {
641 self.name = Some(name.to_string());
642 self
643 }
644
645 pub fn no_show_all(mut self, no_show_all: bool) -> Self {
646 self.no_show_all = Some(no_show_all);
647 self
648 }
649
650 pub fn opacity(mut self, opacity: f64) -> Self {
651 self.opacity = Some(opacity);
652 self
653 }
654
655 pub fn parent(mut self, parent: &Container) -> Self {
656 self.parent = Some(parent.clone());
657 self
658 }
659
660 pub fn receives_default(mut self, receives_default: bool) -> Self {
661 self.receives_default = Some(receives_default);
662 self
663 }
664
665 pub fn sensitive(mut self, sensitive: bool) -> Self {
666 self.sensitive = Some(sensitive);
667 self
668 }
669
670 pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
671 self.tooltip_markup = Some(tooltip_markup.to_string());
672 self
673 }
674
675 pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
676 self.tooltip_text = Some(tooltip_text.to_string());
677 self
678 }
679
680 pub fn valign(mut self, valign: Align) -> Self {
681 self.valign = Some(valign);
682 self
683 }
684
685 pub fn vexpand(mut self, vexpand: bool) -> Self {
686 self.vexpand = Some(vexpand);
687 self
688 }
689
690 pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
691 self.vexpand_set = Some(vexpand_set);
692 self
693 }
694
695 pub fn visible(mut self, visible: bool) -> Self {
696 self.visible = Some(visible);
697 self
698 }
699
700 pub fn width_request(mut self, width_request: i32) -> Self {
701 self.width_request = Some(width_request);
702 self
703 }
704}
705
706pub const NONE_APPLICATION_WINDOW: Option<&ApplicationWindow> = None;
707
708pub trait ApplicationWindowExt: 'static {
709 #[cfg(any(feature = "v3_20", feature = "dox"))]
710 fn get_help_overlay(&self) -> Option<ShortcutsWindow>;
711
712 fn get_id(&self) -> u32;
713
714 fn get_show_menubar(&self) -> bool;
715
716 #[cfg(any(feature = "v3_20", feature = "dox"))]
717 fn set_help_overlay<P: IsA<ShortcutsWindow>>(&self, help_overlay: Option<&P>);
718
719 fn set_show_menubar(&self, show_menubar: bool);
720
721 fn connect_property_show_menubar_notify<F: Fn(&Self) + 'static>(&self, f: F)
722 -> SignalHandlerId;
723}
724
725impl<O: IsA<ApplicationWindow>> ApplicationWindowExt for O {
726 #[cfg(any(feature = "v3_20", feature = "dox"))]
727 fn get_help_overlay(&self) -> Option<ShortcutsWindow> {
728 unsafe {
729 from_glib_none(gtk_sys::gtk_application_window_get_help_overlay(
730 self.as_ref().to_glib_none().0,
731 ))
732 }
733 }
734
735 fn get_id(&self) -> u32 {
736 unsafe { gtk_sys::gtk_application_window_get_id(self.as_ref().to_glib_none().0) }
737 }
738
739 fn get_show_menubar(&self) -> bool {
740 unsafe {
741 from_glib(gtk_sys::gtk_application_window_get_show_menubar(
742 self.as_ref().to_glib_none().0,
743 ))
744 }
745 }
746
747 #[cfg(any(feature = "v3_20", feature = "dox"))]
748 fn set_help_overlay<P: IsA<ShortcutsWindow>>(&self, help_overlay: Option<&P>) {
749 unsafe {
750 gtk_sys::gtk_application_window_set_help_overlay(
751 self.as_ref().to_glib_none().0,
752 help_overlay.map(|p| p.as_ref()).to_glib_none().0,
753 );
754 }
755 }
756
757 fn set_show_menubar(&self, show_menubar: bool) {
758 unsafe {
759 gtk_sys::gtk_application_window_set_show_menubar(
760 self.as_ref().to_glib_none().0,
761 show_menubar.to_glib(),
762 );
763 }
764 }
765
766 fn connect_property_show_menubar_notify<F: Fn(&Self) + 'static>(
767 &self,
768 f: F,
769 ) -> SignalHandlerId {
770 unsafe extern "C" fn notify_show_menubar_trampoline<P, F: Fn(&P) + 'static>(
771 this: *mut gtk_sys::GtkApplicationWindow,
772 _param_spec: glib_sys::gpointer,
773 f: glib_sys::gpointer,
774 ) where
775 P: IsA<ApplicationWindow>,
776 {
777 let f: &F = &*(f as *const F);
778 f(&ApplicationWindow::from_glib_borrow(this).unsafe_cast())
779 }
780 unsafe {
781 let f: Box_<F> = Box_::new(f);
782 connect_raw(
783 self.as_ptr() as *mut _,
784 b"notify::show-menubar\0".as_ptr() as *const _,
785 Some(transmute(
786 notify_show_menubar_trampoline::<Self, F> as usize,
787 )),
788 Box_::into_raw(f),
789 )
790 }
791 }
792}
793
794impl fmt::Display for ApplicationWindow {
795 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
796 write!(f, "ApplicationWindow")
797 }
798}