### ----------------------------------------------------
### -- Gnome::Gtk3
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Gtk3/Container.rakumod
### ----------------------------------------------------
### -- Chunk 2 of 2
backtrace.concise.note } }
        $func-object."$func-name"( $no, |%user-options)
      },
      OpaquePointer
    );
  }

  else {
    note "Method $func-name not found in object $func-object.perl()"
      if $Gnome::N::x-debug;
  }
}

sub _gtk_container_foreach (
  N-GObject $container,
  Callable $callback ( N-GObject $no, OpaquePointer $d),
  OpaquePointer $user_data
) is native(&gtk-lib)
  is symbol('gtk_container_foreach')
  { * }

#-------------------------------------------------------------------------------
#TM:1:get-border-width:
=begin pod
=head2 get-border-width

Retrieves the border width of the container. See C<set-border-width()>.

Returns: the current border width

  method get-border-width ( --> UInt )

=end pod

method get-border-width ( --> UInt ) {
  gtk_container_get_border_width(self._f('GtkContainer'))
}

sub gtk_container_get_border_width (
  N-GObject $container --> guint
) is native(&gtk-lib)
  { * }

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

Returns the container’s non-internal children. See C<forall()> for details on what constitutes an "internal" child.

Returns: a newly-allocated list of the container’s non-internal children.

  method get-children ( --> N-GList )

=end pod

method get-children ( --> N-GList ) {
  gtk_container_get_children(self._f('GtkContainer'))
}

method get-children-rk ( --> Gnome::Glib::List ) {
  Gnome::N::deprecate(
    'get-children-rk', 'get-children', '0.48.6', '0.50.0'
  );

  Gnome::Glib::List.new(
    :native-object(gtk_container_get_children(self._f('GtkContainer')))
  )
}

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

#-------------------------------------------------------------------------------
#TM:0:get-focus-child:
=begin pod
=head2 get-focus-child

Returns the current focus child widget inside this container. This is not the currently focused widget. That can be obtained by calling C<Gnome::Gtk3::Window.get-focus()>.

Returns: The child widget which will receive the focus inside this container when the this container is focused, or C<undefined> if none is set.

  method get-focus-child ( --> N-GObject )

=end pod

method get-focus-child ( --> N-GObject ) {
  gtk_container_get_focus_child(self._f('GtkContainer'))
}

method get-focus-child-rk ( --> Any ) {
  Gnome::N::deprecate(
    'get-focus-child-rk', 'coercing from get-focus-child',
    '0.47.4', '0.50.0'
  );

  self._wrap-native-type-from-no(
    gtk_container_get_focus_child(self._f('GtkContainer'))
  )
}

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

#-------------------------------------------------------------------------------
#TM:1:get-focus-hadjustment:
=begin pod
=head2 get-focus-hadjustment

Retrieves the horizontal focus adjustment for the container. See C<set-focus-hadjustment()>.

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

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

=end pod

method get-focus-hadjustment ( --> N-GObject ) {
  gtk_container_get_focus_hadjustment(self._f('GtkContainer'))
}

method get-focus-hadjustment-rk ( --> Gnome::Gtk3::Adjustment ) {
  Gnome::N::deprecate(
    'get-focus-hadjustment-rk', 'get-focus-hadjustment',
    '0.47.4', '0.50.0'
  );

  Gnome::Gtk3::Adjustment.new(
    :native-object(gtk_container_get_focus_hadjustment(self._f('GtkContainer')))
  )
}

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

#-------------------------------------------------------------------------------
#TM:1:get-focus-vadjustment:
=begin pod
=head2 get-focus-vadjustment

Retrieves the vertical focus adjustment for the container. See C<set-focus-vadjustment()>.

Returns: the vertical focus adjustment, or C<undefined> if none has been set. It is a native object for B<Gnome::Gtk3::Adjustment>.

  method get-focus-vadjustment ( --> N-GObject )

=end pod

method get-focus-vadjustment ( --> N-GObject ) {
  gtk_container_get_focus_vadjustment(self._f('GtkContainer'))
}

method get-focus-vadjustment-rk ( --> Gnome::Gtk3::Adjustment ) {
  Gnome::N::deprecate(
    'get-focus-vadjustment-rk', 'get-focus-vadjustment',
    '0.47.4', '0.50.0'
  );

  Gnome::Gtk3::Adjustment.new(
    :native-object(gtk_container_get_focus_vadjustment(self._f('GtkContainer')))
  )
}

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

#-------------------------------------------------------------------------------
#TM:1:get-path-for-child:
=begin pod
=head2 get-path-for-child

Returns a newly created widget path representing all the widget hierarchy from the toplevel down to and including I<child>.

Returns: A native object for B<Gnome::Gtk3::WidgetPath>

  method get-path-for-child ( N-GObject() $child --> N-GObject )

=item $child; a child of this container
=end pod

method get-path-for-child ( N-GObject() $child --> N-GObject ) {
  gtk_container_get_path_for_child( self._f('GtkContainer'), $child)
}

