Commit 736ff297 authored by Allison Karlitskaya's avatar Allison Karlitskaya

gtk+-3.0: add new GtkListBox selection API

metadata copied from the similar api on GtkFlowBox (which is where the
GtkListBox API itself was modelled from).

https://bugzilla.gnome.org/show_bug.cgi?id=728474
parent c040b250
......@@ -2972,6 +2972,7 @@ namespace Gtk {
public unowned Gtk.ListBoxRow get_row_at_index (int index_);
public unowned Gtk.ListBoxRow get_row_at_y (int y);
public unowned Gtk.ListBoxRow get_selected_row ();
public GLib.List<weak Gtk.ListBoxRow> get_selected_rows ();
public Gtk.SelectionMode get_selection_mode ();
public void insert (Gtk.Widget child, int position);
public void invalidate_filter ();
......@@ -2979,6 +2980,7 @@ namespace Gtk {
public void invalidate_sort ();
public void prepend (Gtk.Widget child);
public void select_row (Gtk.ListBoxRow? row);
public void selected_foreach (Gtk.ListBoxForeachFunc func);
public void set_activate_on_single_click (bool single);
public void set_adjustment (Gtk.Adjustment? adjustment);
public void set_filter_func (owned Gtk.ListBoxFilterFunc? filter_func);
......@@ -2986,13 +2988,19 @@ namespace Gtk {
public void set_placeholder (Gtk.Widget? placeholder);
public void set_selection_mode (Gtk.SelectionMode mode);
public void set_sort_func (owned Gtk.ListBoxSortFunc? sort_func);
public void unselect_row (Gtk.ListBoxRow row);
public bool activate_on_single_click { get; set; }
public Gtk.SelectionMode selection_mode { get; set; }
public virtual signal void activate_cursor_row ();
public virtual signal void move_cursor (Gtk.MovementStep step, int count);
public virtual signal void row_activated (Gtk.ListBoxRow row);
public virtual signal void row_selected (Gtk.ListBoxRow? row);
[HasEmitter]
public virtual signal void select_all ();
public virtual signal void selected_rows_changed ();
public virtual signal void toggle_cursor_row ();
[HasEmitter]
public virtual signal void unselect_all ();
}
[CCode (cheader_filename = "gtk/gtk.h")]
public class ListBoxAccessible : Gtk.ContainerAccessible, Atk.Component, Atk.Selection {
......@@ -3006,6 +3014,7 @@ namespace Gtk {
public void changed ();
public unowned Gtk.Widget get_header ();
public int get_index ();
public bool is_selected ();
public void set_header (Gtk.Widget? header);
public virtual signal void activate ();
}
......@@ -8450,6 +8459,8 @@ namespace Gtk {
[CCode (cheader_filename = "gtk/gtk.h")]
public delegate bool ListBoxFilterFunc (Gtk.ListBoxRow row);
[CCode (cheader_filename = "gtk/gtk.h")]
public delegate void ListBoxForeachFunc (Gtk.ListBox box, Gtk.ListBoxRow row);
[CCode (cheader_filename = "gtk/gtk.h")]
public delegate int ListBoxSortFunc (Gtk.ListBoxRow row1, Gtk.ListBoxRow row2);
[CCode (cheader_filename = "gtk/gtk.h")]
public delegate void ListBoxUpdateHeaderFunc (Gtk.ListBoxRow row, Gtk.ListBoxRow before);
......
......@@ -1787,6 +1787,14 @@
<parameter name="user_data" type="gpointer"/>
</parameters>
</callback>
<callback name="GtkListBoxForeachFunc">
<return-type type="void"/>
<parameters>
<parameter name="box" type="GtkListBox*"/>
<parameter name="row" type="GtkListBoxRow*"/>
<parameter name="user_data" type="gpointer"/>
</parameters>
</callback>
<callback name="GtkListBoxSortFunc">
<return-type type="gint"/>
<parameters>
......@@ -16201,58 +16209,64 @@
<method name="drag_highlight_row" symbol="gtk_list_box_drag_highlight_row">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
<parameter name="row" type="GtkListBoxRow*"/>
</parameters>
</method>
<method name="drag_unhighlight_row" symbol="gtk_list_box_drag_unhighlight_row">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
</parameters>
</method>
<method name="get_activate_on_single_click" symbol="gtk_list_box_get_activate_on_single_click">
<return-type type="gboolean"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
</parameters>
</method>
<method name="get_adjustment" symbol="gtk_list_box_get_adjustment">
<return-type type="GtkAdjustment*"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
</parameters>
</method>
<method name="get_row_at_index" symbol="gtk_list_box_get_row_at_index">
<return-type type="GtkListBoxRow*"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
<parameter name="index_" type="gint"/>
</parameters>
</method>
<method name="get_row_at_y" symbol="gtk_list_box_get_row_at_y">
<return-type type="GtkListBoxRow*"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
<parameter name="y" type="gint"/>
</parameters>
</method>
<method name="get_selected_row" symbol="gtk_list_box_get_selected_row">
<return-type type="GtkListBoxRow*"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
</parameters>
</method>
<method name="get_selected_rows" symbol="gtk_list_box_get_selected_rows">
<return-type type="GList*"/>
<parameters>
<parameter name="box" type="GtkListBox*"/>
</parameters>
</method>
<method name="get_selection_mode" symbol="gtk_list_box_get_selection_mode">
<return-type type="GtkSelectionMode"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
</parameters>
</method>
<method name="insert" symbol="gtk_list_box_insert">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
<parameter name="child" type="GtkWidget*"/>
<parameter name="position" type="gint"/>
</parameters>
......@@ -16260,19 +16274,19 @@
<method name="invalidate_filter" symbol="gtk_list_box_invalidate_filter">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
</parameters>
</method>
<method name="invalidate_headers" symbol="gtk_list_box_invalidate_headers">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
</parameters>
</method>
<method name="invalidate_sort" symbol="gtk_list_box_invalidate_sort">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
</parameters>
</method>
<constructor name="new" symbol="gtk_list_box_new">
......@@ -16281,35 +16295,49 @@
<method name="prepend" symbol="gtk_list_box_prepend">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
<parameter name="child" type="GtkWidget*"/>
</parameters>
</method>
<method name="select_all" symbol="gtk_list_box_select_all">
<return-type type="void"/>
<parameters>
<parameter name="box" type="GtkListBox*"/>
</parameters>
</method>
<method name="select_row" symbol="gtk_list_box_select_row">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
<parameter name="row" type="GtkListBoxRow*"/>
</parameters>
</method>
<method name="selected_foreach" symbol="gtk_list_box_selected_foreach">
<return-type type="void"/>
<parameters>
<parameter name="box" type="GtkListBox*"/>
<parameter name="func" type="GtkListBoxForeachFunc"/>
<parameter name="data" type="gpointer"/>
</parameters>
</method>
<method name="set_activate_on_single_click" symbol="gtk_list_box_set_activate_on_single_click">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
<parameter name="single" type="gboolean"/>
</parameters>
</method>
<method name="set_adjustment" symbol="gtk_list_box_set_adjustment">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
<parameter name="adjustment" type="GtkAdjustment*"/>
</parameters>
</method>
<method name="set_filter_func" symbol="gtk_list_box_set_filter_func">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
<parameter name="filter_func" type="GtkListBoxFilterFunc"/>
<parameter name="user_data" type="gpointer"/>
<parameter name="destroy" type="GDestroyNotify"/>
......@@ -16318,7 +16346,7 @@
<method name="set_header_func" symbol="gtk_list_box_set_header_func">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
<parameter name="update_header" type="GtkListBoxUpdateHeaderFunc"/>
<parameter name="user_data" type="gpointer"/>
<parameter name="destroy" type="GDestroyNotify"/>
......@@ -16327,38 +16355,51 @@
<method name="set_placeholder" symbol="gtk_list_box_set_placeholder">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
<parameter name="placeholder" type="GtkWidget*"/>
</parameters>
</method>
<method name="set_selection_mode" symbol="gtk_list_box_set_selection_mode">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
<parameter name="mode" type="GtkSelectionMode"/>
</parameters>
</method>
<method name="set_sort_func" symbol="gtk_list_box_set_sort_func">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
<parameter name="sort_func" type="GtkListBoxSortFunc"/>
<parameter name="user_data" type="gpointer"/>
<parameter name="destroy" type="GDestroyNotify"/>
</parameters>
</method>
<method name="unselect_all" symbol="gtk_list_box_unselect_all">
<return-type type="void"/>
<parameters>
<parameter name="box" type="GtkListBox*"/>
</parameters>
</method>
<method name="unselect_row" symbol="gtk_list_box_unselect_row">
<return-type type="void"/>
<parameters>
<parameter name="box" type="GtkListBox*"/>
<parameter name="row" type="GtkListBoxRow*"/>
</parameters>
</method>
<property name="activate-on-single-click" type="gboolean" readable="1" writable="1" construct="0" construct-only="0"/>
<property name="selection-mode" type="GtkSelectionMode" readable="1" writable="1" construct="0" construct-only="0"/>
<signal name="activate-cursor-row" when="LAST">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
</parameters>
</signal>
<signal name="move-cursor" when="LAST">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
<parameter name="step" type="GtkMovementStep"/>
<parameter name="count" type="gint"/>
</parameters>
......@@ -16366,21 +16407,39 @@
<signal name="row-activated" when="LAST">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
<parameter name="row" type="GtkListBoxRow*"/>
</parameters>
</signal>
<signal name="row-selected" when="LAST">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
<parameter name="row" type="GtkListBoxRow*"/>
</parameters>
</signal>
<signal name="select-all" when="LAST">
<return-type type="void"/>
<parameters>
<parameter name="box" type="GtkListBox*"/>
</parameters>
</signal>
<signal name="selected-rows-changed" when="FIRST">
<return-type type="void"/>
<parameters>
<parameter name="box" type="GtkListBox*"/>
</parameters>
</signal>
<signal name="toggle-cursor-row" when="LAST">
<return-type type="void"/>
<parameters>
<parameter name="list_box" type="GtkListBox*"/>
<parameter name="box" type="GtkListBox*"/>
</parameters>
</signal>
<signal name="unselect-all" when="LAST">
<return-type type="void"/>
<parameters>
<parameter name="box" type="GtkListBox*"/>
</parameters>
</signal>
</object>
......@@ -16413,6 +16472,12 @@
<parameter name="row" type="GtkListBoxRow*"/>
</parameters>
</method>
<method name="is_selected" symbol="gtk_list_box_row_is_selected">
<return-type type="gboolean"/>
<parameters>
<parameter name="row" type="GtkListBoxRow*"/>
</parameters>
</method>
<constructor name="new" symbol="gtk_list_box_row_new">
<return-type type="GtkWidget*"/>
</constructor>
......@@ -34263,7 +34328,7 @@
</parameters>
</vfunc>
</interface>
<constant name="GTK_BINARY_AGE" type="int" value="1200"/>
<constant name="GTK_BINARY_AGE" type="int" value="1300"/>
<constant name="GTK_INPUT_ERROR" type="int" value="-1"/>
<constant name="GTK_INTERFACE_AGE" type="int" value="0"/>
<constant name="GTK_LEVEL_BAR_OFFSET_HIGH" type="char*" value="high"/>
......@@ -34271,7 +34336,7 @@
<constant name="GTK_MAJOR_VERSION" type="int" value="3"/>
<constant name="GTK_MAX_COMPOSE_LEN" type="int" value="7"/>
<constant name="GTK_MICRO_VERSION" type="int" value="0"/>
<constant name="GTK_MINOR_VERSION" type="int" value="12"/>
<constant name="GTK_MINOR_VERSION" type="int" value="13"/>
<constant name="GTK_PAPER_NAME_A3" type="char*" value="iso_a3"/>
<constant name="GTK_PAPER_NAME_A4" type="char*" value="iso_a4"/>
<constant name="GTK_PAPER_NAME_A5" type="char*" value="iso_a5"/>
......@@ -472,6 +472,8 @@ gtk_layout_get_size.width is_out="1"
gtk_layout_get_size.height is_out="1"
gtk_layout_new.hadjustment nullable="1" default_value="null"
gtk_layout_new.vadjustment nullable="1" default_value="null"
gtk_list_box_get_selected_rows transfer_ownership="1" type_arguments="unowned ListBoxRow"
gtk_list_box_selected_foreach.data hidden="1"
gtk_list_box_row_set_header.header nullable="1"
gtk_list_box_select_row.row nullable="1"
gtk_list_box_set_adjustment.adjustment nullable="1"
......@@ -482,7 +484,9 @@ gtk_list_box_set_header_func.destroy hidden="1"
gtk_list_box_set_placeholder.placeholder nullable="1"
gtk_list_box_set_sort_func.sort_func transfer_ownership="1" nullable="1"
gtk_list_box_set_sort_func.destroy hidden="1"
GtkListBox::select_all has_emitter="1"
GtkListBox::row_selected.row nullable="1"
GtkListBox::unselect_all has_emitter="1"
gtk_list_store_new ellipsis="1" sentinel=""
gtk_list_store_newv.n_columns hidden="1"
gtk_list_store_newv.types array_length_pos="0.9"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment