From b4b97d90032e7c52f1888b1b32132e30c0bd4094 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 16 Oct 2014 09:22:05 +0100 Subject: Chage favicon set APIs to take gui_window rather than hlcache_handle. Let the front end pass its own types around, rather than core ones. This removes one "bw->current_content" from window.c. Now the current content is only accessed where its needed, in the favicon handler, and it is accessed via the appropriate API. --- riscos/gui/url_bar.c | 7 +++++-- riscos/gui/url_bar.h | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'riscos/gui') diff --git a/riscos/gui/url_bar.c b/riscos/gui/url_bar.c index d89004856..76a63aa2d 100644 --- a/riscos/gui/url_bar.c +++ b/riscos/gui/url_bar.c @@ -1164,13 +1164,16 @@ bool ro_gui_url_bar_test_for_text_field_keypress(struct url_bar *url_bar, /* This is an exported interface documented in url_bar.h */ bool ro_gui_url_bar_set_site_favicon(struct url_bar *url_bar, - struct hlcache_handle *h) + struct gui_window *g) { + struct hlcache_handle *h content_type type = CONTENT_NONE; - if (url_bar == NULL) + if (url_bar == NULL || g == NULL) return false; + h = browser_window_get_content(g->bw); + if (h != NULL) type = content_get_type(h); diff --git a/riscos/gui/url_bar.h b/riscos/gui/url_bar.h index 0f41a4b01..8e8d291ac 100644 --- a/riscos/gui/url_bar.h +++ b/riscos/gui/url_bar.h @@ -305,15 +305,15 @@ bool ro_gui_url_bar_set_site_favicon(struct url_bar *url_bar, /** * Set the favicon to a RISC OS filetype sprite based on the type of the - * supplied content. + * content within the supplied window. * * \param *url_bar The URL Bar to update the favicon on. - * \param *h The content to use. + * \param *g The window with the content to use. * \return true if successful; else false. */ bool ro_gui_url_bar_set_content_favicon(struct url_bar *url_bar, - struct hlcache_handle *h); + struct gui_window *g); /** -- cgit v1.2.3