// GENERATED — DO NOT EDIT
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/iface.Root.html).
pub type Root
///|
pub(open) trait IRoot {
fn as_root(Self) -> Root
fn get_display(Self) -> @gdk.Display = _
fn get_focus(Self) -> Widget? = _
fn set_focus(Self, &IWidget?) -> Unit = _
}
///|
pub impl IRoot for Root with fn as_root(self) {
self
}
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Root.get_display.html).
#borrow(self)
pub extern "c" fn Root::get_display(self : Root) -> @gdk.Display = "moonbit_gtk_root_get_display"
///|
#borrow(self_)
extern "c" fn moonbit_gtk_root_get_focus(
self_ : Root,
) -> @glib.Nullable[Widget] = "moonbit_gtk_root_get_focus"
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Root.get_focus.html).
pub fn Root::get_focus(self : Root) -> Widget? {
let raw_result = moonbit_gtk_root_get_focus(self)
raw_result.to_option()
}
///|
#borrow(self_, focus)
extern "c" fn moonbit_gtk_root_set_focus(
self_ : Root,
focus : @glib.Nullable[Widget],
) = "moonbit_gtk_root_set_focus"
///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Root.set_focus.html).
pub fn Root::set_focus(self : Root, focus : &IWidget?) -> Unit {
moonbit_gtk_root_set_focus(
self,
match focus {
Some(v) => @glib.Nullable::some(v.as_widget())
None => @glib.Nullable::null()
},
)
}
///|
impl IRoot with fn get_display(self) -> @gdk.Display {
self.as_root().get_display()
}
///|
impl IRoot with fn get_focus(self) -> Widget? {
self.as_root().get_focus()
}
///|
impl IRoot with fn set_focus(self, focus) -> Unit {
self.as_root().set_focus(focus)
}
///|
pub fn Root::as_native(self : Root) -> Native = "%identity"
///|
pub impl INative for Root with fn as_native(self) {
self.as_native()
}
///|
pub fn Root::as_widget(self : Root) -> Widget = "%identity"
///|
pub impl IWidget for Root with fn as_widget(self) {
self.as_widget()
}