### ----------------------------------------------------
### -- Gnome::Gtk3
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Gtk3/Entry.rakumod
### ----------------------------------------------------
### -- Chunk 1 of 5
#TL:1:Gnome::Gtk3::Entry:
# NOTE: there are documentation errors in gtkentry.c
#   GtkEntry::show-emoji-icon: -> GtkEntry:show-emoji-icon:
#   GtkEntry::tabs:            -> GtkEntry:tabs:
use v6;
#-------------------------------------------------------------------------------
=begin pod

=head1 Gnome::Gtk3::Entry

A single line text entry field

![](images/entry.png)


=head1 Description

The B<Gnome::Gtk3::Entry> widget is a single line text entry widget. A fairly large set of key bindings are supported by default. If the entered text is longer than the allocation of the widget, the widget will scroll so that the cursor position is visible.

When using an entry for passwords and other sensitive information, it can be put into “password mode” using C<gtk_entry_set_visibility()>. In this mode, entered text is displayed using a “invisible” character. By default, GTK+ picks the best invisible character that is available in the current font, but it can be changed with C<gtk_entry_set_invisible_char()>. Since 2.16, GTK+ displays a warning when Caps Lock or input methods might interfere with entering text in a password entry. The warning can be turned off with the  I<caps-lock-warning> property.

Since 2.16, B<Gnome::Gtk3::Entry> has the ability to display progress or activity information behind the text. To make an entry display such information, use C<gtk_entry_set_progress_fraction()> or C<gtk_entry_set_progress_pulse_step()>.

=begin comment
Additionally, B<Gnome::Gtk3::Entry> can show icons at either side of the entry. These icons can be activatable by clicking, can be set up as drag source and can have tooltips. To add an icon, use C<gtk_entry_set_icon_from_gicon()> or one of the various other functions that set an icon from a stock id, an icon name or a pixbuf. To trigger an action when the user clicks an icon, connect to the  I<icon-press> signal. To allow DND operations from an icon, use C<gtk_entry_set_icon_drag_source()>. To set a tooltip on an icon, use C<gtk_entry_set_icon_tooltip_text()> or the corresponding function for markup.
=end comment

Note that functionality or information that is only available by clicking on an icon in an entry may not be accessible at all to users which are not able to use a mouse or other pointing device. It is therefore recommended that any such functionality should also be available by other means, e.g. via the context menu of the entry.


=head2 Css Nodes

  entry
  ├── image.left
  ├── image.right
  ├── undershoot.left
  ├── undershoot.right
  ├── [selection]
  ├── [progress[.pulse]]
  ╰── [window.popup]

B<Gnome::Gtk3::Entry> has a main node with the name entry. Depending on the properties of the entry, the style classes .read-only and .flat may appear. The style classes .warning and .error may also be used with entries.

When the entry shows icons, it adds subnodes with the name image and the style class .left or .right, depending on where the icon appears.

When the entry has a selection, it adds a subnode with the name selection.

When the entry shows progress, it adds a subnode with the name progress. The node has the style class .pulse when the shown progress is pulsing.

The CSS node for a context menu is added as a subnode below entry as well.

The undershoot nodes are used to draw the underflow indication when content is scrolled out of view. These nodes get the .left and .right style classes added depending on where the indication is drawn.

When touch is used and touch selection handles are shown, they are using CSS nodes with name cursor-handle. They get the .top or .bottom style class depending on where they are shown in relation to the selection. If there is just a single handle for the text cursor, it gets the style class .insertion-cursor.


=comment head2 Uml Diagram

![](plantuml/Entry.svg)


=head2 See Also

B<Gnome::Gtk3::TextView>, B<Gnome::Gtk3::EntryCompletion>

=head1 Synopsis
=head2 Declaration

  unit class Gnome::Gtk3::Entry;
  also is Gnome::Gtk3::Widget;


=head2 Inheriting this class

Inheriting is done in a special way in that it needs a call from new() to get the native object created by the class you are inheriting from.

  use Gnome::Gtk3::Entry:api<1>;

  unit class MyGuiClass;
  also is Gnome::Gtk3::Entry;
  also does Gnome::Gtk3::Editable;

  submethod new ( |c ) {
    # let the Gnome::Gtk3::Entry class process the options
    self.bless( :GtkEntry, |c);
  }

  submethod BUILD ( ... ) {
    ...
  }

=comment head2 Example

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

use Gnome::N::X:api<1>;
use Gnome::N::NativeLib:api<1>;
use Gnome::N::N-GObject:api<1>;
use Gnome::N::GlibToRakuTypes:api<1>;

use Gnome::Gdk3::Events:api<1>;
use Gnome::Gdk3::DragContext:api<1>;

use Gnome::Gtk3::Image:api<1>;
use Gnome::Gtk3::Widget:api<1>;
use Gnome::Gtk3::Editable:api<1>;
use Gnome::Gtk3::Enums:api<1>;
use Gnome::Gtk3::TargetList:api<1>;

#-------------------------------------------------------------------------------
# /usr/include/gtk-3.0/gtk/INCLUDE
# https://developer.gnome.org/WWW
unit class Gnome::Gtk3::Entry:auth<github:MARTIMM>:api<1>;
also is Gnome::Gtk3::Widget;
also does Gnome::Gtk3::Editable;

#-------------------------------------------------------------------------------
=begin pod
=head1 Types
=end pod
#-------------------------------------------------------------------------------
=begin pod
=head2 enum GtkEntryIconPosition

Specifies the side of the entry at which an icon is placed.

Since: 2.16


=item GTK_ENTRY_ICON_PRIMARY: At the beginning of the entry (depending on the text direction).
=item GTK_ENTRY_ICON_SECONDARY: At the end of the entry (depending on the text direction).


=end pod

#TE:0:GtkEntryIconPosition:
enum GtkEntryIconPosition is export (
  'GTK_ENTRY_ICON_PRIMARY',
  'GTK_ENTRY_ICON_SECONDARY'
);

#-------------------------------------------------------------------------------
my Bool $signals-added = False;
#-------------------------------------------------------------------------------

=begin pod
=head1 Methods
=head2 new
=head3 default, no options

Create a new plain object.

  multi method new ( )


=head3 :native-object

Create an object using a native object from elsewhere. See also B<Gnome::N::TopLevelSupportClass>.

  multi method new ( N-GObject :$native-object! )


=head3 :build-id

Create an object using a native object from a builder. See also B<Gnome::GObject::Object>.

  multi method new ( Str :$build-id! )

=end pod

#TM:1:new():inheriting
#TM:1:new():
#TM:0:new(:native-object):
#TM:0:new(:build-id):

