diff options
author | Vincent Sanders <vince@kyllikki.org> | 2017-02-08 09:22:42 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2017-02-11 13:57:07 +0000 |
commit | 3ea137ca3d9b0f996493bb33289d9ab3fc2881bc (patch) | |
tree | 120feb9d39ff590aa4c9432b7df5f1304bebe410 /frontends/riscos/gui | |
parent | 78d601eb76c796c038f42c2b9f10e4e591272271 (diff) | |
download | netsurf-3ea137ca3d9b0f996493bb33289d9ab3fc2881bc.tar.gz netsurf-3ea137ca3d9b0f996493bb33289d9ab3fc2881bc.tar.bz2 |
update RISC OS plotters to new API
Diffstat (limited to 'frontends/riscos/gui')
-rw-r--r-- | frontends/riscos/gui/progress_bar.c | 15 | ||||
-rw-r--r-- | frontends/riscos/gui/status_bar.c | 25 |
2 files changed, 28 insertions, 12 deletions
diff --git a/frontends/riscos/gui/progress_bar.c b/frontends/riscos/gui/progress_bar.c index c26b46c84..c47c2af7d 100644 --- a/frontends/riscos/gui/progress_bar.c +++ b/frontends/riscos/gui/progress_bar.c @@ -30,9 +30,9 @@ #include "oslib/wimp.h" #include "oslib/wimpspriteop.h" -#include "netsurf/plotters.h" #include "utils/log.h" #include "utils/utils.h" +#include "netsurf/plotters.h" #include "riscos/gui.h" #include "riscos/tinct.h" @@ -482,6 +482,11 @@ void ro_gui_progress_bar_redraw_window(wimp_draw *redraw, osbool more = true; struct rect clip; int progress_ymid; + struct redraw_context ctx = { + .interactive = true, + .background_images = true, + .plot = &ro_plotters + }; /* initialise the plotters */ ro_plot_origin_x = 0; @@ -513,16 +518,16 @@ void ro_gui_progress_bar_redraw_window(wimp_draw *redraw, redraw->box.y0 + pb->visible.y0) >> 1; if ((clip.x0 < clip.x1) && (clip.y0 < clip.y1)) { if (progress_icon) { - ro_plotters.clip(&clip); + ctx.plot->clip(&ctx, &clip); _swix(Tinct_Plot, _IN(2) | _IN(3) | _IN(4) | _IN(7), progress_icon, redraw->box.x0 - pb->offset, progress_ymid - progress_height, tinct_FILL_HORIZONTALLY); } else { - ro_plotters.rectangle(clip.x0, clip.y0, - clip.x1, clip.y1, - plot_style_fill_red); + ctx.plot->rectangle(&ctx, + plot_style_fill_red, + &clip); } } } diff --git a/frontends/riscos/gui/status_bar.c b/frontends/riscos/gui/status_bar.c index 9d1bada91..bcaf3baf9 100644 --- a/frontends/riscos/gui/status_bar.c +++ b/frontends/riscos/gui/status_bar.c @@ -28,9 +28,10 @@ #include "oslib/os.h" #include "oslib/wimp.h" #include "oslib/wimpspriteop.h" -#include "netsurf/plotters.h" + #include "utils/log.h" #include "utils/utils.h" +#include "netsurf/plotters.h" #include "riscos/gui.h" #include "riscos/wimp.h" @@ -436,6 +437,12 @@ void ro_gui_status_bar_redraw(wimp_draw *redraw) os_error *error; osbool more; rufl_code code; + struct redraw_context ctx = { + .interactive = true, + .background_images = true, + .plot = &ro_plotters + }; + struct rect rect; sb = (struct status_bar *)ro_gui_wimp_event_get_user_data(redraw->w); assert(sb); @@ -467,18 +474,22 @@ void ro_gui_status_bar_redraw(wimp_draw *redraw) rufl_BLEND_FONT); if (code != rufl_OK) { if (code == rufl_FONT_MANAGER_ERROR) - LOG("rufl_FONT_MANAGER_ERROR: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess); + LOG("rufl_FONT_MANAGER_ERROR: 0x%x: %s", + rufl_fm_error->errnum, rufl_fm_error->errmess); else LOG("rufl_paint: 0x%x", code); } } + rect.x0 = (redraw->box.x0 + sb->width - WIDGET_WIDTH - 2) >> 1; + rect.y0 = -redraw->box.y0 >> 1; + rect.x1 = (redraw->box.x0 + sb->width - WIDGET_WIDTH) >> 1; + rect.y1 = -redraw->box.y1 >> 1; + /* separate the widget from the text with a line */ - ro_plotters.rectangle((redraw->box.x0 + sb->width - WIDGET_WIDTH - 2) >> 1, - -redraw->box.y0 >> 1, - (redraw->box.x0 + sb->width - WIDGET_WIDTH) >> 1, - -redraw->box.y1 >> 1, - plot_style_fill_black); + ctx.plot->rectangle(&ctx, + plot_style_fill_black, + &rect); error = xwimp_get_rectangle(redraw, &more); if (error) { |