summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-02-15 18:43:59 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2014-02-15 18:44:50 +0000
commita38a63a37ef8bdc62661d398fb485296c0bed470 (patch)
tree11a1279537f28f51de2fca4c410ecc9b96629a3d /riscos
parenta55957b1c975e96a60d96d9a70c3b64bf02f96fd (diff)
downloadnetsurf-a38a63a37ef8bdc62661d398fb485296c0bed470.tar.gz
netsurf-a38a63a37ef8bdc62661d398fb485296c0bed470.tar.bz2
Make history internal to browser_window module.
Diffstat (limited to 'riscos')
-rw-r--r--riscos/gui.h3
-rw-r--r--riscos/history.c25
-rw-r--r--riscos/menus.c1
-rw-r--r--riscos/window.c34
4 files changed, 29 insertions, 34 deletions
diff --git a/riscos/gui.h b/riscos/gui.h
index c201ab091..dbf6373c0 100644
--- a/riscos/gui.h
+++ b/riscos/gui.h
@@ -169,8 +169,7 @@ void gui_create_form_select_menu(struct browser_window *bw, struct form_control
/* in history.c */
void ro_gui_history_init(void);
-void ro_gui_history_open(struct browser_window *bw, struct history *history,
- bool pointer);
+void ro_gui_history_open(struct gui_window *g, bool pointer);
/* in filetype.c */
const char *fetch_filetype(const char *unix_path);
diff --git a/riscos/history.c b/riscos/history.c
index 959f4ce38..c5bdfcb62 100644
--- a/riscos/history.c
+++ b/riscos/history.c
@@ -27,10 +27,9 @@
#include <stdlib.h>
#include <string.h>
#include "oslib/wimp.h"
-#include "desktop/local_history.h"
+#include "desktop/browser_history.h"
#include "desktop/plotters.h"
#include "riscos/dialog.h"
-#include "desktop/browser_private.h"
#include "utils/nsoption.h"
#include "riscos/gui.h"
#include "riscos/mouse.h"
@@ -43,7 +42,6 @@
static struct browser_window *history_bw;
-static struct history *history_current = 0;
/* Last position of mouse in window. */
static int mouse_x = 0;
/* Last position of mouse in window. */
@@ -82,20 +80,20 @@ void ro_gui_history_init(void)
* \param at_pointer open the window at the pointer
*/
-void ro_gui_history_open(struct browser_window *bw,
- struct history *history, bool at_pointer)
+void ro_gui_history_open(struct gui_window *g, bool at_pointer)
{
+ struct browser_window *bw;
int width, height;
os_box box = {0, 0, 0, 0};
wimp_window_state state;
os_error *error;
- assert(history);
-
- history_current = history;
+ assert(g != NULL);
+ assert(g->bw != NULL);
+ bw = g->bw;
history_bw = bw;
- history_size(history, &width, &height);
+ browser_window_history_size(bw, &width, &height);
width *= 2;
height *= 2;
@@ -132,8 +130,7 @@ void ro_gui_history_open(struct browser_window *bw,
return;
}
- ro_gui_dialog_open_persistent(bw->window->window, history_window,
- at_pointer);
+ ro_gui_dialog_open_persistent(g->window, history_window, at_pointer);
}
@@ -161,7 +158,7 @@ void ro_gui_history_redraw(wimp_draw *redraw)
while (more) {
ro_plot_origin_x = redraw->box.x0 - redraw->xscroll;
ro_plot_origin_y = redraw->box.y1 - redraw->yscroll;
- history_redraw(history_current, &ctx);
+ browser_window_history_redraw(history_bw, &ctx);
error = xwimp_get_rectangle(redraw, &more);
if (error) {
LOG(("xwimp_get_rectangle: 0x%x: %s",
@@ -237,7 +234,7 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer, void *data)
x = (pointer->pos.x - (state.visible.x0 - state.xscroll)) / 2;
y = -(pointer->pos.y - (state.visible.y1 - state.yscroll)) / 2;
- url = history_position_url(history_current, x, y);
+ url = browser_window_history_position_url(history_bw, x, y);
if (!url) {
/* not over a tree entry => close tooltip window. */
error = xwimp_close_window(dialog_tooltip);
@@ -348,7 +345,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_current, x, y,
+ browser_window_history_click(history_bw, x, y,
pointer->buttons == wimp_CLICK_ADJUST);
return true;
diff --git a/riscos/menus.c b/riscos/menus.c
index a0baca087..2ed06c37b 100644
--- a/riscos/menus.c
+++ b/riscos/menus.c
@@ -43,7 +43,6 @@
#include "desktop/cookie_manager.h"
#include "desktop/browser.h"
#include "desktop/gui.h"
-#include "desktop/local_history.h"
#include "desktop/netsurf.h"
#include "desktop/textinput.h"
diff --git a/riscos/window.c b/riscos/window.c
index bf0529805..771f3f5bb 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -53,11 +53,11 @@
#include "content/hlcache.h"
#include "content/urldb.h"
#include "css/css.h"
+#include "desktop/browser_history.h"
#include "desktop/browser_private.h"
#include "desktop/cookie_manager.h"
#include "desktop/scrollbar.h"
#include "desktop/frames.h"
-#include "desktop/local_history.h"
#include "desktop/mouse.h"
#include "desktop/plotters.h"
#include "desktop/textinput.h"
@@ -2404,9 +2404,9 @@ bool ro_gui_window_menu_prepare(wimp_w w, wimp_i i, wimp_menu *menu,
ro_gui_menu_set_entry_shaded(menu, HOTLIST_ADD_URL, h == NULL);
ro_gui_menu_set_entry_shaded(menu, HISTORY_SHOW_LOCAL,
- (bw == NULL || (bw->history == NULL) ||
- !(h != NULL || history_back_available(bw->history) ||
- history_forward_available(bw->history))));
+ (bw == NULL ||
+ !(h != NULL || browser_window_back_available(bw) ||
+ browser_window_forward_available(bw))));
/* Help Submenu */
@@ -2938,12 +2938,12 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu,
ro_gui_window_action_home(g);
break;
case BROWSER_NAVIGATE_BACK:
- if (bw != NULL && bw->history != NULL)
- history_back(bw->history, false);
+ if (bw != NULL)
+ browser_window_history_back(bw, false);
break;
case BROWSER_NAVIGATE_FORWARD:
- if (bw != NULL && bw->history != NULL)
- history_forward(bw->history, false);
+ if (bw != NULL)
+ browser_window_history_forward(bw, false);
break;
case BROWSER_NAVIGATE_UP:
if (bw != NULL && h != NULL)
@@ -3636,23 +3636,23 @@ 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->history, false);
+ if (g->bw != NULL)
+ browser_window_history_back(g->bw, false);
break;
case TOOLBAR_BUTTON_BACK_NEW:
- if (g->bw != NULL && g->bw->history != NULL)
- history_back(g->bw->history, true);
+ if (g->bw != NULL)
+ browser_window_history_back(g->bw, true);
break;
case TOOLBAR_BUTTON_FORWARD:
- if (g->bw != NULL && g->bw->history != NULL)
- history_forward(g->bw->history, false);
+ if (g->bw != NULL)
+ browser_window_history_forward(g->bw, false);
break;
case TOOLBAR_BUTTON_FORWARD_NEW:
- if (g->bw != NULL && g->bw->history != NULL)
- history_forward(g->bw->history, true);
+ if (g->bw != NULL)
+ browser_window_history_forward(g->bw, true);
break;
case TOOLBAR_BUTTON_STOP:
@@ -4127,7 +4127,7 @@ void ro_gui_window_action_new_window(struct gui_window *g)
void ro_gui_window_action_local_history(struct gui_window *g)
{
if (g != NULL && g->bw != NULL && g->bw->history != NULL)
- ro_gui_history_open(g->bw, g->bw->history, true);
+ ro_gui_history_open(g, true);
}