summaryrefslogtreecommitdiff
path: root/frontends/framebuffer/fbtk
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2017-02-09 12:02:28 +0000
committerVincent Sanders <vince@kyllikki.org>2017-02-11 13:57:07 +0000
commit386951ecfc220748b81c53f3c736f2fc08686b78 (patch)
tree2d868ff074aacab2dd703b4d27bef9911e0c8be9 /frontends/framebuffer/fbtk
parent0f43b2327063af238ab1eb5f94c3235f4c9347f6 (diff)
downloadnetsurf-386951ecfc220748b81c53f3c736f2fc08686b78.tar.gz
netsurf-386951ecfc220748b81c53f3c736f2fc08686b78.tar.bz2
update framebuffer to new plotter API
Diffstat (limited to 'frontends/framebuffer/fbtk')
-rw-r--r--frontends/framebuffer/fbtk/text.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/frontends/framebuffer/fbtk/text.c b/frontends/framebuffer/fbtk/text.c
index 00dcba491..31417c2e0 100644
--- a/frontends/framebuffer/fbtk/text.c
+++ b/frontends/framebuffer/fbtk/text.c
@@ -98,6 +98,11 @@ fb_redraw_text(fbtk_widget_t *widget, fbtk_callback_info *cbi )
int padding;
int scroll = 0;
bool caret = false;
+ struct redraw_context ctx = {
+ .interactive = true,
+ .background_images = true,
+ .plot = &fb_plotters
+ };
fb_text_font_style(widget, &fh, &padding, &font_style);
@@ -142,8 +147,11 @@ fb_redraw_text(fbtk_widget_t *widget, fbtk_callback_info *cbi )
}
/* Call the fb text plotting, baseline is 3/4 down the font */
- fb_plotters.text(x, y, widget->u.text.text,
- widget->u.text.len, &font_style);
+ ctx.plot->text(&ctx,
+ &font_style,
+ x, y,
+ widget->u.text.text,
+ widget->u.text.len);
}
if (caret) {
@@ -209,6 +217,11 @@ fb_redraw_text_button(fbtk_widget_t *widget, fbtk_callback_info *cbi )
int fh;
int border;
fbtk_widget_t *root = fbtk_get_root_widget(widget);
+ struct redraw_context ctx = {
+ .interactive = true,
+ .background_images = true,
+ .plot = &fb_plotters
+ };
fb_text_font_style(widget, &fh, &border, &font_style);
@@ -256,11 +269,12 @@ fb_redraw_text_button(fbtk_widget_t *widget, fbtk_callback_info *cbi )
if (widget->u.text.text != NULL) {
/* Call the fb text plotting, baseline is 3/4 down the font */
- fb_plotters.text(bbox.x0 + border,
- bbox.y0 + ((fh * 3) / 4) + border,
- widget->u.text.text,
- widget->u.text.len,
- &font_style);
+ ctx.plot->text(&ctx,
+ &font_style,
+ bbox.x0 + border,
+ bbox.y0 + ((fh * 3) / 4) + border,
+ widget->u.text.text,
+ widget->u.text.len);
}
nsfb_update(root->u.root.fb, &bbox);