// GENERATED — DO NOT EDIT

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

///|
pub(open) trait ISwitch {
  fn as_switch(Self) -> Switch
  fn get_active(Self) -> Bool = _
  fn get_state(Self) -> Bool = _
  fn set_active(Self, Bool) -> Unit = _
  fn set_state(Self, Bool) -> Unit = _
  fn connect_activate(Self, (Switch) -> Unit) -> UInt64 = _
  fn connect_state_set(Self, (Switch, Bool) -> Bool) -> UInt64 = _
}

///|
pub impl ISwitch for Switch with fn as_switch(self) {
  self
}

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

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

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Switch.set_active.html).
#borrow(self)
pub extern "c" fn Switch::set_active(self : Switch, is_active : Bool) = "moonbit_gtk_switch_set_active"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Switch.set_state.html).
#borrow(self)
pub extern "c" fn Switch::set_state(self : Switch, state : Bool) = "moonbit_gtk_switch_set_state"

///|
#borrow(instance)
extern "c" fn gtk_switch_connect_activate(
  instance : Switch,
  function : FuncRef[(Switch, (Switch) -> Unit) -> Unit],
  closure : (Switch) -> Unit,
) -> UInt64 = "moonbit_gtk_switch_connect_activate"

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

///|
#borrow(instance)
extern "c" fn gtk_switch_connect_state_set(
  instance : Switch,
  function : FuncRef[(Switch, Bool, (Switch, Bool) -> Bool) -> Bool],
  closure : (Switch, Bool) -> Bool,
) -> UInt64 = "moonbit_gtk_switch_connect_state_set"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/signal.Switch.state-set.html).
pub fn Switch::connect_state_set(
  self : Switch,
  f : (Switch, Bool) -> Bool,
) -> UInt64 {
  gtk_switch_connect_state_set(
    self,
    fn(instance_, state, f) { f(instance_, state) },
    f,
  )
}

///|
impl ISwitch with fn get_active(self) -> Bool {
  self.as_switch().get_active()
}

///|
impl ISwitch with fn get_state(self) -> Bool {
  self.as_switch().get_state()
}

///|
impl ISwitch with fn set_active(self, is_active) -> Unit {
  self.as_switch().set_active(is_active)
}

///|
impl ISwitch with fn set_state(self, state) -> Unit {
  self.as_switch().set_state(state)
}

///|
impl ISwitch with fn connect_activate(self, f) -> UInt64 {
  self.as_switch().connect_activate(f)
}

///|
impl ISwitch with fn connect_state_set(self, f) -> UInt64 {
  self.as_switch().connect_state_set(f)
}

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

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

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

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