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

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

=head1 Gnome::Gtk3::TreeView

A widget for displaying both trees and lists

![](images/list-and-tree.png)

=head1 Description

Widget that displays any object that implements the B<Gnome::Gtk3::TreeModel> interface.

Please refer to the [tree widget conceptual overview](https://developer.gnome.org/gtk3/3.24/TreeWidget.html) for an overview of all the objects and data types related to the tree widget and how they work together.

=head2 Coordinate systems

Several different coordinate systems are exposed in the B<Gnome::Gtk3::TreeView> API.

![](images/tree-view-coordinates.png)

Coordinate systems in B<Gnome::Gtk3::TreeView> API:

=item Widget coordinates: Coordinates relative to the widget (usually `widget->window`).

=item Bin window coordinates: Coordinates relative to the window that B<Gnome::Gtk3::TreeView> renders to.

=item Tree coordinates: Coordinates relative to the entire scrollable area of B<Gnome::Gtk3::TreeView>. These coordinates start at (0, 0) for row 0 of the tree.

Several functions are available for converting between the different coordinate systems.  The most common translations are between widget and bin window coordinates and between bin window and tree coordinates. For the former you can use C<gtk_tree_view_convert_widget_to_bin_window_coords()> (and vice versa), for the latter C<gtk_tree_view_convert_bin_window_to_tree_coords()> (and vice versa).

=head2 Gnome::Gtk3::TreeView as Gnome::Gtk3::Buildable

The B<Gnome::Gtk3::TreeView> implementation of the B<Gnome::Gtk3::Buildable> interface accepts B<Gnome::Gtk3::TreeViewColumn> objects as <child> elements and exposes the internal B<Gnome::Gtk3::TreeSelection> in UI definitions.

An example of a UI definition fragment with B<Gnome::Gtk3::TreeView>:

  <object class="GtkTreeView" id="treeview">
    <property name="model">liststore1</property>
    <child>
      <object class="GtkTreeViewColumn" id="test-column">
        <property name="title">Test</property>
        <child>
          <object class="GtkCellRendererText" id="test-renderer"/>
          <attributes>
            <attribute name="text">1</attribute>
          </attributes>
        </child>
      </object>
    </child>
    <child internal-child="selection">
      <object class="GtkTreeSelection" id="selection">
        <signal name="changed" handler="on_treeview_selection_changed"/>
      </object>
    </child>
  </object>


=head2 Css Nodes

  treeview.view
  ├── header
  │   ├── <column header>
  ┊   ┊
  │   ╰── <column header>
  │
  ╰── [rubberband]


B<Gnome::Gtk3::TreeView> has a main CSS node with name treeview and style class .view. It has a subnode with name header, which is the parent for all the column header widgets' CSS nodes. For rubberband selection, a subnode with name rubberband is used.

=head2 Implemented Interfaces

Gnome::Gtk3::TreeView implements
=comment item Gnome::Gtk3::Scrollable.

=head2 See Also

B<Gnome::Gtk3::TreeViewColumn>, B<Gnome::Gtk3::TreeSelection>, B<Gnome::Gtk3::TreeModel>,

=head1 Synopsis
=head2 Declaration

  unit class Gnome::Gtk3::TreeView;
  also is Gnome::Gtk3::Container;
  also does Gnome::Gtk3::Scrollable;


=head2 Uml Diagram

![](plantuml/TreeView.svg)


=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::TreeView:api<1>;

  unit class MyGuiClass;
  also is Gnome::Gtk3::TreeView;

  submethod new ( |c ) {
    # let the Gnome::Gtk3::TreeView class process the options
    self.bless( :GtkTreeView, |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::Glib::List:api<1>;
use Gnome::Gdk3::Types:api<1>;
use Gnome::Gtk3::TreeViewColumn:api<1>;
use Gnome::Gtk3::Container:api<1>;
use Gnome::Gtk3::TreePath:api<1>;
use Gnome::Gtk3::Scrollable:api<1>;

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


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

An enum for determining where a dropped row goes.


=item GTK_TREE_VIEW_DROP_BEFORE: dropped row is inserted before
=item GTK_TREE_VIEW_DROP_AFTER: dropped row is inserted after
=item GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: dropped row becomes a child or is inserted before
=item GTK_TREE_VIEW_DROP_INTO_OR_AFTER: dropped row becomes a child or is inserted after


=end pod

#TE:0:GtkTreeViewDropPosition:
enum GtkTreeViewDropPosition is export (
  'GTK_TREE_VIEW_DROP_INTO_OR_BEFORE',
  'GTK_TREE_VIEW_DROP_INTO_OR_AFTER'
);

#-------------------------------------------------------------------------------
my Bool $signals-added = False;
#-------------------------------------------------------------------------------
=begin pod
=head1 Methods
=head2 new

=head3 default, no options

Create a new plain object.

  multi method new ( )

=head3 :model

Create a new tree view object using a model. This can be e.g. a B<Gnome::Gtk3::ListStore> or B<Gnome::Gtk3::TreeStore>.

  multi method new ( Bool :model! )

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

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

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

  multi method new ( Str :$build-id! )
=end comment
=end pod

#TM:1:new():
#TM:1:new(:model):
#TM:4:new(:native-object):TopLevelSupportClass
#TM:4:new(:build-id):Object
submethod BUILD ( *%options ) {

  # add signal info in the form of group<signal-name>.
  # groups are e.g. signal, event, nativeobject etc
  $signals-added = self.add-signal-types( $?CLASS.^name,
    :w0<columns-changed cursor-changed select-all unselect-all toggle-cursor-row select-cursor-parent start-interactive-search>,
    :w1<select-cursor-row>,
    :w2<row-activated test-expand-row test-collapse-row row-expanded row-collapsed move-cursor>,
    :w3<expand-collapse-cursor-row>,
  ) unless $signals-added;


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

    if self.is-valid { }

    elsif %options<native-object>:exists or %options<widget>:exists or
      %options<build-id>:exists { }

    else {
      my $no;

      # process all named arguments
      if ? %options<model> {
        $no = %options<model>;
        $no .= _get-native-object-no-reffing
          if $no.^can('_get-native-object-no-reffing');
        $no = _gtk_tree_view_new_with_model($no);
      }

      else {
        $no = _gtk_tree_view_new();
      }

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

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

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

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

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

  $s;
}

#-------------------------------------------------------------------------------
#TM:2:_gtk_tree_view_new:new()
#`{{
=begin pod
=head2 [gtk_] tree_view_new

Creates a new B<Gnome::Gtk3::TreeView> widget.

  method gtk_tree_view_new ( --> N-GObject  )

=end pod
}}
sub _gtk_tree_view_new ( --> N-GObject )
  is symbol('gtk_tree_view_new')
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:_gtk_tree_view_new_with_model:new(:model)
#`{{
=begin pod
=head2 [[gtk_] tree_view_] new_with_model

Creates a new B<Gnome::Gtk3::TreeView> widget with the model initialized to I<model>.

  method gtk_tree_view_new_with_model ( N-GObject $model --> N-GObject )

=item N-GObject $model; the model.

=end pod
}}

