### ----------------------------------------------------
### -- Gnome::Gtk3
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Gtk3/TextIter.rakumod
### ----------------------------------------------------
### -- Chunk 1 of 3
#TL:1:Gnome::Gtk3::TextIter:

use v6;
#-------------------------------------------------------------------------------
=begin pod

=head1 Gnome::Gtk3::TextIter

Text buffer iterator

=head1 Description

You may wish to begin by reading the [text widget conceptual overview](https://developer.gnome.org/gtk3/3.24/TextWidget.html) which gives an overview of all the objects and data types related to the text widget and how they work together.

=head1 Synopsis
=head2 Declaration

  unit class Gnome::Gtk3::TextIter;
  also is Gnome::GObject::Boxed;

=comment head2 Example

=end pod
#-------------------------------------------------------------------------------
use NativeCall;

use Gnome::N::X:api<1>;
use Gnome::N::N-GObject:api<1>;
use Gnome::N::NativeLib:api<1>;
use Gnome::Glib::SList:api<1>;
use Gnome::GObject::Boxed:api<1>;
#use Gnome::Gtk3::TextBuffer:api<1>;

#-------------------------------------------------------------------------------
# See /usr/include/gtk-3.0/gtk/gtktextiter.h
# https://developer.gnome.org/gtk3/stable/GtkTextIter.html
# https://developer.gnome.org/gtk3/stable/TextWidget.html
unit class Gnome::Gtk3::TextIter:auth<github:MARTIMM>:api<1>;
also is Gnome::GObject::Boxed;

#-------------------------------------------------------------------------------
# This is a representation of an opaque structure. Spelled out here
# to set proper size.
#TE:2:N-GTextIter:

class N-GTextIter is repr('CStruct') is export {
  has Pointer $!dummy1;
  has Pointer $!dummy2;
  has int32 $!dummy3;
  has int32 $!dummy4;
  has int32 $!dummy5;
  has int32 $!dummy6;
  has int32 $!dummy7;
  has int32 $!dummy8;
  has Pointer $!dummy9;
  has Pointer $!dummy10;
  has int32 $!dummy11;
  has int32 $!dummy12;
  # padding
  has int32 $!dummy13;
  has Pointer $!dummy14;
};
#`{{
class N-GTextIter
  is repr('CPointer')
  is export
  { }
}}
#-------------------------------------------------------------------------------
=begin pod
=head2 enum GtkTextSearchFlags

Flags affecting how a search is done.

If neither C<GTK_TEXT_SEARCH_VISIBLE_ONLY> nor C<GTK_TEXT_SEARCH_TEXT_ONLY> are
enabled, the match must be exact; the special 0xFFFC character will match
embedded pixbufs or child widgets.


=item GTK_TEXT_SEARCH_VISIBLE_ONLY: Search only visible data. A search match may have invisible text interspersed.
=item GTK_TEXT_SEARCH_TEXT_ONLY: Search only text. A match may have pixbufs or child widgets mixed inside the matched range.
=item GTK_TEXT_SEARCH_CASE_INSENSITIVE: The text will be matched regardless of what case it is in.

=end pod

#TE:0:GtkTextSearchFlags:
enum GtkTextSearchFlags is export (
  'GTK_TEXT_SEARCH_VISIBLE_ONLY'     => 1 +< 0,
  'GTK_TEXT_SEARCH_TEXT_ONLY'        => 1 +< 1,
  'GTK_TEXT_SEARCH_CASE_INSENSITIVE' => 1 +< 2
);

=begin pod
=head1 Methods
=end pod

#`{{
=begin pod
=head2 new

Create a new plain object.

  multi method new ( )


Create a new object using a native object from elsewhere.

  multi method new ( Bool :$native-object! )
=end pod
}}

#TM:1:new():
submethod BUILD ( *%options ) {

  # prevent creating wrong native-objects
  return unless self.^name eq 'Gnome::Gtk3::TextIter';

  if self.is-valid { }

  # process all named arguments
  elsif %options.keys.elems {
    die X::Gnome.new(
      :message('Unsupported options for ' ~ self.^name ~
               ': ' ~ %options.keys.join(', ')
              )
    );
  }

  else {#if ? %options<empty> {
    self._set-native-object(N-GTextIter.new);
  }

  # only after creating the native-object, the gtype is known
  self._set-class-info('GtkTextIter');
}

