netsurf: branch master updated. c48d7fa2da7331c482fe5e2298d2a08aa41de7d9
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/c48d7fa2da7331c482fe5...
...commit http://git.netsurf-browser.org/netsurf.git/commit/c48d7fa2da7331c482fe5e2...
...tree http://git.netsurf-browser.org/netsurf.git/tree/c48d7fa2da7331c482fe5e229...
The branch, master has been updated
via c48d7fa2da7331c482fe5e2298d2a08aa41de7d9 (commit)
from 8ac36b64b148d4f053c1e0ad4d132a0d0e604daa (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/commitdiff/c48d7fa2da7331c482f...
commit c48d7fa2da7331c482fe5e2298d2a08aa41de7d9
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
missing 'defined'
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index 2790628..2d65099 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -610,7 +610,7 @@ void ami_gui_opts_open(void)
LABEL_Text, gadlab[GID_OPTS_HISTORY],
LabelEnd,
LayoutEnd, // history
-#if defined(WITH_JS) || (WITH_MOZJS)
+#if defined(WITH_JS) || defined(WITH_MOZJS)
LAYOUT_AddChild, VGroupObject,
LAYOUT_SpaceOuter, TRUE,
LAYOUT_BevelStyle, BVS_GROUP,
@@ -1473,7 +1473,7 @@ void ami_gui_opts_use(bool save)
nsoption_set_bool(send_referer, false);
}
-#if defined(WITH_JS) || (WITH_MOZJS)
+#if defined(WITH_JS) || defined(WITH_MOZJS)
GetAttr(GA_Selected,gow->objects[GID_OPTS_JAVASCRIPT],(ULONG *)&data);
if (data) {
nsoption_set_bool(enable_javascript, true);
-----------------------------------------------------------------------
Summary of changes:
amiga/gui_options.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index 2790628..2d65099 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -610,7 +610,7 @@ void ami_gui_opts_open(void)
LABEL_Text, gadlab[GID_OPTS_HISTORY],
LabelEnd,
LayoutEnd, // history
-#if defined(WITH_JS) || (WITH_MOZJS)
+#if defined(WITH_JS) || defined(WITH_MOZJS)
LAYOUT_AddChild, VGroupObject,
LAYOUT_SpaceOuter, TRUE,
LAYOUT_BevelStyle, BVS_GROUP,
@@ -1473,7 +1473,7 @@ void ami_gui_opts_use(bool save)
nsoption_set_bool(send_referer, false);
}
-#if defined(WITH_JS) || (WITH_MOZJS)
+#if defined(WITH_JS) || defined(WITH_MOZJS)
GetAttr(GA_Selected,gow->objects[GID_OPTS_JAVASCRIPT],(ULONG *)&data);
if (data) {
nsoption_set_bool(enable_javascript, true);
--
NetSurf Browser
10 years, 6 months
netsurf: branch master updated. 8ac36b64b148d4f053c1e0ad4d132a0d0e604daa
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/8ac36b64b148d4f053c1e...
...commit http://git.netsurf-browser.org/netsurf.git/commit/8ac36b64b148d4f053c1e0a...
...tree http://git.netsurf-browser.org/netsurf.git/tree/8ac36b64b148d4f053c1e0ad4...
The branch, master has been updated
via 8ac36b64b148d4f053c1e0ad4d132a0d0e604daa (commit)
from dfef1d6fde95891089225570d44fc79b8c738989 (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/commitdiff/8ac36b64b148d4f053c...
commit 8ac36b64b148d4f053c1e0ad4d132a0d0e604daa
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Add a GUI option to enable/disable Javascript, if NetSurf is built with Javascript support.
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index d4a43c6..2790628 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -77,6 +77,7 @@ enum
GID_OPTS_CONTENTLANG,
GID_OPTS_FROMLOCALE,
GID_OPTS_HISTORY,
+ GID_OPTS_JAVASCRIPT,
GID_OPTS_REFERRAL,
GID_OPTS_DONOTTRACK,
GID_OPTS_FASTSCROLL,
@@ -144,6 +145,7 @@ enum
GRP_OPTS_CONTENTBLOCKING,
GRP_OPTS_CONTENTLANGUAGE,
GRP_OPTS_HISTORY,
+ GRP_OPTS_SCRIPTING,
GRP_OPTS_PRIVACY,
GRP_OPTS_MISC,
GRP_OPTS_SCREEN,
@@ -249,6 +251,7 @@ void ami_gui_opts_setup(void)
gadlab[GID_OPTS_HIDEADS] = (char *)ami_utf8_easy((char *)messages_get("BlockAds"));
gadlab[GID_OPTS_FROMLOCALE] = (char *)ami_utf8_easy((char *)messages_get("LocaleLang"));
gadlab[GID_OPTS_HISTORY] = (char *)ami_utf8_easy((char *)messages_get("HistoryAge"));
+ gadlab[GID_OPTS_JAVASCRIPT] = (char *)ami_utf8_easy((char *)messages_get("EnableJS"));
gadlab[GID_OPTS_REFERRAL] = (char *)ami_utf8_easy((char *)messages_get("SendReferer"));
gadlab[GID_OPTS_DONOTTRACK] = (char *)ami_utf8_easy((char *)messages_get("DoNotTrack"));
gadlab[GID_OPTS_FASTSCROLL] = (char *)ami_utf8_easy((char *)messages_get("FastScrolling"));
@@ -316,6 +319,7 @@ void ami_gui_opts_setup(void)
gadlab[GRP_OPTS_CONTENTBLOCKING] = (char *)ami_utf8_easy((char *)messages_get("ContentBlocking"));
gadlab[GRP_OPTS_CONTENTLANGUAGE] = (char *)ami_utf8_easy((char *)messages_get("ContentLanguage"));
gadlab[GRP_OPTS_HISTORY] = (char *)ami_utf8_easy((char *)messages_get("History"));
+ gadlab[GRP_OPTS_SCRIPTING] = (char *)ami_utf8_easy((char *)messages_get("Scripting"));
gadlab[GRP_OPTS_MISC] = (char *)ami_utf8_easy((char *)messages_get("Miscellaneous"));
gadlab[GRP_OPTS_SCREEN] = (char *)ami_utf8_easy((char *)messages_get("Screen"));
gadlab[GRP_OPTS_THEME] = (char *)ami_utf8_easy((char *)messages_get("Theme"));
@@ -581,30 +585,45 @@ void ami_gui_opts_open(void)
// CHILD_WeightedWidth, 0,
LayoutEnd, // content language
LayoutEnd, // content
- LAYOUT_AddChild, VGroupObject,
- LAYOUT_SpaceOuter, TRUE,
- LAYOUT_BevelStyle, BVS_GROUP,
- LAYOUT_Label, gadlab[GRP_OPTS_HISTORY],
- LAYOUT_AddChild, HGroupObject,
- LAYOUT_LabelColumn, PLACETEXT_RIGHT,
- LAYOUT_AddChild, gow->objects[GID_OPTS_HISTORY] = IntegerObject,
- GA_ID, GID_OPTS_CACHE_DISC,
- GA_RelVerify, TRUE,
- INTEGER_Number, nsoption_int(expire_url),
- INTEGER_Minimum, 0,
- INTEGER_Maximum, 366,
- INTEGER_Arrows, TRUE,
- IntegerEnd,
+ LAYOUT_AddChild, HGroupObject,
+ LAYOUT_AddChild, VGroupObject,
+ LAYOUT_SpaceOuter, TRUE,
+ LAYOUT_BevelStyle, BVS_GROUP,
+ LAYOUT_Label, gadlab[GRP_OPTS_HISTORY],
+ LAYOUT_AddChild, HGroupObject,
+ LAYOUT_LabelColumn, PLACETEXT_RIGHT,
+ LAYOUT_AddChild, gow->objects[GID_OPTS_HISTORY] = IntegerObject,
+ GA_ID, GID_OPTS_HISTORY,
+ GA_RelVerify, TRUE,
+ INTEGER_Number, nsoption_int(expire_url),
+ INTEGER_Minimum, 0,
+ INTEGER_Maximum, 366,
+ INTEGER_Arrows, TRUE,
+ IntegerEnd,
+ CHILD_WeightedWidth, 0,
+ CHILD_Label, LabelObject,
+ LABEL_Text, gadlab[LAB_OPTS_DAYS],
+ LabelEnd,
+ LayoutEnd,
CHILD_WeightedWidth, 0,
- CHILD_Label, LabelObject,
- LABEL_Text, gadlab[LAB_OPTS_DAYS],
- LabelEnd,
- LayoutEnd,
- CHILD_WeightedWidth, 0,
- CHILD_Label, LabelObject,
- LABEL_Text, gadlab[GID_OPTS_HISTORY],
- LabelEnd,
- LayoutEnd, // history
+ CHILD_Label, LabelObject,
+ LABEL_Text, gadlab[GID_OPTS_HISTORY],
+ LabelEnd,
+ LayoutEnd, // history
+#if defined(WITH_JS) || (WITH_MOZJS)
+ LAYOUT_AddChild, VGroupObject,
+ LAYOUT_SpaceOuter, TRUE,
+ LAYOUT_BevelStyle, BVS_GROUP,
+ LAYOUT_Label, gadlab[GRP_OPTS_SCRIPTING],
+ LAYOUT_AddChild, gow->objects[GID_OPTS_JAVASCRIPT] = CheckBoxObject,
+ GA_ID, GID_OPTS_JAVASCRIPT,
+ GA_RelVerify, TRUE,
+ GA_Text, gadlab[GID_OPTS_JAVASCRIPT],
+ GA_Selected, nsoption_bool(enable_javascript),
+ CheckBoxEnd,
+ LayoutEnd, // scripting
+#endif
+ LayoutEnd,
CHILD_WeightedHeight, 0,
LAYOUT_AddChild,VGroupObject,
LAYOUT_SpaceOuter, TRUE,
@@ -1454,6 +1473,15 @@ void ami_gui_opts_use(bool save)
nsoption_set_bool(send_referer, false);
}
+#if defined(WITH_JS) || (WITH_MOZJS)
+ GetAttr(GA_Selected,gow->objects[GID_OPTS_JAVASCRIPT],(ULONG *)&data);
+ if (data) {
+ nsoption_set_bool(enable_javascript, true);
+ } else {
+ nsoption_set_bool(enable_javascript, false);
+ }
+#endif
+
GetAttr(GA_Selected,gow->objects[GID_OPTS_DONOTTRACK],(ULONG *)&data);
if (data) {
nsoption_set_bool(do_not_track, true);
diff --git a/resources/FatMessages b/resources/FatMessages
index bfbb6f0..640654b 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -5201,6 +5201,16 @@ de.all.Days:Tage
fr.all.Days:days
it.all.Days:giorni
nl.all.Days:days
+en.all.Scripting:Scripting
+de.all.Scripting:Scripting
+fr.all.Scripting:Scripting
+it.all.Scripting:Scripting
+nl.all.Scripting:Scripting
+en.all.EnableJS:Enable Javascript
+de.all.EnableJS:Enable Javascript
+fr.all.EnableJS:Enable Javascript
+it.all.EnableJS:Enable Javascript
+nl.all.EnableJS:Enable Javascript
en.all.Miscellaneous:Miscellaneous
de.all.Miscellaneous:Verschiedenes
fr.all.Miscellaneous:Miscellaneous
-----------------------------------------------------------------------
Summary of changes:
amiga/gui_options.c | 74 +++++++++++++++++++++++++++++++++---------------
resources/FatMessages | 10 ++++++
2 files changed, 61 insertions(+), 23 deletions(-)
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index d4a43c6..2790628 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -77,6 +77,7 @@ enum
GID_OPTS_CONTENTLANG,
GID_OPTS_FROMLOCALE,
GID_OPTS_HISTORY,
+ GID_OPTS_JAVASCRIPT,
GID_OPTS_REFERRAL,
GID_OPTS_DONOTTRACK,
GID_OPTS_FASTSCROLL,
@@ -144,6 +145,7 @@ enum
GRP_OPTS_CONTENTBLOCKING,
GRP_OPTS_CONTENTLANGUAGE,
GRP_OPTS_HISTORY,
+ GRP_OPTS_SCRIPTING,
GRP_OPTS_PRIVACY,
GRP_OPTS_MISC,
GRP_OPTS_SCREEN,
@@ -249,6 +251,7 @@ void ami_gui_opts_setup(void)
gadlab[GID_OPTS_HIDEADS] = (char *)ami_utf8_easy((char *)messages_get("BlockAds"));
gadlab[GID_OPTS_FROMLOCALE] = (char *)ami_utf8_easy((char *)messages_get("LocaleLang"));
gadlab[GID_OPTS_HISTORY] = (char *)ami_utf8_easy((char *)messages_get("HistoryAge"));
+ gadlab[GID_OPTS_JAVASCRIPT] = (char *)ami_utf8_easy((char *)messages_get("EnableJS"));
gadlab[GID_OPTS_REFERRAL] = (char *)ami_utf8_easy((char *)messages_get("SendReferer"));
gadlab[GID_OPTS_DONOTTRACK] = (char *)ami_utf8_easy((char *)messages_get("DoNotTrack"));
gadlab[GID_OPTS_FASTSCROLL] = (char *)ami_utf8_easy((char *)messages_get("FastScrolling"));
@@ -316,6 +319,7 @@ void ami_gui_opts_setup(void)
gadlab[GRP_OPTS_CONTENTBLOCKING] = (char *)ami_utf8_easy((char *)messages_get("ContentBlocking"));
gadlab[GRP_OPTS_CONTENTLANGUAGE] = (char *)ami_utf8_easy((char *)messages_get("ContentLanguage"));
gadlab[GRP_OPTS_HISTORY] = (char *)ami_utf8_easy((char *)messages_get("History"));
+ gadlab[GRP_OPTS_SCRIPTING] = (char *)ami_utf8_easy((char *)messages_get("Scripting"));
gadlab[GRP_OPTS_MISC] = (char *)ami_utf8_easy((char *)messages_get("Miscellaneous"));
gadlab[GRP_OPTS_SCREEN] = (char *)ami_utf8_easy((char *)messages_get("Screen"));
gadlab[GRP_OPTS_THEME] = (char *)ami_utf8_easy((char *)messages_get("Theme"));
@@ -581,30 +585,45 @@ void ami_gui_opts_open(void)
// CHILD_WeightedWidth, 0,
LayoutEnd, // content language
LayoutEnd, // content
- LAYOUT_AddChild, VGroupObject,
- LAYOUT_SpaceOuter, TRUE,
- LAYOUT_BevelStyle, BVS_GROUP,
- LAYOUT_Label, gadlab[GRP_OPTS_HISTORY],
- LAYOUT_AddChild, HGroupObject,
- LAYOUT_LabelColumn, PLACETEXT_RIGHT,
- LAYOUT_AddChild, gow->objects[GID_OPTS_HISTORY] = IntegerObject,
- GA_ID, GID_OPTS_CACHE_DISC,
- GA_RelVerify, TRUE,
- INTEGER_Number, nsoption_int(expire_url),
- INTEGER_Minimum, 0,
- INTEGER_Maximum, 366,
- INTEGER_Arrows, TRUE,
- IntegerEnd,
+ LAYOUT_AddChild, HGroupObject,
+ LAYOUT_AddChild, VGroupObject,
+ LAYOUT_SpaceOuter, TRUE,
+ LAYOUT_BevelStyle, BVS_GROUP,
+ LAYOUT_Label, gadlab[GRP_OPTS_HISTORY],
+ LAYOUT_AddChild, HGroupObject,
+ LAYOUT_LabelColumn, PLACETEXT_RIGHT,
+ LAYOUT_AddChild, gow->objects[GID_OPTS_HISTORY] = IntegerObject,
+ GA_ID, GID_OPTS_HISTORY,
+ GA_RelVerify, TRUE,
+ INTEGER_Number, nsoption_int(expire_url),
+ INTEGER_Minimum, 0,
+ INTEGER_Maximum, 366,
+ INTEGER_Arrows, TRUE,
+ IntegerEnd,
+ CHILD_WeightedWidth, 0,
+ CHILD_Label, LabelObject,
+ LABEL_Text, gadlab[LAB_OPTS_DAYS],
+ LabelEnd,
+ LayoutEnd,
CHILD_WeightedWidth, 0,
- CHILD_Label, LabelObject,
- LABEL_Text, gadlab[LAB_OPTS_DAYS],
- LabelEnd,
- LayoutEnd,
- CHILD_WeightedWidth, 0,
- CHILD_Label, LabelObject,
- LABEL_Text, gadlab[GID_OPTS_HISTORY],
- LabelEnd,
- LayoutEnd, // history
+ CHILD_Label, LabelObject,
+ LABEL_Text, gadlab[GID_OPTS_HISTORY],
+ LabelEnd,
+ LayoutEnd, // history
+#if defined(WITH_JS) || (WITH_MOZJS)
+ LAYOUT_AddChild, VGroupObject,
+ LAYOUT_SpaceOuter, TRUE,
+ LAYOUT_BevelStyle, BVS_GROUP,
+ LAYOUT_Label, gadlab[GRP_OPTS_SCRIPTING],
+ LAYOUT_AddChild, gow->objects[GID_OPTS_JAVASCRIPT] = CheckBoxObject,
+ GA_ID, GID_OPTS_JAVASCRIPT,
+ GA_RelVerify, TRUE,
+ GA_Text, gadlab[GID_OPTS_JAVASCRIPT],
+ GA_Selected, nsoption_bool(enable_javascript),
+ CheckBoxEnd,
+ LayoutEnd, // scripting
+#endif
+ LayoutEnd,
CHILD_WeightedHeight, 0,
LAYOUT_AddChild,VGroupObject,
LAYOUT_SpaceOuter, TRUE,
@@ -1454,6 +1473,15 @@ void ami_gui_opts_use(bool save)
nsoption_set_bool(send_referer, false);
}
+#if defined(WITH_JS) || (WITH_MOZJS)
+ GetAttr(GA_Selected,gow->objects[GID_OPTS_JAVASCRIPT],(ULONG *)&data);
+ if (data) {
+ nsoption_set_bool(enable_javascript, true);
+ } else {
+ nsoption_set_bool(enable_javascript, false);
+ }
+#endif
+
GetAttr(GA_Selected,gow->objects[GID_OPTS_DONOTTRACK],(ULONG *)&data);
if (data) {
nsoption_set_bool(do_not_track, true);
diff --git a/resources/FatMessages b/resources/FatMessages
index bfbb6f0..640654b 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -5201,6 +5201,16 @@ de.all.Days:Tage
fr.all.Days:days
it.all.Days:giorni
nl.all.Days:days
+en.all.Scripting:Scripting
+de.all.Scripting:Scripting
+fr.all.Scripting:Scripting
+it.all.Scripting:Scripting
+nl.all.Scripting:Scripting
+en.all.EnableJS:Enable Javascript
+de.all.EnableJS:Enable Javascript
+fr.all.EnableJS:Enable Javascript
+it.all.EnableJS:Enable Javascript
+nl.all.EnableJS:Enable Javascript
en.all.Miscellaneous:Miscellaneous
de.all.Miscellaneous:Verschiedenes
fr.all.Miscellaneous:Miscellaneous
--
NetSurf Browser
10 years, 6 months
netsurf: branch master updated. dfef1d6fde95891089225570d44fc79b8c738989
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/dfef1d6fde95891089225...
...commit http://git.netsurf-browser.org/netsurf.git/commit/dfef1d6fde9589108922557...
...tree http://git.netsurf-browser.org/netsurf.git/tree/dfef1d6fde95891089225570d...
The branch, master has been updated
via dfef1d6fde95891089225570d44fc79b8c738989 (commit)
from 72fe92d9ca0d3ba06c56cc258575e42102d502c6 (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/commitdiff/dfef1d6fde958910892...
commit dfef1d6fde95891089225570d44fc79b8c738989
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Use requester.class directly, so we can get requesters to appear on NetSurf's screen. Untested.
diff --git a/amiga/misc.c b/amiga/misc.c
index affb651..8e8fa76 100755
--- a/amiga/misc.c
+++ b/amiga/misc.c
@@ -23,7 +23,14 @@
#include <sys/types.h>
#include <proto/dos.h>
+#include <proto/exec.h>
+#include <proto/intuition.h>
+#include <proto/utility.h>
+#include <proto/requester.h>
+#include <classes/requester.h>
+
+#include "amiga/gui.h"
#include "amiga/utf8.h"
#include "desktop/cookies.h"
#include "utils/log.h"
@@ -33,19 +40,34 @@
void warn_user(const char *warning, const char *detail)
{
+ Object *req = NULL;
char *utf8warning = ami_utf8_easy(messages_get(warning));
+ STRPTR bodytext = NULL;
+ LONG result = 0;
LOG(("%s %s", warning, detail));
- TimedDosRequesterTags(TDR_ImageType,TDRIMAGE_WARNING,
- TDR_TitleString,messages_get("NetSurf"),
- TDR_GadgetString,messages_get("OK"),
-// TDR_CharSet,106,
- TDR_FormatString,"%s\n%s",
- TDR_Arg1,utf8warning != NULL ? utf8warning : warning,
- TDR_Arg2,detail,
- TAG_DONE);
+ bodytext = ASPrintf("\33b%s\33n\n%s",
+ utf8warning != NULL ? utf8warning : warning, detail);
+
+ req = NewObject(REQUESTER_GetClass(), NULL,
+ REQ_Type, REQTYPE_INFO,
+ REQ_TitleText, messages_get("NetSurf"),
+ REQ_BodyText, bodytext,
+ REQ_GadgetText, messages_get("OK"),
+#ifdef __amigaos4__
+ REQ_VarArgs,
+ REQ_Image, (struct Image *)REQIMAGE_WARNING,
+ /* REQ_CharSet, 106, */
+#endif
+ TAG_DONE);
+
+ if (req) {
+ result = IDoMethod(req, RM_OPENREQ, NULL, NULL, scrn);
+ DisposeObject(req);
+ }
+ if(bodytext) FreeVec(bodytext);
if(utf8warning) free(utf8warning);
}
-----------------------------------------------------------------------
Summary of changes:
amiga/misc.c | 38 ++++++++++++++++++++++++++++++--------
1 files changed, 30 insertions(+), 8 deletions(-)
diff --git a/amiga/misc.c b/amiga/misc.c
index affb651..8e8fa76 100755
--- a/amiga/misc.c
+++ b/amiga/misc.c
@@ -23,7 +23,14 @@
#include <sys/types.h>
#include <proto/dos.h>
+#include <proto/exec.h>
+#include <proto/intuition.h>
+#include <proto/utility.h>
+#include <proto/requester.h>
+#include <classes/requester.h>
+
+#include "amiga/gui.h"
#include "amiga/utf8.h"
#include "desktop/cookies.h"
#include "utils/log.h"
@@ -33,19 +40,34 @@
void warn_user(const char *warning, const char *detail)
{
+ Object *req = NULL;
char *utf8warning = ami_utf8_easy(messages_get(warning));
+ STRPTR bodytext = NULL;
+ LONG result = 0;
LOG(("%s %s", warning, detail));
- TimedDosRequesterTags(TDR_ImageType,TDRIMAGE_WARNING,
- TDR_TitleString,messages_get("NetSurf"),
- TDR_GadgetString,messages_get("OK"),
-// TDR_CharSet,106,
- TDR_FormatString,"%s\n%s",
- TDR_Arg1,utf8warning != NULL ? utf8warning : warning,
- TDR_Arg2,detail,
- TAG_DONE);
+ bodytext = ASPrintf("\33b%s\33n\n%s",
+ utf8warning != NULL ? utf8warning : warning, detail);
+
+ req = NewObject(REQUESTER_GetClass(), NULL,
+ REQ_Type, REQTYPE_INFO,
+ REQ_TitleText, messages_get("NetSurf"),
+ REQ_BodyText, bodytext,
+ REQ_GadgetText, messages_get("OK"),
+#ifdef __amigaos4__
+ REQ_VarArgs,
+ REQ_Image, (struct Image *)REQIMAGE_WARNING,
+ /* REQ_CharSet, 106, */
+#endif
+ TAG_DONE);
+
+ if (req) {
+ result = IDoMethod(req, RM_OPENREQ, NULL, NULL, scrn);
+ DisposeObject(req);
+ }
+ if(bodytext) FreeVec(bodytext);
if(utf8warning) free(utf8warning);
}
--
NetSurf Browser
10 years, 6 months
libdom: branch master updated. af0e4892995a00aa35f7c288bfba45bdd507dc4c
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libdom.git/shortlog/af0e4892995a00aa35f7c2...
...commit http://git.netsurf-browser.org/libdom.git/commit/af0e4892995a00aa35f7c288...
...tree http://git.netsurf-browser.org/libdom.git/tree/af0e4892995a00aa35f7c288bf...
The branch, master has been updated
via af0e4892995a00aa35f7c288bfba45bdd507dc4c (commit)
via d316c5d1a09406b63cc5b5754726007882e6360d (commit)
via bce4040985c2c1d43a46b670d857024b0536aabe (commit)
via b7ffc2f9d408cd683ba8a8f0283397e73f88c531 (commit)
via 7ca9105673b0360b62a1c144db0fe90aa5b9164f (commit)
via 1f4cf0d70ae1f082c3bf7f08fabc70a40dd0848a (commit)
via 303419d1000e74db54b7d143ce1d49dc4c3632c9 (commit)
from 8bef33b1005ea97359a71786a84912c42edf97bb (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/commitdiff/af0e4892995a00aa35f7...
commit af0e4892995a00aa35f7c288bfba45bdd507dc4c
Merge: d316c5d 8bef33b
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Merge branch 'master' of git://git.netsurf-browser.org/libdom into chris/amiga-hubbub-lib-compat
-----------------------------------------------------------------------
Summary of changes:
bindings/hubbub/parser.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/bindings/hubbub/parser.c b/bindings/hubbub/parser.c
index 6299da5..9bbf131 100644
--- a/bindings/hubbub/parser.c
+++ b/bindings/hubbub/parser.c
@@ -658,8 +658,8 @@ static hubbub_tree_handler tree_handler = {
add_attributes,
set_quirks_mode,
change_encoding,
- complete_script,
- NULL
+ NULL,
+ complete_script
};
/**
--
Document Object Model library
10 years, 6 months
netsurf: branch vince/script-async created. d63ed30a815d700b1a6889b9fec58e60561f506f
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/d63ed30a815d700b1a688...
...commit http://git.netsurf-browser.org/netsurf.git/commit/d63ed30a815d700b1a6889b...
...tree http://git.netsurf-browser.org/netsurf.git/tree/d63ed30a815d700b1a6889b9f...
The branch, vince/script-async has been created
at d63ed30a815d700b1a6889b9fec58e60561f506f (commit)
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commitdiff/d63ed30a815d700b1a6...
commit d63ed30a815d700b1a6889b9fec58e60561f506f
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
current wip on adding syncronous interpretation
diff --git a/render/html_script.c b/render/html_script.c
index e3075f6..379fb39 100644
--- a/render/html_script.c
+++ b/render/html_script.c
@@ -227,7 +227,25 @@ exec_src_script(html_content *c,
struct html_script *nscript;
union content_msg_data msg_data;
- //exc = dom_element_has_attribute(node, html_dom_string_async, &async);
+ /* there are three ways to precess the script tag at this point:
+
+ * Syncronously pause the parent parse and continue after
+ * the script has downloaded and executed. (default)
+ * Defered Start the script downloading and execute it when
+ * the page has completed parsing
+ * Async Start the script downloading and execute it when it
+ * becomes available.
+ */
+
+ /* we interpret the presence of the async and defer attribute
+ * as true and ignore its value, technically only the empty
+ * value or the attribute name itself are valid. However
+ * various browsers interpret this in various ways the most
+ * compatible approach is to be liberal and accept any
+ * value
+ */
+ exc = dom_element_has_attribute(node, html_dom_string_async, &async);
+ exc = dom_element_has_attribute(node, html_dom_string_async, &defer);
nscript = html_process_new_script(c, HTML_SCRIPT_SYNC);
if (nscript == NULL) {
commitdiff http://git.netsurf-browser.org/netsurf.git/commitdiff/0b493a680b374b18669...
commit 0b493a680b374b18669881353979198a5f83ec38
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
rename and extend script enum to represent the four types we require
diff --git a/render/html.c b/render/html.c
index 759c244..2367529 100644
--- a/render/html.c
+++ b/render/html.c
@@ -2433,21 +2433,7 @@ static void html_destroy(struct content *c)
}
/* Free scripts */
- for (i = 0; i != html->scripts_count; i++) {
- if (html->scripts[i].mimetype != NULL) {
- dom_string_unref(html->scripts[i].mimetype);
- }
- if (html->scripts[i].type == HTML_SCRIPT_EXTERNAL &&
- html->scripts[i].data.external != NULL) {
- hlcache_handle_release(
- html->scripts[i].data.external);
- } else if (html->scripts[i].type ==
- HTML_SCRIPT_INTERNAL &&
- html->scripts[i].data.internal != NULL) {
- dom_string_unref(html->scripts[i].data.internal);
- }
- }
- free(html->scripts);
+ html_free_scripts(html);
/* Free objects */
html_destroy_objects(html);
diff --git a/render/html.h b/render/html.h
index 64548f8..dcbc1a3 100644
--- a/render/html.h
+++ b/render/html.h
@@ -66,10 +66,13 @@ struct html_stylesheet {
*/
struct html_script {
/** Type of script */
- enum html_script_type { HTML_SCRIPT_EXTERNAL, HTML_SCRIPT_INTERNAL } type;
+ enum html_script_type { HTML_SCRIPT_INLINE,
+ HTML_SCRIPT_SYNC,
+ HTML_SCRIPT_DEFER,
+ HTML_SCRIPT_ASYNC } type;
union {
- struct hlcache_handle *external;
- struct dom_string *internal;
+ struct hlcache_handle *handle;
+ struct dom_string *string;
} data; /**< Script data */
struct dom_string *mimetype;
struct dom_string *encoding;
@@ -175,9 +178,9 @@ struct content_html_frames *html_get_frameset(struct hlcache_handle *h);
struct content_html_iframe *html_get_iframe(struct hlcache_handle *h);
nsurl *html_get_base_url(struct hlcache_handle *h);
const char *html_get_base_target(struct hlcache_handle *h);
-struct html_stylesheet *html_get_stylesheets(struct hlcache_handle *h,
+struct html_stylesheet *html_get_stylesheets(struct hlcache_handle *h,
unsigned int *n);
-struct content_html_object *html_get_objects(struct hlcache_handle *h,
+struct content_html_object *html_get_objects(struct hlcache_handle *h,
unsigned int *n);
bool html_get_id_offset(struct hlcache_handle *h, lwc_string *frag_id,
int *x, int *y);
diff --git a/render/html_internal.h b/render/html_internal.h
index ad032f7..3eabe1c 100644
--- a/render/html_internal.h
+++ b/render/html_internal.h
@@ -149,6 +149,7 @@ void html_overflow_scroll_callback(void *client_data,
/* in render/html_script.c */
dom_hubbub_error html_process_script(void *ctx, dom_node *node);
+void html_free_scripts(html_content *html);
/* in render/html_forms.c */
struct form *html_forms_get_forms(const char *docenc, dom_html_document *doc);
diff --git a/render/html_script.c b/render/html_script.c
index fb51256..e3075f6 100644
--- a/render/html_script.c
+++ b/render/html_script.c
@@ -69,32 +69,32 @@ static bool html_scripts_exec(html_content *c)
continue;
}
- assert((s->type == HTML_SCRIPT_EXTERNAL) ||
- (s->type == HTML_SCRIPT_INTERNAL));
+ assert((s->type == HTML_SCRIPT_SYNC) ||
+ (s->type == HTML_SCRIPT_INLINE));
- if (s->type == HTML_SCRIPT_EXTERNAL) {
+ if (s->type == HTML_SCRIPT_SYNC) {
/* ensure script content is present */
- if (s->data.external == NULL)
+ if (s->data.handle == NULL)
continue;
/* ensure script content fetch status is not an error */
- if (content_get_status(s->data.external) ==
+ if (content_get_status(s->data.handle) ==
CONTENT_STATUS_ERROR)
continue;
/* ensure script handler for content type */
script_handler = select_script_handler(
- content_get_type(s->data.external));
+ content_get_type(s->data.handle));
if (script_handler == NULL)
continue; /* unsupported type */
- if (content_get_status(s->data.external) ==
+ if (content_get_status(s->data.handle) ==
CONTENT_STATUS_DONE) {
/* external script is now available */
const char *data;
unsigned long size;
data = content_get_source_data(
- s->data.external, &size );
+ s->data.handle, &size );
script_handler(c->jscontext, data, size);
s->already_started = true;
@@ -158,8 +158,7 @@ convert_script_async_cb(hlcache_handle *script,
/* Find script */
for (i = 0, s = parent->scripts; i != parent->scripts_count; i++, s++) {
- if (s->type == HTML_SCRIPT_EXTERNAL &&
- s->data.external == script)
+ if (s->type == HTML_SCRIPT_ASYNC && s->data.handle == script)
break;
}
@@ -187,7 +186,7 @@ convert_script_async_cb(hlcache_handle *script,
nsurl_access(hlcache_handle_get_url(script)),
event->data.error));
hlcache_handle_release(script);
- s->data.external = NULL;
+ s->data.handle = NULL;
parent->base.active--;
LOG(("%d fetches active", parent->base.active));
content_add_error(&parent->base, "?", 0);
@@ -213,13 +212,13 @@ convert_script_async_cb(hlcache_handle *script,
return NSERROR_OK;
}
-/**
- * process a script with a src tag
+/**
+ * process a script with a src tag
*/
static dom_hubbub_error
-exec_src_script(html_content *c,
- dom_node *node,
- dom_string *mimetype,
+exec_src_script(html_content *c,
+ dom_node *node,
+ dom_string *mimetype,
dom_string *src)
{
nserror ns_error;
@@ -230,7 +229,7 @@ exec_src_script(html_content *c,
//exc = dom_element_has_attribute(node, html_dom_string_async, &async);
- nscript = html_process_new_script(c, HTML_STYLESHEET_EXTERNAL);
+ nscript = html_process_new_script(c, HTML_SCRIPT_SYNC);
if (nscript == NULL) {
dom_string_unref(mimetype);
goto html_process_script_no_memory;
@@ -258,7 +257,7 @@ exec_src_script(html_content *c,
c,
&child,
CONTENT_SCRIPT,
- &nscript->data.external);
+ &nscript->data.handle);
nsurl_unref(joined);
@@ -297,7 +296,7 @@ exec_inline_script(html_content *c, dom_node *node, dom_string *mimetype)
return DOM_HUBBUB_OK; /* no contents, skip */
}
- nscript = html_process_new_script(c, HTML_STYLESHEET_INTERNAL);
+ nscript = html_process_new_script(c, HTML_SCRIPT_INLINE);
if (nscript == NULL) {
dom_string_unref(mimetype);
dom_string_unref(script);
@@ -308,7 +307,7 @@ exec_inline_script(html_content *c, dom_node *node, dom_string *mimetype)
}
- nscript->data.internal = script;
+ nscript->data.string = script;
nscript->mimetype = mimetype;
nscript->already_started = true;
@@ -328,7 +327,7 @@ exec_inline_script(html_content *c, dom_node *node, dom_string *mimetype)
}
-/**
+/**
* process script node parser callback
*
*
@@ -354,7 +353,7 @@ html_process_script(void *ctx, dom_node *node)
}
}
- LOG(("content %p parser %p node %p",c,c->parser, node));
+ LOG(("content %p parser %p node %p", c, c->parser, node));
exc = dom_element_get_attribute(node, corestring_dom_type, &mimetype);
if (exc != DOM_NO_ERR || mimetype == NULL) {
@@ -371,3 +370,27 @@ html_process_script(void *ctx, dom_node *node)
return err;
}
+
+void html_free_scripts(html_content *html)
+{
+ unsigned int i;
+
+ for (i = 0; i != html->scripts_count; i++) {
+ if (html->scripts[i].mimetype != NULL) {
+ dom_string_unref(html->scripts[i].mimetype);
+ }
+
+ if ((html->scripts[i].type == HTML_SCRIPT_INLINE) &&
+ (html->scripts[i].data.string != NULL)) {
+
+ dom_string_unref(html->scripts[i].data.string);
+
+ } else if ((html->scripts[i].type == HTML_SCRIPT_SYNC) &&
+ (html->scripts[i].data.handle != NULL)) {
+
+ hlcache_handle_release(html->scripts[i].data.handle);
+
+ }
+ }
+ free(html->scripts);
+}
commitdiff http://git.netsurf-browser.org/netsurf.git/commitdiff/70d70b2878804b02a04...
commit 70d70b2878804b02a043fd08c2cdc705d1611e5e
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
split up the script processing
diff --git a/render/html_script.c b/render/html_script.c
index 5fd8c8a..fb51256 100644
--- a/render/html_script.c
+++ b/render/html_script.c
@@ -144,11 +144,11 @@ html_process_new_script(html_content *c, enum html_script_type type)
}
/**
- * Callback for fetchcache() for linked stylesheets.
+ * Callback for asyncronous scripts
*/
static nserror
-html_convert_script_callback(hlcache_handle *script,
+convert_script_async_cb(hlcache_handle *script,
const hlcache_event *event,
void *pw)
{
@@ -213,7 +213,123 @@ html_convert_script_callback(hlcache_handle *script,
return NSERROR_OK;
}
-/** process script node
+/**
+ * process a script with a src tag
+ */
+static dom_hubbub_error
+exec_src_script(html_content *c,
+ dom_node *node,
+ dom_string *mimetype,
+ dom_string *src)
+{
+ nserror ns_error;
+ nsurl *joined;
+ hlcache_child_context child;
+ struct html_script *nscript;
+ union content_msg_data msg_data;
+
+ //exc = dom_element_has_attribute(node, html_dom_string_async, &async);
+
+ nscript = html_process_new_script(c, HTML_STYLESHEET_EXTERNAL);
+ if (nscript == NULL) {
+ dom_string_unref(mimetype);
+ goto html_process_script_no_memory;
+ }
+
+ /* charset (encoding) */
+ ns_error = nsurl_join(c->base_url, dom_string_data(src), &joined);
+ if (ns_error != NSERROR_OK) {
+ dom_string_unref(mimetype);
+ goto html_process_script_no_memory;
+ }
+
+ nscript->mimetype = mimetype; /* keep reference to mimetype */
+
+ LOG(("script %i '%s'", c->scripts_count, nsurl_access(joined)));
+
+ child.charset = c->encoding;
+ child.quirks = c->base.quirks;
+
+ ns_error = hlcache_handle_retrieve(joined,
+ 0,
+ content_get_url(&c->base),
+ NULL,
+ convert_script_async_cb,
+ c,
+ &child,
+ CONTENT_SCRIPT,
+ &nscript->data.external);
+
+ nsurl_unref(joined);
+
+ if (ns_error != NSERROR_OK) {
+ goto html_process_script_no_memory;
+ }
+
+ c->base.active++; /* ensure base content knows the fetch is active */
+ LOG(("%d fetches active", c->base.active));
+
+ html_scripts_exec(c);
+
+ return DOM_HUBBUB_OK;
+
+
+html_process_script_no_memory:
+ msg_data.error = messages_get("NoMemory");
+ content_broadcast(&c->base, CONTENT_MSG_ERROR, msg_data);
+ return DOM_HUBBUB_NOMEM;
+}
+
+static dom_hubbub_error
+exec_inline_script(html_content *c, dom_node *node, dom_string *mimetype)
+{
+ union content_msg_data msg_data;
+ dom_string *script;
+ dom_exception exc; /* returned by libdom functions */
+ struct lwc_string_s *lwcmimetype;
+ script_handler_t *script_handler;
+ struct html_script *nscript;
+
+ /* does not appear to be a src so script is inline content */
+ exc = dom_node_get_text_content(node, &script);
+ if ((exc != DOM_NO_ERR) || (script == NULL)) {
+ dom_string_unref(mimetype);
+ return DOM_HUBBUB_OK; /* no contents, skip */
+ }
+
+ nscript = html_process_new_script(c, HTML_STYLESHEET_INTERNAL);
+ if (nscript == NULL) {
+ dom_string_unref(mimetype);
+ dom_string_unref(script);
+
+ msg_data.error = messages_get("NoMemory");
+ content_broadcast(&c->base, CONTENT_MSG_ERROR, msg_data);
+ return DOM_HUBBUB_NOMEM;
+
+ }
+
+ nscript->data.internal = script;
+ nscript->mimetype = mimetype;
+ nscript->already_started = true;
+
+ /* charset (encoding) */
+
+ /* ensure script handler for content type */
+ dom_string_intern(mimetype, &lwcmimetype);
+ script_handler = select_script_handler(content_factory_type_from_mime_type(lwcmimetype));
+ lwc_string_unref(lwcmimetype);
+
+ if (script_handler != NULL) {
+ script_handler(c->jscontext,
+ dom_string_data(script),
+ dom_string_byte_length(script));
+ }
+ return DOM_HUBBUB_OK;
+}
+
+
+/**
+ * process script node parser callback
*
*
*/
@@ -222,9 +338,8 @@ html_process_script(void *ctx, dom_node *node)
{
html_content *c = (html_content *)ctx;
dom_exception exc; /* returned by libdom functions */
- dom_string *src, *script, *mimetype;
- struct html_script *nscript;
- union content_msg_data msg_data;
+ dom_string *src, *mimetype;
+ dom_hubbub_error err = DOM_HUBBUB_OK;
/* ensure javascript context is available */
if (c->jscontext == NULL) {
@@ -248,97 +363,11 @@ html_process_script(void *ctx, dom_node *node)
exc = dom_element_get_attribute(node, corestring_dom_src, &src);
if (exc != DOM_NO_ERR || src == NULL) {
- struct lwc_string_s *lwcmimetype;
- script_handler_t *script_handler;
-
- /* does not appear to be a src so script is inline content */
- exc = dom_node_get_text_content(node, &script);
- if ((exc != DOM_NO_ERR) || (script == NULL)) {
- dom_string_unref(mimetype);
- return DOM_HUBBUB_OK; /* no contents, skip */
- }
-
- nscript = html_process_new_script(c, HTML_STYLESHEET_INTERNAL);
- if (nscript == NULL) {
- dom_string_unref(mimetype);
- dom_string_unref(script);
- goto html_process_script_no_memory;
- }
-
- nscript->data.internal = script;
- nscript->mimetype = mimetype;
- nscript->already_started = true;
-
- /* charset (encoding) */
-
- /* ensure script handler for content type */
- dom_string_intern(mimetype, &lwcmimetype);
- script_handler = select_script_handler(content_factory_type_from_mime_type(lwcmimetype));
- lwc_string_unref(lwcmimetype);
-
- if (script_handler != NULL) {
- script_handler(c->jscontext,
- dom_string_data(script),
- dom_string_byte_length(script));
- }
-
-
+ err = exec_inline_script(c, node, mimetype);
} else {
- /* script with a src tag */
- nserror ns_error;
- nsurl *joined;
- hlcache_child_context child;
-
-
- nscript = html_process_new_script(c, HTML_STYLESHEET_EXTERNAL);
- if (nscript == NULL) {
- dom_string_unref(src);
- dom_string_unref(mimetype);
- goto html_process_script_no_memory;
- }
-
- /* charset (encoding) */
-
- ns_error = nsurl_join(c->base_url, dom_string_data(src), &joined);
+ err = exec_src_script(c, node, mimetype, src);
dom_string_unref(src);
- if (ns_error != NSERROR_OK) {
- dom_string_unref(mimetype);
- goto html_process_script_no_memory;
- }
-
- nscript->mimetype = mimetype; /* keep reference to mimetype */
-
- LOG(("script %i '%s'", c->scripts_count, nsurl_access(joined)));
-
- child.charset = c->encoding;
- child.quirks = c->base.quirks;
-
- ns_error = hlcache_handle_retrieve(joined,
- 0,
- content_get_url(&c->base),
- NULL,
- html_convert_script_callback,
- c,
- &child,
- CONTENT_SCRIPT,
- &nscript->data.external);
-
- nsurl_unref(joined);
-
- if (ns_error != NSERROR_OK) {
- goto html_process_script_no_memory;
- }
-
- c->base.active++; /* ensure base content knows the fetch is active */
- LOG(("%d fetches active", c->base.active));
-
}
- html_scripts_exec(c);
-
- return DOM_HUBBUB_OK;
-html_process_script_no_memory:
- msg_data.error = messages_get("NoMemory");
- content_broadcast(&c->base, CONTENT_MSG_ERROR, msg_data);
- return DOM_HUBBUB_NOMEM;
+ return err;
}
-----------------------------------------------------------------------
--
NetSurf Browser
10 years, 6 months
netsurf: branch master updated. 72fe92d9ca0d3ba06c56cc258575e42102d502c6
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/72fe92d9ca0d3ba06c56c...
...commit http://git.netsurf-browser.org/netsurf.git/commit/72fe92d9ca0d3ba06c56cc2...
...tree http://git.netsurf-browser.org/netsurf.git/tree/72fe92d9ca0d3ba06c56cc258...
The branch, master has been updated
via 72fe92d9ca0d3ba06c56cc258575e42102d502c6 (commit)
via 41f88e693798a186f27a92f9ad087447a62f78d5 (commit)
from 7d011c62ff249161dfb03ee8ecf0716d41d3d353 (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/commitdiff/72fe92d9ca0d3ba06c5...
commit 72fe92d9ca0d3ba06c56cc258575e42102d502c6
Merge: 41f88e6 7d011c6
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Merge branch 'master' of git://git.netsurf-browser.org/netsurf
commitdiff http://git.netsurf-browser.org/netsurf.git/commitdiff/41f88e693798a186f27...
commit 41f88e693798a186f27a92f9ad087447a62f78d5
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Scrollbar behaviour fixes.
Stop scrollbar sliding at different rate from pointer.
Stop jump on drag start when scrollbar position indicator isn't at zero.
diff --git a/framebuffer/fbtk/scroll.c b/framebuffer/fbtk/scroll.c
index 0434f6d..0ce56a6 100644
--- a/framebuffer/fbtk/scroll.c
+++ b/framebuffer/fbtk/scroll.c
@@ -93,8 +93,10 @@ vscroll_drag(fbtk_widget_t *widget, fbtk_callback_info *cbi)
int newpos;
fbtk_widget_t *scrollw = cbi->context;
- newpos = ((widget->u.scroll.maximum - widget->u.scroll.minimum) /
- (widget->height - 4)) * (cbi->y - widget->u.scroll.drag);
+ newpos = ((widget->u.scroll.drag_position +
+ (cbi->y - widget->u.scroll.drag)) *
+ (widget->u.scroll.maximum - widget->u.scroll.minimum)) /
+ (widget->height - 4);
if (newpos < scrollw->u.scroll.minimum)
newpos = scrollw->u.scroll.minimum;
@@ -205,7 +207,8 @@ vscrollarea_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
ret = fbtk_post_callback(cbi->context, FBTK_CBT_SCROLLY, newpos);
} else {
/* on bar - start drag */
- widget->u.scroll.drag = cbi->y - vpos;
+ widget->u.scroll.drag = cbi->y;
+ widget->u.scroll.drag_position = vpos;
fbtk_set_handler(widget, FBTK_CBT_POINTERMOVE, vscroll_drag, widget);
fbtk_tgrab_pointer(widget);
}
@@ -369,8 +372,10 @@ hscroll_drag(fbtk_widget_t *widget, fbtk_callback_info *cbi)
int newpos;
fbtk_widget_t *scrollw = cbi->context;
- newpos = ((widget->u.scroll.maximum - widget->u.scroll.minimum) /
- (widget->width - 4)) * (cbi->x - widget->u.scroll.drag);
+ newpos = ((widget->u.scroll.drag_position +
+ (cbi->x - widget->u.scroll.drag)) *
+ (widget->u.scroll.maximum - widget->u.scroll.minimum)) /
+ (widget->width - 4);
if (newpos < scrollw->u.scroll.minimum)
newpos = scrollw->u.scroll.minimum;
@@ -423,7 +428,8 @@ hscrollarea_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
ret = fbtk_post_callback(cbi->context, FBTK_CBT_SCROLLX, newpos);
} else {
/* on bar - start drag */
- widget->u.scroll.drag = cbi->x - hpos;
+ widget->u.scroll.drag = cbi->x;
+ widget->u.scroll.drag_position = hpos;
fbtk_set_handler(widget, FBTK_CBT_POINTERMOVE, hscroll_drag, widget);
fbtk_tgrab_pointer(widget);
}
diff --git a/framebuffer/fbtk/widget.h b/framebuffer/fbtk/widget.h
index 084a440..060999b 100644
--- a/framebuffer/fbtk/widget.h
+++ b/framebuffer/fbtk/widget.h
@@ -189,6 +189,7 @@ struct fbtk_widget_s {
int page; /* amount to page document */
int position; /* position of bar */
int drag; /* offset to start of drag */
+ int drag_position; /* indicator bar pos at drag start */
struct fbtk_widget_s *btnul; /* scroll button up/left */
struct fbtk_widget_s *btndr; /* scroll button down/right*/
} scroll;
-----------------------------------------------------------------------
Summary of changes:
framebuffer/fbtk/scroll.c | 18 ++++++++++++------
framebuffer/fbtk/widget.h | 1 +
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/framebuffer/fbtk/scroll.c b/framebuffer/fbtk/scroll.c
index 0434f6d..0ce56a6 100644
--- a/framebuffer/fbtk/scroll.c
+++ b/framebuffer/fbtk/scroll.c
@@ -93,8 +93,10 @@ vscroll_drag(fbtk_widget_t *widget, fbtk_callback_info *cbi)
int newpos;
fbtk_widget_t *scrollw = cbi->context;
- newpos = ((widget->u.scroll.maximum - widget->u.scroll.minimum) /
- (widget->height - 4)) * (cbi->y - widget->u.scroll.drag);
+ newpos = ((widget->u.scroll.drag_position +
+ (cbi->y - widget->u.scroll.drag)) *
+ (widget->u.scroll.maximum - widget->u.scroll.minimum)) /
+ (widget->height - 4);
if (newpos < scrollw->u.scroll.minimum)
newpos = scrollw->u.scroll.minimum;
@@ -205,7 +207,8 @@ vscrollarea_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
ret = fbtk_post_callback(cbi->context, FBTK_CBT_SCROLLY, newpos);
} else {
/* on bar - start drag */
- widget->u.scroll.drag = cbi->y - vpos;
+ widget->u.scroll.drag = cbi->y;
+ widget->u.scroll.drag_position = vpos;
fbtk_set_handler(widget, FBTK_CBT_POINTERMOVE, vscroll_drag, widget);
fbtk_tgrab_pointer(widget);
}
@@ -369,8 +372,10 @@ hscroll_drag(fbtk_widget_t *widget, fbtk_callback_info *cbi)
int newpos;
fbtk_widget_t *scrollw = cbi->context;
- newpos = ((widget->u.scroll.maximum - widget->u.scroll.minimum) /
- (widget->width - 4)) * (cbi->x - widget->u.scroll.drag);
+ newpos = ((widget->u.scroll.drag_position +
+ (cbi->x - widget->u.scroll.drag)) *
+ (widget->u.scroll.maximum - widget->u.scroll.minimum)) /
+ (widget->width - 4);
if (newpos < scrollw->u.scroll.minimum)
newpos = scrollw->u.scroll.minimum;
@@ -423,7 +428,8 @@ hscrollarea_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
ret = fbtk_post_callback(cbi->context, FBTK_CBT_SCROLLX, newpos);
} else {
/* on bar - start drag */
- widget->u.scroll.drag = cbi->x - hpos;
+ widget->u.scroll.drag = cbi->x;
+ widget->u.scroll.drag_position = hpos;
fbtk_set_handler(widget, FBTK_CBT_POINTERMOVE, hscroll_drag, widget);
fbtk_tgrab_pointer(widget);
}
diff --git a/framebuffer/fbtk/widget.h b/framebuffer/fbtk/widget.h
index 084a440..060999b 100644
--- a/framebuffer/fbtk/widget.h
+++ b/framebuffer/fbtk/widget.h
@@ -189,6 +189,7 @@ struct fbtk_widget_s {
int page; /* amount to page document */
int position; /* position of bar */
int drag; /* offset to start of drag */
+ int drag_position; /* indicator bar pos at drag start */
struct fbtk_widget_s *btnul; /* scroll button up/left */
struct fbtk_widget_s *btndr; /* scroll button down/right*/
} scroll;
--
NetSurf Browser
10 years, 6 months
libnsfb: branch master updated. 56dd658e6265fb1902c92d6d88420c3accb79225
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libnsfb.git/shortlog/56dd658e6265fb1902c92...
...commit http://git.netsurf-browser.org/libnsfb.git/commit/56dd658e6265fb1902c92d6...
...tree http://git.netsurf-browser.org/libnsfb.git/tree/56dd658e6265fb1902c92d6d8...
The branch, master has been updated
via 56dd658e6265fb1902c92d6d88420c3accb79225 (commit)
from 198e8c2e38c9e7bbc85e61a80217c323819e8597 (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/libnsfb.git/commitdiff/56dd658e6265fb1902c...
commit 56dd658e6265fb1902c92d6d88420c3accb79225
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Simple tester for hammering glyph render function.
diff --git a/test/Makefile b/test/Makefile
index c11f489..64210be 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,3 +1,3 @@
-DIR_TEST_ITEMS := plottest:plottest.c bitmap:bitmap.c;nsglobe.c frontend:frontend.c bezier:bezier.c path:path.c polygon:polygon.c polystar:polystar.c polystar2:polystar2.c
+DIR_TEST_ITEMS := text-speed:text-speed.c plottest:plottest.c bitmap:bitmap.c;nsglobe.c frontend:frontend.c bezier:bezier.c path:path.c polygon:polygon.c polystar:polystar.c polystar2:polystar2.c
include $(NSBUILD)/Makefile.subdir
diff --git a/test/text-speed.c b/test/text-speed.c
new file mode 100644
index 0000000..e09f606
--- /dev/null
+++ b/test/text-speed.c
@@ -0,0 +1,112 @@
+/* libnsfb plotter test program */
+
+#include <stdio.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include "libnsfb.h"
+#include "libnsfb_plot.h"
+#include "libnsfb_event.h"
+
+#define UNUSED(x) ((x) = (x))
+
+const struct {
+ unsigned int w;
+ unsigned int h;
+ unsigned char data[16];
+} Mglyph1 = {
+ 8, 16,
+ {
+ 0x00, /* 00000000 */
+ 0x00, /* 00000000 */
+ 0xc6, /* 11000110 */
+ 0xee, /* 11101110 */
+ 0xfe, /* 11111110 */
+ 0xfe, /* 11111110 */
+ 0xd6, /* 11010110 */
+ 0xc6, /* 11000110 */
+ 0xc6, /* 11000110 */
+ 0xc6, /* 11000110 */
+ 0xc6, /* 11000110 */
+ 0xc6, /* 11000110 */
+ 0x00, /* 00000000 */
+ 0x00, /* 00000000 */
+ 0x00, /* 00000000 */
+ 0x00, /* 00000000 */
+ }
+};
+
+int main(int argc, char **argv)
+{
+ const char *fename;
+ enum nsfb_type_e fetype;
+ nsfb_t *nsfb;
+
+ nsfb_bbox_t box;
+ nsfb_bbox_t box3;
+ uint8_t *fbptr;
+ int fbstride;
+ int i;
+ unsigned int x, y;
+
+ if (argc < 2) {
+ fename="sdl";
+ } else {
+ fename = argv[1];
+ }
+
+ fetype = nsfb_type_from_name(fename);
+ if (fetype == NSFB_SURFACE_NONE) {
+ printf("Unable to convert \"%s\" to nsfb surface type\n",
+ fename);
+ return EXIT_FAILURE;
+ }
+
+ nsfb = nsfb_new(fetype);
+ if (nsfb == NULL) {
+ printf("Unable to allocate \"%s\" nsfb surface\n", fename);
+ return EXIT_FAILURE;
+ }
+
+ if (nsfb_init(nsfb) == -1) {
+ printf("Unable to initialise nsfb surface\n");
+ nsfb_free(nsfb);
+ return EXIT_FAILURE;
+ }
+
+ /* get the geometry of the whole screen */
+ box.x0 = box.y0 = 0;
+ nsfb_get_geometry(nsfb, &box.x1, &box.y1, NULL);
+
+ nsfb_get_buffer(nsfb, &fbptr, &fbstride);
+ nsfb_claim(nsfb, &box);
+
+ /* Clear to white */
+ nsfb_plot_clg(nsfb, 0xffffffff);
+ nsfb_update(nsfb, &box);
+
+ /* test glyph plotting */
+ for (i = 0; i < 1000; i++) {
+ for (y = 0; y < box.y1 - Mglyph1.h; y += Mglyph1.h) {
+ for (x = 0; x < box.x1 - Mglyph1.w; x += Mglyph1.w) {
+ box3.x0 = x;
+ box3.y0 = y;
+ box3.x1 = box3.x0 + Mglyph1.w;
+ box3.y1 = box3.y0 + Mglyph1.h;
+
+ nsfb_plot_glyph1(nsfb, &box3, Mglyph1.data,
+ Mglyph1.w, 0xff000000);
+ }
+ }
+ nsfb_update(nsfb, &box);
+ }
+
+ nsfb_update(nsfb, &box);
+ nsfb_free(nsfb);
+
+ return 0;
+}
-----------------------------------------------------------------------
Summary of changes:
test/Makefile | 2 +-
test/text-speed.c | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 113 insertions(+), 1 deletions(-)
create mode 100644 test/text-speed.c
diff --git a/test/Makefile b/test/Makefile
index c11f489..64210be 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,3 +1,3 @@
-DIR_TEST_ITEMS := plottest:plottest.c bitmap:bitmap.c;nsglobe.c frontend:frontend.c bezier:bezier.c path:path.c polygon:polygon.c polystar:polystar.c polystar2:polystar2.c
+DIR_TEST_ITEMS := text-speed:text-speed.c plottest:plottest.c bitmap:bitmap.c;nsglobe.c frontend:frontend.c bezier:bezier.c path:path.c polygon:polygon.c polystar:polystar.c polystar2:polystar2.c
include $(NSBUILD)/Makefile.subdir
diff --git a/test/text-speed.c b/test/text-speed.c
new file mode 100644
index 0000000..e09f606
--- /dev/null
+++ b/test/text-speed.c
@@ -0,0 +1,112 @@
+/* libnsfb plotter test program */
+
+#include <stdio.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include "libnsfb.h"
+#include "libnsfb_plot.h"
+#include "libnsfb_event.h"
+
+#define UNUSED(x) ((x) = (x))
+
+const struct {
+ unsigned int w;
+ unsigned int h;
+ unsigned char data[16];
+} Mglyph1 = {
+ 8, 16,
+ {
+ 0x00, /* 00000000 */
+ 0x00, /* 00000000 */
+ 0xc6, /* 11000110 */
+ 0xee, /* 11101110 */
+ 0xfe, /* 11111110 */
+ 0xfe, /* 11111110 */
+ 0xd6, /* 11010110 */
+ 0xc6, /* 11000110 */
+ 0xc6, /* 11000110 */
+ 0xc6, /* 11000110 */
+ 0xc6, /* 11000110 */
+ 0xc6, /* 11000110 */
+ 0x00, /* 00000000 */
+ 0x00, /* 00000000 */
+ 0x00, /* 00000000 */
+ 0x00, /* 00000000 */
+ }
+};
+
+int main(int argc, char **argv)
+{
+ const char *fename;
+ enum nsfb_type_e fetype;
+ nsfb_t *nsfb;
+
+ nsfb_bbox_t box;
+ nsfb_bbox_t box3;
+ uint8_t *fbptr;
+ int fbstride;
+ int i;
+ unsigned int x, y;
+
+ if (argc < 2) {
+ fename="sdl";
+ } else {
+ fename = argv[1];
+ }
+
+ fetype = nsfb_type_from_name(fename);
+ if (fetype == NSFB_SURFACE_NONE) {
+ printf("Unable to convert \"%s\" to nsfb surface type\n",
+ fename);
+ return EXIT_FAILURE;
+ }
+
+ nsfb = nsfb_new(fetype);
+ if (nsfb == NULL) {
+ printf("Unable to allocate \"%s\" nsfb surface\n", fename);
+ return EXIT_FAILURE;
+ }
+
+ if (nsfb_init(nsfb) == -1) {
+ printf("Unable to initialise nsfb surface\n");
+ nsfb_free(nsfb);
+ return EXIT_FAILURE;
+ }
+
+ /* get the geometry of the whole screen */
+ box.x0 = box.y0 = 0;
+ nsfb_get_geometry(nsfb, &box.x1, &box.y1, NULL);
+
+ nsfb_get_buffer(nsfb, &fbptr, &fbstride);
+ nsfb_claim(nsfb, &box);
+
+ /* Clear to white */
+ nsfb_plot_clg(nsfb, 0xffffffff);
+ nsfb_update(nsfb, &box);
+
+ /* test glyph plotting */
+ for (i = 0; i < 1000; i++) {
+ for (y = 0; y < box.y1 - Mglyph1.h; y += Mglyph1.h) {
+ for (x = 0; x < box.x1 - Mglyph1.w; x += Mglyph1.w) {
+ box3.x0 = x;
+ box3.y0 = y;
+ box3.x1 = box3.x0 + Mglyph1.w;
+ box3.y1 = box3.y0 + Mglyph1.h;
+
+ nsfb_plot_glyph1(nsfb, &box3, Mglyph1.data,
+ Mglyph1.w, 0xff000000);
+ }
+ }
+ nsfb_update(nsfb, &box);
+ }
+
+ nsfb_update(nsfb, &box);
+ nsfb_free(nsfb);
+
+ return 0;
+}
--
NetSurf Framebuffer library
10 years, 6 months
libnsfb: branch master updated. 198e8c2e38c9e7bbc85e61a80217c323819e8597
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libnsfb.git/shortlog/198e8c2e38c9e7bbc85e6...
...commit http://git.netsurf-browser.org/libnsfb.git/commit/198e8c2e38c9e7bbc85e61a...
...tree http://git.netsurf-browser.org/libnsfb.git/tree/198e8c2e38c9e7bbc85e61a80...
The branch, master has been updated
via 198e8c2e38c9e7bbc85e61a80217c323819e8597 (commit)
from babd30a2b471d1177895327fd555175ca04017a0 (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/libnsfb.git/commitdiff/198e8c2e38c9e7bbc85...
commit 198e8c2e38c9e7bbc85e61a80217c323819e8597
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Fix horizontal scroll of internal text. Simplify and optimise internal text renderer.
diff --git a/src/plot/common.c b/src/plot/common.c
index 5a83942..185e323 100644
--- a/src/plot/common.c
+++ b/src/plot/common.c
@@ -138,15 +138,17 @@ glyph1(nsfb_t *nsfb,
nsfb_colour_t c)
{
PLOT_TYPE *pvideo;
+ PLOT_TYPE const *pvideo_limit;
PLOT_TYPE fgcol;
- int xloop, yloop;
+ int xloop;
int xoff, yoff; /* x and y offset into image */
int x = loc->x0;
int y = loc->y0;
int width;
int height;
- const uint8_t *fntd;
- uint8_t row;
+ const size_t line_len = PLOT_LINELEN(nsfb->linelen);
+ const int first_col = 1 << (loc->x1 - loc->x0 - 1);
+ const uint8_t *row;
if (!nsfb_plot_clip_ctx(nsfb, loc))
return true;
@@ -157,26 +159,22 @@ glyph1(nsfb_t *nsfb,
xoff = loc->x0 - x;
yoff = loc->y0 - y;
- pvideo = get_xy_loc(nsfb, loc->x0, loc->y0);
-
fgcol = colour_to_pixel(nsfb, c);
- for (yloop = yoff; yloop < height; yloop++) {
- fntd = pixel + (yloop * (pitch>>3)) + (xoff>>3);
- row = (*fntd++) << (xoff & 3);
- for (xloop = xoff; xloop < width ; xloop++) {
- if (((xloop % 8) == 0) && (xloop != 0)) {
- row = *fntd++;
- }
+ pitch >>= 3; /* bits to bytes */
+
+ pvideo = get_xy_loc(nsfb, x, loc->y0);
+ pvideo_limit = pvideo + line_len * (height - yoff);
+ row = pixel + yoff * pitch;
- if ((row & 0x80) != 0) {
+ for (; pvideo < pvideo_limit; pvideo += line_len) {
+ for (xloop = xoff; xloop < width; xloop++) {
+
+ if ((*row & (first_col >> xloop)) != 0) {
*(pvideo + xloop) = fgcol;
}
- row = row << 1;
-
}
-
- pvideo += PLOT_LINELEN(nsfb->linelen);
+ row += pitch;
}
return true;
-----------------------------------------------------------------------
Summary of changes:
src/plot/common.c | 32 +++++++++++++++-----------------
1 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/src/plot/common.c b/src/plot/common.c
index 5a83942..185e323 100644
--- a/src/plot/common.c
+++ b/src/plot/common.c
@@ -138,15 +138,17 @@ glyph1(nsfb_t *nsfb,
nsfb_colour_t c)
{
PLOT_TYPE *pvideo;
+ PLOT_TYPE const *pvideo_limit;
PLOT_TYPE fgcol;
- int xloop, yloop;
+ int xloop;
int xoff, yoff; /* x and y offset into image */
int x = loc->x0;
int y = loc->y0;
int width;
int height;
- const uint8_t *fntd;
- uint8_t row;
+ const size_t line_len = PLOT_LINELEN(nsfb->linelen);
+ const int first_col = 1 << (loc->x1 - loc->x0 - 1);
+ const uint8_t *row;
if (!nsfb_plot_clip_ctx(nsfb, loc))
return true;
@@ -157,26 +159,22 @@ glyph1(nsfb_t *nsfb,
xoff = loc->x0 - x;
yoff = loc->y0 - y;
- pvideo = get_xy_loc(nsfb, loc->x0, loc->y0);
-
fgcol = colour_to_pixel(nsfb, c);
- for (yloop = yoff; yloop < height; yloop++) {
- fntd = pixel + (yloop * (pitch>>3)) + (xoff>>3);
- row = (*fntd++) << (xoff & 3);
- for (xloop = xoff; xloop < width ; xloop++) {
- if (((xloop % 8) == 0) && (xloop != 0)) {
- row = *fntd++;
- }
+ pitch >>= 3; /* bits to bytes */
+
+ pvideo = get_xy_loc(nsfb, x, loc->y0);
+ pvideo_limit = pvideo + line_len * (height - yoff);
+ row = pixel + yoff * pitch;
- if ((row & 0x80) != 0) {
+ for (; pvideo < pvideo_limit; pvideo += line_len) {
+ for (xloop = xoff; xloop < width; xloop++) {
+
+ if ((*row & (first_col >> xloop)) != 0) {
*(pvideo + xloop) = fgcol;
}
- row = row << 1;
-
}
-
- pvideo += PLOT_LINELEN(nsfb->linelen);
+ row += pitch;
}
return true;
--
NetSurf Framebuffer library
10 years, 6 months
libdom: branch master updated. 8bef33b1005ea97359a71786a84912c42edf97bb
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libdom.git/shortlog/8bef33b1005ea97359a717...
...commit http://git.netsurf-browser.org/libdom.git/commit/8bef33b1005ea97359a71786...
...tree http://git.netsurf-browser.org/libdom.git/tree/8bef33b1005ea97359a71786a8...
The branch, master has been updated
via 8bef33b1005ea97359a71786a84912c42edf97bb (commit)
from 542b8cb8feba8f15497eecf31cac53a7f4b17add (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/commitdiff/8bef33b1005ea97359a7...
commit 8bef33b1005ea97359a71786a84912c42edf97bb
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
Allow control over parser pause state
diff --git a/bindings/hubbub/parser.c b/bindings/hubbub/parser.c
index 4a90511..6299da5 100644
--- a/bindings/hubbub/parser.c
+++ b/bindings/hubbub/parser.c
@@ -911,3 +911,24 @@ const char *dom_hubbub_parser_get_encoding(dom_hubbub_parser *parser,
return parser->encoding != NULL ? parser->encoding
: "Windows-1252";
}
+
+/**
+ * Set the Parse pause state.
+ *
+ * \param parser The parser object
+ * \param pause The pause state to set.
+ * \return DOM_HUBBUB_OK on success,
+ * DOM_HUBBUB_HUBBUB_ERR | <hubbub_error> on failure
+ */
+dom_hubbub_error dom_hubbub_parser_pause(dom_hubbub_parser *parser, bool pause)
+{
+ hubbub_error err;
+ hubbub_parser_optparams params;
+
+ params.pause_parse = pause;
+ err = hubbub_parser_setopt(parser->parser, HUBBUB_PARSER_PAUSE, ¶ms);
+ if (err != HUBBUB_OK)
+ return DOM_HUBBUB_HUBBUB_ERR | err;
+
+ return DOM_HUBBUB_OK;
+}
diff --git a/bindings/hubbub/parser.h b/bindings/hubbub/parser.h
index 7af0dd0..16b02a8 100644
--- a/bindings/hubbub/parser.h
+++ b/bindings/hubbub/parser.h
@@ -77,4 +77,14 @@ dom_document *dom_hubbub_parser_get_document(dom_hubbub_parser *parser);
const char *dom_hubbub_parser_get_encoding(dom_hubbub_parser *parser,
dom_hubbub_encoding_source *source);
+/**
+ * Set the Parse pause state.
+ *
+ * \param parser The parser object
+ * \param pause The pause state to set.
+ * \return DOM_HUBBUB_OK on success,
+ * DOM_HUBBUB_HUBBUB_ERR | <hubbub_error> on failure
+ */
+dom_hubbub_error dom_hubbub_parser_pause(dom_hubbub_parser *parser, bool pause);
+
#endif
-----------------------------------------------------------------------
Summary of changes:
bindings/hubbub/parser.c | 21 +++++++++++++++++++++
bindings/hubbub/parser.h | 10 ++++++++++
2 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/bindings/hubbub/parser.c b/bindings/hubbub/parser.c
index 4a90511..6299da5 100644
--- a/bindings/hubbub/parser.c
+++ b/bindings/hubbub/parser.c
@@ -911,3 +911,24 @@ const char *dom_hubbub_parser_get_encoding(dom_hubbub_parser *parser,
return parser->encoding != NULL ? parser->encoding
: "Windows-1252";
}
+
+/**
+ * Set the Parse pause state.
+ *
+ * \param parser The parser object
+ * \param pause The pause state to set.
+ * \return DOM_HUBBUB_OK on success,
+ * DOM_HUBBUB_HUBBUB_ERR | <hubbub_error> on failure
+ */
+dom_hubbub_error dom_hubbub_parser_pause(dom_hubbub_parser *parser, bool pause)
+{
+ hubbub_error err;
+ hubbub_parser_optparams params;
+
+ params.pause_parse = pause;
+ err = hubbub_parser_setopt(parser->parser, HUBBUB_PARSER_PAUSE, ¶ms);
+ if (err != HUBBUB_OK)
+ return DOM_HUBBUB_HUBBUB_ERR | err;
+
+ return DOM_HUBBUB_OK;
+}
diff --git a/bindings/hubbub/parser.h b/bindings/hubbub/parser.h
index 7af0dd0..16b02a8 100644
--- a/bindings/hubbub/parser.h
+++ b/bindings/hubbub/parser.h
@@ -77,4 +77,14 @@ dom_document *dom_hubbub_parser_get_document(dom_hubbub_parser *parser);
const char *dom_hubbub_parser_get_encoding(dom_hubbub_parser *parser,
dom_hubbub_encoding_source *source);
+/**
+ * Set the Parse pause state.
+ *
+ * \param parser The parser object
+ * \param pause The pause state to set.
+ * \return DOM_HUBBUB_OK on success,
+ * DOM_HUBBUB_HUBBUB_ERR | <hubbub_error> on failure
+ */
+dom_hubbub_error dom_hubbub_parser_pause(dom_hubbub_parser *parser, bool pause);
+
#endif
--
Document Object Model library
10 years, 6 months
netsurf: branch master updated. 7d011c62ff249161dfb03ee8ecf0716d41d3d353
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/7d011c62ff249161dfb03...
...commit http://git.netsurf-browser.org/netsurf.git/commit/7d011c62ff249161dfb03ee...
...tree http://git.netsurf-browser.org/netsurf.git/tree/7d011c62ff249161dfb03ee8e...
The branch, master has been updated
via 7d011c62ff249161dfb03ee8ecf0716d41d3d353 (commit)
from e4d83d660e494d05ece1bd98799424dd035bdfad (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/commitdiff/7d011c62ff249161dfb...
commit 7d011c62ff249161dfb03ee8ecf0716d41d3d353
Author: Ole Loots <ole(a)monochrom.net>
Commit: Ole Loots <ole(a)monochrom.net>
Open hotlist and history at top right corner
diff --git a/atari/history.c b/atari/history.c
index c145da3..00fcce9 100755
--- a/atari/history.c
+++ b/atari/history.c
@@ -55,12 +55,14 @@ char **global_history_get_recent( int *count )
void global_history_open( void )
{
- if( gl_history.init == false ) {
+ GRECT pos = {app.w - (app.w/3), app.y, app.w/3, app.h/2};
+
+ if (gl_history.init == false ) {
printf("history not init");
return;
}
if( gl_history.open == false ) {
- WindOpen( gl_history.window, -1, -1, app.w/3, app.h/2);
+ WindOpen( gl_history.window, pos.g_x, pos.g_y, pos.g_w, pos.g_h);
gl_history.open = true;
atari_treeview_open( gl_history.tv );
} else {
diff --git a/atari/hotlist.c b/atari/hotlist.c
index 345c6d8..18d016e 100755
--- a/atari/hotlist.c
+++ b/atari/hotlist.c
@@ -134,11 +134,14 @@ void hotlist_init(void)
void hotlist_open(void)
{
+ GRECT pos = {app.w - (app.w/3), app.y, app.w/3, app.h/2};
+
if( hl.init == false ) {
return;
}
+
if( hl.open == false ) {
- WindOpen( hl.window, -1, -1, app.w/3, app.h/2);
+ WindOpen( hl.window, pos.g_x, pos.g_y, pos.g_w, pos.g_h);
hl.open = true;
atari_treeview_open( hl.tv );
} else {
-----------------------------------------------------------------------
Summary of changes:
atari/history.c | 6 ++++--
atari/hotlist.c | 5 ++++-
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/atari/history.c b/atari/history.c
index c145da3..00fcce9 100755
--- a/atari/history.c
+++ b/atari/history.c
@@ -55,12 +55,14 @@ char **global_history_get_recent( int *count )
void global_history_open( void )
{
- if( gl_history.init == false ) {
+ GRECT pos = {app.w - (app.w/3), app.y, app.w/3, app.h/2};
+
+ if (gl_history.init == false ) {
printf("history not init");
return;
}
if( gl_history.open == false ) {
- WindOpen( gl_history.window, -1, -1, app.w/3, app.h/2);
+ WindOpen( gl_history.window, pos.g_x, pos.g_y, pos.g_w, pos.g_h);
gl_history.open = true;
atari_treeview_open( gl_history.tv );
} else {
diff --git a/atari/hotlist.c b/atari/hotlist.c
index 345c6d8..18d016e 100755
--- a/atari/hotlist.c
+++ b/atari/hotlist.c
@@ -134,11 +134,14 @@ void hotlist_init(void)
void hotlist_open(void)
{
+ GRECT pos = {app.w - (app.w/3), app.y, app.w/3, app.h/2};
+
if( hl.init == false ) {
return;
}
+
if( hl.open == false ) {
- WindOpen( hl.window, -1, -1, app.w/3, app.h/2);
+ WindOpen( hl.window, pos.g_x, pos.g_y, pos.g_w, pos.g_h);
hl.open = true;
atari_treeview_open( hl.tv );
} else {
--
NetSurf Browser
10 years, 6 months