// GENERATED — DO NOT EDIT

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

///|
pub(open) trait ITextIter {
  fn as_text_iter(Self) -> TextIter
  fn assign(Self, TextIter) -> Unit = _
  fn backward_char(Self) -> Bool = _
  fn backward_chars(Self, Int) -> Bool = _
  fn backward_cursor_position(Self) -> Bool = _
  fn backward_cursor_positions(Self, Int) -> Bool = _
  fn backward_line(Self) -> Bool = _
  fn backward_lines(Self, Int) -> Bool = _
  fn backward_search(Self, String, TextSearchFlags, TextIter?) -> (
    TextIter,
    TextIter,
    Bool,
  ) = _
  fn backward_sentence_start(Self) -> Bool = _
  fn backward_sentence_starts(Self, Int) -> Bool = _
  fn backward_to_tag_toggle(Self, &ITextTag?) -> Bool = _
  fn backward_visible_cursor_position(Self) -> Bool = _
  fn backward_visible_cursor_positions(Self, Int) -> Bool = _
  fn backward_visible_line(Self) -> Bool = _
  fn backward_visible_lines(Self, Int) -> Bool = _
  fn backward_visible_word_start(Self) -> Bool = _
  fn backward_visible_word_starts(Self, Int) -> Bool = _
  fn backward_word_start(Self) -> Bool = _
  fn backward_word_starts(Self, Int) -> Bool = _
  fn can_insert(Self, Bool) -> Bool = _
  fn compare(Self, TextIter) -> Int = _
  fn editable(Self, Bool) -> Bool = _
  fn ends_line(Self) -> Bool = _
  fn ends_sentence(Self) -> Bool = _
  fn ends_tag(Self, &ITextTag?) -> Bool = _
  fn ends_word(Self) -> Bool = _
  fn equal(Self, TextIter) -> Bool = _
  fn forward_char(Self) -> Bool = _
  fn forward_chars(Self, Int) -> Bool = _
  fn forward_cursor_position(Self) -> Bool = _
  fn forward_cursor_positions(Self, Int) -> Bool = _
  fn forward_line(Self) -> Bool = _
  fn forward_lines(Self, Int) -> Bool = _
  fn forward_search(Self, String, TextSearchFlags, TextIter?) -> (
    TextIter,
    TextIter,
    Bool,
  ) = _
  fn forward_sentence_end(Self) -> Bool = _
  fn forward_sentence_ends(Self, Int) -> Bool = _
  fn forward_to_end(Self) -> Unit = _
  fn forward_to_line_end(Self) -> Bool = _
  fn forward_to_tag_toggle(Self, &ITextTag?) -> Bool = _
  fn forward_visible_cursor_position(Self) -> Bool = _
  fn forward_visible_cursor_positions(Self, Int) -> Bool = _
  fn forward_visible_line(Self) -> Bool = _
  fn forward_visible_lines(Self, Int) -> Bool = _
  fn forward_visible_word_end(Self) -> Bool = _
  fn forward_visible_word_ends(Self, Int) -> Bool = _
  fn forward_word_end(Self) -> Bool = _
  fn forward_word_ends(Self, Int) -> Bool = _
  fn get_buffer(Self) -> TextBuffer = _
  fn get_bytes_in_line(Self) -> Int = _
  fn get_char(Self) -> UInt = _
  fn get_chars_in_line(Self) -> Int = _
  fn get_child_anchor(Self) -> TextChildAnchor? = _
  fn get_language(Self) -> @pango.Language = _
  fn get_line(Self) -> Int = _
  fn get_line_index(Self) -> Int = _
  fn get_line_offset(Self) -> Int = _
  fn get_marks(Self) -> Array[TextMark] = _
  fn get_offset(Self) -> Int = _
  fn get_paintable(Self) -> @gdk.Paintable? = _
  fn get_slice(Self, TextIter) -> String = _
  fn get_tags(Self) -> Array[TextTag] = _
  fn get_text(Self, TextIter) -> String = _
  fn get_toggled_tags(Self, Bool) -> Array[TextTag] = _
  fn get_visible_line_index(Self) -> Int = _
  fn get_visible_line_offset(Self) -> Int = _
  fn get_visible_slice(Self, TextIter) -> String = _
  fn get_visible_text(Self, TextIter) -> String = _
  fn has_tag(Self, &ITextTag) -> Bool = _
  fn in_range(Self, TextIter, TextIter) -> Bool = _
  fn inside_sentence(Self) -> Bool = _
  fn inside_word(Self) -> Bool = _
  fn is_cursor_position(Self) -> Bool = _
  fn is_end(Self) -> Bool = _
  fn is_start(Self) -> Bool = _
  fn order(Self, TextIter) -> Unit = _
  fn set_line(Self, Int) -> Unit = _
  fn set_line_index(Self, Int) -> Unit = _
  fn set_line_offset(Self, Int) -> Unit = _
  fn set_offset(Self, Int) -> Unit = _
  fn set_visible_line_index(Self, Int) -> Unit = _
  fn set_visible_line_offset(Self, Int) -> Unit = _
  fn starts_line(Self) -> Bool = _
  fn starts_sentence(Self) -> Bool = _
  fn starts_tag(Self, &ITextTag?) -> Bool = _
  fn starts_word(Self) -> Bool = _
  fn toggles_tag(Self, &ITextTag?) -> Bool = _
}

