summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile7
-rw-r--r--Makefile.defaults2
-rw-r--r--Makefile.sources.javascript13
-rw-r--r--amiga/Makefile.target2
-rw-r--r--atari/Makefile.target2
-rw-r--r--beos/Makefile.target93
-rw-r--r--cocoa/Makefile.target6
-rw-r--r--framebuffer/Makefile.target2
-rw-r--r--gtk/Makefile.target2
-rw-r--r--javascript/jsapi.c6
-rw-r--r--javascript/jsapi/binding.h159
-rw-r--r--javascript/jsapi/console.bnd4
-rw-r--r--javascript/jsapi/event.bnd5
-rw-r--r--javascript/jsapi/htmlcollection.bnd6
-rw-r--r--javascript/jsapi/htmldocument.bnd10
-rw-r--r--javascript/jsapi/htmlelement.bnd7
-rw-r--r--javascript/jsapi/location.bnd5
-rw-r--r--javascript/jsapi/navigator.bnd5
-rw-r--r--javascript/jsapi/node.bnd3
-rw-r--r--javascript/jsapi/nodelist.bnd6
-rw-r--r--javascript/jsapi/text.bnd6
-rw-r--r--javascript/jsapi/window.bnd14
-rw-r--r--monkey/Makefile.target2
-rw-r--r--riscos/Makefile.target8
-rw-r--r--windows/Makefile.target77
25 files changed, 163 insertions, 289 deletions
diff --git a/Makefile b/Makefile
index baf835421..7a09e6c45 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 812a5a950..7650b381f 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 76a6ff145..4633e9d0d 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 ec43fdd30..f2c429998 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 7f0573407..8e87a741d 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 4edde01a1..7b473dd2f 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 d975a0c8f..2da4c5bb4 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 f3d91de0d..8ab8804b9 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 f9b5436af..2d1eebf50 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 ef34371d1..7b68fe975 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 7b0f61428..000000000
--- a/javascript/jsapi/binding.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright 2012 Vincent Sanders <vince@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 7c3484529..9b3d21f95 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 cc03c920a..b8b0aff47 100644
--- a/javascript/jsapi/event.bnd
+++ b/javascript/jsapi/event.bnd
@@ -16,14 +16,15 @@ hdrcomment "Released under the terms of the MIT License,";
hdrcomment " http://www.opensource.org/licenses/mit-license";
preamble %{
+#include <stdlib.h>
#include <dom/dom.h>
#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 5e99e48b8..38e14ed1d 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 c29e470c2..ddf408a9f 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 3ede93bbf..48ebbdb64 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 32677d1b5..85117a2ce 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 e63e9a9fd..d040edec2 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 bcf0ef7b3..49fd06bc5 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 b57dc6e05..4aa8c47f5 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 42791d081..6b4352116 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 6153e90aa..288b5b3d8 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 fa15a50f2..05a32d005 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 e7370e7ee..faefa417f 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 90f97fbea..33a9492af 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,libcurl,Curl))
+ $(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))
+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