add history navigation

svn path=/trunk/netsurf/; revision=6451
This commit is contained in:
Vincent Sanders 2009-02-12 09:51:47 +00:00
parent 239884924f
commit e4378d3d0c
3 changed files with 20 additions and 1 deletions

View File

@ -30,6 +30,7 @@
#include "desktop/gui.h" #include "desktop/gui.h"
#include "desktop/options.h" #include "desktop/options.h"
#include "utils/messages.h" #include "utils/messages.h"
#include "desktop/history_core.h"
#include "framebuffer/fb_gui.h" #include "framebuffer/fb_gui.h"
#include "framebuffer/fb_plotters.h" #include "framebuffer/fb_plotters.h"
@ -110,6 +111,16 @@ void fb_os_input(struct gui_window *g, bool active)
browser_window_destroy(g->bw); browser_window_destroy(g->bw);
break; break;
case SDLK_b:
if (history_back_available(g->bw->history))
history_back(g->bw, g->bw->history);
break;
case SDLK_f:
if (history_forward_available(g->bw->history))
history_forward(g->bw, g->bw->history);
break;
default: default:
printf("The %s key was pressed!\n", printf("The %s key was pressed!\n",
SDL_GetKeyName(event.key.keysym.sym)); SDL_GetKeyName(event.key.keysym.sym));

View File

@ -128,7 +128,8 @@ static void fb_redraw(struct gui_window *g)
if (c->locked) return; if (c->locked) return;
content_redraw(c, 0, -g->scrolly, g->width, g->height, content_redraw(c, 0, -g->scrolly, g->width, g->height,
g->redraw_box.x0, g->redraw_box.y0, g->redraw_box.x1, g->redraw_box.y1, g->redraw_box.x0, g->redraw_box.y0,
g->redraw_box.x1, g->redraw_box.y1,
g->bw->scale, 0xFFFFFF); g->bw->scale, 0xFFFFFF);
fb_os_redraw(&g->redraw_box); fb_os_redraw(&g->redraw_box);

View File

@ -20,6 +20,13 @@
void global_history_add(const char *url) void global_history_add(const char *url)
{ {
const struct url_data *data;
data = urldb_get_url_data(url);
if (!data)
return;
} }
void global_history_add_recent(const char *url) void global_history_add_recent(const char *url)