///|
pub impl ITextIter for TextIter with fn as_text_iter(self) {
  self
}

///|
#borrow(self_, other)
extern "c" fn moonbit_gtk_text_iter_assign(self_ : TextIter, other : TextIter) = "moonbit_gtk_text_iter_assign"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.assign.html).
pub fn TextIter::assign(self : TextIter, other : TextIter) -> Unit {
  moonbit_gtk_text_iter_assign(self, other)
}

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.backward_chars.html).
#borrow(self)
pub extern "c" fn TextIter::backward_chars(
  self : TextIter,
  count : Int,
) -> Bool = "moonbit_gtk_text_iter_backward_chars"

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.backward_cursor_positions.html).
#borrow(self)
pub extern "c" fn TextIter::backward_cursor_positions(
  self : TextIter,
  count : Int,
) -> Bool = "moonbit_gtk_text_iter_backward_cursor_positions"

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.backward_lines.html).
#borrow(self)
pub extern "c" fn TextIter::backward_lines(
  self : TextIter,
  count : Int,
) -> Bool = "moonbit_gtk_text_iter_backward_lines"

///|
#borrow(self_, str, limit, __out_match_end, native_result)
extern "c" fn moonbit_gtk_text_iter_backward_search(
  self_ : TextIter,
  str : Bytes,
  flags : Int,
  limit : @glib.Nullable[TextIter],
  __out_match_end : Ref[TextIter],
  native_result : Ref[Int],
) -> TextIter = "moonbit_gtk_text_iter_backward_search"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.backward_search.html).
pub fn TextIter::backward_search(
  self : TextIter,
  str : String,
  flags : TextSearchFlags,
  limit : TextIter?,
) -> (TextIter, TextIter, Bool) {
  let __out_match_end = Ref(TextIter::_zero())
  let native_result = Ref(0)
  let __result = moonbit_gtk_text_iter_backward_search(
    self,
    @encoding/utf8.encode(str),
    flags.to_int(),
    match limit {
      Some(v) => @glib.Nullable::some(v)
      None => @glib.Nullable::null()
    },
    __out_match_end,
    native_result,
  )
  (__result, __out_match_end.val, native_result.val != 0)
}

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.backward_sentence_starts.html).
#borrow(self)
pub extern "c" fn TextIter::backward_sentence_starts(
  self : TextIter,
  count : Int,
) -> Bool = "moonbit_gtk_text_iter_backward_sentence_starts"

///|
#borrow(self_, tag)
extern "c" fn moonbit_gtk_text_iter_backward_to_tag_toggle(
  self_ : TextIter,
  tag : @glib.Nullable[TextTag],
) -> Bool = "moonbit_gtk_text_iter_backward_to_tag_toggle"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.backward_to_tag_toggle.html).
pub fn TextIter::backward_to_tag_toggle(
  self : TextIter,
  tag : &ITextTag?,
) -> Bool {
  moonbit_gtk_text_iter_backward_to_tag_toggle(
    self,
    match tag {
      Some(v) => @glib.Nullable::some(v.as_text_tag())
      None => @glib.Nullable::null()
    },
  )
}

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.backward_visible_cursor_positions.html).
#borrow(self)
pub extern "c" fn TextIter::backward_visible_cursor_positions(
  self : TextIter,
  count : Int,
) -> Bool = "moonbit_gtk_text_iter_backward_visible_cursor_positions"

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.backward_visible_lines.html).
#borrow(self)
pub extern "c" fn TextIter::backward_visible_lines(
  self : TextIter,
  count : Int,
) -> Bool = "moonbit_gtk_text_iter_backward_visible_lines"

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.backward_visible_word_starts.html).
#borrow(self)
pub extern "c" fn TextIter::backward_visible_word_starts(
  self : TextIter,
  count : Int,
) -> Bool = "moonbit_gtk_text_iter_backward_visible_word_starts"

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.backward_word_starts.html).
#borrow(self)
pub extern "c" fn TextIter::backward_word_starts(
  self : TextIter,
  count : Int,
) -> Bool = "moonbit_gtk_text_iter_backward_word_starts"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.can_insert.html).
#borrow(self)
pub extern "c" fn TextIter::can_insert(
  self : TextIter,
  default_editability : Bool,
) -> Bool = "moonbit_gtk_text_iter_can_insert"

