summaryrefslogtreecommitdiff
path: root/frontends
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2017-04-23 20:29:22 +0100
committerVincent Sanders <vince@kyllikki.org>2017-04-23 20:42:37 +0100
commit6177e2930bb3c74908daa52a16a2b7c830108d0c (patch)
treeebcf70b34f7d55d63b3f4ca82dc8fcd5f4d15cb0 /frontends
parentb61c21c7d03b4af13e9650348679005bc54bd0f7 (diff)
downloadnetsurf-6177e2930bb3c74908daa52a16a2b7c830108d0c.tar.gz
netsurf-6177e2930bb3c74908daa52a16a2b7c830108d0c.tar.bz2
Update monkey frontend to use invalidate window area API
Diffstat (limited to 'frontends')
-rw-r--r--frontends/monkey/browser.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/frontends/monkey/browser.c b/frontends/monkey/browser.c
index 3bf0dd036..7cd3d077b 100644
--- a/frontends/monkey/browser.c
+++ b/frontends/monkey/browser.c
@@ -119,12 +119,6 @@ gui_window_set_title(struct gui_window *g, const char *title)
}
static void
-gui_window_redraw_window(struct gui_window *g)
-{
- fprintf(stdout, "WINDOW REDRAW WIN %u\n", g->win_num);
-}
-
-static void
gui_window_get_dimensions(struct gui_window *g, int *width, int *height,
bool scaled)
{
@@ -166,13 +160,28 @@ gui_window_set_scroll(struct gui_window *g, int sx, int sy)
fprintf(stdout, "WINDOW SET_SCROLL WIN %u X %d Y %d\n", g->win_num, sx, sy);
}
-static void
-gui_window_update_box(struct gui_window *g, const struct rect *rect)
+/**
+ * Invalidates an area of a monkey browser window
+ *
+ * \param gw gui_window
+ * \param rect area to redraw or NULL for the entire window area
+ * \return NSERROR_OK on success or appropriate error code
+ */
+static nserror
+monkey_window_invalidate_area(struct gui_window *gw, const struct rect *rect)
{
- fprintf(stdout, "WINDOW UPDATE_BOX WIN %u X %d Y %d WIDTH %d HEIGHT %d\n",
- g->win_num, rect->x0, rect->y0,
- (rect->x1 - rect->x0), (rect->y1 - rect->y0));
-
+ fprintf(stdout, "WINDOW INVALIDATE_AREA WIN %u", gw->win_num);
+
+ if (rect != NULL) {
+ fprintf(stdout,
+ " X %d Y %d WIDTH %d HEIGHT %d\n",
+ rect->x0, rect->y0,
+ (rect->x1 - rect->x0), (rect->y1 - rect->y0));
+ } else {
+ fprintf(stdout," ALL\n");
+ }
+
+ return NSERROR_OK;
}
static void
@@ -501,8 +510,7 @@ monkey_window_handle_command(int argc, char **argv)
static struct gui_window_table window_table = {
.create = gui_window_create,
.destroy = gui_window_destroy,
- .redraw = gui_window_redraw_window,
- .update = gui_window_update_box,
+ .invalidate = monkey_window_invalidate_area,
.get_scroll = gui_window_get_scroll,
.set_scroll = gui_window_set_scroll,
.get_dimensions = gui_window_get_dimensions,