summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2011-02-10 22:35:41 +0000
committerVincent Sanders <vince@netsurf-browser.org>2011-02-10 22:35:41 +0000
commit2a8e8a5cf10a22d47dd7ba8701b2b97b317c26ff (patch)
tree5c71cd2bc7f87d2fafd5dc2c8a45019cff5e2004 /desktop
parentbc2bce8d35bcb631168b3ae91ab6868b7057debc (diff)
downloadnetsurf-2a8e8a5cf10a22d47dd7ba8701b2b97b317c26ff.tar.gz
netsurf-2a8e8a5cf10a22d47dd7ba8701b2b97b317c26ff.tar.bz2
add browser_window_redraw() method to make content_redraw calls from frontends common RISC OS, atari, amiga and beos have not been updated
svn path=/trunk/netsurf/; revision=11640
Diffstat (limited to 'desktop')
-rw-r--r--desktop/browser.c26
-rw-r--r--desktop/browser.h28
2 files changed, 54 insertions, 0 deletions
diff --git a/desktop/browser.c b/desktop/browser.c
index d80886556..1ffc12e29 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -51,6 +51,8 @@
#include "desktop/options.h"
#include "desktop/selection.h"
#include "desktop/textinput.h"
+#include "desktop/plotters.h"
+
#include "render/form.h"
#include "render/html.h"
#include "render/textplain.h"
@@ -86,6 +88,30 @@ static void browser_window_find_target_internal(struct browser_window *bw,
const char *target, int depth, struct browser_window *page,
int *rdepth, struct browser_window **bw_target);
+/* exported interface, documented in browser.h */
+bool browser_window_redraw(struct browser_window *bw,
+ int x, int y,
+ int width, int height,
+ int clip_x0, int clip_y0,
+ int clip_x1, int clip_y1)
+{
+ if (bw == NULL) {
+ LOG(("NULL browser window"));
+ return false;
+ }
+
+ plot.clip(clip_x0, clip_y0, clip_x1, clip_y1);
+
+ if (bw->current_content == NULL) {
+ return plot.rectangle(clip_x0, clip_y0, clip_x1, clip_y1, plot_style_fill_white);
+
+ }
+
+ return content_redraw(bw->current_content, x, y, width, height,
+ clip_x0, clip_y0, clip_x1, clip_y1,
+ bw->scale, 0xFFFFFF);
+}
+
/**
* Create and open a new browser window with the given page.
*
diff --git a/desktop/browser.h b/desktop/browser.h
index c0a738a6e..2c16c9732 100644
--- a/desktop/browser.h
+++ b/desktop/browser.h
@@ -251,6 +251,34 @@ bool browser_window_forward_available(struct browser_window *bw);
bool browser_window_reload_available(struct browser_window *bw);
bool browser_window_stop_available(struct browser_window *bw);
+/**
+ * Redraw an area of a window
+ *
+ * Calls the redraw function for the content,
+ *
+ * \param bw The window to redraw
+ * \param x coordinate for top-left of redraw
+ * \param y coordinate for top-left of redraw
+ * \param width available width (not used for HTML redraw)
+ * \param height available height (not used for HTML redraw)
+ * \param clip_x0 clip rectangle left
+ * \param clip_y0 clip rectangle top
+ * \param clip_x1 clip rectangle right
+ * \param clip_y1 clip rectangle bottom
+ * \return true if successful, false otherwise
+ *
+ * x, y and clip_* are coordinates from the top left of the canvas area.
+ *
+ * The top left corner of the clip rectangle is (clip_x0, clip_y0) and
+ * the bottom right corner of the clip rectangle is (clip_x1, clip_y1).
+ * Units for x, y and clip_* are pixels.
+ */
+bool browser_window_redraw(struct browser_window *bw,
+ int x, int y,
+ int width, int height,
+ int clip_x0, int clip_y0,
+ int clip_x1, int clip_y1);
+
/* In platform specific hotlist.c. */
void hotlist_visited(struct hlcache_handle *c);