Gitweb links: ...log http://git.netsurf-browser.org/netsurf.git/shortlog/c0f9ae95b9f5ac169f225d2b52d57d05599b6772 ...commit http://git.netsurf-browser.org/netsurf.git/commit/c0f9ae95b9f5ac169f225d2b52d57d05599b6772 ...tree http://git.netsurf-browser.org/netsurf.git/tree/c0f9ae95b9f5ac169f225d2b52d57d05599b6772
The branch, master has been updated via c0f9ae95b9f5ac169f225d2b52d57d05599b6772 (commit) via 484fa8b110fb10b19808e73c49b345be638cb1db (commit) from 0d803b6c0d252c3a1a9fa07e37d9a0b08ce567b8 (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/c0f9ae95b9f5ac169f225d2b52d57d05599b6772 commit c0f9ae95b9f5ac169f225d2b52d57d05599b6772 Author: Vincent Sanders <vi...@netsurf-browser.org> Commit: Vincent Sanders <vi...@netsurf-browser.org> change the javascript bindings to use generated headers diff --git a/Makefile.sources.javascript b/Makefile.sources.javascript index 3092d1b..4633e9d 100644 --- a/Makefile.sources.javascript +++ b/Makefile.sources.javascript @@ -23,9 +23,10 @@ JSAPI_BINDING_text := javascript/jsapi/text.bnd JSAPI_BINDING_node := javascript/jsapi/node.bnd JSAPI_BINDING_event := javascript/jsapi/event.bnd -# 1: input file -# 2: output file -# 3: binding name +# 1: input binding file +# 2: source output file +# 3: header output file +# 4: binding name define convert_jsapi_binding S_JSAPI_BINDING += $(2) @@ -33,7 +34,9 @@ D_JSAPI_BINDING += $(patsubst %.c,%.d,$(2)) $(2): $(1) $(OBJROOT)/created $$(VQ)echo " GENBIND: $(1)" - $(Q)nsgenbind -I javascript/WebIDL -d $(patsubst %.c,%.d,$(2)) -h $(patsubst %.c,%.h,$(2)) -o $(2) $(1) + $(Q)nsgenbind -I javascript/WebIDL -d $(patsubst %.c,%.d,$(2)) -h $(3) -o $(2) $(1) + +$(3): $(2) endef @@ -52,7 +55,7 @@ S_JSAPI := S_JAVASCRIPT += content.c jsapi.c $(addprefix jsapi/,$(S_JSAPI)) -$(eval $(foreach V,$(filter JSAPI_BINDING_%,$(.VARIABLES)),$(call convert_jsapi_binding,$($(V)),$(OBJROOT)/$(patsubst JSAPI_BINDING_%,%,$(V)).c,$(patsubst JSAPI_BINDING_%,%,$(V))_jsapi))) +$(eval $(foreach V,$(filter JSAPI_BINDING_%,$(.VARIABLES)),$(call convert_jsapi_binding,$($(V)),$(OBJROOT)/$(patsubst JSAPI_BINDING_%,%,$(V)).c,$(OBJROOT)/$(patsubst JSAPI_BINDING_%,%,$(V)).h,$(patsubst JSAPI_BINDING_%,%,$(V))_jsapi))) else S_JAVASCRIPT += none.c diff --git a/javascript/jsapi.c b/javascript/jsapi.c index ef34371..7b68fe9 100644 --- a/javascript/jsapi.c +++ b/javascript/jsapi.c @@ -17,14 +17,16 @@ */ #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" - +#include "render/html_internal.h" #include "content/content.h" #include "javascript/content.h" #include "javascript/js.h" #include "utils/log.h" +#include "window.h" +#include "event.h" + static JSRuntime *rt; /* global runtime */ void js_initialise(void) diff --git a/javascript/jsapi/binding.h b/javascript/jsapi/binding.h deleted file mode 100644 index 7b0f614..0000000 --- a/javascript/jsapi/binding.h +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright 2012 Vincent Sanders <vi...@netsurf-browser.org> - * - * 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/>. - */ - -/** \file - * spidermonkey jsapi class bindings - */ - -#ifndef _NETSURF_JAVASCRIPT_JSAPI_BINDING_H_ -#define _NETSURF_JAVASCRIPT_JSAPI_BINDING_H_ - - -#include "render/html_internal.h" - -JSObject *jsapi_InitClass_Window(JSContext *cx, JSObject *parent); - -/** Create a new javascript window object - * - * @param cx The javascript context. - * @param parent The parent object or NULL for new global - * @param win_priv The private context to set on the object - * @return new javascript object or NULL on error - */ -JSObject *jsapi_new_Window(JSContext *cx, - JSObject *window, - JSObject *parent, - struct browser_window *bw, - html_content *htmlc); - -JSObject *jsapi_InitClass_Location(JSContext *cx, JSObject *parent); -JSObject *jsapi_new_Location(JSContext *cx, - JSObject *window, - JSObject *parent, - nsurl *url, - html_content *htmlc); - - -JSObject *jsapi_InitClass_Document(JSContext *cx, JSObject *parent); - -/** Create a new javascript document object - * - * @param cx The javascript context. - * @param parent The parent object, usually a global window object - * @param doc_priv The private context to set on the object - * @return new javascript object or NULL on error - */ -JSObject *jsapi_new_Document(JSContext *cx, - JSObject *proto, - JSObject *parent, - dom_document *node, - struct html_content *htmlc); - -JSObject *jsapi_InitClass_Console(JSContext *cx, JSObject *parent); -/** Create a new javascript console object - * - * @param cx The javascript context. - * @param parent The parent object, usually a global window object - * @return new javascript object or NULL on error - */ -JSObject *jsapi_new_Console(JSContext *cx, JSObject *prototype, JSObject *parent); - - -JSObject *jsapi_InitClass_Navigator(JSContext *cx, JSObject *parent); -/** Create a new javascript navigator object - * - * @param cx The javascript context. - * @param parent The parent object, usually a global window object - * @return new javascript object or NULL on error - */ -JSObject *jsapi_new_Navigator(JSContext *cx, JSObject *proto, JSObject *parent); - -extern JSClass JSClass_HTMLElement; - -JSObject *jsapi_InitClass_HTMLElement(JSContext *cx, JSObject *parent); -/** Create a new javascript element object - * - * @param cx The javascript context. - * @param parent The parent object, usually a global window object - * @param doc_priv The private context to set on the object - * @return new javascript object or NULL on error - */ -JSObject *jsapi_new_HTMLElement(JSContext *cx, - JSObject *prototype, - JSObject *parent, - dom_element *node, - struct html_content *htmlc); - -JSObject *jsapi_InitClass_HTMLCollection(JSContext *cx, JSObject *parent); -/** Create a new javascript element object - * - * @param cx The javascript context. - * @param parent The parent object, usually a global window object - * @param doc_priv The private context to set on the object - * @return new javascript object or NULL on error - */ -JSObject *jsapi_new_HTMLCollection(JSContext *cx, - JSObject *prototype, - JSObject *parent, - dom_html_collection *collection, - struct html_content *htmlc); - -JSObject *jsapi_InitClass_NodeList(JSContext *cx, JSObject *parent); -/** Create a new javascript element object - * - * @param cx The javascript context. - * @param parent The parent object, usually a global window object - * @param doc_priv The private context to set on the object - * @return new javascript object or NULL on error - */ -JSObject *jsapi_new_NodeList(JSContext *cx, - JSObject *prototype, - JSObject *parent, - dom_nodelist *nodelist, - struct html_content *htmlc); - - -extern JSClass JSClass_Text; - -JSObject *jsapi_InitClass_Text(JSContext *cx, JSObject *parent); -/** Create a new javascript text object - * - * @param cx The javascript context. - * @param parent The parent object, usually a global window object - * @param node The dom node to use in the object - * @return new javascript object or NULL on error - */ -JSObject *jsapi_new_Text(JSContext *cx, - JSObject *prototype, - JSObject *parent, - dom_text *node, - struct html_content *htmlc); - -JSObject *jsapi_InitClass_Node(JSContext *cx, JSObject *parent); -JSObject *jsapi_new_Node(JSContext *cx, - JSObject *prototype, - JSObject *parent); - -extern JSClass JSClass_Event; -JSObject *jsapi_InitClass_Event(JSContext *cx, JSObject *parent); -JSObject *jsapi_new_Event(JSContext *cx, - JSObject *prototype, - JSObject *parent, - dom_event *event); - -#endif diff --git a/javascript/jsapi/console.bnd b/javascript/jsapi/console.bnd index 7c34845..9b3d21f 100644 --- a/javascript/jsapi/console.bnd +++ b/javascript/jsapi/console.bnd @@ -19,9 +19,9 @@ preamble %{ #include "utils/config.h" #include "utils/log.h" - #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" + +#include "console.h" %} diff --git a/javascript/jsapi/event.bnd b/javascript/jsapi/event.bnd index cc03c92..b0880d9 100644 --- a/javascript/jsapi/event.bnd +++ b/javascript/jsapi/event.bnd @@ -21,9 +21,9 @@ preamble %{ #include "utils/config.h" #include "utils/log.h" - #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" + +#include "event.h" %} diff --git a/javascript/jsapi/htmlcollection.bnd b/javascript/jsapi/htmlcollection.bnd index 5e99e48..38e14ed 100644 --- a/javascript/jsapi/htmlcollection.bnd +++ b/javascript/jsapi/htmlcollection.bnd @@ -23,9 +23,11 @@ preamble %{ #include "utils/config.h" #include "utils/log.h" - #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" +#include "render/html_internal.h" + +#include "htmlelement.h" +#include "htmlcollection.h" %} diff --git a/javascript/jsapi/htmldocument.bnd b/javascript/jsapi/htmldocument.bnd index c29e470..ddf408a 100644 --- a/javascript/jsapi/htmldocument.bnd +++ b/javascript/jsapi/htmldocument.bnd @@ -25,12 +25,16 @@ preamble %{ #include "utils/log.h" #include "utils/corestrings.h" #include "utils/libdom.h" - #include "content/urldb.h" - #include "javascript/js.h" #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" +#include "render/html_internal.h" + +#include "htmldocument.h" +#include "htmlelement.h" +#include "text.h" +#include "nodelist.h" +#include "location.h" %} diff --git a/javascript/jsapi/htmlelement.bnd b/javascript/jsapi/htmlelement.bnd index 3ede93b..48ebbdb 100644 --- a/javascript/jsapi/htmlelement.bnd +++ b/javascript/jsapi/htmlelement.bnd @@ -24,10 +24,13 @@ preamble %{ #include "utils/config.h" #include "utils/log.h" #include "utils/corestrings.h" - #include "javascript/js.h" #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" +#include "render/html_internal.h" + +#include "htmlelement.h" +#include "text.h" +#include "location.h" %} diff --git a/javascript/jsapi/location.bnd b/javascript/jsapi/location.bnd index 32677d1..85117a2 100644 --- a/javascript/jsapi/location.bnd +++ b/javascript/jsapi/location.bnd @@ -21,9 +21,10 @@ preamble %{ #include "utils/config.h" #include "utils/log.h" - #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" +#include "render/html_internal.h" + +#include "location.h" %} diff --git a/javascript/jsapi/navigator.bnd b/javascript/jsapi/navigator.bnd index e63e9a9..d040ede 100644 --- a/javascript/jsapi/navigator.bnd +++ b/javascript/jsapi/navigator.bnd @@ -24,14 +24,13 @@ preamble %{ #include "desktop/netsurf.h" #include "desktop/options.h" - #include "utils/config.h" #include "utils/useragent.h" #include "utils/log.h" #include "utils/utsname.h" - #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" + +#include "navigator.h" /* * navigator properties for netsurf diff --git a/javascript/jsapi/node.bnd b/javascript/jsapi/node.bnd index bcf0ef7..49fd06b 100644 --- a/javascript/jsapi/node.bnd +++ b/javascript/jsapi/node.bnd @@ -23,7 +23,8 @@ preamble %{ #include "utils/log.h" #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" + +#include "node.h" %} diff --git a/javascript/jsapi/nodelist.bnd b/javascript/jsapi/nodelist.bnd index b57dc6e..4aa8c47 100644 --- a/javascript/jsapi/nodelist.bnd +++ b/javascript/jsapi/nodelist.bnd @@ -20,9 +20,11 @@ preamble %{ #include "utils/config.h" #include "utils/log.h" - #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" +#include "render/html_internal.h" + +#include "nodelist.h" +#include "htmlelement.h" %} diff --git a/javascript/jsapi/text.bnd b/javascript/jsapi/text.bnd index 42791d0..6b43521 100644 --- a/javascript/jsapi/text.bnd +++ b/javascript/jsapi/text.bnd @@ -23,9 +23,11 @@ preamble %{ #include "utils/config.h" #include "utils/log.h" - +#include "render/html_internal.h" #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" + +#include "text.h" +#include "htmlelement.h" %} diff --git a/javascript/jsapi/window.bnd b/javascript/jsapi/window.bnd index 6153e90..288b5b3 100644 --- a/javascript/jsapi/window.bnd +++ b/javascript/jsapi/window.bnd @@ -24,10 +24,20 @@ preamble %{ #include "utils/config.h" #include "utils/log.h" #include "utils/corestrings.h" - +#include "render/html_internal.h" #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" +#include "console.h" +#include "navigator.h" +#include "event.h" +#include "node.h" +#include "htmlcollection.h" +#include "nodelist.h" +#include "htmldocument.h" +#include "text.h" +#include "htmlelement.h" +#include "window.h" +#include "location.h" %} commitdiff http://git.netsurf-browser.org/netsurf.git/commitdiff/484fa8b110fb10b19808e73c49b345be638cb1db commit 484fa8b110fb10b19808e73c49b345be638cb1db Author: Vincent Sanders <vi...@netsurf-browser.org> Commit: Vincent Sanders <vi...@netsurf-browser.org> move common include path setup to core Makefile diff --git a/Makefile b/Makefile index baf8354..7a09e6c 100644 --- a/Makefile +++ b/Makefile @@ -426,9 +426,14 @@ $(eval $(call feature_enabled,LIBICONV_PLUG,-DLIBICONV_PLUG,,glibc internal icon # common libraries without pkg-config support LDFLAGS += -lz +# add top level and build directory to include search path +CFLAGS += -I. -I$(OBJROOT) + +# export the user agent format CFLAGS += -DNETSURF_UA_FORMAT_STRING=\"$(NETSURF_UA_FORMAT_STRING)\" -CFLAGS += -DNETSURF_HOMEPAGE=\"$(NETSURF_HOMEPAGE)\" +# set the default homepage to use +CFLAGS += -DNETSURF_HOMEPAGE=\"$(NETSURF_HOMEPAGE)\" # ---------------------------------------------------------------------------- # General make rules diff --git a/Makefile.defaults b/Makefile.defaults index 812a5a9..7650b38 100644 --- a/Makefile.defaults +++ b/Makefile.defaults @@ -93,7 +93,7 @@ NETSURF_HOMEPAGE := "about:welcome" NETSURF_USE_LIBICONV_PLUG := YES # Initial CFLAGS. Optimisation level etc. tend to be target specific. -CFLAGS := +CFLAGS := # Default installation/execution prefix PREFIX ?= /usr/local diff --git a/Makefile.sources.javascript b/Makefile.sources.javascript index 76a6ff1..3092d1b 100644 --- a/Makefile.sources.javascript +++ b/Makefile.sources.javascript @@ -33,7 +33,7 @@ D_JSAPI_BINDING += $(patsubst %.c,%.d,$(2)) $(2): $(1) $(OBJROOT)/created $$(VQ)echo " GENBIND: $(1)" - $(Q)nsgenbind -I javascript/WebIDL -d $(patsubst %.c,%.d,$(2)) -o $(2) $(1) + $(Q)nsgenbind -I javascript/WebIDL -d $(patsubst %.c,%.d,$(2)) -h $(patsubst %.c,%.h,$(2)) -o $(2) $(1) endef diff --git a/amiga/Makefile.target b/amiga/Makefile.target index ec43fdd..f2c4299 100644 --- a/amiga/Makefile.target +++ b/amiga/Makefile.target @@ -2,7 +2,7 @@ # Amiga target setup # ---------------------------------------------------------------------------- -CFLAGS += -std=c99 -I . -Dnsamiga +CFLAGS += -std=c99 -Dnsamiga ifneq ($(SUBTARGET),os3) CFLAGS += -U__STRICT_ANSI__ -D__USE_INLINE__ -D__USE_BASETYPE__ diff --git a/atari/Makefile.target b/atari/Makefile.target index 7f05734..8e87a74 100644 --- a/atari/Makefile.target +++ b/atari/Makefile.target @@ -58,7 +58,7 @@ endif $(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP)) $(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF)) -CFLAGS += -U__STRICT_ANSI__ -std=c99 -I. -Dsmall $(WARNFLAGS) -Dnsatari \ +CFLAGS += -U__STRICT_ANSI__ -std=c99 -Dsmall $(WARNFLAGS) -Dnsatari \ -D_BSD_SOURCE \ -D_XOPEN_SOURCE=600 \ -D_POSIX_C_SOURCE=200112L \ diff --git a/beos/Makefile.target b/beos/Makefile.target index 4edde01..7b473dd 100644 --- a/beos/Makefile.target +++ b/beos/Makefile.target @@ -3,35 +3,34 @@ # ---------------------------------------------------------------------------- - $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) )) - - LDFLAGS += -L/boot/home/config/lib - # for Haiku - LDFLAGS += -L/boot/common/lib - # some people do *not* have libm... - LDFLAGS += -lssl -lcrypto -lcss - $(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny))) - LDFLAGS += -ldom -lparserutils -lhubbub -lwapcaplet - LDFLAGS += -lexpat -lcurl -liconv - - CFLAGS += -I. -O $(WARNFLAGS) -Dnsbeos \ - -D_BSD_SOURCE -D_POSIX_C_SOURCE \ - -Drestrict="" -Wno-multichar - # DEBUG - CFLAGS += -g -O0 - # -DDEBUG=1 - - BEOS_BERES := beres - BEOS_RC := rc - BEOS_XRES := xres - BEOS_SETVER := setversion - BEOS_MIMESET := mimeset - VERSION_FULL := $(shell sed -n '/"/{s/.*"\(.*\)".*/\1/;p;}' desktop/version.c) - VERSION_MAJ := $(shell sed -n '/_major/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c) - VERSION_MIN := $(shell sed -n '/_minor/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c) - RSRC_BEOS = $(addprefix $(OBJROOT)/,$(subst /,_,$(patsubst %.rdef,%.rsrc,$(RDEF_BEOS)))) - RESOURCES = $(RSRC_BEOS) - ifeq ($(HOST),beos) +$(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) )) + +LDFLAGS += -L/boot/home/config/lib +# for Haiku +LDFLAGS += -L/boot/common/lib +# some people do *not* have libm... +LDFLAGS += -lssl -lcrypto -lcss +$(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny))) +LDFLAGS += -ldom -lparserutils -lhubbub -lwapcaplet +LDFLAGS += -lexpat -lcurl -liconv + +CFLAGS += -O $(WARNFLAGS) -Dnsbeos -D_BSD_SOURCE -D_POSIX_C_SOURCE \ + -Drestrict="" -Wno-multichar +# DEBUG +CFLAGS += -g -O0 +# -DDEBUG=1 + +BEOS_BERES := beres +BEOS_RC := rc +BEOS_XRES := xres +BEOS_SETVER := setversion +BEOS_MIMESET := mimeset +VERSION_FULL := $(shell sed -n '/"/{s/.*"\(.*\)".*/\1/;p;}' desktop/version.c) +VERSION_MAJ := $(shell sed -n '/_major/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c) +VERSION_MIN := $(shell sed -n '/_minor/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c) +RSRC_BEOS = $(addprefix $(OBJROOT)/,$(subst /,_,$(patsubst %.rdef,%.rsrc,$(RDEF_BEOS)))) +RESOURCES = $(RSRC_BEOS) +ifeq ($(HOST),beos) CFLAGS += -I/boot/home/config/include \ -I/boot/home/config/include/libmng \ -I/boot/home/config/include/hubbub \ @@ -66,22 +65,22 @@ LDFLAGS += -lstdc++.r4 else LDFLAGS += -lstdc++ -lsupc++ - endif +endif - ifeq ($(HOST),beos) - CFLAGS += -I$(PREFIX)/include - LDFLAGS += -L$(PREFIX)/lib - $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp))) - $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif))) - $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) )) - else - NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP - NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF - NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG - $(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP)) - $(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF)) - $(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG )) - endif +ifeq ($(HOST),beos) + CFLAGS += -I$(PREFIX)/include + LDFLAGS += -L$(PREFIX)/lib + $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp))) + $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif))) + $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) )) +else + NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP + NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF + NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG + $(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP)) + $(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF)) + $(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG )) +endif # ---------------------------------------------------------------------------- # Source file setup @@ -89,9 +88,9 @@ # S_BEOS are sources purely for the BeOS build S_BEOS := about.cpp bitmap.cpp download.cpp fetch_rsrc.cpp filetype.cpp \ - font.cpp gui.cpp login.cpp gui_options.cpp plotters.cpp scaffolding.cpp \ - search.cpp schedule.cpp thumbnail.cpp treeview.cpp throbber.cpp \ - window.cpp system_colour.cpp + font.cpp gui.cpp login.cpp gui_options.cpp plotters.cpp \ + scaffolding.cpp search.cpp schedule.cpp thumbnail.cpp treeview.cpp \ + throbber.cpp window.cpp system_colour.cpp S_BEOS := $(addprefix beos/,$(S_BEOS)) RDEF_BEOS := res.rdef diff --git a/cocoa/Makefile.target b/cocoa/Makefile.target index d975a0c..2da4c5b 100644 --- a/cocoa/Makefile.target +++ b/cocoa/Makefile.target @@ -10,11 +10,9 @@ LDFLAGS += -lm -lcurl -liconv LDFLAGS += -lssl -lcrypto - CFLAGS += -I. -O $(WARNFLAGS) -Dnscocoa \ + CFLAGS += -O $(WARNFLAGS) -Dnscocoa \ -D_BSD_SOURCE -D_POSIX_C_SOURCE \ - -std=c99 - - CFLAGS += -g -Os -Wno-uninitialized + -std=c99 -g -Os CFLAGS += $(shell $(PKG_CONFIG) --cflags libhubbub libcss libdom) diff --git a/framebuffer/Makefile.target b/framebuffer/Makefile.target index f3d91de..8ab8804 100644 --- a/framebuffer/Makefile.target +++ b/framebuffer/Makefile.target @@ -44,7 +44,7 @@ $(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF)) $(eval $(call pkg_config_find_and_add_enabled,MOZJS,mozjs185,JavaScript)) $(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript)) -CFLAGS += -std=c99 -g -I. -Dsmall $(WARNFLAGS) \ +CFLAGS += -std=c99 -g -Dsmall $(WARNFLAGS) \ -D_BSD_SOURCE \ -D_XOPEN_SOURCE=600 \ -D_POSIX_C_SOURCE=200112L \ diff --git a/gtk/Makefile.target b/gtk/Makefile.target index f9b5436..2d1eebf 100644 --- a/gtk/Makefile.target +++ b/gtk/Makefile.target @@ -51,7 +51,7 @@ GTKCFLAGS := -std=c99 -Dgtk -Dnsgtk \ -D_POSIX_C_SOURCE=200112L \ -D_NETBSD_SOURCE \ -DGTK_RESPATH=\"$(NETSURF_GTK_RESOURCES)\" \ - $(WARNFLAGS) -I. -g + $(WARNFLAGS) -g # non optional pkg-configed libs $(eval $(call pkg_config_find_and_add,libcss,CSS)) diff --git a/monkey/Makefile.target b/monkey/Makefile.target index fa15a50..05a32d0 100644 --- a/monkey/Makefile.target +++ b/monkey/Makefile.target @@ -41,7 +41,7 @@ MONKEYCFLAGS := -std=c99 -Dmonkey -Dnsmonkey \ -D_POSIX_C_SOURCE=200112L \ -D_NETBSD_SOURCE \ -DMONKEY_RESPATH=\"$(NETSURF_MONKEY_RESOURCES)\" \ - $(WARNFLAGS) -I. -g \ + $(WARNFLAGS) -g \ $(shell $(PKG_CONFIG) --cflags glib-2.0) \ $(shell $(PKG_CONFIG) --cflags libdom libcurl) \ $(shell $(PKG_CONFIG) --cflags openssl) \ diff --git a/riscos/Makefile.target b/riscos/Makefile.target index e7370e7..faefa41 100644 --- a/riscos/Makefile.target +++ b/riscos/Makefile.target @@ -42,12 +42,10 @@ TPD_RISCOS = $(foreach TPL,$(notdir $(TPL_RISCOS)), \ RESOURCES = $(TPD_RISCOS) split-messages -CFLAGS += -I. $(WARNFLAGS) -Driscos \ - -std=c99 -D_BSD_SOURCE -D_POSIX_C_SOURCE \ - -mpoke-function-name -fno-strict-aliasing +CFLAGS += $(WARNFLAGS) -Driscos -std=c99 -D_BSD_SOURCE -D_POSIX_C_SOURCE \ + -mpoke-function-name -fno-strict-aliasing -CFLAGS += -I$(GCCSDK_INSTALL_ENV)/include \ - -I$(GCCSDK_INSTALL_ENV)/include/libmng +CFLAGS += -I$(GCCSDK_INSTALL_ENV)/include -I$(GCCSDK_INSTALL_ENV)/include/libmng ifeq ($(HOST),riscos) CFLAGS += -I<OSLib$$Dir> -mthrowback endif diff --git a/windows/Makefile.target b/windows/Makefile.target index 90f97fb..c373ff5 100644 --- a/windows/Makefile.target +++ b/windows/Makefile.target @@ -3,48 +3,51 @@ # # This file is part of NetSurf - LDFLAGS += -L${GCCSDK_INSTALL_ENV}/lib - CFLAGS += -I${GCCSDK_INSTALL_ENV}/include/ - - NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG - NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE - NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP - NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF - NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG - $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp))) - $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif))) - $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) )) - $(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny))) - $(eval $(call feature_enabled,MNG,,-llcms -ljpeg,PNG/JNG/MNG (libmng))) - - ifneq ($(PKG_CONFIG),) - CFLAGS += $(shell $(PKG_CONFIG) --cflags zlib libcares libcurl libhubbub \ - libparserutils libdom libwapcaplet) - LDFLAGS += $(shell $(PKG_CONFIG) --libs zlib libcurl libcares \ - libhubbub libparserutils libcss libdom libwapcaplet) - else - LDFLAGS += -lhubbub -lcss -lparserutils -lwapcaplet -lcurl -lz - endif - - LDFLAGS += -lssl -lcrypto -lregex -liconv \ +LDFLAGS += -L${GCCSDK_INSTALL_ENV}/lib +CFLAGS += -I${GCCSDK_INSTALL_ENV}/include/ + +NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG +NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE +NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP +NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF +NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG + +$(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp))) +$(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif))) +$(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) )) +$(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny))) +$(eval $(call feature_enabled,MNG,,-llcms -ljpeg,PNG/JNG/MNG (libmng))) + +ifneq ($(PKG_CONFIG),) + $(eval $(call pkg_config_find_and_add,zlib,ZLib)) + $(eval $(call pkg_config_find_and_add,libcares,Cares)) + $(eval $(call pkg_config_find_and_add,libwapcaplet,Wapcaplet)) + $(eval $(call pkg_config_find_and_add,libparserutils,Parserutils)) + $(eval $(call pkg_config_find_and_add,libhubbub,Hubbub)) + $(eval $(call pkg_config_find_and_add,libdom,DOM)) + $(eval $(call pkg_config_find_and_add,libcss,CSS)) + $(eval $(call pkg_config_find_and_add,libcurl,Curl)) +else + LDFLAGS += -lhubbub -lcss -lparserutils -lwapcaplet -lcurl -lz +endif + +LDFLAGS += -lssl -lcrypto -lregex -liconv \ -lgdi32 -lcomctl32 -lws2_32 -lmsimg32 -mwindows - CFLAGS += -U__STRICT_ANSI__ -mwin32 - # only windows versions after XP are supported - CFLAGS += '-DWINVER=0x0501' - CFLAGS += '-D_WIN32_WINNT=0x0501' - CFLAGS += '-D_WIN32_WINDOWS=0x0501' - CFLAGS += '-D_WIN32_IE=0x0501' +CFLAGS += -U__STRICT_ANSI__ -mwin32 +# only windows versions after XP are supported +CFLAGS += '-DWINVER=0x0501' +CFLAGS += '-D_WIN32_WINNT=0x0501' +CFLAGS += '-D_WIN32_WINDOWS=0x0501' +CFLAGS += '-D_WIN32_IE=0x0501' - #installed resource path - CFLAGS += '-DNETSURF_WINDOWS_RESPATH="$(NETSURF_WINDOWS_RESPATH)"' +#installed resource path +CFLAGS += '-DNETSURF_WINDOWS_RESPATH="$(NETSURF_WINDOWS_RESPATH)"' +WSCFLAGS := -std=c99 $(WARNFLAGS) -DCURL_STATICLIB -DCARES_STATICLIB -g - WSCFLAGS := -std=c99 \ - $(WARNFLAGS) -I. \ - -DCURL_STATICLIB -DCARES_STATICLIB -g - CFLAGS += $(WSCFLAGS) - LDFLAGS += $(WSCFLAGS) +CFLAGS += $(WSCFLAGS) +LDFLAGS += $(WSCFLAGS) # ---------------------------------------------------------------------------- # built-in resource setup ----------------------------------------------------------------------- Summary of changes: Makefile | 7 ++- Makefile.defaults | 2 +- Makefile.sources.javascript | 13 ++- amiga/Makefile.target | 2 +- atari/Makefile.target | 2 +- beos/Makefile.target | 93 ++++++++++---------- cocoa/Makefile.target | 6 +- framebuffer/Makefile.target | 2 +- gtk/Makefile.target | 2 +- javascript/jsapi.c | 6 +- javascript/jsapi/binding.h | 159 ----------------------------------- javascript/jsapi/console.bnd | 4 +- javascript/jsapi/event.bnd | 4 +- javascript/jsapi/htmlcollection.bnd | 6 +- javascript/jsapi/htmldocument.bnd | 10 ++- javascript/jsapi/htmlelement.bnd | 7 +- javascript/jsapi/location.bnd | 5 +- javascript/jsapi/navigator.bnd | 5 +- javascript/jsapi/node.bnd | 3 +- javascript/jsapi/nodelist.bnd | 6 +- javascript/jsapi/text.bnd | 6 +- javascript/jsapi/window.bnd | 14 +++- monkey/Makefile.target | 2 +- riscos/Makefile.target | 8 +- windows/Makefile.target | 77 +++++++++-------- 25 files changed, 162 insertions(+), 289 deletions(-) delete mode 100644 javascript/jsapi/binding.h diff --git a/Makefile b/Makefile index baf8354..7a09e6c 100644 --- a/Makefile +++ b/Makefile @@ -426,9 +426,14 @@ $(eval $(call feature_enabled,LIBICONV_PLUG,-DLIBICONV_PLUG,,glibc internal icon # common libraries without pkg-config support LDFLAGS += -lz +# add top level and build directory to include search path +CFLAGS += -I. -I$(OBJROOT) + +# export the user agent format CFLAGS += -DNETSURF_UA_FORMAT_STRING=\"$(NETSURF_UA_FORMAT_STRING)\" -CFLAGS += -DNETSURF_HOMEPAGE=\"$(NETSURF_HOMEPAGE)\" +# set the default homepage to use +CFLAGS += -DNETSURF_HOMEPAGE=\"$(NETSURF_HOMEPAGE)\" # ---------------------------------------------------------------------------- # General make rules diff --git a/Makefile.defaults b/Makefile.defaults index 812a5a9..7650b38 100644 --- a/Makefile.defaults +++ b/Makefile.defaults @@ -93,7 +93,7 @@ NETSURF_HOMEPAGE := "about:welcome" NETSURF_USE_LIBICONV_PLUG := YES # Initial CFLAGS. Optimisation level etc. tend to be target specific. -CFLAGS := +CFLAGS := # Default installation/execution prefix PREFIX ?= /usr/local diff --git a/Makefile.sources.javascript b/Makefile.sources.javascript index 76a6ff1..4633e9d 100644 --- a/Makefile.sources.javascript +++ b/Makefile.sources.javascript @@ -23,9 +23,10 @@ JSAPI_BINDING_text := javascript/jsapi/text.bnd JSAPI_BINDING_node := javascript/jsapi/node.bnd JSAPI_BINDING_event := javascript/jsapi/event.bnd -# 1: input file -# 2: output file -# 3: binding name +# 1: input binding file +# 2: source output file +# 3: header output file +# 4: binding name define convert_jsapi_binding S_JSAPI_BINDING += $(2) @@ -33,7 +34,9 @@ D_JSAPI_BINDING += $(patsubst %.c,%.d,$(2)) $(2): $(1) $(OBJROOT)/created $$(VQ)echo " GENBIND: $(1)" - $(Q)nsgenbind -I javascript/WebIDL -d $(patsubst %.c,%.d,$(2)) -o $(2) $(1) + $(Q)nsgenbind -I javascript/WebIDL -d $(patsubst %.c,%.d,$(2)) -h $(3) -o $(2) $(1) + +$(3): $(2) endef @@ -52,7 +55,7 @@ S_JSAPI := S_JAVASCRIPT += content.c jsapi.c $(addprefix jsapi/,$(S_JSAPI)) -$(eval $(foreach V,$(filter JSAPI_BINDING_%,$(.VARIABLES)),$(call convert_jsapi_binding,$($(V)),$(OBJROOT)/$(patsubst JSAPI_BINDING_%,%,$(V)).c,$(patsubst JSAPI_BINDING_%,%,$(V))_jsapi))) +$(eval $(foreach V,$(filter JSAPI_BINDING_%,$(.VARIABLES)),$(call convert_jsapi_binding,$($(V)),$(OBJROOT)/$(patsubst JSAPI_BINDING_%,%,$(V)).c,$(OBJROOT)/$(patsubst JSAPI_BINDING_%,%,$(V)).h,$(patsubst JSAPI_BINDING_%,%,$(V))_jsapi))) else S_JAVASCRIPT += none.c diff --git a/amiga/Makefile.target b/amiga/Makefile.target index ec43fdd..f2c4299 100644 --- a/amiga/Makefile.target +++ b/amiga/Makefile.target @@ -2,7 +2,7 @@ # Amiga target setup # ---------------------------------------------------------------------------- -CFLAGS += -std=c99 -I . -Dnsamiga +CFLAGS += -std=c99 -Dnsamiga ifneq ($(SUBTARGET),os3) CFLAGS += -U__STRICT_ANSI__ -D__USE_INLINE__ -D__USE_BASETYPE__ diff --git a/atari/Makefile.target b/atari/Makefile.target index 7f05734..8e87a74 100644 --- a/atari/Makefile.target +++ b/atari/Makefile.target @@ -58,7 +58,7 @@ endif $(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP)) $(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF)) -CFLAGS += -U__STRICT_ANSI__ -std=c99 -I. -Dsmall $(WARNFLAGS) -Dnsatari \ +CFLAGS += -U__STRICT_ANSI__ -std=c99 -Dsmall $(WARNFLAGS) -Dnsatari \ -D_BSD_SOURCE \ -D_XOPEN_SOURCE=600 \ -D_POSIX_C_SOURCE=200112L \ diff --git a/beos/Makefile.target b/beos/Makefile.target index 4edde01..7b473dd 100644 --- a/beos/Makefile.target +++ b/beos/Makefile.target @@ -3,35 +3,34 @@ # ---------------------------------------------------------------------------- - $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) )) - - LDFLAGS += -L/boot/home/config/lib - # for Haiku - LDFLAGS += -L/boot/common/lib - # some people do *not* have libm... - LDFLAGS += -lssl -lcrypto -lcss - $(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny))) - LDFLAGS += -ldom -lparserutils -lhubbub -lwapcaplet - LDFLAGS += -lexpat -lcurl -liconv - - CFLAGS += -I. -O $(WARNFLAGS) -Dnsbeos \ - -D_BSD_SOURCE -D_POSIX_C_SOURCE \ - -Drestrict="" -Wno-multichar - # DEBUG - CFLAGS += -g -O0 - # -DDEBUG=1 - - BEOS_BERES := beres - BEOS_RC := rc - BEOS_XRES := xres - BEOS_SETVER := setversion - BEOS_MIMESET := mimeset - VERSION_FULL := $(shell sed -n '/"/{s/.*"\(.*\)".*/\1/;p;}' desktop/version.c) - VERSION_MAJ := $(shell sed -n '/_major/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c) - VERSION_MIN := $(shell sed -n '/_minor/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c) - RSRC_BEOS = $(addprefix $(OBJROOT)/,$(subst /,_,$(patsubst %.rdef,%.rsrc,$(RDEF_BEOS)))) - RESOURCES = $(RSRC_BEOS) - ifeq ($(HOST),beos) +$(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) )) + +LDFLAGS += -L/boot/home/config/lib +# for Haiku +LDFLAGS += -L/boot/common/lib +# some people do *not* have libm... +LDFLAGS += -lssl -lcrypto -lcss +$(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny))) +LDFLAGS += -ldom -lparserutils -lhubbub -lwapcaplet +LDFLAGS += -lexpat -lcurl -liconv + +CFLAGS += -O $(WARNFLAGS) -Dnsbeos -D_BSD_SOURCE -D_POSIX_C_SOURCE \ + -Drestrict="" -Wno-multichar +# DEBUG +CFLAGS += -g -O0 +# -DDEBUG=1 + +BEOS_BERES := beres +BEOS_RC := rc +BEOS_XRES := xres +BEOS_SETVER := setversion +BEOS_MIMESET := mimeset +VERSION_FULL := $(shell sed -n '/"/{s/.*"\(.*\)".*/\1/;p;}' desktop/version.c) +VERSION_MAJ := $(shell sed -n '/_major/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c) +VERSION_MIN := $(shell sed -n '/_minor/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c) +RSRC_BEOS = $(addprefix $(OBJROOT)/,$(subst /,_,$(patsubst %.rdef,%.rsrc,$(RDEF_BEOS)))) +RESOURCES = $(RSRC_BEOS) +ifeq ($(HOST),beos) CFLAGS += -I/boot/home/config/include \ -I/boot/home/config/include/libmng \ -I/boot/home/config/include/hubbub \ @@ -66,22 +65,22 @@ LDFLAGS += -lstdc++.r4 else LDFLAGS += -lstdc++ -lsupc++ - endif +endif - ifeq ($(HOST),beos) - CFLAGS += -I$(PREFIX)/include - LDFLAGS += -L$(PREFIX)/lib - $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp))) - $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif))) - $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) )) - else - NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP - NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF - NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG - $(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP)) - $(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF)) - $(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG )) - endif +ifeq ($(HOST),beos) + CFLAGS += -I$(PREFIX)/include + LDFLAGS += -L$(PREFIX)/lib + $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp))) + $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif))) + $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) )) +else + NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP + NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF + NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG + $(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP)) + $(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF)) + $(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG )) +endif # ---------------------------------------------------------------------------- # Source file setup @@ -89,9 +88,9 @@ # S_BEOS are sources purely for the BeOS build S_BEOS := about.cpp bitmap.cpp download.cpp fetch_rsrc.cpp filetype.cpp \ - font.cpp gui.cpp login.cpp gui_options.cpp plotters.cpp scaffolding.cpp \ - search.cpp schedule.cpp thumbnail.cpp treeview.cpp throbber.cpp \ - window.cpp system_colour.cpp + font.cpp gui.cpp login.cpp gui_options.cpp plotters.cpp \ + scaffolding.cpp search.cpp schedule.cpp thumbnail.cpp treeview.cpp \ + throbber.cpp window.cpp system_colour.cpp S_BEOS := $(addprefix beos/,$(S_BEOS)) RDEF_BEOS := res.rdef diff --git a/cocoa/Makefile.target b/cocoa/Makefile.target index d975a0c..2da4c5b 100644 --- a/cocoa/Makefile.target +++ b/cocoa/Makefile.target @@ -10,11 +10,9 @@ LDFLAGS += -lm -lcurl -liconv LDFLAGS += -lssl -lcrypto - CFLAGS += -I. -O $(WARNFLAGS) -Dnscocoa \ + CFLAGS += -O $(WARNFLAGS) -Dnscocoa \ -D_BSD_SOURCE -D_POSIX_C_SOURCE \ - -std=c99 - - CFLAGS += -g -Os -Wno-uninitialized + -std=c99 -g -Os CFLAGS += $(shell $(PKG_CONFIG) --cflags libhubbub libcss libdom) diff --git a/framebuffer/Makefile.target b/framebuffer/Makefile.target index f3d91de..8ab8804 100644 --- a/framebuffer/Makefile.target +++ b/framebuffer/Makefile.target @@ -44,7 +44,7 @@ $(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF)) $(eval $(call pkg_config_find_and_add_enabled,MOZJS,mozjs185,JavaScript)) $(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript)) -CFLAGS += -std=c99 -g -I. -Dsmall $(WARNFLAGS) \ +CFLAGS += -std=c99 -g -Dsmall $(WARNFLAGS) \ -D_BSD_SOURCE \ -D_XOPEN_SOURCE=600 \ -D_POSIX_C_SOURCE=200112L \ diff --git a/gtk/Makefile.target b/gtk/Makefile.target index f9b5436..2d1eebf 100644 --- a/gtk/Makefile.target +++ b/gtk/Makefile.target @@ -51,7 +51,7 @@ GTKCFLAGS := -std=c99 -Dgtk -Dnsgtk \ -D_POSIX_C_SOURCE=200112L \ -D_NETBSD_SOURCE \ -DGTK_RESPATH=\"$(NETSURF_GTK_RESOURCES)\" \ - $(WARNFLAGS) -I. -g + $(WARNFLAGS) -g # non optional pkg-configed libs $(eval $(call pkg_config_find_and_add,libcss,CSS)) diff --git a/javascript/jsapi.c b/javascript/jsapi.c index ef34371..7b68fe9 100644 --- a/javascript/jsapi.c +++ b/javascript/jsapi.c @@ -17,14 +17,16 @@ */ #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" - +#include "render/html_internal.h" #include "content/content.h" #include "javascript/content.h" #include "javascript/js.h" #include "utils/log.h" +#include "window.h" +#include "event.h" + static JSRuntime *rt; /* global runtime */ void js_initialise(void) diff --git a/javascript/jsapi/binding.h b/javascript/jsapi/binding.h deleted file mode 100644 index 7b0f614..0000000 --- a/javascript/jsapi/binding.h +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright 2012 Vincent Sanders <vi...@netsurf-browser.org> - * - * 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/>. - */ - -/** \file - * spidermonkey jsapi class bindings - */ - -#ifndef _NETSURF_JAVASCRIPT_JSAPI_BINDING_H_ -#define _NETSURF_JAVASCRIPT_JSAPI_BINDING_H_ - - -#include "render/html_internal.h" - -JSObject *jsapi_InitClass_Window(JSContext *cx, JSObject *parent); - -/** Create a new javascript window object - * - * @param cx The javascript context. - * @param parent The parent object or NULL for new global - * @param win_priv The private context to set on the object - * @return new javascript object or NULL on error - */ -JSObject *jsapi_new_Window(JSContext *cx, - JSObject *window, - JSObject *parent, - struct browser_window *bw, - html_content *htmlc); - -JSObject *jsapi_InitClass_Location(JSContext *cx, JSObject *parent); -JSObject *jsapi_new_Location(JSContext *cx, - JSObject *window, - JSObject *parent, - nsurl *url, - html_content *htmlc); - - -JSObject *jsapi_InitClass_Document(JSContext *cx, JSObject *parent); - -/** Create a new javascript document object - * - * @param cx The javascript context. - * @param parent The parent object, usually a global window object - * @param doc_priv The private context to set on the object - * @return new javascript object or NULL on error - */ -JSObject *jsapi_new_Document(JSContext *cx, - JSObject *proto, - JSObject *parent, - dom_document *node, - struct html_content *htmlc); - -JSObject *jsapi_InitClass_Console(JSContext *cx, JSObject *parent); -/** Create a new javascript console object - * - * @param cx The javascript context. - * @param parent The parent object, usually a global window object - * @return new javascript object or NULL on error - */ -JSObject *jsapi_new_Console(JSContext *cx, JSObject *prototype, JSObject *parent); - - -JSObject *jsapi_InitClass_Navigator(JSContext *cx, JSObject *parent); -/** Create a new javascript navigator object - * - * @param cx The javascript context. - * @param parent The parent object, usually a global window object - * @return new javascript object or NULL on error - */ -JSObject *jsapi_new_Navigator(JSContext *cx, JSObject *proto, JSObject *parent); - -extern JSClass JSClass_HTMLElement; - -JSObject *jsapi_InitClass_HTMLElement(JSContext *cx, JSObject *parent); -/** Create a new javascript element object - * - * @param cx The javascript context. - * @param parent The parent object, usually a global window object - * @param doc_priv The private context to set on the object - * @return new javascript object or NULL on error - */ -JSObject *jsapi_new_HTMLElement(JSContext *cx, - JSObject *prototype, - JSObject *parent, - dom_element *node, - struct html_content *htmlc); - -JSObject *jsapi_InitClass_HTMLCollection(JSContext *cx, JSObject *parent); -/** Create a new javascript element object - * - * @param cx The javascript context. - * @param parent The parent object, usually a global window object - * @param doc_priv The private context to set on the object - * @return new javascript object or NULL on error - */ -JSObject *jsapi_new_HTMLCollection(JSContext *cx, - JSObject *prototype, - JSObject *parent, - dom_html_collection *collection, - struct html_content *htmlc); - -JSObject *jsapi_InitClass_NodeList(JSContext *cx, JSObject *parent); -/** Create a new javascript element object - * - * @param cx The javascript context. - * @param parent The parent object, usually a global window object - * @param doc_priv The private context to set on the object - * @return new javascript object or NULL on error - */ -JSObject *jsapi_new_NodeList(JSContext *cx, - JSObject *prototype, - JSObject *parent, - dom_nodelist *nodelist, - struct html_content *htmlc); - - -extern JSClass JSClass_Text; - -JSObject *jsapi_InitClass_Text(JSContext *cx, JSObject *parent); -/** Create a new javascript text object - * - * @param cx The javascript context. - * @param parent The parent object, usually a global window object - * @param node The dom node to use in the object - * @return new javascript object or NULL on error - */ -JSObject *jsapi_new_Text(JSContext *cx, - JSObject *prototype, - JSObject *parent, - dom_text *node, - struct html_content *htmlc); - -JSObject *jsapi_InitClass_Node(JSContext *cx, JSObject *parent); -JSObject *jsapi_new_Node(JSContext *cx, - JSObject *prototype, - JSObject *parent); - -extern JSClass JSClass_Event; -JSObject *jsapi_InitClass_Event(JSContext *cx, JSObject *parent); -JSObject *jsapi_new_Event(JSContext *cx, - JSObject *prototype, - JSObject *parent, - dom_event *event); - -#endif diff --git a/javascript/jsapi/console.bnd b/javascript/jsapi/console.bnd index 7c34845..9b3d21f 100644 --- a/javascript/jsapi/console.bnd +++ b/javascript/jsapi/console.bnd @@ -19,9 +19,9 @@ preamble %{ #include "utils/config.h" #include "utils/log.h" - #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" + +#include "console.h" %} diff --git a/javascript/jsapi/event.bnd b/javascript/jsapi/event.bnd index cc03c92..b0880d9 100644 --- a/javascript/jsapi/event.bnd +++ b/javascript/jsapi/event.bnd @@ -21,9 +21,9 @@ preamble %{ #include "utils/config.h" #include "utils/log.h" - #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" + +#include "event.h" %} diff --git a/javascript/jsapi/htmlcollection.bnd b/javascript/jsapi/htmlcollection.bnd index 5e99e48..38e14ed 100644 --- a/javascript/jsapi/htmlcollection.bnd +++ b/javascript/jsapi/htmlcollection.bnd @@ -23,9 +23,11 @@ preamble %{ #include "utils/config.h" #include "utils/log.h" - #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" +#include "render/html_internal.h" + +#include "htmlelement.h" +#include "htmlcollection.h" %} diff --git a/javascript/jsapi/htmldocument.bnd b/javascript/jsapi/htmldocument.bnd index c29e470..ddf408a 100644 --- a/javascript/jsapi/htmldocument.bnd +++ b/javascript/jsapi/htmldocument.bnd @@ -25,12 +25,16 @@ preamble %{ #include "utils/log.h" #include "utils/corestrings.h" #include "utils/libdom.h" - #include "content/urldb.h" - #include "javascript/js.h" #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" +#include "render/html_internal.h" + +#include "htmldocument.h" +#include "htmlelement.h" +#include "text.h" +#include "nodelist.h" +#include "location.h" %} diff --git a/javascript/jsapi/htmlelement.bnd b/javascript/jsapi/htmlelement.bnd index 3ede93b..48ebbdb 100644 --- a/javascript/jsapi/htmlelement.bnd +++ b/javascript/jsapi/htmlelement.bnd @@ -24,10 +24,13 @@ preamble %{ #include "utils/config.h" #include "utils/log.h" #include "utils/corestrings.h" - #include "javascript/js.h" #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" +#include "render/html_internal.h" + +#include "htmlelement.h" +#include "text.h" +#include "location.h" %} diff --git a/javascript/jsapi/location.bnd b/javascript/jsapi/location.bnd index 32677d1..85117a2 100644 --- a/javascript/jsapi/location.bnd +++ b/javascript/jsapi/location.bnd @@ -21,9 +21,10 @@ preamble %{ #include "utils/config.h" #include "utils/log.h" - #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" +#include "render/html_internal.h" + +#include "location.h" %} diff --git a/javascript/jsapi/navigator.bnd b/javascript/jsapi/navigator.bnd index e63e9a9..d040ede 100644 --- a/javascript/jsapi/navigator.bnd +++ b/javascript/jsapi/navigator.bnd @@ -24,14 +24,13 @@ preamble %{ #include "desktop/netsurf.h" #include "desktop/options.h" - #include "utils/config.h" #include "utils/useragent.h" #include "utils/log.h" #include "utils/utsname.h" - #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" + +#include "navigator.h" /* * navigator properties for netsurf diff --git a/javascript/jsapi/node.bnd b/javascript/jsapi/node.bnd index bcf0ef7..49fd06b 100644 --- a/javascript/jsapi/node.bnd +++ b/javascript/jsapi/node.bnd @@ -23,7 +23,8 @@ preamble %{ #include "utils/log.h" #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" + +#include "node.h" %} diff --git a/javascript/jsapi/nodelist.bnd b/javascript/jsapi/nodelist.bnd index b57dc6e..4aa8c47 100644 --- a/javascript/jsapi/nodelist.bnd +++ b/javascript/jsapi/nodelist.bnd @@ -20,9 +20,11 @@ preamble %{ #include "utils/config.h" #include "utils/log.h" - #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" +#include "render/html_internal.h" + +#include "nodelist.h" +#include "htmlelement.h" %} diff --git a/javascript/jsapi/text.bnd b/javascript/jsapi/text.bnd index 42791d0..6b43521 100644 --- a/javascript/jsapi/text.bnd +++ b/javascript/jsapi/text.bnd @@ -23,9 +23,11 @@ preamble %{ #include "utils/config.h" #include "utils/log.h" - +#include "render/html_internal.h" #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" + +#include "text.h" +#include "htmlelement.h" %} diff --git a/javascript/jsapi/window.bnd b/javascript/jsapi/window.bnd index 6153e90..288b5b3 100644 --- a/javascript/jsapi/window.bnd +++ b/javascript/jsapi/window.bnd @@ -24,10 +24,20 @@ preamble %{ #include "utils/config.h" #include "utils/log.h" #include "utils/corestrings.h" - +#include "render/html_internal.h" #include "javascript/jsapi.h" -#include "javascript/jsapi/binding.h" +#include "console.h" +#include "navigator.h" +#include "event.h" +#include "node.h" +#include "htmlcollection.h" +#include "nodelist.h" +#include "htmldocument.h" +#include "text.h" +#include "htmlelement.h" +#include "window.h" +#include "location.h" %} diff --git a/monkey/Makefile.target b/monkey/Makefile.target index fa15a50..05a32d0 100644 --- a/monkey/Makefile.target +++ b/monkey/Makefile.target @@ -41,7 +41,7 @@ MONKEYCFLAGS := -std=c99 -Dmonkey -Dnsmonkey \ -D_POSIX_C_SOURCE=200112L \ -D_NETBSD_SOURCE \ -DMONKEY_RESPATH=\"$(NETSURF_MONKEY_RESOURCES)\" \ - $(WARNFLAGS) -I. -g \ + $(WARNFLAGS) -g \ $(shell $(PKG_CONFIG) --cflags glib-2.0) \ $(shell $(PKG_CONFIG) --cflags libdom libcurl) \ $(shell $(PKG_CONFIG) --cflags openssl) \ diff --git a/riscos/Makefile.target b/riscos/Makefile.target index e7370e7..faefa41 100644 --- a/riscos/Makefile.target +++ b/riscos/Makefile.target @@ -42,12 +42,10 @@ TPD_RISCOS = $(foreach TPL,$(notdir $(TPL_RISCOS)), \ RESOURCES = $(TPD_RISCOS) split-messages -CFLAGS += -I. $(WARNFLAGS) -Driscos \ - -std=c99 -D_BSD_SOURCE -D_POSIX_C_SOURCE \ - -mpoke-function-name -fno-strict-aliasing +CFLAGS += $(WARNFLAGS) -Driscos -std=c99 -D_BSD_SOURCE -D_POSIX_C_SOURCE \ + -mpoke-function-name -fno-strict-aliasing -CFLAGS += -I$(GCCSDK_INSTALL_ENV)/include \ - -I$(GCCSDK_INSTALL_ENV)/include/libmng +CFLAGS += -I$(GCCSDK_INSTALL_ENV)/include -I$(GCCSDK_INSTALL_ENV)/include/libmng ifeq ($(HOST),riscos) CFLAGS += -I<OSLib$$Dir> -mthrowback endif diff --git a/windows/Makefile.target b/windows/Makefile.target index 90f97fb..c373ff5 100644 --- a/windows/Makefile.target +++ b/windows/Makefile.target @@ -3,48 +3,51 @@ # # This file is part of NetSurf - LDFLAGS += -L${GCCSDK_INSTALL_ENV}/lib - CFLAGS += -I${GCCSDK_INSTALL_ENV}/include/ - - NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG - NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE - NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP - NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF - NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG - $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp))) - $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif))) - $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) )) - $(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny))) - $(eval $(call feature_enabled,MNG,,-llcms -ljpeg,PNG/JNG/MNG (libmng))) - - ifneq ($(PKG_CONFIG),) - CFLAGS += $(shell $(PKG_CONFIG) --cflags zlib libcares libcurl libhubbub \ - libparserutils libdom libwapcaplet) - LDFLAGS += $(shell $(PKG_CONFIG) --libs zlib libcurl libcares \ - libhubbub libparserutils libcss libdom libwapcaplet) - else - LDFLAGS += -lhubbub -lcss -lparserutils -lwapcaplet -lcurl -lz - endif - - LDFLAGS += -lssl -lcrypto -lregex -liconv \ +LDFLAGS += -L${GCCSDK_INSTALL_ENV}/lib +CFLAGS += -I${GCCSDK_INSTALL_ENV}/include/ + +NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG +NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE +NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP +NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF +NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG + +$(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp))) +$(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif))) +$(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) )) +$(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny))) +$(eval $(call feature_enabled,MNG,,-llcms -ljpeg,PNG/JNG/MNG (libmng))) + +ifneq ($(PKG_CONFIG),) + $(eval $(call pkg_config_find_and_add,zlib,ZLib)) + $(eval $(call pkg_config_find_and_add,libcares,Cares)) + $(eval $(call pkg_config_find_and_add,libwapcaplet,Wapcaplet)) + $(eval $(call pkg_config_find_and_add,libparserutils,Parserutils)) + $(eval $(call pkg_config_find_and_add,libhubbub,Hubbub)) + $(eval $(call pkg_config_find_and_add,libdom,DOM)) + $(eval $(call pkg_config_find_and_add,libcss,CSS)) + $(eval $(call pkg_config_find_and_add,libcurl,Curl)) +else + LDFLAGS += -lhubbub -lcss -lparserutils -lwapcaplet -lcurl -lz +endif + +LDFLAGS += -lssl -lcrypto -lregex -liconv \ -lgdi32 -lcomctl32 -lws2_32 -lmsimg32 -mwindows - CFLAGS += -U__STRICT_ANSI__ -mwin32 - # only windows versions after XP are supported - CFLAGS += '-DWINVER=0x0501' - CFLAGS += '-D_WIN32_WINNT=0x0501' - CFLAGS += '-D_WIN32_WINDOWS=0x0501' - CFLAGS += '-D_WIN32_IE=0x0501' +CFLAGS += -U__STRICT_ANSI__ -mwin32 +# only windows versions after XP are supported +CFLAGS += '-DWINVER=0x0501' +CFLAGS += '-D_WIN32_WINNT=0x0501' +CFLAGS += '-D_WIN32_WINDOWS=0x0501' +CFLAGS += '-D_WIN32_IE=0x0501' - #installed resource path - CFLAGS += '-DNETSURF_WINDOWS_RESPATH="$(NETSURF_WINDOWS_RESPATH)"' +#installed resource path +CFLAGS += '-DNETSURF_WINDOWS_RESPATH="$(NETSURF_WINDOWS_RESPATH)"' +WSCFLAGS := -std=c99 $(WARNFLAGS) -DCURL_STATICLIB -DCARES_STATICLIB -g - WSCFLAGS := -std=c99 \ - $(WARNFLAGS) -I. \ - -DCURL_STATICLIB -DCARES_STATICLIB -g - CFLAGS += $(WSCFLAGS) - LDFLAGS += $(WSCFLAGS) +CFLAGS += $(WSCFLAGS) +LDFLAGS += $(WSCFLAGS) # ---------------------------------------------------------------------------- # built-in resource setup -- NetSurf Browser _______________________________________________ netsurf-commits mailing list netsurf-commits@netsurf-browser.org http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org