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