// GENERATED — DO NOT EDIT

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

///|
pub(open) trait IEmblemedIcon {
  fn as_emblemed_icon(Self) -> EmblemedIcon
  fn add_emblem(Self, &IEmblem) -> Unit = _
  fn clear_emblems(Self) -> Unit = _
  fn get_emblems(Self) -> Array[Emblem] = _
  fn get_icon(Self) -> Icon = _
}

///|
pub impl IEmblemedIcon for EmblemedIcon with fn as_emblemed_icon(self) {
  self
}

///|
#borrow(icon, emblem)
extern "c" fn moonbit_g_emblemed_icon_new(
  icon : Icon,
  emblem : @glib.Nullable[Emblem],
) -> EmblemedIcon = "moonbit_g_emblemed_icon_new"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/ctor.EmblemedIcon.new.html).
pub fn EmblemedIcon::new(icon : &IIcon, emblem : &IEmblem?) -> EmblemedIcon {
  moonbit_g_emblemed_icon_new(
    icon.as_icon(),
    match emblem {
      Some(v) => @glib.Nullable::some(v.as_emblem())
      None => @glib.Nullable::null()
    },
  )
}

///|
#borrow(self_, emblem)
extern "c" fn moonbit_g_emblemed_icon_add_emblem(
  self_ : EmblemedIcon,
  emblem : Emblem,
) = "moonbit_g_emblemed_icon_add_emblem"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.EmblemedIcon.add_emblem.html).
pub fn EmblemedIcon::add_emblem(self : EmblemedIcon, emblem : &IEmblem) -> Unit {
  moonbit_g_emblemed_icon_add_emblem(self, emblem.as_emblem())
}

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.EmblemedIcon.clear_emblems.html).
#borrow(self)
pub extern "c" fn EmblemedIcon::clear_emblems(self : EmblemedIcon) = "moonbit_g_emblemed_icon_clear_emblems"

///|
#borrow(self_, result)
extern "c" fn moonbit_g_emblemed_icon_get_emblems(
  self_ : EmblemedIcon,
  result : Ref[FixedArray[Emblem]],
) = "moonbit_g_emblemed_icon_get_emblems"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.EmblemedIcon.get_emblems.html).
pub fn EmblemedIcon::get_emblems(self : EmblemedIcon) -> Array[Emblem] {
  let result_ref : Ref[FixedArray[Emblem]] = Ref([])
  moonbit_g_emblemed_icon_get_emblems(self, result_ref)
  let values : Array[Emblem] = Array::new(capacity=result_ref.val.length())
  for value in result_ref.val {
    values.push(value)
  }
  values
}

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.EmblemedIcon.get_icon.html).
#borrow(self)
pub extern "c" fn EmblemedIcon::get_icon(self : EmblemedIcon) -> Icon = "moonbit_g_emblemed_icon_get_icon"

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

///|
/// [Upstream documentation](https://docs.gtk.org/gio/property.EmblemedIcon.gicon.html).
pub fn EmblemedIcon::get_gicon(self : EmblemedIcon) -> Icon? {
  moonbit_g_emblemed_icon_get_gicon(self).to_option()
}

///|
impl IEmblemedIcon with fn add_emblem(self, emblem) -> Unit {
  self.as_emblemed_icon().add_emblem(emblem)
}

///|
impl IEmblemedIcon with fn clear_emblems(self) -> Unit {
  self.as_emblemed_icon().clear_emblems()
}

///|
impl IEmblemedIcon with fn get_emblems(self) -> Array[Emblem] {
  self.as_emblemed_icon().get_emblems()
}

///|
impl IEmblemedIcon with fn get_icon(self) -> Icon {
  self.as_emblemed_icon().get_icon()
}

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

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

///|
pub fn EmblemedIcon::as_icon(self : EmblemedIcon) -> Icon = "%identity"

///|
pub impl IIcon for EmblemedIcon with fn as_icon(self) {
  self.as_icon()
}