From 3afd9c97310d58c0c6588d18887244328590731e Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 7 May 2013 14:41:40 +0100 Subject: 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. --- render/html_internal.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'render/html_internal.h') diff --git a/render/html_internal.h b/render/html_internal.h index a78dc8f8a..b491f197a 100644 --- a/render/html_internal.h +++ b/render/html_internal.h @@ -161,6 +161,8 @@ typedef struct html_content { /** Context for free text search, or NULL if none */ struct search_context *search; + /** Search string or NULL */ + char *search_string; } html_content; @@ -210,8 +212,6 @@ void html_set_focus(html_content *html, html_focus_type focus_type, struct browser_window *html_get_browser_window(struct content *c); -struct search_context *html_get_search(struct content *c); -void html_set_search(struct content *c, struct search_context *s); /** * Complete conversion of an HTML document @@ -247,6 +247,10 @@ void html_mouse_action(struct content *c, struct browser_window *bw, bool html_keypress(struct content *c, uint32_t key); void html_overflow_scroll_callback(void *client_data, struct scrollbar_msg_data *scrollbar_data); +void html_search(struct content *c, + struct gui_search_callbacks *gui_callbacks, void *gui_data, + search_flags_t flags, const char *string); +void html_search_clear(struct content *c); /* in render/html_script.c */ -- cgit v1.2.3