From b4723c1d05819d4e47fc59254f5ad8c9d6d62db3 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Mon, 21 Jun 2004 15:09:59 +0000 Subject: [project @ 2004-06-21 15:09:58 by bursa] Merge memory cache into content module. svn path=/import/netsurf/; revision=986 --- riscos/debugwin.c | 29 +++++++++++++++++++++++------ riscos/window.c | 4 ---- 2 files changed, 23 insertions(+), 10 deletions(-) (limited to 'riscos') diff --git a/riscos/debugwin.c b/riscos/debugwin.c index b45eb5217..8f9496150 100644 --- a/riscos/debugwin.c +++ b/riscos/debugwin.c @@ -14,6 +14,8 @@ #include "netsurf/utils/log.h" #include "netsurf/utils/utils.h" +/** Update interval / cs. */ +#define DEBUGWIN_UPDATE 500 static void ro_gui_debugwin_resize(void); static void ro_gui_debugwin_update(void *p); @@ -24,13 +26,13 @@ void ro_gui_debugwin_open(void) { ro_gui_debugwin_resize(); ro_gui_dialog_open(dialog_debug); - schedule(100, ro_gui_debugwin_update, 0); + schedule(DEBUGWIN_UPDATE, ro_gui_debugwin_update, 0); } void ro_gui_debugwin_resize(void) { - unsigned int count = 1; + unsigned int count = 2; struct content *content; os_box box; os_error *error; @@ -61,7 +63,7 @@ void ro_gui_debugwin_update(void *p) error->errnum, error->errmess)); warn_user("WimpError", error->errmess); } - schedule(100, ro_gui_debugwin_update, 0); + schedule(DEBUGWIN_UPDATE, ro_gui_debugwin_update, 0); } @@ -105,17 +107,22 @@ void ro_gui_debugwin_redraw(wimp_draw *redraw) void ro_gui_debugwin_redraw_plot(wimp_draw *redraw) { - char size[20]; + char s[20]; int x0 = redraw->box.x0 - redraw->xscroll; int y0 = redraw->box.y1 - redraw->yscroll; int i = 1; int y; + unsigned int users; + unsigned int size = 0; struct content *content; + struct content_user *user; xwimp_set_font_colours(wimp_COLOUR_BLACK, wimp_COLOUR_LIGHT_GREY); xwimptextop_paint(0, "url", x0 + 4, y0 - 20); xwimptextop_paint(0, "type", x0 + 600, y0 - 20); + xwimptextop_paint(0, "fresh", x0 + 680, y0 - 20); xwimptextop_paint(0, "mime_type", x0 + 750, y0 - 20); + xwimptextop_paint(0, "users", x0 + 880, y0 - 20); xwimptextop_paint(0, "status", x0 + 950, y0 - 20); xwimptextop_paint(0, "size", x0 + 1100, y0 - 20); @@ -126,12 +133,22 @@ void ro_gui_debugwin_redraw_plot(wimp_draw *redraw) x0 + 580, y); xwimptextop_paint(0, content_type_name[content->type], x0 + 600, y); + xwimptextop_paint(0, content->fresh ? "" : "", + x0 + 710, y); if (content->mime_type) xwimptextop_paint(0, content->mime_type, x0 + 750, y); + users = 0; + for (user = content->user_list->next; user; user = user->next) + users++; + snprintf(s, sizeof s, "%u", users); + xwimptextop_paint(wimptextop_RJUSTIFY, s, x0 + 930, y); xwimptextop_paint(0, content_status_name[content->status], x0 + 950, y); - snprintf(size, sizeof size, "%lu", content->size); - xwimptextop_paint(0, size, x0 + 1100, y); + snprintf(s, sizeof s, "%u", content->size); + xwimptextop_paint(wimptextop_RJUSTIFY, s, x0 + 1190, y); + size += content->size; } + snprintf(s, sizeof s, "%u", size); + xwimptextop_paint(wimptextop_RJUSTIFY, s, x0 + 1190, y0 - i * 28 - 20); } diff --git a/riscos/window.c b/riscos/window.c index dbce523dc..738428314 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -885,10 +885,6 @@ bool ro_gui_window_keypress(gui_window *g, int key, bool toolbar) } return true; - case wimp_KEY_F10: /* Dump cache for debugging. */ - cache_dump(); - return true; - case wimp_KEY_F11: /* Toggle display of box outlines. */ gui_redraw_debug = !gui_redraw_debug; gui_window_redraw_window(g); -- cgit v1.2.3