It derives from <GObject>.
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 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 will emit the filter:changed signal to notify that previous filter results
are no longer valid and that items should be checked again via
filter:match?.
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.
However, in particular for large lists or complex search methods, it is
also possible to subclass <GtkFilter> and provide
one’s own filter.
parent-instanceNotifies all users of the filter that it has changed.
This emits the filter:changed
signal. Users of the filter should then check items again via
filter:match?.
Depending on the change parameter, not all items need to be
changed, but only some. Refer to the
<GtkFilterChange> documentation for details.
This function is intended for implementers of
<GtkFilter> subclasses and should not be called
from other functions.
Passed: a <GtkFilter>.
a filter
Passed: a <GtkFilterChange>, or one of its
symbols.
how the filter changed
Gets the known strictness of a filter.
If the strictness is not known, Gtk.FilterMatch.some is returned.
This value may change after emission of the filter:changed signal.
This function is meant purely for optimization purposes. Filters can
choose to omit implementing it, but
<GtkFilterListModel> uses it.
Passed: a <GtkFilter>.
a filter
Returned: a <GtkFilterMatch>.
the strictness of self
Checks if the given item is matched by the filter or not.
Passed: a <GtkFilter>.
a filter
Passed: a <GObject>.
The item to check
Returned: a boolean.
true if the filter matches the item
Connect a handler with (connect object filter:changed handler).
It is called as (handler self change).
Emitted whenever the filter changed.
Users of the filter should then check items again via filter:match?.
<GtkFilterListModel> handles this signal
automatically.
Depending on the change parameter, not all items need to be
checked, but only some. Refer to the
<GtkFilterChange> documentation for details.
Passed: a <GtkFilter>.
Passed: a <GtkFilterChange>.
how the filter changed
Gets the known strictness of a filter.
If the strictness is not known, Gtk.FilterMatch.some is returned.
This value may change after emission of the filter:changed signal.
This function is meant purely for optimization purposes. Filters can
choose to omit implementing it, but
<GtkFilterListModel> uses it.
To override it in a new class, give register-type #:vfuncs
`((get-strictness . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call:
<GtkFilter>, or a class that derives from it, or
its GType number.
Passed: a <GtkFilter>.
a filter
Returned: a <GtkFilterMatch>.
the strictness of self
Checks if the given item is matched by the filter or not.
To override it in a new class, give register-type #:vfuncs
`((match . ,procedure)). The procedure is called as (procedure
self item) ⇒ %return.
Passed: the class whose implementation to call:
<GtkFilter>, or a class that derives from it, or
its GType number.
Passed: a <GtkFilter>.
a filter
Passed, or left out: a <GObject>, or
#f.
The item to check
Returned: a boolean.
true if the filter matches the item