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 gdk; 6 use gio; 7 use gio_sys; 8 use glib::object::Cast; 9 use glib::object::IsA; 10 use glib::object::ObjectType as ObjectType_; 11 use glib::signal::connect_raw; 12 use glib::signal::SignalHandlerId; 13 use glib::translate::*; 14 use glib::GString; 15 use glib::StaticType; 16 use glib::ToValue; 17 use glib::Value; 18 use glib_sys; 19 use gobject_sys; 20 use gtk_sys; 21 use libc; 22 use std::boxed::Box as Box_; 23 use std::fmt; 24 use std::mem::transmute; 25 use Adjustment; 26 use Align; 27 use Bin; 28 use Buildable; 29 use Container; 30 use CornerType; 31 use PlacesOpenFlags; 32 use PolicyType; 33 use ResizeMode; 34 use ScrolledWindow; 35 use ShadowType; 36 use Widget; 37 38 glib_wrapper! { 39 pub struct PlacesSidebar(Object<gtk_sys::GtkPlacesSidebar, gtk_sys::GtkPlacesSidebarClass, PlacesSidebarClass>) @extends ScrolledWindow, Bin, Container, Widget, @implements Buildable; 40 41 match fn { 42 get_type => || gtk_sys::gtk_places_sidebar_get_type(), 43 } 44 } 45 46 impl PlacesSidebar { new() -> PlacesSidebar47 pub fn new() -> PlacesSidebar { 48 assert_initialized_main_thread!(); 49 unsafe { Widget::from_glib_none(gtk_sys::gtk_places_sidebar_new()).unsafe_cast() } 50 } 51 add_shortcut<P: IsA<gio::File>>(&self, location: &P)52 pub fn add_shortcut<P: IsA<gio::File>>(&self, location: &P) { 53 unsafe { 54 gtk_sys::gtk_places_sidebar_add_shortcut( 55 self.to_glib_none().0, 56 location.as_ref().to_glib_none().0, 57 ); 58 } 59 } 60 get_local_only(&self) -> bool61 pub fn get_local_only(&self) -> bool { 62 unsafe { 63 from_glib(gtk_sys::gtk_places_sidebar_get_local_only( 64 self.to_glib_none().0, 65 )) 66 } 67 } 68 get_location(&self) -> Option<gio::File>69 pub fn get_location(&self) -> Option<gio::File> { 70 unsafe { 71 from_glib_full(gtk_sys::gtk_places_sidebar_get_location( 72 self.to_glib_none().0, 73 )) 74 } 75 } 76 get_nth_bookmark(&self, n: i32) -> Option<gio::File>77 pub fn get_nth_bookmark(&self, n: i32) -> Option<gio::File> { 78 unsafe { 79 from_glib_full(gtk_sys::gtk_places_sidebar_get_nth_bookmark( 80 self.to_glib_none().0, 81 n, 82 )) 83 } 84 } 85 get_open_flags(&self) -> PlacesOpenFlags86 pub fn get_open_flags(&self) -> PlacesOpenFlags { 87 unsafe { 88 from_glib(gtk_sys::gtk_places_sidebar_get_open_flags( 89 self.to_glib_none().0, 90 )) 91 } 92 } 93 94 #[cfg_attr(feature = "v3_18", deprecated)] get_show_connect_to_server(&self) -> bool95 pub fn get_show_connect_to_server(&self) -> bool { 96 unsafe { 97 from_glib(gtk_sys::gtk_places_sidebar_get_show_connect_to_server( 98 self.to_glib_none().0, 99 )) 100 } 101 } 102 get_show_desktop(&self) -> bool103 pub fn get_show_desktop(&self) -> bool { 104 unsafe { 105 from_glib(gtk_sys::gtk_places_sidebar_get_show_desktop( 106 self.to_glib_none().0, 107 )) 108 } 109 } 110 get_show_enter_location(&self) -> bool111 pub fn get_show_enter_location(&self) -> bool { 112 unsafe { 113 from_glib(gtk_sys::gtk_places_sidebar_get_show_enter_location( 114 self.to_glib_none().0, 115 )) 116 } 117 } 118 119 #[cfg(any(feature = "v3_18", feature = "dox"))] get_show_other_locations(&self) -> bool120 pub fn get_show_other_locations(&self) -> bool { 121 unsafe { 122 from_glib(gtk_sys::gtk_places_sidebar_get_show_other_locations( 123 self.to_glib_none().0, 124 )) 125 } 126 } 127 128 #[cfg(any(feature = "v3_18", feature = "dox"))] get_show_recent(&self) -> bool129 pub fn get_show_recent(&self) -> bool { 130 unsafe { 131 from_glib(gtk_sys::gtk_places_sidebar_get_show_recent( 132 self.to_glib_none().0, 133 )) 134 } 135 } 136 137 #[cfg(any(feature = "v3_22_26", feature = "dox"))] get_show_starred_location(&self) -> bool138 pub fn get_show_starred_location(&self) -> bool { 139 unsafe { 140 from_glib(gtk_sys::gtk_places_sidebar_get_show_starred_location( 141 self.to_glib_none().0, 142 )) 143 } 144 } 145 146 #[cfg(any(feature = "v3_18", feature = "dox"))] get_show_trash(&self) -> bool147 pub fn get_show_trash(&self) -> bool { 148 unsafe { 149 from_glib(gtk_sys::gtk_places_sidebar_get_show_trash( 150 self.to_glib_none().0, 151 )) 152 } 153 } 154 list_shortcuts(&self) -> Vec<gio::File>155 pub fn list_shortcuts(&self) -> Vec<gio::File> { 156 unsafe { 157 FromGlibPtrContainer::from_glib_full(gtk_sys::gtk_places_sidebar_list_shortcuts( 158 self.to_glib_none().0, 159 )) 160 } 161 } 162 remove_shortcut<P: IsA<gio::File>>(&self, location: &P)163 pub fn remove_shortcut<P: IsA<gio::File>>(&self, location: &P) { 164 unsafe { 165 gtk_sys::gtk_places_sidebar_remove_shortcut( 166 self.to_glib_none().0, 167 location.as_ref().to_glib_none().0, 168 ); 169 } 170 } 171 172 #[cfg(any(feature = "v3_18", feature = "dox"))] set_drop_targets_visible(&self, visible: bool, context: &gdk::DragContext)173 pub fn set_drop_targets_visible(&self, visible: bool, context: &gdk::DragContext) { 174 unsafe { 175 gtk_sys::gtk_places_sidebar_set_drop_targets_visible( 176 self.to_glib_none().0, 177 visible.to_glib(), 178 context.to_glib_none().0, 179 ); 180 } 181 } 182 set_local_only(&self, local_only: bool)183 pub fn set_local_only(&self, local_only: bool) { 184 unsafe { 185 gtk_sys::gtk_places_sidebar_set_local_only(self.to_glib_none().0, local_only.to_glib()); 186 } 187 } 188 set_location<P: IsA<gio::File>>(&self, location: Option<&P>)189 pub fn set_location<P: IsA<gio::File>>(&self, location: Option<&P>) { 190 unsafe { 191 gtk_sys::gtk_places_sidebar_set_location( 192 self.to_glib_none().0, 193 location.map(|p| p.as_ref()).to_glib_none().0, 194 ); 195 } 196 } 197 set_open_flags(&self, flags: PlacesOpenFlags)198 pub fn set_open_flags(&self, flags: PlacesOpenFlags) { 199 unsafe { 200 gtk_sys::gtk_places_sidebar_set_open_flags(self.to_glib_none().0, flags.to_glib()); 201 } 202 } 203 204 #[cfg_attr(feature = "v3_18", deprecated)] set_show_connect_to_server(&self, show_connect_to_server: bool)205 pub fn set_show_connect_to_server(&self, show_connect_to_server: bool) { 206 unsafe { 207 gtk_sys::gtk_places_sidebar_set_show_connect_to_server( 208 self.to_glib_none().0, 209 show_connect_to_server.to_glib(), 210 ); 211 } 212 } 213 set_show_desktop(&self, show_desktop: bool)214 pub fn set_show_desktop(&self, show_desktop: bool) { 215 unsafe { 216 gtk_sys::gtk_places_sidebar_set_show_desktop( 217 self.to_glib_none().0, 218 show_desktop.to_glib(), 219 ); 220 } 221 } 222 set_show_enter_location(&self, show_enter_location: bool)223 pub fn set_show_enter_location(&self, show_enter_location: bool) { 224 unsafe { 225 gtk_sys::gtk_places_sidebar_set_show_enter_location( 226 self.to_glib_none().0, 227 show_enter_location.to_glib(), 228 ); 229 } 230 } 231 232 #[cfg(any(feature = "v3_18", feature = "dox"))] set_show_other_locations(&self, show_other_locations: bool)233 pub fn set_show_other_locations(&self, show_other_locations: bool) { 234 unsafe { 235 gtk_sys::gtk_places_sidebar_set_show_other_locations( 236 self.to_glib_none().0, 237 show_other_locations.to_glib(), 238 ); 239 } 240 } 241 242 #[cfg(any(feature = "v3_18", feature = "dox"))] set_show_recent(&self, show_recent: bool)243 pub fn set_show_recent(&self, show_recent: bool) { 244 unsafe { 245 gtk_sys::gtk_places_sidebar_set_show_recent( 246 self.to_glib_none().0, 247 show_recent.to_glib(), 248 ); 249 } 250 } 251 252 #[cfg(any(feature = "v3_22_26", feature = "dox"))] set_show_starred_location(&self, show_starred_location: bool)253 pub fn set_show_starred_location(&self, show_starred_location: bool) { 254 unsafe { 255 gtk_sys::gtk_places_sidebar_set_show_starred_location( 256 self.to_glib_none().0, 257 show_starred_location.to_glib(), 258 ); 259 } 260 } 261 262 #[cfg(any(feature = "v3_18", feature = "dox"))] set_show_trash(&self, show_trash: bool)263 pub fn set_show_trash(&self, show_trash: bool) { 264 unsafe { 265 gtk_sys::gtk_places_sidebar_set_show_trash(self.to_glib_none().0, show_trash.to_glib()); 266 } 267 } 268 269 #[cfg(any(feature = "v3_18", feature = "dox"))] get_property_populate_all(&self) -> bool270 pub fn get_property_populate_all(&self) -> bool { 271 unsafe { 272 let mut value = Value::from_type(<bool as StaticType>::static_type()); 273 gobject_sys::g_object_get_property( 274 self.as_ptr() as *mut gobject_sys::GObject, 275 b"populate-all\0".as_ptr() as *const _, 276 value.to_glib_none_mut().0, 277 ); 278 value 279 .get() 280 .expect("Return Value for property `populate-all` getter") 281 .unwrap() 282 } 283 } 284 285 #[cfg(any(feature = "v3_18", feature = "dox"))] set_property_populate_all(&self, populate_all: bool)286 pub fn set_property_populate_all(&self, populate_all: bool) { 287 unsafe { 288 gobject_sys::g_object_set_property( 289 self.as_ptr() as *mut gobject_sys::GObject, 290 b"populate-all\0".as_ptr() as *const _, 291 Value::from(&populate_all).to_glib_none().0, 292 ); 293 } 294 } 295 get_property_show_other_locations(&self) -> bool296 pub fn get_property_show_other_locations(&self) -> bool { 297 unsafe { 298 let mut value = Value::from_type(<bool as StaticType>::static_type()); 299 gobject_sys::g_object_get_property( 300 self.as_ptr() as *mut gobject_sys::GObject, 301 b"show-other-locations\0".as_ptr() as *const _, 302 value.to_glib_none_mut().0, 303 ); 304 value 305 .get() 306 .expect("Return Value for property `show-other-locations` getter") 307 .unwrap() 308 } 309 } 310 set_property_show_other_locations(&self, show_other_locations: bool)311 pub fn set_property_show_other_locations(&self, show_other_locations: bool) { 312 unsafe { 313 gobject_sys::g_object_set_property( 314 self.as_ptr() as *mut gobject_sys::GObject, 315 b"show-other-locations\0".as_ptr() as *const _, 316 Value::from(&show_other_locations).to_glib_none().0, 317 ); 318 } 319 } 320 get_property_show_recent(&self) -> bool321 pub fn get_property_show_recent(&self) -> bool { 322 unsafe { 323 let mut value = Value::from_type(<bool as StaticType>::static_type()); 324 gobject_sys::g_object_get_property( 325 self.as_ptr() as *mut gobject_sys::GObject, 326 b"show-recent\0".as_ptr() as *const _, 327 value.to_glib_none_mut().0, 328 ); 329 value 330 .get() 331 .expect("Return Value for property `show-recent` getter") 332 .unwrap() 333 } 334 } 335 set_property_show_recent(&self, show_recent: bool)336 pub fn set_property_show_recent(&self, show_recent: bool) { 337 unsafe { 338 gobject_sys::g_object_set_property( 339 self.as_ptr() as *mut gobject_sys::GObject, 340 b"show-recent\0".as_ptr() as *const _, 341 Value::from(&show_recent).to_glib_none().0, 342 ); 343 } 344 } 345 get_property_show_trash(&self) -> bool346 pub fn get_property_show_trash(&self) -> bool { 347 unsafe { 348 let mut value = Value::from_type(<bool as StaticType>::static_type()); 349 gobject_sys::g_object_get_property( 350 self.as_ptr() as *mut gobject_sys::GObject, 351 b"show-trash\0".as_ptr() as *const _, 352 value.to_glib_none_mut().0, 353 ); 354 value 355 .get() 356 .expect("Return Value for property `show-trash` getter") 357 .unwrap() 358 } 359 } 360 set_property_show_trash(&self, show_trash: bool)361 pub fn set_property_show_trash(&self, show_trash: bool) { 362 unsafe { 363 gobject_sys::g_object_set_property( 364 self.as_ptr() as *mut gobject_sys::GObject, 365 b"show-trash\0".as_ptr() as *const _, 366 Value::from(&show_trash).to_glib_none().0, 367 ); 368 } 369 } 370 connect_drag_action_ask<F: Fn(&PlacesSidebar, i32) -> i32 + 'static>( &self, f: F, ) -> SignalHandlerId371 pub fn connect_drag_action_ask<F: Fn(&PlacesSidebar, i32) -> i32 + 'static>( 372 &self, 373 f: F, 374 ) -> SignalHandlerId { 375 unsafe extern "C" fn drag_action_ask_trampoline< 376 F: Fn(&PlacesSidebar, i32) -> i32 + 'static, 377 >( 378 this: *mut gtk_sys::GtkPlacesSidebar, 379 actions: libc::c_int, 380 f: glib_sys::gpointer, 381 ) -> libc::c_int { 382 let f: &F = &*(f as *const F); 383 f(&from_glib_borrow(this), actions) 384 } 385 unsafe { 386 let f: Box_<F> = Box_::new(f); 387 connect_raw( 388 self.as_ptr() as *mut _, 389 b"drag-action-ask\0".as_ptr() as *const _, 390 Some(transmute(drag_action_ask_trampoline::<F> as usize)), 391 Box_::into_raw(f), 392 ) 393 } 394 } 395 396 #[cfg(any(feature = "v3_20", feature = "dox"))] connect_mount<F: Fn(&PlacesSidebar, &gio::MountOperation) + 'static>( &self, f: F, ) -> SignalHandlerId397 pub fn connect_mount<F: Fn(&PlacesSidebar, &gio::MountOperation) + 'static>( 398 &self, 399 f: F, 400 ) -> SignalHandlerId { 401 unsafe extern "C" fn mount_trampoline< 402 F: Fn(&PlacesSidebar, &gio::MountOperation) + 'static, 403 >( 404 this: *mut gtk_sys::GtkPlacesSidebar, 405 mount_operation: *mut gio_sys::GMountOperation, 406 f: glib_sys::gpointer, 407 ) { 408 let f: &F = &*(f as *const F); 409 f(&from_glib_borrow(this), &from_glib_borrow(mount_operation)) 410 } 411 unsafe { 412 let f: Box_<F> = Box_::new(f); 413 connect_raw( 414 self.as_ptr() as *mut _, 415 b"mount\0".as_ptr() as *const _, 416 Some(transmute(mount_trampoline::<F> as usize)), 417 Box_::into_raw(f), 418 ) 419 } 420 } 421 connect_open_location<F: Fn(&PlacesSidebar, &gio::File, PlacesOpenFlags) + 'static>( &self, f: F, ) -> SignalHandlerId422 pub fn connect_open_location<F: Fn(&PlacesSidebar, &gio::File, PlacesOpenFlags) + 'static>( 423 &self, 424 f: F, 425 ) -> SignalHandlerId { 426 unsafe extern "C" fn open_location_trampoline< 427 F: Fn(&PlacesSidebar, &gio::File, PlacesOpenFlags) + 'static, 428 >( 429 this: *mut gtk_sys::GtkPlacesSidebar, 430 location: *mut gio_sys::GFile, 431 open_flags: gtk_sys::GtkPlacesOpenFlags, 432 f: glib_sys::gpointer, 433 ) { 434 let f: &F = &*(f as *const F); 435 f( 436 &from_glib_borrow(this), 437 &from_glib_borrow(location), 438 from_glib(open_flags), 439 ) 440 } 441 unsafe { 442 let f: Box_<F> = Box_::new(f); 443 connect_raw( 444 self.as_ptr() as *mut _, 445 b"open-location\0".as_ptr() as *const _, 446 Some(transmute(open_location_trampoline::<F> as usize)), 447 Box_::into_raw(f), 448 ) 449 } 450 } 451 452 //pub fn connect_populate_popup<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId { 453 // Ignored selected_volume: Gio.Volume 454 //} 455 456 #[cfg_attr(feature = "v3_18", deprecated)] connect_show_connect_to_server<F: Fn(&PlacesSidebar) + 'static>( &self, f: F, ) -> SignalHandlerId457 pub fn connect_show_connect_to_server<F: Fn(&PlacesSidebar) + 'static>( 458 &self, 459 f: F, 460 ) -> SignalHandlerId { 461 unsafe extern "C" fn show_connect_to_server_trampoline<F: Fn(&PlacesSidebar) + 'static>( 462 this: *mut gtk_sys::GtkPlacesSidebar, 463 f: glib_sys::gpointer, 464 ) { 465 let f: &F = &*(f as *const F); 466 f(&from_glib_borrow(this)) 467 } 468 unsafe { 469 let f: Box_<F> = Box_::new(f); 470 connect_raw( 471 self.as_ptr() as *mut _, 472 b"show-connect-to-server\0".as_ptr() as *const _, 473 Some(transmute(show_connect_to_server_trampoline::<F> as usize)), 474 Box_::into_raw(f), 475 ) 476 } 477 } 478 connect_show_enter_location<F: Fn(&PlacesSidebar) + 'static>( &self, f: F, ) -> SignalHandlerId479 pub fn connect_show_enter_location<F: Fn(&PlacesSidebar) + 'static>( 480 &self, 481 f: F, 482 ) -> SignalHandlerId { 483 unsafe extern "C" fn show_enter_location_trampoline<F: Fn(&PlacesSidebar) + 'static>( 484 this: *mut gtk_sys::GtkPlacesSidebar, 485 f: glib_sys::gpointer, 486 ) { 487 let f: &F = &*(f as *const F); 488 f(&from_glib_borrow(this)) 489 } 490 unsafe { 491 let f: Box_<F> = Box_::new(f); 492 connect_raw( 493 self.as_ptr() as *mut _, 494 b"show-enter-location\0".as_ptr() as *const _, 495 Some(transmute(show_enter_location_trampoline::<F> as usize)), 496 Box_::into_raw(f), 497 ) 498 } 499 } 500 connect_show_error_message<F: Fn(&PlacesSidebar, &str, &str) + 'static>( &self, f: F, ) -> SignalHandlerId501 pub fn connect_show_error_message<F: Fn(&PlacesSidebar, &str, &str) + 'static>( 502 &self, 503 f: F, 504 ) -> SignalHandlerId { 505 unsafe extern "C" fn show_error_message_trampoline< 506 F: Fn(&PlacesSidebar, &str, &str) + 'static, 507 >( 508 this: *mut gtk_sys::GtkPlacesSidebar, 509 primary: *mut libc::c_char, 510 secondary: *mut libc::c_char, 511 f: glib_sys::gpointer, 512 ) { 513 let f: &F = &*(f as *const F); 514 f( 515 &from_glib_borrow(this), 516 &GString::from_glib_borrow(primary), 517 &GString::from_glib_borrow(secondary), 518 ) 519 } 520 unsafe { 521 let f: Box_<F> = Box_::new(f); 522 connect_raw( 523 self.as_ptr() as *mut _, 524 b"show-error-message\0".as_ptr() as *const _, 525 Some(transmute(show_error_message_trampoline::<F> as usize)), 526 Box_::into_raw(f), 527 ) 528 } 529 } 530 531 #[cfg_attr(feature = "v3_20", deprecated)] 532 #[cfg(any(feature = "v3_18", feature = "dox"))] connect_show_other_locations<F: Fn(&PlacesSidebar) + 'static>( &self, f: F, ) -> SignalHandlerId533 pub fn connect_show_other_locations<F: Fn(&PlacesSidebar) + 'static>( 534 &self, 535 f: F, 536 ) -> SignalHandlerId { 537 unsafe extern "C" fn show_other_locations_trampoline<F: Fn(&PlacesSidebar) + 'static>( 538 this: *mut gtk_sys::GtkPlacesSidebar, 539 f: glib_sys::gpointer, 540 ) { 541 let f: &F = &*(f as *const F); 542 f(&from_glib_borrow(this)) 543 } 544 unsafe { 545 let f: Box_<F> = Box_::new(f); 546 connect_raw( 547 self.as_ptr() as *mut _, 548 b"show-other-locations\0".as_ptr() as *const _, 549 Some(transmute(show_other_locations_trampoline::<F> as usize)), 550 Box_::into_raw(f), 551 ) 552 } 553 } 554 555 #[cfg(any(feature = "v3_20", feature = "dox"))] connect_show_other_locations_with_flags< F: Fn(&PlacesSidebar, PlacesOpenFlags) + 'static, >( &self, f: F, ) -> SignalHandlerId556 pub fn connect_show_other_locations_with_flags< 557 F: Fn(&PlacesSidebar, PlacesOpenFlags) + 'static, 558 >( 559 &self, 560 f: F, 561 ) -> SignalHandlerId { 562 unsafe extern "C" fn show_other_locations_with_flags_trampoline< 563 F: Fn(&PlacesSidebar, PlacesOpenFlags) + 'static, 564 >( 565 this: *mut gtk_sys::GtkPlacesSidebar, 566 open_flags: gtk_sys::GtkPlacesOpenFlags, 567 f: glib_sys::gpointer, 568 ) { 569 let f: &F = &*(f as *const F); 570 f(&from_glib_borrow(this), from_glib(open_flags)) 571 } 572 unsafe { 573 let f: Box_<F> = Box_::new(f); 574 connect_raw( 575 self.as_ptr() as *mut _, 576 b"show-other-locations-with-flags\0".as_ptr() as *const _, 577 Some(transmute( 578 show_other_locations_with_flags_trampoline::<F> as usize, 579 )), 580 Box_::into_raw(f), 581 ) 582 } 583 } 584 585 #[cfg(any(feature = "v3_22_26", feature = "dox"))] connect_show_starred_location<F: Fn(&PlacesSidebar, PlacesOpenFlags) + 'static>( &self, f: F, ) -> SignalHandlerId586 pub fn connect_show_starred_location<F: Fn(&PlacesSidebar, PlacesOpenFlags) + 'static>( 587 &self, 588 f: F, 589 ) -> SignalHandlerId { 590 unsafe extern "C" fn show_starred_location_trampoline< 591 F: Fn(&PlacesSidebar, PlacesOpenFlags) + 'static, 592 >( 593 this: *mut gtk_sys::GtkPlacesSidebar, 594 open_flags: gtk_sys::GtkPlacesOpenFlags, 595 f: glib_sys::gpointer, 596 ) { 597 let f: &F = &*(f as *const F); 598 f(&from_glib_borrow(this), from_glib(open_flags)) 599 } 600 unsafe { 601 let f: Box_<F> = Box_::new(f); 602 connect_raw( 603 self.as_ptr() as *mut _, 604 b"show-starred-location\0".as_ptr() as *const _, 605 Some(transmute(show_starred_location_trampoline::<F> as usize)), 606 Box_::into_raw(f), 607 ) 608 } 609 } 610 611 #[cfg(any(feature = "v3_20", feature = "dox"))] connect_unmount<F: Fn(&PlacesSidebar, &gio::MountOperation) + 'static>( &self, f: F, ) -> SignalHandlerId612 pub fn connect_unmount<F: Fn(&PlacesSidebar, &gio::MountOperation) + 'static>( 613 &self, 614 f: F, 615 ) -> SignalHandlerId { 616 unsafe extern "C" fn unmount_trampoline< 617 F: Fn(&PlacesSidebar, &gio::MountOperation) + 'static, 618 >( 619 this: *mut gtk_sys::GtkPlacesSidebar, 620 mount_operation: *mut gio_sys::GMountOperation, 621 f: glib_sys::gpointer, 622 ) { 623 let f: &F = &*(f as *const F); 624 f(&from_glib_borrow(this), &from_glib_borrow(mount_operation)) 625 } 626 unsafe { 627 let f: Box_<F> = Box_::new(f); 628 connect_raw( 629 self.as_ptr() as *mut _, 630 b"unmount\0".as_ptr() as *const _, 631 Some(transmute(unmount_trampoline::<F> as usize)), 632 Box_::into_raw(f), 633 ) 634 } 635 } 636 connect_property_local_only_notify<F: Fn(&PlacesSidebar) + 'static>( &self, f: F, ) -> SignalHandlerId637 pub fn connect_property_local_only_notify<F: Fn(&PlacesSidebar) + 'static>( 638 &self, 639 f: F, 640 ) -> SignalHandlerId { 641 unsafe extern "C" fn notify_local_only_trampoline<F: Fn(&PlacesSidebar) + 'static>( 642 this: *mut gtk_sys::GtkPlacesSidebar, 643 _param_spec: glib_sys::gpointer, 644 f: glib_sys::gpointer, 645 ) { 646 let f: &F = &*(f as *const F); 647 f(&from_glib_borrow(this)) 648 } 649 unsafe { 650 let f: Box_<F> = Box_::new(f); 651 connect_raw( 652 self.as_ptr() as *mut _, 653 b"notify::local-only\0".as_ptr() as *const _, 654 Some(transmute(notify_local_only_trampoline::<F> as usize)), 655 Box_::into_raw(f), 656 ) 657 } 658 } 659 connect_property_location_notify<F: Fn(&PlacesSidebar) + 'static>( &self, f: F, ) -> SignalHandlerId660 pub fn connect_property_location_notify<F: Fn(&PlacesSidebar) + 'static>( 661 &self, 662 f: F, 663 ) -> SignalHandlerId { 664 unsafe extern "C" fn notify_location_trampoline<F: Fn(&PlacesSidebar) + 'static>( 665 this: *mut gtk_sys::GtkPlacesSidebar, 666 _param_spec: glib_sys::gpointer, 667 f: glib_sys::gpointer, 668 ) { 669 let f: &F = &*(f as *const F); 670 f(&from_glib_borrow(this)) 671 } 672 unsafe { 673 let f: Box_<F> = Box_::new(f); 674 connect_raw( 675 self.as_ptr() as *mut _, 676 b"notify::location\0".as_ptr() as *const _, 677 Some(transmute(notify_location_trampoline::<F> as usize)), 678 Box_::into_raw(f), 679 ) 680 } 681 } 682 connect_property_open_flags_notify<F: Fn(&PlacesSidebar) + 'static>( &self, f: F, ) -> SignalHandlerId683 pub fn connect_property_open_flags_notify<F: Fn(&PlacesSidebar) + 'static>( 684 &self, 685 f: F, 686 ) -> SignalHandlerId { 687 unsafe extern "C" fn notify_open_flags_trampoline<F: Fn(&PlacesSidebar) + 'static>( 688 this: *mut gtk_sys::GtkPlacesSidebar, 689 _param_spec: glib_sys::gpointer, 690 f: glib_sys::gpointer, 691 ) { 692 let f: &F = &*(f as *const F); 693 f(&from_glib_borrow(this)) 694 } 695 unsafe { 696 let f: Box_<F> = Box_::new(f); 697 connect_raw( 698 self.as_ptr() as *mut _, 699 b"notify::open-flags\0".as_ptr() as *const _, 700 Some(transmute(notify_open_flags_trampoline::<F> as usize)), 701 Box_::into_raw(f), 702 ) 703 } 704 } 705 706 #[cfg(any(feature = "v3_18", feature = "dox"))] connect_property_populate_all_notify<F: Fn(&PlacesSidebar) + 'static>( &self, f: F, ) -> SignalHandlerId707 pub fn connect_property_populate_all_notify<F: Fn(&PlacesSidebar) + 'static>( 708 &self, 709 f: F, 710 ) -> SignalHandlerId { 711 unsafe extern "C" fn notify_populate_all_trampoline<F: Fn(&PlacesSidebar) + 'static>( 712 this: *mut gtk_sys::GtkPlacesSidebar, 713 _param_spec: glib_sys::gpointer, 714 f: glib_sys::gpointer, 715 ) { 716 let f: &F = &*(f as *const F); 717 f(&from_glib_borrow(this)) 718 } 719 unsafe { 720 let f: Box_<F> = Box_::new(f); 721 connect_raw( 722 self.as_ptr() as *mut _, 723 b"notify::populate-all\0".as_ptr() as *const _, 724 Some(transmute(notify_populate_all_trampoline::<F> as usize)), 725 Box_::into_raw(f), 726 ) 727 } 728 } 729 connect_property_show_connect_to_server_notify<F: Fn(&PlacesSidebar) + 'static>( &self, f: F, ) -> SignalHandlerId730 pub fn connect_property_show_connect_to_server_notify<F: Fn(&PlacesSidebar) + 'static>( 731 &self, 732 f: F, 733 ) -> SignalHandlerId { 734 unsafe extern "C" fn notify_show_connect_to_server_trampoline< 735 F: Fn(&PlacesSidebar) + 'static, 736 >( 737 this: *mut gtk_sys::GtkPlacesSidebar, 738 _param_spec: glib_sys::gpointer, 739 f: glib_sys::gpointer, 740 ) { 741 let f: &F = &*(f as *const F); 742 f(&from_glib_borrow(this)) 743 } 744 unsafe { 745 let f: Box_<F> = Box_::new(f); 746 connect_raw( 747 self.as_ptr() as *mut _, 748 b"notify::show-connect-to-server\0".as_ptr() as *const _, 749 Some(transmute( 750 notify_show_connect_to_server_trampoline::<F> as usize, 751 )), 752 Box_::into_raw(f), 753 ) 754 } 755 } 756 connect_property_show_desktop_notify<F: Fn(&PlacesSidebar) + 'static>( &self, f: F, ) -> SignalHandlerId757 pub fn connect_property_show_desktop_notify<F: Fn(&PlacesSidebar) + 'static>( 758 &self, 759 f: F, 760 ) -> SignalHandlerId { 761 unsafe extern "C" fn notify_show_desktop_trampoline<F: Fn(&PlacesSidebar) + 'static>( 762 this: *mut gtk_sys::GtkPlacesSidebar, 763 _param_spec: glib_sys::gpointer, 764 f: glib_sys::gpointer, 765 ) { 766 let f: &F = &*(f as *const F); 767 f(&from_glib_borrow(this)) 768 } 769 unsafe { 770 let f: Box_<F> = Box_::new(f); 771 connect_raw( 772 self.as_ptr() as *mut _, 773 b"notify::show-desktop\0".as_ptr() as *const _, 774 Some(transmute(notify_show_desktop_trampoline::<F> as usize)), 775 Box_::into_raw(f), 776 ) 777 } 778 } 779 connect_property_show_enter_location_notify<F: Fn(&PlacesSidebar) + 'static>( &self, f: F, ) -> SignalHandlerId780 pub fn connect_property_show_enter_location_notify<F: Fn(&PlacesSidebar) + 'static>( 781 &self, 782 f: F, 783 ) -> SignalHandlerId { 784 unsafe extern "C" fn notify_show_enter_location_trampoline< 785 F: Fn(&PlacesSidebar) + 'static, 786 >( 787 this: *mut gtk_sys::GtkPlacesSidebar, 788 _param_spec: glib_sys::gpointer, 789 f: glib_sys::gpointer, 790 ) { 791 let f: &F = &*(f as *const F); 792 f(&from_glib_borrow(this)) 793 } 794 unsafe { 795 let f: Box_<F> = Box_::new(f); 796 connect_raw( 797 self.as_ptr() as *mut _, 798 b"notify::show-enter-location\0".as_ptr() as *const _, 799 Some(transmute( 800 notify_show_enter_location_trampoline::<F> as usize, 801 )), 802 Box_::into_raw(f), 803 ) 804 } 805 } 806 connect_property_show_other_locations_notify<F: Fn(&PlacesSidebar) + 'static>( &self, f: F, ) -> SignalHandlerId807 pub fn connect_property_show_other_locations_notify<F: Fn(&PlacesSidebar) + 'static>( 808 &self, 809 f: F, 810 ) -> SignalHandlerId { 811 unsafe extern "C" fn notify_show_other_locations_trampoline< 812 F: Fn(&PlacesSidebar) + 'static, 813 >( 814 this: *mut gtk_sys::GtkPlacesSidebar, 815 _param_spec: glib_sys::gpointer, 816 f: glib_sys::gpointer, 817 ) { 818 let f: &F = &*(f as *const F); 819 f(&from_glib_borrow(this)) 820 } 821 unsafe { 822 let f: Box_<F> = Box_::new(f); 823 connect_raw( 824 self.as_ptr() as *mut _, 825 b"notify::show-other-locations\0".as_ptr() as *const _, 826 Some(transmute( 827 notify_show_other_locations_trampoline::<F> as usize, 828 )), 829 Box_::into_raw(f), 830 ) 831 } 832 } 833 connect_property_show_recent_notify<F: Fn(&PlacesSidebar) + 'static>( &self, f: F, ) -> SignalHandlerId834 pub fn connect_property_show_recent_notify<F: Fn(&PlacesSidebar) + 'static>( 835 &self, 836 f: F, 837 ) -> SignalHandlerId { 838 unsafe extern "C" fn notify_show_recent_trampoline<F: Fn(&PlacesSidebar) + 'static>( 839 this: *mut gtk_sys::GtkPlacesSidebar, 840 _param_spec: glib_sys::gpointer, 841 f: glib_sys::gpointer, 842 ) { 843 let f: &F = &*(f as *const F); 844 f(&from_glib_borrow(this)) 845 } 846 unsafe { 847 let f: Box_<F> = Box_::new(f); 848 connect_raw( 849 self.as_ptr() as *mut _, 850 b"notify::show-recent\0".as_ptr() as *const _, 851 Some(transmute(notify_show_recent_trampoline::<F> as usize)), 852 Box_::into_raw(f), 853 ) 854 } 855 } 856 857 #[cfg(any(feature = "v3_22_26", feature = "dox"))] connect_property_show_starred_location_notify<F: Fn(&PlacesSidebar) + 'static>( &self, f: F, ) -> SignalHandlerId858 pub fn connect_property_show_starred_location_notify<F: Fn(&PlacesSidebar) + 'static>( 859 &self, 860 f: F, 861 ) -> SignalHandlerId { 862 unsafe extern "C" fn notify_show_starred_location_trampoline< 863 F: Fn(&PlacesSidebar) + 'static, 864 >( 865 this: *mut gtk_sys::GtkPlacesSidebar, 866 _param_spec: glib_sys::gpointer, 867 f: glib_sys::gpointer, 868 ) { 869 let f: &F = &*(f as *const F); 870 f(&from_glib_borrow(this)) 871 } 872 unsafe { 873 let f: Box_<F> = Box_::new(f); 874 connect_raw( 875 self.as_ptr() as *mut _, 876 b"notify::show-starred-location\0".as_ptr() as *const _, 877 Some(transmute( 878 notify_show_starred_location_trampoline::<F> as usize, 879 )), 880 Box_::into_raw(f), 881 ) 882 } 883 } 884 connect_property_show_trash_notify<F: Fn(&PlacesSidebar) + 'static>( &self, f: F, ) -> SignalHandlerId885 pub fn connect_property_show_trash_notify<F: Fn(&PlacesSidebar) + 'static>( 886 &self, 887 f: F, 888 ) -> SignalHandlerId { 889 unsafe extern "C" fn notify_show_trash_trampoline<F: Fn(&PlacesSidebar) + 'static>( 890 this: *mut gtk_sys::GtkPlacesSidebar, 891 _param_spec: glib_sys::gpointer, 892 f: glib_sys::gpointer, 893 ) { 894 let f: &F = &*(f as *const F); 895 f(&from_glib_borrow(this)) 896 } 897 unsafe { 898 let f: Box_<F> = Box_::new(f); 899 connect_raw( 900 self.as_ptr() as *mut _, 901 b"notify::show-trash\0".as_ptr() as *const _, 902 Some(transmute(notify_show_trash_trampoline::<F> as usize)), 903 Box_::into_raw(f), 904 ) 905 } 906 } 907 } 908 909 impl Default for PlacesSidebar { default() -> Self910 fn default() -> Self { 911 Self::new() 912 } 913 } 914 915 #[derive(Clone, Default)] 916 pub struct PlacesSidebarBuilder { 917 local_only: Option<bool>, 918 location: Option<gio::File>, 919 open_flags: Option<PlacesOpenFlags>, 920 #[cfg(any(feature = "v3_18", feature = "dox"))] 921 populate_all: Option<bool>, 922 show_connect_to_server: Option<bool>, 923 show_desktop: Option<bool>, 924 show_enter_location: Option<bool>, 925 show_other_locations: Option<bool>, 926 show_recent: Option<bool>, 927 #[cfg(any(feature = "v3_22_26", feature = "dox"))] 928 show_starred_location: Option<bool>, 929 show_trash: Option<bool>, 930 hadjustment: Option<Adjustment>, 931 hscrollbar_policy: Option<PolicyType>, 932 kinetic_scrolling: Option<bool>, 933 #[cfg(any(feature = "v3_22", feature = "dox"))] 934 max_content_height: Option<i32>, 935 #[cfg(any(feature = "v3_22", feature = "dox"))] 936 max_content_width: Option<i32>, 937 min_content_height: Option<i32>, 938 min_content_width: Option<i32>, 939 #[cfg(any(feature = "v3_16", feature = "dox"))] 940 overlay_scrolling: Option<bool>, 941 #[cfg(any(feature = "v3_22", feature = "dox"))] 942 propagate_natural_height: Option<bool>, 943 #[cfg(any(feature = "v3_22", feature = "dox"))] 944 propagate_natural_width: Option<bool>, 945 shadow_type: Option<ShadowType>, 946 vadjustment: Option<Adjustment>, 947 vscrollbar_policy: Option<PolicyType>, 948 window_placement: Option<CornerType>, 949 border_width: Option<u32>, 950 child: Option<Widget>, 951 resize_mode: Option<ResizeMode>, 952 app_paintable: Option<bool>, 953 can_default: Option<bool>, 954 can_focus: Option<bool>, 955 events: Option<gdk::EventMask>, 956 expand: Option<bool>, 957 #[cfg(any(feature = "v3_20", feature = "dox"))] 958 focus_on_click: Option<bool>, 959 halign: Option<Align>, 960 has_default: Option<bool>, 961 has_focus: Option<bool>, 962 has_tooltip: Option<bool>, 963 height_request: Option<i32>, 964 hexpand: Option<bool>, 965 hexpand_set: Option<bool>, 966 is_focus: Option<bool>, 967 margin: Option<i32>, 968 margin_bottom: Option<i32>, 969 margin_end: Option<i32>, 970 margin_start: Option<i32>, 971 margin_top: Option<i32>, 972 name: Option<String>, 973 no_show_all: Option<bool>, 974 opacity: Option<f64>, 975 parent: Option<Container>, 976 receives_default: Option<bool>, 977 sensitive: Option<bool>, 978 tooltip_markup: Option<String>, 979 tooltip_text: Option<String>, 980 valign: Option<Align>, 981 vexpand: Option<bool>, 982 vexpand_set: Option<bool>, 983 visible: Option<bool>, 984 width_request: Option<i32>, 985 } 986 987 impl PlacesSidebarBuilder { new() -> Self988 pub fn new() -> Self { 989 Self::default() 990 } 991 build(self) -> PlacesSidebar992 pub fn build(self) -> PlacesSidebar { 993 let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; 994 if let Some(ref local_only) = self.local_only { 995 properties.push(("local-only", local_only)); 996 } 997 if let Some(ref location) = self.location { 998 properties.push(("location", location)); 999 } 1000 if let Some(ref open_flags) = self.open_flags { 1001 properties.push(("open-flags", open_flags)); 1002 } 1003 #[cfg(any(feature = "v3_18", feature = "dox"))] 1004 { 1005 if let Some(ref populate_all) = self.populate_all { 1006 properties.push(("populate-all", populate_all)); 1007 } 1008 } 1009 if let Some(ref show_connect_to_server) = self.show_connect_to_server { 1010 properties.push(("show-connect-to-server", show_connect_to_server)); 1011 } 1012 if let Some(ref show_desktop) = self.show_desktop { 1013 properties.push(("show-desktop", show_desktop)); 1014 } 1015 if let Some(ref show_enter_location) = self.show_enter_location { 1016 properties.push(("show-enter-location", show_enter_location)); 1017 } 1018 if let Some(ref show_other_locations) = self.show_other_locations { 1019 properties.push(("show-other-locations", show_other_locations)); 1020 } 1021 if let Some(ref show_recent) = self.show_recent { 1022 properties.push(("show-recent", show_recent)); 1023 } 1024 #[cfg(any(feature = "v3_22_26", feature = "dox"))] 1025 { 1026 if let Some(ref show_starred_location) = self.show_starred_location { 1027 properties.push(("show-starred-location", show_starred_location)); 1028 } 1029 } 1030 if let Some(ref show_trash) = self.show_trash { 1031 properties.push(("show-trash", show_trash)); 1032 } 1033 if let Some(ref hadjustment) = self.hadjustment { 1034 properties.push(("hadjustment", hadjustment)); 1035 } 1036 if let Some(ref hscrollbar_policy) = self.hscrollbar_policy { 1037 properties.push(("hscrollbar-policy", hscrollbar_policy)); 1038 } 1039 if let Some(ref kinetic_scrolling) = self.kinetic_scrolling { 1040 properties.push(("kinetic-scrolling", kinetic_scrolling)); 1041 } 1042 #[cfg(any(feature = "v3_22", feature = "dox"))] 1043 { 1044 if let Some(ref max_content_height) = self.max_content_height { 1045 properties.push(("max-content-height", max_content_height)); 1046 } 1047 } 1048 #[cfg(any(feature = "v3_22", feature = "dox"))] 1049 { 1050 if let Some(ref max_content_width) = self.max_content_width { 1051 properties.push(("max-content-width", max_content_width)); 1052 } 1053 } 1054 if let Some(ref min_content_height) = self.min_content_height { 1055 properties.push(("min-content-height", min_content_height)); 1056 } 1057 if let Some(ref min_content_width) = self.min_content_width { 1058 properties.push(("min-content-width", min_content_width)); 1059 } 1060 #[cfg(any(feature = "v3_16", feature = "dox"))] 1061 { 1062 if let Some(ref overlay_scrolling) = self.overlay_scrolling { 1063 properties.push(("overlay-scrolling", overlay_scrolling)); 1064 } 1065 } 1066 #[cfg(any(feature = "v3_22", feature = "dox"))] 1067 { 1068 if let Some(ref propagate_natural_height) = self.propagate_natural_height { 1069 properties.push(("propagate-natural-height", propagate_natural_height)); 1070 } 1071 } 1072 #[cfg(any(feature = "v3_22", feature = "dox"))] 1073 { 1074 if let Some(ref propagate_natural_width) = self.propagate_natural_width { 1075 properties.push(("propagate-natural-width", propagate_natural_width)); 1076 } 1077 } 1078 if let Some(ref shadow_type) = self.shadow_type { 1079 properties.push(("shadow-type", shadow_type)); 1080 } 1081 if let Some(ref vadjustment) = self.vadjustment { 1082 properties.push(("vadjustment", vadjustment)); 1083 } 1084 if let Some(ref vscrollbar_policy) = self.vscrollbar_policy { 1085 properties.push(("vscrollbar-policy", vscrollbar_policy)); 1086 } 1087 if let Some(ref window_placement) = self.window_placement { 1088 properties.push(("window-placement", window_placement)); 1089 } 1090 if let Some(ref border_width) = self.border_width { 1091 properties.push(("border-width", border_width)); 1092 } 1093 if let Some(ref child) = self.child { 1094 properties.push(("child", child)); 1095 } 1096 if let Some(ref resize_mode) = self.resize_mode { 1097 properties.push(("resize-mode", resize_mode)); 1098 } 1099 if let Some(ref app_paintable) = self.app_paintable { 1100 properties.push(("app-paintable", app_paintable)); 1101 } 1102 if let Some(ref can_default) = self.can_default { 1103 properties.push(("can-default", can_default)); 1104 } 1105 if let Some(ref can_focus) = self.can_focus { 1106 properties.push(("can-focus", can_focus)); 1107 } 1108 if let Some(ref events) = self.events { 1109 properties.push(("events", events)); 1110 } 1111 if let Some(ref expand) = self.expand { 1112 properties.push(("expand", expand)); 1113 } 1114 #[cfg(any(feature = "v3_20", feature = "dox"))] 1115 { 1116 if let Some(ref focus_on_click) = self.focus_on_click { 1117 properties.push(("focus-on-click", focus_on_click)); 1118 } 1119 } 1120 if let Some(ref halign) = self.halign { 1121 properties.push(("halign", halign)); 1122 } 1123 if let Some(ref has_default) = self.has_default { 1124 properties.push(("has-default", has_default)); 1125 } 1126 if let Some(ref has_focus) = self.has_focus { 1127 properties.push(("has-focus", has_focus)); 1128 } 1129 if let Some(ref has_tooltip) = self.has_tooltip { 1130 properties.push(("has-tooltip", has_tooltip)); 1131 } 1132 if let Some(ref height_request) = self.height_request { 1133 properties.push(("height-request", height_request)); 1134 } 1135 if let Some(ref hexpand) = self.hexpand { 1136 properties.push(("hexpand", hexpand)); 1137 } 1138 if let Some(ref hexpand_set) = self.hexpand_set { 1139 properties.push(("hexpand-set", hexpand_set)); 1140 } 1141 if let Some(ref is_focus) = self.is_focus { 1142 properties.push(("is-focus", is_focus)); 1143 } 1144 if let Some(ref margin) = self.margin { 1145 properties.push(("margin", margin)); 1146 } 1147 if let Some(ref margin_bottom) = self.margin_bottom { 1148 properties.push(("margin-bottom", margin_bottom)); 1149 } 1150 if let Some(ref margin_end) = self.margin_end { 1151 properties.push(("margin-end", margin_end)); 1152 } 1153 if let Some(ref margin_start) = self.margin_start { 1154 properties.push(("margin-start", margin_start)); 1155 } 1156 if let Some(ref margin_top) = self.margin_top { 1157 properties.push(("margin-top", margin_top)); 1158 } 1159 if let Some(ref name) = self.name { 1160 properties.push(("name", name)); 1161 } 1162 if let Some(ref no_show_all) = self.no_show_all { 1163 properties.push(("no-show-all", no_show_all)); 1164 } 1165 if let Some(ref opacity) = self.opacity { 1166 properties.push(("opacity", opacity)); 1167 } 1168 if let Some(ref parent) = self.parent { 1169 properties.push(("parent", parent)); 1170 } 1171 if let Some(ref receives_default) = self.receives_default { 1172 properties.push(("receives-default", receives_default)); 1173 } 1174 if let Some(ref sensitive) = self.sensitive { 1175 properties.push(("sensitive", sensitive)); 1176 } 1177 if let Some(ref tooltip_markup) = self.tooltip_markup { 1178 properties.push(("tooltip-markup", tooltip_markup)); 1179 } 1180 if let Some(ref tooltip_text) = self.tooltip_text { 1181 properties.push(("tooltip-text", tooltip_text)); 1182 } 1183 if let Some(ref valign) = self.valign { 1184 properties.push(("valign", valign)); 1185 } 1186 if let Some(ref vexpand) = self.vexpand { 1187 properties.push(("vexpand", vexpand)); 1188 } 1189 if let Some(ref vexpand_set) = self.vexpand_set { 1190 properties.push(("vexpand-set", vexpand_set)); 1191 } 1192 if let Some(ref visible) = self.visible { 1193 properties.push(("visible", visible)); 1194 } 1195 if let Some(ref width_request) = self.width_request { 1196 properties.push(("width-request", width_request)); 1197 } 1198 glib::Object::new(PlacesSidebar::static_type(), &properties) 1199 .expect("object new") 1200 .downcast() 1201 .expect("downcast") 1202 } 1203 local_only(mut self, local_only: bool) -> Self1204 pub fn local_only(mut self, local_only: bool) -> Self { 1205 self.local_only = Some(local_only); 1206 self 1207 } 1208 location<P: IsA<gio::File>>(mut self, location: &P) -> Self1209 pub fn location<P: IsA<gio::File>>(mut self, location: &P) -> Self { 1210 self.location = Some(location.clone().upcast()); 1211 self 1212 } 1213 open_flags(mut self, open_flags: PlacesOpenFlags) -> Self1214 pub fn open_flags(mut self, open_flags: PlacesOpenFlags) -> Self { 1215 self.open_flags = Some(open_flags); 1216 self 1217 } 1218 1219 #[cfg(any(feature = "v3_18", feature = "dox"))] populate_all(mut self, populate_all: bool) -> Self1220 pub fn populate_all(mut self, populate_all: bool) -> Self { 1221 self.populate_all = Some(populate_all); 1222 self 1223 } 1224 show_connect_to_server(mut self, show_connect_to_server: bool) -> Self1225 pub fn show_connect_to_server(mut self, show_connect_to_server: bool) -> Self { 1226 self.show_connect_to_server = Some(show_connect_to_server); 1227 self 1228 } 1229 show_desktop(mut self, show_desktop: bool) -> Self1230 pub fn show_desktop(mut self, show_desktop: bool) -> Self { 1231 self.show_desktop = Some(show_desktop); 1232 self 1233 } 1234 show_enter_location(mut self, show_enter_location: bool) -> Self1235 pub fn show_enter_location(mut self, show_enter_location: bool) -> Self { 1236 self.show_enter_location = Some(show_enter_location); 1237 self 1238 } 1239 show_other_locations(mut self, show_other_locations: bool) -> Self1240 pub fn show_other_locations(mut self, show_other_locations: bool) -> Self { 1241 self.show_other_locations = Some(show_other_locations); 1242 self 1243 } 1244 show_recent(mut self, show_recent: bool) -> Self1245 pub fn show_recent(mut self, show_recent: bool) -> Self { 1246 self.show_recent = Some(show_recent); 1247 self 1248 } 1249 1250 #[cfg(any(feature = "v3_22_26", feature = "dox"))] show_starred_location(mut self, show_starred_location: bool) -> Self1251 pub fn show_starred_location(mut self, show_starred_location: bool) -> Self { 1252 self.show_starred_location = Some(show_starred_location); 1253 self 1254 } 1255 show_trash(mut self, show_trash: bool) -> Self1256 pub fn show_trash(mut self, show_trash: bool) -> Self { 1257 self.show_trash = Some(show_trash); 1258 self 1259 } 1260 hadjustment<P: IsA<Adjustment>>(mut self, hadjustment: &P) -> Self1261 pub fn hadjustment<P: IsA<Adjustment>>(mut self, hadjustment: &P) -> Self { 1262 self.hadjustment = Some(hadjustment.clone().upcast()); 1263 self 1264 } 1265 hscrollbar_policy(mut self, hscrollbar_policy: PolicyType) -> Self1266 pub fn hscrollbar_policy(mut self, hscrollbar_policy: PolicyType) -> Self { 1267 self.hscrollbar_policy = Some(hscrollbar_policy); 1268 self 1269 } 1270 kinetic_scrolling(mut self, kinetic_scrolling: bool) -> Self1271 pub fn kinetic_scrolling(mut self, kinetic_scrolling: bool) -> Self { 1272 self.kinetic_scrolling = Some(kinetic_scrolling); 1273 self 1274 } 1275 1276 #[cfg(any(feature = "v3_22", feature = "dox"))] max_content_height(mut self, max_content_height: i32) -> Self1277 pub fn max_content_height(mut self, max_content_height: i32) -> Self { 1278 self.max_content_height = Some(max_content_height); 1279 self 1280 } 1281 1282 #[cfg(any(feature = "v3_22", feature = "dox"))] max_content_width(mut self, max_content_width: i32) -> Self1283 pub fn max_content_width(mut self, max_content_width: i32) -> Self { 1284 self.max_content_width = Some(max_content_width); 1285 self 1286 } 1287 min_content_height(mut self, min_content_height: i32) -> Self1288 pub fn min_content_height(mut self, min_content_height: i32) -> Self { 1289 self.min_content_height = Some(min_content_height); 1290 self 1291 } 1292 min_content_width(mut self, min_content_width: i32) -> Self1293 pub fn min_content_width(mut self, min_content_width: i32) -> Self { 1294 self.min_content_width = Some(min_content_width); 1295 self 1296 } 1297 1298 #[cfg(any(feature = "v3_16", feature = "dox"))] overlay_scrolling(mut self, overlay_scrolling: bool) -> Self1299 pub fn overlay_scrolling(mut self, overlay_scrolling: bool) -> Self { 1300 self.overlay_scrolling = Some(overlay_scrolling); 1301 self 1302 } 1303 1304 #[cfg(any(feature = "v3_22", feature = "dox"))] propagate_natural_height(mut self, propagate_natural_height: bool) -> Self1305 pub fn propagate_natural_height(mut self, propagate_natural_height: bool) -> Self { 1306 self.propagate_natural_height = Some(propagate_natural_height); 1307 self 1308 } 1309 1310 #[cfg(any(feature = "v3_22", feature = "dox"))] propagate_natural_width(mut self, propagate_natural_width: bool) -> Self1311 pub fn propagate_natural_width(mut self, propagate_natural_width: bool) -> Self { 1312 self.propagate_natural_width = Some(propagate_natural_width); 1313 self 1314 } 1315 shadow_type(mut self, shadow_type: ShadowType) -> Self1316 pub fn shadow_type(mut self, shadow_type: ShadowType) -> Self { 1317 self.shadow_type = Some(shadow_type); 1318 self 1319 } 1320 vadjustment<P: IsA<Adjustment>>(mut self, vadjustment: &P) -> Self1321 pub fn vadjustment<P: IsA<Adjustment>>(mut self, vadjustment: &P) -> Self { 1322 self.vadjustment = Some(vadjustment.clone().upcast()); 1323 self 1324 } 1325 vscrollbar_policy(mut self, vscrollbar_policy: PolicyType) -> Self1326 pub fn vscrollbar_policy(mut self, vscrollbar_policy: PolicyType) -> Self { 1327 self.vscrollbar_policy = Some(vscrollbar_policy); 1328 self 1329 } 1330 window_placement(mut self, window_placement: CornerType) -> Self1331 pub fn window_placement(mut self, window_placement: CornerType) -> Self { 1332 self.window_placement = Some(window_placement); 1333 self 1334 } 1335 border_width(mut self, border_width: u32) -> Self1336 pub fn border_width(mut self, border_width: u32) -> Self { 1337 self.border_width = Some(border_width); 1338 self 1339 } 1340 child<P: IsA<Widget>>(mut self, child: &P) -> Self1341 pub fn child<P: IsA<Widget>>(mut self, child: &P) -> Self { 1342 self.child = Some(child.clone().upcast()); 1343 self 1344 } 1345 resize_mode(mut self, resize_mode: ResizeMode) -> Self1346 pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self { 1347 self.resize_mode = Some(resize_mode); 1348 self 1349 } 1350 app_paintable(mut self, app_paintable: bool) -> Self1351 pub fn app_paintable(mut self, app_paintable: bool) -> Self { 1352 self.app_paintable = Some(app_paintable); 1353 self 1354 } 1355 can_default(mut self, can_default: bool) -> Self1356 pub fn can_default(mut self, can_default: bool) -> Self { 1357 self.can_default = Some(can_default); 1358 self 1359 } 1360 can_focus(mut self, can_focus: bool) -> Self1361 pub fn can_focus(mut self, can_focus: bool) -> Self { 1362 self.can_focus = Some(can_focus); 1363 self 1364 } 1365 events(mut self, events: gdk::EventMask) -> Self1366 pub fn events(mut self, events: gdk::EventMask) -> Self { 1367 self.events = Some(events); 1368 self 1369 } 1370 expand(mut self, expand: bool) -> Self1371 pub fn expand(mut self, expand: bool) -> Self { 1372 self.expand = Some(expand); 1373 self 1374 } 1375 1376 #[cfg(any(feature = "v3_20", feature = "dox"))] focus_on_click(mut self, focus_on_click: bool) -> Self1377 pub fn focus_on_click(mut self, focus_on_click: bool) -> Self { 1378 self.focus_on_click = Some(focus_on_click); 1379 self 1380 } 1381 halign(mut self, halign: Align) -> Self1382 pub fn halign(mut self, halign: Align) -> Self { 1383 self.halign = Some(halign); 1384 self 1385 } 1386 has_default(mut self, has_default: bool) -> Self1387 pub fn has_default(mut self, has_default: bool) -> Self { 1388 self.has_default = Some(has_default); 1389 self 1390 } 1391 has_focus(mut self, has_focus: bool) -> Self1392 pub fn has_focus(mut self, has_focus: bool) -> Self { 1393 self.has_focus = Some(has_focus); 1394 self 1395 } 1396 has_tooltip(mut self, has_tooltip: bool) -> Self1397 pub fn has_tooltip(mut self, has_tooltip: bool) -> Self { 1398 self.has_tooltip = Some(has_tooltip); 1399 self 1400 } 1401 height_request(mut self, height_request: i32) -> Self1402 pub fn height_request(mut self, height_request: i32) -> Self { 1403 self.height_request = Some(height_request); 1404 self 1405 } 1406 hexpand(mut self, hexpand: bool) -> Self1407 pub fn hexpand(mut self, hexpand: bool) -> Self { 1408 self.hexpand = Some(hexpand); 1409 self 1410 } 1411 hexpand_set(mut self, hexpand_set: bool) -> Self1412 pub fn hexpand_set(mut self, hexpand_set: bool) -> Self { 1413 self.hexpand_set = Some(hexpand_set); 1414 self 1415 } 1416 is_focus(mut self, is_focus: bool) -> Self1417 pub fn is_focus(mut self, is_focus: bool) -> Self { 1418 self.is_focus = Some(is_focus); 1419 self 1420 } 1421 margin(mut self, margin: i32) -> Self1422 pub fn margin(mut self, margin: i32) -> Self { 1423 self.margin = Some(margin); 1424 self 1425 } 1426 margin_bottom(mut self, margin_bottom: i32) -> Self1427 pub fn margin_bottom(mut self, margin_bottom: i32) -> Self { 1428 self.margin_bottom = Some(margin_bottom); 1429 self 1430 } 1431 margin_end(mut self, margin_end: i32) -> Self1432 pub fn margin_end(mut self, margin_end: i32) -> Self { 1433 self.margin_end = Some(margin_end); 1434 self 1435 } 1436 margin_start(mut self, margin_start: i32) -> Self1437 pub fn margin_start(mut self, margin_start: i32) -> Self { 1438 self.margin_start = Some(margin_start); 1439 self 1440 } 1441 margin_top(mut self, margin_top: i32) -> Self1442 pub fn margin_top(mut self, margin_top: i32) -> Self { 1443 self.margin_top = Some(margin_top); 1444 self 1445 } 1446 name(mut self, name: &str) -> Self1447 pub fn name(mut self, name: &str) -> Self { 1448 self.name = Some(name.to_string()); 1449 self 1450 } 1451 no_show_all(mut self, no_show_all: bool) -> Self1452 pub fn no_show_all(mut self, no_show_all: bool) -> Self { 1453 self.no_show_all = Some(no_show_all); 1454 self 1455 } 1456 opacity(mut self, opacity: f64) -> Self1457 pub fn opacity(mut self, opacity: f64) -> Self { 1458 self.opacity = Some(opacity); 1459 self 1460 } 1461 parent<P: IsA<Container>>(mut self, parent: &P) -> Self1462 pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self { 1463 self.parent = Some(parent.clone().upcast()); 1464 self 1465 } 1466 receives_default(mut self, receives_default: bool) -> Self1467 pub fn receives_default(mut self, receives_default: bool) -> Self { 1468 self.receives_default = Some(receives_default); 1469 self 1470 } 1471 sensitive(mut self, sensitive: bool) -> Self1472 pub fn sensitive(mut self, sensitive: bool) -> Self { 1473 self.sensitive = Some(sensitive); 1474 self 1475 } 1476 tooltip_markup(mut self, tooltip_markup: &str) -> Self1477 pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self { 1478 self.tooltip_markup = Some(tooltip_markup.to_string()); 1479 self 1480 } 1481 tooltip_text(mut self, tooltip_text: &str) -> Self1482 pub fn tooltip_text(mut self, tooltip_text: &str) -> Self { 1483 self.tooltip_text = Some(tooltip_text.to_string()); 1484 self 1485 } 1486 valign(mut self, valign: Align) -> Self1487 pub fn valign(mut self, valign: Align) -> Self { 1488 self.valign = Some(valign); 1489 self 1490 } 1491 vexpand(mut self, vexpand: bool) -> Self1492 pub fn vexpand(mut self, vexpand: bool) -> Self { 1493 self.vexpand = Some(vexpand); 1494 self 1495 } 1496 vexpand_set(mut self, vexpand_set: bool) -> Self1497 pub fn vexpand_set(mut self, vexpand_set: bool) -> Self { 1498 self.vexpand_set = Some(vexpand_set); 1499 self 1500 } 1501 visible(mut self, visible: bool) -> Self1502 pub fn visible(mut self, visible: bool) -> Self { 1503 self.visible = Some(visible); 1504 self 1505 } 1506 width_request(mut self, width_request: i32) -> Self1507 pub fn width_request(mut self, width_request: i32) -> Self { 1508 self.width_request = Some(width_request); 1509 self 1510 } 1511 } 1512 1513 impl fmt::Display for PlacesSidebar { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1514 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 1515 write!(f, "PlacesSidebar") 1516 } 1517 } 1518