summaryrefslogtreecommitdiff
path: root/content/handlers/html/interaction.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2020-05-10 23:22:29 +0100
committerVincent Sanders <vince@kyllikki.org>2020-05-10 23:22:29 +0100
commita8596a80aeb70acb05aba29f654df24210f50c19 (patch)
tree6bf35682734c56398567a346467340504b7f1b83 /content/handlers/html/interaction.c
parente72ca36863f4b05e5e641e77472f0f7fef97d906 (diff)
downloadnetsurf-a8596a80aeb70acb05aba29f654df24210f50c19.tar.gz
netsurf-a8596a80aeb70acb05aba29f654df24210f50c19.tar.bz2
move free text search general interface to content.
needs additional cleanup to call content through handler table to perform searches.
Diffstat (limited to 'content/handlers/html/interaction.c')
-rw-r--r--content/handlers/html/interaction.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/content/handlers/html/interaction.c b/content/handlers/html/interaction.c
index 3f401bd11..8ae5144c0 100644
--- a/content/handlers/html/interaction.c
+++ b/content/handlers/html/interaction.c
@@ -41,6 +41,7 @@
#include "netsurf/layout.h"
#include "netsurf/keypress.h"
#include "content/hlcache.h"
+#include "content/textsearch.h"
#include "desktop/frames.h"
#include "desktop/scrollbar.h"
#include "desktop/selection.h"
@@ -55,7 +56,6 @@
#include "html/form_internal.h"
#include "html/private.h"
#include "html/imagemap.h"
-#include "html/search.h"
#include "html/interaction.h"
/**
@@ -1602,17 +1602,18 @@ bool html_keypress(struct content *c, uint32_t key)
* Handle search.
*
* \param c content of type HTML
- * \param context front end private data
+ * \param fe_ctx front end private data
* \param flags search flags
* \param string search string
*/
void
html_search(struct content *c,
- void *context,
+ void *fe_ctx,
search_flags_t flags,
const char *string)
{
html_content *html = (html_content *)c;
+ nserror res;
assert(c != NULL);
@@ -1621,7 +1622,7 @@ html_search(struct content *c,
(strcmp(string, html->search_string) == 0) &&
(html->search != NULL)) {
/* Continue prev. search */
- search_step(html->search, flags, string);
+ content_textsearch_step(html->search, flags, string);
} else if (string != NULL) {
/* New search */
@@ -1631,16 +1632,16 @@ html_search(struct content *c,
return;
if (html->search != NULL) {
- search_destroy_context(html->search);
+ content_textsearch_destroy(html->search);
html->search = NULL;
}
- html->search = search_create_context(c, CONTENT_HTML, context);
-
- if (html->search == NULL)
+ res = content_textsearch_create(c, fe_ctx, &html->search);
+ if (res != NSERROR_OK) {
return;
+ }
- search_step(html->search, flags, string);
+ content_textsearch_step(html->search, flags, string);
} else {
/* Clear search */
@@ -1653,9 +1654,9 @@ html_search(struct content *c,
/**
- * Terminate a search.
+ * Terminate a text search.
*
- * \param c content of type HTML
+ * \param c content of type HTML
*/
void html_search_clear(struct content *c)
{
@@ -1667,7 +1668,7 @@ void html_search_clear(struct content *c)
html->search_string = NULL;
if (html->search != NULL) {
- search_destroy_context(html->search);
+ content_textsearch_destroy(html->search);
}
html->search = NULL;
}