summaryrefslogtreecommitdiff
path: root/windows
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 /windows
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 'windows')
-rw-r--r--windows/drawable.c6
-rw-r--r--windows/localhistory.c15
-rw-r--r--windows/plot.c2
-rw-r--r--windows/plot.h2
-rw-r--r--windows/thumbnail.c6
5 files changed, 25 insertions, 6 deletions
diff --git a/windows/drawable.c b/windows/drawable.c
index 5b2dea967..cdb9cc2b4 100644
--- a/windows/drawable.c
+++ b/windows/drawable.c
@@ -305,6 +305,10 @@ nsws_drawable_paint(struct gui_window *gw, HWND hwnd)
{
struct rect clip;
PAINTSTRUCT ps;
+ struct redraw_context ctx = {
+ .interactive = true,
+ .plot = &win_plotters
+ };
BeginPaint(hwnd, &ps);
@@ -319,7 +323,7 @@ nsws_drawable_paint(struct gui_window *gw, HWND hwnd)
browser_window_redraw(gw->bw,
-gw->scrollx / gw->bw->scale,
-gw->scrolly / gw->bw->scale,
- &clip);
+ &clip, &ctx);
}
EndPaint(hwnd, &ps);
diff --git a/windows/localhistory.c b/windows/localhistory.c
index bd59f4c8a..e7b79cb8e 100644
--- a/windows/localhistory.c
+++ b/windows/localhistory.c
@@ -78,7 +78,11 @@ static void nsws_localhistory_scroll_check(struct nsws_localhistory *l, struct g
static void nsws_localhistory_up(struct nsws_localhistory *l, struct gui_window *gw)
{
- HDC tmp_hdc;
+ HDC tmp_hdc;
+ struct redraw_context ctx = {
+ .interactive = true,
+ .plot = &win_plotters
+ };
LOG(("gui window %p", gw));
@@ -90,7 +94,7 @@ static void nsws_localhistory_up(struct nsws_localhistory *l, struct gui_window
tmp_hdc = plot_hdc;
plot_hdc = GetDC(l->hwnd);
- history_redraw(gw->bw->history);
+ history_redraw(gw->bw->history, &ctx);
ReleaseDC(l->hwnd, plot_hdc);
@@ -268,6 +272,11 @@ nsws_localhistory_event_callback(HWND hwnd, UINT msg,
case WM_PAINT: {
PAINTSTRUCT ps;
HDC hdc, tmp_hdc;
+ struct redraw_context ctx = {
+ .interactive = true,
+ .plot = &win_plotters
+ };
+
hdc = BeginPaint(hwnd, &ps);
if (gw->bw != NULL) {
/* set global HDC for the plotters */
@@ -280,7 +289,7 @@ nsws_localhistory_event_callback(HWND hwnd, UINT msg,
gw->localhistory->hscroll + (ps.rcPaint.right - ps.rcPaint.left),
gw->localhistory->vscroll + (ps.rcPaint.bottom - ps.rcPaint.top),
ps.rcPaint.left,
- ps.rcPaint.top);
+ ps.rcPaint.top, &ctx);
plot_hdc = tmp_hdc;
diff --git a/windows/plot.c b/windows/plot.c
index 491b89bcc..2898fae27 100644
--- a/windows/plot.c
+++ b/windows/plot.c
@@ -846,7 +846,7 @@ static bool path(const float *p, unsigned int n, colour fill, float width,
return true;
}
-struct plotter_table plot = {
+const struct plotter_table win_plotters = {
.rectangle = rectangle,
.line = line,
.polygon = polygon,
diff --git a/windows/plot.h b/windows/plot.h
index dc0ac0386..044f4be47 100644
--- a/windows/plot.h
+++ b/windows/plot.h
@@ -18,6 +18,8 @@
#include <windows.h>
#include "desktop/gui.h"
+
+extern const struct plotter_table win_plotters;
extern HDC plot_hdc;
diff --git a/windows/thumbnail.c b/windows/thumbnail.c
index ec44bbb2f..565ee3de1 100644
--- a/windows/thumbnail.c
+++ b/windows/thumbnail.c
@@ -38,6 +38,10 @@ thumbnail_create(hlcache_handle *content,
int width;
int height;
HDC hdc, bufferdc, minidc;
+ struct redraw_context ctx = {
+ .interactive = false,
+ .plot = &win_plotters
+ };
struct bitmap *fsbitmap;
@@ -67,7 +71,7 @@ thumbnail_create(hlcache_handle *content,
hdc = plot_hdc;
plot_hdc = bufferdc;
- thumbnail_redraw(content, width, height);
+ thumbnail_redraw(content, width, height, &ctx);
plot_hdc = hdc;
/* scale bitmap bufferbm into minibm */