Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gtkfilter.h
Go to the documentation of this file.
1/*
2 * Copyright © 2019 Benjamin Otte
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Authors: Benjamin Otte <otte@gnome.org>
18 */
19
20#pragma once
21
22#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
23#error "Only <gtk/gtk.h> can be included directly."
24#endif
25
26#include <gdk/gdk.h>
27
29
30/**
31 * GtkFilterMatch:
32 * @GTK_FILTER_MATCH_SOME: The filter matches some items,
33 * gtk_filter_match() may return %TRUE or %FALSE
34 * @GTK_FILTER_MATCH_NONE: The filter does not match any item,
35 * gtk_filter_match() will always return %FALSE.
36 * @GTK_FILTER_MATCH_ALL: The filter matches all items,
37 * gtk_filter_match() will alays return %TRUE.
38 *
39 * Describes the known strictness of a filter.
40 *
41 * Note that for filters where the strictness is not known,
42 * %GTK_FILTER_MATCH_SOME is always an acceptable value,
43 * even if a filter does match all or no items.
44 */
50
51/**
52 * GtkFilterChange:
53 * @GTK_FILTER_CHANGE_DIFFERENT: The filter change cannot be
54 * described with any of the other enumeration values.
55 * @GTK_FILTER_CHANGE_LESS_STRICT: The filter is less strict than
56 * it was before: All items that it used to return %TRUE for
57 * still return %TRUE, others now may, too.
58 * @GTK_FILTER_CHANGE_MORE_STRICT: The filter is more strict than
59 * it was before: All items that it used to return %FALSE for
60 * still return %FALSE, others now may, too.
61 *
62 * Describes changes in a filter in more detail and allows objects
63 * using the filter to optimize refiltering items.
64 *
65 * If you are writing an implementation and are not sure which
66 * value to pass, %GTK_FILTER_CHANGE_DIFFERENT is always a correct
67 * choice.
68 */
74
75#define GTK_TYPE_FILTER (gtk_filter_get_type ())
76
78G_DECLARE_DERIVABLE_TYPE (GtkFilter, gtk_filter, GTK, FILTER, GObject)
79
81{
83
84 gboolean (* match) (GtkFilter *self,
85 gpointer item);
86
87 /* optional */
88 GtkFilterMatch (* get_strictness) (GtkFilter *self);
89
90 /* Padding for future expansion */
91 void (*_gtk_reserved1) (void);
92 void (*_gtk_reserved2) (void);
93 void (*_gtk_reserved3) (void);
94 void (*_gtk_reserved4) (void);
95 void (*_gtk_reserved5) (void);
96 void (*_gtk_reserved6) (void);
97 void (*_gtk_reserved7) (void);
98 void (*_gtk_reserved8) (void);
99};
100
102gboolean gtk_filter_match (GtkFilter *self,
103 gpointer item);
106
107/* for filter implementations */
109void gtk_filter_changed (GtkFilter *self,
110 GtkFilterChange change);
111
112
114
#define GDK_AVAILABLE_IN_ALL
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
GDK_AVAILABLE_IN_ALL GtkFilterMatch gtk_filter_get_strictness(GtkFilter *self)
GDK_AVAILABLE_IN_ALL gboolean gtk_filter_match(GtkFilter *self, gpointer item)
GtkFilterMatch
Definition gtkfilter.h:45
@ GTK_FILTER_MATCH_NONE
Definition gtkfilter.h:47
@ GTK_FILTER_MATCH_ALL
Definition gtkfilter.h:48
@ GTK_FILTER_MATCH_SOME
Definition gtkfilter.h:46
GDK_AVAILABLE_IN_ALL void gtk_filter_changed(GtkFilter *self, GtkFilterChange change)
GtkFilterChange
Definition gtkfilter.h:69
@ GTK_FILTER_CHANGE_MORE_STRICT
Definition gtkfilter.h:72
@ GTK_FILTER_CHANGE_LESS_STRICT
Definition gtkfilter.h:71
@ GTK_FILTER_CHANGE_DIFFERENT
Definition gtkfilter.h:70
#define G_DECLARE_DERIVABLE_TYPE(ModuleObjName, module_obj_name, MODULE, OBJ_NAME, ParentName)
Definition gtype.h:1705
gint gboolean
Definition gtypes.h:56
void * gpointer
Definition gtypes.h:109
static const char * match(MatchState *ms, const char *s, const char *p)
GObjectClass parent_class
Definition gtkfilter.h:82