// GENERATED — DO NOT EDIT

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/struct.FontDescription.html).
pub type FontDescription

///|
pub(open) trait IFontDescription {
  fn as_font_description(Self) -> FontDescription
  fn better_match(Self, FontDescription?, FontDescription) -> Bool = _
  fn copy_static(Self) -> FontDescription? = _
  fn equal(Self, FontDescription) -> Bool = _
  fn get_color(Self) -> FontColor = _
  fn get_family(Self) -> String? = _
  fn get_features(Self) -> String? = _
  fn get_gravity(Self) -> Gravity = _
  fn get_set_fields(Self) -> FontMask = _
  fn get_size(Self) -> Int = _
  fn get_size_is_absolute(Self) -> Bool = _
  fn get_stretch(Self) -> Stretch = _
  fn get_style(Self) -> Style = _
  fn get_variant(Self) -> Variant = _
  fn get_variations(Self) -> String? = _
  fn get_weight(Self) -> Weight = _
  fn hash(Self) -> UInt = _
  fn merge(Self, FontDescription?, Bool) -> Unit = _
  fn merge_static(Self, FontDescription, Bool) -> Unit = _
  fn set_absolute_size(Self, Double) -> Unit = _
  fn set_color(Self, FontColor) -> Unit = _
  fn set_family(Self, String) -> Unit = _
  fn set_family_static(Self, String) -> Unit = _
  fn set_features(Self, String?) -> Unit = _
  fn set_features_static(Self, String) -> Unit = _
  fn set_gravity(Self, Gravity) -> Unit = _
  fn set_size(Self, Int) -> Unit = _
  fn set_stretch(Self, Stretch) -> Unit = _
  fn set_style(Self, Style) -> Unit = _
  fn set_variant(Self, Variant) -> Unit = _
  fn set_variations(Self, String?) -> Unit = _
  fn set_variations_static(Self, String) -> Unit = _
  fn set_weight(Self, Weight) -> Unit = _
  fn to_filename(Self) -> String? = _
  fn to_string(Self) -> String = _
  fn unset_fields(Self, FontMask) -> Unit = _
}

///|
pub impl IFontDescription for FontDescription with fn as_font_description(self) {
  self
}

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/ctor.FontDescription.new.html).
pub extern "c" fn FontDescription::new() -> FontDescription = "moonbit_pango_font_description_new"

///|
#borrow(str)
extern "c" fn moonbit_pango_font_description_from_string(
  str : Bytes,
) -> FontDescription = "moonbit_pango_font_description_from_string"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/type_func.FontDescription.from_string.html).
pub fn FontDescription::from_string(str : String) -> FontDescription {
  moonbit_pango_font_description_from_string(@encoding/utf8.encode(str))
}

///|
#borrow(self_, old_match, new_match)
extern "c" fn moonbit_pango_font_description_better_match(
  self_ : FontDescription,
  old_match : @glib.Nullable[FontDescription],
  new_match : FontDescription,
) -> Bool = "moonbit_pango_font_description_better_match"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.better_match.html).
pub fn FontDescription::better_match(
  self : FontDescription,
  old_match : FontDescription?,
  new_match : FontDescription,
) -> Bool {
  moonbit_pango_font_description_better_match(
    self,
    match old_match {
      Some(v) => @glib.Nullable::some(v)
      None => @glib.Nullable::null()
    },
    new_match,
  )
}

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

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.copy_static.html).
pub fn FontDescription::copy_static(self : FontDescription) -> FontDescription? {
  let raw_result = moonbit_pango_font_description_copy_static(self)
  raw_result.to_option()
}

///|
#borrow(self_, desc2)
extern "c" fn moonbit_pango_font_description_equal(
  self_ : FontDescription,
  desc2 : FontDescription,
) -> Bool = "moonbit_pango_font_description_equal"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.equal.html).
pub fn FontDescription::equal(
  self : FontDescription,
  desc2 : FontDescription,
) -> Bool {
  moonbit_pango_font_description_equal(self, desc2)
}

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.get_color.html).
#borrow(self)
pub extern "c" fn FontDescription::get_color(
  self : FontDescription,
) -> FontColor = "moonbit_pango_font_description_get_color"

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

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.get_family.html).
pub fn FontDescription::get_family(self : FontDescription) -> String? {
  let result = moonbit_pango_font_description_get_family(self)
  match result.to_option() {
    Some(bytes) => Some(@encoding/utf8.decode_lossy(bytes))
    None => None
  }
}

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

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.get_features.html).
pub fn FontDescription::get_features(self : FontDescription) -> String? {
  let result = moonbit_pango_font_description_get_features(self)
  match result.to_option() {
    Some(bytes) => Some(@encoding/utf8.decode_lossy(bytes))
    None => None
  }
}

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.get_gravity.html).
#borrow(self)
pub extern "c" fn FontDescription::get_gravity(
  self : FontDescription,
) -> Gravity = "moonbit_pango_font_description_get_gravity"

