summaryrefslogtreecommitdiff
path: root/frontends/atari
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2017-04-19 16:33:31 +0100
committerVincent Sanders <vince@kyllikki.org>2017-04-23 12:05:30 +0100
commitb1029506505320859c57d056011003b71053b600 (patch)
treefe72d371680606fdb36889d98232b28d884034a7 /frontends/atari
parent6833f526f61ab1e9c5e2e50d9376b1bec83223ee (diff)
downloadnetsurf-b1029506505320859c57d056011003b71053b600.tar.gz
netsurf-b1029506505320859c57d056011003b71053b600.tar.bz2
update atari frontend for invalidate window API change
Diffstat (limited to 'frontends/atari')
-rw-r--r--frontends/atari/gui.c52
1 files changed, 29 insertions, 23 deletions
diff --git a/frontends/atari/gui.c b/frontends/atari/gui.c
index 1287b4715..ad568b761 100644
--- a/frontends/atari/gui.c
+++ b/frontends/atari/gui.c
@@ -385,34 +385,41 @@ static void atari_window_reformat(struct gui_window *gw)
}
}
-static void gui_window_redraw_window(struct gui_window *gw)
-{
- //CMP_BROWSER b;
- GRECT rect;
- if (gw == NULL)
- return;
- //b = gw->browser;
- window_get_grect(gw->root, BROWSER_AREA_CONTENT, &rect);
- window_schedule_redraw_grect(gw->root, &rect);
-}
-static void gui_window_update_box(struct gui_window *gw, const struct rect *rect)
+/**
+ * Invalidates an area of an atari 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
+atari_window_invalidate_area(struct gui_window *gw,
+ const struct rect *rect)
{
GRECT area;
- struct gemtk_wm_scroll_info_s *slid;
- if (gw == NULL)
- return;
-
- slid = gemtk_wm_get_scroll_info(gw->root->win);
+ if (gw == NULL) {
+ return NSERROR_BAD_PARAMETER;
+ }
window_get_grect(gw->root, BROWSER_AREA_CONTENT, &area);
- area.g_x += rect->x0 - (slid->x_pos * slid->x_unit_px);
- area.g_y += rect->y0 - (slid->y_pos * slid->y_unit_px);
- area.g_w = rect->x1 - rect->x0;
- area.g_h = rect->y1 - rect->y0;
+
+ if (rect != NULL) {
+ struct gemtk_wm_scroll_info_s *slid;
+
+ slid = gemtk_wm_get_scroll_info(gw->root->win);
+
+ area.g_x += rect->x0 - (slid->x_pos * slid->x_unit_px);
+ area.g_y += rect->y0 - (slid->y_pos * slid->y_unit_px);
+ area.g_w = rect->x1 - rect->x0;
+ area.g_h = rect->y1 - rect->y0;
+ }
+
//dbg_grect("update box", &area);
window_schedule_redraw_grect(gw->root, &area);
+
+ return NSERROR_OK;
}
bool gui_window_get_scroll(struct gui_window *w, int *sx, int *sy)
@@ -680,7 +687,7 @@ static void gui_window_new_content(struct gui_window *w)
slid->x_pos = 0;
slid->y_pos = 0;
gemtk_wm_update_slider(w->root->win, GEMTK_WM_VH_SLIDER);
- gui_window_redraw_window(w);
+ atari_window_invalidate_area(w, NULL);
}
@@ -1051,8 +1058,7 @@ static void gui_init(int argc, char** argv)
static struct gui_window_table atari_window_table = {
.create = gui_window_create,
.destroy = gui_window_destroy,
- .redraw = gui_window_redraw_window,
- .update = gui_window_update_box,
+ .invalidate = atari_window_invalidate_area,
.get_scroll = gui_window_get_scroll,
.set_scroll = gui_window_set_scroll,
.get_dimensions = gui_window_get_dimensions,