From f308e319f3170a2949624e211adf75002ee5d3f1 Mon Sep 17 00:00:00 2001 From: defanor Date: Sat, 24 Aug 2019 13:38:44 +0300 Subject: 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. --- src/browserbox.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/browserbox.h') diff --git a/src/browserbox.h b/src/browserbox.h index 5016c67..9af6f83 100644 --- a/src/browserbox.h +++ b/src/browserbox.h @@ -89,6 +89,15 @@ struct _BuilderState typedef struct _BrowserBox BrowserBox; typedef struct _BrowserBoxClass BrowserBoxClass; +typedef enum _BTSState BTSState; +enum _BTSState { + SEARCH_INACTIVE, + SEARCH_FORWARD, + SEARCH_BACKWARD +}; + +#define MAX_SEARCH_STRING_LEN 512 + struct _BrowserBox { BlockBox parent_instance; @@ -100,6 +109,8 @@ struct _BrowserBox GList *forms; GList *history; GList *history_position; + BTSState search_state; + gchar search_string[MAX_SEARCH_STRING_LEN + 1]; GtkStack *tabs; /* GHashTable *word_cache; */ }; @@ -125,6 +136,8 @@ void document_request_sm (BrowserBox *bb, SoupMessage *sm); void document_request (BrowserBox *bb, SoupURI *uri); gboolean history_back (BrowserBox *bb); gboolean history_forward (BrowserBox *bb); +void browser_box_set_status(BrowserBox *bb, const gchar *status_str); +void browser_box_display_search_status (BrowserBox *bb); GHashTable *word_cache; -- cgit v1.2.3