///|
#borrow(self_)
extern "c" fn moonbit_pango_font_description_get_set_fields(
  self_ : FontDescription,
) -> Int = "moonbit_pango_font_description_get_set_fields"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.get_set_fields.html).
pub fn FontDescription::get_set_fields(self : FontDescription) -> FontMask {
  FontMask::from_int(moonbit_pango_font_description_get_set_fields(self))
}

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.get_size.html).
#borrow(self)
pub extern "c" fn FontDescription::get_size(self : FontDescription) -> Int = "moonbit_pango_font_description_get_size"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.get_size_is_absolute.html).
#borrow(self)
pub extern "c" fn FontDescription::get_size_is_absolute(
  self : FontDescription,
) -> Bool = "moonbit_pango_font_description_get_size_is_absolute"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.get_stretch.html).
#borrow(self)
pub extern "c" fn FontDescription::get_stretch(
  self : FontDescription,
) -> Stretch = "moonbit_pango_font_description_get_stretch"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.get_style.html).
#borrow(self)
pub extern "c" fn FontDescription::get_style(self : FontDescription) -> Style = "moonbit_pango_font_description_get_style"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.get_variant.html).
#borrow(self)
pub extern "c" fn FontDescription::get_variant(
  self : FontDescription,
) -> Variant = "moonbit_pango_font_description_get_variant"

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

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.get_variations.html).
pub fn FontDescription::get_variations(self : FontDescription) -> String? {
  let result = moonbit_pango_font_description_get_variations(self)
  match result.to_option() {
    Some(bytes) => Some(@encoding/utf8.decode_lossy(bytes))
    None => None
  }
}

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.get_weight.html).
#borrow(self)
pub extern "c" fn FontDescription::get_weight(self : FontDescription) -> Weight = "moonbit_pango_font_description_get_weight"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.hash.html).
#borrow(self)
pub extern "c" fn FontDescription::hash(self : FontDescription) -> UInt = "moonbit_pango_font_description_hash"

///|
#borrow(self_, desc_to_merge)
extern "c" fn moonbit_pango_font_description_merge(
  self_ : FontDescription,
  desc_to_merge : @glib.Nullable[FontDescription],
  replace_existing : Bool,
) = "moonbit_pango_font_description_merge"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.merge.html).
pub fn FontDescription::merge(
  self : FontDescription,
  desc_to_merge : FontDescription?,
  replace_existing : Bool,
) -> Unit {
  moonbit_pango_font_description_merge(
    self,
    match desc_to_merge {
      Some(v) => @glib.Nullable::some(v)
      None => @glib.Nullable::null()
    },
    replace_existing,
  )
}

///|
#borrow(self_, desc_to_merge)
extern "c" fn moonbit_pango_font_description_merge_static(
  self_ : FontDescription,
  desc_to_merge : FontDescription,
  replace_existing : Bool,
) = "moonbit_pango_font_description_merge_static"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.merge_static.html).
pub fn FontDescription::merge_static(
  self : FontDescription,
  desc_to_merge : FontDescription,
  replace_existing : Bool,
) -> Unit {
  moonbit_pango_font_description_merge_static(
    self, desc_to_merge, replace_existing,
  )
}

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.set_absolute_size.html).
#borrow(self)
pub extern "c" fn FontDescription::set_absolute_size(
  self : FontDescription,
  size : Double,
) = "moonbit_pango_font_description_set_absolute_size"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.set_color.html).
#borrow(self)
pub extern "c" fn FontDescription::set_color(
  self : FontDescription,
  color : FontColor,
) = "moonbit_pango_font_description_set_color"

///|
#borrow(self_, family)
extern "c" fn moonbit_pango_font_description_set_family(
  self_ : FontDescription,
  family : Bytes,
) = "moonbit_pango_font_description_set_family"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.set_family.html).
pub fn FontDescription::set_family(
  self : FontDescription,
  family : String,
) -> Unit {
  moonbit_pango_font_description_set_family(self, @encoding/utf8.encode(family))
}

