1use gdk;
6use gdk_pixbuf;
7use glib;
8use glib::object::Cast;
9use glib::object::IsA;
10use glib::object::ObjectExt;
11use glib::signal::connect_raw;
12use glib::signal::SignalHandlerId;
13use glib::translate::*;
14use glib::GString;
15use glib::StaticType;
16use glib::ToValue;
17use glib::Value;
18use glib_sys;
19use gobject_sys;
20use gtk_sys;
21use std;
22use std::boxed::Box as Box_;
23use std::fmt;
24use std::mem;
25use std::mem::transmute;
26use std::ptr;
27use AccelGroup;
28use Align;
29use Application;
30use Bin;
31use Buildable;
32use Container;
33use Error;
34use ResizeMode;
35use Widget;
36use WindowGroup;
37use WindowPosition;
38use WindowType;
39
40glib_wrapper! {
41 pub struct Window(Object<gtk_sys::GtkWindow, gtk_sys::GtkWindowClass, WindowClass>) @extends Bin, Container, Widget, @implements Buildable;
42
43 match fn {
44 get_type => || gtk_sys::gtk_window_get_type(),
45 }
46}
47
48impl Window {
49 pub fn new(type_: WindowType) -> Window {
50 assert_initialized_main_thread!();
51 unsafe { Widget::from_glib_none(gtk_sys::gtk_window_new(type_.to_glib())).unsafe_cast() }
52 }
53
54 pub fn get_default_icon_list() -> Vec<gdk_pixbuf::Pixbuf> {
55 assert_initialized_main_thread!();
56 unsafe {
57 FromGlibPtrContainer::from_glib_container(gtk_sys::gtk_window_get_default_icon_list())
58 }
59 }
60
61 pub fn get_default_icon_name() -> Option<GString> {
62 assert_initialized_main_thread!();
63 unsafe { from_glib_none(gtk_sys::gtk_window_get_default_icon_name()) }
64 }
65
66 pub fn list_toplevels() -> Vec<Widget> {
67 assert_initialized_main_thread!();
68 unsafe { FromGlibPtrContainer::from_glib_container(gtk_sys::gtk_window_list_toplevels()) }
69 }
70
71 pub fn set_auto_startup_notification(setting: bool) {
72 assert_initialized_main_thread!();
73 unsafe {
74 gtk_sys::gtk_window_set_auto_startup_notification(setting.to_glib());
75 }
76 }
77
78 pub fn set_default_icon(icon: &gdk_pixbuf::Pixbuf) {
79 assert_initialized_main_thread!();
80 unsafe {
81 gtk_sys::gtk_window_set_default_icon(icon.to_glib_none().0);
82 }
83 }
84
85 pub fn set_default_icon_from_file<P: AsRef<std::path::Path>>(filename: P) -> Result<(), Error> {
86 assert_initialized_main_thread!();
87 unsafe {
88 let mut error = ptr::null_mut();
89 let _ = gtk_sys::gtk_window_set_default_icon_from_file(
90 filename.as_ref().to_glib_none().0,
91 &mut error,
92 );
93 if error.is_null() {
94 Ok(())
95 } else {
96 Err(from_glib_full(error))
97 }
98 }
99 }
100
101 pub fn set_default_icon_list(list: &[gdk_pixbuf::Pixbuf]) {
102 assert_initialized_main_thread!();
103 unsafe {
104 gtk_sys::gtk_window_set_default_icon_list(list.to_glib_container().0);
105 }
106 }
107
108 pub fn set_default_icon_name(name: &str) {
109 assert_initialized_main_thread!();
110 unsafe {
111 gtk_sys::gtk_window_set_default_icon_name(name.to_glib_none().0);
112 }
113 }
114
115 pub fn set_interactive_debugging(enable: bool) {
116 assert_initialized_main_thread!();
117 unsafe {
118 gtk_sys::gtk_window_set_interactive_debugging(enable.to_glib());
119 }
120 }
121}
122
123pub struct WindowBuilder {
124 accept_focus: Option<bool>,
125 application: Option<Application>,
126 attached_to: Option<Widget>,
127 decorated: Option<bool>,
128 default_height: Option<i32>,
129 default_width: Option<i32>,
130 deletable: Option<bool>,
131 destroy_with_parent: Option<bool>,
132 focus_on_map: Option<bool>,
133 focus_visible: Option<bool>,
134 gravity: Option<gdk::Gravity>,
135 hide_titlebar_when_maximized: Option<bool>,
136 icon: Option<gdk_pixbuf::Pixbuf>,
137 icon_name: Option<String>,
138 mnemonics_visible: Option<bool>,
139 modal: Option<bool>,
140 resizable: Option<bool>,
141 role: Option<String>,
142 screen: Option<gdk::Screen>,
143 skip_pager_hint: Option<bool>,
144 skip_taskbar_hint: Option<bool>,
145 startup_id: Option<String>,
146 title: Option<String>,
147 transient_for: Option<Window>,
148 type_: Option<WindowType>,
149 type_hint: Option<gdk::WindowTypeHint>,
150 urgency_hint: Option<bool>,
151 window_position: Option<WindowPosition>,
152 border_width: Option<u32>,
153 child: Option<Widget>,
154 resize_mode: Option<ResizeMode>,
155 app_paintable: Option<bool>,
156 can_default: Option<bool>,
157 can_focus: Option<bool>,
158 events: Option<gdk::EventMask>,
159 expand: Option<bool>,
160 #[cfg(any(feature = "v3_20", feature = "dox"))]
161 focus_on_click: Option<bool>,
162 halign: Option<Align>,
163 has_default: Option<bool>,
164 has_focus: Option<bool>,
165 has_tooltip: Option<bool>,
166 height_request: Option<i32>,
167 hexpand: Option<bool>,
168 hexpand_set: Option<bool>,
169 is_focus: Option<bool>,
170 margin: Option<i32>,
171 margin_bottom: Option<i32>,
172 margin_end: Option<i32>,
173 margin_start: Option<i32>,
174 margin_top: Option<i32>,
175 name: Option<String>,
176 no_show_all: Option<bool>,
177 opacity: Option<f64>,
178 parent: Option<Container>,
179 receives_default: Option<bool>,
180 sensitive: Option<bool>,
181 tooltip_markup: Option<String>,
183 tooltip_text: Option<String>,
184 valign: Option<Align>,
185 vexpand: Option<bool>,
186 vexpand_set: Option<bool>,
187 visible: Option<bool>,
188 width_request: Option<i32>,
189}
190
191impl WindowBuilder {
192 pub fn new() -> Self {
193 Self {
194 accept_focus: None,
195 application: None,
196 attached_to: None,
197 decorated: None,
198 default_height: None,
199 default_width: None,
200 deletable: None,
201 destroy_with_parent: None,
202 focus_on_map: None,
203 focus_visible: None,
204 gravity: None,
205 hide_titlebar_when_maximized: None,
206 icon: None,
207 icon_name: None,
208 mnemonics_visible: None,
209 modal: None,
210 resizable: None,
211 role: None,
212 screen: None,
213 skip_pager_hint: None,
214 skip_taskbar_hint: None,
215 startup_id: None,
216 title: None,
217 transient_for: None,
218 type_: None,
219 type_hint: None,
220 urgency_hint: None,
221 window_position: None,
222 border_width: None,
223 child: None,
224 resize_mode: None,
225 app_paintable: None,
226 can_default: None,
227 can_focus: None,
228 events: None,
229 expand: None,
230 #[cfg(any(feature = "v3_20", feature = "dox"))]
231 focus_on_click: None,
232 halign: None,
233 has_default: None,
234 has_focus: None,
235 has_tooltip: None,
236 height_request: None,
237 hexpand: None,
238 hexpand_set: None,
239 is_focus: None,
240 margin: None,
241 margin_bottom: None,
242 margin_end: None,
243 margin_start: None,
244 margin_top: None,
245 name: None,
246 no_show_all: None,
247 opacity: None,
248 parent: None,
249 receives_default: None,
250 sensitive: None,
251 tooltip_markup: None,
252 tooltip_text: None,
253 valign: None,
254 vexpand: None,
255 vexpand_set: None,
256 visible: None,
257 width_request: None,
258 }
259 }
260
261 pub fn build(self) -> Window {
262 let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
263 if let Some(ref accept_focus) = self.accept_focus {
264 properties.push(("accept-focus", accept_focus));
265 }
266 if let Some(ref application) = self.application {
267 properties.push(("application", application));
268 }
269 if let Some(ref attached_to) = self.attached_to {
270 properties.push(("attached-to", attached_to));
271 }
272 if let Some(ref decorated) = self.decorated {
273 properties.push(("decorated", decorated));
274 }
275 if let Some(ref default_height) = self.default_height {
276 properties.push(("default-height", default_height));
277 }
278 if let Some(ref default_width) = self.default_width {
279 properties.push(("default-width", default_width));
280 }
281 if let Some(ref deletable) = self.deletable {
282 properties.push(("deletable", deletable));
283 }
284 if let Some(ref destroy_with_parent) = self.destroy_with_parent {
285 properties.push(("destroy-with-parent", destroy_with_parent));
286 }
287 if let Some(ref focus_on_map) = self.focus_on_map {
288 properties.push(("focus-on-map", focus_on_map));
289 }
290 if let Some(ref focus_visible) = self.focus_visible {
291 properties.push(("focus-visible", focus_visible));
292 }
293 if let Some(ref gravity) = self.gravity {
294 properties.push(("gravity", gravity));
295 }
296 if let Some(ref hide_titlebar_when_maximized) = self.hide_titlebar_when_maximized {
297 properties.push(("hide-titlebar-when-maximized", hide_titlebar_when_maximized));
298 }
299 if let Some(ref icon) = self.icon {
300 properties.push(("icon", icon));
301 }
302 if let Some(ref icon_name) = self.icon_name {
303 properties.push(("icon-name", icon_name));
304 }
305 if let Some(ref mnemonics_visible) = self.mnemonics_visible {
306 properties.push(("mnemonics-visible", mnemonics_visible));
307 }
308 if let Some(ref modal) = self.modal {
309 properties.push(("modal", modal));
310 }
311 if let Some(ref resizable) = self.resizable {
312 properties.push(("resizable", resizable));
313 }
314 if let Some(ref role) = self.role {
315 properties.push(("role", role));
316 }
317 if let Some(ref screen) = self.screen {
318 properties.push(("screen", screen));
319 }
320 if let Some(ref skip_pager_hint) = self.skip_pager_hint {
321 properties.push(("skip-pager-hint", skip_pager_hint));
322 }
323 if let Some(ref skip_taskbar_hint) = self.skip_taskbar_hint {
324 properties.push(("skip-taskbar-hint", skip_taskbar_hint));
325 }
326 if let Some(ref startup_id) = self.startup_id {
327 properties.push(("startup-id", startup_id));
328 }
329 if let Some(ref title) = self.title {
330 properties.push(("title", title));
331 }
332 if let Some(ref transient_for) = self.transient_for {
333 properties.push(("transient-for", transient_for));
334 }
335 if let Some(ref type_) = self.type_ {
336 properties.push(("type", type_));
337 }
338 if let Some(ref type_hint) = self.type_hint {
339 properties.push(("type-hint", type_hint));
340 }
341 if let Some(ref urgency_hint) = self.urgency_hint {
342 properties.push(("urgency-hint", urgency_hint));
343 }
344 if let Some(ref window_position) = self.window_position {
345 properties.push(("window-position", window_position));
346 }
347 if let Some(ref border_width) = self.border_width {
348 properties.push(("border-width", border_width));
349 }
350 if let Some(ref child) = self.child {
351 properties.push(("child", child));
352 }
353 if let Some(ref resize_mode) = self.resize_mode {
354 properties.push(("resize-mode", resize_mode));
355 }
356 if let Some(ref app_paintable) = self.app_paintable {
357 properties.push(("app-paintable", app_paintable));
358 }
359 if let Some(ref can_default) = self.can_default {
360 properties.push(("can-default", can_default));
361 }
362 if let Some(ref can_focus) = self.can_focus {
363 properties.push(("can-focus", can_focus));
364 }
365 if let Some(ref events) = self.events {
366 properties.push(("events", events));
367 }
368 if let Some(ref expand) = self.expand {
369 properties.push(("expand", expand));
370 }
371 #[cfg(any(feature = "v3_20", feature = "dox"))]
372 {
373 if let Some(ref focus_on_click) = self.focus_on_click {
374 properties.push(("focus-on-click", focus_on_click));
375 }
376 }
377 if let Some(ref halign) = self.halign {
378 properties.push(("halign", halign));
379 }
380 if let Some(ref has_default) = self.has_default {
381 properties.push(("has-default", has_default));
382 }
383 if let Some(ref has_focus) = self.has_focus {
384 properties.push(("has-focus", has_focus));
385 }
386 if let Some(ref has_tooltip) = self.has_tooltip {
387 properties.push(("has-tooltip", has_tooltip));
388 }
389 if let Some(ref height_request) = self.height_request {
390 properties.push(("height-request", height_request));
391 }
392 if let Some(ref hexpand) = self.hexpand {
393 properties.push(("hexpand", hexpand));
394 }
395 if let Some(ref hexpand_set) = self.hexpand_set {
396 properties.push(("hexpand-set", hexpand_set));
397 }
398 if let Some(ref is_focus) = self.is_focus {
399 properties.push(("is-focus", is_focus));
400 }
401 if let Some(ref margin) = self.margin {
402 properties.push(("margin", margin));
403 }
404 if let Some(ref margin_bottom) = self.margin_bottom {
405 properties.push(("margin-bottom", margin_bottom));
406 }
407 if let Some(ref margin_end) = self.margin_end {
408 properties.push(("margin-end", margin_end));
409 }
410 if let Some(ref margin_start) = self.margin_start {
411 properties.push(("margin-start", margin_start));
412 }
413 if let Some(ref margin_top) = self.margin_top {
414 properties.push(("margin-top", margin_top));
415 }
416 if let Some(ref name) = self.name {
417 properties.push(("name", name));
418 }
419 if let Some(ref no_show_all) = self.no_show_all {
420 properties.push(("no-show-all", no_show_all));
421 }
422 if let Some(ref opacity) = self.opacity {
423 properties.push(("opacity", opacity));
424 }
425 if let Some(ref parent) = self.parent {
426 properties.push(("parent", parent));
427 }
428 if let Some(ref receives_default) = self.receives_default {
429 properties.push(("receives-default", receives_default));
430 }
431 if let Some(ref sensitive) = self.sensitive {
432 properties.push(("sensitive", sensitive));
433 }
434 if let Some(ref tooltip_markup) = self.tooltip_markup {
435 properties.push(("tooltip-markup", tooltip_markup));
436 }
437 if let Some(ref tooltip_text) = self.tooltip_text {
438 properties.push(("tooltip-text", tooltip_text));
439 }
440 if let Some(ref valign) = self.valign {
441 properties.push(("valign", valign));
442 }
443 if let Some(ref vexpand) = self.vexpand {
444 properties.push(("vexpand", vexpand));
445 }
446 if let Some(ref vexpand_set) = self.vexpand_set {
447 properties.push(("vexpand-set", vexpand_set));
448 }
449 if let Some(ref visible) = self.visible {
450 properties.push(("visible", visible));
451 }
452 if let Some(ref width_request) = self.width_request {
453 properties.push(("width-request", width_request));
454 }
455 glib::Object::new(Window::static_type(), &properties)
456 .expect("object new")
457 .downcast()
458 .expect("downcast")
459 }
460
461 pub fn accept_focus(mut self, accept_focus: bool) -> Self {
462 self.accept_focus = Some(accept_focus);
463 self
464 }
465
466 pub fn application(mut self, application: &Application) -> Self {
467 self.application = Some(application.clone());
468 self
469 }
470
471 pub fn attached_to(mut self, attached_to: &Widget) -> Self {
472 self.attached_to = Some(attached_to.clone());
473 self
474 }
475
476 pub fn decorated(mut self, decorated: bool) -> Self {
477 self.decorated = Some(decorated);
478 self
479 }
480
481 pub fn default_height(mut self, default_height: i32) -> Self {
482 self.default_height = Some(default_height);
483 self
484 }
485
486 pub fn default_width(mut self, default_width: i32) -> Self {
487 self.default_width = Some(default_width);
488 self
489 }
490
491 pub fn deletable(mut self, deletable: bool) -> Self {
492 self.deletable = Some(deletable);
493 self
494 }
495
496 pub fn destroy_with_parent(mut self, destroy_with_parent: bool) -> Self {
497 self.destroy_with_parent = Some(destroy_with_parent);
498 self
499 }
500
501 pub fn focus_on_map(mut self, focus_on_map: bool) -> Self {
502 self.focus_on_map = Some(focus_on_map);
503 self
504 }
505
506 pub fn focus_visible(mut self, focus_visible: bool) -> Self {
507 self.focus_visible = Some(focus_visible);
508 self
509 }
510
511 pub fn gravity(mut self, gravity: gdk::Gravity) -> Self {
512 self.gravity = Some(gravity);
513 self
514 }
515
516 pub fn hide_titlebar_when_maximized(mut self, hide_titlebar_when_maximized: bool) -> Self {
517 self.hide_titlebar_when_maximized = Some(hide_titlebar_when_maximized);
518 self
519 }
520
521 pub fn icon(mut self, icon: &gdk_pixbuf::Pixbuf) -> Self {
522 self.icon = Some(icon.clone());
523 self
524 }
525
526 pub fn icon_name(mut self, icon_name: &str) -> Self {
527 self.icon_name = Some(icon_name.to_string());
528 self
529 }
530
531 pub fn mnemonics_visible(mut self, mnemonics_visible: bool) -> Self {
532 self.mnemonics_visible = Some(mnemonics_visible);
533 self
534 }
535
536 pub fn modal(mut self, modal: bool) -> Self {
537 self.modal = Some(modal);
538 self
539 }
540
541 pub fn resizable(mut self, resizable: bool) -> Self {
542 self.resizable = Some(resizable);
543 self
544 }
545
546 pub fn role(mut self, role: &str) -> Self {
547 self.role = Some(role.to_string());
548 self
549 }
550
551 pub fn screen(mut self, screen: &gdk::Screen) -> Self {
552 self.screen = Some(screen.clone());
553 self
554 }
555
556 pub fn skip_pager_hint(mut self, skip_pager_hint: bool) -> Self {
557 self.skip_pager_hint = Some(skip_pager_hint);
558 self
559 }
560
561 pub fn skip_taskbar_hint(mut self, skip_taskbar_hint: bool) -> Self {
562 self.skip_taskbar_hint = Some(skip_taskbar_hint);
563 self
564 }
565
566 pub fn startup_id(mut self, startup_id: &str) -> Self {
567 self.startup_id = Some(startup_id.to_string());
568 self
569 }
570
571 pub fn title(mut self, title: &str) -> Self {
572 self.title = Some(title.to_string());
573 self
574 }
575
576 pub fn transient_for(mut self, transient_for: &Window) -> Self {
577 self.transient_for = Some(transient_for.clone());
578 self
579 }
580
581 pub fn type_(mut self, type_: WindowType) -> Self {
582 self.type_ = Some(type_);
583 self
584 }
585
586 pub fn type_hint(mut self, type_hint: gdk::WindowTypeHint) -> Self {
587 self.type_hint = Some(type_hint);
588 self
589 }
590
591 pub fn urgency_hint(mut self, urgency_hint: bool) -> Self {
592 self.urgency_hint = Some(urgency_hint);
593 self
594 }
595
596 pub fn window_position(mut self, window_position: WindowPosition) -> Self {
597 self.window_position = Some(window_position);
598 self
599 }
600
601 pub fn border_width(mut self, border_width: u32) -> Self {
602 self.border_width = Some(border_width);
603 self
604 }
605
606 pub fn child(mut self, child: &Widget) -> Self {
607 self.child = Some(child.clone());
608 self
609 }
610
611 pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self {
612 self.resize_mode = Some(resize_mode);
613 self
614 }
615
616 pub fn app_paintable(mut self, app_paintable: bool) -> Self {
617 self.app_paintable = Some(app_paintable);
618 self
619 }
620
621 pub fn can_default(mut self, can_default: bool) -> Self {
622 self.can_default = Some(can_default);
623 self
624 }
625
626 pub fn can_focus(mut self, can_focus: bool) -> Self {
627 self.can_focus = Some(can_focus);
628 self
629 }
630
631 pub fn events(mut self, events: gdk::EventMask) -> Self {
632 self.events = Some(events);
633 self
634 }
635
636 pub fn expand(mut self, expand: bool) -> Self {
637 self.expand = Some(expand);
638 self
639 }
640
641 #[cfg(any(feature = "v3_20", feature = "dox"))]
642 pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
643 self.focus_on_click = Some(focus_on_click);
644 self
645 }
646
647 pub fn halign(mut self, halign: Align) -> Self {
648 self.halign = Some(halign);
649 self
650 }
651
652 pub fn has_default(mut self, has_default: bool) -> Self {
653 self.has_default = Some(has_default);
654 self
655 }
656
657 pub fn has_focus(mut self, has_focus: bool) -> Self {
658 self.has_focus = Some(has_focus);
659 self
660 }
661
662 pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
663 self.has_tooltip = Some(has_tooltip);
664 self
665 }
666
667 pub fn height_request(mut self, height_request: i32) -> Self {
668 self.height_request = Some(height_request);
669 self
670 }
671
672 pub fn hexpand(mut self, hexpand: bool) -> Self {
673 self.hexpand = Some(hexpand);
674 self
675 }
676
677 pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
678 self.hexpand_set = Some(hexpand_set);
679 self
680 }
681
682 pub fn is_focus(mut self, is_focus: bool) -> Self {
683 self.is_focus = Some(is_focus);
684 self
685 }
686
687 pub fn margin(mut self, margin: i32) -> Self {
688 self.margin = Some(margin);
689 self
690 }
691
692 pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
693 self.margin_bottom = Some(margin_bottom);
694 self
695 }
696
697 pub fn margin_end(mut self, margin_end: i32) -> Self {
698 self.margin_end = Some(margin_end);
699 self
700 }
701
702 pub fn margin_start(mut self, margin_start: i32) -> Self {
703 self.margin_start = Some(margin_start);
704 self
705 }
706
707 pub fn margin_top(mut self, margin_top: i32) -> Self {
708 self.margin_top = Some(margin_top);
709 self
710 }
711
712 pub fn name(mut self, name: &str) -> Self {
713 self.name = Some(name.to_string());
714 self
715 }
716
717 pub fn no_show_all(mut self, no_show_all: bool) -> Self {
718 self.no_show_all = Some(no_show_all);
719 self
720 }
721
722 pub fn opacity(mut self, opacity: f64) -> Self {
723 self.opacity = Some(opacity);
724 self
725 }
726
727 pub fn parent(mut self, parent: &Container) -> Self {
728 self.parent = Some(parent.clone());
729 self
730 }
731
732 pub fn receives_default(mut self, receives_default: bool) -> Self {
733 self.receives_default = Some(receives_default);
734 self
735 }
736
737 pub fn sensitive(mut self, sensitive: bool) -> Self {
738 self.sensitive = Some(sensitive);
739 self
740 }
741
742 pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
743 self.tooltip_markup = Some(tooltip_markup.to_string());
744 self
745 }
746
747 pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
748 self.tooltip_text = Some(tooltip_text.to_string());
749 self
750 }
751
752 pub fn valign(mut self, valign: Align) -> Self {
753 self.valign = Some(valign);
754 self
755 }
756
757 pub fn vexpand(mut self, vexpand: bool) -> Self {
758 self.vexpand = Some(vexpand);
759 self
760 }
761
762 pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
763 self.vexpand_set = Some(vexpand_set);
764 self
765 }
766
767 pub fn visible(mut self, visible: bool) -> Self {
768 self.visible = Some(visible);
769 self
770 }
771
772 pub fn width_request(mut self, width_request: i32) -> Self {
773 self.width_request = Some(width_request);
774 self
775 }
776}
777
778pub const NONE_WINDOW: Option<&Window> = None;
779
780pub trait GtkWindowExt: 'static {
781 fn activate_default(&self) -> bool;
782
783 fn activate_focus(&self) -> bool;
784
785 fn activate_key(&self, event: &gdk::EventKey) -> bool;
786
787 fn add_accel_group<P: IsA<AccelGroup>>(&self, accel_group: &P);
788
789 fn add_mnemonic<P: IsA<Widget>>(&self, keyval: u32, target: &P);
790
791 fn begin_move_drag(&self, button: i32, root_x: i32, root_y: i32, timestamp: u32);
792
793 fn begin_resize_drag(
794 &self,
795 edge: gdk::WindowEdge,
796 button: i32,
797 root_x: i32,
798 root_y: i32,
799 timestamp: u32,
800 );
801
802 fn close(&self);
803
804 fn deiconify(&self);
805
806 fn fullscreen(&self);
807
808 #[cfg(any(feature = "v3_18", feature = "dox"))]
809 fn fullscreen_on_monitor(&self, screen: &gdk::Screen, monitor: i32);
810
811 fn get_accept_focus(&self) -> bool;
812
813 fn get_application(&self) -> Option<Application>;
814
815 fn get_attached_to(&self) -> Option<Widget>;
816
817 fn get_decorated(&self) -> bool;
818
819 fn get_default_size(&self) -> (i32, i32);
820
821 fn get_default_widget(&self) -> Option<Widget>;
822
823 fn get_deletable(&self) -> bool;
824
825 fn get_destroy_with_parent(&self) -> bool;
826
827 fn get_focus(&self) -> Option<Widget>;
828
829 fn get_focus_on_map(&self) -> bool;
830
831 fn get_focus_visible(&self) -> bool;
832
833 fn get_gravity(&self) -> gdk::Gravity;
834
835 fn get_group(&self) -> Option<WindowGroup>;
836
837 fn get_hide_titlebar_when_maximized(&self) -> bool;
838
839 fn get_icon(&self) -> Option<gdk_pixbuf::Pixbuf>;
840
841 fn get_icon_list(&self) -> Vec<gdk_pixbuf::Pixbuf>;
842
843 fn get_icon_name(&self) -> Option<GString>;
844
845 fn get_mnemonic_modifier(&self) -> gdk::ModifierType;
846
847 fn get_mnemonics_visible(&self) -> bool;
848
849 fn get_modal(&self) -> bool;
850
851 fn get_position(&self) -> (i32, i32);
852
853 fn get_resizable(&self) -> bool;
854
855 fn get_role(&self) -> Option<GString>;
856
857 fn get_size(&self) -> (i32, i32);
858
859 fn get_skip_pager_hint(&self) -> bool;
860
861 fn get_skip_taskbar_hint(&self) -> bool;
862
863 fn get_title(&self) -> Option<GString>;
864
865 #[cfg(any(feature = "v3_16", feature = "dox"))]
866 fn get_titlebar(&self) -> Option<Widget>;
867
868 fn get_transient_for(&self) -> Option<Window>;
869
870 fn get_type_hint(&self) -> gdk::WindowTypeHint;
871
872 fn get_urgency_hint(&self) -> bool;
873
874 fn get_window_type(&self) -> WindowType;
875
876 fn has_group(&self) -> bool;
877
878 fn has_toplevel_focus(&self) -> bool;
879
880 fn iconify(&self);
881
882 fn is_active(&self) -> bool;
883
884 fn is_maximized(&self) -> bool;
885
886 fn maximize(&self);
887
888 fn mnemonic_activate(&self, keyval: u32, modifier: gdk::ModifierType) -> bool;
889
890 fn move_(&self, x: i32, y: i32);
891
892 #[cfg_attr(feature = "v3_20", deprecated)]
893 fn parse_geometry(&self, geometry: &str) -> bool;
894
895 fn present_with_time(&self, timestamp: u32);
896
897 fn propagate_key_event(&self, event: &gdk::EventKey) -> bool;
898
899 fn remove_accel_group<P: IsA<AccelGroup>>(&self, accel_group: &P);
900
901 fn remove_mnemonic<P: IsA<Widget>>(&self, keyval: u32, target: &P);
902
903 fn resize(&self, width: i32, height: i32);
904
905 #[cfg_attr(feature = "v3_20", deprecated)]
906 fn resize_to_geometry(&self, width: i32, height: i32);
907
908 fn set_accept_focus(&self, setting: bool);
909
910 fn set_application<P: IsA<Application>>(&self, application: Option<&P>);
911
912 fn set_attached_to<P: IsA<Widget>>(&self, attach_widget: Option<&P>);
913
914 fn set_decorated(&self, setting: bool);
915
916 fn set_default<P: IsA<Widget>>(&self, default_widget: Option<&P>);
917
918 #[cfg_attr(feature = "v3_20", deprecated)]
919 fn set_default_geometry(&self, width: i32, height: i32);
920
921 fn set_default_size(&self, width: i32, height: i32);
922
923 fn set_deletable(&self, setting: bool);
924
925 fn set_destroy_with_parent(&self, setting: bool);
926
927 fn set_focus<P: IsA<Widget>>(&self, focus: Option<&P>);
928
929 fn set_focus_on_map(&self, setting: bool);
930
931 fn set_focus_visible(&self, setting: bool);
932
933 fn set_gravity(&self, gravity: gdk::Gravity);
936
937 fn set_has_user_ref_count(&self, setting: bool);
938
939 fn set_hide_titlebar_when_maximized(&self, setting: bool);
940
941 fn set_icon(&self, icon: Option<&gdk_pixbuf::Pixbuf>);
942
943 fn set_icon_from_file<P: AsRef<std::path::Path>>(&self, filename: P) -> Result<(), Error>;
944
945 fn set_icon_list(&self, list: &[gdk_pixbuf::Pixbuf]);
946
947 fn set_icon_name(&self, name: Option<&str>);
948
949 fn set_keep_above(&self, setting: bool);
950
951 fn set_keep_below(&self, setting: bool);
952
953 fn set_mnemonic_modifier(&self, modifier: gdk::ModifierType);
954
955 fn set_mnemonics_visible(&self, setting: bool);
956
957 fn set_modal(&self, modal: bool);
958
959 fn set_position(&self, position: WindowPosition);
960
961 fn set_resizable(&self, resizable: bool);
962
963 fn set_role(&self, role: &str);
964
965 fn set_screen(&self, screen: &gdk::Screen);
966
967 fn set_skip_pager_hint(&self, setting: bool);
968
969 fn set_skip_taskbar_hint(&self, setting: bool);
970
971 fn set_startup_id(&self, startup_id: &str);
972
973 fn set_title(&self, title: &str);
974
975 fn set_titlebar<P: IsA<Widget>>(&self, titlebar: Option<&P>);
976
977 fn set_transient_for<P: IsA<Window>>(&self, parent: Option<&P>);
978
979 fn set_type_hint(&self, hint: gdk::WindowTypeHint);
980
981 fn set_urgency_hint(&self, setting: bool);
982
983 #[cfg_attr(feature = "v3_22", deprecated)]
984 fn set_wmclass(&self, wmclass_name: &str, wmclass_class: &str);
985
986 fn stick(&self);
987
988 fn unfullscreen(&self);
989
990 fn unmaximize(&self);
991
992 fn unstick(&self);
993
994 fn get_property_default_height(&self) -> i32;
995
996 fn set_property_default_height(&self, default_height: i32);
997
998 fn get_property_default_width(&self) -> i32;
999
1000 fn set_property_default_width(&self, default_width: i32);
1001
1002 fn get_property_has_toplevel_focus(&self) -> bool;
1003
1004 fn get_property_is_active(&self) -> bool;
1005
1006 fn get_property_is_maximized(&self) -> bool;
1007
1008 fn get_property_type(&self) -> WindowType;
1009
1010 fn get_property_window_position(&self) -> WindowPosition;
1011
1012 fn set_property_window_position(&self, window_position: WindowPosition);
1013
1014 fn connect_activate_default<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
1015
1016 fn emit_activate_default(&self);
1017
1018 fn connect_activate_focus<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
1019
1020 fn emit_activate_focus(&self);
1021
1022 fn connect_enable_debugging<F: Fn(&Self, bool) -> bool + 'static>(
1023 &self,
1024 f: F,
1025 ) -> SignalHandlerId;
1026
1027 fn emit_enable_debugging(&self, toggle: bool) -> bool;
1028
1029 fn connect_keys_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
1030
1031 fn connect_set_focus<F: Fn(&Self, &Widget) + 'static>(&self, f: F) -> SignalHandlerId;
1032
1033 fn connect_property_accept_focus_notify<F: Fn(&Self) + 'static>(&self, f: F)
1034 -> SignalHandlerId;
1035
1036 fn connect_property_application_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
1037
1038 fn connect_property_attached_to_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
1039
1040 fn connect_property_decorated_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
1041
1042 fn connect_property_default_height_notify<F: Fn(&Self) + 'static>(
1043 &self,
1044 f: F,
1045 ) -> SignalHandlerId;
1046
1047 fn connect_property_default_width_notify<F: Fn(&Self) + 'static>(
1048 &self,
1049 f: F,
1050 ) -> SignalHandlerId;
1051
1052 fn connect_property_deletable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
1053
1054 fn connect_property_destroy_with_parent_notify<F: Fn(&Self) + 'static>(
1055 &self,
1056 f: F,
1057 ) -> SignalHandlerId;
1058
1059 fn connect_property_focus_on_map_notify<F: Fn(&Self) + 'static>(&self, f: F)
1060 -> SignalHandlerId;
1061
1062 fn connect_property_focus_visible_notify<F: Fn(&Self) + 'static>(
1063 &self,
1064 f: F,
1065 ) -> SignalHandlerId;
1066
1067 fn connect_property_gravity_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
1068
1069 fn connect_property_has_toplevel_focus_notify<F: Fn(&Self) + 'static>(
1070 &self,
1071 f: F,
1072 ) -> SignalHandlerId;
1073
1074 fn connect_property_hide_titlebar_when_maximized_notify<F: Fn(&Self) + 'static>(
1075 &self,
1076 f: F,
1077 ) -> SignalHandlerId;
1078
1079 fn connect_property_icon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
1080
1081 fn connect_property_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
1082
1083 fn connect_property_is_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
1084
1085 fn connect_property_is_maximized_notify<F: Fn(&Self) + 'static>(&self, f: F)
1086 -> SignalHandlerId;
1087
1088 fn connect_property_mnemonics_visible_notify<F: Fn(&Self) + 'static>(
1089 &self,
1090 f: F,
1091 ) -> SignalHandlerId;
1092
1093 fn connect_property_modal_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
1094
1095 fn connect_property_resizable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
1096
1097 fn connect_property_role_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
1098
1099 fn connect_property_screen_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
1100
1101 fn connect_property_skip_pager_hint_notify<F: Fn(&Self) + 'static>(
1102 &self,
1103 f: F,
1104 ) -> SignalHandlerId;
1105
1106 fn connect_property_skip_taskbar_hint_notify<F: Fn(&Self) + 'static>(
1107 &self,
1108 f: F,
1109 ) -> SignalHandlerId;
1110
1111 fn connect_property_startup_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
1112
1113 fn connect_property_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
1114
1115 fn connect_property_transient_for_notify<F: Fn(&Self) + 'static>(
1116 &self,
1117 f: F,
1118 ) -> SignalHandlerId;
1119
1120 fn connect_property_type_hint_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
1121
1122 fn connect_property_urgency_hint_notify<F: Fn(&Self) + 'static>(&self, f: F)
1123 -> SignalHandlerId;
1124
1125 fn connect_property_window_position_notify<F: Fn(&Self) + 'static>(
1126 &self,
1127 f: F,
1128 ) -> SignalHandlerId;
1129}
1130
1131impl<O: IsA<Window>> GtkWindowExt for O {
1132 fn activate_default(&self) -> bool {
1133 unsafe {
1134 from_glib(gtk_sys::gtk_window_activate_default(
1135 self.as_ref().to_glib_none().0,
1136 ))
1137 }
1138 }
1139
1140 fn activate_focus(&self) -> bool {
1141 unsafe {
1142 from_glib(gtk_sys::gtk_window_activate_focus(
1143 self.as_ref().to_glib_none().0,
1144 ))
1145 }
1146 }
1147
1148 fn activate_key(&self, event: &gdk::EventKey) -> bool {
1149 unsafe {
1150 from_glib(gtk_sys::gtk_window_activate_key(
1151 self.as_ref().to_glib_none().0,
1152 mut_override(event.to_glib_none().0),
1153 ))
1154 }
1155 }
1156
1157 fn add_accel_group<P: IsA<AccelGroup>>(&self, accel_group: &P) {
1158 unsafe {
1159 gtk_sys::gtk_window_add_accel_group(
1160 self.as_ref().to_glib_none().0,
1161 accel_group.as_ref().to_glib_none().0,
1162 );
1163 }
1164 }
1165
1166 fn add_mnemonic<P: IsA<Widget>>(&self, keyval: u32, target: &P) {
1167 unsafe {
1168 gtk_sys::gtk_window_add_mnemonic(
1169 self.as_ref().to_glib_none().0,
1170 keyval,
1171 target.as_ref().to_glib_none().0,
1172 );
1173 }
1174 }
1175
1176 fn begin_move_drag(&self, button: i32, root_x: i32, root_y: i32, timestamp: u32) {
1177 unsafe {
1178 gtk_sys::gtk_window_begin_move_drag(
1179 self.as_ref().to_glib_none().0,
1180 button,
1181 root_x,
1182 root_y,
1183 timestamp,
1184 );
1185 }
1186 }
1187
1188 fn begin_resize_drag(
1189 &self,
1190 edge: gdk::WindowEdge,
1191 button: i32,
1192 root_x: i32,
1193 root_y: i32,
1194 timestamp: u32,
1195 ) {
1196 unsafe {
1197 gtk_sys::gtk_window_begin_resize_drag(
1198 self.as_ref().to_glib_none().0,
1199 edge.to_glib(),
1200 button,
1201 root_x,
1202 root_y,
1203 timestamp,
1204 );
1205 }
1206 }
1207
1208 fn close(&self) {
1209 unsafe {
1210 gtk_sys::gtk_window_close(self.as_ref().to_glib_none().0);
1211 }
1212 }
1213
1214 fn deiconify(&self) {
1215 unsafe {
1216 gtk_sys::gtk_window_deiconify(self.as_ref().to_glib_none().0);
1217 }
1218 }
1219
1220 fn fullscreen(&self) {
1221 unsafe {
1222 gtk_sys::gtk_window_fullscreen(self.as_ref().to_glib_none().0);
1223 }
1224 }
1225
1226 #[cfg(any(feature = "v3_18", feature = "dox"))]
1227 fn fullscreen_on_monitor(&self, screen: &gdk::Screen, monitor: i32) {
1228 unsafe {
1229 gtk_sys::gtk_window_fullscreen_on_monitor(
1230 self.as_ref().to_glib_none().0,
1231 screen.to_glib_none().0,
1232 monitor,
1233 );
1234 }
1235 }
1236
1237 fn get_accept_focus(&self) -> bool {
1238 unsafe {
1239 from_glib(gtk_sys::gtk_window_get_accept_focus(
1240 self.as_ref().to_glib_none().0,
1241 ))
1242 }
1243 }
1244
1245 fn get_application(&self) -> Option<Application> {
1246 unsafe {
1247 from_glib_none(gtk_sys::gtk_window_get_application(
1248 self.as_ref().to_glib_none().0,
1249 ))
1250 }
1251 }
1252
1253 fn get_attached_to(&self) -> Option<Widget> {
1254 unsafe {
1255 from_glib_none(gtk_sys::gtk_window_get_attached_to(
1256 self.as_ref().to_glib_none().0,
1257 ))
1258 }
1259 }
1260
1261 fn get_decorated(&self) -> bool {
1262 unsafe {
1263 from_glib(gtk_sys::gtk_window_get_decorated(
1264 self.as_ref().to_glib_none().0,
1265 ))
1266 }
1267 }
1268
1269 fn get_default_size(&self) -> (i32, i32) {
1270 unsafe {
1271 let mut width = mem::uninitialized();
1272 let mut height = mem::uninitialized();
1273 gtk_sys::gtk_window_get_default_size(
1274 self.as_ref().to_glib_none().0,
1275 &mut width,
1276 &mut height,
1277 );
1278 (width, height)
1279 }
1280 }
1281
1282 fn get_default_widget(&self) -> Option<Widget> {
1283 unsafe {
1284 from_glib_none(gtk_sys::gtk_window_get_default_widget(
1285 self.as_ref().to_glib_none().0,
1286 ))
1287 }
1288 }
1289
1290 fn get_deletable(&self) -> bool {
1291 unsafe {
1292 from_glib(gtk_sys::gtk_window_get_deletable(
1293 self.as_ref().to_glib_none().0,
1294 ))
1295 }
1296 }
1297
1298 fn get_destroy_with_parent(&self) -> bool {
1299 unsafe {
1300 from_glib(gtk_sys::gtk_window_get_destroy_with_parent(
1301 self.as_ref().to_glib_none().0,
1302 ))
1303 }
1304 }
1305
1306 fn get_focus(&self) -> Option<Widget> {
1307 unsafe {
1308 from_glib_none(gtk_sys::gtk_window_get_focus(
1309 self.as_ref().to_glib_none().0,
1310 ))
1311 }
1312 }
1313
1314 fn get_focus_on_map(&self) -> bool {
1315 unsafe {
1316 from_glib(gtk_sys::gtk_window_get_focus_on_map(
1317 self.as_ref().to_glib_none().0,
1318 ))
1319 }
1320 }
1321
1322 fn get_focus_visible(&self) -> bool {
1323 unsafe {
1324 from_glib(gtk_sys::gtk_window_get_focus_visible(
1325 self.as_ref().to_glib_none().0,
1326 ))
1327 }
1328 }
1329
1330 fn get_gravity(&self) -> gdk::Gravity {
1331 unsafe {
1332 from_glib(gtk_sys::gtk_window_get_gravity(
1333 self.as_ref().to_glib_none().0,
1334 ))
1335 }
1336 }
1337
1338 fn get_group(&self) -> Option<WindowGroup> {
1339 unsafe {
1340 from_glib_none(gtk_sys::gtk_window_get_group(
1341 self.as_ref().to_glib_none().0,
1342 ))
1343 }
1344 }
1345
1346 fn get_hide_titlebar_when_maximized(&self) -> bool {
1347 unsafe {
1348 from_glib(gtk_sys::gtk_window_get_hide_titlebar_when_maximized(
1349 self.as_ref().to_glib_none().0,
1350 ))
1351 }
1352 }
1353
1354 fn get_icon(&self) -> Option<gdk_pixbuf::Pixbuf> {
1355 unsafe { from_glib_none(gtk_sys::gtk_window_get_icon(self.as_ref().to_glib_none().0)) }
1356 }
1357
1358 fn get_icon_list(&self) -> Vec<gdk_pixbuf::Pixbuf> {
1359 unsafe {
1360 FromGlibPtrContainer::from_glib_container(gtk_sys::gtk_window_get_icon_list(
1361 self.as_ref().to_glib_none().0,
1362 ))
1363 }
1364 }
1365
1366 fn get_icon_name(&self) -> Option<GString> {
1367 unsafe {
1368 from_glib_none(gtk_sys::gtk_window_get_icon_name(
1369 self.as_ref().to_glib_none().0,
1370 ))
1371 }
1372 }
1373
1374 fn get_mnemonic_modifier(&self) -> gdk::ModifierType {
1375 unsafe {
1376 from_glib(gtk_sys::gtk_window_get_mnemonic_modifier(
1377 self.as_ref().to_glib_none().0,
1378 ))
1379 }
1380 }
1381
1382 fn get_mnemonics_visible(&self) -> bool {
1383 unsafe {
1384 from_glib(gtk_sys::gtk_window_get_mnemonics_visible(
1385 self.as_ref().to_glib_none().0,
1386 ))
1387 }
1388 }
1389
1390 fn get_modal(&self) -> bool {
1391 unsafe {
1392 from_glib(gtk_sys::gtk_window_get_modal(
1393 self.as_ref().to_glib_none().0,
1394 ))
1395 }
1396 }
1397
1398 fn get_position(&self) -> (i32, i32) {
1399 unsafe {
1400 let mut root_x = mem::uninitialized();
1401 let mut root_y = mem::uninitialized();
1402 gtk_sys::gtk_window_get_position(
1403 self.as_ref().to_glib_none().0,
1404 &mut root_x,
1405 &mut root_y,
1406 );
1407 (root_x, root_y)
1408 }
1409 }
1410
1411 fn get_resizable(&self) -> bool {
1412 unsafe {
1413 from_glib(gtk_sys::gtk_window_get_resizable(
1414 self.as_ref().to_glib_none().0,
1415 ))
1416 }
1417 }
1418
1419 fn get_role(&self) -> Option<GString> {
1420 unsafe { from_glib_none(gtk_sys::gtk_window_get_role(self.as_ref().to_glib_none().0)) }
1421 }
1422
1423 fn get_size(&self) -> (i32, i32) {
1424 unsafe {
1425 let mut width = mem::uninitialized();
1426 let mut height = mem::uninitialized();
1427 gtk_sys::gtk_window_get_size(self.as_ref().to_glib_none().0, &mut width, &mut height);
1428 (width, height)
1429 }
1430 }
1431
1432 fn get_skip_pager_hint(&self) -> bool {
1433 unsafe {
1434 from_glib(gtk_sys::gtk_window_get_skip_pager_hint(
1435 self.as_ref().to_glib_none().0,
1436 ))
1437 }
1438 }
1439
1440 fn get_skip_taskbar_hint(&self) -> bool {
1441 unsafe {
1442 from_glib(gtk_sys::gtk_window_get_skip_taskbar_hint(
1443 self.as_ref().to_glib_none().0,
1444 ))
1445 }
1446 }
1447
1448 fn get_title(&self) -> Option<GString> {
1449 unsafe {
1450 from_glib_none(gtk_sys::gtk_window_get_title(
1451 self.as_ref().to_glib_none().0,
1452 ))
1453 }
1454 }
1455
1456 #[cfg(any(feature = "v3_16", feature = "dox"))]
1457 fn get_titlebar(&self) -> Option<Widget> {
1458 unsafe {
1459 from_glib_none(gtk_sys::gtk_window_get_titlebar(
1460 self.as_ref().to_glib_none().0,
1461 ))
1462 }
1463 }
1464
1465 fn get_transient_for(&self) -> Option<Window> {
1466 unsafe {
1467 from_glib_none(gtk_sys::gtk_window_get_transient_for(
1468 self.as_ref().to_glib_none().0,
1469 ))
1470 }
1471 }
1472
1473 fn get_type_hint(&self) -> gdk::WindowTypeHint {
1474 unsafe {
1475 from_glib(gtk_sys::gtk_window_get_type_hint(
1476 self.as_ref().to_glib_none().0,
1477 ))
1478 }
1479 }
1480
1481 fn get_urgency_hint(&self) -> bool {
1482 unsafe {
1483 from_glib(gtk_sys::gtk_window_get_urgency_hint(
1484 self.as_ref().to_glib_none().0,
1485 ))
1486 }
1487 }
1488
1489 fn get_window_type(&self) -> WindowType {
1490 unsafe {
1491 from_glib(gtk_sys::gtk_window_get_window_type(
1492 self.as_ref().to_glib_none().0,
1493 ))
1494 }
1495 }
1496
1497 fn has_group(&self) -> bool {
1498 unsafe {
1499 from_glib(gtk_sys::gtk_window_has_group(
1500 self.as_ref().to_glib_none().0,
1501 ))
1502 }
1503 }
1504
1505 fn has_toplevel_focus(&self) -> bool {
1506 unsafe {
1507 from_glib(gtk_sys::gtk_window_has_toplevel_focus(
1508 self.as_ref().to_glib_none().0,
1509 ))
1510 }
1511 }
1512
1513 fn iconify(&self) {
1514 unsafe {
1515 gtk_sys::gtk_window_iconify(self.as_ref().to_glib_none().0);
1516 }
1517 }
1518
1519 fn is_active(&self) -> bool {
1520 unsafe {
1521 from_glib(gtk_sys::gtk_window_is_active(
1522 self.as_ref().to_glib_none().0,
1523 ))
1524 }
1525 }
1526
1527 fn is_maximized(&self) -> bool {
1528 unsafe {
1529 from_glib(gtk_sys::gtk_window_is_maximized(
1530 self.as_ref().to_glib_none().0,
1531 ))
1532 }
1533 }
1534
1535 fn maximize(&self) {
1536 unsafe {
1537 gtk_sys::gtk_window_maximize(self.as_ref().to_glib_none().0);
1538 }
1539 }
1540
1541 fn mnemonic_activate(&self, keyval: u32, modifier: gdk::ModifierType) -> bool {
1542 unsafe {
1543 from_glib(gtk_sys::gtk_window_mnemonic_activate(
1544 self.as_ref().to_glib_none().0,
1545 keyval,
1546 modifier.to_glib(),
1547 ))
1548 }
1549 }
1550
1551 fn move_(&self, x: i32, y: i32) {
1552 unsafe {
1553 gtk_sys::gtk_window_move(self.as_ref().to_glib_none().0, x, y);
1554 }
1555 }
1556
1557 fn parse_geometry(&self, geometry: &str) -> bool {
1558 unsafe {
1559 from_glib(gtk_sys::gtk_window_parse_geometry(
1560 self.as_ref().to_glib_none().0,
1561 geometry.to_glib_none().0,
1562 ))
1563 }
1564 }
1565
1566 fn present_with_time(&self, timestamp: u32) {
1567 unsafe {
1568 gtk_sys::gtk_window_present_with_time(self.as_ref().to_glib_none().0, timestamp);
1569 }
1570 }
1571
1572 fn propagate_key_event(&self, event: &gdk::EventKey) -> bool {
1573 unsafe {
1574 from_glib(gtk_sys::gtk_window_propagate_key_event(
1575 self.as_ref().to_glib_none().0,
1576 mut_override(event.to_glib_none().0),
1577 ))
1578 }
1579 }
1580
1581 fn remove_accel_group<P: IsA<AccelGroup>>(&self, accel_group: &P) {
1582 unsafe {
1583 gtk_sys::gtk_window_remove_accel_group(
1584 self.as_ref().to_glib_none().0,
1585 accel_group.as_ref().to_glib_none().0,
1586 );
1587 }
1588 }
1589
1590 fn remove_mnemonic<P: IsA<Widget>>(&self, keyval: u32, target: &P) {
1591 unsafe {
1592 gtk_sys::gtk_window_remove_mnemonic(
1593 self.as_ref().to_glib_none().0,
1594 keyval,
1595 target.as_ref().to_glib_none().0,
1596 );
1597 }
1598 }
1599
1600 fn resize(&self, width: i32, height: i32) {
1601 unsafe {
1602 gtk_sys::gtk_window_resize(self.as_ref().to_glib_none().0, width, height);
1603 }
1604 }
1605
1606 fn resize_to_geometry(&self, width: i32, height: i32) {
1607 unsafe {
1608 gtk_sys::gtk_window_resize_to_geometry(self.as_ref().to_glib_none().0, width, height);
1609 }
1610 }
1611
1612 fn set_accept_focus(&self, setting: bool) {
1613 unsafe {
1614 gtk_sys::gtk_window_set_accept_focus(self.as_ref().to_glib_none().0, setting.to_glib());
1615 }
1616 }
1617
1618 fn set_application<P: IsA<Application>>(&self, application: Option<&P>) {
1619 unsafe {
1620 gtk_sys::gtk_window_set_application(
1621 self.as_ref().to_glib_none().0,
1622 application.map(|p| p.as_ref()).to_glib_none().0,
1623 );
1624 }
1625 }
1626
1627 fn set_attached_to<P: IsA<Widget>>(&self, attach_widget: Option<&P>) {
1628 unsafe {
1629 gtk_sys::gtk_window_set_attached_to(
1630 self.as_ref().to_glib_none().0,
1631 attach_widget.map(|p| p.as_ref()).to_glib_none().0,
1632 );
1633 }
1634 }
1635
1636 fn set_decorated(&self, setting: bool) {
1637 unsafe {
1638 gtk_sys::gtk_window_set_decorated(self.as_ref().to_glib_none().0, setting.to_glib());
1639 }
1640 }
1641
1642 fn set_default<P: IsA<Widget>>(&self, default_widget: Option<&P>) {
1643 unsafe {
1644 gtk_sys::gtk_window_set_default(
1645 self.as_ref().to_glib_none().0,
1646 default_widget.map(|p| p.as_ref()).to_glib_none().0,
1647 );
1648 }
1649 }
1650
1651 fn set_default_geometry(&self, width: i32, height: i32) {
1652 unsafe {
1653 gtk_sys::gtk_window_set_default_geometry(self.as_ref().to_glib_none().0, width, height);
1654 }
1655 }
1656
1657 fn set_default_size(&self, width: i32, height: i32) {
1658 unsafe {
1659 gtk_sys::gtk_window_set_default_size(self.as_ref().to_glib_none().0, width, height);
1660 }
1661 }
1662
1663 fn set_deletable(&self, setting: bool) {
1664 unsafe {
1665 gtk_sys::gtk_window_set_deletable(self.as_ref().to_glib_none().0, setting.to_glib());
1666 }
1667 }
1668
1669 fn set_destroy_with_parent(&self, setting: bool) {
1670 unsafe {
1671 gtk_sys::gtk_window_set_destroy_with_parent(
1672 self.as_ref().to_glib_none().0,
1673 setting.to_glib(),
1674 );
1675 }
1676 }
1677
1678 fn set_focus<P: IsA<Widget>>(&self, focus: Option<&P>) {
1679 unsafe {
1680 gtk_sys::gtk_window_set_focus(
1681 self.as_ref().to_glib_none().0,
1682 focus.map(|p| p.as_ref()).to_glib_none().0,
1683 );
1684 }
1685 }
1686
1687 fn set_focus_on_map(&self, setting: bool) {
1688 unsafe {
1689 gtk_sys::gtk_window_set_focus_on_map(self.as_ref().to_glib_none().0, setting.to_glib());
1690 }
1691 }
1692
1693 fn set_focus_visible(&self, setting: bool) {
1694 unsafe {
1695 gtk_sys::gtk_window_set_focus_visible(
1696 self.as_ref().to_glib_none().0,
1697 setting.to_glib(),
1698 );
1699 }
1700 }
1701
1702 fn set_gravity(&self, gravity: gdk::Gravity) {
1707 unsafe {
1708 gtk_sys::gtk_window_set_gravity(self.as_ref().to_glib_none().0, gravity.to_glib());
1709 }
1710 }
1711
1712 fn set_has_user_ref_count(&self, setting: bool) {
1713 unsafe {
1714 gtk_sys::gtk_window_set_has_user_ref_count(
1715 self.as_ref().to_glib_none().0,
1716 setting.to_glib(),
1717 );
1718 }
1719 }
1720
1721 fn set_hide_titlebar_when_maximized(&self, setting: bool) {
1722 unsafe {
1723 gtk_sys::gtk_window_set_hide_titlebar_when_maximized(
1724 self.as_ref().to_glib_none().0,
1725 setting.to_glib(),
1726 );
1727 }
1728 }
1729
1730 fn set_icon(&self, icon: Option<&gdk_pixbuf::Pixbuf>) {
1731 unsafe {
1732 gtk_sys::gtk_window_set_icon(self.as_ref().to_glib_none().0, icon.to_glib_none().0);
1733 }
1734 }
1735
1736 fn set_icon_from_file<P: AsRef<std::path::Path>>(&self, filename: P) -> Result<(), Error> {
1737 unsafe {
1738 let mut error = ptr::null_mut();
1739 let _ = gtk_sys::gtk_window_set_icon_from_file(
1740 self.as_ref().to_glib_none().0,
1741 filename.as_ref().to_glib_none().0,
1742 &mut error,
1743 );
1744 if error.is_null() {
1745 Ok(())
1746 } else {
1747 Err(from_glib_full(error))
1748 }
1749 }
1750 }
1751
1752 fn set_icon_list(&self, list: &[gdk_pixbuf::Pixbuf]) {
1753 unsafe {
1754 gtk_sys::gtk_window_set_icon_list(
1755 self.as_ref().to_glib_none().0,
1756 list.to_glib_none().0,
1757 );
1758 }
1759 }
1760
1761 fn set_icon_name(&self, name: Option<&str>) {
1762 unsafe {
1763 gtk_sys::gtk_window_set_icon_name(
1764 self.as_ref().to_glib_none().0,
1765 name.to_glib_none().0,
1766 );
1767 }
1768 }
1769
1770 fn set_keep_above(&self, setting: bool) {
1771 unsafe {
1772 gtk_sys::gtk_window_set_keep_above(self.as_ref().to_glib_none().0, setting.to_glib());
1773 }
1774 }
1775
1776 fn set_keep_below(&self, setting: bool) {
1777 unsafe {
1778 gtk_sys::gtk_window_set_keep_below(self.as_ref().to_glib_none().0, setting.to_glib());
1779 }
1780 }
1781
1782 fn set_mnemonic_modifier(&self, modifier: gdk::ModifierType) {
1783 unsafe {
1784 gtk_sys::gtk_window_set_mnemonic_modifier(
1785 self.as_ref().to_glib_none().0,
1786 modifier.to_glib(),
1787 );
1788 }
1789 }
1790
1791 fn set_mnemonics_visible(&self, setting: bool) {
1792 unsafe {
1793 gtk_sys::gtk_window_set_mnemonics_visible(
1794 self.as_ref().to_glib_none().0,
1795 setting.to_glib(),
1796 );
1797 }
1798 }
1799
1800 fn set_modal(&self, modal: bool) {
1801 unsafe {
1802 gtk_sys::gtk_window_set_modal(self.as_ref().to_glib_none().0, modal.to_glib());
1803 }
1804 }
1805
1806 fn set_position(&self, position: WindowPosition) {
1807 unsafe {
1808 gtk_sys::gtk_window_set_position(self.as_ref().to_glib_none().0, position.to_glib());
1809 }
1810 }
1811
1812 fn set_resizable(&self, resizable: bool) {
1813 unsafe {
1814 gtk_sys::gtk_window_set_resizable(self.as_ref().to_glib_none().0, resizable.to_glib());
1815 }
1816 }
1817
1818 fn set_role(&self, role: &str) {
1819 unsafe {
1820 gtk_sys::gtk_window_set_role(self.as_ref().to_glib_none().0, role.to_glib_none().0);
1821 }
1822 }
1823
1824 fn set_screen(&self, screen: &gdk::Screen) {
1825 unsafe {
1826 gtk_sys::gtk_window_set_screen(self.as_ref().to_glib_none().0, screen.to_glib_none().0);
1827 }
1828 }
1829
1830 fn set_skip_pager_hint(&self, setting: bool) {
1831 unsafe {
1832 gtk_sys::gtk_window_set_skip_pager_hint(
1833 self.as_ref().to_glib_none().0,
1834 setting.to_glib(),
1835 );
1836 }
1837 }
1838
1839 fn set_skip_taskbar_hint(&self, setting: bool) {
1840 unsafe {
1841 gtk_sys::gtk_window_set_skip_taskbar_hint(
1842 self.as_ref().to_glib_none().0,
1843 setting.to_glib(),
1844 );
1845 }
1846 }
1847
1848 fn set_startup_id(&self, startup_id: &str) {
1849 unsafe {
1850 gtk_sys::gtk_window_set_startup_id(
1851 self.as_ref().to_glib_none().0,
1852 startup_id.to_glib_none().0,
1853 );
1854 }
1855 }
1856
1857 fn set_title(&self, title: &str) {
1858 unsafe {
1859 gtk_sys::gtk_window_set_title(self.as_ref().to_glib_none().0, title.to_glib_none().0);
1860 }
1861 }
1862
1863 fn set_titlebar<P: IsA<Widget>>(&self, titlebar: Option<&P>) {
1864 unsafe {
1865 gtk_sys::gtk_window_set_titlebar(
1866 self.as_ref().to_glib_none().0,
1867 titlebar.map(|p| p.as_ref()).to_glib_none().0,
1868 );
1869 }
1870 }
1871
1872 fn set_transient_for<P: IsA<Window>>(&self, parent: Option<&P>) {
1873 unsafe {
1874 gtk_sys::gtk_window_set_transient_for(
1875 self.as_ref().to_glib_none().0,
1876 parent.map(|p| p.as_ref()).to_glib_none().0,
1877 );
1878 }
1879 }
1880
1881 fn set_type_hint(&self, hint: gdk::WindowTypeHint) {
1882 unsafe {
1883 gtk_sys::gtk_window_set_type_hint(self.as_ref().to_glib_none().0, hint.to_glib());
1884 }
1885 }
1886
1887 fn set_urgency_hint(&self, setting: bool) {
1888 unsafe {
1889 gtk_sys::gtk_window_set_urgency_hint(self.as_ref().to_glib_none().0, setting.to_glib());
1890 }
1891 }
1892
1893 fn set_wmclass(&self, wmclass_name: &str, wmclass_class: &str) {
1894 unsafe {
1895 gtk_sys::gtk_window_set_wmclass(
1896 self.as_ref().to_glib_none().0,
1897 wmclass_name.to_glib_none().0,
1898 wmclass_class.to_glib_none().0,
1899 );
1900 }
1901 }
1902
1903 fn stick(&self) {
1904 unsafe {
1905 gtk_sys::gtk_window_stick(self.as_ref().to_glib_none().0);
1906 }
1907 }
1908
1909 fn unfullscreen(&self) {
1910 unsafe {
1911 gtk_sys::gtk_window_unfullscreen(self.as_ref().to_glib_none().0);
1912 }
1913 }
1914
1915 fn unmaximize(&self) {
1916 unsafe {
1917 gtk_sys::gtk_window_unmaximize(self.as_ref().to_glib_none().0);
1918 }
1919 }
1920
1921 fn unstick(&self) {
1922 unsafe {
1923 gtk_sys::gtk_window_unstick(self.as_ref().to_glib_none().0);
1924 }
1925 }
1926
1927 fn get_property_default_height(&self) -> i32 {
1928 unsafe {
1929 let mut value = Value::from_type(<i32 as StaticType>::static_type());
1930 gobject_sys::g_object_get_property(
1931 self.to_glib_none().0 as *mut gobject_sys::GObject,
1932 b"default-height\0".as_ptr() as *const _,
1933 value.to_glib_none_mut().0,
1934 );
1935 value.get().unwrap()
1936 }
1937 }
1938
1939 fn set_property_default_height(&self, default_height: i32) {
1940 unsafe {
1941 gobject_sys::g_object_set_property(
1942 self.to_glib_none().0 as *mut gobject_sys::GObject,
1943 b"default-height\0".as_ptr() as *const _,
1944 Value::from(&default_height).to_glib_none().0,
1945 );
1946 }
1947 }
1948
1949 fn get_property_default_width(&self) -> i32 {
1950 unsafe {
1951 let mut value = Value::from_type(<i32 as StaticType>::static_type());
1952 gobject_sys::g_object_get_property(
1953 self.to_glib_none().0 as *mut gobject_sys::GObject,
1954 b"default-width\0".as_ptr() as *const _,
1955 value.to_glib_none_mut().0,
1956 );
1957 value.get().unwrap()
1958 }
1959 }
1960
1961 fn set_property_default_width(&self, default_width: i32) {
1962 unsafe {
1963 gobject_sys::g_object_set_property(
1964 self.to_glib_none().0 as *mut gobject_sys::GObject,
1965 b"default-width\0".as_ptr() as *const _,
1966 Value::from(&default_width).to_glib_none().0,
1967 );
1968 }
1969 }
1970
1971 fn get_property_has_toplevel_focus(&self) -> bool {
1972 unsafe {
1973 let mut value = Value::from_type(<bool as StaticType>::static_type());
1974 gobject_sys::g_object_get_property(
1975 self.to_glib_none().0 as *mut gobject_sys::GObject,
1976 b"has-toplevel-focus\0".as_ptr() as *const _,
1977 value.to_glib_none_mut().0,
1978 );
1979 value.get().unwrap()
1980 }
1981 }
1982
1983 fn get_property_is_active(&self) -> bool {
1984 unsafe {
1985 let mut value = Value::from_type(<bool as StaticType>::static_type());
1986 gobject_sys::g_object_get_property(
1987 self.to_glib_none().0 as *mut gobject_sys::GObject,
1988 b"is-active\0".as_ptr() as *const _,
1989 value.to_glib_none_mut().0,
1990 );
1991 value.get().unwrap()
1992 }
1993 }
1994
1995 fn get_property_is_maximized(&self) -> bool {
1996 unsafe {
1997 let mut value = Value::from_type(<bool as StaticType>::static_type());
1998 gobject_sys::g_object_get_property(
1999 self.to_glib_none().0 as *mut gobject_sys::GObject,
2000 b"is-maximized\0".as_ptr() as *const _,
2001 value.to_glib_none_mut().0,
2002 );
2003 value.get().unwrap()
2004 }
2005 }
2006
2007 fn get_property_type(&self) -> WindowType {
2008 unsafe {
2009 let mut value = Value::from_type(<WindowType as StaticType>::static_type());
2010 gobject_sys::g_object_get_property(
2011 self.to_glib_none().0 as *mut gobject_sys::GObject,
2012 b"type\0".as_ptr() as *const _,
2013 value.to_glib_none_mut().0,
2014 );
2015 value.get().unwrap()
2016 }
2017 }
2018
2019 fn get_property_window_position(&self) -> WindowPosition {
2020 unsafe {
2021 let mut value = Value::from_type(<WindowPosition as StaticType>::static_type());
2022 gobject_sys::g_object_get_property(
2023 self.to_glib_none().0 as *mut gobject_sys::GObject,
2024 b"window-position\0".as_ptr() as *const _,
2025 value.to_glib_none_mut().0,
2026 );
2027 value.get().unwrap()
2028 }
2029 }
2030
2031 fn set_property_window_position(&self, window_position: WindowPosition) {
2032 unsafe {
2033 gobject_sys::g_object_set_property(
2034 self.to_glib_none().0 as *mut gobject_sys::GObject,
2035 b"window-position\0".as_ptr() as *const _,
2036 Value::from(&window_position).to_glib_none().0,
2037 );
2038 }
2039 }
2040
2041 fn connect_activate_default<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2042 unsafe extern "C" fn activate_default_trampoline<P, F: Fn(&P) + 'static>(
2043 this: *mut gtk_sys::GtkWindow,
2044 f: glib_sys::gpointer,
2045 ) where
2046 P: IsA<Window>,
2047 {
2048 let f: &F = &*(f as *const F);
2049 f(&Window::from_glib_borrow(this).unsafe_cast())
2050 }
2051 unsafe {
2052 let f: Box_<F> = Box_::new(f);
2053 connect_raw(
2054 self.as_ptr() as *mut _,
2055 b"activate-default\0".as_ptr() as *const _,
2056 Some(transmute(activate_default_trampoline::<Self, F> as usize)),
2057 Box_::into_raw(f),
2058 )
2059 }
2060 }
2061
2062 fn emit_activate_default(&self) {
2063 let _ = unsafe {
2064 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
2065 .emit("activate-default", &[])
2066 .unwrap()
2067 };
2068 }
2069
2070 fn connect_activate_focus<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2071 unsafe extern "C" fn activate_focus_trampoline<P, F: Fn(&P) + 'static>(
2072 this: *mut gtk_sys::GtkWindow,
2073 f: glib_sys::gpointer,
2074 ) where
2075 P: IsA<Window>,
2076 {
2077 let f: &F = &*(f as *const F);
2078 f(&Window::from_glib_borrow(this).unsafe_cast())
2079 }
2080 unsafe {
2081 let f: Box_<F> = Box_::new(f);
2082 connect_raw(
2083 self.as_ptr() as *mut _,
2084 b"activate-focus\0".as_ptr() as *const _,
2085 Some(transmute(activate_focus_trampoline::<Self, F> as usize)),
2086 Box_::into_raw(f),
2087 )
2088 }
2089 }
2090
2091 fn emit_activate_focus(&self) {
2092 let _ = unsafe {
2093 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
2094 .emit("activate-focus", &[])
2095 .unwrap()
2096 };
2097 }
2098
2099 fn connect_enable_debugging<F: Fn(&Self, bool) -> bool + 'static>(
2100 &self,
2101 f: F,
2102 ) -> SignalHandlerId {
2103 unsafe extern "C" fn enable_debugging_trampoline<P, F: Fn(&P, bool) -> bool + 'static>(
2104 this: *mut gtk_sys::GtkWindow,
2105 toggle: glib_sys::gboolean,
2106 f: glib_sys::gpointer,
2107 ) -> glib_sys::gboolean
2108 where
2109 P: IsA<Window>,
2110 {
2111 let f: &F = &*(f as *const F);
2112 f(
2113 &Window::from_glib_borrow(this).unsafe_cast(),
2114 from_glib(toggle),
2115 )
2116 .to_glib()
2117 }
2118 unsafe {
2119 let f: Box_<F> = Box_::new(f);
2120 connect_raw(
2121 self.as_ptr() as *mut _,
2122 b"enable-debugging\0".as_ptr() as *const _,
2123 Some(transmute(enable_debugging_trampoline::<Self, F> as usize)),
2124 Box_::into_raw(f),
2125 )
2126 }
2127 }
2128
2129 fn emit_enable_debugging(&self, toggle: bool) -> bool {
2130 let res = unsafe {
2131 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
2132 .emit("enable-debugging", &[&toggle])
2133 .unwrap()
2134 };
2135 res.unwrap().get().unwrap()
2136 }
2137
2138 fn connect_keys_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2139 unsafe extern "C" fn keys_changed_trampoline<P, F: Fn(&P) + 'static>(
2140 this: *mut gtk_sys::GtkWindow,
2141 f: glib_sys::gpointer,
2142 ) where
2143 P: IsA<Window>,
2144 {
2145 let f: &F = &*(f as *const F);
2146 f(&Window::from_glib_borrow(this).unsafe_cast())
2147 }
2148 unsafe {
2149 let f: Box_<F> = Box_::new(f);
2150 connect_raw(
2151 self.as_ptr() as *mut _,
2152 b"keys-changed\0".as_ptr() as *const _,
2153 Some(transmute(keys_changed_trampoline::<Self, F> as usize)),
2154 Box_::into_raw(f),
2155 )
2156 }
2157 }
2158
2159 fn connect_set_focus<F: Fn(&Self, &Widget) + 'static>(&self, f: F) -> SignalHandlerId {
2160 unsafe extern "C" fn set_focus_trampoline<P, F: Fn(&P, &Widget) + 'static>(
2161 this: *mut gtk_sys::GtkWindow,
2162 object: *mut gtk_sys::GtkWidget,
2163 f: glib_sys::gpointer,
2164 ) where
2165 P: IsA<Window>,
2166 {
2167 let f: &F = &*(f as *const F);
2168 f(
2169 &Window::from_glib_borrow(this).unsafe_cast(),
2170 &from_glib_borrow(object),
2171 )
2172 }
2173 unsafe {
2174 let f: Box_<F> = Box_::new(f);
2175 connect_raw(
2176 self.as_ptr() as *mut _,
2177 b"set-focus\0".as_ptr() as *const _,
2178 Some(transmute(set_focus_trampoline::<Self, F> as usize)),
2179 Box_::into_raw(f),
2180 )
2181 }
2182 }
2183
2184 fn connect_property_accept_focus_notify<F: Fn(&Self) + 'static>(
2185 &self,
2186 f: F,
2187 ) -> SignalHandlerId {
2188 unsafe extern "C" fn notify_accept_focus_trampoline<P, F: Fn(&P) + 'static>(
2189 this: *mut gtk_sys::GtkWindow,
2190 _param_spec: glib_sys::gpointer,
2191 f: glib_sys::gpointer,
2192 ) where
2193 P: IsA<Window>,
2194 {
2195 let f: &F = &*(f as *const F);
2196 f(&Window::from_glib_borrow(this).unsafe_cast())
2197 }
2198 unsafe {
2199 let f: Box_<F> = Box_::new(f);
2200 connect_raw(
2201 self.as_ptr() as *mut _,
2202 b"notify::accept-focus\0".as_ptr() as *const _,
2203 Some(transmute(
2204 notify_accept_focus_trampoline::<Self, F> as usize,
2205 )),
2206 Box_::into_raw(f),
2207 )
2208 }
2209 }
2210
2211 fn connect_property_application_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2212 unsafe extern "C" fn notify_application_trampoline<P, F: Fn(&P) + 'static>(
2213 this: *mut gtk_sys::GtkWindow,
2214 _param_spec: glib_sys::gpointer,
2215 f: glib_sys::gpointer,
2216 ) where
2217 P: IsA<Window>,
2218 {
2219 let f: &F = &*(f as *const F);
2220 f(&Window::from_glib_borrow(this).unsafe_cast())
2221 }
2222 unsafe {
2223 let f: Box_<F> = Box_::new(f);
2224 connect_raw(
2225 self.as_ptr() as *mut _,
2226 b"notify::application\0".as_ptr() as *const _,
2227 Some(transmute(notify_application_trampoline::<Self, F> as usize)),
2228 Box_::into_raw(f),
2229 )
2230 }
2231 }
2232
2233 fn connect_property_attached_to_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2234 unsafe extern "C" fn notify_attached_to_trampoline<P, F: Fn(&P) + 'static>(
2235 this: *mut gtk_sys::GtkWindow,
2236 _param_spec: glib_sys::gpointer,
2237 f: glib_sys::gpointer,
2238 ) where
2239 P: IsA<Window>,
2240 {
2241 let f: &F = &*(f as *const F);
2242 f(&Window::from_glib_borrow(this).unsafe_cast())
2243 }
2244 unsafe {
2245 let f: Box_<F> = Box_::new(f);
2246 connect_raw(
2247 self.as_ptr() as *mut _,
2248 b"notify::attached-to\0".as_ptr() as *const _,
2249 Some(transmute(notify_attached_to_trampoline::<Self, F> as usize)),
2250 Box_::into_raw(f),
2251 )
2252 }
2253 }
2254
2255 fn connect_property_decorated_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2256 unsafe extern "C" fn notify_decorated_trampoline<P, F: Fn(&P) + 'static>(
2257 this: *mut gtk_sys::GtkWindow,
2258 _param_spec: glib_sys::gpointer,
2259 f: glib_sys::gpointer,
2260 ) where
2261 P: IsA<Window>,
2262 {
2263 let f: &F = &*(f as *const F);
2264 f(&Window::from_glib_borrow(this).unsafe_cast())
2265 }
2266 unsafe {
2267 let f: Box_<F> = Box_::new(f);
2268 connect_raw(
2269 self.as_ptr() as *mut _,
2270 b"notify::decorated\0".as_ptr() as *const _,
2271 Some(transmute(notify_decorated_trampoline::<Self, F> as usize)),
2272 Box_::into_raw(f),
2273 )
2274 }
2275 }
2276
2277 fn connect_property_default_height_notify<F: Fn(&Self) + 'static>(
2278 &self,
2279 f: F,
2280 ) -> SignalHandlerId {
2281 unsafe extern "C" fn notify_default_height_trampoline<P, F: Fn(&P) + 'static>(
2282 this: *mut gtk_sys::GtkWindow,
2283 _param_spec: glib_sys::gpointer,
2284 f: glib_sys::gpointer,
2285 ) where
2286 P: IsA<Window>,
2287 {
2288 let f: &F = &*(f as *const F);
2289 f(&Window::from_glib_borrow(this).unsafe_cast())
2290 }
2291 unsafe {
2292 let f: Box_<F> = Box_::new(f);
2293 connect_raw(
2294 self.as_ptr() as *mut _,
2295 b"notify::default-height\0".as_ptr() as *const _,
2296 Some(transmute(
2297 notify_default_height_trampoline::<Self, F> as usize,
2298 )),
2299 Box_::into_raw(f),
2300 )
2301 }
2302 }
2303
2304 fn connect_property_default_width_notify<F: Fn(&Self) + 'static>(
2305 &self,
2306 f: F,
2307 ) -> SignalHandlerId {
2308 unsafe extern "C" fn notify_default_width_trampoline<P, F: Fn(&P) + 'static>(
2309 this: *mut gtk_sys::GtkWindow,
2310 _param_spec: glib_sys::gpointer,
2311 f: glib_sys::gpointer,
2312 ) where
2313 P: IsA<Window>,
2314 {
2315 let f: &F = &*(f as *const F);
2316 f(&Window::from_glib_borrow(this).unsafe_cast())
2317 }
2318 unsafe {
2319 let f: Box_<F> = Box_::new(f);
2320 connect_raw(
2321 self.as_ptr() as *mut _,
2322 b"notify::default-width\0".as_ptr() as *const _,
2323 Some(transmute(
2324 notify_default_width_trampoline::<Self, F> as usize,
2325 )),
2326 Box_::into_raw(f),
2327 )
2328 }
2329 }
2330
2331 fn connect_property_deletable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2332 unsafe extern "C" fn notify_deletable_trampoline<P, F: Fn(&P) + 'static>(
2333 this: *mut gtk_sys::GtkWindow,
2334 _param_spec: glib_sys::gpointer,
2335 f: glib_sys::gpointer,
2336 ) where
2337 P: IsA<Window>,
2338 {
2339 let f: &F = &*(f as *const F);
2340 f(&Window::from_glib_borrow(this).unsafe_cast())
2341 }
2342 unsafe {
2343 let f: Box_<F> = Box_::new(f);
2344 connect_raw(
2345 self.as_ptr() as *mut _,
2346 b"notify::deletable\0".as_ptr() as *const _,
2347 Some(transmute(notify_deletable_trampoline::<Self, F> as usize)),
2348 Box_::into_raw(f),
2349 )
2350 }
2351 }
2352
2353 fn connect_property_destroy_with_parent_notify<F: Fn(&Self) + 'static>(
2354 &self,
2355 f: F,
2356 ) -> SignalHandlerId {
2357 unsafe extern "C" fn notify_destroy_with_parent_trampoline<P, F: Fn(&P) + 'static>(
2358 this: *mut gtk_sys::GtkWindow,
2359 _param_spec: glib_sys::gpointer,
2360 f: glib_sys::gpointer,
2361 ) where
2362 P: IsA<Window>,
2363 {
2364 let f: &F = &*(f as *const F);
2365 f(&Window::from_glib_borrow(this).unsafe_cast())
2366 }
2367 unsafe {
2368 let f: Box_<F> = Box_::new(f);
2369 connect_raw(
2370 self.as_ptr() as *mut _,
2371 b"notify::destroy-with-parent\0".as_ptr() as *const _,
2372 Some(transmute(
2373 notify_destroy_with_parent_trampoline::<Self, F> as usize,
2374 )),
2375 Box_::into_raw(f),
2376 )
2377 }
2378 }
2379
2380 fn connect_property_focus_on_map_notify<F: Fn(&Self) + 'static>(
2381 &self,
2382 f: F,
2383 ) -> SignalHandlerId {
2384 unsafe extern "C" fn notify_focus_on_map_trampoline<P, F: Fn(&P) + 'static>(
2385 this: *mut gtk_sys::GtkWindow,
2386 _param_spec: glib_sys::gpointer,
2387 f: glib_sys::gpointer,
2388 ) where
2389 P: IsA<Window>,
2390 {
2391 let f: &F = &*(f as *const F);
2392 f(&Window::from_glib_borrow(this).unsafe_cast())
2393 }
2394 unsafe {
2395 let f: Box_<F> = Box_::new(f);
2396 connect_raw(
2397 self.as_ptr() as *mut _,
2398 b"notify::focus-on-map\0".as_ptr() as *const _,
2399 Some(transmute(
2400 notify_focus_on_map_trampoline::<Self, F> as usize,
2401 )),
2402 Box_::into_raw(f),
2403 )
2404 }
2405 }
2406
2407 fn connect_property_focus_visible_notify<F: Fn(&Self) + 'static>(
2408 &self,
2409 f: F,
2410 ) -> SignalHandlerId {
2411 unsafe extern "C" fn notify_focus_visible_trampoline<P, F: Fn(&P) + 'static>(
2412 this: *mut gtk_sys::GtkWindow,
2413 _param_spec: glib_sys::gpointer,
2414 f: glib_sys::gpointer,
2415 ) where
2416 P: IsA<Window>,
2417 {
2418 let f: &F = &*(f as *const F);
2419 f(&Window::from_glib_borrow(this).unsafe_cast())
2420 }
2421 unsafe {
2422 let f: Box_<F> = Box_::new(f);
2423 connect_raw(
2424 self.as_ptr() as *mut _,
2425 b"notify::focus-visible\0".as_ptr() as *const _,
2426 Some(transmute(
2427 notify_focus_visible_trampoline::<Self, F> as usize,
2428 )),
2429 Box_::into_raw(f),
2430 )
2431 }
2432 }
2433
2434 fn connect_property_gravity_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2435 unsafe extern "C" fn notify_gravity_trampoline<P, F: Fn(&P) + 'static>(
2436 this: *mut gtk_sys::GtkWindow,
2437 _param_spec: glib_sys::gpointer,
2438 f: glib_sys::gpointer,
2439 ) where
2440 P: IsA<Window>,
2441 {
2442 let f: &F = &*(f as *const F);
2443 f(&Window::from_glib_borrow(this).unsafe_cast())
2444 }
2445 unsafe {
2446 let f: Box_<F> = Box_::new(f);
2447 connect_raw(
2448 self.as_ptr() as *mut _,
2449 b"notify::gravity\0".as_ptr() as *const _,
2450 Some(transmute(notify_gravity_trampoline::<Self, F> as usize)),
2451 Box_::into_raw(f),
2452 )
2453 }
2454 }
2455
2456 fn connect_property_has_toplevel_focus_notify<F: Fn(&Self) + 'static>(
2457 &self,
2458 f: F,
2459 ) -> SignalHandlerId {
2460 unsafe extern "C" fn notify_has_toplevel_focus_trampoline<P, F: Fn(&P) + 'static>(
2461 this: *mut gtk_sys::GtkWindow,
2462 _param_spec: glib_sys::gpointer,
2463 f: glib_sys::gpointer,
2464 ) where
2465 P: IsA<Window>,
2466 {
2467 let f: &F = &*(f as *const F);
2468 f(&Window::from_glib_borrow(this).unsafe_cast())
2469 }
2470 unsafe {
2471 let f: Box_<F> = Box_::new(f);
2472 connect_raw(
2473 self.as_ptr() as *mut _,
2474 b"notify::has-toplevel-focus\0".as_ptr() as *const _,
2475 Some(transmute(
2476 notify_has_toplevel_focus_trampoline::<Self, F> as usize,
2477 )),
2478 Box_::into_raw(f),
2479 )
2480 }
2481 }
2482
2483 fn connect_property_hide_titlebar_when_maximized_notify<F: Fn(&Self) + 'static>(
2484 &self,
2485 f: F,
2486 ) -> SignalHandlerId {
2487 unsafe extern "C" fn notify_hide_titlebar_when_maximized_trampoline<
2488 P,
2489 F: Fn(&P) + 'static,
2490 >(
2491 this: *mut gtk_sys::GtkWindow,
2492 _param_spec: glib_sys::gpointer,
2493 f: glib_sys::gpointer,
2494 ) where
2495 P: IsA<Window>,
2496 {
2497 let f: &F = &*(f as *const F);
2498 f(&Window::from_glib_borrow(this).unsafe_cast())
2499 }
2500 unsafe {
2501 let f: Box_<F> = Box_::new(f);
2502 connect_raw(
2503 self.as_ptr() as *mut _,
2504 b"notify::hide-titlebar-when-maximized\0".as_ptr() as *const _,
2505 Some(transmute(
2506 notify_hide_titlebar_when_maximized_trampoline::<Self, F> as usize,
2507 )),
2508 Box_::into_raw(f),
2509 )
2510 }
2511 }
2512
2513 fn connect_property_icon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2514 unsafe extern "C" fn notify_icon_trampoline<P, F: Fn(&P) + 'static>(
2515 this: *mut gtk_sys::GtkWindow,
2516 _param_spec: glib_sys::gpointer,
2517 f: glib_sys::gpointer,
2518 ) where
2519 P: IsA<Window>,
2520 {
2521 let f: &F = &*(f as *const F);
2522 f(&Window::from_glib_borrow(this).unsafe_cast())
2523 }
2524 unsafe {
2525 let f: Box_<F> = Box_::new(f);
2526 connect_raw(
2527 self.as_ptr() as *mut _,
2528 b"notify::icon\0".as_ptr() as *const _,
2529 Some(transmute(notify_icon_trampoline::<Self, F> as usize)),
2530 Box_::into_raw(f),
2531 )
2532 }
2533 }
2534
2535 fn connect_property_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2536 unsafe extern "C" fn notify_icon_name_trampoline<P, F: Fn(&P) + 'static>(
2537 this: *mut gtk_sys::GtkWindow,
2538 _param_spec: glib_sys::gpointer,
2539 f: glib_sys::gpointer,
2540 ) where
2541 P: IsA<Window>,
2542 {
2543 let f: &F = &*(f as *const F);
2544 f(&Window::from_glib_borrow(this).unsafe_cast())
2545 }
2546 unsafe {
2547 let f: Box_<F> = Box_::new(f);
2548 connect_raw(
2549 self.as_ptr() as *mut _,
2550 b"notify::icon-name\0".as_ptr() as *const _,
2551 Some(transmute(notify_icon_name_trampoline::<Self, F> as usize)),
2552 Box_::into_raw(f),
2553 )
2554 }
2555 }
2556
2557 fn connect_property_is_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2558 unsafe extern "C" fn notify_is_active_trampoline<P, F: Fn(&P) + 'static>(
2559 this: *mut gtk_sys::GtkWindow,
2560 _param_spec: glib_sys::gpointer,
2561 f: glib_sys::gpointer,
2562 ) where
2563 P: IsA<Window>,
2564 {
2565 let f: &F = &*(f as *const F);
2566 f(&Window::from_glib_borrow(this).unsafe_cast())
2567 }
2568 unsafe {
2569 let f: Box_<F> = Box_::new(f);
2570 connect_raw(
2571 self.as_ptr() as *mut _,
2572 b"notify::is-active\0".as_ptr() as *const _,
2573 Some(transmute(notify_is_active_trampoline::<Self, F> as usize)),
2574 Box_::into_raw(f),
2575 )
2576 }
2577 }
2578
2579 fn connect_property_is_maximized_notify<F: Fn(&Self) + 'static>(
2580 &self,
2581 f: F,
2582 ) -> SignalHandlerId {
2583 unsafe extern "C" fn notify_is_maximized_trampoline<P, F: Fn(&P) + 'static>(
2584 this: *mut gtk_sys::GtkWindow,
2585 _param_spec: glib_sys::gpointer,
2586 f: glib_sys::gpointer,
2587 ) where
2588 P: IsA<Window>,
2589 {
2590 let f: &F = &*(f as *const F);
2591 f(&Window::from_glib_borrow(this).unsafe_cast())
2592 }
2593 unsafe {
2594 let f: Box_<F> = Box_::new(f);
2595 connect_raw(
2596 self.as_ptr() as *mut _,
2597 b"notify::is-maximized\0".as_ptr() as *const _,
2598 Some(transmute(
2599 notify_is_maximized_trampoline::<Self, F> as usize,
2600 )),
2601 Box_::into_raw(f),
2602 )
2603 }
2604 }
2605
2606 fn connect_property_mnemonics_visible_notify<F: Fn(&Self) + 'static>(
2607 &self,
2608 f: F,
2609 ) -> SignalHandlerId {
2610 unsafe extern "C" fn notify_mnemonics_visible_trampoline<P, F: Fn(&P) + 'static>(
2611 this: *mut gtk_sys::GtkWindow,
2612 _param_spec: glib_sys::gpointer,
2613 f: glib_sys::gpointer,
2614 ) where
2615 P: IsA<Window>,
2616 {
2617 let f: &F = &*(f as *const F);
2618 f(&Window::from_glib_borrow(this).unsafe_cast())
2619 }
2620 unsafe {
2621 let f: Box_<F> = Box_::new(f);
2622 connect_raw(
2623 self.as_ptr() as *mut _,
2624 b"notify::mnemonics-visible\0".as_ptr() as *const _,
2625 Some(transmute(
2626 notify_mnemonics_visible_trampoline::<Self, F> as usize,
2627 )),
2628 Box_::into_raw(f),
2629 )
2630 }
2631 }
2632
2633 fn connect_property_modal_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2634 unsafe extern "C" fn notify_modal_trampoline<P, F: Fn(&P) + 'static>(
2635 this: *mut gtk_sys::GtkWindow,
2636 _param_spec: glib_sys::gpointer,
2637 f: glib_sys::gpointer,
2638 ) where
2639 P: IsA<Window>,
2640 {
2641 let f: &F = &*(f as *const F);
2642 f(&Window::from_glib_borrow(this).unsafe_cast())
2643 }
2644 unsafe {
2645 let f: Box_<F> = Box_::new(f);
2646 connect_raw(
2647 self.as_ptr() as *mut _,
2648 b"notify::modal\0".as_ptr() as *const _,
2649 Some(transmute(notify_modal_trampoline::<Self, F> as usize)),
2650 Box_::into_raw(f),
2651 )
2652 }
2653 }
2654
2655 fn connect_property_resizable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2656 unsafe extern "C" fn notify_resizable_trampoline<P, F: Fn(&P) + 'static>(
2657 this: *mut gtk_sys::GtkWindow,
2658 _param_spec: glib_sys::gpointer,
2659 f: glib_sys::gpointer,
2660 ) where
2661 P: IsA<Window>,
2662 {
2663 let f: &F = &*(f as *const F);
2664 f(&Window::from_glib_borrow(this).unsafe_cast())
2665 }
2666 unsafe {
2667 let f: Box_<F> = Box_::new(f);
2668 connect_raw(
2669 self.as_ptr() as *mut _,
2670 b"notify::resizable\0".as_ptr() as *const _,
2671 Some(transmute(notify_resizable_trampoline::<Self, F> as usize)),
2672 Box_::into_raw(f),
2673 )
2674 }
2675 }
2676
2677 fn connect_property_role_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2678 unsafe extern "C" fn notify_role_trampoline<P, F: Fn(&P) + 'static>(
2679 this: *mut gtk_sys::GtkWindow,
2680 _param_spec: glib_sys::gpointer,
2681 f: glib_sys::gpointer,
2682 ) where
2683 P: IsA<Window>,
2684 {
2685 let f: &F = &*(f as *const F);
2686 f(&Window::from_glib_borrow(this).unsafe_cast())
2687 }
2688 unsafe {
2689 let f: Box_<F> = Box_::new(f);
2690 connect_raw(
2691 self.as_ptr() as *mut _,
2692 b"notify::role\0".as_ptr() as *const _,
2693 Some(transmute(notify_role_trampoline::<Self, F> as usize)),
2694 Box_::into_raw(f),
2695 )
2696 }
2697 }
2698
2699 fn connect_property_screen_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2700 unsafe extern "C" fn notify_screen_trampoline<P, F: Fn(&P) + 'static>(
2701 this: *mut gtk_sys::GtkWindow,
2702 _param_spec: glib_sys::gpointer,
2703 f: glib_sys::gpointer,
2704 ) where
2705 P: IsA<Window>,
2706 {
2707 let f: &F = &*(f as *const F);
2708 f(&Window::from_glib_borrow(this).unsafe_cast())
2709 }
2710 unsafe {
2711 let f: Box_<F> = Box_::new(f);
2712 connect_raw(
2713 self.as_ptr() as *mut _,
2714 b"notify::screen\0".as_ptr() as *const _,
2715 Some(transmute(notify_screen_trampoline::<Self, F> as usize)),
2716 Box_::into_raw(f),
2717 )
2718 }
2719 }
2720
2721 fn connect_property_skip_pager_hint_notify<F: Fn(&Self) + 'static>(
2722 &self,
2723 f: F,
2724 ) -> SignalHandlerId {
2725 unsafe extern "C" fn notify_skip_pager_hint_trampoline<P, F: Fn(&P) + 'static>(
2726 this: *mut gtk_sys::GtkWindow,
2727 _param_spec: glib_sys::gpointer,
2728 f: glib_sys::gpointer,
2729 ) where
2730 P: IsA<Window>,
2731 {
2732 let f: &F = &*(f as *const F);
2733 f(&Window::from_glib_borrow(this).unsafe_cast())
2734 }
2735 unsafe {
2736 let f: Box_<F> = Box_::new(f);
2737 connect_raw(
2738 self.as_ptr() as *mut _,
2739 b"notify::skip-pager-hint\0".as_ptr() as *const _,
2740 Some(transmute(
2741 notify_skip_pager_hint_trampoline::<Self, F> as usize,
2742 )),
2743 Box_::into_raw(f),
2744 )
2745 }
2746 }
2747
2748 fn connect_property_skip_taskbar_hint_notify<F: Fn(&Self) + 'static>(
2749 &self,
2750 f: F,
2751 ) -> SignalHandlerId {
2752 unsafe extern "C" fn notify_skip_taskbar_hint_trampoline<P, F: Fn(&P) + 'static>(
2753 this: *mut gtk_sys::GtkWindow,
2754 _param_spec: glib_sys::gpointer,
2755 f: glib_sys::gpointer,
2756 ) where
2757 P: IsA<Window>,
2758 {
2759 let f: &F = &*(f as *const F);
2760 f(&Window::from_glib_borrow(this).unsafe_cast())
2761 }
2762 unsafe {
2763 let f: Box_<F> = Box_::new(f);
2764 connect_raw(
2765 self.as_ptr() as *mut _,
2766 b"notify::skip-taskbar-hint\0".as_ptr() as *const _,
2767 Some(transmute(
2768 notify_skip_taskbar_hint_trampoline::<Self, F> as usize,
2769 )),
2770 Box_::into_raw(f),
2771 )
2772 }
2773 }
2774
2775 fn connect_property_startup_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2776 unsafe extern "C" fn notify_startup_id_trampoline<P, F: Fn(&P) + 'static>(
2777 this: *mut gtk_sys::GtkWindow,
2778 _param_spec: glib_sys::gpointer,
2779 f: glib_sys::gpointer,
2780 ) where
2781 P: IsA<Window>,
2782 {
2783 let f: &F = &*(f as *const F);
2784 f(&Window::from_glib_borrow(this).unsafe_cast())
2785 }
2786 unsafe {
2787 let f: Box_<F> = Box_::new(f);
2788 connect_raw(
2789 self.as_ptr() as *mut _,
2790 b"notify::startup-id\0".as_ptr() as *const _,
2791 Some(transmute(notify_startup_id_trampoline::<Self, F> as usize)),
2792 Box_::into_raw(f),
2793 )
2794 }
2795 }
2796
2797 fn connect_property_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2798 unsafe extern "C" fn notify_title_trampoline<P, F: Fn(&P) + 'static>(
2799 this: *mut gtk_sys::GtkWindow,
2800 _param_spec: glib_sys::gpointer,
2801 f: glib_sys::gpointer,
2802 ) where
2803 P: IsA<Window>,
2804 {
2805 let f: &F = &*(f as *const F);
2806 f(&Window::from_glib_borrow(this).unsafe_cast())
2807 }
2808 unsafe {
2809 let f: Box_<F> = Box_::new(f);
2810 connect_raw(
2811 self.as_ptr() as *mut _,
2812 b"notify::title\0".as_ptr() as *const _,
2813 Some(transmute(notify_title_trampoline::<Self, F> as usize)),
2814 Box_::into_raw(f),
2815 )
2816 }
2817 }
2818
2819 fn connect_property_transient_for_notify<F: Fn(&Self) + 'static>(
2820 &self,
2821 f: F,
2822 ) -> SignalHandlerId {
2823 unsafe extern "C" fn notify_transient_for_trampoline<P, F: Fn(&P) + 'static>(
2824 this: *mut gtk_sys::GtkWindow,
2825 _param_spec: glib_sys::gpointer,
2826 f: glib_sys::gpointer,
2827 ) where
2828 P: IsA<Window>,
2829 {
2830 let f: &F = &*(f as *const F);
2831 f(&Window::from_glib_borrow(this).unsafe_cast())
2832 }
2833 unsafe {
2834 let f: Box_<F> = Box_::new(f);
2835 connect_raw(
2836 self.as_ptr() as *mut _,
2837 b"notify::transient-for\0".as_ptr() as *const _,
2838 Some(transmute(
2839 notify_transient_for_trampoline::<Self, F> as usize,
2840 )),
2841 Box_::into_raw(f),
2842 )
2843 }
2844 }
2845
2846 fn connect_property_type_hint_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2847 unsafe extern "C" fn notify_type_hint_trampoline<P, F: Fn(&P) + 'static>(
2848 this: *mut gtk_sys::GtkWindow,
2849 _param_spec: glib_sys::gpointer,
2850 f: glib_sys::gpointer,
2851 ) where
2852 P: IsA<Window>,
2853 {
2854 let f: &F = &*(f as *const F);
2855 f(&Window::from_glib_borrow(this).unsafe_cast())
2856 }
2857 unsafe {
2858 let f: Box_<F> = Box_::new(f);
2859 connect_raw(
2860 self.as_ptr() as *mut _,
2861 b"notify::type-hint\0".as_ptr() as *const _,
2862 Some(transmute(notify_type_hint_trampoline::<Self, F> as usize)),
2863 Box_::into_raw(f),
2864 )
2865 }
2866 }
2867
2868 fn connect_property_urgency_hint_notify<F: Fn(&Self) + 'static>(
2869 &self,
2870 f: F,
2871 ) -> SignalHandlerId {
2872 unsafe extern "C" fn notify_urgency_hint_trampoline<P, F: Fn(&P) + 'static>(
2873 this: *mut gtk_sys::GtkWindow,
2874 _param_spec: glib_sys::gpointer,
2875 f: glib_sys::gpointer,
2876 ) where
2877 P: IsA<Window>,
2878 {
2879 let f: &F = &*(f as *const F);
2880 f(&Window::from_glib_borrow(this).unsafe_cast())
2881 }
2882 unsafe {
2883 let f: Box_<F> = Box_::new(f);
2884 connect_raw(
2885 self.as_ptr() as *mut _,
2886 b"notify::urgency-hint\0".as_ptr() as *const _,
2887 Some(transmute(
2888 notify_urgency_hint_trampoline::<Self, F> as usize,
2889 )),
2890 Box_::into_raw(f),
2891 )
2892 }
2893 }
2894
2895 fn connect_property_window_position_notify<F: Fn(&Self) + 'static>(
2896 &self,
2897 f: F,
2898 ) -> SignalHandlerId {
2899 unsafe extern "C" fn notify_window_position_trampoline<P, F: Fn(&P) + 'static>(
2900 this: *mut gtk_sys::GtkWindow,
2901 _param_spec: glib_sys::gpointer,
2902 f: glib_sys::gpointer,
2903 ) where
2904 P: IsA<Window>,
2905 {
2906 let f: &F = &*(f as *const F);
2907 f(&Window::from_glib_borrow(this).unsafe_cast())
2908 }
2909 unsafe {
2910 let f: Box_<F> = Box_::new(f);
2911 connect_raw(
2912 self.as_ptr() as *mut _,
2913 b"notify::window-position\0".as_ptr() as *const _,
2914 Some(transmute(
2915 notify_window_position_trampoline::<Self, F> as usize,
2916 )),
2917 Box_::into_raw(f),
2918 )
2919 }
2920 }
2921}
2922
2923impl fmt::Display for Window {
2924 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2925 write!(f, "Window")
2926 }
2927}