///|
#borrow(self_, rhs)
extern "c" fn moonbit_gtk_text_iter_compare(
  self_ : TextIter,
  rhs : TextIter,
) -> Int = "moonbit_gtk_text_iter_compare"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.compare.html).
pub fn TextIter::compare(self : TextIter, rhs : TextIter) -> Int {
  moonbit_gtk_text_iter_compare(self, rhs)
}

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.editable.html).
#borrow(self)
pub extern "c" fn TextIter::editable(
  self : TextIter,
  default_setting : Bool,
) -> Bool = "moonbit_gtk_text_iter_editable"

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

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

///|
#borrow(self_, tag)
extern "c" fn moonbit_gtk_text_iter_ends_tag(
  self_ : TextIter,
  tag : @glib.Nullable[TextTag],
) -> Bool = "moonbit_gtk_text_iter_ends_tag"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.ends_tag.html).
pub fn TextIter::ends_tag(self : TextIter, tag : &ITextTag?) -> Bool {
  moonbit_gtk_text_iter_ends_tag(
    self,
    match tag {
      Some(v) => @glib.Nullable::some(v.as_text_tag())
      None => @glib.Nullable::null()
    },
  )
}

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

///|
#borrow(self_, rhs)
extern "c" fn moonbit_gtk_text_iter_equal(
  self_ : TextIter,
  rhs : TextIter,
) -> Bool = "moonbit_gtk_text_iter_equal"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.equal.html).
pub fn TextIter::equal(self : TextIter, rhs : TextIter) -> Bool {
  moonbit_gtk_text_iter_equal(self, rhs)
}

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.forward_chars.html).
#borrow(self)
pub extern "c" fn TextIter::forward_chars(self : TextIter, count : Int) -> Bool = "moonbit_gtk_text_iter_forward_chars"

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.forward_cursor_positions.html).
#borrow(self)
pub extern "c" fn TextIter::forward_cursor_positions(
  self : TextIter,
  count : Int,
) -> Bool = "moonbit_gtk_text_iter_forward_cursor_positions"

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.forward_lines.html).
#borrow(self)
pub extern "c" fn TextIter::forward_lines(self : TextIter, count : Int) -> Bool = "moonbit_gtk_text_iter_forward_lines"

///|
#borrow(self_, str, limit, __out_match_end, native_result)
extern "c" fn moonbit_gtk_text_iter_forward_search(
  self_ : TextIter,
  str : Bytes,
  flags : Int,
  limit : @glib.Nullable[TextIter],
  __out_match_end : Ref[TextIter],
  native_result : Ref[Int],
) -> TextIter = "moonbit_gtk_text_iter_forward_search"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.forward_search.html).
pub fn TextIter::forward_search(
  self : TextIter,
  str : String,
  flags : TextSearchFlags,
  limit : TextIter?,
) -> (TextIter, TextIter, Bool) {
  let __out_match_end = Ref(TextIter::_zero())
  let native_result = Ref(0)
  let __result = moonbit_gtk_text_iter_forward_search(
    self,
    @encoding/utf8.encode(str),
    flags.to_int(),
    match limit {
      Some(v) => @glib.Nullable::some(v)
      None => @glib.Nullable::null()
    },
    __out_match_end,
    native_result,
  )
  (__result, __out_match_end.val, native_result.val != 0)
}

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.forward_sentence_ends.html).
#borrow(self)
pub extern "c" fn TextIter::forward_sentence_ends(
  self : TextIter,
  count : Int,
) -> Bool = "moonbit_gtk_text_iter_forward_sentence_ends"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.forward_to_end.html).
#borrow(self)
pub extern "c" fn TextIter::forward_to_end(self : TextIter) = "moonbit_gtk_text_iter_forward_to_end"

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

