// GENERATED — DO NOT EDIT

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

///|
pub(open) trait IGrid {
  fn as_grid(Self) -> Grid
  fn attach(Self, &IWidget, Int, Int, Int, Int) -> Unit = _
  fn attach_next_to(Self, &IWidget, &IWidget?, PositionType, Int, Int) -> Unit = _
  fn get_baseline_row(Self) -> Int = _
  fn get_child_at(Self, Int, Int) -> Widget? = _
  fn get_column_homogeneous(Self) -> Bool = _
  fn get_column_spacing(Self) -> UInt = _
  fn get_row_baseline_position(Self, Int) -> BaselinePosition = _
  fn get_row_homogeneous(Self) -> Bool = _
  fn get_row_spacing(Self) -> UInt = _
  fn insert_column(Self, Int) -> Unit = _
  fn insert_next_to(Self, &IWidget, PositionType) -> Unit = _
  fn insert_row(Self, Int) -> Unit = _
  fn query_child(Self, &IWidget) -> (Int, Int, Int, Int) = _
  fn remove(Self, &IWidget) -> Unit = _
  fn remove_column(Self, Int) -> Unit = _
  fn remove_row(Self, Int) -> Unit = _
  fn set_baseline_row(Self, Int) -> Unit = _
  fn set_column_homogeneous(Self, Bool) -> Unit = _
  fn set_column_spacing(Self, UInt) -> Unit = _
  fn set_row_baseline_position(Self, Int, BaselinePosition) -> Unit = _
  fn set_row_homogeneous(Self, Bool) -> Unit = _
  fn set_row_spacing(Self, UInt) -> Unit = _
}

///|
pub impl IGrid for Grid with fn as_grid(self) {
  self
}

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

///|
#borrow(self_, child)
extern "c" fn moonbit_gtk_grid_attach(
  self_ : Grid,
  child : Widget,
  column : Int,
  row : Int,
  width : Int,
  height : Int,
) = "moonbit_gtk_grid_attach"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Grid.attach.html).
pub fn Grid::attach(
  self : Grid,
  child : &IWidget,
  column : Int,
  row : Int,
  width : Int,
  height : Int,
) -> Unit {
  moonbit_gtk_grid_attach(self, child.as_widget(), column, row, width, height)
}

///|
#borrow(self_, child, sibling)
extern "c" fn moonbit_gtk_grid_attach_next_to(
  self_ : Grid,
  child : Widget,
  sibling : @glib.Nullable[Widget],
  side : PositionType,
  width : Int,
  height : Int,
) = "moonbit_gtk_grid_attach_next_to"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Grid.attach_next_to.html).
pub fn Grid::attach_next_to(
  self : Grid,
  child : &IWidget,
  sibling : &IWidget?,
  side : PositionType,
  width : Int,
  height : Int,
) -> Unit {
  moonbit_gtk_grid_attach_next_to(
    self,
    child.as_widget(),
    match sibling {
      Some(v) => @glib.Nullable::some(v.as_widget())
      None => @glib.Nullable::null()
    },
    side,
    width,
    height,
  )
}

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

///|
#borrow(self_)
extern "c" fn moonbit_gtk_grid_get_child_at(
  self_ : Grid,
  column : Int,
  row : Int,
) -> @glib.Nullable[Widget] = "moonbit_gtk_grid_get_child_at"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Grid.get_child_at.html).
pub fn Grid::get_child_at(self : Grid, column : Int, row : Int) -> Widget? {
  let raw_result = moonbit_gtk_grid_get_child_at(self, column, row)
  raw_result.to_option()
}

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Grid.get_column_spacing.html).
#borrow(self)
pub extern "c" fn Grid::get_column_spacing(self : Grid) -> UInt = "moonbit_gtk_grid_get_column_spacing"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Grid.get_row_baseline_position.html).
#borrow(self)
pub extern "c" fn Grid::get_row_baseline_position(
  self : Grid,
  row : Int,
) -> BaselinePosition = "moonbit_gtk_grid_get_row_baseline_position"

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Grid.get_row_spacing.html).
#borrow(self)
pub extern "c" fn Grid::get_row_spacing(self : Grid) -> UInt = "moonbit_gtk_grid_get_row_spacing"

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

///|
#borrow(self_, sibling)
extern "c" fn moonbit_gtk_grid_insert_next_to(
  self_ : Grid,
  sibling : Widget,
  side : PositionType,
) = "moonbit_gtk_grid_insert_next_to"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Grid.insert_next_to.html).
pub fn Grid::insert_next_to(
  self : Grid,
  sibling : &IWidget,
  side : PositionType,
) -> Unit {
  moonbit_gtk_grid_insert_next_to(self, sibling.as_widget(), side)
}

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