///|
#borrow(self_, family)
extern "c" fn moonbit_pango_font_description_set_family_static(
  self_ : FontDescription,
  family : Bytes,
) = "moonbit_pango_font_description_set_family_static"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.set_family_static.html).
pub fn FontDescription::set_family_static(
  self : FontDescription,
  family : String,
) -> Unit {
  moonbit_pango_font_description_set_family_static(
    self,
    @encoding/utf8.encode(family),
  )
}

///|
#borrow(self_, features)
extern "c" fn moonbit_pango_font_description_set_features(
  self_ : FontDescription,
  features : @glib.Nullable[Bytes],
) = "moonbit_pango_font_description_set_features"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.set_features.html).
pub fn FontDescription::set_features(
  self : FontDescription,
  features : String?,
) -> Unit {
  moonbit_pango_font_description_set_features(
    self,
    match features {
      Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
      None => @glib.Nullable::null()
    },
  )
}

///|
#borrow(self_, features)
extern "c" fn moonbit_pango_font_description_set_features_static(
  self_ : FontDescription,
  features : Bytes,
) = "moonbit_pango_font_description_set_features_static"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.set_features_static.html).
pub fn FontDescription::set_features_static(
  self : FontDescription,
  features : String,
) -> Unit {
  moonbit_pango_font_description_set_features_static(
    self,
    @encoding/utf8.encode(features),
  )
}

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.set_gravity.html).
#borrow(self)
pub extern "c" fn FontDescription::set_gravity(
  self : FontDescription,
  gravity : Gravity,
) = "moonbit_pango_font_description_set_gravity"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.set_size.html).
#borrow(self)
pub extern "c" fn FontDescription::set_size(self : FontDescription, size : Int) = "moonbit_pango_font_description_set_size"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.set_stretch.html).
#borrow(self)
pub extern "c" fn FontDescription::set_stretch(
  self : FontDescription,
  stretch : Stretch,
) = "moonbit_pango_font_description_set_stretch"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.set_style.html).
#borrow(self)
pub extern "c" fn FontDescription::set_style(
  self : FontDescription,
  style : Style,
) = "moonbit_pango_font_description_set_style"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.set_variant.html).
#borrow(self)
pub extern "c" fn FontDescription::set_variant(
  self : FontDescription,
  variant : Variant,
) = "moonbit_pango_font_description_set_variant"

///|
#borrow(self_, variations)
extern "c" fn moonbit_pango_font_description_set_variations(
  self_ : FontDescription,
  variations : @glib.Nullable[Bytes],
) = "moonbit_pango_font_description_set_variations"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.set_variations.html).
pub fn FontDescription::set_variations(
  self : FontDescription,
  variations : String?,
) -> Unit {
  moonbit_pango_font_description_set_variations(
    self,
    match variations {
      Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
      None => @glib.Nullable::null()
    },
  )
}

///|
#borrow(self_, variations)
extern "c" fn moonbit_pango_font_description_set_variations_static(
  self_ : FontDescription,
  variations : Bytes,
) = "moonbit_pango_font_description_set_variations_static"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.set_variations_static.html).
pub fn FontDescription::set_variations_static(
  self : FontDescription,
  variations : String,
) -> Unit {
  moonbit_pango_font_description_set_variations_static(
    self,
    @encoding/utf8.encode(variations),
  )
}

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.set_weight.html).
#borrow(self)
pub extern "c" fn FontDescription::set_weight(
  self : FontDescription,
  weight : Weight,
) = "moonbit_pango_font_description_set_weight"

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

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.to_filename.html).
pub fn FontDescription::to_filename(self : FontDescription) -> String? {
  let result = moonbit_pango_font_description_to_filename(self)
  match result.to_option() {
    Some(bytes) => Some(@encoding/utf8.decode_lossy(bytes))
    None => None
  }
}

///|
#borrow(self_)
extern "c" fn moonbit_pango_font_description_to_string(
  self_ : FontDescription,
) -> Bytes = "moonbit_pango_font_description_to_string"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.to_string.html).
pub fn FontDescription::to_string(self : FontDescription) -> String {
  @encoding/utf8.decode_lossy(moonbit_pango_font_description_to_string(self))
}

///|
#borrow(self_)
extern "c" fn moonbit_pango_font_description_unset_fields(
  self_ : FontDescription,
  to_unset : Int,
) = "moonbit_pango_font_description_unset_fields"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontDescription.unset_fields.html).
pub fn FontDescription::unset_fields(
  self : FontDescription,
  to_unset : FontMask,
) -> Unit {
  moonbit_pango_font_description_unset_fields(self, to_unset.to_int())
}