///|
#borrow(self_, tag)
extern "c" fn moonbit_gtk_text_iter_forward_to_tag_toggle(
  self_ : TextIter,
  tag : @glib.Nullable[TextTag],
) -> Bool = "moonbit_gtk_text_iter_forward_to_tag_toggle"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.forward_to_tag_toggle.html).
pub fn TextIter::forward_to_tag_toggle(
  self : TextIter,
  tag : &ITextTag?,
) -> Bool {
  moonbit_gtk_text_iter_forward_to_tag_toggle(
    self,
    match tag {
      Some(v) => @glib.Nullable::some(v.as_text_tag())
      None => @glib.Nullable::null()
    },
  )
}

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.forward_visible_cursor_positions.html).
#borrow(self)
pub extern "c" fn TextIter::forward_visible_cursor_positions(
  self : TextIter,
  count : Int,
) -> Bool = "moonbit_gtk_text_iter_forward_visible_cursor_positions"

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.forward_visible_lines.html).
#borrow(self)
pub extern "c" fn TextIter::forward_visible_lines(
  self : TextIter,
  count : Int,
) -> Bool = "moonbit_gtk_text_iter_forward_visible_lines"

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.forward_visible_word_ends.html).
#borrow(self)
pub extern "c" fn TextIter::forward_visible_word_ends(
  self : TextIter,
  count : Int,
) -> Bool = "moonbit_gtk_text_iter_forward_visible_word_ends"

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.forward_word_ends.html).
#borrow(self)
pub extern "c" fn TextIter::forward_word_ends(
  self : TextIter,
  count : Int,
) -> Bool = "moonbit_gtk_text_iter_forward_word_ends"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.get_buffer.html).
#borrow(self)
pub extern "c" fn TextIter::get_buffer(self : TextIter) -> TextBuffer = "moonbit_gtk_text_iter_get_buffer"

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

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

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

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

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.get_child_anchor.html).
pub fn TextIter::get_child_anchor(self : TextIter) -> TextChildAnchor? {
  let raw_result = moonbit_gtk_text_iter_get_child_anchor(self)
  raw_result.to_option()
}

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.get_language.html).
#borrow(self)
pub extern "c" fn TextIter::get_language(self : TextIter) -> @pango.Language = "moonbit_gtk_text_iter_get_language"

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

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

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

///|
#borrow(self_, result)
extern "c" fn moonbit_gtk_text_iter_get_marks(
  self_ : TextIter,
  result : Ref[FixedArray[TextMark]],
) = "moonbit_gtk_text_iter_get_marks"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.get_marks.html).
pub fn TextIter::get_marks(self : TextIter) -> Array[TextMark] {
  let result_ref : Ref[FixedArray[TextMark]] = Ref([])
  moonbit_gtk_text_iter_get_marks(self, result_ref)
  let values : Array[TextMark] = Array::new(capacity=result_ref.val.length())
  for value in result_ref.val {
    values.push(value)
  }
  values
}

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

///|
#borrow(self_)
extern "c" fn moonbit_gtk_text_iter_get_paintable(
  self_ : TextIter,
) -> @glib.Nullable[@gdk.Paintable] = "moonbit_gtk_text_iter_get_paintable"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.get_paintable.html).
pub fn TextIter::get_paintable(self : TextIter) -> @gdk.Paintable? {
  let raw_result = moonbit_gtk_text_iter_get_paintable(self)
  raw_result.to_option()
}

///|
#borrow(self_, end)
extern "c" fn moonbit_gtk_text_iter_get_slice(
  self_ : TextIter,
  end : TextIter,
) -> Bytes = "moonbit_gtk_text_iter_get_slice"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.get_slice.html).
pub fn TextIter::get_slice(self : TextIter, end : TextIter) -> String {
  @encoding/utf8.decode_lossy(moonbit_gtk_text_iter_get_slice(self, end))
}

///|
#borrow(self_, result)
extern "c" fn moonbit_gtk_text_iter_get_tags(
  self_ : TextIter,
  result : Ref[FixedArray[TextTag]],
) = "moonbit_gtk_text_iter_get_tags"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.get_tags.html).
pub fn TextIter::get_tags(self : TextIter) -> Array[TextTag] {
  let result_ref : Ref[FixedArray[TextTag]] = Ref([])
  moonbit_gtk_text_iter_get_tags(self, result_ref)
  let values : Array[TextTag] = Array::new(capacity=result_ref.val.length())
  for value in result_ref.val {
    values.push(value)
  }
  values
}

