summaryrefslogtreecommitdiff
path: root/content/handlers/html/interaction.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2020-05-12 21:09:41 +0100
committerVincent Sanders <vince@kyllikki.org>2020-05-12 21:09:41 +0100
commit3c7538a9f906e38e78be0300049f9e49839d7fd7 (patch)
tree318e996390f05db954969b2eb9cb71760f118e75 /content/handlers/html/interaction.c
parenta8596a80aeb70acb05aba29f654df24210f50c19 (diff)
downloadnetsurf-3c7538a9f906e38e78be0300049f9e49839d7fd7.tar.gz
netsurf-3c7538a9f906e38e78be0300049f9e49839d7fd7.tar.bz2
hoist common text search out of content handlers
Diffstat (limited to 'content/handlers/html/interaction.c')
-rw-r--r--content/handlers/html/interaction.c76
1 files changed, 0 insertions, 76 deletions
diff --git a/content/handlers/html/interaction.c b/content/handlers/html/interaction.c
index 8ae5144c0..f2eae70df 100644
--- a/content/handlers/html/interaction.c
+++ b/content/handlers/html/interaction.c
@@ -1599,82 +1599,6 @@ bool html_keypress(struct content *c, uint32_t key)
/**
- * Handle search.
- *
- * \param c content of type HTML
- * \param fe_ctx front end private data
- * \param flags search flags
- * \param string search string
- */
-void
-html_search(struct content *c,
- void *fe_ctx,
- search_flags_t flags,
- const char *string)
-{
- html_content *html = (html_content *)c;
- nserror res;
-
- assert(c != NULL);
-
- if ((string != NULL) &&
- (html->search_string != NULL) &&
- (strcmp(string, html->search_string) == 0) &&
- (html->search != NULL)) {
- /* Continue prev. search */
- content_textsearch_step(html->search, flags, string);
-
- } else if (string != NULL) {
- /* New search */
- free(html->search_string);
- html->search_string = strdup(string);
- if (html->search_string == NULL)
- return;
-
- if (html->search != NULL) {
- content_textsearch_destroy(html->search);
- html->search = NULL;
- }
-
- res = content_textsearch_create(c, fe_ctx, &html->search);
- if (res != NSERROR_OK) {
- return;
- }
-
- content_textsearch_step(html->search, flags, string);
-
- } else {
- /* Clear search */
- html_search_clear(c);
-
- free(html->search_string);
- html->search_string = NULL;
- }
-}
-
-
-/**
- * Terminate a text search.
- *
- * \param c content of type HTML
- */
-void html_search_clear(struct content *c)
-{
- html_content *html = (html_content *)c;
-
- assert(c != NULL);
-
- free(html->search_string);
- html->search_string = NULL;
-
- if (html->search != NULL) {
- content_textsearch_destroy(html->search);
- }
- html->search = NULL;
-}
-
-
-/**
* Callback for in-page scrollbars.
*/
void html_overflow_scroll_callback(void *client_data,