### ----------------------------------------------------
### -- Gnome::Gtk3
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Gtk3/Widget.rakumod
### ----------------------------------------------------
### -- Chunk 4 of 8
 get-support-multidevice ( --> Bool ) {
  gtk_widget_get_support_multidevice(self._f('GtkWidget')).Bool
}

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

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

Fetch an object build from the template XML for I<widget-type> in this I<widget> instance.

This will only report children which were previously declared with C<class-bind-template-child-full()> or one of its variants.

This function is only meant to be called for code which is private to the I<widget-type> which declared the child and is meant for language bindings which cannot easily make use of the GObject structure offsets.

Returns: The object built in the template XML with the id I<name>

  method get-template-child ( N-GObject $widget_type, Str $name --> N-GObject )

=item N-GObject $widget_type; The B<Gnome::Gtk3::Type> to get a template child for
=item Str $name; The “id” of the child defined in the template XML

=end pod

method get-template-child ( $widget_type is copy, Str $name --> N-GObject ) {
  $widget_type .= _get-native-object-no-reffing unless $widget_type ~~ N-GObject;
  gtk_widget_get_template_child( self._f('GtkWidget'), $widget_type, $name)
}

sub gtk_widget_get_template_child (
  N-GObject $widget, N-GObject $widget_type, gchar-ptr $name --> N-GObject
) is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:get-tooltip-markup:
=begin pod
=head2 get-tooltip-markup

Gets the contents of the tooltip for I<widget>.

Returns: the tooltip text, or C<undefined>. You should free the returned string with C<g-free()> when done.

  method get-tooltip-markup ( --> Str )

=end pod

method get-tooltip-markup ( --> Str ) {
  gtk_widget_get_tooltip_markup(self._f('GtkWidget'))
}

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

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

Gets the contents of the tooltip for I<widget>.

Returns: the tooltip text, or C<undefined>. You should free the returned string with C<g-free()> when done.

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

=end pod

method get-tooltip-text ( --> Str ) {
  gtk_widget_get_tooltip_text(self._f('GtkWidget'))
}

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

#-------------------------------------------------------------------------------
#TM:1:get-tooltip-window:
#TM:1:get-tooltip-window-rk:
=begin pod
=head2 get-tooltip-window, get-tooltip-window-rk

Returns the B<Gnome::Gtk3::Window> of the current tooltip. This can be the GtkWindow created by default, or the custom tooltip window set using C<set-tooltip-window()>.

Returns: The B<Gnome::Gtk3::Window> of the current tooltip. It can be undefined or invalid when there is no window defined.

  method get-tooltip-window ( --> N-GObject )
  method get-tooltip-window-rk ( :$child-type? --> Gnome::Gtk3::Window )

=item $child-type: This is an optional argument. You can specify a real type or a type as a string. In the latter case the type must be defined in a module which can be found by the Raku require call.

=end pod

method get-tooltip-window-rk ( *%options --> Gnome::GObject::Object ) {
  my $no = gtk_widget_get_tooltip_window(self._f('GtkWidget'));
  if $no.defined {
    self._wrap-native-type-from-no( $no, |%options)
  }

  else {
    self.new(:native-object($no))
  }
}

method get-tooltip-window ( --> N-GObject ) {
  gtk_widget_get_tooltip_window(self._f('GtkWidget'))
}

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

#-------------------------------------------------------------------------------
#TM:1:get-toplevel:
#TM:1:get-toplevel-rk:
=begin pod
=head2 get-toplevel, get-toplevel-rk

This function returns the topmost widget in the container hierarchy I<widget> is a part of. If I<widget> has no parent widgets, it will be returned as the topmost widget. No reference will be added to the returned widget; it should not be unreferenced.

Note the difference in behavior vs. C<get-ancestor()>; `gtk-widget-get-ancestor (widget, GTK-TYPE-WINDOW)` would return C<undefined> if I<widget> wasn’t inside a toplevel window, and if the window was inside a B<Gnome::Gtk3::Window>-derived widget which was in turn inside the toplevel B<Gnome::Gtk3::Window>. While the second case may seem unlikely, it actually happens when a B<Gnome::Gtk3::Plug> is embedded inside a B<Gnome::Gtk3::Socket> within the same application.