///|
#borrow(self_, end)
extern "c" fn moonbit_gtk_text_iter_get_text(
  self_ : TextIter,
  end : TextIter,
) -> Bytes = "moonbit_gtk_text_iter_get_text"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.get_text.html).
pub fn TextIter::get_text(self : TextIter, end : TextIter) -> String {
  @encoding/utf8.decode_lossy(moonbit_gtk_text_iter_get_text(self, end))
}

///|
#borrow(self_, result)
extern "c" fn moonbit_gtk_text_iter_get_toggled_tags(
  self_ : TextIter,
  toggled_on : Bool,
  result : Ref[FixedArray[TextTag]],
) = "moonbit_gtk_text_iter_get_toggled_tags"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.get_toggled_tags.html).
pub fn TextIter::get_toggled_tags(
  self : TextIter,
  toggled_on : Bool,
) -> Array[TextTag] {
  let result_ref : Ref[FixedArray[TextTag]] = Ref([])
  moonbit_gtk_text_iter_get_toggled_tags(self, toggled_on, result_ref)
  let values : Array[TextTag] = Array::new(capacity=result_ref.val.length())
  for value in result_ref.val {
    values.push(value)
  }
  values
}

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

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

///|
#borrow(self_, end)
extern "c" fn moonbit_gtk_text_iter_get_visible_slice(
  self_ : TextIter,
  end : TextIter,
) -> Bytes = "moonbit_gtk_text_iter_get_visible_slice"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.get_visible_slice.html).
pub fn TextIter::get_visible_slice(self : TextIter, end : TextIter) -> String {
  @encoding/utf8.decode_lossy(
    moonbit_gtk_text_iter_get_visible_slice(self, end),
  )
}

///|
#borrow(self_, end)
extern "c" fn moonbit_gtk_text_iter_get_visible_text(
  self_ : TextIter,
  end : TextIter,
) -> Bytes = "moonbit_gtk_text_iter_get_visible_text"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.get_visible_text.html).
pub fn TextIter::get_visible_text(self : TextIter, end : TextIter) -> String {
  @encoding/utf8.decode_lossy(moonbit_gtk_text_iter_get_visible_text(self, end))
}

///|
#borrow(self_, tag)
extern "c" fn moonbit_gtk_text_iter_has_tag(
  self_ : TextIter,
  tag : TextTag,
) -> Bool = "moonbit_gtk_text_iter_has_tag"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.has_tag.html).
pub fn TextIter::has_tag(self : TextIter, tag : &ITextTag) -> Bool {
  moonbit_gtk_text_iter_has_tag(self, tag.as_text_tag())
}

///|
#borrow(self_, start, end)
extern "c" fn moonbit_gtk_text_iter_in_range(
  self_ : TextIter,
  start : TextIter,
  end : TextIter,
) -> Bool = "moonbit_gtk_text_iter_in_range"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.in_range.html).
pub fn TextIter::in_range(
  self : TextIter,
  start : TextIter,
  end : TextIter,
) -> Bool {
  moonbit_gtk_text_iter_in_range(self, start, end)
}

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

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

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

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

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

///|
#borrow(self_, second)
extern "c" fn moonbit_gtk_text_iter_order(self_ : TextIter, second : TextIter) = "moonbit_gtk_text_iter_order"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.order.html).
pub fn TextIter::order(self : TextIter, second : TextIter) -> Unit {
  moonbit_gtk_text_iter_order(self, second)
}

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.set_line.html).
#borrow(self)
pub extern "c" fn TextIter::set_line(self : TextIter, line_number : Int) = "moonbit_gtk_text_iter_set_line"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.set_line_index.html).
#borrow(self)
pub extern "c" fn TextIter::set_line_index(self : TextIter, byte_on_line : Int) = "moonbit_gtk_text_iter_set_line_index"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.set_line_offset.html).
#borrow(self)
pub extern "c" fn TextIter::set_line_offset(
  self : TextIter,
  char_on_line : Int,
) = "moonbit_gtk_text_iter_set_line_offset"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.set_offset.html).
#borrow(self)
pub extern "c" fn TextIter::set_offset(self : TextIter, char_offset : Int) = "moonbit_gtk_text_iter_set_offset"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.set_visible_line_index.html).
#borrow(self)
pub extern "c" fn TextIter::set_visible_line_index(
  self : TextIter,
  byte_on_line : Int,
) = "moonbit_gtk_text_iter_set_visible_line_index"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.set_visible_line_offset.html).
#borrow(self)
pub extern "c" fn TextIter::set_visible_line_offset(
  self : TextIter,
  char_on_line : Int,
) = "moonbit_gtk_text_iter_set_visible_line_offset"

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

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