sub _gtk_tree_view_new_with_model ( N-GObject $model --> N-GObject )
  is symbol('gtk_tree_view_new_with_model')
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:gtk_tree_view_get_model:
=begin pod
=head2 [[gtk_] tree_view_] get_model

Returns the model the B<Gnome::Gtk3::TreeView> is based on.  Returns C<Any> if the model is unset.

Returns: A B<Gnome::Gtk3::TreeModel>, or C<Any> if none is currently being used.

  method gtk_tree_view_get_model ( --> N-GObject  )

=end pod

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

#-------------------------------------------------------------------------------
#TM:1:gtk_tree_view_set_model:
=begin pod
=head2 [[gtk_] tree_view_] set_model

Sets the model for a B<Gnome::Gtk3::TreeView>.  If the I<tree_view> already has a model set, it will remove it before setting the new model.  If I<model> is C<Any>, then it will unset the old model.

  method gtk_tree_view_set_model ( N-GObject $model )

=item N-GObject $model; (allow-none): The model.

=end pod

sub gtk_tree_view_set_model ( N-GObject $tree_view, N-GObject $model )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_get_selection:
=begin pod
=head2 [[gtk_] tree_view_] get_selection

Gets the B<Gnome::Gtk3::TreeSelection> associated with this I<tree_view>.

  method gtk_tree_view_get_selection ( --> N-GObject  )

