// GENERATED — DO NOT EDIT

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

///|
pub(open) trait IContext {
  fn as_context(Self) -> Context
  fn changed(Self) -> Unit = _
  fn get_base_dir(Self) -> Direction = _
  fn get_base_gravity(Self) -> Gravity = _
  fn get_font_description(Self) -> FontDescription? = _
  fn get_font_map(Self) -> FontMap? = _
  fn get_gravity(Self) -> Gravity = _
  fn get_gravity_hint(Self) -> GravityHint = _
  fn get_language(Self) -> Language = _
  fn get_matrix(Self) -> Matrix? = _
  fn get_metrics(Self, FontDescription?, Language?) -> FontMetrics = _
  fn get_round_glyph_positions(Self) -> Bool = _
  fn get_serial(Self) -> UInt = _
  fn list_families(Self) -> Array[FontFamily] = _
  fn load_font(Self, FontDescription) -> Font? = _
  fn load_fontset(Self, FontDescription, Language) -> Fontset? = _
  fn set_base_dir(Self, Direction) -> Unit = _
  fn set_base_gravity(Self, Gravity) -> Unit = _
  fn set_font_description(Self, FontDescription) -> Unit = _
  fn set_font_map(Self, &IFontMap?) -> Unit = _
  fn set_gravity_hint(Self, GravityHint) -> Unit = _
  fn set_language(Self, Language?) -> Unit = _
  fn set_matrix(Self, Matrix?) -> Unit = _
  fn set_round_glyph_positions(Self, Bool) -> Unit = _
}

///|
pub impl IContext for Context with fn as_context(self) {
  self
}

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

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.Context.changed.html).
#borrow(self)
pub extern "c" fn Context::changed(self : Context) = "moonbit_pango_context_changed"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.Context.get_base_dir.html).
#borrow(self)
pub extern "c" fn Context::get_base_dir(self : Context) -> Direction = "moonbit_pango_context_get_base_dir"

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

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

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

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

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

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

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.Context.get_gravity_hint.html).
#borrow(self)
pub extern "c" fn Context::get_gravity_hint(self : Context) -> GravityHint = "moonbit_pango_context_get_gravity_hint"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.Context.get_language.html).
#borrow(self)
pub extern "c" fn Context::get_language(self : Context) -> Language = "moonbit_pango_context_get_language"

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

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

///|
#borrow(self_, desc, language)
extern "c" fn moonbit_pango_context_get_metrics(
  self_ : Context,
  desc : @glib.Nullable[FontDescription],
  language : @glib.Nullable[Language],
) -> FontMetrics = "moonbit_pango_context_get_metrics"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.Context.get_metrics.html).
pub fn Context::get_metrics(
  self : Context,
  desc : FontDescription?,
  language : Language?,
) -> FontMetrics {
  moonbit_pango_context_get_metrics(
    self,
    match desc {
      Some(v) => @glib.Nullable::some(v)
      None => @glib.Nullable::null()
    },
    match language {
      Some(v) => @glib.Nullable::some(v)
      None => @glib.Nullable::null()
    },
  )
}

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

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

///|
#borrow(self_, families)
extern "c" fn moonbit_pango_context_list_families(
  self_ : Context,
  families : Ref[FixedArray[FontFamily]],
) = "moonbit_pango_context_list_families"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.Context.list_families.html).
pub fn Context::list_families(self : Context) -> Array[FontFamily] {
  let families : Ref[FixedArray[FontFamily]] = Ref([])
  moonbit_pango_context_list_families(self, families)
  let result : Array[FontFamily] = Array::new(capacity=families.val.length())
  for i in 0.. @glib.Nullable[Font] = "moonbit_pango_context_load_font"

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

///|
#borrow(self_, desc, language)
extern "c" fn moonbit_pango_context_load_fontset(
  self_ : Context,
  desc : FontDescription,
  language : Language,
) -> @glib.Nullable[Fontset] = "moonbit_pango_context_load_fontset"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.Context.load_fontset.html).
pub fn Context::load_fontset(
  self : Context,
  desc : FontDescription,
  language : Language,
) -> Fontset? {
  let raw_result = moonbit_pango_context_load_fontset(self, desc, language)
  raw_result.to_option()
}

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.Context.set_base_dir.html).
#borrow(self)
pub extern "c" fn Context::set_base_dir(self : Context, direction : Direction) = "moonbit_pango_context_set_base_dir"

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

///|
#borrow(self_, desc)
extern "c" fn moonbit_pango_context_set_font_description(
  self_ : Context,
  desc : FontDescription,
) = "moonbit_pango_context_set_font_description"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.Context.set_font_description.html).
pub fn Context::set_font_description(
  self : Context,
  desc : FontDescription,
) -> Unit {
  moonbit_pango_context_set_font_description(self, desc)
}