#-------------------------------------------------------------------------------
# no pod. user does not have to know about it.
method _fallback ( $native-sub is copy --> Callable ) {

  my Callable $s;
  try { $s = &::("gtk_text_iter_$native-sub"); };
  try { $s = &::("gtk_$native-sub"); } unless ?$s;
  try { $s = &::($native-sub); } if !$s and $native-sub ~~ m/^ 'gtk_' /;

  self._set-class-name-of-sub('GtkTextIter');
  $s = callsame unless ?$s;

  $s;
}

#-------------------------------------------------------------------------------
# ? no ref/unref for a variant type
method native-object-ref ( $n-native-object --> N-GTextIter ) {
  $n-native-object
}

#-------------------------------------------------------------------------------
method native-object-unref ( $n-native-object ) {
  _gtk_text_iter_free($n-native-object);
}

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_buffer:
=begin pod
=head2 [[gtk_] text_iter_] get_buffer

Returns the B<Gnome::Gtk3::TextBuffer> this iterator is associated with.

Returns: (transfer none): the buffer

  method gtk_text_iter_get_buffer ( --> N-GObject  )


=end pod

sub gtk_text_iter_get_buffer ( N-GTextIter $iter )
  returns N-GObject
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_copy:
=begin pod
=head2 [gtk_] text_iter_copy

Creates a dynamically-allocated copy of an iterator. This function
is not useful in applications, because iterators can be copied with a
simple assignment (`B<Gnome::Gtk3::TextIter> i = j;`). The
function is used by language bindings.

Returns: a copy of the I<iter>, free with C<gtk_text_iter_free()>

  method gtk_text_iter_copy ( --> N-GObject  )


=end pod

sub gtk_text_iter_copy ( N-GTextIter $iter --> N-GTextIter)
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#`{{
#TM:0:_gtk_text_iter_free:
=begin pod
=head2 [gtk_] text_iter_free

Free an iterator allocated on the heap. This function
is intended for use in language bindings, and is not
especially useful for applications, because iterators can
simply be allocated on the stack.

  method gtk_text_iter_free ( )


=end pod
}}

sub _gtk_text_iter_free ( N-GTextIter $iter )
  is native(&gtk-lib)
  is symbol('gtk_text_iter_free')
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_assign:
=begin pod
=head2 [gtk_] text_iter_assign

Assigns the value of I<other> to I<iter>.  This function
is not useful in applications, because iterators can be assigned
with `B<Gnome::Gtk3::TextIter> i = j;`. The
function is used by language bindings.

Since: 3.2

  method gtk_text_iter_assign ( N-GObject $other )

=item N-GObject $other; another B<Gnome::Gtk3::TextIter>

=end pod

sub gtk_text_iter_assign ( N-GTextIter $iter, N-GObject $other )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_offset:
=begin pod
=head2 [[gtk_] text_iter_] get_offset

Returns the character offset of an iterator.
Each character in a B<Gnome::Gtk3::TextBuffer> has an offset,
starting with 0 for the first character in the buffer.
Use C<gtk_text_buffer_get_iter_at_offset()> to convert an
offset back into an iterator.

Returns: a character offset

  method gtk_text_iter_get_offset ( --> Int  )


=end pod

sub gtk_text_iter_get_offset ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_line:
=begin pod
=head2 [[gtk_] text_iter_] get_line

Returns the line number containing the iterator. Lines in
a B<Gnome::Gtk3::TextBuffer> are numbered beginning with 0 for the first
line in the buffer.

Returns: a line number

  method gtk_text_iter_get_line ( --> Int  )


=end pod

sub gtk_text_iter_get_line ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_line_offset:
=begin pod
=head2 [[gtk_] text_iter_] get_line_offset

Returns the character offset of the iterator,
counting from the start of a newline-terminated line.
The first character on the line has offset 0.

Returns: offset from start of line

  method gtk_text_iter_get_line_offset ( --> Int  )


=end pod

sub gtk_text_iter_get_line_offset ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_line_index:
=begin pod
=head2 [[gtk_] text_iter_] get_line_index

