Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!2257
This commit is contained in:
Matthias Clasen 2020-07-17 03:20:20 +00:00
commit 9742200ff6
18 changed files with 119 additions and 62 deletions

View File

@ -65,9 +65,9 @@
<section>
<xi:include href="xml/gtksorter.xml" />
<xi:include href="xml/gtkcustomsorter.xml" />
<xi:include href="xml/gtkmultisorter.xml" />
<xi:include href="xml/gtkstringsorter.xml" />
<xi:include href="xml/gtknumericsorter.xml" />
<xi:include href="xml/gtkmultisorter.xml" />
</section>
<xi:include href="xml/gtkselectionmodel.xml" />
<section>
@ -93,7 +93,9 @@
<xi:include href="xml/gtklistview.xml" />
<xi:include href="xml/gtkgridview.xml" />
<xi:include href="xml/gtkcolumnview.xml" />
<xi:include href="xml/gtkcolumnviewcolumn.xml" />
<section>
<xi:include href="xml/gtkcolumnviewcolumn.xml" />
</section>
<xi:include href="xml/gtkdropdown.xml" />
</chapter>

View File

@ -3420,6 +3420,7 @@ gtk_tree_list_row_get_type
<SECTION>
<FILE>gtktreeexpander</FILE>
<TITLE>GtkTreeExpander</TITLE>
GtkTreeExpander
gtk_tree_expander_new
gtk_tree_expander_get_child
gtk_tree_expander_set_child
@ -7551,6 +7552,17 @@ gtk_object_expression_get_object
gtk_closure_expression_new
gtk_cclosure_expression_new
<SUBSECTION>
GTK_VALUE_HOLDS_EXPRESSION
gtk_value_set_expression
gtk_value_take_expression
gtk_value_get_expression
gtk_value_dup_expression
<SUBSECTION>
GtkParamSpecExpression
gtk_param_spec_expression
<SUBSECTION Standard>
GTK_IS_EXPRESSION
GTK_TYPE_EXPRESSION

View File

@ -19,6 +19,7 @@ gtk_assistant_get_type
gtk_assistant_page_get_type
gtk_bin_layout_get_type
gtk_bitset_get_type
gtk_expression_get_type
gtk_bookmark_list_get_type
gtk_box_get_type
gtk_box_layout_get_type
@ -29,6 +30,7 @@ gtk_builder_list_item_factory_get_type
gtk_builder_scope_get_type
gtk_button_get_type
gtk_calendar_get_type
gtk_cclosure_expression_get_type
gtk_cell_area_get_type
gtk_cell_area_box_get_type
gtk_cell_area_context_get_type
@ -46,6 +48,7 @@ gtk_cell_renderer_toggle_get_type
gtk_cell_view_get_type
gtk_center_layout_get_type
gtk_check_button_get_type
gtk_closure_expression_get_type
gtk_color_button_get_type
gtk_color_chooser_get_type
gtk_color_chooser_dialog_get_type
@ -54,6 +57,7 @@ gtk_column_view_get_type
gtk_column_view_column_get_type
gtk_combo_box_get_type
gtk_combo_box_text_get_type
gtk_constant_expression_get_type
gtk_constraint_get_type
gtk_constraint_guide_get_type
gtk_constraint_layout_get_type
@ -150,6 +154,7 @@ gtk_no_selection_get_type
gtk_notebook_get_type
gtk_notebook_page_get_type
gtk_numeric_sorter_get_type
gtk_object_expression_get_type
gtk_orientable_get_type
gtk_overlay_get_type
gtk_overlay_layout_get_type
@ -172,6 +177,7 @@ gtk_print_operation_preview_get_type
gtk_print_settings_get_type
@DISABLE_ON_W32@gtk_print_unix_dialog_get_type
gtk_progress_bar_get_type
gtk_property_expression_get_type
gtk_radio_button_get_type
gtk_range_get_type
gtk_recent_manager_get_type
@ -229,6 +235,7 @@ gtk_text_view_get_type
gtk_toggle_button_get_type
gtk_tree_drag_dest_get_type
gtk_tree_drag_source_get_type
gtk_tree_expander_get_type
gtk_tree_list_model_get_type
gtk_tree_list_row_get_type
gtk_tree_list_row_sorter_get_type