///|
#borrow(self_, tag)
extern "c" fn moonbit_gtk_text_iter_starts_tag(
  self_ : TextIter,
  tag : @glib.Nullable[TextTag],
) -> Bool = "moonbit_gtk_text_iter_starts_tag"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.starts_tag.html).
pub fn TextIter::starts_tag(self : TextIter, tag : &ITextTag?) -> Bool {
  moonbit_gtk_text_iter_starts_tag(
    self,
    match tag {
      Some(v) => @glib.Nullable::some(v.as_text_tag())
      None => @glib.Nullable::null()
    },
  )
}

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

///|
#borrow(self_, tag)
extern "c" fn moonbit_gtk_text_iter_toggles_tag(
  self_ : TextIter,
  tag : @glib.Nullable[TextTag],
) -> Bool = "moonbit_gtk_text_iter_toggles_tag"

///|
/// [Upstream documentation](https://docs.gtk.org/gtk4/method.TextIter.toggles_tag.html).
pub fn TextIter::toggles_tag(self : TextIter, tag : &ITextTag?) -> Bool {
  moonbit_gtk_text_iter_toggles_tag(
    self,
    match tag {
      Some(v) => @glib.Nullable::some(v.as_text_tag())
      None => @glib.Nullable::null()
    },
  )
}

///|
impl ITextIter with fn assign(self, other) -> Unit {
  self.as_text_iter().assign(other)
}

///|
impl ITextIter with fn backward_char(self) -> Bool {
  self.as_text_iter().backward_char()
}

///|
impl ITextIter with fn backward_chars(self, count) -> Bool {
  self.as_text_iter().backward_chars(count)
}

///|
impl ITextIter with fn backward_cursor_position(self) -> Bool {
  self.as_text_iter().backward_cursor_position()
}

///|
impl ITextIter with fn backward_cursor_positions(self, count) -> Bool {
  self.as_text_iter().backward_cursor_positions(count)
}

///|
impl ITextIter with fn backward_line(self) -> Bool {
  self.as_text_iter().backward_line()
}

///|
impl ITextIter with fn backward_lines(self, count) -> Bool {
  self.as_text_iter().backward_lines(count)
}

///|
impl ITextIter with fn backward_search(self, str, flags, limit) -> (
  TextIter,
  TextIter,
  Bool,
) {
  self.as_text_iter().backward_search(str, flags, limit)
}

///|
impl ITextIter with fn backward_sentence_start(self) -> Bool {
  self.as_text_iter().backward_sentence_start()
}

///|
impl ITextIter with fn backward_sentence_starts(self, count) -> Bool {
  self.as_text_iter().backward_sentence_starts(count)
}

///|
impl ITextIter with fn backward_to_tag_toggle(self, tag) -> Bool {
  self.as_text_iter().backward_to_tag_toggle(tag)
}

///|
impl ITextIter with fn backward_visible_cursor_position(self) -> Bool {
  self.as_text_iter().backward_visible_cursor_position()
}

///|
impl ITextIter with fn backward_visible_cursor_positions(self, count) -> Bool {
  self.as_text_iter().backward_visible_cursor_positions(count)
}

///|
impl ITextIter with fn backward_visible_line(self) -> Bool {
  self.as_text_iter().backward_visible_line()
}

///|
impl ITextIter with fn backward_visible_lines(self, count) -> Bool {
  self.as_text_iter().backward_visible_lines(count)
}

///|
impl ITextIter with fn backward_visible_word_start(self) -> Bool {
  self.as_text_iter().backward_visible_word_start()
}

///|
impl ITextIter with fn backward_visible_word_starts(self, count) -> Bool {
  self.as_text_iter().backward_visible_word_starts(count)
}

///|
impl ITextIter with fn backward_word_start(self) -> Bool {
  self.as_text_iter().backward_word_start()
}

///|
impl ITextIter with fn backward_word_starts(self, count) -> Bool {
  self.as_text_iter().backward_word_starts(count)
}

