gtk/auto/
stack.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use gdk;
6use glib::object::Cast;
7use glib::object::IsA;
8use glib::signal::connect_raw;
9use glib::signal::SignalHandlerId;
10use glib::translate::*;
11use glib::GString;
12use glib::StaticType;
13use glib::ToValue;
14use glib::Value;
15use glib_sys;
16use gobject_sys;
17use gtk_sys;
18use std::boxed::Box as Box_;
19use std::fmt;
20use std::mem::transmute;
21use Align;
22use Buildable;
23use Container;
24use ResizeMode;
25use StackTransitionType;
26use Widget;
27
28glib_wrapper! {
29    pub struct Stack(Object<gtk_sys::GtkStack, gtk_sys::GtkStackClass, StackClass>) @extends Container, Widget, @implements Buildable;
30
31    match fn {
32        get_type => || gtk_sys::gtk_stack_get_type(),
33    }
34}
35
36impl Stack {
37    pub fn new() -> Stack {
38        assert_initialized_main_thread!();
39        unsafe { Widget::from_glib_none(gtk_sys::gtk_stack_new()).unsafe_cast() }
40    }
41}
42
43impl Default for Stack {
44    fn default() -> Self {
45        Self::new()
46    }
47}
48
49pub struct StackBuilder {
50    #[cfg(any(feature = "v3_16", feature = "dox"))]
51    hhomogeneous: Option<bool>,
52    homogeneous: Option<bool>,
53    interpolate_size: Option<bool>,
54    transition_duration: Option<u32>,
55    transition_type: Option<StackTransitionType>,
56    #[cfg(any(feature = "v3_16", feature = "dox"))]
57    vhomogeneous: Option<bool>,
58    visible_child: Option<Widget>,
59    visible_child_name: Option<String>,
60    border_width: Option<u32>,
61    child: Option<Widget>,
62    resize_mode: Option<ResizeMode>,
63    app_paintable: Option<bool>,
64    can_default: Option<bool>,
65    can_focus: Option<bool>,
66    events: Option<gdk::EventMask>,
67    expand: Option<bool>,
68    #[cfg(any(feature = "v3_20", feature = "dox"))]
69    focus_on_click: Option<bool>,
70    halign: Option<Align>,
71    has_default: Option<bool>,
72    has_focus: Option<bool>,
73    has_tooltip: Option<bool>,
74    height_request: Option<i32>,
75    hexpand: Option<bool>,
76    hexpand_set: Option<bool>,
77    is_focus: Option<bool>,
78    margin: Option<i32>,
79    margin_bottom: Option<i32>,
80    margin_end: Option<i32>,
81    margin_start: Option<i32>,
82    margin_top: Option<i32>,
83    name: Option<String>,
84    no_show_all: Option<bool>,
85    opacity: Option<f64>,
86    parent: Option<Container>,
87    receives_default: Option<bool>,
88    sensitive: Option<bool>,
89    //style: /*Unknown type*/,
90    tooltip_markup: Option<String>,
91    tooltip_text: Option<String>,
92    valign: Option<Align>,
93    vexpand: Option<bool>,
94    vexpand_set: Option<bool>,
95    visible: Option<bool>,
96    width_request: Option<i32>,
97}
98
99impl StackBuilder {
100    pub fn new() -> Self {
101        Self {
102            #[cfg(any(feature = "v3_16", feature = "dox"))]
103            hhomogeneous: None,
104            homogeneous: None,
105            interpolate_size: None,
106            transition_duration: None,
107            transition_type: None,
108            #[cfg(any(feature = "v3_16", feature = "dox"))]
109            vhomogeneous: None,
110            visible_child: None,
111            visible_child_name: None,
112            border_width: None,
113            child: None,
114            resize_mode: None,
115            app_paintable: None,
116            can_default: None,
117            can_focus: None,
118            events: None,
119            expand: None,
120            #[cfg(any(feature = "v3_20", feature = "dox"))]
121            focus_on_click: None,
122            halign: None,
123            has_default: None,
124            has_focus: None,
125            has_tooltip: None,
126            height_request: None,
127            hexpand: None,
128            hexpand_set: None,
129            is_focus: None,
130            margin: None,
131            margin_bottom: None,
132            margin_end: None,
133            margin_start: None,
134            margin_top: None,
135            name: None,
136            no_show_all: None,
137            opacity: None,
138            parent: None,
139            receives_default: None,
140            sensitive: None,
141            tooltip_markup: None,
142            tooltip_text: None,
143            valign: None,
144            vexpand: None,
145            vexpand_set: None,
146            visible: None,
147            width_request: None,
148        }
149    }
150
151    pub fn build(self) -> Stack {
152        let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
153        #[cfg(any(feature = "v3_16", feature = "dox"))]
154        {
155            if let Some(ref hhomogeneous) = self.hhomogeneous {
156                properties.push(("hhomogeneous", hhomogeneous));
157            }
158        }
159        if let Some(ref homogeneous) = self.homogeneous {
160            properties.push(("homogeneous", homogeneous));
161        }
162        if let Some(ref interpolate_size) = self.interpolate_size {
163            properties.push(("interpolate-size", interpolate_size));
164        }
165        if let Some(ref transition_duration) = self.transition_duration {
166            properties.push(("transition-duration", transition_duration));
167        }
168        if let Some(ref transition_type) = self.transition_type {
169            properties.push(("transition-type", transition_type));
170        }
171        #[cfg(any(feature = "v3_16", feature = "dox"))]
172        {
173            if let Some(ref vhomogeneous) = self.vhomogeneous {
174                properties.push(("vhomogeneous", vhomogeneous));
175            }
176        }
177        if let Some(ref visible_child) = self.visible_child {
178            properties.push(("visible-child", visible_child));
179        }
180        if let Some(ref visible_child_name) = self.visible_child_name {
181            properties.push(("visible-child-name", visible_child_name));
182        }
183        if let Some(ref border_width) = self.border_width {
184            properties.push(("border-width", border_width));
185        }
186        if let Some(ref child) = self.child {
187            properties.push(("child", child));
188        }
189        if let Some(ref resize_mode) = self.resize_mode {
190            properties.push(("resize-mode", resize_mode));
191        }
192        if let Some(ref app_paintable) = self.app_paintable {
193            properties.push(("app-paintable", app_paintable));
194        }
195        if let Some(ref can_default) = self.can_default {
196            properties.push(("can-default", can_default));
197        }
198        if let Some(ref can_focus) = self.can_focus {
199            properties.push(("can-focus", can_focus));
200        }
201        if let Some(ref events) = self.events {
202            properties.push(("events", events));
203        }
204        if let Some(ref expand) = self.expand {
205            properties.push(("expand", expand));
206        }
207        #[cfg(any(feature = "v3_20", feature = "dox"))]
208        {
209            if let Some(ref focus_on_click) = self.focus_on_click {
210                properties.push(("focus-on-click", focus_on_click));
211            }
212        }
213        if let Some(ref halign) = self.halign {
214            properties.push(("halign", halign));
215        }
216        if let Some(ref has_default) = self.has_default {
217            properties.push(("has-default", has_default));
218        }
219        if let Some(ref has_focus) = self.has_focus {
220            properties.push(("has-focus", has_focus));
221        }
222        if let Some(ref has_tooltip) = self.has_tooltip {
223            properties.push(("has-tooltip", has_tooltip));
224        }
225        if let Some(ref height_request) = self.height_request {
226            properties.push(("height-request", height_request));
227        }
228        if let Some(ref hexpand) = self.hexpand {
229            properties.push(("hexpand", hexpand));
230        }
231        if let Some(ref hexpand_set) = self.hexpand_set {
232            properties.push(("hexpand-set", hexpand_set));
233        }
234        if let Some(ref is_focus) = self.is_focus {
235            properties.push(("is-focus", is_focus));
236        }
237        if let Some(ref margin) = self.margin {
238            properties.push(("margin", margin));
239        }
240        if let Some(ref margin_bottom) = self.margin_bottom {
241            properties.push(("margin-bottom", margin_bottom));
242        }
243        if let Some(ref margin_end) = self.margin_end {
244            properties.push(("margin-end", margin_end));
245        }
246        if let Some(ref margin_start) = self.margin_start {
247            properties.push(("margin-start", margin_start));
248        }
249        if let Some(ref margin_top) = self.margin_top {
250            properties.push(("margin-top", margin_top));
251        }
252        if let Some(ref name) = self.name {
253            properties.push(("name", name));
254        }
255        if let Some(ref no_show_all) = self.no_show_all {
256            properties.push(("no-show-all", no_show_all));
257        }
258        if let Some(ref opacity) = self.opacity {
259            properties.push(("opacity", opacity));
260        }
261        if let Some(ref parent) = self.parent {
262            properties.push(("parent", parent));
263        }
264        if let Some(ref receives_default) = self.receives_default {
265            properties.push(("receives-default", receives_default));
266        }
267        if let Some(ref sensitive) = self.sensitive {
268            properties.push(("sensitive", sensitive));
269        }
270        if let Some(ref tooltip_markup) = self.tooltip_markup {
271            properties.push(("tooltip-markup", tooltip_markup));
272        }
273        if let Some(ref tooltip_text) = self.tooltip_text {
274            properties.push(("tooltip-text", tooltip_text));
275        }
276        if let Some(ref valign) = self.valign {
277            properties.push(("valign", valign));
278        }
279        if let Some(ref vexpand) = self.vexpand {
280            properties.push(("vexpand", vexpand));
281        }
282        if let Some(ref vexpand_set) = self.vexpand_set {
283            properties.push(("vexpand-set", vexpand_set));
284        }
285        if let Some(ref visible) = self.visible {
286            properties.push(("visible", visible));
287        }
288        if let Some(ref width_request) = self.width_request {
289            properties.push(("width-request", width_request));
290        }
291        glib::Object::new(Stack::static_type(), &properties)
292            .expect("object new")
293            .downcast()
294            .expect("downcast")
295    }
296
297    #[cfg(any(feature = "v3_16", feature = "dox"))]
298    pub fn hhomogeneous(mut self, hhomogeneous: bool) -> Self {
299        self.hhomogeneous = Some(hhomogeneous);
300        self
301    }
302
303    pub fn homogeneous(mut self, homogeneous: bool) -> Self {
304        self.homogeneous = Some(homogeneous);
305        self
306    }
307
308    pub fn interpolate_size(mut self, interpolate_size: bool) -> Self {
309        self.interpolate_size = Some(interpolate_size);
310        self
311    }
312
313    pub fn transition_duration(mut self, transition_duration: u32) -> Self {
314        self.transition_duration = Some(transition_duration);
315        self
316    }
317
318    pub fn transition_type(mut self, transition_type: StackTransitionType) -> Self {
319        self.transition_type = Some(transition_type);
320        self
321    }
322
323    #[cfg(any(feature = "v3_16", feature = "dox"))]
324    pub fn vhomogeneous(mut self, vhomogeneous: bool) -> Self {
325        self.vhomogeneous = Some(vhomogeneous);
326        self
327    }
328
329    pub fn visible_child(mut self, visible_child: &Widget) -> Self {
330        self.visible_child = Some(visible_child.clone());
331        self
332    }
333
334    pub fn visible_child_name(mut self, visible_child_name: &str) -> Self {
335        self.visible_child_name = Some(visible_child_name.to_string());
336        self
337    }
338
339    pub fn border_width(mut self, border_width: u32) -> Self {
340        self.border_width = Some(border_width);
341        self
342    }
343
344    pub fn child(mut self, child: &Widget) -> Self {
345        self.child = Some(child.clone());
346        self
347    }
348
349    pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self {
350        self.resize_mode = Some(resize_mode);
351        self
352    }
353
354    pub fn app_paintable(mut self, app_paintable: bool) -> Self {
355        self.app_paintable = Some(app_paintable);
356        self
357    }
358
359    pub fn can_default(mut self, can_default: bool) -> Self {
360        self.can_default = Some(can_default);
361        self
362    }
363
364    pub fn can_focus(mut self, can_focus: bool) -> Self {
365        self.can_focus = Some(can_focus);
366        self
367    }
368
369    pub fn events(mut self, events: gdk::EventMask) -> Self {
370        self.events = Some(events);
371        self
372    }
373
374    pub fn expand(mut self, expand: bool) -> Self {
375        self.expand = Some(expand);
376        self
377    }
378
379    #[cfg(any(feature = "v3_20", feature = "dox"))]
380    pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
381        self.focus_on_click = Some(focus_on_click);
382        self
383    }
384
385    pub fn halign(mut self, halign: Align) -> Self {
386        self.halign = Some(halign);
387        self
388    }
389
390    pub fn has_default(mut self, has_default: bool) -> Self {
391        self.has_default = Some(has_default);
392        self
393    }
394
395    pub fn has_focus(mut self, has_focus: bool) -> Self {
396        self.has_focus = Some(has_focus);
397        self
398    }
399
400    pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
401        self.has_tooltip = Some(has_tooltip);
402        self
403    }
404
405    pub fn height_request(mut self, height_request: i32) -> Self {
406        self.height_request = Some(height_request);
407        self
408    }
409
410    pub fn hexpand(mut self, hexpand: bool) -> Self {
411        self.hexpand = Some(hexpand);
412        self
413    }
414
415    pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
416        self.hexpand_set = Some(hexpand_set);
417        self
418    }
419
420    pub fn is_focus(mut self, is_focus: bool) -> Self {
421        self.is_focus = Some(is_focus);
422        self
423    }
424
425    pub fn margin(mut self, margin: i32) -> Self {
426        self.margin = Some(margin);
427        self
428    }
429
430    pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
431        self.margin_bottom = Some(margin_bottom);
432        self
433    }
434
435    pub fn margin_end(mut self, margin_end: i32) -> Self {
436        self.margin_end = Some(margin_end);
437        self
438    }
439
440    pub fn margin_start(mut self, margin_start: i32) -> Self {
441        self.margin_start = Some(margin_start);
442        self
443    }
444
445    pub fn margin_top(mut self, margin_top: i32) -> Self {
446        self.margin_top = Some(margin_top);
447        self
448    }
449
450    pub fn name(mut self, name: &str) -> Self {
451        self.name = Some(name.to_string());
452        self
453    }
454
455    pub fn no_show_all(mut self, no_show_all: bool) -> Self {
456        self.no_show_all = Some(no_show_all);
457        self
458    }
459
460    pub fn opacity(mut self, opacity: f64) -> Self {
461        self.opacity = Some(opacity);
462        self
463    }
464
465    pub fn parent(mut self, parent: &Container) -> Self {
466        self.parent = Some(parent.clone());
467        self
468    }
469
470    pub fn receives_default(mut self, receives_default: bool) -> Self {
471        self.receives_default = Some(receives_default);
472        self
473    }
474
475    pub fn sensitive(mut self, sensitive: bool) -> Self {
476        self.sensitive = Some(sensitive);
477        self
478    }
479
480    pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
481        self.tooltip_markup = Some(tooltip_markup.to_string());
482        self
483    }
484
485    pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
486        self.tooltip_text = Some(tooltip_text.to_string());
487        self
488    }
489
490    pub fn valign(mut self, valign: Align) -> Self {
491        self.valign = Some(valign);
492        self
493    }
494
495    pub fn vexpand(mut self, vexpand: bool) -> Self {
496        self.vexpand = Some(vexpand);
497        self
498    }
499
500    pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
501        self.vexpand_set = Some(vexpand_set);
502        self
503    }
504
505    pub fn visible(mut self, visible: bool) -> Self {
506        self.visible = Some(visible);
507        self
508    }
509
510    pub fn width_request(mut self, width_request: i32) -> Self {
511        self.width_request = Some(width_request);
512        self
513    }
514}
515
516pub const NONE_STACK: Option<&Stack> = None;
517
518pub trait StackExt: 'static {
519    fn add_named<P: IsA<Widget>>(&self, child: &P, name: &str);
520
521    fn add_titled<P: IsA<Widget>>(&self, child: &P, name: &str, title: &str);
522
523    fn get_child_by_name(&self, name: &str) -> Option<Widget>;
524
525    #[cfg(any(feature = "v3_16", feature = "dox"))]
526    fn get_hhomogeneous(&self) -> bool;
527
528    fn get_homogeneous(&self) -> bool;
529
530    #[cfg(any(feature = "v3_18", feature = "dox"))]
531    fn get_interpolate_size(&self) -> bool;
532
533    fn get_transition_duration(&self) -> u32;
534
535    fn get_transition_running(&self) -> bool;
536
537    fn get_transition_type(&self) -> StackTransitionType;
538
539    #[cfg(any(feature = "v3_16", feature = "dox"))]
540    fn get_vhomogeneous(&self) -> bool;
541
542    fn get_visible_child(&self) -> Option<Widget>;
543
544    fn get_visible_child_name(&self) -> Option<GString>;
545
546    #[cfg(any(feature = "v3_16", feature = "dox"))]
547    fn set_hhomogeneous(&self, hhomogeneous: bool);
548
549    fn set_homogeneous(&self, homogeneous: bool);
550
551    #[cfg(any(feature = "v3_18", feature = "dox"))]
552    fn set_interpolate_size(&self, interpolate_size: bool);
553
554    fn set_transition_duration(&self, duration: u32);
555
556    fn set_transition_type(&self, transition: StackTransitionType);
557
558    #[cfg(any(feature = "v3_16", feature = "dox"))]
559    fn set_vhomogeneous(&self, vhomogeneous: bool);
560
561    fn set_visible_child<P: IsA<Widget>>(&self, child: &P);
562
563    fn set_visible_child_full(&self, name: &str, transition: StackTransitionType);
564
565    fn set_visible_child_name(&self, name: &str);
566
567    fn get_property_interpolate_size(&self) -> bool;
568
569    fn set_property_interpolate_size(&self, interpolate_size: bool);
570
571    fn get_child_icon_name<T: IsA<Widget>>(&self, item: &T) -> Option<GString>;
572
573    fn set_child_icon_name<T: IsA<Widget>>(&self, item: &T, icon_name: Option<&str>);
574
575    fn get_child_name<T: IsA<Widget>>(&self, item: &T) -> Option<GString>;
576
577    fn set_child_name<T: IsA<Widget>>(&self, item: &T, name: Option<&str>);
578
579    fn get_child_needs_attention<T: IsA<Widget>>(&self, item: &T) -> bool;
580
581    fn set_child_needs_attention<T: IsA<Widget>>(&self, item: &T, needs_attention: bool);
582
583    fn get_child_position<T: IsA<Widget>>(&self, item: &T) -> i32;
584
585    fn set_child_position<T: IsA<Widget>>(&self, item: &T, position: i32);
586
587    fn get_child_title<T: IsA<Widget>>(&self, item: &T) -> Option<GString>;
588
589    fn set_child_title<T: IsA<Widget>>(&self, item: &T, title: Option<&str>);
590
591    #[cfg(any(feature = "v3_16", feature = "dox"))]
592    fn connect_property_hhomogeneous_notify<F: Fn(&Self) + 'static>(&self, f: F)
593        -> SignalHandlerId;
594
595    fn connect_property_homogeneous_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
596
597    fn connect_property_interpolate_size_notify<F: Fn(&Self) + 'static>(
598        &self,
599        f: F,
600    ) -> SignalHandlerId;
601
602    fn connect_property_transition_duration_notify<F: Fn(&Self) + 'static>(
603        &self,
604        f: F,
605    ) -> SignalHandlerId;
606
607    fn connect_property_transition_running_notify<F: Fn(&Self) + 'static>(
608        &self,
609        f: F,
610    ) -> SignalHandlerId;
611
612    fn connect_property_transition_type_notify<F: Fn(&Self) + 'static>(
613        &self,
614        f: F,
615    ) -> SignalHandlerId;
616
617    #[cfg(any(feature = "v3_16", feature = "dox"))]
618    fn connect_property_vhomogeneous_notify<F: Fn(&Self) + 'static>(&self, f: F)
619        -> SignalHandlerId;
620
621    fn connect_property_visible_child_notify<F: Fn(&Self) + 'static>(
622        &self,
623        f: F,
624    ) -> SignalHandlerId;
625
626    fn connect_property_visible_child_name_notify<F: Fn(&Self) + 'static>(
627        &self,
628        f: F,
629    ) -> SignalHandlerId;
630}
631
632impl<O: IsA<Stack>> StackExt for O {
633    fn add_named<P: IsA<Widget>>(&self, child: &P, name: &str) {
634        unsafe {
635            gtk_sys::gtk_stack_add_named(
636                self.as_ref().to_glib_none().0,
637                child.as_ref().to_glib_none().0,
638                name.to_glib_none().0,
639            );
640        }
641    }
642
643    fn add_titled<P: IsA<Widget>>(&self, child: &P, name: &str, title: &str) {
644        unsafe {
645            gtk_sys::gtk_stack_add_titled(
646                self.as_ref().to_glib_none().0,
647                child.as_ref().to_glib_none().0,
648                name.to_glib_none().0,
649                title.to_glib_none().0,
650            );
651        }
652    }
653
654    fn get_child_by_name(&self, name: &str) -> Option<Widget> {
655        unsafe {
656            from_glib_none(gtk_sys::gtk_stack_get_child_by_name(
657                self.as_ref().to_glib_none().0,
658                name.to_glib_none().0,
659            ))
660        }
661    }
662
663    #[cfg(any(feature = "v3_16", feature = "dox"))]
664    fn get_hhomogeneous(&self) -> bool {
665        unsafe {
666            from_glib(gtk_sys::gtk_stack_get_hhomogeneous(
667                self.as_ref().to_glib_none().0,
668            ))
669        }
670    }
671
672    fn get_homogeneous(&self) -> bool {
673        unsafe {
674            from_glib(gtk_sys::gtk_stack_get_homogeneous(
675                self.as_ref().to_glib_none().0,
676            ))
677        }
678    }
679
680    #[cfg(any(feature = "v3_18", feature = "dox"))]
681    fn get_interpolate_size(&self) -> bool {
682        unsafe {
683            from_glib(gtk_sys::gtk_stack_get_interpolate_size(
684                self.as_ref().to_glib_none().0,
685            ))
686        }
687    }
688
689    fn get_transition_duration(&self) -> u32 {
690        unsafe { gtk_sys::gtk_stack_get_transition_duration(self.as_ref().to_glib_none().0) }
691    }
692
693    fn get_transition_running(&self) -> bool {
694        unsafe {
695            from_glib(gtk_sys::gtk_stack_get_transition_running(
696                self.as_ref().to_glib_none().0,
697            ))
698        }
699    }
700
701    fn get_transition_type(&self) -> StackTransitionType {
702        unsafe {
703            from_glib(gtk_sys::gtk_stack_get_transition_type(
704                self.as_ref().to_glib_none().0,
705            ))
706        }
707    }
708
709    #[cfg(any(feature = "v3_16", feature = "dox"))]
710    fn get_vhomogeneous(&self) -> bool {
711        unsafe {
712            from_glib(gtk_sys::gtk_stack_get_vhomogeneous(
713                self.as_ref().to_glib_none().0,
714            ))
715        }
716    }
717
718    fn get_visible_child(&self) -> Option<Widget> {
719        unsafe {
720            from_glib_none(gtk_sys::gtk_stack_get_visible_child(
721                self.as_ref().to_glib_none().0,
722            ))
723        }
724    }
725
726    fn get_visible_child_name(&self) -> Option<GString> {
727        unsafe {
728            from_glib_none(gtk_sys::gtk_stack_get_visible_child_name(
729                self.as_ref().to_glib_none().0,
730            ))
731        }
732    }
733
734    #[cfg(any(feature = "v3_16", feature = "dox"))]
735    fn set_hhomogeneous(&self, hhomogeneous: bool) {
736        unsafe {
737            gtk_sys::gtk_stack_set_hhomogeneous(
738                self.as_ref().to_glib_none().0,
739                hhomogeneous.to_glib(),
740            );
741        }
742    }
743
744    fn set_homogeneous(&self, homogeneous: bool) {
745        unsafe {
746            gtk_sys::gtk_stack_set_homogeneous(
747                self.as_ref().to_glib_none().0,
748                homogeneous.to_glib(),
749            );
750        }
751    }
752
753    #[cfg(any(feature = "v3_18", feature = "dox"))]
754    fn set_interpolate_size(&self, interpolate_size: bool) {
755        unsafe {
756            gtk_sys::gtk_stack_set_interpolate_size(
757                self.as_ref().to_glib_none().0,
758                interpolate_size.to_glib(),
759            );
760        }
761    }
762
763    fn set_transition_duration(&self, duration: u32) {
764        unsafe {
765            gtk_sys::gtk_stack_set_transition_duration(self.as_ref().to_glib_none().0, duration);
766        }
767    }
768
769    fn set_transition_type(&self, transition: StackTransitionType) {
770        unsafe {
771            gtk_sys::gtk_stack_set_transition_type(
772                self.as_ref().to_glib_none().0,
773                transition.to_glib(),
774            );
775        }
776    }
777
778    #[cfg(any(feature = "v3_16", feature = "dox"))]
779    fn set_vhomogeneous(&self, vhomogeneous: bool) {
780        unsafe {
781            gtk_sys::gtk_stack_set_vhomogeneous(
782                self.as_ref().to_glib_none().0,
783                vhomogeneous.to_glib(),
784            );
785        }
786    }
787
788    fn set_visible_child<P: IsA<Widget>>(&self, child: &P) {
789        unsafe {
790            gtk_sys::gtk_stack_set_visible_child(
791                self.as_ref().to_glib_none().0,
792                child.as_ref().to_glib_none().0,
793            );
794        }
795    }
796
797    fn set_visible_child_full(&self, name: &str, transition: StackTransitionType) {
798        unsafe {
799            gtk_sys::gtk_stack_set_visible_child_full(
800                self.as_ref().to_glib_none().0,
801                name.to_glib_none().0,
802                transition.to_glib(),
803            );
804        }
805    }
806
807    fn set_visible_child_name(&self, name: &str) {
808        unsafe {
809            gtk_sys::gtk_stack_set_visible_child_name(
810                self.as_ref().to_glib_none().0,
811                name.to_glib_none().0,
812            );
813        }
814    }
815
816    fn get_property_interpolate_size(&self) -> bool {
817        unsafe {
818            let mut value = Value::from_type(<bool as StaticType>::static_type());
819            gobject_sys::g_object_get_property(
820                self.to_glib_none().0 as *mut gobject_sys::GObject,
821                b"interpolate-size\0".as_ptr() as *const _,
822                value.to_glib_none_mut().0,
823            );
824            value.get().unwrap()
825        }
826    }
827
828    fn set_property_interpolate_size(&self, interpolate_size: bool) {
829        unsafe {
830            gobject_sys::g_object_set_property(
831                self.to_glib_none().0 as *mut gobject_sys::GObject,
832                b"interpolate-size\0".as_ptr() as *const _,
833                Value::from(&interpolate_size).to_glib_none().0,
834            );
835        }
836    }
837
838    fn get_child_icon_name<T: IsA<Widget>>(&self, item: &T) -> Option<GString> {
839        unsafe {
840            let mut value = Value::from_type(<GString as StaticType>::static_type());
841            gtk_sys::gtk_container_child_get_property(
842                self.to_glib_none().0 as *mut gtk_sys::GtkContainer,
843                item.to_glib_none().0 as *mut _,
844                b"icon-name\0".as_ptr() as *const _,
845                value.to_glib_none_mut().0,
846            );
847            value.get()
848        }
849    }
850
851    fn set_child_icon_name<T: IsA<Widget>>(&self, item: &T, icon_name: Option<&str>) {
852        unsafe {
853            gtk_sys::gtk_container_child_set_property(
854                self.to_glib_none().0 as *mut gtk_sys::GtkContainer,
855                item.to_glib_none().0 as *mut _,
856                b"icon-name\0".as_ptr() as *const _,
857                Value::from(icon_name).to_glib_none().0,
858            );
859        }
860    }
861
862    fn get_child_name<T: IsA<Widget>>(&self, item: &T) -> Option<GString> {
863        unsafe {
864            let mut value = Value::from_type(<GString as StaticType>::static_type());
865            gtk_sys::gtk_container_child_get_property(
866                self.to_glib_none().0 as *mut gtk_sys::GtkContainer,
867                item.to_glib_none().0 as *mut _,
868                b"name\0".as_ptr() as *const _,
869                value.to_glib_none_mut().0,
870            );
871            value.get()
872        }
873    }
874
875    fn set_child_name<T: IsA<Widget>>(&self, item: &T, name: Option<&str>) {
876        unsafe {
877            gtk_sys::gtk_container_child_set_property(
878                self.to_glib_none().0 as *mut gtk_sys::GtkContainer,
879                item.to_glib_none().0 as *mut _,
880                b"name\0".as_ptr() as *const _,
881                Value::from(name).to_glib_none().0,
882            );
883        }
884    }
885
886    fn get_child_needs_attention<T: IsA<Widget>>(&self, item: &T) -> bool {
887        unsafe {
888            let mut value = Value::from_type(<bool as StaticType>::static_type());
889            gtk_sys::gtk_container_child_get_property(
890                self.to_glib_none().0 as *mut gtk_sys::GtkContainer,
891                item.to_glib_none().0 as *mut _,
892                b"needs-attention\0".as_ptr() as *const _,
893                value.to_glib_none_mut().0,
894            );
895            value.get().unwrap()
896        }
897    }
898
899    fn set_child_needs_attention<T: IsA<Widget>>(&self, item: &T, needs_attention: bool) {
900        unsafe {
901            gtk_sys::gtk_container_child_set_property(
902                self.to_glib_none().0 as *mut gtk_sys::GtkContainer,
903                item.to_glib_none().0 as *mut _,
904                b"needs-attention\0".as_ptr() as *const _,
905                Value::from(&needs_attention).to_glib_none().0,
906            );
907        }
908    }
909
910    fn get_child_position<T: IsA<Widget>>(&self, item: &T) -> i32 {
911        unsafe {
912            let mut value = Value::from_type(<i32 as StaticType>::static_type());
913            gtk_sys::gtk_container_child_get_property(
914                self.to_glib_none().0 as *mut gtk_sys::GtkContainer,
915                item.to_glib_none().0 as *mut _,
916                b"position\0".as_ptr() as *const _,
917                value.to_glib_none_mut().0,
918            );
919            value.get().unwrap()
920        }
921    }
922
923    fn set_child_position<T: IsA<Widget>>(&self, item: &T, position: i32) {
924        unsafe {
925            gtk_sys::gtk_container_child_set_property(
926                self.to_glib_none().0 as *mut gtk_sys::GtkContainer,
927                item.to_glib_none().0 as *mut _,
928                b"position\0".as_ptr() as *const _,
929                Value::from(&position).to_glib_none().0,
930            );
931        }
932    }
933
934    fn get_child_title<T: IsA<Widget>>(&self, item: &T) -> Option<GString> {
935        unsafe {
936            let mut value = Value::from_type(<GString as StaticType>::static_type());
937            gtk_sys::gtk_container_child_get_property(
938                self.to_glib_none().0 as *mut gtk_sys::GtkContainer,
939                item.to_glib_none().0 as *mut _,
940                b"title\0".as_ptr() as *const _,
941                value.to_glib_none_mut().0,
942            );
943            value.get()
944        }
945    }
946
947    fn set_child_title<T: IsA<Widget>>(&self, item: &T, title: Option<&str>) {
948        unsafe {
949            gtk_sys::gtk_container_child_set_property(
950                self.to_glib_none().0 as *mut gtk_sys::GtkContainer,
951                item.to_glib_none().0 as *mut _,
952                b"title\0".as_ptr() as *const _,
953                Value::from(title).to_glib_none().0,
954            );
955        }
956    }
957
958    #[cfg(any(feature = "v3_16", feature = "dox"))]
959    fn connect_property_hhomogeneous_notify<F: Fn(&Self) + 'static>(
960        &self,
961        f: F,
962    ) -> SignalHandlerId {
963        unsafe extern "C" fn notify_hhomogeneous_trampoline<P, F: Fn(&P) + 'static>(
964            this: *mut gtk_sys::GtkStack,
965            _param_spec: glib_sys::gpointer,
966            f: glib_sys::gpointer,
967        ) where
968            P: IsA<Stack>,
969        {
970            let f: &F = &*(f as *const F);
971            f(&Stack::from_glib_borrow(this).unsafe_cast())
972        }
973        unsafe {
974            let f: Box_<F> = Box_::new(f);
975            connect_raw(
976                self.as_ptr() as *mut _,
977                b"notify::hhomogeneous\0".as_ptr() as *const _,
978                Some(transmute(
979                    notify_hhomogeneous_trampoline::<Self, F> as usize,
980                )),
981                Box_::into_raw(f),
982            )
983        }
984    }
985
986    fn connect_property_homogeneous_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
987        unsafe extern "C" fn notify_homogeneous_trampoline<P, F: Fn(&P) + 'static>(
988            this: *mut gtk_sys::GtkStack,
989            _param_spec: glib_sys::gpointer,
990            f: glib_sys::gpointer,
991        ) where
992            P: IsA<Stack>,
993        {
994            let f: &F = &*(f as *const F);
995            f(&Stack::from_glib_borrow(this).unsafe_cast())
996        }
997        unsafe {
998            let f: Box_<F> = Box_::new(f);
999            connect_raw(
1000                self.as_ptr() as *mut _,
1001                b"notify::homogeneous\0".as_ptr() as *const _,
1002                Some(transmute(notify_homogeneous_trampoline::<Self, F> as usize)),
1003                Box_::into_raw(f),
1004            )
1005        }
1006    }
1007
1008    fn connect_property_interpolate_size_notify<F: Fn(&Self) + 'static>(
1009        &self,
1010        f: F,
1011    ) -> SignalHandlerId {
1012        unsafe extern "C" fn notify_interpolate_size_trampoline<P, F: Fn(&P) + 'static>(
1013            this: *mut gtk_sys::GtkStack,
1014            _param_spec: glib_sys::gpointer,
1015            f: glib_sys::gpointer,
1016        ) where
1017            P: IsA<Stack>,
1018        {
1019            let f: &F = &*(f as *const F);
1020            f(&Stack::from_glib_borrow(this).unsafe_cast())
1021        }
1022        unsafe {
1023            let f: Box_<F> = Box_::new(f);
1024            connect_raw(
1025                self.as_ptr() as *mut _,
1026                b"notify::interpolate-size\0".as_ptr() as *const _,
1027                Some(transmute(
1028                    notify_interpolate_size_trampoline::<Self, F> as usize,
1029                )),
1030                Box_::into_raw(f),
1031            )
1032        }
1033    }
1034
1035    fn connect_property_transition_duration_notify<F: Fn(&Self) + 'static>(
1036        &self,
1037        f: F,
1038    ) -> SignalHandlerId {
1039        unsafe extern "C" fn notify_transition_duration_trampoline<P, F: Fn(&P) + 'static>(
1040            this: *mut gtk_sys::GtkStack,
1041            _param_spec: glib_sys::gpointer,
1042            f: glib_sys::gpointer,
1043        ) where
1044            P: IsA<Stack>,
1045        {
1046            let f: &F = &*(f as *const F);
1047            f(&Stack::from_glib_borrow(this).unsafe_cast())
1048        }
1049        unsafe {
1050            let f: Box_<F> = Box_::new(f);
1051            connect_raw(
1052                self.as_ptr() as *mut _,
1053                b"notify::transition-duration\0".as_ptr() as *const _,
1054                Some(transmute(
1055                    notify_transition_duration_trampoline::<Self, F> as usize,
1056                )),
1057                Box_::into_raw(f),
1058            )
1059        }
1060    }
1061
1062    fn connect_property_transition_running_notify<F: Fn(&Self) + 'static>(
1063        &self,
1064        f: F,
1065    ) -> SignalHandlerId {
1066        unsafe extern "C" fn notify_transition_running_trampoline<P, F: Fn(&P) + 'static>(
1067            this: *mut gtk_sys::GtkStack,
1068            _param_spec: glib_sys::gpointer,
1069            f: glib_sys::gpointer,
1070        ) where
1071            P: IsA<Stack>,
1072        {
1073            let f: &F = &*(f as *const F);
1074            f(&Stack::from_glib_borrow(this).unsafe_cast())
1075        }
1076        unsafe {
1077            let f: Box_<F> = Box_::new(f);
1078            connect_raw(
1079                self.as_ptr() as *mut _,
1080                b"notify::transition-running\0".as_ptr() as *const _,
1081                Some(transmute(
1082                    notify_transition_running_trampoline::<Self, F> as usize,
1083                )),
1084                Box_::into_raw(f),
1085            )
1086        }
1087    }
1088
1089    fn connect_property_transition_type_notify<F: Fn(&Self) + 'static>(
1090        &self,
1091        f: F,
1092    ) -> SignalHandlerId {
1093        unsafe extern "C" fn notify_transition_type_trampoline<P, F: Fn(&P) + 'static>(
1094            this: *mut gtk_sys::GtkStack,
1095            _param_spec: glib_sys::gpointer,
1096            f: glib_sys::gpointer,
1097        ) where
1098            P: IsA<Stack>,
1099        {
1100            let f: &F = &*(f as *const F);
1101            f(&Stack::from_glib_borrow(this).unsafe_cast())
1102        }
1103        unsafe {
1104            let f: Box_<F> = Box_::new(f);
1105            connect_raw(
1106                self.as_ptr() as *mut _,
1107                b"notify::transition-type\0".as_ptr() as *const _,
1108                Some(transmute(
1109                    notify_transition_type_trampoline::<Self, F> as usize,
1110                )),
1111                Box_::into_raw(f),
1112            )
1113        }
1114    }
1115
1116    #[cfg(any(feature = "v3_16", feature = "dox"))]
1117    fn connect_property_vhomogeneous_notify<F: Fn(&Self) + 'static>(
1118        &self,
1119        f: F,
1120    ) -> SignalHandlerId {
1121        unsafe extern "C" fn notify_vhomogeneous_trampoline<P, F: Fn(&P) + 'static>(
1122            this: *mut gtk_sys::GtkStack,
1123            _param_spec: glib_sys::gpointer,
1124            f: glib_sys::gpointer,
1125        ) where
1126            P: IsA<Stack>,
1127        {
1128            let f: &F = &*(f as *const F);
1129            f(&Stack::from_glib_borrow(this).unsafe_cast())
1130        }
1131        unsafe {
1132            let f: Box_<F> = Box_::new(f);
1133            connect_raw(
1134                self.as_ptr() as *mut _,
1135                b"notify::vhomogeneous\0".as_ptr() as *const _,
1136                Some(transmute(
1137                    notify_vhomogeneous_trampoline::<Self, F> as usize,
1138                )),
1139                Box_::into_raw(f),
1140            )
1141        }
1142    }
1143
1144    fn connect_property_visible_child_notify<F: Fn(&Self) + 'static>(
1145        &self,
1146        f: F,
1147    ) -> SignalHandlerId {
1148        unsafe extern "C" fn notify_visible_child_trampoline<P, F: Fn(&P) + 'static>(
1149            this: *mut gtk_sys::GtkStack,
1150            _param_spec: glib_sys::gpointer,
1151            f: glib_sys::gpointer,
1152        ) where
1153            P: IsA<Stack>,
1154        {
1155            let f: &F = &*(f as *const F);
1156            f(&Stack::from_glib_borrow(this).unsafe_cast())
1157        }
1158        unsafe {
1159            let f: Box_<F> = Box_::new(f);
1160            connect_raw(
1161                self.as_ptr() as *mut _,
1162                b"notify::visible-child\0".as_ptr() as *const _,
1163                Some(transmute(
1164                    notify_visible_child_trampoline::<Self, F> as usize,
1165                )),
1166                Box_::into_raw(f),
1167            )
1168        }
1169    }
1170
1171    fn connect_property_visible_child_name_notify<F: Fn(&Self) + 'static>(
1172        &self,
1173        f: F,
1174    ) -> SignalHandlerId {
1175        unsafe extern "C" fn notify_visible_child_name_trampoline<P, F: Fn(&P) + 'static>(
1176            this: *mut gtk_sys::GtkStack,
1177            _param_spec: glib_sys::gpointer,
1178            f: glib_sys::gpointer,
1179        ) where
1180            P: IsA<Stack>,
1181        {
1182            let f: &F = &*(f as *const F);
1183            f(&Stack::from_glib_borrow(this).unsafe_cast())
1184        }
1185        unsafe {
1186            let f: Box_<F> = Box_::new(f);
1187            connect_raw(
1188                self.as_ptr() as *mut _,
1189                b"notify::visible-child-name\0".as_ptr() as *const _,
1190                Some(transmute(
1191                    notify_visible_child_name_trampoline::<Self, F> as usize,
1192                )),
1193                Box_::into_raw(f),
1194            )
1195        }
1196    }
1197}
1198
1199impl fmt::Display for Stack {
1200    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1201        write!(f, "Stack")
1202    }
1203}