netsurf: branch master updated. release/3.3-565-gadccaad
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/adccaadb57224f7a1b149...
...commit http://git.netsurf-browser.org/netsurf.git/commit/adccaadb57224f7a1b149e1...
...tree http://git.netsurf-browser.org/netsurf.git/tree/adccaadb57224f7a1b149e128...
The branch, master has been updated
via adccaadb57224f7a1b149e12862f845f3c729efa (commit)
via 4f7e2563c11626a10c5470773a8b588f8339c495 (commit)
via 469cd6dc67075fcb1bacc69cbf1354cd67aefddd (commit)
via 37e5bff1880c6c532fad5c5b316deda292fafd17 (commit)
from bcdbb9e365201cc06a5a9635c51d57993a6286fe (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=adccaadb57224f7a1b1...
commit adccaadb57224f7a1b149e12862f845f3c729efa
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
More consistent naming for font cache elements
diff --git a/amiga/font.c b/amiga/font.c
index 79f887f..3a141ac 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -348,9 +348,9 @@ static inline bool amiga_nsfont_split(const plot_font_style_t *fstyle,
/**
* Search for a font in the list and load from disk if not present
*/
-static struct ami_font_node *ami_font_open(const char *font, bool critical)
+static struct ami_font_cache_node *ami_font_open(const char *font, bool critical)
{
- struct ami_font_node *nodedata = ami_font_cache_locate(font);
+ struct ami_font_cache_node *nodedata = ami_font_cache_locate(font);
if(nodedata) return nodedata;
nodedata = ami_font_cache_alloc_entry(font);
@@ -402,8 +402,8 @@ static struct ami_font_node *ami_font_open(const char *font, bool critical)
static struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle,
const uint16 *codepoint)
{
- struct ami_font_node *node;
- struct ami_font_node *designed_node = NULL;
+ struct ami_font_cache_node *node;
+ struct ami_font_cache_node *designed_node = NULL;
struct OutlineFont *ofont;
char *fontname;
ULONG ysize;
@@ -891,7 +891,7 @@ void ami_close_fonts(void)
ami_font_finiscanner();
}
-void ami_font_close(struct ami_font_node *node)
+void ami_font_close(struct ami_font_cache_node *node)
{
/* Called from FreeObjList if node type is AMINS_FONT */
diff --git a/amiga/font.h b/amiga/font.h
index 375e150..98b0a0c 100755
--- a/amiga/font.h
+++ b/amiga/font.h
@@ -23,14 +23,14 @@
#include <graphics/rastport.h>
#include <graphics/text.h>
-struct ami_font_node;
+struct ami_font_cache_node;
ULONG ami_font_unicode_text(struct RastPort *rp, const char *string,
ULONG length, const plot_font_style_t *fstyle, ULONG x, ULONG y, bool aa);
void ami_font_setdevicedpi(int id);
void ami_init_fonts(void);
void ami_close_fonts(void);
-void ami_font_close(struct ami_font_node *node);
+void ami_font_close(struct ami_font_cache_node *node);
/* Alternate entry points into font_scan */
void ami_font_initscanner(bool force, bool save);
diff --git a/amiga/font_bitmap.c b/amiga/font_bitmap.c
index 65d2193..98dd4c9 100644
--- a/amiga/font_bitmap.c
+++ b/amiga/font_bitmap.c
@@ -37,6 +37,7 @@
#include "desktop/gui_window.h"
#include "amiga/font.h"
+#include "amiga/font_cache.h"
#include "amiga/gui.h"
#include "amiga/utf8.h"
diff --git a/amiga/font_cache.c b/amiga/font_cache.c
index 4b81aab..5814f83 100644
--- a/amiga/font_cache.c
+++ b/amiga/font_cache.c
@@ -34,10 +34,10 @@
#endif
#ifdef __amigaos4__
-static struct SkipList *ami_font_list = NULL;
+static struct SkipList *ami_font_cache_list = NULL;
static struct Hook ami_font_cache_hook;
#else
-static struct MinList *ami_font_list = NULL;
+static struct MinList *ami_font_cache_list = NULL;
#endif
@@ -52,17 +52,17 @@ static LONG ami_font_cache_sort(struct Hook *hook, APTR key1, APTR key2)
#endif
#ifdef __amigaos4__
-static void ami_font_cleanup(struct SkipList *skiplist)
+static void ami_font_cache_cleanup(struct SkipList *skiplist)
{
- struct ami_font_node *node;
- struct ami_font_node *nnode;
+ struct ami_font_cache_node *node;
+ struct ami_font_cache_node *nnode;
struct TimeVal curtime;
- node = (struct ami_font_node *)GetFirstSkipNode(skiplist);
+ node = (struct ami_font_cache_node *)GetFirstSkipNode(skiplist);
if(node == NULL) return;
do {
- nnode = (struct ami_font_node *)GetNextSkipNode(skiplist, (struct SkipNode *)node);
+ nnode = (struct ami_font_cache_node *)GetNextSkipNode(skiplist, (struct SkipNode *)node);
GetSysTime(&curtime);
SubTime(&curtime, &node->lastused);
if(curtime.Seconds > 300)
@@ -74,19 +74,19 @@ static void ami_font_cleanup(struct SkipList *skiplist)
} while((node = nnode));
/* reschedule to run in five minutes */
- ami_schedule(300000, (void *)ami_font_cleanup, ami_font_list);
+ ami_schedule(300000, (void *)ami_font_cache_cleanup, ami_font_cache_list);
}
#else
-static void ami_font_cleanup(struct MinList *ami_font_list)
+static void ami_font_cache_cleanup(struct MinList *ami_font_cache_list)
{
struct nsObject *node;
struct nsObject *nnode;
- struct ami_font_node *fnode;
+ struct ami_font_cache_node *fnode;
struct TimeVal curtime;
- if(IsMinListEmpty(ami_font_list)) return;
+ if(IsMinListEmpty(ami_font_cache_list)) return;
- node = (struct nsObject *)GetHead((struct List *)ami_font_list);
+ node = (struct nsObject *)GetHead((struct List *)ami_font_cache_list);
do
{
@@ -102,17 +102,17 @@ static void ami_font_cleanup(struct MinList *ami_font_list)
} while((node=nnode));
/* reschedule to run in five minutes */
- ami_schedule(300000, (void *)ami_font_cleanup, ami_font_list);
+ ami_schedule(300000, (void *)ami_font_cache_cleanup, ami_font_cache_list);
}
#endif
#ifdef __amigaos4__
-static void ami_font_del_skiplist(struct SkipList *skiplist)
+static void ami_font_cache_del_skiplist(struct SkipList *skiplist)
{
- struct ami_font_node *node;
+ struct ami_font_cache_node *node;
struct SkipNode *nnode;
- node = (struct ami_font_node *)GetFirstSkipNode(skiplist);
+ node = (struct ami_font_cache_node *)GetFirstSkipNode(skiplist);
if(node == NULL) return;
do {
@@ -126,16 +126,16 @@ static void ami_font_del_skiplist(struct SkipList *skiplist)
#endif
-struct ami_font_node *ami_font_cache_locate(const char *font)
+struct ami_font_cache_node *ami_font_cache_locate(const char *font)
{
- struct ami_font_node *nodedata;
+ struct ami_font_cache_node *nodedata;
uint32 hash = 0;
#ifdef __amigaos4__
hash = XXH32(font, strlen(font), 0);
- nodedata = (struct ami_font_node *)FindSkipNode(ami_font_list, (APTR)hash);
+ nodedata = (struct ami_font_cache_node *)FindSkipNode(ami_font_cache_list, (APTR)hash);
#else
- struct nsObject *node = (struct nsObject *)FindIName((struct List *)ami_font_list, font);
+ struct nsObject *node = (struct nsObject *)FindIName((struct List *)ami_font_cache_list, font);
if(node) nodedata = node->objstruct;
#endif
@@ -148,15 +148,15 @@ struct ami_font_node *ami_font_cache_locate(const char *font)
return NULL;
}
-struct ami_font_node *ami_font_cache_alloc_entry(const char *font)
+struct ami_font_cache_node *ami_font_cache_alloc_entry(const char *font)
{
- struct ami_font_node *nodedata;
+ struct ami_font_cache_node *nodedata;
#ifdef __amigaos4__
uint32 hash = XXH32(font, strlen(font), 0);
- nodedata = (struct ami_font_node *)InsertSkipNode(ami_font_list, (APTR)hash, sizeof(struct ami_font_node));
+ nodedata = (struct ami_font_cache_node *)InsertSkipNode(ami_font_cache_list, (APTR)hash, sizeof(struct ami_font_cache_node));
#else
- nodedata = AllocVecTagList(sizeof(struct ami_font_node), NULL);
+ nodedata = AllocVecTagList(sizeof(struct ami_font_cache_node), NULL);
#endif
GetSysTime(&nodedata->lastused);
@@ -164,10 +164,10 @@ struct ami_font_node *ami_font_cache_alloc_entry(const char *font)
return nodedata;
}
-void ami_font_cache_insert(struct ami_font_node *nodedata, const char *font)
+void ami_font_cache_insert(struct ami_font_cache_node *nodedata, const char *font)
{
#ifndef __amigaos4__
- struct nsObject *node = AddObject(ami_font_list, AMINS_FONT);
+ struct nsObject *node = AddObject(ami_font_cache_list, AMINS_FONT);
if(node) {
node->objstruct = nodedata;
node->dtz_Node.ln_Name = strdup(font);
@@ -178,13 +178,13 @@ void ami_font_cache_insert(struct ami_font_node *nodedata, const char *font)
void ami_font_cache_fini(void)
{
LOG("Cleaning up font cache");
- ami_schedule(-1, (void *)ami_font_cleanup, ami_font_list);
+ ami_schedule(-1, (void *)ami_font_cache_cleanup, ami_font_cache_list);
#ifdef __amigaos4__
- ami_font_del_skiplist(ami_font_list);
+ ami_font_cache_del_skiplist(ami_font_cache_list);
#else
- FreeObjList(ami_font_list);
+ FreeObjList(ami_font_cache_list);
#endif
- ami_font_list = NULL;
+ ami_font_cache_list = NULL;
}
void ami_font_cache_init(void)
@@ -192,12 +192,12 @@ void ami_font_cache_init(void)
#ifdef __amigaos4__
ami_font_cache_hook.h_Entry = (HOOKFUNC)ami_font_cache_sort;
ami_font_cache_hook.h_Data = 0;
- ami_font_list = CreateSkipList(&ami_font_cache_hook, 8);
+ ami_font_cache_list = CreateSkipList(&ami_font_cache_hook, 8);
#else
- ami_font_list = NewObjList();
+ ami_font_cache_list = NewObjList();
#endif
/* run first cleanup in ten minutes */
- ami_schedule(600000, (void *)ami_font_cleanup, ami_font_list);
+ ami_schedule(600000, (void *)ami_font_cache_cleanup, ami_font_cache_list);
}
diff --git a/amiga/font_cache.h b/amiga/font_cache.h
index bb462bc..813b67d 100644
--- a/amiga/font_cache.h
+++ b/amiga/font_cache.h
@@ -18,7 +18,7 @@
#ifndef AMIGA_FONT_CACHE_H
#define AMIGA_FONT_CACHE_H
-struct ami_font_node
+struct ami_font_cache_node
{
#ifdef __amigaos4__
struct SkipNode skip_node;
@@ -32,15 +32,18 @@ struct ami_font_node
/* locate an entry in the font cache, NULL if not found */
-struct ami_font_node *ami_font_cache_locate(const char *font);
+struct ami_font_cache_node *ami_font_cache_locate(const char *font);
/* allocate a cache entry */
-struct ami_font_node *ami_font_cache_alloc_entry(const char *font);
+struct ami_font_cache_node *ami_font_cache_alloc_entry(const char *font);
/* insert a cache entry into the list (OS3) */
-void ami_font_cache_insert(struct ami_font_node *nodedata, const char *font);
+void ami_font_cache_insert(struct ami_font_cache_node *nodedata, const char *font);
+/* initialise the cache */
void ami_font_cache_init(void);
+
+/* cache clean-up */
void ami_font_cache_fini(void);
#endif
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=4f7e2563c11626a10c5...
commit 4f7e2563c11626a10c5470773a8b588f8339c495
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Separate font cache code into a new file
diff --git a/amiga/Makefile.target b/amiga/Makefile.target
index f422140..391dd6e 100644
--- a/amiga/Makefile.target
+++ b/amiga/Makefile.target
@@ -76,7 +76,7 @@ S_AMIGA := gui.c tree.c history.c hotlist.c schedule.c file.c \
datatypes.c dt_picture.c dt_anim.c dt_sound.c plugin_hack.c \
stringview/stringview.c stringview/urlhistory.c rtg.c \
agclass/amigaguide_class.c os3support.c font_bitmap.c \
- selectmenu.c hash/xxhash.c
+ selectmenu.c hash/xxhash.c font_cache.c
S_AMIGA := $(addprefix amiga/,$(S_AMIGA))
# This is the final source build list
diff --git a/amiga/font.c b/amiga/font.c
index 0b97842..79f887f 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -26,8 +26,6 @@
#include <proto/diskfont.h>
#include <proto/exec.h>
#include <proto/graphics.h>
-#include <proto/Picasso96API.h>
-#include <proto/timer.h>
#include <proto/utility.h>
#include <diskfont/diskfonttag.h>
@@ -47,14 +45,10 @@
#include "desktop/gui_window.h"
#include "amiga/font.h"
+#include "amiga/font_cache.h"
#include "amiga/font_scan.h"
#include "amiga/gui.h"
#include "amiga/utf8.h"
-#include "amiga/object.h"
-#include "amiga/schedule.h"
-#ifdef __amigaos4__
-#include <amiga/hash/xxhash.h>
-#endif
#define NSA_UNICODE_FONT PLOT_FONT_FAMILY_COUNT
@@ -72,18 +66,6 @@
#define NSA_FONT_EMWIDTH(s) (s / FONT_SIZE_SCALE) * (ami_xdpi / 72.0)
-struct ami_font_node
-{
-#ifdef __amigaos4__
- struct SkipNode skip_node;
-#endif
- struct OutlineFont *font;
- char *bold;
- char *italic;
- char *bolditalic;
- struct TimeVal lastused;
-};
-
const uint16 sc_table[] = {
0x0061, 0x1D00, /* a */
0x0062, 0x0299, /* b */
@@ -151,16 +133,11 @@ const uint16 sc_table[] = {
#endif
0, 0};
-#ifdef __amigaos4__
-struct SkipList *ami_font_list = NULL;
-#else
-struct MinList *ami_font_list = NULL;
-#endif
-struct List ami_diskfontlib_list;
lwc_string *glypharray[0xffff + 1];
ULONG ami_devicedpi;
ULONG ami_xdpi;
-static struct Hook ami_font_cache_hook;
+
+static struct List ami_diskfontlib_list;
static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPort *rp,
uint16 *char1, uint16 *char2, uint32 x, uint32 y, uint32 emwidth, bool aa);
@@ -373,29 +350,10 @@ static inline bool amiga_nsfont_split(const plot_font_style_t *fstyle,
*/
static struct ami_font_node *ami_font_open(const char *font, bool critical)
{
- struct ami_font_node *nodedata = NULL;
- uint32 hash = 0;
-
-#ifdef __amigaos4__
- hash = XXH32(font, strlen(font), 0);
- nodedata = (struct ami_font_node *)FindSkipNode(ami_font_list, (APTR)hash);
-#else
- struct nsObject *node = (struct nsObject *)FindIName((struct List *)ami_font_list, font);
- if(node) nodedata = node->objstruct;
-#endif
-
- if(nodedata) {
- GetSysTime(&nodedata->lastused);
- return nodedata;
- }
+ struct ami_font_node *nodedata = ami_font_cache_locate(font);
+ if(nodedata) return nodedata;
- LOG("Font cache miss: %s (%lx)", font, hash);
-
-#ifdef __amigaos4__
- nodedata = (struct ami_font_node *)InsertSkipNode(ami_font_list, (APTR)hash, sizeof(struct ami_font_node));
-#else
- nodedata = AllocVecTagList(sizeof(struct ami_font_node), NULL);
-#endif
+ nodedata = ami_font_cache_alloc_entry(font);
if(nodedata == NULL) {
warn_user("NoMemory", "");
@@ -430,16 +388,7 @@ static struct ami_font_node *ami_font_open(const char *font, bool critical)
else
LOG("Warning: No designed bold-italic font defined for %s", font);
- GetSysTime(&nodedata->lastused);
-
-#ifndef __amigaos4__
- node = AddObject(ami_font_list, AMINS_FONT);
- if(node) {
- node->objstruct = nodedata;
- node->dtz_Node.ln_Name = strdup(font);
- }
-#endif
-
+ ami_font_cache_insert(nodedata, font);
return nodedata;
}
@@ -924,119 +873,21 @@ void ami_font_savescanner(void)
ami_font_scan_save(nsoption_charp(font_unicode_file), glypharray);
}
-#ifdef __amigaos4__
-static LONG ami_font_cache_sort(struct Hook *hook, APTR key1, APTR key2)
-{
- if(key1 == key2) return 0;
- if(key1 < key2) return -1;
- return 1;
-}
-#endif
-
-#ifdef __amigaos4__
-static void ami_font_cleanup(struct SkipList *skiplist)
-{
- struct ami_font_node *node;
- struct ami_font_node *nnode;
- struct TimeVal curtime;
-
- node = (struct ami_font_node *)GetFirstSkipNode(skiplist);
- if(node == NULL) return;
-
- do {
- nnode = (struct ami_font_node *)GetNextSkipNode(skiplist, (struct SkipNode *)node);
- GetSysTime(&curtime);
- SubTime(&curtime, &node->lastused);
- if(curtime.Seconds > 300)
- {
- LOG("Freeing font %lx not used for %ld seconds", node->skip_node.sn_Key, curtime.Seconds);
- ami_font_close(node);
- RemoveSkipNode(skiplist, node->skip_node.sn_Key);
- }
- } while((node = nnode));
-
- /* reschedule to run in five minutes */
- ami_schedule(300000, (void *)ami_font_cleanup, ami_font_list);
-}
-#else
-static void ami_font_cleanup(struct MinList *ami_font_list)
-{
- struct nsObject *node;
- struct nsObject *nnode;
- struct ami_font_node *fnode;
- struct TimeVal curtime;
-
- if(IsMinListEmpty(ami_font_list)) return;
-
- node = (struct nsObject *)GetHead((struct List *)ami_font_list);
-
- do
- {
- nnode=(struct nsObject *)GetSucc((struct Node *)node);
- fnode = node->objstruct;
- GetSysTime(&curtime);
- SubTime(&curtime, &fnode->lastused);
- if(curtime.Seconds > 300)
- {
- LOG("Freeing %s not used for %ld seconds", node->dtz_Node.ln_Name, curtime.Seconds);
- DelObject(node);
- }
- } while((node=nnode));
-
- /* reschedule to run in five minutes */
- ami_schedule(300000, (void *)ami_font_cleanup, ami_font_list);
-}
-#endif
-
void ami_init_fonts(void)
{
/* Initialise Unicode font scanner */
ami_font_initscanner(false, true);
/* Initialise font caching etc lists */
-#ifdef __amigaos4__
- ami_font_cache_hook.h_Entry = (HOOKFUNC)ami_font_cache_sort;
- ami_font_cache_hook.h_Data = 0;
- ami_font_list = CreateSkipList(&ami_font_cache_hook, 8);
-#else
- ami_font_list = NewObjList();
-#endif
+ ami_font_cache_init();
+ /* List for diskfont internal cache */
NewList(&ami_diskfontlib_list);
-
- /* run first cleanup in ten minutes */
- ami_schedule(600000, (void *)ami_font_cleanup, ami_font_list);
}
-#ifdef __amigaos4__
-static void ami_font_del_skiplist(struct SkipList *skiplist)
-{
- struct ami_font_node *node;
- struct SkipNode *nnode;
-
- node = (struct ami_font_node *)GetFirstSkipNode(skiplist);
- if(node == NULL) return;
-
- do {
- nnode = GetNextSkipNode(skiplist, (struct SkipNode *)node);
- ami_font_close(node);
-
- } while((node = nnode));
-
- DeleteSkipList(skiplist);
-}
-#endif
-
void ami_close_fonts(void)
{
- LOG("Cleaning up font cache");
- ami_schedule(-1, (void *)ami_font_cleanup, ami_font_list);
-#ifdef __amigaos4__
- ami_font_del_skiplist(ami_font_list);
-#else
- FreeObjList(ami_font_list);
-#endif
- ami_font_list = NULL;
+ ami_font_cache_fini();
ami_font_finiscanner();
}
diff --git a/amiga/font_cache.c b/amiga/font_cache.c
new file mode 100644
index 0000000..4b81aab
--- /dev/null
+++ b/amiga/font_cache.c
@@ -0,0 +1,203 @@
+/*
+ * Copyright 2015 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "amiga/os3support.h"
+
+#include <proto/timer.h>
+#include <proto/utility.h>
+
+#include "utils/log.h"
+
+#include "amiga/font.h"
+#include "amiga/font_cache.h"
+#include "amiga/schedule.h"
+
+#ifdef __amigaos4__
+#include "amiga/hash/xxhash.h"
+#else
+#include "amiga/object.h"
+#endif
+
+#ifdef __amigaos4__
+static struct SkipList *ami_font_list = NULL;
+static struct Hook ami_font_cache_hook;
+#else
+static struct MinList *ami_font_list = NULL;
+#endif
+
+
+
+#ifdef __amigaos4__
+static LONG ami_font_cache_sort(struct Hook *hook, APTR key1, APTR key2)
+{
+ if(key1 == key2) return 0;
+ if(key1 < key2) return -1;
+ return 1;
+}
+#endif
+
+#ifdef __amigaos4__
+static void ami_font_cleanup(struct SkipList *skiplist)
+{
+ struct ami_font_node *node;
+ struct ami_font_node *nnode;
+ struct TimeVal curtime;
+
+ node = (struct ami_font_node *)GetFirstSkipNode(skiplist);
+ if(node == NULL) return;
+
+ do {
+ nnode = (struct ami_font_node *)GetNextSkipNode(skiplist, (struct SkipNode *)node);
+ GetSysTime(&curtime);
+ SubTime(&curtime, &node->lastused);
+ if(curtime.Seconds > 300)
+ {
+ LOG("Freeing font %lx not used for %ld seconds", node->skip_node.sn_Key, curtime.Seconds);
+ ami_font_close(node);
+ RemoveSkipNode(skiplist, node->skip_node.sn_Key);
+ }
+ } while((node = nnode));
+
+ /* reschedule to run in five minutes */
+ ami_schedule(300000, (void *)ami_font_cleanup, ami_font_list);
+}
+#else
+static void ami_font_cleanup(struct MinList *ami_font_list)
+{
+ struct nsObject *node;
+ struct nsObject *nnode;
+ struct ami_font_node *fnode;
+ struct TimeVal curtime;
+
+ if(IsMinListEmpty(ami_font_list)) return;
+
+ node = (struct nsObject *)GetHead((struct List *)ami_font_list);
+
+ do
+ {
+ nnode=(struct nsObject *)GetSucc((struct Node *)node);
+ fnode = node->objstruct;
+ GetSysTime(&curtime);
+ SubTime(&curtime, &fnode->lastused);
+ if(curtime.Seconds > 300)
+ {
+ LOG("Freeing %s not used for %ld seconds", node->dtz_Node.ln_Name, curtime.Seconds);
+ DelObject(node);
+ }
+ } while((node=nnode));
+
+ /* reschedule to run in five minutes */
+ ami_schedule(300000, (void *)ami_font_cleanup, ami_font_list);
+}
+#endif
+
+#ifdef __amigaos4__
+static void ami_font_del_skiplist(struct SkipList *skiplist)
+{
+ struct ami_font_node *node;
+ struct SkipNode *nnode;
+
+ node = (struct ami_font_node *)GetFirstSkipNode(skiplist);
+ if(node == NULL) return;
+
+ do {
+ nnode = GetNextSkipNode(skiplist, (struct SkipNode *)node);
+ ami_font_close(node);
+
+ } while((node = nnode));
+
+ DeleteSkipList(skiplist);
+}
+#endif
+
+
+struct ami_font_node *ami_font_cache_locate(const char *font)
+{
+ struct ami_font_node *nodedata;
+ uint32 hash = 0;
+
+#ifdef __amigaos4__
+ hash = XXH32(font, strlen(font), 0);
+ nodedata = (struct ami_font_node *)FindSkipNode(ami_font_list, (APTR)hash);
+#else
+ struct nsObject *node = (struct nsObject *)FindIName((struct List *)ami_font_list, font);
+ if(node) nodedata = node->objstruct;
+#endif
+
+ if(nodedata) {
+ GetSysTime(&nodedata->lastused);
+ return nodedata;
+ }
+
+ LOG("Font cache miss: %s (%lx)", font, hash);
+ return NULL;
+}
+
+struct ami_font_node *ami_font_cache_alloc_entry(const char *font)
+{
+ struct ami_font_node *nodedata;
+
+#ifdef __amigaos4__
+ uint32 hash = XXH32(font, strlen(font), 0);
+ nodedata = (struct ami_font_node *)InsertSkipNode(ami_font_list, (APTR)hash, sizeof(struct ami_font_node));
+#else
+ nodedata = AllocVecTagList(sizeof(struct ami_font_node), NULL);
+#endif
+
+ GetSysTime(&nodedata->lastused);
+
+ return nodedata;
+}
+
+void ami_font_cache_insert(struct ami_font_node *nodedata, const char *font)
+{
+#ifndef __amigaos4__
+ struct nsObject *node = AddObject(ami_font_list, AMINS_FONT);
+ if(node) {
+ node->objstruct = nodedata;
+ node->dtz_Node.ln_Name = strdup(font);
+ }
+#endif
+}
+
+void ami_font_cache_fini(void)
+{
+ LOG("Cleaning up font cache");
+ ami_schedule(-1, (void *)ami_font_cleanup, ami_font_list);
+#ifdef __amigaos4__
+ ami_font_del_skiplist(ami_font_list);
+#else
+ FreeObjList(ami_font_list);
+#endif
+ ami_font_list = NULL;
+}
+
+void ami_font_cache_init(void)
+{
+#ifdef __amigaos4__
+ ami_font_cache_hook.h_Entry = (HOOKFUNC)ami_font_cache_sort;
+ ami_font_cache_hook.h_Data = 0;
+ ami_font_list = CreateSkipList(&ami_font_cache_hook, 8);
+#else
+ ami_font_list = NewObjList();
+#endif
+
+ /* run first cleanup in ten minutes */
+ ami_schedule(600000, (void *)ami_font_cleanup, ami_font_list);
+}
+
diff --git a/amiga/font_cache.h b/amiga/font_cache.h
new file mode 100644
index 0000000..bb462bc
--- /dev/null
+++ b/amiga/font_cache.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2015 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef AMIGA_FONT_CACHE_H
+#define AMIGA_FONT_CACHE_H
+struct ami_font_node
+{
+#ifdef __amigaos4__
+ struct SkipNode skip_node;
+#endif
+ struct OutlineFont *font;
+ char *bold;
+ char *italic;
+ char *bolditalic;
+ struct TimeVal lastused;
+};
+
+
+/* locate an entry in the font cache, NULL if not found */
+struct ami_font_node *ami_font_cache_locate(const char *font);
+
+/* allocate a cache entry */
+struct ami_font_node *ami_font_cache_alloc_entry(const char *font);
+
+/* insert a cache entry into the list (OS3) */
+void ami_font_cache_insert(struct ami_font_node *nodedata, const char *font);
+
+void ami_font_cache_init(void);
+void ami_font_cache_fini(void);
+
+#endif
+
+
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=469cd6dc67075fcb1ba...
commit 469cd6dc67075fcb1bacc69cbf1354cd67aefddd
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Close the font when we finish with it
diff --git a/amiga/font_bitmap.c b/amiga/font_bitmap.c
index 90277d6..65d2193 100644
--- a/amiga/font_bitmap.c
+++ b/amiga/font_bitmap.c
@@ -210,8 +210,6 @@ bool amiga_bm_nsfont_split(const plot_font_style_t *fstyle,
*char_offset = length;
}
- ami_font_bm_close(bmfont);
-
return true;
}
@@ -227,6 +225,8 @@ ULONG ami_font_bm_text(struct RastPort *rp, const char *string, ULONG length,
free(localtext);
}
+ ami_font_bm_close(bmfont);
+
return 0;
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=37e5bff1880c6c532fa...
commit 37e5bff1880c6c532fad5c5b316deda292fafd17
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Add a status gadget inside the window for OS3
diff --git a/amiga/gui.c b/amiga/gui.c
index eefc2c6..4eb2c47 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -151,7 +151,6 @@
#include "amiga/sslcert.h"
#define AMINS_SCROLLERPEN NUMDRIPENS
-
#define NSA_KBD_SCROLL_PX 10
/* Extra mouse button defines to match those in intuition/intuition.h */
@@ -160,6 +159,12 @@
#define EXTRADOWN (IECODE_5TH_BUTTON)
#define EXTRAUP (IECODE_5TH_BUTTON | IECODE_UP_PREFIX)
+#ifdef __amigaos4__
+#define NSA_STATUS_TEXT GA_Text
+#else
+#define NSA_STATUS_TEXT STRINGA_TextVal
+#endif
+
static bool ami_quit = false;
extern struct gui_utf8_table *amiga_utf8_table;
@@ -176,8 +181,6 @@ static Class *urlStringClass;
static BOOL locked_screen = FALSE;
static int screen_signal = -1;
-static ULONG sz_gad_width = 0;
-static ULONG sz_gad_height = 0;
static bool win_destroyed;
static STRPTR nsscreentitle;
@@ -1807,10 +1810,13 @@ static void ami_gui_refresh_favicon(void *p)
/* Gets the size that border gadget 1 (status) needs to be.
* Returns the width of the size gadget as a convenience.
*/
+#ifdef __amigaos4__
static ULONG ami_get_border_gadget_size(struct gui_window_2 *gwin, ULONG *width, ULONG *height)
{
+ static ULONG sz_gad_width = 0;
+ static ULONG sz_gad_height = 0;
ULONG available_width;
-#ifdef __amigaos4__
+
if((sz_gad_width == 0) || (sz_gad_height == 0)) {
struct DrawInfo *dri = GetScreenDrawInfo(scrn);
GetGUIAttrs(NULL, dri,
@@ -1819,7 +1825,6 @@ static ULONG ami_get_border_gadget_size(struct gui_window_2 *gwin, ULONG *width,
TAG_DONE);
FreeScreenDrawInfo(scrn, dri);
}
-#endif
available_width = gwin->win->Width - scrn->WBorLeft - sz_gad_width;
*width = available_width;
@@ -1827,9 +1832,11 @@ static ULONG ami_get_border_gadget_size(struct gui_window_2 *gwin, ULONG *width,
return sz_gad_width;
}
+#endif
static void ami_set_border_gadget_size(struct gui_window_2 *gwin)
{
+#ifdef __amigaos4__
/* Reset gadget widths according to new calculation */
ULONG size1, size2, sz;
@@ -1841,6 +1848,7 @@ static void ami_set_border_gadget_size(struct gui_window_2 *gwin)
TAG_DONE);
RefreshWindowFrame(gwin->win);
+#endif
}
static void ami_handle_msg(void)
@@ -4228,11 +4236,21 @@ gui_window_create(struct browser_window *bw,
LayoutEnd,
CHILD_WeightedHeight,0,
LAYOUT_AddChild, g->shared->objects[GID_VSCROLLLAYOUT] = LayoutHObj,
- LAYOUT_AddChild, g->shared->objects[GID_HSCROLLLAYOUT] = LayoutVObj,
- LAYOUT_AddChild, g->shared->objects[GID_BROWSER] = SpaceObj,
- GA_ID,GID_BROWSER,
- SPACE_Transparent,TRUE,
- SpaceEnd,
+ LAYOUT_AddChild, LayoutVObj,
+ LAYOUT_AddChild, g->shared->objects[GID_HSCROLLLAYOUT] = LayoutVObj,
+ LAYOUT_AddChild, g->shared->objects[GID_BROWSER] = SpaceObj,
+ GA_ID,GID_BROWSER,
+ SPACE_Transparent,TRUE,
+ SpaceEnd,
+ EndGroup,
+#ifndef __amigaos4__
+ LAYOUT_AddChild, g->shared->objects[GID_STATUS] = StringObj,
+ GA_ID, GID_STATUS,
+ GA_ReadOnly, TRUE,
+ STRINGA_TextVal, NULL,
+ GA_RelVerify, TRUE,
+ StringEnd,
+#endif
EndGroup,
EndGroup,
EndGroup,
@@ -4303,6 +4321,7 @@ gui_window_create(struct browser_window *bw,
if(nsoption_bool(kiosk_mode) == false)
{
+#ifdef __amigaos4__
ULONG sz, width, height;
struct DrawInfo *dri = GetScreenDrawInfo(scrn);
@@ -4311,15 +4330,11 @@ gui_window_create(struct browser_window *bw,
g->shared->objects[GID_STATUS] = NewObject(
NULL,
- "frbuttonclass", /**\todo find appropriate class which works on OS3 */
+ "frbuttonclass",
GA_ID, GID_STATUS,
GA_Left, scrn->WBorLeft + 2,
-#ifdef __amigaos4__
GA_RelBottom, scrn->WBorBottom - (height/2),
GA_BottomBorder, TRUE,
-#else
- GA_Top, g->shared->win->Height,
-#endif
GA_Width, width,
GA_Height, 1 + height - scrn->WBorBottom,
GA_DrawInfo, dri,
@@ -4327,13 +4342,8 @@ gui_window_create(struct browser_window *bw,
GA_Disabled, TRUE,
GA_Image, (struct Image *)NewObject(
NULL,
-#ifdef __amigaos4__
"gaugeiclass",
GAUGEIA_Level, 0,
-#else
- "frameiclass",
- IA_Recessed, TRUE,
-#endif
IA_Top, (int)(- ceil((scrn->WBorBottom + height) / 2)),
IA_Left, -4,
IA_Height, 2 + height - scrn->WBorBottom,
@@ -4357,7 +4367,7 @@ gui_window_create(struct browser_window *bw,
g->shared->win, NULL);
FreeScreenDrawInfo(scrn, dri);
-
+#endif //__amigaos4__
ami_gui_hotlist_toolbar_add(g->shared); /* is this the right place for this? */
if(nsoption_bool(tab_always_show)) ami_toggletabbar(g->shared, true);
}
@@ -4993,7 +5003,7 @@ static void gui_window_set_status(struct gui_window *g, const char *text)
SetGadgetAttrs((struct Gadget *)g->shared->objects[GID_STATUS],
g->shared->win, NULL,
- GA_Text, utf8text,
+ NSA_STATUS_TEXT, utf8text,
TAG_DONE);
RefreshGList((struct Gadget *)g->shared->objects[GID_STATUS],
-----------------------------------------------------------------------
Summary of changes:
amiga/Makefile.target | 2 +-
amiga/font.c | 177 +++--------------------------------
amiga/font.h | 4 +-
amiga/font_bitmap.c | 5 +-
amiga/font_cache.c | 203 +++++++++++++++++++++++++++++++++++++++++
amiga/{rtg.h => font_cache.h} | 42 ++++++---
amiga/gui.c | 54 ++++++-----
7 files changed, 283 insertions(+), 204 deletions(-)
create mode 100644 amiga/font_cache.c
copy amiga/{rtg.h => font_cache.h} (50%)
diff --git a/amiga/Makefile.target b/amiga/Makefile.target
index f422140..391dd6e 100644
--- a/amiga/Makefile.target
+++ b/amiga/Makefile.target
@@ -76,7 +76,7 @@ S_AMIGA := gui.c tree.c history.c hotlist.c schedule.c file.c \
datatypes.c dt_picture.c dt_anim.c dt_sound.c plugin_hack.c \
stringview/stringview.c stringview/urlhistory.c rtg.c \
agclass/amigaguide_class.c os3support.c font_bitmap.c \
- selectmenu.c hash/xxhash.c
+ selectmenu.c hash/xxhash.c font_cache.c
S_AMIGA := $(addprefix amiga/,$(S_AMIGA))
# This is the final source build list
diff --git a/amiga/font.c b/amiga/font.c
index 0b97842..3a141ac 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -26,8 +26,6 @@
#include <proto/diskfont.h>
#include <proto/exec.h>
#include <proto/graphics.h>
-#include <proto/Picasso96API.h>
-#include <proto/timer.h>
#include <proto/utility.h>
#include <diskfont/diskfonttag.h>
@@ -47,14 +45,10 @@
#include "desktop/gui_window.h"
#include "amiga/font.h"
+#include "amiga/font_cache.h"
#include "amiga/font_scan.h"
#include "amiga/gui.h"
#include "amiga/utf8.h"
-#include "amiga/object.h"
-#include "amiga/schedule.h"
-#ifdef __amigaos4__
-#include <amiga/hash/xxhash.h>
-#endif
#define NSA_UNICODE_FONT PLOT_FONT_FAMILY_COUNT
@@ -72,18 +66,6 @@
#define NSA_FONT_EMWIDTH(s) (s / FONT_SIZE_SCALE) * (ami_xdpi / 72.0)
-struct ami_font_node
-{
-#ifdef __amigaos4__
- struct SkipNode skip_node;
-#endif
- struct OutlineFont *font;
- char *bold;
- char *italic;
- char *bolditalic;
- struct TimeVal lastused;
-};
-
const uint16 sc_table[] = {
0x0061, 0x1D00, /* a */
0x0062, 0x0299, /* b */
@@ -151,16 +133,11 @@ const uint16 sc_table[] = {
#endif
0, 0};
-#ifdef __amigaos4__
-struct SkipList *ami_font_list = NULL;
-#else
-struct MinList *ami_font_list = NULL;
-#endif
-struct List ami_diskfontlib_list;
lwc_string *glypharray[0xffff + 1];
ULONG ami_devicedpi;
ULONG ami_xdpi;
-static struct Hook ami_font_cache_hook;
+
+static struct List ami_diskfontlib_list;
static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPort *rp,
uint16 *char1, uint16 *char2, uint32 x, uint32 y, uint32 emwidth, bool aa);
@@ -371,31 +348,12 @@ static inline bool amiga_nsfont_split(const plot_font_style_t *fstyle,
/**
* Search for a font in the list and load from disk if not present
*/
-static struct ami_font_node *ami_font_open(const char *font, bool critical)
+static struct ami_font_cache_node *ami_font_open(const char *font, bool critical)
{
- struct ami_font_node *nodedata = NULL;
- uint32 hash = 0;
-
-#ifdef __amigaos4__
- hash = XXH32(font, strlen(font), 0);
- nodedata = (struct ami_font_node *)FindSkipNode(ami_font_list, (APTR)hash);
-#else
- struct nsObject *node = (struct nsObject *)FindIName((struct List *)ami_font_list, font);
- if(node) nodedata = node->objstruct;
-#endif
-
- if(nodedata) {
- GetSysTime(&nodedata->lastused);
- return nodedata;
- }
-
- LOG("Font cache miss: %s (%lx)", font, hash);
+ struct ami_font_cache_node *nodedata = ami_font_cache_locate(font);
+ if(nodedata) return nodedata;
-#ifdef __amigaos4__
- nodedata = (struct ami_font_node *)InsertSkipNode(ami_font_list, (APTR)hash, sizeof(struct ami_font_node));
-#else
- nodedata = AllocVecTagList(sizeof(struct ami_font_node), NULL);
-#endif
+ nodedata = ami_font_cache_alloc_entry(font);
if(nodedata == NULL) {
warn_user("NoMemory", "");
@@ -430,16 +388,7 @@ static struct ami_font_node *ami_font_open(const char *font, bool critical)
else
LOG("Warning: No designed bold-italic font defined for %s", font);
- GetSysTime(&nodedata->lastused);
-
-#ifndef __amigaos4__
- node = AddObject(ami_font_list, AMINS_FONT);
- if(node) {
- node->objstruct = nodedata;
- node->dtz_Node.ln_Name = strdup(font);
- }
-#endif
-
+ ami_font_cache_insert(nodedata, font);
return nodedata;
}
@@ -453,8 +402,8 @@ static struct ami_font_node *ami_font_open(const char *font, bool critical)
static struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle,
const uint16 *codepoint)
{
- struct ami_font_node *node;
- struct ami_font_node *designed_node = NULL;
+ struct ami_font_cache_node *node;
+ struct ami_font_cache_node *designed_node = NULL;
struct OutlineFont *ofont;
char *fontname;
ULONG ysize;
@@ -924,123 +873,25 @@ void ami_font_savescanner(void)
ami_font_scan_save(nsoption_charp(font_unicode_file), glypharray);
}
-#ifdef __amigaos4__
-static LONG ami_font_cache_sort(struct Hook *hook, APTR key1, APTR key2)
-{
- if(key1 == key2) return 0;
- if(key1 < key2) return -1;
- return 1;
-}
-#endif
-
-#ifdef __amigaos4__
-static void ami_font_cleanup(struct SkipList *skiplist)
-{
- struct ami_font_node *node;
- struct ami_font_node *nnode;
- struct TimeVal curtime;
-
- node = (struct ami_font_node *)GetFirstSkipNode(skiplist);
- if(node == NULL) return;
-
- do {
- nnode = (struct ami_font_node *)GetNextSkipNode(skiplist, (struct SkipNode *)node);
- GetSysTime(&curtime);
- SubTime(&curtime, &node->lastused);
- if(curtime.Seconds > 300)
- {
- LOG("Freeing font %lx not used for %ld seconds", node->skip_node.sn_Key, curtime.Seconds);
- ami_font_close(node);
- RemoveSkipNode(skiplist, node->skip_node.sn_Key);
- }
- } while((node = nnode));
-
- /* reschedule to run in five minutes */
- ami_schedule(300000, (void *)ami_font_cleanup, ami_font_list);
-}
-#else
-static void ami_font_cleanup(struct MinList *ami_font_list)
-{
- struct nsObject *node;
- struct nsObject *nnode;
- struct ami_font_node *fnode;
- struct TimeVal curtime;
-
- if(IsMinListEmpty(ami_font_list)) return;
-
- node = (struct nsObject *)GetHead((struct List *)ami_font_list);
-
- do
- {
- nnode=(struct nsObject *)GetSucc((struct Node *)node);
- fnode = node->objstruct;
- GetSysTime(&curtime);
- SubTime(&curtime, &fnode->lastused);
- if(curtime.Seconds > 300)
- {
- LOG("Freeing %s not used for %ld seconds", node->dtz_Node.ln_Name, curtime.Seconds);
- DelObject(node);
- }
- } while((node=nnode));
-
- /* reschedule to run in five minutes */
- ami_schedule(300000, (void *)ami_font_cleanup, ami_font_list);
-}
-#endif
-
void ami_init_fonts(void)
{
/* Initialise Unicode font scanner */
ami_font_initscanner(false, true);
/* Initialise font caching etc lists */
-#ifdef __amigaos4__
- ami_font_cache_hook.h_Entry = (HOOKFUNC)ami_font_cache_sort;
- ami_font_cache_hook.h_Data = 0;
- ami_font_list = CreateSkipList(&ami_font_cache_hook, 8);
-#else
- ami_font_list = NewObjList();
-#endif
+ ami_font_cache_init();
+ /* List for diskfont internal cache */
NewList(&ami_diskfontlib_list);
-
- /* run first cleanup in ten minutes */
- ami_schedule(600000, (void *)ami_font_cleanup, ami_font_list);
-}
-
-#ifdef __amigaos4__
-static void ami_font_del_skiplist(struct SkipList *skiplist)
-{
- struct ami_font_node *node;
- struct SkipNode *nnode;
-
- node = (struct ami_font_node *)GetFirstSkipNode(skiplist);
- if(node == NULL) return;
-
- do {
- nnode = GetNextSkipNode(skiplist, (struct SkipNode *)node);
- ami_font_close(node);
-
- } while((node = nnode));
-
- DeleteSkipList(skiplist);
}
-#endif
void ami_close_fonts(void)
{
- LOG("Cleaning up font cache");
- ami_schedule(-1, (void *)ami_font_cleanup, ami_font_list);
-#ifdef __amigaos4__
- ami_font_del_skiplist(ami_font_list);
-#else
- FreeObjList(ami_font_list);
-#endif
- ami_font_list = NULL;
+ ami_font_cache_fini();
ami_font_finiscanner();
}
-void ami_font_close(struct ami_font_node *node)
+void ami_font_close(struct ami_font_cache_node *node)
{
/* Called from FreeObjList if node type is AMINS_FONT */
diff --git a/amiga/font.h b/amiga/font.h
index 375e150..98b0a0c 100755
--- a/amiga/font.h
+++ b/amiga/font.h
@@ -23,14 +23,14 @@
#include <graphics/rastport.h>
#include <graphics/text.h>
-struct ami_font_node;
+struct ami_font_cache_node;
ULONG ami_font_unicode_text(struct RastPort *rp, const char *string,
ULONG length, const plot_font_style_t *fstyle, ULONG x, ULONG y, bool aa);
void ami_font_setdevicedpi(int id);
void ami_init_fonts(void);
void ami_close_fonts(void);
-void ami_font_close(struct ami_font_node *node);
+void ami_font_close(struct ami_font_cache_node *node);
/* Alternate entry points into font_scan */
void ami_font_initscanner(bool force, bool save);
diff --git a/amiga/font_bitmap.c b/amiga/font_bitmap.c
index 90277d6..98dd4c9 100644
--- a/amiga/font_bitmap.c
+++ b/amiga/font_bitmap.c
@@ -37,6 +37,7 @@
#include "desktop/gui_window.h"
#include "amiga/font.h"
+#include "amiga/font_cache.h"
#include "amiga/gui.h"
#include "amiga/utf8.h"
@@ -210,8 +211,6 @@ bool amiga_bm_nsfont_split(const plot_font_style_t *fstyle,
*char_offset = length;
}
- ami_font_bm_close(bmfont);
-
return true;
}
@@ -227,6 +226,8 @@ ULONG ami_font_bm_text(struct RastPort *rp, const char *string, ULONG length,
free(localtext);
}
+ ami_font_bm_close(bmfont);
+
return 0;
}
diff --git a/amiga/font_cache.c b/amiga/font_cache.c
new file mode 100644
index 0000000..5814f83
--- /dev/null
+++ b/amiga/font_cache.c
@@ -0,0 +1,203 @@
+/*
+ * Copyright 2015 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "amiga/os3support.h"
+
+#include <proto/timer.h>
+#include <proto/utility.h>
+
+#include "utils/log.h"
+
+#include "amiga/font.h"
+#include "amiga/font_cache.h"
+#include "amiga/schedule.h"
+
+#ifdef __amigaos4__
+#include "amiga/hash/xxhash.h"
+#else
+#include "amiga/object.h"
+#endif
+
+#ifdef __amigaos4__
+static struct SkipList *ami_font_cache_list = NULL;
+static struct Hook ami_font_cache_hook;
+#else
+static struct MinList *ami_font_cache_list = NULL;
+#endif
+
+
+
+#ifdef __amigaos4__
+static LONG ami_font_cache_sort(struct Hook *hook, APTR key1, APTR key2)
+{
+ if(key1 == key2) return 0;
+ if(key1 < key2) return -1;
+ return 1;
+}
+#endif
+
+#ifdef __amigaos4__
+static void ami_font_cache_cleanup(struct SkipList *skiplist)
+{
+ struct ami_font_cache_node *node;
+ struct ami_font_cache_node *nnode;
+ struct TimeVal curtime;
+
+ node = (struct ami_font_cache_node *)GetFirstSkipNode(skiplist);
+ if(node == NULL) return;
+
+ do {
+ nnode = (struct ami_font_cache_node *)GetNextSkipNode(skiplist, (struct SkipNode *)node);
+ GetSysTime(&curtime);
+ SubTime(&curtime, &node->lastused);
+ if(curtime.Seconds > 300)
+ {
+ LOG("Freeing font %lx not used for %ld seconds", node->skip_node.sn_Key, curtime.Seconds);
+ ami_font_close(node);
+ RemoveSkipNode(skiplist, node->skip_node.sn_Key);
+ }
+ } while((node = nnode));
+
+ /* reschedule to run in five minutes */
+ ami_schedule(300000, (void *)ami_font_cache_cleanup, ami_font_cache_list);
+}
+#else
+static void ami_font_cache_cleanup(struct MinList *ami_font_cache_list)
+{
+ struct nsObject *node;
+ struct nsObject *nnode;
+ struct ami_font_cache_node *fnode;
+ struct TimeVal curtime;
+
+ if(IsMinListEmpty(ami_font_cache_list)) return;
+
+ node = (struct nsObject *)GetHead((struct List *)ami_font_cache_list);
+
+ do
+ {
+ nnode=(struct nsObject *)GetSucc((struct Node *)node);
+ fnode = node->objstruct;
+ GetSysTime(&curtime);
+ SubTime(&curtime, &fnode->lastused);
+ if(curtime.Seconds > 300)
+ {
+ LOG("Freeing %s not used for %ld seconds", node->dtz_Node.ln_Name, curtime.Seconds);
+ DelObject(node);
+ }
+ } while((node=nnode));
+
+ /* reschedule to run in five minutes */
+ ami_schedule(300000, (void *)ami_font_cache_cleanup, ami_font_cache_list);
+}
+#endif
+
+#ifdef __amigaos4__
+static void ami_font_cache_del_skiplist(struct SkipList *skiplist)
+{
+ struct ami_font_cache_node *node;
+ struct SkipNode *nnode;
+
+ node = (struct ami_font_cache_node *)GetFirstSkipNode(skiplist);
+ if(node == NULL) return;
+
+ do {
+ nnode = GetNextSkipNode(skiplist, (struct SkipNode *)node);
+ ami_font_close(node);
+
+ } while((node = nnode));
+
+ DeleteSkipList(skiplist);
+}
+#endif
+
+
+struct ami_font_cache_node *ami_font_cache_locate(const char *font)
+{
+ struct ami_font_cache_node *nodedata;
+ uint32 hash = 0;
+
+#ifdef __amigaos4__
+ hash = XXH32(font, strlen(font), 0);
+ nodedata = (struct ami_font_cache_node *)FindSkipNode(ami_font_cache_list, (APTR)hash);
+#else
+ struct nsObject *node = (struct nsObject *)FindIName((struct List *)ami_font_cache_list, font);
+ if(node) nodedata = node->objstruct;
+#endif
+
+ if(nodedata) {
+ GetSysTime(&nodedata->lastused);
+ return nodedata;
+ }
+
+ LOG("Font cache miss: %s (%lx)", font, hash);
+ return NULL;
+}
+
+struct ami_font_cache_node *ami_font_cache_alloc_entry(const char *font)
+{
+ struct ami_font_cache_node *nodedata;
+
+#ifdef __amigaos4__
+ uint32 hash = XXH32(font, strlen(font), 0);
+ nodedata = (struct ami_font_cache_node *)InsertSkipNode(ami_font_cache_list, (APTR)hash, sizeof(struct ami_font_cache_node));
+#else
+ nodedata = AllocVecTagList(sizeof(struct ami_font_cache_node), NULL);
+#endif
+
+ GetSysTime(&nodedata->lastused);
+
+ return nodedata;
+}
+
+void ami_font_cache_insert(struct ami_font_cache_node *nodedata, const char *font)
+{
+#ifndef __amigaos4__
+ struct nsObject *node = AddObject(ami_font_cache_list, AMINS_FONT);
+ if(node) {
+ node->objstruct = nodedata;
+ node->dtz_Node.ln_Name = strdup(font);
+ }
+#endif
+}
+
+void ami_font_cache_fini(void)
+{
+ LOG("Cleaning up font cache");
+ ami_schedule(-1, (void *)ami_font_cache_cleanup, ami_font_cache_list);
+#ifdef __amigaos4__
+ ami_font_cache_del_skiplist(ami_font_cache_list);
+#else
+ FreeObjList(ami_font_cache_list);
+#endif
+ ami_font_cache_list = NULL;
+}
+
+void ami_font_cache_init(void)
+{
+#ifdef __amigaos4__
+ ami_font_cache_hook.h_Entry = (HOOKFUNC)ami_font_cache_sort;
+ ami_font_cache_hook.h_Data = 0;
+ ami_font_cache_list = CreateSkipList(&ami_font_cache_hook, 8);
+#else
+ ami_font_cache_list = NewObjList();
+#endif
+
+ /* run first cleanup in ten minutes */
+ ami_schedule(600000, (void *)ami_font_cache_cleanup, ami_font_cache_list);
+}
+
diff --git a/amiga/rtg.h b/amiga/font_cache.h
similarity index 50%
copy from amiga/rtg.h
copy to amiga/font_cache.h
index 72f5bf3..813b67d 100644
--- a/amiga/rtg.h
+++ b/amiga/font_cache.h
@@ -16,22 +16,36 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/** \file
- * Abstract RTG functions for newer/older/non-P96 systems
- */
+#ifndef AMIGA_FONT_CACHE_H
+#define AMIGA_FONT_CACHE_H
+struct ami_font_cache_node
+{
+#ifdef __amigaos4__
+ struct SkipNode skip_node;
+#endif
+ struct OutlineFont *font;
+ char *bold;
+ char *italic;
+ char *bolditalic;
+ struct TimeVal lastused;
+};
+
+
+/* locate an entry in the font cache, NULL if not found */
+struct ami_font_cache_node *ami_font_cache_locate(const char *font);
-#ifndef AMIGA_RTG_H
-#define AMIGA_RTG_H 1
-#include <proto/graphics.h>
-#include <proto/Picasso96API.h>
+/* allocate a cache entry */
+struct ami_font_cache_node *ami_font_cache_alloc_entry(const char *font);
-/* Wrappers for Alloc/FreeBitMap */
-struct BitMap *ami_rtg_allocbitmap(ULONG width, ULONG height, ULONG depth,
- ULONG flags, struct BitMap *friend, RGBFTYPE format);
-void ami_rtg_freebitmap(struct BitMap *bm);
+/* insert a cache entry into the list (OS3) */
+void ami_font_cache_insert(struct ami_font_cache_node *nodedata, const char *font);
+
+/* initialise the cache */
+void ami_font_cache_init(void);
+
+/* cache clean-up */
+void ami_font_cache_fini(void);
-/* WritePixelArray wrapper. This isn't entirely (at all) equivalent to p96WPA */
-void ami_rtg_writepixelarray(UBYTE *pixdata, struct BitMap *bm,
- ULONG width, ULONG height, ULONG bpr, ULONG format);
#endif
+
diff --git a/amiga/gui.c b/amiga/gui.c
index eefc2c6..4eb2c47 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -151,7 +151,6 @@
#include "amiga/sslcert.h"
#define AMINS_SCROLLERPEN NUMDRIPENS
-
#define NSA_KBD_SCROLL_PX 10
/* Extra mouse button defines to match those in intuition/intuition.h */
@@ -160,6 +159,12 @@
#define EXTRADOWN (IECODE_5TH_BUTTON)
#define EXTRAUP (IECODE_5TH_BUTTON | IECODE_UP_PREFIX)
+#ifdef __amigaos4__
+#define NSA_STATUS_TEXT GA_Text
+#else
+#define NSA_STATUS_TEXT STRINGA_TextVal
+#endif
+
static bool ami_quit = false;
extern struct gui_utf8_table *amiga_utf8_table;
@@ -176,8 +181,6 @@ static Class *urlStringClass;
static BOOL locked_screen = FALSE;
static int screen_signal = -1;
-static ULONG sz_gad_width = 0;
-static ULONG sz_gad_height = 0;
static bool win_destroyed;
static STRPTR nsscreentitle;
@@ -1807,10 +1810,13 @@ static void ami_gui_refresh_favicon(void *p)
/* Gets the size that border gadget 1 (status) needs to be.
* Returns the width of the size gadget as a convenience.
*/
+#ifdef __amigaos4__
static ULONG ami_get_border_gadget_size(struct gui_window_2 *gwin, ULONG *width, ULONG *height)
{
+ static ULONG sz_gad_width = 0;
+ static ULONG sz_gad_height = 0;
ULONG available_width;
-#ifdef __amigaos4__
+
if((sz_gad_width == 0) || (sz_gad_height == 0)) {
struct DrawInfo *dri = GetScreenDrawInfo(scrn);
GetGUIAttrs(NULL, dri,
@@ -1819,7 +1825,6 @@ static ULONG ami_get_border_gadget_size(struct gui_window_2 *gwin, ULONG *width,
TAG_DONE);
FreeScreenDrawInfo(scrn, dri);
}
-#endif
available_width = gwin->win->Width - scrn->WBorLeft - sz_gad_width;
*width = available_width;
@@ -1827,9 +1832,11 @@ static ULONG ami_get_border_gadget_size(struct gui_window_2 *gwin, ULONG *width,
return sz_gad_width;
}
+#endif
static void ami_set_border_gadget_size(struct gui_window_2 *gwin)
{
+#ifdef __amigaos4__
/* Reset gadget widths according to new calculation */
ULONG size1, size2, sz;
@@ -1841,6 +1848,7 @@ static void ami_set_border_gadget_size(struct gui_window_2 *gwin)
TAG_DONE);
RefreshWindowFrame(gwin->win);
+#endif
}
static void ami_handle_msg(void)
@@ -4228,11 +4236,21 @@ gui_window_create(struct browser_window *bw,
LayoutEnd,
CHILD_WeightedHeight,0,
LAYOUT_AddChild, g->shared->objects[GID_VSCROLLLAYOUT] = LayoutHObj,
- LAYOUT_AddChild, g->shared->objects[GID_HSCROLLLAYOUT] = LayoutVObj,
- LAYOUT_AddChild, g->shared->objects[GID_BROWSER] = SpaceObj,
- GA_ID,GID_BROWSER,
- SPACE_Transparent,TRUE,
- SpaceEnd,
+ LAYOUT_AddChild, LayoutVObj,
+ LAYOUT_AddChild, g->shared->objects[GID_HSCROLLLAYOUT] = LayoutVObj,
+ LAYOUT_AddChild, g->shared->objects[GID_BROWSER] = SpaceObj,
+ GA_ID,GID_BROWSER,
+ SPACE_Transparent,TRUE,
+ SpaceEnd,
+ EndGroup,
+#ifndef __amigaos4__
+ LAYOUT_AddChild, g->shared->objects[GID_STATUS] = StringObj,
+ GA_ID, GID_STATUS,
+ GA_ReadOnly, TRUE,
+ STRINGA_TextVal, NULL,
+ GA_RelVerify, TRUE,
+ StringEnd,
+#endif
EndGroup,
EndGroup,
EndGroup,
@@ -4303,6 +4321,7 @@ gui_window_create(struct browser_window *bw,
if(nsoption_bool(kiosk_mode) == false)
{
+#ifdef __amigaos4__
ULONG sz, width, height;
struct DrawInfo *dri = GetScreenDrawInfo(scrn);
@@ -4311,15 +4330,11 @@ gui_window_create(struct browser_window *bw,
g->shared->objects[GID_STATUS] = NewObject(
NULL,
- "frbuttonclass", /**\todo find appropriate class which works on OS3 */
+ "frbuttonclass",
GA_ID, GID_STATUS,
GA_Left, scrn->WBorLeft + 2,
-#ifdef __amigaos4__
GA_RelBottom, scrn->WBorBottom - (height/2),
GA_BottomBorder, TRUE,
-#else
- GA_Top, g->shared->win->Height,
-#endif
GA_Width, width,
GA_Height, 1 + height - scrn->WBorBottom,
GA_DrawInfo, dri,
@@ -4327,13 +4342,8 @@ gui_window_create(struct browser_window *bw,
GA_Disabled, TRUE,
GA_Image, (struct Image *)NewObject(
NULL,
-#ifdef __amigaos4__
"gaugeiclass",
GAUGEIA_Level, 0,
-#else
- "frameiclass",
- IA_Recessed, TRUE,
-#endif
IA_Top, (int)(- ceil((scrn->WBorBottom + height) / 2)),
IA_Left, -4,
IA_Height, 2 + height - scrn->WBorBottom,
@@ -4357,7 +4367,7 @@ gui_window_create(struct browser_window *bw,
g->shared->win, NULL);
FreeScreenDrawInfo(scrn, dri);
-
+#endif //__amigaos4__
ami_gui_hotlist_toolbar_add(g->shared); /* is this the right place for this? */
if(nsoption_bool(tab_always_show)) ami_toggletabbar(g->shared, true);
}
@@ -4993,7 +5003,7 @@ static void gui_window_set_status(struct gui_window *g, const char *text)
SetGadgetAttrs((struct Gadget *)g->shared->objects[GID_STATUS],
g->shared->win, NULL,
- GA_Text, utf8text,
+ NSA_STATUS_TEXT, utf8text,
TAG_DONE);
RefreshGList((struct Gadget *)g->shared->objects[GID_STATUS],
--
NetSurf Browser
7 years, 8 months
toolchains: branch master updated. 08e93a706f715c59ec71dc09f283e9ef7956b77d
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/toolchains.git/shortlog/08e93a706f715c59ec...
...commit http://git.netsurf-browser.org/toolchains.git/commit/08e93a706f715c59ec71...
...tree http://git.netsurf-browser.org/toolchains.git/tree/08e93a706f715c59ec71dc...
The branch, master has been updated
via 08e93a706f715c59ec71dc09f283e9ef7956b77d (commit)
from 241aeaac6d0a63f3f8f81237a31154f4719b7d85 (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/toolchains.git/commit/?id=08e93a706f715c59...
commit 08e93a706f715c59ec71dc09f283e9ef7956b77d
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Removed patch not needed with current libcurl
diff --git a/sdk/recipes/patches/libcurl/m68k-unknown-amigaos/lib.timeval.c.p b/sdk/recipes/patches/libcurl/m68k-unknown-amigaos/lib.timeval.c.p
deleted file mode 100644
index 85d2695..0000000
--- a/sdk/recipes/patches/libcurl/m68k-unknown-amigaos/lib.timeval.c.p
+++ /dev/null
@@ -1,11 +0,0 @@
---- lib/timeval.c.orig 2015-01-19 18:31:02.436021392 +0000
-+++ lib/timeval.c 2015-01-19 18:30:53.552021418 +0000
-@@ -110,7 +110,7 @@ struct timeval curlx_tvnow(void)
- long curlx_tvdiff(struct timeval newer, struct timeval older)
- {
- return (newer.tv_sec-older.tv_sec)*1000+
-- (newer.tv_usec-older.tv_usec)/1000;
-+ (long)(newer.tv_usec-older.tv_usec)/1000;
- }
-
- /*
-----------------------------------------------------------------------
Summary of changes:
.../patches/libcurl/m68k-unknown-amigaos/lib.timeval.c.p | 11 -----------
1 file changed, 11 deletions(-)
delete mode 100644 sdk/recipes/patches/libcurl/m68k-unknown-amigaos/lib.timeval.c.p
diff --git a/sdk/recipes/patches/libcurl/m68k-unknown-amigaos/lib.timeval.c.p b/sdk/recipes/patches/libcurl/m68k-unknown-amigaos/lib.timeval.c.p
deleted file mode 100644
index 85d2695..0000000
--- a/sdk/recipes/patches/libcurl/m68k-unknown-amigaos/lib.timeval.c.p
+++ /dev/null
@@ -1,11 +0,0 @@
---- lib/timeval.c.orig 2015-01-19 18:31:02.436021392 +0000
-+++ lib/timeval.c 2015-01-19 18:30:53.552021418 +0000
-@@ -110,7 +110,7 @@ struct timeval curlx_tvnow(void)
- long curlx_tvdiff(struct timeval newer, struct timeval older)
- {
- return (newer.tv_sec-older.tv_sec)*1000+
-- (newer.tv_usec-older.tv_usec)/1000;
-+ (long)(newer.tv_usec-older.tv_usec)/1000;
- }
-
- /*
--
Cross-compilation toolchains and environments
7 years, 8 months
netsurf: branch master updated. release/3.3-561-gbcdbb9e
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/bcdbb9e365201cc06a5a9...
...commit http://git.netsurf-browser.org/netsurf.git/commit/bcdbb9e365201cc06a5a963...
...tree http://git.netsurf-browser.org/netsurf.git/tree/bcdbb9e365201cc06a5a9635c...
The branch, master has been updated
via bcdbb9e365201cc06a5a9635c51d57993a6286fe (commit)
via 5fb63e19ab4496fd7a0d75dc2744f143c5b9a488 (commit)
from 4fd1fbf68cb07f3cb845c7559ddcaf9e42317ca3 (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=bcdbb9e365201cc06a5...
commit bcdbb9e365201cc06a5a9635c51d57993a6286fe
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Use correct parameters
diff --git a/amiga/font.c b/amiga/font.c
index 5197b32..0b97842 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -789,6 +789,7 @@ ULONG ami_font_unicode_text(struct RastPort *rp, const char *string, ULONG lengt
uint32 x=0;
int32 tempx = 0;
ULONG emwidth = (ULONG)NSA_FONT_EMWIDTH(fstyle->size);
+ uint16 utf16_a = 0x41;
if(!string || string[0]=='\0') return 0;
if(!length) return 0;
@@ -801,7 +802,7 @@ ULONG ami_font_unicode_text(struct RastPort *rp, const char *string, ULONG lengt
if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != NSERROR_OK) return 0;
outf16 = utf16;
if(!(ofont = ami_open_outline_font(fstyle, 0))) {
- if(!(ofont = ami_open_outline_font(fstyle, 'A'))) return 0;
+ if(!(ofont = ami_open_outline_font(fstyle, &utf16_a))) return 0;
}
while(*utf16 != 0)
@@ -857,6 +858,7 @@ static inline ULONG ami_font_unicode_width(const char *string, ULONG length,
uint32 x=0;
int32 tempx = 0;
ULONG emwidth = (ULONG)NSA_FONT_EMWIDTH(fstyle->size);
+ uint16 utf16_a = 0x41;
if(!string || string[0]=='\0') return 0;
if(!length) return 0;
@@ -864,8 +866,7 @@ static inline ULONG ami_font_unicode_width(const char *string, ULONG length,
if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != NSERROR_OK) return 0;
outf16 = utf16;
if(!(ofont = ami_open_outline_font(fstyle, 0))) {
- if(!(ofont = ami_open_outline_font(fstyle, 'A'))) return 0;
-
+ if(!(ofont = ami_open_outline_font(fstyle, &utf16_a))) return 0;
}
while(*utf16 != 0)
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=5fb63e19ab4496fd7a0...
commit 5fb63e19ab4496fd7a0d75dc2744f143c5b9a488
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
If the specified font won't open, use the fallback font for character 'A'.
This helps stop pages showing up blank when the default fonts are wrong.
diff --git a/amiga/font.c b/amiga/font.c
index 8848021..5197b32 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -800,7 +800,9 @@ ULONG ami_font_unicode_text(struct RastPort *rp, const char *string, ULONG lengt
if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != NSERROR_OK) return 0;
outf16 = utf16;
- if(!(ofont = ami_open_outline_font(fstyle, 0))) return 0;
+ if(!(ofont = ami_open_outline_font(fstyle, 0))) {
+ if(!(ofont = ami_open_outline_font(fstyle, 'A'))) return 0;
+ }
while(*utf16 != 0)
{
@@ -861,7 +863,10 @@ static inline ULONG ami_font_unicode_width(const char *string, ULONG length,
if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != NSERROR_OK) return 0;
outf16 = utf16;
- if(!(ofont = ami_open_outline_font(fstyle, 0))) return 0;
+ if(!(ofont = ami_open_outline_font(fstyle, 0))) {
+ if(!(ofont = ami_open_outline_font(fstyle, 'A'))) return 0;
+
+ }
while(*utf16 != 0)
{
-----------------------------------------------------------------------
Summary of changes:
amiga/font.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/amiga/font.c b/amiga/font.c
index 8848021..0b97842 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -789,6 +789,7 @@ ULONG ami_font_unicode_text(struct RastPort *rp, const char *string, ULONG lengt
uint32 x=0;
int32 tempx = 0;
ULONG emwidth = (ULONG)NSA_FONT_EMWIDTH(fstyle->size);
+ uint16 utf16_a = 0x41;
if(!string || string[0]=='\0') return 0;
if(!length) return 0;
@@ -800,7 +801,9 @@ ULONG ami_font_unicode_text(struct RastPort *rp, const char *string, ULONG lengt
if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != NSERROR_OK) return 0;
outf16 = utf16;
- if(!(ofont = ami_open_outline_font(fstyle, 0))) return 0;
+ if(!(ofont = ami_open_outline_font(fstyle, 0))) {
+ if(!(ofont = ami_open_outline_font(fstyle, &utf16_a))) return 0;
+ }
while(*utf16 != 0)
{
@@ -855,13 +858,16 @@ static inline ULONG ami_font_unicode_width(const char *string, ULONG length,
uint32 x=0;
int32 tempx = 0;
ULONG emwidth = (ULONG)NSA_FONT_EMWIDTH(fstyle->size);
+ uint16 utf16_a = 0x41;
if(!string || string[0]=='\0') return 0;
if(!length) return 0;
if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != NSERROR_OK) return 0;
outf16 = utf16;
- if(!(ofont = ami_open_outline_font(fstyle, 0))) return 0;
+ if(!(ofont = ami_open_outline_font(fstyle, 0))) {
+ if(!(ofont = ami_open_outline_font(fstyle, &utf16_a))) return 0;
+ }
while(*utf16 != 0)
{
--
NetSurf Browser
7 years, 8 months
netsurf: branch master updated. release/3.3-559-g4fd1fbf
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/4fd1fbf68cb07f3cb845c...
...commit http://git.netsurf-browser.org/netsurf.git/commit/4fd1fbf68cb07f3cb845c75...
...tree http://git.netsurf-browser.org/netsurf.git/tree/4fd1fbf68cb07f3cb845c7559...
The branch, master has been updated
via 4fd1fbf68cb07f3cb845c7559ddcaf9e42317ca3 (commit)
from 3e71a538c343b3341a435ece56f46b39f1bb3b74 (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=4fd1fbf68cb07f3cb84...
commit 4fd1fbf68cb07f3cb845c7559ddcaf9e42317ca3
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Revert "Set a unicode fallback to LetterGothic on OS3"
This reverts commit 3e71a538c343b3341a435ece56f46b39f1bb3b74.
This is pointless because the fallback is picked up from the font scan, so we should get text on screen from some other font.
diff --git a/amiga/gui.c b/amiga/gui.c
index 8e9fada..eefc2c6 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -624,22 +624,18 @@ static nserror ami_set_options(struct nsoption_s *defaults)
BPTR lock = 0;
/* Search for some likely candidates */
- if((lock = Lock("FONTS:Code2000.otag", ACCESS_READ))) {
+ if((lock = Lock("FONTS:Code2000.otag", ACCESS_READ)))
+ {
UnLock(lock);
nsoption_set_charp(font_unicode,
(char *)strdup("Code2000"));
- } else if((lock = Lock("FONTS:Bitstream Cyberbit.otag", ACCESS_READ))) {
- UnLock(lock);
- nsoption_set_charp(font_unicode,
- (char *)strdup("Bitstream Cyberbit"));
}
-#ifndef __amigaos4__
- else if((lock = Lock("FONTS:LetterGothic.otag", ACCESS_READ))) {
+ else if((lock = Lock("FONTS:Bitstream Cyberbit.otag", ACCESS_READ)))
+ {
UnLock(lock);
nsoption_set_charp(font_unicode,
- (char *)strdup("LetterGothic"));
+ (char *)strdup("Bitstream Cyberbit"));
}
-#endif
}
if (nsoption_charp(font_surrogate) == NULL) {
-----------------------------------------------------------------------
Summary of changes:
amiga/gui.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/amiga/gui.c b/amiga/gui.c
index 8e9fada..eefc2c6 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -624,22 +624,18 @@ static nserror ami_set_options(struct nsoption_s *defaults)
BPTR lock = 0;
/* Search for some likely candidates */
- if((lock = Lock("FONTS:Code2000.otag", ACCESS_READ))) {
+ if((lock = Lock("FONTS:Code2000.otag", ACCESS_READ)))
+ {
UnLock(lock);
nsoption_set_charp(font_unicode,
(char *)strdup("Code2000"));
- } else if((lock = Lock("FONTS:Bitstream Cyberbit.otag", ACCESS_READ))) {
- UnLock(lock);
- nsoption_set_charp(font_unicode,
- (char *)strdup("Bitstream Cyberbit"));
}
-#ifndef __amigaos4__
- else if((lock = Lock("FONTS:LetterGothic.otag", ACCESS_READ))) {
+ else if((lock = Lock("FONTS:Bitstream Cyberbit.otag", ACCESS_READ)))
+ {
UnLock(lock);
nsoption_set_charp(font_unicode,
- (char *)strdup("LetterGothic"));
+ (char *)strdup("Bitstream Cyberbit"));
}
-#endif
}
if (nsoption_charp(font_surrogate) == NULL) {
--
NetSurf Browser
7 years, 8 months
netsurf: branch master updated. release/3.3-558-g3e71a53
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/3e71a538c343b3341a435...
...commit http://git.netsurf-browser.org/netsurf.git/commit/3e71a538c343b3341a435ec...
...tree http://git.netsurf-browser.org/netsurf.git/tree/3e71a538c343b3341a435ece5...
The branch, master has been updated
via 3e71a538c343b3341a435ece56f46b39f1bb3b74 (commit)
from 54feabe845b9f444b7288681d6b502103a97fe07 (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=3e71a538c343b3341a4...
commit 3e71a538c343b3341a435ece56f46b39f1bb3b74
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Set a unicode fallback to LetterGothic on OS3
This should ensure we get text on screen even if use_diskfont is disabled and a bitmap font is set.
diff --git a/amiga/gui.c b/amiga/gui.c
index eefc2c6..8e9fada 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -624,18 +624,22 @@ static nserror ami_set_options(struct nsoption_s *defaults)
BPTR lock = 0;
/* Search for some likely candidates */
- if((lock = Lock("FONTS:Code2000.otag", ACCESS_READ)))
- {
+ if((lock = Lock("FONTS:Code2000.otag", ACCESS_READ))) {
UnLock(lock);
nsoption_set_charp(font_unicode,
(char *)strdup("Code2000"));
- }
- else if((lock = Lock("FONTS:Bitstream Cyberbit.otag", ACCESS_READ)))
- {
+ } else if((lock = Lock("FONTS:Bitstream Cyberbit.otag", ACCESS_READ))) {
UnLock(lock);
nsoption_set_charp(font_unicode,
(char *)strdup("Bitstream Cyberbit"));
}
+#ifndef __amigaos4__
+ else if((lock = Lock("FONTS:LetterGothic.otag", ACCESS_READ))) {
+ UnLock(lock);
+ nsoption_set_charp(font_unicode,
+ (char *)strdup("LetterGothic"));
+ }
+#endif
}
if (nsoption_charp(font_surrogate) == NULL) {
-----------------------------------------------------------------------
Summary of changes:
amiga/gui.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/amiga/gui.c b/amiga/gui.c
index eefc2c6..8e9fada 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -624,18 +624,22 @@ static nserror ami_set_options(struct nsoption_s *defaults)
BPTR lock = 0;
/* Search for some likely candidates */
- if((lock = Lock("FONTS:Code2000.otag", ACCESS_READ)))
- {
+ if((lock = Lock("FONTS:Code2000.otag", ACCESS_READ))) {
UnLock(lock);
nsoption_set_charp(font_unicode,
(char *)strdup("Code2000"));
- }
- else if((lock = Lock("FONTS:Bitstream Cyberbit.otag", ACCESS_READ)))
- {
+ } else if((lock = Lock("FONTS:Bitstream Cyberbit.otag", ACCESS_READ))) {
UnLock(lock);
nsoption_set_charp(font_unicode,
(char *)strdup("Bitstream Cyberbit"));
}
+#ifndef __amigaos4__
+ else if((lock = Lock("FONTS:LetterGothic.otag", ACCESS_READ))) {
+ UnLock(lock);
+ nsoption_set_charp(font_unicode,
+ (char *)strdup("LetterGothic"));
+ }
+#endif
}
if (nsoption_charp(font_surrogate) == NULL) {
--
NetSurf Browser
7 years, 8 months
netsurf: branch master updated. release/3.3-557-g54feabe
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/54feabe845b9f444b7288...
...commit http://git.netsurf-browser.org/netsurf.git/commit/54feabe845b9f444b728868...
...tree http://git.netsurf-browser.org/netsurf.git/tree/54feabe845b9f444b7288681d...
The branch, master has been updated
via 54feabe845b9f444b7288681d6b502103a97fe07 (commit)
from 81516b33c883b5b88782c2b31731215ac73d490f (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=54feabe845b9f444b72...
commit 54feabe845b9f444b7288681d6b502103a97fe07
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Set some memory and speed options by default for OS3
diff --git a/amiga/gui.c b/amiga/gui.c
index 4933618..eefc2c6 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -497,9 +497,10 @@ static void ami_set_screen_defaults(struct Screen *screen)
nsoption_default_set_int(window_width, screen->Width);
nsoption_default_set_int(window_height, screen->Height - screen->BarHeight - 1);
+#ifdef __amigaos4__
nsoption_default_set_int(redraw_tile_size_x, screen->Width);
nsoption_default_set_int(redraw_tile_size_y, screen->Height);
-#ifdef __amigaos4__
+
/* set system colours for amiga ui */
colour_option_from_pen(FILLPEN, NSOPTION_sys_colour_ActiveBorder, screen, 0x00000000);
colour_option_from_pen(FILLPEN, NSOPTION_sys_colour_ActiveCaption, screen, 0x00dddddd);
@@ -529,6 +530,9 @@ static void ami_set_screen_defaults(struct Screen *screen)
colour_option_from_pen(BACKGROUNDPEN, NSOPTION_sys_colour_Window, screen, 0x00aaaaaa);
colour_option_from_pen(INACTIVEFILLPEN, NSOPTION_sys_colour_WindowFrame, screen, 0x00000000);
colour_option_from_pen(TEXTPEN, NSOPTION_sys_colour_WindowText, screen, 0x00000000);
+#else
+ nsoption_default_set_int(redraw_tile_size_x, 100);
+ nsoption_default_set_int(redraw_tile_size_y, 100);
#endif
}
@@ -547,9 +551,17 @@ static nserror ami_set_options(struct nsoption_s *defaults)
/* The following line disables the popupmenu.class select menu.
** It's not recommended to use it!
*/
-
nsoption_set_bool(core_select_menu, true);
+ /* Some AmigaOS3 overrides */
+#ifndef __amigaos4__
+ nsoption_set_bool(download_notify, false);
+ nsoption_set_bool(font_antialiasing, false);
+ nsoption_set_bool(truecolour_mouse_pointers, false);
+ nsoption_set_bool(use_openurl_lib, true);
+ nsoption_set_bool(use_diskfont, true);
+#endif
+
if((!nsoption_charp(accept_language)) ||
(nsoption_charp(accept_language)[0] == '\0') ||
(nsoption_bool(accept_lang_locale) == true))
@@ -589,19 +601,22 @@ static nserror ami_set_options(struct nsoption_s *defaults)
nsoption_setnull_charp(font_cursive, (char *)strdup("DejaVu Sans"));
nsoption_setnull_charp(font_fantasy, (char *)strdup("DejaVu Serif"));
#else
- if(nsoption_bool(use_diskfont) == true) {
- nsoption_setnull_charp(font_sans, (char *)strdup("helvetica"));
- nsoption_setnull_charp(font_serif, (char *)strdup("times"));
- nsoption_setnull_charp(font_mono, (char *)strdup("topaz"));
- nsoption_setnull_charp(font_cursive, (char *)strdup("garnet"));
- nsoption_setnull_charp(font_fantasy, (char *)strdup("emerald"));
- } else {
- nsoption_setnull_charp(font_sans, (char *)strdup("CGTriumvirate"));
- nsoption_setnull_charp(font_serif, (char *)strdup("CGTimes"));
- nsoption_setnull_charp(font_mono, (char *)strdup("LetterGothic"));
- nsoption_setnull_charp(font_cursive, (char *)strdup("CGTriumvirate"));
- nsoption_setnull_charp(font_fantasy, (char *)strdup("CGTimes"));
- }
+ nsoption_setnull_charp(font_sans, (char *)strdup("helvetica"));
+ nsoption_setnull_charp(font_serif, (char *)strdup("times"));
+ nsoption_setnull_charp(font_mono, (char *)strdup("topaz"));
+ nsoption_setnull_charp(font_cursive, (char *)strdup("garnet"));
+ nsoption_setnull_charp(font_fantasy, (char *)strdup("emerald"));
+/* Default CG fonts for OS3 - these work with use_diskfont both on and off,
+ however they are slow in both cases. The bitmap fonts don't work when
+ use_diskfont is off. The bitmap fonts performance on 68k is far superior,
+ so default to those for now whilst testing.
+ \todo maybe add some buttons to the prefs GUI to toggle?
+ nsoption_setnull_charp(font_sans, (char *)strdup("CGTriumvirate"));
+ nsoption_setnull_charp(font_serif, (char *)strdup("CGTimes"));
+ nsoption_setnull_charp(font_mono, (char *)strdup("LetterGothic"));
+ nsoption_setnull_charp(font_cursive, (char *)strdup("CGTriumvirate"));
+ nsoption_setnull_charp(font_fantasy, (char *)strdup("CGTimes"));
+*/
#endif
if (nsoption_charp(font_unicode) == NULL)
@@ -636,12 +651,6 @@ static nserror ami_set_options(struct nsoption_s *defaults)
}
}
-#ifndef __amigaos4__
- nsoption_set_bool(download_notify, false);
- nsoption_set_bool(font_antialiasing, false);
- nsoption_set_bool(truecolour_mouse_pointers, false);
-#endif
-
return NSERROR_OK;
}
diff --git a/amiga/options.h b/amiga/options.h
index 317e5df..728f6d4 100644
--- a/amiga/options.h
+++ b/amiga/options.h
@@ -50,7 +50,7 @@ NSOPTION_STRING(download_dir, NULL)
NSOPTION_BOOL(download_notify, true)
NSOPTION_BOOL(faster_scroll, true)
NSOPTION_BOOL(scale_quality, false)
-NSOPTION_INTEGER(dither_quality, 1)
+NSOPTION_INTEGER(dither_quality, 0)
NSOPTION_INTEGER(mask_alpha, 50)
NSOPTION_BOOL(ask_overwrite, true)
NSOPTION_INTEGER(printer_unit, 0)
@@ -63,7 +63,7 @@ NSOPTION_STRING(font_surrogate, NULL)
NSOPTION_STRING(font_unicode_file, NULL)
NSOPTION_BOOL(font_unicode_only, false)
NSOPTION_BOOL(font_antialiasing, true)
-NSOPTION_BOOL(use_diskfont, false)
+NSOPTION_BOOL(use_diskfont, false)
NSOPTION_BOOL(drag_save_icons, true)
NSOPTION_INTEGER(hotlist_window_xpos, 0)
NSOPTION_INTEGER(hotlist_window_ypos, 0)
@@ -89,6 +89,6 @@ NSOPTION_INTEGER(monitor_aspect_y, 0)
NSOPTION_BOOL(accept_lang_locale, true)
/* Options relevant for OS3 only */
#ifndef __amigaos4__
-NSOPTION_BOOL(friend_bitmap, false)
+NSOPTION_BOOL(friend_bitmap, true)
#endif
-----------------------------------------------------------------------
Summary of changes:
amiga/gui.c | 51 ++++++++++++++++++++++++++++++---------------------
amiga/options.h | 6 +++---
2 files changed, 33 insertions(+), 24 deletions(-)
diff --git a/amiga/gui.c b/amiga/gui.c
index 4933618..eefc2c6 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -497,9 +497,10 @@ static void ami_set_screen_defaults(struct Screen *screen)
nsoption_default_set_int(window_width, screen->Width);
nsoption_default_set_int(window_height, screen->Height - screen->BarHeight - 1);
+#ifdef __amigaos4__
nsoption_default_set_int(redraw_tile_size_x, screen->Width);
nsoption_default_set_int(redraw_tile_size_y, screen->Height);
-#ifdef __amigaos4__
+
/* set system colours for amiga ui */
colour_option_from_pen(FILLPEN, NSOPTION_sys_colour_ActiveBorder, screen, 0x00000000);
colour_option_from_pen(FILLPEN, NSOPTION_sys_colour_ActiveCaption, screen, 0x00dddddd);
@@ -529,6 +530,9 @@ static void ami_set_screen_defaults(struct Screen *screen)
colour_option_from_pen(BACKGROUNDPEN, NSOPTION_sys_colour_Window, screen, 0x00aaaaaa);
colour_option_from_pen(INACTIVEFILLPEN, NSOPTION_sys_colour_WindowFrame, screen, 0x00000000);
colour_option_from_pen(TEXTPEN, NSOPTION_sys_colour_WindowText, screen, 0x00000000);
+#else
+ nsoption_default_set_int(redraw_tile_size_x, 100);
+ nsoption_default_set_int(redraw_tile_size_y, 100);
#endif
}
@@ -547,9 +551,17 @@ static nserror ami_set_options(struct nsoption_s *defaults)
/* The following line disables the popupmenu.class select menu.
** It's not recommended to use it!
*/
-
nsoption_set_bool(core_select_menu, true);
+ /* Some AmigaOS3 overrides */
+#ifndef __amigaos4__
+ nsoption_set_bool(download_notify, false);
+ nsoption_set_bool(font_antialiasing, false);
+ nsoption_set_bool(truecolour_mouse_pointers, false);
+ nsoption_set_bool(use_openurl_lib, true);
+ nsoption_set_bool(use_diskfont, true);
+#endif
+
if((!nsoption_charp(accept_language)) ||
(nsoption_charp(accept_language)[0] == '\0') ||
(nsoption_bool(accept_lang_locale) == true))
@@ -589,19 +601,22 @@ static nserror ami_set_options(struct nsoption_s *defaults)
nsoption_setnull_charp(font_cursive, (char *)strdup("DejaVu Sans"));
nsoption_setnull_charp(font_fantasy, (char *)strdup("DejaVu Serif"));
#else
- if(nsoption_bool(use_diskfont) == true) {
- nsoption_setnull_charp(font_sans, (char *)strdup("helvetica"));
- nsoption_setnull_charp(font_serif, (char *)strdup("times"));
- nsoption_setnull_charp(font_mono, (char *)strdup("topaz"));
- nsoption_setnull_charp(font_cursive, (char *)strdup("garnet"));
- nsoption_setnull_charp(font_fantasy, (char *)strdup("emerald"));
- } else {
- nsoption_setnull_charp(font_sans, (char *)strdup("CGTriumvirate"));
- nsoption_setnull_charp(font_serif, (char *)strdup("CGTimes"));
- nsoption_setnull_charp(font_mono, (char *)strdup("LetterGothic"));
- nsoption_setnull_charp(font_cursive, (char *)strdup("CGTriumvirate"));
- nsoption_setnull_charp(font_fantasy, (char *)strdup("CGTimes"));
- }
+ nsoption_setnull_charp(font_sans, (char *)strdup("helvetica"));
+ nsoption_setnull_charp(font_serif, (char *)strdup("times"));
+ nsoption_setnull_charp(font_mono, (char *)strdup("topaz"));
+ nsoption_setnull_charp(font_cursive, (char *)strdup("garnet"));
+ nsoption_setnull_charp(font_fantasy, (char *)strdup("emerald"));
+/* Default CG fonts for OS3 - these work with use_diskfont both on and off,
+ however they are slow in both cases. The bitmap fonts don't work when
+ use_diskfont is off. The bitmap fonts performance on 68k is far superior,
+ so default to those for now whilst testing.
+ \todo maybe add some buttons to the prefs GUI to toggle?
+ nsoption_setnull_charp(font_sans, (char *)strdup("CGTriumvirate"));
+ nsoption_setnull_charp(font_serif, (char *)strdup("CGTimes"));
+ nsoption_setnull_charp(font_mono, (char *)strdup("LetterGothic"));
+ nsoption_setnull_charp(font_cursive, (char *)strdup("CGTriumvirate"));
+ nsoption_setnull_charp(font_fantasy, (char *)strdup("CGTimes"));
+*/
#endif
if (nsoption_charp(font_unicode) == NULL)
@@ -636,12 +651,6 @@ static nserror ami_set_options(struct nsoption_s *defaults)
}
}
-#ifndef __amigaos4__
- nsoption_set_bool(download_notify, false);
- nsoption_set_bool(font_antialiasing, false);
- nsoption_set_bool(truecolour_mouse_pointers, false);
-#endif
-
return NSERROR_OK;
}
diff --git a/amiga/options.h b/amiga/options.h
index 317e5df..728f6d4 100644
--- a/amiga/options.h
+++ b/amiga/options.h
@@ -50,7 +50,7 @@ NSOPTION_STRING(download_dir, NULL)
NSOPTION_BOOL(download_notify, true)
NSOPTION_BOOL(faster_scroll, true)
NSOPTION_BOOL(scale_quality, false)
-NSOPTION_INTEGER(dither_quality, 1)
+NSOPTION_INTEGER(dither_quality, 0)
NSOPTION_INTEGER(mask_alpha, 50)
NSOPTION_BOOL(ask_overwrite, true)
NSOPTION_INTEGER(printer_unit, 0)
@@ -63,7 +63,7 @@ NSOPTION_STRING(font_surrogate, NULL)
NSOPTION_STRING(font_unicode_file, NULL)
NSOPTION_BOOL(font_unicode_only, false)
NSOPTION_BOOL(font_antialiasing, true)
-NSOPTION_BOOL(use_diskfont, false)
+NSOPTION_BOOL(use_diskfont, false)
NSOPTION_BOOL(drag_save_icons, true)
NSOPTION_INTEGER(hotlist_window_xpos, 0)
NSOPTION_INTEGER(hotlist_window_ypos, 0)
@@ -89,6 +89,6 @@ NSOPTION_INTEGER(monitor_aspect_y, 0)
NSOPTION_BOOL(accept_lang_locale, true)
/* Options relevant for OS3 only */
#ifndef __amigaos4__
-NSOPTION_BOOL(friend_bitmap, false)
+NSOPTION_BOOL(friend_bitmap, true)
#endif
--
NetSurf Browser
7 years, 8 months
libdom: branch master updated. release/0.2.0-3-g418da4c
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libdom.git/shortlog/418da4cef720b72bfee797...
...commit http://git.netsurf-browser.org/libdom.git/commit/418da4cef720b72bfee797d5...
...tree http://git.netsurf-browser.org/libdom.git/tree/418da4cef720b72bfee797d584...
The branch, master has been updated
via 418da4cef720b72bfee797d584933ed689f2e74a (commit)
from 295927e1c6a3ce6a17a610ba2176773337de13a7 (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=418da4cef720b72bfee7...
commit 418da4cef720b72bfee797d584933ed689f2e74a
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Fix leak of dom string on error path. Coverity #1347877.
diff --git a/src/core/document.c b/src/core/document.c
index 4e2bf6b..fda83dd 100644
--- a/src/core/document.c
+++ b/src/core/document.c
@@ -127,6 +127,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
err = dom_string_create_interned((const uint8_t *) "about:blank",
SLEN("about:blank"), &doc->uri);
if (err != DOM_NO_ERR) {
+ dom_string_unref(name);
return err;
}
-----------------------------------------------------------------------
Summary of changes:
src/core/document.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/core/document.c b/src/core/document.c
index 4e2bf6b..fda83dd 100644
--- a/src/core/document.c
+++ b/src/core/document.c
@@ -127,6 +127,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
err = dom_string_create_interned((const uint8_t *) "about:blank",
SLEN("about:blank"), &doc->uri);
if (err != DOM_NO_ERR) {
+ dom_string_unref(name);
return err;
}
--
Document Object Model library
7 years, 8 months
netsurf: branch master updated. release/3.3-556-g81516b3
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/81516b33c883b5b88782c...
...commit http://git.netsurf-browser.org/netsurf.git/commit/81516b33c883b5b88782c2b...
...tree http://git.netsurf-browser.org/netsurf.git/tree/81516b33c883b5b88782c2b31...
The branch, master has been updated
via 81516b33c883b5b88782c2b31731215ac73d490f (commit)
from 58d9c9801734bcd8073c62c8b4676d1b826847ab (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=81516b33c883b5b8878...
commit 81516b33c883b5b88782c2b31731215ac73d490f
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Set some sensible default bitmap fonts on OS3 when using diskfont
diff --git a/amiga/gui.c b/amiga/gui.c
index 30d72a8..4933618 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -589,11 +589,19 @@ static nserror ami_set_options(struct nsoption_s *defaults)
nsoption_setnull_charp(font_cursive, (char *)strdup("DejaVu Sans"));
nsoption_setnull_charp(font_fantasy, (char *)strdup("DejaVu Serif"));
#else
- nsoption_setnull_charp(font_sans, (char *)strdup("CGTriumvirate"));
- nsoption_setnull_charp(font_serif, (char *)strdup("CGTimes"));
- nsoption_setnull_charp(font_mono, (char *)strdup("LetterGothic"));
- nsoption_setnull_charp(font_cursive, (char *)strdup("CGTriumvirate"));
- nsoption_setnull_charp(font_fantasy, (char *)strdup("CGTimes"));
+ if(nsoption_bool(use_diskfont) == true) {
+ nsoption_setnull_charp(font_sans, (char *)strdup("helvetica"));
+ nsoption_setnull_charp(font_serif, (char *)strdup("times"));
+ nsoption_setnull_charp(font_mono, (char *)strdup("topaz"));
+ nsoption_setnull_charp(font_cursive, (char *)strdup("garnet"));
+ nsoption_setnull_charp(font_fantasy, (char *)strdup("emerald"));
+ } else {
+ nsoption_setnull_charp(font_sans, (char *)strdup("CGTriumvirate"));
+ nsoption_setnull_charp(font_serif, (char *)strdup("CGTimes"));
+ nsoption_setnull_charp(font_mono, (char *)strdup("LetterGothic"));
+ nsoption_setnull_charp(font_cursive, (char *)strdup("CGTriumvirate"));
+ nsoption_setnull_charp(font_fantasy, (char *)strdup("CGTimes"));
+ }
#endif
if (nsoption_charp(font_unicode) == NULL)
-----------------------------------------------------------------------
Summary of changes:
amiga/gui.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/amiga/gui.c b/amiga/gui.c
index 30d72a8..4933618 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -589,11 +589,19 @@ static nserror ami_set_options(struct nsoption_s *defaults)
nsoption_setnull_charp(font_cursive, (char *)strdup("DejaVu Sans"));
nsoption_setnull_charp(font_fantasy, (char *)strdup("DejaVu Serif"));
#else
- nsoption_setnull_charp(font_sans, (char *)strdup("CGTriumvirate"));
- nsoption_setnull_charp(font_serif, (char *)strdup("CGTimes"));
- nsoption_setnull_charp(font_mono, (char *)strdup("LetterGothic"));
- nsoption_setnull_charp(font_cursive, (char *)strdup("CGTriumvirate"));
- nsoption_setnull_charp(font_fantasy, (char *)strdup("CGTimes"));
+ if(nsoption_bool(use_diskfont) == true) {
+ nsoption_setnull_charp(font_sans, (char *)strdup("helvetica"));
+ nsoption_setnull_charp(font_serif, (char *)strdup("times"));
+ nsoption_setnull_charp(font_mono, (char *)strdup("topaz"));
+ nsoption_setnull_charp(font_cursive, (char *)strdup("garnet"));
+ nsoption_setnull_charp(font_fantasy, (char *)strdup("emerald"));
+ } else {
+ nsoption_setnull_charp(font_sans, (char *)strdup("CGTriumvirate"));
+ nsoption_setnull_charp(font_serif, (char *)strdup("CGTimes"));
+ nsoption_setnull_charp(font_mono, (char *)strdup("LetterGothic"));
+ nsoption_setnull_charp(font_cursive, (char *)strdup("CGTriumvirate"));
+ nsoption_setnull_charp(font_fantasy, (char *)strdup("CGTimes"));
+ }
#endif
if (nsoption_charp(font_unicode) == NULL)
--
NetSurf Browser
7 years, 8 months
netsurf: branch master updated. release/3.3-555-g58d9c98
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/58d9c9801734bcd8073c6...
...commit http://git.netsurf-browser.org/netsurf.git/commit/58d9c9801734bcd8073c62c...
...tree http://git.netsurf-browser.org/netsurf.git/tree/58d9c9801734bcd8073c62c8b...
The branch, master has been updated
via 58d9c9801734bcd8073c62c8b4676d1b826847ab (commit)
via 8e0e72368e987e364bfa5b3bd0be0298e45cd00b (commit)
via fcaf43ddcc7906a96031dbdccfd565f47e54e37b (commit)
from b1e0a711c798c48059c5d40835649c84e109d056 (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=58d9c9801734bcd8073...
commit 58d9c9801734bcd8073c62c8b4676d1b826847ab
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
URLdb doesn't store 'mailto' urls, so add early exit to lookup.
diff --git a/content/urldb.c b/content/urldb.c
index 0c2c639..edb49b5 100644
--- a/content/urldb.c
+++ b/content/urldb.c
@@ -1219,6 +1219,12 @@ static struct path_data *urldb_find_url(nsurl *url)
if (scheme == NULL)
return NULL;
+ if (lwc_string_isequal(scheme, corestring_lwc_mailto, &match) ==
+ lwc_error_ok && match == true) {
+ lwc_string_unref(scheme);
+ return NULL;
+ }
+
host = nsurl_get_component(url, NSURL_HOST);
if (host != NULL) {
host_str = lwc_string_data(host);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=8e0e72368e987e364bf...
commit 8e0e72368e987e364bfa5b3bd0be0298e45cd00b
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Fix crazy indentation.
diff --git a/content/urldb.c b/content/urldb.c
index 1121244..0c2c639 100644
--- a/content/urldb.c
+++ b/content/urldb.c
@@ -1210,9 +1210,8 @@ static struct path_data *urldb_find_url(nsurl *url)
assert(url);
if (url_bloom != NULL) {
- if (bloom_search_hash(url_bloom,
- nsurl_hash(url)) == false) {
- return NULL;
+ if (bloom_search_hash(url_bloom, nsurl_hash(url)) == false) {
+ return NULL;
}
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=fcaf43ddcc7906a9603...
commit fcaf43ddcc7906a96031dbdccfd565f47e54e37b
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add 'mailto' lwc corestring.
diff --git a/utils/corestrings.c b/utils/corestrings.c
index 493dace..38da76d 100644
--- a/utils/corestrings.c
+++ b/utils/corestrings.c
@@ -75,6 +75,7 @@ lwc_string *corestring_lwc_justify;
lwc_string *corestring_lwc_left;
lwc_string *corestring_lwc_li;
lwc_string *corestring_lwc_link;
+lwc_string *corestring_lwc_mailto;
lwc_string *corestring_lwc_meta;
lwc_string *corestring_lwc_middle;
lwc_string *corestring_lwc_multipart_form_data;
@@ -345,6 +346,7 @@ void corestrings_fini(void)
CSS_LWC_STRING_UNREF(left);
CSS_LWC_STRING_UNREF(li);
CSS_LWC_STRING_UNREF(link);
+ CSS_LWC_STRING_UNREF(mailto);
CSS_LWC_STRING_UNREF(meta);
CSS_LWC_STRING_UNREF(middle);
CSS_LWC_STRING_UNREF(multipart_form_data);
@@ -643,6 +645,7 @@ nserror corestrings_init(void)
CSS_LWC_STRING_INTERN(left);
CSS_LWC_STRING_INTERN(li);
CSS_LWC_STRING_INTERN(link);
+ CSS_LWC_STRING_INTERN(mailto);
CSS_LWC_STRING_INTERN(meta);
CSS_LWC_STRING_INTERN(middle);
CSS_LWC_STRING_INTERN(no);
diff --git a/utils/corestrings.h b/utils/corestrings.h
index 4913e73..280098b 100644
--- a/utils/corestrings.h
+++ b/utils/corestrings.h
@@ -84,6 +84,7 @@ extern lwc_string *corestring_lwc_justify;
extern lwc_string *corestring_lwc_left;
extern lwc_string *corestring_lwc_li;
extern lwc_string *corestring_lwc_link;
+extern lwc_string *corestring_lwc_mailto;
extern lwc_string *corestring_lwc_meta;
extern lwc_string *corestring_lwc_middle;
extern lwc_string *corestring_lwc_multipart_form_data; /* multipart/form-data */
-----------------------------------------------------------------------
Summary of changes:
content/urldb.c | 11 ++++++++---
utils/corestrings.c | 3 +++
utils/corestrings.h | 1 +
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/content/urldb.c b/content/urldb.c
index 1121244..edb49b5 100644
--- a/content/urldb.c
+++ b/content/urldb.c
@@ -1210,9 +1210,8 @@ static struct path_data *urldb_find_url(nsurl *url)
assert(url);
if (url_bloom != NULL) {
- if (bloom_search_hash(url_bloom,
- nsurl_hash(url)) == false) {
- return NULL;
+ if (bloom_search_hash(url_bloom, nsurl_hash(url)) == false) {
+ return NULL;
}
}
@@ -1220,6 +1219,12 @@ static struct path_data *urldb_find_url(nsurl *url)
if (scheme == NULL)
return NULL;
+ if (lwc_string_isequal(scheme, corestring_lwc_mailto, &match) ==
+ lwc_error_ok && match == true) {
+ lwc_string_unref(scheme);
+ return NULL;
+ }
+
host = nsurl_get_component(url, NSURL_HOST);
if (host != NULL) {
host_str = lwc_string_data(host);
diff --git a/utils/corestrings.c b/utils/corestrings.c
index 493dace..38da76d 100644
--- a/utils/corestrings.c
+++ b/utils/corestrings.c
@@ -75,6 +75,7 @@ lwc_string *corestring_lwc_justify;
lwc_string *corestring_lwc_left;
lwc_string *corestring_lwc_li;
lwc_string *corestring_lwc_link;
+lwc_string *corestring_lwc_mailto;
lwc_string *corestring_lwc_meta;
lwc_string *corestring_lwc_middle;
lwc_string *corestring_lwc_multipart_form_data;
@@ -345,6 +346,7 @@ void corestrings_fini(void)
CSS_LWC_STRING_UNREF(left);
CSS_LWC_STRING_UNREF(li);
CSS_LWC_STRING_UNREF(link);
+ CSS_LWC_STRING_UNREF(mailto);
CSS_LWC_STRING_UNREF(meta);
CSS_LWC_STRING_UNREF(middle);
CSS_LWC_STRING_UNREF(multipart_form_data);
@@ -643,6 +645,7 @@ nserror corestrings_init(void)
CSS_LWC_STRING_INTERN(left);
CSS_LWC_STRING_INTERN(li);
CSS_LWC_STRING_INTERN(link);
+ CSS_LWC_STRING_INTERN(mailto);
CSS_LWC_STRING_INTERN(meta);
CSS_LWC_STRING_INTERN(middle);
CSS_LWC_STRING_INTERN(no);
diff --git a/utils/corestrings.h b/utils/corestrings.h
index 4913e73..280098b 100644
--- a/utils/corestrings.h
+++ b/utils/corestrings.h
@@ -84,6 +84,7 @@ extern lwc_string *corestring_lwc_justify;
extern lwc_string *corestring_lwc_left;
extern lwc_string *corestring_lwc_li;
extern lwc_string *corestring_lwc_link;
+extern lwc_string *corestring_lwc_mailto;
extern lwc_string *corestring_lwc_meta;
extern lwc_string *corestring_lwc_middle;
extern lwc_string *corestring_lwc_multipart_form_data; /* multipart/form-data */
--
NetSurf Browser
7 years, 8 months
libdom: branch master updated. release/0.2.0-2-g295927e
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libdom.git/shortlog/295927e1c6a3ce6a17a610...
...commit http://git.netsurf-browser.org/libdom.git/commit/295927e1c6a3ce6a17a610ba...
...tree http://git.netsurf-browser.org/libdom.git/tree/295927e1c6a3ce6a17a610ba21...
The branch, master has been updated
via 295927e1c6a3ce6a17a610ba2176773337de13a7 (commit)
from 29690449912aa85b8b5bbd9a2105b1afd082089d (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=295927e1c6a3ce6a17a6...
commit 295927e1c6a3ce6a17a610ba2176773337de13a7
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Create documents with initial URI of "about:blank".
Clients can set the URI on a document with dom_document_set_uri()
diff --git a/src/core/document.c b/src/core/document.c
index 3d43d7a..4e2bf6b 100644
--- a/src/core/document.c
+++ b/src/core/document.c
@@ -124,25 +124,36 @@ dom_exception _dom_document_initialise(dom_document *doc,
if (err != DOM_NO_ERR)
return err;
+ err = dom_string_create_interned((const uint8_t *) "about:blank",
+ SLEN("about:blank"), &doc->uri);
+ if (err != DOM_NO_ERR) {
+ return err;
+ }
+
doc->nodelists = NULL;
err = _dom_node_initialise(&doc->base, doc, DOM_DOCUMENT_NODE,
name, NULL, NULL, NULL);
dom_string_unref(name);
- if (err != DOM_NO_ERR)
- return err;
+ if (err != DOM_NO_ERR) {
+ dom_string_unref(doc->uri);
+ return err;
+ }
list_init(&doc->pending_nodes);
err = dom_string_create_interned((const uint8_t *) "id",
SLEN("id"), &doc->id_name);
- if (err != DOM_NO_ERR)
+ if (err != DOM_NO_ERR) {
+ dom_string_unref(doc->uri);
return err;
+ }
doc->quirks = DOM_DOCUMENT_QUIRKS_MODE_NONE;
err = dom_string_create_interned((const uint8_t *) "class",
SLEN("class"), &doc->class_string);
if (err != DOM_NO_ERR) {
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
return err;
}
@@ -150,6 +161,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
err = dom_string_create_interned((const uint8_t *) "script",
SLEN("script"), &doc->script_string);
if (err != DOM_NO_ERR) {
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
dom_string_unref(doc->class_string);
return err;
@@ -161,6 +173,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
err = dom_string_create_interned((const uint8_t *) " ", 0,
&doc->_memo_empty);
if (err != DOM_NO_ERR) {
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
dom_string_unref(doc->class_string);
dom_string_unref(doc->script_string);
@@ -172,6 +185,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
&doc->_memo_domnodeinserted);
if (err != DOM_NO_ERR) {
dom_string_unref(doc->_memo_empty);
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
dom_string_unref(doc->class_string);
dom_string_unref(doc->script_string);
@@ -184,6 +198,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
if (err != DOM_NO_ERR) {
dom_string_unref(doc->_memo_domnodeinserted);
dom_string_unref(doc->_memo_empty);
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
dom_string_unref(doc->class_string);
dom_string_unref(doc->script_string);
@@ -197,6 +212,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
dom_string_unref(doc->_memo_domnoderemoved);
dom_string_unref(doc->_memo_domnodeinserted);
dom_string_unref(doc->_memo_empty);
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
dom_string_unref(doc->class_string);
dom_string_unref(doc->script_string);
@@ -211,6 +227,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
dom_string_unref(doc->_memo_domnoderemoved);
dom_string_unref(doc->_memo_domnodeinserted);
dom_string_unref(doc->_memo_empty);
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
dom_string_unref(doc->class_string);
dom_string_unref(doc->script_string);
@@ -226,6 +243,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
dom_string_unref(doc->_memo_domnoderemoved);
dom_string_unref(doc->_memo_domnodeinserted);
dom_string_unref(doc->_memo_empty);
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
dom_string_unref(doc->class_string);
dom_string_unref(doc->script_string);
@@ -242,6 +260,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
dom_string_unref(doc->_memo_domnoderemoved);
dom_string_unref(doc->_memo_domnodeinserted);
dom_string_unref(doc->_memo_empty);
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
dom_string_unref(doc->class_string);
dom_string_unref(doc->script_string);
@@ -259,6 +278,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
dom_string_unref(doc->_memo_domnoderemoved);
dom_string_unref(doc->_memo_domnodeinserted);
dom_string_unref(doc->_memo_empty);
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
dom_string_unref(doc->class_string);
dom_string_unref(doc->script_string);
-----------------------------------------------------------------------
Summary of changes:
src/core/document.c | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/src/core/document.c b/src/core/document.c
index 3d43d7a..4e2bf6b 100644
--- a/src/core/document.c
+++ b/src/core/document.c
@@ -124,25 +124,36 @@ dom_exception _dom_document_initialise(dom_document *doc,
if (err != DOM_NO_ERR)
return err;
+ err = dom_string_create_interned((const uint8_t *) "about:blank",
+ SLEN("about:blank"), &doc->uri);
+ if (err != DOM_NO_ERR) {
+ return err;
+ }
+
doc->nodelists = NULL;
err = _dom_node_initialise(&doc->base, doc, DOM_DOCUMENT_NODE,
name, NULL, NULL, NULL);
dom_string_unref(name);
- if (err != DOM_NO_ERR)
- return err;
+ if (err != DOM_NO_ERR) {
+ dom_string_unref(doc->uri);
+ return err;
+ }
list_init(&doc->pending_nodes);
err = dom_string_create_interned((const uint8_t *) "id",
SLEN("id"), &doc->id_name);
- if (err != DOM_NO_ERR)
+ if (err != DOM_NO_ERR) {
+ dom_string_unref(doc->uri);
return err;
+ }
doc->quirks = DOM_DOCUMENT_QUIRKS_MODE_NONE;
err = dom_string_create_interned((const uint8_t *) "class",
SLEN("class"), &doc->class_string);
if (err != DOM_NO_ERR) {
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
return err;
}
@@ -150,6 +161,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
err = dom_string_create_interned((const uint8_t *) "script",
SLEN("script"), &doc->script_string);
if (err != DOM_NO_ERR) {
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
dom_string_unref(doc->class_string);
return err;
@@ -161,6 +173,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
err = dom_string_create_interned((const uint8_t *) " ", 0,
&doc->_memo_empty);
if (err != DOM_NO_ERR) {
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
dom_string_unref(doc->class_string);
dom_string_unref(doc->script_string);
@@ -172,6 +185,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
&doc->_memo_domnodeinserted);
if (err != DOM_NO_ERR) {
dom_string_unref(doc->_memo_empty);
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
dom_string_unref(doc->class_string);
dom_string_unref(doc->script_string);
@@ -184,6 +198,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
if (err != DOM_NO_ERR) {
dom_string_unref(doc->_memo_domnodeinserted);
dom_string_unref(doc->_memo_empty);
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
dom_string_unref(doc->class_string);
dom_string_unref(doc->script_string);
@@ -197,6 +212,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
dom_string_unref(doc->_memo_domnoderemoved);
dom_string_unref(doc->_memo_domnodeinserted);
dom_string_unref(doc->_memo_empty);
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
dom_string_unref(doc->class_string);
dom_string_unref(doc->script_string);
@@ -211,6 +227,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
dom_string_unref(doc->_memo_domnoderemoved);
dom_string_unref(doc->_memo_domnodeinserted);
dom_string_unref(doc->_memo_empty);
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
dom_string_unref(doc->class_string);
dom_string_unref(doc->script_string);
@@ -226,6 +243,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
dom_string_unref(doc->_memo_domnoderemoved);
dom_string_unref(doc->_memo_domnodeinserted);
dom_string_unref(doc->_memo_empty);
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
dom_string_unref(doc->class_string);
dom_string_unref(doc->script_string);
@@ -242,6 +260,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
dom_string_unref(doc->_memo_domnoderemoved);
dom_string_unref(doc->_memo_domnodeinserted);
dom_string_unref(doc->_memo_empty);
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
dom_string_unref(doc->class_string);
dom_string_unref(doc->script_string);
@@ -259,6 +278,7 @@ dom_exception _dom_document_initialise(dom_document *doc,
dom_string_unref(doc->_memo_domnoderemoved);
dom_string_unref(doc->_memo_domnodeinserted);
dom_string_unref(doc->_memo_empty);
+ dom_string_unref(doc->uri);
dom_string_unref(doc->id_name);
dom_string_unref(doc->class_string);
dom_string_unref(doc->script_string);
--
Document Object Model library
7 years, 8 months