///|
impl ITextIter with fn can_insert(self, default_editability) -> Bool {
  self.as_text_iter().can_insert(default_editability)
}

///|
impl ITextIter with fn compare(self, rhs) -> Int {
  self.as_text_iter().compare(rhs)
}

///|
impl ITextIter with fn editable(self, default_setting) -> Bool {
  self.as_text_iter().editable(default_setting)
}

///|
impl ITextIter with fn ends_line(self) -> Bool {
  self.as_text_iter().ends_line()
}

///|
impl ITextIter with fn ends_sentence(self) -> Bool {
  self.as_text_iter().ends_sentence()
}

///|
impl ITextIter with fn ends_tag(self, tag) -> Bool {
  self.as_text_iter().ends_tag(tag)
}

///|
impl ITextIter with fn ends_word(self) -> Bool {
  self.as_text_iter().ends_word()
}

///|
impl ITextIter with fn equal(self, rhs) -> Bool {
  self.as_text_iter().equal(rhs)
}

///|
impl ITextIter with fn forward_char(self) -> Bool {
  self.as_text_iter().forward_char()
}

///|
impl ITextIter with fn forward_chars(self, count) -> Bool {
  self.as_text_iter().forward_chars(count)
}

///|
impl ITextIter with fn forward_cursor_position(self) -> Bool {
  self.as_text_iter().forward_cursor_position()
}

///|
impl ITextIter with fn forward_cursor_positions(self, count) -> Bool {
  self.as_text_iter().forward_cursor_positions(count)
}

///|
impl ITextIter with fn forward_line(self) -> Bool {
  self.as_text_iter().forward_line()
}

///|
impl ITextIter with fn forward_lines(self, count) -> Bool {
  self.as_text_iter().forward_lines(count)
}

///|
impl ITextIter with fn forward_search(self, str, flags, limit) -> (
  TextIter,
  TextIter,
  Bool,
) {
  self.as_text_iter().forward_search(str, flags, limit)
}

///|
impl ITextIter with fn forward_sentence_end(self) -> Bool {
  self.as_text_iter().forward_sentence_end()
}

///|
impl ITextIter with fn forward_sentence_ends(self, count) -> Bool {
  self.as_text_iter().forward_sentence_ends(count)
}

///|
impl ITextIter with fn forward_to_end(self) -> Unit {
  self.as_text_iter().forward_to_end()
}

///|
impl ITextIter with fn forward_to_line_end(self) -> Bool {
  self.as_text_iter().forward_to_line_end()
}

///|
impl ITextIter with fn forward_to_tag_toggle(self, tag) -> Bool {
  self.as_text_iter().forward_to_tag_toggle(tag)
}

///|
impl ITextIter with fn forward_visible_cursor_position(self) -> Bool {
  self.as_text_iter().forward_visible_cursor_position()
}

///|
impl ITextIter with fn forward_visible_cursor_positions(self, count) -> Bool {
  self.as_text_iter().forward_visible_cursor_positions(count)
}

///|
impl ITextIter with fn forward_visible_line(self) -> Bool {
  self.as_text_iter().forward_visible_line()
}

///|
impl ITextIter with fn forward_visible_lines(self, count) -> Bool {
  self.as_text_iter().forward_visible_lines(count)
}

///|
impl ITextIter with fn forward_visible_word_end(self) -> Bool {
  self.as_text_iter().forward_visible_word_end()
}

///|
impl ITextIter with fn forward_visible_word_ends(self, count) -> Bool {
  self.as_text_iter().forward_visible_word_ends(count)
}

///|
impl ITextIter with fn forward_word_end(self) -> Bool {
  self.as_text_iter().forward_word_end()
}

///|
impl ITextIter with fn forward_word_ends(self, count) -> Bool {
  self.as_text_iter().forward_word_ends(count)
}

///|
impl ITextIter with fn get_buffer(self) -> TextBuffer {
  self.as_text_iter().get_buffer()
}

///|
impl ITextIter with fn get_bytes_in_line(self) -> Int {
  self.as_text_iter().get_bytes_in_line()
}

///|
impl ITextIter with fn get_char(self) -> UInt {
  self.as_text_iter().get_char()
}

///|
impl ITextIter with fn get_chars_in_line(self) -> Int {
  self.as_text_iter().get_chars_in_line()
}

///|
impl ITextIter with fn get_child_anchor(self) -> TextChildAnchor? {
  self.as_text_iter().get_child_anchor()
}

