diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2014-08-26 18:16:03 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2014-08-26 18:16:03 +0100 |
commit | 5cd61f2ef4449b43ffd9348fa9c72cbbf0abb5a7 (patch) | |
tree | d0bfdbea78a8885d7c7204b34d3d0beba359b16c | |
parent | b7b70a3ca89f2bce90dac363967b31477794b157 (diff) | |
download | netsurf-5cd61f2ef4449b43ffd9348fa9c72cbbf0abb5a7.tar.gz netsurf-5cd61f2ef4449b43ffd9348fa9c72cbbf0abb5a7.tar.bz2 |
Avoid include of browser_private.h
-rw-r--r-- | riscos/search.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/riscos/search.c b/riscos/search.c index 23c148028..bf070a965 100644 --- a/riscos/search.c +++ b/riscos/search.c @@ -32,7 +32,7 @@ #include "content/hlcache.h" #include "desktop/browser.h" #include "desktop/gui.h" -#include "desktop/browser_private.h" +#include "desktop/browser.h" #include "desktop/search.h" #include "utils/log.h" #include "utils/messages.h" @@ -259,22 +259,33 @@ bool ro_gui_search_prepare_menu(void) return true; } -/** - * Open the search dialog - * - * \param bw the browser window to search - */ -void ro_gui_search_prepare(struct browser_window *bw) +bool ro_gui_search_bw_searchable(struct browser_window *bw) { hlcache_handle *h; assert(bw != NULL); - h = bw->current_content; + h = browser_window_get_content(bw); /* only handle html/textplain contents */ + /* TODO: Should have content_is_searchable() api */ if ((!h) || (content_get_type(h) != CONTENT_HTML && content_get_type(h) != CONTENT_TEXTPLAIN)) + return false; + + return true; +} + + +/** + * Open the search dialog + * + * \param bw the browser window to search + */ +void ro_gui_search_prepare(struct browser_window *bw) +{ + /* only handle searchable contents */ + if (!ro_gui_search_bw_searchable(bw)) return; /* if the search dialogue is reopened over a new window, we may |