submethod BUILD ( *%options ) {

  unless $signals-added {
    # add signal info in the form of w*<signal-name>.
    $signals-added = self.add-signal-types( $?CLASS.^name,
      :w2<insert-at-cursor toggle-overwrite icon-press>, :w1<tabs move-cursor icon-release>, :w3<activate>, :w0<populate-popup delete-from-cursor backspace cut-clipboard copy-clipboard paste-clipboard>,
    );

    # signals from interfaces
    self._add_editable_interface_signal_types($?CLASS.^name);
  }


  # prevent creating wrong native-objects
  if self.^name eq 'Gnome::Gtk3::Entry' or %options<GtkEntry> {

    if self.is-valid { }

    # process all named arguments
    elsif %options<native-object>:exists or %options<widget>:exists or
      %options<build-id>:exists { }

    else {
      my $no;

      # process all named arguments
      $no = _gtk_entry_new();

      self._set-native-object($no);
    }

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

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

  my Str $new-patt = $native-sub.subst( '_', '-', :g);

  my Callable $s;
  try { $s = &::("gtk_entry_$native-sub"); };
  if ?$s {
    Gnome::N::deprecate(
      "gtk_entry_$native-sub", $new-patt, '0.47.4', '0.50.0'
    );
  }

  else {
    try { $s = &::("gtk_$native-sub"); } unless ?$s;
    if ?$s {
      Gnome::N::deprecate(
        "gtk_$native-sub", $new-patt.subst('entry-'),
        '0.47.4', '0.50.0'
      );
    }

    else {
      try { $s = &::($native-sub); } if !$s and $native-sub ~~ m/^ 'gtk_' /;
      if ?$s {
        Gnome::N::deprecate(
          "$native-sub", $new-patt.subst('gtk-entry-'),
          '0.47.4', '0.50.0'
        );
      }
    }
  }

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

  $s;
}

#-------------------------------------------------------------------------------
#TM:0:get-activates-default:
=begin pod
=head2 get-activates-default

Retrieves the value set by C<set_activates_default()>.

Returns: C<True> if the entry will activate the default widget

  method get-activates-default ( --> Bool )

=end pod

method get-activates-default ( --> Bool ) {
  gtk_entry_get_activates_default( self._f('GtkEntry')).Bool
}

sub gtk_entry_get_activates_default (
  N-GObject $entry --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-alignment:
=begin pod
=head2 get-alignment

Gets the value set by C<set_alignment()>.

Returns: the alignment

  method get-alignment ( --> Num )

=end pod

method get-alignment ( --> Num ) {
  gtk_entry_get_alignment( self._f('GtkEntry'))
}

sub gtk_entry_get_alignment (
  N-GObject $entry --> gfloat
) is native(&gtk-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:get-attributes:
=begin pod
=head2 get-attributes

Gets the attribute list that was set on the entry using C<set_attributes()>, if any.

Returns: the attribute list, or C<undefined> if none was set.

  method get-attributes ( --> PangoAttrList )

=end pod

method get-attributes ( --> PangoAttrList ) {
  gtk_entry_get_attributes( self._f('GtkEntry'))
}

sub gtk_entry_get_attributes (
  N-GObject $entry --> PangoAttrList
) is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:0:get-buffer:
=begin pod
=head2 get-buffer

Get the B<Gnome::Gtk3::EntryBuffer> object which holds the text for this widget.

Returns: A B<Gnome::Gtk3::EntryBuffer> object.

  method get-buffer ( --> N-GObject )

=end pod

method get-buffer ( --> N-GObject ) {
  gtk_entry_get_buffer( self._f('GtkEntry'))
}

sub gtk_entry_get_buffer (
  N-GObject $entry --> N-GObject
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-completion:
=begin pod
=head2 get-completion

Returns the auxiliary completion object currently in use by I<entry>.

Returns: The auxiliary completion object currently in use by I<entry>.

  method get-completion ( --> N-GObject )

=end pod

method get-completion ( --> N-GObject ) {
  gtk_entry_get_completion( self._f('GtkEntry'))
}

sub gtk_entry_get_completion (
  N-GObject $entry --> N-GObject
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-current-icon-drag-source:
=begin pod
=head2 get-current-icon-drag-source

Returns the index of the icon which is the source of the current DND operation, or -1.

This function is meant to be used in a I<drag-data-get from Gnome::Gtk3::Widget> callback.

Returns: index of the icon which is the source of the current DND operation, or -1.

  method get-current-icon-drag-source ( --> Int )

=end pod

method get-current-icon-drag-source ( --> Int ) {
  gtk_entry_get_current_icon_drag_source( self._f('GtkEntry'))
}

sub gtk_entry_get_current_icon_drag_source (
  N-GObject $entry --> gint
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-cursor-hadjustment:
=begin pod
=head2 get-cursor-hadjustment

Retrieves the horizontal cursor adjustment for the entry. See C<set_cursor_hadjustment()>.

Returns: the horizontal cursor adjustment, or C<undefined> if none has been set.

  method get-cursor-hadjustment ( --> N-GObject )

=end pod

method get-cursor-hadjustment ( --> N-GObject ) {
  gtk_entry_get_cursor_hadjustment( self._f('GtkEntry'))
}

sub gtk_entry_get_cursor_hadjustment (
  N-GObject $entry --> N-GObject
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-has-frame:
=begin pod
=head2 get-has-frame

Gets the value set by C<set_has_frame()>.

Returns: whether the entry has a beveled frame

  method get-has-frame ( --> Bool )

=end pod

method get-has-frame ( --> Bool ) {
  gtk_entry_get_has_frame( self._f('GtkEntry')).Bool
}

sub gtk_entry_get_has_frame (
  N-GObject $entry --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-icon-activatable:
=begin pod
=head2 get-icon-activatable

Returns whether the icon is activatable.

Returns: C<True> if the icon is activatable.

  method get-icon-activatable ( GtkEntryIconPosition $icon_pos --> Bool )

=item $icon_pos; Icon position
=end pod

method get-icon-activatable ( GtkEntryIconPosition $icon_pos --> Bool ) {
  gtk_entry_get_icon_activatable( self._f('GtkEntry'), $icon_pos).Bool
}

sub gtk_entry_get_icon_activatable (
  N-GObject $entry, GEnum $icon_pos --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-icon-area:
=begin pod
=head2 get-icon-area

Gets the area where entry’s icon at I<icon_pos> is drawn. This function is useful when drawing something to the entry in a draw callback.

If the entry is not realized or has no icon at the given position, I<icon_area> is filled with zeros. Otherwise, I<icon_area> will be filled with the icon’s allocation, relative to I<entry>’s allocation.

See also C<get_text_area()>

  method get-icon-area ( GtkEntryIconPosition $icon_pos, N-GObject() $icon_area )

=item $icon_pos; Icon position
=item $icon_area; Return location for the icon’s area
=end pod

method get-icon-area ( GtkEntryIconPosition $icon_pos, N-GObject() $icon_area ) {
  gtk_entry_get_icon_area( self._f('GtkEntry'), $icon_pos, $icon_area);
}

sub gtk_entry_get_icon_area (
  N-GObject $entry, GEnum $icon_pos, N-GObject $icon_area
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-icon-at-pos:
=begin pod
=head2 get-icon-at-pos

Finds the icon at the given position and return its index. The position’s coordinates are relative to the I<entry>’s top left corner. If I<x>, I<y> doesn’t lie inside an icon, -1 is returned. This function is intended for use in a I<query-tooltip from Gnome::Gtk3::Widget> signal handler.

Returns: the index of the icon at the given position, or -1

  method get-icon-at-pos ( Int() $x, Int() $y --> Int )

=item $x; the x coordinate of the position to find
=item $y; the y coordinate of the position to find
=end pod

method get-icon-at-pos ( Int() $x, Int() $y --> Int ) {
  gtk_entry_get_icon_at_pos( self._f('GtkEntry'), $x, $y)
}

sub gtk_entry_get_icon_at_pos (
  N-GObject $entry, gint $x, gint $y --> gint
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-icon-gicon:
=begin pod
=head2 get-icon-gicon

Retrieves the B<Gnome::Gio::Icon> used for the icon, or C<undefined> if there is no icon or if the icon was set by some other method (e.g., by stock, pixbuf, or icon name).

Returns: A B<Gnome::Gio::Icon>, or C<undefined> if no icon is set or if the icon is not a B<Gnome::Gio::Icon>

  method get-icon-gicon ( GtkEntryIconPosition $icon_pos --> N-GObject )

=item $icon_pos; Icon position
=end pod

method get-icon-gicon ( GtkEntryIconPosition $icon_pos --> N-GObject ) {
  gtk_entry_get_icon_gicon( self._f('GtkEntry'), $icon_pos)
}

sub gtk_entry_get_icon_gicon (
  N-GObject $entry, GEnum $icon_pos --> N-GObject
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-icon-name:
=begin pod
=head2 get-icon-name

Retrieves the icon name used for the icon, or C<undefined> if there is no icon or if the icon was set by some other method (e.g., by pixbuf, stock or gicon).

Returns: An icon name, or C<undefined> if no icon is set or if the icon wasn’t set from an icon name

  method get-icon-name ( GtkEntryIconPosition $icon_pos --> Str )

=item $icon_pos; Icon position
=end pod

method get-icon-name ( GtkEntryIconPosition $icon_pos --> Str ) {
  gtk_entry_get_icon_name( self._f('GtkEntry'), $icon_pos)
}

sub gtk_entry_get_icon_name (
  N-GObject $entry, GEnum $icon_pos --> gchar-ptr
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-icon-pixbuf:
=begin pod
=head2 get-icon-pixbuf

Retrieves the image used for the icon.

Unlike the other methods of setting and getting icon data, this method will work regardless of whether the icon was set using a B<Gnome::Gdk3::Pixbuf>, a B<Gnome::Gio::Icon>, a stock item, or an icon name.

Returns: A B<Gnome::Gdk3::Pixbuf>, or C<undefined> if no icon is set for this position.

  method get-icon-pixbuf ( GtkEntryIconPosition $icon_pos --> N-GObject )

=item $icon_pos; Icon position
=end pod

method get-icon-pixbuf ( GtkEntryIconPosition $icon_pos --> N-GObject ) {
  gtk_entry_get_icon_pixbuf( self._f('GtkEntry'), $icon_pos)
}

sub gtk_entry_get_icon_pixbuf (
  N-GObject $entry, GEnum $icon_pos --> N-GObject
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-icon-sensitive:
=begin pod
=head2 get-icon-sensitive

Returns whether the icon appears sensitive or insensitive.

Returns: C<True> if the icon is sensitive.

  method get-icon-sensitive ( GtkEntryIconPosition $icon_pos --> Bool )

=item $icon_pos; Icon position
=end pod

method get-icon-sensitive ( GtkEntryIconPosition $icon_pos --> Bool ) {
  gtk_entry_get_icon_sensitive( self._f('GtkEntry'), $icon_pos).Bool
}

sub gtk_entry_get_icon_sensitive (
  N-GObject $entry, GEnum $icon_pos --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-icon-storage-type:
=begin pod
=head2 get-icon-storage-type

Gets the type of representation being used by the icon to store image data. If the icon has no image data, the return value will be C<GTK_IMAGE_EMPTY>.

Returns: image representation being used

  method get-icon-storage-type ( GtkEntryIconPosition $icon_pos --> GtkImageType )

=item $icon_pos; Icon position
=end pod

method get-icon-storage-type ( GtkEntryIconPosition $icon_pos --> GtkImageType ) {
  gtk_entry_get_icon_storage_type( self._f('GtkEntry'), $icon_pos)
}

sub gtk_entry_get_icon_storage_type (
  N-GObject $entry, GEnum $icon_pos --> GEnum
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-icon-tooltip-markup:
=begin pod
=head2 get-icon-tooltip-markup

Gets the contents of the tooltip on the icon at the specified position in I<entry>.

Returns: the tooltip text, or C<undefined>. Free the returned string with C<g_free()> when done.

  method get-icon-tooltip-markup ( GtkEntryIconPosition $icon_pos --> Str )

=item $icon_pos; the icon position
=end pod

method get-icon-tooltip-markup ( GtkEntryIconPosition $icon_pos --> Str ) {
  gtk_entry_get_icon_tooltip_markup( self._f('GtkEntry'), $icon_pos)
}

sub gtk_entry_get_icon_tooltip_markup (
  N-GObject $entry, GEnum $icon_pos --> gchar-ptr
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-icon-tooltip-text:
=begin pod
=head2 get-icon-tooltip-text

Gets the contents of the tooltip on the icon at the specified position in I<entry>.

Returns: the tooltip text, or C<undefined>. Free the returned string with C<g_free()> when done.

  method get-icon-tooltip-text ( GtkEntryIconPosition $icon_pos --> Str )

=item $icon_pos; the icon position
=end pod

method get-icon-tooltip-text ( GtkEntryIconPosition $icon_pos --> Str ) {
  gtk_entry_get_icon_tooltip_text( self._f('GtkEntry'), $icon_pos)
}

sub gtk_entry_get_icon_tooltip_text (
  N-GObject $entry, GEnum $icon_pos --> gchar-ptr
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-input-hints:
=begin pod
=head2 get-input-hints

Gets the value of the I<input-hints> property.

  method get-input-hints ( --> GtkInputHints )

=end pod

method get-input-hints ( --> GtkInputHints ) {
  gtk_entry_get_input_hints( self._f('GtkEntry'))
}

sub gtk_entry_get_input_hints (
  N-GObject $entry --> GEnum
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-input-purpose:
=begin pod
=head2 get-input-purpose

Gets the value of the I<input-purpose> property.

  method get-input-purpose ( --> GtkInputPurpose )

=end pod

method get-input-purpose ( --> GtkInputPurpose ) {
  gtk_entry_get_input_purpose( self._f('GtkEntry'))
}

sub gtk_entry_get_input_purpose (
  N-GObject $entry --> GEnum
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-invisible-char:
=begin pod
=head2 get-invisible-char

Retrieves the character displayed in place of the real characters for entries with visibility set to false. See C<set_invisible_char()>.

Returns: the current invisible char, or 0, if the entry does not show invisible text at all.

  method get-invisible-char ( --> gunichar )

=end pod

method get-invisible-char ( --> gunichar ) {
  gtk_entry_get_invisible_char( self._f('GtkEntry'))
}

sub gtk_entry_get_invisible_char (
  N-GObject $entry --> gunichar
) is native(&gtk-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:get-layout:
=begin pod
=head2 get-layout

Gets the B<PangoLayout> used to display the entry. The layout is useful to e.g. convert text positions to pixel positions, in combination with C<get_layout_offsets()>. The returned layout is owned by the entry and must not be modified or freed by the caller.

Keep in mind that the layout text may contain a preedit string, so C<layout_index_to_text_index()> and C<text_index_to_layout_index()> are needed to convert byte indices in the layout to byte indices in the entry contents.

Returns: the B<PangoLayout> for this entry

  method get-layout ( --> N-GObject )

=end pod

method get-layout ( --> N-GObject ) {
  gtk_entry_get_layout( self._f('GtkEntry'))
}

sub gtk_entry_get_layout (
  N-GObject $entry --> N-GObject
) is native(&gtk-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
#TM:0:get-layout-offsets:
=begin pod
=head2 get-layout-offsets

Obtains the position of the B<PangoLayout> used to render text in the entry, in widget coordinates. Useful if you want to line up the text in an entry with some other text, e.g. when using the entry to implement editable cells in a sheet widget.

Also useful to convert mouse events into coordinates inside the B<PangoLayout>, e.g. to take some action if some part of the entry text is clicked.

Note that as the user scrolls around in the entry the offsets will change; you’ll need to connect to the “notify::scroll-offset” signal to track this. Remember when using the B<PangoLayout> functions you need to convert to and from pixels using C<PANGO_PIXELS()> or B<PANGO_SCALE>.

Keep in mind that the layout text may contain a preedit string, so C<layout_index_to_text_index()> and C<text_index_to_layout_index()> are needed to convert byte indices in the layout to byte indices in the entry contents.

  method get-layout-offsets ( )

=item $x; location to store X offset of layout, or C<undefined>
=item $y; location to store Y offset of layout, or C<undefined>
=end pod

method get-layout-offsets ( ) {
  gtk_entry_get_layout_offsets( self._f('GtkEntry'), my gint $x, my gint $y);
}

sub gtk_entry_get_layout_offsets (
  N-GObject $entry, gint $x is rw, gint $y is rw
) is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:0:get-max-length:
=begin pod
=head2 get-max-length

Retrieves the maximum allowed length of the text in I<entry>. See C<set_max_length()>.

This is equivalent to getting I<entry>'s B<Gnome::Gtk3::EntryBuffer> and calling C<buffer_get_max_length()> on it.

Returns: the maximum allowed number of characters in B<Gnome::Gtk3::Entry>, or 0 if there is no maximum.

  method get-max-length ( --> Int )

=end pod

method get-max-length ( --> Int ) {
  gtk_entry_get_max_length( self._f('GtkEntry'))
}

sub gtk_entry_get_max_length (
  N-GObject $entry --> gint
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-max-width-chars:
=begin pod
=head2 get-max-width-chars

Retrieves the desired maximum width of I<entry>, in characters. See C<set_max_width_chars()>.

Returns: the maximum width of the entry, in characters

  method get-max-width-chars ( --> Int )

=end pod

method get-max-width-chars ( --> Int ) {
  gtk_entry_get_max_width_chars( self._f('GtkEntry'))
}

sub gtk_entry_get_max_width_chars (
  N-GObject $entry --> gint
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-overwrite-mode:
=begin pod
=head2 get-overwrite-mode

Gets the value set by C<set_overwrite_mode()>.

Returns: whether the text is overwritten when typing.

  method get-overwrite-mode ( --> Bool )

=end pod

method get-overwrite-mode ( --> Bool ) {
  gtk_entry_get_overwrite_mode( self._f('GtkEntry')).Bool
}

sub gtk_entry_get_overwrite_mode (
  N-GObject $entry --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-placeholder-text:
=begin pod
=head2 get-placeholder-text

Retrieves the text that will be displayed when I<entry> is empty and unfocused

Returns: a pointer to the placeholder text as a string. This string points to internally allocated storage in the widget and must not be freed, modified or stored.

  method get-placeholder-text ( --> Str )

=end pod

method get-placeholder-text ( --> Str ) {
  gtk_entry_get_placeholder_text( self._f('GtkEntry'))
}

sub gtk_entry_get_placeholder_text (
  N-GObject $entry --> gchar-ptr
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-progress-fraction:
=begin pod
=head2 get-progress-fraction

Returns the current fraction of the task that’s been completed. See C<set_progress_fraction()>.

Returns: a fraction from 0.0 to 1.0

  method get-progress-fraction ( --> Num )

=end pod

method get-progress-fraction ( --> Num ) {
  gtk_entry_get_progress_fraction( self._f('GtkEntry'))
}

sub gtk_entry_get_progress_fraction (
  N-GObject $entry --> gdouble
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-progress-pulse-step:
=begin pod
=head2 get-progress-pulse-step

Retrieves the pulse step set with C<set_progress_pulse_step()>.

Returns: a fraction from 0.0 to 1.0

  method get-progress-pulse-step ( --> Num )

=end pod

method get-progress-pulse-step ( --> Num ) {
  gtk_entry_get_progress_pulse_step( self._f('GtkEntry'))
}

sub gtk_entry_get_progress_pulse_step (
  N-GObject $entry --> gdouble
) is native(&gtk-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:get-tabs:
=begin pod
=head2 get-tabs

Gets the tabstops that were set on the entry using C<set_tabs()>, if any.

Returns: the tabstops, or C<undefined> if none was set.

  method get-tabs ( --> PangoTabArray )

=end pod

method get-tabs ( --> PangoTabArray ) {
  gtk_entry_get_tabs( self._f('GtkEntry'))
}

sub gtk_entry_get_tabs (
  N-GObject $entry --> PangoTabArray
) is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:get-text:
=begin pod
=head2 get-text

Retrieves the contents of the entry widget. See also C<gtk_editable_get_chars()>.

This is equivalent to getting I<entry>'s B<Gnome::Gtk3::EntryBuffer> and calling C<buffer_get_text()> on it.

Returns: a pointer to the contents of the widget as a string. This string points to internally allocated storage in the widget and must not be freed, modified or stored.

  method get-text ( --> Str )

=end pod

method get-text ( --> Str ) {
  gtk_entry_get_text( self._f('GtkEntry'))
}

sub gtk_entry_get_text (
  N-GObject $entry --> gchar-ptr
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-text-area:
=begin pod
=head2 get-text-area

Gets the area where the entry’s text is drawn. This function is useful when drawing something to the entry in a draw callback.

If the entry is not realized, I<text_area> is filled with zeros.

See also C<get_icon_area()>.

  method get-text-area ( N-GObject() $text_area )

=item $text_area; Return location for the text area.
=end pod

method get-text-area ( N-GObject() $text_area ) {
  gtk_entry_get_text_area( self._f('GtkEntry'), $text_area);
}

sub gtk_entry_get_text_area (
  N-GObject $entry, N-GObject $text_area
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:get-text-length:
=begin pod
=head2 get-text-length

Retrieves the current length of the text in I<entry>.

This is equivalent to getting I<entry>'s B<Gnome::Gtk3::EntryBuffer> and calling C<buffer_get_length()> on it.

Returns: the current number of characters in B<Gnome::Gtk3::Entry>, or 0 if there are none.

  method get-text-length ( --> UInt )

=end pod

method get-text-length ( --> UInt ) {
  gtk_entry_get_text_length( self._f('GtkEntry'))
}

sub gtk_entry_get_text_length (
  N-GObject $entry --> guint16
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:get-visibility:
=begin pod
=head2 get-visibility

Retrieves whether the text in I<entry> is visible. See C<set_visibility()>.

Returns: C<True> if the text is currently visible

  method get-visibility ( --> Bool )

=end pod

method get-visibility ( --> Bool ) {
  gtk_entry_get_visibility( self._f('GtkEntry')).Bool
}

sub gtk_entry_get_visibility (
  N-GObject $entry --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-width-chars:
=begin pod
=head2 get-width-chars

Gets the value set by C<set_width_chars()>.

Returns: number of chars to request space for, or negative if unset

  method get-width-chars ( --> Int )

=end pod

method get-width-chars ( --> Int ) {
  gtk_entry_get_width_chars( self._f('GtkEntry'))
}

sub gtk_entry_get_width_chars (
  N-GObject $entry --> gint
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:grab-focus-without-selecting:
=begin pod
=head2 grab-focus-without-selecting

Causes I<entry> to have keyboard focus.

It behaves like C<gtk_widget_grab_focus()>, except that it doesn't select the contents of the entry. You only want to call this on some special entries which the user usually doesn't want to replace all text in, such as search-as-you-type entries.

  method grab-focus-without-selecting ( )

=end pod

method grab-focus-without-selecting ( ) {
  gtk_entry_grab_focus_without_selecting( self._f('GtkEntry'));
}

sub gtk_entry_grab_focus_without_selecting (
  N-GObject $entry
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:im-context-filter-keypress:
=begin pod
=head2 im-context-filter-keypress

Allow the B<Gnome::Gtk3::Entry> input method to internally handle key press and release events. If this function returns C<True>, then no further processing should be done for this key event. See C<gtk_im_context_filter_keypress()>.

Note that you are expected to call this function from your handler when overriding key event handling. This is needed in the case when you need to insert your own key handling between the input method and the default key event handling of the B<Gnome::Gtk3::Entry>. See C<gtk_text_view_reset_im_context()> for an example of use.

Returns: C<True> if the input method handled the key event.

  method im-context-filter-keypress ( N-GdkEvent $event --> Bool )

=item $event; (type Gdk.EventKey): the key event
=end pod

method im-context-filter-keypress ( N-GdkEvent $event --> Bool ) {
  gtk_entry_im_context_filter_keypress( self._f('GtkEntry'), $event).Bool
}

sub gtk_entry_im_context_filter_keypress (
  N-GObject $entry, N-GdkEvent $event --> gboolean
) is native(&gtk-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:layout-index-to-text-index:
=begin pod
=head2 layout-index-to-text-index

Converts from a position in the entry’s B<PangoLayout> (returned by C<get_layout()>) to a position in the entry contents (returned by C<get_text()>).

Returns: byte index into the entry contents

  method layout-index-to-text-index ( Int() $layout_index --> Int )

=item $