To reliably find the toplevel B<Gnome::Gtk3::Window>, use C<get-toplevel()> and call C<GTK-IS-WINDOW()> on the result. For instance, to get the title of a widget's toplevel window, one might use:

  sub get-widget-toplevel-title ( Gnome::Gtk3::Widget $widget --> Str ) {
    Gnome::Gtk3::Widget $toplevel = $widget.get-toplevel-rk;
    ( $toplevel.is-valid and $toplevel.is-toplevel )
      ?? $toplevel.gtk-window-get-title !! ''
  }

Returns: the topmost ancestor of I<widget>, or I<widget> itself if there’s no ancestor.

  method get-toplevel ( --> N-GObject )
  method get-toplevel-rk ( :$child-type? --> Gnome::GObject::Widget )

=item $child-type: This is an optional argument. You can specify a real type or a type as a string. In the latter case the type must be defined in a module which can be found by the Raku require call.

=end pod

method get-toplevel-rk ( *%options --> Gnome::GObject::Object ) {
  self._wrap-native-type-from-no(
    gtk_widget_get_toplevel(self._f('GtkWidget')), |%options
  )
}

method get-toplevel ( --> N-GObject ) {
  gtk_widget_get_toplevel(self._f('GtkWidget'))
}

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

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

Gets the value of the  I<valign> property.

For backwards compatibility reasons this method will never return C<GTK-ALIGN-BASELINE>, but instead it will convert it to C<GTK-ALIGN-FILL>. If your widget want to support baseline aligned children it must use C<get-valign-with-baseline()>, or `g-object-get (widget, "valign", &value, NULL)`, which will also report the true value.

Returns: the vertical alignment of I<widget>, ignoring baseline alignment

  method get-valign ( --> GtkAlign )

=end pod

method get-valign ( --> GtkAlign ) {
  GtkAlign(gtk_widget_get_valign(self._f('GtkWidget')))
}

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

#-------------------------------------------------------------------------------
#TM:1:get-valign-with-baseline:
=begin pod
=head2 get-valign-with-baseline

Gets the value of the  I<valign> property, including C<GTK-ALIGN-BASELINE>.

Returns: the vertical alignment of I<widget>

  method get-valign-with-baseline ( --> GtkAlign )

=end pod

method get-valign-with-baseline ( --> GtkAlign ) {
  GtkAlign(gtk_widget_get_valign_with_baseline(self._f('GtkWidget')))
}

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

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

Gets whether the widget would like any available extra vertical space.

See C<get-hexpand()> for more detail.

Returns: whether vexpand flag is set

  method get-vexpand ( --> Bool )

=end pod

method get-vexpand ( --> Bool ) {
  gtk_widget_get_vexpand(self._f('GtkWidget')).Bool
}

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

#-------------------------------------------------------------------------------
#TM:1:get-vexpand-set:
=begin pod
=head2 get-vexpand-set

Gets whether C<set-vexpand()> has been used to explicitly set the expand flag on this widget.

See C<get-hexpand-set()> for more detail.

Returns: whether vexpand has been explicitly set

  method get-vexpand-set ( --> Bool )

=end pod

method get-vexpand-set ( --> Bool ) {
  gtk_widget_get_vexpand_set(self._f('GtkWidget')).Bool
}

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

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

Determines whether the widget is visible. If you want to take into account whether the widget’s parent is also marked as visible, use C<is-visible()> instead.

This function does not check if the widget is obscured in any way.

See C<set-visible()>.

Returns: C<True> if the widget is visible

  method get-visible ( --> Bool )

=end pod

method get-visible ( --> Bool ) {
  gtk_widget_get_visible(self._f('GtkWidget')).Bool
}

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

#-------------------------------------------------------------------------------
#TM:1:get-visual:
#TM:1:get-visual-rk:
=begin pod
=head2 get-visual, get-visual-rk

Gets the visual that will be used to render I<widget>.

Returns: the visual for I<widget>

  method get-visual-rk ( --> Gnome::Gdk3::Visual )
  method get-visual ( --> N-GObject )

=end pod

method get-visual-rk ( --> Gnome::Gdk3::Visual ) {
  Gnome::Gdk3::Visual.new(
    :native-object(gtk_widget_get_visual(self._f('GtkWidget')))
  );
}

method get-visual ( --> N-GObject ) {
  gtk_widget_get_visual(self._f('GtkWidget'))
}

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

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

Returns the widget’s window if it is realized, C<undefined> otherwise

Returns: I<widget>’s gdk window as a native object or Raku object.

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

=end pod

method get-window ( --> N-GObject ) {
  gtk_widget_get_window(self._f('GtkWidget'))
}

method get-window-rk ( --> Any ) {
  Gnome::N::deprecate(
    'get-window-rk', 'coercing from get-window',
    '0.47.2', '0.50.0'
  );

  self._wrap-native-type(
    'Gnome::Gdk3::Window',
    gtk_widget_get_window(self._f('GtkWidget'))
  )
}

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

#-------------------------------------------------------------------------------
#TM:1:grab-default:
=begin pod
=head2 grab-default

Causes I<widget> to become the default widget. I<widget> must be able to be a default widget; typically you would ensure this yourself by calling C<set-can-default()> with a C<True> value. The default widget is activated when the user presses Enter in a window. Default widgets must be activatable, that is, C<activate()> should affect them. Note that B<Gnome::Gtk3::Entry> widgets require the “activates-default” property set to C<True> before they activate the default widget when Enter is pressed and the B<Gnome::Gtk3::Entry> is focused.

  method grab-default ( )

=end pod

method grab-default ( ) {
  gtk_widget_grab_default(self._f('GtkWidget'));
}

sub gtk_widget_grab_default (
  N-GObject $widget
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:grab-focus:
=begin pod
=head2 grab-focus

Causes I<widget> to have the keyboard focus for the B<Gnome::Gtk3::Window> it's inside. I<widget> must be a focusable widget, such as a B<Gnome::Gtk3::Entry>; something like B<Gnome::Gtk3::Frame> won’t work.

More precisely, it must have the C<GTK-CAN-FOCUS> flag set. Use C<set-can-focus()> to modify that flag.

The widget also needs to be realized and mapped. This is indicated by the related signals. Grabbing the focus immediately after creating the widget will likely fail and cause critical warnings.

  method grab-focus ( )

=end pod

method grab-focus ( ) {
  gtk_widget_grab_focus(self._f('GtkWidget'));
}

sub gtk_widget_grab_focus (
  N-GObject $widget
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk-cairo-should-draw-window:
=begin pod
=head2 gtk-cairo-should-draw-window

This function is supposed to be called in  I<draw> implementations for widgets that support multiple windows. I<$cr> must be untransformed from invoking of the draw function. This function will return C<True> if the contents of the given I<$window> are supposed to be drawn and C<False> otherwise. Note that when the drawing was not initiated by the windowing system this function will return C<True> for all windows, so you need to draw the bottommost window first. Also, do not use “else if” statements to check which window should be drawn.

Returns: C<True> if I<window> should be drawn

  method gtk-cairo-should-draw-window (
    cairo_t $cr, N-GObject $window --> Bool
  )

=item cairo_t $cr; a cairo context
=item N-GObject $window; the window to check. I<window> may not be an input-only window.

=end pod

method gtk-cairo-should-draw-window ( cairo_t $cr, $window is copy --> Bool ) {
  $window .= _get-native-object-no-reffing unless $window ~~ N-GObject;
  gtk_cairo_should_draw_window( self._f('GtkWidget'), $cr, $window).Bool
}

sub gtk_cairo_should_draw_window (
  cairo_t $cr, N-GObject $window --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk-cairo-transform-to-window:
=begin pod
=head2 gtk-cairo-transform-to-window

Transforms the given cairo context I<cr> that from I<widget>-relative coordinates to I<window>-relative coordinates. If the I<widget>’s window is not an ancestor of I<window>, no modification will be applied.

This is the inverse to the transformation GTK applies when preparing an expose event to be emitted with the  I<draw> signal. It is intended to help porting multiwindow widgets from GTK+ 2 to the rendering architecture of GTK+ 3.

  method gtk-cairo-transform-to-window (
    cairo_t $cr, N-GObject $widget, N-GObject $window
  )

=item cairo_t $cr; the cairo context to transform
=item N-GObject $widget; the widget the context is currently centered for
=item N-GObject $window; the window to transform the context to

=end pod

method gtk-cairo-transform-to-window (
  cairo_t $cr, $widget is copy, $window is copy
) {
  $widget .= _get-native-object-no-reffing unless $widget ~~ N-GObject;
  $window .= _get-native-object-no-reffing unless $window ~~ N-GObject;
  gtk_cairo_transform_to_window( self._f('GtkWidget'), $cr, $widget, $window);
}

sub gtk_cairo_transform_to_window (
  cairo_t $cr, N-GObject $widget, N-GObject $window
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:gtk-requisition-copy:
=begin pod
=head2 gtk-requisition-copy

Copies a B<Gnome::Gtk3::Requisition>.

Returns: a copy of I<requisition>

  method gtk-requisition-copy (
    N-GtkRequisition $requisition --> N-GtkRequisition
  )

=item N-GtkRequisition $requisition; a B<Gnome::Gtk3::Requisition>

=end pod

method gtk-requisition-copy (
  N-GtkRequisition $requisition --> N-GtkRequisition
) {
  gtk_requisition_copy($requisition)
}

sub gtk_requisition_copy (
  N-GtkRequisition $requisition --> N-GtkRequisition
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:gtk-requisition-free:
=begin pod
=head2 gtk-requisition-free

Frees a B<Gnome::Gtk3::Requisition>.

  method gtk-requisition-free ( N-GtkRequisition $requisition )

=item N-GtkRequisition $requisition; a B<Gnome::Gtk3::Requisition>

=end pod

method gtk-requisition-free ( N-GtkRequisition $requisition ) {
  gtk_requisition_free($requisition);
}

sub gtk_requisition_free (
  N-GtkRequisition $requisition
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:1:gtk-requisition-new:
=begin pod
=head2 gtk-requisition-new

Allocates a new B<Gnome::Gtk3::Requisition>-struct and initializes its elements to zero.

Returns: a new empty B<Gnome::Gtk3::Requisition>. The newly allocated B<Gnome::Gtk3::Requisition> should be freed with C<requisition-free()>.

  method gtk-requisition-new ( --> N-GtkRequisition )

=end pod

method gtk-requisition-new ( --> N-GtkRequisition ) {
  gtk_requisition_new(self._f('GtkWidget'))
}

sub gtk_requisition_new (
  --> N-GtkRequisition
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:has-default:
=begin pod
=head2 has-default

Determines whether I<widget> is the current default widget within its toplevel. See C<set-can-default()>.

Returns: C<True> if I<widget> is the current default widget within its toplevel, C<False> otherwise

  method has-default ( --> Bool )

=end pod

method has-default ( --> Bool ) {
  gtk_widget_has_default(self._f('GtkWidget')).Bool
}

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

#-------------------------------------------------------------------------------
#TM:1:has-focus:
=begin pod
=head2 has-focus

Determines if the widget has the global input focus. See C<is-focus()> for the difference between having the global input focus, and only having the focus within a toplevel.

Returns: C<True> if the widget has the global input focus.

  method has-focus ( --> Bool )

=end pod

method has-focus ( --> Bool ) {
  gtk_widget_has_focus( self._f('GtkWidget')).Bool
}

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

#-------------------------------------------------------------------------------
#TM:1:has-grab:
=begin pod
=head2 has-grab

Determines whether the widget is currently grabbing events, so it is the only widget receiving input events (keyboard and mouse).

See also C<gtk-grab-add()>.

Returns: C<True> if the widget is in the grab-widgets stack

  method has-grab ( --> Bool )

=end pod

method has-grab ( --> Bool ) {
  gtk_widget_has_grab(self._f('GtkWidget')).Bool
}

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

#-------------------------------------------------------------------------------
#TM:1:has-screen:
=begin pod
=head2 has-screen

Checks whether there is a B<Gnome::Gdk3::Screen> is associated with this widget. All toplevel widgets have an associated screen, and all widgets added into a hierarchy with a toplevel window at the top.

Returns: C<True> if there is a B<Gnome::Gdk3::Screen> associated with the widget.

  method has-screen ( --> Bool )

=end pod

method has-screen ( --> Bool ) {
  gtk_widget_has_screen(self._f('GtkWidget')).Bool
}

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

#-------------------------------------------------------------------------------
#TM:1:has-visible-focus:
=begin pod
=head2 has-visible-focus

Determines if the widget should show a visible indication that it has the global input focus. This is a convenience function for use in I<draw> handlers that takes into account whether focus indication should currently be shown in the toplevel window of I<widget>. See C<gtk-window-get-focus-visible()> for more information about focus indication.

To find out if the widget has the global input focus, use C<has-focus()>.

Returns: C<True> if the widget should display a “focus rectangle”

  method has-visible-focus ( --> Bool )

=end pod

method has-visible-focus ( --> Bool ) {
  gtk_widget_has_visible_focus(self._f('GtkWidget')).Bool
}

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

#-------------------------------------------------------------------------------
#TM:1:hide:
=begin pod
=head2 hide

Reverses the effects of C<show()>, causing the widget to be hidden (invisible to the user).

  method hide ( )

=end pod

method hide ( ) {
  gtk_widget_hide(self._f('GtkWidget'));
}

sub gtk_widget_hide (
  N-GObject $widget
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:hide-on-delete:
=begin pod
=head2 hide-on-delete

Utility function; intended to be connected to the  I<delete-event> signal on a B<Gnome::Gtk3::Window>. The function calls C<hide()> on its argument, then returns C<True>. If connected to I<delete-event>, the result is that clicking the close button for a window (on the window frame, top right corner usually) will hide but not destroy the window. By default, GTK+ destroys windows when I<delete-event> is received.

Returns: C<True>

  method hide-on-delete ( --> Bool )

=end pod

method hide-on-delete ( --> Bool ) {
  gtk_widget_hide_on_delete(self._f('GtkWidget')).Bool
}

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

#-------------------------------------------------------------------------------
#TM:1:in-destruction:
=begin pod
=head2 in-destruction

Returns whether the widget is currently being destroyed. This information can sometimes be used to avoid doing unnecessary work.

Returns: C<True> if I<widget> is being destroyed

  method in-destruction ( --> Bool )

=end pod

method in-destruction ( --> Bool ) {
  gtk_widget_in_destruction(self._f('GtkWidget')).Bool
}

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

#`{{
#-------------------------------------------------------------------------------
# TM:0:init-template:
=begin pod
=head2 init-template

Creates and initializes child widgets defined in templates. This function must be called in the instance initializer for any class which assigned itself a template using C<class-set-template()>

It is important to call this function in the instance initializer of a B<Gnome::Gtk3::Widget> subclass and not in B<Gnome::Gtk3::Object>.C<constructed()> or B<Gnome::Gtk3::Object>.C<constructor()> for two reasons.

One reason is that generally derived widgets will assume that parent class composite widgets have been created in their instance initializers.

Another reason is that when calling C<g-object-new()> on a widget with composite templates, it’s important to build the composite widgets before the construct properties are set. Properties passed to C<g-object-new()> should take precedence over properties set in the private template XML.

  method init-template ( )


=end pod

method init-template ( ) {

  gtk_widget_init_template(
    self._f('GtkWidget'),
  );
}

sub gtk_widget_init_template (
  N-GObject $widget
) is native(&gtk-lib)
  { * }
}}
#`{{
#-------------------------------------------------------------------------------
#TM:0:input-shape-combine-region:
=begin pod
=head2 input-shape-combine-region

Sets an input shape for this widget’s GDK window. This allows for windows which react to mouse click in a nonrectangular region, see C<gdk-window-input-shape-combine-region()> for more information.

  method input-shape-combine-region ( cairo_region_t $region )

=item cairo_region_t $region; shape to be added, or C<undefined> to remove an existing shape

=end pod

method input-shape-combine-region ( cairo_region_t $region ) {

  gtk_widget_input_shape_combine_region(
    self._f('GtkWidget'), $region
  );
}

sub gtk_widget_input_shape_combine_region (
  N-GObject $widget, cairo_region_t $region
) is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:0:insert-action-group:
=begin pod
=head2 insert-action-group

Inserts I<$group> into I<widget>. Children of I<widget> that implement B<Gnome::Gtk3::Actionable> can then be associated with actions in I<$group> by setting their “action-name” to I<$prefix>.`action-name`.

If I<group> is C<undefined>, a previously inserted group for I<name> is removed from I<widget>.

  method insert-action-group ( Str $name, N-GObject $group )

=item Str $name; the prefix for actions in I<group>
=item N-GObject $group; a B<Gnome::Gio::ActionGroup>, or C<undefined>

=end pod

method insert-action-group ( Str $name, $group is copy ) {
  $group .= _get-native-object-no-reffing unless $group ~~ N-GObject;

  gtk_widget_insert_action_group( self._f('GtkWidget'), $name, $group);
}

sub gtk_widget_insert_action_group (
  N-GObject $widget, gchar-ptr $name, N-GObject $group
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:intersect:
=begin pod
=head2 intersect

Computes the intersection of a I<widget>’s area and I<$area>, storing the intersection in I<$intersection>, and returns C<True> if there was an intersection. I<$intersection> may be C<undefined> if you’re only interested in whether there was an intersection.

Returns: C<True> if there was an intersection

  method intersect ( N-GObject $area, N-GObject $intersection --> Bool )

=item N-GObject $area; a N-GdkRectangle
=item N-GObject $intersection; N-GdkRectangle to store intersection of I<widget> and I<area>

=end pod

method intersect (
  N-GdkRectangle $area, N-GdkRectangle $intersection --> Bool
) {
  gtk_widget_intersect( self._f('GtkWidget'), $area, $intersection).Bool
}

sub gtk_widget_intersect (
  N-GObject $widget, N-GdkRectangle $area, N-GdkRectangle $intersection --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:is-ancestor:
=begin pod
=head2 is-ancestor

Determines whether I<widget> is somewhere inside I<$ancestor>, possibly with intermediate containers.

Returns: C<True> if I<$ancestor> contains I<widget> as a child, grandchild, great grandchild, etc.

  method is-ancestor ( N-GObject $ancestor --> Bool )

=item N-GObject $ancestor; another B<Gnome::Gtk3::Widget>

=end pod

method is-ancestor ( $ancestor is copy --> Bool ) {
  $ancestor .= _get-native-object-no-reffing unless $ancestor ~~ N-GObject;
  gtk_widget_is_ancestor( self._f('GtkWidget'), $ancestor).Bool
}

sub gtk_widget_is_ancestor (
  N-GObject $widget, N-GObject $ancestor --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:is-drawable:
=begin pod
=head2 is-drawable

Determines whether I<widget> can be drawn to. A widget can be drawn to if it is mapped and visible.

Returns: C<True> if I<widget> is drawable, C<False> otherwise

  method is-drawable ( --> Bool )

=end pod

method is-drawable ( --> Bool ) {
  gtk_widget_is_drawable(self._f('GtkWidget')).Bool
}

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

#-------------------------------------------------------------------------------
#TM:1:is-focus:
=begin pod
=head2 is-focus

Determines if the widget is the focus widget within its toplevel. (This does not mean that the  I<has-focus> property is necessarily set;  I<has-focus> will only be set if the toplevel widget additionally has the global input focus.)

Returns: C<True> if the widget is the focus widget.

  method is-focus ( --> Bool )

=end pod

method is-focus ( --> Bool ) {
  gtk_widget_is_focus(self._f('GtkWidget')).Bool
}

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

#-------------------------------------------------------------------------------
#TM:1:is-sensitive:
=begin pod
=head2 is-sensitive

Returns the widget’s effective sensitivity, which means it is sensitive itself and also its parent widget is sensitive

Returns: C<True> if the widget is effectively sensitive

  method is-sensitive ( --> Bool )

=end pod

method is-sensitive ( --> Bool ) {
  gtk_widget_is_sensitive(self._f('GtkWidget')).Bool
}

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

#-------------------------------------------------------------------------------
#TM:1:is-toplevel:
=begin pod
=head2 is-toplevel

Determines whether I<widget> is a toplevel widget.

Currently only B<Gnome::Gtk3::Window> and B<Gnome::Gtk3::Invisible> (and out-of-process B<Gnome::Gtk3::Plugs>) are toplevel widgets. Toplevel widgets have no parent widget.

Returns: C<True> if I<widget> is a toplevel, C<False> otherwise

  method is-toplevel ( --> Bool )

=end pod

method is-toplevel ( --> Bool ) {
  gtk_widget_is_toplevel(self._f('GtkWidget')).Bool
}

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

#-------------------------------------------------------------------------------
#TM:1:is-visible:
=begin pod
=head2 is-visible

Determines whether the widget and all its parents are marked as visible.

This function does not check if the widget is obscured in any way.

See also C<get-visible()> and C<set-visible()>

Returns: C<True> if the widget and all its parents are visible

  method is-visible ( --> Bool )

=end pod

method is-visible ( --> Bool ) {
  gtk_widget_is_visible(self._f('GtkWidget')).Bool
}

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

#-------------------------------------------------------------------------------
#TM:1:keynav-failed:
=begin pod
=head2 keynav-failed

This function should be called whenever keyboard navigation within a single widget hits a boundary. The function emits the  I<keynav-failed> signal on the widget and its return value should be interpreted in a way similar to the return value of C<child-focus()>:

When C<True> is returned, stay in the widget, the failed keyboard navigation is OK and/or there is nowhere we can/should move the focus to.

When C<False> is returned, the caller should continue with keyboard navigation outside the widget, e.g. by calling C<child-focus()> on the widget’s toplevel.

The default I<keynav-failed> handler returns C<False> for C<GTK-DIR-TAB-FORWARD> and C<GTK-DIR-TAB-BACKWARD>. For the other values of B<Gnome::Gtk3::DirectionType> it returns C<True>.

Whenever the default handler returns C<True>, it also calls C<error-bell()> to notify the user of the failed keyboard navigation.

A use case for providing an own implementation of I<keynav-failed> (either by connecting to it or by overriding it) would be a row of B<Gnome::Gtk3::Entry> widgets where the user should be able to navigate the entire row with the cursor keys, as e.g. known from user interfaces that require entering license keys.

Returns: C<True> if stopping keyboard navigation is fine, C<False> if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).

  method keynav-failed ( GtkDirectionType $direction --> Bool )

=item GtkDirectionType $direction; direction of focus movement

=end pod

method keynav-failed ( GtkDirectionType $direction --> Bool ) {
  gtk_widget_keynav_failed( self._f('GtkWidget'), $direction).Bool
}

sub gtk_widget_keynav_failed (
  N-GObject $widget, GEnum $direction --> gboolean
) is native(&gtk-lib)
  { * }

#`{{ do we need closures?
#-------------------------------------------------------------------------------
# TM:0:list-accel-closures:
=begin pod
=head2 list-accel-closures

Lists the closures used by I<widget> for accelerator group connections with C<gtk-accel-group-connect-by-path()> or C<gtk-accel-group-connect()>. The closures can be used to monitor accelerator changes on I<widget>, by connecting to the I<GtkAccelGroup>::accel-changed signal of the B<Gnome::Gtk3::AccelGroup> of a closure which can be found out with C<gtk-accel-group-from-accel-closure()>.

Returns: a newly allocated B<Gnome::Gtk3::List> of closures

  method list-accel-closures ( --> N-GList )

=end pod

method list-accel-closures ( --> N-GList ) {
  gtk_widget_list_accel_closures(self._f('GtkWidget'))
}

sub gtk_widget_list_accel_closures (
  N-GObject $widget --> N-GList
) is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:list-action-prefixes:
=begin pod
=head2 list-action-prefixes

Retrieves a C<undefined>-terminated array of strings containing the prefixes of B<Gnome::Gtk3::ActionGroup>'s available to I<widget>.

Returns: an array of strings.

  method list-action-prefixes ( --> List )

=end pod

method list-action-prefixes ( --> List ) {
  my CArray[Str] $ca = gtk_widget_list_action_prefixes(self._f('GtkWidget'));
  my Int $i = 0;
  my List $l = ();
  while $ca[$i] {
    $l.push: $ca[$i];
  }

  $l
}

sub gtk_widget_list_action_prefixes (
  N-GObject $widget --> gchar-pptr
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:list-mnemonic-labels:
#TM:1:list-mnemonic-labels-rk:
=begin pod
=head2 list-mnemonic-labels, list-mnemonic-labels-rk

Returns a newly allocated list of the widgets, normally labels, for which this widget is the target of a mnemonic (see for example, C<Gnome::Gtk3::Label.set-mnemonic-widget()>). The widgets in the list are not individually referenced.
=comment If you want to iterate through the list and perform actions involving callbacks that might destroy the widgets, you must call `g-list-foreach (result, (GFunc)g-object-ref, NULL)` first, and then unref all the widgets afterwards.

Returns: the list of mnemonic labels; free this list with C<clear-object()> when you are done with it.

  method list-mnemonic-labels ( --> N-GList )
  method list-mnemonic-labels-rk ( --> Gnome::Glib::List )

=end pod

method list-mnemonic-labels-rk ( --> Gnome::Glib::List ) {
  Gnome::Glib::List.new(
    :native-object(gtk_widget_list_mnemonic_labels(self._f('GtkWidget')))
  )
}

method list-mnemonic-labels ( --> N-GList ) {
  gtk_widget_list_mnemonic_labels(self._f('GtkWidget'))
}

sub gtk_widget_list_mnemonic_labels (
  N-GObject $widget