### ----------------------------------------------------
### -- Gnome::Gtk3
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Gtk3/Notebook.rakumod
### ----------------------------------------------------
### -- Chunk 3 of 3
 N-GObject $notebook, int32 $show_tabs  )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_get_show_tabs:
=begin pod
=head2 [gtk_notebook_] get_show_tabs

Returns whether the tabs of the notebook are shown.
See C<gtk_notebook_set_show_tabs()>.

Returns: C<1> if the tabs are shown

  method gtk_notebook_get_show_tabs ( --> Int )


=end pod

sub gtk_notebook_get_show_tabs ( N-GObject $notebook --> int32 )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_set_tab_pos:
=begin pod
=head2 [gtk_notebook_] set_tab_pos

Sets the edge at which the tabs for switching pages in the
notebook are drawn.

  method gtk_notebook_set_tab_pos ( GtkPositionType $pos )

=item GtkPositionType $pos; the edge to draw the tabs at

=end pod

sub gtk_notebook_set_tab_pos ( N-GObject $notebook, int32 $pos  )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_get_tab_pos:
=begin pod
=head2 [gtk_notebook_] get_tab_pos

Gets the edge at which the tabs for switching pages in the
notebook are drawn.

Returns: the edge at which the tabs are drawn

  method gtk_notebook_get_tab_pos ( --> GtkPositionType )


=end pod

sub gtk_notebook_get_tab_pos ( N-GObject $notebook --> int32 )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_set_scrollable:
=begin pod
=head2 [gtk_notebook_] set_scrollable

Sets whether the tab label area will have arrows for
scrolling if there are too many tabs to fit in the area.

  method gtk_notebook_set_scrollable ( Int $scrollable )

=item Int $scrollable; C<1> if scroll arrows should be added

=end pod

sub gtk_notebook_set_scrollable ( N-GObject $notebook, int32 $scrollable  )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_get_scrollable:
=begin pod
=head2 [gtk_notebook_] get_scrollable

Returns whether the tab label area has arrows for scrolling.
See C<gtk_notebook_set_scrollable()>.

Returns: C<1> if arrows for scrolling are present

  method gtk_notebook_get_scrollable ( --> Int )


=end pod

sub gtk_notebook_get_scrollable ( N-GObject $notebook --> int32 )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_popup_enable:
=begin pod
=head2 [gtk_notebook_] popup_enable

Enables the popup menu: if the user clicks with the right
mouse button on the tab labels, a menu with all the pages
will be popped up.

  method gtk_notebook_popup_enable ( )


=end pod

sub gtk_notebook_popup_enable ( N-GObject $notebook  )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_popup_disable:
=begin pod
=head2 [gtk_notebook_] popup_disable

Disables the popup menu.

  method gtk_notebook_popup_disable ( )


=end pod

sub gtk_notebook_popup_disable ( N-GObject $notebook  )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_get_tab_label:
=begin pod
=head2 [gtk_notebook_] get_tab_label

Returns the tab label widget for the page I<child>.
C<Any> is returned if I<child> is not in I<notebook> or
if no tab label has specifically been set for I<child>.

Returns: (transfer none) (nullable): the tab label

  method gtk_notebook_get_tab_label ( N-GObject $child --> N-GObject )

=item N-GObject $child; the page

=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_set_tab_label:
=begin pod
=head2 [gtk_notebook_] set_tab_label

Changes the tab label for I<child>.
If C<Any> is specified for I<tab_label>, then the page will
have the label “page N”.

  method gtk_notebook_set_tab_label ( N-GObject $child, N-GObject $tab_label )

=item N-GObject $child; the page
=item N-GObject $tab_label; (allow-none): the tab label widget to use, or C<Any> for default tab label

=end pod

sub gtk_notebook_set_tab_label ( N-GObject $notebook, N-GObject $child, N-GObject $tab_label  )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_set_tab_label_text:
=begin pod
=head2 [gtk_notebook_] set_tab_label_text

Creates a new label and sets it as the tab label for the page
containing I<child>.

  method gtk_notebook_set_tab_label_text ( N-GObject $child, Str $tab_text )

=item N-GObject $child; the page
=item Str $tab_text; the label text

=end pod

sub gtk_notebook_set_tab_label_text ( N-GObject $notebook, N-GObject $child, Str $tab_text  )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_get_tab_label_text:
=begin pod
=head2 [gtk_notebook_] get_tab_label_text

