summaryrefslogtreecommitdiff
path: root/framebuffer
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-06-30 15:48:07 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-06-30 15:48:07 +0000
commiteddae6af0663243a2677674d501f9a87d55798f5 (patch)
tree08562171f870a6b592d624adfbfd0d6fa11fcdcb /framebuffer
parenta5dc6b9e6637c85d18510ac6446ee4a8a7955e7b (diff)
downloadnetsurf-eddae6af0663243a2677674d501f9a87d55798f5.tar.gz
netsurf-eddae6af0663243a2677674d501f9a87d55798f5.tar.bz2
Remove plotter table global. Pass a redraw context around redraw functions. Knockout could be handled better. Note: untested on most front ends.
svn path=/trunk/netsurf/; revision=12543
Diffstat (limited to 'framebuffer')
-rw-r--r--framebuffer/fbtk/text.c6
-rw-r--r--framebuffer/framebuffer.c3
-rw-r--r--framebuffer/framebuffer.h6
-rw-r--r--framebuffer/gui.c6
-rw-r--r--framebuffer/localhistory.c7
5 files changed, 19 insertions, 9 deletions
diff --git a/framebuffer/fbtk/text.c b/framebuffer/fbtk/text.c
index 18b8e9ae5..f50a5ad59 100644
--- a/framebuffer/fbtk/text.c
+++ b/framebuffer/fbtk/text.c
@@ -29,10 +29,10 @@
#include "utils/log.h"
#include "desktop/browser.h"
-#include "desktop/plotters.h"
#include "framebuffer/gui.h"
#include "framebuffer/fbtk.h"
+#include "framebuffer/framebuffer.h"
#include "framebuffer/image_data.h"
#include "widget.h"
@@ -109,7 +109,7 @@ fb_redraw_text(fbtk_widget_t *widget, fbtk_callback_info *cbi )
* system for the baseline is to the "higher value
* pixel co-ordinate" due to this the + 1 is neccessary.
*/
- plot.text(bbox.x0 + padding,
+ fb_plotters.text(bbox.x0 + padding,
bbox.y0 + (((fh * 3) + 3)/4) + padding + 1,
widget->u.text.text,
strlen(widget->u.text.text),
@@ -207,7 +207,7 @@ fb_redraw_text_button(fbtk_widget_t *widget, fbtk_callback_info *cbi )
* system for the baseline is to the "higher value
* pixel co-ordinate" due to this the + 1 is neccessary.
*/
- plot.text(bbox.x0 + border,
+ fb_plotters.text(bbox.x0 + border,
bbox.y0 + (((fh * 3) + 3)/4) + border + 1,
widget->u.text.text,
strlen(widget->u.text.text),
diff --git a/framebuffer/framebuffer.c b/framebuffer/framebuffer.c
index 535f63c85..218a912e7 100644
--- a/framebuffer/framebuffer.c
+++ b/framebuffer/framebuffer.c
@@ -30,7 +30,6 @@
#include "utils/log.h"
#include "desktop/browser.h"
-#include "desktop/plotters.h"
#include "framebuffer/gui.h"
#include "framebuffer/fbtk.h"
@@ -342,7 +341,7 @@ framebuffer_plot_clip(const struct rect *clip)
return nsfb_plot_set_clip(nsfb, &nsfb_clip);
}
-struct plotter_table plot = {
+const struct plotter_table fb_plotters = {
.clip = framebuffer_plot_clip,
.arc = framebuffer_plot_arc,
.disc = framebuffer_plot_disc,
diff --git a/framebuffer/framebuffer.h b/framebuffer/framebuffer.h
index a61a746e7..aec6a689f 100644
--- a/framebuffer/framebuffer.h
+++ b/framebuffer/framebuffer.h
@@ -1,5 +1,7 @@
+#include "desktop/plotters.h"
+
+extern const struct plotter_table fb_plotters;
+
nsfb_t *framebuffer_initialise(const char *fename, int width, int height, int bpp);
void framebuffer_finalise(void);
bool framebuffer_set_cursor(struct bitmap *bm);
-
-
diff --git a/framebuffer/gui.c b/framebuffer/gui.c
index 7df3a9173..644a917e0 100644
--- a/framebuffer/gui.c
+++ b/framebuffer/gui.c
@@ -307,6 +307,10 @@ fb_redraw(fbtk_widget_t *widget,
int x;
int y;
struct rect clip;
+ struct redraw_context ctx = {
+ .interactive = true,
+ .plot = &fb_plotters
+ };
LOG(("%d,%d to %d,%d",
bwidget->redraw_box.x0,
@@ -336,7 +340,7 @@ fb_redraw(fbtk_widget_t *widget,
browser_window_redraw(bw,
(x - bwidget->scrollx) / bw->scale,
(y - bwidget->scrolly) / bw->scale,
- &clip);
+ &clip, &ctx);
current_redraw_browser = NULL;
diff --git a/framebuffer/localhistory.c b/framebuffer/localhistory.c
index d8f2b048d..78c1a8d90 100644
--- a/framebuffer/localhistory.c
+++ b/framebuffer/localhistory.c
@@ -61,6 +61,11 @@ localhistory_redraw(fbtk_widget_t *widget, fbtk_callback_info *cbi)
struct gui_localhistory *glh = cbi->context;
nsfb_bbox_t rbox;
+ struct redraw_context ctx = {
+ .interactive = true,
+ .plot = &fb_plotters
+ };
+
rbox.x0 = fbtk_get_absx(widget);
rbox.y0 = fbtk_get_absy(widget);
@@ -76,7 +81,7 @@ localhistory_redraw(fbtk_widget_t *widget, fbtk_callback_info *cbi)
glh->scrolly,
fbtk_get_width(widget) + glh->scrollx,
fbtk_get_height(widget) + glh->scrolly,
- 0, 0);
+ 0, 0, &ctx);
nsfb_update(fbtk_get_nsfb(widget), &rbox);