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 
6 use crate::DeckTransitionType;
7 use crate::NavigationDirection;
8 use crate::Swipeable;
9 use glib::object::Cast;
10 use glib::object::IsA;
11 use glib::signal::connect_raw;
12 use glib::signal::SignalHandlerId;
13 use glib::translate::*;
14 use glib::StaticType;
15 use glib::ToValue;
16 use std::boxed::Box as Box_;
17 use std::fmt;
18 use std::mem::transmute;
19 
20 glib::wrapper! {
21     #[doc(alias = "HdyDeck")]
22     pub struct Deck(Object<ffi::HdyDeck, ffi::HdyDeckClass>) @extends gtk::Container, gtk::Widget, @implements gtk::Buildable, gtk::Orientable, Swipeable;
23 
24     match fn {
25         type_ => || ffi::hdy_deck_get_type(),
26     }
27 }
28 
29 impl Deck {
30     #[doc(alias = "hdy_deck_new")]
new() -> Deck31     pub fn new() -> Deck {
32         assert_initialized_main_thread!();
33         unsafe { gtk::Widget::from_glib_none(ffi::hdy_deck_new()).unsafe_cast() }
34     }
35 
36     // rustdoc-stripper-ignore-next
37     /// Creates a new builder-pattern struct instance to construct [`Deck`] objects.
38     ///
39     /// This method returns an instance of [`DeckBuilder`] which can be used to create [`Deck`] objects.
builder() -> DeckBuilder40     pub fn builder() -> DeckBuilder {
41         DeckBuilder::default()
42     }
43 }
44 
45 impl Default for Deck {
default() -> Self46     fn default() -> Self {
47         Self::new()
48     }
49 }
50 
51 #[derive(Clone, Default)]
52 // rustdoc-stripper-ignore-next
53 /// A [builder-pattern] type to construct [`Deck`] objects.
54 ///
55 /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
56 pub struct DeckBuilder {
57     can_swipe_back: Option<bool>,
58     can_swipe_forward: Option<bool>,
59     hhomogeneous: Option<bool>,
60     interpolate_size: Option<bool>,
61     transition_duration: Option<u32>,
62     transition_type: Option<DeckTransitionType>,
63     vhomogeneous: Option<bool>,
64     visible_child: Option<gtk::Widget>,
65     visible_child_name: Option<String>,
66     border_width: Option<u32>,
67     child: Option<gtk::Widget>,
68     resize_mode: Option<gtk::ResizeMode>,
69     app_paintable: Option<bool>,
70     can_default: Option<bool>,
71     can_focus: Option<bool>,
72     double_buffered: Option<bool>,
73     events: Option<gdk::EventMask>,
74     expand: Option<bool>,
75     focus_on_click: Option<bool>,
76     halign: Option<gtk::Align>,
77     has_default: Option<bool>,
78     has_focus: Option<bool>,
79     has_tooltip: Option<bool>,
80     height_request: Option<i32>,
81     hexpand: Option<bool>,
82     hexpand_set: Option<bool>,
83     is_focus: Option<bool>,
84     margin: Option<i32>,
85     margin_bottom: Option<i32>,
86     margin_end: Option<i32>,
87     margin_left: Option<i32>,
88     margin_right: Option<i32>,
89     margin_start: Option<i32>,
90     margin_top: Option<i32>,
91     name: Option<String>,
92     no_show_all: Option<bool>,
93     opacity: Option<f64>,
94     parent: Option<gtk::Container>,
95     receives_default: Option<bool>,
96     sensitive: Option<bool>,
97     //style: /*Unknown type*/,
98     tooltip_markup: Option<String>,
99     tooltip_text: Option<String>,
100     valign: Option<gtk::Align>,
101     vexpand: Option<bool>,
102     vexpand_set: Option<bool>,
103     visible: Option<bool>,
104     width_request: Option<i32>,
105     orientation: Option<gtk::Orientation>,
106 }
107 
108 impl DeckBuilder {
109     // rustdoc-stripper-ignore-next
110     /// Create a new [`DeckBuilder`].
new() -> Self111     pub fn new() -> Self {
112         Self::default()
113     }
114 
115     // rustdoc-stripper-ignore-next
116     /// Build the [`Deck`].
build(self) -> Deck117     pub fn build(self) -> Deck {
118         let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
119         if let Some(ref can_swipe_back) = self.can_swipe_back {
120             properties.push(("can-swipe-back", can_swipe_back));
121         }
122         if let Some(ref can_swipe_forward) = self.can_swipe_forward {
123             properties.push(("can-swipe-forward", can_swipe_forward));
124         }
125         if let Some(ref hhomogeneous) = self.hhomogeneous {
126             properties.push(("hhomogeneous", hhomogeneous));
127         }
128         if let Some(ref interpolate_size) = self.interpolate_size {
129             properties.push(("interpolate-size", interpolate_size));
130         }
131         if let Some(ref transition_duration) = self.transition_duration {
132             properties.push(("transition-duration", transition_duration));
133         }
134         if let Some(ref transition_type) = self.transition_type {
135             properties.push(("transition-type", transition_type));
136         }
137         if let Some(ref vhomogeneous) = self.vhomogeneous {
138             properties.push(("vhomogeneous", vhomogeneous));
139         }
140         if let Some(ref visible_child) = self.visible_child {
141             properties.push(("visible-child", visible_child));
142         }
143         if let Some(ref visible_child_name) = self.visible_child_name {
144             properties.push(("visible-child-name", visible_child_name));
145         }
146         if let Some(ref border_width) = self.border_width {
147             properties.push(("border-width", border_width));
148         }
149         if let Some(ref child) = self.child {
150             properties.push(("child", child));
151         }
152         if let Some(ref resize_mode) = self.resize_mode {
153             properties.push(("resize-mode", resize_mode));
154         }
155         if let Some(ref app_paintable) = self.app_paintable {
156             properties.push(("app-paintable", app_paintable));
157         }
158         if let Some(ref can_default) = self.can_default {
159             properties.push(("can-default", can_default));
160         }
161         if let Some(ref can_focus) = self.can_focus {
162             properties.push(("can-focus", can_focus));
163         }
164         if let Some(ref double_buffered) = self.double_buffered {
165             properties.push(("double-buffered", double_buffered));
166         }
167         if let Some(ref events) = self.events {
168             properties.push(("events", events));
169         }
170         if let Some(ref expand) = self.expand {
171             properties.push(("expand", expand));
172         }
173         if let Some(ref focus_on_click) = self.focus_on_click {
174             properties.push(("focus-on-click", focus_on_click));
175         }
176         if let Some(ref halign) = self.halign {
177             properties.push(("halign", halign));
178         }
179         if let Some(ref has_default) = self.has_default {
180             properties.push(("has-default", has_default));
181         }
182         if let Some(ref has_focus) = self.has_focus {
183             properties.push(("has-focus", has_focus));
184         }
185         if let Some(ref has_tooltip) = self.has_tooltip {
186             properties.push(("has-tooltip", has_tooltip));
187         }
188         if let Some(ref height_request) = self.height_request {
189             properties.push(("height-request", height_request));
190         }
191         if let Some(ref hexpand) = self.hexpand {
192             properties.push(("hexpand", hexpand));
193         }
194         if let Some(ref hexpand_set) = self.hexpand_set {
195             properties.push(("hexpand-set", hexpand_set));
196         }
197         if let Some(ref is_focus) = self.is_focus {
198             properties.push(("is-focus", is_focus));
199         }
200         if let Some(ref margin) = self.margin {
201             properties.push(("margin", margin));
202         }
203         if let Some(ref margin_bottom) = self.margin_bottom {
204             properties.push(("margin-bottom", margin_bottom));
205         }
206         if let Some(ref margin_end) = self.margin_end {
207             properties.push(("margin-end", margin_end));
208         }
209         if let Some(ref margin_left) = self.margin_left {
210             properties.push(("margin-left", margin_left));
211         }
212         if let Some(ref margin_right) = self.margin_right {
213             properties.push(("margin-right", margin_right));
214         }
215         if let Some(ref margin_start) = self.margin_start {
216             properties.push(("margin-start", margin_start));
217         }
218         if let Some(ref margin_top) = self.margin_top {
219             properties.push(("margin-top", margin_top));
220         }
221         if let Some(ref name) = self.name {
222             properties.push(("name", name));
223         }
224         if let Some(ref no_show_all) = self.no_show_all {
225             properties.push(("no-show-all", no_show_all));
226         }
227         if let Some(ref opacity) = self.opacity {
228             properties.push(("opacity", opacity));
229         }
230         if let Some(ref parent) = self.parent {
231             properties.push(("parent", parent));
232         }
233         if let Some(ref receives_default) = self.receives_default {
234             properties.push(("receives-default", receives_default));
235         }
236         if let Some(ref sensitive) = self.sensitive {
237             properties.push(("sensitive", sensitive));
238         }
239         if let Some(ref tooltip_markup) = self.tooltip_markup {
240             properties.push(("tooltip-markup", tooltip_markup));
241         }
242         if let Some(ref tooltip_text) = self.tooltip_text {
243             properties.push(("tooltip-text", tooltip_text));
244         }
245         if let Some(ref valign) = self.valign {
246             properties.push(("valign", valign));
247         }
248         if let Some(ref vexpand) = self.vexpand {
249             properties.push(("vexpand", vexpand));
250         }
251         if let Some(ref vexpand_set) = self.vexpand_set {
252             properties.push(("vexpand-set", vexpand_set));
253         }
254         if let Some(ref visible) = self.visible {
255             properties.push(("visible", visible));
256         }
257         if let Some(ref width_request) = self.width_request {
258             properties.push(("width-request", width_request));
259         }
260         if let Some(ref orientation) = self.orientation {
261             properties.push(("orientation", orientation));
262         }
263         glib::Object::new::<Deck>(&properties).expect("Failed to create an instance of Deck")
264     }
265 
can_swipe_back(mut self, can_swipe_back: bool) -> Self266     pub fn can_swipe_back(mut self, can_swipe_back: bool) -> Self {
267         self.can_swipe_back = Some(can_swipe_back);
268         self
269     }
270 
can_swipe_forward(mut self, can_swipe_forward: bool) -> Self271     pub fn can_swipe_forward(mut self, can_swipe_forward: bool) -> Self {
272         self.can_swipe_forward = Some(can_swipe_forward);
273         self
274     }
275 
hhomogeneous(mut self, hhomogeneous: bool) -> Self276     pub fn hhomogeneous(mut self, hhomogeneous: bool) -> Self {
277         self.hhomogeneous = Some(hhomogeneous);
278         self
279     }
280 
interpolate_size(mut self, interpolate_size: bool) -> Self281     pub fn interpolate_size(mut self, interpolate_size: bool) -> Self {
282         self.interpolate_size = Some(interpolate_size);
283         self
284     }
285 
transition_duration(mut self, transition_duration: u32) -> Self286     pub fn transition_duration(mut self, transition_duration: u32) -> Self {
287         self.transition_duration = Some(transition_duration);
288         self
289     }
290 
transition_type(mut self, transition_type: DeckTransitionType) -> Self291     pub fn transition_type(mut self, transition_type: DeckTransitionType) -> Self {
292         self.transition_type = Some(transition_type);
293         self
294     }
295 
vhomogeneous(mut self, vhomogeneous: bool) -> Self296     pub fn vhomogeneous(mut self, vhomogeneous: bool) -> Self {
297         self.vhomogeneous = Some(vhomogeneous);
298         self
299     }
300 
visible_child<P: IsA<gtk::Widget>>(mut self, visible_child: &P) -> Self301     pub fn visible_child<P: IsA<gtk::Widget>>(mut self, visible_child: &P) -> Self {
302         self.visible_child = Some(visible_child.clone().upcast());
303         self
304     }
305 
visible_child_name(mut self, visible_child_name: &str) -> Self306     pub fn visible_child_name(mut self, visible_child_name: &str) -> Self {
307         self.visible_child_name = Some(visible_child_name.to_string());
308         self
309     }
310 
border_width(mut self, border_width: u32) -> Self311     pub fn border_width(mut self, border_width: u32) -> Self {
312         self.border_width = Some(border_width);
313         self
314     }
315 
child<P: IsA<gtk::Widget>>(mut self, child: &P) -> Self316     pub fn child<P: IsA<gtk::Widget>>(mut self, child: &P) -> Self {
317         self.child = Some(child.clone().upcast());
318         self
319     }
320 
resize_mode(mut self, resize_mode: gtk::ResizeMode) -> Self321     pub fn resize_mode(mut self, resize_mode: gtk::ResizeMode) -> Self {
322         self.resize_mode = Some(resize_mode);
323         self
324     }
325 
app_paintable(mut self, app_paintable: bool) -> Self326     pub fn app_paintable(mut self, app_paintable: bool) -> Self {
327         self.app_paintable = Some(app_paintable);
328         self
329     }
330 
can_default(mut self, can_default: bool) -> Self331     pub fn can_default(mut self, can_default: bool) -> Self {
332         self.can_default = Some(can_default);
333         self
334     }
335 
can_focus(mut self, can_focus: bool) -> Self336     pub fn can_focus(mut self, can_focus: bool) -> Self {
337         self.can_focus = Some(can_focus);
338         self
339     }
340 
double_buffered(mut self, double_buffered: bool) -> Self341     pub fn double_buffered(mut self, double_buffered: bool) -> Self {
342         self.double_buffered = Some(double_buffered);
343         self
344     }
345 
events(mut self, events: gdk::EventMask) -> Self346     pub fn events(mut self, events: gdk::EventMask) -> Self {
347         self.events = Some(events);
348         self
349     }
350 
expand(mut self, expand: bool) -> Self351     pub fn expand(mut self, expand: bool) -> Self {
352         self.expand = Some(expand);
353         self
354     }
355 
focus_on_click(mut self, focus_on_click: bool) -> Self356     pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
357         self.focus_on_click = Some(focus_on_click);
358         self
359     }
360 
halign(mut self, halign: gtk::Align) -> Self361     pub fn halign(mut self, halign: gtk::Align) -> Self {
362         self.halign = Some(halign);
363         self
364     }
365 
has_default(mut self, has_default: bool) -> Self366     pub fn has_default(mut self, has_default: bool) -> Self {
367         self.has_default = Some(has_default);
368         self
369     }
370 
has_focus(mut self, has_focus: bool) -> Self371     pub fn has_focus(mut self, has_focus: bool) -> Self {
372         self.has_focus = Some(has_focus);
373         self
374     }
375 
has_tooltip(mut self, has_tooltip: bool) -> Self376     pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
377         self.has_tooltip = Some(has_tooltip);
378         self
379     }
380 
height_request(mut self, height_request: i32) -> Self381     pub fn height_request(mut self, height_request: i32) -> Self {
382         self.height_request = Some(height_request);
383         self
384     }
385 
hexpand(mut self, hexpand: bool) -> Self386     pub fn hexpand(mut self, hexpand: bool) -> Self {
387         self.hexpand = Some(hexpand);
388         self
389     }
390 
hexpand_set(mut self, hexpand_set: bool) -> Self391     pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
392         self.hexpand_set = Some(hexpand_set);
393         self
394     }
395 
is_focus(mut self, is_focus: bool) -> Self396     pub fn is_focus(mut self, is_focus: bool) -> Self {
397         self.is_focus = Some(is_focus);
398         self
399     }
400 
margin(mut self, margin: i32) -> Self401     pub fn margin(mut self, margin: i32) -> Self {
402         self.margin = Some(margin);
403         self
404     }
405 
margin_bottom(mut self, margin_bottom: i32) -> Self406     pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
407         self.margin_bottom = Some(margin_bottom);
408         self
409     }
410 
margin_end(mut self, margin_end: i32) -> Self411     pub fn margin_end(mut self, margin_end: i32) -> Self {
412         self.margin_end = Some(margin_end);
413         self
414     }
415 
margin_left(mut self, margin_left: i32) -> Self416     pub fn margin_left(mut self, margin_left: i32) -> Self {
417         self.margin_left = Some(margin_left);
418         self
419     }
420 
margin_right(mut self, margin_right: i32) -> Self421     pub fn margin_right(mut self, margin_right: i32) -> Self {
422         self.margin_right = Some(margin_right);
423         self
424     }
425 
margin_start(mut self, margin_start: i32) -> Self426     pub fn margin_start(mut self, margin_start: i32) -> Self {
427         self.margin_start = Some(margin_start);
428         self
429     }
430 
margin_top(mut self, margin_top: i32) -> Self431     pub fn margin_top(mut self, margin_top: i32) -> Self {
432         self.margin_top = Some(margin_top);
433         self
434     }
435 
name(mut self, name: &str) -> Self436     pub fn name(mut self, name: &str) -> Self {
437         self.name = Some(name.to_string());
438         self
439     }
440 
no_show_all(mut self, no_show_all: bool) -> Self441     pub fn no_show_all(mut self, no_show_all: bool) -> Self {
442         self.no_show_all = Some(no_show_all);
443         self
444     }
445 
opacity(mut self, opacity: f64) -> Self446     pub fn opacity(mut self, opacity: f64) -> Self {
447         self.opacity = Some(opacity);
448         self
449     }
450 
parent<P: IsA<gtk::Container>>(mut self, parent: &P) -> Self451     pub fn parent<P: IsA<gtk::Container>>(mut self, parent: &P) -> Self {
452         self.parent = Some(parent.clone().upcast());
453         self
454     }
455 
receives_default(mut self, receives_default: bool) -> Self456     pub fn receives_default(mut self, receives_default: bool) -> Self {
457         self.receives_default = Some(receives_default);
458         self
459     }
460 
sensitive(mut self, sensitive: bool) -> Self461     pub fn sensitive(mut self, sensitive: bool) -> Self {
462         self.sensitive = Some(sensitive);
463         self
464     }
465 
tooltip_markup(mut self, tooltip_markup: &str) -> Self466     pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
467         self.tooltip_markup = Some(tooltip_markup.to_string());
468         self
469     }
470 
tooltip_text(mut self, tooltip_text: &str) -> Self471     pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
472         self.tooltip_text = Some(tooltip_text.to_string());
473         self
474     }
475 
valign(mut self, valign: gtk::Align) -> Self476     pub fn valign(mut self, valign: gtk::Align) -> Self {
477         self.valign = Some(valign);
478         self
479     }
480 
vexpand(mut self, vexpand: bool) -> Self481     pub fn vexpand(mut self, vexpand: bool) -> Self {
482         self.vexpand = Some(vexpand);
483         self
484     }
485 
vexpand_set(mut self, vexpand_set: bool) -> Self486     pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
487         self.vexpand_set = Some(vexpand_set);
488         self
489     }
490 
visible(mut self, visible: bool) -> Self491     pub fn visible(mut self, visible: bool) -> Self {
492         self.visible = Some(visible);
493         self
494     }
495 
width_request(mut self, width_request: i32) -> Self496     pub fn width_request(mut self, width_request: i32) -> Self {
497         self.width_request = Some(width_request);
498         self
499     }
500 
orientation(mut self, orientation: gtk::Orientation) -> Self501     pub fn orientation(mut self, orientation: gtk::Orientation) -> Self {
502         self.orientation = Some(orientation);
503         self
504     }
505 }
506 
507 pub const NONE_DECK: Option<&Deck> = None;
508 
509 pub trait DeckExt: 'static {
510     #[doc(alias = "hdy_deck_get_adjacent_child")]
511     #[doc(alias = "get_adjacent_child")]
adjacent_child(&self, direction: NavigationDirection) -> Option<gtk::Widget>512     fn adjacent_child(&self, direction: NavigationDirection) -> Option<gtk::Widget>;
513 
514     #[doc(alias = "hdy_deck_get_can_swipe_back")]
515     #[doc(alias = "get_can_swipe_back")]
can_swipe_back(&self) -> bool516     fn can_swipe_back(&self) -> bool;
517 
518     #[doc(alias = "hdy_deck_get_can_swipe_forward")]
519     #[doc(alias = "get_can_swipe_forward")]
can_swipe_forward(&self) -> bool520     fn can_swipe_forward(&self) -> bool;
521 
522     #[doc(alias = "hdy_deck_get_child_by_name")]
523     #[doc(alias = "get_child_by_name")]
child_by_name(&self, name: &str) -> Option<gtk::Widget>524     fn child_by_name(&self, name: &str) -> Option<gtk::Widget>;
525 
526     #[doc(alias = "hdy_deck_get_homogeneous")]
527     #[doc(alias = "get_homogeneous")]
is_homogeneous(&self, orientation: gtk::Orientation) -> bool528     fn is_homogeneous(&self, orientation: gtk::Orientation) -> bool;
529 
530     #[doc(alias = "hdy_deck_get_interpolate_size")]
531     #[doc(alias = "get_interpolate_size")]
is_interpolate_size(&self) -> bool532     fn is_interpolate_size(&self) -> bool;
533 
534     #[doc(alias = "hdy_deck_get_transition_duration")]
535     #[doc(alias = "get_transition_duration")]
transition_duration(&self) -> u32536     fn transition_duration(&self) -> u32;
537 
538     #[doc(alias = "hdy_deck_get_transition_running")]
539     #[doc(alias = "get_transition_running")]
is_transition_running(&self) -> bool540     fn is_transition_running(&self) -> bool;
541 
542     #[doc(alias = "hdy_deck_get_transition_type")]
543     #[doc(alias = "get_transition_type")]
transition_type(&self) -> DeckTransitionType544     fn transition_type(&self) -> DeckTransitionType;
545 
546     #[doc(alias = "hdy_deck_get_visible_child")]
547     #[doc(alias = "get_visible_child")]
visible_child(&self) -> Option<gtk::Widget>548     fn visible_child(&self) -> Option<gtk::Widget>;
549 
550     #[doc(alias = "hdy_deck_get_visible_child_name")]
551     #[doc(alias = "get_visible_child_name")]
visible_child_name(&self) -> Option<glib::GString>552     fn visible_child_name(&self) -> Option<glib::GString>;
553 
554     #[cfg(any(feature = "v1_2", feature = "dox"))]
555     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
556     #[doc(alias = "hdy_deck_insert_child_after")]
insert_child_after<P: IsA<gtk::Widget>, Q: IsA<gtk::Widget>>( &self, child: &P, sibling: Option<&Q>, )557     fn insert_child_after<P: IsA<gtk::Widget>, Q: IsA<gtk::Widget>>(
558         &self,
559         child: &P,
560         sibling: Option<&Q>,
561     );
562 
563     #[doc(alias = "hdy_deck_navigate")]
navigate(&self, direction: NavigationDirection) -> bool564     fn navigate(&self, direction: NavigationDirection) -> bool;
565 
566     #[cfg(any(feature = "v1_2", feature = "dox"))]
567     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
568     #[doc(alias = "hdy_deck_prepend")]
prepend<P: IsA<gtk::Widget>>(&self, child: &P)569     fn prepend<P: IsA<gtk::Widget>>(&self, child: &P);
570 
571     #[cfg(any(feature = "v1_2", feature = "dox"))]
572     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
573     #[doc(alias = "hdy_deck_reorder_child_after")]
reorder_child_after<P: IsA<gtk::Widget>, Q: IsA<gtk::Widget>>( &self, child: &P, sibling: Option<&Q>, )574     fn reorder_child_after<P: IsA<gtk::Widget>, Q: IsA<gtk::Widget>>(
575         &self,
576         child: &P,
577         sibling: Option<&Q>,
578     );
579 
580     #[doc(alias = "hdy_deck_set_can_swipe_back")]
set_can_swipe_back(&self, can_swipe_back: bool)581     fn set_can_swipe_back(&self, can_swipe_back: bool);
582 
583     #[doc(alias = "hdy_deck_set_can_swipe_forward")]
set_can_swipe_forward(&self, can_swipe_forward: bool)584     fn set_can_swipe_forward(&self, can_swipe_forward: bool);
585 
586     #[doc(alias = "hdy_deck_set_homogeneous")]
set_homogeneous(&self, orientation: gtk::Orientation, homogeneous: bool)587     fn set_homogeneous(&self, orientation: gtk::Orientation, homogeneous: bool);
588 
589     #[doc(alias = "hdy_deck_set_interpolate_size")]
set_interpolate_size(&self, interpolate_size: bool)590     fn set_interpolate_size(&self, interpolate_size: bool);
591 
592     #[doc(alias = "hdy_deck_set_transition_duration")]
set_transition_duration(&self, duration: u32)593     fn set_transition_duration(&self, duration: u32);
594 
595     #[doc(alias = "hdy_deck_set_transition_type")]
set_transition_type(&self, transition: DeckTransitionType)596     fn set_transition_type(&self, transition: DeckTransitionType);
597 
598     #[doc(alias = "hdy_deck_set_visible_child")]
set_visible_child<P: IsA<gtk::Widget>>(&self, visible_child: &P)599     fn set_visible_child<P: IsA<gtk::Widget>>(&self, visible_child: &P);
600 
601     #[doc(alias = "hdy_deck_set_visible_child_name")]
set_visible_child_name(&self, name: &str)602     fn set_visible_child_name(&self, name: &str);
603 
is_hhomogeneous(&self) -> bool604     fn is_hhomogeneous(&self) -> bool;
605 
set_hhomogeneous(&self, hhomogeneous: bool)606     fn set_hhomogeneous(&self, hhomogeneous: bool);
607 
is_vhomogeneous(&self) -> bool608     fn is_vhomogeneous(&self) -> bool;
609 
set_vhomogeneous(&self, vhomogeneous: bool)610     fn set_vhomogeneous(&self, vhomogeneous: bool);
611 
child_name<T: IsA<Widget>>(&self, item: &T) -> Option<glib::GString>612     fn child_name<T: IsA<Widget>>(&self, item: &T) -> Option<glib::GString>;
613 
set_child_name<T: IsA<Widget>>(&self, item: &T, name: Option<&str>)614     fn set_child_name<T: IsA<Widget>>(&self, item: &T, name: Option<&str>);
615 
616     #[doc(alias = "can-swipe-back")]
connect_can_swipe_back_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId617     fn connect_can_swipe_back_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
618 
619     #[doc(alias = "can-swipe-forward")]
connect_can_swipe_forward_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId620     fn connect_can_swipe_forward_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
621 
622     #[doc(alias = "hhomogeneous")]
connect_hhomogeneous_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId623     fn connect_hhomogeneous_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
624 
625     #[doc(alias = "interpolate-size")]
connect_interpolate_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId626     fn connect_interpolate_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
627 
628     #[doc(alias = "transition-duration")]
connect_transition_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId629     fn connect_transition_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
630 
631     #[doc(alias = "transition-running")]
connect_transition_running_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId632     fn connect_transition_running_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
633 
634     #[doc(alias = "transition-type")]
connect_transition_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId635     fn connect_transition_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
636 
637     #[doc(alias = "vhomogeneous")]
connect_vhomogeneous_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId638     fn connect_vhomogeneous_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
639 
640     #[doc(alias = "visible-child")]
connect_visible_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId641     fn connect_visible_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
642 
643     #[doc(alias = "visible-child-name")]
connect_visible_child_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId644     fn connect_visible_child_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
645 }
646 
647 impl<O: IsA<Deck>> DeckExt for O {
adjacent_child(&self, direction: NavigationDirection) -> Option<gtk::Widget>648     fn adjacent_child(&self, direction: NavigationDirection) -> Option<gtk::Widget> {
649         unsafe {
650             from_glib_none(ffi::hdy_deck_get_adjacent_child(
651                 self.as_ref().to_glib_none().0,
652                 direction.into_glib(),
653             ))
654         }
655     }
656 
can_swipe_back(&self) -> bool657     fn can_swipe_back(&self) -> bool {
658         unsafe {
659             from_glib(ffi::hdy_deck_get_can_swipe_back(
660                 self.as_ref().to_glib_none().0,
661             ))
662         }
663     }
664 
can_swipe_forward(&self) -> bool665     fn can_swipe_forward(&self) -> bool {
666         unsafe {
667             from_glib(ffi::hdy_deck_get_can_swipe_forward(
668                 self.as_ref().to_glib_none().0,
669             ))
670         }
671     }
672 
child_by_name(&self, name: &str) -> Option<gtk::Widget>673     fn child_by_name(&self, name: &str) -> Option<gtk::Widget> {
674         unsafe {
675             from_glib_none(ffi::hdy_deck_get_child_by_name(
676                 self.as_ref().to_glib_none().0,
677                 name.to_glib_none().0,
678             ))
679         }
680     }
681 
is_homogeneous(&self, orientation: gtk::Orientation) -> bool682     fn is_homogeneous(&self, orientation: gtk::Orientation) -> bool {
683         unsafe {
684             from_glib(ffi::hdy_deck_get_homogeneous(
685                 self.as_ref().to_glib_none().0,
686                 orientation.into_glib(),
687             ))
688         }
689     }
690 
is_interpolate_size(&self) -> bool691     fn is_interpolate_size(&self) -> bool {
692         unsafe {
693             from_glib(ffi::hdy_deck_get_interpolate_size(
694                 self.as_ref().to_glib_none().0,
695             ))
696         }
697     }
698 
transition_duration(&self) -> u32699     fn transition_duration(&self) -> u32 {
700         unsafe { ffi::hdy_deck_get_transition_duration(self.as_ref().to_glib_none().0) }
701     }
702 
is_transition_running(&self) -> bool703     fn is_transition_running(&self) -> bool {
704         unsafe {
705             from_glib(ffi::hdy_deck_get_transition_running(
706                 self.as_ref().to_glib_none().0,
707             ))
708         }
709     }
710 
transition_type(&self) -> DeckTransitionType711     fn transition_type(&self) -> DeckTransitionType {
712         unsafe {
713             from_glib(ffi::hdy_deck_get_transition_type(
714                 self.as_ref().to_glib_none().0,
715             ))
716         }
717     }
718 
visible_child(&self) -> Option<gtk::Widget>719     fn visible_child(&self) -> Option<gtk::Widget> {
720         unsafe {
721             from_glib_none(ffi::hdy_deck_get_visible_child(
722                 self.as_ref().to_glib_none().0,
723             ))
724         }
725     }
726 
visible_child_name(&self) -> Option<glib::GString>727     fn visible_child_name(&self) -> Option<glib::GString> {
728         unsafe {
729             from_glib_none(ffi::hdy_deck_get_visible_child_name(
730                 self.as_ref().to_glib_none().0,
731             ))
732         }
733     }
734 
735     #[cfg(any(feature = "v1_2", feature = "dox"))]
736     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
insert_child_after<P: IsA<gtk::Widget>, Q: IsA<gtk::Widget>>( &self, child: &P, sibling: Option<&Q>, )737     fn insert_child_after<P: IsA<gtk::Widget>, Q: IsA<gtk::Widget>>(
738         &self,
739         child: &P,
740         sibling: Option<&Q>,
741     ) {
742         unsafe {
743             ffi::hdy_deck_insert_child_after(
744                 self.as_ref().to_glib_none().0,
745                 child.as_ref().to_glib_none().0,
746                 sibling.map(|p| p.as_ref()).to_glib_none().0,
747             );
748         }
749     }
750 
navigate(&self, direction: NavigationDirection) -> bool751     fn navigate(&self, direction: NavigationDirection) -> bool {
752         unsafe {
753             from_glib(ffi::hdy_deck_navigate(
754                 self.as_ref().to_glib_none().0,
755                 direction.into_glib(),
756             ))
757         }
758     }
759 
760     #[cfg(any(feature = "v1_2", feature = "dox"))]
761     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
prepend<P: IsA<gtk::Widget>>(&self, child: &P)762     fn prepend<P: IsA<gtk::Widget>>(&self, child: &P) {
763         unsafe {
764             ffi::hdy_deck_prepend(
765                 self.as_ref().to_glib_none().0,
766                 child.as_ref().to_glib_none().0,
767             );
768         }
769     }
770 
771     #[cfg(any(feature = "v1_2", feature = "dox"))]
772     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
reorder_child_after<P: IsA<gtk::Widget>, Q: IsA<gtk::Widget>>( &self, child: &P, sibling: Option<&Q>, )773     fn reorder_child_after<P: IsA<gtk::Widget>, Q: IsA<gtk::Widget>>(
774         &self,
775         child: &P,
776         sibling: Option<&Q>,
777     ) {
778         unsafe {
779             ffi::hdy_deck_reorder_child_after(
780                 self.as_ref().to_glib_none().0,
781                 child.as_ref().to_glib_none().0,
782                 sibling.map(|p| p.as_ref()).to_glib_none().0,
783             );
784         }
785     }
786 
set_can_swipe_back(&self, can_swipe_back: bool)787     fn set_can_swipe_back(&self, can_swipe_back: bool) {
788         unsafe {
789             ffi::hdy_deck_set_can_swipe_back(
790                 self.as_ref().to_glib_none().0,
791                 can_swipe_back.into_glib(),
792             );
793         }
794     }
795 
set_can_swipe_forward(&self, can_swipe_forward: bool)796     fn set_can_swipe_forward(&self, can_swipe_forward: bool) {
797         unsafe {
798             ffi::hdy_deck_set_can_swipe_forward(
799                 self.as_ref().to_glib_none().0,
800                 can_swipe_forward.into_glib(),
801             );
802         }
803     }
804 
set_homogeneous(&self, orientation: gtk::Orientation, homogeneous: bool)805     fn set_homogeneous(&self, orientation: gtk::Orientation, homogeneous: bool) {
806         unsafe {
807             ffi::hdy_deck_set_homogeneous(
808                 self.as_ref().to_glib_none().0,
809                 orientation.into_glib(),
810                 homogeneous.into_glib(),
811             );
812         }
813     }
814 
set_interpolate_size(&self, interpolate_size: bool)815     fn set_interpolate_size(&self, interpolate_size: bool) {
816         unsafe {
817             ffi::hdy_deck_set_interpolate_size(
818                 self.as_ref().to_glib_none().0,
819                 interpolate_size.into_glib(),
820             );
821         }
822     }
823 
set_transition_duration(&self, duration: u32)824     fn set_transition_duration(&self, duration: u32) {
825         unsafe {
826             ffi::hdy_deck_set_transition_duration(self.as_ref().to_glib_none().0, duration);
827         }
828     }
829 
set_transition_type(&self, transition: DeckTransitionType)830     fn set_transition_type(&self, transition: DeckTransitionType) {
831         unsafe {
832             ffi::hdy_deck_set_transition_type(
833                 self.as_ref().to_glib_none().0,
834                 transition.into_glib(),
835             );
836         }
837     }
838 
set_visible_child<P: IsA<gtk::Widget>>(&self, visible_child: &P)839     fn set_visible_child<P: IsA<gtk::Widget>>(&self, visible_child: &P) {
840         unsafe {
841             ffi::hdy_deck_set_visible_child(
842                 self.as_ref().to_glib_none().0,
843                 visible_child.as_ref().to_glib_none().0,
844             );
845         }
846     }
847 
set_visible_child_name(&self, name: &str)848     fn set_visible_child_name(&self, name: &str) {
849         unsafe {
850             ffi::hdy_deck_set_visible_child_name(
851                 self.as_ref().to_glib_none().0,
852                 name.to_glib_none().0,
853             );
854         }
855     }
856 
is_hhomogeneous(&self) -> bool857     fn is_hhomogeneous(&self) -> bool {
858         unsafe {
859             let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
860             glib::gobject_ffi::g_object_get_property(
861                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
862                 b"hhomogeneous\0".as_ptr() as *const _,
863                 value.to_glib_none_mut().0,
864             );
865             value
866                 .get()
867                 .expect("Return Value for property `hhomogeneous` getter")
868         }
869     }
870 
set_hhomogeneous(&self, hhomogeneous: bool)871     fn set_hhomogeneous(&self, hhomogeneous: bool) {
872         unsafe {
873             glib::gobject_ffi::g_object_set_property(
874                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
875                 b"hhomogeneous\0".as_ptr() as *const _,
876                 hhomogeneous.to_value().to_glib_none().0,
877             );
878         }
879     }
880 
is_vhomogeneous(&self) -> bool881     fn is_vhomogeneous(&self) -> bool {
882         unsafe {
883             let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
884             glib::gobject_ffi::g_object_get_property(
885                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
886                 b"vhomogeneous\0".as_ptr() as *const _,
887                 value.to_glib_none_mut().0,
888             );
889             value
890                 .get()
891                 .expect("Return Value for property `vhomogeneous` getter")
892         }
893     }
894 
set_vhomogeneous(&self, vhomogeneous: bool)895     fn set_vhomogeneous(&self, vhomogeneous: bool) {
896         unsafe {
897             glib::gobject_ffi::g_object_set_property(
898                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
899                 b"vhomogeneous\0".as_ptr() as *const _,
900                 vhomogeneous.to_value().to_glib_none().0,
901             );
902         }
903     }
904 
child_name<T: IsA<Widget>>(&self, item: &T) -> Option<glib::GString>905     fn child_name<T: IsA<Widget>>(&self, item: &T) -> Option<glib::GString> {
906         unsafe {
907             let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
908             gtk::ffi::gtk_container_child_get_property(
909                 self.to_glib_none().0 as *mut gtk::ffi::GtkContainer,
910                 item.to_glib_none().0 as *mut _,
911                 b"name\0".as_ptr() as *const _,
912                 value.to_glib_none_mut().0,
913             );
914             value
915                 .get()
916                 .expect("Return Value for property `name` getter")
917         }
918     }
919 
set_child_name<T: IsA<Widget>>(&self, item: &T, name: Option<&str>)920     fn set_child_name<T: IsA<Widget>>(&self, item: &T, name: Option<&str>) {
921         unsafe {
922             gtk::ffi::gtk_container_child_set_property(
923                 self.to_glib_none().0 as *mut gtk::ffi::GtkContainer,
924                 item.to_glib_none().0 as *mut _,
925                 b"name\0".as_ptr() as *const _,
926                 name.to_value().to_glib_none().0,
927             );
928         }
929     }
930 
connect_can_swipe_back_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId931     fn connect_can_swipe_back_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
932         unsafe extern "C" fn notify_can_swipe_back_trampoline<P: IsA<Deck>, F: Fn(&P) + 'static>(
933             this: *mut ffi::HdyDeck,
934             _param_spec: glib::ffi::gpointer,
935             f: glib::ffi::gpointer,
936         ) {
937             let f: &F = &*(f as *const F);
938             f(Deck::from_glib_borrow(this).unsafe_cast_ref())
939         }
940         unsafe {
941             let f: Box_<F> = Box_::new(f);
942             connect_raw(
943                 self.as_ptr() as *mut _,
944                 b"notify::can-swipe-back\0".as_ptr() as *const _,
945                 Some(transmute::<_, unsafe extern "C" fn()>(
946                     notify_can_swipe_back_trampoline::<Self, F> as *const (),
947                 )),
948                 Box_::into_raw(f),
949             )
950         }
951     }
952 
connect_can_swipe_forward_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId953     fn connect_can_swipe_forward_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
954         unsafe extern "C" fn notify_can_swipe_forward_trampoline<
955             P: IsA<Deck>,
956             F: Fn(&P) + 'static,
957         >(
958             this: *mut ffi::HdyDeck,
959             _param_spec: glib::ffi::gpointer,
960             f: glib::ffi::gpointer,
961         ) {
962             let f: &F = &*(f as *const F);
963             f(Deck::from_glib_borrow(this).unsafe_cast_ref())
964         }
965         unsafe {
966             let f: Box_<F> = Box_::new(f);
967             connect_raw(
968                 self.as_ptr() as *mut _,
969                 b"notify::can-swipe-forward\0".as_ptr() as *const _,
970                 Some(transmute::<_, unsafe extern "C" fn()>(
971                     notify_can_swipe_forward_trampoline::<Self, F> as *const (),
972                 )),
973                 Box_::into_raw(f),
974             )
975         }
976     }
977 
connect_hhomogeneous_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId978     fn connect_hhomogeneous_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
979         unsafe extern "C" fn notify_hhomogeneous_trampoline<P: IsA<Deck>, F: Fn(&P) + 'static>(
980             this: *mut ffi::HdyDeck,
981             _param_spec: glib::ffi::gpointer,
982             f: glib::ffi::gpointer,
983         ) {
984             let f: &F = &*(f as *const F);
985             f(Deck::from_glib_borrow(this).unsafe_cast_ref())
986         }
987         unsafe {
988             let f: Box_<F> = Box_::new(f);
989             connect_raw(
990                 self.as_ptr() as *mut _,
991                 b"notify::hhomogeneous\0".as_ptr() as *const _,
992                 Some(transmute::<_, unsafe extern "C" fn()>(
993                     notify_hhomogeneous_trampoline::<Self, F> as *const (),
994                 )),
995                 Box_::into_raw(f),
996             )
997         }
998     }
999 
connect_interpolate_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1000     fn connect_interpolate_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1001         unsafe extern "C" fn notify_interpolate_size_trampoline<
1002             P: IsA<Deck>,
1003             F: Fn(&P) + 'static,
1004         >(
1005             this: *mut ffi::HdyDeck,
1006             _param_spec: glib::ffi::gpointer,
1007             f: glib::ffi::gpointer,
1008         ) {
1009             let f: &F = &*(f as *const F);
1010             f(Deck::from_glib_borrow(this).unsafe_cast_ref())
1011         }
1012         unsafe {
1013             let f: Box_<F> = Box_::new(f);
1014             connect_raw(
1015                 self.as_ptr() as *mut _,
1016                 b"notify::interpolate-size\0".as_ptr() as *const _,
1017                 Some(transmute::<_, unsafe extern "C" fn()>(
1018                     notify_interpolate_size_trampoline::<Self, F> as *const (),
1019                 )),
1020                 Box_::into_raw(f),
1021             )
1022         }
1023     }
1024 
connect_transition_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1025     fn connect_transition_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1026         unsafe extern "C" fn notify_transition_duration_trampoline<
1027             P: IsA<Deck>,
1028             F: Fn(&P) + 'static,
1029         >(
1030             this: *mut ffi::HdyDeck,
1031             _param_spec: glib::ffi::gpointer,
1032             f: glib::ffi::gpointer,
1033         ) {
1034             let f: &F = &*(f as *const F);
1035             f(Deck::from_glib_borrow(this).unsafe_cast_ref())
1036         }
1037         unsafe {
1038             let f: Box_<F> = Box_::new(f);
1039             connect_raw(
1040                 self.as_ptr() as *mut _,
1041                 b"notify::transition-duration\0".as_ptr() as *const _,
1042                 Some(transmute::<_, unsafe extern "C" fn()>(
1043                     notify_transition_duration_trampoline::<Self, F> as *const (),
1044                 )),
1045                 Box_::into_raw(f),
1046             )
1047         }
1048     }
1049 
connect_transition_running_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1050     fn connect_transition_running_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1051         unsafe extern "C" fn notify_transition_running_trampoline<
1052             P: IsA<Deck>,
1053             F: Fn(&P) + 'static,
1054         >(
1055             this: *mut ffi::HdyDeck,
1056             _param_spec: glib::ffi::gpointer,
1057             f: glib::ffi::gpointer,
1058         ) {
1059             let f: &F = &*(f as *const F);
1060             f(Deck::from_glib_borrow(this).unsafe_cast_ref())
1061         }
1062         unsafe {
1063             let f: Box_<F> = Box_::new(f);
1064             connect_raw(
1065                 self.as_ptr() as *mut _,
1066                 b"notify::transition-running\0".as_ptr() as *const _,
1067                 Some(transmute::<_, unsafe extern "C" fn()>(
1068                     notify_transition_running_trampoline::<Self, F> as *const (),
1069                 )),
1070                 Box_::into_raw(f),
1071             )
1072         }
1073     }
1074 
connect_transition_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1075     fn connect_transition_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1076         unsafe extern "C" fn notify_transition_type_trampoline<
1077             P: IsA<Deck>,
1078             F: Fn(&P) + 'static,
1079         >(
1080             this: *mut ffi::HdyDeck,
1081             _param_spec: glib::ffi::gpointer,
1082             f: glib::ffi::gpointer,
1083         ) {
1084             let f: &F = &*(f as *const F);
1085             f(Deck::from_glib_borrow(this).unsafe_cast_ref())
1086         }
1087         unsafe {
1088             let f: Box_<F> = Box_::new(f);
1089             connect_raw(
1090                 self.as_ptr() as *mut _,
1091                 b"notify::transition-type\0".as_ptr() as *const _,
1092                 Some(transmute::<_, unsafe extern "C" fn()>(
1093                     notify_transition_type_trampoline::<Self, F> as *const (),
1094                 )),
1095                 Box_::into_raw(f),
1096             )
1097         }
1098     }
1099 
connect_vhomogeneous_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1100     fn connect_vhomogeneous_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1101         unsafe extern "C" fn notify_vhomogeneous_trampoline<P: IsA<Deck>, F: Fn(&P) + 'static>(
1102             this: *mut ffi::HdyDeck,
1103             _param_spec: glib::ffi::gpointer,
1104             f: glib::ffi::gpointer,
1105         ) {
1106             let f: &F = &*(f as *const F);
1107             f(Deck::from_glib_borrow(this).unsafe_cast_ref())
1108         }
1109         unsafe {
1110             let f: Box_<F> = Box_::new(f);
1111             connect_raw(
1112                 self.as_ptr() as *mut _,
1113                 b"notify::vhomogeneous\0".as_ptr() as *const _,
1114                 Some(transmute::<_, unsafe extern "C" fn()>(
1115                     notify_vhomogeneous_trampoline::<Self, F> as *const (),
1116                 )),
1117                 Box_::into_raw(f),
1118             )
1119         }
1120     }
1121 
connect_visible_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1122     fn connect_visible_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1123         unsafe extern "C" fn notify_visible_child_trampoline<P: IsA<Deck>, F: Fn(&P) + 'static>(
1124             this: *mut ffi::HdyDeck,
1125             _param_spec: glib::ffi::gpointer,
1126             f: glib::ffi::gpointer,
1127         ) {
1128             let f: &F = &*(f as *const F);
1129             f(Deck::from_glib_borrow(this).unsafe_cast_ref())
1130         }
1131         unsafe {
1132             let f: Box_<F> = Box_::new(f);
1133             connect_raw(
1134                 self.as_ptr() as *mut _,
1135                 b"notify::visible-child\0".as_ptr() as *const _,
1136                 Some(transmute::<_, unsafe extern "C" fn()>(
1137                     notify_visible_child_trampoline::<Self, F> as *const (),
1138                 )),
1139                 Box_::into_raw(f),
1140             )
1141         }
1142     }
1143 
connect_visible_child_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1144     fn connect_visible_child_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1145         unsafe extern "C" fn notify_visible_child_name_trampoline<
1146             P: IsA<Deck>,
1147             F: Fn(&P) + 'static,
1148         >(
1149             this: *mut ffi::HdyDeck,
1150             _param_spec: glib::ffi::gpointer,
1151             f: glib::ffi::gpointer,
1152         ) {
1153             let f: &F = &*(f as *const F);
1154             f(Deck::from_glib_borrow(this).unsafe_cast_ref())
1155         }
1156         unsafe {
1157             let f: Box_<F> = Box_::new(f);
1158             connect_raw(
1159                 self.as_ptr() as *mut _,
1160                 b"notify::visible-child-name\0".as_ptr() as *const _,
1161                 Some(transmute::<_, unsafe extern "C" fn()>(
1162                     notify_visible_child_name_trampoline::<Self, F> as *const (),
1163                 )),
1164                 Box_::into_raw(f),
1165             )
1166         }
1167     }
1168 }
1169 
1170 impl fmt::Display for Deck {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1171     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1172         f.write_str("Deck")
1173     }
1174 }
1175 use gtk::Widget;
1176