logo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use glib::object::IsA;
use glib::translate::*;
use std::fmt;

glib::wrapper! {
    ///
    ///
    /// This is an Abstract Base Class, you cannot instantiate it.
    ///
    /// # Implements
    ///
    /// [`BinExt`][trait@crate::prelude::BinExt], [`trait@gtk::prelude::WidgetExt`], [`trait@glib::ObjectExt`], [`trait@gtk::prelude::AccessibleExt`], [`trait@gtk::prelude::BuildableExt`], [`trait@gtk::prelude::ConstraintTargetExt`]
    #[doc(alias = "HeBin")]
    pub struct Bin(Object<ffi::HeBin, ffi::HeBinClass>) @extends gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget;

    match fn {
        type_ => || ffi::he_bin_get_type(),
    }
}

impl Bin {
    pub const NONE: Option<&'static Bin> = None;
}

/// Trait containing all [`struct@Bin`] methods.
///
/// # Implementors
///
/// [`AppBar`][struct@crate::AppBar], [`Badge`][struct@crate::Badge], [`Banner`][struct@crate::Banner], [`Bin`][struct@crate::Bin], [`BottomBar`][struct@crate::BottomBar], [`ContentBlockImageCluster`][struct@crate::ContentBlockImageCluster], [`ContentBlockImage`][struct@crate::ContentBlockImage], [`ContentBlock`][struct@crate::ContentBlock], [`ContentList`][struct@crate::ContentList], [`EmptyPage`][struct@crate::EmptyPage], [`MiniContentBlock`][struct@crate::MiniContentBlock], [`ModifierBadge`][struct@crate::ModifierBadge], [`OverlayButton`][struct@crate::OverlayButton], [`SettingsPage`][struct@crate::SettingsPage], [`SideBar`][struct@crate::SideBar], [`TabPage`][struct@crate::TabPage], [`TabSwitcher`][struct@crate::TabSwitcher], [`Tab`][struct@crate::Tab], [`Toast`][struct@crate::Toast], [`ViewSubTitle`][struct@crate::ViewSubTitle], [`ViewSwitcher`][struct@crate::ViewSwitcher], [`ViewTitle`][struct@crate::ViewTitle], [`WelcomeScreen`][struct@crate::WelcomeScreen]
pub trait BinExt: 'static {
    #[doc(alias = "he_bin_add_child")]
    fn add_child(
        &self,
        builder: &gtk::Builder,
        child: &impl IsA<glib::Object>,
        type_: Option<&str>,
    );
}

impl<O: IsA<Bin>> BinExt for O {
    fn add_child(
        &self,
        builder: &gtk::Builder,
        child: &impl IsA<glib::Object>,
        type_: Option<&str>,
    ) {
        unsafe {
            ffi::he_bin_add_child(
                self.as_ref().to_glib_none().0,
                builder.to_glib_none().0,
                child.as_ref().to_glib_none().0,
                type_.to_glib_none().0,
            );
        }
    }
}

impl fmt::Display for Bin {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str("Bin")
    }
}