Retrieves the text of the tab label for the page containing
I<child>.

Returns: (nullable): the text of the tab label, or C<Any> if the tab label
widget is not a B<Gnome::Gtk3::Label>. The string is owned by the widget and must not be
freed.

  method gtk_notebook_get_tab_label_text ( N-GObject $child --> Str )

=item N-GObject $child; a widget contained in a page of I<notebook>

=end pod

sub gtk_notebook_get_tab_label_text ( N-GObject $notebook, N-GObject $child --> Str )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_get_menu_label:
=begin pod
=head2 [gtk_notebook_] get_menu_label

Retrieves the menu label widget of the page containing I<child>.

Returns: (nullable) (transfer none): the menu label, or C<Any> if the
notebook page does not have a menu label other than the default (the tab
label).

  method gtk_notebook_get_menu_label ( N-GObject $child --> N-GObject )

=item N-GObject $child; a widget contained in a page of I<notebook>

=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_set_menu_label:
=begin pod
=head2 [gtk_notebook_] set_menu_label

Changes the menu label for the page containing I<child>.

  method gtk_notebook_set_menu_label ( N-GObject $child, N-GObject $menu_label )

=item N-GObject $child; the child widget
=item N-GObject $menu_label; (allow-none): the menu label, or C<Any> for default

=end pod

sub gtk_notebook_set_menu_label ( N-GObject $notebook, N-GObject $child, N-GObject $menu_label  )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_set_menu_label_text:
=begin pod
=head2 [gtk_notebook_] set_menu_label_text

Creates a new label and sets it as the menu label of I<child>.

  method gtk_notebook_set_menu_label_text ( N-GObject $child, Str $menu_text )

=item N-GObject $child; the child widget
=item Str $menu_text; the label text

=end pod

sub gtk_notebook_set_menu_label_text ( N-GObject $notebook, N-GObject $child, Str $menu_text  )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_get_menu_label_text:
=begin pod
=head2 [gtk_notebook_] get_menu_label_text

Retrieves the text of the menu label for the page containing
I<child>.

Returns: (nullable): the text of the tab label, or C<Any> if the widget does
not have a menu label other than the default menu label, or the menu label
widget is not a B<Gnome::Gtk3::Label>. The string is owned by the widget and must not be
freed.

  method gtk_notebook_get_menu_label_text ( N-GObject $child --> Str )

=item N-GObject $child; the child widget of a page of the notebook.

=end pod

sub gtk_notebook_get_menu_label_text ( N-GObject $notebook, N-GObject $child --> Str )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_reorder_child:
=begin pod
=head2 [gtk_notebook_] reorder_child

Reorders the page containing I<child>, so that it appears in position
I<position>. If I<position> is greater than or equal to the number of
children in the list or negative, I<child> will be moved to the end
of the list.

  method gtk_notebook_reorder_child ( N-GObject $child, Int $position )

=item N-GObject $child; the child to move
=item Int $position; the new position, or -1 to move to the end

=end pod

sub gtk_notebook_reorder_child ( N-GObject $notebook, N-GObject $child, int32 $position  )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_get_tab_reorderable:
=begin pod
=head2 [gtk_notebook_] get_tab_reorderable

Gets whether the tab can be reordered via drag and drop or not.

Returns: C<1> if the tab is reorderable.

Since: 2.10

  method gtk_notebook_get_tab_reorderable ( N-GObject $child --> Int )

=item N-GObject $child; a child B<Gnome::Gtk3::Widget>

=end pod

sub gtk_notebook_get_tab_reorderable ( N-GObject $notebook, N-GObject $child --> int32 )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_set_tab_reorderable:
=begin pod
=head2 [gtk_notebook_] set_tab_reorderable

Sets whether the notebook tab can be reordered
via drag and drop or not.

Since: 2.10

  method gtk_notebook_set_tab_reorderable ( N-GObject $child, Int $reorderable )

=item N-GObject $child; a child B<Gnome::Gtk3::Widget>
=item Int $reorderable; whether the tab is reorderable or not

=end pod

sub gtk_notebook_set_tab_reorderable ( N-GObject $notebook, N-GObject $child, int32 $reorderable  )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_get_tab_detachable:
=begin pod
=head2 [gtk_notebook_] get_tab_detachable

Returns whether the tab contents can be detached from I<notebook>.

