diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2013-05-07 14:41:40 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2013-05-07 14:41:40 +0100 |
commit | 3afd9c97310d58c0c6588d18887244328590731e (patch) | |
tree | 133917633f801613e8742d8b313faee3c4f47e71 /render/html.c | |
parent | 0647d69a8b8663fcc09af118dde6b256624fe232 (diff) | |
download | netsurf-3afd9c97310d58c0c6588d18887244328590731e.tar.gz netsurf-3afd9c97310d58c0c6588d18887244328590731e.tar.bz2 |
Remove search context from browser window, simplify search interface for front ends.
Added content interface for search.
Removed bw->cur_search search context. Desktop layer now does nothing
except pass search requests from front end onto the bw's current_content
via the content interface.
Search API reduced to a pair of functions at each level:
{desktop|content|html|textplain}_search
and
{desktop|content|html|textplain}_search_clear
Updated front ends to use simplified search API. Only tested GTK and RO builds.
These confine the search stuff to render/. However search still uses struct
selection. The handling for which is still spread over desktop/ and render/.
Also the render/search code itself still fiddles inside html and textplain
privates.
Diffstat (limited to 'render/html.c')
-rw-r--r-- | render/html.c | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/render/html.c b/render/html.c index 1ff1c7cc7..364083bae 100644 --- a/render/html.c +++ b/render/html.c @@ -330,6 +330,8 @@ html_create_html_data(html_content *c, const http_parameter *params) c->selection_owner.none = true; c->focus_type = HTML_FOCUS_SELF; c->focus_owner.self = true; + c->search = NULL; + c->search_string = NULL; c->scripts_count = 0; c->scripts = NULL; c->jscontext = NULL; @@ -2006,36 +2008,6 @@ static void html_debug_dump(struct content *c, FILE *f) } -/** - * Set an HTML content's search context - * - * \param c content of type html - * \param s search context, or NULL if none - */ - -void html_set_search(struct content *c, struct search_context *s) -{ - html_content *html = (html_content *) c; - - html->search = s; -} - - -/** - * Return an HTML content's search context - * - * \param c content of type html - * \return content's search context, or NULL if none - */ - -struct search_context *html_get_search(struct content *c) -{ - html_content *html = (html_content *) c; - - return html->search; -} - - #if ALWAYS_DUMP_FRAMESET /** * Print a frameset tree to stderr. @@ -2276,6 +2248,8 @@ static const content_handler html_content_handler = { .get_contextual_content = html_get_contextual_content, .scroll_at_point = html_scroll_at_point, .drop_file_at_point = html_drop_file_at_point, + .search = html_search, + .search_clear = html_search_clear, .debug_dump = html_debug_dump, .clone = html_clone, .type = html_content_type, |