1 | #pragma once |
2 | |
3 | #include <gtk/gtk.h> |
4 | |
5 | G_BEGIN_DECLS |
6 | |
7 | |
8 | #define MATCH_TYPE_OBJECT (match_object_get_type ()) |
9 | #define MATCH_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MATCH_TYPE_OBJECT, MatchObject)) |
10 | #define MATCH_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MATCH_TYPE_OBJECT)) |
11 | |
12 | typedef struct _MatchObject MatchObject; |
13 | |
14 | GType match_object_get_type (void) G_GNUC_CONST; |
15 | |
16 | gpointer match_object_get_item (MatchObject *object); |
17 | const char * match_object_get_string (MatchObject *object); |
18 | guint match_object_get_match_start (MatchObject *object); |
19 | guint match_object_get_match_end (MatchObject *object); |
20 | guint match_object_get_score (MatchObject *object); |
21 | void match_object_set_match (MatchObject *object, |
22 | guint start, |
23 | guint end, |
24 | guint score); |
25 | |
26 | #define SUGGESTION_TYPE_ENTRY (suggestion_entry_get_type ()) |
27 | #define SUGGESTION_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SUGGESTION_TYPE_ENTRY, SuggestionEntry)) |
28 | #define SUGGESTION_IS_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SUGGESTION_TYPE_ENTRY)) |
29 | |
30 | typedef struct _SuggestionEntry SuggestionEntry; |
31 | |
32 | GType suggestion_entry_get_type (void) G_GNUC_CONST; |
33 | |
34 | GtkWidget* suggestion_entry_new (void); |
35 | |
36 | void suggestion_entry_set_model (SuggestionEntry *self, |
37 | GListModel *model); |
38 | GListModel * suggestion_entry_get_model (SuggestionEntry *self); |
39 | |
40 | void suggestion_entry_set_factory (SuggestionEntry *self, |
41 | GtkListItemFactory *factory); |
42 | GtkListItemFactory * |
43 | suggestion_entry_get_factory (SuggestionEntry *self); |
44 | |
45 | void suggestion_entry_set_use_filter (SuggestionEntry *self, |
46 | gboolean use_ilter); |
47 | gboolean suggestion_entry_get_use_filter (SuggestionEntry *self); |
48 | |
49 | void suggestion_entry_set_expression (SuggestionEntry *self, |
50 | GtkExpression *expression); |
51 | GtkExpression * suggestion_entry_get_expression (SuggestionEntry *self); |
52 | |
53 | void suggestion_entry_set_show_arrow (SuggestionEntry *self, |
54 | gboolean show_arrow); |
55 | gboolean suggestion_entry_get_show_arrow (SuggestionEntry *self); |
56 | |
57 | typedef void (* SuggestionEntryMatchFunc) (MatchObject *object, |
58 | const char *search, |
59 | gpointer user_data); |
60 | |
61 | void suggestion_entry_set_match_func (SuggestionEntry *self, |
62 | SuggestionEntryMatchFunc func, |
63 | gpointer user_data, |
64 | GDestroyNotify destroy); |
65 | |
66 | G_END_DECLS |
67 | |