=end pod

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


#-------------------------------------------------------------------------------
#TM:1:gtk_tree_view_get_headers_visible:
=begin pod
=head2 [[gtk_] tree_view_] get_headers_visible

Returns C<1> if the headers on the I<tree_view> are visible.

  method gtk_tree_view_get_headers_visible ( --> Int  )

=end pod

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

#-------------------------------------------------------------------------------
#TM:1:gtk_tree_view_set_headers_visible:
=begin pod
=head2 [[gtk_] tree_view_] set_headers_visible

Sets the visibility state of the headers.

  method gtk_tree_view_set_headers_visible ( Int $headers_visible )

=item Int $headers_visible; C<1> if the headers are visible

=end pod

sub gtk_tree_view_set_headers_visible ( N-GObject $tree_view, int32 $headers_visible )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_columns_autosize:
=begin pod
=head2 [[gtk_] tree_view_] columns_autosize

Resizes all columns to their optimal width. Only works after the treeview has been realized.

  method gtk_tree_view_columns_autosize ( )

=end pod

sub gtk_tree_view_columns_autosize ( N-GObject $tree_view )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:gtk_tree_view_get_headers_clickable:
=begin pod
=head2 [[gtk_] tree_view_] get_headers_clickable

Returns C<1> if all header columns are clickable, otherwise C<0>

  method gtk_tree_view_get_headers_clickable ( --> Int  )

=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_set_headers_clickable:
=begin pod
=head2 [[gtk_] tree_view_] set_headers_clickable

Allow the column title buttons to be clicked.

  method gtk_tree_view_set_headers_clickable ( Int $setting )

=item Int $setting; C<1> if the columns are clickable.

=end pod

sub gtk_tree_view_set_headers_clickable ( N-GObject $tree_view, int32 $setting )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:gtk_tree_view_get_activate_on_single_click:
=begin pod
=head2 [[gtk_] tree_view_] get_activate_on_single_click

Gets the setting set by C<gtk_tree_view_set_activate_on_single_click()>. The method returns C<1> if row-activated will be emitted on a single click.

  method gtk_tree_view_get_activate_on_single_click ( --> Int )

=end pod

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

#-------------------------------------------------------------------------------
#TM:1:gtk_tree_view_set_activate_on_single_click:
=begin pod
=head2 [[gtk_] tree_view_] set_activate_on_single_click

Cause the  I<row-activated> signal to be emitted on a single click instead of a double click.

  method gtk_tree_view_set_activate_on_single_click ( Bool $single )

=item Bool $single; C<True> to emit row-activated on a single click

=end pod

sub gtk_tree_view_set_activate_on_single_click ( N-GObject $tree_view, int32 $single )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_append_column:
=begin pod
=head2 [[gtk_] tree_view_] append_column

Appends I<$column> to the list of columns. If this tree view has “fixed_height” mode enabled, then I<$column> must have its “sizing” property set to be C<GTK_TREE_VIEW_COLUMN_FIXED>.

Returns: The number of columns in I<tree_view> after appending.

  method gtk_tree_view_append_column (
    Gnome::Gtk3::TreeViewColumn $column
    --> Int
  )

=item Gnome::Gtk3::TreeViewColumn $column; The column to add.

=end pod

sub gtk_tree_view_append_column ( N-GObject $tree_view, N-GObject $column --> int32 )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_remove_column:
=begin pod
=head2 [[gtk_] tree_view_] remove_column

Removes I<$column> from this I<tree_view>.

Returns: The number of columns in I<tree_view> after removing.

  method gtk_tree_view_remove_column ( N-GObject $column --> Int  )

=item N-GObject $column; The B<Gnome::Gtk3::TreeViewColumn> to remove.

=end pod

sub gtk_tree_view_remove_column ( N-GObject $tree_view, N-GObject $column --> int32 )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_insert_column:
=begin pod
=head2 [[gtk_] tree_view_] insert_column