///|
#borrow(self_, child, column, row, width, height)
extern "c" fn moonbit_gtk_grid_query_child(
  self_ : Grid,
  child : Widget,
  column : Ref[Int],
  row : Ref[Int],
  width : Ref[Int],
  height : Ref[Int],
) = "moonbit_gtk_grid_query_child"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Grid.query_child.html).
pub fn Grid::query_child(self : Grid, child : &IWidget) -> (Int, Int, Int, Int) {
  let column = Ref(0)
  let row = Ref(0)
  let width = Ref(0)
  let height = Ref(0)
  moonbit_gtk_grid_query_child(
    self,
    child.as_widget(),
    column,
    row,
    width,
    height,
  )
  (column.val, row.val, width.val, height.val)
}

///|
#borrow(self_, child)
extern "c" fn moonbit_gtk_grid_remove(self_ : Grid, child : Widget) = "moonbit_gtk_grid_remove"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Grid.remove.html).
pub fn Grid::remove(self : Grid, child : &IWidget) -> Unit {
  moonbit_gtk_grid_remove(self, child.as_widget())
}

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

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Grid.set_baseline_row.html).
#borrow(self)
pub extern "c" fn Grid::set_baseline_row(self : Grid, row : Int) = "moonbit_gtk_grid_set_baseline_row"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Grid.set_column_homogeneous.html).
#borrow(self)
pub extern "c" fn Grid::set_column_homogeneous(self : Grid, homogeneous : Bool) = "moonbit_gtk_grid_set_column_homogeneous"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Grid.set_column_spacing.html).
#borrow(self)
pub extern "c" fn Grid::set_column_spacing(self : Grid, spacing : UInt) = "moonbit_gtk_grid_set_column_spacing"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Grid.set_row_baseline_position.html).
#borrow(self)
pub extern "c" fn Grid::set_row_baseline_position(
  self : Grid,
  row : Int,
  pos : BaselinePosition,
) = "moonbit_gtk_grid_set_row_baseline_position"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Grid.set_row_homogeneous.html).
#borrow(self)
pub extern "c" fn Grid::set_row_homogeneous(self : Grid, homogeneous : Bool) = "moonbit_gtk_grid_set_row_homogeneous"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.Grid.set_row_spacing.html).
#borrow(self)
pub extern "c" fn Grid::set_row_spacing(self : Grid, spacing : UInt) = "moonbit_gtk_grid_set_row_spacing"

///|
impl IGrid with fn attach(self, child, column, row, width, height) -> Unit {
  self.as_grid().attach(child, column, row, width, height)
}

///|
impl IGrid with fn attach_next_to(self, child, sibling, side, width, height) -> Unit {
  self.as_grid().attach_next_to(child, sibling, side, width, height)
}

///|
impl IGrid with fn get_baseline_row(self) -> Int {
  self.as_grid().get_baseline_row()
}

///|
impl IGrid with fn get_child_at(self, column, row) -> Widget? {
  self.as_grid().get_child_at(column, row)
}

///|
impl IGrid with fn get_column_homogeneous(self) -> Bool {
  self.as_grid().get_column_homogeneous()
}

///|
impl IGrid with fn get_column_spacing(self) -> UInt {
  self.as_grid().get_column_spacing()
}

///|
impl IGrid with fn get_row_baseline_position(self, row) -> BaselinePosition {
  self.as_grid().get_row_baseline_position(row)
}

///|
impl IGrid with fn get_row_homogeneous(self) -> Bool {
  self.as_grid().get_row_homogeneous()
}

///|
impl IGrid with fn get_row_spacing(self) -> UInt {
  self.as_grid().get_row_spacing()
}

///|
impl IGrid with fn insert_column(self, position) -> Unit {
  self.as_grid().insert_column(position)
}

///|
impl IGrid with fn insert_next_to(self, sibling, side) -> Unit {
  self.as_grid().insert_next_to(sibling, side)
}

///|
impl IGrid with fn insert_row(self, position) -> Unit {
  self.as_grid().insert_row(position)
}

///|
impl IGrid with fn query_child(self, child) -> (Int, Int, Int, Int) {
  self.as_grid().query_child(child)
}

///|
impl IGrid with fn remove(self, child) -> Unit {
  self.as_grid().remove(child)
}

///|
impl IGrid with fn remove_column(self, position) -> Unit {
  self.as_grid().remove_column(position)
}

///|
impl IGrid with fn remove_row(self, position) -> Unit {
  self.as_grid().remove_row(position)
}

///|
impl IGrid with fn set_baseline_row(self, row) -> Unit {
  self.as_grid().set_baseline_row(row)
}

///|
impl IGrid with fn set_column_homogeneous(self, homogeneous) -> Unit {
  self.as_grid().set_column_homogeneous(homogeneous)
}

///|
impl IGrid with fn set_column_spacing(self, spacing) -> Unit {
  self.as_grid().set_column_spacing(spacing)
}

///|
impl IGrid with fn set_row_baseline_position(self, row, pos) -> Unit {
  self.as_grid().set_row_baseline_position(row, pos)
}

///|
impl IGrid with fn set_row_homogeneous(self, homogeneous) -> Unit {
  self.as_grid().set_row_homogeneous(homogeneous)
}

///|
impl IGrid with fn set_row_spacing(self, spacing) -> Unit {
  self.as_grid().set_row_spacing(spacing)
}

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

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

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

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

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

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