r13784 chris_y - /trunk/netsurf/amiga/gui.c
by netsurf@semichrome.net
Author: chris_y
Date: Sat Mar 31 16:51:44 2012
New Revision: 13784
URL: http://source.netsurf-browser.org?rev=13784&view=rev
Log:
Remove old commented out tags
Modified:
trunk/netsurf/amiga/gui.c
Modified: trunk/netsurf/amiga/gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/gui.c?rev=13784&r1=...
==============================================================================
--- trunk/netsurf/amiga/gui.c (original)
+++ trunk/netsurf/amiga/gui.c Sat Mar 31 16:51:44 2012
@@ -2951,7 +2951,6 @@
"scrollergclass",
GA_ID, GID_HSCROLL,
PGA_Freedom, FREEHORIZ,
- // GA_Left, size1,
GA_RelRight, 1 - size2 - sz,
GA_Width, size2,
GA_BottomBorder, TRUE,
@@ -2976,8 +2975,6 @@
GA_Image, (struct Image *)NewObject(
NULL,
"gaugeiclass",
- //"frameiclass",
- //IA_FrameType, FRAME_DISPLAY,
IA_Top, 2 - (scrn->RastPort.TxHeight),
IA_Left, -3,
IA_Height, 4 + scrn->RastPort.TxHeight,
11 years, 5 months
r13783 chris_y - /trunk/netsurf/amiga/gui.c
by netsurf@semichrome.net
Author: chris_y
Date: Sat Mar 31 16:49:50 2012
New Revision: 13783
URL: http://source.netsurf-browser.org?rev=13783&view=rev
Log:
Change the status bar frameiclass to a gaugeiclass, as it is more
aesthetically pleasing, and also allows us to show progress bar if it is
possible to get this data from the core in the future.
Modified:
trunk/netsurf/amiga/gui.c
Modified: trunk/netsurf/amiga/gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/gui.c?rev=13783&r1=...
==============================================================================
--- trunk/netsurf/amiga/gui.c (original)
+++ trunk/netsurf/amiga/gui.c Sat Mar 31 16:49:50 2012
@@ -2975,12 +2975,16 @@
GA_ReadOnly, TRUE,
GA_Image, (struct Image *)NewObject(
NULL,
- "frameiclass",
- IA_FrameType, FRAME_DISPLAY,
+ "gaugeiclass",
+ //"frameiclass",
+ //IA_FrameType, FRAME_DISPLAY,
IA_Top, 2 - (scrn->RastPort.TxHeight),
IA_Left, -3,
IA_Height, 4 + scrn->RastPort.TxHeight,
IA_InBorder, TRUE,
+ IA_Label, NULL,
+ IA_Screen, scrn,
+ GAUGEIA_Level, 0,
TAG_DONE),
GA_Next, gwin->shared->objects[GID_HSCROLL],
TAG_DONE);
11 years, 5 months
r13782 chris_y - in /trunk/netsurf/amiga: pkg/makereslinks resources/Resource.map resources/favicon.ico resources/favicon.png
by netsurf@semichrome.net
Author: chris_y
Date: Sat Mar 31 10:29:08 2012
New Revision: 13782
URL: http://source.netsurf-browser.org?rev=13782&view=rev
Log:
Use the same default favicon as other platforms.
Added:
trunk/netsurf/amiga/resources/Resource.map (with props)
trunk/netsurf/amiga/resources/favicon.png
- copied unchanged from r13777, trunk/netsurf/!NetSurf/Resources/Icons/content.png
Removed:
trunk/netsurf/amiga/resources/favicon.ico
Modified:
trunk/netsurf/amiga/pkg/makereslinks
Modified: trunk/netsurf/amiga/pkg/makereslinks
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/pkg/makereslinks?re...
==============================================================================
--- trunk/netsurf/amiga/pkg/makereslinks (original)
+++ trunk/netsurf/amiga/pkg/makereslinks Sat Mar 31 10:29:08 2012
@@ -8,7 +8,8 @@
makelink ca-bundle /!NetSurf/Resources/ca-bundle soft
makelink de /!NetSurf/Resources/de soft
makelink nsdefault.css /!NetSurf/Resources/CSS,f79 soft
-makelink favicon.ico /amiga/resources/favicon.ico soft
+makelink favicon.png /amiga/resources/favicon.png soft
+makelink Resource.map /amiga/resources/Resource.map soft
makelink en /!NetSurf/Resources/en soft
makelink fr /!NetSurf/Resources/fr soft
makelink internal.css /!NetSurf/Resources/internal.css,f79 soft
@@ -24,4 +25,4 @@
makelink mimetypes /amiga/resources/mimetypes soft
/
-copy !NetSurf/Resources/CSS,f79 amiga/resources/nsdefault.css
+makelink amiga/resources/nsdefault.css //!NetSurf/Resources/CSS,f79 soft
Added: trunk/netsurf/amiga/resources/Resource.map
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/resources/Resource....
==============================================================================
--- trunk/netsurf/amiga/resources/Resource.map (added)
+++ trunk/netsurf/amiga/resources/Resource.map Sat Mar 31 10:29:08 2012
@@ -1,0 +1,2 @@
+# Resource.map
+favicon.ico:favicon.png
Propchange: trunk/netsurf/amiga/resources/Resource.map
------------------------------------------------------------------------------
amiga:protection = ----rw-d ---- ----
Removed: trunk/netsurf/amiga/resources/favicon.ico
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/resources/favicon.i...
==============================================================================
Binary file - no diff available.
11 years, 5 months
r13781 jmb - /trunk/libdom/Makefile
by netsurf@semichrome.net
Author: jmb
Date: Fri Mar 30 16:23:07 2012
New Revision: 13781
URL: http://source.netsurf-browser.org?rev=13781&view=rev
Log:
Remove _GNU_SOURCE
Modified:
trunk/libdom/Makefile
Modified: trunk/libdom/Makefile
URL: http://source.netsurf-browser.org/trunk/libdom/Makefile?rev=13781&r1=1378...
==============================================================================
--- trunk/libdom/Makefile (original)
+++ trunk/libdom/Makefile Fri Mar 30 16:23:07 2012
@@ -21,7 +21,7 @@
ifeq ($(TARGET),amiga)
CFLAGS := -U__STRICT_ANSI__ $(CFLAGS)
endif
-CFLAGS := -std=c99 -D_BSD_SOURCE -D_GNU_SOURCE -I$(CURDIR)/include/ \
+CFLAGS := -std=c99 -D_BSD_SOURCE -I$(CURDIR)/include/ \
-I$(CURDIR)/src -I$(CURDIR)/binding $(WARNFLAGS) $(CFLAGS)
# Parserutils & wapcaplet
11 years, 5 months
r13780 jmb - /trunk/libdom/bindings/hubbub/parser.c
by netsurf@semichrome.net
Author: jmb
Date: Fri Mar 30 16:20:06 2012
New Revision: 13780
URL: http://source.netsurf-browser.org?rev=13780&view=rev
Log:
Replace strndup with our own implementation
Modified:
trunk/libdom/bindings/hubbub/parser.c
Modified: trunk/libdom/bindings/hubbub/parser.c
URL: http://source.netsurf-browser.org/trunk/libdom/bindings/hubbub/parser.c?r...
==============================================================================
--- trunk/libdom/bindings/hubbub/parser.c (original)
+++ trunk/libdom/bindings/hubbub/parser.c Fri Mar 30 16:20:06 2012
@@ -334,6 +334,23 @@
return HUBBUB_OK;
}
+static char *parser_strndup(const char *s, size_t n)
+{
+ size_t len;
+ char *s2;
+
+ for (len = 0; len != n && s[len] != '\0'; len++)
+ continue;
+
+ s2 = malloc(len + 1);
+ if (s2 == NULL)
+ return NULL;
+
+ memcpy(s2, s, len);
+ s2[len] = '\0';
+ return s2;
+}
+
static hubbub_error create_doctype(void *parser, const hubbub_doctype *doctype,
void **result)
{
@@ -344,7 +361,7 @@
*result = NULL;
- qname = strndup((const char *) doctype->name.ptr,
+ qname = parser_strndup((const char *) doctype->name.ptr,
(size_t) doctype->name.len);
if (qname == NULL) {
dom_parser->msg(DOM_MSG_CRITICAL, dom_parser->mctx,
@@ -353,7 +370,8 @@
}
if (doctype->public_missing == false) {
- public_id = strndup((const char *) doctype->public_id.ptr,
+ public_id = parser_strndup(
+ (const char *) doctype->public_id.ptr,
(size_t) doctype->public_id.len);
} else {
public_id = strdup("");
@@ -365,7 +383,8 @@
}
if (doctype->system_missing == false) {
- system_id = strndup((const char *) doctype->system_id.ptr,
+ system_id = parser_strndup(
+ (const char *) doctype->system_id.ptr,
(size_t) doctype->system_id.len);
} else {
system_id = strdup("");
11 years, 5 months
r13779 chris_y - /trunk/netsurf/amiga/gui.c
by netsurf@semichrome.net
Author: chris_y
Date: Fri Mar 30 14:28:37 2012
New Revision: 13779
URL: http://source.netsurf-browser.org?rev=13779&view=rev
Log:
Search user data dir first for resources
Modified:
trunk/netsurf/amiga/gui.c
Modified: trunk/netsurf/amiga/gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/gui.c?rev=13779&r1=...
==============================================================================
--- trunk/netsurf/amiga/gui.c (original)
+++ trunk/netsurf/amiga/gui.c Fri Mar 30 14:28:37 2012
@@ -291,7 +291,13 @@
bool found = false;
char *remapped;
- /* Firstly check the user's selected theme. NB: ami_locate_resource()
+ /* Check NetSurf user data area first */
+
+ strcpy(fullpath, current_user_dir);
+ found = ami_gui_check_resource(fullpath, file);
+ if(found) return true;
+
+ /* Secondly check the user's selected theme. NB: ami_locate_resource()
* gets called for Messages before options are loaded */
if(nsoption_charp(theme))
11 years, 5 months
r13778 chris_y - in /trunk/netsurf/amiga: dist/Install gui.c
by netsurf@semichrome.net
Author: chris_y
Date: Fri Mar 30 13:18:15 2012
New Revision: 13778
URL: http://source.netsurf-browser.org?rev=13778&view=rev
Log:
Use 'user' env-var to determine username
Modified:
trunk/netsurf/amiga/dist/Install
trunk/netsurf/amiga/gui.c
Modified: trunk/netsurf/amiga/dist/Install
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/dist/Install?rev=13...
==============================================================================
--- trunk/netsurf/amiga/dist/Install (original)
+++ trunk/netsurf/amiga/dist/Install Fri Mar 30 13:18:15 2012
@@ -363,7 +363,12 @@
(complete 15)
-(set #options-exist (exists (tackon @default-dest "Users/Default/Choices")))
+(set #user (getenv "user"))
+(if (= #user "") (set #user "Default"))
+
+(set #user-dir (tackon (tackon @default-dest "Users") #user))
+(set #user-options (tackon #user-dir "Choices"))
+(set #options-exist (exists #user-options))
(set #searchengines-exist (exists (tackon @default-dest "Resources/SearchEngines")))
(set #aiss-theme "")
@@ -518,12 +523,12 @@
)
)
- (makedir (tackon @default-dest "Users/Default"))
+ (makedir #user-dir)
(textfile
(prompt "Setting default options")
(help @textfile-help)
- (dest (tackon @default-dest "Users/Default/Choices"))
+ (dest #user-options)
(append "theme:" #theme "\n")
(append "use_pubscreen:Workbench\n")
)
Modified: trunk/netsurf/amiga/gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/gui.c?rev=13778&r1=...
==============================================================================
--- trunk/netsurf/amiga/gui.c (original)
+++ trunk/netsurf/amiga/gui.c Fri Mar 30 13:18:15 2012
@@ -819,11 +819,18 @@
char messages[100];
char script[1024];
char temp[1024];
+ BPTR lock = 0;
+ int32 user = 0;
Object *splash_window = ami_gui_splash_open();
- current_user = ASPrintf("Default");
+ user = GetVar("user", temp, 1024, GVF_GLOBAL_ONLY);
+ current_user = ASPrintf("%s", (user == -1) ? "Default" : temp);
current_user_dir = ASPrintf("PROGDIR:Users/%s", current_user);
+
+ if(lock = CreateDirTree(current_user_dir))
+ UnLock(lock);
+
current_user_options = ASPrintf("%s/Choices", current_user_dir);
if(ami_locate_resource(messages, "Messages") == false)
11 years, 5 months
r13777 dsilvers - in /trunk/libwapcaplet: include/libwapcaplet/libwapcaplet.h src/libwapcaplet.c
by netsurf@semichrome.net
Author: dsilvers
Date: Thu Mar 29 07:27:43 2012
New Revision: 13777
URL: http://source.netsurf-browser.org?rev=13777&view=rev
Log:
Rework the majority of wapcaplet's interface to be macros. This removes *many* function call overheads but does require GNUish braced-group expressions.
Modified:
trunk/libwapcaplet/include/libwapcaplet/libwapcaplet.h
trunk/libwapcaplet/src/libwapcaplet.c
Modified: trunk/libwapcaplet/include/libwapcaplet/libwapcaplet.h
URL: http://source.netsurf-browser.org/trunk/libwapcaplet/include/libwapcaplet...
==============================================================================
--- trunk/libwapcaplet/include/libwapcaplet/libwapcaplet.h (original)
+++ trunk/libwapcaplet/include/libwapcaplet/libwapcaplet.h Thu Mar 29 07:27:43 2012
@@ -19,10 +19,32 @@
#include <stdint.h>
/**
+ * The type of a reference counter used in libwapcaplet.
+ */
+typedef uint32_t lwc_refcounter;
+
+/**
+ * The type of a hash value used in libwapcaplet.
+ */
+typedef uint32_t lwc_hash;
+
+/**
* An interned string.
- */
-typedef struct lwc_string_s lwc_string;
-
+ *
+ * NOTE: The contents of this struct are considered *PRIVATE* and may
+ * change in future revisions. Do not rely on them whatsoever.
+ * They're only here at all so that the ref, unref and matches etc can
+ * use them.
+ */
+typedef struct lwc_string_s {
+ struct lwc_string_s ** prevptr;
+ struct lwc_string_s * next;
+ size_t len;
+ lwc_hash hash;
+ lwc_refcounter refcnt;
+ struct lwc_string_s * insensitive;
+} lwc_string;
+
/**
* String iteration function
*
@@ -39,11 +61,6 @@
lwc_error_oom = 1, /**< Out of memory. */
lwc_error_range = 2 /**< Substring internment out of range. */
} lwc_error;
-
-/**
- * The type of a hash value used in libwapcaplet.
- */
-typedef uint32_t lwc_hash;
/**
* Intern a string.
@@ -104,7 +121,7 @@
* @note Use this if copying the string and intending both sides to retain
* ownership.
*/
-extern lwc_string *lwc_string_ref(lwc_string *str);
+#define lwc_string_ref(str) ({lwc_string *__lwc_s = (str); __lwc_s->refcnt++; __lwc_s;})
/**
* Release a reference on an lwc_string.
@@ -112,13 +129,27 @@
* This decreases the reference count on the given ::lwc_string.
*
* @param str The string to unref.
- * @return The result of the operation, if not OK then the string
- * was not unreffed.
*
* @note If the reference count reaches zero then the string will be
- * freed.
- */
-extern void lwc_string_unref(lwc_string *str);
+ * freed. (Ref count of 1 where string is its own insensitve match
+ * will also result in the string being freed.)
+ */
+#define lwc_string_unref(str) { \
+ lwc_string *__lwc_s = (str); \
+ __lwc_s->refcnt--; \
+ if ((__lwc_s->refcnt == 0) || \
+ ((__lwc_s->refcnt == 1) && (__lwc_s->insensitive == __lwc_s))) \
+ lwc_string_destroy(__lwc_s); \
+ }
+
+/**
+ * Destroy an unreffed lwc_string.
+ *
+ * This destroys an lwc_string whose reference count indicates that it should be.
+ *
+ * @param str The string to unref.
+ */
+extern void lwc_string_destroy(lwc_string *str);
/**
* Check if two interned strings are equal.
@@ -141,9 +172,37 @@
* @return Result of operation, if not ok then value pointed to
* by \a ret will not be valid.
*/
-extern lwc_error lwc_string_caseless_isequal(lwc_string *str1,
- lwc_string *str2,
- bool *ret);
+#define lwc_string_caseless_isequal(_str1,_str2,_ret) ({ \
+ lwc_error __lwc_err = lwc_error_ok; \
+ lwc_string *__lwc_str1 = (_str1); \
+ lwc_string *__lwc_str2 = (_str2); \
+ bool *__lwc_ret = (_ret); \
+ \
+ if (__lwc_str1->insensitive == NULL) { \
+ __lwc_err = lwc__intern_caseless_string(__lwc_str1); \
+ } \
+ if (__lwc_err == lwc_error_ok && __lwc_str2->insensitive == NULL) { \
+ __lwc_err = lwc__intern_caseless_string(__lwc_str2); \
+ } \
+ if (__lwc_err == lwc_error_ok) \
+ *__lwc_ret = (__lwc_str1->insensitive == __lwc_str2->insensitive); \
+ __lwc_err; \
+ })
+
+/**
+ * Intern a caseless copy of the passed string.
+ *
+ * @param str The string to intern the caseless copy of.
+ *
+ * @return lwc_error_ok if successful, otherwise the
+ * error code describing the issue.,
+ *
+ * @note This is for "internal" use by the caseless comparison
+ * macro and not for users.
+ */
+extern lwc_error
+lwc__intern_caseless_string(lwc_string *str);
+
/**
* Retrieve the data pointer for an interned string.
*
@@ -156,7 +215,7 @@
* in future. Any code relying on it currently should be
* modified to use ::lwc_string_length if possible.
*/
-extern const char *lwc_string_data(const lwc_string *str);
+#define lwc_string_data(str) ((const char *)((str)+1))
/**
* Retrieve the data length for an interned string.
@@ -164,7 +223,7 @@
* @param str The string to retrieve the length of.
* @return The length of \a str.
*/
-extern size_t lwc_string_length(const lwc_string *str);
+#define lwc_string_length(str) ((str)->len)
/**
* Retrieve (or compute if unavailable) a hash value for the content of the string.
@@ -178,7 +237,7 @@
* to be stable between invocations of the program. Never use the hash
* value as a way to directly identify the value of the string.
*/
-extern uint32_t lwc_string_hash_value(lwc_string *str);
+#define lwc_string_hash_value(str) ((str)->hash)
/**
* Iterate the context and return every string in it.
Modified: trunk/libwapcaplet/src/libwapcaplet.c
URL: http://source.netsurf-browser.org/trunk/libwapcaplet/src/libwapcaplet.c?r...
==============================================================================
--- trunk/libwapcaplet/src/libwapcaplet.c (original)
+++ trunk/libwapcaplet/src/libwapcaplet.c Thu Mar 29 07:27:43 2012
@@ -16,8 +16,6 @@
#define UNUSED(x) ((x) = (x))
#endif
-typedef uint32_t lwc_refcounter;
-
static inline lwc_hash
lwc__calculate_hash(const char *str, size_t len)
{
@@ -32,15 +30,6 @@
return z;
}
-
-struct lwc_string_s {
- lwc_string ** prevptr;
- lwc_string * next;
- size_t len;
- lwc_hash hash;
- lwc_refcounter refcnt;
- lwc_string * insensitive;
-};
#define STR_OF(str) ((char *)(str + 1))
#define CSTR_OF(str) ((const char *)(str + 1))
@@ -174,26 +163,10 @@
return lwc_intern_string(CSTR_OF(str) + ssoffset, sslen, ret);
}
-lwc_string *
-lwc_string_ref(lwc_string *str)
+void
+lwc_string_destroy(lwc_string *str)
{
assert(str);
-
- str->refcnt++;
-
- return str;
-}
-
-void
-lwc_string_unref(lwc_string *str)
-{
- assert(str);
-
- if (--(str->refcnt) > 1)
- return;
-
- if ((str->refcnt == 1) && (str->insensitive != str))
- return;
*(str->prevptr) = str->next;
@@ -254,7 +227,7 @@
}
}
-static lwc_error
+lwc_error
lwc__intern_caseless_string(lwc_string *str)
{
assert(str);
@@ -265,56 +238,6 @@
lwc__calculate_lcase_hash,
lwc__lcase_strncmp,
lwc__lcase_memcpy);
-}
-
-lwc_error
-lwc_string_caseless_isequal(lwc_string *str1,
- lwc_string *str2,
- bool *ret)
-{
- lwc_error err;
- assert(str1);
- assert(str2);
-
- if (str1->insensitive == NULL) {
- err = lwc__intern_caseless_string(str1);
- if (err != lwc_error_ok)
- return err;
- }
- if (str2->insensitive == NULL) {
- err = lwc__intern_caseless_string(str2);
- if (err != lwc_error_ok)
- return err;
- }
-
- *ret = (str1->insensitive == str2->insensitive);
- return lwc_error_ok;
-}
-
-/**** Simple accessors ****/
-
-const char *
-lwc_string_data(const lwc_string *str)
-{
- assert(str);
-
- return CSTR_OF(str);
-}
-
-size_t
-lwc_string_length(const lwc_string *str)
-{
- assert(str);
-
- return str->len;
-}
-
-uint32_t
-lwc_string_hash_value(lwc_string *str)
-{
- assert(str);
-
- return str->hash;
}
/**** Iteration ****/
11 years, 5 months
r13776 dsilvers - /trunk/libwapcaplet/Makefile
by netsurf@semichrome.net
Author: dsilvers
Date: Thu Mar 29 07:27:00 2012
New Revision: 13776
URL: http://source.netsurf-browser.org?rev=13776&view=rev
Log:
Remove pedantic from CFLAGS ready for wapcaplet rework
Modified:
trunk/libwapcaplet/Makefile
Modified: trunk/libwapcaplet/Makefile
URL: http://source.netsurf-browser.org/trunk/libwapcaplet/Makefile?rev=13776&r...
==============================================================================
--- trunk/libwapcaplet/Makefile (original)
+++ trunk/libwapcaplet/Makefile Thu Mar 29 07:27:00 2012
@@ -13,7 +13,7 @@
# Toolchain flags
WARNFLAGS := -Wall -W -Wundef -Wpointer-arith -Wcast-align \
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
- -Wmissing-declarations -Wnested-externs -pedantic
+ -Wmissing-declarations -Wnested-externs
# BeOS/Haiku standard library headers issue warnings
ifneq ($(TARGET),beos)
WARNFLAGS := $(WARNFLAGS) -Werror
11 years, 5 months