diff options
author | defanor <defanor@uberspace.net> | 2019-08-24 13:38:44 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2019-08-24 13:38:44 +0300 |
commit | f308e319f3170a2949624e211adf75002ee5d3f1 (patch) | |
tree | d086626c17e1a88860dcf44c3bbb5f74ce41d869 /src/documentbox.h | |
parent | 2395d5ab1e83507530fdbd675c917d0c55187e66 (diff) |
Introduce incremental text search
It is quite rough and should be refined, but as with most of the other
features, introducing it at this stage primarily to ensure that it
will not require major changes.
Diffstat (limited to 'src/documentbox.h')
-rw-r--r-- | src/documentbox.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/documentbox.h b/src/documentbox.h index 351471b..64a2320 100644 --- a/src/documentbox.h +++ b/src/documentbox.h @@ -46,14 +46,32 @@ struct _SelectionState gboolean selecting; }; +typedef enum _TSState TSState; +enum _TSState { + START, + LOOKING, + FOUND +}; + +typedef struct _TextSearchState TextSearchState; +struct _TextSearchState +{ + InlineBox *ib; + gint start; + gint end; + const gchar *str; + gboolean forward; + TSState state; +}; + struct _DocumentBox { GtkScrolledWindow parent_instance; GtkEventBox *evbox; GList *links; SelectionState sel; + TextSearchState search; GdkWindow *event_window; - /* GList *forms; */ }; struct _DocumentBoxClass @@ -63,7 +81,7 @@ struct _DocumentBoxClass GType document_box_get_type(void) G_GNUC_CONST; DocumentBox *document_box_new(void); - +gboolean document_box_find (DocumentBox *db, const gchar *str); G_END_DECLS |