gtk4/auto/buildable.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 crate::ffi;
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9 /// Allows objects to extend and customize deserialization from ui files.
10 ///
11 /// The [`Buildable`][crate::Buildable] interface includes methods for setting names and
12 /// properties of objects, parsing custom tags and constructing child objects.
13 ///
14 /// It is implemented by all widgets and many of the non-widget objects that are
15 /// provided by GTK. The main user of this interface is [`Builder`][crate::Builder].
16 /// There should be very little need for applications to call any of these
17 /// functions directly.
18 ///
19 /// An object only needs to implement this interface if it needs to extend the
20 /// [`Builder`][crate::Builder] XML format or run any extra routines at deserialization time.
21 ///
22 /// # Implements
23 ///
24 /// [`BuildableExt`][trait@crate::prelude::BuildableExt]
25 #[doc(alias = "GtkBuildable")]
26 pub struct Buildable(Interface<ffi::GtkBuildable, ffi::GtkBuildableIface>);
27
28 match fn {
29 type_ => || ffi::gtk_buildable_get_type(),
30 }
31}
32
33impl Buildable {
34 pub const NONE: Option<&'static Buildable> = None;
35}
36
37/// Trait containing all [`struct@Buildable`] methods.
38///
39/// # Implementors
40///
41/// [`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], [`GraphicsOffload`][struct@crate::GraphicsOffload], [`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]
42pub trait BuildableExt: IsA<Buildable> + 'static {
43 /// Gets the ID of the @self object.
44 ///
45 /// [`Builder`][crate::Builder] sets the name based on the ID attribute
46 /// of the `<object>` tag used to construct the @self.
47 ///
48 /// # Returns
49 ///
50 /// the ID of the buildable object
51 #[doc(alias = "gtk_buildable_get_buildable_id")]
52 #[doc(alias = "get_buildable_id")]
53 fn buildable_id(&self) -> Option<glib::GString> {
54 unsafe {
55 from_glib_none(ffi::gtk_buildable_get_buildable_id(
56 self.as_ref().to_glib_none().0,
57 ))
58 }
59 }
60}
61
62impl<O: IsA<Buildable>> BuildableExt for O {}