// GENERATED — DO NOT EDIT

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

///|
pub(open) trait IPaned {
  fn as_paned(Self) -> Paned
  fn get_end_child(Self) -> Widget? = _
  fn get_position(Self) -> Int = _
  fn get_resize_end_child(Self) -> Bool = _
  fn get_resize_start_child(Self) -> Bool = _
  fn get_shrink_end_child(Self) -> Bool = _
  fn get_shrink_start_child(Self) -> Bool = _
  fn get_start_child(Self) -> Widget? = _
  fn get_wide_handle(Self) -> Bool = _
  fn set_end_child(Self, &IWidget?) -> Unit = _
  fn set_position(Self, Int) -> Unit = _
  fn set_resize_end_child(Self, Bool) -> Unit = _
  fn set_resize_start_child(Self, Bool) -> Unit = _
  fn set_shrink_end_child(Self, Bool) -> Unit = _
  fn set_shrink_start_child(Self, Bool) -> Unit = _
  fn set_start_child(Self, &IWidget?) -> Unit = _
  fn set_wide_handle(Self, Bool) -> Unit = _
  fn connect_accept_position(Self, (Paned) -> Bool) -> UInt64 = _
  fn connect_cancel_position(Self, (Paned) -> Bool) -> UInt64 = _
  fn connect_cycle_child_focus(Self, (Paned, Bool) -> Bool) -> UInt64 = _
  fn connect_cycle_handle_focus(Self, (Paned, Bool) -> Bool) -> UInt64 = _
  fn connect_move_handle(Self, (Paned, ScrollType) -> Bool) -> UInt64 = _
  fn connect_toggle_handle_focus(Self, (Paned) -> Bool) -> UInt64 = _
}

///|
pub impl IPaned for Paned with fn as_paned(self) {
  self
}

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

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

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Paned.get_position.html).
#borrow(self)
pub extern "c" fn Paned::get_position(self : Paned) -> Int = "moonbit_gtk_paned_get_position"

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

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

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

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

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

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

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

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

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Paned.set_position.html).
#borrow(self)
pub extern "c" fn Paned::set_position(self : Paned, position : Int) = "moonbit_gtk_paned_set_position"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Paned.set_resize_end_child.html).
#borrow(self)
pub extern "c" fn Paned::set_resize_end_child(self : Paned, resize : Bool) = "moonbit_gtk_paned_set_resize_end_child"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Paned.set_resize_start_child.html).
#borrow(self)
pub extern "c" fn Paned::set_resize_start_child(self : Paned, resize : Bool) = "moonbit_gtk_paned_set_resize_start_child"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Paned.set_shrink_end_child.html).
#borrow(self)
pub extern "c" fn Paned::set_shrink_end_child(self : Paned, resize : Bool) = "moonbit_gtk_paned_set_shrink_end_child"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Paned.set_shrink_start_child.html).
#borrow(self)
pub extern "c" fn Paned::set_shrink_start_child(self : Paned, resize : Bool) = "moonbit_gtk_paned_set_shrink_start_child"

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

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Paned.set_wide_handle.html).
#borrow(self)
pub extern "c" fn Paned::set_wide_handle(self : Paned, wide : Bool) = "moonbit_gtk_paned_set_wide_handle"

///|
#borrow(instance)
extern "c" fn gtk_paned_connect_accept_position(
  instance : Paned,
  function : FuncRef[(Paned, (Paned) -> Bool) -> Bool],
  closure : (Paned) -> Bool,
) -> UInt64 = "moonbit_gtk_paned_connect_accept_position"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/signal.Paned.accept-position.html).
pub fn Paned::connect_accept_position(
  self : Paned,
  f : (Paned) -> Bool,
) -> UInt64 {
  gtk_paned_connect_accept_position(self, fn(instance_, f) { f(instance_) }, f)
}

///|
#borrow(instance)
extern "c" fn gtk_paned_connect_cancel_position(
  instance : Paned,
  function : FuncRef[(Paned, (Paned) -> Bool) -> Bool],
  closure : (Paned) -> Bool,
) -> UInt64 = "moonbit_gtk_paned_connect_cancel_position"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/signal.Paned.cancel-position.html).
pub fn Paned::connect_cancel_position(
  self : Paned,
  f : (Paned) -> Bool,
) -> UInt64 {
  gtk_paned_connect_cancel_position(self, fn(instance_, f) { f(instance_) }, f)
}

///|
#borrow(instance)
extern "c" fn gtk_paned_connect_cycle_child_focus(
  instance : Paned,
  function : FuncRef[(Paned, Bool, (Paned, Bool) -> Bool) -> Bool],
  closure : (Paned, Bool) -> Bool,
) -> UInt64 = "moonbit_gtk_paned_connect_cycle_child_focus"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/signal.Paned.cycle-child-focus.html).
pub fn Paned::connect_cycle_child_focus(
  self : Paned,
  f : (Paned, Bool) -> Bool,
) -> UInt64 {
  gtk_paned_connect_cycle_child_focus(
    self,
    fn(instance_, reversed, f) { f(instance_, reversed) },
    f,
  )
}

///|
#borrow(instance)
extern "c" fn gtk_paned_connect_cycle_handle_focus(
  instance : Paned,
  function : FuncRef[(Paned, Bool, (Paned, Bool) -> Bool) -> Bool],
  closure : (Paned, Bool) -> Bool,
) -> UInt64 = "moonbit_gtk_paned_connect_cycle_handle_focus"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/signal.Paned.cycle-handle-focus.html).
pub fn Paned::connect_cycle_handle_focus(
  self : Paned,
  f : (Paned, Bool) -> Bool,
) -> UInt64 {
  gtk_paned_connect_cycle_handle_focus(
    self,
    fn(instance_, reversed, f) { f(instance_, reversed) },
    f,
  )
}

