// GENERATED — DO NOT EDIT

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

///|
pub(open) trait IWindow {
  fn as_window(Self) -> Window
  fn close(Self) -> Unit = _
  fn destroy(Self) -> Unit = _
  fn fullscreen(Self) -> Unit = _
  fn fullscreen_on_monitor(Self, &@gdk.IMonitor) -> Unit = _
  fn get_application(Self) -> Application? = _
  fn get_child(Self) -> Widget? = _
  fn get_decorated(Self) -> Bool = _
  fn get_default_size(Self) -> (Int, Int) = _
  fn get_default_widget(Self) -> Widget? = _
  fn get_deletable(Self) -> Bool = _
  fn get_destroy_with_parent(Self) -> Bool = _
  fn get_focus(Self) -> Widget? = _
  fn get_focus_visible(Self) -> Bool = _
  fn get_gravity(Self) -> WindowGravity = _
  fn get_group(Self) -> WindowGroup = _
  fn get_handle_menubar_accel(Self) -> Bool = _
  fn get_hide_on_close(Self) -> Bool = _
  fn get_icon_name(Self) -> String? = _
  fn get_mnemonics_visible(Self) -> Bool = _
  fn get_modal(Self) -> Bool = _
  fn get_resizable(Self) -> Bool = _
  fn get_title(Self) -> String? = _
  fn get_titlebar(Self) -> Widget? = _
  fn get_transient_for(Self) -> Window? = _
  fn has_group(Self) -> Bool = _
  fn is_active(Self) -> Bool = _
  fn is_fullscreen(Self) -> Bool = _
  fn is_maximized(Self) -> Bool = _
  fn is_suspended(Self) -> Bool = _
  fn maximize(Self) -> Unit = _
  fn minimize(Self) -> Unit = _
  fn present(Self) -> Unit = _
  fn set_application(Self, &IApplication?) -> Unit = _
  fn set_child(Self, &IWidget?) -> Unit = _
  fn set_decorated(Self, Bool) -> Unit = _
  fn set_default_size(Self, Int, Int) -> Unit = _
  fn set_default_widget(Self, &IWidget?) -> Unit = _
  fn set_deletable(Self, Bool) -> Unit = _
  fn set_destroy_with_parent(Self, Bool) -> Unit = _
  fn set_display(Self, &@gdk.IDisplay) -> Unit = _
  fn set_focus(Self, &IWidget?) -> Unit = _
  fn set_focus_visible(Self, Bool) -> Unit = _
  fn set_gravity(Self, WindowGravity) -> Unit = _
  fn set_handle_menubar_accel(Self, Bool) -> Unit = _
  fn set_hide_on_close(Self, Bool) -> Unit = _
  fn set_icon_name(Self, String?) -> Unit = _
  fn set_mnemonics_visible(Self, Bool) -> Unit = _
  fn set_modal(Self, Bool) -> Unit = _
  fn set_resizable(Self, Bool) -> Unit = _
  fn set_startup_id(Self, String) -> Unit = _
  fn set_title(Self, String?) -> Unit = _
  fn set_titlebar(Self, &IWidget?) -> Unit = _
  fn set_transient_for(Self, &IWindow?) -> Unit = _
  fn unfullscreen(Self) -> Unit = _
  fn unmaximize(Self) -> Unit = _
  fn unminimize(Self) -> Unit = _
  fn connect_activate_default(Self, (Window) -> Unit) -> UInt64 = _
  fn connect_activate_focus(Self, (Window) -> Unit) -> UInt64 = _
  fn connect_close_request(Self, (Window) -> Bool) -> UInt64 = _
  fn connect_enable_debugging(Self, (Window, Bool) -> Bool) -> UInt64 = _
}

///|
pub impl IWindow for Window with fn as_window(self) {
  self
}

///|
/// Implementation contract for Window.activate_default. Self is the retained MoonBit state; the second parameter is the invoked Window object.
pub(open) trait VWindowActivateDefault {
  fn activate_default(Self, Window) -> Unit
}

///|
/// Implementation contract for Window.activate_focus. Self is the retained MoonBit state; the second parameter is the invoked Window object.
pub(open) trait VWindowActivateFocus {
  fn activate_focus(Self, Window) -> Unit
}

