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
68
69
70
71
72
73
74
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use glib::{prelude::*, translate::*};
use std::fmt;

glib::wrapper! {
    /// [`Buildable`][crate::Buildable] allows objects to extend and customize their deserialization
    /// from ui files.
    ///
    /// The interface includes methods for setting names and properties of objects,
    /// parsing custom tags and constructing child objects.
    ///
    /// The [`Buildable`][crate::Buildable] interface is implemented by all widgets and
    /// many of the non-widget objects that are provided by GTK. The
    /// main user of this interface is [`Builder`][crate::Builder]. There should be
    /// very little need for applications to call any of these functions directly.
    ///
    /// An object only needs to implement this interface if it needs to extend the
    /// [`Builder`][crate::Builder] XML format or run any extra routines at deserialization time.
    ///
    /// # Implements
    ///
    /// [`BuildableExt`][trait@crate::prelude::BuildableExt]
    #[doc(alias = "GtkBuildable")]
    pub struct Buildable(Interface<ffi::GtkBuildable, ffi::GtkBuildableIface>);

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

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

mod sealed {
    pub trait Sealed {}
    impl<T: super::IsA<super::Buildable>> Sealed for T {}
}

/// Trait containing all [`struct@Buildable`] methods.
///
/// # Implementors
///
/// [`AboutDialog`][struct@crate::AboutDialog], [`ActionBar`][struct@crate::ActionBar], [`AnyFilter`][struct@crate::AnyFilter], [`AppChooserButton`][struct@crate::AppChooserButton], [`AppChooserDialog`][struct@crate::AppChooserDialog], [`AppChooserWidget`][struct@crate::AppChooserWidget], [`ApplicationWindow`][struct@crate::ApplicationWindow], [`AspectFrame`][struct@crate::AspectFrame], [`Assistant`][struct@crate::Assistant], [`Box`][struct@crate::Box], [`Buildable`][struct@crate::Buildable], [`Button`][struct@crate::Button], [`Calendar`][struct@crate::Calendar], [`CellAreaBox`][struct@crate::CellAreaBox], [`CellArea`][struct@crate::CellArea], [`CellView`][struct@crate::CellView], [`CenterBox`][struct@crate::CenterBox], [`CheckButton`][struct@crate::CheckButton], [`ColorButton`][struct@crate::ColorButton], [`ColorChooserDialog`][struct@crate::ColorChooserDialog], [`ColorChooserWidget`][struct@crate::ColorChooserWidget], [`ColorDialogButton`][struct@crate::ColorDialogButton], [`ColumnView`][struct@crate::ColumnView], [`ComboBoxText`][struct@crate::ComboBoxText], [`ComboBox`][struct@crate::ComboBox], [`ConstraintLayout`][struct@crate::ConstraintLayout], [`Dialog`][struct@crate::Dialog], [`DragIcon`][struct@crate::DragIcon], [`DrawingArea`][struct@crate::DrawingArea], [`DropDown`][struct@crate::DropDown], [`EditableLabel`][struct@crate::EditableLabel], [`EmojiChooser`][struct@crate::EmojiChooser], [`EntryCompletion`][struct@crate::EntryCompletion], [`Entry`][struct@crate::Entry], [`EveryFilter`][struct@crate::EveryFilter], [`Expander`][struct@crate::Expander], [`FileChooserDialog`][struct@crate::FileChooserDialog], [`FileChooserWidget`][struct@crate::FileChooserWidget], [`FileFilter`][struct@crate::FileFilter], [`Fixed`][struct@crate::Fixed], [`FlowBoxChild`][struct@crate::FlowBoxChild], [`FlowBox`][struct@crate::FlowBox], [`FontButton`][struct@crate::FontButton], [`FontChooserDialog`][struct@crate::FontChooserDialog], [`FontChooserWidget`][struct@crate::FontChooserWidget], [`FontDialogButton`][struct@crate::FontDialogButton], [`Frame`][struct@crate::Frame], [`GLArea`][struct@crate::GLArea], [`GridView`][struct@crate::GridView], [`Grid`][struct@crate::Grid], [`HeaderBar`][struct@crate::HeaderBar], [`IconView`][struct@crate::IconView], [`Image`][struct@crate::Image], [`InfoBar`][struct@crate::InfoBar], [`Inscription`][struct@crate::Inscription], [`Label`][struct@crate::Label], [`LevelBar`][struct@crate::LevelBar], [`LinkButton`][struct@crate::LinkButton], [`ListBase`][struct@crate::ListBase], [`ListBoxRow`][struct@crate::ListBoxRow], [`ListBox`][struct@crate::ListBox], [`ListStore`][struct@crate::ListStore], [`ListView`][struct@crate::ListView], [`LockButton`][struct@crate::LockButton], [`MediaControls`][struct@crate::MediaControls], [`MenuButton`][struct@crate::MenuButton], [`MessageDialog`][struct@crate::MessageDialog], [`MultiFilter`][struct@crate::MultiFilter], [`MultiSorter`][struct@crate::MultiSorter], [`Notebook`][struct@crate::Notebook], [`Overlay`][struct@crate::Overlay], [`PageSetupUnixDialog`][struct@crate::PageSetupUnixDialog], [`Paned`][struct@crate::Paned], [`PasswordEntry`][struct@crate::PasswordEntry], [`Picture`][struct@crate::Picture], [`PopoverMenuBar`][struct@crate::PopoverMenuBar], [`PopoverMenu`][struct@crate::PopoverMenu], [`Popover`][struct@crate::Popover], [`PrintUnixDialog`][struct@crate::PrintUnixDialog], [`ProgressBar`][struct@crate::ProgressBar], [`Range`][struct@crate::Range], [`Revealer`][struct@crate::Revealer], [`ScaleButton`][struct@crate::ScaleButton], [`Scale`][struct@crate::Scale], [`Scrollbar`][struct@crate::Scrollbar], [`ScrolledWindow`][struct@crate::ScrolledWindow], [`SearchBar`][struct@crate::SearchBar], [`SearchEntry`][struct@crate::SearchEntry], [`Separator`][struct@crate::Separator], [`ShortcutController`][struct@crate::ShortcutController], [`ShortcutLabel`][struct@crate::ShortcutLabel], [`ShortcutsGroup`][struct@crate::ShortcutsGroup], [`ShortcutsSection`][struct@crate::ShortcutsSection], [`ShortcutsShortcut`][struct@crate::ShortcutsShortcut], [`ShortcutsWindow`][struct@crate::ShortcutsWindow], [`SizeGroup`][struct@crate::SizeGroup], [`SpinButton`][struct@crate::SpinButton], [`Spinner`][struct@crate::Spinner], [`StackSidebar`][struct@crate::StackSidebar], [`StackSwitcher`][struct@crate::StackSwitcher], [`Stack`][struct@crate::Stack], [`Statusbar`][struct@crate::Statusbar], [`StringList`][struct@crate::StringList], [`Switch`][struct@crate::Switch], [`TextTagTable`][struct@crate::TextTagTable], [`TextView`][struct@crate::TextView], [`Text`][struct@crate::Text], [`ToggleButton`][struct@crate::ToggleButton], [`TreeExpander`][struct@crate::TreeExpander], [`TreeStore`][struct@crate::TreeStore], [`TreeViewColumn`][struct@crate::TreeViewColumn], [`TreeView`][struct@crate::TreeView], [`Video`][struct@crate::Video], [`Viewport`][struct@crate::Viewport], [`VolumeButton`][struct@crate::VolumeButton], [`Widget`][struct@crate::Widget], [`WindowControls`][struct@crate::WindowControls], [`WindowHandle`][struct@crate::WindowHandle], [`Window`][struct@crate::Window]
pub trait BuildableExt: IsA<Buildable> + sealed::Sealed + 'static {
    /// Gets the ID of the @self object.
    ///
    /// [`Builder`][crate::Builder] sets the name based on the ID attribute
    /// of the `<object>` tag used to construct the @self.
    ///
    /// # Returns
    ///
    /// the ID of the buildable object
    #[doc(alias = "gtk_buildable_get_buildable_id")]
    #[doc(alias = "get_buildable_id")]
    fn buildable_id(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::gtk_buildable_get_buildable_id(
                self.as_ref().to_glib_none().0,
            ))
        }
    }
}

impl<O: IsA<Buildable>> BuildableExt for O {}

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