Returns: C<1> if the tab is detachable.

Since: 2.10

  method gtk_notebook_get_tab_detachable ( N-GObject $child --> Int )

=item N-GObject $child; a child B<Gnome::Gtk3::Widget>

=end pod

sub gtk_notebook_get_tab_detachable ( N-GObject $notebook, N-GObject $child --> int32 )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_set_tab_detachable:
=begin pod
=head2 [gtk_notebook_] set_tab_detachable

Sets whether the tab can be detached from I<notebook> to another
notebook or widget.

Note that 2 notebooks must share a common group identificator
(see C<gtk_notebook_set_group_name()>) to allow automatic tabs
interchange between them.

If you want a widget to interact with a notebook through DnD
(i.e.: accept dragged tabs from it) it must be set as a drop
destination and accept the target “GTK_NOTEBOOK_TAB”. The notebook
will fill the selection with a B<Gnome::Gtk3::Widget>** pointing to the child
widget that corresponds to the dropped tab.

Note that you should use C<gtk_notebook_detach_tab()> instead
of C<gtk_container_remove()> if you want to remove the tab from
the source notebook as part of accepting a drop. Otherwise,
the source notebook will think that the dragged tab was
removed from underneath the ongoing drag operation, and
will initiate a drag cancel animation.

|[<!-- language="C" -->
static void
on_drag_data_received (B<Gnome::Gtk3::Widget>        *widget,
B<Gnome::Gdk3::DragContext>   *context,
gint              x,
gint              y,
B<Gnome::Gtk3::SelectionData> *data,
guint             info,
guint             time,
gpointer          user_data)
{
B<Gnome::Gtk3::Widget> *notebook;
B<Gnome::Gtk3::Widget> **child;

notebook = gtk_drag_get_source_widget (context);
child = (void*) gtk_selection_data_get_data (data);

// process_widget (*child);

gtk_notebook_detach_tab (GTK_NOTEBOOK (notebook), *child);
}
]|

If you want a notebook to accept drags from other widgets,
you will have to set your own DnD code to do it.

Since: 2.10

  method gtk_notebook_set_tab_detachable ( N-GObject $child, Int $detachable )

=item N-GObject $child; a child B<Gnome::Gtk3::Widget>
=item Int $detachable; whether the tab is detachable or not

=end pod

sub gtk_notebook_set_tab_detachable ( N-GObject $notebook, N-GObject $child, int32 $detachable  )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_detach_tab:
=begin pod
=head2 [gtk_notebook_] detach_tab

Removes the child from the notebook.

This function is very similar to C<gtk_container_remove()>,
but additionally informs the notebook that the removal
is happening as part of a tab DND operation, which should
not be cancelled.

Since: 3.16

  method gtk_notebook_detach_tab ( N-GObject $child )

=item N-GObject $child; a child

=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_get_action_widget:
=begin pod
=head2 [gtk_notebook_] get_action_widget

Gets one of the action widgets. See C<gtk_notebook_set_action_widget()>.

Returns: (nullable) (transfer none): The action widget with the given
I<pack_type> or C<Any> when this action widget has not been set

Since: 2.20

  method gtk_notebook_get_action_widget ( GtkPackType $pack_type --> N-GObject )

=item GtkPackType $pack_type; pack type of the action widget to receive

=end pod

sub gtk_notebook_get_action_widget ( N-GObject $notebook, int32 $pack_type --> N-GObject )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_notebook_set_action_widget:
=begin pod
=head2 [gtk_notebook_] set_action_widget

Sets I<widget> as one of the action widgets. Depending on the pack type
the widget will be placed before or after the tabs. You can use
a B<Gnome::Gtk3::Box> if you need to pack more than one widget on the same side.

Note that action widgets are “internal” children of the notebook and thus
not included in the list returned from C<gtk_container_foreach()>.

Since: 2.20

  method gtk_notebook_set_action_widget ( N-GObject $widget, GtkPackType $pack_type )

=item N-GObject $widget; a B<Gnome::Gtk3::Widget>
=item GtkPackType $pack_type; pack type of the action widget

=end pod