///|
/// Implementation contract for Window.keys_changed. Self is the retained MoonBit state; the second parameter is the invoked Window object.
pub(open) trait VWindowKeysChanged {
  fn keys_changed(Self, Window) -> Unit
}

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

///|
extern "c" fn moonbit_gtk_window_get_default_icon_name() -> @glib.Nullable[
  Bytes,
] = "moonbit_gtk_window_get_default_icon_name"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/type_func.Window.get_default_icon_name.html).
pub fn Window::get_default_icon_name() -> String? {
  let result = moonbit_gtk_window_get_default_icon_name()
  match result.to_option() {
    Some(bytes) => Some(@encoding/utf8.decode_lossy(bytes))
    None => None
  }
}

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/type_func.Window.get_toplevels.html).
pub extern "c" fn Window::get_toplevels() -> Window = "moonbit_gtk_window_get_toplevels"

///|
#borrow(result)
extern "c" fn moonbit_gtk_window_list_toplevels(
  result : Ref[FixedArray[Widget]],
) = "moonbit_gtk_window_list_toplevels"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/type_func.Window.list_toplevels.html).
pub fn Window::list_toplevels() -> Array[Widget] {
  let result_ref : Ref[FixedArray[Widget]] = Ref([])
  moonbit_gtk_window_list_toplevels(result_ref)
  let values : Array[Widget] = Array::new(capacity=result_ref.val.length())
  for value in result_ref.val {
    values.push(value)
  }
  values
}

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/type_func.Window.set_auto_startup_notification.html).
pub extern "c" fn Window::set_auto_startup_notification(setting : Bool) -> Unit = "moonbit_gtk_window_set_auto_startup_notification"

///|
#borrow(name)
extern "c" fn moonbit_gtk_window_set_default_icon_name(name : Bytes) = "moonbit_gtk_window_set_default_icon_name"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/type_func.Window.set_default_icon_name.html).
pub fn Window::set_default_icon_name(name : String) -> Unit {
  moonbit_gtk_window_set_default_icon_name(@encoding/utf8.encode(name))
}

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/type_func.Window.set_interactive_debugging.html).
pub extern "c" fn Window::set_interactive_debugging(enable : Bool) -> Unit = "moonbit_gtk_window_set_interactive_debugging"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.close.html).
#borrow(self)
pub extern "c" fn Window::close(self : Window) = "moonbit_gtk_window_close"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.destroy.html).
#borrow(self)
pub extern "c" fn Window::destroy(self : Window) = "moonbit_gtk_window_destroy"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.fullscreen.html).
#borrow(self)
pub extern "c" fn Window::fullscreen(self : Window) = "moonbit_gtk_window_fullscreen"

///|
#borrow(self_, monitor)
extern "c" fn moonbit_gtk_window_fullscreen_on_monitor(
  self_ : Window,
  monitor : @gdk.Monitor,
) = "moonbit_gtk_window_fullscreen_on_monitor"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.fullscreen_on_monitor.html).
pub fn Window::fullscreen_on_monitor(
  self : Window,
  monitor : &@gdk.IMonitor,
) -> Unit {
  moonbit_gtk_window_fullscreen_on_monitor(self, monitor.as_monitor())
}

///|
#borrow(self_)
extern "c" fn moonbit_gtk_window_get_application(
  self_ : Window,
) -> @glib.Nullable[Application] = "moonbit_gtk_window_get_application"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.get_application.html).
pub fn Window::get_application(self : Window) -> Application? {
  let raw_result = moonbit_gtk_window_get_application(self)
  raw_result.to_option()
}

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

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.get_decorated.html).
#borrow(self)
pub extern "c" fn Window::get_decorated(self : Window) -> Bool = "moonbit_gtk_window_get_decorated"

