Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/ec94d5f812723c586b26d4c1700b641e5cb2f7a0
...commit
http://git.netsurf-browser.org/netsurf.git/commit/ec94d5f812723c586b26d4c1700b641e5cb2f7a0
...tree
http://git.netsurf-browser.org/netsurf.git/tree/ec94d5f812723c586b26d4c1700b641e5cb2f7a0
The branch, master has been updated
via ec94d5f812723c586b26d4c1700b641e5cb2f7a0 (commit)
from 02a8b5bca0cfe8307624dc7c2bf736069c0a2e0b (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=ec94d5f812723c586b26d4c1700b641e5cb2f7a0
commit ec94d5f812723c586b26d4c1700b641e5cb2f7a0
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>
move history bitmap thumbnail into the page information structure
diff --git a/desktop/browser_history.c b/desktop/browser_history.c
index c7d0104..ba122f3 100644
--- a/desktop/browser_history.c
+++ b/desktop/browser_history.c
@@ -326,19 +326,21 @@ nserror browser_window_history_add(struct browser_window
*bw,
}
entry->page.url = nsurl_ref(nsurl);
- entry->page.frag_id = frag_id ? lwc_string_ref(frag_id) : 0;
-
+ entry->page.frag_id = frag_id ? lwc_string_ref(frag_id) : NULL;
entry->page.title = title;
+ entry->page.bitmap = NULL;
+
entry->back = history->current;
entry->next = 0;
entry->forward = entry->forward_pref = entry->forward_last = 0;
entry->children = 0;
- entry->bitmap = 0;
+
if (history->current) {
- if (history->current->forward_last)
+ if (history->current->forward_last) {
history->current->forward_last->next = entry;
- else
+ } else {
history->current->forward = entry;
+ }
history->current->forward_pref = entry;
history->current->forward_last = entry;
history->current->children++;
@@ -373,7 +375,7 @@ nserror browser_window_history_add(struct browser_window
*bw,
}
}
}
- entry->bitmap = bitmap;
+ entry->page.bitmap = bitmap;
browser_window_history__layout(history);
@@ -392,7 +394,9 @@ nserror browser_window_history_update(struct browser_window
*bw,
history = bw->history;
- if (!history || !history->current || !history->current->bitmap) {
+ if (!history ||
+ !history->current ||
+ !history->current->page.bitmap) {
return NSERROR_INVALID;
}
@@ -407,7 +411,7 @@ nserror browser_window_history_update(struct browser_window
*bw,
free(history->current->page.title);
history->current->page.title = title;
- guit->bitmap->render(history->current->bitmap, content);
+ guit->bitmap->render(history->current->page.bitmap, content);
return NSERROR_OK;
}
diff --git a/desktop/browser_private.h b/desktop/browser_private.h
index 8bbc573..3cdef5c 100644
--- a/desktop/browser_private.h
+++ b/desktop/browser_private.h
@@ -45,6 +45,7 @@ struct history_page {
struct nsurl *url; /**< Page URL, never NULL. */
lwc_string *frag_id; /** Fragment identifier, or NULL. */
char *title; /**< Page title, never NULL. */
+ struct bitmap *bitmap; /**< Thumbnail bitmap, or NULL. */
};
/**
@@ -61,7 +62,6 @@ struct history_entry {
unsigned int children; /**< Number of children. */
int x; /**< Position of node. */
int y; /**< Position of node. */
- struct bitmap *bitmap; /**< Thumbnail bitmap, or 0. */
};
/**
diff --git a/desktop/local_history.c b/desktop/local_history.c
index 01222e2..3219de9 100644
--- a/desktop/local_history.c
+++ b/desktop/local_history.c
@@ -144,9 +144,9 @@ redraw_entry(struct history *history,
}
/* Only attempt to plot bitmap if it is present */
- if (entry->bitmap != NULL) {
+ if (entry->page.bitmap != NULL) {
res = ctx->plot->bitmap(ctx,
- entry->bitmap,
+ entry->page.bitmap,
entry->x + x,
entry->y + y,
WIDTH, HEIGHT,
diff --git a/desktop/save_complete.c b/desktop/save_complete.c
index cd1ac53..9a88ad1 100644
--- a/desktop/save_complete.c
+++ b/desktop/save_complete.c
@@ -195,10 +195,12 @@ static bool save_complete_save_buffer(save_complete_ctx
*ctx,
* \param osize updated with the size of the result.
* \return converted source, or NULL on out of memory.
*/
-
-static char *save_complete_rewrite_stylesheet_urls(save_complete_ctx *ctx,
- const char *source, unsigned long size, const nsurl *base,
- unsigned long *osize)
+static char *
+save_complete_rewrite_stylesheet_urls(save_complete_ctx *ctx,
+ const char *source,
+ unsigned long size,
+ const nsurl *base,
+ unsigned long *osize)
{
char *rewritten;
unsigned long offset = 0;
@@ -207,8 +209,9 @@ static char
*save_complete_rewrite_stylesheet_urls(save_complete_ctx *ctx,
/* count number occurrences of @import to (over)estimate result size */
/* can't use strstr because source is not 0-terminated string */
- for (offset = 0; SLEN("@import") < size &&
- offset <= size - SLEN("@import"); offset++) {
+ for (offset = 0;
+ (SLEN("@import") < size) && (offset <= (size - SLEN("@import")));
+ offset++) {
if (source[offset] == '@' &&
ascii_to_lower(source[offset + 1]) == 'i' &&
ascii_to_lower(source[offset + 2]) == 'm' &&
-----------------------------------------------------------------------
Summary of changes:
desktop/browser_history.c | 20 ++++++++++++--------
desktop/browser_private.h | 2 +-
desktop/local_history.c | 4 ++--
desktop/save_complete.c | 15 +++++++++------
4 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/desktop/browser_history.c b/desktop/browser_history.c
index c7d0104..ba122f3 100644
--- a/desktop/browser_history.c
+++ b/desktop/browser_history.c
@@ -326,19 +326,21 @@ nserror browser_window_history_add(struct browser_window
*bw,
}
entry->page.url = nsurl_ref(nsurl);
- entry->page.frag_id = frag_id ? lwc_string_ref(frag_id) : 0;
-
+ entry->page.frag_id = frag_id ? lwc_string_ref(frag_id) : NULL;
entry->page.title = title;
+ entry->page.bitmap = NULL;
+
entry->back = history->current;
entry->next = 0;
entry->forward = entry->forward_pref = entry->forward_last = 0;
entry->children = 0;
- entry->bitmap = 0;
+
if (history->current) {
- if (history->current->forward_last)
+ if (history->current->forward_last) {
history->current->forward_last->next = entry;
- else
+ } else {
history->current->forward = entry;
+ }
history->current->forward_pref = entry;
history->current->forward_last = entry;
history->current->children++;
@@ -373,7 +375,7 @@ nserror browser_window_history_add(struct browser_window
*bw,
}
}
}
- entry->bitmap = bitmap;
+ entry->page.bitmap = bitmap;
browser_window_history__layout(history);
@@ -392,7 +394,9 @@ nserror browser_window_history_update(struct browser_window
*bw,
history = bw->history;
- if (!history || !history->current || !history->current->bitmap) {
+ if (!history ||
+ !history->current ||
+ !history->current->page.bitmap) {
return NSERROR_INVALID;
}
@@ -407,7 +411,7 @@ nserror browser_window_history_update(struct browser_window
*bw,
free(history->current->page.title);
history->current->page.title = title;
- guit->bitmap->render(history->current->bitmap, content);
+ guit->bitmap->render(history->current->page.bitmap, content);
return NSERROR_OK;
}
diff --git a/desktop/browser_private.h b/desktop/browser_private.h
index 8bbc573..3cdef5c 100644
--- a/desktop/browser_private.h
+++ b/desktop/browser_private.h
@@ -45,6 +45,7 @@ struct history_page {
struct nsurl *url; /**< Page URL, never NULL. */
lwc_string *frag_id; /** Fragment identifier, or NULL. */
char *title; /**< Page title, never NULL. */
+ struct bitmap *bitmap; /**< Thumbnail bitmap, or NULL. */
};
/**
@@ -61,7 +62,6 @@ struct history_entry {
unsigned int children; /**< Number of children. */
int x; /**< Position of node. */
int y; /**< Position of node. */
- struct bitmap *bitmap; /**< Thumbnail bitmap, or 0. */
};
/**
diff --git a/desktop/local_history.c b/desktop/local_history.c
index 01222e2..3219de9 100644
--- a/desktop/local_history.c
+++ b/desktop/local_history.c
@@ -144,9 +144,9 @@ redraw_entry(struct history *history,
}
/* Only attempt to plot bitmap if it is present */
- if (entry->bitmap != NULL) {
+ if (entry->page.bitmap != NULL) {
res = ctx->plot->bitmap(ctx,
- entry->bitmap,
+ entry->page.bitmap,
entry->x + x,
entry->y + y,
WIDTH, HEIGHT,
diff --git a/desktop/save_complete.c b/desktop/save_complete.c
index cd1ac53..9a88ad1 100644
--- a/desktop/save_complete.c
+++ b/desktop/save_complete.c
@@ -195,10 +195,12 @@ static bool save_complete_save_buffer(save_complete_ctx
*ctx,
* \param osize updated with the size of the result.
* \return converted source, or NULL on out of memory.
*/
-
-static char *save_complete_rewrite_stylesheet_urls(save_complete_ctx *ctx,
- const char *source, unsigned long size, const nsurl *base,
- unsigned long *osize)
+static char *
+save_complete_rewrite_stylesheet_urls(save_complete_ctx *ctx,
+ const char *source,
+ unsigned long size,
+ const nsurl *base,
+ unsigned long *osize)
{
char *rewritten;
unsigned long offset = 0;
@@ -207,8 +209,9 @@ static char
*save_complete_rewrite_stylesheet_urls(save_complete_ctx *ctx,
/* count number occurrences of @import to (over)estimate result size */
/* can't use strstr because source is not 0-terminated string */
- for (offset = 0; SLEN("@import") < size &&
- offset <= size - SLEN("@import"); offset++) {
+ for (offset = 0;
+ (SLEN("@import") < size) && (offset <= (size - SLEN("@import")));
+ offset++) {
if (source[offset] == '@' &&
ascii_to_lower(source[offset + 1]) == 'i' &&
ascii_to_lower(source[offset + 2]) == 'm' &&
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org