This inserts the I<$column> into the I<tree_view> at I<$position>.  If I<$position> is -1, then the column is inserted at the end. If I<tree_view> has “fixed_height” mode enabled, then I<$column> must have its “sizing” property set to be C<GTK_TREE_VIEW_COLUMN_FIXED>.

Returns: The number of columns in I<tree_view> after insertion.

  method gtk_tree_view_insert_column (
    N-GObject $column, Int $position --> Int
  )

=item N-GObject $column; The B<Gnome::Gtk3::TreeViewColumn> to be inserted.
=item Int $position; The position to insert I<column> in.

=end pod

sub gtk_tree_view_insert_column ( N-GObject $tree_view, N-GObject $column, int32 $position --> int32 )
  is native(&gtk-lib)
  { * }


#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_insert_column_with_attributes:
=begin pod
=comment head2 [gtk_tree_view_] insert_column_with_attributes
=head2 insert-column-with-attributes

Creates a new B<Gnome::Gtk3::TreeViewColumn> and inserts it into the I<tree_view> at I<$position>.  If I<$position> is -1, then the newly created column is inserted at the end.  The column is initialized with the attributes given. If I<tree_view> has “fixed_height” mode enabled, then the new column will have its sizing property set to be C<GTK_TREE_VIEW_COLUMN_FIXED>.

Returns: The number of columns in this treeview after insertion.

  method insert-column-with-attributes (
    Int $insert-position,
    Str $title, Gnome::Gtk3::CellRenderer $cellrenderer, ...
    --> Int
  )

=item A repeating list of
=item2 Int $position; The position to insert the new column in
=item2 Str $title; The title to set the header to
=item2 Gnome::Gtk3::CellRenderer $cell; The cell renderer

=end pod

method insert-column-with-attributes ( *@attributes --> Int ) {

  my @parameter-list = ( );
  @parameter-list.push: Parameter.new(type => N-GObject);    # tree_view

  my @attrs = ( );
  for @attributes -> $insert, $title, $renderer {
    @parameter-list.push: Parameter.new(type => int32);      # insert position
    @parameter-list.push: Parameter.new(type => Str);        # title
    @parameter-list.push: Parameter.new(type => N-GObject);  # renderer

    @attrs.push: $insert;
    @attrs.push: $title;
    @attrs.push: $renderer._get-native-object;
  }

  # end list with 0
  @parameter-list.push: Parameter.new(type => int32);

  # create signature
  my Signature $signature .= new(
    :params(|@parameter-list),
    :returns(int32)
  );

#note "S: ", $signature.perl;
#note "A: ", (self._get-native-object, |@attrs, 0).join(', ');

  # get a pointer to the sub, then cast it to a sub with the proper
  # signature. after that, the sub can be called, returning a value.
  state $ptr = cglobal(
    &gtk-lib, 'gtk_tree_view_insert_column_with_attributes', Pointer
  );
  my Callable $f = nativecast( $signature, $ptr);

  $f( self._get-native-object, |@attrs, 0)
}

#`{{
#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_insert_column_with_data_func:
=begin pod
=head2 [[gtk_] tree_view_] insert_column_with_data_func

Convenience function that inserts a new column into the B<Gnome::Gtk3::TreeView>
with the given cell renderer and a B<Gnome::Gtk3::TreeCellDataFunc> to set cell renderer
attributes (normally using data from the model). See also
C<gtk_tree_view_column_set_cell_data_func()>, C<gtk_tree_view_column_pack_start()>.
If I<tree_view> has “fixed_height” mode enabled, then the new column will have its
“sizing” property set to be GTK_TREE_VIEW_COLUMN_FIXED.

Returns: number of columns in the tree view post-insert

  method gtk_tree_view_insert_column_with_data_func ( Int $position, Str $title, N-GObject $cell, GtkTreeCellDataFunc $func, Pointer $data, GDestroyNotify $dnotify --> Int  )

=item Int $position; Position to insert, -1 for append
=item Str $title; column title
=item N-GObject $cell; cell renderer for column
=item GtkTreeCellDataFunc $func; function to set attributes of cell renderer
=item Pointer $data; data for I<func>
=item GDestroyNotify $dnotify; destroy notifier for I<data>

=end pod

