netsurf: branch master updated. release/3.9-534-g0e6ba16
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/0e6ba162b22ca64b323ed...
...commit http://git.netsurf-browser.org/netsurf.git/commit/0e6ba162b22ca64b323ed90...
...tree http://git.netsurf-browser.org/netsurf.git/tree/0e6ba162b22ca64b323ed9071...
The branch, master has been updated
via 0e6ba162b22ca64b323ed9071c64a3e31b93c0f6 (commit)
from 14286b381b12034140768800c7ba10baa7c3b334 (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=0e6ba162b22ca64b323...
commit 0e6ba162b22ca64b323ed9071c64a3e31b93c0f6
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Internal content: Restyle certificate viewer page.
diff --git a/content/fetchers/about.c b/content/fetchers/about.c
index c140fde..aa68fd2 100644
--- a/content/fetchers/about.c
+++ b/content/fetchers/about.c
@@ -31,6 +31,8 @@
#include <stdio.h>
#include <stdarg.h>
+#include "netsurf/plot_style.h"
+
#include "utils/log.h"
#include "testament.h"
#include "utils/corestrings.h"
@@ -44,6 +46,8 @@
#include "content/fetchers/about.h"
#include "image/image_cache.h"
+#include "desktop/system_colour.h"
+
struct fetch_about_context;
typedef bool (*fetch_about_handler)(struct fetch_about_context *);
@@ -577,6 +581,28 @@ static bool fetch_about_certificate_handler(struct fetch_about_context *ctx)
nserror res;
struct cert_chain *chain = NULL;
+ colour bg;
+ colour fg;
+ colour border;
+ colour outside;
+
+ res = ns_system_colour_char("Window", &bg);
+ if (res != NSERROR_OK) {
+ return false;
+ }
+
+ res = ns_system_colour_char("WindowText", &fg);
+ if (res != NSERROR_OK) {
+ return false;
+ }
+
+ outside = mix_colour(fg, bg, 0x0c);
+ border = mix_colour(fg, bg, 0x40);
+
+ bg = colour_rb_swap(bg);
+ fg = colour_rb_swap(fg);
+ border = colour_rb_swap(border);
+ outside = colour_rb_swap(outside);
/* content is going to return ok */
fetch_set_http_code(ctx->fetchh, code);
@@ -587,17 +613,27 @@ static bool fetch_about_certificate_handler(struct fetch_about_context *ctx)
/* page head */
res = ssenddataf(ctx,
- "<html>\n<head>\n"
+ "<html>\n<head>\n"
"<title>NetSurf Browser Certificate Viewer</title>\n"
"<link rel=\"stylesheet\" type=\"text/css\" "
- "href=\"resource:internal.css\">\n"
+ "href=\"resource:internal.css\">\n"
+ "<style>\n"
+ "html {\n"
+ "\tbackground-color: #%06x;\n"
+ "}\n"
+ "body {\n"
+ "\tcolor: #%06x;\n"
+ "\tbackground-color: #%06x;\n"
+ "\tborder-color: #%06x;\n"
+ "}\n"
+ "h2 {\n"
+ "\tborder-color: #%06x;\n"
+ "}\n"
+ "</style>\n"
"</head>\n"
"<body id =\"certificate\">\n"
- "<p class=\"banner\">"
- "<a href=\"http://www.netsurf-browser.org/\">"
- "<img src=\"resource:netsurf.png\" alt=\"NetSurf\"></a>"
- "</p>\n"
- "<h1>NetSurf Browser Certificate Viewer</h1>\n");
+ "<h1>Certificate</h1>\n",
+ outside, fg, bg, border, border);
if (res != NSERROR_OK) {
goto fetch_about_certificate_handler_aborted;
}
diff --git a/resources/internal.css b/resources/internal.css
index f98f0cc..8dcc7cf 100644
--- a/resources/internal.css
+++ b/resources/internal.css
@@ -40,7 +40,8 @@ h1 {
h2 {
font-size: 160%;
padding-top: 5mm;
- border-top: 1px solid black; }
+ border-top-width: 1px;
+ border-top-style: solid; }
h3 {
font-size: 140%;
-----------------------------------------------------------------------
Summary of changes:
content/fetchers/about.c | 50 +++++++++++++++++++++++++++++++++++++++-------
resources/internal.css | 3 ++-
2 files changed, 45 insertions(+), 8 deletions(-)
diff --git a/content/fetchers/about.c b/content/fetchers/about.c
index c140fde..aa68fd2 100644
--- a/content/fetchers/about.c
+++ b/content/fetchers/about.c
@@ -31,6 +31,8 @@
#include <stdio.h>
#include <stdarg.h>
+#include "netsurf/plot_style.h"
+
#include "utils/log.h"
#include "testament.h"
#include "utils/corestrings.h"
@@ -44,6 +46,8 @@
#include "content/fetchers/about.h"
#include "image/image_cache.h"
+#include "desktop/system_colour.h"
+
struct fetch_about_context;
typedef bool (*fetch_about_handler)(struct fetch_about_context *);
@@ -577,6 +581,28 @@ static bool fetch_about_certificate_handler(struct fetch_about_context *ctx)
nserror res;
struct cert_chain *chain = NULL;
+ colour bg;
+ colour fg;
+ colour border;
+ colour outside;
+
+ res = ns_system_colour_char("Window", &bg);
+ if (res != NSERROR_OK) {
+ return false;
+ }
+
+ res = ns_system_colour_char("WindowText", &fg);
+ if (res != NSERROR_OK) {
+ return false;
+ }
+
+ outside = mix_colour(fg, bg, 0x0c);
+ border = mix_colour(fg, bg, 0x40);
+
+ bg = colour_rb_swap(bg);
+ fg = colour_rb_swap(fg);
+ border = colour_rb_swap(border);
+ outside = colour_rb_swap(outside);
/* content is going to return ok */
fetch_set_http_code(ctx->fetchh, code);
@@ -587,17 +613,27 @@ static bool fetch_about_certificate_handler(struct fetch_about_context *ctx)
/* page head */
res = ssenddataf(ctx,
- "<html>\n<head>\n"
+ "<html>\n<head>\n"
"<title>NetSurf Browser Certificate Viewer</title>\n"
"<link rel=\"stylesheet\" type=\"text/css\" "
- "href=\"resource:internal.css\">\n"
+ "href=\"resource:internal.css\">\n"
+ "<style>\n"
+ "html {\n"
+ "\tbackground-color: #%06x;\n"
+ "}\n"
+ "body {\n"
+ "\tcolor: #%06x;\n"
+ "\tbackground-color: #%06x;\n"
+ "\tborder-color: #%06x;\n"
+ "}\n"
+ "h2 {\n"
+ "\tborder-color: #%06x;\n"
+ "}\n"
+ "</style>\n"
"</head>\n"
"<body id =\"certificate\">\n"
- "<p class=\"banner\">"
- "<a href=\"http://www.netsurf-browser.org/\">"
- "<img src=\"resource:netsurf.png\" alt=\"NetSurf\"></a>"
- "</p>\n"
- "<h1>NetSurf Browser Certificate Viewer</h1>\n");
+ "<h1>Certificate</h1>\n",
+ outside, fg, bg, border, border);
if (res != NSERROR_OK) {
goto fetch_about_certificate_handler_aborted;
}
diff --git a/resources/internal.css b/resources/internal.css
index f98f0cc..8dcc7cf 100644
--- a/resources/internal.css
+++ b/resources/internal.css
@@ -40,7 +40,8 @@ h1 {
h2 {
font-size: 160%;
padding-top: 5mm;
- border-top: 1px solid black; }
+ border-top-width: 1px;
+ border-top-style: solid; }
h3 {
font-size: 140%;
--
NetSurf Browser
3 years, 7 months
netsurf: branch master updated. release/3.9-533-g14286b3
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/14286b381b12034140768...
...commit http://git.netsurf-browser.org/netsurf.git/commit/14286b381b1203414076880...
...tree http://git.netsurf-browser.org/netsurf.git/tree/14286b381b12034140768800c...
The branch, master has been updated
via 14286b381b12034140768800c7ba10baa7c3b334 (commit)
via 5dd1a81f9c97d852faa54e0d96482b69739fe8dc (commit)
from 921568166bc924f2c5e587095012d7a34a472ed5 (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=14286b381b120341407...
commit 14286b381b12034140768800c7ba10baa7c3b334
Author: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Commit: Daniel Silverstone <dsilvers(a)digital-scurf.org>
fs_backing_store: Remove cache on failure to init
If we fail to init the control file for reasons other than it
not being found, we blow away the cache in its entirety and then
try again. We warn if the removal fails, but carry on regardless
since right now the worst that'll happen is that we'll end up
with more on disk than we know about in the cache.
Signed-off-by: Daniel Silverstone <dsilvers(a)digital-scurf.org>
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index ff1c265..458866c 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -62,7 +62,7 @@
#define DEFAULT_ENTRY_SIZE 16
/** Backing store file format version */
-#define CONTROL_VERSION 201
+#define CONTROL_VERSION 202
/** Number of milliseconds after a update before control data maintenance is performed */
#define CONTROL_MAINT_TIME 10000
@@ -1461,8 +1461,22 @@ initialise(const struct llcache_store_parameters *parameters)
/* read store control and create new if required */
ret = read_control(newstate);
if (ret != NSERROR_OK) {
- NSLOG(netsurf, ERROR, "read control failed %s",
- messages_get_errorcode(ret));
+ if (ret == NSERROR_NOT_FOUND) {
+ NSLOG(netsurf, INFO, "cache control file not found, making fresh");
+ } else {
+ NSLOG(netsurf, ERROR, "read control failed %s",
+ messages_get_errorcode(ret));
+ ret = netsurf_recursive_rm(newstate->path);
+ if (ret != NSERROR_OK) {
+ NSLOG(netsurf, WARNING, "Error `%s` while removing `%s`",
+ messages_get_errorcode(ret), newstate->path);
+ NSLOG(netsurf, WARNING, "Unable to clean up partial cache state.");
+ NSLOG(netsurf, WARNING, "Funky behaviour may ensue.");
+ } else {
+ NSLOG(netsurf, INFO, "Successfully removed old cache from `%s`",
+ newstate->path);
+ }
+ }
ret = write_control(newstate);
if (ret == NSERROR_OK) {
unlink_entries(newstate);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=5dd1a81f9c97d852faa...
commit 5dd1a81f9c97d852faa54e0d96482b69739fe8dc
Author: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Commit: Daniel Silverstone <dsilvers(a)digital-scurf.org>
utils/file: Add netsurf_recursive_rm
This is to be used to remove the disc cache (and other things
if useful in the future)
Signed-off-by: Daniel Silverstone <dsilvers(a)digital-scurf.org>
diff --git a/utils/file.c b/utils/file.c
index cc82657..7eff6a7 100644
--- a/utils/file.c
+++ b/utils/file.c
@@ -26,6 +26,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <errno.h>
#include "desktop/gui_internal.h"
@@ -35,6 +36,7 @@
#include "utils/nsurl.h"
#include "utils/string.h"
#include "utils/file.h"
+#include "utils/dirent.h"
/**
* Generate a posix path from one or more component elemnts.
@@ -307,3 +309,76 @@ nserror netsurf_mkdir_all(const char *fname)
{
return guit->file->mkdir_all(fname);
}
+
+/* exported interface documented in utils/file.h */
+nserror
+netsurf_recursive_rm(const char *path)
+{
+ struct dirent **listing = NULL; /* directory entry listing */
+ int nentries, ent;
+ nserror ret = NSERROR_OK;
+ struct stat ent_stat; /* stat result of leaf entry */
+ char *leafpath = NULL;
+ const char *leafname;
+
+ nentries = scandir(path, &listing, 0, alphasort);
+
+ if (nentries < 0) {
+ switch (errno) {
+ case ENOENT:
+ return NSERROR_NOT_FOUND;
+ default:
+ return NSERROR_UNKNOWN;
+ }
+ }
+
+ for (ent = 0; ent < nentries; ent++) {
+ leafname = listing[ent]->d_name;
+ if (strcmp(leafname, ".") == 0 ||
+ strcmp(leafname, "..") == 0)
+ continue;
+ ret = netsurf_mkpath(&leafpath, NULL, 2, path, leafname);
+ if (ret != NSERROR_OK) goto out;
+ if (stat(leafpath, &ent_stat) != 0) {
+ goto out_via_errno;
+ }
+ if (S_ISDIR(ent_stat.st_mode)) {
+ ret = netsurf_recursive_rm(leafpath);
+ if (ret != NSERROR_OK) goto out;
+ } else {
+ if (unlink(leafpath) != 0) {
+ goto out_via_errno;
+ }
+ }
+ free(leafpath);
+ leafpath = NULL;
+ }
+
+ if (rmdir(path) != 0) {
+ goto out_via_errno;
+ }
+
+ goto out;
+
+out_via_errno:
+ switch (errno) {
+ case ENOENT:
+ ret = NSERROR_NOT_FOUND;
+ break;
+ default:
+ ret = NSERROR_UNKNOWN;
+ }
+out:
+ if (listing != NULL) {
+ for (ent = 0; ent < nentries; ent++) {
+ free(listing[ent]);
+ }
+ free(listing);
+ }
+
+ if (leafpath != NULL) {
+ free(leafpath);
+ }
+
+ return ret;
+}
diff --git a/utils/file.h b/utils/file.h
index 0282c35..809ffe4 100644
--- a/utils/file.h
+++ b/utils/file.h
@@ -172,4 +172,15 @@ nserror netsurf_path_to_nsurl(const char *path, struct nsurl **url);
*/
nserror netsurf_mkdir_all(const char *fname);
+/**
+ * Recursively remove a directory
+ *
+ * If this returns a failure code, there's an unpredictable amount left
+ * unremoved.
+ *
+ * @param path The path to recursively remove
+ * @return NSERROR_OK on success, or an error code on failure.
+ */
+nserror netsurf_recursive_rm(const char *path);
+
#endif
-----------------------------------------------------------------------
Summary of changes:
content/fs_backing_store.c | 20 ++++++++++--
utils/file.c | 75 ++++++++++++++++++++++++++++++++++++++++++++
utils/file.h | 11 +++++++
3 files changed, 103 insertions(+), 3 deletions(-)
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index ff1c265..458866c 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -62,7 +62,7 @@
#define DEFAULT_ENTRY_SIZE 16
/** Backing store file format version */
-#define CONTROL_VERSION 201
+#define CONTROL_VERSION 202
/** Number of milliseconds after a update before control data maintenance is performed */
#define CONTROL_MAINT_TIME 10000
@@ -1461,8 +1461,22 @@ initialise(const struct llcache_store_parameters *parameters)
/* read store control and create new if required */
ret = read_control(newstate);
if (ret != NSERROR_OK) {
- NSLOG(netsurf, ERROR, "read control failed %s",
- messages_get_errorcode(ret));
+ if (ret == NSERROR_NOT_FOUND) {
+ NSLOG(netsurf, INFO, "cache control file not found, making fresh");
+ } else {
+ NSLOG(netsurf, ERROR, "read control failed %s",
+ messages_get_errorcode(ret));
+ ret = netsurf_recursive_rm(newstate->path);
+ if (ret != NSERROR_OK) {
+ NSLOG(netsurf, WARNING, "Error `%s` while removing `%s`",
+ messages_get_errorcode(ret), newstate->path);
+ NSLOG(netsurf, WARNING, "Unable to clean up partial cache state.");
+ NSLOG(netsurf, WARNING, "Funky behaviour may ensue.");
+ } else {
+ NSLOG(netsurf, INFO, "Successfully removed old cache from `%s`",
+ newstate->path);
+ }
+ }
ret = write_control(newstate);
if (ret == NSERROR_OK) {
unlink_entries(newstate);
diff --git a/utils/file.c b/utils/file.c
index cc82657..7eff6a7 100644
--- a/utils/file.c
+++ b/utils/file.c
@@ -26,6 +26,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <errno.h>
#include "desktop/gui_internal.h"
@@ -35,6 +36,7 @@
#include "utils/nsurl.h"
#include "utils/string.h"
#include "utils/file.h"
+#include "utils/dirent.h"
/**
* Generate a posix path from one or more component elemnts.
@@ -307,3 +309,76 @@ nserror netsurf_mkdir_all(const char *fname)
{
return guit->file->mkdir_all(fname);
}
+
+/* exported interface documented in utils/file.h */
+nserror
+netsurf_recursive_rm(const char *path)
+{
+ struct dirent **listing = NULL; /* directory entry listing */
+ int nentries, ent;
+ nserror ret = NSERROR_OK;
+ struct stat ent_stat; /* stat result of leaf entry */
+ char *leafpath = NULL;
+ const char *leafname;
+
+ nentries = scandir(path, &listing, 0, alphasort);
+
+ if (nentries < 0) {
+ switch (errno) {
+ case ENOENT:
+ return NSERROR_NOT_FOUND;
+ default:
+ return NSERROR_UNKNOWN;
+ }
+ }
+
+ for (ent = 0; ent < nentries; ent++) {
+ leafname = listing[ent]->d_name;
+ if (strcmp(leafname, ".") == 0 ||
+ strcmp(leafname, "..") == 0)
+ continue;
+ ret = netsurf_mkpath(&leafpath, NULL, 2, path, leafname);
+ if (ret != NSERROR_OK) goto out;
+ if (stat(leafpath, &ent_stat) != 0) {
+ goto out_via_errno;
+ }
+ if (S_ISDIR(ent_stat.st_mode)) {
+ ret = netsurf_recursive_rm(leafpath);
+ if (ret != NSERROR_OK) goto out;
+ } else {
+ if (unlink(leafpath) != 0) {
+ goto out_via_errno;
+ }
+ }
+ free(leafpath);
+ leafpath = NULL;
+ }
+
+ if (rmdir(path) != 0) {
+ goto out_via_errno;
+ }
+
+ goto out;
+
+out_via_errno:
+ switch (errno) {
+ case ENOENT:
+ ret = NSERROR_NOT_FOUND;
+ break;
+ default:
+ ret = NSERROR_UNKNOWN;
+ }
+out:
+ if (listing != NULL) {
+ for (ent = 0; ent < nentries; ent++) {
+ free(listing[ent]);
+ }
+ free(listing);
+ }
+
+ if (leafpath != NULL) {
+ free(leafpath);
+ }
+
+ return ret;
+}
diff --git a/utils/file.h b/utils/file.h
index 0282c35..809ffe4 100644
--- a/utils/file.h
+++ b/utils/file.h
@@ -172,4 +172,15 @@ nserror netsurf_path_to_nsurl(const char *path, struct nsurl **url);
*/
nserror netsurf_mkdir_all(const char *fname);
+/**
+ * Recursively remove a directory
+ *
+ * If this returns a failure code, there's an unpredictable amount left
+ * unremoved.
+ *
+ * @param path The path to recursively remove
+ * @return NSERROR_OK on success, or an error code on failure.
+ */
+nserror netsurf_recursive_rm(const char *path);
+
#endif
--
NetSurf Browser
3 years, 7 months
netsurf: branch tlsa/page-info created. release/3.9-532-gc7860df
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/c7860df46f3731044c15c...
...commit http://git.netsurf-browser.org/netsurf.git/commit/c7860df46f3731044c15c4f...
...tree http://git.netsurf-browser.org/netsurf.git/tree/c7860df46f3731044c15c4f7d...
The branch, tlsa/page-info has been created
at c7860df46f3731044c15c4f7db0a91eadc2aca53 (commit)
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=c7860df46f3731044c1...
commit c7860df46f3731044c15c4f7db0a91eadc2aca53
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
GTK: Initial page-info display.
diff --git a/frontends/gtk/page_info.c b/frontends/gtk/page_info.c
index 2892788..5e887b5 100644
--- a/frontends/gtk/page_info.c
+++ b/frontends/gtk/page_info.c
@@ -29,7 +29,7 @@
#include "netsurf/keypress.h"
#include "netsurf/plotters.h"
#include "netsurf/browser_window.h"
-#include "desktop/sslcert_viewer.h"
+#include "desktop/page-info.h"
#include "gtk/plotters.h"
#include "gtk/scaffolding.h"
@@ -48,8 +48,8 @@ struct nsgtk_pi_window {
GtkBuilder *builder;
/** GTK dialog window being shown */
GtkDialog *dlg;
- /** SSL certificate viewer context data */
- struct sslcert_session_data *ssl_data;
+ /** Core page-info window */
+ struct page_info *pi;
};
@@ -60,13 +60,12 @@ static nserror nsgtk_pi_destroy(struct nsgtk_pi_window *pi_win)
{
nserror res;
- res = sslcert_viewer_fini(pi_win->ssl_data);
- if (res == NSERROR_OK) {
- res = nsgtk_corewindow_fini(&pi_win->core);
- gtk_widget_destroy(GTK_WIDGET(pi_win->dlg));
- g_object_unref(G_OBJECT(pi_win->builder));
- free(pi_win);
- }
+ page_info_destroy(pi_win->pi);
+ res = nsgtk_corewindow_fini(&pi_win->core);
+ gtk_widget_destroy(GTK_WIDGET(pi_win->dlg));
+ g_object_unref(G_OBJECT(pi_win->builder));
+ free(pi_win);
+
return res;
}
@@ -76,8 +75,6 @@ nsgtk_pi_accept(GtkButton *w, gpointer data)
struct nsgtk_pi_window *pi_win;
pi_win = (struct nsgtk_pi_window *)data;
- sslcert_viewer_accept(pi_win->ssl_data);
-
nsgtk_pi_destroy(pi_win);
}
@@ -87,8 +84,6 @@ nsgtk_pi_reject(GtkWidget *w, gpointer data)
struct nsgtk_pi_window *pi_win;
pi_win = (struct nsgtk_pi_window *)data;
- sslcert_viewer_reject(pi_win->ssl_data);
-
nsgtk_pi_destroy(pi_win);
}
@@ -117,7 +112,7 @@ nsgtk_pi_mouse(struct nsgtk_corewindow *nsgtk_cw,
/* technically degenerate container of */
pi_win = (struct nsgtk_pi_window *)nsgtk_cw;
- sslcert_viewer_mouse_action(pi_win->ssl_data, mouse_state, x, y);
+ page_info_mouse_action(pi_win->pi, mouse_state, x, y);
return NSERROR_OK;
}
@@ -137,7 +132,7 @@ nsgtk_pi_key(struct nsgtk_corewindow *nsgtk_cw, uint32_t nskey)
/* technically degenerate container of */
pi_win = (struct nsgtk_pi_window *)nsgtk_cw;
- if (sslcert_viewer_keypress(pi_win->ssl_data, nskey)) {
+ if (page_info_keypress(pi_win->pi, nskey)) {
return NSERROR_OK;
}
return NSERROR_NOT_IMPLEMENTED;
@@ -163,32 +158,17 @@ nsgtk_pi_draw(struct nsgtk_corewindow *nsgtk_cw, struct rect *r)
/* technically degenerate container of */
pi_win = (struct nsgtk_pi_window *)nsgtk_cw;
- sslcert_viewer_redraw(pi_win->ssl_data, 0, 0, r, &ctx);
+ page_info_redraw(pi_win->pi, 0, 0, r, &ctx);
return NSERROR_OK;
}
-static nserror dummy_cb(bool proceed, void *pw)
-{
- return NSERROR_OK;
-}
-
/* exported interface documented in gtk/page_info.h */
nserror nsgtk_page_info(struct browser_window *bw)
{
struct nsgtk_pi_window *ncwin;
nserror res;
- struct cert_chain *chain;
- struct nsurl *url;
-
- res = browser_window_get_ssl_chain(bw, &chain);
- if (res != NSERROR_OK) {
- NSLOG(netsurf, WARNING, "Unable to get certificate chain");
- return NSERROR_INVALID;
- }
- url = browser_window_access_url(bw);
-
ncwin = malloc(sizeof(struct nsgtk_pi_window));
if (ncwin == NULL) {
return NSERROR_NOMEM;
@@ -248,18 +228,9 @@ nserror nsgtk_page_info(struct browser_window *bw)
return res;
}
- /* initialise certificate viewing interface */
- res = sslcert_viewer_create_session_data(
- url, dummy_cb, NULL, chain, &ncwin->ssl_data);
- if (res != NSERROR_OK) {
- g_object_unref(G_OBJECT(ncwin->dlg));
- free(ncwin);
- return res;
- }
-
- res = sslcert_viewer_init(ncwin->core.cb_table,
- (struct core_window *)ncwin,
- ncwin->ssl_data);
+ res = page_info_create(ncwin->core.cb_table,
+ (struct core_window *)ncwin,
+ bw, &ncwin->pi);
if (res != NSERROR_OK) {
g_object_unref(G_OBJECT(ncwin->dlg));
free(ncwin);
-----------------------------------------------------------------------
--
NetSurf Browser
3 years, 7 months
netsurf-wiki: branch master updated. 0a5f01a0aad30ac9c1e896a68c2f302910caf6fa
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf-wiki.git/shortlog/0a5f01a0aad30ac9...
...commit http://git.netsurf-browser.org/netsurf-wiki.git/commit/0a5f01a0aad30ac9c1...
...tree http://git.netsurf-browser.org/netsurf-wiki.git/tree/0a5f01a0aad30ac9c1e8...
The branch, master has been updated
via 0a5f01a0aad30ac9c1e896a68c2f302910caf6fa (commit)
from 8190d28d83ddbcb1c08caea439d6d3a37738e547 (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-wiki.git/commit/?id=0a5f01a0aad30a...
commit 0a5f01a0aad30ac9c1e896a68c2f302910caf6fa
Author: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Commit: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Browsing cache
Signed-off-by: Daniel Silverstone <dsilvers(a)digital-scurf.org>
diff --git a/developer-weekend/feb-2020.mdwn b/developer-weekend/feb-2020.mdwn
index 81b07c0..e8c8d36 100644
--- a/developer-weekend/feb-2020.mdwn
+++ b/developer-weekend/feb-2020.mdwn
@@ -182,6 +182,18 @@ Vince
* Reworked our entire certificate handling framework to use DER rather than
our cert_info structures
+Browsing Cache
+==============
+
+Running the long-internet test with disk cache on and javascript off, the
+disc cache ended up with:
+
+* 1 dblk 82 ish entries in there
+* 1 mblk
+* 227 m files ranging in size from just over 8k to just under 10k
+* 913 d files
+
+Daniel put a copy in his homedir on `ci`.
Statement of work
=================
-----------------------------------------------------------------------
Summary of changes:
developer-weekend/feb-2020.mdwn | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/developer-weekend/feb-2020.mdwn b/developer-weekend/feb-2020.mdwn
index 81b07c0..e8c8d36 100644
--- a/developer-weekend/feb-2020.mdwn
+++ b/developer-weekend/feb-2020.mdwn
@@ -182,6 +182,18 @@ Vince
* Reworked our entire certificate handling framework to use DER rather than
our cert_info structures
+Browsing Cache
+==============
+
+Running the long-internet test with disk cache on and javascript off, the
+disc cache ended up with:
+
+* 1 dblk 82 ish entries in there
+* 1 mblk
+* 227 m files ranging in size from just over 8k to just under 10k
+* 913 d files
+
+Daniel put a copy in his homedir on `ci`.
Statement of work
=================
--
NetSurf Developer Wiki Backing Store
3 years, 7 months
netsurf: branch master updated. release/3.9-531-g9215681
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/921568166bc924f2c5e58...
...commit http://git.netsurf-browser.org/netsurf.git/commit/921568166bc924f2c5e5870...
...tree http://git.netsurf-browser.org/netsurf.git/tree/921568166bc924f2c5e587095...
The branch, master has been updated
via 921568166bc924f2c5e587095012d7a34a472ed5 (commit)
from 82805f72e69af367317f83a5674590fd92b4572f (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=921568166bc924f2c5e...
commit 921568166bc924f2c5e587095012d7a34a472ed5
Author: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Commit: Daniel Silverstone <dsilvers(a)digital-scurf.org>
test: Add disc_cache_path to Choices-all test data
Signed-off-by: Daniel Silverstone <dsilvers(a)digital-scurf.org>
diff --git a/test/data/Choices-all b/test/data/Choices-all
index 65a467d..baae231 100644
--- a/test/data/Choices-all
+++ b/test/data/Choices-all
@@ -16,6 +16,7 @@ font_fantasy:Serif
accept_language:en
accept_charset:
memory_cache_size:12582912
+disc_cache_path:
disc_cache_size:1073741824
disc_cache_age:28
block_advertisements:0
-----------------------------------------------------------------------
Summary of changes:
test/data/Choices-all | 1 +
1 file changed, 1 insertion(+)
diff --git a/test/data/Choices-all b/test/data/Choices-all
index 65a467d..baae231 100644
--- a/test/data/Choices-all
+++ b/test/data/Choices-all
@@ -16,6 +16,7 @@ font_fantasy:Serif
accept_language:en
accept_charset:
memory_cache_size:12582912
+disc_cache_path:
disc_cache_size:1073741824
disc_cache_age:28
block_advertisements:0
--
NetSurf Browser
3 years, 7 months
netsurf: branch master updated. release/3.9-530-g82805f7
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/82805f72e69af367317f8...
...commit http://git.netsurf-browser.org/netsurf.git/commit/82805f72e69af367317f83a...
...tree http://git.netsurf-browser.org/netsurf.git/tree/82805f72e69af367317f83a56...
The branch, master has been updated
via 82805f72e69af367317f83a5674590fd92b4572f (commit)
via c8efbbc206331319587856c8fdd48a966ed48497 (commit)
from 1a25234f20b6c634024196143677c14e8142576c (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=82805f72e69af367317...
commit 82805f72e69af367317f83a5674590fd92b4572f
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Browser window: Rework constification of bw for show_certificates.
diff --git a/desktop/browser_private.h b/desktop/browser_private.h
index 41b8fef..c9f9bbc 100644
--- a/desktop/browser_private.h
+++ b/desktop/browser_private.h
@@ -283,7 +283,8 @@ struct browser_window {
* \param existing The existing window if cloning, else NULL
*/
nserror browser_window_initialise_common(enum browser_window_create_flags flags,
- struct browser_window *bw, struct browser_window *existing);
+ struct browser_window *bw,
+ const struct browser_window *existing);
/**
@@ -331,7 +332,8 @@ void browser_window_set_status(struct browser_window *bw, const char *text);
* \param bw browser window to set the type of the current drag for
* \return root browser window
*/
-struct browser_window * browser_window_get_root(struct browser_window *bw);
+struct browser_window * browser_window_get_root(
+ struct browser_window *bw);
/**
diff --git a/desktop/browser_window.c b/desktop/browser_window.c
index f705ce9..602c8e1 100644
--- a/desktop/browser_window.c
+++ b/desktop/browser_window.c
@@ -3090,7 +3090,7 @@ browser_window_create(enum browser_window_create_flags flags,
nserror
browser_window_initialise_common(enum browser_window_create_flags flags,
struct browser_window *bw,
- struct browser_window *existing)
+ const struct browser_window *existing)
{
nserror err;
assert(bw);
@@ -4765,7 +4765,7 @@ nserror browser_window_show_cookies(
}
/* Exported interface, documented in browser_window.h */
-nserror browser_window_show_certificates(const struct browser_window *bw)
+nserror browser_window_show_certificates(struct browser_window *bw)
{
nserror res;
nsurl *url;
diff --git a/include/netsurf/browser_window.h b/include/netsurf/browser_window.h
index e463dfa..73ca8e8 100644
--- a/include/netsurf/browser_window.h
+++ b/include/netsurf/browser_window.h
@@ -817,6 +817,6 @@ nserror browser_window_show_cookies(
* \return NSERROR_OK, or appropriate error otherwise.
*/
nserror browser_window_show_certificates(
- const struct browser_window *bw);
+ struct browser_window *bw);
#endif
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=c8efbbc206331319587...
commit c8efbbc206331319587856c8fdd48a966ed48497
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Page info: We need a non-const browser window.
Due to where we pass it back out to browser window.
diff --git a/desktop/page-info.c b/desktop/page-info.c
index 89c63b7..416c8e5 100644
--- a/desktop/page-info.c
+++ b/desktop/page-info.c
@@ -238,7 +238,7 @@ struct page_info {
const struct core_window_callback_table *cw_t;
struct core_window *cw_h;
- const struct browser_window *bw;
+ struct browser_window *bw;
lwc_string *domain;
browser_window_page_info_state state;
@@ -464,7 +464,7 @@ static nserror page_info__set_text(
*/
static nserror page_info__create_from_bw(
struct page_info *pi,
- const struct browser_window *bw)
+ struct browser_window *bw)
{
nsurl *url = browser_window_access_url(bw);
@@ -527,7 +527,7 @@ static nserror page_info__layout(
nserror page_info_create(
const struct core_window_callback_table *cw_t,
struct core_window *cw_h,
- const struct browser_window *bw,
+ struct browser_window *bw,
struct page_info **pi_out)
{
struct page_info *pi;
diff --git a/desktop/page-info.h b/desktop/page-info.h
index 89b82e0..d4437fd 100644
--- a/desktop/page-info.h
+++ b/desktop/page-info.h
@@ -68,7 +68,7 @@ nserror page_info_fini(void);
nserror page_info_create(
const struct core_window_callback_table *cw_t,
struct core_window *cw_h,
- const struct browser_window *bw,
+ struct browser_window *bw,
struct page_info **pi_out);
/**
-----------------------------------------------------------------------
Summary of changes:
desktop/browser_private.h | 6 ++++--
desktop/browser_window.c | 4 ++--
desktop/page-info.c | 6 +++---
desktop/page-info.h | 2 +-
include/netsurf/browser_window.h | 2 +-
5 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/desktop/browser_private.h b/desktop/browser_private.h
index 41b8fef..c9f9bbc 100644
--- a/desktop/browser_private.h
+++ b/desktop/browser_private.h
@@ -283,7 +283,8 @@ struct browser_window {
* \param existing The existing window if cloning, else NULL
*/
nserror browser_window_initialise_common(enum browser_window_create_flags flags,
- struct browser_window *bw, struct browser_window *existing);
+ struct browser_window *bw,
+ const struct browser_window *existing);
/**
@@ -331,7 +332,8 @@ void browser_window_set_status(struct browser_window *bw, const char *text);
* \param bw browser window to set the type of the current drag for
* \return root browser window
*/
-struct browser_window * browser_window_get_root(struct browser_window *bw);
+struct browser_window * browser_window_get_root(
+ struct browser_window *bw);
/**
diff --git a/desktop/browser_window.c b/desktop/browser_window.c
index f705ce9..602c8e1 100644
--- a/desktop/browser_window.c
+++ b/desktop/browser_window.c
@@ -3090,7 +3090,7 @@ browser_window_create(enum browser_window_create_flags flags,
nserror
browser_window_initialise_common(enum browser_window_create_flags flags,
struct browser_window *bw,
- struct browser_window *existing)
+ const struct browser_window *existing)
{
nserror err;
assert(bw);
@@ -4765,7 +4765,7 @@ nserror browser_window_show_cookies(
}
/* Exported interface, documented in browser_window.h */
-nserror browser_window_show_certificates(const struct browser_window *bw)
+nserror browser_window_show_certificates(struct browser_window *bw)
{
nserror res;
nsurl *url;
diff --git a/desktop/page-info.c b/desktop/page-info.c
index 89c63b7..416c8e5 100644
--- a/desktop/page-info.c
+++ b/desktop/page-info.c
@@ -238,7 +238,7 @@ struct page_info {
const struct core_window_callback_table *cw_t;
struct core_window *cw_h;
- const struct browser_window *bw;
+ struct browser_window *bw;
lwc_string *domain;
browser_window_page_info_state state;
@@ -464,7 +464,7 @@ static nserror page_info__set_text(
*/
static nserror page_info__create_from_bw(
struct page_info *pi,
- const struct browser_window *bw)
+ struct browser_window *bw)
{
nsurl *url = browser_window_access_url(bw);
@@ -527,7 +527,7 @@ static nserror page_info__layout(
nserror page_info_create(
const struct core_window_callback_table *cw_t,
struct core_window *cw_h,
- const struct browser_window *bw,
+ struct browser_window *bw,
struct page_info **pi_out)
{
struct page_info *pi;
diff --git a/desktop/page-info.h b/desktop/page-info.h
index 89b82e0..d4437fd 100644
--- a/desktop/page-info.h
+++ b/desktop/page-info.h
@@ -68,7 +68,7 @@ nserror page_info_fini(void);
nserror page_info_create(
const struct core_window_callback_table *cw_t,
struct core_window *cw_h,
- const struct browser_window *bw,
+ struct browser_window *bw,
struct page_info **pi_out);
/**
diff --git a/include/netsurf/browser_window.h b/include/netsurf/browser_window.h
index e463dfa..73ca8e8 100644
--- a/include/netsurf/browser_window.h
+++ b/include/netsurf/browser_window.h
@@ -817,6 +817,6 @@ nserror browser_window_show_cookies(
* \return NSERROR_OK, or appropriate error otherwise.
*/
nserror browser_window_show_certificates(
- const struct browser_window *bw);
+ struct browser_window *bw);
#endif
--
NetSurf Browser
3 years, 7 months
netsurf: branch master updated. release/3.9-528-g1a25234
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/1a25234f20b6c63402419...
...commit http://git.netsurf-browser.org/netsurf.git/commit/1a25234f20b6c6340241961...
...tree http://git.netsurf-browser.org/netsurf.git/tree/1a25234f20b6c634024196143...
The branch, master has been updated
via 1a25234f20b6c634024196143677c14e8142576c (commit)
from 52bfae17822d289dcf16566acfa3eac2539d66d5 (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=1a25234f20b6c634024...
commit 1a25234f20b6c634024196143677c14e8142576c
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
implement browser_window_show_certificates
diff --git a/desktop/browser_window.c b/desktop/browser_window.c
index e128852..f705ce9 100644
--- a/desktop/browser_window.c
+++ b/desktop/browser_window.c
@@ -35,6 +35,7 @@
#include <strings.h>
#include <math.h>
#include <nsutils/time.h>
+#include <nsutils/base64.h>
#include "utils/corestrings.h"
#include "utils/log.h"
@@ -4764,9 +4765,69 @@ nserror browser_window_show_cookies(
}
/* Exported interface, documented in browser_window.h */
-nserror browser_window_show_certificates(
- const struct browser_window *bw)
+nserror browser_window_show_certificates(const struct browser_window *bw)
{
- /** \todo Implement show certificates */
- return NSERROR_OK;
+ nserror res;
+ nsurl *url;
+ size_t allocsize;
+ size_t urlstrlen;
+ uint8_t *urlstr;
+ size_t depth;
+
+ if (bw->current_cert_chain == NULL) {
+ return NSERROR_NOT_FOUND;
+ }
+
+ allocsize = 20;
+ for (depth = 0; depth < bw->current_cert_chain->depth; depth++) {
+ allocsize += 7; /* allow for &cert= */
+ allocsize += 4 * ((bw->current_cert_chain->certs[depth].der_length + 2) / 3);
+ }
+
+ urlstr = malloc(allocsize);
+ if (urlstr == NULL) {
+ return NSERROR_NOMEM;
+ }
+
+ urlstrlen = snprintf((char *)urlstr, allocsize, "about:certificate");
+ for (depth = 0; depth < bw->current_cert_chain->depth; depth++) {
+ nsuerror nsures;
+ size_t output_length;
+
+ urlstrlen += snprintf((char *)urlstr + urlstrlen,
+ allocsize - urlstrlen,
+ "&cert=");
+
+ output_length = allocsize - urlstrlen;
+ nsures = nsu_base64_encode_url(
+ bw->current_cert_chain->certs[depth].der,
+ bw->current_cert_chain->certs[depth].der_length,
+ (uint8_t *)urlstr + urlstrlen,
+ &output_length);
+ if (nsures != NSUERROR_OK) {
+ free(urlstr);
+ return (nserror)nsures;
+ }
+ urlstrlen += output_length;
+ }
+ urlstr[17] = '?';
+ urlstr[urlstrlen] = 0;
+
+ res = nsurl_create((const char *)urlstr, &url);
+ free(urlstr);
+ if (res != NSERROR_OK) {
+ return res;
+ }
+
+ res = browser_window_create(BW_CREATE_HISTORY |
+ BW_CREATE_FOREGROUND |
+ BW_CREATE_TAB,
+ url,
+ NULL,
+ bw,
+ NULL);
+
+ nsurl_unref(url);
+
+ return res;
}
-----------------------------------------------------------------------
Summary of changes:
desktop/browser_window.c | 69 +++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 65 insertions(+), 4 deletions(-)
diff --git a/desktop/browser_window.c b/desktop/browser_window.c
index e128852..f705ce9 100644
--- a/desktop/browser_window.c
+++ b/desktop/browser_window.c
@@ -35,6 +35,7 @@
#include <strings.h>
#include <math.h>
#include <nsutils/time.h>
+#include <nsutils/base64.h>
#include "utils/corestrings.h"
#include "utils/log.h"
@@ -4764,9 +4765,69 @@ nserror browser_window_show_cookies(
}
/* Exported interface, documented in browser_window.h */
-nserror browser_window_show_certificates(
- const struct browser_window *bw)
+nserror browser_window_show_certificates(const struct browser_window *bw)
{
- /** \todo Implement show certificates */
- return NSERROR_OK;
+ nserror res;
+ nsurl *url;
+ size_t allocsize;
+ size_t urlstrlen;
+ uint8_t *urlstr;
+ size_t depth;
+
+ if (bw->current_cert_chain == NULL) {
+ return NSERROR_NOT_FOUND;
+ }
+
+ allocsize = 20;
+ for (depth = 0; depth < bw->current_cert_chain->depth; depth++) {
+ allocsize += 7; /* allow for &cert= */
+ allocsize += 4 * ((bw->current_cert_chain->certs[depth].der_length + 2) / 3);
+ }
+
+ urlstr = malloc(allocsize);
+ if (urlstr == NULL) {
+ return NSERROR_NOMEM;
+ }
+
+ urlstrlen = snprintf((char *)urlstr, allocsize, "about:certificate");
+ for (depth = 0; depth < bw->current_cert_chain->depth; depth++) {
+ nsuerror nsures;
+ size_t output_length;
+
+ urlstrlen += snprintf((char *)urlstr + urlstrlen,
+ allocsize - urlstrlen,
+ "&cert=");
+
+ output_length = allocsize - urlstrlen;
+ nsures = nsu_base64_encode_url(
+ bw->current_cert_chain->certs[depth].der,
+ bw->current_cert_chain->certs[depth].der_length,
+ (uint8_t *)urlstr + urlstrlen,
+ &output_length);
+ if (nsures != NSUERROR_OK) {
+ free(urlstr);
+ return (nserror)nsures;
+ }
+ urlstrlen += output_length;
+ }
+ urlstr[17] = '?';
+ urlstr[urlstrlen] = 0;
+
+ res = nsurl_create((const char *)urlstr, &url);
+ free(urlstr);
+ if (res != NSERROR_OK) {
+ return res;
+ }
+
+ res = browser_window_create(BW_CREATE_HISTORY |
+ BW_CREATE_FOREGROUND |
+ BW_CREATE_TAB,
+ url,
+ NULL,
+ bw,
+ NULL);
+
+ nsurl_unref(url);
+
+ return res;
}
--
NetSurf Browser
3 years, 7 months
netsurf: branch master updated. release/3.9-527-g52bfae1
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/52bfae17822d289dcf165...
...commit http://git.netsurf-browser.org/netsurf.git/commit/52bfae17822d289dcf16566...
...tree http://git.netsurf-browser.org/netsurf.git/tree/52bfae17822d289dcf16566ac...
The branch, master has been updated
via 52bfae17822d289dcf16566acfa3eac2539d66d5 (commit)
via 1e6b0f1d76198cf1770d92684bd70ed35d981d0d (commit)
from 4c256408c5b21d20bf703571ba106f7bb6101ada (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=52bfae17822d289dcf1...
commit 52bfae17822d289dcf16566acfa3eac2539d66d5
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Internal pages: Update directory listing style.
diff --git a/content/dirlist.c b/content/dirlist.c
index 1d7a67e..d34d3ff 100644
--- a/content/dirlist.c
+++ b/content/dirlist.c
@@ -28,7 +28,11 @@
#include "utils/nsurl.h"
#include "utils/messages.h"
+#include "netsurf/types.h"
+#include "netsurf/plot_style.h"
+
#include "content/dirlist.h"
+#include "desktop/system_colour.h"
static int dirlist_filesize_calculate(unsigned long *bytesize);
static int dirlist_filesize_value(unsigned long bytesize);
@@ -136,18 +140,68 @@ bool dirlist_generate_hide_columns(int flags, char *buffer, int buffer_length)
bool dirlist_generate_title(const char *title, char *buffer, int buffer_length)
{
+ nserror err;
int error;
+ colour bg;
+ colour fg;
+ colour odd;
+ colour even;
+ colour border;
+
+ err = ns_system_colour_char("Window", &bg);
+ if (err != NSERROR_OK) {
+ return false;
+ }
+
+ err = ns_system_colour_char("WindowText", &fg);
+ if (err != NSERROR_OK) {
+ return false;
+ }
+
+ odd = mix_colour(fg, bg, 0x18);
+ even = mix_colour(fg, bg, 0x0c);
+ border = mix_colour(fg, bg, 0x40);
+
+ bg = colour_rb_swap(bg);
+ fg = colour_rb_swap(fg);
+ odd = colour_rb_swap(odd);
+ even = colour_rb_swap(even);
+ border = colour_rb_swap(border);
+
if (title == NULL)
title = "";
error = snprintf(buffer, buffer_length,
"</style>\n"
"<title>%s</title>\n"
+ "<style>\n"
+ "html {\n"
+ "\tbackground-color: #%06x;\n"
+ "}\n"
+ "body {\n"
+ "\tcolor: #%06x;\n"
+ "\tbackground-color: #%06x;\n"
+ "\tborder-color: #%06x;\n"
+ "}\n"
+ "body#dirlist h1 {\n"
+ "\tborder-color: #%06x;\n"
+ "}\n"
+ "body#dirlist a.odd {\n"
+ "\tbackground-color: #%06x;\n"
+ "}\n"
+ "body#dirlist a.even {\n"
+ "\tbackground-color: #%06x;\n"
+ "}\n"
+ "body#dirlist a + a>span {\n"
+ "\tborder-color: #%06x;\n"
+ "}\n"
+ "</style>\n"
"</head>\n"
"<body id=\"dirlist\">\n"
"<h1>%s</h1>\n",
- title, title);
+ title, even, fg, bg, border, border, odd,
+ even, border, title);
if (error < 0 || error >= buffer_length)
/* Error or buffer too small */
return false;
diff --git a/resources/internal.css b/resources/internal.css
index ded56ee..f98f0cc 100644
--- a/resources/internal.css
+++ b/resources/internal.css
@@ -2,13 +2,17 @@ html, body {
margin: 0;
padding: 0; }
+html {
+ padding: 2em;
+}
+
body {
- color: #000;
- background-color: #fff;
font-family: sans-serif;
font-size: 94%;
margin: 0 auto;
- position: relative; }
+ position: relative;
+ border-width: 2px;
+ border-style: solid; }
h1, h2, h3, h4, h5, h6, h7, p, ul, dl, ol, table {
margin-left: 5mm;
@@ -108,13 +112,13 @@ input.default-action {
*/
body#dirlist {
- background-color: #abf;
padding-bottom: 2em; }
body#dirlist h1 {
padding: 5mm;
margin: 0;
- border-bottom: 2px solid #bcf; }
+ border-bottom-width: 2px;
+ border-bottom-style: solid; }
body#dirlist p {
padding: 2px 5mm;
@@ -126,26 +130,31 @@ body#dirlist div {
margin: 5mm auto 2em auto;
padding: 0; }
-body#dirlist a, strong {
+body#dirlist strong {
display: table-row;
margin: 0;
- padding: 0; }
-
-body#dirlist a.odd {
- background-color: #bcf; }
+ padding: 0;
+ font-size: 120%;
+}
-body#dirlist a.even {
- background-color: #b2c3ff; }
+body#dirlist a {
+ display: table-row;
+ margin: 0;
+ padding: 0; }
body#dirlist span {
display: table-cell;
vertical-align: middle; }
+body#dirlist a > span {
+ padding-top: 0.1em; }
+
body#dirlist em > span {
padding-bottom: 1px; }
body#dirlist a + a>span {
- border-top: 1px solid #9af; }
+ border-top-width: 1px;
+ border-top-style: solid; }
body#dirlist a {
background-position: 4px 50%;
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=1e6b0f1d76198cf1770...
commit 1e6b0f1d76198cf1770d92684bd70ed35d981d0d
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Plot style: Add helper to swap red and blue channels.
diff --git a/include/netsurf/plot_style.h b/include/netsurf/plot_style.h
index bc86041..fee7a10 100644
--- a/include/netsurf/plot_style.h
+++ b/include/netsurf/plot_style.h
@@ -188,6 +188,12 @@ typedef struct plot_font_style {
#define blue_from_colour(c) \
((c >> 16) & 0xff)
+/* Swap red and blue channels in a colour */
+#define colour_rb_swap(c) \
+ (((0x000000ff & c) << 16) | \
+ ((0x0000ff00 & c) ) | \
+ ((0x00ff0000 & c) >> 16))
+
/** Colour components */
enum plot_colour_component {
PLOT_COLOUR_COMPONENT_RED,
-----------------------------------------------------------------------
Summary of changes:
content/dirlist.c | 56 +++++++++++++++++++++++++++++++++++++++++-
include/netsurf/plot_style.h | 6 +++++
resources/internal.css | 35 ++++++++++++++++----------
3 files changed, 83 insertions(+), 14 deletions(-)
diff --git a/content/dirlist.c b/content/dirlist.c
index 1d7a67e..d34d3ff 100644
--- a/content/dirlist.c
+++ b/content/dirlist.c
@@ -28,7 +28,11 @@
#include "utils/nsurl.h"
#include "utils/messages.h"
+#include "netsurf/types.h"
+#include "netsurf/plot_style.h"
+
#include "content/dirlist.h"
+#include "desktop/system_colour.h"
static int dirlist_filesize_calculate(unsigned long *bytesize);
static int dirlist_filesize_value(unsigned long bytesize);
@@ -136,18 +140,68 @@ bool dirlist_generate_hide_columns(int flags, char *buffer, int buffer_length)
bool dirlist_generate_title(const char *title, char *buffer, int buffer_length)
{
+ nserror err;
int error;
+ colour bg;
+ colour fg;
+ colour odd;
+ colour even;
+ colour border;
+
+ err = ns_system_colour_char("Window", &bg);
+ if (err != NSERROR_OK) {
+ return false;
+ }
+
+ err = ns_system_colour_char("WindowText", &fg);
+ if (err != NSERROR_OK) {
+ return false;
+ }
+
+ odd = mix_colour(fg, bg, 0x18);
+ even = mix_colour(fg, bg, 0x0c);
+ border = mix_colour(fg, bg, 0x40);
+
+ bg = colour_rb_swap(bg);
+ fg = colour_rb_swap(fg);
+ odd = colour_rb_swap(odd);
+ even = colour_rb_swap(even);
+ border = colour_rb_swap(border);
+
if (title == NULL)
title = "";
error = snprintf(buffer, buffer_length,
"</style>\n"
"<title>%s</title>\n"
+ "<style>\n"
+ "html {\n"
+ "\tbackground-color: #%06x;\n"
+ "}\n"
+ "body {\n"
+ "\tcolor: #%06x;\n"
+ "\tbackground-color: #%06x;\n"
+ "\tborder-color: #%06x;\n"
+ "}\n"
+ "body#dirlist h1 {\n"
+ "\tborder-color: #%06x;\n"
+ "}\n"
+ "body#dirlist a.odd {\n"
+ "\tbackground-color: #%06x;\n"
+ "}\n"
+ "body#dirlist a.even {\n"
+ "\tbackground-color: #%06x;\n"
+ "}\n"
+ "body#dirlist a + a>span {\n"
+ "\tborder-color: #%06x;\n"
+ "}\n"
+ "</style>\n"
"</head>\n"
"<body id=\"dirlist\">\n"
"<h1>%s</h1>\n",
- title, title);
+ title, even, fg, bg, border, border, odd,
+ even, border, title);
if (error < 0 || error >= buffer_length)
/* Error or buffer too small */
return false;
diff --git a/include/netsurf/plot_style.h b/include/netsurf/plot_style.h
index bc86041..fee7a10 100644
--- a/include/netsurf/plot_style.h
+++ b/include/netsurf/plot_style.h
@@ -188,6 +188,12 @@ typedef struct plot_font_style {
#define blue_from_colour(c) \
((c >> 16) & 0xff)
+/* Swap red and blue channels in a colour */
+#define colour_rb_swap(c) \
+ (((0x000000ff & c) << 16) | \
+ ((0x0000ff00 & c) ) | \
+ ((0x00ff0000 & c) >> 16))
+
/** Colour components */
enum plot_colour_component {
PLOT_COLOUR_COMPONENT_RED,
diff --git a/resources/internal.css b/resources/internal.css
index ded56ee..f98f0cc 100644
--- a/resources/internal.css
+++ b/resources/internal.css
@@ -2,13 +2,17 @@ html, body {
margin: 0;
padding: 0; }
+html {
+ padding: 2em;
+}
+
body {
- color: #000;
- background-color: #fff;
font-family: sans-serif;
font-size: 94%;
margin: 0 auto;
- position: relative; }
+ position: relative;
+ border-width: 2px;
+ border-style: solid; }
h1, h2, h3, h4, h5, h6, h7, p, ul, dl, ol, table {
margin-left: 5mm;
@@ -108,13 +112,13 @@ input.default-action {
*/
body#dirlist {
- background-color: #abf;
padding-bottom: 2em; }
body#dirlist h1 {
padding: 5mm;
margin: 0;
- border-bottom: 2px solid #bcf; }
+ border-bottom-width: 2px;
+ border-bottom-style: solid; }
body#dirlist p {
padding: 2px 5mm;
@@ -126,26 +130,31 @@ body#dirlist div {
margin: 5mm auto 2em auto;
padding: 0; }
-body#dirlist a, strong {
+body#dirlist strong {
display: table-row;
margin: 0;
- padding: 0; }
-
-body#dirlist a.odd {
- background-color: #bcf; }
+ padding: 0;
+ font-size: 120%;
+}
-body#dirlist a.even {
- background-color: #b2c3ff; }
+body#dirlist a {
+ display: table-row;
+ margin: 0;
+ padding: 0; }
body#dirlist span {
display: table-cell;
vertical-align: middle; }
+body#dirlist a > span {
+ padding-top: 0.1em; }
+
body#dirlist em > span {
padding-bottom: 1px; }
body#dirlist a + a>span {
- border-top: 1px solid #9af; }
+ border-top-width: 1px;
+ border-top-style: solid; }
body#dirlist a {
background-position: 4px 50%;
--
NetSurf Browser
3 years, 7 months
netsurf-wiki: branch master updated. 8190d28d83ddbcb1c08caea439d6d3a37738e547
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf-wiki.git/shortlog/8190d28d83ddbcb1...
...commit http://git.netsurf-browser.org/netsurf-wiki.git/commit/8190d28d83ddbcb1c0...
...tree http://git.netsurf-browser.org/netsurf-wiki.git/tree/8190d28d83ddbcb1c08c...
The branch, master has been updated
via 8190d28d83ddbcb1c08caea439d6d3a37738e547 (commit)
from d8a37684fb44b59a2af22e361af0a2ce4721ae8a (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-wiki.git/commit/?id=8190d28d83ddbc...
commit 8190d28d83ddbcb1c08caea439d6d3a37738e547
Author: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Commit: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Daniel added disc cache path option
Signed-off-by: Daniel Silverstone <dsilvers(a)digital-scurf.org>
diff --git a/developer-weekend/feb-2020.mdwn b/developer-weekend/feb-2020.mdwn
index 8e2564a..81b07c0 100644
--- a/developer-weekend/feb-2020.mdwn
+++ b/developer-weekend/feb-2020.mdwn
@@ -173,6 +173,7 @@ Daniel
* Added surface enumeration to libnsfb
* Added support to use that to nsfb
* Fixed [[!bug 2650]] by making windows port not use `NoMemory` where inappropriate.
+* Added disc cache path as a core option and made monkey able to use it
Vince
-----
-----------------------------------------------------------------------
Summary of changes:
developer-weekend/feb-2020.mdwn | 1 +
1 file changed, 1 insertion(+)
diff --git a/developer-weekend/feb-2020.mdwn b/developer-weekend/feb-2020.mdwn
index 8e2564a..81b07c0 100644
--- a/developer-weekend/feb-2020.mdwn
+++ b/developer-weekend/feb-2020.mdwn
@@ -173,6 +173,7 @@ Daniel
* Added surface enumeration to libnsfb
* Added support to use that to nsfb
* Fixed [[!bug 2650]] by making windows port not use `NoMemory` where inappropriate.
+* Added disc cache path as a core option and made monkey able to use it
Vince
-----
--
NetSurf Developer Wiki Backing Store
3 years, 7 months