View File

@ -183,7 +183,7 @@ transitioning code for easy lookup:
| #GtkTreeModel | #GListModel |
| #GtkTreePath | #guint position, #GtkTreeListRow |
| #GtkTreeIter | #guint position |
| GtkTreeRowReference | #GObject item |
| #GtkTreeRowReference | #GObject item |
| #GtkListStore | #GListStore |
| #GtkTreeStore | #GtkTreeListModel, #GtkTreeExpander |
| #GtkTreeSelection | #GtkSelectionModel |

View File

@ -27,20 +27,19 @@
* SECTION:gtkbitset
* @title: GtkBitset
* @short_description: Sets of integers
* @see_also: GtkSelectionModel
* @see_also: #GtkSelectionModel
*
* #GtkBitset is a data structure for representing a set of unsigned integers.
* Another name for this data structure is "bitmap".
*
* This version is based on [roaring bitmaps](https://roaringbitmap.org/).
* The current implemenation is based on [roaring bitmaps](https://roaringbitmap.org/).
*
* A bitset allows adding a set of integers and provides support for set operations
* like unions, intersections and checks for equality or if a value is contained
* in the set. #GtkBitset also contains various functions to query metadata about
* the bitset, such as the minimum or maximum values or its size.
*
* The fastest way to iterate values in a bitset is #GtkBitsetIter which allows
* quick iteration of all the values in a bitset.
* The fastest way to iterate values in a bitset is #GtkBitsetIter.
*
* The main use case for #GtkBitset is implementing complex selections for
* #GtkSelectionModel.

View File

@ -130,7 +130,21 @@ void gtk_bitset_splice (GtkBitset
guint removed,
guint added);
typedef struct {gpointer private_data[10]; } GtkBitsetIter;
/**
* GtkBitsetIter:
*
* An opaque, stack-allocated struct for iterating
* over the elements of a #GtkBitset. Before a GtkBitsetIter
* can be used, it needs to be initialized with
* gtk_bitset_iter_init_first(), gtk_bitset_iter_init_last()
* or gtk_bitset_iter_init_at().
*/
typedef struct _GtkBitsetIter GtkBitsetIter;
struct _GtkBitsetIter
{
gpointer private_data[10];
};
GDK_AVAILABLE_IN_ALL
gboolean gtk_bitset_iter_init_first (GtkBitsetIter *iter,

View File

@ -60,7 +60,7 @@
* GtkColumnView allows the user to select items according to the selection
* characteristics of the model. If the provided model is not a #GtkSelectionModel,
* GtkColumnView will wrap it in a #GtkSingleSelection. For models that allow
* multiple selected items, it is possible to turn on _rubberband selection_,
* multiple selected items, it is possible to turn on *rubberband selection*,
* using #GtkColumnView:enable-rubberband.
*
* The column view supports sorting that can be customized by the user by
@ -1241,7 +1241,7 @@ gtk_column_view_set_model (GtkColumnView *self,
*
* Gets the list of columns in this column view. This list is constant over
* the lifetime of @self and can be used to monitor changes to the columns
* of @self by connecting to the GListModel:items-changed signal.
* of @self by connecting to the #GListModel:items-changed signal.
*
* Returns: (transfer none): The list managing the columns
**/
@ -1263,7 +1263,7 @@ gtk_column_view_get_columns (GtkColumnView *self)
*/
void
gtk_column_view_set_show_row_separators (GtkColumnView *self,
gboolean show_row_separators)
gboolean show_row_separators)
{
g_return_if_fail (GTK_IS_COLUMN_VIEW (self));
@ -1302,7 +1302,7 @@ gtk_column_view_get_show_row_separators (GtkColumnView *self)
*/
void
gtk_column_view_set_show_column_separators (GtkColumnView *self,
gboolean show_column_separators)
gboolean show_column_separators)
{
g_return_if_fail (GTK_IS_COLUMN_VIEW (self));
@ -1486,17 +1486,26 @@ gtk_column_view_get_list_view (GtkColumnView *self)
* gtk_column_view_get_sorter:
* @self: a #GtkColumnView
*
* Returns the sorter associated with users sorting choices in
* the column view.
* Returns a special sorter that reflects the users sorting
* choices in the column view.
*
* To allow users to customizable sorting by clicking on column
* headers, this sorter needs to be set on the sort
* model(s) underneath the model that is displayed
* by the view.
* headers, this sorter needs to be set on the sort model underneath
* the model that is displayed by the view.
*
* See gtk_column_view_column_get_sorter() for setting up
* See gtk_column_view_column_set_sorter() for setting up
* per-column sorting.
*
* Here is an example:
* |[
* gtk_column_view_column_set_sorter (column, sorter);
* gtk_column_view_append_column (view, column);
* model = gtk_sort_list_model_new (store,
* gtk_column_view_get_sorter (view));
* selection = gtk_no_selection_new (model);
* gtk_column_view_set_model (view, selection);
* ]|
*
* Returns: (transfer none): the #GtkSorter of @self
*/
GtkSorter *

View File

@ -29,8 +29,8 @@
* @Title: GtkCustomFilter
* @Short_description: Filtering with callbacks
*
* #GtkCustomFilter is a #GtkFilter that uses a callback to determine whether
* to include an item or not.
* #GtkCustomFilter is a #GtkFilter that uses a callback to determine
* whether to include an item or not.
*/
struct _GtkCustomFilter
{
@ -98,11 +98,13 @@ gtk_custom_filter_init (GtkCustomFilter *self)
* gtk_custom_filter_new:
* @match_func: (nullable): function to filter items
* @user_data: (nullable): user data to pass to @match_func
* @user_destroy: destory notify
* @user_destroy: destroy notify for @user_data
*
* Creates a new filter using the given @match_func to filter
* items.
*
* If @match_func is %NULL, the filter matches all items.
*
* If the filter func changes its filtering behavior,
* gtk_filter_changed() needs to be called.
*
@ -127,10 +129,12 @@ gtk_custom_filter_new (GtkCustomFilterFunc match_func,
* @self: a #GtkCustomFilter
* @match_func: (nullable): function to filter items
* @user_data: (nullable): user data to pass to @match_func
* @user_destroy: destory notify
* @user_destroy: destroy notify for @user_data
*
* Sets (or unsets) the function used for filtering items.
*
*
* If @match_func is %NULL, the filter matches all items.
*
* If the filter func changes its filtering behavior,
* gtk_filter_changed() needs to be called.
*

View File

@ -27,7 +27,7 @@
/**
* SECTION:gtkcustomsorter
* @Title: GtkCustomSorter
* @Short_description: Sorting with a callback
* @Short_description: Sorting with a callbacks
*
* GtkCustomSorter is a #GtkSorter implementation that sorts
* via a traditional #GCompareDataFunc callback.
@ -108,8 +108,10 @@ gtk_custom_sorter_init (GtkCustomSorter *self)
* Creates a new #GtkSorter that works by calling
* @sort_func to compare items.
*
* Returns: a new #GTkSorter
*/
* If @sort_func is %NULL, all items are considered equal.
*
* Returns: a new #GtkSorter
*/
GtkSorter *
gtk_custom_sorter_new (GCompareDataFunc sort_func,
gpointer user_data,
@ -129,10 +131,12 @@ gtk_custom_sorter_new (GCompareDataFunc sort_func,
* @self: a #GtkCustomSorter
* @sort_func: (nullable): function to sort items
* @user_data: (nullable): user data to pass to @match_func
* @user_destroy: destory notify
* @user_destroy: destroy notify for @user_data
*
* Sets (or unsets) the function used for sorting items.
*
*
* If @sort_func is %NULL, all items are considered equal.
*
* If the sort func changes its sorting behavior,
* gtk_sorter_changed() needs to be called.
*

View File

@ -70,7 +70,7 @@
* useful if the list of options is long. To enable the search entry,
* use gtk_drop_down_set_enable_search().
*
* * # CSS nodes
* # CSS nodes
*
* GtkDropDown has a single CSS node with name dropdown,
* with the button and popover nodes as children.

View File

@ -53,26 +53,26 @@
*
* Here is an example of a complex expression:
* |[
* color_expr = gtk_property_expression_new (GTK_TYPE_LIST_ITEM,
* NULL, "item");
* expression = gtk_property_expression_new (GTK_TYPE_COLOR,
* color_expr,
* "name");
* color_expr = gtk_property_expression_new (GTK_TYPE_LIST_ITEM,
* NULL, "item");
* expression = gtk_property_expression_new (GTK_TYPE_COLOR,
* color_expr, "name");
* ]|
*
* when evaluated with `this` being a GtkListItem, it will obtain the
* "item" property from the GtkListItem, and then obtain the "name" property
* from the resulting object (which is assumed to be of type GTK_TYPE_COLOR).
*
* A more concise way to describe this would be
* |[
* this->item->name
* this->item->name
* ]|
*
* The most likely place where you will encounter expressions is in the context
* of list models and list widgets using them. For example, #GtkDropDown is
* evaluating a GtkExpression to obtain strings from the items in its model
* that it can then use to match against the contents of its search entry.
* #GtkStringFilter is using a GtkExpression for a similar reason.
* #GtkStringFilter is using a GtkExpression for similar reasons.
*
* By default, expressions are not paying attention to changes and evaluation is
* just a snapshot of the current state at a given time. To get informed about
@ -127,11 +127,11 @@
* attribute to specify the object type, and a `name` attribute to specify the property
* to look up. The content of <lookup> can either be an element specfiying the expression
* to use the object, or a string that specifies the name of the object to use.
*
*
* Example:
* |[
* <lookup name='search'>string_filter</lookup>
* |]
* ]|
*
* To create a constant expression, use the <constant> element. If the type attribute
* is specified, the element content is interpreted as a value of that type. Otherwise,

View File

@ -30,20 +30,21 @@
* @Short_description: Filtering items
* @See_also: #GtkFilerListModel
*
* #GtkFilter is the way to describe filters to be used in #GtkFilterListModel.
*
* The model will use a filter to determine if it should filter items or not
* by calling gtk_filter_match() for each item and only keeping the ones
* visible that the function returns %TRUE for.
* A #GtkFilter object describes the filtering to be performed by a
* #GtkFilterListModel.
*
* The model will use the filter to determine if it should include items
* or not by calling gtk_filter_match() for each item and only keeping the
* ones that the function returns %TRUE for.
*
* Filters may change what items they match through their lifetime. In that
* case, they can call gtk_filter_changed() which will emit the #GtkFilter:changed
* signal to notify that previous filter results are no longer valid and that
* items should be checked via gtk_filter_match() again.
* case, they will emit the #GtkFilter:changed signal to notify that previous
* filter results are no longer valid and that items should be checked again
* via gtk_filter_match().
*
* GTK provides various premade filter implementations for common filtering
* GTK provides various pre-made filter implementations for common filtering
* operations. These filters often include properties that can be linked to
* various widgets to easily allow searches.
* various widgets to easily allow searches.
*
* However, in particular for large lists or complex search methods, it is
* also possible to subclass #GtkFilter and provide one's own filter.
@ -118,7 +119,7 @@ gtk_filter_init (GtkFilter *self)
* @self: a #GtkFilter
* @item: (type GObject) (transfer none): The item to check
*
* Checks if the given @item is matched by the filter or not.
* Checks if the given @item is matched by the filter or not.
*
* Returns: %TRUE if the filter matches the item and a filter model should
* keep it, %FALSE if not.
@ -140,7 +141,7 @@ gtk_filter_match (GtkFilter *self,
* Gets the known strictness of @filters. If the strictness is not known,
* %GTK_FILTER_MATCH_SOME is returned.
*
* This value may change after emission of the GtkFilter:changed signal.
* This value may change after emission of the #GtkFilter:changed signal.
*
* This function is meant purely for optimization purposes, filters can
* choose to omit implementing it, but #GtkFilterListModel uses it.

View File

@ -771,8 +771,8 @@ gtk_filter_list_model_get_model (GtkFilterListModel *self)
* @self: a #GtkFilterListModel
* @incremental: %TRUE to enable incremental filtering
*
* When incremental filtering is enabled, the filterlistmodel will not run
* filters immediately, but will instead queue an idle handler that
* When incremental filtering is enabled, the GtkFilterListModel will not
* run filters immediately, but will instead queue an idle handler that
* incrementally filters the items and adds them to the list. This of course
* means that items are not instantly added to the list, but only appear
* incrementally.
@ -837,8 +837,14 @@ gtk_filter_list_model_get_incremental (GtkFilterListModel *self)
*
* You can use this value to check if @self is busy filtering by
* comparing the return value to 0 or you can compute the percentage
* of the filter remaining by dividing the return value by
* g_list_model_get_n_items(gtk_filter_list_model_get_model (self)).
* of the filter remaining by dividing the return value by the total
* number of items in the underlying model:
*
* |[
* pending = gtk_filter_list_model_get_pending (self);
* model = gtk_filter_list_model_get_model (self);
* percentage = pending / (double) g_list_model_get_n_items (model);
* ]|
*
* Returns: The number of items not yet filtered
**/

View File

@ -45,7 +45,7 @@
/**
* SECTION:gtkgridview
* @title: GtkGridView
* @short_description: A widget for displaying lists in a grid
* @short_description: A widget for displaying grids
* @see_also: #GListModel, #GtkListView, #GtkColumnView
*
* GtkGridView is a widget to present a view into a large dynamic grid of items.

View File

@ -26,7 +26,7 @@
/**
* SECTION:gtklistitem
* @title: GtkListItem
* @short_description: Object used to represent items of a ListModel
* @short_description: Object used to represent items of a list model
* @see_also: #GtkListView, #GListModel
*
* #GtkListItem is the object that list-handling containers such

View File

@ -42,10 +42,10 @@
* GtkMultiFilter is the base type that implements support for handling
* multiple filters.
*
* GtkAnyFilter is an implementation of GtkMultiFilter that matches an item
* GtkAnyFilter is a subclass of GtkMultiFilter that matches an item
* when at least one of its filters matches.
*
* GtkEveryFilter is an implementation of GtkMultiFilter that matches an item
* GtkEveryFilter is a subclass of GtkMultiFilter that matches an item
* when each of its filters matches.
*/
struct _GtkMultiFilter

View File

@ -37,9 +37,8 @@
* by calling gtk_sorter_compare() for pairs of items.
*
* Sorters may change their sorting behavior through their lifetime. In that case,
* they call gtk_sorter_changed(), which will emit the #GtkSorter::changed signal to
* notify that the sort order is no longer valid and should be updated by calling
* gtk_sorter_compare() again.
* they will emit the #GtkSorter::changed signal to notify that the sort order is
* no longer valid and should be updated by calling gtk_sorter_compare() again.
*
* GTK provides various pre-made sorter implementations for common sorting operations.
* #GtkColumnView has built-in support for sorting lists via the #GtkColumnViewColumn:sorter

View File

@ -27,7 +27,7 @@
/**
* SECTION:gtkstringfilter
* @Title: GtkStringFilter
* @Short_description: Filtering by string
* @Short_description: Filtering by strings
*
* GtkStringFilter determines whether to include items by looking
* at strings and comparing them to a fixed search term. The strings