sub gtk_tree_view_insert_column_with_data_func ( N-GObject $tree_view, int32 $position, Str $title, N-GObject $cell, GtkTreeCellDataFunc $func, Pointer $data, GDestroyNotify $dnotify --> int32 )
  is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_get_n_columns:
=begin pod
=head2 [[gtk_] tree_view_] get_n_columns

Queries the number of columns in the given I<tree_view>.

Returns: The number of columns in the I<tree_view>


  method gtk_tree_view_get_n_columns ( --> UInt  )


=end pod

sub gtk_tree_view_get_n_columns ( N-GObject $tree_view --> uint32 )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:gtk_tree_view_get_column:
=begin pod
=head2 [[gtk_] tree_view_] get_column

Gets the B<Gnome::Gtk3::TreeViewColumn> at the given position in the B<tree_view> or undefined if the position is outside the range of columns.

  method gtk_tree_view_get_column ( Int $n --> Gnome::Gtk3::TreeViewColumn )

=item Int $n; The position of the column, counting from 0.

=end pod

sub gtk_tree_view_get_column ( N-GObject $tree_view, int32 $n --> N-GObject )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:gtk_tree_view_get_columns:
=begin pod
=head2 [[gtk_] tree_view_] get_columns

Returns a B<GList> of all the B<Gnome::Gtk3::TreeViewColumn> s currently in I<tree_view>.
The returned list must be freed with C<g_list_free()>.

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

  method gtk_tree_view_get_columns ( --> N-GList  )


=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_move_column_after:
=begin pod
=head2 [[gtk_] tree_view_] move_column_after

Moves I<column> to be after to I<base_column>.  If I<base_column> is C<Any>, then
I<column> is placed in the first position.

  method gtk_tree_view_move_column_after ( N-GObject $column, N-GObject $base_column )

=item N-GObject $column; The B<Gnome::Gtk3::TreeViewColumn> to be moved.
=item N-GObject $base_column; (allow-none): The B<Gnome::Gtk3::TreeViewColumn> to be moved relative to, or C<Any>.

=end pod

sub gtk_tree_view_move_column_after ( N-GObject $tree_view, N-GObject $column, N-GObject $base_column )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_set_expander_column:
=begin pod
=head2 [[gtk_] tree_view_] set_expander_column

Sets the column to draw the expander arrow at. It must be in I<tree_view>.
If I<column> is C<Any>, then the expander arrow is always at the first
visible column.

If you do not want expander arrow to appear in your tree, set the
expander column to a hidden column.

  method gtk_tree_view_set_expander_column ( N-GObject $column )

=item N-GObject $column; C<Any>, or the column to draw the expander arrow at.

=end pod

sub gtk_tree_view_set_expander_column ( N-GObject $tree_view, N-GObject $column )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_get_expander_column:
=begin pod
=head2 [[gtk_] tree_view_] get_expander_column

Returns the column that is the current expander column.
This column has the expander arrow drawn next to it.

Returns: (transfer none): The expander column.

  method gtk_tree_view_get_expander_column ( --> N-GObject  )


=end pod

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

#`{{
#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_set_column_drag_function:
=begin pod
=head2 [[gtk_] tree_view_] set_column_drag_function

Sets a user function for determining where a column may be dropped when
dragged.  This function is called on every column pair in turn at the
beginning of a column drag to determine where a drop can take place.  The
arguments passed to I<func> are: the I<tree_view>, the B<Gnome::Gtk3::TreeViewColumn> being
dragged, the two B<Gnome::Gtk3::TreeViewColumn> s determining the drop spot, and
I<user_data>.  If either of the B<Gnome::Gtk3::TreeViewColumn> arguments for the drop spot
are C<Any>, then they indicate an edge.  If I<func> is set to be C<Any>, then
I<tree_view> reverts to the default behavior of allowing all columns to be
dropped everywhere.

  method gtk_tree_view_set_column_drag_function ( GtkTreeViewColumnDropFunc $func, Pointer $user_data, GDestroyNotify $destroy )

=item GtkTreeViewColumnDropFunc $func; (allow-none): A function to determine which columns are reorderable, or C<Any>.
=item Pointer $user_data; (allow-none): User data to be passed to I<func>, or C<Any>
=item GDestroyNotify $destroy; (allow-none): Destroy notifier for I<user_data>, or C<Any>

=end pod

sub gtk_tree_view_set_column_drag_function ( N-GObject $tree_view, GtkTreeViewColumnDropFunc $func, Pointer $user_data, GDestroyNotify $destroy )
  is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_scroll_to_point:
=begin pod
=head2 [[gtk_] tree_view_] scroll_to_point

Scrolls the tree view such that the top-left corner of the visible
area is I<tree_x>, I<tree_y>, where I<tree_x> and I<tree_y> are specified
in tree coordinates.  The I<tree_view> must be realized before
this function is called.  If it isn't, you probably want to be
using C<gtk_tree_view_scroll_to_cell()>.

If either I<tree_x> or I<tree_y> are -1, then that direction isn’t scrolled.

  method gtk_tree_view_scroll_to_point ( Int $tree_x, Int $tree_y )

=item Int $tree_x; X coordinate of new top-left pixel of visible area, or -1
=item Int $tree_y; Y coordinate of new top-left pixel of visible area, or -1

=end pod

sub gtk_tree_view_scroll_to_point ( N-GObject $tree_view, int32 $tree_x, int32 $tree_y )
  is native(&gtk-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_scroll_to_cell:
=begin pod
=head2 [[gtk_] tree_view_] scroll_to_cell

Moves the alignments of I<tree_view> to the position specified by I<column> and
I<path>.  If I<column> is C<Any>, then no horizontal scrolling occurs.  Likewise,
if I<path> is C<Any> no vertical scrolling occurs.  At a minimum, one of I<column>
or I<path> need to be non-C<Any>.  I<row_align> determines where the row is
placed, and I<col_align> determines where I<column> is placed.  Both are expected
to be between 0.0 and 1.0. 0.0 means left/top alignment, 1.0 means
right/bottom alignment, 0.5 means center.

If I<use_align> is C<0>, then the alignment arguments are ignored, and the
tree does the minimum amount of work to scroll the cell onto the screen.
This means that the cell will be scrolled to the edge closest to its current
position.  If the cell is currently visible on the screen, nothing is done.

This function only works if the model is set, and I<path> is a valid row on the
model.  If the model changes before the I<tree_view> is realized, the centered
path will be modified to reflect this change.

  method gtk_tree_view_scroll_to_cell ( N-GtkTreePath $path, N-GObject $column, Int $use_align, Num $row_align, Num $col_align )

=item N-GtkTreePath $path; (allow-none): The path of the row to move to, or C<Any>.
=item N-GObject $column; (allow-none): The B<Gnome::Gtk3::TreeViewColumn> to move horizontally to, or C<Any>.
=item Int $use_align; whether to use alignment arguments, or C<0>.
=item Num $row_align; The vertical alignment of the row specified by I<path>.
=item Num $col_align; The horizontal alignment of the column specified by I<column>.

=end pod

sub gtk_tree_view_scroll_to_cell ( N-GObject $tree_view, N-GtkTreePath $path, N-GObject $column, int32 $use_align, num32 $row_align, num32 $col_align )
  is native(&gtk-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_row_activated:
=begin pod
=head2 [[gtk_] tree_view_] row_activated

Activates the cell determined by I<path> and I<column>.

  method gtk_tree_view_row_activated ( N-GtkTreePath $path, N-GObject $column )

=item N-GtkTreePath $path; The B<Gnome::Gtk3::TreePath> to be activated.
=item N-GObject $column; The B<Gnome::Gtk3::TreeViewColumn> to be activated.

=end pod

sub gtk_tree_view_row_activated ( N-GObject $tree_view, N-GtkTreePath $path, N-GObject $column )
  is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_expand_all:
=begin pod
=head2 [[gtk_] tree_view_] expand_all

Recursively expands all nodes in the I<tree_view>.

  method gtk_tree_view_expand_all ( )


=end pod

sub gtk_tree_view_expand_all ( N-GObject $tree_view )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_collapse_all:
=begin pod
=head2 [[gtk_] tree_view_] collapse_all

Recursively collapses all visible, expanded nodes in I<tree_view>.

  method gtk_tree_view_collapse_all ( )


=end pod

sub gtk_tree_view_collapse_all ( N-GObject $tree_view )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:4:gtk_tree_view_expand_to_path:QAManager
=begin pod
=head2 [[gtk_] tree_view_] expand_to_path

Expands the row at I<$path>. This will also expand all parent rows of I<$path> as necessary.

  method gtk_tree_view_expand_to_path ( N-GtkTreePath $path )

=item N-GtkTreePath $path; path to a row.

=end pod

sub gtk_tree_view_expand_to_path ( N-GObject $tree_view, N-GtkTreePath $path )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:4:gtk_tree_view_expand_row:QAManager
=begin pod
=head2 [[gtk_] tree_view_] expand_row

Opens the row so its children are visible.

Returns: C<1> if the row existed and had children

  method gtk_tree_view_expand_row (
    N-GtkTreePath $path, Bool $open_all
    --> Int
  )

=item N-GtkTreePath $path; path to a row
=item Int $open_all; whether to recursively expand, or just expand immediate children

=end pod

sub gtk_tree_view_expand_row ( N-GObject $tree_view, N-GtkTreePath $path, int32 $open_all --> int32 )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:4:gtk_tree_view_collapse_row:QAManager
=begin pod
=head2 [[gtk_] tree_view_] collapse_row

Collapses a row (hides its child rows, if they exist).

Returns: C<1> if the row was collapsed.

  method gtk_tree_view_collapse_row ( N-GtkTreePath $path --> Int  )

=item N-GtkTreePath $path; path to a row in the I<tree_view>

=end pod

sub gtk_tree_view_collapse_row ( N-GObject $tree_view, N-GtkTreePath $path --> int32 )
  is native(&gtk-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_map_expanded_rows:
=begin pod
=head2 [[gtk_] tree_view_] map_expanded_rows

Calls I<func> on all expanded rows.

  method gtk_tree_view_map_expanded_rows ( GtkTreeViewMappingFunc $func, Pointer $data )

=item GtkTreeViewMappingFunc $func; (scope call): A function to be called
=item Pointer $data; User data to be passed to the function.

=end pod

sub gtk_tree_view_map_expanded_rows ( N-GObject $tree_view, GtkTreeViewMappingFunc $func, Pointer $data )
  is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:4:gtk_tree_view_row_expanded:QAManager
=begin pod
=head2 [[gtk_] tree_view_] row_expanded

Returns C<1> if the node pointed to by I<$path> is expanded.

  method gtk_tree_view_row_expanded ( N-GtkTreePath $path --> Int  )

=end pod

sub gtk_tree_view_row_expanded ( N-GObject $tree_view, N-GtkTreePath $path --> int32 )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_set_reorderable:
=begin pod
=head2 [[gtk_] tree_view_] set_reorderable

This function is a convenience function to allow you to reorder
models that support the B<Gnome::Gtk3::TreeDragSourceIface> and the
B<Gnome::Gtk3::TreeDragDestIface>.  Both B<Gnome::Gtk3::TreeStore> and B<Gnome::Gtk3::ListStore> support
these.  If I<reorderable> is C<1>, then the user can reorder the
model by dragging and dropping rows. The developer can listen to
these changes by connecting to the model’s  I<row-inserted>
and  I<row-deleted> signals. The reordering is implemented
by setting up the tree view as a drag source and destination.
Therefore, drag and drop can not be used in a reorderable view for any
other purpose.

This function does not give you any degree of control over the order -- any
reordering is allowed.  If more control is needed, you should probably
handle drag and drop manually.

  method gtk_tree_view_set_reorderable ( Int $reorderable )

=item Int $reorderable; C<1>, if the tree can be reordered.

=end pod

sub gtk_tree_view_set_reorderable ( N-GObject $tree_view, int32 $reorderable )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_tree_view_get_reorderable:
=begin pod
=head2 [[gtk_] tree_view_] get_reorderable

Retrieves whether the user can reorder the tree via drag-and-drop. See
C<gtk_tree_view_set_reorderable()>.

Returns: C<1> if the tree can be reordered.

  method gtk_tree_view_get_reorderable ( --> Int  )


=end pod

sub gtk_tree_view