///|
#borrow(self_, width, height)
extern "c" fn moonbit_gtk_window_get_default_size(
  self_ : Window,
  width : Ref[Int],
  height : Ref[Int],
) = "moonbit_gtk_window_get_default_size"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.get_default_size.html).
pub fn Window::get_default_size(self : Window) -> (Int, Int) {
  let width = Ref(0)
  let height = Ref(0)
  moonbit_gtk_window_get_default_size(self, width, height)
  (width.val, height.val)
}

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

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.get_deletable.html).
#borrow(self)
pub extern "c" fn Window::get_deletable(self : Window) -> Bool = "moonbit_gtk_window_get_deletable"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.get_destroy_with_parent.html).
#borrow(self)
pub extern "c" fn Window::get_destroy_with_parent(self : Window) -> Bool = "moonbit_gtk_window_get_destroy_with_parent"

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

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.get_focus_visible.html).
#borrow(self)
pub extern "c" fn Window::get_focus_visible(self : Window) -> Bool = "moonbit_gtk_window_get_focus_visible"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.get_gravity.html).
#borrow(self)
pub extern "c" fn Window::get_gravity(self : Window) -> WindowGravity = "moonbit_gtk_window_get_gravity"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.get_group.html).
#borrow(self)
pub extern "c" fn Window::get_group(self : Window) -> WindowGroup = "moonbit_gtk_window_get_group"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.get_handle_menubar_accel.html).
#borrow(self)
pub extern "c" fn Window::get_handle_menubar_accel(self : Window) -> Bool = "moonbit_gtk_window_get_handle_menubar_accel"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.get_hide_on_close.html).
#borrow(self)
pub extern "c" fn Window::get_hide_on_close(self : Window) -> Bool = "moonbit_gtk_window_get_hide_on_close"

///|
#borrow(self_)
extern "c" fn moonbit_gtk_window_get_icon_name(
  self_ : Window,
) -> @glib.Nullable[Bytes] = "moonbit_gtk_window_get_icon_name"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.get_icon_name.html).
pub fn Window::get_icon_name(self : Window) -> String? {
  let result = moonbit_gtk_window_get_icon_name(self)
  match result.to_option() {
    Some(bytes) => Some(@encoding/utf8.decode_lossy(bytes))
    None => None
  }
}

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.get_mnemonics_visible.html).
#borrow(self)
pub extern "c" fn Window::get_mnemonics_visible(self : Window) -> Bool = "moonbit_gtk_window_get_mnemonics_visible"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.get_modal.html).
#borrow(self)
pub extern "c" fn Window::get_modal(self : Window) -> Bool = "moonbit_gtk_window_get_modal"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.get_resizable.html).
#borrow(self)
pub extern "c" fn Window::get_resizable(self : Window) -> Bool = "moonbit_gtk_window_get_resizable"

///|
#borrow(self_)
extern "c" fn moonbit_gtk_window_get_title(
  self_ : Window,
) -> @glib.Nullable[Bytes] = "moonbit_gtk_window_get_title"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.get_title.html).
pub fn Window::get_title(self : Window) -> String? {
  let result = moonbit_gtk_window_get_title(self)
  match result.to_option() {
    Some(bytes) => Some(@encoding/utf8.decode_lossy(bytes))
    None => None
  }
}

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

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

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

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.has_group.html).
#borrow(self)
pub extern "c" fn Window::has_group(self : Window) -> Bool = "moonbit_gtk_window_has_group"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.is_active.html).
#borrow(self)
pub extern "c" fn Window::is_active(self : Window) -> Bool = "moonbit_gtk_window_is_active"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.is_fullscreen.html).
#borrow(self)
pub extern "c" fn Window::is_fullscreen(self : Window) -> Bool = "moonbit_gtk_window_is_fullscreen"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.is_maximized.html).
#borrow(self)
pub extern "c" fn Window::is_maximized(self : Window) -> Bool = "moonbit_gtk_window_is_maximized"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.is_suspended.html).
#borrow(self)
pub extern "c" fn Window::is_suspended(self : Window) -> Bool = "moonbit_gtk_window_is_suspended"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.maximize.html).
#borrow(self)
pub extern "c" fn Window::maximize(self : Window) = "moonbit_gtk_window_maximize"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.minimize.html).
#borrow(self)
pub extern "c" fn Window::minimize(self : Window) = "moonbit_gtk_window_minimize"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.present.html).
#borrow(self)
pub extern "c" fn Window::present(self : Window) = "moonbit_gtk_window_present"

