From 501da1c487f04fbbe04c3cc2a130a4583621681c Mon Sep 17 00:00:00 2001 From: Richard Wilson Date: Mon, 14 Mar 2005 13:58:43 +0000 Subject: [project @ 2005-03-14 13:58:43 by rjw] Minimise flicker when viewing non-HTML files. svn path=/import/netsurf/; revision=1535 --- riscos/wimp.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'riscos/wimp.c') diff --git a/riscos/wimp.c b/riscos/wimp.c index a9e2a29d4..54a3cf815 100644 --- a/riscos/wimp.c +++ b/riscos/wimp.c @@ -14,6 +14,7 @@ #include #include #include +#include "oslib/colourtrans.h" #include "oslib/os.h" #include "oslib/osfile.h" #include "oslib/wimp.h" @@ -626,3 +627,45 @@ void ro_gui_open_pane(wimp_w parent, wimp_w pane, int offset) return; } } + + +/** + * Performs simple user redraw for a window. + * + * \param user_fill whether to fill the redraw area + * \param user_colour the colour to use when filling + */ + +void ro_gui_user_redraw(wimp_draw *redraw, bool user_fill, os_colour user_colour) +{ + os_error *error; + osbool more; + + error = xwimp_redraw_window(redraw, &more); + if (error) { + LOG(("xwimp_redraw_window: 0x%x: %s", + error->errnum, error->errmess)); + warn_user("WimpError", error->errmess); + return; + } + while (more) { + if (user_fill) { + error = xcolourtrans_set_gcol(user_colour, + colourtrans_SET_BG, + os_ACTION_OVERWRITE, 0, 0); + if (error) { + LOG(("xcolourtrans_set_gcol: 0x%x: %s", + error->errnum, error->errmess)); + warn_user("MiscError", error->errmess); + } + os_clg(); + } + error = xwimp_get_rectangle(redraw, &more); + if (error) { + LOG(("xwimp_get_rectangle: 0x%x: %s", + error->errnum, error->errmess)); + warn_user("WimpError", error->errmess); + return; + } + } +} -- cgit v1.2.3