///|
#borrow(instance)
extern "c" fn gtk_paned_connect_move_handle(
  instance : Paned,
  function : FuncRef[(Paned, ScrollType, (Paned, ScrollType) -> Bool) -> Bool],
  closure : (Paned, ScrollType) -> Bool,
) -> UInt64 = "moonbit_gtk_paned_connect_move_handle"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/signal.Paned.move-handle.html).
pub fn Paned::connect_move_handle(
  self : Paned,
  f : (Paned, ScrollType) -> Bool,
) -> UInt64 {
  gtk_paned_connect_move_handle(
    self,
    fn(instance_, scroll_type, f) { f(instance_, scroll_type) },
    f,
  )
}

///|
#borrow(instance)
extern "c" fn gtk_paned_connect_toggle_handle_focus(
  instance : Paned,
  function : FuncRef[(Paned, (Paned) -> Bool) -> Bool],
  closure : (Paned) -> Bool,
) -> UInt64 = "moonbit_gtk_paned_connect_toggle_handle_focus"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/signal.Paned.toggle-handle-focus.html).
pub fn Paned::connect_toggle_handle_focus(
  self : Paned,
  f : (Paned) -> Bool,
) -> UInt64 {
  gtk_paned_connect_toggle_handle_focus(
    self,
    fn(instance_, f) { f(instance_) },
    f,
  )
}

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/property.Paned.max-position.html).
#borrow(self_)
pub extern "c" fn Paned::get_max_position(self_ : Paned) -> Int = "moonbit_gtk_paned_get_max_position"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/property.Paned.min-position.html).
#borrow(self_)
pub extern "c" fn Paned::get_min_position(self_ : Paned) -> Int = "moonbit_gtk_paned_get_min_position"

///|
#borrow(self_)
extern "c" fn moonbit_gtk_paned_get_position_set(self_ : Paned) -> Int = "moonbit_gtk_paned_get_position_set"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/property.Paned.position-set.html).
pub fn Paned::get_position_set(self : Paned) -> Bool {
  moonbit_gtk_paned_get_position_set(self) != 0
}

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

///|
pub fn Paned::set_position_set(self : Paned, value : Bool) -> Unit {
  moonbit_gtk_paned_set_position_set(self, if value { 1 } else { 0 })
}

///|
impl IPaned with fn get_end_child(self) -> Widget? {
  self.as_paned().get_end_child()
}

///|
impl IPaned with fn get_position(self) -> Int {
  self.as_paned().get_position()
}

///|
impl IPaned with fn get_resize_end_child(self) -> Bool {
  self.as_paned().get_resize_end_child()
}

///|
impl IPaned with fn get_resize_start_child(self) -> Bool {
  self.as_paned().get_resize_start_child()
}

///|
impl IPaned with fn get_shrink_end_child(self) -> Bool {
  self.as_paned().get_shrink_end_child()
}

///|
impl IPaned with fn get_shrink_start_child(self) -> Bool {
  self.as_paned().get_shrink_start_child()
}

///|
impl IPaned with fn get_start_child(self) -> Widget? {
  self.as_paned().get_start_child()
}

///|
impl IPaned with fn get_wide_handle(self) -> Bool {
  self.as_paned().get_wide_handle()
}

///|
impl IPaned with fn set_end_child(self, child) -> Unit {
  self.as_paned().set_end_child(child)
}

///|
impl IPaned with fn set_position(self, position) -> Unit {
  self.as_paned().set_position(position)
}

///|
impl IPaned with fn set_resize_end_child(self, resize) -> Unit {
  self.as_paned().set_resize_end_child(resize)
}

///|
impl IPaned with fn set_resize_start_child(self, resize) -> Unit {
  self.as_paned().set_resize_start_child(resize)
}

///|
impl IPaned with fn set_shrink_end_child(self, resize) -> Unit {
  self.as_paned().set_shrink_end_child(resize)
}

///|
impl IPaned with fn set_shrink_start_child(self, resize) -> Unit {
  self.as_paned().set_shrink_start_child(resize)
}

///|
impl IPaned with fn set_start_child(self, child) -> Unit {
  self.as_paned().set_start_child(child)
}

///|
impl IPaned with fn set_wide_handle(self, wide) -> Unit {
  self.as_paned().set_wide_handle(wide)
}

///|
impl IPaned with fn connect_accept_position(self, f) -> UInt64 {
  self.as_paned().connect_accept_position(f)
}

///|
impl IPaned with fn connect_cancel_position(self, f) -> UInt64 {
  self.as_paned().connect_cancel_position(f)
}

///|
impl IPaned with fn connect_cycle_child_focus(self, f) -> UInt64 {
  self.as_paned().connect_cycle_child_focus(f)
}

///|
impl IPaned with fn connect_cycle_handle_focus(self, f) -> UInt64 {
  self.as_paned().connect_cycle_handle_focus(f)
}

///|
impl IPaned with fn connect_move_handle(self, f) -> UInt64 {
  self.as_paned().connect_move_handle(f)
}

///|
impl IPaned with fn connect_toggle_handle_focus(self, f) -> UInt64 {
  self.as_paned().connect_toggle_handle_focus(f)
}

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

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

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

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

///|
pub fn Paned::as_orientable(self : Paned) -> Orientable = "%identity"

///|
pub impl IOrientable for Paned with fn as_orientable(self) {
  self.as_orientable()
}