///|
#borrow(self_, application)
extern "c" fn moonbit_gtk_window_set_application(
  self_ : Window,
  application : @glib.Nullable[Application],
) = "moonbit_gtk_window_set_application"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.set_application.html).
pub fn Window::set_application(
  self : Window,
  application : &IApplication?,
) -> Unit {
  moonbit_gtk_window_set_application(
    self,
    match application {
      Some(v) => @glib.Nullable::some(v.as_application())
      None => @glib.Nullable::null()
    },
  )
}

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

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.set_decorated.html).
#borrow(self)
pub extern "c" fn Window::set_decorated(self : Window, setting : Bool) = "moonbit_gtk_window_set_decorated"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.set_default_size.html).
#borrow(self)
pub extern "c" fn Window::set_default_size(
  self : Window,
  width : Int,
  height : Int,
) = "moonbit_gtk_window_set_default_size"

///|
#borrow(self_, default_widget)
extern "c" fn moonbit_gtk_window_set_default_widget(
  self_ : Window,
  default_widget : @glib.Nullable[Widget],
) = "moonbit_gtk_window_set_default_widget"

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.set_deletable.html).
#borrow(self)
pub extern "c" fn Window::set_deletable(self : Window, setting : Bool) = "moonbit_gtk_window_set_deletable"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.set_destroy_with_parent.html).
#borrow(self)
pub extern "c" fn Window::set_destroy_with_parent(
  self : Window,
  setting : Bool,
) = "moonbit_gtk_window_set_destroy_with_parent"

///|
#borrow(self_, display)
extern "c" fn moonbit_gtk_window_set_display(
  self_ : Window,
  display : @gdk.Display,
) = "moonbit_gtk_window_set_display"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.set_display.html).
pub fn Window::set_display(self : Window, display : &@gdk.IDisplay) -> Unit {
  moonbit_gtk_window_set_display(self, display.as_display())
}

///|
#borrow(self_, focus)
extern "c" fn moonbit_gtk_window_set_focus(
  self_ : Window,
  focus : @glib.Nullable[Widget],
) = "moonbit_gtk_window_set_focus"

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.set_focus_visible.html).
#borrow(self)
pub extern "c" fn Window::set_focus_visible(self : Window, setting : Bool) = "moonbit_gtk_window_set_focus_visible"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.set_gravity.html).
#borrow(self)
pub extern "c" fn Window::set_gravity(self : Window, gravity : WindowGravity) = "moonbit_gtk_window_set_gravity"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.set_handle_menubar_accel.html).
#borrow(self)
pub extern "c" fn Window::set_handle_menubar_accel(
  self : Window,
  handle_menubar_accel : Bool,
) = "moonbit_gtk_window_set_handle_menubar_accel"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.set_hide_on_close.html).
#borrow(self)
pub extern "c" fn Window::set_hide_on_close(self : Window, setting : Bool) = "moonbit_gtk_window_set_hide_on_close"

///|
#borrow(self_, name)
extern "c" fn moonbit_gtk_window_set_icon_name(
  self_ : Window,
  name : @glib.Nullable[Bytes],
) = "moonbit_gtk_window_set_icon_name"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.set_icon_name.html).
pub fn Window::set_icon_name(self : Window, name : String?) -> Unit {
  moonbit_gtk_window_set_icon_name(
    self,
    match name {
      Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
      None => @glib.Nullable::null()
    },
  )
}

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.set_mnemonics_visible.html).
#borrow(self)
pub extern "c" fn Window::set_mnemonics_visible(self : Window, setting : Bool) = "moonbit_gtk_window_set_mnemonics_visible"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.set_modal.html).
#borrow(self)
pub extern "c" fn Window::set_modal(self : Window, modal : Bool) = "moonbit_gtk_window_set_modal"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.set_resizable.html).
#borrow(self)
pub extern "c" fn Window::set_resizable(self : Window, resizable : Bool) = "moonbit_gtk_window_set_resizable"

///|
#borrow(self_, startup_id)
extern "c" fn moonbit_gtk_window_set_startup_id(
  self_ : Window,
  startup_id : Bytes,
) = "moonbit_gtk_window_set_startup_id"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.set_startup_id.html).
pub fn Window::set_startup_id(self : Window, startup_id : String) -> Unit {
  moonbit_gtk_window_set_startup_id(self, @encoding/utf8.encode(startup_id))
}

///|
#borrow(self_, title)
extern "c" fn moonbit_gtk_window_set_title(
  self_ : Window,
  title : @glib.Nullable[Bytes],
) = "moonbit_gtk_window_set_title"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.set_title.html).
pub fn Window::set_title(self : Window, title : String?) -> Unit {
  moonbit_gtk_window_set_title(
    self,
    match title {
      Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
      None => @glib.Nullable::null()
    },
  )
}

