Skip to main content

libadwaita/auto/
overlay_split_view.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from
3// from gir-files (https://github.com/gtk-rs/gir-files.git)
4// DO NOT EDIT
5
6use crate::{LengthUnit, Swipeable, ffi};
7use glib::{
8    prelude::*,
9    signal::{SignalHandlerId, connect_raw},
10    translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15    #[doc(alias = "AdwOverlaySplitView")]
16    pub struct OverlaySplitView(Object<ffi::AdwOverlaySplitView, ffi::AdwOverlaySplitViewClass>) @extends gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, Swipeable;
17
18    match fn {
19        type_ => || ffi::adw_overlay_split_view_get_type(),
20    }
21}
22
23impl OverlaySplitView {
24    #[doc(alias = "adw_overlay_split_view_new")]
25    pub fn new() -> OverlaySplitView {
26        assert_initialized_main_thread!();
27        unsafe { gtk::Widget::from_glib_none(ffi::adw_overlay_split_view_new()).unsafe_cast() }
28    }
29
30    // rustdoc-stripper-ignore-next
31    /// Creates a new builder-pattern struct instance to construct [`OverlaySplitView`] objects.
32    ///
33    /// This method returns an instance of [`OverlaySplitViewBuilder`](crate::builders::OverlaySplitViewBuilder) which can be used to create [`OverlaySplitView`] objects.
34    pub fn builder() -> OverlaySplitViewBuilder {
35        OverlaySplitViewBuilder::new()
36    }
37
38    #[doc(alias = "adw_overlay_split_view_get_collapsed")]
39    #[doc(alias = "get_collapsed")]
40    #[doc(alias = "collapsed")]
41    pub fn is_collapsed(&self) -> bool {
42        unsafe {
43            from_glib(ffi::adw_overlay_split_view_get_collapsed(
44                self.to_glib_none().0,
45            ))
46        }
47    }
48
49    #[doc(alias = "adw_overlay_split_view_get_content")]
50    #[doc(alias = "get_content")]
51    pub fn content(&self) -> Option<gtk::Widget> {
52        unsafe {
53            from_glib_none(ffi::adw_overlay_split_view_get_content(
54                self.to_glib_none().0,
55            ))
56        }
57    }
58
59    #[doc(alias = "adw_overlay_split_view_get_enable_hide_gesture")]
60    #[doc(alias = "get_enable_hide_gesture")]
61    #[doc(alias = "enable-hide-gesture")]
62    pub fn enables_hide_gesture(&self) -> bool {
63        unsafe {
64            from_glib(ffi::adw_overlay_split_view_get_enable_hide_gesture(
65                self.to_glib_none().0,
66            ))
67        }
68    }
69
70    #[doc(alias = "adw_overlay_split_view_get_enable_show_gesture")]
71    #[doc(alias = "get_enable_show_gesture")]
72    #[doc(alias = "enable-show-gesture")]
73    pub fn enables_show_gesture(&self) -> bool {
74        unsafe {
75            from_glib(ffi::adw_overlay_split_view_get_enable_show_gesture(
76                self.to_glib_none().0,
77            ))
78        }
79    }
80
81    #[doc(alias = "adw_overlay_split_view_get_max_sidebar_width")]
82    #[doc(alias = "get_max_sidebar_width")]
83    #[doc(alias = "max-sidebar-width")]
84    pub fn max_sidebar_width(&self) -> f64 {
85        unsafe { ffi::adw_overlay_split_view_get_max_sidebar_width(self.to_glib_none().0) }
86    }
87
88    #[doc(alias = "adw_overlay_split_view_get_min_sidebar_width")]
89    #[doc(alias = "get_min_sidebar_width")]
90    #[doc(alias = "min-sidebar-width")]
91    pub fn min_sidebar_width(&self) -> f64 {
92        unsafe { ffi::adw_overlay_split_view_get_min_sidebar_width(self.to_glib_none().0) }
93    }
94
95    #[doc(alias = "adw_overlay_split_view_get_pin_sidebar")]
96    #[doc(alias = "get_pin_sidebar")]
97    #[doc(alias = "pin-sidebar")]
98    pub fn is_pin_sidebar(&self) -> bool {
99        unsafe {
100            from_glib(ffi::adw_overlay_split_view_get_pin_sidebar(
101                self.to_glib_none().0,
102            ))
103        }
104    }
105
106    #[doc(alias = "adw_overlay_split_view_get_show_sidebar")]
107    #[doc(alias = "get_show_sidebar")]
108    #[doc(alias = "show-sidebar")]
109    pub fn shows_sidebar(&self) -> bool {
110        unsafe {
111            from_glib(ffi::adw_overlay_split_view_get_show_sidebar(
112                self.to_glib_none().0,
113            ))
114        }
115    }
116
117    #[doc(alias = "adw_overlay_split_view_get_sidebar")]
118    #[doc(alias = "get_sidebar")]
119    pub fn sidebar(&self) -> Option<gtk::Widget> {
120        unsafe {
121            from_glib_none(ffi::adw_overlay_split_view_get_sidebar(
122                self.to_glib_none().0,
123            ))
124        }
125    }
126
127    #[doc(alias = "adw_overlay_split_view_get_sidebar_position")]
128    #[doc(alias = "get_sidebar_position")]
129    #[doc(alias = "sidebar-position")]
130    pub fn sidebar_position(&self) -> gtk::PackType {
131        unsafe {
132            from_glib(ffi::adw_overlay_split_view_get_sidebar_position(
133                self.to_glib_none().0,
134            ))
135        }
136    }
137
138    #[doc(alias = "adw_overlay_split_view_get_sidebar_width_fraction")]
139    #[doc(alias = "get_sidebar_width_fraction")]
140    #[doc(alias = "sidebar-width-fraction")]
141    pub fn sidebar_width_fraction(&self) -> f64 {
142        unsafe { ffi::adw_overlay_split_view_get_sidebar_width_fraction(self.to_glib_none().0) }
143    }
144
145    #[doc(alias = "adw_overlay_split_view_get_sidebar_width_unit")]
146    #[doc(alias = "get_sidebar_width_unit")]
147    #[doc(alias = "sidebar-width-unit")]
148    pub fn sidebar_width_unit(&self) -> LengthUnit {
149        unsafe {
150            from_glib(ffi::adw_overlay_split_view_get_sidebar_width_unit(
151                self.to_glib_none().0,
152            ))
153        }
154    }
155
156    #[doc(alias = "adw_overlay_split_view_set_collapsed")]
157    #[doc(alias = "collapsed")]
158    pub fn set_collapsed(&self, collapsed: bool) {
159        unsafe {
160            ffi::adw_overlay_split_view_set_collapsed(self.to_glib_none().0, collapsed.into_glib());
161        }
162    }
163
164    #[doc(alias = "adw_overlay_split_view_set_content")]
165    #[doc(alias = "content")]
166    pub fn set_content(&self, content: Option<&impl IsA<gtk::Widget>>) {
167        unsafe {
168            ffi::adw_overlay_split_view_set_content(
169                self.to_glib_none().0,
170                content.map(|p| p.as_ref()).to_glib_none().0,
171            );
172        }
173    }
174
175    #[doc(alias = "adw_overlay_split_view_set_enable_hide_gesture")]
176    #[doc(alias = "enable-hide-gesture")]
177    pub fn set_enable_hide_gesture(&self, enable_hide_gesture: bool) {
178        unsafe {
179            ffi::adw_overlay_split_view_set_enable_hide_gesture(
180                self.to_glib_none().0,
181                enable_hide_gesture.into_glib(),
182            );
183        }
184    }
185
186    #[doc(alias = "adw_overlay_split_view_set_enable_show_gesture")]
187    #[doc(alias = "enable-show-gesture")]
188    pub fn set_enable_show_gesture(&self, enable_show_gesture: bool) {
189        unsafe {
190            ffi::adw_overlay_split_view_set_enable_show_gesture(
191                self.to_glib_none().0,
192                enable_show_gesture.into_glib(),
193            );
194        }
195    }
196
197    #[doc(alias = "adw_overlay_split_view_set_max_sidebar_width")]
198    #[doc(alias = "max-sidebar-width")]
199    pub fn set_max_sidebar_width(&self, width: f64) {
200        unsafe {
201            ffi::adw_overlay_split_view_set_max_sidebar_width(self.to_glib_none().0, width);
202        }
203    }
204
205    #[doc(alias = "adw_overlay_split_view_set_min_sidebar_width")]
206    #[doc(alias = "min-sidebar-width")]
207    pub fn set_min_sidebar_width(&self, width: f64) {
208        unsafe {
209            ffi::adw_overlay_split_view_set_min_sidebar_width(self.to_glib_none().0, width);
210        }
211    }
212
213    #[doc(alias = "adw_overlay_split_view_set_pin_sidebar")]
214    #[doc(alias = "pin-sidebar")]
215    pub fn set_pin_sidebar(&self, pin_sidebar: bool) {
216        unsafe {
217            ffi::adw_overlay_split_view_set_pin_sidebar(
218                self.to_glib_none().0,
219                pin_sidebar.into_glib(),
220            );
221        }
222    }
223
224    #[doc(alias = "adw_overlay_split_view_set_show_sidebar")]
225    #[doc(alias = "show-sidebar")]
226    pub fn set_show_sidebar(&self, show_sidebar: bool) {
227        unsafe {
228            ffi::adw_overlay_split_view_set_show_sidebar(
229                self.to_glib_none().0,
230                show_sidebar.into_glib(),
231            );
232        }
233    }
234
235    #[doc(alias = "adw_overlay_split_view_set_sidebar")]
236    #[doc(alias = "sidebar")]
237    pub fn set_sidebar(&self, sidebar: Option<&impl IsA<gtk::Widget>>) {
238        unsafe {
239            ffi::adw_overlay_split_view_set_sidebar(
240                self.to_glib_none().0,
241                sidebar.map(|p| p.as_ref()).to_glib_none().0,
242            );
243        }
244    }
245
246    #[doc(alias = "adw_overlay_split_view_set_sidebar_position")]
247    #[doc(alias = "sidebar-position")]
248    pub fn set_sidebar_position(&self, position: gtk::PackType) {
249        unsafe {
250            ffi::adw_overlay_split_view_set_sidebar_position(
251                self.to_glib_none().0,
252                position.into_glib(),
253            );
254        }
255    }
256
257    #[doc(alias = "adw_overlay_split_view_set_sidebar_width_fraction")]
258    #[doc(alias = "sidebar-width-fraction")]
259    pub fn set_sidebar_width_fraction(&self, fraction: f64) {
260        unsafe {
261            ffi::adw_overlay_split_view_set_sidebar_width_fraction(self.to_glib_none().0, fraction);
262        }
263    }
264
265    #[doc(alias = "adw_overlay_split_view_set_sidebar_width_unit")]
266    #[doc(alias = "sidebar-width-unit")]
267    pub fn set_sidebar_width_unit(&self, unit: LengthUnit) {
268        unsafe {
269            ffi::adw_overlay_split_view_set_sidebar_width_unit(
270                self.to_glib_none().0,
271                unit.into_glib(),
272            );
273        }
274    }
275
276    #[cfg(feature = "v1_4")]
277    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
278    #[doc(alias = "collapsed")]
279    pub fn connect_collapsed_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
280        unsafe extern "C" fn notify_collapsed_trampoline<F: Fn(&OverlaySplitView) + 'static>(
281            this: *mut ffi::AdwOverlaySplitView,
282            _param_spec: glib::ffi::gpointer,
283            f: glib::ffi::gpointer,
284        ) {
285            unsafe {
286                let f: &F = &*(f as *const F);
287                f(&from_glib_borrow(this))
288            }
289        }
290        unsafe {
291            let f: Box_<F> = Box_::new(f);
292            connect_raw(
293                self.as_ptr() as *mut _,
294                c"notify::collapsed".as_ptr(),
295                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
296                    notify_collapsed_trampoline::<F> as *const (),
297                )),
298                Box_::into_raw(f),
299            )
300        }
301    }
302
303    #[cfg(feature = "v1_4")]
304    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
305    #[doc(alias = "content")]
306    pub fn connect_content_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
307        unsafe extern "C" fn notify_content_trampoline<F: Fn(&OverlaySplitView) + 'static>(
308            this: *mut ffi::AdwOverlaySplitView,
309            _param_spec: glib::ffi::gpointer,
310            f: glib::ffi::gpointer,
311        ) {
312            unsafe {
313                let f: &F = &*(f as *const F);
314                f(&from_glib_borrow(this))
315            }
316        }
317        unsafe {
318            let f: Box_<F> = Box_::new(f);
319            connect_raw(
320                self.as_ptr() as *mut _,
321                c"notify::content".as_ptr(),
322                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
323                    notify_content_trampoline::<F> as *const (),
324                )),
325                Box_::into_raw(f),
326            )
327        }
328    }
329
330    #[cfg(feature = "v1_4")]
331    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
332    #[doc(alias = "enable-hide-gesture")]
333    pub fn connect_enable_hide_gesture_notify<F: Fn(&Self) + 'static>(
334        &self,
335        f: F,
336    ) -> SignalHandlerId {
337        unsafe extern "C" fn notify_enable_hide_gesture_trampoline<
338            F: Fn(&OverlaySplitView) + 'static,
339        >(
340            this: *mut ffi::AdwOverlaySplitView,
341            _param_spec: glib::ffi::gpointer,
342            f: glib::ffi::gpointer,
343        ) {
344            unsafe {
345                let f: &F = &*(f as *const F);
346                f(&from_glib_borrow(this))
347            }
348        }
349        unsafe {
350            let f: Box_<F> = Box_::new(f);
351            connect_raw(
352                self.as_ptr() as *mut _,
353                c"notify::enable-hide-gesture".as_ptr(),
354                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
355                    notify_enable_hide_gesture_trampoline::<F> as *const (),
356                )),
357                Box_::into_raw(f),
358            )
359        }
360    }
361
362    #[cfg(feature = "v1_4")]
363    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
364    #[doc(alias = "enable-show-gesture")]
365    pub fn connect_enable_show_gesture_notify<F: Fn(&Self) + 'static>(
366        &self,
367        f: F,
368    ) -> SignalHandlerId {
369        unsafe extern "C" fn notify_enable_show_gesture_trampoline<
370            F: Fn(&OverlaySplitView) + 'static,
371        >(
372            this: *mut ffi::AdwOverlaySplitView,
373            _param_spec: glib::ffi::gpointer,
374            f: glib::ffi::gpointer,
375        ) {
376            unsafe {
377                let f: &F = &*(f as *const F);
378                f(&from_glib_borrow(this))
379            }
380        }
381        unsafe {
382            let f: Box_<F> = Box_::new(f);
383            connect_raw(
384                self.as_ptr() as *mut _,
385                c"notify::enable-show-gesture".as_ptr(),
386                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
387                    notify_enable_show_gesture_trampoline::<F> as *const (),
388                )),
389                Box_::into_raw(f),
390            )
391        }
392    }
393
394    #[cfg(feature = "v1_4")]
395    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
396    #[doc(alias = "max-sidebar-width")]
397    pub fn connect_max_sidebar_width_notify<F: Fn(&Self) + 'static>(
398        &self,
399        f: F,
400    ) -> SignalHandlerId {
401        unsafe extern "C" fn notify_max_sidebar_width_trampoline<
402            F: Fn(&OverlaySplitView) + 'static,
403        >(
404            this: *mut ffi::AdwOverlaySplitView,
405            _param_spec: glib::ffi::gpointer,
406            f: glib::ffi::gpointer,
407        ) {
408            unsafe {
409                let f: &F = &*(f as *const F);
410                f(&from_glib_borrow(this))
411            }
412        }
413        unsafe {
414            let f: Box_<F> = Box_::new(f);
415            connect_raw(
416                self.as_ptr() as *mut _,
417                c"notify::max-sidebar-width".as_ptr(),
418                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
419                    notify_max_sidebar_width_trampoline::<F> as *const (),
420                )),
421                Box_::into_raw(f),
422            )
423        }
424    }
425
426    #[cfg(feature = "v1_4")]
427    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
428    #[doc(alias = "min-sidebar-width")]
429    pub fn connect_min_sidebar_width_notify<F: Fn(&Self) + 'static>(
430        &self,
431        f: F,
432    ) -> SignalHandlerId {
433        unsafe extern "C" fn notify_min_sidebar_width_trampoline<
434            F: Fn(&OverlaySplitView) + 'static,
435        >(
436            this: *mut ffi::AdwOverlaySplitView,
437            _param_spec: glib::ffi::gpointer,
438            f: glib::ffi::gpointer,
439        ) {
440            unsafe {
441                let f: &F = &*(f as *const F);
442                f(&from_glib_borrow(this))
443            }
444        }
445        unsafe {
446            let f: Box_<F> = Box_::new(f);
447            connect_raw(
448                self.as_ptr() as *mut _,
449                c"notify::min-sidebar-width".as_ptr(),
450                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
451                    notify_min_sidebar_width_trampoline::<F> as *const (),
452                )),
453                Box_::into_raw(f),
454            )
455        }
456    }
457
458    #[cfg(feature = "v1_4")]
459    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
460    #[doc(alias = "pin-sidebar")]
461    pub fn connect_pin_sidebar_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
462        unsafe extern "C" fn notify_pin_sidebar_trampoline<F: Fn(&OverlaySplitView) + 'static>(
463            this: *mut ffi::AdwOverlaySplitView,
464            _param_spec: glib::ffi::gpointer,
465            f: glib::ffi::gpointer,
466        ) {
467            unsafe {
468                let f: &F = &*(f as *const F);
469                f(&from_glib_borrow(this))
470            }
471        }
472        unsafe {
473            let f: Box_<F> = Box_::new(f);
474            connect_raw(
475                self.as_ptr() as *mut _,
476                c"notify::pin-sidebar".as_ptr(),
477                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
478                    notify_pin_sidebar_trampoline::<F> as *const (),
479                )),
480                Box_::into_raw(f),
481            )
482        }
483    }
484
485    #[cfg(feature = "v1_4")]
486    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
487    #[doc(alias = "show-sidebar")]
488    pub fn connect_show_sidebar_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
489        unsafe extern "C" fn notify_show_sidebar_trampoline<F: Fn(&OverlaySplitView) + 'static>(
490            this: *mut ffi::AdwOverlaySplitView,
491            _param_spec: glib::ffi::gpointer,
492            f: glib::ffi::gpointer,
493        ) {
494            unsafe {
495                let f: &F = &*(f as *const F);
496                f(&from_glib_borrow(this))
497            }
498        }
499        unsafe {
500            let f: Box_<F> = Box_::new(f);
501            connect_raw(
502                self.as_ptr() as *mut _,
503                c"notify::show-sidebar".as_ptr(),
504                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
505                    notify_show_sidebar_trampoline::<F> as *const (),
506                )),
507                Box_::into_raw(f),
508            )
509        }
510    }
511
512    #[cfg(feature = "v1_4")]
513    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
514    #[doc(alias = "sidebar")]
515    pub fn connect_sidebar_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
516        unsafe extern "C" fn notify_sidebar_trampoline<F: Fn(&OverlaySplitView) + 'static>(
517            this: *mut ffi::AdwOverlaySplitView,
518            _param_spec: glib::ffi::gpointer,
519            f: glib::ffi::gpointer,
520        ) {
521            unsafe {
522                let f: &F = &*(f as *const F);
523                f(&from_glib_borrow(this))
524            }
525        }
526        unsafe {
527            let f: Box_<F> = Box_::new(f);
528            connect_raw(
529                self.as_ptr() as *mut _,
530                c"notify::sidebar".as_ptr(),
531                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
532                    notify_sidebar_trampoline::<F> as *const (),
533                )),
534                Box_::into_raw(f),
535            )
536        }
537    }
538
539    #[cfg(feature = "v1_4")]
540    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
541    #[doc(alias = "sidebar-position")]
542    pub fn connect_sidebar_position_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
543        unsafe extern "C" fn notify_sidebar_position_trampoline<
544            F: Fn(&OverlaySplitView) + 'static,
545        >(
546            this: *mut ffi::AdwOverlaySplitView,
547            _param_spec: glib::ffi::gpointer,
548            f: glib::ffi::gpointer,
549        ) {
550            unsafe {
551                let f: &F = &*(f as *const F);
552                f(&from_glib_borrow(this))
553            }
554        }
555        unsafe {
556            let f: Box_<F> = Box_::new(f);
557            connect_raw(
558                self.as_ptr() as *mut _,
559                c"notify::sidebar-position".as_ptr(),
560                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
561                    notify_sidebar_position_trampoline::<F> as *const (),
562                )),
563                Box_::into_raw(f),
564            )
565        }
566    }
567
568    #[cfg(feature = "v1_4")]
569    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
570    #[doc(alias = "sidebar-width-fraction")]
571    pub fn connect_sidebar_width_fraction_notify<F: Fn(&Self) + 'static>(
572        &self,
573        f: F,
574    ) -> SignalHandlerId {
575        unsafe extern "C" fn notify_sidebar_width_fraction_trampoline<
576            F: Fn(&OverlaySplitView) + 'static,
577        >(
578            this: *mut ffi::AdwOverlaySplitView,
579            _param_spec: glib::ffi::gpointer,
580            f: glib::ffi::gpointer,
581        ) {
582            unsafe {
583                let f: &F = &*(f as *const F);
584                f(&from_glib_borrow(this))
585            }
586        }
587        unsafe {
588            let f: Box_<F> = Box_::new(f);
589            connect_raw(
590                self.as_ptr() as *mut _,
591                c"notify::sidebar-width-fraction".as_ptr(),
592                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
593                    notify_sidebar_width_fraction_trampoline::<F> as *const (),
594                )),
595                Box_::into_raw(f),
596            )
597        }
598    }
599
600    #[cfg(feature = "v1_4")]
601    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
602    #[doc(alias = "sidebar-width-unit")]
603    pub fn connect_sidebar_width_unit_notify<F: Fn(&Self) + 'static>(
604        &self,
605        f: F,
606    ) -> SignalHandlerId {
607        unsafe extern "C" fn notify_sidebar_width_unit_trampoline<
608            F: Fn(&OverlaySplitView) + 'static,
609        >(
610            this: *mut ffi::AdwOverlaySplitView,
611            _param_spec: glib::ffi::gpointer,
612            f: glib::ffi::gpointer,
613        ) {
614            unsafe {
615                let f: &F = &*(f as *const F);
616                f(&from_glib_borrow(this))
617            }
618        }
619        unsafe {
620            let f: Box_<F> = Box_::new(f);
621            connect_raw(
622                self.as_ptr() as *mut _,
623                c"notify::sidebar-width-unit".as_ptr(),
624                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
625                    notify_sidebar_width_unit_trampoline::<F> as *const (),
626                )),
627                Box_::into_raw(f),
628            )
629        }
630    }
631}
632
633#[cfg(feature = "v1_4")]
634#[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
635impl Default for OverlaySplitView {
636    fn default() -> Self {
637        Self::new()
638    }
639}
640
641// rustdoc-stripper-ignore-next
642/// A [builder-pattern] type to construct [`OverlaySplitView`] objects.
643///
644/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
645#[must_use = "The builder must be built to be used"]
646pub struct OverlaySplitViewBuilder {
647    builder: glib::object::ObjectBuilder<'static, OverlaySplitView>,
648}
649
650impl OverlaySplitViewBuilder {
651    fn new() -> Self {
652        Self {
653            builder: glib::object::Object::builder(),
654        }
655    }
656
657    #[cfg(feature = "v1_4")]
658    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
659    pub fn collapsed(self, collapsed: bool) -> Self {
660        Self {
661            builder: self.builder.property("collapsed", collapsed),
662        }
663    }
664
665    #[cfg(feature = "v1_4")]
666    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
667    pub fn content(self, content: &impl IsA<gtk::Widget>) -> Self {
668        Self {
669            builder: self.builder.property("content", content.clone().upcast()),
670        }
671    }
672
673    #[cfg(feature = "v1_4")]
674    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
675    pub fn enable_hide_gesture(self, enable_hide_gesture: bool) -> Self {
676        Self {
677            builder: self
678                .builder
679                .property("enable-hide-gesture", enable_hide_gesture),
680        }
681    }
682
683    #[cfg(feature = "v1_4")]
684    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
685    pub fn enable_show_gesture(self, enable_show_gesture: bool) -> Self {
686        Self {
687            builder: self
688                .builder
689                .property("enable-show-gesture", enable_show_gesture),
690        }
691    }
692
693    #[cfg(feature = "v1_4")]
694    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
695    pub fn max_sidebar_width(self, max_sidebar_width: f64) -> Self {
696        Self {
697            builder: self
698                .builder
699                .property("max-sidebar-width", max_sidebar_width),
700        }
701    }
702
703    #[cfg(feature = "v1_4")]
704    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
705    pub fn min_sidebar_width(self, min_sidebar_width: f64) -> Self {
706        Self {
707            builder: self
708                .builder
709                .property("min-sidebar-width", min_sidebar_width),
710        }
711    }
712
713    #[cfg(feature = "v1_4")]
714    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
715    pub fn pin_sidebar(self, pin_sidebar: bool) -> Self {
716        Self {
717            builder: self.builder.property("pin-sidebar", pin_sidebar),
718        }
719    }
720
721    #[cfg(feature = "v1_4")]
722    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
723    pub fn show_sidebar(self, show_sidebar: bool) -> Self {
724        Self {
725            builder: self.builder.property("show-sidebar", show_sidebar),
726        }
727    }
728
729    #[cfg(feature = "v1_4")]
730    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
731    pub fn sidebar(self, sidebar: &impl IsA<gtk::Widget>) -> Self {
732        Self {
733            builder: self.builder.property("sidebar", sidebar.clone().upcast()),
734        }
735    }
736
737    #[cfg(feature = "v1_4")]
738    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
739    pub fn sidebar_position(self, sidebar_position: gtk::PackType) -> Self {
740        Self {
741            builder: self.builder.property("sidebar-position", sidebar_position),
742        }
743    }
744
745    #[cfg(feature = "v1_4")]
746    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
747    pub fn sidebar_width_fraction(self, sidebar_width_fraction: f64) -> Self {
748        Self {
749            builder: self
750                .builder
751                .property("sidebar-width-fraction", sidebar_width_fraction),
752        }
753    }
754
755    #[cfg(feature = "v1_4")]
756    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
757    pub fn sidebar_width_unit(self, sidebar_width_unit: LengthUnit) -> Self {
758        Self {
759            builder: self
760                .builder
761                .property("sidebar-width-unit", sidebar_width_unit),
762        }
763    }
764
765    pub fn can_focus(self, can_focus: bool) -> Self {
766        Self {
767            builder: self.builder.property("can-focus", can_focus),
768        }
769    }
770
771    pub fn can_target(self, can_target: bool) -> Self {
772        Self {
773            builder: self.builder.property("can-target", can_target),
774        }
775    }
776
777    pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
778        Self {
779            builder: self.builder.property("css-classes", css_classes.into()),
780        }
781    }
782
783    pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
784        Self {
785            builder: self.builder.property("css-name", css_name.into()),
786        }
787    }
788
789    pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
790        Self {
791            builder: self.builder.property("cursor", cursor.clone()),
792        }
793    }
794
795    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
796        Self {
797            builder: self.builder.property("focus-on-click", focus_on_click),
798        }
799    }
800
801    pub fn focusable(self, focusable: bool) -> Self {
802        Self {
803            builder: self.builder.property("focusable", focusable),
804        }
805    }
806
807    pub fn halign(self, halign: gtk::Align) -> Self {
808        Self {
809            builder: self.builder.property("halign", halign),
810        }
811    }
812
813    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
814        Self {
815            builder: self.builder.property("has-tooltip", has_tooltip),
816        }
817    }
818
819    pub fn height_request(self, height_request: i32) -> Self {
820        Self {
821            builder: self.builder.property("height-request", height_request),
822        }
823    }
824
825    pub fn hexpand(self, hexpand: bool) -> Self {
826        Self {
827            builder: self.builder.property("hexpand", hexpand),
828        }
829    }
830
831    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
832        Self {
833            builder: self.builder.property("hexpand-set", hexpand_set),
834        }
835    }
836
837    pub fn layout_manager(self, layout_manager: &impl IsA<gtk::LayoutManager>) -> Self {
838        Self {
839            builder: self
840                .builder
841                .property("layout-manager", layout_manager.clone().upcast()),
842        }
843    }
844
845    #[cfg(feature = "gtk_v4_18")]
846    #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_18")))]
847    pub fn limit_events(self, limit_events: bool) -> Self {
848        Self {
849            builder: self.builder.property("limit-events", limit_events),
850        }
851    }
852
853    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
854        Self {
855            builder: self.builder.property("margin-bottom", margin_bottom),
856        }
857    }
858
859    pub fn margin_end(self, margin_end: i32) -> Self {
860        Self {
861            builder: self.builder.property("margin-end", margin_end),
862        }
863    }
864
865    pub fn margin_start(self, margin_start: i32) -> Self {
866        Self {
867            builder: self.builder.property("margin-start", margin_start),
868        }
869    }
870
871    pub fn margin_top(self, margin_top: i32) -> Self {
872        Self {
873            builder: self.builder.property("margin-top", margin_top),
874        }
875    }
876
877    pub fn name(self, name: impl Into<glib::GString>) -> Self {
878        Self {
879            builder: self.builder.property("name", name.into()),
880        }
881    }
882
883    pub fn opacity(self, opacity: f64) -> Self {
884        Self {
885            builder: self.builder.property("opacity", opacity),
886        }
887    }
888
889    pub fn overflow(self, overflow: gtk::Overflow) -> Self {
890        Self {
891            builder: self.builder.property("overflow", overflow),
892        }
893    }
894
895    pub fn receives_default(self, receives_default: bool) -> Self {
896        Self {
897            builder: self.builder.property("receives-default", receives_default),
898        }
899    }
900
901    pub fn sensitive(self, sensitive: bool) -> Self {
902        Self {
903            builder: self.builder.property("sensitive", sensitive),
904        }
905    }
906
907    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
908        Self {
909            builder: self
910                .builder
911                .property("tooltip-markup", tooltip_markup.into()),
912        }
913    }
914
915    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
916        Self {
917            builder: self.builder.property("tooltip-text", tooltip_text.into()),
918        }
919    }
920
921    pub fn valign(self, valign: gtk::Align) -> Self {
922        Self {
923            builder: self.builder.property("valign", valign),
924        }
925    }
926
927    pub fn vexpand(self, vexpand: bool) -> Self {
928        Self {
929            builder: self.builder.property("vexpand", vexpand),
930        }
931    }
932
933    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
934        Self {
935            builder: self.builder.property("vexpand-set", vexpand_set),
936        }
937    }
938
939    pub fn visible(self, visible: bool) -> Self {
940        Self {
941            builder: self.builder.property("visible", visible),
942        }
943    }
944
945    pub fn width_request(self, width_request: i32) -> Self {
946        Self {
947            builder: self.builder.property("width-request", width_request),
948        }
949    }
950
951    pub fn accessible_role(self, accessible_role: gtk::AccessibleRole) -> Self {
952        Self {
953            builder: self.builder.property("accessible-role", accessible_role),
954        }
955    }
956
957    // rustdoc-stripper-ignore-next
958    /// Build the [`OverlaySplitView`].
959    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
960    pub fn build(self) -> OverlaySplitView {
961        assert_initialized_main_thread!();
962        self.builder.build()
963    }
964}