1 // This file was generated by gir (https://github.com/gtk-rs/gir) 2 // from 3 // from gir-files (https://github.com/gtk-rs/gir-files.git) 4 // DO NOT EDIT 5 6 use crate::LeafletTransitionType; 7 use crate::NavigationDirection; 8 use crate::Swipeable; 9 use glib::object::Cast; 10 use glib::object::IsA; 11 use glib::signal::connect_raw; 12 use glib::signal::SignalHandlerId; 13 use glib::translate::*; 14 use glib::StaticType; 15 use glib::ToValue; 16 use std::boxed::Box as Box_; 17 use std::fmt; 18 use std::mem::transmute; 19 20 glib::wrapper! { 21 #[doc(alias = "HdyLeaflet")] 22 pub struct Leaflet(Object<ffi::HdyLeaflet, ffi::HdyLeafletClass>) @extends gtk::Container, gtk::Widget, @implements gtk::Buildable, gtk::Orientable, Swipeable; 23 24 match fn { 25 type_ => || ffi::hdy_leaflet_get_type(), 26 } 27 } 28 29 impl Leaflet { 30 #[doc(alias = "hdy_leaflet_new")] new() -> Leaflet31 pub fn new() -> Leaflet { 32 assert_initialized_main_thread!(); 33 unsafe { gtk::Widget::from_glib_none(ffi::hdy_leaflet_new()).unsafe_cast() } 34 } 35 36 // rustdoc-stripper-ignore-next 37 /// Creates a new builder-pattern struct instance to construct [`Leaflet`] objects. 38 /// 39 /// This method returns an instance of [`LeafletBuilder`] which can be used to create [`Leaflet`] objects. builder() -> LeafletBuilder40 pub fn builder() -> LeafletBuilder { 41 LeafletBuilder::default() 42 } 43 } 44 45 impl Default for Leaflet { default() -> Self46 fn default() -> Self { 47 Self::new() 48 } 49 } 50 51 #[derive(Clone, Default)] 52 // rustdoc-stripper-ignore-next 53 /// A [builder-pattern] type to construct [`Leaflet`] objects. 54 /// 55 /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html 56 pub struct LeafletBuilder { 57 can_swipe_back: Option<bool>, 58 can_swipe_forward: Option<bool>, 59 child_transition_duration: Option<u32>, 60 hhomogeneous_folded: Option<bool>, 61 hhomogeneous_unfolded: Option<bool>, 62 interpolate_size: Option<bool>, 63 mode_transition_duration: Option<u32>, 64 transition_type: Option<LeafletTransitionType>, 65 vhomogeneous_folded: Option<bool>, 66 vhomogeneous_unfolded: Option<bool>, 67 visible_child: Option<gtk::Widget>, 68 visible_child_name: Option<String>, 69 border_width: Option<u32>, 70 child: Option<gtk::Widget>, 71 resize_mode: Option<gtk::ResizeMode>, 72 app_paintable: Option<bool>, 73 can_default: Option<bool>, 74 can_focus: Option<bool>, 75 double_buffered: Option<bool>, 76 events: Option<gdk::EventMask>, 77 expand: Option<bool>, 78 focus_on_click: Option<bool>, 79 halign: Option<gtk::Align>, 80 has_default: Option<bool>, 81 has_focus: Option<bool>, 82 has_tooltip: Option<bool>, 83 height_request: Option<i32>, 84 hexpand: Option<bool>, 85 hexpand_set: Option<bool>, 86 is_focus: Option<bool>, 87 margin: Option<i32>, 88 margin_bottom: Option<i32>, 89 margin_end: Option<i32>, 90 margin_left: Option<i32>, 91 margin_right: Option<i32>, 92 margin_start: Option<i32>, 93 margin_top: Option<i32>, 94 name: Option<String>, 95 no_show_all: Option<bool>, 96 opacity: Option<f64>, 97 parent: Option<gtk::Container>, 98 receives_default: Option<bool>, 99 sensitive: Option<bool>, 100 //style: /*Unknown type*/, 101 tooltip_markup: Option<String>, 102 tooltip_text: Option<String>, 103 valign: Option<gtk::Align>, 104 vexpand: Option<bool>, 105 vexpand_set: Option<bool>, 106 visible: Option<bool>, 107 width_request: Option<i32>, 108 orientation: Option<gtk::Orientation>, 109 } 110 111 impl LeafletBuilder { 112 // rustdoc-stripper-ignore-next 113 /// Create a new [`LeafletBuilder`]. new() -> Self114 pub fn new() -> Self { 115 Self::default() 116 } 117 118 // rustdoc-stripper-ignore-next 119 /// Build the [`Leaflet`]. build(self) -> Leaflet120 pub fn build(self) -> Leaflet { 121 let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; 122 if let Some(ref can_swipe_back) = self.can_swipe_back { 123 properties.push(("can-swipe-back", can_swipe_back)); 124 } 125 if let Some(ref can_swipe_forward) = self.can_swipe_forward { 126 properties.push(("can-swipe-forward", can_swipe_forward)); 127 } 128 if let Some(ref child_transition_duration) = self.child_transition_duration { 129 properties.push(("child-transition-duration", child_transition_duration)); 130 } 131 if let Some(ref hhomogeneous_folded) = self.hhomogeneous_folded { 132 properties.push(("hhomogeneous-folded", hhomogeneous_folded)); 133 } 134 if let Some(ref hhomogeneous_unfolded) = self.hhomogeneous_unfolded { 135 properties.push(("hhomogeneous-unfolded", hhomogeneous_unfolded)); 136 } 137 if let Some(ref interpolate_size) = self.interpolate_size { 138 properties.push(("interpolate-size", interpolate_size)); 139 } 140 if let Some(ref mode_transition_duration) = self.mode_transition_duration { 141 properties.push(("mode-transition-duration", mode_transition_duration)); 142 } 143 if let Some(ref transition_type) = self.transition_type { 144 properties.push(("transition-type", transition_type)); 145 } 146 if let Some(ref vhomogeneous_folded) = self.vhomogeneous_folded { 147 properties.push(("vhomogeneous-folded", vhomogeneous_folded)); 148 } 149 if let Some(ref vhomogeneous_unfolded) = self.vhomogeneous_unfolded { 150 properties.push(("vhomogeneous-unfolded", vhomogeneous_unfolded)); 151 } 152 if let Some(ref visible_child) = self.visible_child { 153 properties.push(("visible-child", visible_child)); 154 } 155 if let Some(ref visible_child_name) = self.visible_child_name { 156 properties.push(("visible-child-name", visible_child_name)); 157 } 158 if let Some(ref border_width) = self.border_width { 159 properties.push(("border-width", border_width)); 160 } 161 if let Some(ref child) = self.child { 162 properties.push(("child", child)); 163 } 164 if let Some(ref resize_mode) = self.resize_mode { 165 properties.push(("resize-mode", resize_mode)); 166 } 167 if let Some(ref app_paintable) = self.app_paintable { 168 properties.push(("app-paintable", app_paintable)); 169 } 170 if let Some(ref can_default) = self.can_default { 171 properties.push(("can-default", can_default)); 172 } 173 if let Some(ref can_focus) = self.can_focus { 174 properties.push(("can-focus", can_focus)); 175 } 176 if let Some(ref double_buffered) = self.double_buffered { 177 properties.push(("double-buffered", double_buffered)); 178 } 179 if let Some(ref events) = self.events { 180 properties.push(("events", events)); 181 } 182 if let Some(ref expand) = self.expand { 183 properties.push(("expand", expand)); 184 } 185 if let Some(ref focus_on_click) = self.focus_on_click { 186 properties.push(("focus-on-click", focus_on_click)); 187 } 188 if let Some(ref halign) = self.halign { 189 properties.push(("halign", halign)); 190 } 191 if let Some(ref has_default) = self.has_default { 192 properties.push(("has-default", has_default)); 193 } 194 if let Some(ref has_focus) = self.has_focus { 195 properties.push(("has-focus", has_focus)); 196 } 197 if let Some(ref has_tooltip) = self.has_tooltip { 198 properties.push(("has-tooltip", has_tooltip)); 199 } 200 if let Some(ref height_request) = self.height_request { 201 properties.push(("height-request", height_request)); 202 } 203 if let Some(ref hexpand) = self.hexpand { 204 properties.push(("hexpand", hexpand)); 205 } 206 if let Some(ref hexpand_set) = self.hexpand_set { 207 properties.push(("hexpand-set", hexpand_set)); 208 } 209 if let Some(ref is_focus) = self.is_focus { 210 properties.push(("is-focus", is_focus)); 211 } 212 if let Some(ref margin) = self.margin { 213 properties.push(("margin", margin)); 214 } 215 if let Some(ref margin_bottom) = self.margin_bottom { 216 properties.push(("margin-bottom", margin_bottom)); 217 } 218 if let Some(ref margin_end) = self.margin_end { 219 properties.push(("margin-end", margin_end)); 220 } 221 if let Some(ref margin_left) = self.margin_left { 222 properties.push(("margin-left", margin_left)); 223 } 224 if let Some(ref margin_right) = self.margin_right { 225 properties.push(("margin-right", margin_right)); 226 } 227 if let Some(ref margin_start) = self.margin_start { 228 properties.push(("margin-start", margin_start)); 229 } 230 if let Some(ref margin_top) = self.margin_top { 231 properties.push(("margin-top", margin_top)); 232 } 233 if let Some(ref name) = self.name { 234 properties.push(("name", name)); 235 } 236 if let Some(ref no_show_all) = self.no_show_all { 237 properties.push(("no-show-all", no_show_all)); 238 } 239 if let Some(ref opacity) = self.opacity { 240 properties.push(("opacity", opacity)); 241 } 242 if let Some(ref parent) = self.parent { 243 properties.push(("parent", parent)); 244 } 245 if let Some(ref receives_default) = self.receives_default { 246 properties.push(("receives-default", receives_default)); 247 } 248 if let Some(ref sensitive) = self.sensitive { 249 properties.push(("sensitive", sensitive)); 250 } 251 if let Some(ref tooltip_markup) = self.tooltip_markup { 252 properties.push(("tooltip-markup", tooltip_markup)); 253 } 254 if let Some(ref tooltip_text) = self.tooltip_text { 255 properties.push(("tooltip-text", tooltip_text)); 256 } 257 if let Some(ref valign) = self.valign { 258 properties.push(("valign", valign)); 259 } 260 if let Some(ref vexpand) = self.vexpand { 261 properties.push(("vexpand", vexpand)); 262 } 263 if let Some(ref vexpand_set) = self.vexpand_set { 264 properties.push(("vexpand-set", vexpand_set)); 265 } 266 if let Some(ref visible) = self.visible { 267 properties.push(("visible", visible)); 268 } 269 if let Some(ref width_request) = self.width_request { 270 properties.push(("width-request", width_request)); 271 } 272 if let Some(ref orientation) = self.orientation { 273 properties.push(("orientation", orientation)); 274 } 275 glib::Object::new::<Leaflet>(&properties).expect("Failed to create an instance of Leaflet") 276 } 277 can_swipe_back(mut self, can_swipe_back: bool) -> Self278 pub fn can_swipe_back(mut self, can_swipe_back: bool) -> Self { 279 self.can_swipe_back = Some(can_swipe_back); 280 self 281 } 282 can_swipe_forward(mut self, can_swipe_forward: bool) -> Self283 pub fn can_swipe_forward(mut self, can_swipe_forward: bool) -> Self { 284 self.can_swipe_forward = Some(can_swipe_forward); 285 self 286 } 287 child_transition_duration(mut self, child_transition_duration: u32) -> Self288 pub fn child_transition_duration(mut self, child_transition_duration: u32) -> Self { 289 self.child_transition_duration = Some(child_transition_duration); 290 self 291 } 292 hhomogeneous_folded(mut self, hhomogeneous_folded: bool) -> Self293 pub fn hhomogeneous_folded(mut self, hhomogeneous_folded: bool) -> Self { 294 self.hhomogeneous_folded = Some(hhomogeneous_folded); 295 self 296 } 297 hhomogeneous_unfolded(mut self, hhomogeneous_unfolded: bool) -> Self298 pub fn hhomogeneous_unfolded(mut self, hhomogeneous_unfolded: bool) -> Self { 299 self.hhomogeneous_unfolded = Some(hhomogeneous_unfolded); 300 self 301 } 302 interpolate_size(mut self, interpolate_size: bool) -> Self303 pub fn interpolate_size(mut self, interpolate_size: bool) -> Self { 304 self.interpolate_size = Some(interpolate_size); 305 self 306 } 307 mode_transition_duration(mut self, mode_transition_duration: u32) -> Self308 pub fn mode_transition_duration(mut self, mode_transition_duration: u32) -> Self { 309 self.mode_transition_duration = Some(mode_transition_duration); 310 self 311 } 312 transition_type(mut self, transition_type: LeafletTransitionType) -> Self313 pub fn transition_type(mut self, transition_type: LeafletTransitionType) -> Self { 314 self.transition_type = Some(transition_type); 315 self 316 } 317 vhomogeneous_folded(mut self, vhomogeneous_folded: bool) -> Self318 pub fn vhomogeneous_folded(mut self, vhomogeneous_folded: bool) -> Self { 319 self.vhomogeneous_folded = Some(vhomogeneous_folded); 320 self 321 } 322 vhomogeneous_unfolded(mut self, vhomogeneous_unfolded: bool) -> Self323 pub fn vhomogeneous_unfolded(mut self, vhomogeneous_unfolded: bool) -> Self { 324 self.vhomogeneous_unfolded = Some(vhomogeneous_unfolded); 325 self 326 } 327 visible_child<P: IsA<gtk::Widget>>(mut self, visible_child: &P) -> Self328 pub fn visible_child<P: IsA<gtk::Widget>>(mut self, visible_child: &P) -> Self { 329 self.visible_child = Some(visible_child.clone().upcast()); 330 self 331 } 332 visible_child_name(mut self, visible_child_name: &str) -> Self333 pub fn visible_child_name(mut self, visible_child_name: &str) -> Self { 334 self.visible_child_name = Some(visible_child_name.to_string()); 335 self 336 } 337 border_width(mut self, border_width: u32) -> Self338 pub fn border_width(mut self, border_width: u32) -> Self { 339 self.border_width = Some(border_width); 340 self 341 } 342 child<P: IsA<gtk::Widget>>(mut self, child: &P) -> Self343 pub fn child<P: IsA<gtk::Widget>>(mut self, child: &P) -> Self { 344 self.child = Some(child.clone().upcast()); 345 self 346 } 347 resize_mode(mut self, resize_mode: gtk::ResizeMode) -> Self348 pub fn resize_mode(mut self, resize_mode: gtk::ResizeMode) -> Self { 349 self.resize_mode = Some(resize_mode); 350 self 351 } 352 app_paintable(mut self, app_paintable: bool) -> Self353 pub fn app_paintable(mut self, app_paintable: bool) -> Self { 354 self.app_paintable = Some(app_paintable); 355 self 356 } 357 can_default(mut self, can_default: bool) -> Self358 pub fn can_default(mut self, can_default: bool) -> Self { 359 self.can_default = Some(can_default); 360 self 361 } 362 can_focus(mut self, can_focus: bool) -> Self363 pub fn can_focus(mut self, can_focus: bool) -> Self { 364 self.can_focus = Some(can_focus); 365 self 366 } 367 double_buffered(mut self, double_buffered: bool) -> Self368 pub fn double_buffered(mut self, double_buffered: bool) -> Self { 369 self.double_buffered = Some(double_buffered); 370 self 371 } 372 events(mut self, events: gdk::EventMask) -> Self373 pub fn events(mut self, events: gdk::EventMask) -> Self { 374 self.events = Some(events); 375 self 376 } 377 expand(mut self, expand: bool) -> Self378 pub fn expand(mut self, expand: bool) -> Self { 379 self.expand = Some(expand); 380 self 381 } 382 focus_on_click(mut self, focus_on_click: bool) -> Self383 pub fn focus_on_click(mut self, focus_on_click: bool) -> Self { 384 self.focus_on_click = Some(focus_on_click); 385 self 386 } 387 halign(mut self, halign: gtk::Align) -> Self388 pub fn halign(mut self, halign: gtk::Align) -> Self { 389 self.halign = Some(halign); 390 self 391 } 392 has_default(mut self, has_default: bool) -> Self393 pub fn has_default(mut self, has_default: bool) -> Self { 394 self.has_default = Some(has_default); 395 self 396 } 397 has_focus(mut self, has_focus: bool) -> Self398 pub fn has_focus(mut self, has_focus: bool) -> Self { 399 self.has_focus = Some(has_focus); 400 self 401 } 402 has_tooltip(mut self, has_tooltip: bool) -> Self403 pub fn has_tooltip(mut self, has_tooltip: bool) -> Self { 404 self.has_tooltip = Some(has_tooltip); 405 self 406 } 407 height_request(mut self, height_request: i32) -> Self408 pub fn height_request(mut self, height_request: i32) -> Self { 409 self.height_request = Some(height_request); 410 self 411 } 412 hexpand(mut self, hexpand: bool) -> Self413 pub fn hexpand(mut self, hexpand: bool) -> Self { 414 self.hexpand = Some(hexpand); 415 self 416 } 417 hexpand_set(mut self, hexpand_set: bool) -> Self418 pub fn hexpand_set(mut self, hexpand_set: bool) -> Self { 419 self.hexpand_set = Some(hexpand_set); 420 self 421 } 422 is_focus(mut self, is_focus: bool) -> Self423 pub fn is_focus(mut self, is_focus: bool) -> Self { 424 self.is_focus = Some(is_focus); 425 self 426 } 427 margin(mut self, margin: i32) -> Self428 pub fn margin(mut self, margin: i32) -> Self { 429 self.margin = Some(margin); 430 self 431 } 432 margin_bottom(mut self, margin_bottom: i32) -> Self433 pub fn margin_bottom(mut self, margin_bottom: i32) -> Self { 434 self.margin_bottom = Some(margin_bottom); 435 self 436 } 437 margin_end(mut self, margin_end: i32) -> Self438 pub fn margin_end(mut self, margin_end: i32) -> Self { 439 self.margin_end = Some(margin_end); 440 self 441 } 442 margin_left(mut self, margin_left: i32) -> Self443 pub fn margin_left(mut self, margin_left: i32) -> Self { 444 self.margin_left = Some(margin_left); 445 self 446 } 447 margin_right(mut self, margin_right: i32) -> Self448 pub fn margin_right(mut self, margin_right: i32) -> Self { 449 self.margin_right = Some(margin_right); 450 self 451 } 452 margin_start(mut self, margin_start: i32) -> Self453 pub fn margin_start(mut self, margin_start: i32) -> Self { 454 self.margin_start = Some(margin_start); 455 self 456 } 457 margin_top(mut self, margin_top: i32) -> Self458 pub fn margin_top(mut self, margin_top: i32) -> Self { 459 self.margin_top = Some(margin_top); 460 self 461 } 462 name(mut self, name: &str) -> Self463 pub fn name(mut self, name: &str) -> Self { 464 self.name = Some(name.to_string()); 465 self 466 } 467 no_show_all(mut self, no_show_all: bool) -> Self468 pub fn no_show_all(mut self, no_show_all: bool) -> Self { 469 self.no_show_all = Some(no_show_all); 470 self 471 } 472 opacity(mut self, opacity: f64) -> Self473 pub fn opacity(mut self, opacity: f64) -> Self { 474 self.opacity = Some(opacity); 475 self 476 } 477 parent<P: IsA<gtk::Container>>(mut self, parent: &P) -> Self478 pub fn parent<P: IsA<gtk::Container>>(mut self, parent: &P) -> Self { 479 self.parent = Some(parent.clone().upcast()); 480 self 481 } 482 receives_default(mut self, receives_default: bool) -> Self483 pub fn receives_default(mut self, receives_default: bool) -> Self { 484 self.receives_default = Some(receives_default); 485 self 486 } 487 sensitive(mut self, sensitive: bool) -> Self488 pub fn sensitive(mut self, sensitive: bool) -> Self { 489 self.sensitive = Some(sensitive); 490 self 491 } 492 tooltip_markup(mut self, tooltip_markup: &str) -> Self493 pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self { 494 self.tooltip_markup = Some(tooltip_markup.to_string()); 495 self 496 } 497 tooltip_text(mut self, tooltip_text: &str) -> Self498 pub fn tooltip_text(mut self, tooltip_text: &str) -> Self { 499 self.tooltip_text = Some(tooltip_text.to_string()); 500 self 501 } 502 valign(mut self, valign: gtk::Align) -> Self503 pub fn valign(mut self, valign: gtk::Align) -> Self { 504 self.valign = Some(valign); 505 self 506 } 507 vexpand(mut self, vexpand: bool) -> Self508 pub fn vexpand(mut self, vexpand: bool) -> Self { 509 self.vexpand = Some(vexpand); 510 self 511 } 512 vexpand_set(mut self, vexpand_set: bool) -> Self513 pub fn vexpand_set(mut self, vexpand_set: bool) -> Self { 514 self.vexpand_set = Some(vexpand_set); 515 self 516 } 517 visible(mut self, visible: bool) -> Self518 pub fn visible(mut self, visible: bool) -> Self { 519 self.visible = Some(visible); 520 self 521 } 522 width_request(mut self, width_request: i32) -> Self523 pub fn width_request(mut self, width_request: i32) -> Self { 524 self.width_request = Some(width_request); 525 self 526 } 527 orientation(mut self, orientation: gtk::Orientation) -> Self528 pub fn orientation(mut self, orientation: gtk::Orientation) -> Self { 529 self.orientation = Some(orientation); 530 self 531 } 532 } 533 534 pub const NONE_LEAFLET: Option<&Leaflet> = None; 535 536 pub trait LeafletExt: 'static { 537 #[doc(alias = "hdy_leaflet_get_adjacent_child")] 538 #[doc(alias = "get_adjacent_child")] adjacent_child(&self, direction: NavigationDirection) -> Option<gtk::Widget>539 fn adjacent_child(&self, direction: NavigationDirection) -> Option<gtk::Widget>; 540 541 #[doc(alias = "hdy_leaflet_get_can_swipe_back")] 542 #[doc(alias = "get_can_swipe_back")] can_swipe_back(&self) -> bool543 fn can_swipe_back(&self) -> bool; 544 545 #[doc(alias = "hdy_leaflet_get_can_swipe_forward")] 546 #[doc(alias = "get_can_swipe_forward")] can_swipe_forward(&self) -> bool547 fn can_swipe_forward(&self) -> bool; 548 549 #[doc(alias = "hdy_leaflet_get_child_by_name")] 550 #[doc(alias = "get_child_by_name")] child_by_name(&self, name: &str) -> Option<gtk::Widget>551 fn child_by_name(&self, name: &str) -> Option<gtk::Widget>; 552 553 #[doc(alias = "hdy_leaflet_get_child_transition_duration")] 554 #[doc(alias = "get_child_transition_duration")] child_transition_duration(&self) -> u32555 fn child_transition_duration(&self) -> u32; 556 557 #[doc(alias = "hdy_leaflet_get_child_transition_running")] 558 #[doc(alias = "get_child_transition_running")] is_child_transition_running(&self) -> bool559 fn is_child_transition_running(&self) -> bool; 560 561 #[doc(alias = "hdy_leaflet_get_folded")] 562 #[doc(alias = "get_folded")] is_folded(&self) -> bool563 fn is_folded(&self) -> bool; 564 565 #[doc(alias = "hdy_leaflet_get_homogeneous")] 566 #[doc(alias = "get_homogeneous")] is_homogeneous(&self, folded: bool, orientation: gtk::Orientation) -> bool567 fn is_homogeneous(&self, folded: bool, orientation: gtk::Orientation) -> bool; 568 569 #[doc(alias = "hdy_leaflet_get_interpolate_size")] 570 #[doc(alias = "get_interpolate_size")] is_interpolate_size(&self) -> bool571 fn is_interpolate_size(&self) -> bool; 572 573 #[doc(alias = "hdy_leaflet_get_mode_transition_duration")] 574 #[doc(alias = "get_mode_transition_duration")] mode_transition_duration(&self) -> u32575 fn mode_transition_duration(&self) -> u32; 576 577 #[doc(alias = "hdy_leaflet_get_transition_type")] 578 #[doc(alias = "get_transition_type")] transition_type(&self) -> LeafletTransitionType579 fn transition_type(&self) -> LeafletTransitionType; 580 581 #[doc(alias = "hdy_leaflet_get_visible_child")] 582 #[doc(alias = "get_visible_child")] visible_child(&self) -> Option<gtk::Widget>583 fn visible_child(&self) -> Option<gtk::Widget>; 584 585 #[doc(alias = "hdy_leaflet_get_visible_child_name")] 586 #[doc(alias = "get_visible_child_name")] visible_child_name(&self) -> Option<glib::GString>587 fn visible_child_name(&self) -> Option<glib::GString>; 588 589 #[cfg(any(feature = "v1_2", feature = "dox"))] 590 #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))] 591 #[doc(alias = "hdy_leaflet_insert_child_after")] insert_child_after<P: IsA<gtk::Widget>, Q: IsA<gtk::Widget>>( &self, child: &P, sibling: Option<&Q>, )592 fn insert_child_after<P: IsA<gtk::Widget>, Q: IsA<gtk::Widget>>( 593 &self, 594 child: &P, 595 sibling: Option<&Q>, 596 ); 597 598 #[doc(alias = "hdy_leaflet_navigate")] navigate(&self, direction: NavigationDirection) -> bool599 fn navigate(&self, direction: NavigationDirection) -> bool; 600 601 #[cfg(any(feature = "v1_2", feature = "dox"))] 602 #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))] 603 #[doc(alias = "hdy_leaflet_prepend")] prepend<P: IsA<gtk::Widget>>(&self, child: &P)604 fn prepend<P: IsA<gtk::Widget>>(&self, child: &P); 605 606 #[cfg(any(feature = "v1_2", feature = "dox"))] 607 #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))] 608 #[doc(alias = "hdy_leaflet_reorder_child_after")] reorder_child_after<P: IsA<gtk::Widget>, Q: IsA<gtk::Widget>>( &self, child: &P, sibling: Option<&Q>, )609 fn reorder_child_after<P: IsA<gtk::Widget>, Q: IsA<gtk::Widget>>( 610 &self, 611 child: &P, 612 sibling: Option<&Q>, 613 ); 614 615 #[doc(alias = "hdy_leaflet_set_can_swipe_back")] set_can_swipe_back(&self, can_swipe_back: bool)616 fn set_can_swipe_back(&self, can_swipe_back: bool); 617 618 #[doc(alias = "hdy_leaflet_set_can_swipe_forward")] set_can_swipe_forward(&self, can_swipe_forward: bool)619 fn set_can_swipe_forward(&self, can_swipe_forward: bool); 620 621 #[doc(alias = "hdy_leaflet_set_child_transition_duration")] set_child_transition_duration(&self, duration: u32)622 fn set_child_transition_duration(&self, duration: u32); 623 624 #[doc(alias = "hdy_leaflet_set_homogeneous")] set_homogeneous(&self, folded: bool, orientation: gtk::Orientation, homogeneous: bool)625 fn set_homogeneous(&self, folded: bool, orientation: gtk::Orientation, homogeneous: bool); 626 627 #[doc(alias = "hdy_leaflet_set_interpolate_size")] set_interpolate_size(&self, interpolate_size: bool)628 fn set_interpolate_size(&self, interpolate_size: bool); 629 630 #[doc(alias = "hdy_leaflet_set_mode_transition_duration")] set_mode_transition_duration(&self, duration: u32)631 fn set_mode_transition_duration(&self, duration: u32); 632 633 #[doc(alias = "hdy_leaflet_set_transition_type")] set_transition_type(&self, transition: LeafletTransitionType)634 fn set_transition_type(&self, transition: LeafletTransitionType); 635 636 #[doc(alias = "hdy_leaflet_set_visible_child")] set_visible_child<P: IsA<gtk::Widget>>(&self, visible_child: &P)637 fn set_visible_child<P: IsA<gtk::Widget>>(&self, visible_child: &P); 638 639 #[doc(alias = "hdy_leaflet_set_visible_child_name")] set_visible_child_name(&self, name: &str)640 fn set_visible_child_name(&self, name: &str); 641 642 #[doc(alias = "hhomogeneous-folded")] is_hhomogeneous_folded(&self) -> bool643 fn is_hhomogeneous_folded(&self) -> bool; 644 645 #[doc(alias = "hhomogeneous-folded")] set_hhomogeneous_folded(&self, hhomogeneous_folded: bool)646 fn set_hhomogeneous_folded(&self, hhomogeneous_folded: bool); 647 648 #[doc(alias = "hhomogeneous-unfolded")] is_hhomogeneous_unfolded(&self) -> bool649 fn is_hhomogeneous_unfolded(&self) -> bool; 650 651 #[doc(alias = "hhomogeneous-unfolded")] set_hhomogeneous_unfolded(&self, hhomogeneous_unfolded: bool)652 fn set_hhomogeneous_unfolded(&self, hhomogeneous_unfolded: bool); 653 654 #[doc(alias = "vhomogeneous-folded")] is_vhomogeneous_folded(&self) -> bool655 fn is_vhomogeneous_folded(&self) -> bool; 656 657 #[doc(alias = "vhomogeneous-folded")] set_vhomogeneous_folded(&self, vhomogeneous_folded: bool)658 fn set_vhomogeneous_folded(&self, vhomogeneous_folded: bool); 659 660 #[doc(alias = "vhomogeneous-unfolded")] is_vhomogeneous_unfolded(&self) -> bool661 fn is_vhomogeneous_unfolded(&self) -> bool; 662 663 #[doc(alias = "vhomogeneous-unfolded")] set_vhomogeneous_unfolded(&self, vhomogeneous_unfolded: bool)664 fn set_vhomogeneous_unfolded(&self, vhomogeneous_unfolded: bool); 665 666 #[doc(alias = "child.icon-name")] child_icon_name<T: IsA<gtk::Widget>>(&self, item: &T) -> Option<glib::GString>667 fn child_icon_name<T: IsA<gtk::Widget>>(&self, item: &T) -> Option<glib::GString>; 668 669 #[doc(alias = "child.icon-name")] set_child_icon_name<T: IsA<gtk::Widget>>(&self, item: &T, icon_name: Option<&str>)670 fn set_child_icon_name<T: IsA<gtk::Widget>>(&self, item: &T, icon_name: Option<&str>); 671 child_name<T: IsA<gtk::Widget>>(&self, item: &T) -> Option<glib::GString>672 fn child_name<T: IsA<gtk::Widget>>(&self, item: &T) -> Option<glib::GString>; 673 set_child_name<T: IsA<gtk::Widget>>(&self, item: &T, name: Option<&str>)674 fn set_child_name<T: IsA<gtk::Widget>>(&self, item: &T, name: Option<&str>); 675 676 #[doc(alias = "child.needs-attention")] child_needs_attention<T: IsA<gtk::Widget>>(&self, item: &T) -> bool677 fn child_needs_attention<T: IsA<gtk::Widget>>(&self, item: &T) -> bool; 678 679 #[doc(alias = "child.needs-attention")] set_child_needs_attention<T: IsA<gtk::Widget>>(&self, item: &T, needs_attention: bool)680 fn set_child_needs_attention<T: IsA<gtk::Widget>>(&self, item: &T, needs_attention: bool); 681 child_position<T: IsA<gtk::Widget>>(&self, item: &T) -> i32682 fn child_position<T: IsA<gtk::Widget>>(&self, item: &T) -> i32; 683 set_child_position<T: IsA<gtk::Widget>>(&self, item: &T, position: i32)684 fn set_child_position<T: IsA<gtk::Widget>>(&self, item: &T, position: i32); 685 child_title<T: IsA<gtk::Widget>>(&self, item: &T) -> Option<glib::GString>686 fn child_title<T: IsA<gtk::Widget>>(&self, item: &T) -> Option<glib::GString>; 687 set_child_title<T: IsA<gtk::Widget>>(&self, item: &T, title: Option<&str>)688 fn set_child_title<T: IsA<gtk::Widget>>(&self, item: &T, title: Option<&str>); 689 690 #[doc(alias = "can-swipe-back")] connect_can_swipe_back_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId691 fn connect_can_swipe_back_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 692 693 #[doc(alias = "can-swipe-forward")] connect_can_swipe_forward_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId694 fn connect_can_swipe_forward_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 695 696 #[doc(alias = "child-transition-duration")] connect_child_transition_duration_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId697 fn connect_child_transition_duration_notify<F: Fn(&Self) + 'static>( 698 &self, 699 f: F, 700 ) -> SignalHandlerId; 701 702 #[doc(alias = "child-transition-running")] connect_child_transition_running_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId703 fn connect_child_transition_running_notify<F: Fn(&Self) + 'static>( 704 &self, 705 f: F, 706 ) -> SignalHandlerId; 707 708 #[doc(alias = "folded")] connect_folded_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId709 fn connect_folded_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 710 711 #[doc(alias = "hhomogeneous-folded")] connect_hhomogeneous_folded_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId712 fn connect_hhomogeneous_folded_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 713 714 #[doc(alias = "hhomogeneous-unfolded")] connect_hhomogeneous_unfolded_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId715 fn connect_hhomogeneous_unfolded_notify<F: Fn(&Self) + 'static>(&self, f: F) 716 -> SignalHandlerId; 717 718 #[doc(alias = "interpolate-size")] connect_interpolate_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId719 fn connect_interpolate_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 720 721 #[doc(alias = "mode-transition-duration")] connect_mode_transition_duration_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId722 fn connect_mode_transition_duration_notify<F: Fn(&Self) + 'static>( 723 &self, 724 f: F, 725 ) -> SignalHandlerId; 726 727 #[doc(alias = "transition-type")] connect_transition_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId728 fn connect_transition_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 729 730 #[doc(alias = "vhomogeneous-folded")] connect_vhomogeneous_folded_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId731 fn connect_vhomogeneous_folded_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 732 733 #[doc(alias = "vhomogeneous-unfolded")] connect_vhomogeneous_unfolded_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId734 fn connect_vhomogeneous_unfolded_notify<F: Fn(&Self) + 'static>(&self, f: F) 735 -> SignalHandlerId; 736 737 #[doc(alias = "visible-child")] connect_visible_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId738 fn connect_visible_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 739 740 #[doc(alias = "visible-child-name")] connect_visible_child_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId741 fn connect_visible_child_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 742 } 743 744 impl<O: IsA<Leaflet>> LeafletExt for O { adjacent_child(&self, direction: NavigationDirection) -> Option<gtk::Widget>745 fn adjacent_child(&self, direction: NavigationDirection) -> Option<gtk::Widget> { 746 unsafe { 747 from_glib_none(ffi::hdy_leaflet_get_adjacent_child( 748 self.as_ref().to_glib_none().0, 749 direction.into_glib(), 750 )) 751 } 752 } 753 can_swipe_back(&self) -> bool754 fn can_swipe_back(&self) -> bool { 755 unsafe { 756 from_glib(ffi::hdy_leaflet_get_can_swipe_back( 757 self.as_ref().to_glib_none().0, 758 )) 759 } 760 } 761 can_swipe_forward(&self) -> bool762 fn can_swipe_forward(&self) -> bool { 763 unsafe { 764 from_glib(ffi::hdy_leaflet_get_can_swipe_forward( 765 self.as_ref().to_glib_none().0, 766 )) 767 } 768 } 769 child_by_name(&self, name: &str) -> Option<gtk::Widget>770 fn child_by_name(&self, name: &str) -> Option<gtk::Widget> { 771 unsafe { 772 from_glib_none(ffi::hdy_leaflet_get_child_by_name( 773 self.as_ref().to_glib_none().0, 774 name.to_glib_none().0, 775 )) 776 } 777 } 778 child_transition_duration(&self) -> u32779 fn child_transition_duration(&self) -> u32 { 780 unsafe { ffi::hdy_leaflet_get_child_transition_duration(self.as_ref().to_glib_none().0) } 781 } 782 is_child_transition_running(&self) -> bool783 fn is_child_transition_running(&self) -> bool { 784 unsafe { 785 from_glib(ffi::hdy_leaflet_get_child_transition_running( 786 self.as_ref().to_glib_none().0, 787 )) 788 } 789 } 790 is_folded(&self) -> bool791 fn is_folded(&self) -> bool { 792 unsafe { from_glib(ffi::hdy_leaflet_get_folded(self.as_ref().to_glib_none().0)) } 793 } 794 is_homogeneous(&self, folded: bool, orientation: gtk::Orientation) -> bool795 fn is_homogeneous(&self, folded: bool, orientation: gtk::Orientation) -> bool { 796 unsafe { 797 from_glib(ffi::hdy_leaflet_get_homogeneous( 798 self.as_ref().to_glib_none().0, 799 folded.into_glib(), 800 orientation.into_glib(), 801 )) 802 } 803 } 804 is_interpolate_size(&self) -> bool805 fn is_interpolate_size(&self) -> bool { 806 unsafe { 807 from_glib(ffi::hdy_leaflet_get_interpolate_size( 808 self.as_ref().to_glib_none().0, 809 )) 810 } 811 } 812 mode_transition_duration(&self) -> u32813 fn mode_transition_duration(&self) -> u32 { 814 unsafe { ffi::hdy_leaflet_get_mode_transition_duration(self.as_ref().to_glib_none().0) } 815 } 816 transition_type(&self) -> LeafletTransitionType817 fn transition_type(&self) -> LeafletTransitionType { 818 unsafe { 819 from_glib(ffi::hdy_leaflet_get_transition_type( 820 self.as_ref().to_glib_none().0, 821 )) 822 } 823 } 824 visible_child(&self) -> Option<gtk::Widget>825 fn visible_child(&self) -> Option<gtk::Widget> { 826 unsafe { 827 from_glib_none(ffi::hdy_leaflet_get_visible_child( 828 self.as_ref().to_glib_none().0, 829 )) 830 } 831 } 832 visible_child_name(&self) -> Option<glib::GString>833 fn visible_child_name(&self) -> Option<glib::GString> { 834 unsafe { 835 from_glib_none(ffi::hdy_leaflet_get_visible_child_name( 836 self.as_ref().to_glib_none().0, 837 )) 838 } 839 } 840 841 #[cfg(any(feature = "v1_2", feature = "dox"))] 842 #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))] insert_child_after<P: IsA<gtk::Widget>, Q: IsA<gtk::Widget>>( &self, child: &P, sibling: Option<&Q>, )843 fn insert_child_after<P: IsA<gtk::Widget>, Q: IsA<gtk::Widget>>( 844 &self, 845 child: &P, 846 sibling: Option<&Q>, 847 ) { 848 unsafe { 849 ffi::hdy_leaflet_insert_child_after( 850 self.as_ref().to_glib_none().0, 851 child.as_ref().to_glib_none().0, 852 sibling.map(|p| p.as_ref()).to_glib_none().0, 853 ); 854 } 855 } 856 navigate(&self, direction: NavigationDirection) -> bool857 fn navigate(&self, direction: NavigationDirection) -> bool { 858 unsafe { 859 from_glib(ffi::hdy_leaflet_navigate( 860 self.as_ref().to_glib_none().0, 861 direction.into_glib(), 862 )) 863 } 864 } 865 866 #[cfg(any(feature = "v1_2", feature = "dox"))] 867 #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))] prepend<P: IsA<gtk::Widget>>(&self, child: &P)868 fn prepend<P: IsA<gtk::Widget>>(&self, child: &P) { 869 unsafe { 870 ffi::hdy_leaflet_prepend( 871 self.as_ref().to_glib_none().0, 872 child.as_ref().to_glib_none().0, 873 ); 874 } 875 } 876 877 #[cfg(any(feature = "v1_2", feature = "dox"))] 878 #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))] reorder_child_after<P: IsA<gtk::Widget>, Q: IsA<gtk::Widget>>( &self, child: &P, sibling: Option<&Q>, )879 fn reorder_child_after<P: IsA<gtk::Widget>, Q: IsA<gtk::Widget>>( 880 &self, 881 child: &P, 882 sibling: Option<&Q>, 883 ) { 884 unsafe { 885 ffi::hdy_leaflet_reorder_child_after( 886 self.as_ref().to_glib_none().0, 887 child.as_ref().to_glib_none().0, 888 sibling.map(|p| p.as_ref()).to_glib_none().0, 889 ); 890 } 891 } 892 set_can_swipe_back(&self, can_swipe_back: bool)893 fn set_can_swipe_back(&self, can_swipe_back: bool) { 894 unsafe { 895 ffi::hdy_leaflet_set_can_swipe_back( 896 self.as_ref().to_glib_none().0, 897 can_swipe_back.into_glib(), 898 ); 899 } 900 } 901 set_can_swipe_forward(&self, can_swipe_forward: bool)902 fn set_can_swipe_forward(&self, can_swipe_forward: bool) { 903 unsafe { 904 ffi::hdy_leaflet_set_can_swipe_forward( 905 self.as_ref().to_glib_none().0, 906 can_swipe_forward.into_glib(), 907 ); 908 } 909 } 910 set_child_transition_duration(&self, duration: u32)911 fn set_child_transition_duration(&self, duration: u32) { 912 unsafe { 913 ffi::hdy_leaflet_set_child_transition_duration( 914 self.as_ref().to_glib_none().0, 915 duration, 916 ); 917 } 918 } 919 set_homogeneous(&self, folded: bool, orientation: gtk::Orientation, homogeneous: bool)920 fn set_homogeneous(&self, folded: bool, orientation: gtk::Orientation, homogeneous: bool) { 921 unsafe { 922 ffi::hdy_leaflet_set_homogeneous( 923 self.as_ref().to_glib_none().0, 924 folded.into_glib(), 925 orientation.into_glib(), 926 homogeneous.into_glib(), 927 ); 928 } 929 } 930 set_interpolate_size(&self, interpolate_size: bool)931 fn set_interpolate_size(&self, interpolate_size: bool) { 932 unsafe { 933 ffi::hdy_leaflet_set_interpolate_size( 934 self.as_ref().to_glib_none().0, 935 interpolate_size.into_glib(), 936 ); 937 } 938 } 939 set_mode_transition_duration(&self, duration: u32)940 fn set_mode_transition_duration(&self, duration: u32) { 941 unsafe { 942 ffi::hdy_leaflet_set_mode_transition_duration(self.as_ref().to_glib_none().0, duration); 943 } 944 } 945 set_transition_type(&self, transition: LeafletTransitionType)946 fn set_transition_type(&self, transition: LeafletTransitionType) { 947 unsafe { 948 ffi::hdy_leaflet_set_transition_type( 949 self.as_ref().to_glib_none().0, 950 transition.into_glib(), 951 ); 952 } 953 } 954 set_visible_child<P: IsA<gtk::Widget>>(&self, visible_child: &P)955 fn set_visible_child<P: IsA<gtk::Widget>>(&self, visible_child: &P) { 956 unsafe { 957 ffi::hdy_leaflet_set_visible_child( 958 self.as_ref().to_glib_none().0, 959 visible_child.as_ref().to_glib_none().0, 960 ); 961 } 962 } 963 set_visible_child_name(&self, name: &str)964 fn set_visible_child_name(&self, name: &str) { 965 unsafe { 966 ffi::hdy_leaflet_set_visible_child_name( 967 self.as_ref().to_glib_none().0, 968 name.to_glib_none().0, 969 ); 970 } 971 } 972 is_hhomogeneous_folded(&self) -> bool973 fn is_hhomogeneous_folded(&self) -> bool { 974 unsafe { 975 let mut value = glib::Value::from_type(<bool as StaticType>::static_type()); 976 glib::gobject_ffi::g_object_get_property( 977 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 978 b"hhomogeneous-folded\0".as_ptr() as *const _, 979 value.to_glib_none_mut().0, 980 ); 981 value 982 .get() 983 .expect("Return Value for property `hhomogeneous-folded` getter") 984 } 985 } 986 set_hhomogeneous_folded(&self, hhomogeneous_folded: bool)987 fn set_hhomogeneous_folded(&self, hhomogeneous_folded: bool) { 988 unsafe { 989 glib::gobject_ffi::g_object_set_property( 990 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 991 b"hhomogeneous-folded\0".as_ptr() as *const _, 992 hhomogeneous_folded.to_value().to_glib_none().0, 993 ); 994 } 995 } 996 is_hhomogeneous_unfolded(&self) -> bool997 fn is_hhomogeneous_unfolded(&self) -> bool { 998 unsafe { 999 let mut value = glib::Value::from_type(<bool as StaticType>::static_type()); 1000 glib::gobject_ffi::g_object_get_property( 1001 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 1002 b"hhomogeneous-unfolded\0".as_ptr() as *const _, 1003 value.to_glib_none_mut().0, 1004 ); 1005 value 1006 .get() 1007 .expect("Return Value for property `hhomogeneous-unfolded` getter") 1008 } 1009 } 1010 set_hhomogeneous_unfolded(&self, hhomogeneous_unfolded: bool)1011 fn set_hhomogeneous_unfolded(&self, hhomogeneous_unfolded: bool) { 1012 unsafe { 1013 glib::gobject_ffi::g_object_set_property( 1014 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 1015 b"hhomogeneous-unfolded\0".as_ptr() as *const _, 1016 hhomogeneous_unfolded.to_value().to_glib_none().0, 1017 ); 1018 } 1019 } 1020 is_vhomogeneous_folded(&self) -> bool1021 fn is_vhomogeneous_folded(&self) -> bool { 1022 unsafe { 1023 let mut value = glib::Value::from_type(<bool as StaticType>::static_type()); 1024 glib::gobject_ffi::g_object_get_property( 1025 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 1026 b"vhomogeneous-folded\0".as_ptr() as *const _, 1027 value.to_glib_none_mut().0, 1028 ); 1029 value 1030 .get() 1031 .expect("Return Value for property `vhomogeneous-folded` getter") 1032 } 1033 } 1034 set_vhomogeneous_folded(&self, vhomogeneous_folded: bool)1035 fn set_vhomogeneous_folded(&self, vhomogeneous_folded: bool) { 1036 unsafe { 1037 glib::gobject_ffi::g_object_set_property( 1038 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 1039 b"vhomogeneous-folded\0".as_ptr() as *const _, 1040 vhomogeneous_folded.to_value().to_glib_none().0, 1041 ); 1042 } 1043 } 1044 is_vhomogeneous_unfolded(&self) -> bool1045 fn is_vhomogeneous_unfolded(&self) -> bool { 1046 unsafe { 1047 let mut value = glib::Value::from_type(<bool as StaticType>::static_type()); 1048 glib::gobject_ffi::g_object_get_property( 1049 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 1050 b"vhomogeneous-unfolded\0".as_ptr() as *const _, 1051 value.to_glib_none_mut().0, 1052 ); 1053 value 1054 .get() 1055 .expect("Return Value for property `vhomogeneous-unfolded` getter") 1056 } 1057 } 1058 set_vhomogeneous_unfolded(&self, vhomogeneous_unfolded: bool)1059 fn set_vhomogeneous_unfolded(&self, vhomogeneous_unfolded: bool) { 1060 unsafe { 1061 glib::gobject_ffi::g_object_set_property( 1062 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 1063 b"vhomogeneous-unfolded\0".as_ptr() as *const _, 1064 vhomogeneous_unfolded.to_value().to_glib_none().0, 1065 ); 1066 } 1067 } 1068 child_icon_name<T: IsA<gtk::Widget>>(&self, item: &T) -> Option<glib::GString>1069 fn child_icon_name<T: IsA<gtk::Widget>>(&self, item: &T) -> Option<glib::GString> { 1070 unsafe { 1071 let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type()); 1072 gtk::ffi::gtk_container_child_get_property( 1073 self.to_glib_none().0 as *mut gtk::ffi::GtkContainer, 1074 item.to_glib_none().0 as *mut _, 1075 b"icon-name\0".as_ptr() as *const _, 1076 value.to_glib_none_mut().0, 1077 ); 1078 value 1079 .get() 1080 .expect("Return Value for property `icon-name` getter") 1081 } 1082 } 1083 set_child_icon_name<T: IsA<gtk::Widget>>(&self, item: &T, icon_name: Option<&str>)1084 fn set_child_icon_name<T: IsA<gtk::Widget>>(&self, item: &T, icon_name: Option<&str>) { 1085 unsafe { 1086 gtk::ffi::gtk_container_child_set_property( 1087 self.to_glib_none().0 as *mut gtk::ffi::GtkContainer, 1088 item.to_glib_none().0 as *mut _, 1089 b"icon-name\0".as_ptr() as *const _, 1090 icon_name.to_value().to_glib_none().0, 1091 ); 1092 } 1093 } 1094 child_name<T: IsA<gtk::Widget>>(&self, item: &T) -> Option<glib::GString>1095 fn child_name<T: IsA<gtk::Widget>>(&self, item: &T) -> Option<glib::GString> { 1096 unsafe { 1097 let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type()); 1098 gtk::ffi::gtk_container_child_get_property( 1099 self.to_glib_none().0 as *mut gtk::ffi::GtkContainer, 1100 item.to_glib_none().0 as *mut _, 1101 b"name\0".as_ptr() as *const _, 1102 value.to_glib_none_mut().0, 1103 ); 1104 value 1105 .get() 1106 .expect("Return Value for property `name` getter") 1107 } 1108 } 1109 set_child_name<T: IsA<gtk::Widget>>(&self, item: &T, name: Option<&str>)1110 fn set_child_name<T: IsA<gtk::Widget>>(&self, item: &T, name: Option<&str>) { 1111 unsafe { 1112 gtk::ffi::gtk_container_child_set_property( 1113 self.to_glib_none().0 as *mut gtk::ffi::GtkContainer, 1114 item.to_glib_none().0 as *mut _, 1115 b"name\0".as_ptr() as *const _, 1116 name.to_value().to_glib_none().0, 1117 ); 1118 } 1119 } 1120 child_needs_attention<T: IsA<gtk::Widget>>(&self, item: &T) -> bool1121 fn child_needs_attention<T: IsA<gtk::Widget>>(&self, item: &T) -> bool { 1122 unsafe { 1123 let mut value = glib::Value::from_type(<bool as StaticType>::static_type()); 1124 gtk::ffi::gtk_container_child_get_property( 1125 self.to_glib_none().0 as *mut gtk::ffi::GtkContainer, 1126 item.to_glib_none().0 as *mut _, 1127 b"needs-attention\0".as_ptr() as *const _, 1128 value.to_glib_none_mut().0, 1129 ); 1130 value 1131 .get() 1132 .expect("Return Value for property `needs-attention` getter") 1133 } 1134 } 1135 set_child_needs_attention<T: IsA<gtk::Widget>>(&self, item: &T, needs_attention: bool)1136 fn set_child_needs_attention<T: IsA<gtk::Widget>>(&self, item: &T, needs_attention: bool) { 1137 unsafe { 1138 gtk::ffi::gtk_container_child_set_property( 1139 self.to_glib_none().0 as *mut gtk::ffi::GtkContainer, 1140 item.to_glib_none().0 as *mut _, 1141 b"needs-attention\0".as_ptr() as *const _, 1142 needs_attention.to_value().to_glib_none().0, 1143 ); 1144 } 1145 } 1146 child_position<T: IsA<gtk::Widget>>(&self, item: &T) -> i321147 fn child_position<T: IsA<gtk::Widget>>(&self, item: &T) -> i32 { 1148 unsafe { 1149 let mut value = glib::Value::from_type(<i32 as StaticType>::static_type()); 1150 gtk::ffi::gtk_container_child_get_property( 1151 self.to_glib_none().0 as *mut gtk::ffi::GtkContainer, 1152 item.to_glib_none().0 as *mut _, 1153 b"position\0".as_ptr() as *const _, 1154 value.to_glib_none_mut().0, 1155 ); 1156 value 1157 .get() 1158 .expect("Return Value for property `position` getter") 1159 } 1160 } 1161 set_child_position<T: IsA<gtk::Widget>>(&self, item: &T, position: i32)1162 fn set_child_position<T: IsA<gtk::Widget>>(&self, item: &T, position: i32) { 1163 unsafe { 1164 gtk::ffi::gtk_container_child_set_property( 1165 self.to_glib_none().0 as *mut gtk::ffi::GtkContainer, 1166 item.to_glib_none().0 as *mut _, 1167 b"position\0".as_ptr() as *const _, 1168 position.to_value().to_glib_none().0, 1169 ); 1170 } 1171 } 1172 child_title<T: IsA<gtk::Widget>>(&self, item: &T) -> Option<glib::GString>1173 fn child_title<T: IsA<gtk::Widget>>(&self, item: &T) -> Option<glib::GString> { 1174 unsafe { 1175 let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type()); 1176 gtk::ffi::gtk_container_child_get_property( 1177 self.to_glib_none().0 as *mut gtk::ffi::GtkContainer, 1178 item.to_glib_none().0 as *mut _, 1179 b"title\0".as_ptr() as *const _, 1180 value.to_glib_none_mut().0, 1181 ); 1182 value 1183 .get() 1184 .expect("Return Value for property `title` getter") 1185 } 1186 } 1187 set_child_title<T: IsA<gtk::Widget>>(&self, item: &T, title: Option<&str>)1188 fn set_child_title<T: IsA<gtk::Widget>>(&self, item: &T, title: Option<&str>) { 1189 unsafe { 1190 gtk::ffi::gtk_container_child_set_property( 1191 self.to_glib_none().0 as *mut gtk::ffi::GtkContainer, 1192 item.to_glib_none().0 as *mut _, 1193 b"title\0".as_ptr() as *const _, 1194 title.to_value().to_glib_none().0, 1195 ); 1196 } 1197 } 1198 connect_can_swipe_back_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1199 fn connect_can_swipe_back_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1200 unsafe extern "C" fn notify_can_swipe_back_trampoline< 1201 P: IsA<Leaflet>, 1202 F: Fn(&P) + 'static, 1203 >( 1204 this: *mut ffi::HdyLeaflet, 1205 _param_spec: glib::ffi::gpointer, 1206 f: glib::ffi::gpointer, 1207 ) { 1208 let f: &F = &*(f as *const F); 1209 f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) 1210 } 1211 unsafe { 1212 let f: Box_<F> = Box_::new(f); 1213 connect_raw( 1214 self.as_ptr() as *mut _, 1215 b"notify::can-swipe-back\0".as_ptr() as *const _, 1216 Some(transmute::<_, unsafe extern "C" fn()>( 1217 notify_can_swipe_back_trampoline::<Self, F> as *const (), 1218 )), 1219 Box_::into_raw(f), 1220 ) 1221 } 1222 } 1223 connect_can_swipe_forward_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1224 fn connect_can_swipe_forward_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1225 unsafe extern "C" fn notify_can_swipe_forward_trampoline< 1226 P: IsA<Leaflet>, 1227 F: Fn(&P) + 'static, 1228 >( 1229 this: *mut ffi::HdyLeaflet, 1230 _param_spec: glib::ffi::gpointer, 1231 f: glib::ffi::gpointer, 1232 ) { 1233 let f: &F = &*(f as *const F); 1234 f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) 1235 } 1236 unsafe { 1237 let f: Box_<F> = Box_::new(f); 1238 connect_raw( 1239 self.as_ptr() as *mut _, 1240 b"notify::can-swipe-forward\0".as_ptr() as *const _, 1241 Some(transmute::<_, unsafe extern "C" fn()>( 1242 notify_can_swipe_forward_trampoline::<Self, F> as *const (), 1243 )), 1244 Box_::into_raw(f), 1245 ) 1246 } 1247 } 1248 connect_child_transition_duration_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1249 fn connect_child_transition_duration_notify<F: Fn(&Self) + 'static>( 1250 &self, 1251 f: F, 1252 ) -> SignalHandlerId { 1253 unsafe extern "C" fn notify_child_transition_duration_trampoline< 1254 P: IsA<Leaflet>, 1255 F: Fn(&P) + 'static, 1256 >( 1257 this: *mut ffi::HdyLeaflet, 1258 _param_spec: glib::ffi::gpointer, 1259 f: glib::ffi::gpointer, 1260 ) { 1261 let f: &F = &*(f as *const F); 1262 f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) 1263 } 1264 unsafe { 1265 let f: Box_<F> = Box_::new(f); 1266 connect_raw( 1267 self.as_ptr() as *mut _, 1268 b"notify::child-transition-duration\0".as_ptr() as *const _, 1269 Some(transmute::<_, unsafe extern "C" fn()>( 1270 notify_child_transition_duration_trampoline::<Self, F> as *const (), 1271 )), 1272 Box_::into_raw(f), 1273 ) 1274 } 1275 } 1276 connect_child_transition_running_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1277 fn connect_child_transition_running_notify<F: Fn(&Self) + 'static>( 1278 &self, 1279 f: F, 1280 ) -> SignalHandlerId { 1281 unsafe extern "C" fn notify_child_transition_running_trampoline< 1282 P: IsA<Leaflet>, 1283 F: Fn(&P) + 'static, 1284 >( 1285 this: *mut ffi::HdyLeaflet, 1286 _param_spec: glib::ffi::gpointer, 1287 f: glib::ffi::gpointer, 1288 ) { 1289 let f: &F = &*(f as *const F); 1290 f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) 1291 } 1292 unsafe { 1293 let f: Box_<F> = Box_::new(f); 1294 connect_raw( 1295 self.as_ptr() as *mut _, 1296 b"notify::child-transition-running\0".as_ptr() as *const _, 1297 Some(transmute::<_, unsafe extern "C" fn()>( 1298 notify_child_transition_running_trampoline::<Self, F> as *const (), 1299 )), 1300 Box_::into_raw(f), 1301 ) 1302 } 1303 } 1304 connect_folded_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1305 fn connect_folded_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1306 unsafe extern "C" fn notify_folded_trampoline<P: IsA<Leaflet>, F: Fn(&P) + 'static>( 1307 this: *mut ffi::HdyLeaflet, 1308 _param_spec: glib::ffi::gpointer, 1309 f: glib::ffi::gpointer, 1310 ) { 1311 let f: &F = &*(f as *const F); 1312 f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) 1313 } 1314 unsafe { 1315 let f: Box_<F> = Box_::new(f); 1316 connect_raw( 1317 self.as_ptr() as *mut _, 1318 b"notify::folded\0".as_ptr() as *const _, 1319 Some(transmute::<_, unsafe extern "C" fn()>( 1320 notify_folded_trampoline::<Self, F> as *const (), 1321 )), 1322 Box_::into_raw(f), 1323 ) 1324 } 1325 } 1326 connect_hhomogeneous_folded_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1327 fn connect_hhomogeneous_folded_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1328 unsafe extern "C" fn notify_hhomogeneous_folded_trampoline< 1329 P: IsA<Leaflet>, 1330 F: Fn(&P) + 'static, 1331 >( 1332 this: *mut ffi::HdyLeaflet, 1333 _param_spec: glib::ffi::gpointer, 1334 f: glib::ffi::gpointer, 1335 ) { 1336 let f: &F = &*(f as *const F); 1337 f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) 1338 } 1339 unsafe { 1340 let f: Box_<F> = Box_::new(f); 1341 connect_raw( 1342 self.as_ptr() as *mut _, 1343 b"notify::hhomogeneous-folded\0".as_ptr() as *const _, 1344 Some(transmute::<_, unsafe extern "C" fn()>( 1345 notify_hhomogeneous_folded_trampoline::<Self, F> as *const (), 1346 )), 1347 Box_::into_raw(f), 1348 ) 1349 } 1350 } 1351 connect_hhomogeneous_unfolded_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1352 fn connect_hhomogeneous_unfolded_notify<F: Fn(&Self) + 'static>( 1353 &self, 1354 f: F, 1355 ) -> SignalHandlerId { 1356 unsafe extern "C" fn notify_hhomogeneous_unfolded_trampoline< 1357 P: IsA<Leaflet>, 1358 F: Fn(&P) + 'static, 1359 >( 1360 this: *mut ffi::HdyLeaflet, 1361 _param_spec: glib::ffi::gpointer, 1362 f: glib::ffi::gpointer, 1363 ) { 1364 let f: &F = &*(f as *const F); 1365 f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) 1366 } 1367 unsafe { 1368 let f: Box_<F> = Box_::new(f); 1369 connect_raw( 1370 self.as_ptr() as *mut _, 1371 b"notify::hhomogeneous-unfolded\0".as_ptr() as *const _, 1372 Some(transmute::<_, unsafe extern "C" fn()>( 1373 notify_hhomogeneous_unfolded_trampoline::<Self, F> as *const (), 1374 )), 1375 Box_::into_raw(f), 1376 ) 1377 } 1378 } 1379 connect_interpolate_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1380 fn connect_interpolate_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1381 unsafe extern "C" fn notify_interpolate_size_trampoline< 1382 P: IsA<Leaflet>, 1383 F: Fn(&P) + 'static, 1384 >( 1385 this: *mut ffi::HdyLeaflet, 1386 _param_spec: glib::ffi::gpointer, 1387 f: glib::ffi::gpointer, 1388 ) { 1389 let f: &F = &*(f as *const F); 1390 f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) 1391 } 1392 unsafe { 1393 let f: Box_<F> = Box_::new(f); 1394 connect_raw( 1395 self.as_ptr() as *mut _, 1396 b"notify::interpolate-size\0".as_ptr() as *const _, 1397 Some(transmute::<_, unsafe extern "C" fn()>( 1398 notify_interpolate_size_trampoline::<Self, F> as *const (), 1399 )), 1400 Box_::into_raw(f), 1401 ) 1402 } 1403 } 1404 connect_mode_transition_duration_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1405 fn connect_mode_transition_duration_notify<F: Fn(&Self) + 'static>( 1406 &self, 1407 f: F, 1408 ) -> SignalHandlerId { 1409 unsafe extern "C" fn notify_mode_transition_duration_trampoline< 1410 P: IsA<Leaflet>, 1411 F: Fn(&P) + 'static, 1412 >( 1413 this: *mut ffi::HdyLeaflet, 1414 _param_spec: glib::ffi::gpointer, 1415 f: glib::ffi::gpointer, 1416 ) { 1417 let f: &F = &*(f as *const F); 1418 f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) 1419 } 1420 unsafe { 1421 let f: Box_<F> = Box_::new(f); 1422 connect_raw( 1423 self.as_ptr() as *mut _, 1424 b"notify::mode-transition-duration\0".as_ptr() as *const _, 1425 Some(transmute::<_, unsafe extern "C" fn()>( 1426 notify_mode_transition_duration_trampoline::<Self, F> as *const (), 1427 )), 1428 Box_::into_raw(f), 1429 ) 1430 } 1431 } 1432 connect_transition_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1433 fn connect_transition_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1434 unsafe extern "C" fn notify_transition_type_trampoline< 1435 P: IsA<Leaflet>, 1436 F: Fn(&P) + 'static, 1437 >( 1438 this: *mut ffi::HdyLeaflet, 1439 _param_spec: glib::ffi::gpointer, 1440 f: glib::ffi::gpointer, 1441 ) { 1442 let f: &F = &*(f as *const F); 1443 f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) 1444 } 1445 unsafe { 1446 let f: Box_<F> = Box_::new(f); 1447 connect_raw( 1448 self.as_ptr() as *mut _, 1449 b"notify::transition-type\0".as_ptr() as *const _, 1450 Some(transmute::<_, unsafe extern "C" fn()>( 1451 notify_transition_type_trampoline::<Self, F> as *const (), 1452 )), 1453 Box_::into_raw(f), 1454 ) 1455 } 1456 } 1457 connect_vhomogeneous_folded_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1458 fn connect_vhomogeneous_folded_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1459 unsafe extern "C" fn notify_vhomogeneous_folded_trampoline< 1460 P: IsA<Leaflet>, 1461 F: Fn(&P) + 'static, 1462 >( 1463 this: *mut ffi::HdyLeaflet, 1464 _param_spec: glib::ffi::gpointer, 1465 f: glib::ffi::gpointer, 1466 ) { 1467 let f: &F = &*(f as *const F); 1468 f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) 1469 } 1470 unsafe { 1471 let f: Box_<F> = Box_::new(f); 1472 connect_raw( 1473 self.as_ptr() as *mut _, 1474 b"notify::vhomogeneous-folded\0".as_ptr() as *const _, 1475 Some(transmute::<_, unsafe extern "C" fn()>( 1476 notify_vhomogeneous_folded_trampoline::<Self, F> as *const (), 1477 )), 1478 Box_::into_raw(f), 1479 ) 1480 } 1481 } 1482 connect_vhomogeneous_unfolded_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1483 fn connect_vhomogeneous_unfolded_notify<F: Fn(&Self) + 'static>( 1484 &self, 1485 f: F, 1486 ) -> SignalHandlerId { 1487 unsafe extern "C" fn notify_vhomogeneous_unfolded_trampoline< 1488 P: IsA<Leaflet>, 1489 F: Fn(&P) + 'static, 1490 >( 1491 this: *mut ffi::HdyLeaflet, 1492 _param_spec: glib::ffi::gpointer, 1493 f: glib::ffi::gpointer, 1494 ) { 1495 let f: &F = &*(f as *const F); 1496 f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) 1497 } 1498 unsafe { 1499 let f: Box_<F> = Box_::new(f); 1500 connect_raw( 1501 self.as_ptr() as *mut _, 1502 b"notify::vhomogeneous-unfolded\0".as_ptr() as *const _, 1503 Some(transmute::<_, unsafe extern "C" fn()>( 1504 notify_vhomogeneous_unfolded_trampoline::<Self, F> as *const (), 1505 )), 1506 Box_::into_raw(f), 1507 ) 1508 } 1509 } 1510 connect_visible_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1511 fn connect_visible_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1512 unsafe extern "C" fn notify_visible_child_trampoline< 1513 P: IsA<Leaflet>, 1514 F: Fn(&P) + 'static, 1515 >( 1516 this: *mut ffi::HdyLeaflet, 1517 _param_spec: glib::ffi::gpointer, 1518 f: glib::ffi::gpointer, 1519 ) { 1520 let f: &F = &*(f as *const F); 1521 f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) 1522 } 1523 unsafe { 1524 let f: Box_<F> = Box_::new(f); 1525 connect_raw( 1526 self.as_ptr() as *mut _, 1527 b"notify::visible-child\0".as_ptr() as *const _, 1528 Some(transmute::<_, unsafe extern "C" fn()>( 1529 notify_visible_child_trampoline::<Self, F> as *const (), 1530 )), 1531 Box_::into_raw(f), 1532 ) 1533 } 1534 } 1535 connect_visible_child_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1536 fn connect_visible_child_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1537 unsafe extern "C" fn notify_visible_child_name_trampoline< 1538 P: IsA<Leaflet>, 1539 F: Fn(&P) + 'static, 1540 >( 1541 this: *mut ffi::HdyLeaflet, 1542 _param_spec: glib::ffi::gpointer, 1543 f: glib::ffi::gpointer, 1544 ) { 1545 let f: &F = &*(f as *const F); 1546 f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) 1547 } 1548 unsafe { 1549 let f: Box_<F> = Box_::new(f); 1550 connect_raw( 1551 self.as_ptr() as *mut _, 1552 b"notify::visible-child-name\0".as_ptr() as *const _, 1553 Some(transmute::<_, unsafe extern "C" fn()>( 1554 notify_visible_child_name_trampoline::<Self, F> as *const (), 1555 )), 1556 Box_::into_raw(f), 1557 ) 1558 } 1559 } 1560 } 1561 1562 impl fmt::Display for Leaflet { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1563 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 1564 f.write_str("Leaflet") 1565 } 1566 } 1567