Returns the byte index of the iterator, counting
from the start of a newline-terminated line.
Remember that B<Gnome::Gtk3::TextBuffer> encodes text in
UTF-8, and that characters can require a variable
number of bytes to represent.

Returns: distance from start of line, in bytes

  method gtk_text_iter_get_line_index ( --> Int  )


=end pod

sub gtk_text_iter_get_line_index ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_visible_line_offset:
=begin pod
=head2 [[gtk_] text_iter_] get_visible_line_offset

Returns the offset in characters from the start of the
line to the given I<iter>, not counting characters that
are invisible due to tags with the “invisible” flag
toggled on.

Returns: offset in visible characters from the start of the line

  method gtk_text_iter_get_visible_line_offset ( --> Int  )


=end pod

sub gtk_text_iter_get_visible_line_offset ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_visible_line_index:
=begin pod
=head2 [[gtk_] text_iter_] get_visible_line_index

Returns the number of bytes from the start of the
line to the given I<iter>, not counting bytes that
are invisible due to tags with the “invisible” flag
toggled on.

Returns: byte index of I<iter> with respect to the start of the line

  method gtk_text_iter_get_visible_line_index ( --> Int  )


=end pod

sub gtk_text_iter_get_visible_line_index ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_char:
=begin pod
=head2 [[gtk_] text_iter_] get_char

The Unicode character at this iterator is returned.  (Equivalent to
operator* on a C++ iterator.)  If the element at this iterator is a
non-character element, such as an image embedded in the buffer, the
Unicode “unknown” character 0xFFFC is returned. If invoked on
the end iterator, zero is returned; zero is not a valid Unicode character.
So you can write a loop which ends when C<gtk_text_iter_get_char()>
returns 0.

Returns: a Unicode character, or 0 if I<iter> is not dereferenceable

  method gtk_text_iter_get_char ( --> uint32 )


=end pod

sub gtk_text_iter_get_char ( N-GTextIter $iter )
  returns uint32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_slice:
=begin pod
=head2 [[gtk_] text_iter_] get_slice

Returns the text in the given range. A “slice” is an array of
characters encoded in UTF-8 format, including the Unicode “unknown”
character 0xFFFC for iterable non-character elements in the buffer,
such as images.  Because images are encoded in the slice, byte and
character offsets in the returned array will correspond to byte
offsets in the text buffer. Note that 0xFFFC can occur in normal
text as well, so it is not a reliable indicator that a pixbuf or
widget is in the buffer.

Returns: (transfer full): slice of text from the buffer

  method gtk_text_iter_get_slice ( N-GObject $end --> Str  )

=item N-GObject $end; iterator at end of a range

=end pod

sub gtk_text_iter_get_slice ( N-GTextIter $start, N-GTextIter $end )
  returns Str
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:2:gtk_text_iter_get_text:TextBuffer.t
=begin pod
=head2 [[gtk_] text_iter_] get_text

Returns text in the given range.  If the range
contains non-text elements such as images, the character and byte
offsets in the returned string will not correspond to character and
byte offsets in the buffer. If you want offsets to correspond, see
C<gtk_text_iter_get_slice()>.

Returns: (transfer full): array of characters from the buffer

  method gtk_text_iter_get_text ( N-GObject $end --> Str  )

=item N-GObject $end; iterator at end of a range

=end pod

sub gtk_text_iter_get_text ( N-GTextIter $start, N-GTextIter $end )
  returns Str
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_visible_slice:
=begin pod
=head2 [[gtk_] text_iter_] get_visible_slice

Like C<gtk_text_iter_get_slice()>, but invisible text is not included.
Invisible text is usually invisible because a B<Gnome::Gtk3::TextTag> with the
“invisible” attribute turned on has been applied to it.

Returns: (transfer full): slice of text from the buffer

  method gtk_text_iter_get_visible_slice ( N-GObject $end --> Str  )

=item N-GObject $end; iterator at end of range

=end pod

sub gtk_text_iter_get_visible_slice ( N-GTextIter $start, N-GTextIter $end )
  returns Str
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_visible_text:
=begin pod
=head2 [[gtk_] text_iter_] get_visible_text

Like C<gtk_text_iter_get_text()>, but invisible text is not included.
Invisible text is usually invisible because a B<Gnome::Gtk3::TextTag> with the
“invisible” attribute turned on has been applied to it.

