gtk/auto/
places_sidebar.rs

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
5use gdk;
6use gio;
7use gio_sys;
8use glib::object::Cast;
9use glib::object::IsA;
10use glib::object::ObjectType as ObjectType_;
11use glib::signal::connect_raw;
12use glib::signal::SignalHandlerId;
13use glib::translate::*;
14use glib::GString;
15use glib::StaticType;
16use glib::ToValue;
17use glib::Value;
18use glib_sys;
19use gobject_sys;
20use gtk_sys;
21use libc;
22use std::boxed::Box as Box_;
23use std::fmt;
24use std::mem::transmute;
25use Adjustment;
26use Align;
27use Bin;
28use Buildable;
29use Container;
30use CornerType;
31use PlacesOpenFlags;
32use PolicyType;
33use ResizeMode;
34use ScrolledWindow;
35use ShadowType;
36use Widget;
37
38glib_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
46impl PlacesSidebar {
47    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
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
61    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
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
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
86    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)]
95    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
103    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
111    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"))]
120    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"))]
129    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"))]
138    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"))]
147    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
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
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"))]
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
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
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
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)]
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
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
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"))]
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"))]
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"))]
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"))]
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"))]
270    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.get().unwrap()
279        }
280    }
281
282    #[cfg(any(feature = "v3_18", feature = "dox"))]
283    pub fn set_property_populate_all(&self, populate_all: bool) {
284        unsafe {
285            gobject_sys::g_object_set_property(
286                self.as_ptr() as *mut gobject_sys::GObject,
287                b"populate-all\0".as_ptr() as *const _,
288                Value::from(&populate_all).to_glib_none().0,
289            );
290        }
291    }
292
293    pub fn get_property_show_other_locations(&self) -> bool {
294        unsafe {
295            let mut value = Value::from_type(<bool as StaticType>::static_type());
296            gobject_sys::g_object_get_property(
297                self.as_ptr() as *mut gobject_sys::GObject,
298                b"show-other-locations\0".as_ptr() as *const _,
299                value.to_glib_none_mut().0,
300            );
301            value.get().unwrap()
302        }
303    }
304
305    pub fn set_property_show_other_locations(&self, show_other_locations: bool) {
306        unsafe {
307            gobject_sys::g_object_set_property(
308                self.as_ptr() as *mut gobject_sys::GObject,
309                b"show-other-locations\0".as_ptr() as *const _,
310                Value::from(&show_other_locations).to_glib_none().0,
311            );
312        }
313    }
314
315    pub fn get_property_show_recent(&self) -> bool {
316        unsafe {
317            let mut value = Value::from_type(<bool as StaticType>::static_type());
318            gobject_sys::g_object_get_property(
319                self.as_ptr() as *mut gobject_sys::GObject,
320                b"show-recent\0".as_ptr() as *const _,
321                value.to_glib_none_mut().0,
322            );
323            value.get().unwrap()
324        }
325    }
326
327    pub fn set_property_show_recent(&self, show_recent: bool) {
328        unsafe {
329            gobject_sys::g_object_set_property(
330                self.as_ptr() as *mut gobject_sys::GObject,
331                b"show-recent\0".as_ptr() as *const _,
332                Value::from(&show_recent).to_glib_none().0,
333            );
334        }
335    }
336
337    pub fn get_property_show_trash(&self) -> bool {
338        unsafe {
339            let mut value = Value::from_type(<bool as StaticType>::static_type());
340            gobject_sys::g_object_get_property(
341                self.as_ptr() as *mut gobject_sys::GObject,
342                b"show-trash\0".as_ptr() as *const _,
343                value.to_glib_none_mut().0,
344            );
345            value.get().unwrap()
346        }
347    }
348
349    pub fn set_property_show_trash(&self, show_trash: bool) {
350        unsafe {
351            gobject_sys::g_object_set_property(
352                self.as_ptr() as *mut gobject_sys::GObject,
353                b"show-trash\0".as_ptr() as *const _,
354                Value::from(&show_trash).to_glib_none().0,
355            );
356        }
357    }
358
359    pub fn connect_drag_action_ask<F: Fn(&PlacesSidebar, i32) -> i32 + 'static>(
360        &self,
361        f: F,
362    ) -> SignalHandlerId {
363        unsafe extern "C" fn drag_action_ask_trampoline<
364            F: Fn(&PlacesSidebar, i32) -> i32 + 'static,
365        >(
366            this: *mut gtk_sys::GtkPlacesSidebar,
367            actions: libc::c_int,
368            f: glib_sys::gpointer,
369        ) -> libc::c_int {
370            let f: &F = &*(f as *const F);
371            f(&from_glib_borrow(this), actions)
372        }
373        unsafe {
374            let f: Box_<F> = Box_::new(f);
375            connect_raw(
376                self.as_ptr() as *mut _,
377                b"drag-action-ask\0".as_ptr() as *const _,
378                Some(transmute(drag_action_ask_trampoline::<F> as usize)),
379                Box_::into_raw(f),
380            )
381        }
382    }
383
384    #[cfg(any(feature = "v3_20", feature = "dox"))]
385    pub fn connect_mount<F: Fn(&PlacesSidebar, &gio::MountOperation) + 'static>(
386        &self,
387        f: F,
388    ) -> SignalHandlerId {
389        unsafe extern "C" fn mount_trampoline<
390            F: Fn(&PlacesSidebar, &gio::MountOperation) + 'static,
391        >(
392            this: *mut gtk_sys::GtkPlacesSidebar,
393            mount_operation: *mut gio_sys::GMountOperation,
394            f: glib_sys::gpointer,
395        ) {
396            let f: &F = &*(f as *const F);
397            f(&from_glib_borrow(this), &from_glib_borrow(mount_operation))
398        }
399        unsafe {
400            let f: Box_<F> = Box_::new(f);
401            connect_raw(
402                self.as_ptr() as *mut _,
403                b"mount\0".as_ptr() as *const _,
404                Some(transmute(mount_trampoline::<F> as usize)),
405                Box_::into_raw(f),
406            )
407        }
408    }
409
410    pub fn connect_open_location<F: Fn(&PlacesSidebar, &gio::File, PlacesOpenFlags) + 'static>(
411        &self,
412        f: F,
413    ) -> SignalHandlerId {
414        unsafe extern "C" fn open_location_trampoline<
415            F: Fn(&PlacesSidebar, &gio::File, PlacesOpenFlags) + 'static,
416        >(
417            this: *mut gtk_sys::GtkPlacesSidebar,
418            location: *mut gio_sys::GFile,
419            open_flags: gtk_sys::GtkPlacesOpenFlags,
420            f: glib_sys::gpointer,
421        ) {
422            let f: &F = &*(f as *const F);
423            f(
424                &from_glib_borrow(this),
425                &from_glib_borrow(location),
426                from_glib(open_flags),
427            )
428        }
429        unsafe {
430            let f: Box_<F> = Box_::new(f);
431            connect_raw(
432                self.as_ptr() as *mut _,
433                b"open-location\0".as_ptr() as *const _,
434                Some(transmute(open_location_trampoline::<F> as usize)),
435                Box_::into_raw(f),
436            )
437        }
438    }
439
440    //pub fn connect_populate_popup<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
441    //    Ignored selected_volume: Gio.Volume
442    //}
443
444    #[cfg_attr(feature = "v3_18", deprecated)]
445    pub fn connect_show_connect_to_server<F: Fn(&PlacesSidebar) + 'static>(
446        &self,
447        f: F,
448    ) -> SignalHandlerId {
449        unsafe extern "C" fn show_connect_to_server_trampoline<F: Fn(&PlacesSidebar) + 'static>(
450            this: *mut gtk_sys::GtkPlacesSidebar,
451            f: glib_sys::gpointer,
452        ) {
453            let f: &F = &*(f as *const F);
454            f(&from_glib_borrow(this))
455        }
456        unsafe {
457            let f: Box_<F> = Box_::new(f);
458            connect_raw(
459                self.as_ptr() as *mut _,
460                b"show-connect-to-server\0".as_ptr() as *const _,
461                Some(transmute(show_connect_to_server_trampoline::<F> as usize)),
462                Box_::into_raw(f),
463            )
464        }
465    }
466
467    pub fn connect_show_enter_location<F: Fn(&PlacesSidebar) + 'static>(
468        &self,
469        f: F,
470    ) -> SignalHandlerId {
471        unsafe extern "C" fn show_enter_location_trampoline<F: Fn(&PlacesSidebar) + 'static>(
472            this: *mut gtk_sys::GtkPlacesSidebar,
473            f: glib_sys::gpointer,
474        ) {
475            let f: &F = &*(f as *const F);
476            f(&from_glib_borrow(this))
477        }
478        unsafe {
479            let f: Box_<F> = Box_::new(f);
480            connect_raw(
481                self.as_ptr() as *mut _,
482                b"show-enter-location\0".as_ptr() as *const _,
483                Some(transmute(show_enter_location_trampoline::<F> as usize)),
484                Box_::into_raw(f),
485            )
486        }
487    }
488
489    pub fn connect_show_error_message<F: Fn(&PlacesSidebar, &str, &str) + 'static>(
490        &self,
491        f: F,
492    ) -> SignalHandlerId {
493        unsafe extern "C" fn show_error_message_trampoline<
494            F: Fn(&PlacesSidebar, &str, &str) + 'static,
495        >(
496            this: *mut gtk_sys::GtkPlacesSidebar,
497            primary: *mut libc::c_char,
498            secondary: *mut libc::c_char,
499            f: glib_sys::gpointer,
500        ) {
501            let f: &F = &*(f as *const F);
502            f(
503                &from_glib_borrow(this),
504                &GString::from_glib_borrow(primary),
505                &GString::from_glib_borrow(secondary),
506            )
507        }
508        unsafe {
509            let f: Box_<F> = Box_::new(f);
510            connect_raw(
511                self.as_ptr() as *mut _,
512                b"show-error-message\0".as_ptr() as *const _,
513                Some(transmute(show_error_message_trampoline::<F> as usize)),
514                Box_::into_raw(f),
515            )
516        }
517    }
518
519    #[cfg_attr(feature = "v3_20", deprecated)]
520    #[cfg(any(feature = "v3_18", feature = "dox"))]
521    pub fn connect_show_other_locations<F: Fn(&PlacesSidebar) + 'static>(
522        &self,
523        f: F,
524    ) -> SignalHandlerId {
525        unsafe extern "C" fn show_other_locations_trampoline<F: Fn(&PlacesSidebar) + 'static>(
526            this: *mut gtk_sys::GtkPlacesSidebar,
527            f: glib_sys::gpointer,
528        ) {
529            let f: &F = &*(f as *const F);
530            f(&from_glib_borrow(this))
531        }
532        unsafe {
533            let f: Box_<F> = Box_::new(f);
534            connect_raw(
535                self.as_ptr() as *mut _,
536                b"show-other-locations\0".as_ptr() as *const _,
537                Some(transmute(show_other_locations_trampoline::<F> as usize)),
538                Box_::into_raw(f),
539            )
540        }
541    }
542
543    #[cfg(any(feature = "v3_20", feature = "dox"))]
544    pub fn connect_show_other_locations_with_flags<
545        F: Fn(&PlacesSidebar, PlacesOpenFlags) + 'static,
546    >(
547        &self,
548        f: F,
549    ) -> SignalHandlerId {
550        unsafe extern "C" fn show_other_locations_with_flags_trampoline<
551            F: Fn(&PlacesSidebar, PlacesOpenFlags) + 'static,
552        >(
553            this: *mut gtk_sys::GtkPlacesSidebar,
554            open_flags: gtk_sys::GtkPlacesOpenFlags,
555            f: glib_sys::gpointer,
556        ) {
557            let f: &F = &*(f as *const F);
558            f(&from_glib_borrow(this), from_glib(open_flags))
559        }
560        unsafe {
561            let f: Box_<F> = Box_::new(f);
562            connect_raw(
563                self.as_ptr() as *mut _,
564                b"show-other-locations-with-flags\0".as_ptr() as *const _,
565                Some(transmute(
566                    show_other_locations_with_flags_trampoline::<F> as usize,
567                )),
568                Box_::into_raw(f),
569            )
570        }
571    }
572
573    #[cfg(any(feature = "v3_22_26", feature = "dox"))]
574    pub fn connect_show_starred_location<F: Fn(&PlacesSidebar, PlacesOpenFlags) + 'static>(
575        &self,
576        f: F,
577    ) -> SignalHandlerId {
578        unsafe extern "C" fn show_starred_location_trampoline<
579            F: Fn(&PlacesSidebar, PlacesOpenFlags) + 'static,
580        >(
581            this: *mut gtk_sys::GtkPlacesSidebar,
582            open_flags: gtk_sys::GtkPlacesOpenFlags,
583            f: glib_sys::gpointer,
584        ) {
585            let f: &F = &*(f as *const F);
586            f(&from_glib_borrow(this), from_glib(open_flags))
587        }
588        unsafe {
589            let f: Box_<F> = Box_::new(f);
590            connect_raw(
591                self.as_ptr() as *mut _,
592                b"show-starred-location\0".as_ptr() as *const _,
593                Some(transmute(show_starred_location_trampoline::<F> as usize)),
594                Box_::into_raw(f),
595            )
596        }
597    }
598
599    #[cfg(any(feature = "v3_20", feature = "dox"))]
600    pub fn connect_unmount<F: Fn(&PlacesSidebar, &gio::MountOperation) + 'static>(
601        &self,
602        f: F,
603    ) -> SignalHandlerId {
604        unsafe extern "C" fn unmount_trampoline<
605            F: Fn(&PlacesSidebar, &gio::MountOperation) + 'static,
606        >(
607            this: *mut gtk_sys::GtkPlacesSidebar,
608            mount_operation: *mut gio_sys::GMountOperation,
609            f: glib_sys::gpointer,
610        ) {
611            let f: &F = &*(f as *const F);
612            f(&from_glib_borrow(this), &from_glib_borrow(mount_operation))
613        }
614        unsafe {
615            let f: Box_<F> = Box_::new(f);
616            connect_raw(
617                self.as_ptr() as *mut _,
618                b"unmount\0".as_ptr() as *const _,
619                Some(transmute(unmount_trampoline::<F> as usize)),
620                Box_::into_raw(f),
621            )
622        }
623    }
624
625    pub fn connect_property_local_only_notify<F: Fn(&PlacesSidebar) + 'static>(
626        &self,
627        f: F,
628    ) -> SignalHandlerId {
629        unsafe extern "C" fn notify_local_only_trampoline<F: Fn(&PlacesSidebar) + 'static>(
630            this: *mut gtk_sys::GtkPlacesSidebar,
631            _param_spec: glib_sys::gpointer,
632            f: glib_sys::gpointer,
633        ) {
634            let f: &F = &*(f as *const F);
635            f(&from_glib_borrow(this))
636        }
637        unsafe {
638            let f: Box_<F> = Box_::new(f);
639            connect_raw(
640                self.as_ptr() as *mut _,
641                b"notify::local-only\0".as_ptr() as *const _,
642                Some(transmute(notify_local_only_trampoline::<F> as usize)),
643                Box_::into_raw(f),
644            )
645        }
646    }
647
648    pub fn connect_property_location_notify<F: Fn(&PlacesSidebar) + 'static>(
649        &self,
650        f: F,
651    ) -> SignalHandlerId {
652        unsafe extern "C" fn notify_location_trampoline<F: Fn(&PlacesSidebar) + 'static>(
653            this: *mut gtk_sys::GtkPlacesSidebar,
654            _param_spec: glib_sys::gpointer,
655            f: glib_sys::gpointer,
656        ) {
657            let f: &F = &*(f as *const F);
658            f(&from_glib_borrow(this))
659        }
660        unsafe {
661            let f: Box_<F> = Box_::new(f);
662            connect_raw(
663                self.as_ptr() as *mut _,
664                b"notify::location\0".as_ptr() as *const _,
665                Some(transmute(notify_location_trampoline::<F> as usize)),
666                Box_::into_raw(f),
667            )
668        }
669    }
670
671    pub fn connect_property_open_flags_notify<F: Fn(&PlacesSidebar) + 'static>(
672        &self,
673        f: F,
674    ) -> SignalHandlerId {
675        unsafe extern "C" fn notify_open_flags_trampoline<F: Fn(&PlacesSidebar) + 'static>(
676            this: *mut gtk_sys::GtkPlacesSidebar,
677            _param_spec: glib_sys::gpointer,
678            f: glib_sys::gpointer,
679        ) {
680            let f: &F = &*(f as *const F);
681            f(&from_glib_borrow(this))
682        }
683        unsafe {
684            let f: Box_<F> = Box_::new(f);
685            connect_raw(
686                self.as_ptr() as *mut _,
687                b"notify::open-flags\0".as_ptr() as *const _,
688                Some(transmute(notify_open_flags_trampoline::<F> as usize)),
689                Box_::into_raw(f),
690            )
691        }
692    }
693
694    #[cfg(any(feature = "v3_18", feature = "dox"))]
695    pub fn connect_property_populate_all_notify<F: Fn(&PlacesSidebar) + 'static>(
696        &self,
697        f: F,
698    ) -> SignalHandlerId {
699        unsafe extern "C" fn notify_populate_all_trampoline<F: Fn(&PlacesSidebar) + 'static>(
700            this: *mut gtk_sys::GtkPlacesSidebar,
701            _param_spec: glib_sys::gpointer,
702            f: glib_sys::gpointer,
703        ) {
704            let f: &F = &*(f as *const F);
705            f(&from_glib_borrow(this))
706        }
707        unsafe {
708            let f: Box_<F> = Box_::new(f);
709            connect_raw(
710                self.as_ptr() as *mut _,
711                b"notify::populate-all\0".as_ptr() as *const _,
712                Some(transmute(notify_populate_all_trampoline::<F> as usize)),
713                Box_::into_raw(f),
714            )
715        }
716    }
717
718    pub fn connect_property_show_connect_to_server_notify<F: Fn(&PlacesSidebar) + 'static>(
719        &self,
720        f: F,
721    ) -> SignalHandlerId {
722        unsafe extern "C" fn notify_show_connect_to_server_trampoline<
723            F: Fn(&PlacesSidebar) + 'static,
724        >(
725            this: *mut gtk_sys::GtkPlacesSidebar,
726            _param_spec: glib_sys::gpointer,
727            f: glib_sys::gpointer,
728        ) {
729            let f: &F = &*(f as *const F);
730            f(&from_glib_borrow(this))
731        }
732        unsafe {
733            let f: Box_<F> = Box_::new(f);
734            connect_raw(
735                self.as_ptr() as *mut _,
736                b"notify::show-connect-to-server\0".as_ptr() as *const _,
737                Some(transmute(
738                    notify_show_connect_to_server_trampoline::<F> as usize,
739                )),
740                Box_::into_raw(f),
741            )
742        }
743    }
744
745    pub fn connect_property_show_desktop_notify<F: Fn(&PlacesSidebar) + 'static>(
746        &self,
747        f: F,
748    ) -> SignalHandlerId {
749        unsafe extern "C" fn notify_show_desktop_trampoline<F: Fn(&PlacesSidebar) + 'static>(
750            this: *mut gtk_sys::GtkPlacesSidebar,
751            _param_spec: glib_sys::gpointer,
752            f: glib_sys::gpointer,
753        ) {
754            let f: &F = &*(f as *const F);
755            f(&from_glib_borrow(this))
756        }
757        unsafe {
758            let f: Box_<F> = Box_::new(f);
759            connect_raw(
760                self.as_ptr() as *mut _,
761                b"notify::show-desktop\0".as_ptr() as *const _,
762                Some(transmute(notify_show_desktop_trampoline::<F> as usize)),
763                Box_::into_raw(f),
764            )
765        }
766    }
767
768    pub fn connect_property_show_enter_location_notify<F: Fn(&PlacesSidebar) + 'static>(
769        &self,
770        f: F,
771    ) -> SignalHandlerId {
772        unsafe extern "C" fn notify_show_enter_location_trampoline<
773            F: Fn(&PlacesSidebar) + 'static,
774        >(
775            this: *mut gtk_sys::GtkPlacesSidebar,
776            _param_spec: glib_sys::gpointer,
777            f: glib_sys::gpointer,
778        ) {
779            let f: &F = &*(f as *const F);
780            f(&from_glib_borrow(this))
781        }
782        unsafe {
783            let f: Box_<F> = Box_::new(f);
784            connect_raw(
785                self.as_ptr() as *mut _,
786                b"notify::show-enter-location\0".as_ptr() as *const _,
787                Some(transmute(
788                    notify_show_enter_location_trampoline::<F> as usize,
789                )),
790                Box_::into_raw(f),
791            )
792        }
793    }
794
795    pub fn connect_property_show_other_locations_notify<F: Fn(&PlacesSidebar) + 'static>(
796        &self,
797        f: F,
798    ) -> SignalHandlerId {
799        unsafe extern "C" fn notify_show_other_locations_trampoline<
800            F: Fn(&PlacesSidebar) + 'static,
801        >(
802            this: *mut gtk_sys::GtkPlacesSidebar,
803            _param_spec: glib_sys::gpointer,
804            f: glib_sys::gpointer,
805        ) {
806            let f: &F = &*(f as *const F);
807            f(&from_glib_borrow(this))
808        }
809        unsafe {
810            let f: Box_<F> = Box_::new(f);
811            connect_raw(
812                self.as_ptr() as *mut _,
813                b"notify::show-other-locations\0".as_ptr() as *const _,
814                Some(transmute(
815                    notify_show_other_locations_trampoline::<F> as usize,
816                )),
817                Box_::into_raw(f),
818            )
819        }
820    }
821
822    pub fn connect_property_show_recent_notify<F: Fn(&PlacesSidebar) + 'static>(
823        &self,
824        f: F,
825    ) -> SignalHandlerId {
826        unsafe extern "C" fn notify_show_recent_trampoline<F: Fn(&PlacesSidebar) + 'static>(
827            this: *mut gtk_sys::GtkPlacesSidebar,
828            _param_spec: glib_sys::gpointer,
829            f: glib_sys::gpointer,
830        ) {
831            let f: &F = &*(f as *const F);
832            f(&from_glib_borrow(this))
833        }
834        unsafe {
835            let f: Box_<F> = Box_::new(f);
836            connect_raw(
837                self.as_ptr() as *mut _,
838                b"notify::show-recent\0".as_ptr() as *const _,
839                Some(transmute(notify_show_recent_trampoline::<F> as usize)),
840                Box_::into_raw(f),
841            )
842        }
843    }
844
845    #[cfg(any(feature = "v3_22_26", feature = "dox"))]
846    pub fn connect_property_show_starred_location_notify<F: Fn(&PlacesSidebar) + 'static>(
847        &self,
848        f: F,
849    ) -> SignalHandlerId {
850        unsafe extern "C" fn notify_show_starred_location_trampoline<
851            F: Fn(&PlacesSidebar) + 'static,
852        >(
853            this: *mut gtk_sys::GtkPlacesSidebar,
854            _param_spec: glib_sys::gpointer,
855            f: glib_sys::gpointer,
856        ) {
857            let f: &F = &*(f as *const F);
858            f(&from_glib_borrow(this))
859        }
860        unsafe {
861            let f: Box_<F> = Box_::new(f);
862            connect_raw(
863                self.as_ptr() as *mut _,
864                b"notify::show-starred-location\0".as_ptr() as *const _,
865                Some(transmute(
866                    notify_show_starred_location_trampoline::<F> as usize,
867                )),
868                Box_::into_raw(f),
869            )
870        }
871    }
872
873    pub fn connect_property_show_trash_notify<F: Fn(&PlacesSidebar) + 'static>(
874        &self,
875        f: F,
876    ) -> SignalHandlerId {
877        unsafe extern "C" fn notify_show_trash_trampoline<F: Fn(&PlacesSidebar) + 'static>(
878            this: *mut gtk_sys::GtkPlacesSidebar,
879            _param_spec: glib_sys::gpointer,
880            f: glib_sys::gpointer,
881        ) {
882            let f: &F = &*(f as *const F);
883            f(&from_glib_borrow(this))
884        }
885        unsafe {
886            let f: Box_<F> = Box_::new(f);
887            connect_raw(
888                self.as_ptr() as *mut _,
889                b"notify::show-trash\0".as_ptr() as *const _,
890                Some(transmute(notify_show_trash_trampoline::<F> as usize)),
891                Box_::into_raw(f),
892            )
893        }
894    }
895}
896
897impl Default for PlacesSidebar {
898    fn default() -> Self {
899        Self::new()
900    }
901}
902
903pub struct PlacesSidebarBuilder {
904    local_only: Option<bool>,
905    location: Option<gio::File>,
906    open_flags: Option<PlacesOpenFlags>,
907    #[cfg(any(feature = "v3_18", feature = "dox"))]
908    populate_all: Option<bool>,
909    show_connect_to_server: Option<bool>,
910    show_desktop: Option<bool>,
911    show_enter_location: Option<bool>,
912    show_other_locations: Option<bool>,
913    show_recent: Option<bool>,
914    #[cfg(any(feature = "v3_22_26", feature = "dox"))]
915    show_starred_location: Option<bool>,
916    show_trash: Option<bool>,
917    hadjustment: Option<Adjustment>,
918    hscrollbar_policy: Option<PolicyType>,
919    kinetic_scrolling: Option<bool>,
920    #[cfg(any(feature = "v3_22", feature = "dox"))]
921    max_content_height: Option<i32>,
922    #[cfg(any(feature = "v3_22", feature = "dox"))]
923    max_content_width: Option<i32>,
924    min_content_height: Option<i32>,
925    min_content_width: Option<i32>,
926    #[cfg(any(feature = "v3_16", feature = "dox"))]
927    overlay_scrolling: Option<bool>,
928    #[cfg(any(feature = "v3_22", feature = "dox"))]
929    propagate_natural_height: Option<bool>,
930    #[cfg(any(feature = "v3_22", feature = "dox"))]
931    propagate_natural_width: Option<bool>,
932    shadow_type: Option<ShadowType>,
933    vadjustment: Option<Adjustment>,
934    vscrollbar_policy: Option<PolicyType>,
935    window_placement: Option<CornerType>,
936    border_width: Option<u32>,
937    child: Option<Widget>,
938    resize_mode: Option<ResizeMode>,
939    app_paintable: Option<bool>,
940    can_default: Option<bool>,
941    can_focus: Option<bool>,
942    events: Option<gdk::EventMask>,
943    expand: Option<bool>,
944    #[cfg(any(feature = "v3_20", feature = "dox"))]
945    focus_on_click: Option<bool>,
946    halign: Option<Align>,
947    has_default: Option<bool>,
948    has_focus: Option<bool>,
949    has_tooltip: Option<bool>,
950    height_request: Option<i32>,
951    hexpand: Option<bool>,
952    hexpand_set: Option<bool>,
953    is_focus: Option<bool>,
954    margin: Option<i32>,
955    margin_bottom: Option<i32>,
956    margin_end: Option<i32>,
957    margin_start: Option<i32>,
958    margin_top: Option<i32>,
959    name: Option<String>,
960    no_show_all: Option<bool>,
961    opacity: Option<f64>,
962    parent: Option<Container>,
963    receives_default: Option<bool>,
964    sensitive: Option<bool>,
965    //style: /*Unknown type*/,
966    tooltip_markup: Option<String>,
967    tooltip_text: Option<String>,
968    valign: Option<Align>,
969    vexpand: Option<bool>,
970    vexpand_set: Option<bool>,
971    visible: Option<bool>,
972    width_request: Option<i32>,
973}
974
975impl PlacesSidebarBuilder {
976    pub fn new() -> Self {
977        Self {
978            local_only: None,
979            location: None,
980            open_flags: None,
981            #[cfg(any(feature = "v3_18", feature = "dox"))]
982            populate_all: None,
983            show_connect_to_server: None,
984            show_desktop: None,
985            show_enter_location: None,
986            show_other_locations: None,
987            show_recent: None,
988            #[cfg(any(feature = "v3_22_26", feature = "dox"))]
989            show_starred_location: None,
990            show_trash: None,
991            hadjustment: None,
992            hscrollbar_policy: None,
993            kinetic_scrolling: None,
994            #[cfg(any(feature = "v3_22", feature = "dox"))]
995            max_content_height: None,
996            #[cfg(any(feature = "v3_22", feature = "dox"))]
997            max_content_width: None,
998            min_content_height: None,
999            min_content_width: None,
1000            #[cfg(any(feature = "v3_16", feature = "dox"))]
1001            overlay_scrolling: None,
1002            #[cfg(any(feature = "v3_22", feature = "dox"))]
1003            propagate_natural_height: None,
1004            #[cfg(any(feature = "v3_22", feature = "dox"))]
1005            propagate_natural_width: None,
1006            shadow_type: None,
1007            vadjustment: None,
1008            vscrollbar_policy: None,
1009            window_placement: None,
1010            border_width: None,
1011            child: None,
1012            resize_mode: None,
1013            app_paintable: None,
1014            can_default: None,
1015            can_focus: None,
1016            events: None,
1017            expand: None,
1018            #[cfg(any(feature = "v3_20", feature = "dox"))]
1019            focus_on_click: None,
1020            halign: None,
1021            has_default: None,
1022            has_focus: None,
1023            has_tooltip: None,
1024            height_request: None,
1025            hexpand: None,
1026            hexpand_set: None,
1027            is_focus: None,
1028            margin: None,
1029            margin_bottom: None,
1030            margin_end: None,
1031            margin_start: None,
1032            margin_top: None,
1033            name: None,
1034            no_show_all: None,
1035            opacity: None,
1036            parent: None,
1037            receives_default: None,
1038            sensitive: None,
1039            tooltip_markup: None,
1040            tooltip_text: None,
1041            valign: None,
1042            vexpand: None,
1043            vexpand_set: None,
1044            visible: None,
1045            width_request: None,
1046        }
1047    }
1048
1049    pub fn build(self) -> PlacesSidebar {
1050        let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
1051        if let Some(ref local_only) = self.local_only {
1052            properties.push(("local-only", local_only));
1053        }
1054        if let Some(ref location) = self.location {
1055            properties.push(("location", location));
1056        }
1057        if let Some(ref open_flags) = self.open_flags {
1058            properties.push(("open-flags", open_flags));
1059        }
1060        #[cfg(any(feature = "v3_18", feature = "dox"))]
1061        {
1062            if let Some(ref populate_all) = self.populate_all {
1063                properties.push(("populate-all", populate_all));
1064            }
1065        }
1066        if let Some(ref show_connect_to_server) = self.show_connect_to_server {
1067            properties.push(("show-connect-to-server", show_connect_to_server));
1068        }
1069        if let Some(ref show_desktop) = self.show_desktop {
1070            properties.push(("show-desktop", show_desktop));
1071        }
1072        if let Some(ref show_enter_location) = self.show_enter_location {
1073            properties.push(("show-enter-location", show_enter_location));
1074        }
1075        if let Some(ref show_other_locations) = self.show_other_locations {
1076            properties.push(("show-other-locations", show_other_locations));
1077        }
1078        if let Some(ref show_recent) = self.show_recent {
1079            properties.push(("show-recent", show_recent));
1080        }
1081        #[cfg(any(feature = "v3_22_26", feature = "dox"))]
1082        {
1083            if let Some(ref show_starred_location) = self.show_starred_location {
1084                properties.push(("show-starred-location", show_starred_location));
1085            }
1086        }
1087        if let Some(ref show_trash) = self.show_trash {
1088            properties.push(("show-trash", show_trash));
1089        }
1090        if let Some(ref hadjustment) = self.hadjustment {
1091            properties.push(("hadjustment", hadjustment));
1092        }
1093        if let Some(ref hscrollbar_policy) = self.hscrollbar_policy {
1094            properties.push(("hscrollbar-policy", hscrollbar_policy));
1095        }
1096        if let Some(ref kinetic_scrolling) = self.kinetic_scrolling {
1097            properties.push(("kinetic-scrolling", kinetic_scrolling));
1098        }
1099        #[cfg(any(feature = "v3_22", feature = "dox"))]
1100        {
1101            if let Some(ref max_content_height) = self.max_content_height {
1102                properties.push(("max-content-height", max_content_height));
1103            }
1104        }
1105        #[cfg(any(feature = "v3_22", feature = "dox"))]
1106        {
1107            if let Some(ref max_content_width) = self.max_content_width {
1108                properties.push(("max-content-width", max_content_width));
1109            }
1110        }
1111        if let Some(ref min_content_height) = self.min_content_height {
1112            properties.push(("min-content-height", min_content_height));
1113        }
1114        if let Some(ref min_content_width) = self.min_content_width {
1115            properties.push(("min-content-width", min_content_width));
1116        }
1117        #[cfg(any(feature = "v3_16", feature = "dox"))]
1118        {
1119            if let Some(ref overlay_scrolling) = self.overlay_scrolling {
1120                properties.push(("overlay-scrolling", overlay_scrolling));
1121            }
1122        }
1123        #[cfg(any(feature = "v3_22", feature = "dox"))]
1124        {
1125            if let Some(ref propagate_natural_height) = self.propagate_natural_height {
1126                properties.push(("propagate-natural-height", propagate_natural_height));
1127            }
1128        }
1129        #[cfg(any(feature = "v3_22", feature = "dox"))]
1130        {
1131            if let Some(ref propagate_natural_width) = self.propagate_natural_width {
1132                properties.push(("propagate-natural-width", propagate_natural_width));
1133            }
1134        }
1135        if let Some(ref shadow_type) = self.shadow_type {
1136            properties.push(("shadow-type", shadow_type));
1137        }
1138        if let Some(ref vadjustment) = self.vadjustment {
1139            properties.push(("vadjustment", vadjustment));
1140        }
1141        if let Some(ref vscrollbar_policy) = self.vscrollbar_policy {
1142            properties.push(("vscrollbar-policy", vscrollbar_policy));
1143        }
1144        if let Some(ref window_placement) = self.window_placement {
1145            properties.push(("window-placement", window_placement));
1146        }
1147        if let Some(ref border_width) = self.border_width {
1148            properties.push(("border-width", border_width));
1149        }
1150        if let Some(ref child) = self.child {
1151            properties.push(("child", child));
1152        }
1153        if let Some(ref resize_mode) = self.resize_mode {
1154            properties.push(("resize-mode", resize_mode));
1155        }
1156        if let Some(ref app_paintable) = self.app_paintable {
1157            properties.push(("app-paintable", app_paintable));
1158        }
1159        if let Some(ref can_default) = self.can_default {
1160            properties.push(("can-default", can_default));
1161        }
1162        if let Some(ref can_focus) = self.can_focus {
1163            properties.push(("can-focus", can_focus));
1164        }
1165        if let Some(ref events) = self.events {
1166            properties.push(("events", events));
1167        }
1168        if let Some(ref expand) = self.expand {
1169            properties.push(("expand", expand));
1170        }
1171        #[cfg(any(feature = "v3_20", feature = "dox"))]
1172        {
1173            if let Some(ref focus_on_click) = self.focus_on_click {
1174                properties.push(("focus-on-click", focus_on_click));
1175            }
1176        }
1177        if let Some(ref halign) = self.halign {
1178            properties.push(("halign", halign));
1179        }
1180        if let Some(ref has_default) = self.has_default {
1181            properties.push(("has-default", has_default));
1182        }
1183        if let Some(ref has_focus) = self.has_focus {
1184            properties.push(("has-focus", has_focus));
1185        }
1186        if let Some(ref has_tooltip) = self.has_tooltip {
1187            properties.push(("has-tooltip", has_tooltip));
1188        }
1189        if let Some(ref height_request) = self.height_request {
1190            properties.push(("height-request", height_request));
1191        }
1192        if let Some(ref hexpand) = self.hexpand {
1193            properties.push(("hexpand", hexpand));
1194        }
1195        if let Some(ref hexpand_set) = self.hexpand_set {
1196            properties.push(("hexpand-set", hexpand_set));
1197        }
1198        if let Some(ref is_focus) = self.is_focus {
1199            properties.push(("is-focus", is_focus));
1200        }
1201        if let Some(ref margin) = self.margin {
1202            properties.push(("margin", margin));
1203        }
1204        if let Some(ref margin_bottom) = self.margin_bottom {
1205            properties.push(("margin-bottom", margin_bottom));
1206        }
1207        if let Some(ref margin_end) = self.margin_end {
1208            properties.push(("margin-end", margin_end));
1209        }
1210        if let Some(ref margin_start) = self.margin_start {
1211            properties.push(("margin-start", margin_start));
1212        }
1213        if let Some(ref margin_top) = self.margin_top {
1214            properties.push(("margin-top", margin_top));
1215        }
1216        if let Some(ref name) = self.name {
1217            properties.push(("name", name));
1218        }
1219        if let Some(ref no_show_all) = self.no_show_all {
1220            properties.push(("no-show-all", no_show_all));
1221        }
1222        if let Some(ref opacity) = self.opacity {
1223            properties.push(("opacity", opacity));
1224        }
1225        if let Some(ref parent) = self.parent {
1226            properties.push(("parent", parent));
1227        }
1228        if let Some(ref receives_default) = self.receives_default {
1229            properties.push(("receives-default", receives_default));
1230        }
1231        if let Some(ref sensitive) = self.sensitive {
1232            properties.push(("sensitive", sensitive));
1233        }
1234        if let Some(ref tooltip_markup) = self.tooltip_markup {
1235            properties.push(("tooltip-markup", tooltip_markup));
1236        }
1237        if let Some(ref tooltip_text) = self.tooltip_text {
1238            properties.push(("tooltip-text", tooltip_text));
1239        }
1240        if let Some(ref valign) = self.valign {
1241            properties.push(("valign", valign));
1242        }
1243        if let Some(ref vexpand) = self.vexpand {
1244            properties.push(("vexpand", vexpand));
1245        }
1246        if let Some(ref vexpand_set) = self.vexpand_set {
1247            properties.push(("vexpand-set", vexpand_set));
1248        }
1249        if let Some(ref visible) = self.visible {
1250            properties.push(("visible", visible));
1251        }
1252        if let Some(ref width_request) = self.width_request {
1253            properties.push(("width-request", width_request));
1254        }
1255        glib::Object::new(PlacesSidebar::static_type(), &properties)
1256            .expect("object new")
1257            .downcast()
1258            .expect("downcast")
1259    }
1260
1261    pub fn local_only(mut self, local_only: bool) -> Self {
1262        self.local_only = Some(local_only);
1263        self
1264    }
1265
1266    pub fn location(mut self, location: &gio::File) -> Self {
1267        self.location = Some(location.clone());
1268        self
1269    }
1270
1271    pub fn open_flags(mut self, open_flags: PlacesOpenFlags) -> Self {
1272        self.open_flags = Some(open_flags);
1273        self
1274    }
1275
1276    #[cfg(any(feature = "v3_18", feature = "dox"))]
1277    pub fn populate_all(mut self, populate_all: bool) -> Self {
1278        self.populate_all = Some(populate_all);
1279        self
1280    }
1281
1282    pub fn show_connect_to_server(mut self, show_connect_to_server: bool) -> Self {
1283        self.show_connect_to_server = Some(show_connect_to_server);
1284        self
1285    }
1286
1287    pub fn show_desktop(mut self, show_desktop: bool) -> Self {
1288        self.show_desktop = Some(show_desktop);
1289        self
1290    }
1291
1292    pub fn show_enter_location(mut self, show_enter_location: bool) -> Self {
1293        self.show_enter_location = Some(show_enter_location);
1294        self
1295    }
1296
1297    pub fn show_other_locations(mut self, show_other_locations: bool) -> Self {
1298        self.show_other_locations = Some(show_other_locations);
1299        self
1300    }
1301
1302    pub fn show_recent(mut self, show_recent: bool) -> Self {
1303        self.show_recent = Some(show_recent);
1304        self
1305    }
1306
1307    #[cfg(any(feature = "v3_22_26", feature = "dox"))]
1308    pub fn show_starred_location(mut self, show_starred_location: bool) -> Self {
1309        self.show_starred_location = Some(show_starred_location);
1310        self
1311    }
1312
1313    pub fn show_trash(mut self, show_trash: bool) -> Self {
1314        self.show_trash = Some(show_trash);
1315        self
1316    }
1317
1318    pub fn hadjustment(mut self, hadjustment: &Adjustment) -> Self {
1319        self.hadjustment = Some(hadjustment.clone());
1320        self
1321    }
1322
1323    pub fn hscrollbar_policy(mut self, hscrollbar_policy: PolicyType) -> Self {
1324        self.hscrollbar_policy = Some(hscrollbar_policy);
1325        self
1326    }
1327
1328    pub fn kinetic_scrolling(mut self, kinetic_scrolling: bool) -> Self {
1329        self.kinetic_scrolling = Some(kinetic_scrolling);
1330        self
1331    }
1332
1333    #[cfg(any(feature = "v3_22", feature = "dox"))]
1334    pub fn max_content_height(mut self, max_content_height: i32) -> Self {
1335        self.max_content_height = Some(max_content_height);
1336        self
1337    }
1338
1339    #[cfg(any(feature = "v3_22", feature = "dox"))]
1340    pub fn max_content_width(mut self, max_content_width: i32) -> Self {
1341        self.max_content_width = Some(max_content_width);
1342        self
1343    }
1344
1345    pub fn min_content_height(mut self, min_content_height: i32) -> Self {
1346        self.min_content_height = Some(min_content_height);
1347        self
1348    }
1349
1350    pub fn min_content_width(mut self, min_content_width: i32) -> Self {
1351        self.min_content_width = Some(min_content_width);
1352        self
1353    }
1354
1355    #[cfg(any(feature = "v3_16", feature = "dox"))]
1356    pub fn overlay_scrolling(mut self, overlay_scrolling: bool) -> Self {
1357        self.overlay_scrolling = Some(overlay_scrolling);
1358        self
1359    }
1360
1361    #[cfg(any(feature = "v3_22", feature = "dox"))]
1362    pub fn propagate_natural_height(mut self, propagate_natural_height: bool) -> Self {
1363        self.propagate_natural_height = Some(propagate_natural_height);
1364        self
1365    }
1366
1367    #[cfg(any(feature = "v3_22", feature = "dox"))]
1368    pub fn propagate_natural_width(mut self, propagate_natural_width: bool) -> Self {
1369        self.propagate_natural_width = Some(propagate_natural_width);
1370        self
1371    }
1372
1373    pub fn shadow_type(mut self, shadow_type: ShadowType) -> Self {
1374        self.shadow_type = Some(shadow_type);
1375        self
1376    }
1377
1378    pub fn vadjustment(mut self, vadjustment: &Adjustment) -> Self {
1379        self.vadjustment = Some(vadjustment.clone());
1380        self
1381    }
1382
1383    pub fn vscrollbar_policy(mut self, vscrollbar_policy: PolicyType) -> Self {
1384        self.vscrollbar_policy = Some(vscrollbar_policy);
1385        self
1386    }
1387
1388    pub fn window_placement(mut self, window_placement: CornerType) -> Self {
1389        self.window_placement = Some(window_placement);
1390        self
1391    }
1392
1393    pub fn border_width(mut self, border_width: u32) -> Self {
1394        self.border_width = Some(border_width);
1395        self
1396    }
1397
1398    pub fn child(mut self, child: &Widget) -> Self {
1399        self.child = Some(child.clone());
1400        self
1401    }
1402
1403    pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self {
1404        self.resize_mode = Some(resize_mode);
1405        self
1406    }
1407
1408    pub fn app_paintable(mut self, app_paintable: bool) -> Self {
1409        self.app_paintable = Some(app_paintable);
1410        self
1411    }
1412
1413    pub fn can_default(mut self, can_default: bool) -> Self {
1414        self.can_default = Some(can_default);
1415        self
1416    }
1417
1418    pub fn can_focus(mut self, can_focus: bool) -> Self {
1419        self.can_focus = Some(can_focus);
1420        self
1421    }
1422
1423    pub fn events(mut self, events: gdk::EventMask) -> Self {
1424        self.events = Some(events);
1425        self
1426    }
1427
1428    pub fn expand(mut self, expand: bool) -> Self {
1429        self.expand = Some(expand);
1430        self
1431    }
1432
1433    #[cfg(any(feature = "v3_20", feature = "dox"))]
1434    pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
1435        self.focus_on_click = Some(focus_on_click);
1436        self
1437    }
1438
1439    pub fn halign(mut self, halign: Align) -> Self {
1440        self.halign = Some(halign);
1441        self
1442    }
1443
1444    pub fn has_default(mut self, has_default: bool) -> Self {
1445        self.has_default = Some(has_default);
1446        self
1447    }
1448
1449    pub fn has_focus(mut self, has_focus: bool) -> Self {
1450        self.has_focus = Some(has_focus);
1451        self
1452    }
1453
1454    pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
1455        self.has_tooltip = Some(has_tooltip);
1456        self
1457    }
1458
1459    pub fn height_request(mut self, height_request: i32) -> Self {
1460        self.height_request = Some(height_request);
1461        self
1462    }
1463
1464    pub fn hexpand(mut self, hexpand: bool) -> Self {
1465        self.hexpand = Some(hexpand);
1466        self
1467    }
1468
1469    pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
1470        self.hexpand_set = Some(hexpand_set);
1471        self
1472    }
1473
1474    pub fn is_focus(mut self, is_focus: bool) -> Self {
1475        self.is_focus = Some(is_focus);
1476        self
1477    }
1478
1479    pub fn margin(mut self, margin: i32) -> Self {
1480        self.margin = Some(margin);
1481        self
1482    }
1483
1484    pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
1485        self.margin_bottom = Some(margin_bottom);
1486        self
1487    }
1488
1489    pub fn margin_end(mut self, margin_end: i32) -> Self {
1490        self.margin_end = Some(margin_end);
1491        self
1492    }
1493
1494    pub fn margin_start(mut self, margin_start: i32) -> Self {
1495        self.margin_start = Some(margin_start);
1496        self
1497    }
1498
1499    pub fn margin_top(mut self, margin_top: i32) -> Self {
1500        self.margin_top = Some(margin_top);
1501        self
1502    }
1503
1504    pub fn name(mut self, name: &str) -> Self {
1505        self.name = Some(name.to_string());
1506        self
1507    }
1508
1509    pub fn no_show_all(mut self, no_show_all: bool) -> Self {
1510        self.no_show_all = Some(no_show_all);
1511        self
1512    }
1513
1514    pub fn opacity(mut self, opacity: f64) -> Self {
1515        self.opacity = Some(opacity);
1516        self
1517    }
1518
1519    pub fn parent(mut self, parent: &Container) -> Self {
1520        self.parent = Some(parent.clone());
1521        self
1522    }
1523
1524    pub fn receives_default(mut self, receives_default: bool) -> Self {
1525        self.receives_default = Some(receives_default);
1526        self
1527    }
1528
1529    pub fn sensitive(mut self, sensitive: bool) -> Self {
1530        self.sensitive = Some(sensitive);
1531        self
1532    }
1533
1534    pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
1535        self.tooltip_markup = Some(tooltip_markup.to_string());
1536        self
1537    }
1538
1539    pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
1540        self.tooltip_text = Some(tooltip_text.to_string());
1541        self
1542    }
1543
1544    pub fn valign(mut self, valign: Align) -> Self {
1545        self.valign = Some(valign);
1546        self
1547    }
1548
1549    pub fn vexpand(mut self, vexpand: bool) -> Self {
1550        self.vexpand = Some(vexpand);
1551        self
1552    }
1553
1554    pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
1555        self.vexpand_set = Some(vexpand_set);
1556        self
1557    }
1558
1559    pub fn visible(mut self, visible: bool) -> Self {
1560        self.visible = Some(visible);
1561        self
1562    }
1563
1564    pub fn width_request(mut self, width_request: i32) -> Self {
1565        self.width_request = Some(width_request);
1566        self
1567    }
1568}
1569
1570impl fmt::Display for PlacesSidebar {
1571    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1572        write!(f, "PlacesSidebar")
1573    }
1574}