forked from AuroraMiddleware/gtk
stringfilter: Convert docs
This commit is contained in:
parent
8da60587e1
commit
ef09696ee5
@ -25,16 +25,21 @@
|
|||||||
#include "gtktypebuiltins.h"
|
#include "gtktypebuiltins.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:gtkstringfilter
|
* GtkStringFilter:
|
||||||
* @Title: GtkStringFilter
|
|
||||||
* @Short_description: Filtering by strings
|
|
||||||
*
|
*
|
||||||
* GtkStringFilter determines whether to include items by looking
|
* `GtkStringFilter` determines whether to include items by comparing
|
||||||
* at strings and comparing them to a fixed search term. The strings
|
* strings to a fixed search term.
|
||||||
* are obtained from the items by evaluating a #GtkExpression.
|
|
||||||
*
|
*
|
||||||
* GtkStringFilter has several different modes of comparison - it
|
* The strings are obtained from the items by evaluating a `GtkExpression`
|
||||||
* can match the whole string, just a prefix, or any substring.
|
* set with [method@Gtk.StringFilter.set_expression], and they are
|
||||||
|
* compared against a search term set with [method@Gtk.StringFilter.set_search].
|
||||||
|
*
|
||||||
|
* `GtkStringFilter` has several different modes of comparison - it
|
||||||
|
* can match the whole string, just a prefix, or any substring. Use
|
||||||
|
* [method@Gtk.StringFilter.set_match_mode] choose a mode.
|
||||||
|
*
|
||||||
|
* It is also possible to make case-insensitive comparisons, with
|
||||||
|
* [method@Gtk.StringFilter.set_ignore_case].
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct _GtkStringFilter
|
struct _GtkStringFilter
|
||||||
@ -243,9 +248,9 @@ gtk_string_filter_class_init (GtkStringFilterClass *class)
|
|||||||
object_class->dispose = gtk_string_filter_dispose;
|
object_class->dispose = gtk_string_filter_dispose;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GtkStringFilter:expression: (type GtkExpression)
|
* GtkStringFilter:expression: (type GtkExpression) (attributes org.gtk.Property.get=gtk_string_filter_get_expression org.gtk.Property.set=gtk_string_filter_set_expression)
|
||||||
*
|
*
|
||||||
* The expression to evaluate on item to get a string to compare with
|
* The expression to evaluate on item to get a string to compare with.
|
||||||
*/
|
*/
|
||||||
properties[PROP_EXPRESSION] =
|
properties[PROP_EXPRESSION] =
|
||||||
gtk_param_spec_expression ("expression",
|
gtk_param_spec_expression ("expression",
|
||||||
@ -254,9 +259,9 @@ gtk_string_filter_class_init (GtkStringFilterClass *class)
|
|||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GtkStringFilter:ignore-case:
|
* GtkStringFilter:ignore-case: (attributes org.gtk.Property.get=gtk_string_filter_get_ignore_case org.gtk.Property.set=gtk_string_filter_set_ignore_case)
|
||||||
*
|
*
|
||||||
* If matching is case sensitive
|
* If matching is case sensitive.
|
||||||
*/
|
*/
|
||||||
properties[PROP_IGNORE_CASE] =
|
properties[PROP_IGNORE_CASE] =
|
||||||
g_param_spec_boolean ("ignore-case",
|
g_param_spec_boolean ("ignore-case",
|
||||||
@ -266,9 +271,9 @@ gtk_string_filter_class_init (GtkStringFilterClass *class)
|
|||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GtkStringFilter:match-mode:
|
* GtkStringFilter:match-mode: (attributes org.gtk.Property.get=gtk_string_filter_get_match_mode org.gtk.Property.set=gtk_string_filter_set_match_mode)
|
||||||
*
|
*
|
||||||
* If exact matches are necessary or if substrings are allowed
|
* If exact matches are necessary or if substrings are allowed.
|
||||||
*/
|
*/
|
||||||
properties[PROP_MATCH_MODE] =
|
properties[PROP_MATCH_MODE] =
|
||||||
g_param_spec_enum ("match-mode",
|
g_param_spec_enum ("match-mode",
|
||||||
@ -279,9 +284,9 @@ gtk_string_filter_class_init (GtkStringFilterClass *class)
|
|||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GtkStringFilter:search:
|
* GtkStringFilter:search: (attributes org.gtk.Property.get=gtk_string_filter_get_search org.gtk.Property.set=gtk_string_filter_set_search)
|
||||||
*
|
*
|
||||||
* The search term
|
* The search term.
|
||||||
*/
|
*/
|
||||||
properties[PROP_SEARCH] =
|
properties[PROP_SEARCH] =
|
||||||
g_param_spec_string ("search",
|
g_param_spec_string ("search",
|
||||||
@ -311,8 +316,8 @@ gtk_string_filter_init (GtkStringFilter *self)
|
|||||||
* You will want to set up the filter by providing a string to search for
|
* You will want to set up the filter by providing a string to search for
|
||||||
* and by providing a property to look up on the item.
|
* and by providing a property to look up on the item.
|
||||||
*
|
*
|
||||||
* Returns: a new #GtkStringFilter
|
* Returns: a new `GtkStringFilter`
|
||||||
**/
|
*/
|
||||||
GtkStringFilter *
|
GtkStringFilter *
|
||||||
gtk_string_filter_new (GtkExpression *expression)
|
gtk_string_filter_new (GtkExpression *expression)
|
||||||
{
|
{
|
||||||
@ -328,12 +333,12 @@ gtk_string_filter_new (GtkExpression *expression)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gtk_string_filter_get_search:
|
* gtk_string_filter_get_search: (attributes org.gtk.Method.get_property=search)
|
||||||
* @self: a #GtkStringFilter
|
* @self: a `GtkStringFilter`
|
||||||
*
|
*
|
||||||
* Gets the search string set via gtk_string_filter_set_search().
|
* Gets the search term.
|
||||||
*
|
*
|
||||||
* Returns: (nullable) (transfer none): The search string
|
* Returns: (nullable) (transfer none): The search term
|
||||||
**/
|
**/
|
||||||
const char *
|
const char *
|
||||||
gtk_string_filter_get_search (GtkStringFilter *self)
|
gtk_string_filter_get_search (GtkStringFilter *self)
|
||||||
@ -344,13 +349,13 @@ gtk_string_filter_get_search (GtkStringFilter *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gtk_string_filter_set_search:
|
* gtk_string_filter_set_search: (attributes org.gtk.Method.set_property=search)
|
||||||
* @self: a #GtkStringFilter
|
* @self: a `GtkStringFilter`
|
||||||
* @search: (transfer none) (nullable): The string to search for
|
* @search: (transfer none) (nullable): The string to search for
|
||||||
* or %NULL to clear the search
|
* or %NULL to clear the search
|
||||||
*
|
*
|
||||||
* Sets the string to search for.
|
* Sets the string to search for.
|
||||||
**/
|
*/
|
||||||
void
|
void
|
||||||
gtk_string_filter_set_search (GtkStringFilter *self,
|
gtk_string_filter_set_search (GtkStringFilter *self,
|
||||||
const char *search)
|
const char *search)
|
||||||
@ -385,13 +390,13 @@ gtk_string_filter_set_search (GtkStringFilter *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gtk_string_filter_get_expression:
|
* gtk_string_filter_get_expression: (attributes org.gtk.Method.get_property=expression)
|
||||||
* @self: a #GtkStringFilter
|
* @self: a `GtkStringFilter`
|
||||||
*
|
*
|
||||||
* Gets the expression that the string filter uses to
|
* Gets the expression that the string filter uses to
|
||||||
* obtain strings from items.
|
* obtain strings from items.
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): a #GtkExpression
|
* Returns: (transfer none): a `GtkExpression`
|
||||||
*/
|
*/
|
||||||
GtkExpression *
|
GtkExpression *
|
||||||
gtk_string_filter_get_expression (GtkStringFilter *self)
|
gtk_string_filter_get_expression (GtkStringFilter *self)
|
||||||
@ -402,13 +407,14 @@ gtk_string_filter_get_expression (GtkStringFilter *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gtk_string_filter_set_expression:
|
* gtk_string_filter_set_expression: (attributes org.gtk.Method.set_property=expression)
|
||||||
* @self: a #GtkStringFilter
|
* @self: a `GtkStringFilter`
|
||||||
* @expression: a #GtkExpression
|
* @expression: a `GtkExpression`
|
||||||
*
|
*
|
||||||
* Sets the expression that the string filter uses to
|
* Sets the expression that the string filter uses to
|
||||||
* obtain strings from items. The expression must have
|
* obtain strings from items.
|
||||||
* a value type of #G_TYPE_STRING.
|
*
|
||||||
|
* The expression must have a value type of %G_TYPE_STRING.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gtk_string_filter_set_expression (GtkStringFilter *self,
|
gtk_string_filter_set_expression (GtkStringFilter *self,
|
||||||
@ -430,8 +436,8 @@ gtk_string_filter_set_expression (GtkStringFilter *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gtk_string_filter_get_ignore_case:
|
* gtk_string_filter_get_ignore_case: (attributes org.gtk.Method.get_property=ignore-case)
|
||||||
* @self: a #GtkStringFilter
|
* @self: a `GtkStringFilter`
|
||||||
*
|
*
|
||||||
* Returns whether the filter ignores case differences.
|
* Returns whether the filter ignores case differences.
|
||||||
*
|
*
|
||||||
@ -446,8 +452,8 @@ gtk_string_filter_get_ignore_case (GtkStringFilter *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gtk_string_filter_set_ignore_case:
|
* gtk_string_filter_set_ignore_case: (attributes org.gtk.Method.set_property=ignore-case)
|
||||||
* @self: a #GtkStringFilter
|
* @self: a `GtkStringFilter`
|
||||||
* @ignore_case: %TRUE to ignore case
|
* @ignore_case: %TRUE to ignore case
|
||||||
*
|
*
|
||||||
* Sets whether the filter ignores case differences.
|
* Sets whether the filter ignores case differences.
|
||||||
@ -474,8 +480,8 @@ gtk_string_filter_set_ignore_case (GtkStringFilter *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gtk_string_filter_get_match_mode:
|
* gtk_string_filter_get_match_mode: (attributes org.gtk.Method.get_property=match-mode)
|
||||||
* @self: a #GtkStringFilter
|
* @self: a `GtkStringFilter`
|
||||||
*
|
*
|
||||||
* Returns the match mode that the filter is using.
|
* Returns the match mode that the filter is using.
|
||||||
*
|
*
|
||||||
@ -490,8 +496,8 @@ gtk_string_filter_get_match_mode (GtkStringFilter *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gtk_string_filter_set_match_mode:
|
* gtk_string_filter_set_match_mode: (attributes org.gtk.Method.set_property=match-mode)
|
||||||
* @self: a #GtkStringFilter
|
* @self: a `GtkStringFilter`
|
||||||
* @mode: the new match mode
|
* @mode: the new match mode
|
||||||
*
|
*
|
||||||
* Sets the match mode for the filter.
|
* Sets the match mode for the filter.
|
||||||
@ -537,5 +543,3 @@ gtk_string_filter_set_match_mode (GtkStringFilter *self,
|
|||||||
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_MATCH_MODE]);
|
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_MATCH_MODE]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user