method get-path-for-child-rk (
  N-GObject() $child --> Gnome::Gtk3::WidgetPath
) {
  Gnome::N::deprecate(
    'get-path-for-child-rk', 'coercing from get-path-for-child',
    '0.47.4', '0.50.0'
  );

  Gnome::Gtk3::WidgetPath.new(
    :native-object(
      gtk_container_get_path_for_child( self._f('GtkContainer'), $child)
    )
  )
}

sub gtk_container_get_path_for_child (
  N-GObject $container, N-GObject $child --> N-GObject
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:propagate-draw:
=begin pod
=head2 propagate-draw

When a container receives a call to the draw function, it must send synthetic  I<draw> calls to all children that don’t have their own B<Gnome::Gtk3::Windows>. This function provides a convenient way of doing this. A container, when it receives a call to its  I<draw> function, calls C<propagate-draw()> once for each child, passing in the I<cr> the container received.

C<gtk-container-propagate-draw()> takes care of translating the origin of I<cr>, and deciding whether the draw needs to be sent to the child. It is a convenient and optimized way of getting the same effect as calling C<gtk-widget-draw()> on the child directly.

In most cases, a container can simply either inherit the  I<draw> implementation from B<Gnome::Gtk3::Container>, or do some drawing and then chain to the I<draw> implementation from B<Gnome::Gtk3::Container>.

  method propagate-draw ( N-GObject() $child, cairo_t $cr )

=item $child; a child of this container
=item $cr; Cairo context as passed to the container. If you want to use I<cr> in container’s draw function, consider using C<cairo-save()> and C<cairo-restore()> before calling this function.
=end pod

method propagate-draw ( N-GObject() $child, cairo_t $cr ) {
  gtk_container_propagate_draw( self._f('GtkContainer'), $child, $cr);
}

sub gtk_container_propagate_draw (
  N-GObject $container, N-GObject $child, cairo_t $cr
) is native(&gtk-lib)
  { * }

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

Removes I<widget> from this container. I<widget> must be inside this container. Note that this container will own a reference to I<widget>, and that this may be the last reference held; so removing a widget from its container can destroy that widget. If you want to use I<widget> again, you need to add a reference to it before removing it from a container, using C<g-object-ref()>. If you don’t want to use I<widget> again it’s usually more efficient to simply destroy it directly using C<gtk-widget-destroy()> since this will remove it from the container and help break any circular reference count cycles.

  method remove ( N-GObject() $widget )

=item $widget; a current child of this container
=end pod

method remove ( N-GObject() $widget ) {
  gtk_container_remove( self._f('GtkContainer'), $widget);
}

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

#-------------------------------------------------------------------------------
#TM:1:set-border-width:
=begin pod
=head2 set-border-width

Sets the border width of the container.

The border width of a container is the amount of space to leave around the outside of the container. The only exception to this is B<Gnome::Gtk3::Window>; because toplevel windows can’t leave space outside, they leave the space inside. The border is added on all sides of the container. To add space to only one side, use a specific  I<margin> property on the child widget, for example  I<margin-top>.

  method set-border-width ( UInt $border_width )

=item $border_width; amount of blank space to leave outside the container. Valid values are in the range 0-65535 pixels.
=end pod

method set-border-width ( UInt $border_width ) {
  gtk_container_set_border_width( self._f('GtkContainer'), $border_width);
}

sub gtk_container_set_border_width (
  N-GObject $container, guint $border_width
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-focus-child:
=begin pod
=head2 set-focus-child

Sets, or unsets if I<child> is C<undefined>, the focused child of this container.

This function emits the GtkContainer::set-focus-child signal of this container. Implementations of B<Gnome::Gtk3::Container> can override the default behaviour by overriding the class closure of this signal.

This is function is mostly meant to be used by widgets. Applications can use C<gtk-widget-grab-focus()> to manually set the focus to a specific widget.

  method set-focus-child ( N-GObject() $child )

=item $child; a B<Gnome::Gtk3::Widget>, or C<undefined>
=end pod

method set-focus-child ( N-GObject() $child ) {
  gtk_container_set_focus_child( self._f('GtkContainer'), $child);
}

sub gtk_container_set_focus_child (
  N-GObject $container, N-GObject $child
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-focus-hadjustment:
=begin pod
=head2 set-focus-hadjustment

Hooks up an adjustment to focus handling in a container, so when a child of the container is focused, the adjustment is scrolled to show that widget. This function sets the horizontal alignment. See C<gtk-scrolled-window-get-hadjustment()> for a typical way of obtaining the adjustment and C<set-focus-vadjustment()> for setting the vertical adjustment.

The adjustments have to be in pixel units and in the same coordinate system as the allocation for immediate children of the container.

  method set-focus-hadjustment ( N-GObject() $adjustment )

=item $adjustment; an adjustment which should be adjusted when the focus is moved among the descendents of this container
=end pod

method set-focus-hadjustment ( N-GObject() $adjustment ) {
  gtk_container_set_focus_hadjustment( self._f('GtkContainer'), $adjustment);
}

sub gtk_container_set_focus_hadjustment (
  N-GObject $container, N-GObject $adjustment
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-focus-vadjustment:
=begin pod
=head2 set-focus-vadjustment

Hooks up an adjustment to focus handling in a container, so when a child of the container is focused, the adjustment is scrolled to show that widget. This function sets the vertical alignment. See C<gtk-scrolled-window-get-vadjustment()> for a typical way of obtaining the adjustment and C<set-focus-hadjustment()> for setting the horizontal adjustment.

The adjustments have to be in pixel units and in the same coordinate system as the allocation for immediate children of the container.

  method set-focus-vadjustment ( N-GObject() $adjustment )

=item $adjustment; an adjustment which should be adjusted when the focus is moved among the descendents of this container
=end pod

method set-focus-vadjustment ( N-GObject() $adjustment ) {
  gtk_container_set_focus_vadjustment( self._f('GtkContainer'), $adjustment);
}

sub gtk_container_set_focus_vadjustment (
  N-GObject $container, N-GObject $adjustment
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
=begin pod
=head1 Signals


=comment -----------------------------------------------------------------------
=comment #TS:0:add:
=head2 add

  method handler (
    N-GObject #`{ native widget } $n-widget,
    Gnome::Gtk3::Container :_widget($container),
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options
  )

=item $n-widget; the added widget
=item $container; The instance which registered the signal
=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=comment -----------------------------------------------------------------------
=comment #TS:0:check-resize:
=head2 check-resize

  method handler (
    Gnome::Gtk3::Container :_widget($container),
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options
  )

=item $container; The instance which registered the signal
=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=comment -----------------------------------------------------------------------
=comment #TS:0:remove:
=head2 remove

  method handler (
    N-GObject #`{ native widget } $n-widget,
    Gnome::Gtk3::Container :_widget($container),
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options
  )

=item $n-widget; The removed widget
=item $container; The instance which registered the signal
=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=comment -----------------------------------------------------------------------
=comment #TS:0:set-focus-child:
=head2 set-focus-child

  method handler (
    N-GObject #`{ native widget } $widget,
    Gnome::Gtk3::Container :_widget($container),
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options
  )

=item $widget; The focussed child
=item $container; The instance which registered the signal
=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=end pod



#`{{
#-------------------------------------------------------------------------------
=begin pod
=head1 Signals

There are two ways to connect to a signal. The first option you have is to use C<register-signal()> from B<Gnome::GObject::Object>. The second option is to use C<connect-object()> directly from B<Gnome::GObject::Signal>.

=head2 First method

The positional arguments of the signal handler are all obligatory as well as their types. The named attributes C<:$widget> and user data are optional.

  # handler method
  method mouse-event ( GdkEvent $event, :$widget ) { ... }

  # connect a signal on window object
  my Gnome::Gtk3::Window $w .= new( ... );
  $w.register-signal( self, 'mouse-event', 'button-press-event');

=head2 Second method

  my Gnome::Gtk3::Window $w .= new( ... );
  my Callable $handler = sub (
    N-GObject $native, GdkEvent $event, OpaquePointer $data
  ) {
    ...
  }

  $w.connect-object( 'button-press-event', $handler);

Also here, the types of positional arguments in the signal handler are important. This is because both methods C<register-signal()> and C<connect-object()> are using the signatures of the handler routines to setup the native call interface.

=head2 Supported signals


=comment -----------------------------------------------------------------------
=comment #TS:1:add:
=head3 add

  method handler (
    N-GObject $n-gobject,
    Int :$_handle_id,
    Gnome::GObject::Object :_widget($container),
    *%user-options
  );

=item $container;
=item $n-gobject; is added widget

=begin comment
=comment -----------------------------------------------------------------------
=comment # TS:0:check-resize:
=head3 check-resize

  method handler (
    Int :$_handle_id,
    Gnome::GObject::Object :_widget($container),
    *%user-options
  );

=item $container;
=end comment

=comment -----------------------------------------------------------------------
=comment #TS:1:remove:
=head3 remove

  method handler (
    N-GObject #`{ is widget } $n-gobject #`{ is widget },
    Int :$_handle_id,
    Gnome::GObject::Object :_widget($container),
    *%user-options
  );

=item $container;
=item $n-gobject #`{ is widget };

=comment -----------------------------------------------------------------------
=comment #TS:0:set-focus-child:
=head3 set-focus-child

  method handler (
    N-GObject #`{ is widget } $n-gobject #`{ is widget },
    Int :$_handle_id,
    Gnome::GObject::Object :_widget($container),
    *%user-options
  );

=item $container;
=item $n-gobject #`{ is widget };

=end pod
}}

#-------------------------------------------------------------------------------
=begin pod
=head1 Properties

=comment -----------------------------------------------------------------------
=comment #TP:0:border-width:
=head2 border-width

The width of the empty border outside the containers children

=item B<Gnome::GObject::Value> type of this property is G_TYPE_UINT
=item Parameter is readable and writable.
=item Minimum value is 0.
=item Maximum value is 65535.
=item Default value is 0.

=end pod


