1 // This file was generated by gir (https://github.com/gtk-rs/gir)
2 // from gir-files (https://github.com/gtk-rs/gir-files)
3 // DO NOT EDIT
4 
5 use crate::Adjustment;
6 use crate::Align;
7 use crate::Bin;
8 use crate::Buildable;
9 use crate::Container;
10 use crate::CornerType;
11 use crate::PlacesOpenFlags;
12 use crate::PolicyType;
13 use crate::ResizeMode;
14 use crate::ScrolledWindow;
15 use crate::ShadowType;
16 use crate::Widget;
17 use glib::object::Cast;
18 use glib::object::IsA;
19 use glib::object::ObjectType as ObjectType_;
20 use glib::signal::connect_raw;
21 use glib::signal::SignalHandlerId;
22 use glib::translate::*;
23 use glib::StaticType;
24 use glib::ToValue;
25 use std::boxed::Box as Box_;
26 use std::fmt;
27 use std::mem::transmute;
28 
29 glib::wrapper! {
30     #[doc(alias = "GtkPlacesSidebar")]
31     pub struct PlacesSidebar(Object<ffi::GtkPlacesSidebar, ffi::GtkPlacesSidebarClass>) @extends ScrolledWindow, Bin, Container, Widget, @implements Buildable;
32 
33     match fn {
34         type_ => || ffi::gtk_places_sidebar_get_type(),
35     }
36 }
37 
38 impl PlacesSidebar {
39     #[doc(alias = "gtk_places_sidebar_new")]
new() -> PlacesSidebar40     pub fn new() -> PlacesSidebar {
41         assert_initialized_main_thread!();
42         unsafe { Widget::from_glib_none(ffi::gtk_places_sidebar_new()).unsafe_cast() }
43     }
44 
45     // rustdoc-stripper-ignore-next
46     /// Creates a new builder-pattern struct instance to construct [`PlacesSidebar`] objects.
47     ///
48     /// This method returns an instance of [`PlacesSidebarBuilder`] which can be used to create [`PlacesSidebar`] objects.
builder() -> PlacesSidebarBuilder49     pub fn builder() -> PlacesSidebarBuilder {
50         PlacesSidebarBuilder::default()
51     }
52 
53     #[doc(alias = "gtk_places_sidebar_add_shortcut")]
add_shortcut<P: IsA<gio::File>>(&self, location: &P)54     pub fn add_shortcut<P: IsA<gio::File>>(&self, location: &P) {
55         unsafe {
56             ffi::gtk_places_sidebar_add_shortcut(
57                 self.to_glib_none().0,
58                 location.as_ref().to_glib_none().0,
59             );
60         }
61     }
62 
63     #[doc(alias = "gtk_places_sidebar_get_local_only")]
64     #[doc(alias = "get_local_only")]
is_local_only(&self) -> bool65     pub fn is_local_only(&self) -> bool {
66         unsafe {
67             from_glib(ffi::gtk_places_sidebar_get_local_only(
68                 self.to_glib_none().0,
69             ))
70         }
71     }
72 
73     #[doc(alias = "gtk_places_sidebar_get_location")]
74     #[doc(alias = "get_location")]
location(&self) -> Option<gio::File>75     pub fn location(&self) -> Option<gio::File> {
76         unsafe { from_glib_full(ffi::gtk_places_sidebar_get_location(self.to_glib_none().0)) }
77     }
78 
79     #[doc(alias = "gtk_places_sidebar_get_nth_bookmark")]
80     #[doc(alias = "get_nth_bookmark")]
nth_bookmark(&self, n: i32) -> Option<gio::File>81     pub fn nth_bookmark(&self, n: i32) -> Option<gio::File> {
82         unsafe {
83             from_glib_full(ffi::gtk_places_sidebar_get_nth_bookmark(
84                 self.to_glib_none().0,
85                 n,
86             ))
87         }
88     }
89 
90     #[doc(alias = "gtk_places_sidebar_get_open_flags")]
91     #[doc(alias = "get_open_flags")]
open_flags(&self) -> PlacesOpenFlags92     pub fn open_flags(&self) -> PlacesOpenFlags {
93         unsafe {
94             from_glib(ffi::gtk_places_sidebar_get_open_flags(
95                 self.to_glib_none().0,
96             ))
97         }
98     }
99 
100     #[doc(alias = "gtk_places_sidebar_get_show_desktop")]
101     #[doc(alias = "get_show_desktop")]
shows_desktop(&self) -> bool102     pub fn shows_desktop(&self) -> bool {
103         unsafe {
104             from_glib(ffi::gtk_places_sidebar_get_show_desktop(
105                 self.to_glib_none().0,
106             ))
107         }
108     }
109 
110     #[doc(alias = "gtk_places_sidebar_get_show_enter_location")]
111     #[doc(alias = "get_show_enter_location")]
shows_enter_location(&self) -> bool112     pub fn shows_enter_location(&self) -> bool {
113         unsafe {
114             from_glib(ffi::gtk_places_sidebar_get_show_enter_location(
115                 self.to_glib_none().0,
116             ))
117         }
118     }
119 
120     #[doc(alias = "gtk_places_sidebar_get_show_other_locations")]
121     #[doc(alias = "get_show_other_locations")]
shows_other_locations(&self) -> bool122     pub fn shows_other_locations(&self) -> bool {
123         unsafe {
124             from_glib(ffi::gtk_places_sidebar_get_show_other_locations(
125                 self.to_glib_none().0,
126             ))
127         }
128     }
129 
130     #[doc(alias = "gtk_places_sidebar_get_show_recent")]
131     #[doc(alias = "get_show_recent")]
shows_recent(&self) -> bool132     pub fn shows_recent(&self) -> bool {
133         unsafe {
134             from_glib(ffi::gtk_places_sidebar_get_show_recent(
135                 self.to_glib_none().0,
136             ))
137         }
138     }
139 
140     #[cfg(any(feature = "v3_22_26", feature = "dox"))]
141     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22_26")))]
142     #[doc(alias = "gtk_places_sidebar_get_show_starred_location")]
143     #[doc(alias = "get_show_starred_location")]
shows_starred_location(&self) -> bool144     pub fn shows_starred_location(&self) -> bool {
145         unsafe {
146             from_glib(ffi::gtk_places_sidebar_get_show_starred_location(
147                 self.to_glib_none().0,
148             ))
149         }
150     }
151 
152     #[doc(alias = "gtk_places_sidebar_get_show_trash")]
153     #[doc(alias = "get_show_trash")]
shows_trash(&self) -> bool154     pub fn shows_trash(&self) -> bool {
155         unsafe {
156             from_glib(ffi::gtk_places_sidebar_get_show_trash(
157                 self.to_glib_none().0,
158             ))
159         }
160     }
161 
162     #[doc(alias = "gtk_places_sidebar_list_shortcuts")]
list_shortcuts(&self) -> Vec<gio::File>163     pub fn list_shortcuts(&self) -> Vec<gio::File> {
164         unsafe {
165             FromGlibPtrContainer::from_glib_full(ffi::gtk_places_sidebar_list_shortcuts(
166                 self.to_glib_none().0,
167             ))
168         }
169     }
170 
171     #[doc(alias = "gtk_places_sidebar_remove_shortcut")]
remove_shortcut<P: IsA<gio::File>>(&self, location: &P)172     pub fn remove_shortcut<P: IsA<gio::File>>(&self, location: &P) {
173         unsafe {
174             ffi::gtk_places_sidebar_remove_shortcut(
175                 self.to_glib_none().0,
176                 location.as_ref().to_glib_none().0,
177             );
178         }
179     }
180 
181     #[doc(alias = "gtk_places_sidebar_set_drop_targets_visible")]
set_drop_targets_visible(&self, visible: bool, context: &gdk::DragContext)182     pub fn set_drop_targets_visible(&self, visible: bool, context: &gdk::DragContext) {
183         unsafe {
184             ffi::gtk_places_sidebar_set_drop_targets_visible(
185                 self.to_glib_none().0,
186                 visible.into_glib(),
187                 context.to_glib_none().0,
188             );
189         }
190     }
191 
192     #[doc(alias = "gtk_places_sidebar_set_local_only")]
set_local_only(&self, local_only: bool)193     pub fn set_local_only(&self, local_only: bool) {
194         unsafe {
195             ffi::gtk_places_sidebar_set_local_only(self.to_glib_none().0, local_only.into_glib());
196         }
197     }
198 
199     #[doc(alias = "gtk_places_sidebar_set_location")]
set_location<P: IsA<gio::File>>(&self, location: Option<&P>)200     pub fn set_location<P: IsA<gio::File>>(&self, location: Option<&P>) {
201         unsafe {
202             ffi::gtk_places_sidebar_set_location(
203                 self.to_glib_none().0,
204                 location.map(|p| p.as_ref()).to_glib_none().0,
205             );
206         }
207     }
208 
209     #[doc(alias = "gtk_places_sidebar_set_open_flags")]
set_open_flags(&self, flags: PlacesOpenFlags)210     pub fn set_open_flags(&self, flags: PlacesOpenFlags) {
211         unsafe {
212             ffi::gtk_places_sidebar_set_open_flags(self.to_glib_none().0, flags.into_glib());
213         }
214     }
215 
216     #[doc(alias = "gtk_places_sidebar_set_show_desktop")]
set_show_desktop(&self, show_desktop: bool)217     pub fn set_show_desktop(&self, show_desktop: bool) {
218         unsafe {
219             ffi::gtk_places_sidebar_set_show_desktop(
220                 self.to_glib_none().0,
221                 show_desktop.into_glib(),
222             );
223         }
224     }
225 
226     #[doc(alias = "gtk_places_sidebar_set_show_enter_location")]
set_show_enter_location(&self, show_enter_location: bool)227     pub fn set_show_enter_location(&self, show_enter_location: bool) {
228         unsafe {
229             ffi::gtk_places_sidebar_set_show_enter_location(
230                 self.to_glib_none().0,
231                 show_enter_location.into_glib(),
232             );
233         }
234     }
235 
236     #[doc(alias = "gtk_places_sidebar_set_show_other_locations")]
set_show_other_locations(&self, show_other_locations: bool)237     pub fn set_show_other_locations(&self, show_other_locations: bool) {
238         unsafe {
239             ffi::gtk_places_sidebar_set_show_other_locations(
240                 self.to_glib_none().0,
241                 show_other_locations.into_glib(),
242             );
243         }
244     }
245 
246     #[doc(alias = "gtk_places_sidebar_set_show_recent")]
set_show_recent(&self, show_recent: bool)247     pub fn set_show_recent(&self, show_recent: bool) {
248         unsafe {
249             ffi::gtk_places_sidebar_set_show_recent(self.to_glib_none().0, show_recent.into_glib());
250         }
251     }
252 
253     #[cfg(any(feature = "v3_22_26", feature = "dox"))]
254     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22_26")))]
255     #[doc(alias = "gtk_places_sidebar_set_show_starred_location")]
set_show_starred_location(&self, show_starred_location: bool)256     pub fn set_show_starred_location(&self, show_starred_location: bool) {
257         unsafe {
258             ffi::gtk_places_sidebar_set_show_starred_location(
259                 self.to_glib_none().0,
260                 show_starred_location.into_glib(),
261             );
262         }
263     }
264 
265     #[doc(alias = "gtk_places_sidebar_set_show_trash")]
set_show_trash(&self, show_trash: bool)266     pub fn set_show_trash(&self, show_trash: bool) {
267         unsafe {
268             ffi::gtk_places_sidebar_set_show_trash(self.to_glib_none().0, show_trash.into_glib());
269         }
270     }
271 
272     #[doc(alias = "populate-all")]
populates_all(&self) -> bool273     pub fn populates_all(&self) -> bool {
274         unsafe {
275             let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
276             glib::gobject_ffi::g_object_get_property(
277                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
278                 b"populate-all\0".as_ptr() as *const _,
279                 value.to_glib_none_mut().0,
280             );
281             value
282                 .get()
283                 .expect("Return Value for property `populate-all` getter")
284         }
285     }
286 
287     #[doc(alias = "populate-all")]
set_populate_all(&self, populate_all: bool)288     pub fn set_populate_all(&self, populate_all: bool) {
289         unsafe {
290             glib::gobject_ffi::g_object_set_property(
291                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
292                 b"populate-all\0".as_ptr() as *const _,
293                 populate_all.to_value().to_glib_none().0,
294             );
295         }
296     }
297 
298     #[doc(alias = "show-connect-to-server")]
shows_connect_to_server(&self) -> bool299     pub fn shows_connect_to_server(&self) -> bool {
300         unsafe {
301             let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
302             glib::gobject_ffi::g_object_get_property(
303                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
304                 b"show-connect-to-server\0".as_ptr() as *const _,
305                 value.to_glib_none_mut().0,
306             );
307             value
308                 .get()
309                 .expect("Return Value for property `show-connect-to-server` getter")
310         }
311     }
312 
313     #[doc(alias = "show-connect-to-server")]
set_show_connect_to_server(&self, show_connect_to_server: bool)314     pub fn set_show_connect_to_server(&self, show_connect_to_server: bool) {
315         unsafe {
316             glib::gobject_ffi::g_object_set_property(
317                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
318                 b"show-connect-to-server\0".as_ptr() as *const _,
319                 show_connect_to_server.to_value().to_glib_none().0,
320             );
321         }
322     }
323 
324     #[doc(alias = "drag-action-ask")]
connect_drag_action_ask<F: Fn(&Self, i32) -> i32 + 'static>( &self, f: F, ) -> SignalHandlerId325     pub fn connect_drag_action_ask<F: Fn(&Self, i32) -> i32 + 'static>(
326         &self,
327         f: F,
328     ) -> SignalHandlerId {
329         unsafe extern "C" fn drag_action_ask_trampoline<
330             F: Fn(&PlacesSidebar, i32) -> i32 + 'static,
331         >(
332             this: *mut ffi::GtkPlacesSidebar,
333             actions: libc::c_int,
334             f: glib::ffi::gpointer,
335         ) -> libc::c_int {
336             let f: &F = &*(f as *const F);
337             f(&from_glib_borrow(this), actions)
338         }
339         unsafe {
340             let f: Box_<F> = Box_::new(f);
341             connect_raw(
342                 self.as_ptr() as *mut _,
343                 b"drag-action-ask\0".as_ptr() as *const _,
344                 Some(transmute::<_, unsafe extern "C" fn()>(
345                     drag_action_ask_trampoline::<F> as *const (),
346                 )),
347                 Box_::into_raw(f),
348             )
349         }
350     }
351 
352     #[cfg(any(feature = "v3_20", feature = "dox"))]
353     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
354     #[doc(alias = "mount")]
connect_mount<F: Fn(&Self, &gio::MountOperation) + 'static>( &self, f: F, ) -> SignalHandlerId355     pub fn connect_mount<F: Fn(&Self, &gio::MountOperation) + 'static>(
356         &self,
357         f: F,
358     ) -> SignalHandlerId {
359         unsafe extern "C" fn mount_trampoline<
360             F: Fn(&PlacesSidebar, &gio::MountOperation) + 'static,
361         >(
362             this: *mut ffi::GtkPlacesSidebar,
363             mount_operation: *mut gio::ffi::GMountOperation,
364             f: glib::ffi::gpointer,
365         ) {
366             let f: &F = &*(f as *const F);
367             f(&from_glib_borrow(this), &from_glib_borrow(mount_operation))
368         }
369         unsafe {
370             let f: Box_<F> = Box_::new(f);
371             connect_raw(
372                 self.as_ptr() as *mut _,
373                 b"mount\0".as_ptr() as *const _,
374                 Some(transmute::<_, unsafe extern "C" fn()>(
375                     mount_trampoline::<F> as *const (),
376                 )),
377                 Box_::into_raw(f),
378             )
379         }
380     }
381 
382     #[doc(alias = "open-location")]
connect_open_location<F: Fn(&Self, &gio::File, PlacesOpenFlags) + 'static>( &self, f: F, ) -> SignalHandlerId383     pub fn connect_open_location<F: Fn(&Self, &gio::File, PlacesOpenFlags) + 'static>(
384         &self,
385         f: F,
386     ) -> SignalHandlerId {
387         unsafe extern "C" fn open_location_trampoline<
388             F: Fn(&PlacesSidebar, &gio::File, PlacesOpenFlags) + 'static,
389         >(
390             this: *mut ffi::GtkPlacesSidebar,
391             location: *mut gio::ffi::GFile,
392             open_flags: ffi::GtkPlacesOpenFlags,
393             f: glib::ffi::gpointer,
394         ) {
395             let f: &F = &*(f as *const F);
396             f(
397                 &from_glib_borrow(this),
398                 &from_glib_borrow(location),
399                 from_glib(open_flags),
400             )
401         }
402         unsafe {
403             let f: Box_<F> = Box_::new(f);
404             connect_raw(
405                 self.as_ptr() as *mut _,
406                 b"open-location\0".as_ptr() as *const _,
407                 Some(transmute::<_, unsafe extern "C" fn()>(
408                     open_location_trampoline::<F> as *const (),
409                 )),
410                 Box_::into_raw(f),
411             )
412         }
413     }
414 
415     //#[doc(alias = "populate-popup")]
416     //pub fn connect_populate_popup<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
417     //    Ignored selected_volume: Gio.Volume
418     //}
419 
420     #[doc(alias = "show-enter-location")]
connect_show_enter_location<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId421     pub fn connect_show_enter_location<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
422         unsafe extern "C" fn show_enter_location_trampoline<F: Fn(&PlacesSidebar) + 'static>(
423             this: *mut ffi::GtkPlacesSidebar,
424             f: glib::ffi::gpointer,
425         ) {
426             let f: &F = &*(f as *const F);
427             f(&from_glib_borrow(this))
428         }
429         unsafe {
430             let f: Box_<F> = Box_::new(f);
431             connect_raw(
432                 self.as_ptr() as *mut _,
433                 b"show-enter-location\0".as_ptr() as *const _,
434                 Some(transmute::<_, unsafe extern "C" fn()>(
435                     show_enter_location_trampoline::<F> as *const (),
436                 )),
437                 Box_::into_raw(f),
438             )
439         }
440     }
441 
442     #[doc(alias = "show-error-message")]
connect_show_error_message<F: Fn(&Self, &str, &str) + 'static>( &self, f: F, ) -> SignalHandlerId443     pub fn connect_show_error_message<F: Fn(&Self, &str, &str) + 'static>(
444         &self,
445         f: F,
446     ) -> SignalHandlerId {
447         unsafe extern "C" fn show_error_message_trampoline<
448             F: Fn(&PlacesSidebar, &str, &str) + 'static,
449         >(
450             this: *mut ffi::GtkPlacesSidebar,
451             primary: *mut libc::c_char,
452             secondary: *mut libc::c_char,
453             f: glib::ffi::gpointer,
454         ) {
455             let f: &F = &*(f as *const F);
456             f(
457                 &from_glib_borrow(this),
458                 &glib::GString::from_glib_borrow(primary),
459                 &glib::GString::from_glib_borrow(secondary),
460             )
461         }
462         unsafe {
463             let f: Box_<F> = Box_::new(f);
464             connect_raw(
465                 self.as_ptr() as *mut _,
466                 b"show-error-message\0".as_ptr() as *const _,
467                 Some(transmute::<_, unsafe extern "C" fn()>(
468                     show_error_message_trampoline::<F> as *const (),
469                 )),
470                 Box_::into_raw(f),
471             )
472         }
473     }
474 
475     #[cfg_attr(feature = "v3_20", deprecated = "Since 3.20")]
476     #[doc(alias = "show-other-locations")]
connect_show_other_locations<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId477     pub fn connect_show_other_locations<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
478         unsafe extern "C" fn show_other_locations_trampoline<F: Fn(&PlacesSidebar) + 'static>(
479             this: *mut ffi::GtkPlacesSidebar,
480             f: glib::ffi::gpointer,
481         ) {
482             let f: &F = &*(f as *const F);
483             f(&from_glib_borrow(this))
484         }
485         unsafe {
486             let f: Box_<F> = Box_::new(f);
487             connect_raw(
488                 self.as_ptr() as *mut _,
489                 b"show-other-locations\0".as_ptr() as *const _,
490                 Some(transmute::<_, unsafe extern "C" fn()>(
491                     show_other_locations_trampoline::<F> as *const (),
492                 )),
493                 Box_::into_raw(f),
494             )
495         }
496     }
497 
498     #[cfg(any(feature = "v3_20", feature = "dox"))]
499     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
500     #[doc(alias = "show-other-locations-with-flags")]
connect_show_other_locations_with_flags<F: Fn(&Self, PlacesOpenFlags) + 'static>( &self, f: F, ) -> SignalHandlerId501     pub fn connect_show_other_locations_with_flags<F: Fn(&Self, PlacesOpenFlags) + 'static>(
502         &self,
503         f: F,
504     ) -> SignalHandlerId {
505         unsafe extern "C" fn show_other_locations_with_flags_trampoline<
506             F: Fn(&PlacesSidebar, PlacesOpenFlags) + 'static,
507         >(
508             this: *mut ffi::GtkPlacesSidebar,
509             open_flags: ffi::GtkPlacesOpenFlags,
510             f: glib::ffi::gpointer,
511         ) {
512             let f: &F = &*(f as *const F);
513             f(&from_glib_borrow(this), from_glib(open_flags))
514         }
515         unsafe {
516             let f: Box_<F> = Box_::new(f);
517             connect_raw(
518                 self.as_ptr() as *mut _,
519                 b"show-other-locations-with-flags\0".as_ptr() as *const _,
520                 Some(transmute::<_, unsafe extern "C" fn()>(
521                     show_other_locations_with_flags_trampoline::<F> as *const (),
522                 )),
523                 Box_::into_raw(f),
524             )
525         }
526     }
527 
528     #[cfg(any(feature = "v3_22_26", feature = "dox"))]
529     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22_26")))]
530     #[doc(alias = "show-starred-location")]
connect_show_starred_location<F: Fn(&Self, PlacesOpenFlags) + 'static>( &self, f: F, ) -> SignalHandlerId531     pub fn connect_show_starred_location<F: Fn(&Self, PlacesOpenFlags) + 'static>(
532         &self,
533         f: F,
534     ) -> SignalHandlerId {
535         unsafe extern "C" fn show_starred_location_trampoline<
536             F: Fn(&PlacesSidebar, PlacesOpenFlags) + 'static,
537         >(
538             this: *mut ffi::GtkPlacesSidebar,
539             open_flags: ffi::GtkPlacesOpenFlags,
540             f: glib::ffi::gpointer,
541         ) {
542             let f: &F = &*(f as *const F);
543             f(&from_glib_borrow(this), from_glib(open_flags))
544         }
545         unsafe {
546             let f: Box_<F> = Box_::new(f);
547             connect_raw(
548                 self.as_ptr() as *mut _,
549                 b"show-starred-location\0".as_ptr() as *const _,
550                 Some(transmute::<_, unsafe extern "C" fn()>(
551                     show_starred_location_trampoline::<F> as *const (),
552                 )),
553                 Box_::into_raw(f),
554             )
555         }
556     }
557 
558     #[cfg(any(feature = "v3_20", feature = "dox"))]
559     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
560     #[doc(alias = "unmount")]
connect_unmount<F: Fn(&Self, &gio::MountOperation) + 'static>( &self, f: F, ) -> SignalHandlerId561     pub fn connect_unmount<F: Fn(&Self, &gio::MountOperation) + 'static>(
562         &self,
563         f: F,
564     ) -> SignalHandlerId {
565         unsafe extern "C" fn unmount_trampoline<
566             F: Fn(&PlacesSidebar, &gio::MountOperation) + 'static,
567         >(
568             this: *mut ffi::GtkPlacesSidebar,
569             mount_operation: *mut gio::ffi::GMountOperation,
570             f: glib::ffi::gpointer,
571         ) {
572             let f: &F = &*(f as *const F);
573             f(&from_glib_borrow(this), &from_glib_borrow(mount_operation))
574         }
575         unsafe {
576             let f: Box_<F> = Box_::new(f);
577             connect_raw(
578                 self.as_ptr() as *mut _,
579                 b"unmount\0".as_ptr() as *const _,
580                 Some(transmute::<_, unsafe extern "C" fn()>(
581                     unmount_trampoline::<F> as *const (),
582                 )),
583                 Box_::into_raw(f),
584             )
585         }
586     }
587 
588     #[doc(alias = "local-only")]
connect_local_only_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId589     pub fn connect_local_only_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
590         unsafe extern "C" fn notify_local_only_trampoline<F: Fn(&PlacesSidebar) + 'static>(
591             this: *mut ffi::GtkPlacesSidebar,
592             _param_spec: glib::ffi::gpointer,
593             f: glib::ffi::gpointer,
594         ) {
595             let f: &F = &*(f as *const F);
596             f(&from_glib_borrow(this))
597         }
598         unsafe {
599             let f: Box_<F> = Box_::new(f);
600             connect_raw(
601                 self.as_ptr() as *mut _,
602                 b"notify::local-only\0".as_ptr() as *const _,
603                 Some(transmute::<_, unsafe extern "C" fn()>(
604                     notify_local_only_trampoline::<F> as *const (),
605                 )),
606                 Box_::into_raw(f),
607             )
608         }
609     }
610 
611     #[doc(alias = "location")]
connect_location_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId612     pub fn connect_location_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
613         unsafe extern "C" fn notify_location_trampoline<F: Fn(&PlacesSidebar) + 'static>(
614             this: *mut ffi::GtkPlacesSidebar,
615             _param_spec: glib::ffi::gpointer,
616             f: glib::ffi::gpointer,
617         ) {
618             let f: &F = &*(f as *const F);
619             f(&from_glib_borrow(this))
620         }
621         unsafe {
622             let f: Box_<F> = Box_::new(f);
623             connect_raw(
624                 self.as_ptr() as *mut _,
625                 b"notify::location\0".as_ptr() as *const _,
626                 Some(transmute::<_, unsafe extern "C" fn()>(
627                     notify_location_trampoline::<F> as *const (),
628                 )),
629                 Box_::into_raw(f),
630             )
631         }
632     }
633 
634     #[doc(alias = "open-flags")]
connect_open_flags_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId635     pub fn connect_open_flags_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
636         unsafe extern "C" fn notify_open_flags_trampoline<F: Fn(&PlacesSidebar) + 'static>(
637             this: *mut ffi::GtkPlacesSidebar,
638             _param_spec: glib::ffi::gpointer,
639             f: glib::ffi::gpointer,
640         ) {
641             let f: &F = &*(f as *const F);
642             f(&from_glib_borrow(this))
643         }
644         unsafe {
645             let f: Box_<F> = Box_::new(f);
646             connect_raw(
647                 self.as_ptr() as *mut _,
648                 b"notify::open-flags\0".as_ptr() as *const _,
649                 Some(transmute::<_, unsafe extern "C" fn()>(
650                     notify_open_flags_trampoline::<F> as *const (),
651                 )),
652                 Box_::into_raw(f),
653             )
654         }
655     }
656 
657     #[doc(alias = "populate-all")]
connect_populate_all_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId658     pub fn connect_populate_all_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
659         unsafe extern "C" fn notify_populate_all_trampoline<F: Fn(&PlacesSidebar) + 'static>(
660             this: *mut ffi::GtkPlacesSidebar,
661             _param_spec: glib::ffi::gpointer,
662             f: glib::ffi::gpointer,
663         ) {
664             let f: &F = &*(f as *const F);
665             f(&from_glib_borrow(this))
666         }
667         unsafe {
668             let f: Box_<F> = Box_::new(f);
669             connect_raw(
670                 self.as_ptr() as *mut _,
671                 b"notify::populate-all\0".as_ptr() as *const _,
672                 Some(transmute::<_, unsafe extern "C" fn()>(
673                     notify_populate_all_trampoline::<F> as *const (),
674                 )),
675                 Box_::into_raw(f),
676             )
677         }
678     }
679 
680     #[doc(alias = "show-connect-to-server")]
connect_show_connect_to_server_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId681     pub fn connect_show_connect_to_server_notify<F: Fn(&Self) + 'static>(
682         &self,
683         f: F,
684     ) -> SignalHandlerId {
685         unsafe extern "C" fn notify_show_connect_to_server_trampoline<
686             F: Fn(&PlacesSidebar) + 'static,
687         >(
688             this: *mut ffi::GtkPlacesSidebar,
689             _param_spec: glib::ffi::gpointer,
690             f: glib::ffi::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::show-connect-to-server\0".as_ptr() as *const _,
700                 Some(transmute::<_, unsafe extern "C" fn()>(
701                     notify_show_connect_to_server_trampoline::<F> as *const (),
702                 )),
703                 Box_::into_raw(f),
704             )
705         }
706     }
707 
708     #[doc(alias = "show-desktop")]
connect_show_desktop_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId709     pub fn connect_show_desktop_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
710         unsafe extern "C" fn notify_show_desktop_trampoline<F: Fn(&PlacesSidebar) + 'static>(
711             this: *mut ffi::GtkPlacesSidebar,
712             _param_spec: glib::ffi::gpointer,
713             f: glib::ffi::gpointer,
714         ) {
715             let f: &F = &*(f as *const F);
716             f(&from_glib_borrow(this))
717         }
718         unsafe {
719             let f: Box_<F> = Box_::new(f);
720             connect_raw(
721                 self.as_ptr() as *mut _,
722                 b"notify::show-desktop\0".as_ptr() as *const _,
723                 Some(transmute::<_, unsafe extern "C" fn()>(
724                     notify_show_desktop_trampoline::<F> as *const (),
725                 )),
726                 Box_::into_raw(f),
727             )
728         }
729     }
730 
731     #[doc(alias = "show-enter-location")]
connect_show_enter_location_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId732     pub fn connect_show_enter_location_notify<F: Fn(&Self) + 'static>(
733         &self,
734         f: F,
735     ) -> SignalHandlerId {
736         unsafe extern "C" fn notify_show_enter_location_trampoline<
737             F: Fn(&PlacesSidebar) + 'static,
738         >(
739             this: *mut ffi::GtkPlacesSidebar,
740             _param_spec: glib::ffi::gpointer,
741             f: glib::ffi::gpointer,
742         ) {
743             let f: &F = &*(f as *const F);
744             f(&from_glib_borrow(this))
745         }
746         unsafe {
747             let f: Box_<F> = Box_::new(f);
748             connect_raw(
749                 self.as_ptr() as *mut _,
750                 b"notify::show-enter-location\0".as_ptr() as *const _,
751                 Some(transmute::<_, unsafe extern "C" fn()>(
752                     notify_show_enter_location_trampoline::<F> as *const (),
753                 )),
754                 Box_::into_raw(f),
755             )
756         }
757     }
758 
759     #[doc(alias = "show-other-locations")]
connect_show_other_locations_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId760     pub fn connect_show_other_locations_notify<F: Fn(&Self) + 'static>(
761         &self,
762         f: F,
763     ) -> SignalHandlerId {
764         unsafe extern "C" fn notify_show_other_locations_trampoline<
765             F: Fn(&PlacesSidebar) + 'static,
766         >(
767             this: *mut ffi::GtkPlacesSidebar,
768             _param_spec: glib::ffi::gpointer,
769             f: glib::ffi::gpointer,
770         ) {
771             let f: &F = &*(f as *const F);
772             f(&from_glib_borrow(this))
773         }
774         unsafe {
775             let f: Box_<F> = Box_::new(f);
776             connect_raw(
777                 self.as_ptr() as *mut _,
778                 b"notify::show-other-locations\0".as_ptr() as *const _,
779                 Some(transmute::<_, unsafe extern "C" fn()>(
780                     notify_show_other_locations_trampoline::<F> as *const (),
781                 )),
782                 Box_::into_raw(f),
783             )
784         }
785     }
786 
787     #[doc(alias = "show-recent")]
connect_show_recent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId788     pub fn connect_show_recent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
789         unsafe extern "C" fn notify_show_recent_trampoline<F: Fn(&PlacesSidebar) + 'static>(
790             this: *mut ffi::GtkPlacesSidebar,
791             _param_spec: glib::ffi::gpointer,
792             f: glib::ffi::gpointer,
793         ) {
794             let f: &F = &*(f as *const F);
795             f(&from_glib_borrow(this))
796         }
797         unsafe {
798             let f: Box_<F> = Box_::new(f);
799             connect_raw(
800                 self.as_ptr() as *mut _,
801                 b"notify::show-recent\0".as_ptr() as *const _,
802                 Some(transmute::<_, unsafe extern "C" fn()>(
803                     notify_show_recent_trampoline::<F> as *const (),
804                 )),
805                 Box_::into_raw(f),
806             )
807         }
808     }
809 
810     #[cfg(any(feature = "v3_22_26", feature = "dox"))]
811     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22_26")))]
812     #[doc(alias = "show-starred-location")]
connect_show_starred_location_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId813     pub fn connect_show_starred_location_notify<F: Fn(&Self) + 'static>(
814         &self,
815         f: F,
816     ) -> SignalHandlerId {
817         unsafe extern "C" fn notify_show_starred_location_trampoline<
818             F: Fn(&PlacesSidebar) + 'static,
819         >(
820             this: *mut ffi::GtkPlacesSidebar,
821             _param_spec: glib::ffi::gpointer,
822             f: glib::ffi::gpointer,
823         ) {
824             let f: &F = &*(f as *const F);
825             f(&from_glib_borrow(this))
826         }
827         unsafe {
828             let f: Box_<F> = Box_::new(f);
829             connect_raw(
830                 self.as_ptr() as *mut _,
831                 b"notify::show-starred-location\0".as_ptr() as *const _,
832                 Some(transmute::<_, unsafe extern "C" fn()>(
833                     notify_show_starred_location_trampoline::<F> as *const (),
834                 )),
835                 Box_::into_raw(f),
836             )
837         }
838     }
839 
840     #[doc(alias = "show-trash")]
connect_show_trash_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId841     pub fn connect_show_trash_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
842         unsafe extern "C" fn notify_show_trash_trampoline<F: Fn(&PlacesSidebar) + 'static>(
843             this: *mut ffi::GtkPlacesSidebar,
844             _param_spec: glib::ffi::gpointer,
845             f: glib::ffi::gpointer,
846         ) {
847             let f: &F = &*(f as *const F);
848             f(&from_glib_borrow(this))
849         }
850         unsafe {
851             let f: Box_<F> = Box_::new(f);
852             connect_raw(
853                 self.as_ptr() as *mut _,
854                 b"notify::show-trash\0".as_ptr() as *const _,
855                 Some(transmute::<_, unsafe extern "C" fn()>(
856                     notify_show_trash_trampoline::<F> as *const (),
857                 )),
858                 Box_::into_raw(f),
859             )
860         }
861     }
862 }
863 
864 impl Default for PlacesSidebar {
default() -> Self865     fn default() -> Self {
866         Self::new()
867     }
868 }
869 
870 #[derive(Clone, Default)]
871 // rustdoc-stripper-ignore-next
872 /// A [builder-pattern] type to construct [`PlacesSidebar`] objects.
873 ///
874 /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
875 pub struct PlacesSidebarBuilder {
876     local_only: Option<bool>,
877     location: Option<gio::File>,
878     open_flags: Option<PlacesOpenFlags>,
879     populate_all: Option<bool>,
880     show_connect_to_server: Option<bool>,
881     show_desktop: Option<bool>,
882     show_enter_location: Option<bool>,
883     show_other_locations: Option<bool>,
884     show_recent: Option<bool>,
885     #[cfg(any(feature = "v3_22_26", feature = "dox"))]
886     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22_26")))]
887     show_starred_location: Option<bool>,
888     show_trash: Option<bool>,
889     hadjustment: Option<Adjustment>,
890     hscrollbar_policy: Option<PolicyType>,
891     kinetic_scrolling: Option<bool>,
892     #[cfg(any(feature = "v3_22", feature = "dox"))]
893     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
894     max_content_height: Option<i32>,
895     #[cfg(any(feature = "v3_22", feature = "dox"))]
896     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
897     max_content_width: Option<i32>,
898     min_content_height: Option<i32>,
899     min_content_width: Option<i32>,
900     overlay_scrolling: Option<bool>,
901     #[cfg(any(feature = "v3_22", feature = "dox"))]
902     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
903     propagate_natural_height: Option<bool>,
904     #[cfg(any(feature = "v3_22", feature = "dox"))]
905     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
906     propagate_natural_width: Option<bool>,
907     shadow_type: Option<ShadowType>,
908     vadjustment: Option<Adjustment>,
909     vscrollbar_policy: Option<PolicyType>,
910     window_placement: Option<CornerType>,
911     border_width: Option<u32>,
912     child: Option<Widget>,
913     resize_mode: Option<ResizeMode>,
914     app_paintable: Option<bool>,
915     can_default: Option<bool>,
916     can_focus: Option<bool>,
917     events: Option<gdk::EventMask>,
918     expand: Option<bool>,
919     #[cfg(any(feature = "v3_20", feature = "dox"))]
920     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
921     focus_on_click: Option<bool>,
922     halign: Option<Align>,
923     has_default: Option<bool>,
924     has_focus: Option<bool>,
925     has_tooltip: Option<bool>,
926     height_request: Option<i32>,
927     hexpand: Option<bool>,
928     hexpand_set: Option<bool>,
929     is_focus: Option<bool>,
930     margin: Option<i32>,
931     margin_bottom: Option<i32>,
932     margin_end: Option<i32>,
933     margin_start: Option<i32>,
934     margin_top: Option<i32>,
935     name: Option<String>,
936     no_show_all: Option<bool>,
937     opacity: Option<f64>,
938     parent: Option<Container>,
939     receives_default: Option<bool>,
940     sensitive: Option<bool>,
941     tooltip_markup: Option<String>,
942     tooltip_text: Option<String>,
943     valign: Option<Align>,
944     vexpand: Option<bool>,
945     vexpand_set: Option<bool>,
946     visible: Option<bool>,
947     width_request: Option<i32>,
948 }
949 
950 impl PlacesSidebarBuilder {
951     // rustdoc-stripper-ignore-next
952     /// Create a new [`PlacesSidebarBuilder`].
new() -> Self953     pub fn new() -> Self {
954         Self::default()
955     }
956 
957     // rustdoc-stripper-ignore-next
958     /// Build the [`PlacesSidebar`].
build(self) -> PlacesSidebar959     pub fn build(self) -> PlacesSidebar {
960         let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
961         if let Some(ref local_only) = self.local_only {
962             properties.push(("local-only", local_only));
963         }
964         if let Some(ref location) = self.location {
965             properties.push(("location", location));
966         }
967         if let Some(ref open_flags) = self.open_flags {
968             properties.push(("open-flags", open_flags));
969         }
970         if let Some(ref populate_all) = self.populate_all {
971             properties.push(("populate-all", populate_all));
972         }
973         if let Some(ref show_connect_to_server) = self.show_connect_to_server {
974             properties.push(("show-connect-to-server", show_connect_to_server));
975         }
976         if let Some(ref show_desktop) = self.show_desktop {
977             properties.push(("show-desktop", show_desktop));
978         }
979         if let Some(ref show_enter_location) = self.show_enter_location {
980             properties.push(("show-enter-location", show_enter_location));
981         }
982         if let Some(ref show_other_locations) = self.show_other_locations {
983             properties.push(("show-other-locations", show_other_locations));
984         }
985         if let Some(ref show_recent) = self.show_recent {
986             properties.push(("show-recent", show_recent));
987         }
988         #[cfg(any(feature = "v3_22_26", feature = "dox"))]
989         if let Some(ref show_starred_location) = self.show_starred_location {
990             properties.push(("show-starred-location", show_starred_location));
991         }
992         if let Some(ref show_trash) = self.show_trash {
993             properties.push(("show-trash", show_trash));
994         }
995         if let Some(ref hadjustment) = self.hadjustment {
996             properties.push(("hadjustment", hadjustment));
997         }
998         if let Some(ref hscrollbar_policy) = self.hscrollbar_policy {
999             properties.push(("hscrollbar-policy", hscrollbar_policy));
1000         }
1001         if let Some(ref kinetic_scrolling) = self.kinetic_scrolling {
1002             properties.push(("kinetic-scrolling", kinetic_scrolling));
1003         }
1004         #[cfg(any(feature = "v3_22", feature = "dox"))]
1005         if let Some(ref max_content_height) = self.max_content_height {
1006             properties.push(("max-content-height", max_content_height));
1007         }
1008         #[cfg(any(feature = "v3_22", feature = "dox"))]
1009         if let Some(ref max_content_width) = self.max_content_width {
1010             properties.push(("max-content-width", max_content_width));
1011         }
1012         if let Some(ref min_content_height) = self.min_content_height {
1013             properties.push(("min-content-height", min_content_height));
1014         }
1015         if let Some(ref min_content_width) = self.min_content_width {
1016             properties.push(("min-content-width", min_content_width));
1017         }
1018         if let Some(ref overlay_scrolling) = self.overlay_scrolling {
1019             properties.push(("overlay-scrolling", overlay_scrolling));
1020         }
1021         #[cfg(any(feature = "v3_22", feature = "dox"))]
1022         if let Some(ref propagate_natural_height) = self.propagate_natural_height {
1023             properties.push(("propagate-natural-height", propagate_natural_height));
1024         }
1025         #[cfg(any(feature = "v3_22", feature = "dox"))]
1026         if let Some(ref propagate_natural_width) = self.propagate_natural_width {
1027             properties.push(("propagate-natural-width", propagate_natural_width));
1028         }
1029         if let Some(ref shadow_type) = self.shadow_type {
1030             properties.push(("shadow-type", shadow_type));
1031         }
1032         if let Some(ref vadjustment) = self.vadjustment {
1033             properties.push(("vadjustment", vadjustment));
1034         }
1035         if let Some(ref vscrollbar_policy) = self.vscrollbar_policy {
1036             properties.push(("vscrollbar-policy", vscrollbar_policy));
1037         }
1038         if let Some(ref window_placement) = self.window_placement {
1039             properties.push(("window-placement", window_placement));
1040         }
1041         if let Some(ref border_width) = self.border_width {
1042             properties.push(("border-width", border_width));
1043         }
1044         if let Some(ref child) = self.child {
1045             properties.push(("child", child));
1046         }
1047         if let Some(ref resize_mode) = self.resize_mode {
1048             properties.push(("resize-mode", resize_mode));
1049         }
1050         if let Some(ref app_paintable) = self.app_paintable {
1051             properties.push(("app-paintable", app_paintable));
1052         }
1053         if let Some(ref can_default) = self.can_default {
1054             properties.push(("can-default", can_default));
1055         }
1056         if let Some(ref can_focus) = self.can_focus {
1057             properties.push(("can-focus", can_focus));
1058         }
1059         if let Some(ref events) = self.events {
1060             properties.push(("events", events));
1061         }
1062         if let Some(ref expand) = self.expand {
1063             properties.push(("expand", expand));
1064         }
1065         #[cfg(any(feature = "v3_20", feature = "dox"))]
1066         if let Some(ref focus_on_click) = self.focus_on_click {
1067             properties.push(("focus-on-click", focus_on_click));
1068         }
1069         if let Some(ref halign) = self.halign {
1070             properties.push(("halign", halign));
1071         }
1072         if let Some(ref has_default) = self.has_default {
1073             properties.push(("has-default", has_default));
1074         }
1075         if let Some(ref has_focus) = self.has_focus {
1076             properties.push(("has-focus", has_focus));
1077         }
1078         if let Some(ref has_tooltip) = self.has_tooltip {
1079             properties.push(("has-tooltip", has_tooltip));
1080         }
1081         if let Some(ref height_request) = self.height_request {
1082             properties.push(("height-request", height_request));
1083         }
1084         if let Some(ref hexpand) = self.hexpand {
1085             properties.push(("hexpand", hexpand));
1086         }
1087         if let Some(ref hexpand_set) = self.hexpand_set {
1088             properties.push(("hexpand-set", hexpand_set));
1089         }
1090         if let Some(ref is_focus) = self.is_focus {
1091             properties.push(("is-focus", is_focus));
1092         }
1093         if let Some(ref margin) = self.margin {
1094             properties.push(("margin", margin));
1095         }
1096         if let Some(ref margin_bottom) = self.margin_bottom {
1097             properties.push(("margin-bottom", margin_bottom));
1098         }
1099         if let Some(ref margin_end) = self.margin_end {
1100             properties.push(("margin-end", margin_end));
1101         }
1102         if let Some(ref margin_start) = self.margin_start {
1103             properties.push(("margin-start", margin_start));
1104         }
1105         if let Some(ref margin_top) = self.margin_top {
1106             properties.push(("margin-top", margin_top));
1107         }
1108         if let Some(ref name) = self.name {
1109             properties.push(("name", name));
1110         }
1111         if let Some(ref no_show_all) = self.no_show_all {
1112             properties.push(("no-show-all", no_show_all));
1113         }
1114         if let Some(ref opacity) = self.opacity {
1115             properties.push(("opacity", opacity));
1116         }
1117         if let Some(ref parent) = self.parent {
1118             properties.push(("parent", parent));
1119         }
1120         if let Some(ref receives_default) = self.receives_default {
1121             properties.push(("receives-default", receives_default));
1122         }
1123         if let Some(ref sensitive) = self.sensitive {
1124             properties.push(("sensitive", sensitive));
1125         }
1126         if let Some(ref tooltip_markup) = self.tooltip_markup {
1127             properties.push(("tooltip-markup", tooltip_markup));
1128         }
1129         if let Some(ref tooltip_text) = self.tooltip_text {
1130             properties.push(("tooltip-text", tooltip_text));
1131         }
1132         if let Some(ref valign) = self.valign {
1133             properties.push(("valign", valign));
1134         }
1135         if let Some(ref vexpand) = self.vexpand {
1136             properties.push(("vexpand", vexpand));
1137         }
1138         if let Some(ref vexpand_set) = self.vexpand_set {
1139             properties.push(("vexpand-set", vexpand_set));
1140         }
1141         if let Some(ref visible) = self.visible {
1142             properties.push(("visible", visible));
1143         }
1144         if let Some(ref width_request) = self.width_request {
1145             properties.push(("width-request", width_request));
1146         }
1147         glib::Object::new::<PlacesSidebar>(&properties)
1148             .expect("Failed to create an instance of PlacesSidebar")
1149     }
1150 
local_only(mut self, local_only: bool) -> Self1151     pub fn local_only(mut self, local_only: bool) -> Self {
1152         self.local_only = Some(local_only);
1153         self
1154     }
1155 
location<P: IsA<gio::File>>(mut self, location: &P) -> Self1156     pub fn location<P: IsA<gio::File>>(mut self, location: &P) -> Self {
1157         self.location = Some(location.clone().upcast());
1158         self
1159     }
1160 
open_flags(mut self, open_flags: PlacesOpenFlags) -> Self1161     pub fn open_flags(mut self, open_flags: PlacesOpenFlags) -> Self {
1162         self.open_flags = Some(open_flags);
1163         self
1164     }
1165 
populate_all(mut self, populate_all: bool) -> Self1166     pub fn populate_all(mut self, populate_all: bool) -> Self {
1167         self.populate_all = Some(populate_all);
1168         self
1169     }
1170 
show_connect_to_server(mut self, show_connect_to_server: bool) -> Self1171     pub fn show_connect_to_server(mut self, show_connect_to_server: bool) -> Self {
1172         self.show_connect_to_server = Some(show_connect_to_server);
1173         self
1174     }
1175 
show_desktop(mut self, show_desktop: bool) -> Self1176     pub fn show_desktop(mut self, show_desktop: bool) -> Self {
1177         self.show_desktop = Some(show_desktop);
1178         self
1179     }
1180 
show_enter_location(mut self, show_enter_location: bool) -> Self1181     pub fn show_enter_location(mut self, show_enter_location: bool) -> Self {
1182         self.show_enter_location = Some(show_enter_location);
1183         self
1184     }
1185 
show_other_locations(mut self, show_other_locations: bool) -> Self1186     pub fn show_other_locations(mut self, show_other_locations: bool) -> Self {
1187         self.show_other_locations = Some(show_other_locations);
1188         self
1189     }
1190 
show_recent(mut self, show_recent: bool) -> Self1191     pub fn show_recent(mut self, show_recent: bool) -> Self {
1192         self.show_recent = Some(show_recent);
1193         self
1194     }
1195 
1196     #[cfg(any(feature = "v3_22_26", feature = "dox"))]
1197     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22_26")))]
show_starred_location(mut self, show_starred_location: bool) -> Self1198     pub fn show_starred_location(mut self, show_starred_location: bool) -> Self {
1199         self.show_starred_location = Some(show_starred_location);
1200         self
1201     }
1202 
show_trash(mut self, show_trash: bool) -> Self1203     pub fn show_trash(mut self, show_trash: bool) -> Self {
1204         self.show_trash = Some(show_trash);
1205         self
1206     }
1207 
hadjustment<P: IsA<Adjustment>>(mut self, hadjustment: &P) -> Self1208     pub fn hadjustment<P: IsA<Adjustment>>(mut self, hadjustment: &P) -> Self {
1209         self.hadjustment = Some(hadjustment.clone().upcast());
1210         self
1211     }
1212 
hscrollbar_policy(mut self, hscrollbar_policy: PolicyType) -> Self1213     pub fn hscrollbar_policy(mut self, hscrollbar_policy: PolicyType) -> Self {
1214         self.hscrollbar_policy = Some(hscrollbar_policy);
1215         self
1216     }
1217 
kinetic_scrolling(mut self, kinetic_scrolling: bool) -> Self1218     pub fn kinetic_scrolling(mut self, kinetic_scrolling: bool) -> Self {
1219         self.kinetic_scrolling = Some(kinetic_scrolling);
1220         self
1221     }
1222 
1223     #[cfg(any(feature = "v3_22", feature = "dox"))]
1224     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
max_content_height(mut self, max_content_height: i32) -> Self1225     pub fn max_content_height(mut self, max_content_height: i32) -> Self {
1226         self.max_content_height = Some(max_content_height);
1227         self
1228     }
1229 
1230     #[cfg(any(feature = "v3_22", feature = "dox"))]
1231     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
max_content_width(mut self, max_content_width: i32) -> Self1232     pub fn max_content_width(mut self, max_content_width: i32) -> Self {
1233         self.max_content_width = Some(max_content_width);
1234         self
1235     }
1236 
min_content_height(mut self, min_content_height: i32) -> Self1237     pub fn min_content_height(mut self, min_content_height: i32) -> Self {
1238         self.min_content_height = Some(min_content_height);
1239         self
1240     }
1241 
min_content_width(mut self, min_content_width: i32) -> Self1242     pub fn min_content_width(mut self, min_content_width: i32) -> Self {
1243         self.min_content_width = Some(min_content_width);
1244         self
1245     }
1246 
overlay_scrolling(mut self, overlay_scrolling: bool) -> Self1247     pub fn overlay_scrolling(mut self, overlay_scrolling: bool) -> Self {
1248         self.overlay_scrolling = Some(overlay_scrolling);
1249         self
1250     }
1251 
1252     #[cfg(any(feature = "v3_22", feature = "dox"))]
1253     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
propagate_natural_height(mut self, propagate_natural_height: bool) -> Self1254     pub fn propagate_natural_height(mut self, propagate_natural_height: bool) -> Self {
1255         self.propagate_natural_height = Some(propagate_natural_height);
1256         self
1257     }
1258 
1259     #[cfg(any(feature = "v3_22", feature = "dox"))]
1260     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
propagate_natural_width(mut self, propagate_natural_width: bool) -> Self1261     pub fn propagate_natural_width(mut self, propagate_natural_width: bool) -> Self {
1262         self.propagate_natural_width = Some(propagate_natural_width);
1263         self
1264     }
1265 
shadow_type(mut self, shadow_type: ShadowType) -> Self1266     pub fn shadow_type(mut self, shadow_type: ShadowType) -> Self {
1267         self.shadow_type = Some(shadow_type);
1268         self
1269     }
1270 
vadjustment<P: IsA<Adjustment>>(mut self, vadjustment: &P) -> Self1271     pub fn vadjustment<P: IsA<Adjustment>>(mut self, vadjustment: &P) -> Self {
1272         self.vadjustment = Some(vadjustment.clone().upcast());
1273         self
1274     }
1275 
vscrollbar_policy(mut self, vscrollbar_policy: PolicyType) -> Self1276     pub fn vscrollbar_policy(mut self, vscrollbar_policy: PolicyType) -> Self {
1277         self.vscrollbar_policy = Some(vscrollbar_policy);
1278         self
1279     }
1280 
window_placement(mut self, window_placement: CornerType) -> Self1281     pub fn window_placement(mut self, window_placement: CornerType) -> Self {
1282         self.window_placement = Some(window_placement);
1283         self
1284     }
1285 
border_width(mut self, border_width: u32) -> Self1286     pub fn border_width(mut self, border_width: u32) -> Self {
1287         self.border_width = Some(border_width);
1288         self
1289     }
1290 
child<P: IsA<Widget>>(mut self, child: &P) -> Self1291     pub fn child<P: IsA<Widget>>(mut self, child: &P) -> Self {
1292         self.child = Some(child.clone().upcast());
1293         self
1294     }
1295 
resize_mode(mut self, resize_mode: ResizeMode) -> Self1296     pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self {
1297         self.resize_mode = Some(resize_mode);
1298         self
1299     }
1300 
app_paintable(mut self, app_paintable: bool) -> Self1301     pub fn app_paintable(mut self, app_paintable: bool) -> Self {
1302         self.app_paintable = Some(app_paintable);
1303         self
1304     }
1305 
can_default(mut self, can_default: bool) -> Self1306     pub fn can_default(mut self, can_default: bool) -> Self {
1307         self.can_default = Some(can_default);
1308         self
1309     }
1310 
can_focus(mut self, can_focus: bool) -> Self1311     pub fn can_focus(mut self, can_focus: bool) -> Self {
1312         self.can_focus = Some(can_focus);
1313         self
1314     }
1315 
events(mut self, events: gdk::EventMask) -> Self1316     pub fn events(mut self, events: gdk::EventMask) -> Self {
1317         self.events = Some(events);
1318         self
1319     }
1320 
expand(mut self, expand: bool) -> Self1321     pub fn expand(mut self, expand: bool) -> Self {
1322         self.expand = Some(expand);
1323         self
1324     }
1325 
1326     #[cfg(any(feature = "v3_20", feature = "dox"))]
1327     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
focus_on_click(mut self, focus_on_click: bool) -> Self1328     pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
1329         self.focus_on_click = Some(focus_on_click);
1330         self
1331     }
1332 
halign(mut self, halign: Align) -> Self1333     pub fn halign(mut self, halign: Align) -> Self {
1334         self.halign = Some(halign);
1335         self
1336     }
1337 
has_default(mut self, has_default: bool) -> Self1338     pub fn has_default(mut self, has_default: bool) -> Self {
1339         self.has_default = Some(has_default);
1340         self
1341     }
1342 
has_focus(mut self, has_focus: bool) -> Self1343     pub fn has_focus(mut self, has_focus: bool) -> Self {
1344         self.has_focus = Some(has_focus);
1345         self
1346     }
1347 
has_tooltip(mut self, has_tooltip: bool) -> Self1348     pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
1349         self.has_tooltip = Some(has_tooltip);
1350         self
1351     }
1352 
height_request(mut self, height_request: i32) -> Self1353     pub fn height_request(mut self, height_request: i32) -> Self {
1354         self.height_request = Some(height_request);
1355         self
1356     }
1357 
hexpand(mut self, hexpand: bool) -> Self1358     pub fn hexpand(mut self, hexpand: bool) -> Self {
1359         self.hexpand = Some(hexpand);
1360         self
1361     }
1362 
hexpand_set(mut self, hexpand_set: bool) -> Self1363     pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
1364         self.hexpand_set = Some(hexpand_set);
1365         self
1366     }
1367 
is_focus(mut self, is_focus: bool) -> Self1368     pub fn is_focus(mut self, is_focus: bool) -> Self {
1369         self.is_focus = Some(is_focus);
1370         self
1371     }
1372 
margin(mut self, margin: i32) -> Self1373     pub fn margin(mut self, margin: i32) -> Self {
1374         self.margin = Some(margin);
1375         self
1376     }
1377 
margin_bottom(mut self, margin_bottom: i32) -> Self1378     pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
1379         self.margin_bottom = Some(margin_bottom);
1380         self
1381     }
1382 
margin_end(mut self, margin_end: i32) -> Self1383     pub fn margin_end(mut self, margin_end: i32) -> Self {
1384         self.margin_end = Some(margin_end);
1385         self
1386     }
1387 
margin_start(mut self, margin_start: i32) -> Self1388     pub fn margin_start(mut self, margin_start: i32) -> Self {
1389         self.margin_start = Some(margin_start);
1390         self
1391     }
1392 
margin_top(mut self, margin_top: i32) -> Self1393     pub fn margin_top(mut self, margin_top: i32) -> Self {
1394         self.margin_top = Some(margin_top);
1395         self
1396     }
1397 
name(mut self, name: &str) -> Self1398     pub fn name(mut self, name: &str) -> Self {
1399         self.name = Some(name.to_string());
1400         self
1401     }
1402 
no_show_all(mut self, no_show_all: bool) -> Self1403     pub fn no_show_all(mut self, no_show_all: bool) -> Self {
1404         self.no_show_all = Some(no_show_all);
1405         self
1406     }
1407 
opacity(mut self, opacity: f64) -> Self1408     pub fn opacity(mut self, opacity: f64) -> Self {
1409         self.opacity = Some(opacity);
1410         self
1411     }
1412 
parent<P: IsA<Container>>(mut self, parent: &P) -> Self1413     pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self {
1414         self.parent = Some(parent.clone().upcast());
1415         self
1416     }
1417 
receives_default(mut self, receives_default: bool) -> Self1418     pub fn receives_default(mut self, receives_default: bool) -> Self {
1419         self.receives_default = Some(receives_default);
1420         self
1421     }
1422 
sensitive(mut self, sensitive: bool) -> Self1423     pub fn sensitive(mut self, sensitive: bool) -> Self {
1424         self.sensitive = Some(sensitive);
1425         self
1426     }
1427 
tooltip_markup(mut self, tooltip_markup: &str) -> Self1428     pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
1429         self.tooltip_markup = Some(tooltip_markup.to_string());
1430         self
1431     }
1432 
tooltip_text(mut self, tooltip_text: &str) -> Self1433     pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
1434         self.tooltip_text = Some(tooltip_text.to_string());
1435         self
1436     }
1437 
valign(mut self, valign: Align) -> Self1438     pub fn valign(mut self, valign: Align) -> Self {
1439         self.valign = Some(valign);
1440         self
1441     }
1442 
vexpand(mut self, vexpand: bool) -> Self1443     pub fn vexpand(mut self, vexpand: bool) -> Self {
1444         self.vexpand = Some(vexpand);
1445         self
1446     }
1447 
vexpand_set(mut self, vexpand_set: bool) -> Self1448     pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
1449         self.vexpand_set = Some(vexpand_set);
1450         self
1451     }
1452 
visible(mut self, visible: bool) -> Self1453     pub fn visible(mut self, visible: bool) -> Self {
1454         self.visible = Some(visible);
1455         self
1456     }
1457 
width_request(mut self, width_request: i32) -> Self1458     pub fn width_request(mut self, width_request: i32) -> Self {
1459         self.width_request = Some(width_request);
1460         self
1461     }
1462 }
1463 
1464 impl fmt::Display for PlacesSidebar {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1465     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1466         f.write_str("PlacesSidebar")
1467     }
1468 }
1469