Returns: (transfer full): string containing visible text in the
range

  method gtk_text_iter_get_visible_text ( N-GObject $end --> Str  )

=item N-GObject $end; iterator at end of range

=end pod

sub gtk_text_iter_get_visible_text ( N-GTextIter $start, N-GTextIter $end )
  returns Str
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_pixbuf:
=begin pod
=head2 [[gtk_] text_iter_] get_pixbuf

If the element at I<iter> is a pixbuf, the pixbuf is returned
(with no new reference count added). Otherwise,
C<Any> is returned.

Returns: (transfer none): the pixbuf at I<iter>

  method gtk_text_iter_get_pixbuf ( --> N-GObject  )


=end pod

sub gtk_text_iter_get_pixbuf ( N-GTextIter $iter )
  returns N-GObject
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_marks:
=begin pod
=head2 [[gtk_] text_iter_] get_marks

Returns a list of all B<Gnome::Gtk3::TextMark> at this location. Because marks
are not iterable (they don’t take up any "space" in the buffer,
they are just marks in between iterable locations), multiple marks
can exist in the same place. The returned list is not in any
meaningful order.

Returns: (element-type B<Gnome::Gtk3::TextMark>) (transfer container): list of B<Gnome::Gtk3::TextMark>

  method gtk_text_iter_get_marks ( --> N-GSList  )


=end pod

