From 6f67739fa76911f7649ff2917ad319fce7b32dcd Mon Sep 17 00:00:00 2001 From: Phil Mellor Date: Sat, 11 Jan 2003 17:33:31 +0000 Subject: [project @ 2003-01-11 17:33:31 by monkeyson] Mouse gestures. Recognises the same gestures as Opera, although only back, forward and reload actually do anything yet. svn path=/import/netsurf/; revision=91 --- desktop/browser.c | 23 ++++++++++++++--------- desktop/gui.h | 3 ++- 2 files changed, 16 insertions(+), 10 deletions(-) (limited to 'desktop') diff --git a/desktop/browser.c b/desktop/browser.c index 8edf77e9f..63418051f 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -1,5 +1,5 @@ /** - * $Id: browser.c,v 1.20 2003/01/06 23:53:39 bursa Exp $ + * $Id: browser.c,v 1.21 2003/01/11 17:33:31 monkeyson Exp $ */ #include "netsurf/riscos/font.h" @@ -113,29 +113,34 @@ void set_content_html(struct content* c) return; } -void content_html_reformat(struct content* c, int width) + +char* content_html_reformat(struct content* c, int width) { char* file; + char* title = NULL; struct css_selector* selector = xcalloc(1, sizeof(struct css_selector)); LOG(("Starting stuff")); + + /* need to find title of page */ + if (c->data.html.layout != NULL) { /* TODO: skip if width is unchanged */ layout_document(c->data.html.layout->children, (unsigned long)width); - return; + return title; } LOG(("Setting document to myDoc")); c->data.html.document = c->data.html.parser->myDoc; - xmlDebugDumpDocument(stderr, c->data.html.parser->myDoc); + //xmlDebugDumpDocument(stderr, c->data.html.parser->myDoc); /* skip to start of html */ LOG(("Skipping to html")); if (c->data.html.document == NULL) { LOG(("There is no document!")); - return; + return title; } for (c->data.html.markup = c->data.html.document->children; c->data.html.markup != 0 && @@ -146,12 +151,12 @@ void content_html_reformat(struct content* c, int width) if (c->data.html.markup == 0) { LOG(("No markup")); - return; + return title; } if (strcmp((const char *) c->data.html.markup->name, "html")) { LOG(("Not html")); - return; + return title; } // xfree(c->data.html.stylesheet); @@ -183,7 +188,7 @@ void content_html_reformat(struct content* c, int width) /* can tidy up memory here? */ - return; + return title; } void browser_window_reformat(struct browser_window* bw) @@ -203,7 +208,7 @@ void browser_window_reformat(struct browser_window* bw) LOG(("HTML content.")); browser_window_set_status(bw, "Formatting page..."); time0 = clock(); - content_html_reformat(bw->current_content, gui_window_get_width(bw->window)); + gui_window_set_title(bw->window, content_html_reformat(bw->current_content, gui_window_get_width(bw->window))); time1 = clock(); LOG(("Content reformatted")); if (bw->current_content->data.html.layout != NULL) diff --git a/desktop/gui.h b/desktop/gui.h index 4e6c7975a..3cbc7472a 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -1,5 +1,5 @@ /** - * $Id: gui.h,v 1.3 2002/12/30 22:56:30 monkeyson Exp $ + * $Id: gui.h,v 1.4 2003/01/11 17:33:31 monkeyson Exp $ */ #ifndef _NETSURF_DESKTOP_GUI_H_ @@ -32,6 +32,7 @@ void gui_window_redraw_window(gui_window* g); void gui_window_set_scroll(gui_window* g, int sx, int sy); void gui_window_set_extent(gui_window* g, int width, int height); void gui_window_set_status(gui_window* g, char* text); +void gui_window_set_title(gui_window* g, char* title); void gui_window_message(gui_window* g, gui_message* msg); -- cgit v1.2.3