///|
#borrow(self_, font_map)
extern "c" fn moonbit_pango_context_set_font_map(
  self_ : Context,
  font_map : @glib.Nullable[FontMap],
) = "moonbit_pango_context_set_font_map"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.Context.set_font_map.html).
pub fn Context::set_font_map(self : Context, font_map : &IFontMap?) -> Unit {
  moonbit_pango_context_set_font_map(
    self,
    match font_map {
      Some(v) => @glib.Nullable::some(v.as_font_map())
      None => @glib.Nullable::null()
    },
  )
}

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.Context.set_gravity_hint.html).
#borrow(self)
pub extern "c" fn Context::set_gravity_hint(self : Context, hint : GravityHint) = "moonbit_pango_context_set_gravity_hint"

///|
#borrow(self_, language)
extern "c" fn moonbit_pango_context_set_language(
  self_ : Context,
  language : @glib.Nullable[Language],
) = "moonbit_pango_context_set_language"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.Context.set_language.html).
pub fn Context::set_language(self : Context, language : Language?) -> Unit {
  moonbit_pango_context_set_language(
    self,
    match language {
      Some(v) => @glib.Nullable::some(v)
      None => @glib.Nullable::null()
    },
  )
}

///|
#borrow(self_, matrix)
extern "c" fn moonbit_pango_context_set_matrix(
  self_ : Context,
  matrix : @glib.Nullable[Matrix],
) = "moonbit_pango_context_set_matrix"

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.Context.set_matrix.html).
pub fn Context::set_matrix(self : Context, matrix : Matrix?) -> Unit {
  moonbit_pango_context_set_matrix(
    self,
    match matrix {
      Some(v) => @glib.Nullable::some(v)
      None => @glib.Nullable::null()
    },
  )
}

///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.Context.set_round_glyph_positions.html).
#borrow(self)
pub extern "c" fn Context::set_round_glyph_positions(
  self : Context,
  round_positions : Bool,
) = "moonbit_pango_context_set_round_glyph_positions"

///|
impl IContext with fn changed(self) -> Unit {
  self.as_context().changed()
}

///|
impl IContext with fn get_base_dir(self) -> Direction {
  self.as_context().get_base_dir()
}

///|
impl IContext with fn get_base_gravity(self) -> Gravity {
  self.as_context().get_base_gravity()
}

///|
impl IContext with fn get_font_description(self) -> FontDescription? {
  self.as_context().get_font_description()
}

///|
impl IContext with fn get_font_map(self) -> FontMap? {
  self.as_context().get_font_map()
}

///|
impl IContext with fn get_gravity(self) -> Gravity {
  self.as_context().get_gravity()
}

///|
impl IContext with fn get_gravity_hint(self) -> GravityHint {
  self.as_context().get_gravity_hint()
}

///|
impl IContext with fn get_language(self) -> Language {
  self.as_context().get_language()
}

///|
impl IContext with fn get_matrix(self) -> Matrix? {
  self.as_context().get_matrix()
}

///|
impl IContext with fn get_metrics(self, desc, language) -> FontMetrics {
  self.as_context().get_metrics(desc, language)
}

///|
impl IContext with fn get_round_glyph_positions(self) -> Bool {
  self.as_context().get_round_glyph_positions()
}

///|
impl IContext with fn get_serial(self) -> UInt {
  self.as_context().get_serial()
}

///|
impl IContext with fn list_families(self) -> Array[FontFamily] {
  self.as_context().list_families()
}

///|
impl IContext with fn load_font(self, desc) -> Font? {
  self.as_context().load_font(desc)
}

///|
impl IContext with fn load_fontset(self, desc, language) -> Fontset? {
  self.as_context().load_fontset(desc, language)
}

///|
impl IContext with fn set_base_dir(self, direction) -> Unit {
  self.as_context().set_base_dir(direction)
}

///|
impl IContext with fn set_base_gravity(self, gravity) -> Unit {
  self.as_context().set_base_gravity(gravity)
}

///|
impl IContext with fn set_font_description(self, desc) -> Unit {
  self.as_context().set_font_description(desc)
}

///|
impl IContext with fn set_font_map(self, font_map) -> Unit {
  self.as_context().set_font_map(font_map)
}

///|
impl IContext with fn set_gravity_hint(self, hint) -> Unit {
  self.as_context().set_gravity_hint(hint)
}

///|
impl IContext with fn set_language(self, language) -> Unit {
  self.as_context().set_language(language)
}

///|
impl IContext with fn set_matrix(self, matrix) -> Unit {
  self.as_context().set_matrix(matrix)
}

///|
impl IContext with fn set_round_glyph_positions(self, round_positions) -> Unit {
  self.as_context().set_round_glyph_positions(round_positions)
}

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

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