///|
#borrow(self_, titlebar)
extern "c" fn moonbit_gtk_window_set_titlebar(
  self_ : Window,
  titlebar : @glib.Nullable[Widget],
) = "moonbit_gtk_window_set_titlebar"

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

///|
#borrow(self_, parent)
extern "c" fn moonbit_gtk_window_set_transient_for(
  self_ : Window,
  parent : @glib.Nullable[Window],
) = "moonbit_gtk_window_set_transient_for"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.set_transient_for.html).
pub fn Window::set_transient_for(self : Window, parent : &IWindow?) -> Unit {
  moonbit_gtk_window_set_transient_for(
    self,
    match parent {
      Some(v) => @glib.Nullable::some(v.as_window())
      None => @glib.Nullable::null()
    },
  )
}

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.unfullscreen.html).
#borrow(self)
pub extern "c" fn Window::unfullscreen(self : Window) = "moonbit_gtk_window_unfullscreen"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.unmaximize.html).
#borrow(self)
pub extern "c" fn Window::unmaximize(self : Window) = "moonbit_gtk_window_unmaximize"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Window.unminimize.html).
#borrow(self)
pub extern "c" fn Window::unminimize(self : Window) = "moonbit_gtk_window_unminimize"

///|
#borrow(instance)
extern "c" fn gtk_window_connect_activate_default(
  instance : Window,
  function : FuncRef[(Window, (Window) -> Unit) -> Unit],
  closure : (Window) -> Unit,
) -> UInt64 = "moonbit_gtk_window_connect_activate_default"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/signal.Window.activate-default.html).
pub fn Window::connect_activate_default(
  self : Window,
  f : (Window) -> Unit,
) -> UInt64 {
  gtk_window_connect_activate_default(
    self,
    fn(instance_, f) { f(instance_) },
    f,
  )
}

///|
#borrow(instance)
extern "c" fn gtk_window_connect_activate_focus(
  instance : Window,
  function : FuncRef[(Window, (Window) -> Unit) -> Unit],
  closure : (Window) -> Unit,
) -> UInt64 = "moonbit_gtk_window_connect_activate_focus"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/signal.Window.activate-focus.html).
pub fn Window::connect_activate_focus(
  self : Window,
  f : (Window) -> Unit,
) -> UInt64 {
  gtk_window_connect_activate_focus(self, fn(instance_, f) { f(instance_) }, f)
}

///|
#borrow(instance)
extern "c" fn gtk_window_connect_close_request(
  instance : Window,
  function : FuncRef[(Window, (Window) -> Bool) -> Bool],
  closure : (Window) -> Bool,
) -> UInt64 = "moonbit_gtk_window_connect_close_request"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/signal.Window.close-request.html).
pub fn Window::connect_close_request(
  self : Window,
  f : (Window) -> Bool,
) -> UInt64 {
  gtk_window_connect_close_request(self, fn(instance_, f) { f(instance_) }, f)
}

///|
#borrow(instance)
extern "c" fn gtk_window_connect_enable_debugging(
  instance : Window,
  function : FuncRef[(Window, Bool, (Window, Bool) -> Bool) -> Bool],
  closure : (Window, Bool) -> Bool,
) -> UInt64 = "moonbit_gtk_window_connect_enable_debugging"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/signal.Window.enable-debugging.html).
pub fn Window::connect_enable_debugging(
  self : Window,
  f : (Window, Bool) -> Bool,
) -> UInt64 {
  gtk_window_connect_enable_debugging(
    self,
    fn(instance_, toggle, f) { f(instance_, toggle) },
    f,
  )
}

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/property.Window.default-height.html).
#borrow(self_)
pub extern "c" fn Window::get_default_height(self_ : Window) -> Int = "moonbit_gtk_window_get_default_height"

///|
#borrow(self_, value)
pub extern "c" fn Window::set_default_height(self_ : Window, value : Int) = "moonbit_gtk_window_set_default_height"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/property.Window.default-width.html).
#borrow(self_)
pub extern "c" fn Window::get_default_width(self_ : Window) -> Int = "moonbit_gtk_window_get_default_width"

