// GENERATED — DO NOT EDIT

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/class.WindowHandle.html).
pub type WindowHandle

///|
pub(open) trait IWindowHandle {
  fn as_window_handle(Self) -> WindowHandle
  fn get_child(Self) -> Widget? = _
  fn set_child(Self, &IWidget?) -> Unit = _
}

///|
pub impl IWindowHandle for WindowHandle with fn as_window_handle(self) {
  self
}

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/ctor.WindowHandle.new.html).
pub extern "c" fn WindowHandle::new() -> WindowHandle = "moonbit_gtk_window_handle_new"

///|
#borrow(self_)
extern "c" fn moonbit_gtk_window_handle_get_child(
  self_ : WindowHandle,
) -> @glib.Nullable[Widget] = "moonbit_gtk_window_handle_get_child"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.WindowHandle.get_child.html).
pub fn WindowHandle::get_child(self : WindowHandle) -> Widget? {
  let raw_result = moonbit_gtk_window_handle_get_child(self)
  raw_result.to_option()
}

///|
#borrow(self_, child)
extern "c" fn moonbit_gtk_window_handle_set_child(
  self_ : WindowHandle,
  child : @glib.Nullable[Widget],
) = "moonbit_gtk_window_handle_set_child"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.WindowHandle.set_child.html).
pub fn WindowHandle::set_child(self : WindowHandle, child : &IWidget?) -> Unit {
  moonbit_gtk_window_handle_set_child(
    self,
    match child {
      Some(v) => @glib.Nullable::some(v.as_widget())
      None => @glib.Nullable::null()
    },
  )
}

///|
impl IWindowHandle with fn get_child(self) -> Widget? {
  self.as_window_handle().get_child()
}

///|
impl IWindowHandle with fn set_child(self, child) -> Unit {
  self.as_window_handle().set_child(child)
}

///|
pub fn WindowHandle::as_widget(self : WindowHandle) -> Widget = "%identity"

///|
pub impl IWidget for WindowHandle with fn as_widget(self) {
  self.as_widget()
}

///|
pub fn WindowHandle::as_gobject_object(self : WindowHandle) -> @gobject.Object = "%identity"

///|
pub impl @gobject.IObject for WindowHandle with fn as_object(self) {
  self.as_gobject_object()
}