///|
impl IFontDescription with fn better_match(self, old_match, new_match) -> Bool {
  self.as_font_description().better_match(old_match, new_match)
}

///|
impl IFontDescription with fn copy_static(self) -> FontDescription? {
  self.as_font_description().copy_static()
}

///|
impl IFontDescription with fn equal(self, desc2) -> Bool {
  self.as_font_description().equal(desc2)
}

///|
impl IFontDescription with fn get_color(self) -> FontColor {
  self.as_font_description().get_color()
}

///|
impl IFontDescription with fn get_family(self) -> String? {
  self.as_font_description().get_family()
}

///|
impl IFontDescription with fn get_features(self) -> String? {
  self.as_font_description().get_features()
}

///|
impl IFontDescription with fn get_gravity(self) -> Gravity {
  self.as_font_description().get_gravity()
}

///|
impl IFontDescription with fn get_set_fields(self) -> FontMask {
  self.as_font_description().get_set_fields()
}

///|
impl IFontDescription with fn get_size(self) -> Int {
  self.as_font_description().get_size()
}

///|
impl IFontDescription with fn get_size_is_absolute(self) -> Bool {
  self.as_font_description().get_size_is_absolute()
}

///|
impl IFontDescription with fn get_stretch(self) -> Stretch {
  self.as_font_description().get_stretch()
}

///|
impl IFontDescription with fn get_style(self) -> Style {
  self.as_font_description().get_style()
}

///|
impl IFontDescription with fn get_variant(self) -> Variant {
  self.as_font_description().get_variant()
}

///|
impl IFontDescription with fn get_variations(self) -> String? {
  self.as_font_description().get_variations()
}

///|
impl IFontDescription with fn get_weight(self) -> Weight {
  self.as_font_description().get_weight()
}

///|
impl IFontDescription with fn hash(self) -> UInt {
  self.as_font_description().hash()
}

///|
impl IFontDescription with fn merge(self, desc_to_merge, replace_existing) -> Unit {
  self.as_font_description().merge(desc_to_merge, replace_existing)
}

///|
impl IFontDescription with fn merge_static(
  self,
  desc_to_merge,
  replace_existing,
) -> Unit {
  self.as_font_description().merge_static(desc_to_merge, replace_existing)
}

///|
impl IFontDescription with fn set_absolute_size(self, size) -> Unit {
  self.as_font_description().set_absolute_size(size)
}

///|
impl IFontDescription with fn set_color(self, color) -> Unit {
  self.as_font_description().set_color(color)
}

///|
impl IFontDescription with fn set_family(self, family) -> Unit {
  self.as_font_description().set_family(family)
}

///|
impl IFontDescription with fn set_family_static(self, family) -> Unit {
  self.as_font_description().set_family_static(family)
}

///|
impl IFontDescription with fn set_features(self, features) -> Unit {
  self.as_font_description().set_features(features)
}

///|
impl IFontDescription with fn set_features_static(self, features) -> Unit {
  self.as_font_description().set_features_static(features)
}

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

///|
impl IFontDescription with fn set_size(self, size) -> Unit {
  self.as_font_description().set_size(size)
}

///|
impl IFontDescription with fn set_stretch(self, stretch) -> Unit {
  self.as_font_description().set_stretch(stretch)
}

///|
impl IFontDescription with fn set_style(self, style) -> Unit {
  self.as_font_description().set_style(style)
}

///|
impl IFontDescription with fn set_variant(self, variant) -> Unit {
  self.as_font_description().set_variant(variant)
}

///|
impl IFontDescription with fn set_variations(self, variations) -> Unit {
  self.as_font_description().set_variations(variations)
}

///|
impl IFontDescription with fn set_variations_static(self, variations) -> Unit {
  self.as_font_description().set_variations_static(variations)
}

///|
impl IFontDescription with fn set_weight(self, weight) -> Unit {
  self.as_font_description().set_weight(weight)
}

///|
impl IFontDescription with fn to_filename(self) -> String? {
  self.as_font_description().to_filename()
}

///|
impl IFontDescription with fn to_string(self) -> String {
  self.as_font_description().to_string()
}

///|
impl IFontDescription with fn unset_fields(self, to_unset) -> Unit {
  self.as_font_description().unset_fields(to_unset)
}