///|
impl ITextIter with fn get_language(self) -> @pango.Language {
  self.as_text_iter().get_language()
}

///|
impl ITextIter with fn get_line(self) -> Int {
  self.as_text_iter().get_line()
}

///|
impl ITextIter with fn get_line_index(self) -> Int {
  self.as_text_iter().get_line_index()
}

///|
impl ITextIter with fn get_line_offset(self) -> Int {
  self.as_text_iter().get_line_offset()
}

///|
impl ITextIter with fn get_marks(self) -> Array[TextMark] {
  self.as_text_iter().get_marks()
}

///|
impl ITextIter with fn get_offset(self) -> Int {
  self.as_text_iter().get_offset()
}

///|
impl ITextIter with fn get_paintable(self) -> @gdk.Paintable? {
  self.as_text_iter().get_paintable()
}

///|
impl ITextIter with fn get_slice(self, end) -> String {
  self.as_text_iter().get_slice(end)
}

///|
impl ITextIter with fn get_tags(self) -> Array[TextTag] {
  self.as_text_iter().get_tags()
}

///|
impl ITextIter with fn get_text(self, end) -> String {
  self.as_text_iter().get_text(end)
}

///|
impl ITextIter with fn get_toggled_tags(self, toggled_on) -> Array[TextTag] {
  self.as_text_iter().get_toggled_tags(toggled_on)
}

///|
impl ITextIter with fn get_visible_line_index(self) -> Int {
  self.as_text_iter().get_visible_line_index()
}

///|
impl ITextIter with fn get_visible_line_offset(self) -> Int {
  self.as_text_iter().get_visible_line_offset()
}

///|
impl ITextIter with fn get_visible_slice(self, end) -> String {
  self.as_text_iter().get_visible_slice(end)
}

///|
impl ITextIter with fn get_visible_text(self, end) -> String {
  self.as_text_iter().get_visible_text(end)
}

///|
impl ITextIter with fn has_tag(self, tag) -> Bool {
  self.as_text_iter().has_tag(tag)
}

///|
impl ITextIter with fn in_range(self, start, end) -> Bool {
  self.as_text_iter().in_range(start, end)
}

///|
impl ITextIter with fn inside_sentence(self) -> Bool {
  self.as_text_iter().inside_sentence()
}

///|
impl ITextIter with fn inside_word(self) -> Bool {
  self.as_text_iter().inside_word()
}

///|
impl ITextIter with fn is_cursor_position(self) -> Bool {
  self.as_text_iter().is_cursor_position()
}

///|
impl ITextIter with fn is_end(self) -> Bool {
  self.as_text_iter().is_end()
}

///|
impl ITextIter with fn is_start(self) -> Bool {
  self.as_text_iter().is_start()
}

///|
impl ITextIter with fn order(self, second) -> Unit {
  self.as_text_iter().order(second)
}

///|
impl ITextIter with fn set_line(self, line_number) -> Unit {
  self.as_text_iter().set_line(line_number)
}

///|
impl ITextIter with fn set_line_index(self, byte_on_line) -> Unit {
  self.as_text_iter().set_line_index(byte_on_line)
}

///|
impl ITextIter with fn set_line_offset(self, char_on_line) -> Unit {
  self.as_text_iter().set_line_offset(char_on_line)
}

///|
impl ITextIter with fn set_offset(self, char_offset) -> Unit {
  self.as_text_iter().set_offset(char_offset)
}

///|
impl ITextIter with fn set_visible_line_index(self, byte_on_line) -> Unit {
  self.as_text_iter().set_visible_line_index(byte_on_line)
}

///|
impl ITextIter with fn set_visible_line_offset(self, char_on_line) -> Unit {
  self.as_text_iter().set_visible_line_offset(char_on_line)
}

///|
impl ITextIter with fn starts_line(self) -> Bool {
  self.as_text_iter().starts_line()
}

///|
impl ITextIter with fn starts_sentence(self) -> Bool {
  self.as_text_iter().starts_sentence()
}

///|
impl ITextIter with fn starts_tag(self, tag) -> Bool {
  self.as_text_iter().starts_tag(tag)
}

///|
impl ITextIter with fn starts_word(self) -> Bool {
  self.as_text_iter().starts_word()
}

///|
impl ITextIter with fn toggles_tag(self, tag) -> Bool {
  self.as_text_iter().toggles_tag(tag)
}