libadwaita/auto/
carousel.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::{ffi, SpringParams, Swipeable};
7use glib::{
8    object::ObjectType as _,
9    prelude::*,
10    signal::{connect_raw, SignalHandlerId},
11    translate::*,
12};
13use std::boxed::Box as Box_;
14
15glib::wrapper! {
16    #[doc(alias = "AdwCarousel")]
17    pub struct Carousel(Object<ffi::AdwCarousel, ffi::AdwCarouselClass>) @extends gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, Swipeable, gtk::Orientable;
18
19    match fn {
20        type_ => || ffi::adw_carousel_get_type(),
21    }
22}
23
24impl Carousel {
25    #[doc(alias = "adw_carousel_new")]
26    pub fn new() -> Carousel {
27        assert_initialized_main_thread!();
28        unsafe { gtk::Widget::from_glib_none(ffi::adw_carousel_new()).unsafe_cast() }
29    }
30
31    // rustdoc-stripper-ignore-next
32    /// Creates a new builder-pattern struct instance to construct [`Carousel`] objects.
33    ///
34    /// This method returns an instance of [`CarouselBuilder`](crate::builders::CarouselBuilder) which can be used to create [`Carousel`] objects.
35    pub fn builder() -> CarouselBuilder {
36        CarouselBuilder::new()
37    }
38
39    #[doc(alias = "adw_carousel_append")]
40    pub fn append(&self, child: &impl IsA<gtk::Widget>) {
41        unsafe {
42            ffi::adw_carousel_append(self.to_glib_none().0, child.as_ref().to_glib_none().0);
43        }
44    }
45
46    #[doc(alias = "adw_carousel_get_allow_long_swipes")]
47    #[doc(alias = "get_allow_long_swipes")]
48    #[doc(alias = "allow-long-swipes")]
49    pub fn allows_long_swipes(&self) -> bool {
50        unsafe {
51            from_glib(ffi::adw_carousel_get_allow_long_swipes(
52                self.to_glib_none().0,
53            ))
54        }
55    }
56
57    #[doc(alias = "adw_carousel_get_allow_mouse_drag")]
58    #[doc(alias = "get_allow_mouse_drag")]
59    #[doc(alias = "allow-mouse-drag")]
60    pub fn allows_mouse_drag(&self) -> bool {
61        unsafe {
62            from_glib(ffi::adw_carousel_get_allow_mouse_drag(
63                self.to_glib_none().0,
64            ))
65        }
66    }
67
68    #[doc(alias = "adw_carousel_get_allow_scroll_wheel")]
69    #[doc(alias = "get_allow_scroll_wheel")]
70    #[doc(alias = "allow-scroll-wheel")]
71    pub fn allows_scroll_wheel(&self) -> bool {
72        unsafe {
73            from_glib(ffi::adw_carousel_get_allow_scroll_wheel(
74                self.to_glib_none().0,
75            ))
76        }
77    }
78
79    #[doc(alias = "adw_carousel_get_interactive")]
80    #[doc(alias = "get_interactive")]
81    #[doc(alias = "interactive")]
82    pub fn is_interactive(&self) -> bool {
83        unsafe { from_glib(ffi::adw_carousel_get_interactive(self.to_glib_none().0)) }
84    }
85
86    #[doc(alias = "adw_carousel_get_n_pages")]
87    #[doc(alias = "get_n_pages")]
88    #[doc(alias = "n-pages")]
89    pub fn n_pages(&self) -> u32 {
90        unsafe { ffi::adw_carousel_get_n_pages(self.to_glib_none().0) }
91    }
92
93    #[doc(alias = "adw_carousel_get_position")]
94    #[doc(alias = "get_position")]
95    pub fn position(&self) -> f64 {
96        unsafe { ffi::adw_carousel_get_position(self.to_glib_none().0) }
97    }
98
99    #[doc(alias = "adw_carousel_get_reveal_duration")]
100    #[doc(alias = "get_reveal_duration")]
101    #[doc(alias = "reveal-duration")]
102    pub fn reveal_duration(&self) -> u32 {
103        unsafe { ffi::adw_carousel_get_reveal_duration(self.to_glib_none().0) }
104    }
105
106    #[doc(alias = "adw_carousel_get_scroll_params")]
107    #[doc(alias = "get_scroll_params")]
108    #[doc(alias = "scroll-params")]
109    pub fn scroll_params(&self) -> SpringParams {
110        unsafe { from_glib_full(ffi::adw_carousel_get_scroll_params(self.to_glib_none().0)) }
111    }
112
113    #[doc(alias = "adw_carousel_get_spacing")]
114    #[doc(alias = "get_spacing")]
115    pub fn spacing(&self) -> u32 {
116        unsafe { ffi::adw_carousel_get_spacing(self.to_glib_none().0) }
117    }
118
119    #[doc(alias = "adw_carousel_insert")]
120    pub fn insert(&self, child: &impl IsA<gtk::Widget>, position: i32) {
121        unsafe {
122            ffi::adw_carousel_insert(
123                self.to_glib_none().0,
124                child.as_ref().to_glib_none().0,
125                position,
126            );
127        }
128    }
129
130    #[doc(alias = "adw_carousel_prepend")]
131    pub fn prepend(&self, child: &impl IsA<gtk::Widget>) {
132        unsafe {
133            ffi::adw_carousel_prepend(self.to_glib_none().0, child.as_ref().to_glib_none().0);
134        }
135    }
136
137    #[doc(alias = "adw_carousel_remove")]
138    pub fn remove(&self, child: &impl IsA<gtk::Widget>) {
139        unsafe {
140            ffi::adw_carousel_remove(self.to_glib_none().0, child.as_ref().to_glib_none().0);
141        }
142    }
143
144    #[doc(alias = "adw_carousel_reorder")]
145    pub fn reorder(&self, child: &impl IsA<gtk::Widget>, position: i32) {
146        unsafe {
147            ffi::adw_carousel_reorder(
148                self.to_glib_none().0,
149                child.as_ref().to_glib_none().0,
150                position,
151            );
152        }
153    }
154
155    #[doc(alias = "adw_carousel_scroll_to")]
156    pub fn scroll_to(&self, widget: &impl IsA<gtk::Widget>, animate: bool) {
157        unsafe {
158            ffi::adw_carousel_scroll_to(
159                self.to_glib_none().0,
160                widget.as_ref().to_glib_none().0,
161                animate.into_glib(),
162            );
163        }
164    }
165
166    #[doc(alias = "adw_carousel_set_allow_long_swipes")]
167    #[doc(alias = "allow-long-swipes")]
168    pub fn set_allow_long_swipes(&self, allow_long_swipes: bool) {
169        unsafe {
170            ffi::adw_carousel_set_allow_long_swipes(
171                self.to_glib_none().0,
172                allow_long_swipes.into_glib(),
173            );
174        }
175    }
176
177    #[doc(alias = "adw_carousel_set_allow_mouse_drag")]
178    #[doc(alias = "allow-mouse-drag")]
179    pub fn set_allow_mouse_drag(&self, allow_mouse_drag: bool) {
180        unsafe {
181            ffi::adw_carousel_set_allow_mouse_drag(
182                self.to_glib_none().0,
183                allow_mouse_drag.into_glib(),
184            );
185        }
186    }
187
188    #[doc(alias = "adw_carousel_set_allow_scroll_wheel")]
189    #[doc(alias = "allow-scroll-wheel")]
190    pub fn set_allow_scroll_wheel(&self, allow_scroll_wheel: bool) {
191        unsafe {
192            ffi::adw_carousel_set_allow_scroll_wheel(
193                self.to_glib_none().0,
194                allow_scroll_wheel.into_glib(),
195            );
196        }
197    }
198
199    #[doc(alias = "adw_carousel_set_interactive")]
200    #[doc(alias = "interactive")]
201    pub fn set_interactive(&self, interactive: bool) {
202        unsafe {
203            ffi::adw_carousel_set_interactive(self.to_glib_none().0, interactive.into_glib());
204        }
205    }
206
207    #[doc(alias = "adw_carousel_set_reveal_duration")]
208    #[doc(alias = "reveal-duration")]
209    pub fn set_reveal_duration(&self, reveal_duration: u32) {
210        unsafe {
211            ffi::adw_carousel_set_reveal_duration(self.to_glib_none().0, reveal_duration);
212        }
213    }
214
215    #[doc(alias = "adw_carousel_set_scroll_params")]
216    #[doc(alias = "scroll-params")]
217    pub fn set_scroll_params(&self, params: &SpringParams) {
218        unsafe {
219            ffi::adw_carousel_set_scroll_params(self.to_glib_none().0, params.to_glib_none().0);
220        }
221    }
222
223    #[doc(alias = "adw_carousel_set_spacing")]
224    #[doc(alias = "spacing")]
225    pub fn set_spacing(&self, spacing: u32) {
226        unsafe {
227            ffi::adw_carousel_set_spacing(self.to_glib_none().0, spacing);
228        }
229    }
230
231    #[doc(alias = "page-changed")]
232    pub fn connect_page_changed<F: Fn(&Self, u32) + 'static>(&self, f: F) -> SignalHandlerId {
233        unsafe extern "C" fn page_changed_trampoline<F: Fn(&Carousel, u32) + 'static>(
234            this: *mut ffi::AdwCarousel,
235            index: std::ffi::c_uint,
236            f: glib::ffi::gpointer,
237        ) {
238            let f: &F = &*(f as *const F);
239            f(&from_glib_borrow(this), index)
240        }
241        unsafe {
242            let f: Box_<F> = Box_::new(f);
243            connect_raw(
244                self.as_ptr() as *mut _,
245                c"page-changed".as_ptr() as *const _,
246                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
247                    page_changed_trampoline::<F> as *const (),
248                )),
249                Box_::into_raw(f),
250            )
251        }
252    }
253
254    #[doc(alias = "allow-long-swipes")]
255    pub fn connect_allow_long_swipes_notify<F: Fn(&Self) + 'static>(
256        &self,
257        f: F,
258    ) -> SignalHandlerId {
259        unsafe extern "C" fn notify_allow_long_swipes_trampoline<F: Fn(&Carousel) + 'static>(
260            this: *mut ffi::AdwCarousel,
261            _param_spec: glib::ffi::gpointer,
262            f: glib::ffi::gpointer,
263        ) {
264            let f: &F = &*(f as *const F);
265            f(&from_glib_borrow(this))
266        }
267        unsafe {
268            let f: Box_<F> = Box_::new(f);
269            connect_raw(
270                self.as_ptr() as *mut _,
271                c"notify::allow-long-swipes".as_ptr() as *const _,
272                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
273                    notify_allow_long_swipes_trampoline::<F> as *const (),
274                )),
275                Box_::into_raw(f),
276            )
277        }
278    }
279
280    #[doc(alias = "allow-mouse-drag")]
281    pub fn connect_allow_mouse_drag_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
282        unsafe extern "C" fn notify_allow_mouse_drag_trampoline<F: Fn(&Carousel) + 'static>(
283            this: *mut ffi::AdwCarousel,
284            _param_spec: glib::ffi::gpointer,
285            f: glib::ffi::gpointer,
286        ) {
287            let f: &F = &*(f as *const F);
288            f(&from_glib_borrow(this))
289        }
290        unsafe {
291            let f: Box_<F> = Box_::new(f);
292            connect_raw(
293                self.as_ptr() as *mut _,
294                c"notify::allow-mouse-drag".as_ptr() as *const _,
295                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
296                    notify_allow_mouse_drag_trampoline::<F> as *const (),
297                )),
298                Box_::into_raw(f),
299            )
300        }
301    }
302
303    #[doc(alias = "allow-scroll-wheel")]
304    pub fn connect_allow_scroll_wheel_notify<F: Fn(&Self) + 'static>(
305        &self,
306        f: F,
307    ) -> SignalHandlerId {
308        unsafe extern "C" fn notify_allow_scroll_wheel_trampoline<F: Fn(&Carousel) + 'static>(
309            this: *mut ffi::AdwCarousel,
310            _param_spec: glib::ffi::gpointer,
311            f: glib::ffi::gpointer,
312        ) {
313            let f: &F = &*(f as *const F);
314            f(&from_glib_borrow(this))
315        }
316        unsafe {
317            let f: Box_<F> = Box_::new(f);
318            connect_raw(
319                self.as_ptr() as *mut _,
320                c"notify::allow-scroll-wheel".as_ptr() as *const _,
321                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
322                    notify_allow_scroll_wheel_trampoline::<F> as *const (),
323                )),
324                Box_::into_raw(f),
325            )
326        }
327    }
328
329    #[doc(alias = "interactive")]
330    pub fn connect_interactive_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
331        unsafe extern "C" fn notify_interactive_trampoline<F: Fn(&Carousel) + 'static>(
332            this: *mut ffi::AdwCarousel,
333            _param_spec: glib::ffi::gpointer,
334            f: glib::ffi::gpointer,
335        ) {
336            let f: &F = &*(f as *const F);
337            f(&from_glib_borrow(this))
338        }
339        unsafe {
340            let f: Box_<F> = Box_::new(f);
341            connect_raw(
342                self.as_ptr() as *mut _,
343                c"notify::interactive".as_ptr() as *const _,
344                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
345                    notify_interactive_trampoline::<F> as *const (),
346                )),
347                Box_::into_raw(f),
348            )
349        }
350    }
351
352    #[doc(alias = "n-pages")]
353    pub fn connect_n_pages_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
354        unsafe extern "C" fn notify_n_pages_trampoline<F: Fn(&Carousel) + 'static>(
355            this: *mut ffi::AdwCarousel,
356            _param_spec: glib::ffi::gpointer,
357            f: glib::ffi::gpointer,
358        ) {
359            let f: &F = &*(f as *const F);
360            f(&from_glib_borrow(this))
361        }
362        unsafe {
363            let f: Box_<F> = Box_::new(f);
364            connect_raw(
365                self.as_ptr() as *mut _,
366                c"notify::n-pages".as_ptr() as *const _,
367                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
368                    notify_n_pages_trampoline::<F> as *const (),
369                )),
370                Box_::into_raw(f),
371            )
372        }
373    }
374
375    #[doc(alias = "position")]
376    pub fn connect_position_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
377        unsafe extern "C" fn notify_position_trampoline<F: Fn(&Carousel) + 'static>(
378            this: *mut ffi::AdwCarousel,
379            _param_spec: glib::ffi::gpointer,
380            f: glib::ffi::gpointer,
381        ) {
382            let f: &F = &*(f as *const F);
383            f(&from_glib_borrow(this))
384        }
385        unsafe {
386            let f: Box_<F> = Box_::new(f);
387            connect_raw(
388                self.as_ptr() as *mut _,
389                c"notify::position".as_ptr() as *const _,
390                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
391                    notify_position_trampoline::<F> as *const (),
392                )),
393                Box_::into_raw(f),
394            )
395        }
396    }
397
398    #[doc(alias = "reveal-duration")]
399    pub fn connect_reveal_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
400        unsafe extern "C" fn notify_reveal_duration_trampoline<F: Fn(&Carousel) + 'static>(
401            this: *mut ffi::AdwCarousel,
402            _param_spec: glib::ffi::gpointer,
403            f: glib::ffi::gpointer,
404        ) {
405            let f: &F = &*(f as *const F);
406            f(&from_glib_borrow(this))
407        }
408        unsafe {
409            let f: Box_<F> = Box_::new(f);
410            connect_raw(
411                self.as_ptr() as *mut _,
412                c"notify::reveal-duration".as_ptr() as *const _,
413                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
414                    notify_reveal_duration_trampoline::<F> as *const (),
415                )),
416                Box_::into_raw(f),
417            )
418        }
419    }
420
421    #[doc(alias = "scroll-params")]
422    pub fn connect_scroll_params_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
423        unsafe extern "C" fn notify_scroll_params_trampoline<F: Fn(&Carousel) + 'static>(
424            this: *mut ffi::AdwCarousel,
425            _param_spec: glib::ffi::gpointer,
426            f: glib::ffi::gpointer,
427        ) {
428            let f: &F = &*(f as *const F);
429            f(&from_glib_borrow(this))
430        }
431        unsafe {
432            let f: Box_<F> = Box_::new(f);
433            connect_raw(
434                self.as_ptr() as *mut _,
435                c"notify::scroll-params".as_ptr() as *const _,
436                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
437                    notify_scroll_params_trampoline::<F> as *const (),
438                )),
439                Box_::into_raw(f),
440            )
441        }
442    }
443
444    #[doc(alias = "spacing")]
445    pub fn connect_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
446        unsafe extern "C" fn notify_spacing_trampoline<F: Fn(&Carousel) + 'static>(
447            this: *mut ffi::AdwCarousel,
448            _param_spec: glib::ffi::gpointer,
449            f: glib::ffi::gpointer,
450        ) {
451            let f: &F = &*(f as *const F);
452            f(&from_glib_borrow(this))
453        }
454        unsafe {
455            let f: Box_<F> = Box_::new(f);
456            connect_raw(
457                self.as_ptr() as *mut _,
458                c"notify::spacing".as_ptr() as *const _,
459                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
460                    notify_spacing_trampoline::<F> as *const (),
461                )),
462                Box_::into_raw(f),
463            )
464        }
465    }
466}
467
468impl Default for Carousel {
469    fn default() -> Self {
470        Self::new()
471    }
472}
473
474// rustdoc-stripper-ignore-next
475/// A [builder-pattern] type to construct [`Carousel`] objects.
476///
477/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
478#[must_use = "The builder must be built to be used"]
479pub struct CarouselBuilder {
480    builder: glib::object::ObjectBuilder<'static, Carousel>,
481}
482
483impl CarouselBuilder {
484    fn new() -> Self {
485        Self {
486            builder: glib::object::Object::builder(),
487        }
488    }
489
490    pub fn allow_long_swipes(self, allow_long_swipes: bool) -> Self {
491        Self {
492            builder: self
493                .builder
494                .property("allow-long-swipes", allow_long_swipes),
495        }
496    }
497
498    pub fn allow_mouse_drag(self, allow_mouse_drag: bool) -> Self {
499        Self {
500            builder: self.builder.property("allow-mouse-drag", allow_mouse_drag),
501        }
502    }
503
504    pub fn allow_scroll_wheel(self, allow_scroll_wheel: bool) -> Self {
505        Self {
506            builder: self
507                .builder
508                .property("allow-scroll-wheel", allow_scroll_wheel),
509        }
510    }
511
512    pub fn interactive(self, interactive: bool) -> Self {
513        Self {
514            builder: self.builder.property("interactive", interactive),
515        }
516    }
517
518    pub fn reveal_duration(self, reveal_duration: u32) -> Self {
519        Self {
520            builder: self.builder.property("reveal-duration", reveal_duration),
521        }
522    }
523
524    pub fn scroll_params(self, scroll_params: &SpringParams) -> Self {
525        Self {
526            builder: self
527                .builder
528                .property("scroll-params", scroll_params.clone()),
529        }
530    }
531
532    pub fn spacing(self, spacing: u32) -> Self {
533        Self {
534            builder: self.builder.property("spacing", spacing),
535        }
536    }
537
538    pub fn can_focus(self, can_focus: bool) -> Self {
539        Self {
540            builder: self.builder.property("can-focus", can_focus),
541        }
542    }
543
544    pub fn can_target(self, can_target: bool) -> Self {
545        Self {
546            builder: self.builder.property("can-target", can_target),
547        }
548    }
549
550    pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
551        Self {
552            builder: self.builder.property("css-classes", css_classes.into()),
553        }
554    }
555
556    pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
557        Self {
558            builder: self.builder.property("css-name", css_name.into()),
559        }
560    }
561
562    pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
563        Self {
564            builder: self.builder.property("cursor", cursor.clone()),
565        }
566    }
567
568    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
569        Self {
570            builder: self.builder.property("focus-on-click", focus_on_click),
571        }
572    }
573
574    pub fn focusable(self, focusable: bool) -> Self {
575        Self {
576            builder: self.builder.property("focusable", focusable),
577        }
578    }
579
580    pub fn halign(self, halign: gtk::Align) -> Self {
581        Self {
582            builder: self.builder.property("halign", halign),
583        }
584    }
585
586    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
587        Self {
588            builder: self.builder.property("has-tooltip", has_tooltip),
589        }
590    }
591
592    pub fn height_request(self, height_request: i32) -> Self {
593        Self {
594            builder: self.builder.property("height-request", height_request),
595        }
596    }
597
598    pub fn hexpand(self, hexpand: bool) -> Self {
599        Self {
600            builder: self.builder.property("hexpand", hexpand),
601        }
602    }
603
604    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
605        Self {
606            builder: self.builder.property("hexpand-set", hexpand_set),
607        }
608    }
609
610    pub fn layout_manager(self, layout_manager: &impl IsA<gtk::LayoutManager>) -> Self {
611        Self {
612            builder: self
613                .builder
614                .property("layout-manager", layout_manager.clone().upcast()),
615        }
616    }
617
618    #[cfg(feature = "gtk_v4_18")]
619    #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_18")))]
620    pub fn limit_events(self, limit_events: bool) -> Self {
621        Self {
622            builder: self.builder.property("limit-events", limit_events),
623        }
624    }
625
626    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
627        Self {
628            builder: self.builder.property("margin-bottom", margin_bottom),
629        }
630    }
631
632    pub fn margin_end(self, margin_end: i32) -> Self {
633        Self {
634            builder: self.builder.property("margin-end", margin_end),
635        }
636    }
637
638    pub fn margin_start(self, margin_start: i32) -> Self {
639        Self {
640            builder: self.builder.property("margin-start", margin_start),
641        }
642    }
643
644    pub fn margin_top(self, margin_top: i32) -> Self {
645        Self {
646            builder: self.builder.property("margin-top", margin_top),
647        }
648    }
649
650    pub fn name(self, name: impl Into<glib::GString>) -> Self {
651        Self {
652            builder: self.builder.property("name", name.into()),
653        }
654    }
655
656    pub fn opacity(self, opacity: f64) -> Self {
657        Self {
658            builder: self.builder.property("opacity", opacity),
659        }
660    }
661
662    pub fn overflow(self, overflow: gtk::Overflow) -> Self {
663        Self {
664            builder: self.builder.property("overflow", overflow),
665        }
666    }
667
668    pub fn receives_default(self, receives_default: bool) -> Self {
669        Self {
670            builder: self.builder.property("receives-default", receives_default),
671        }
672    }
673
674    pub fn sensitive(self, sensitive: bool) -> Self {
675        Self {
676            builder: self.builder.property("sensitive", sensitive),
677        }
678    }
679
680    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
681        Self {
682            builder: self
683                .builder
684                .property("tooltip-markup", tooltip_markup.into()),
685        }
686    }
687
688    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
689        Self {
690            builder: self.builder.property("tooltip-text", tooltip_text.into()),
691        }
692    }
693
694    pub fn valign(self, valign: gtk::Align) -> Self {
695        Self {
696            builder: self.builder.property("valign", valign),
697        }
698    }
699
700    pub fn vexpand(self, vexpand: bool) -> Self {
701        Self {
702            builder: self.builder.property("vexpand", vexpand),
703        }
704    }
705
706    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
707        Self {
708            builder: self.builder.property("vexpand-set", vexpand_set),
709        }
710    }
711
712    pub fn visible(self, visible: bool) -> Self {
713        Self {
714            builder: self.builder.property("visible", visible),
715        }
716    }
717
718    pub fn width_request(self, width_request: i32) -> Self {
719        Self {
720            builder: self.builder.property("width-request", width_request),
721        }
722    }
723
724    pub fn accessible_role(self, accessible_role: gtk::AccessibleRole) -> Self {
725        Self {
726            builder: self.builder.property("accessible-role", accessible_role),
727        }
728    }
729
730    pub fn orientation(self, orientation: gtk::Orientation) -> Self {
731        Self {
732            builder: self.builder.property("orientation", orientation),
733        }
734    }
735
736    // rustdoc-stripper-ignore-next
737    /// Build the [`Carousel`].
738    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
739    pub fn build(self) -> Carousel {
740        assert_initialized_main_thread!();
741        self.builder.build()
742    }
743}