sub gtk_text_iter_get_marks ( N-GTextIter $iter )
  returns N-GSList
  is native(&gtk-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_child_anchor:
=begin pod
=head2 [[gtk_] text_iter_] get_child_anchor

If the location at I<iter> contains a child anchor, the
anchor is returned (with no new reference count added). Otherwise,
C<Any> is returned.

Returns: (transfer none): the anchor at I<iter>

  method gtk_text_iter_get_child_anchor ( --> GtkTextChildAnchor  )


=end pod

sub gtk_text_iter_get_child_anchor ( N-GObject $iter )
  returns GtkTextChildAnchor
  is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_toggled_tags:
=begin pod
=head2 [[gtk_] text_iter_] get_toggled_tags

Returns a list of B<Gnome::Gtk3::TextTag> that are toggled on or off at this
point.  (If I<toggled_on> is C<1>, the list contains tags that are
toggled on.) If a tag is toggled on at I<iter>, then some non-empty
range of characters following I<iter> has that tag applied to it.  If
a tag is toggled off, then some non-empty range following I<iter>
does not have the tag applied to it.

Returns: (element-type B<Gnome::Gtk3::TextTag>) (transfer container): tags toggled at this point

  method gtk_text_iter_get_toggled_tags ( Int $toggled_on --> N-GSList  )

=item Int $toggled_on; C<1> to get toggled-on tags

=end pod

sub gtk_text_iter_get_toggled_tags ( N-GTextIter $iter, int32 $toggled_on )
  returns N-GSList
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_starts_tag:
=begin pod
=head2 [[gtk_] text_iter_] starts_tag

Returns C<1> if I<tag> is toggled on at exactly this point. If I<tag>
is C<Any>, returns C<1> if any tag is toggled on at this point.

Note that if C<gtk_text_iter_starts_tag()> returns C<1>, it means that I<iter> is
at the beginning of the tagged range, and that the
character at I<iter> is inside the tagged range. In other
words, unlike C<gtk_text_iter_ends_tag()>, if C<gtk_text_iter_starts_tag()> returns
C<1>, C<gtk_text_iter_has_tag()> will also return C<1> for the same
parameters.

Returns: whether I<iter> is the start of a range tagged with I<tag>
Since: 3.20

  method gtk_text_iter_starts_tag ( N-GObject $tag --> Int  )

=item N-GObject $tag; (nullable): a B<Gnome::Gtk3::TextTag>, or C<Any>

=end pod

sub gtk_text_iter_starts_tag ( N-GTextIter $iter, N-GObject $tag )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_ends_tag:
=begin pod
=head2 [[gtk_] text_iter_] ends_tag

Returns C<1> if I<tag> is toggled off at exactly this point. If I<tag>
is C<Any>, returns C<1> if any tag is toggled off at this point.

Note that if C<gtk_text_iter_ends_tag()> returns C<1>, it means that I<iter> is
at the end of the tagged range, but that the character
at I<iter> is outside the tagged range. In other words,
unlike C<gtk_text_iter_starts_tag()>, if C<gtk_text_iter_ends_tag()> returns C<1>,
C<gtk_text_iter_has_tag()> will return C<0> for the same parameters.

Returns: whether I<iter> is the end of a range tagged with I<tag>

  method gtk_text_iter_ends_tag ( N-GObject $tag --> Int  )

=item N-GObject $tag; (allow-none): a B<Gnome::Gtk3::TextTag>, or C<Any>

=end pod

sub gtk_text_iter_ends_tag ( N-GTextIter $iter, N-GObject $tag )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_toggles_tag:
=begin pod
=head2 [[gtk_] text_iter_] toggles_tag

This is equivalent to (C<gtk_text_iter_starts_tag()> ||
C<gtk_text_iter_ends_tag()>), i.e. it tells you whether a range with
I<tag> applied to it begins or ends at I<iter>.

Returns: whether I<tag> is toggled on or off at I<iter>

  method gtk_text_iter_toggles_tag ( N-GObject $tag --> Int  )

=item N-GObject $tag; (allow-none): a B<Gnome::Gtk3::TextTag>, or C<Any>

=end pod

sub gtk_text_iter_toggles_tag ( N-GTextIter $iter, N-GObject $tag )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_has_tag:
=begin pod
=head2 [[gtk_] text_iter_] has_tag

Returns C<1> if I<iter> points to a character that is part of a range tagged
with I<tag>. See also C<gtk_text_iter_starts_tag()> and C<gtk_text_iter_ends_tag()>.

Returns: whether I<iter> is tagged with I<tag>

  method gtk_text_iter_has_tag ( N-GObject $tag --> Int  )

=item N-GObject $tag; a B<Gnome::Gtk3::TextTag>

=end pod

sub gtk_text_iter_has_tag ( N-GTextIter $iter, N-GObject $tag )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_tags:
=begin pod
=head2 [[gtk_] text_iter_] get_tags

Returns a list of tags that apply to I<iter>, in ascending order of
priority (highest-priority tags are last). The B<Gnome::Gtk3::TextTag> in the
list don’t have a reference added, but you have to free the list
itself.

Returns: (element-type B<Gnome::Gtk3::TextTag>) (transfer container): list of B<Gnome::Gtk3::TextTag>

  method gtk_text_iter_get_tags ( --> N-GSList  )


=end pod

sub gtk_text_iter_get_tags ( N-GTextIter $iter )
  returns N-GSList
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_editable:
=begin pod
=head2 [gtk_] text_iter_editable

Returns whether the character at I<iter> is within an editable region
of text.  Non-editable text is “locked” and can’t be changed by the
user via B<Gnome::Gtk3::TextView>. This function is simply a convenience
wrapper around C<gtk_text_iter_get_attributes()>. If no tags applied
to this text affect editability, I<default_setting> will be returned.

You don’t want to use this function to decide whether text can be
inserted at I<iter>, because for insertion you don’t want to know
whether the char at I<iter> is inside an editable range, you want to
know whether a new character inserted at I<iter> would be inside an
editable range. Use C<gtk_text_iter_can_insert()> to handle this
case.

Returns: whether I<iter> is inside an editable range

  method gtk_text_iter_editable ( Int $default_setting --> Int  )

=item Int $default_setting; C<1> if text is editable by default

=end pod

sub gtk_text_iter_editable ( N-GTextIter $iter, int32 $default_setting )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_can_insert:
=begin pod
=head2 [[gtk_] text_iter_] can_insert

Considering the default editability of the buffer, and tags that
affect editability, determines whether text inserted at I<iter> would
be editable. If text inserted at I<iter> would be editable then the
user should be allowed to insert text at I<iter>.
C<gtk_text_buffer_insert_interactive()> uses this function to decide
whether insertions are allowed at a given position.

Returns: whether text inserted at I<iter> would be editable

  method gtk_text_iter_can_insert ( Int $default_editability --> Int  )

=item Int $default_editability; C<1> if text is editable by default

=end pod

sub gtk_text_iter_can_insert ( N-GTextIter $iter, int32 $default_editability )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_starts_word:
=begin pod
=head2 [[gtk_] text_iter_] starts_word

Determines whether I<iter> begins a natural-language word.  Word
breaks are determined by Pango and should be correct for nearly any
language (if not, the correct fix would be to the Pango word break
algorithms).

Returns: C<1> if I<iter> is at the start of a word

  method gtk_text_iter_starts_word ( --> Int  )


=end pod

sub gtk_text_iter_starts_word ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_ends_word:
=begin pod
=head2 [[gtk_] text_iter_] ends_word

Determines whether I<iter> ends a natural-language word.  Word breaks
are determined by Pango and should be correct for nearly any
language (if not, the correct fix would be to the Pango word break
algorithms).

Returns: C<1> if I<iter> is at the end of a word

  method gtk_text_iter_ends_word ( --> Int  )


=end pod

sub gtk_text_iter_ends_word ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_inside_word:
=begin pod
=head2 [[gtk_] text_iter_] inside_word

Determines whether the character pointed by I<iter> is part of a
natural-language word (as opposed to say inside some whitespace).  Word
breaks are determined by Pango and should be correct for nearly any language
(if not, the correct fix would be to the Pango word break algorithms).

Note that if C<gtk_text_iter_starts_word()> returns C<1>, then this function
returns C<1> too, since I<iter> points to the first character of the word.

Returns: C<1> if I<iter> is inside a word

  method gtk_text_iter_inside_word ( --> Int  )


=end pod

sub gtk_text_iter_inside_word ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_starts_sentence:
=begin pod
=head2 [[gtk_] text_iter_] starts_sentence

Determines whether I<iter> begins a sentence.  Sentence boundaries are
determined by Pango and should be correct for nearly any language
(if not, the correct fix would be to the Pango text boundary
algorithms).

Returns: C<1> if I<iter> is at the start of a sentence.

  method gtk_text_iter_starts_sentence ( --> Int  )


=end pod

sub gtk_text_iter_starts_sentence ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_ends_sentence:
=begin pod
=head2 [[gtk_] text_iter_] ends_sentence

Determines whether I<iter> ends a sentence.  Sentence boundaries are
determined by Pango and should be correct for nearly any language
(if not, the correct fix would be to the Pango text boundary
algorithms).

Returns: C<1> if I<iter> is at the end of a sentence.

  method gtk_text_iter_ends_sentence ( --> Int  )


=end pod

sub gtk_text_iter_ends_sentence ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_inside_sentence:
=begin pod
=head2 [[gtk_] text_iter_] inside_sentence

Determines whether I<iter> is inside a sentence (as opposed to in
between two sentences, e.g. after a period and before the first
letter of the next sentence).  Sentence boundaries are determined
by Pango and should be correct for nearly any language (if not, the
correct fix would be to the Pango text boundary algorithms).

Returns: C<1> if I<iter> is inside a sentence.

  method gtk_text_iter_inside_sentence ( --> Int  )


=end pod

sub gtk_text_iter_inside_sentence ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_starts_line:
=begin pod
=head2 [[gtk_] text_iter_] starts_line

Returns C<1> if I<iter> begins a paragraph,
i.e. if C<gtk_text_iter_get_line_offset()> would return 0.
However this function is potentially more efficient than
C<gtk_text_iter_get_line_offset()> because it doesn’t have to compute
the offset, it just has to see whether it’s 0.

Returns: whether I<iter> begins a line

  method gtk_text_iter_starts_line ( --> Int  )


=end pod

sub gtk_text_iter_starts_line ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_ends_line:
=begin pod
=head2 [[gtk_] text_iter_] ends_line

Returns C<1> if I<iter> points to the start of the paragraph
delimiter characters for a line (delimiters will be either a
newline, a carriage return, a carriage return followed by a
newline, or a Unicode paragraph separator character). Note that an
iterator pointing to the \n of a \r\n pair will not be counted as
the end of a line, the line ends before the \r. The end iterator is
considered to be at the end of a line, even though there are no
paragraph delimiter chars there.

Returns: whether I<iter> is at the end of a line

  method gtk_text_iter_ends_line ( --> Int  )


=end pod

sub gtk_text_iter_ends_line ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_is_cursor_position:
=begin pod
=head2 [[gtk_] text_iter_] is_cursor_position

See C<gtk_text_iter_forward_cursor_position()> or B<PangoLogAttr> or
C<pango_break()> for details on what a cursor position is.

Returns: C<1> if the cursor can be placed at I<iter>

  method gtk_text_iter_is_cursor_position ( --> Int  )


=end pod

sub gtk_text_iter_is_cursor_position ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_chars_in_line:
=begin pod
=head2 [[gtk_] text_iter_] get_chars_in_line

Returns the number of characters in the line containing I<iter>,
including the paragraph delimiters.

Returns: number of characters in the line

  method gtk_text_iter_get_chars_in_line ( --> Int  )


=end pod

sub gtk_text_iter_get_chars_in_line ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_bytes_in_line:
=begin pod
=head2 [[gtk_] text_iter_] get_bytes_in_line

Returns the number of bytes in the line containing I<iter>,
including the paragraph delimiters.

Returns: number of bytes in the line

  method gtk_text_iter_get_bytes_in_line ( --> Int  )


=end pod

sub gtk_text_iter_get_bytes_in_line ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_attributes:
=begin pod
=head2 [[gtk_] text_iter_] get_attributes

Computes the effect of any tags applied to this spot in the
text. The I<values> parameter should be initialized to the default
settings you wish to use if no tags are in effect. You’d typically
obtain the defaults from C<gtk_text_view_get_default_attributes()>.

C<gtk_text_iter_get_attributes()> will modify I<values>, applying the
effects of any tags present at I<iter>. If any tags affected I<values>,
the function returns C<1>.

Returns: C<1> if I<values> was modified

  method gtk_text_iter_get_attributes ( N-GObject $values --> Int  )

=item N-GObject $values; (out): a B<Gnome::Gtk3::TextAttributes> to be filled in

=end pod

sub gtk_text_iter_get_attributes ( N-GTextIter $iter, N-GObject $values )
  returns int32
  is native(&gtk-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_get_language:
=begin pod
=head2 [[gtk_] text_iter_] get_language

A convenience wrapper around C<gtk_text_iter_get_attributes()>,
which returns the language in effect at I<iter>. If no tags affecting
language apply to I<iter>, the return value is identical to that of
C<gtk_get_default_language()>.

Returns: (transfer full): language in effect at I<iter>

  method gtk_text_iter_get_language ( --> PangoLanguage  )


=end pod

sub gtk_text_iter_get_language ( N-GTextIter $iter )
  returns PangoLanguage
  is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_is_end:
=begin pod
=head2 [[gtk_] text_iter_] is_end

Returns C<1> if I<iter> is the end iterator, i.e. one past the last
dereferenceable iterator in the buffer. C<gtk_text_iter_is_end()> is
the most efficient way to check whether an iterator is the end
iterator.

Returns: whether I<iter> is the end iterator

  method gtk_text_iter_is_end ( --> Int  )


=end pod

sub gtk_text_iter_is_end ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_is_start:
=begin pod
=head2 [[gtk_] text_iter_] is_start

Returns C<1> if I<iter> is the first iterator in the buffer, that is
if I<iter> has a character offset of 0.

Returns: whether I<iter> is the first in the buffer

  method gtk_text_iter_is_start ( --> Int  )


=end pod

sub gtk_text_iter_is_start ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_forward_char:
=begin pod
=head2 [[gtk_] text_iter_] forward_char

Moves I<iter> forward by one character offset. Note that images
embedded in the buffer occupy 1 character slot, so
C<gtk_text_iter_forward_char()> may actually move onto an image instead
of a character, if you have images in your buffer.  If I<iter> is the
end iterator or one character before it, I<iter> will now point at
the end iterator, and C<gtk_text_iter_forward_char()> returns C<0> for
convenience when writing loops.

Returns: whether I<iter> moved and is dereferenceable

  method gtk_text_iter_forward_char ( --> Int  )


=end pod

sub gtk_text_iter_forward_char ( N-GTextIter $iter )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_iter_backward_char:
=begin pod
=head2 [[gtk_] text_iter_] backward_char

Moves backward by one character offset. Returns C<1> if movement
was