sub gtk_notebook_set_action_widget ( N-GObject $notebook, N-GObject $widget, int32 $pack_type  )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
=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<g_signal_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 ( N-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, N-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<g_signal_connect_object()> are using the signatures of the handler routines to setup the native call interface.

=head2 Supported signals


=comment #TS:0:switch-page:
=head3 switch-page

Emitted when the user or a function changes the current page.

  method handler (
    N-GObject #`{ is widget } $page,
    UInt $page_num,
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($notebook),
    *%user-options
    --> Int
  );

=item $notebook; the object which received the signal.
=item $page; the new current page
=item $page_num; the index of the page


=comment #TS:0:page-reordered:
=head3 page-reordered

the I<page-reordered> signal is emitted in the notebook right after a page has been reordered.

Since: 2.10

  method handler (
    N-GObject #`{ is widget } $child,
    UInt $page_num,
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($notebook),
    *%user-options
    --> Int
  );

=item $notebook; the B<Gnome::Gtk3::Notebook>
=item $child; the child B<Gnome::Gtk3::Widget> affected
=item $page_num; the new page number for I<child>


=comment #TS:0:page-removed:
=head3 page-removed

the I<page-removed> signal is emitted in the notebook right after a page is removed from the notebook.

Since: 2.10

  method handler (
    N-GObject #`{ is widget } $child,
    UInt $page_num,
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($notebook),
    *%user-options
    --> Int
  );

=item $notebook; the B<Gnome::Gtk3::Notebook>
=item $child; the child B<Gnome::Gtk3::Widget> affected
=item $page_num; the I<child> page number


=comment #TS:0:page-added:
=head3 page-added

the I<page-added> signal is emitted in the notebook right after a page is added to the notebook.

Since: 2.10

  method handler (
    N-GObject #`{ is widget } $child,
    UInt $page_num,
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($notebook),
    *%user-options
    --> Int
  );

=item $notebook; the B<Gnome::Gtk3::Notebook>
=item $child; the child B<Gnome::Gtk3::Widget> affected
=item $page_num; the new page number for I<child>


=comment #TS:0:create-window:
=head3 create-window

The I<create-window> signal is emitted when a detachable tab is dropped on the root window.

A handler for this signal can create a window containing a notebook where the tab will be attached. It is also responsible for moving/resizing the window and adding the necessary properties to the notebook (e.g. the I<group-name> ).

Returns: a B<Gnome::Gtk3::Notebook> that I<page> should be added to, or C<Any>.

Since: 2.12

  method handler (
    N-GObject #`{ is widget } $page,
    Int $x,
    Int $y,
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($notebook),
    *%user-options
  );

=item $notebook; the B<Gnome::Gtk3::Notebook> emitting the signal
=item $page; the tab of I<notebook> that is being detached
=item $x; the X coordinate where the drop happens
=item $y; the Y coordinate where the drop happens


=comment #TS:0:reorder-tab:
=head3 reorder-tab

  method handler (
    Int $arg1, #`{ GtkDirectionType }
    Int $arg2, #`{ Bool }
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($notebook),
    *%user-options
    --> Int
  );

=item $notebook; the B<Gnome::Gtk3::Notebook> emitting the signal
=item $arg1; ?
=item $arg2; ?


=comment #TS:0:page-reordered:
=head3 page-reordered

  method handler (
    N-GObject $child, #`{ is widget }
    uint $page-num,
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($notebook),
    *%user-options
    --> Int
  );

=item $notebook; the B<Gnome::Gtk3::Notebook> emitting the signal
=item $child; the child Gtk Widget affected
=item $page-num; the new page number for child


=comment #TS:0:page-removed:
=head3 page-removed

  method handler (
    N-GObject $child, #`{ is widget }
    uint $page-num,
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($notebook),
    *%user-options
    --> Int
  );

=item $notebook; the B<Gnome::Gtk3::Notebook> emitting the signal
=item $child; the child Gtk Widget affected
=item $page-num; the new page number for child


=comment #TS:0:page-added:
=head3 page-added

  method handler (
    N-GObject $child, #`{ is widget }
    uint $page-num,
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($notebook),
    *%user-options
    --> Int
  );

=item $notebook; the B<Gnome::Gtk3::Notebook> emitting the signal
=item $child; the child Gtk Widget affected
=item $page-num; the new page number for child


=comment #TS:0:create-window:
=head3 create-window

  method handler (
    N-GObject #`{ is widget } $n-gobject #`{ is widget },
    Int $int,
    Int $int,
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($notebook),
    *%user-options
    --> Unknown type GTK_TYPE_NOTEBOOK
  );

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

=end pod


