diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2014-01-03 00:27:20 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2014-01-03 00:27:20 +0000 |
commit | 5fe89ab13500120c4d365448e17642e7f9ce3fa8 (patch) | |
tree | 7ecc5c16ac842eaa471fd11a6a8edb9b85e33370 | |
parent | 8d82cd9963942cd9e78081c27639f69557ca4f08 (diff) | |
parent | bf8c88dbec9d66dadaa584d80702c1653fda1c08 (diff) | |
download | netsurf-5fe89ab13500120c4d365448e17642e7f9ce3fa8.tar.gz netsurf-5fe89ab13500120c4d365448e17642e7f9ce3fa8.tar.bz2 |
Merge branch 'master' of git://git.netsurf-browser.org/netsurf
-rw-r--r-- | riscos/gui/url_bar.c | 9 | ||||
-rw-r--r-- | riscos/hotlist.c | 5 | ||||
-rw-r--r-- | riscos/hotlist.h | 3 | ||||
-rw-r--r-- | riscos/window.c | 66 |
4 files changed, 44 insertions, 39 deletions
diff --git a/riscos/gui/url_bar.c b/riscos/gui/url_bar.c index 845f8b3e8..62956a9ab 100644 --- a/riscos/gui/url_bar.c +++ b/riscos/gui/url_bar.c @@ -1,6 +1,6 @@ /* * Copyright 2004, 2005 Richard Wilson <info@tinct.net> - * Copyright 2011 Stephen Fryatt <stevef@netsurf-browser.org> + * Copyright 2011-2013 Stephen Fryatt <stevef@netsurf-browser.org> * * This file is part of NetSurf, http://www.netsurf-browser.org/ * @@ -1013,9 +1013,9 @@ static void ro_gui_url_bar_set_hotlist(struct url_bar *url_bar, bool set) { if (url_bar == NULL || set == url_bar->hotlist.set) return; - + url_bar->hotlist.set = set; - + if (!url_bar->hidden) { xwimp_force_redraw(url_bar->window, url_bar->hotlist.extent.x0, @@ -1097,7 +1097,7 @@ bool ro_gui_url_bar_test_for_text_field_keypress(struct url_bar *url_bar, return false; /* Update hotlist indicator */ - + url = (const char *) url_bar->text_buffer; if (url != NULL && nsurl_create(url, &n) == NSERROR_OK) { ro_gui_url_bar_set_hotlist(url_bar, ro_gui_hotlist_has_page(n)); @@ -1278,4 +1278,3 @@ void ro_gui_url_bar_fini(void) hlcache_handle_release(url_bar_res[i].c); } } - diff --git a/riscos/hotlist.c b/riscos/hotlist.c index f47d05e9c..eeaddd00f 100644 --- a/riscos/hotlist.c +++ b/riscos/hotlist.c @@ -1,6 +1,6 @@ /* * Copyright 2004, 2005 Richard Wilson <info@tinct.net> - * Copyright 2010 Stephen Fryatt <stevef@netsurf-browser.org> + * Copyright 2010, 2013 Stephen Fryatt <stevef@netsurf-browser.org> * * This file is part of NetSurf, http://www.netsurf-browser.org/ * @@ -220,7 +220,7 @@ void ro_gui_hotlist_open(void) os_error *error; char command[2048]; - if (nsoption_bool(external_hotlists) && + if (nsoption_bool(external_hotlists) && nsoption_charp(external_hotlist_app) != NULL && *nsoption_charp(external_hotlist_app) != '\0') { snprintf(command, sizeof(command), "Filer_Run %s", @@ -732,4 +732,3 @@ void ro_gui_hotlist_url_drop(wimp_message *message, const char *url) nsurl_unref(nsurl); } #endif - diff --git a/riscos/hotlist.h b/riscos/hotlist.h index 4cb5a1ff3..70cb183c9 100644 --- a/riscos/hotlist.h +++ b/riscos/hotlist.h @@ -1,6 +1,6 @@ /* * Copyright 2006 Richard Wilson <info@tinct.net> - * Copyright 2010 Stephen Fryatt <stevef@netsurf-browser.org> + * Copyright 2010, 2013 Stephen Fryatt <stevef@netsurf-browser.org> * * This file is part of NetSurf, http://www.netsurf-browser.org/ * @@ -51,4 +51,3 @@ void ro_gui_hotlist_remove_page(nsurl *url); bool ro_gui_hotlist_has_page(nsurl *url); #endif - diff --git a/riscos/window.c b/riscos/window.c index f6b274a20..c314c748b 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -5,7 +5,7 @@ * Copyright 2004 Andrew Timmins <atimmins@blueyonder.co.uk> * Copyright 2005 Richard Wilson <info@tinct.net> * Copyright 2005 Adrian Lees <adrianl@users.sourceforge.net> - * Copyright 2010, 2011 Stephen Fryatt <stevef@netsurf-browser.org> + * Copyright 2010-2014 Stephen Fryatt <stevef@netsurf-browser.org> * * This file is part of NetSurf, http://www.netsurf-browser.org/ * @@ -1800,7 +1800,6 @@ bool ro_gui_window_keypress(wimp_key *key) struct gui_window *g; hlcache_handle *h; os_error *error; - wimp_pointer pointer; uint32_t c = (uint32_t) key->c; g = (struct gui_window *) ro_gui_wimp_event_get_user_data(key->w); @@ -1809,14 +1808,6 @@ bool ro_gui_window_keypress(wimp_key *key) h = g->bw->current_content; - error = xwimp_get_pointer_info(&pointer); - if (error) { - LOG(("xwimp_get_pointer_info: 0x%x: %s\n", - error->errnum, error->errmess)); - warn_user("WimpError", error->errmess); - return false; - } - /* First send the key to the browser window, eg. form fields. */ if ((unsigned)c < 0x20 || (0x7f <= c && c <= 0x9f) || @@ -1893,7 +1884,7 @@ bool ro_gui_window_keypress(wimp_key *key) bool ro_gui_window_toolbar_keypress(void *data, wimp_key *key) { - struct gui_window *g = (struct gui_window *) data; + struct gui_window *g = (struct gui_window *) data; if (g != NULL) return ro_gui_window_handle_local_keypress(g, key, true); @@ -1917,20 +1908,38 @@ bool ro_gui_window_toolbar_keypress(void *data, wimp_key *key) bool ro_gui_window_handle_local_keypress(struct gui_window *g, wimp_key *key, bool is_toolbar) { - hlcache_handle *h; - const char *toolbar_url; - float scale; - uint32_t c = (uint32_t) key->c; - wimp_scroll_direction xscroll = wimp_SCROLL_NONE; - wimp_scroll_direction yscroll = wimp_SCROLL_NONE; - nsurl *url; - nserror error; + hlcache_handle *h; + struct contextual_content cont; + os_error *ro_error; + wimp_pointer pointer; + os_coord pos; + const char *toolbar_url; + float scale; + uint32_t c = (uint32_t) key->c; + wimp_scroll_direction xscroll = wimp_SCROLL_NONE; + wimp_scroll_direction yscroll = wimp_SCROLL_NONE; + nsurl *url; + nserror error; if (g == NULL) return false; + ro_error = xwimp_get_pointer_info(&pointer); + if (ro_error) { + LOG(("xwimp_get_pointer_info: 0x%x: %s\n", + ro_error->errnum, ro_error->errmess)); + warn_user("WimpError", ro_error->errmess); + return false; + } + + if (!ro_gui_window_to_window_pos(g, pointer.pos.x, pointer.pos.y, &pos)) + return false; + + h = g->bw->current_content; + browser_window_get_contextual_content(g->bw, pos.x, pos.y, &cont); + switch (c) { case IS_WIMP_KEY + wimp_KEY_F1: /* Help. */ { @@ -2015,7 +2024,7 @@ bool ro_gui_window_handle_local_keypress(struct gui_window *g, wimp_key *key, return true; case IS_WIMP_KEY + wimp_KEY_F8: /* View source */ - ro_gui_view_source(h); + ro_gui_view_source((cont.main != NULL) ? cont.main : h); return true; case IS_WIMP_KEY + wimp_KEY_F9: @@ -2848,10 +2857,10 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, error = nsurl_create(current_menu_url, &url); if (error == NSERROR_OK) { error = browser_window_navigate(bw, - url, - hlcache_handle_get_url(h), - BROWSER_WINDOW_DOWNLOAD | - BROWSER_WINDOW_VERIFIABLE, + url, + hlcache_handle_get_url(h), + BROWSER_WINDOW_DOWNLOAD | + BROWSER_WINDOW_VERIFIABLE, NULL, NULL, NULL); @@ -3035,12 +3044,12 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, } break; case BROWSER_WINDOW_STAGGER: - nsoption_set_bool(window_stagger, + nsoption_set_bool(window_stagger, !nsoption_bool(window_stagger)); ro_gui_save_options(); break; case BROWSER_WINDOW_COPY: - nsoption_set_bool(window_size_clone, + nsoption_set_bool(window_size_clone, !nsoption_bool(window_size_clone)); ro_gui_save_options(); break; @@ -3637,7 +3646,7 @@ void ro_gui_window_toolbar_click(void *data, case TOOLBAR_URL_ADJUST_HOTLIST: ro_gui_window_action_remove_bookmark(g); break; - + default: break; } @@ -3749,7 +3758,7 @@ void ro_gui_window_toolbar_click(void *data, warn_user(messages_get_errorcode(error), 0); } else { /* do it without loading the content - * into the new window + * into the new window */ ro_gui_window_navigate_up(new_bw->window, nsurl_access(hlcache_handle_get_url(h))); @@ -5255,4 +5264,3 @@ bool ro_gui_alt_pressed(void) xosbyte1(osbyte_SCAN_KEYBOARD, 2 ^ 0x80, 0, &alt); return (alt == 0xff); } - |