summaryrefslogtreecommitdiff
path: root/frontends
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2017-04-23 20:59:50 +0100
committerVincent Sanders <vince@kyllikki.org>2017-04-23 20:59:50 +0100
commit6e0f5bee5587db14f7c5755f50a7a17d665d0b99 (patch)
tree25ef5ca0cecab7fe9a63c9633955c4775340a639 /frontends
parentbecd3863c469ee44ccd8922e176a5394afaca682 (diff)
downloadnetsurf-6e0f5bee5587db14f7c5755f50a7a17d665d0b99.tar.gz
netsurf-6e0f5bee5587db14f7c5755f50a7a17d665d0b99.tar.bz2
Update beos frontend to use invalidate window area API
Diffstat (limited to 'frontends')
-rw-r--r--frontends/beos/window.cpp54
1 files changed, 28 insertions, 26 deletions
diff --git a/frontends/beos/window.cpp b/frontends/beos/window.cpp
index fbf7b1652..4db7b3ca6 100644
--- a/frontends/beos/window.cpp
+++ b/frontends/beos/window.cpp
@@ -1000,39 +1000,42 @@ void nsbeos_redraw_caret(struct gui_window *g)
g->view->UnlockLooper();
}
-static void gui_window_redraw_window(struct gui_window *g)
+/**
+ * Invalidate an area of a beos browser window
+ *
+ * \param gw The netsurf window being invalidated.
+ * \param rect area to redraw or NULL for entrire window area.
+ * \return NSERROR_OK or appropriate error code.
+ */
+static nserror
+beos_window_invalidate_area(struct gui_window *g, const struct rect *rect)
{
- if (g->view == NULL)
- return;
- if (!g->view->LockLooper())
- return;
-
- nsbeos_current_gc_set(g->view);
-
- g->view->Invalidate();
-
- nsbeos_current_gc_set(NULL);
- g->view->UnlockLooper();
-}
+ if (browser_window_has_content(g->bw) == false) {
+ return NSERROR_OK;
+ }
-static void gui_window_update_box(struct gui_window *g, const struct rect *rect)
-{
- if (browser_window_has_content(g->bw) == false)
- return;
+ if (g->view == NULL) {
+ return NSERROR_OK;
+ }
- if (g->view == NULL)
- return;
- if (!g->view->LockLooper())
- return;
+ if (!g->view->LockLooper()) {
+ return NSERROR_OK;
+ }
nsbeos_current_gc_set(g->view);
-//XXX +1 ??
- g->view->Invalidate(BRect(rect->x0, rect->y0,
- rect->x1 - 1, rect->y1 - 1));
+ if (rect != NULL) {
+ //XXX +1 ??
+ g->view->Invalidate(BRect(rect->x0, rect->y0,
+ rect->x1 - 1, rect->y1 - 1));
+ } else {
+ g->view->Invalidate();
+ }
nsbeos_current_gc_set(NULL);
g->view->UnlockLooper();
+
+ return NSERROR_OK;
}
static bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy)
@@ -1349,8 +1352,7 @@ static void gui_window_get_dimensions(struct gui_window *g, int *width, int *hei
static struct gui_window_table window_table = {
gui_window_create,
gui_window_destroy,
- gui_window_redraw_window,
- gui_window_update_box,
+ beos_window_invalidate_area,
gui_window_get_scroll,
gui_window_set_scroll,
gui_window_get_dimensions,