netsurf: branch master updated. release/3.6-39-g811d7b7
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/811d7b71758917919a0c9...
...commit http://git.netsurf-browser.org/netsurf.git/commit/811d7b71758917919a0c94b...
...tree http://git.netsurf-browser.org/netsurf.git/tree/811d7b71758917919a0c94b12...
The branch, master has been updated
via 811d7b71758917919a0c94b1289bd5608119ccc5 (commit)
from 540c6ee0ef432dfad375d64afa2c67d410f826d5 (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=811d7b71758917919a0...
commit 811d7b71758917919a0c94b1289bd5608119ccc5
Author: François Revol <revol(a)free.fr>
Commit: François Revol <revol(a)free.fr>
haiku: close parenthesis in version string
they are unmatched due to the CI ifdefery
diff --git a/frontends/beos/Makefile b/frontends/beos/Makefile
index 19ab43f..f40cce4 100644
--- a/frontends/beos/Makefile
+++ b/frontends/beos/Makefile
@@ -29,7 +29,7 @@ CFLAGS += -I$(PREFIX)/include
CXXFLAGS += -Dnsbeos -D_BSD_SOURCE -D_POSIX_C_SOURCE -Drestrict="" -g
CXXFLAGS += -I$(PREFIX)/include
-VERSION_FULL := $(shell sed -n '/_version.*=.*"/{s/.*"\(.*\)".*/\1/;p;}' desktop/version.c)
+VERSION_FULL := $(shell sed -n '/_version.*=.*"/{s/.*"\(.*\)".*/\1/;p;}' desktop/version.c))
VERSION_MAJ := $(shell sed -n '/_major/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c)
VERSION_MIN := $(shell sed -n '/_minor/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c)
-----------------------------------------------------------------------
Summary of changes:
frontends/beos/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/frontends/beos/Makefile b/frontends/beos/Makefile
index 19ab43f..f40cce4 100644
--- a/frontends/beos/Makefile
+++ b/frontends/beos/Makefile
@@ -29,7 +29,7 @@ CFLAGS += -I$(PREFIX)/include
CXXFLAGS += -Dnsbeos -D_BSD_SOURCE -D_POSIX_C_SOURCE -Drestrict="" -g
CXXFLAGS += -I$(PREFIX)/include
-VERSION_FULL := $(shell sed -n '/_version.*=.*"/{s/.*"\(.*\)".*/\1/;p;}' desktop/version.c)
+VERSION_FULL := $(shell sed -n '/_version.*=.*"/{s/.*"\(.*\)".*/\1/;p;}' desktop/version.c))
VERSION_MAJ := $(shell sed -n '/_major/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c)
VERSION_MIN := $(shell sed -n '/_minor/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c)
--
NetSurf Browser
6 years, 4 months
netsurf: branch master updated. release/3.6-38-g540c6ee
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/540c6ee0ef432dfad375d...
...commit http://git.netsurf-browser.org/netsurf.git/commit/540c6ee0ef432dfad375d64...
...tree http://git.netsurf-browser.org/netsurf.git/tree/540c6ee0ef432dfad375d64af...
The branch, master has been updated
via 540c6ee0ef432dfad375d64afa2c67d410f826d5 (commit)
via cd3720d5b63147fb97f3b7cdd056d3e8e6cc5586 (commit)
from 3f88c12315556d6f5f928c7e6a5e56357899ece7 (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=540c6ee0ef432dfad37...
commit 540c6ee0ef432dfad375d64afa2c67d410f826d5
Author: François Revol <revol(a)free.fr>
Commit: François Revol <revol(a)free.fr>
haiku: use logging instead of fprintf
diff --git a/frontends/beos/gui.cpp b/frontends/beos/gui.cpp
index c1b1536..d3321b5 100644
--- a/frontends/beos/gui.cpp
+++ b/frontends/beos/gui.cpp
@@ -1038,7 +1038,7 @@ int main(int argc, char** argv)
char path[12];
sprintf(path,"%.2s/Messages", getenv("LC_MESSAGES"));
- fprintf(stderr, "Loading messages from resource %s\n", path);
+ LOG("Loading messages from resource %s\n", path);
const uint8_t* res = (const uint8_t*)resources.LoadResource('data', path, &size);
if (size > 0 && res != NULL) {
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=cd3720d5b63147fb97f...
commit cd3720d5b63147fb97f3b7cdd056d3e8e6cc5586
Author: François Revol <revol(a)free.fr>
Commit: François Revol <revol(a)free.fr>
haiku: Fix popup menu
Only the reload entry is enabled for now.
diff --git a/frontends/beos/scaffolding.cpp b/frontends/beos/scaffolding.cpp
index a79cf91..5e386bd 100644
--- a/frontends/beos/scaffolding.cpp
+++ b/frontends/beos/scaffolding.cpp
@@ -133,6 +133,9 @@ struct beos_scaffolding {
int being_destroyed;
bool fullscreen;
+
+ /** Object under menu, or 0 if no object. */
+ struct hlcache_handle *current_menu_object;
};
struct beos_history_window {
@@ -1254,6 +1257,11 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
case BROWSER_OBJECT_INFO:
break;
case BROWSER_OBJECT_RELOAD:
+ if (scaffold->current_menu_object != NULL) {
+ content_invalidate_reuse_data(scaffold->current_menu_object);
+ browser_window_reload(bw, false);
+ scaffold->current_menu_object = NULL;
+ }
break;
case BROWSER_OBJECT_SAVE:
break;
@@ -1514,6 +1522,8 @@ void nsbeos_attach_toplevel_view(nsbeos_scaffolding *g, BView *view)
nsbeos_scaffolding_update_colors(g);
+ recursively_set_menu_items_target(g->popup_menu, view);
+
if (g->window) {
recursively_set_menu_items_target(g->menu_bar, view);
@@ -1720,6 +1730,7 @@ nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel)
BMessage *message;
BRect rect;
+ BMenuItem *item;
g->window = NULL;
g->menu_bar = NULL;
@@ -1767,7 +1778,6 @@ nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel)
g->window->AddChild(g->menu_bar);
BMenu *menu;
- BMenuItem *item;
// App menu
//XXX: use icon item ?
@@ -2071,7 +2081,22 @@ nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel)
g->top_view->SetScaffolding(g);
// build popup menu
- g->popup_menu = new BPopUpMenu("");
+ g->popup_menu = new BPopUpMenu("popup", false, false);
+
+#if 0
+ message = new BMessage(BROWSER_OBJECT_INFO);
+ item = make_menu_item("ObjInfo", message);
+ g->popup_menu->AddItem(item);
+
+ message = new BMessage(BROWSER_OBJECT_SAVE);
+ item = make_menu_item("ObjSave", message);
+ g->popup_menu->AddItem(item);
+ // XXX: submenu: Sprite ?
+#endif
+
+ message = new BMessage(BROWSER_OBJECT_RELOAD);
+ item = make_menu_item("ObjReload", message, true);
+ g->popup_menu->AddItem(item);
#ifdef ENABLE_DRAGGER
@@ -2335,8 +2360,19 @@ void gui_window_set_icon(struct gui_window *_g, hlcache_handle *icon)
}
-void nsbeos_scaffolding_popup_menu(nsbeos_scaffolding *g, BPoint where)
+void nsbeos_scaffolding_popup_menu(nsbeos_scaffolding *scaffold, struct browser_window *bw, BPoint where, BPoint screenWhere)
{
- g->popup_menu->Go(where);
+ struct browser_window_features cont;
+
+ browser_window_get_features(bw, (int)where.x, (int)where.y, &cont);
+
+ scaffold->current_menu_object = cont.object;
+ bool enabled = !!scaffold->current_menu_object;
+
+ for (int i = 0; scaffold->popup_menu->ItemAt(i); i++) {
+ scaffold->popup_menu->ItemAt(i)->SetEnabled(enabled);
+ }
+
+ scaffold->popup_menu->Go(screenWhere, true, false, true);
}
diff --git a/frontends/beos/scaffolding.h b/frontends/beos/scaffolding.h
index 3fdca57..04cc3fa 100644
--- a/frontends/beos/scaffolding.h
+++ b/frontends/beos/scaffolding.h
@@ -198,7 +198,7 @@ void nsbeos_scaffolding_destroy(nsbeos_scaffolding *scaffold);
//void nsbeos_window_destroy_event(NSBrowserWindow *window, nsbeos_scaffolding *g, BMessage *event);
-void nsbeos_scaffolding_popup_menu(nsbeos_scaffolding *g, BPoint where);
+void nsbeos_scaffolding_popup_menu(nsbeos_scaffolding *scaffold, struct browser_window *bw, BPoint where, BPoint screenWhere);
void gui_window_set_title(struct gui_window *_g, const char *title);
nserror gui_window_set_url(struct gui_window *_g, struct nsurl *url);
diff --git a/frontends/beos/window.cpp b/frontends/beos/window.cpp
index 07d6af2..fbf7b16 100644
--- a/frontends/beos/window.cpp
+++ b/frontends/beos/window.cpp
@@ -545,8 +545,7 @@ void nsbeos_dispatch_event(BMessage *message)
if (buttons & B_SECONDARY_MOUSE_BUTTON) {
/* 2 == right button on BeOS */
-
- nsbeos_scaffolding_popup_menu(gui->scaffold, screenWhere);
+ nsbeos_scaffolding_popup_menu(gui->scaffold, gui->bw, where, screenWhere);
break;
}
-----------------------------------------------------------------------
Summary of changes:
frontends/beos/gui.cpp | 2 +-
frontends/beos/scaffolding.cpp | 44 ++++++++++++++++++++++++++++++++++++----
frontends/beos/scaffolding.h | 2 +-
frontends/beos/window.cpp | 3 +--
4 files changed, 43 insertions(+), 8 deletions(-)
diff --git a/frontends/beos/gui.cpp b/frontends/beos/gui.cpp
index c1b1536..d3321b5 100644
--- a/frontends/beos/gui.cpp
+++ b/frontends/beos/gui.cpp
@@ -1038,7 +1038,7 @@ int main(int argc, char** argv)
char path[12];
sprintf(path,"%.2s/Messages", getenv("LC_MESSAGES"));
- fprintf(stderr, "Loading messages from resource %s\n", path);
+ LOG("Loading messages from resource %s\n", path);
const uint8_t* res = (const uint8_t*)resources.LoadResource('data', path, &size);
if (size > 0 && res != NULL) {
diff --git a/frontends/beos/scaffolding.cpp b/frontends/beos/scaffolding.cpp
index a79cf91..5e386bd 100644
--- a/frontends/beos/scaffolding.cpp
+++ b/frontends/beos/scaffolding.cpp
@@ -133,6 +133,9 @@ struct beos_scaffolding {
int being_destroyed;
bool fullscreen;
+
+ /** Object under menu, or 0 if no object. */
+ struct hlcache_handle *current_menu_object;
};
struct beos_history_window {
@@ -1254,6 +1257,11 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
case BROWSER_OBJECT_INFO:
break;
case BROWSER_OBJECT_RELOAD:
+ if (scaffold->current_menu_object != NULL) {
+ content_invalidate_reuse_data(scaffold->current_menu_object);
+ browser_window_reload(bw, false);
+ scaffold->current_menu_object = NULL;
+ }
break;
case BROWSER_OBJECT_SAVE:
break;
@@ -1514,6 +1522,8 @@ void nsbeos_attach_toplevel_view(nsbeos_scaffolding *g, BView *view)
nsbeos_scaffolding_update_colors(g);
+ recursively_set_menu_items_target(g->popup_menu, view);
+
if (g->window) {
recursively_set_menu_items_target(g->menu_bar, view);
@@ -1720,6 +1730,7 @@ nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel)
BMessage *message;
BRect rect;
+ BMenuItem *item;
g->window = NULL;
g->menu_bar = NULL;
@@ -1767,7 +1778,6 @@ nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel)
g->window->AddChild(g->menu_bar);
BMenu *menu;
- BMenuItem *item;
// App menu
//XXX: use icon item ?
@@ -2071,7 +2081,22 @@ nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel)
g->top_view->SetScaffolding(g);
// build popup menu
- g->popup_menu = new BPopUpMenu("");
+ g->popup_menu = new BPopUpMenu("popup", false, false);
+
+#if 0
+ message = new BMessage(BROWSER_OBJECT_INFO);
+ item = make_menu_item("ObjInfo", message);
+ g->popup_menu->AddItem(item);
+
+ message = new BMessage(BROWSER_OBJECT_SAVE);
+ item = make_menu_item("ObjSave", message);
+ g->popup_menu->AddItem(item);
+ // XXX: submenu: Sprite ?
+#endif
+
+ message = new BMessage(BROWSER_OBJECT_RELOAD);
+ item = make_menu_item("ObjReload", message, true);
+ g->popup_menu->AddItem(item);
#ifdef ENABLE_DRAGGER
@@ -2335,8 +2360,19 @@ void gui_window_set_icon(struct gui_window *_g, hlcache_handle *icon)
}
-void nsbeos_scaffolding_popup_menu(nsbeos_scaffolding *g, BPoint where)
+void nsbeos_scaffolding_popup_menu(nsbeos_scaffolding *scaffold, struct browser_window *bw, BPoint where, BPoint screenWhere)
{
- g->popup_menu->Go(where);
+ struct browser_window_features cont;
+
+ browser_window_get_features(bw, (int)where.x, (int)where.y, &cont);
+
+ scaffold->current_menu_object = cont.object;
+ bool enabled = !!scaffold->current_menu_object;
+
+ for (int i = 0; scaffold->popup_menu->ItemAt(i); i++) {
+ scaffold->popup_menu->ItemAt(i)->SetEnabled(enabled);
+ }
+
+ scaffold->popup_menu->Go(screenWhere, true, false, true);
}
diff --git a/frontends/beos/scaffolding.h b/frontends/beos/scaffolding.h
index 3fdca57..04cc3fa 100644
--- a/frontends/beos/scaffolding.h
+++ b/frontends/beos/scaffolding.h
@@ -198,7 +198,7 @@ void nsbeos_scaffolding_destroy(nsbeos_scaffolding *scaffold);
//void nsbeos_window_destroy_event(NSBrowserWindow *window, nsbeos_scaffolding *g, BMessage *event);
-void nsbeos_scaffolding_popup_menu(nsbeos_scaffolding *g, BPoint where);
+void nsbeos_scaffolding_popup_menu(nsbeos_scaffolding *scaffold, struct browser_window *bw, BPoint where, BPoint screenWhere);
void gui_window_set_title(struct gui_window *_g, const char *title);
nserror gui_window_set_url(struct gui_window *_g, struct nsurl *url);
diff --git a/frontends/beos/window.cpp b/frontends/beos/window.cpp
index 07d6af2..fbf7b16 100644
--- a/frontends/beos/window.cpp
+++ b/frontends/beos/window.cpp
@@ -545,8 +545,7 @@ void nsbeos_dispatch_event(BMessage *message)
if (buttons & B_SECONDARY_MOUSE_BUTTON) {
/* 2 == right button on BeOS */
-
- nsbeos_scaffolding_popup_menu(gui->scaffold, screenWhere);
+ nsbeos_scaffolding_popup_menu(gui->scaffold, gui->bw, where, screenWhere);
break;
}
--
NetSurf Browser
6 years, 4 months
netsurf: branch master updated. release/3.6-36-g3f88c12
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/3f88c12315556d6f5f928...
...commit http://git.netsurf-browser.org/netsurf.git/commit/3f88c12315556d6f5f928c7...
...tree http://git.netsurf-browser.org/netsurf.git/tree/3f88c12315556d6f5f928c7e6...
The branch, master has been updated
via 3f88c12315556d6f5f928c7e6a5e56357899ece7 (commit)
from 356e92c604ec6ab218302cfc1704f04ae171ddeb (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=3f88c12315556d6f5f9...
commit 3f88c12315556d6f5f928c7e6a5e56357899ece7
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Fix OpenSSL X509 cert API detection
LibreSSL defines a OPENSSL_VERSION_NUMBER of 2.1 but only provides the
old OpenSSL 1.0.x API.
diff --git a/content/fetchers/curl.c b/content/fetchers/curl.c
index 7ddf512..7d0e40c 100644
--- a/content/fetchers/curl.c
+++ b/content/fetchers/curl.c
@@ -128,8 +128,10 @@ static char fetch_error_buffer[CURL_ERROR_SIZE];
static char fetch_proxy_userpwd[100];
-/* OpenSSL 1.0.x to 1.1.0 certificate reference counting changed */
-#if (OPENSSL_VERSION_NUMBER < 0x1010000fL)
+/* OpenSSL 1.0.x to 1.1.0 certificate reference counting changed
+ * LibreSSL declares its OpenSSL version as 2.1 but only supports the old way
+ */
+#if (defined(LIBRESSL_VERSION_NUMBER) || (OPENSSL_VERSION_NUMBER < 0x1010000fL))
static int ns_X509_up_ref(X509 *cert)
{
cert->references++;
-----------------------------------------------------------------------
Summary of changes:
content/fetchers/curl.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/content/fetchers/curl.c b/content/fetchers/curl.c
index 7ddf512..7d0e40c 100644
--- a/content/fetchers/curl.c
+++ b/content/fetchers/curl.c
@@ -128,8 +128,10 @@ static char fetch_error_buffer[CURL_ERROR_SIZE];
static char fetch_proxy_userpwd[100];
-/* OpenSSL 1.0.x to 1.1.0 certificate reference counting changed */
-#if (OPENSSL_VERSION_NUMBER < 0x1010000fL)
+/* OpenSSL 1.0.x to 1.1.0 certificate reference counting changed
+ * LibreSSL declares its OpenSSL version as 2.1 but only supports the old way
+ */
+#if (defined(LIBRESSL_VERSION_NUMBER) || (OPENSSL_VERSION_NUMBER < 0x1010000fL))
static int ns_X509_up_ref(X509 *cert)
{
cert->references++;
--
NetSurf Browser
6 years, 4 months
netsurf: branch master updated. release/3.6-35-g356e92c
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/356e92c604ec6ab218302...
...commit http://git.netsurf-browser.org/netsurf.git/commit/356e92c604ec6ab218302cf...
...tree http://git.netsurf-browser.org/netsurf.git/tree/356e92c604ec6ab218302cfc1...
The branch, master has been updated
via 356e92c604ec6ab218302cfc1704f04ae171ddeb (commit)
from 30ca72b32eba20793b2888be35992fdc5dae375b (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=356e92c604ec6ab2183...
commit 356e92c604ec6ab218302cfc1704f04ae171ddeb
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
haiku: add some menu accelerators to FatMessages
diff --git a/resources/FatMessages b/resources/FatMessages
index 9fb5939..ead95fc 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -85,6 +85,7 @@ de.all.Quit:Beenden
fr.all.Quit:Quitter
it.all.Quit:Esci
nl.all.Quit:Stop
+en.beos.QuitAccel:Q
# Iconbar -> Open menu
#
@@ -162,6 +163,7 @@ de.ro.NewWindow:Neues Fenster ^N
fr.ro.NewWindow:Nouvelle fenêtre ^N
it.ro.NewWindow:Nuova finestra ^N
nl.ro.NewWindow:Nieuw venster ^N
+en.beos.NewWindowNSAccel:N
en.ro.ViewSrc:View source... F8
de.ro.ViewSrc:Quellcode... F8
fr.ro.ViewSrc:Voir le source... F8
@@ -172,6 +174,7 @@ de.beos.ViewSrc:Quellcode...
fr.beos.ViewSrc:Voir le source...
it.beos.ViewSrc:Mostra sorgente...
nl.beos.ViewSrc:Toon HTML...
+en.beos.ViewSrcAccel:U
# Main -> Page -> Export menu
#
@@ -265,21 +268,25 @@ de.all.Home:Homepage
fr.all.Home:Page d'accueil
it.all.Home:Pagina iniziale
nl.all.Home:Startpagina
+en.beos.HomeAccel:H
en.all.Back:Back one page
de.all.Back:Eine Seite zurück
fr.all.Back:Retour
it.all.Back:Indietro
nl.all.Back:Vorige pagina
+en.beos.BackAccel:←
en.all.Forward:Forward one page
de.all.Forward:Eine Seite vor
fr.all.Forward:Avancer
it.all.Forward:Avanti
nl.all.Forward:Volgende pagina
+en.beos.ForwardAccel:→
en.all.UpLevel:Up one level
de.all.UpLevel:Eine Ebene hoch
fr.all.UpLevel:Remonter d'un niveau
it.all.UpLevel:Livello superiore
nl.all.UpLevel:Niveau omhoog
+en.beos.UpLevelAccel:↑
en.ro.Reload:Reload this page ^F5
de.ro.Reload:Seite erneut laden ^F5
fr.ro.Reload:Recharger cette page ^F5
@@ -290,11 +297,13 @@ de.beos.Reload:Seite erneut laden
fr.beos.Reload:Recharger cette page
it.beos.Reload:Ricarica
nl.beos.Reload:Herlaad pagina
+en.beos.ReloadAccel:R
en.all.Stop:Stop loading this page
de.all.Stop:Ladevorgang abbrechen
fr.all.Stop:Arrêter le chargement de la page
it.all.Stop:Interrompi
nl.all.Stop:Breek ophaalproces af
+en.beos.StopAccel:S
# Main -> Display menu
#
-----------------------------------------------------------------------
Summary of changes:
resources/FatMessages | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/resources/FatMessages b/resources/FatMessages
index 9fb5939..ead95fc 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -85,6 +85,7 @@ de.all.Quit:Beenden
fr.all.Quit:Quitter
it.all.Quit:Esci
nl.all.Quit:Stop
+en.beos.QuitAccel:Q
# Iconbar -> Open menu
#
@@ -162,6 +163,7 @@ de.ro.NewWindow:Neues Fenster ^N
fr.ro.NewWindow:Nouvelle fenêtre ^N
it.ro.NewWindow:Nuova finestra ^N
nl.ro.NewWindow:Nieuw venster ^N
+en.beos.NewWindowNSAccel:N
en.ro.ViewSrc:View source... F8
de.ro.ViewSrc:Quellcode... F8
fr.ro.ViewSrc:Voir le source... F8
@@ -172,6 +174,7 @@ de.beos.ViewSrc:Quellcode...
fr.beos.ViewSrc:Voir le source...
it.beos.ViewSrc:Mostra sorgente...
nl.beos.ViewSrc:Toon HTML...
+en.beos.ViewSrcAccel:U
# Main -> Page -> Export menu
#
@@ -265,21 +268,25 @@ de.all.Home:Homepage
fr.all.Home:Page d'accueil
it.all.Home:Pagina iniziale
nl.all.Home:Startpagina
+en.beos.HomeAccel:H
en.all.Back:Back one page
de.all.Back:Eine Seite zurück
fr.all.Back:Retour
it.all.Back:Indietro
nl.all.Back:Vorige pagina
+en.beos.BackAccel:←
en.all.Forward:Forward one page
de.all.Forward:Eine Seite vor
fr.all.Forward:Avancer
it.all.Forward:Avanti
nl.all.Forward:Volgende pagina
+en.beos.ForwardAccel:→
en.all.UpLevel:Up one level
de.all.UpLevel:Eine Ebene hoch
fr.all.UpLevel:Remonter d'un niveau
it.all.UpLevel:Livello superiore
nl.all.UpLevel:Niveau omhoog
+en.beos.UpLevelAccel:↑
en.ro.Reload:Reload this page ^F5
de.ro.Reload:Seite erneut laden ^F5
fr.ro.Reload:Recharger cette page ^F5
@@ -290,11 +297,13 @@ de.beos.Reload:Seite erneut laden
fr.beos.Reload:Recharger cette page
it.beos.Reload:Ricarica
nl.beos.Reload:Herlaad pagina
+en.beos.ReloadAccel:R
en.all.Stop:Stop loading this page
de.all.Stop:Ladevorgang abbrechen
fr.all.Stop:Arrêter le chargement de la page
it.all.Stop:Interrompi
nl.all.Stop:Breek ophaalproces af
+en.beos.StopAccel:S
# Main -> Display menu
#
--
NetSurf Browser
6 years, 4 months
netsurf: branch master updated. release/3.6-34-g30ca72b
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/30ca72b32eba20793b288...
...commit http://git.netsurf-browser.org/netsurf.git/commit/30ca72b32eba20793b2888b...
...tree http://git.netsurf-browser.org/netsurf.git/tree/30ca72b32eba20793b2888be3...
The branch, master has been updated
via 30ca72b32eba20793b2888be35992fdc5dae375b (commit)
from b5fd0ae1ed4558b50cb7e3002e8f0c7042a4617d (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=30ca72b32eba20793b2...
commit 30ca72b32eba20793b2888be35992fdc5dae375b
Author: François Revol <revol(a)free.fr>
Commit: François Revol <revol(a)free.fr>
haiku: Rework menu accelerator handling
Instead of splitting accel keys from the item string, we go the GTK
way of using a separate Accel-suffixed string id.
diff --git a/frontends/beos/scaffolding.cpp b/frontends/beos/scaffolding.cpp
index 1fe22ff..a79cf91 100644
--- a/frontends/beos/scaffolding.cpp
+++ b/frontends/beos/scaffolding.cpp
@@ -1566,36 +1566,34 @@ static BMenuItem *make_menu_item(const char *name, BMessage *message, bool enabl
{
BMenuItem *item;
BString label(messages_get(name));
- BString accel;
+ BString accelKey(name);
+ accelKey += "Accel";
+ BString accel(messages_get(accelKey));
+ if (accel == accelKey)
+ accel = "";
uint32 mods = 0;
char key = 0;
// try to understand accelerators
- int32 start = label.IFindLast(" ");
- if (start > 0 && (label.Length() - start > 1)
- && (label.Length() - start < 7)
- && (label[start + 1] == 'F'
- || !strcmp(label.String() + start + 1, "PRINT")
- || label[start + 1] == '\xe2'
- || label[start + 1] == '^')) {
-
- label.MoveInto(accel, start + 1, label.Length());
- // strip the trailing spaces
- while (label[label.Length() - 1] == ' ')
- label.Truncate(label.Length() - 1);
-
+ if (!accel.IsEmpty()) {
if (accel.FindFirst("\xe2\x87\x91") > -1) {
accel.RemoveFirst("\xe2\x87\x91");
mods |= B_SHIFT_KEY;
}
if (accel.FindFirst("^") > -1) {
accel.RemoveFirst("^");
- mods |= B_CONTROL_KEY; // ALT!!!
+ mods |= B_CONTROL_KEY;
}
if (accel.FindFirst("PRINT") > -1) {
accel.RemoveFirst("PRINT");
//mods |= ; // ALT!!!
key = B_PRINT_KEY;
}
+
+ /* replace UTF-8 glyphs (arrows...) with API codes */
+ accel.ReplaceAll("\xE2\x86\x90", (BString()+=B_LEFT_ARROW).String());
+ accel.ReplaceAll("\xE2\x86\x92", (BString()+=B_RIGHT_ARROW).String());
+ accel.ReplaceAll("\xE2\x86\x91", (BString()+=B_UP_ARROW).String());
+
if (accel.Length() > 1 && accel[0] == 'F') { // Function key
int num;
if (sscanf(accel.String(), "F%d", &num) > 0) {
-----------------------------------------------------------------------
Summary of changes:
frontends/beos/scaffolding.cpp | 28 +++++++++++++---------------
1 file changed, 13 insertions(+), 15 deletions(-)
diff --git a/frontends/beos/scaffolding.cpp b/frontends/beos/scaffolding.cpp
index 1fe22ff..a79cf91 100644
--- a/frontends/beos/scaffolding.cpp
+++ b/frontends/beos/scaffolding.cpp
@@ -1566,36 +1566,34 @@ static BMenuItem *make_menu_item(const char *name, BMessage *message, bool enabl
{
BMenuItem *item;
BString label(messages_get(name));
- BString accel;
+ BString accelKey(name);
+ accelKey += "Accel";
+ BString accel(messages_get(accelKey));
+ if (accel == accelKey)
+ accel = "";
uint32 mods = 0;
char key = 0;
// try to understand accelerators
- int32 start = label.IFindLast(" ");
- if (start > 0 && (label.Length() - start > 1)
- && (label.Length() - start < 7)
- && (label[start + 1] == 'F'
- || !strcmp(label.String() + start + 1, "PRINT")
- || label[start + 1] == '\xe2'
- || label[start + 1] == '^')) {
-
- label.MoveInto(accel, start + 1, label.Length());
- // strip the trailing spaces
- while (label[label.Length() - 1] == ' ')
- label.Truncate(label.Length() - 1);
-
+ if (!accel.IsEmpty()) {
if (accel.FindFirst("\xe2\x87\x91") > -1) {
accel.RemoveFirst("\xe2\x87\x91");
mods |= B_SHIFT_KEY;
}
if (accel.FindFirst("^") > -1) {
accel.RemoveFirst("^");
- mods |= B_CONTROL_KEY; // ALT!!!
+ mods |= B_CONTROL_KEY;
}
if (accel.FindFirst("PRINT") > -1) {
accel.RemoveFirst("PRINT");
//mods |= ; // ALT!!!
key = B_PRINT_KEY;
}
+
+ /* replace UTF-8 glyphs (arrows...) with API codes */
+ accel.ReplaceAll("\xE2\x86\x90", (BString()+=B_LEFT_ARROW).String());
+ accel.ReplaceAll("\xE2\x86\x92", (BString()+=B_RIGHT_ARROW).String());
+ accel.ReplaceAll("\xE2\x86\x91", (BString()+=B_UP_ARROW).String());
+
if (accel.Length() > 1 && accel[0] == 'F') { // Function key
int num;
if (sscanf(accel.String(), "F%d", &num) > 0) {
--
NetSurf Browser
6 years, 4 months
netsurf: branch master updated. release/3.6-33-gb5fd0ae
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/b5fd0ae1ed4558b50cb7e...
...commit http://git.netsurf-browser.org/netsurf.git/commit/b5fd0ae1ed4558b50cb7e30...
...tree http://git.netsurf-browser.org/netsurf.git/tree/b5fd0ae1ed4558b50cb7e3002...
The branch, master has been updated
via b5fd0ae1ed4558b50cb7e3002e8f0c7042a4617d (commit)
from 31b1c72ddc66512c3a9cef4e59b94bdafc713ad4 (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=b5fd0ae1ed4558b50cb...
commit b5fd0ae1ed4558b50cb7e3002e8f0c7042a4617d
Author: François Revol <revol(a)free.fr>
Commit: François Revol <revol(a)free.fr>
haiku: catch NetPositive messages also in the Window
At least Pe sends them there for its Help menu.
diff --git a/frontends/beos/scaffolding.cpp b/frontends/beos/scaffolding.cpp
index 47f18c9..1fe22ff 100644
--- a/frontends/beos/scaffolding.cpp
+++ b/frontends/beos/scaffolding.cpp
@@ -729,6 +729,15 @@ NSBrowserWindow::MessageReceived(BMessage *message)
case B_ARGV_RECEIVED:
case B_REFS_RECEIVED:
case B_UI_SETTINGS_CHANGED:
+ // NetPositive messages
+ case B_NETPOSITIVE_OPEN_URL:
+ case B_NETPOSITIVE_BACK:
+ case B_NETPOSITIVE_FORWARD:
+ case B_NETPOSITIVE_HOME:
+ case B_NETPOSITIVE_RELOAD:
+ case B_NETPOSITIVE_STOP:
+ case B_NETPOSITIVE_DOWN:
+ case B_NETPOSITIVE_UP:
DetachCurrentMessage();
nsbeos_pipe_message_top(message, this, fScaffolding);
break;
-----------------------------------------------------------------------
Summary of changes:
frontends/beos/scaffolding.cpp | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/frontends/beos/scaffolding.cpp b/frontends/beos/scaffolding.cpp
index 47f18c9..1fe22ff 100644
--- a/frontends/beos/scaffolding.cpp
+++ b/frontends/beos/scaffolding.cpp
@@ -729,6 +729,15 @@ NSBrowserWindow::MessageReceived(BMessage *message)
case B_ARGV_RECEIVED:
case B_REFS_RECEIVED:
case B_UI_SETTINGS_CHANGED:
+ // NetPositive messages
+ case B_NETPOSITIVE_OPEN_URL:
+ case B_NETPOSITIVE_BACK:
+ case B_NETPOSITIVE_FORWARD:
+ case B_NETPOSITIVE_HOME:
+ case B_NETPOSITIVE_RELOAD:
+ case B_NETPOSITIVE_STOP:
+ case B_NETPOSITIVE_DOWN:
+ case B_NETPOSITIVE_UP:
DetachCurrentMessage();
nsbeos_pipe_message_top(message, this, fScaffolding);
break;
--
NetSurf Browser
6 years, 4 months
netsurf: branch master updated. release/3.6-32-g31b1c72
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/31b1c72ddc66512c3a9ce...
...commit http://git.netsurf-browser.org/netsurf.git/commit/31b1c72ddc66512c3a9cef4...
...tree http://git.netsurf-browser.org/netsurf.git/tree/31b1c72ddc66512c3a9cef4e5...
The branch, master has been updated
via 31b1c72ddc66512c3a9cef4e59b94bdafc713ad4 (commit)
via 35146ef0c8f72526683f306a07d5cc70a070fe85 (commit)
from bcce8cc7b41f869fa2b022f85622cd389082d0f5 (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=31b1c72ddc66512c3a9...
commit 31b1c72ddc66512c3a9cef4e59b94bdafc713ad4
Author: François Revol <revol(a)free.fr>
Commit: François Revol <revol(a)free.fr>
haiku: add a file extension when viewing source
Pe still requires it to detect the language, this makes it easier.
diff --git a/frontends/beos/gui.cpp b/frontends/beos/gui.cpp
index 254fa90..c1b1536 100644
--- a/frontends/beos/gui.cpp
+++ b/frontends/beos/gui.cpp
@@ -840,13 +840,28 @@ void nsbeos_gui_view_source(struct hlcache_handle *content)
* allow it to be re-used next time NetSurf is started. The
* memory overhead from doing this is under 1 byte per
* filename. */
- const char *filename = filename_request();
- if (!filename) {
+ BString filename(filename_request());
+ if (filename.IsEmpty()) {
beos_warn_user("NoMemory", 0);
return;
}
+
+ lwc_string *mime = content_get_mime_type(content);
+
+ /* provide an extension, as Pe still doesn't sniff the MIME */
+ if (mime) {
+ BMimeType type(lwc_string_data(mime));
+ BMessage extensions;
+ if (type.GetFileExtensions(&extensions) == B_OK) {
+ BString ext;
+ if (extensions.FindString("extensions", &ext) == B_OK)
+ filename << "." << ext;
+ }
+ /* we unref(mime) later on, we just leak on error */
+ }
+
path.SetTo(TEMP_FILENAME_PREFIX);
- path.Append(filename);
+ path.Append(filename.String());
BFile file(path.Path(), B_WRITE_ONLY | B_CREATE_FILE);
err = file.InitCheck();
if (err < B_OK) {
@@ -858,7 +873,7 @@ void nsbeos_gui_view_source(struct hlcache_handle *content)
beos_warn_user("IOError", strerror(err));
return;
}
- lwc_string *mime = content_get_mime_type(content);
+
if (mime) {
file.WriteAttr("BEOS:TYPE", B_MIME_STRING_TYPE, 0LL,
lwc_string_data(mime), lwc_string_length(mime) + 1);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=35146ef0c8f72526683...
commit 35146ef0c8f72526683f306a07d5cc70a070fe85
Author: François Revol <revol(a)free.fr>
Commit: François Revol <revol(a)free.fr>
haiku: try to open source in preferred app for source-code first
We still fall back to the hardcoded list, but we first check for the
user's prefered code editor.
diff --git a/frontends/beos/gui.cpp b/frontends/beos/gui.cpp
index 8c6614d..254fa90 100644
--- a/frontends/beos/gui.cpp
+++ b/frontends/beos/gui.cpp
@@ -877,6 +877,7 @@ void nsbeos_gui_view_source(struct hlcache_handle *content)
// apps to try
const char *editorSigs[] = {
+ "text/x-source-code",
"application/x-vnd.beunited.pe",
"application/x-vnd.XEmacs",
"application/x-vnd.Haiku-StyledEdit",
@@ -891,10 +892,11 @@ void nsbeos_gui_view_source(struct hlcache_handle *content)
BMessenger msgr(editorSigs[i], team);
if (msgr.SendMessage(&m) >= B_OK)
break;
+
}
err = be_roster->Launch(editorSigs[i], (BMessage *)&m, &team);
- if (err >= B_OK)
+ if (err >= B_OK || err == B_ALREADY_RUNNING)
break;
}
}
-----------------------------------------------------------------------
Summary of changes:
frontends/beos/gui.cpp | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/frontends/beos/gui.cpp b/frontends/beos/gui.cpp
index 8c6614d..c1b1536 100644
--- a/frontends/beos/gui.cpp
+++ b/frontends/beos/gui.cpp
@@ -840,13 +840,28 @@ void nsbeos_gui_view_source(struct hlcache_handle *content)
* allow it to be re-used next time NetSurf is started. The
* memory overhead from doing this is under 1 byte per
* filename. */
- const char *filename = filename_request();
- if (!filename) {
+ BString filename(filename_request());
+ if (filename.IsEmpty()) {
beos_warn_user("NoMemory", 0);
return;
}
+
+ lwc_string *mime = content_get_mime_type(content);
+
+ /* provide an extension, as Pe still doesn't sniff the MIME */
+ if (mime) {
+ BMimeType type(lwc_string_data(mime));
+ BMessage extensions;
+ if (type.GetFileExtensions(&extensions) == B_OK) {
+ BString ext;
+ if (extensions.FindString("extensions", &ext) == B_OK)
+ filename << "." << ext;
+ }
+ /* we unref(mime) later on, we just leak on error */
+ }
+
path.SetTo(TEMP_FILENAME_PREFIX);
- path.Append(filename);
+ path.Append(filename.String());
BFile file(path.Path(), B_WRITE_ONLY | B_CREATE_FILE);
err = file.InitCheck();
if (err < B_OK) {
@@ -858,7 +873,7 @@ void nsbeos_gui_view_source(struct hlcache_handle *content)
beos_warn_user("IOError", strerror(err));
return;
}
- lwc_string *mime = content_get_mime_type(content);
+
if (mime) {
file.WriteAttr("BEOS:TYPE", B_MIME_STRING_TYPE, 0LL,
lwc_string_data(mime), lwc_string_length(mime) + 1);
@@ -877,6 +892,7 @@ void nsbeos_gui_view_source(struct hlcache_handle *content)
// apps to try
const char *editorSigs[] = {
+ "text/x-source-code",
"application/x-vnd.beunited.pe",
"application/x-vnd.XEmacs",
"application/x-vnd.Haiku-StyledEdit",
@@ -891,10 +907,11 @@ void nsbeos_gui_view_source(struct hlcache_handle *content)
BMessenger msgr(editorSigs[i], team);
if (msgr.SendMessage(&m) >= B_OK)
break;
+
}
err = be_roster->Launch(editorSigs[i], (BMessage *)&m, &team);
- if (err >= B_OK)
+ if (err >= B_OK || err == B_ALREADY_RUNNING)
break;
}
}
--
NetSurf Browser
6 years, 4 months
netsurf: branch master updated. release/3.6-30-gbcce8cc
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/bcce8cc7b41f869fa2b02...
...commit http://git.netsurf-browser.org/netsurf.git/commit/bcce8cc7b41f869fa2b022f...
...tree http://git.netsurf-browser.org/netsurf.git/tree/bcce8cc7b41f869fa2b022f85...
The branch, master has been updated
via bcce8cc7b41f869fa2b022f85622cd389082d0f5 (commit)
via f679a9b1d6b652e06c24d543c7c5921753e3071b (commit)
from d436992eb2a28e2e056e96e42072b13d89b44a0b (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=bcce8cc7b41f869fa2b...
commit bcce8cc7b41f869fa2b022f85622cd389082d0f5
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
fix spelling of retrived
diff --git a/content/backing_store.h b/content/backing_store.h
index 4e29511..3a1ae8f 100644
--- a/content/backing_store.h
+++ b/content/backing_store.h
@@ -38,7 +38,7 @@ enum backing_store_flags {
* low level cache backing store operation table
*
* The low level cache (source objects) has the capability to make
- * objects and their metadata (headers etc) persistant by writing to a
+ * objects and their metadata (headers etc) persistent by writing to a
* backing store using these operations.
*/
struct gui_llcache_table {
@@ -46,14 +46,14 @@ struct gui_llcache_table {
* Initialise the backing store.
*
* @param parameters to configure backing store.
- * @return NSERROR_OK on success or error code on faliure.
+ * @return NSERROR_OK on success or error code on failure.
*/
nserror (*initialise)(const struct llcache_store_parameters *parameters);
/**
* Finalise the backing store.
*
- * @return NSERROR_OK on success or error code on faliure.
+ * @return NSERROR_OK on success or error code on failure.
*/
nserror (*finalise)(void);
@@ -72,16 +72,16 @@ struct gui_llcache_table {
* been completely written on return.
*
* @param[in] url The url is used as the unique primary key for the data.
- * @param[in] flags The flags to control how the obejct is stored.
+ * @param[in] flags The flags to control how the object is stored.
* @param[in] data The objects data.
* @param[in] datalen The length of the \a data.
- * @return NSERROR_OK on success or error code on faliure.
+ * @return NSERROR_OK on success or error code on failure.
*/
nserror (*store)(struct nsurl *url, enum backing_store_flags flags,
uint8_t *data, const size_t datalen);
/**
- * Retrive an object from the backing store.
+ * Retrieve an object from the backing store.
*
* The backing store will manage its own memory and the
* allocations returned in \a data *must* not be altered.
@@ -91,10 +91,10 @@ struct gui_llcache_table {
* calling the release method.
*
* @param[in] url The url is used as the unique primary key for the data.
- * @param[in] flags The flags to control how the object is retrived.
- * @param[out] data The retrived objects data.
+ * @param[in] flags The flags to control how the object is retrieved.
+ * @param[out] data The retrieved objects data.
* @param[out] datalen The length of the \a data retrieved.
- * @return NSERROR_OK on success or error code on faliure.
+ * @return NSERROR_OK on success or error code on failure.
*/
nserror (*fetch)(struct nsurl *url, enum backing_store_flags flags,
uint8_t **data, size_t *datalen);
@@ -104,7 +104,7 @@ struct gui_llcache_table {
*
* @param url The url is used as the unique primary key to invalidate.
* @param[in] flags The flags to control how the object data is released.
- * @return NSERROR_OK on success or error code on faliure.
+ * @return NSERROR_OK on success or error code on failure.
*/
nserror (*release)(struct nsurl *url, enum backing_store_flags flags);
@@ -117,7 +117,7 @@ struct gui_llcache_table {
* If the entry had data allocated it will be released.
*
* @param url The url is used as the unique primary key to invalidate.
- * @return NSERROR_OK on success or error code on faliure.
+ * @return NSERROR_OK on success or error code on failure.
*/
nserror (*invalidate)(struct nsurl *url);
diff --git a/content/handlers/css/hints.h b/content/handlers/css/hints.h
index 2c18359..3d44d21 100644
--- a/content/handlers/css/hints.h
+++ b/content/handlers/css/hints.h
@@ -31,8 +31,8 @@ void css_hint_fini(void);
*
* \param[in] pw HTML document
* \param[in] node DOM node
- * \param[out] nhints number of hints retrived
- * \param[out] hints retrived hints
+ * \param[out] nhints number of hints retrieved
+ * \param[out] hints retrieved hints
* \return CSS_OK on success,
* CSS_PROPERTY_NOT_SET if there is no hint for the requested property,
* CSS_NOMEM on memory exhaustion.
diff --git a/desktop/searchweb.c b/desktop/searchweb.c
index 593591c..29a998e 100644
--- a/desktop/searchweb.c
+++ b/desktop/searchweb.c
@@ -60,7 +60,7 @@ static const char *default_search_icon_url = "resource:icons/search.png";
/**
* Read providers file.
*
- * Allocates stoage of sufficient size for the providers file and
+ * Allocates storage of sufficient size for the providers file and
* reads the entire file in.
*
* \param fname The filename to read.
@@ -132,7 +132,7 @@ read_providers(const char *fname,
* \param providers_size The size of the provider data.
* \param providers_out The resulting provider array.
* \param providers_count The number of providers in the output array.
- * \return NSERROR_OK on success or error code on faliure.
+ * \return NSERROR_OK on success or error code on failure.
*/
static nserror
parse_providers(char *providersd,
@@ -224,7 +224,7 @@ parse_providers(char *providersd,
* \param provider The provider to use.
* \param term The term being searched for.
* \param url_out The resulting url.
- * \return NSERROR_OK on sucess or appropriate error code.
+ * \return NSERROR_OK on success or appropriate error code.
*/
static nserror
make_search_nsurl(struct search_provider *provider,
@@ -289,7 +289,7 @@ search_web_ico_callback(hlcache_handle *ico,
switch (event->type) {
case CONTENT_MSG_DONE:
- LOG("icon '%s' retrived", nsurl_access(hlcache_handle_get_url(ico)));
+ LOG("icon '%s' retrieved", nsurl_access(hlcache_handle_get_url(ico)));
guit->search_web->provider_update(provider->name,
content_get_bitmap(ico));
break;
@@ -399,7 +399,7 @@ nserror search_web_select_provider(int selection)
guit->search_web->provider_update(provider->name, ico_bitmap);
- /* if the providers icon has not been retrived get it now */
+ /* if the providers icon has not been retrieved get it now */
if (provider->ico_handle == NULL) {
nsurl *icon_nsurl;
nserror ret;
@@ -438,7 +438,7 @@ default_ico_callback(hlcache_handle *ico,
switch (event->type) {
case CONTENT_MSG_DONE:
- LOG("default icon '%s' retrived", nsurl_access(hlcache_handle_get_url(ico)));
+ LOG("default icon '%s' retrieved", nsurl_access(hlcache_handle_get_url(ico)));
/* only set to default icon if providers icon has no handle */
if (ctx->providers[search_web_ctx.current].ico_handle == NULL) {
diff --git a/frontends/riscos/gui/url_bar.c b/frontends/riscos/gui/url_bar.c
index 30a72db..40c5c6f 100644
--- a/frontends/riscos/gui/url_bar.c
+++ b/frontends/riscos/gui/url_bar.c
@@ -21,7 +21,7 @@
* \file
* RISC OS URL bar implementation.
*
- * The treeview resources are retrived from resource url necessitating
+ * The treeview resources are retrieved from resource url necessitating
* the use of the hlcache content interface.
*/
@@ -966,7 +966,7 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url,
return;
/* Before we do anything with the URL, get it into local encoding so
- * that behaviour is consistant with the rest of the URL Bar module
+ * that behaviour is consistent with the rest of the URL Bar module
* (which will act on the icon's text buffer, which is always in local
* encoding).
*/
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=f679a9b1d6b652e06c2...
commit f679a9b1d6b652e06c24d543c7c5921753e3071b
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
fix spelling and doxygen comments in image cache
diff --git a/content/handlers/image/image_cache.c b/content/handlers/image/image_cache.c
index 3eb27ac..9c7ce22 100644
--- a/content/handlers/image/image_cache.c
+++ b/content/handlers/image/image_cache.c
@@ -16,6 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * \file
+ * Cache implementation for bitmap images decoded into frontend format.
+ */
+
#include <assert.h>
#include <inttypes.h>
#include <stdint.h>
@@ -34,22 +39,26 @@
#include "image/image_cache.h"
#include "image/image.h"
-/** Age of an entry within the cache
+/**
+ * Age of an entry within the cache
*
* type deffed away so it can be readily changed later perhaps to a
* wallclock time structure.
*/
typedef unsigned int cache_age;
-/** Image cache entry
+/**
+ * Image cache entry
*/
struct image_cache_entry_s {
- struct image_cache_entry_s *next; /* next cache entry in list */
- struct image_cache_entry_s *prev; /* previous cache entry in list */
-
- struct content *content; /** content is used as a key */
- struct bitmap *bitmap; /** associated bitmap entry */
- /** Conversion routine */
+ struct image_cache_entry_s *next; /**< next cache entry in list */
+ struct image_cache_entry_s *prev; /**< previous cache entry in list */
+
+ /** content is used as a key */
+ struct content *content;
+ /** associated bitmap entry */
+ struct bitmap *bitmap;
+ /** routine to convert content into bitmap */
image_cache_convert_fn *convert;
/* Statistics for replacement algorithm */
@@ -62,7 +71,8 @@ struct image_cache_entry_s {
int conversion_count; /**< Number of times image has been converted */
};
-/** Current state of the cache.
+/**
+ * Current state of the cache.
*
* Global state of the cache. entries "age" is determined based on a
* monotonically incrementing operation count. This avoids issues with
@@ -90,12 +100,12 @@ struct image_cache_s {
/** Maximum size of bitmaps allocated at any one time */
size_t max_bitmap_size;
- /** The number of objects when maximum bitmap usage occoured */
+ /** The number of objects when maximum bitmap usage occurred */
int max_bitmap_size_count;
/** Maximum count of bitmaps allocated at any one time */
int max_bitmap_count;
- /** The size of the bitmaps when the max count occoured */
+ /** The size of the bitmaps when the max count occurred */
size_t max_bitmap_count_size;
/** Bitmap was not available at plot time required conversion */
@@ -130,7 +140,11 @@ struct image_cache_s {
static struct image_cache_s *image_cache = NULL;
-/** Find the nth cache entry
+/**
+ * Find a cache entry by index.
+ *
+ * \param entryn index of cache entry
+ * \return cache entry at index or NULL if not found.
*/
static struct image_cache_entry_s *image_cache__findn(int entryn)
{
@@ -144,7 +158,12 @@ static struct image_cache_entry_s *image_cache__findn(int entryn)
return found;
}
-/** Find the cache entry for a content
+
+/**
+ * Find the cache entry for a content
+ *
+ * \param c The content to get an entry for
+ * \return The image cache entry or NULL if not found.
*/
static struct image_cache_entry_s *image_cache__find(const struct content *c)
{
@@ -157,6 +176,11 @@ static struct image_cache_entry_s *image_cache__find(const struct content *c)
return found;
}
+/**
+ * Update the image cache statistics with an entry.
+ *
+ * \param centry The image cache entry to update the stats with.
+ */
static void image_cache_stats_bitmap_add(struct image_cache_entry_s *centry)
{
centry->bitmap_age = image_cache->current_age;
@@ -223,11 +247,20 @@ static void image_cache__unlink(struct image_cache_entry_s *centry)
}
}
+/**
+ * free bitmap from an image cache entry
+ *
+ * \param centry The image cache entry to free bitmap from.
+ */
static void image_cache__free_bitmap(struct image_cache_entry_s *centry)
{
if (centry->bitmap != NULL) {
#ifdef IMAGE_CACHE_VERBOSE
- LOG("Freeing bitmap %p size %d age %d redraw count %d", centry->bitmap, centry->bitmap_size, image_cache->current_age - centry->bitmap_age, centry->redraw_count);
+ LOG("Freeing bitmap %p size %d age %d redraw count %d",
+ centry->bitmap,
+ centry->bitmap_size,
+ image_cache->current_age - centry->bitmap_age,
+ centry->redraw_count);
#endif
guit->bitmap->destroy(centry->bitmap);
centry->bitmap = NULL;
@@ -240,7 +273,11 @@ static void image_cache__free_bitmap(struct image_cache_entry_s *centry)
}
-/* free cache entry */
+/**
+ * free image cache entry
+ *
+ * \param centry The image cache entry to free.
+ */
static void image_cache__free_entry(struct image_cache_entry_s *centry)
{
#ifdef IMAGE_CACHE_VERBOSE
@@ -258,7 +295,11 @@ static void image_cache__free_entry(struct image_cache_entry_s *centry)
free(centry);
}
-/** Cache cleaner */
+/**
+ * Image cache cleaner
+ *
+ * \param icache The image cache context.
+ */
static void image_cache__clean(struct image_cache_s *icache)
{
struct image_cache_entry_s *centry = icache->entries;
@@ -277,7 +318,11 @@ static void image_cache__clean(struct image_cache_s *icache)
}
}
-/** Cache background scheduled callback. */
+/**
+ * Cache background scheduled callback.
+ *
+ * \param p The image cache context.
+ */
static void image_cache__background_update(void *p)
{
struct image_cache_s *icache = p;
@@ -377,7 +422,7 @@ image_cache_init(const struct image_cache_parameters *image_cache_parameters)
image_cache__background_update,
image_cache);
- LOG("Image cache initilised with a limit of %" PRIsizet " hysteresis of %"PRIsizet,
+ LOG("Image cache initialised with a limit of %" PRIsizet " hysteresis of %"PRIsizet,
image_cache->params.limit, image_cache->params.hysteresis);
return NSERROR_OK;
@@ -678,7 +723,7 @@ int image_cache_snentryf(char *string, size_t size, unsigned int entryn,
case 'U':
slen += snprintf(string + slen, size - slen,
- "%s", nsurl_access(llcache_handle_get_url(centry->content->llcache)));
+ "%s", nsurl_access(llcache_handle_get_url(centry->content->llcache)));
break;
case 'o':
@@ -690,20 +735,20 @@ int image_cache_snentryf(char *string, size_t size, unsigned int entryn,
centry->content->
llcache),
NSURL_HOST);
-
+
slen += snprintf(string + slen,
size - slen, "%s",
- lwc_string_data(
- origin));
+ lwc_string_data(
+ origin));
lwc_string_unref(origin);
} else {
slen += snprintf(string + slen,
size - slen, "%s",
- "localhost");
+ "localhost");
}
break;
-
+
case 's':
if (centry->bitmap != NULL) {
slen += snprintf(string + slen,
@@ -774,6 +819,7 @@ bool image_cache_redraw(struct content *c,
return image_bitmap_plot(centry->bitmap, data, clip, ctx);
}
+/* exported interface documented in image_cache.h */
void image_cache_destroy(struct content *content)
{
struct image_cache_entry_s *centry;
@@ -787,11 +833,13 @@ void image_cache_destroy(struct content *content)
}
}
+/* exported interface documented in image_cache.h */
void *image_cache_get_internal(const struct content *c, void *context)
{
return image_cache_get_bitmap(c);
}
+/* exported interface documented in image_cache.h */
content_type image_cache_content_type(void)
{
return CONTENT_IMAGE;
-----------------------------------------------------------------------
Summary of changes:
content/backing_store.h | 22 ++++----
content/handlers/css/hints.h | 4 +-
content/handlers/image/image_cache.c | 96 +++++++++++++++++++++++++---------
desktop/searchweb.c | 12 ++---
frontends/riscos/gui/url_bar.c | 4 +-
5 files changed, 93 insertions(+), 45 deletions(-)
diff --git a/content/backing_store.h b/content/backing_store.h
index 4e29511..3a1ae8f 100644
--- a/content/backing_store.h
+++ b/content/backing_store.h
@@ -38,7 +38,7 @@ enum backing_store_flags {
* low level cache backing store operation table
*
* The low level cache (source objects) has the capability to make
- * objects and their metadata (headers etc) persistant by writing to a
+ * objects and their metadata (headers etc) persistent by writing to a
* backing store using these operations.
*/
struct gui_llcache_table {
@@ -46,14 +46,14 @@ struct gui_llcache_table {
* Initialise the backing store.
*
* @param parameters to configure backing store.
- * @return NSERROR_OK on success or error code on faliure.
+ * @return NSERROR_OK on success or error code on failure.
*/
nserror (*initialise)(const struct llcache_store_parameters *parameters);
/**
* Finalise the backing store.
*
- * @return NSERROR_OK on success or error code on faliure.
+ * @return NSERROR_OK on success or error code on failure.
*/
nserror (*finalise)(void);
@@ -72,16 +72,16 @@ struct gui_llcache_table {
* been completely written on return.
*
* @param[in] url The url is used as the unique primary key for the data.
- * @param[in] flags The flags to control how the obejct is stored.
+ * @param[in] flags The flags to control how the object is stored.
* @param[in] data The objects data.
* @param[in] datalen The length of the \a data.
- * @return NSERROR_OK on success or error code on faliure.
+ * @return NSERROR_OK on success or error code on failure.
*/
nserror (*store)(struct nsurl *url, enum backing_store_flags flags,
uint8_t *data, const size_t datalen);
/**
- * Retrive an object from the backing store.
+ * Retrieve an object from the backing store.
*
* The backing store will manage its own memory and the
* allocations returned in \a data *must* not be altered.
@@ -91,10 +91,10 @@ struct gui_llcache_table {
* calling the release method.
*
* @param[in] url The url is used as the unique primary key for the data.
- * @param[in] flags The flags to control how the object is retrived.
- * @param[out] data The retrived objects data.
+ * @param[in] flags The flags to control how the object is retrieved.
+ * @param[out] data The retrieved objects data.
* @param[out] datalen The length of the \a data retrieved.
- * @return NSERROR_OK on success or error code on faliure.
+ * @return NSERROR_OK on success or error code on failure.
*/
nserror (*fetch)(struct nsurl *url, enum backing_store_flags flags,
uint8_t **data, size_t *datalen);
@@ -104,7 +104,7 @@ struct gui_llcache_table {
*
* @param url The url is used as the unique primary key to invalidate.
* @param[in] flags The flags to control how the object data is released.
- * @return NSERROR_OK on success or error code on faliure.
+ * @return NSERROR_OK on success or error code on failure.
*/
nserror (*release)(struct nsurl *url, enum backing_store_flags flags);
@@ -117,7 +117,7 @@ struct gui_llcache_table {
* If the entry had data allocated it will be released.
*
* @param url The url is used as the unique primary key to invalidate.
- * @return NSERROR_OK on success or error code on faliure.
+ * @return NSERROR_OK on success or error code on failure.
*/
nserror (*invalidate)(struct nsurl *url);
diff --git a/content/handlers/css/hints.h b/content/handlers/css/hints.h
index 2c18359..3d44d21 100644
--- a/content/handlers/css/hints.h
+++ b/content/handlers/css/hints.h
@@ -31,8 +31,8 @@ void css_hint_fini(void);
*
* \param[in] pw HTML document
* \param[in] node DOM node
- * \param[out] nhints number of hints retrived
- * \param[out] hints retrived hints
+ * \param[out] nhints number of hints retrieved
+ * \param[out] hints retrieved hints
* \return CSS_OK on success,
* CSS_PROPERTY_NOT_SET if there is no hint for the requested property,
* CSS_NOMEM on memory exhaustion.
diff --git a/content/handlers/image/image_cache.c b/content/handlers/image/image_cache.c
index 3eb27ac..9c7ce22 100644
--- a/content/handlers/image/image_cache.c
+++ b/content/handlers/image/image_cache.c
@@ -16,6 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * \file
+ * Cache implementation for bitmap images decoded into frontend format.
+ */
+
#include <assert.h>
#include <inttypes.h>
#include <stdint.h>
@@ -34,22 +39,26 @@
#include "image/image_cache.h"
#include "image/image.h"
-/** Age of an entry within the cache
+/**
+ * Age of an entry within the cache
*
* type deffed away so it can be readily changed later perhaps to a
* wallclock time structure.
*/
typedef unsigned int cache_age;
-/** Image cache entry
+/**
+ * Image cache entry
*/
struct image_cache_entry_s {
- struct image_cache_entry_s *next; /* next cache entry in list */
- struct image_cache_entry_s *prev; /* previous cache entry in list */
-
- struct content *content; /** content is used as a key */
- struct bitmap *bitmap; /** associated bitmap entry */
- /** Conversion routine */
+ struct image_cache_entry_s *next; /**< next cache entry in list */
+ struct image_cache_entry_s *prev; /**< previous cache entry in list */
+
+ /** content is used as a key */
+ struct content *content;
+ /** associated bitmap entry */
+ struct bitmap *bitmap;
+ /** routine to convert content into bitmap */
image_cache_convert_fn *convert;
/* Statistics for replacement algorithm */
@@ -62,7 +71,8 @@ struct image_cache_entry_s {
int conversion_count; /**< Number of times image has been converted */
};
-/** Current state of the cache.
+/**
+ * Current state of the cache.
*
* Global state of the cache. entries "age" is determined based on a
* monotonically incrementing operation count. This avoids issues with
@@ -90,12 +100,12 @@ struct image_cache_s {
/** Maximum size of bitmaps allocated at any one time */
size_t max_bitmap_size;
- /** The number of objects when maximum bitmap usage occoured */
+ /** The number of objects when maximum bitmap usage occurred */
int max_bitmap_size_count;
/** Maximum count of bitmaps allocated at any one time */
int max_bitmap_count;
- /** The size of the bitmaps when the max count occoured */
+ /** The size of the bitmaps when the max count occurred */
size_t max_bitmap_count_size;
/** Bitmap was not available at plot time required conversion */
@@ -130,7 +140,11 @@ struct image_cache_s {
static struct image_cache_s *image_cache = NULL;
-/** Find the nth cache entry
+/**
+ * Find a cache entry by index.
+ *
+ * \param entryn index of cache entry
+ * \return cache entry at index or NULL if not found.
*/
static struct image_cache_entry_s *image_cache__findn(int entryn)
{
@@ -144,7 +158,12 @@ static struct image_cache_entry_s *image_cache__findn(int entryn)
return found;
}
-/** Find the cache entry for a content
+
+/**
+ * Find the cache entry for a content
+ *
+ * \param c The content to get an entry for
+ * \return The image cache entry or NULL if not found.
*/
static struct image_cache_entry_s *image_cache__find(const struct content *c)
{
@@ -157,6 +176,11 @@ static struct image_cache_entry_s *image_cache__find(const struct content *c)
return found;
}
+/**
+ * Update the image cache statistics with an entry.
+ *
+ * \param centry The image cache entry to update the stats with.
+ */
static void image_cache_stats_bitmap_add(struct image_cache_entry_s *centry)
{
centry->bitmap_age = image_cache->current_age;
@@ -223,11 +247,20 @@ static void image_cache__unlink(struct image_cache_entry_s *centry)
}
}
+/**
+ * free bitmap from an image cache entry
+ *
+ * \param centry The image cache entry to free bitmap from.
+ */
static void image_cache__free_bitmap(struct image_cache_entry_s *centry)
{
if (centry->bitmap != NULL) {
#ifdef IMAGE_CACHE_VERBOSE
- LOG("Freeing bitmap %p size %d age %d redraw count %d", centry->bitmap, centry->bitmap_size, image_cache->current_age - centry->bitmap_age, centry->redraw_count);
+ LOG("Freeing bitmap %p size %d age %d redraw count %d",
+ centry->bitmap,
+ centry->bitmap_size,
+ image_cache->current_age - centry->bitmap_age,
+ centry->redraw_count);
#endif
guit->bitmap->destroy(centry->bitmap);
centry->bitmap = NULL;
@@ -240,7 +273,11 @@ static void image_cache__free_bitmap(struct image_cache_entry_s *centry)
}
-/* free cache entry */
+/**
+ * free image cache entry
+ *
+ * \param centry The image cache entry to free.
+ */
static void image_cache__free_entry(struct image_cache_entry_s *centry)
{
#ifdef IMAGE_CACHE_VERBOSE
@@ -258,7 +295,11 @@ static void image_cache__free_entry(struct image_cache_entry_s *centry)
free(centry);
}
-/** Cache cleaner */
+/**
+ * Image cache cleaner
+ *
+ * \param icache The image cache context.
+ */
static void image_cache__clean(struct image_cache_s *icache)
{
struct image_cache_entry_s *centry = icache->entries;
@@ -277,7 +318,11 @@ static void image_cache__clean(struct image_cache_s *icache)
}
}
-/** Cache background scheduled callback. */
+/**
+ * Cache background scheduled callback.
+ *
+ * \param p The image cache context.
+ */
static void image_cache__background_update(void *p)
{
struct image_cache_s *icache = p;
@@ -377,7 +422,7 @@ image_cache_init(const struct image_cache_parameters *image_cache_parameters)
image_cache__background_update,
image_cache);
- LOG("Image cache initilised with a limit of %" PRIsizet " hysteresis of %"PRIsizet,
+ LOG("Image cache initialised with a limit of %" PRIsizet " hysteresis of %"PRIsizet,
image_cache->params.limit, image_cache->params.hysteresis);
return NSERROR_OK;
@@ -678,7 +723,7 @@ int image_cache_snentryf(char *string, size_t size, unsigned int entryn,
case 'U':
slen += snprintf(string + slen, size - slen,
- "%s", nsurl_access(llcache_handle_get_url(centry->content->llcache)));
+ "%s", nsurl_access(llcache_handle_get_url(centry->content->llcache)));
break;
case 'o':
@@ -690,20 +735,20 @@ int image_cache_snentryf(char *string, size_t size, unsigned int entryn,
centry->content->
llcache),
NSURL_HOST);
-
+
slen += snprintf(string + slen,
size - slen, "%s",
- lwc_string_data(
- origin));
+ lwc_string_data(
+ origin));
lwc_string_unref(origin);
} else {
slen += snprintf(string + slen,
size - slen, "%s",
- "localhost");
+ "localhost");
}
break;
-
+
case 's':
if (centry->bitmap != NULL) {
slen += snprintf(string + slen,
@@ -774,6 +819,7 @@ bool image_cache_redraw(struct content *c,
return image_bitmap_plot(centry->bitmap, data, clip, ctx);
}
+/* exported interface documented in image_cache.h */
void image_cache_destroy(struct content *content)
{
struct image_cache_entry_s *centry;
@@ -787,11 +833,13 @@ void image_cache_destroy(struct content *content)
}
}
+/* exported interface documented in image_cache.h */
void *image_cache_get_internal(const struct content *c, void *context)
{
return image_cache_get_bitmap(c);
}
+/* exported interface documented in image_cache.h */
content_type image_cache_content_type(void)
{
return CONTENT_IMAGE;
diff --git a/desktop/searchweb.c b/desktop/searchweb.c
index 593591c..29a998e 100644
--- a/desktop/searchweb.c
+++ b/desktop/searchweb.c
@@ -60,7 +60,7 @@ static const char *default_search_icon_url = "resource:icons/search.png";
/**
* Read providers file.
*
- * Allocates stoage of sufficient size for the providers file and
+ * Allocates storage of sufficient size for the providers file and
* reads the entire file in.
*
* \param fname The filename to read.
@@ -132,7 +132,7 @@ read_providers(const char *fname,
* \param providers_size The size of the provider data.
* \param providers_out The resulting provider array.
* \param providers_count The number of providers in the output array.
- * \return NSERROR_OK on success or error code on faliure.
+ * \return NSERROR_OK on success or error code on failure.
*/
static nserror
parse_providers(char *providersd,
@@ -224,7 +224,7 @@ parse_providers(char *providersd,
* \param provider The provider to use.
* \param term The term being searched for.
* \param url_out The resulting url.
- * \return NSERROR_OK on sucess or appropriate error code.
+ * \return NSERROR_OK on success or appropriate error code.
*/
static nserror
make_search_nsurl(struct search_provider *provider,
@@ -289,7 +289,7 @@ search_web_ico_callback(hlcache_handle *ico,
switch (event->type) {
case CONTENT_MSG_DONE:
- LOG("icon '%s' retrived", nsurl_access(hlcache_handle_get_url(ico)));
+ LOG("icon '%s' retrieved", nsurl_access(hlcache_handle_get_url(ico)));
guit->search_web->provider_update(provider->name,
content_get_bitmap(ico));
break;
@@ -399,7 +399,7 @@ nserror search_web_select_provider(int selection)
guit->search_web->provider_update(provider->name, ico_bitmap);
- /* if the providers icon has not been retrived get it now */
+ /* if the providers icon has not been retrieved get it now */
if (provider->ico_handle == NULL) {
nsurl *icon_nsurl;
nserror ret;
@@ -438,7 +438,7 @@ default_ico_callback(hlcache_handle *ico,
switch (event->type) {
case CONTENT_MSG_DONE:
- LOG("default icon '%s' retrived", nsurl_access(hlcache_handle_get_url(ico)));
+ LOG("default icon '%s' retrieved", nsurl_access(hlcache_handle_get_url(ico)));
/* only set to default icon if providers icon has no handle */
if (ctx->providers[search_web_ctx.current].ico_handle == NULL) {
diff --git a/frontends/riscos/gui/url_bar.c b/frontends/riscos/gui/url_bar.c
index 30a72db..40c5c6f 100644
--- a/frontends/riscos/gui/url_bar.c
+++ b/frontends/riscos/gui/url_bar.c
@@ -21,7 +21,7 @@
* \file
* RISC OS URL bar implementation.
*
- * The treeview resources are retrived from resource url necessitating
+ * The treeview resources are retrieved from resource url necessitating
* the use of the hlcache content interface.
*/
@@ -966,7 +966,7 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url,
return;
/* Before we do anything with the URL, get it into local encoding so
- * that behaviour is consistant with the rest of the URL Bar module
+ * that behaviour is consistent with the rest of the URL Bar module
* (which will act on the icon's text buffer, which is always in local
* encoding).
*/
--
NetSurf Browser
6 years, 4 months
libdom: branch master updated. release/0.3.1-4-g25f17fd
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libdom.git/shortlog/25f17fdecaa895478a9b2e...
...commit http://git.netsurf-browser.org/libdom.git/commit/25f17fdecaa895478a9b2e3e...
...tree http://git.netsurf-browser.org/libdom.git/tree/25f17fdecaa895478a9b2e3e59...
The branch, master has been updated
via 25f17fdecaa895478a9b2e3e59b044ac5a0e3c4d (commit)
from e59d7422cc1ce3f4446bb520995017f1ebad19e4 (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/libdom.git/commit/?id=25f17fdecaa895478a9b...
commit 25f17fdecaa895478a9b2e3e59b044ac5a0e3c4d
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Ignore http and https addresses when fetching entity refs
The fopen() causes a requester on AmigaOS which I'm bored of hearing about.
See also bug 2313
diff --git a/bindings/xml/expat_xmlparser.c b/bindings/xml/expat_xmlparser.c
index e5bc2e6..a63ccf1 100644
--- a/bindings/xml/expat_xmlparser.c
+++ b/bindings/xml/expat_xmlparser.c
@@ -319,6 +319,19 @@ expat_xmlparser_external_entity_ref_handler(XML_Parser parser,
if (system_id == NULL)
return XML_STATUS_OK;
+ /* If the ID is a network URI, return (see bug 2313 and below) */
+ if ((strncmp(system_id, "http://", 7) == 0) ||
+ (strncmp(system_id, "https://", 8) == 0)) {
+ return XML_STATUS_OK;
+ }
+
+ /*\todo This needs fixing. Our system_id, if not
+ * absolute, needs to be made absolute relative to
+ * base before being opened. It should also be
+ * passed back to the client to be opened, as network
+ * addresses need special handling and local files
+ * should also have the file:// scheme, so fopen is
+ * not necessarily going to work. */
fh = fopen(system_id, "r");
if (fh == NULL)
-----------------------------------------------------------------------
Summary of changes:
bindings/xml/expat_xmlparser.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/bindings/xml/expat_xmlparser.c b/bindings/xml/expat_xmlparser.c
index e5bc2e6..a63ccf1 100644
--- a/bindings/xml/expat_xmlparser.c
+++ b/bindings/xml/expat_xmlparser.c
@@ -319,6 +319,19 @@ expat_xmlparser_external_entity_ref_handler(XML_Parser parser,
if (system_id == NULL)
return XML_STATUS_OK;
+ /* If the ID is a network URI, return (see bug 2313 and below) */
+ if ((strncmp(system_id, "http://", 7) == 0) ||
+ (strncmp(system_id, "https://", 8) == 0)) {
+ return XML_STATUS_OK;
+ }
+
+ /*\todo This needs fixing. Our system_id, if not
+ * absolute, needs to be made absolute relative to
+ * base before being opened. It should also be
+ * passed back to the client to be opened, as network
+ * addresses need special handling and local files
+ * should also have the file:// scheme, so fopen is
+ * not necessarily going to work. */
fh = fopen(system_id, "r");
if (fh == NULL)
--
Document Object Model library
6 years, 4 months
netsurf: branch master updated. release/3.6-28-gd436992
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/d436992eb2a28e2e056e9...
...commit http://git.netsurf-browser.org/netsurf.git/commit/d436992eb2a28e2e056e96e...
...tree http://git.netsurf-browser.org/netsurf.git/tree/d436992eb2a28e2e056e96e42...
The branch, master has been updated
via d436992eb2a28e2e056e96e42072b13d89b44a0b (commit)
via 5ce3b934571906c012567d898d83c652fad30567 (commit)
via 17128fd0ad119c801a17e06da1fd8b351fb17f21 (commit)
from b3042f6c1fcb708d8663f4ab51865fe6a1f8bec3 (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=d436992eb2a28e2e056...
commit d436992eb2a28e2e056e96e42072b13d89b44a0b
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Reduce slab size to 2K as very few allocations are above that.
diff --git a/frontends/amiga/memory.c b/frontends/amiga/memory.c
index cf42c1e..d86f73d 100755
--- a/frontends/amiga/memory.c
+++ b/frontends/amiga/memory.c
@@ -21,7 +21,7 @@
#include "amiga/memory.h"
#include "utils/log.h"
-ULONG __slab_max_size = 8192; /* Enable clib2's slab allocator */
+ULONG __slab_max_size = 2048; /* Enable clib2's slab allocator */
/* Special clear (ie. non-zero) */
void *ami_memory_clear_alloc(size_t size, UBYTE value)
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=5ce3b934571906c0125...
commit 5ce3b934571906c012567d898d83c652fad30567
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Get clib2 slab usage
Calling ARexx function "SLABSTATS" will dump the current stats to the ns log
diff --git a/frontends/amiga/arexx.c b/frontends/amiga/arexx.c
index cdb12c2..18dae24 100644
--- a/frontends/amiga/arexx.c
+++ b/frontends/amiga/arexx.c
@@ -45,6 +45,10 @@
#include "amiga/misc.h"
#include "amiga/theme.h"
+#ifndef __amigaos4__
+#include "amiga/memory.h"
+#endif
+
extern const char * const verarexx;
extern const char * const wt_revid;
@@ -65,7 +69,8 @@ enum
RX_WINDOWS,
RX_ACTIVE,
RX_CLOSE,
- RX_HOTLIST
+ RX_HOTLIST,
+ RX_SLABSTATS
};
static Object *arexx_obj = NULL;
@@ -93,6 +98,7 @@ RXHOOKF(rx_windows);
RXHOOKF(rx_active);
RXHOOKF(rx_close);
RXHOOKF(rx_hotlist);
+RXHOOKF(rx_slabstats);
STATIC struct ARexxCmd Commands[] =
{
@@ -112,6 +118,7 @@ STATIC struct ARexxCmd Commands[] =
{"ACTIVE", RX_ACTIVE, rx_active, "T=TAB/S", 0, NULL, 0, 0, NULL },
{"CLOSE", RX_CLOSE, rx_close, "W=WINDOW/K/N,T=TAB/K/N", 0, NULL, 0, 0, NULL },
{"HOTLIST", RX_HOTLIST, rx_hotlist, "A=ACTION/A", 0, NULL, 0, 0, NULL },
+ {"SLABSTATS", RX_SLABSTATS, rx_slabstats, NULL, 0, NULL, 0, 0, NULL },
{ NULL, 0, NULL, NULL, 0, NULL, 0, 0, NULL }
};
@@ -664,3 +671,10 @@ RXHOOKF(rx_hotlist)
}
}
+RXHOOKF(rx_slabstats)
+{
+#ifndef __amigaos4__
+ ami_memory_slab_dump();
+#endif
+}
+
diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c
index 27ffee4..c6e23b2 100644
--- a/frontends/amiga/bitmap.c
+++ b/frontends/amiga/bitmap.c
@@ -108,9 +108,9 @@ void *amiga_bitmap_create(int width, int height, unsigned int state)
{
struct bitmap *bitmap;
- if(pool_bitmap == NULL) pool_bitmap = ami_misc_itempool_create(sizeof(struct bitmap));
+ if(pool_bitmap == NULL) pool_bitmap = ami_memory_itempool_create(sizeof(struct bitmap));
- bitmap = ami_misc_itempool_alloc(pool_bitmap, sizeof(struct bitmap));
+ bitmap = ami_memory_itempool_alloc(pool_bitmap, sizeof(struct bitmap));
if(bitmap == NULL) return NULL;
bitmap->pixdata = ami_memory_clear_alloc(width*height*4, 0xff);
@@ -182,7 +182,7 @@ void amiga_bitmap_destroy(void *bitmap)
bm->url = NULL;
bm->title = NULL;
- ami_misc_itempool_free(pool_bitmap, bm, sizeof(struct bitmap));
+ ami_memory_itempool_free(pool_bitmap, bm, sizeof(struct bitmap));
bm = NULL;
}
}
@@ -655,7 +655,7 @@ struct BitMap *ami_bitmap_get_native(struct bitmap *bitmap,
void ami_bitmap_fini(void)
{
- if(pool_bitmap) ami_misc_itempool_delete(pool_bitmap);
+ if(pool_bitmap) ami_memory_itempool_delete(pool_bitmap);
pool_bitmap = NULL;
}
diff --git a/frontends/amiga/memory.c b/frontends/amiga/memory.c
index 901d616..cf42c1e 100755
--- a/frontends/amiga/memory.c
+++ b/frontends/amiga/memory.c
@@ -16,12 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifndef __amigaos4__
#include <stdlib.h>
-#include <proto/exec.h>
-
#include "amiga/memory.h"
+#include "utils/log.h"
-#ifndef __amigaos4__
ULONG __slab_max_size = 8192; /* Enable clib2's slab allocator */
/* Special clear (ie. non-zero) */
@@ -31,5 +30,35 @@ void *ami_memory_clear_alloc(size_t size, UBYTE value)
if (mem) memset(mem, value, size);
return mem;
}
+
+/* clib2 slab allocator stats */
+static int ami_memory_slab_callback(const struct __slab_usage_information * sui)
+{
+ if(sui->sui_slab_index <= 1) {
+ LOG("clib2 slab usage:");
+ LOG(" The size of all slabs, in bytes: %ld", sui->sui_slab_size);
+ LOG(" Number of allocations which are not managed by slabs: %ld",
+ sui->sui_num_single_allocations);
+ LOG(" Total number of bytes allocated for memory not managed by slabs: %ld",
+ sui->sui_total_single_allocation_size);
+ LOG(" Number of slabs currently in play: %ld", sui->sui_num_slabs);
+ LOG(" Number of currently unused slabs: %ld", sui->sui_num_empty_slabs);
+ LOG(" Number of slabs in use which are completely filled with data: %ld",
+ sui->sui_num_full_slabs);
+ LOG(" Total number of bytes allocated for all slabs: %ld",
+ sui->sui_total_slab_allocation_size);
+ }
+ LOG("Slab %d", sui->sui_slab_index);
+ LOG(" Memory chunk size managed by this slab: %ld", sui->sui_chunk_size);
+ LOG(" Number of memory chunks that fit in this slab: %ld", sui->sui_num_chunks);
+ LOG(" Number of memory chunks used in this slab: %ld", sui->sui_num_chunks_used);
+
+ return 0;
+}
+
+void ami_memory_slab_dump(void)
+{
+ __get_slab_usage(ami_memory_slab_callback);
+}
#endif
diff --git a/frontends/amiga/memory.h b/frontends/amiga/memory.h
index a3b6b5e..3d92350 100644
--- a/frontends/amiga/memory.h
+++ b/frontends/amiga/memory.h
@@ -57,5 +57,10 @@ void *ami_memory_clear_alloc(size_t size, UBYTE value);
#define ami_memory_itempool_free(p,i,s) FreePooled(p,i,s)
#endif
+/* clib2 slab allocator stats */
+#ifndef __amigaos4__
+void ami_memory_slab_dump(void);
+#endif
+
#endif //AMIGA_MEMORY_H
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=17128fd0ad119c801a1...
commit 17128fd0ad119c801a17e06da1fd8b351fb17f21
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Move ItemPool compatiblity into the header and rename
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index ecc36fa..e5b5c59 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -3829,7 +3829,7 @@ gui_window_create(struct browser_window *bw,
NewList(&g->dllist);
g->deferred_rects = NewObjList();
- g->deferred_rects_pool = ami_misc_itempool_create(sizeof(struct rect));
+ g->deferred_rects_pool = ami_memory_itempool_create(sizeof(struct rect));
g->bw = bw;
g->scale = browser_window_get_scale(bw);
@@ -4492,7 +4492,7 @@ static void gui_window_destroy(struct gui_window *g)
ami_free_download_list(&g->dllist);
FreeObjList(g->deferred_rects);
- ami_misc_itempool_delete(g->deferred_rects_pool);
+ ami_memory_itempool_delete(g->deferred_rects_pool);
gui_window_stop_throbber(g);
cur_gw = NULL;
@@ -4705,7 +4705,7 @@ static void ami_gui_window_update_box_deferred(struct gui_window *g, bool draw)
rect->x0, rect->y0, rect->x1, rect->y1);
}
nnode=(struct nsObject *)GetSucc((struct Node *)node);
- ami_misc_itempool_free(g->deferred_rects_pool, node->objstruct, sizeof(struct rect));
+ ami_memory_itempool_free(g->deferred_rects_pool, node->objstruct, sizeof(struct rect));
DelObjectNoFree(node);
} while((node = nnode));
@@ -4739,7 +4739,7 @@ static bool ami_gui_window_update_box_deferred_check(struct MinList *deferred_re
(new_rect->x1 >= rect->x1) &&
(new_rect->y1 >= rect->y1)) {
LOG("Removing queued redraw that is a subset of new box redraw");
- ami_misc_itempool_free(mempool, node->objstruct, sizeof(struct rect));
+ ami_memory_itempool_free(mempool, node->objstruct, sizeof(struct rect));
DelObjectNoFree(node);
/* Don't return - we might find more */
}
@@ -4756,7 +4756,7 @@ static void gui_window_update_box(struct gui_window *g, const struct rect *restr
if(ami_gui_window_update_box_deferred_check(g->deferred_rects, rect,
g->deferred_rects_pool)) {
- deferred_rect = ami_misc_itempool_alloc(g->deferred_rects_pool, sizeof(struct rect));
+ deferred_rect = ami_memory_itempool_alloc(g->deferred_rects_pool, sizeof(struct rect));
CopyMem(rect, deferred_rect, sizeof(struct rect));
nsobj = AddObject(g->deferred_rects, AMINS_RECT);
nsobj->objstruct = deferred_rect;
diff --git a/frontends/amiga/memory.c b/frontends/amiga/memory.c
index 7a34f7a..901d616 100755
--- a/frontends/amiga/memory.c
+++ b/frontends/amiga/memory.c
@@ -23,68 +23,13 @@
#ifndef __amigaos4__
ULONG __slab_max_size = 8192; /* Enable clib2's slab allocator */
-#endif
-/* Special clear (ie. non-zero), which is different on OS3 and 4 */
+/* Special clear (ie. non-zero) */
void *ami_memory_clear_alloc(size_t size, UBYTE value)
{
-#ifdef __amigaos4__
- return AllocVecTags(size, AVT_ClearWithValue, value, TAG_DONE);
-#else
void *mem = malloc(size);
if (mem) memset(mem, value, size);
return mem;
-#endif
}
-
-/* Free special clear (ie. non-zero) area, which is different on OS3 and 4 */
-void ami_memory_clear_free(void *p)
-{
-#ifdef __amigaos4__
- FreeVec(p);
-#else
- free(p);
#endif
-}
-
-APTR ami_misc_itempool_create(int size)
-{
-#ifdef __amigaos4__
- return AllocSysObjectTags(ASOT_ITEMPOOL,
- ASOITEM_MFlags, MEMF_PRIVATE,
- ASOITEM_ItemSize, size,
- ASOITEM_GCPolicy, ITEMGC_AFTERCOUNT,
- ASOITEM_GCParameter, 100,
- TAG_DONE);
-#else
- return CreatePool(MEMF_ANY, 20 * size, size);
-#endif
-}
-
-void ami_misc_itempool_delete(APTR pool)
-{
-#ifdef __amigaos4__
- FreeSysObject(ASOT_ITEMPOOL, pool);
-#else
- DeletePool(pool);
-#endif
-}
-
-APTR ami_misc_itempool_alloc(APTR pool, int size)
-{
-#ifdef __amigaos4__
- return ItemPoolAlloc(pool);
-#else
- return AllocPooled(pool, size);
-#endif
-}
-
-void ami_misc_itempool_free(APTR restrict pool, APTR restrict item, int size)
-{
-#ifdef __amigaos4__
- ItemPoolFree(pool, item);
-#else
- FreePooled(pool, item, size);
-#endif
-}
diff --git a/frontends/amiga/memory.h b/frontends/amiga/memory.h
index 63452f6..a3b6b5e 100644
--- a/frontends/amiga/memory.h
+++ b/frontends/amiga/memory.h
@@ -31,13 +31,31 @@
#endif
/* Alloc/free a block cleared to non-zero */
+#ifdef __amigaos4__
+#define ami_memory_clear_alloc(s,v) AllocVecTags(s, AVT_ClearWithValue, v, TAG_DONE)
+#define ami_memory_clear_free(p) FreeVec(p)
+#else
void *ami_memory_clear_alloc(size_t size, UBYTE value);
-void ami_memory_clear_free(void *p);
+#define ami_memory_clear_free(p) free(p)
+#endif
/* Itempool cross-compatibility */
-APTR ami_misc_itempool_create(int size);
-void ami_misc_itempool_delete(APTR pool);
-APTR ami_misc_itempool_alloc(APTR pool, int size);
-void ami_misc_itempool_free(APTR pool, APTR item, int size);
+#ifdef __amigaos4__
+#define ami_memory_itempool_create(s) AllocSysObjectTags(ASOT_ITEMPOOL, \
+ ASOITEM_MFlags, MEMF_PRIVATE, \
+ ASOITEM_ItemSize, s, \
+ ASOITEM_GCPolicy, ITEMGC_AFTERCOUNT, \
+ ASOITEM_GCParameter, 100, \
+ TAG_DONE)
+#define ami_memory_itempool_delete(p) FreeSysObject(ASOT_ITEMPOOL, p)
+#define ami_memory_itempool_alloc(p,s) ItemPoolAlloc(p)
+#define ami_memory_itempool_free(p,i,s) ItemPoolFree(p,i)
+#else
+#define ami_memory_itempool_create(s) CreatePool(MEMF_ANY, 20 * s, s)
+#define ami_memory_itempool_delete(p) DeletePool(p)
+#define ami_memory_itempool_alloc(p,s) AllocPooled(p, s)
+#define ami_memory_itempool_free(p,i,s) FreePooled(p,i,s)
#endif
+#endif //AMIGA_MEMORY_H
+
diff --git a/frontends/amiga/object.c b/frontends/amiga/object.c
index c729e4a..2ebca75 100755
--- a/frontends/amiga/object.c
+++ b/frontends/amiga/object.c
@@ -41,7 +41,7 @@ static APTR pool_nsobj = NULL;
bool ami_object_init(void)
{
- pool_nsobj = ami_misc_itempool_create(sizeof(struct nsObject));
+ pool_nsobj = ami_memory_itempool_create(sizeof(struct nsObject));
if(pool_nsobj == NULL) return false;
else return true;
@@ -49,7 +49,7 @@ bool ami_object_init(void)
void ami_object_fini(void)
{
- ami_misc_itempool_delete(pool_nsobj);
+ ami_memory_itempool_delete(pool_nsobj);
}
/* Slightly abstract MinList initialisation */
@@ -78,7 +78,7 @@ struct nsObject *AddObject(struct MinList *objlist, ULONG otype)
{
struct nsObject *dtzo;
- dtzo = (struct nsObject *)ami_misc_itempool_alloc(pool_nsobj, sizeof(struct nsObject));
+ dtzo = (struct nsObject *)ami_memory_itempool_alloc(pool_nsobj, sizeof(struct nsObject));
if(dtzo == NULL) return NULL;
memset(dtzo, 0, sizeof(struct nsObject));
@@ -100,7 +100,7 @@ static void DelObjectInternal(struct nsObject *dtzo, BOOL free_obj)
if(dtzo->callback != NULL) dtzo->callback(dtzo->objstruct);
if(dtzo->objstruct && free_obj) free(dtzo->objstruct);
if(dtzo->dtz_Node.ln_Name) free(dtzo->dtz_Node.ln_Name);
- ami_misc_itempool_free(pool_nsobj, dtzo, sizeof(struct nsObject));
+ ami_memory_itempool_free(pool_nsobj, dtzo, sizeof(struct nsObject));
dtzo = NULL;
}
diff --git a/frontends/amiga/plotters.c b/frontends/amiga/plotters.c
index f9fa62a..6bae634 100644
--- a/frontends/amiga/plotters.c
+++ b/frontends/amiga/plotters.c
@@ -193,7 +193,7 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height, bool for
InitTmpRas(gg->rp->TmpRas, gg->tmprasbuf, width*height);
if((gg->palette_mapped == true) && (pool_pens == NULL)) {
- pool_pens = ami_misc_itempool_create(sizeof(struct ami_plot_pen));
+ pool_pens = ami_memory_itempool_create(sizeof(struct ami_plot_pen));
}
gg->apen = 0x00000000;
@@ -210,7 +210,7 @@ void ami_free_layers(struct gui_globals *gg)
init_layers_count--;
if((init_layers_count == 0) && (pool_pens != NULL)) {
- ami_misc_itempool_delete(pool_pens);
+ ami_memory_itempool_delete(pool_pens);
pool_pens = NULL;
}
@@ -256,7 +256,7 @@ static ULONG ami_plot_obtain_pen(struct MinList *shared_pens, ULONG colr)
if(pen == -1) LOG("WARNING: Cannot allocate pen for ABGR:%lx", colr);
if((shared_pens != NULL) && (pool_pens != NULL)) {
- if((node = (struct ami_plot_pen *)ami_misc_itempool_alloc(pool_pens, sizeof(struct ami_plot_pen)))) {
+ if((node = (struct ami_plot_pen *)ami_memory_itempool_alloc(pool_pens, sizeof(struct ami_plot_pen)))) {
node->pen = pen;
AddTail((struct List *)shared_pens, (struct Node *)node);
}
@@ -280,7 +280,7 @@ void ami_plot_release_pens(struct MinList *shared_pens)
nnode = (struct ami_plot_pen *)GetSucc((struct Node *)node);
ReleasePen(scrn->ViewPort.ColorMap, node->pen);
Remove((struct Node *)node);
- ami_misc_itempool_free(pool_pens, node, sizeof(struct ami_plot_pen));
+ ami_memory_itempool_free(pool_pens, node, sizeof(struct ami_plot_pen));
} while((node = nnode));
glob->apen = 0x00000000;
-----------------------------------------------------------------------
Summary of changes:
frontends/amiga/arexx.c | 16 ++++++++-
frontends/amiga/bitmap.c | 8 ++---
frontends/amiga/gui.c | 10 +++---
frontends/amiga/memory.c | 80 +++++++++++++++-----------------------------
frontends/amiga/memory.h | 33 +++++++++++++++---
frontends/amiga/object.c | 8 ++---
frontends/amiga/plotters.c | 8 ++---
7 files changed, 87 insertions(+), 76 deletions(-)
diff --git a/frontends/amiga/arexx.c b/frontends/amiga/arexx.c
index cdb12c2..18dae24 100644
--- a/frontends/amiga/arexx.c
+++ b/frontends/amiga/arexx.c
@@ -45,6 +45,10 @@
#include "amiga/misc.h"
#include "amiga/theme.h"
+#ifndef __amigaos4__
+#include "amiga/memory.h"
+#endif
+
extern const char * const verarexx;
extern const char * const wt_revid;
@@ -65,7 +69,8 @@ enum
RX_WINDOWS,
RX_ACTIVE,
RX_CLOSE,
- RX_HOTLIST
+ RX_HOTLIST,
+ RX_SLABSTATS
};
static Object *arexx_obj = NULL;
@@ -93,6 +98,7 @@ RXHOOKF(rx_windows);
RXHOOKF(rx_active);
RXHOOKF(rx_close);
RXHOOKF(rx_hotlist);
+RXHOOKF(rx_slabstats);
STATIC struct ARexxCmd Commands[] =
{
@@ -112,6 +118,7 @@ STATIC struct ARexxCmd Commands[] =
{"ACTIVE", RX_ACTIVE, rx_active, "T=TAB/S", 0, NULL, 0, 0, NULL },
{"CLOSE", RX_CLOSE, rx_close, "W=WINDOW/K/N,T=TAB/K/N", 0, NULL, 0, 0, NULL },
{"HOTLIST", RX_HOTLIST, rx_hotlist, "A=ACTION/A", 0, NULL, 0, 0, NULL },
+ {"SLABSTATS", RX_SLABSTATS, rx_slabstats, NULL, 0, NULL, 0, 0, NULL },
{ NULL, 0, NULL, NULL, 0, NULL, 0, 0, NULL }
};
@@ -664,3 +671,10 @@ RXHOOKF(rx_hotlist)
}
}
+RXHOOKF(rx_slabstats)
+{
+#ifndef __amigaos4__
+ ami_memory_slab_dump();
+#endif
+}
+
diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c
index 27ffee4..c6e23b2 100644
--- a/frontends/amiga/bitmap.c
+++ b/frontends/amiga/bitmap.c
@@ -108,9 +108,9 @@ void *amiga_bitmap_create(int width, int height, unsigned int state)
{
struct bitmap *bitmap;
- if(pool_bitmap == NULL) pool_bitmap = ami_misc_itempool_create(sizeof(struct bitmap));
+ if(pool_bitmap == NULL) pool_bitmap = ami_memory_itempool_create(sizeof(struct bitmap));
- bitmap = ami_misc_itempool_alloc(pool_bitmap, sizeof(struct bitmap));
+ bitmap = ami_memory_itempool_alloc(pool_bitmap, sizeof(struct bitmap));
if(bitmap == NULL) return NULL;
bitmap->pixdata = ami_memory_clear_alloc(width*height*4, 0xff);
@@ -182,7 +182,7 @@ void amiga_bitmap_destroy(void *bitmap)
bm->url = NULL;
bm->title = NULL;
- ami_misc_itempool_free(pool_bitmap, bm, sizeof(struct bitmap));
+ ami_memory_itempool_free(pool_bitmap, bm, sizeof(struct bitmap));
bm = NULL;
}
}
@@ -655,7 +655,7 @@ struct BitMap *ami_bitmap_get_native(struct bitmap *bitmap,
void ami_bitmap_fini(void)
{
- if(pool_bitmap) ami_misc_itempool_delete(pool_bitmap);
+ if(pool_bitmap) ami_memory_itempool_delete(pool_bitmap);
pool_bitmap = NULL;
}
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index ecc36fa..e5b5c59 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -3829,7 +3829,7 @@ gui_window_create(struct browser_window *bw,
NewList(&g->dllist);
g->deferred_rects = NewObjList();
- g->deferred_rects_pool = ami_misc_itempool_create(sizeof(struct rect));
+ g->deferred_rects_pool = ami_memory_itempool_create(sizeof(struct rect));
g->bw = bw;
g->scale = browser_window_get_scale(bw);
@@ -4492,7 +4492,7 @@ static void gui_window_destroy(struct gui_window *g)
ami_free_download_list(&g->dllist);
FreeObjList(g->deferred_rects);
- ami_misc_itempool_delete(g->deferred_rects_pool);
+ ami_memory_itempool_delete(g->deferred_rects_pool);
gui_window_stop_throbber(g);
cur_gw = NULL;
@@ -4705,7 +4705,7 @@ static void ami_gui_window_update_box_deferred(struct gui_window *g, bool draw)
rect->x0, rect->y0, rect->x1, rect->y1);
}
nnode=(struct nsObject *)GetSucc((struct Node *)node);
- ami_misc_itempool_free(g->deferred_rects_pool, node->objstruct, sizeof(struct rect));
+ ami_memory_itempool_free(g->deferred_rects_pool, node->objstruct, sizeof(struct rect));
DelObjectNoFree(node);
} while((node = nnode));
@@ -4739,7 +4739,7 @@ static bool ami_gui_window_update_box_deferred_check(struct MinList *deferred_re
(new_rect->x1 >= rect->x1) &&
(new_rect->y1 >= rect->y1)) {
LOG("Removing queued redraw that is a subset of new box redraw");
- ami_misc_itempool_free(mempool, node->objstruct, sizeof(struct rect));
+ ami_memory_itempool_free(mempool, node->objstruct, sizeof(struct rect));
DelObjectNoFree(node);
/* Don't return - we might find more */
}
@@ -4756,7 +4756,7 @@ static void gui_window_update_box(struct gui_window *g, const struct rect *restr
if(ami_gui_window_update_box_deferred_check(g->deferred_rects, rect,
g->deferred_rects_pool)) {
- deferred_rect = ami_misc_itempool_alloc(g->deferred_rects_pool, sizeof(struct rect));
+ deferred_rect = ami_memory_itempool_alloc(g->deferred_rects_pool, sizeof(struct rect));
CopyMem(rect, deferred_rect, sizeof(struct rect));
nsobj = AddObject(g->deferred_rects, AMINS_RECT);
nsobj->objstruct = deferred_rect;
diff --git a/frontends/amiga/memory.c b/frontends/amiga/memory.c
index 7a34f7a..d86f73d 100755
--- a/frontends/amiga/memory.c
+++ b/frontends/amiga/memory.c
@@ -16,75 +16,49 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifndef __amigaos4__
#include <stdlib.h>
-#include <proto/exec.h>
-
#include "amiga/memory.h"
+#include "utils/log.h"
-#ifndef __amigaos4__
-ULONG __slab_max_size = 8192; /* Enable clib2's slab allocator */
-#endif
+ULONG __slab_max_size = 2048; /* Enable clib2's slab allocator */
-/* Special clear (ie. non-zero), which is different on OS3 and 4 */
+/* Special clear (ie. non-zero) */
void *ami_memory_clear_alloc(size_t size, UBYTE value)
{
-#ifdef __amigaos4__
- return AllocVecTags(size, AVT_ClearWithValue, value, TAG_DONE);
-#else
void *mem = malloc(size);
if (mem) memset(mem, value, size);
return mem;
-#endif
}
-/* Free special clear (ie. non-zero) area, which is different on OS3 and 4 */
-void ami_memory_clear_free(void *p)
+/* clib2 slab allocator stats */
+static int ami_memory_slab_callback(const struct __slab_usage_information * sui)
{
-#ifdef __amigaos4__
- FreeVec(p);
-#else
- free(p);
-#endif
-}
+ if(sui->sui_slab_index <= 1) {
+ LOG("clib2 slab usage:");
+ LOG(" The size of all slabs, in bytes: %ld", sui->sui_slab_size);
+ LOG(" Number of allocations which are not managed by slabs: %ld",
+ sui->sui_num_single_allocations);
+ LOG(" Total number of bytes allocated for memory not managed by slabs: %ld",
+ sui->sui_total_single_allocation_size);
+ LOG(" Number of slabs currently in play: %ld", sui->sui_num_slabs);
+ LOG(" Number of currently unused slabs: %ld", sui->sui_num_empty_slabs);
+ LOG(" Number of slabs in use which are completely filled with data: %ld",
+ sui->sui_num_full_slabs);
+ LOG(" Total number of bytes allocated for all slabs: %ld",
+ sui->sui_total_slab_allocation_size);
+ }
+ LOG("Slab %d", sui->sui_slab_index);
+ LOG(" Memory chunk size managed by this slab: %ld", sui->sui_chunk_size);
+ LOG(" Number of memory chunks that fit in this slab: %ld", sui->sui_num_chunks);
+ LOG(" Number of memory chunks used in this slab: %ld", sui->sui_num_chunks_used);
-APTR ami_misc_itempool_create(int size)
-{
-#ifdef __amigaos4__
- return AllocSysObjectTags(ASOT_ITEMPOOL,
- ASOITEM_MFlags, MEMF_PRIVATE,
- ASOITEM_ItemSize, size,
- ASOITEM_GCPolicy, ITEMGC_AFTERCOUNT,
- ASOITEM_GCParameter, 100,
- TAG_DONE);
-#else
- return CreatePool(MEMF_ANY, 20 * size, size);
-#endif
+ return 0;
}
-void ami_misc_itempool_delete(APTR pool)
+void ami_memory_slab_dump(void)
{
-#ifdef __amigaos4__
- FreeSysObject(ASOT_ITEMPOOL, pool);
-#else
- DeletePool(pool);
-#endif
-}
-
-APTR ami_misc_itempool_alloc(APTR pool, int size)
-{
-#ifdef __amigaos4__
- return ItemPoolAlloc(pool);
-#else
- return AllocPooled(pool, size);
-#endif
+ __get_slab_usage(ami_memory_slab_callback);
}
-
-void ami_misc_itempool_free(APTR restrict pool, APTR restrict item, int size)
-{
-#ifdef __amigaos4__
- ItemPoolFree(pool, item);
-#else
- FreePooled(pool, item, size);
#endif
-}
diff --git a/frontends/amiga/memory.h b/frontends/amiga/memory.h
index 63452f6..3d92350 100644
--- a/frontends/amiga/memory.h
+++ b/frontends/amiga/memory.h
@@ -31,13 +31,36 @@
#endif
/* Alloc/free a block cleared to non-zero */
+#ifdef __amigaos4__
+#define ami_memory_clear_alloc(s,v) AllocVecTags(s, AVT_ClearWithValue, v, TAG_DONE)
+#define ami_memory_clear_free(p) FreeVec(p)
+#else
void *ami_memory_clear_alloc(size_t size, UBYTE value);
-void ami_memory_clear_free(void *p);
+#define ami_memory_clear_free(p) free(p)
+#endif
/* Itempool cross-compatibility */
-APTR ami_misc_itempool_create(int size);
-void ami_misc_itempool_delete(APTR pool);
-APTR ami_misc_itempool_alloc(APTR pool, int size);
-void ami_misc_itempool_free(APTR pool, APTR item, int size);
+#ifdef __amigaos4__
+#define ami_memory_itempool_create(s) AllocSysObjectTags(ASOT_ITEMPOOL, \
+ ASOITEM_MFlags, MEMF_PRIVATE, \
+ ASOITEM_ItemSize, s, \
+ ASOITEM_GCPolicy, ITEMGC_AFTERCOUNT, \
+ ASOITEM_GCParameter, 100, \
+ TAG_DONE)
+#define ami_memory_itempool_delete(p) FreeSysObject(ASOT_ITEMPOOL, p)
+#define ami_memory_itempool_alloc(p,s) ItemPoolAlloc(p)
+#define ami_memory_itempool_free(p,i,s) ItemPoolFree(p,i)
+#else
+#define ami_memory_itempool_create(s) CreatePool(MEMF_ANY, 20 * s, s)
+#define ami_memory_itempool_delete(p) DeletePool(p)
+#define ami_memory_itempool_alloc(p,s) AllocPooled(p, s)
+#define ami_memory_itempool_free(p,i,s) FreePooled(p,i,s)
+#endif
+
+/* clib2 slab allocator stats */
+#ifndef __amigaos4__
+void ami_memory_slab_dump(void);
#endif
+#endif //AMIGA_MEMORY_H
+
diff --git a/frontends/amiga/object.c b/frontends/amiga/object.c
index c729e4a..2ebca75 100755
--- a/frontends/amiga/object.c
+++ b/frontends/amiga/object.c
@@ -41,7 +41,7 @@ static APTR pool_nsobj = NULL;
bool ami_object_init(void)
{
- pool_nsobj = ami_misc_itempool_create(sizeof(struct nsObject));
+ pool_nsobj = ami_memory_itempool_create(sizeof(struct nsObject));
if(pool_nsobj == NULL) return false;
else return true;
@@ -49,7 +49,7 @@ bool ami_object_init(void)
void ami_object_fini(void)
{
- ami_misc_itempool_delete(pool_nsobj);
+ ami_memory_itempool_delete(pool_nsobj);
}
/* Slightly abstract MinList initialisation */
@@ -78,7 +78,7 @@ struct nsObject *AddObject(struct MinList *objlist, ULONG otype)
{
struct nsObject *dtzo;
- dtzo = (struct nsObject *)ami_misc_itempool_alloc(pool_nsobj, sizeof(struct nsObject));
+ dtzo = (struct nsObject *)ami_memory_itempool_alloc(pool_nsobj, sizeof(struct nsObject));
if(dtzo == NULL) return NULL;
memset(dtzo, 0, sizeof(struct nsObject));
@@ -100,7 +100,7 @@ static void DelObjectInternal(struct nsObject *dtzo, BOOL free_obj)
if(dtzo->callback != NULL) dtzo->callback(dtzo->objstruct);
if(dtzo->objstruct && free_obj) free(dtzo->objstruct);
if(dtzo->dtz_Node.ln_Name) free(dtzo->dtz_Node.ln_Name);
- ami_misc_itempool_free(pool_nsobj, dtzo, sizeof(struct nsObject));
+ ami_memory_itempool_free(pool_nsobj, dtzo, sizeof(struct nsObject));
dtzo = NULL;
}
diff --git a/frontends/amiga/plotters.c b/frontends/amiga/plotters.c
index f9fa62a..6bae634 100644
--- a/frontends/amiga/plotters.c
+++ b/frontends/amiga/plotters.c
@@ -193,7 +193,7 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height, bool for
InitTmpRas(gg->rp->TmpRas, gg->tmprasbuf, width*height);
if((gg->palette_mapped == true) && (pool_pens == NULL)) {
- pool_pens = ami_misc_itempool_create(sizeof(struct ami_plot_pen));
+ pool_pens = ami_memory_itempool_create(sizeof(struct ami_plot_pen));
}
gg->apen = 0x00000000;
@@ -210,7 +210,7 @@ void ami_free_layers(struct gui_globals *gg)
init_layers_count--;
if((init_layers_count == 0) && (pool_pens != NULL)) {
- ami_misc_itempool_delete(pool_pens);
+ ami_memory_itempool_delete(pool_pens);
pool_pens = NULL;
}
@@ -256,7 +256,7 @@ static ULONG ami_plot_obtain_pen(struct MinList *shared_pens, ULONG colr)
if(pen == -1) LOG("WARNING: Cannot allocate pen for ABGR:%lx", colr);
if((shared_pens != NULL) && (pool_pens != NULL)) {
- if((node = (struct ami_plot_pen *)ami_misc_itempool_alloc(pool_pens, sizeof(struct ami_plot_pen)))) {
+ if((node = (struct ami_plot_pen *)ami_memory_itempool_alloc(pool_pens, sizeof(struct ami_plot_pen)))) {
node->pen = pen;
AddTail((struct List *)shared_pens, (struct Node *)node);
}
@@ -280,7 +280,7 @@ void ami_plot_release_pens(struct MinList *shared_pens)
nnode = (struct ami_plot_pen *)GetSucc((struct Node *)node);
ReleasePen(scrn->ViewPort.ColorMap, node->pen);
Remove((struct Node *)node);
- ami_misc_itempool_free(pool_pens, node, sizeof(struct ami_plot_pen));
+ ami_memory_itempool_free(pool_pens, node, sizeof(struct ami_plot_pen));
} while((node = nnode));
glob->apen = 0x00000000;
--
NetSurf Browser
6 years, 4 months