///|
#borrow(self_, value)
pub extern "c" fn Window::set_default_width(self_ : Window, value : Int) = "moonbit_gtk_window_set_default_width"

///|
#borrow(self_)
extern "c" fn moonbit_gtk_window_get_display(
  self_ : Window,
) -> @glib.Nullable[@gdk.Display] = "moonbit_gtk_window_get_display"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/property.Window.display.html).
pub fn Window::get_display(self : Window) -> @gdk.Display? {
  moonbit_gtk_window_get_display(self).to_option()
}

///|
#borrow(self_)
extern "c" fn moonbit_gtk_window_set_fullscreened(self_ : Window, value : Int) = "moonbit_gtk_window_set_fullscreened"

///|
pub fn Window::set_fullscreened(self : Window, value : Bool) -> Unit {
  moonbit_gtk_window_set_fullscreened(self, if value { 1 } else { 0 })
}

///|
#borrow(self_)
extern "c" fn moonbit_gtk_window_set_maximized(self_ : Window, value : Int) = "moonbit_gtk_window_set_maximized"

///|
pub fn Window::set_maximized(self : Window, value : Bool) -> Unit {
  moonbit_gtk_window_set_maximized(self, if value { 1 } else { 0 })
}

///|
impl IWindow with fn close(self) -> Unit {
  self.as_window().close()
}

///|
impl IWindow with fn destroy(self) -> Unit {
  self.as_window().destroy()
}

///|
impl IWindow with fn fullscreen(self) -> Unit {
  self.as_window().fullscreen()
}

///|
impl IWindow with fn fullscreen_on_monitor(self, monitor) -> Unit {
  self.as_window().fullscreen_on_monitor(monitor)
}

///|
impl IWindow with fn get_application(self) -> Application? {
  self.as_window().get_application()
}

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

///|
impl IWindow with fn get_decorated(self) -> Bool {
  self.as_window().get_decorated()
}

///|
impl IWindow with fn get_default_size(self) -> (Int, Int) {
  self.as_window().get_default_size()
}

///|
impl IWindow with fn get_default_widget(self) -> Widget? {
  self.as_window().get_default_widget()
}

///|
impl IWindow with fn get_deletable(self) -> Bool {
  self.as_window().get_deletable()
}

///|
impl IWindow with fn get_destroy_with_parent(self) -> Bool {
  self.as_window().get_destroy_with_parent()
}

///|
impl IWindow with fn get_focus(self) -> Widget? {
  self.as_window().get_focus()
}

///|
impl IWindow with fn get_focus_visible(self) -> Bool {
  self.as_window().get_focus_visible()
}

///|
impl IWindow with fn get_gravity(self) -> WindowGravity {
  self.as_window().get_gravity()
}

///|
impl IWindow with fn get_group(self) -> WindowGroup {
  self.as_window().get_group()
}

///|
impl IWindow with fn get_handle_menubar_accel(self) -> Bool {
  self.as_window().get_handle_menubar_accel()
}

///|
impl IWindow with fn get_hide_on_close(self) -> Bool {
  self.as_window().get_hide_on_close()
}

///|
impl IWindow with fn get_icon_name(self) -> String? {
  self.as_window().get_icon_name()
}

///|
impl IWindow with fn get_mnemonics_visible(self) -> Bool {
  self.as_window().get_mnemonics_visible()
}

///|
impl IWindow with fn get_modal(self) -> Bool {
  self.as_window().get_modal()
}

///|
impl IWindow with fn get_resizable(self) -> Bool {
  self.as_window().get_resizable()
}

///|
impl IWindow with fn get_title(self) -> String? {
  self.as_window().get_title()
}

///|
impl IWindow with fn get_titlebar(self) -> Widget? {
  self.as_window().get_titlebar()
}

///|
impl IWindow with fn get_transient_for(self) -> Window? {
  self.as_window().get_transient_for()
}

///|
impl IWindow with fn has_group(self) -> Bool {
  self.as_window().has_group()
}

///|
impl IWindow with fn is_active(self) -> Bool {
  self.as_window().is_active()
}

///|
impl IWindow with fn is_fullscreen(self) -> Bool {
  self.as_window().is_fullscreen()
}

///|
impl IWindow with fn is_maximized(self) -> Bool {
  self.as_window().is_maximized()
}

