[go: up one dir, main page]

gtk4/auto/
paned.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
5#[cfg(feature = "v4_10")]
6#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
7use crate::AccessibleRange;
8use crate::{
9    ffi, Accessible, AccessibleRole, Align, Buildable, ConstraintTarget, LayoutManager, Orientable,
10    Orientation, Overflow, ScrollType, Widget,
11};
12use glib::{
13    object::ObjectType as _,
14    prelude::*,
15    signal::{connect_raw, SignalHandlerId},
16    translate::*,
17};
18use std::boxed::Box as Box_;
19
20#[cfg(feature = "v4_10")]
21#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
22glib::wrapper! {
23    #[doc(alias = "GtkPaned")]
24    pub struct Paned(Object<ffi::GtkPaned>) @extends Widget, @implements Accessible, Buildable, ConstraintTarget, AccessibleRange, Orientable;
25
26    match fn {
27        type_ => || ffi::gtk_paned_get_type(),
28    }
29}
30
31#[cfg(not(any(feature = "v4_10")))]
32glib::wrapper! {
33    #[doc(alias = "GtkPaned")]
34    pub struct Paned(Object<ffi::GtkPaned>) @extends Widget, @implements Accessible, Buildable, ConstraintTarget, Orientable;
35
36    match fn {
37        type_ => || ffi::gtk_paned_get_type(),
38    }
39}
40
41impl Paned {
42    #[doc(alias = "gtk_paned_new")]
43    pub fn new(orientation: Orientation) -> Paned {
44        assert_initialized_main_thread!();
45        unsafe { Widget::from_glib_none(ffi::gtk_paned_new(orientation.into_glib())).unsafe_cast() }
46    }
47
48    // rustdoc-stripper-ignore-next
49    /// Creates a new builder-pattern struct instance to construct [`Paned`] objects.
50    ///
51    /// This method returns an instance of [`PanedBuilder`](crate::builders::PanedBuilder) which can be used to create [`Paned`] objects.
52    pub fn builder() -> PanedBuilder {
53        PanedBuilder::new()
54    }
55
56    #[doc(alias = "gtk_paned_get_end_child")]
57    #[doc(alias = "get_end_child")]
58    #[doc(alias = "end-child")]
59    pub fn end_child(&self) -> Option<Widget> {
60        unsafe { from_glib_none(ffi::gtk_paned_get_end_child(self.to_glib_none().0)) }
61    }
62
63    #[doc(alias = "gtk_paned_get_position")]
64    #[doc(alias = "get_position")]
65    pub fn position(&self) -> i32 {
66        unsafe { ffi::gtk_paned_get_position(self.to_glib_none().0) }
67    }
68
69    #[doc(alias = "gtk_paned_get_resize_end_child")]
70    #[doc(alias = "get_resize_end_child")]
71    #[doc(alias = "resize-end-child")]
72    pub fn resizes_end_child(&self) -> bool {
73        unsafe { from_glib(ffi::gtk_paned_get_resize_end_child(self.to_glib_none().0)) }
74    }
75
76    #[doc(alias = "gtk_paned_get_resize_start_child")]
77    #[doc(alias = "get_resize_start_child")]
78    #[doc(alias = "resize-start-child")]
79    pub fn resizes_start_child(&self) -> bool {
80        unsafe { from_glib(ffi::gtk_paned_get_resize_start_child(self.to_glib_none().0)) }
81    }
82
83    #[doc(alias = "gtk_paned_get_shrink_end_child")]
84    #[doc(alias = "get_shrink_end_child")]
85    #[doc(alias = "shrink-end-child")]
86    pub fn shrinks_end_child(&self) -> bool {
87        unsafe { from_glib(ffi::gtk_paned_get_shrink_end_child(self.to_glib_none().0)) }
88    }
89
90    #[doc(alias = "gtk_paned_get_shrink_start_child")]
91    #[doc(alias = "get_shrink_start_child")]
92    #[doc(alias = "shrink-start-child")]
93    pub fn shrinks_start_child(&self) -> bool {
94        unsafe { from_glib(ffi::gtk_paned_get_shrink_start_child(self.to_glib_none().0)) }
95    }
96
97    #[doc(alias = "gtk_paned_get_start_child")]
98    #[doc(alias = "get_start_child")]
99    #[doc(alias = "start-child")]
100    pub fn start_child(&self) -> Option<Widget> {
101        unsafe { from_glib_none(ffi::gtk_paned_get_start_child(self.to_glib_none().0)) }
102    }
103
104    #[doc(alias = "gtk_paned_get_wide_handle")]
105    #[doc(alias = "get_wide_handle")]
106    #[doc(alias = "wide-handle")]
107    pub fn is_wide_handle(&self) -> bool {
108        unsafe { from_glib(ffi::gtk_paned_get_wide_handle(self.to_glib_none().0)) }
109    }
110
111    #[doc(alias = "gtk_paned_set_end_child")]
112    #[doc(alias = "end-child")]
113    pub fn set_end_child(&self, child: Option<&impl IsA<Widget>>) {
114        unsafe {
115            ffi::gtk_paned_set_end_child(
116                self.to_glib_none().0,
117                child.map(|p| p.as_ref()).to_glib_none().0,
118            );
119        }
120    }
121
122    #[doc(alias = "gtk_paned_set_position")]
123    #[doc(alias = "position")]
124    pub fn set_position(&self, position: i32) {
125        unsafe {
126            ffi::gtk_paned_set_position(self.to_glib_none().0, position);
127        }
128    }
129
130    #[doc(alias = "gtk_paned_set_resize_end_child")]
131    #[doc(alias = "resize-end-child")]
132    pub fn set_resize_end_child(&self, resize: bool) {
133        unsafe {
134            ffi::gtk_paned_set_resize_end_child(self.to_glib_none().0, resize.into_glib());
135        }
136    }
137
138    #[doc(alias = "gtk_paned_set_resize_start_child")]
139    #[doc(alias = "resize-start-child")]
140    pub fn set_resize_start_child(&self, resize: bool) {
141        unsafe {
142            ffi::gtk_paned_set_resize_start_child(self.to_glib_none().0, resize.into_glib());
143        }
144    }
145
146    #[doc(alias = "gtk_paned_set_shrink_end_child")]
147    #[doc(alias = "shrink-end-child")]
148    pub fn set_shrink_end_child(&self, resize: bool) {
149        unsafe {
150            ffi::gtk_paned_set_shrink_end_child(self.to_glib_none().0, resize.into_glib());
151        }
152    }
153
154    #[doc(alias = "gtk_paned_set_shrink_start_child")]
155    #[doc(alias = "shrink-start-child")]
156    pub fn set_shrink_start_child(&self, resize: bool) {
157        unsafe {
158            ffi::gtk_paned_set_shrink_start_child(self.to_glib_none().0, resize.into_glib());
159        }
160    }
161
162    #[doc(alias = "gtk_paned_set_start_child")]
163    #[doc(alias = "start-child")]
164    pub fn set_start_child(&self, child: Option<&impl IsA<Widget>>) {
165        unsafe {
166            ffi::gtk_paned_set_start_child(
167                self.to_glib_none().0,
168                child.map(|p| p.as_ref()).to_glib_none().0,
169            );
170        }
171    }
172
173    #[doc(alias = "gtk_paned_set_wide_handle")]
174    #[doc(alias = "wide-handle")]
175    pub fn set_wide_handle(&self, wide: bool) {
176        unsafe {
177            ffi::gtk_paned_set_wide_handle(self.to_glib_none().0, wide.into_glib());
178        }
179    }
180
181    #[doc(alias = "max-position")]
182    pub fn max_position(&self) -> i32 {
183        ObjectExt::property(self, "max-position")
184    }
185
186    #[doc(alias = "min-position")]
187    pub fn min_position(&self) -> i32 {
188        ObjectExt::property(self, "min-position")
189    }
190
191    #[doc(alias = "position-set")]
192    pub fn is_position_set(&self) -> bool {
193        ObjectExt::property(self, "position-set")
194    }
195
196    #[doc(alias = "accept-position")]
197    pub fn connect_accept_position<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId {
198        unsafe extern "C" fn accept_position_trampoline<F: Fn(&Paned) -> bool + 'static>(
199            this: *mut ffi::GtkPaned,
200            f: glib::ffi::gpointer,
201        ) -> glib::ffi::gboolean {
202            let f: &F = &*(f as *const F);
203            f(&from_glib_borrow(this)).into_glib()
204        }
205        unsafe {
206            let f: Box_<F> = Box_::new(f);
207            connect_raw(
208                self.as_ptr() as *mut _,
209                c"accept-position".as_ptr() as *const _,
210                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
211                    accept_position_trampoline::<F> as *const (),
212                )),
213                Box_::into_raw(f),
214            )
215        }
216    }
217
218    pub fn emit_accept_position(&self) -> bool {
219        self.emit_by_name("accept-position", &[])
220    }
221
222    #[doc(alias = "cancel-position")]
223    pub fn connect_cancel_position<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId {
224        unsafe extern "C" fn cancel_position_trampoline<F: Fn(&Paned) -> bool + 'static>(
225            this: *mut ffi::GtkPaned,
226            f: glib::ffi::gpointer,
227        ) -> glib::ffi::gboolean {
228            let f: &F = &*(f as *const F);
229            f(&from_glib_borrow(this)).into_glib()
230        }
231        unsafe {
232            let f: Box_<F> = Box_::new(f);
233            connect_raw(
234                self.as_ptr() as *mut _,
235                c"cancel-position".as_ptr() as *const _,
236                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
237                    cancel_position_trampoline::<F> as *const (),
238                )),
239                Box_::into_raw(f),
240            )
241        }
242    }
243
244    pub fn emit_cancel_position(&self) -> bool {
245        self.emit_by_name("cancel-position", &[])
246    }
247
248    #[doc(alias = "cycle-child-focus")]
249    pub fn connect_cycle_child_focus<F: Fn(&Self, bool) -> bool + 'static>(
250        &self,
251        f: F,
252    ) -> SignalHandlerId {
253        unsafe extern "C" fn cycle_child_focus_trampoline<F: Fn(&Paned, bool) -> bool + 'static>(
254            this: *mut ffi::GtkPaned,
255            reversed: glib::ffi::gboolean,
256            f: glib::ffi::gpointer,
257        ) -> glib::ffi::gboolean {
258            let f: &F = &*(f as *const F);
259            f(&from_glib_borrow(this), from_glib(reversed)).into_glib()
260        }
261        unsafe {
262            let f: Box_<F> = Box_::new(f);
263            connect_raw(
264                self.as_ptr() as *mut _,
265                c"cycle-child-focus".as_ptr() as *const _,
266                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
267                    cycle_child_focus_trampoline::<F> as *const (),
268                )),
269                Box_::into_raw(f),
270            )
271        }
272    }
273
274    pub fn emit_cycle_child_focus(&self, reversed: bool) -> bool {
275        self.emit_by_name("cycle-child-focus", &[&reversed])
276    }
277
278    #[doc(alias = "cycle-handle-focus")]
279    pub fn connect_cycle_handle_focus<F: Fn(&Self, bool) -> bool + 'static>(
280        &self,
281        f: F,
282    ) -> SignalHandlerId {
283        unsafe extern "C" fn cycle_handle_focus_trampoline<
284            F: Fn(&Paned, bool) -> bool + 'static,
285        >(
286            this: *mut ffi::GtkPaned,
287            reversed: glib::ffi::gboolean,
288            f: glib::ffi::gpointer,
289        ) -> glib::ffi::gboolean {
290            let f: &F = &*(f as *const F);
291            f(&from_glib_borrow(this), from_glib(reversed)).into_glib()
292        }
293        unsafe {
294            let f: Box_<F> = Box_::new(f);
295            connect_raw(
296                self.as_ptr() as *mut _,
297                c"cycle-handle-focus".as_ptr() as *const _,
298                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
299                    cycle_handle_focus_trampoline::<F> as *const (),
300                )),
301                Box_::into_raw(f),
302            )
303        }
304    }
305
306    pub fn emit_cycle_handle_focus(&self, reversed: bool) -> bool {
307        self.emit_by_name("cycle-handle-focus", &[&reversed])
308    }
309
310    #[doc(alias = "move-handle")]
311    pub fn connect_move_handle<F: Fn(&Self, ScrollType) -> bool + 'static>(
312        &self,
313        f: F,
314    ) -> SignalHandlerId {
315        unsafe extern "C" fn move_handle_trampoline<F: Fn(&Paned, ScrollType) -> bool + 'static>(
316            this: *mut ffi::GtkPaned,
317            scroll_type: ffi::GtkScrollType,
318            f: glib::ffi::gpointer,
319        ) -> glib::ffi::gboolean {
320            let f: &F = &*(f as *const F);
321            f(&from_glib_borrow(this), from_glib(scroll_type)).into_glib()
322        }
323        unsafe {
324            let f: Box_<F> = Box_::new(f);
325            connect_raw(
326                self.as_ptr() as *mut _,
327                c"move-handle".as_ptr() as *const _,
328                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
329                    move_handle_trampoline::<F> as *const (),
330                )),
331                Box_::into_raw(f),
332            )
333        }
334    }
335
336    pub fn emit_move_handle(&self, scroll_type: ScrollType) -> bool {
337        self.emit_by_name("move-handle", &[&scroll_type])
338    }
339
340    #[doc(alias = "toggle-handle-focus")]
341    pub fn connect_toggle_handle_focus<F: Fn(&Self) -> bool + 'static>(
342        &self,
343        f: F,
344    ) -> SignalHandlerId {
345        unsafe extern "C" fn toggle_handle_focus_trampoline<F: Fn(&Paned) -> bool + 'static>(
346            this: *mut ffi::GtkPaned,
347            f: glib::ffi::gpointer,
348        ) -> glib::ffi::gboolean {
349            let f: &F = &*(f as *const F);
350            f(&from_glib_borrow(this)).into_glib()
351        }
352        unsafe {
353            let f: Box_<F> = Box_::new(f);
354            connect_raw(
355                self.as_ptr() as *mut _,
356                c"toggle-handle-focus".as_ptr() as *const _,
357                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
358                    toggle_handle_focus_trampoline::<F> as *const (),
359                )),
360                Box_::into_raw(f),
361            )
362        }
363    }
364
365    pub fn emit_toggle_handle_focus(&self) -> bool {
366        self.emit_by_name("toggle-handle-focus", &[])
367    }
368
369    #[doc(alias = "end-child")]
370    pub fn connect_end_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
371        unsafe extern "C" fn notify_end_child_trampoline<F: Fn(&Paned) + 'static>(
372            this: *mut ffi::GtkPaned,
373            _param_spec: glib::ffi::gpointer,
374            f: glib::ffi::gpointer,
375        ) {
376            let f: &F = &*(f as *const F);
377            f(&from_glib_borrow(this))
378        }
379        unsafe {
380            let f: Box_<F> = Box_::new(f);
381            connect_raw(
382                self.as_ptr() as *mut _,
383                c"notify::end-child".as_ptr() as *const _,
384                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
385                    notify_end_child_trampoline::<F> as *const (),
386                )),
387                Box_::into_raw(f),
388            )
389        }
390    }
391
392    #[doc(alias = "max-position")]
393    pub fn connect_max_position_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
394        unsafe extern "C" fn notify_max_position_trampoline<F: Fn(&Paned) + 'static>(
395            this: *mut ffi::GtkPaned,
396            _param_spec: glib::ffi::gpointer,
397            f: glib::ffi::gpointer,
398        ) {
399            let f: &F = &*(f as *const F);
400            f(&from_glib_borrow(this))
401        }
402        unsafe {
403            let f: Box_<F> = Box_::new(f);
404            connect_raw(
405                self.as_ptr() as *mut _,
406                c"notify::max-position".as_ptr() as *const _,
407                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
408                    notify_max_position_trampoline::<F> as *const (),
409                )),
410                Box_::into_raw(f),
411            )
412        }
413    }
414
415    #[doc(alias = "min-position")]
416    pub fn connect_min_position_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
417        unsafe extern "C" fn notify_min_position_trampoline<F: Fn(&Paned) + 'static>(
418            this: *mut ffi::GtkPaned,
419            _param_spec: glib::ffi::gpointer,
420            f: glib::ffi::gpointer,
421        ) {
422            let f: &F = &*(f as *const F);
423            f(&from_glib_borrow(this))
424        }
425        unsafe {
426            let f: Box_<F> = Box_::new(f);
427            connect_raw(
428                self.as_ptr() as *mut _,
429                c"notify::min-position".as_ptr() as *const _,
430                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
431                    notify_min_position_trampoline::<F> as *const (),
432                )),
433                Box_::into_raw(f),
434            )
435        }
436    }
437
438    #[doc(alias = "position")]
439    pub fn connect_position_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
440        unsafe extern "C" fn notify_position_trampoline<F: Fn(&Paned) + 'static>(
441            this: *mut ffi::GtkPaned,
442            _param_spec: glib::ffi::gpointer,
443            f: glib::ffi::gpointer,
444        ) {
445            let f: &F = &*(f as *const F);
446            f(&from_glib_borrow(this))
447        }
448        unsafe {
449            let f: Box_<F> = Box_::new(f);
450            connect_raw(
451                self.as_ptr() as *mut _,
452                c"notify::position".as_ptr() as *const _,
453                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
454                    notify_position_trampoline::<F> as *const (),
455                )),
456                Box_::into_raw(f),
457            )
458        }
459    }
460
461    #[doc(alias = "position-set")]
462    pub fn connect_position_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
463        unsafe extern "C" fn notify_position_set_trampoline<F: Fn(&Paned) + 'static>(
464            this: *mut ffi::GtkPaned,
465            _param_spec: glib::ffi::gpointer,
466            f: glib::ffi::gpointer,
467        ) {
468            let f: &F = &*(f as *const F);
469            f(&from_glib_borrow(this))
470        }
471        unsafe {
472            let f: Box_<F> = Box_::new(f);
473            connect_raw(
474                self.as_ptr() as *mut _,
475                c"notify::position-set".as_ptr() as *const _,
476                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
477                    notify_position_set_trampoline::<F> as *const (),
478                )),
479                Box_::into_raw(f),
480            )
481        }
482    }
483
484    #[doc(alias = "resize-end-child")]
485    pub fn connect_resize_end_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
486        unsafe extern "C" fn notify_resize_end_child_trampoline<F: Fn(&Paned) + 'static>(
487            this: *mut ffi::GtkPaned,
488            _param_spec: glib::ffi::gpointer,
489            f: glib::ffi::gpointer,
490        ) {
491            let f: &F = &*(f as *const F);
492            f(&from_glib_borrow(this))
493        }
494        unsafe {
495            let f: Box_<F> = Box_::new(f);
496            connect_raw(
497                self.as_ptr() as *mut _,
498                c"notify::resize-end-child".as_ptr() as *const _,
499                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
500                    notify_resize_end_child_trampoline::<F> as *const (),
501                )),
502                Box_::into_raw(f),
503            )
504        }
505    }
506
507    #[doc(alias = "resize-start-child")]
508    pub fn connect_resize_start_child_notify<F: Fn(&Self) + 'static>(
509        &self,
510        f: F,
511    ) -> SignalHandlerId {
512        unsafe extern "C" fn notify_resize_start_child_trampoline<F: Fn(&Paned) + 'static>(
513            this: *mut ffi::GtkPaned,
514            _param_spec: glib::ffi::gpointer,
515            f: glib::ffi::gpointer,
516        ) {
517            let f: &F = &*(f as *const F);
518            f(&from_glib_borrow(this))
519        }
520        unsafe {
521            let f: Box_<F> = Box_::new(f);
522            connect_raw(
523                self.as_ptr() as *mut _,
524                c"notify::resize-start-child".as_ptr() as *const _,
525                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
526                    notify_resize_start_child_trampoline::<F> as *const (),
527                )),
528                Box_::into_raw(f),
529            )
530        }
531    }
532
533    #[doc(alias = "shrink-end-child")]
534    pub fn connect_shrink_end_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
535        unsafe extern "C" fn notify_shrink_end_child_trampoline<F: Fn(&Paned) + 'static>(
536            this: *mut ffi::GtkPaned,
537            _param_spec: glib::ffi::gpointer,
538            f: glib::ffi::gpointer,
539        ) {
540            let f: &F = &*(f as *const F);
541            f(&from_glib_borrow(this))
542        }
543        unsafe {
544            let f: Box_<F> = Box_::new(f);
545            connect_raw(
546                self.as_ptr() as *mut _,
547                c"notify::shrink-end-child".as_ptr() as *const _,
548                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
549                    notify_shrink_end_child_trampoline::<F> as *const (),
550                )),
551                Box_::into_raw(f),
552            )
553        }
554    }
555
556    #[doc(alias = "shrink-start-child")]
557    pub fn connect_shrink_start_child_notify<F: Fn(&Self) + 'static>(
558        &self,
559        f: F,
560    ) -> SignalHandlerId {
561        unsafe extern "C" fn notify_shrink_start_child_trampoline<F: Fn(&Paned) + 'static>(
562            this: *mut ffi::GtkPaned,
563            _param_spec: glib::ffi::gpointer,
564            f: glib::ffi::gpointer,
565        ) {
566            let f: &F = &*(f as *const F);
567            f(&from_glib_borrow(this))
568        }
569        unsafe {
570            let f: Box_<F> = Box_::new(f);
571            connect_raw(
572                self.as_ptr() as *mut _,
573                c"notify::shrink-start-child".as_ptr() as *const _,
574                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
575                    notify_shrink_start_child_trampoline::<F> as *const (),
576                )),
577                Box_::into_raw(f),
578            )
579        }
580    }
581
582    #[doc(alias = "start-child")]
583    pub fn connect_start_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
584        unsafe extern "C" fn notify_start_child_trampoline<F: Fn(&Paned) + 'static>(
585            this: *mut ffi::GtkPaned,
586            _param_spec: glib::ffi::gpointer,
587            f: glib::ffi::gpointer,
588        ) {
589            let f: &F = &*(f as *const F);
590            f(&from_glib_borrow(this))
591        }
592        unsafe {
593            let f: Box_<F> = Box_::new(f);
594            connect_raw(
595                self.as_ptr() as *mut _,
596                c"notify::start-child".as_ptr() as *const _,
597                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
598                    notify_start_child_trampoline::<F> as *const (),
599                )),
600                Box_::into_raw(f),
601            )
602        }
603    }
604
605    #[doc(alias = "wide-handle")]
606    pub fn connect_wide_handle_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
607        unsafe extern "C" fn notify_wide_handle_trampoline<F: Fn(&Paned) + 'static>(
608            this: *mut ffi::GtkPaned,
609            _param_spec: glib::ffi::gpointer,
610            f: glib::ffi::gpointer,
611        ) {
612            let f: &F = &*(f as *const F);
613            f(&from_glib_borrow(this))
614        }
615        unsafe {
616            let f: Box_<F> = Box_::new(f);
617            connect_raw(
618                self.as_ptr() as *mut _,
619                c"notify::wide-handle".as_ptr() as *const _,
620                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
621                    notify_wide_handle_trampoline::<F> as *const (),
622                )),
623                Box_::into_raw(f),
624            )
625        }
626    }
627}
628
629impl Default for Paned {
630    fn default() -> Self {
631        glib::object::Object::new::<Self>()
632    }
633}
634
635// rustdoc-stripper-ignore-next
636/// A [builder-pattern] type to construct [`Paned`] objects.
637///
638/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
639#[must_use = "The builder must be built to be used"]
640pub struct PanedBuilder {
641    builder: glib::object::ObjectBuilder<'static, Paned>,
642}
643
644impl PanedBuilder {
645    fn new() -> Self {
646        Self {
647            builder: glib::object::Object::builder(),
648        }
649    }
650
651    pub fn end_child(self, end_child: &impl IsA<Widget>) -> Self {
652        Self {
653            builder: self
654                .builder
655                .property("end-child", end_child.clone().upcast()),
656        }
657    }
658
659    pub fn position(self, position: i32) -> Self {
660        Self {
661            builder: self.builder.property("position", position),
662        }
663    }
664
665    pub fn position_set(self, position_set: bool) -> Self {
666        Self {
667            builder: self.builder.property("position-set", position_set),
668        }
669    }
670
671    pub fn resize_end_child(self, resize_end_child: bool) -> Self {
672        Self {
673            builder: self.builder.property("resize-end-child", resize_end_child),
674        }
675    }
676
677    pub fn resize_start_child(self, resize_start_child: bool) -> Self {
678        Self {
679            builder: self
680                .builder
681                .property("resize-start-child", resize_start_child),
682        }
683    }
684
685    pub fn shrink_end_child(self, shrink_end_child: bool) -> Self {
686        Self {
687            builder: self.builder.property("shrink-end-child", shrink_end_child),
688        }
689    }
690
691    pub fn shrink_start_child(self, shrink_start_child: bool) -> Self {
692        Self {
693            builder: self
694                .builder
695                .property("shrink-start-child", shrink_start_child),
696        }
697    }
698
699    pub fn start_child(self, start_child: &impl IsA<Widget>) -> Self {
700        Self {
701            builder: self
702                .builder
703                .property("start-child", start_child.clone().upcast()),
704        }
705    }
706
707    pub fn wide_handle(self, wide_handle: bool) -> Self {
708        Self {
709            builder: self.builder.property("wide-handle", wide_handle),
710        }
711    }
712
713    pub fn can_focus(self, can_focus: bool) -> Self {
714        Self {
715            builder: self.builder.property("can-focus", can_focus),
716        }
717    }
718
719    pub fn can_target(self, can_target: bool) -> Self {
720        Self {
721            builder: self.builder.property("can-target", can_target),
722        }
723    }
724
725    pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
726        Self {
727            builder: self.builder.property("css-classes", css_classes.into()),
728        }
729    }
730
731    pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
732        Self {
733            builder: self.builder.property("css-name", css_name.into()),
734        }
735    }
736
737    pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
738        Self {
739            builder: self.builder.property("cursor", cursor.clone()),
740        }
741    }
742
743    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
744        Self {
745            builder: self.builder.property("focus-on-click", focus_on_click),
746        }
747    }
748
749    pub fn focusable(self, focusable: bool) -> Self {
750        Self {
751            builder: self.builder.property("focusable", focusable),
752        }
753    }
754
755    pub fn halign(self, halign: Align) -> Self {
756        Self {
757            builder: self.builder.property("halign", halign),
758        }
759    }
760
761    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
762        Self {
763            builder: self.builder.property("has-tooltip", has_tooltip),
764        }
765    }
766
767    pub fn height_request(self, height_request: i32) -> Self {
768        Self {
769            builder: self.builder.property("height-request", height_request),
770        }
771    }
772
773    pub fn hexpand(self, hexpand: bool) -> Self {
774        Self {
775            builder: self.builder.property("hexpand", hexpand),
776        }
777    }
778
779    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
780        Self {
781            builder: self.builder.property("hexpand-set", hexpand_set),
782        }
783    }
784
785    pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
786        Self {
787            builder: self
788                .builder
789                .property("layout-manager", layout_manager.clone().upcast()),
790        }
791    }
792
793    #[cfg(feature = "v4_18")]
794    #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
795    pub fn limit_events(self, limit_events: bool) -> Self {
796        Self {
797            builder: self.builder.property("limit-events", limit_events),
798        }
799    }
800
801    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
802        Self {
803            builder: self.builder.property("margin-bottom", margin_bottom),
804        }
805    }
806
807    pub fn margin_end(self, margin_end: i32) -> Self {
808        Self {
809            builder: self.builder.property("margin-end", margin_end),
810        }
811    }
812
813    pub fn margin_start(self, margin_start: i32) -> Self {
814        Self {
815            builder: self.builder.property("margin-start", margin_start),
816        }
817    }
818
819    pub fn margin_top(self, margin_top: i32) -> Self {
820        Self {
821            builder: self.builder.property("margin-top", margin_top),
822        }
823    }
824
825    pub fn name(self, name: impl Into<glib::GString>) -> Self {
826        Self {
827            builder: self.builder.property("name", name.into()),
828        }
829    }
830
831    pub fn opacity(self, opacity: f64) -> Self {
832        Self {
833            builder: self.builder.property("opacity", opacity),
834        }
835    }
836
837    pub fn overflow(self, overflow: Overflow) -> Self {
838        Self {
839            builder: self.builder.property("overflow", overflow),
840        }
841    }
842
843    pub fn receives_default(self, receives_default: bool) -> Self {
844        Self {
845            builder: self.builder.property("receives-default", receives_default),
846        }
847    }
848
849    pub fn sensitive(self, sensitive: bool) -> Self {
850        Self {
851            builder: self.builder.property("sensitive", sensitive),
852        }
853    }
854
855    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
856        Self {
857            builder: self
858                .builder
859                .property("tooltip-markup", tooltip_markup.into()),
860        }
861    }
862
863    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
864        Self {
865            builder: self.builder.property("tooltip-text", tooltip_text.into()),
866        }
867    }
868
869    pub fn valign(self, valign: Align) -> Self {
870        Self {
871            builder: self.builder.property("valign", valign),
872        }
873    }
874
875    pub fn vexpand(self, vexpand: bool) -> Self {
876        Self {
877            builder: self.builder.property("vexpand", vexpand),
878        }
879    }
880
881    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
882        Self {
883            builder: self.builder.property("vexpand-set", vexpand_set),
884        }
885    }
886
887    pub fn visible(self, visible: bool) -> Self {
888        Self {
889            builder: self.builder.property("visible", visible),
890        }
891    }
892
893    pub fn width_request(self, width_request: i32) -> Self {
894        Self {
895            builder: self.builder.property("width-request", width_request),
896        }
897    }
898
899    pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
900        Self {
901            builder: self.builder.property("accessible-role", accessible_role),
902        }
903    }
904
905    pub fn orientation(self, orientation: Orientation) -> Self {
906        Self {
907            builder: self.builder.property("orientation", orientation),
908        }
909    }
910
911    // rustdoc-stripper-ignore-next
912    /// Build the [`Paned`].
913    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
914    pub fn build(self) -> Paned {
915        assert_initialized_main_thread!();
916        self.builder.build()
917    }
918}