diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2014-02-08 22:43:54 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2014-02-08 22:43:54 +0000 |
commit | 3d7cd77982d79ff798a92ebe7f3c0b2a52042cdf (patch) | |
tree | 43fb131d4c23d6d9f177c135291c4ad8ea102953 /riscos | |
parent | 2cd2e5b0541e7067c908e88f446b7cc56095253b (diff) | |
download | netsurf-3d7cd77982d79ff798a92ebe7f3c0b2a52042cdf.tar.gz netsurf-3d7cd77982d79ff798a92ebe7f3c0b2a52042cdf.tar.bz2 |
Simplify local history interface.
Diffstat (limited to 'riscos')
-rw-r--r-- | riscos/history.c | 2 | ||||
-rw-r--r-- | riscos/window.c | 72 |
2 files changed, 9 insertions, 65 deletions
diff --git a/riscos/history.c b/riscos/history.c index a4aedc6b5..959f4ce38 100644 --- a/riscos/history.c +++ b/riscos/history.c @@ -348,7 +348,7 @@ bool ro_gui_history_click(wimp_pointer *pointer) x = (pointer->pos.x - (state.visible.x0 - state.xscroll)) / 2; y = -(pointer->pos.y - (state.visible.y1 - state.yscroll)) / 2; - history_click(history_bw, history_current, x, y, + history_click(history_current, x, y, pointer->buttons == wimp_CLICK_ADJUST); return true; diff --git a/riscos/window.c b/riscos/window.c index 83fa1eed9..37a5e7b1d 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -135,8 +135,6 @@ static bool ro_gui_window_navigate_up(struct gui_window *g, const char *url); static void ro_gui_window_action_home(struct gui_window *g); static void ro_gui_window_action_new_window(struct gui_window *g); static void ro_gui_window_action_local_history(struct gui_window *g); -static void ro_gui_window_action_navigate_back_new(struct gui_window *g); -static void ro_gui_window_action_navigate_forward_new(struct gui_window *g); static void ro_gui_window_action_save(struct gui_window *g, gui_save_type save_type); static void ro_gui_window_action_search(struct gui_window *g); @@ -2944,11 +2942,11 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, break; case BROWSER_NAVIGATE_BACK: if (bw != NULL && bw->history != NULL) - history_back(bw, bw->history); + history_back(bw->history, false); break; case BROWSER_NAVIGATE_FORWARD: if (bw != NULL && bw->history != NULL) - history_forward(bw, bw->history); + history_forward(bw->history, false); break; case BROWSER_NAVIGATE_UP: if (bw != NULL && h != NULL) @@ -3642,20 +3640,22 @@ void ro_gui_window_toolbar_click(void *data, switch (action.button) { case TOOLBAR_BUTTON_BACK: if (g->bw != NULL && g->bw->history != NULL) - history_back(g->bw, g->bw->history); + history_back(g->bw->history, false); break; case TOOLBAR_BUTTON_BACK_NEW: - ro_gui_window_action_navigate_back_new(g); + if (g->bw != NULL && g->bw->history != NULL) + history_back(g->bw->history, true); break; case TOOLBAR_BUTTON_FORWARD: if (g->bw != NULL && g->bw->history != NULL) - history_forward(g->bw, g->bw->history); + history_forward(g->bw->history, false); break; case TOOLBAR_BUTTON_FORWARD_NEW: - ro_gui_window_action_navigate_forward_new(g); + if (g->bw != NULL && g->bw->history != NULL) + history_forward(g->bw->history, true); break; case TOOLBAR_BUTTON_STOP: @@ -4099,62 +4099,6 @@ void ro_gui_window_action_home(struct gui_window *g) /** - * Navigate back from a browser window into a new window. - * - * \param *g The browser window to act on. - */ - -void ro_gui_window_action_navigate_back_new(struct gui_window *g) -{ - struct browser_window *new_bw; - nserror error; - - if (g == NULL || g->bw == NULL) - return; - - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE, - NULL, - NULL, - g->bw, - &new_bw); - - if (error != NSERROR_OK) { - warn_user(messages_get_errorcode(error), 0); - } else { - history_back(new_bw, new_bw->history); - } -} - - -/** - * Navigate forward from a browser window into a new window. - * - * \param *g The browser window to act on. - */ - -void ro_gui_window_action_navigate_forward_new(struct gui_window *g) -{ - struct browser_window *new_bw; - nserror error; - - if (g == NULL || g->bw == NULL) - return; - - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE, - NULL, - NULL, - g->bw, - &new_bw); - - if (error != NSERROR_OK) { - warn_user(messages_get_errorcode(error), 0); - } else { - history_forward(new_bw, new_bw->history); - } -} - - -/** * Open a new browser window. * * \param *g The browser window to act on. |