///|
impl IWindow with fn is_suspended(self) -> Bool {
  self.as_window().is_suspended()
}

///|
impl IWindow with fn maximize(self) -> Unit {
  self.as_window().maximize()
}

///|
impl IWindow with fn minimize(self) -> Unit {
  self.as_window().minimize()
}

///|
impl IWindow with fn present(self) -> Unit {
  self.as_window().present()
}

///|
impl IWindow with fn set_application(self, application) -> Unit {
  self.as_window().set_application(application)
}

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

///|
impl IWindow with fn set_decorated(self, setting) -> Unit {
  self.as_window().set_decorated(setting)
}

///|
impl IWindow with fn set_default_size(self, width, height) -> Unit {
  self.as_window().set_default_size(width, height)
}

///|
impl IWindow with fn set_default_widget(self, default_widget) -> Unit {
  self.as_window().set_default_widget(default_widget)
}

///|
impl IWindow with fn set_deletable(self, setting) -> Unit {
  self.as_window().set_deletable(setting)
}

///|
impl IWindow with fn set_destroy_with_parent(self, setting) -> Unit {
  self.as_window().set_destroy_with_parent(setting)
}

///|
impl IWindow with fn set_display(self, display) -> Unit {
  self.as_window().set_display(display)
}

///|
impl IWindow with fn set_focus(self, focus) -> Unit {
  self.as_window().set_focus(focus)
}

///|
impl IWindow with fn set_focus_visible(self, setting) -> Unit {
  self.as_window().set_focus_visible(setting)
}

///|
impl IWindow with fn set_gravity(self, gravity) -> Unit {
  self.as_window().set_gravity(gravity)
}

///|
impl IWindow with fn set_handle_menubar_accel(self, handle_menubar_accel) -> Unit {
  self.as_window().set_handle_menubar_accel(handle_menubar_accel)
}

///|
impl IWindow with fn set_hide_on_close(self, setting) -> Unit {
  self.as_window().set_hide_on_close(setting)
}

///|
impl IWindow with fn set_icon_name(self, name) -> Unit {
  self.as_window().set_icon_name(name)
}

///|
impl IWindow with fn set_mnemonics_visible(self, setting) -> Unit {
  self.as_window().set_mnemonics_visible(setting)
}

///|
impl IWindow with fn set_modal(self, modal) -> Unit {
  self.as_window().set_modal(modal)
}

///|
impl IWindow with fn set_resizable(self, resizable) -> Unit {
  self.as_window().set_resizable(resizable)
}

///|
impl IWindow with fn set_startup_id(self, startup_id) -> Unit {
  self.as_window().set_startup_id(startup_id)
}

///|
impl IWindow with fn set_title(self, title) -> Unit {
  self.as_window().set_title(title)
}

///|
impl IWindow with fn set_titlebar(self, titlebar) -> Unit {
  self.as_window().set_titlebar(titlebar)
}

///|
impl IWindow with fn set_transient_for(self, parent) -> Unit {
  self.as_window().set_transient_for(parent)
}

///|
impl IWindow with fn unfullscreen(self) -> Unit {
  self.as_window().unfullscreen()
}

///|
impl IWindow with fn unmaximize(self) -> Unit {
  self.as_window().unmaximize()
}

///|
impl IWindow with fn unminimize(self) -> Unit {
  self.as_window().unminimize()
}

///|
impl IWindow with fn connect_activate_default(self, f) -> UInt64 {
  self.as_window().connect_activate_default(f)
}

///|
impl IWindow with fn connect_activate_focus(self, f) -> UInt64 {
  self.as_window().connect_activate_focus(f)
}

///|
impl IWindow with fn connect_close_request(self, f) -> UInt64 {
  self.as_window().connect_close_request(f)
}

///|
impl IWindow with fn connect_enable_debugging(self, f) -> UInt64 {
  self.as_window().connect_enable_debugging(f)
}

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

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

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

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

///|
pub fn Window::as_native(self : Window) -> Native = "%identity"

///|
pub impl INative for Window with fn as_native(self) {
  self.as_native()
}

///|
pub fn Window::as_root(self : Window) -> Root = "%identity"

///|
pub impl IRoot for Window with fn as_root(self) {
  self.as_root()
}