Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/772ebc69c95bda5e5c35ab8aedfe9049cca212b7
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/772ebc69c95bda5e5c35ab8aedfe9049cca212b7
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/772ebc69c95bda5e5c35ab8aedfe9049cca212b7

The branch, master has been updated
       via  772ebc69c95bda5e5c35ab8aedfe9049cca212b7 (commit)
       via  b0358727d90383d9fee6ccff87f3f2274d9d4225 (commit)
       via  56daba58789acddaeb2c6ecf3801eb27a8dc9ccf (commit)
       via  368b03bffb8dcf2dc2a306f29756ca882b3fee51 (commit)
       via  283d921f346d44bd8d78fdac6a36b5a8516ca722 (commit)
       via  5225ca2b90f66b202c520773b0c8c52b0687e6a5 (commit)
      from  9bf5ecfa87d022645e986249270c5a89e27f46fe (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=772ebc69c95bda5e5c35ab8aedfe9049cca212b7
commit 772ebc69c95bda5e5c35ab8aedfe9049cca212b7
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    RISC OS: Local history now behaves the same as other core windows.

diff --git a/frontends/riscos/local_history.c b/frontends/riscos/local_history.c
index fae78e6..1ad63e0 100644
--- a/frontends/riscos/local_history.c
+++ b/frontends/riscos/local_history.c
@@ -90,7 +90,7 @@ ro_local_history_draw(struct ro_corewindow *ro_cw,
        ro_plot_origin_x = originx;
        ro_plot_origin_y = originy;
        no_font_blending = true;
-       local_history_redraw(lhw->session, r->x0, r->y0, r, &ctx);
+       local_history_redraw(lhw->session, 0, 0, r, &ctx);
        no_font_blending = false;
 
        return NSERROR_OK;


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=b0358727d90383d9fee6ccff87f3f2274d9d4225
commit b0358727d90383d9fee6ccff87f3f2274d9d4225
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    GTK: Don't need to treat local history specially now.

diff --git a/frontends/gtk/local_history.c b/frontends/gtk/local_history.c
index 650cb4f..b36ccd2 100644
--- a/frontends/gtk/local_history.c
+++ b/frontends/gtk/local_history.c
@@ -116,7 +116,7 @@ nsgtk_local_history_draw(struct nsgtk_corewindow *nsgtk_cw, 
struct rect *r)
        lhw = (struct nsgtk_local_history_window *)nsgtk_cw;
 
        ctx.plot->clip(&ctx, r);
-       local_history_redraw(lhw->session, r->x0, r->y0, r, &ctx);
+       local_history_redraw(lhw->session, 0, 0, r, &ctx);
 
        return NSERROR_OK;
 }


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=56daba58789acddaeb2c6ecf3801eb27a8dc9ccf
commit 56daba58789acddaeb2c6ecf3801eb27a8dc9ccf
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Core local history: Make rendering behave like treeview.
    
    This fixes behaviour now that both treeviews and local history can
    be rendered through core window.

diff --git a/desktop/browser_history.c b/desktop/browser_history.c
index 50017bf..c5f2923 100644
--- a/desktop/browser_history.c
+++ b/desktop/browser_history.c
@@ -294,8 +294,6 @@ browser_window_history__redraw_entry(struct history 
*history,
        int actual_x;
        struct history_entry *child;
        int tailsize = 5;
-       int xoffset = x - clip->x0;
-       int yoffset = y - clip->y0;
 
        plot_style_t *pstyle;
        plot_font_style_t *pfstyle;
@@ -311,22 +309,12 @@ browser_window_history__redraw_entry(struct history 
*history,
                pfstyle = &pfstyle_node;
        }
 
-       /* setup clip area */
-       rect.x0 = clip->x0 + xoffset;
-       rect.y0 = clip->y0 + yoffset;
-       rect.x1 = clip->x1 + xoffset;
-       rect.y1 = clip->y1 + yoffset;
-       res = ctx->plot->clip(ctx, &rect);
-       if (res != NSERROR_OK) {
-               return false;
-       }
-
        /* Only attempt to plot bitmap if it is present */
        if (entry->bitmap != NULL) {
                res = ctx->plot->bitmap(ctx,
                                        entry->bitmap,
-                                       entry->x + xoffset,
-                                       entry->y + yoffset,
+                                       entry->x + x,
+                                       entry->y + y,
                                        WIDTH, HEIGHT,
                                        0xffffff,
                                        0);
@@ -335,10 +323,10 @@ browser_window_history__redraw_entry(struct history 
*history,
                }
        }
 
-       rect.x0 = entry->x - 1 + xoffset;
-       rect.y0 = entry->y - 1 + yoffset;
-       rect.x1 = entry->x + xoffset + WIDTH;
-       rect.y1 = entry->y + yoffset + HEIGHT;
+       rect.x0 = entry->x - 1 + x;
+       rect.y0 = entry->y - 1 + y;
+       rect.x1 = entry->x + x + WIDTH;
+       rect.y1 = entry->y + y + HEIGHT;
        res = ctx->plot->rectangle(ctx, pstyle, &rect);
        if (res != NSERROR_OK) {
                return false;
@@ -353,8 +341,8 @@ browser_window_history__redraw_entry(struct history 
*history,
 
        res = ctx->plot->text(ctx,
                              pfstyle,
-                             entry->x + xoffset,
-                             entry->y + HEIGHT + 12 + yoffset,
+                             entry->x + x,
+                             entry->y + HEIGHT + 12 + y,
                              entry->page.title,
                              char_offset);
        if (res != NSERROR_OK) {
@@ -363,28 +351,28 @@ browser_window_history__redraw_entry(struct history 
*history,
 
        /* for each child node draw a line and recurse redraw into it */
        for (child = entry->forward; child; child = child->next) {
-               rect.x0 = entry->x + WIDTH + xoffset;
-               rect.y0 = entry->y + HEIGHT / 2 + yoffset;
-               rect.x1 = entry->x + WIDTH + tailsize + xoffset;
-               rect.y1 = entry->y + HEIGHT / 2 + yoffset;
+               rect.x0 = entry->x + WIDTH + x;
+               rect.y0 = entry->y + HEIGHT / 2 + y;
+               rect.x1 = entry->x + WIDTH + tailsize + x;
+               rect.y1 = entry->y + HEIGHT / 2 + y;
                res = ctx->plot->line(ctx, &pstyle_line, &rect);
                if (res != NSERROR_OK) {
                        return false;
                }
 
-               rect.x0 = entry->x + WIDTH + tailsize + xoffset;
-               rect.y0 = entry->y + HEIGHT / 2 + yoffset;
-               rect.x1 = child->x - tailsize + xoffset;
-               rect.y1 = child->y + HEIGHT / 2 + yoffset;
+               rect.x0 = entry->x + WIDTH + tailsize + x;
+               rect.y0 = entry->y + HEIGHT / 2 + y;
+               rect.x1 = child->x - tailsize + x;
+               rect.y1 = child->y + HEIGHT / 2 + y;
                res = ctx->plot->line(ctx, &pstyle_line, &rect);
                if (res != NSERROR_OK) {
                        return false;
                }
 
-               rect.x0 = child->x - tailsize + xoffset;
-               rect.y0 = child->y + HEIGHT / 2 + yoffset;
-               rect.x1 = child->x + xoffset;
-               rect.y1 = child->y + HEIGHT / 2 + yoffset;
+               rect.x0 = child->x - tailsize + x;
+               rect.y0 = child->y + HEIGHT / 2 + y;
+               rect.x1 = child->x + x;
+               rect.y1 = child->y + HEIGHT / 2 + y;
                res = ctx->plot->line(ctx, &pstyle_line, &rect);
                if (res != NSERROR_OK) {
                        return false;
@@ -477,6 +465,7 @@ nserror browser_window_history_create(struct browser_window 
*bw)
        if (res != NSERROR_OK) {
                return res;
        }
+       pstyle_bg.fill_colour = 0xf888ff;
        pfstyle_node.background = pstyle_bg.fill_colour;
        pfstyle_node_sel.background = pstyle_bg.fill_colour;
 
@@ -778,6 +767,12 @@ bool browser_window_history_redraw_rectangle(struct 
browser_window *bw,
                const struct redraw_context *ctx)
 {
        struct history *history;
+       struct rect r = {
+               .x0 = clip->x0 + x,
+               .y0 = clip->y0 + y,
+               .x1 = clip->x1 + x,
+               .y1 = clip->y1 + y,
+       };
 
        assert(bw != NULL);
        history = bw->history;
@@ -785,7 +780,8 @@ bool browser_window_history_redraw_rectangle(struct 
browser_window *bw,
        if (!history->start)
                return true;
 
-       ctx->plot->rectangle(ctx, &pstyle_bg, clip);
+       ctx->plot->clip(ctx, &r);
+       ctx->plot->rectangle(ctx, &pstyle_bg, &r);
 
        return browser_window_history__redraw_entry(
                        history, history->start,


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=368b03bffb8dcf2dc2a306f29756ca882b3fee51
commit 368b03bffb8dcf2dc2a306f29756ca882b3fee51
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Local history: Pass clip rectangle around as struct.

diff --git a/desktop/browser_history.c b/desktop/browser_history.c
index 58c472f..50017bf 100644
--- a/desktop/browser_history.c
+++ b/desktop/browser_history.c
@@ -279,27 +279,23 @@ static plot_font_style_t pfstyle_node_sel = {
  * Recursively redraw a history_entry.
  *
  * \param history history containing the entry
- * \param entry entry to render
- * \param x0 area top left x coordinate
- * \param y0 area top left y coordinate
- * \param x1 area bottom right x coordinate
- * \param y1 area bottom right y coordinate
- * \param x window x offset
- * \param y window y offset
- * \param ctx current redraw context
+ * \param entry   entry to render
+ * \param clip    redraw area
+ * \param x       window x offset
+ * \param y       window y offset
+ * \param ctx     current redraw context
  */
 static bool
 browser_window_history__redraw_entry(struct history *history,
-               struct history_entry *entry,
-               int x0, int y0, int x1, int y1,
+               struct history_entry *entry, struct rect *clip,
                int x, int y, const struct redraw_context *ctx)
 {
        size_t char_offset;
        int actual_x;
        struct history_entry *child;
        int tailsize = 5;
-       int xoffset = x - x0;
-       int yoffset = y - y0;
+       int xoffset = x - clip->x0;
+       int yoffset = y - clip->y0;
 
        plot_style_t *pstyle;
        plot_font_style_t *pfstyle;
@@ -316,10 +312,10 @@ browser_window_history__redraw_entry(struct history 
*history,
        }
 
        /* setup clip area */
-       rect.x0 = x0 + xoffset;
-       rect.y0 = y0 + yoffset;
-       rect.x1 = x1 + xoffset;
-       rect.y1 = y1 + yoffset;
+       rect.x0 = clip->x0 + xoffset;
+       rect.y0 = clip->y0 + yoffset;
+       rect.x1 = clip->x1 + xoffset;
+       rect.y1 = clip->y1 + yoffset;
        res = ctx->plot->clip(ctx, &rect);
        if (res != NSERROR_OK) {
                return false;
@@ -395,7 +391,7 @@ browser_window_history__redraw_entry(struct history 
*history,
                }
 
                if (!browser_window_history__redraw_entry(history, child,
-                       x0, y0, x1, y1, x, y, ctx)) {
+                       clip, x, y, ctx)) {
                        return false;
                }
        }
@@ -778,16 +774,10 @@ void browser_window_history_size(struct browser_window 
*bw,
 
 /* exported interface documented in desktop/browser_history.h */
 bool browser_window_history_redraw_rectangle(struct browser_window *bw,
-       int x0, int y0, int x1, int y1,
-       int x, int y, const struct redraw_context *ctx)
+               struct rect *clip, int x, int y,
+               const struct redraw_context *ctx)
 {
        struct history *history;
-       struct rect rect = {
-               .x0 = x0,
-               .y0 = y0,
-               .x1 = x1,
-               .y1 = y1,
-       };
 
        assert(bw != NULL);
        history = bw->history;
@@ -795,10 +785,11 @@ bool browser_window_history_redraw_rectangle(struct 
browser_window *bw,
        if (!history->start)
                return true;
 
-       ctx->plot->rectangle(ctx, &pstyle_bg, &rect);
+       ctx->plot->rectangle(ctx, &pstyle_bg, clip);
 
-       return browser_window_history__redraw_entry(history, history->start,
-               x0, y0, x1, y1, x, y, ctx);
+       return browser_window_history__redraw_entry(
+                       history, history->start,
+                       clip, x, y, ctx);
 }
 
 
diff --git a/desktop/browser_history.h b/desktop/browser_history.h
index 831eeee..ec625df 100644
--- a/desktop/browser_history.h
+++ b/desktop/browser_history.h
@@ -129,17 +129,14 @@ void browser_window_history_size(struct browser_window 
*bw,
 /**
  * Redraw part of a history area.
  *
- * \param bw browser window with history object.
- * \param x0 left X co-ordinate of redraw area
- * \param y0 top Y co-ordinate of redraw area
- * \param x1 right X co-ordinate of redraw area
- * \param y1 lower Y co-ordinate of redraw area
- * \param x start X co-ordinate on plot canvas
- * \param y start Y co-ordinate on plot canvas
- * \param ctx current redraw context
+ * \param bw   browser window with history object.
+ * \param clip redraw area
+ * \param x    start X co-ordinate on plot canvas
+ * \param y    start Y co-ordinate on plot canvas
+ * \param ctx  current redraw context
  */
 bool browser_window_history_redraw_rectangle(struct browser_window *bw,
-               int x0, int y0, int x1, int y1, int x, int y,
+               struct rect *clip, int x, int y,
                const struct redraw_context *ctx);
 
 /**
diff --git a/desktop/local_history.c b/desktop/local_history.c
index 6d07c8a..d7022d7 100644
--- a/desktop/local_history.c
+++ b/desktop/local_history.c
@@ -77,7 +77,7 @@ local_history_redraw(struct local_history_session *session,
 {
        if (session->bw != NULL) {
                browser_window_history_redraw_rectangle(session->bw,
-                       clip->x0, clip->y0, clip->x1, clip->y1, x, y, ctx);
+                               clip, x, y, ctx);
        }
        return NSERROR_OK;
 }
diff --git a/frontends/amiga/history_local.c b/frontends/amiga/history_local.c
index 368557d..8d1f4ac 100755
--- a/frontends/amiga/history_local.c
+++ b/frontends/amiga/history_local.c
@@ -84,6 +84,7 @@ static void ami_history_redraw(struct history_window *hw)
 {
        struct IBox *bbox;
        ULONG xs,ys;
+       struct rect clip;
        struct redraw_context ctx = {
                .interactive = true,
                .background_images = true,
@@ -102,9 +103,11 @@ static void ami_history_redraw(struct history_window *hw)
        SetRPAttrs(glob->rp, RPTAG_APenColor, 0xffffffff, TAG_DONE);
        RectFill(glob->rp, 0, 0, bbox->Width - 1, bbox->Height - 1);
 */
-
-       browser_window_history_redraw_rectangle(hw->gw->bw, xs, ys,
-                       bbox->Width + xs, bbox->Height + ys, 0, 0, &ctx);
+       clip.x0 = xs;
+       clip.y0 = ys;
+       clip.x1 = bbox->Width + xs;
+       clip.y1 = bbox->Height + ys;
+       browser_window_history_redraw_rectangle(hw->gw->bw, &clip, 0, 0, &ctx);
 
        ami_clearclipreg(hw->gg);
        ami_history_update_extent(hw);
diff --git a/frontends/framebuffer/localhistory.c 
b/frontends/framebuffer/localhistory.c
index 3192f07..b91c947 100644
--- a/frontends/framebuffer/localhistory.c
+++ b/frontends/framebuffer/localhistory.c
@@ -36,6 +36,7 @@ localhistory_redraw(fbtk_widget_t *widget, fbtk_callback_info 
*cbi)
 {
        struct gui_localhistory *glh = cbi->context;
        nsfb_bbox_t rbox;
+       struct rect clip;
 
        struct redraw_context ctx = {
                .interactive = true,
@@ -53,12 +54,13 @@ localhistory_redraw(fbtk_widget_t *widget, 
fbtk_callback_info *cbi)
 
        nsfb_plot_rectangle_fill(fbtk_get_nsfb(widget), &rbox, 0xffffffff);
 
+       clip.x0 = glh->scrollx;
+       clip.y0 = glh->scrolly;
+       clip.x1 = fbtk_get_width(widget) + glh->scrollx;
+       clip.y0 = fbtk_get_height(widget) + glh->scrolly;
+
        browser_window_history_redraw_rectangle(glh->bw,
-                                glh->scrollx,
-                                glh->scrolly,
-                                fbtk_get_width(widget) + glh->scrollx,
-                                fbtk_get_height(widget) + glh->scrolly,
-                                0, 0, &ctx);
+                       &clip, 0, 0, &ctx);
 
        nsfb_update(fbtk_get_nsfb(widget), &rbox);
 
diff --git a/frontends/windows/local_history.c 
b/frontends/windows/local_history.c
index f447423..205ebfe 100644
--- a/frontends/windows/local_history.c
+++ b/frontends/windows/local_history.c
@@ -111,11 +111,7 @@ nsw32_local_history_draw(struct nsw32_corewindow *nsw32_cw,
 
        lhw = (struct nsw32_local_history_window *)nsw32_cw;
 
-       local_history_redraw(lhw->session,
-                            r->x0 - scrollx,
-                            r->y0 - scrolly,
-                            r,
-                            &ctx);
+       local_history_redraw(lhw->session, -scrollx, -scrolly, r, &ctx);
 
        return NSERROR_OK;
 }


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=283d921f346d44bd8d78fdac6a36b5a8516ca722
commit 283d921f346d44bd8d78fdac6a36b5a8516ca722
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Core local history: We always clip, so don't need to handle condition.

diff --git a/desktop/browser_history.c b/desktop/browser_history.c
index 97f4f71..58c472f 100644
--- a/desktop/browser_history.c
+++ b/desktop/browser_history.c
@@ -286,15 +286,13 @@ static plot_font_style_t pfstyle_node_sel = {
  * \param y1 area bottom right y coordinate
  * \param x window x offset
  * \param y window y offset
- * \param clip clip redraw
  * \param ctx current redraw context
  */
 static bool
 browser_window_history__redraw_entry(struct history *history,
                struct history_entry *entry,
                int x0, int y0, int x1, int y1,
-               int x, int y, bool clip,
-               const struct redraw_context *ctx)
+               int x, int y, const struct redraw_context *ctx)
 {
        size_t char_offset;
        int actual_x;
@@ -318,15 +316,13 @@ browser_window_history__redraw_entry(struct history 
*history,
        }
 
        /* setup clip area */
-       if (clip) {
-               rect.x0 = x0 + xoffset;
-               rect.y0 = y0 + yoffset;
-               rect.x1 = x1 + xoffset;
-               rect.y1 = y1 + yoffset;
-               res = ctx->plot->clip(ctx, &rect);
-               if (res != NSERROR_OK) {
-                       return false;
-               }
+       rect.x0 = x0 + xoffset;
+       rect.y0 = y0 + yoffset;
+       rect.x1 = x1 + xoffset;
+       rect.y1 = y1 + yoffset;
+       res = ctx->plot->clip(ctx, &rect);
+       if (res != NSERROR_OK) {
+               return false;
        }
 
        /* Only attempt to plot bitmap if it is present */
@@ -399,7 +395,7 @@ browser_window_history__redraw_entry(struct history 
*history,
                }
 
                if (!browser_window_history__redraw_entry(history, child,
-                       x0, y0, x1, y1, x, y, clip, ctx)) {
+                       x0, y0, x1, y1, x, y, ctx)) {
                        return false;
                }
        }
@@ -802,7 +798,7 @@ bool browser_window_history_redraw_rectangle(struct 
browser_window *bw,
        ctx->plot->rectangle(ctx, &pstyle_bg, &rect);
 
        return browser_window_history__redraw_entry(history, history->start,
-               x0, y0, x1, y1, x, y, true, ctx);
+               x0, y0, x1, y1, x, y, ctx);
 }
 
 


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=5225ca2b90f66b202c520773b0c8c52b0687e6a5
commit 5225ca2b90f66b202c520773b0c8c52b0687e6a5
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Core local history: Remove unused redraw API.

diff --git a/desktop/browser_history.c b/desktop/browser_history.c
index 606a8c6..97f4f71 100644
--- a/desktop/browser_history.c
+++ b/desktop/browser_history.c
@@ -781,36 +781,6 @@ void browser_window_history_size(struct browser_window *bw,
 
 
 /* exported interface documented in desktop/browser_history.h */
-bool browser_window_history_redraw(struct browser_window *bw,
-               const struct redraw_context *ctx)
-{
-       struct history *history;
-       struct rect rect = {
-               .x0 = 0,
-               .y0 = 0,
-       };
-
-       assert(bw != NULL);
-       history = bw->history;
-       rect.x1 = history->width;
-       rect.y1 = history->height;
-
-       if (history == NULL) {
-               LOG("Attempt to draw NULL history.");
-               return false;
-       }
-
-       if (!history->start)
-               return true;
-
-       ctx->plot->rectangle(ctx, &pstyle_bg, &rect);
-
-       return browser_window_history__redraw_entry(history, history->start,
-                       0, 0, 0, 0, 0, 0, false, ctx);
-}
-
-
-/* exported interface documented in desktop/browser_history.h */
 bool browser_window_history_redraw_rectangle(struct browser_window *bw,
        int x0, int y0, int x1, int y1,
        int x, int y, const struct redraw_context *ctx)
diff --git a/desktop/browser_history.h b/desktop/browser_history.h
index 8ffb612..831eeee 100644
--- a/desktop/browser_history.h
+++ b/desktop/browser_history.h
@@ -127,15 +127,6 @@ void browser_window_history_size(struct browser_window *bw,
                int *width, int *height);
 
 /**
- * Redraw all of a history area.
- *
- * \param bw browser window with history object.
- * \param ctx current redraw context
- */
-bool browser_window_history_redraw(struct browser_window *bw,
-               const struct redraw_context *ctx);
-
-/**
  * Redraw part of a history area.
  *
  * \param bw browser window with history object.


-----------------------------------------------------------------------

Summary of changes:
 desktop/browser_history.c            |  129 +++++++++++-----------------------
 desktop/browser_history.h            |   24 ++-----
 desktop/local_history.c              |    2 +-
 frontends/amiga/history_local.c      |    9 ++-
 frontends/framebuffer/localhistory.c |   12 ++--
 frontends/gtk/local_history.c        |    2 +-
 frontends/riscos/local_history.c     |    2 +-
 frontends/windows/local_history.c    |    6 +-
 8 files changed, 64 insertions(+), 122 deletions(-)

diff --git a/desktop/browser_history.c b/desktop/browser_history.c
index 606a8c6..c5f2923 100644
--- a/desktop/browser_history.c
+++ b/desktop/browser_history.c
@@ -279,29 +279,21 @@ static plot_font_style_t pfstyle_node_sel = {
  * Recursively redraw a history_entry.
  *
  * \param history history containing the entry
- * \param entry entry to render
- * \param x0 area top left x coordinate
- * \param y0 area top left y coordinate
- * \param x1 area bottom right x coordinate
- * \param y1 area bottom right y coordinate
- * \param x window x offset
- * \param y window y offset
- * \param clip clip redraw
- * \param ctx current redraw context
+ * \param entry   entry to render
+ * \param clip    redraw area
+ * \param x       window x offset
+ * \param y       window y offset
+ * \param ctx     current redraw context
  */
 static bool
 browser_window_history__redraw_entry(struct history *history,
-               struct history_entry *entry,
-               int x0, int y0, int x1, int y1,
-               int x, int y, bool clip,
-               const struct redraw_context *ctx)
+               struct history_entry *entry, struct rect *clip,
+               int x, int y, const struct redraw_context *ctx)
 {
        size_t char_offset;
        int actual_x;
        struct history_entry *child;
        int tailsize = 5;
-       int xoffset = x - x0;
-       int yoffset = y - y0;
 
        plot_style_t *pstyle;
        plot_font_style_t *pfstyle;
@@ -317,24 +309,12 @@ browser_window_history__redraw_entry(struct history 
*history,
                pfstyle = &pfstyle_node;
        }
 
-       /* setup clip area */
-       if (clip) {
-               rect.x0 = x0 + xoffset;
-               rect.y0 = y0 + yoffset;
-               rect.x1 = x1 + xoffset;
-               rect.y1 = y1 + yoffset;
-               res = ctx->plot->clip(ctx, &rect);
-               if (res != NSERROR_OK) {
-                       return false;
-               }
-       }
-
        /* Only attempt to plot bitmap if it is present */
        if (entry->bitmap != NULL) {
                res = ctx->plot->bitmap(ctx,
                                        entry->bitmap,
-                                       entry->x + xoffset,
-                                       entry->y + yoffset,
+                                       entry->x + x,
+                                       entry->y + y,
                                        WIDTH, HEIGHT,
                                        0xffffff,
                                        0);
@@ -343,10 +323,10 @@ browser_window_history__redraw_entry(struct history 
*history,
                }
        }
 
-       rect.x0 = entry->x - 1 + xoffset;
-       rect.y0 = entry->y - 1 + yoffset;
-       rect.x1 = entry->x + xoffset + WIDTH;
-       rect.y1 = entry->y + yoffset + HEIGHT;
+       rect.x0 = entry->x - 1 + x;
+       rect.y0 = entry->y - 1 + y;
+       rect.x1 = entry->x + x + WIDTH;
+       rect.y1 = entry->y + y + HEIGHT;
        res = ctx->plot->rectangle(ctx, pstyle, &rect);
        if (res != NSERROR_OK) {
                return false;
@@ -361,8 +341,8 @@ browser_window_history__redraw_entry(struct history 
*history,
 
        res = ctx->plot->text(ctx,
                              pfstyle,
-                             entry->x + xoffset,
-                             entry->y + HEIGHT + 12 + yoffset,
+                             entry->x + x,
+                             entry->y + HEIGHT + 12 + y,
                              entry->page.title,
                              char_offset);
        if (res != NSERROR_OK) {
@@ -371,35 +351,35 @@ browser_window_history__redraw_entry(struct history 
*history,
 
        /* for each child node draw a line and recurse redraw into it */
        for (child = entry->forward; child; child = child->next) {
-               rect.x0 = entry->x + WIDTH + xoffset;
-               rect.y0 = entry->y + HEIGHT / 2 + yoffset;
-               rect.x1 = entry->x + WIDTH + tailsize + xoffset;
-               rect.y1 = entry->y + HEIGHT / 2 + yoffset;
+               rect.x0 = entry->x + WIDTH + x;
+               rect.y0 = entry->y + HEIGHT / 2 + y;
+               rect.x1 = entry->x + WIDTH + tailsize + x;
+               rect.y1 = entry->y + HEIGHT / 2 + y;
                res = ctx->plot->line(ctx, &pstyle_line, &rect);
                if (res != NSERROR_OK) {
                        return false;
                }
 
-               rect.x0 = entry->x + WIDTH + tailsize + xoffset;
-               rect.y0 = entry->y + HEIGHT / 2 + yoffset;
-               rect.x1 = child->x - tailsize + xoffset;
-               rect.y1 = child->y + HEIGHT / 2 + yoffset;
+               rect.x0 = entry->x + WIDTH + tailsize + x;
+               rect.y0 = entry->y + HEIGHT / 2 + y;
+               rect.x1 = child->x - tailsize + x;
+               rect.y1 = child->y + HEIGHT / 2 + y;
                res = ctx->plot->line(ctx, &pstyle_line, &rect);
                if (res != NSERROR_OK) {
                        return false;
                }
 
-               rect.x0 = child->x - tailsize + xoffset;
-               rect.y0 = child->y + HEIGHT / 2 + yoffset;
-               rect.x1 = child->x + xoffset;
-               rect.y1 = child->y + HEIGHT / 2 + yoffset;
+               rect.x0 = child->x - tailsize + x;
+               rect.y0 = child->y + HEIGHT / 2 + y;
+               rect.x1 = child->x + x;
+               rect.y1 = child->y + HEIGHT / 2 + y;
                res = ctx->plot->line(ctx, &pstyle_line, &rect);
                if (res != NSERROR_OK) {
                        return false;
                }
 
                if (!browser_window_history__redraw_entry(history, child,
-                       x0, y0, x1, y1, x, y, clip, ctx)) {
+                       clip, x, y, ctx)) {
                        return false;
                }
        }
@@ -485,6 +465,7 @@ nserror browser_window_history_create(struct browser_window 
*bw)
        if (res != NSERROR_OK) {
                return res;
        }
+       pstyle_bg.fill_colour = 0xf888ff;
        pfstyle_node.background = pstyle_bg.fill_colour;
        pfstyle_node_sel.background = pstyle_bg.fill_colour;
 
@@ -781,46 +762,16 @@ void browser_window_history_size(struct browser_window 
*bw,
 
 
 /* exported interface documented in desktop/browser_history.h */
-bool browser_window_history_redraw(struct browser_window *bw,
-               const struct redraw_context *ctx)
-{
-       struct history *history;
-       struct rect rect = {
-               .x0 = 0,
-               .y0 = 0,
-       };
-
-       assert(bw != NULL);
-       history = bw->history;
-       rect.x1 = history->width;
-       rect.y1 = history->height;
-
-       if (history == NULL) {
-               LOG("Attempt to draw NULL history.");
-               return false;
-       }
-
-       if (!history->start)
-               return true;
-
-       ctx->plot->rectangle(ctx, &pstyle_bg, &rect);
-
-       return browser_window_history__redraw_entry(history, history->start,
-                       0, 0, 0, 0, 0, 0, false, ctx);
-}
-
-
-/* exported interface documented in desktop/browser_history.h */
 bool browser_window_history_redraw_rectangle(struct browser_window *bw,
-       int x0, int y0, int x1, int y1,
-       int x, int y, const struct redraw_context *ctx)
+               struct rect *clip, int x, int y,
+               const struct redraw_context *ctx)
 {
        struct history *history;
-       struct rect rect = {
-               .x0 = x0,
-               .y0 = y0,
-               .x1 = x1,
-               .y1 = y1,
+       struct rect r = {
+               .x0 = clip->x0 + x,
+               .y0 = clip->y0 + y,
+               .x1 = clip->x1 + x,
+               .y1 = clip->y1 + y,
        };
 
        assert(bw != NULL);
@@ -829,10 +780,12 @@ bool browser_window_history_redraw_rectangle(struct 
browser_window *bw,
        if (!history->start)
                return true;
 
-       ctx->plot->rectangle(ctx, &pstyle_bg, &rect);
+       ctx->plot->clip(ctx, &r);
+       ctx->plot->rectangle(ctx, &pstyle_bg, &r);
 
-       return browser_window_history__redraw_entry(history, history->start,
-               x0, y0, x1, y1, x, y, true, ctx);
+       return browser_window_history__redraw_entry(
+                       history, history->start,
+                       clip, x, y, ctx);
 }
 
 
diff --git a/desktop/browser_history.h b/desktop/browser_history.h
index 8ffb612..ec625df 100644
--- a/desktop/browser_history.h
+++ b/desktop/browser_history.h
@@ -127,28 +127,16 @@ void browser_window_history_size(struct browser_window 
*bw,
                int *width, int *height);
 
 /**
- * Redraw all of a history area.
- *
- * \param bw browser window with history object.
- * \param ctx current redraw context
- */
-bool browser_window_history_redraw(struct browser_window *bw,
-               const struct redraw_context *ctx);
-
-/**
  * Redraw part of a history area.
  *
- * \param bw browser window with history object.
- * \param x0 left X co-ordinate of redraw area
- * \param y0 top Y co-ordinate of redraw area
- * \param x1 right X co-ordinate of redraw area
- * \param y1 lower Y co-ordinate of redraw area
- * \param x start X co-ordinate on plot canvas
- * \param y start Y co-ordinate on plot canvas
- * \param ctx current redraw context
+ * \param bw   browser window with history object.
+ * \param clip redraw area
+ * \param x    start X co-ordinate on plot canvas
+ * \param y    start Y co-ordinate on plot canvas
+ * \param ctx  current redraw context
  */
 bool browser_window_history_redraw_rectangle(struct browser_window *bw,
-               int x0, int y0, int x1, int y1, int x, int y,
+               struct rect *clip, int x, int y,
                const struct redraw_context *ctx);
 
 /**
diff --git a/desktop/local_history.c b/desktop/local_history.c
index 6d07c8a..d7022d7 100644
--- a/desktop/local_history.c
+++ b/desktop/local_history.c
@@ -77,7 +77,7 @@ local_history_redraw(struct local_history_session *session,
 {
        if (session->bw != NULL) {
                browser_window_history_redraw_rectangle(session->bw,
-                       clip->x0, clip->y0, clip->x1, clip->y1, x, y, ctx);
+                               clip, x, y, ctx);
        }
        return NSERROR_OK;
 }
diff --git a/frontends/amiga/history_local.c b/frontends/amiga/history_local.c
index 368557d..8d1f4ac 100755
--- a/frontends/amiga/history_local.c
+++ b/frontends/amiga/history_local.c
@@ -84,6 +84,7 @@ static void ami_history_redraw(struct history_window *hw)
 {
        struct IBox *bbox;
        ULONG xs,ys;
+       struct rect clip;
        struct redraw_context ctx = {
                .interactive = true,
                .background_images = true,
@@ -102,9 +103,11 @@ static void ami_history_redraw(struct history_window *hw)
        SetRPAttrs(glob->rp, RPTAG_APenColor, 0xffffffff, TAG_DONE);
        RectFill(glob->rp, 0, 0, bbox->Width - 1, bbox->Height - 1);
 */
-
-       browser_window_history_redraw_rectangle(hw->gw->bw, xs, ys,
-                       bbox->Width + xs, bbox->Height + ys, 0, 0, &ctx);
+       clip.x0 = xs;
+       clip.y0 = ys;
+       clip.x1 = bbox->Width + xs;
+       clip.y1 = bbox->Height + ys;
+       browser_window_history_redraw_rectangle(hw->gw->bw, &clip, 0, 0, &ctx);
 
        ami_clearclipreg(hw->gg);
        ami_history_update_extent(hw);
diff --git a/frontends/framebuffer/localhistory.c 
b/frontends/framebuffer/localhistory.c
index 3192f07..b91c947 100644
--- a/frontends/framebuffer/localhistory.c
+++ b/frontends/framebuffer/localhistory.c
@@ -36,6 +36,7 @@ localhistory_redraw(fbtk_widget_t *widget, fbtk_callback_info 
*cbi)
 {
        struct gui_localhistory *glh = cbi->context;
        nsfb_bbox_t rbox;
+       struct rect clip;
 
        struct redraw_context ctx = {
                .interactive = true,
@@ -53,12 +54,13 @@ localhistory_redraw(fbtk_widget_t *widget, 
fbtk_callback_info *cbi)
 
        nsfb_plot_rectangle_fill(fbtk_get_nsfb(widget), &rbox, 0xffffffff);
 
+       clip.x0 = glh->scrollx;
+       clip.y0 = glh->scrolly;
+       clip.x1 = fbtk_get_width(widget) + glh->scrollx;
+       clip.y0 = fbtk_get_height(widget) + glh->scrolly;
+
        browser_window_history_redraw_rectangle(glh->bw,
-                                glh->scrollx,
-                                glh->scrolly,
-                                fbtk_get_width(widget) + glh->scrollx,
-                                fbtk_get_height(widget) + glh->scrolly,
-                                0, 0, &ctx);
+                       &clip, 0, 0, &ctx);
 
        nsfb_update(fbtk_get_nsfb(widget), &rbox);
 
diff --git a/frontends/gtk/local_history.c b/frontends/gtk/local_history.c
index 650cb4f..b36ccd2 100644
--- a/frontends/gtk/local_history.c
+++ b/frontends/gtk/local_history.c
@@ -116,7 +116,7 @@ nsgtk_local_history_draw(struct nsgtk_corewindow *nsgtk_cw, 
struct rect *r)
        lhw = (struct nsgtk_local_history_window *)nsgtk_cw;
 
        ctx.plot->clip(&ctx, r);
-       local_history_redraw(lhw->session, r->x0, r->y0, r, &ctx);
+       local_history_redraw(lhw->session, 0, 0, r, &ctx);
 
        return NSERROR_OK;
 }
diff --git a/frontends/riscos/local_history.c b/frontends/riscos/local_history.c
index fae78e6..1ad63e0 100644
--- a/frontends/riscos/local_history.c
+++ b/frontends/riscos/local_history.c
@@ -90,7 +90,7 @@ ro_local_history_draw(struct ro_corewindow *ro_cw,
        ro_plot_origin_x = originx;
        ro_plot_origin_y = originy;
        no_font_blending = true;
-       local_history_redraw(lhw->session, r->x0, r->y0, r, &ctx);
+       local_history_redraw(lhw->session, 0, 0, r, &ctx);
        no_font_blending = false;
 
        return NSERROR_OK;
diff --git a/frontends/windows/local_history.c 
b/frontends/windows/local_history.c
index f447423..205ebfe 100644
--- a/frontends/windows/local_history.c
+++ b/frontends/windows/local_history.c
@@ -111,11 +111,7 @@ nsw32_local_history_draw(struct nsw32_corewindow *nsw32_cw,
 
        lhw = (struct nsw32_local_history_window *)nsw32_cw;
 
-       local_history_redraw(lhw->session,
-                            r->x0 - scrollx,
-                            r->y0 - scrolly,
-                            r,
-                            &ctx);
+       local_history_redraw(lhw->session, -scrollx, -scrolly, r, &ctx);
 
        return NSERROR_OK;
 }


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to