netsurf: branch mono/removing-windom-dependency updated. f7ee2a03876bf4a5cf66b3a433955e4e55d91362
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/f7ee2a03876bf4a5cf66b...
...commit http://git.netsurf-browser.org/netsurf.git/commit/f7ee2a03876bf4a5cf66b3a...
...tree http://git.netsurf-browser.org/netsurf.git/tree/f7ee2a03876bf4a5cf66b3a43...
The branch, mono/removing-windom-dependency has been updated
via f7ee2a03876bf4a5cf66b3a433955e4e55d91362 (commit)
via 3019368c93600a335445c09178c9554074c7f656 (commit)
via c6a5109a95c1206ccf63d99316fa12b8c43bb7cf (commit)
via 0d803b6c0d252c3a1a9fa07e37d9a0b08ce567b8 (commit)
via e913a58ee77643b46138a3c9db37170ef2ed55af (commit)
via 347fdf0743b01d096c33e4cb089bb4a34b00b18c (commit)
via 90f0cfb5514b68483a75bd34955433e4739f381b (commit)
via b9d6eccf24a7ba1f2242740e981bf6bf3edcd82d (commit)
via f185ffa2574e7687620e0cdeb8449d480504d0fa (commit)
via 8e416ec2265fda98de4b1ea027b1ff0998e20205 (commit)
via 79b1496d3054a68cc5dcdf27677ed58667c099b3 (commit)
via 2a42b028b2c407cdd796a487d738370ee96e7d9b (commit)
via 8c74aeb6e17bbd97544bc41120c2d7d7a5c2b66c (commit)
via 51067561c9b6b3fe9f6dd5b032b570bf92f34a02 (commit)
via ea5096fb8d8233f588145357220f8e3f72bf160e (commit)
via 08cb5a09b2554e4eae7ffa692f540107fc07b5ec (commit)
via 8685336e2da8a594955d1db97fff9eaac1e276fd (commit)
via 6582b4e075e28d17349132ed77862f0a370a9119 (commit)
via 7c5f9ed8cd029dda34b6167520d6b65fbc40fc69 (commit)
via 44487224252ad91c448373cd1974f1ef6c53579f (commit)
via c87cbe565580975bf8300578ec556931a5f5a409 (commit)
via fa6e1379d0cc8c904c60251eee55d58dabf60784 (commit)
via 16d67095a6731f329bad971985e8983cdc054efe (commit)
via 45906b9dc2c87181f359289abc034f84b44947c4 (commit)
via 17e20537d4c6cdcb55f1ab68c950264c79ca69b2 (commit)
via 0ff9d858139328956cfe60a29f13b3315b6d2ce6 (commit)
via 5a5451a0c58903fe5b0590e01a0f06e53c44787d (commit)
via 25e85f1429971a13b5f063c65781a73952e0bfcf (commit)
via 1b4604130ebd636df5b932134d651408f35015d7 (commit)
via 30efe4ba306f129f3d92108dee522b3eb132545a (commit)
via ec7389a18f8cbfd79ec98da5b30ea616573c9f34 (commit)
via 8698245ad2e7885368f71080154b6590b407e7b5 (commit)
via a1876073adc2d13cf0c493c21a485302f6333c77 (commit)
via c1c3a067480b90a8d0747d92ea4a1bbb88228b0a (commit)
via 47579b468cb02886b2113e5bfcdee05978c7c940 (commit)
via 589c8a28a4fb4c6e4ccb0f55cf6fc316dea6cc80 (commit)
via a6005c9a5bb529bde2e669aef84ff2a7ad25281f (commit)
via 02a4bfd375110c268837931a8714fab0dc154d50 (commit)
via af8c3ef0c359a4c86531755659af7688e8b3f08e (commit)
via 5b5336499479af1e902de62319a95405b45136ac (commit)
via 083b7c0233635959f1944c2150abbb923c5e0481 (commit)
via 0c54f2a90260127f7a96b798afc08c691ddebadf (commit)
via 24e1aff974499e7e2cb0996a946a6a2d34fd851d (commit)
via 388ddc6dbd11e28740538a4d39d04f086e16c0c0 (commit)
via 3ef843fcb420c94665981519dacdd8d8c03b8ed0 (commit)
via 6b7e67847643dc54ade072c83c5669d7093fb1a3 (commit)
via 5ee1f09dd2f1535613d1ad88359150f4c6ac53b6 (commit)
via 70825a5ee24ead041bc331b13e00ae5f86f458c0 (commit)
via 083cf492f59529192b1a683fa9064ee2c2300c48 (commit)
via c8b3fbbfdd64e23632d414ab0b2986a855960f26 (commit)
via dfa287767fee79f479b4cf0d8d69431febc5e934 (commit)
via ff333828b70a5d31b9efe1c7b2df3216478722a3 (commit)
via ffac64fcea44e2840cef67ec2d5bdc6ef0b4b268 (commit)
via 69647cc6a4f230fc0c1ce5481a30ac21c93db8d2 (commit)
via 04825c62df92c8adef3f40f89c7b5d88b963f833 (commit)
via 99f93da0f3a510df51c5a057e7597c570a636f9d (commit)
via 40076ea422458fde1799fd383b475586ee112c3f (commit)
via 912b9de92808c43a78680d41bba1ad982e120d86 (commit)
via 646aed64ff07fa356f8aef034e77792cf634b053 (commit)
via 61723e01c1beed8591d877c92035b65c448f46df (commit)
via 0718d809180b1bff9c83f4475be4cb918a8564e2 (commit)
via 897acff532415ed81f9066b8b811ae744918da84 (commit)
via 878fe3e68cbda4f3d51cce7bc3b0ffcc27135367 (commit)
via 70ece8a428de80d2efacef58d4a2ec259def54b8 (commit)
via 30528647735b5bcb689427b3a865f78c57a6070c (commit)
via 22fbe5abfc2797ebba6f330a48b3b6d2ec2058a3 (commit)
via c88c4fa214b3dd23b8f68fe35d9c8eb738d80976 (commit)
via ee79de52446499e56ff6986af1c08d866fd670d5 (commit)
via 1e2cc766cdb16f1a5ef3201df5601ffbc22a8bc8 (commit)
via ffcb07b8b2a4d5096d8bd794b1b34c5ffdfd5b17 (commit)
via 31c9ffb4b51b79394f882e5efed629c2df0600d9 (commit)
via 61872ab3a493d60ede0e5ca2221b4c5c94708171 (commit)
via 23dc635e1a2386d52779384d6117f020376142f7 (commit)
via d66e9c34a8e5e6081541c2b7bfd1e97012289494 (commit)
via ec79063155c809d52e54812e0045900bbad53532 (commit)
via 168d09c8780de36daa580a2b584059e37744b53b (commit)
via d80bb6210dcad46997b190793efa5d472a1809c1 (commit)
via 4865886721f76373cf9902f5c3fe2f159a375ee6 (commit)
via 71577f214da0e53b845b0c0a41496b0f1d0eead5 (commit)
from 59a44380a6951b220c91d109532c24ecc7148361 (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/f7ee2a03876bf4a5cf6...
commit f7ee2a03876bf4a5cf66b3a433955e4e55d91362
Author: Ole Loots <ole(a)monochrom.net>
Commit: Ole Loots <ole(a)monochrom.net>
- started to work on settings dialog
- some WIP in treeview widgets. Changed destroy / and init handling.
It requires some optimization, when the widget is closed
it must remove itself from the guiwin list, for perfomance.
diff --git a/atari/Makefile.defaults b/atari/Makefile.defaults
index 1503588..155ba8d 100644
--- a/atari/Makefile.defaults
+++ b/atari/Makefile.defaults
@@ -42,7 +42,7 @@
# enable optimizations
# -O2 is currently broken with m68000 / m68020-60 builds
- CFLAGS += -O1
+ CFLAGS += -O3
# override warning flags removing -Wall
WARNFLAGS = -W -Wundef -Wpointer-arith \
diff --git a/atari/Makefile.target b/atari/Makefile.target
index e7755d5..275eb56 100644
--- a/atari/Makefile.target
+++ b/atari/Makefile.target
@@ -106,10 +106,11 @@ S_ATARI := \
plot/eddi.s \
plot/font_freetype.c \
plot/font_internal.c \
- gemtk/utils.c \
+ gemtk/aestabs.c \
gemtk/dragdrop.c \
+ gemtk/guiwin.c \
gemtk/msgbox.c \
- gemtk/guiwin.c
+ gemtk/utils.c
S_ATARI := $(addprefix atari/,$(S_ATARI))
diff --git a/atari/deskmenu.c b/atari/deskmenu.c
index 646a09c..601ba99 100644
--- a/atari/deskmenu.c
+++ b/atari/deskmenu.c
@@ -353,9 +353,8 @@ static void __CDECL menu_find(short item, short title, void *data)
static void __CDECL menu_choices(short item, short title, void *data)
{
- static WINDOW * settings_dlg = NULL;
LOG(("%s", __FUNCTION__));
- settings_dlg = open_settings();
+ open_settings();
}
static void __CDECL menu_stop(short item, short title, void *data)
diff --git a/atari/download.c b/atari/download.c
index e35f31d..bf3105f 100755
--- a/atari/download.c
+++ b/atari/download.c
@@ -204,9 +204,10 @@ static void gui_download_window_destroy( struct gui_download_window * gdw)
}
if (gdw->fbuf != NULL) {
free( gdw->fbuf );
- }
- wind_close(gdw->aes_handle);
- guiwin_remove(gdw->guiwin);
+ }
+ guiwin_remove(gdw->guiwin);
+ wind_close(gdw->aes_handle);
+ wind_delete(gdw->aes_handle);
free(gdw);
}
@@ -269,7 +270,7 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
gemdos_realpath(nsoption_charp(downloads_path), gdos_path);
dstsize = strlen(gdos_path) + strlen(filename) + 2;
destination = malloc( dstsize );
- snprintf( destination, dstsize, "%s/%s", gdos_path, filename );
+ snprintf(destination, dstsize, "%s/%s", gdos_path, filename);
}
gdw = calloc(1, sizeof(struct gui_download_window));
diff --git a/atari/gemtk/aestabs.c b/atari/gemtk/aestabs.c
new file mode 100644
index 0000000..414d5c2
--- /dev/null
+++ b/atari/gemtk/aestabs.c
@@ -0,0 +1,173 @@
+#include <stdlib.h>
+#include <assert.h>
+#include <gem.h>
+#include <cflib.h>
+#include "aestabs.h"
+
+#ifndef NDEBUG
+# define DEBUG_PRINT(x) printf x
+#else
+# define DEBUG_PRINT(x)
+#endif
+
+
+AES_TABLIST * tablist_declare(OBJECT *tree, aes_tablist_user_func user_func)
+{
+ AES_TABLIST * newlist = malloc(sizeof(AES_TABLIST));
+
+ newlist->first = NULL;
+ newlist->tree = tree;
+ newlist->user_func = user_func;
+ DEBUG_PRINT(("aes_tablist_declare: %p\n", newlist));
+ return(newlist);
+}
+
+
+AES_TAB * tablist_add(AES_TABLIST * tablist, short obj_tab, OBJECT * page_tree,
+ short obj_page)
+{
+ AES_TAB * newtab = malloc(sizeof(AES_TAB));
+
+ assert(newtab);
+ assert(tablist);
+
+ newtab->next = NULL;
+ newtab->prev = NULL;
+ newtab->obj_tab = obj_tab;
+ newtab->obj_page = obj_page;
+ newtab->page_tree = page_tree;
+
+ if(newtab->page_tree == NULL){
+ newtab->page_tree = tablist->tree;
+ }
+
+ if (tablist->first == NULL) {
+ tablist->first = newtab;
+ set_state(tablist->tree, newtab->obj_tab, OS_SELECTED, 0);
+ } else {
+ AES_TAB *tmp = tablist->first;
+ while( tmp->next != NULL ) {
+ tmp = tmp->next;
+ }
+ tmp->next = newtab;
+ newtab->prev = tmp;
+ newtab->next = NULL;
+ set_state(tablist->tree, newtab->obj_tab, OS_SELECTED, 0);
+ }
+
+ // TODO: Set the visible flag on that register?
+
+ DEBUG_PRINT(("tablist_add: Tab=%p\n", newtab));
+
+ return(newtab);
+}
+
+
+short tablist_activate(AES_TABLIST * tablist, short tab, short options)
+{
+ AES_TAB *tmp, *activated=NULL, *deactivated=NULL;
+ struct aes_tab_s *active;
+ short activated_pg = -1;
+ short is_tab = 0;
+
+ assert(tablist);
+ assert(tablist->first);
+
+ active = tablist_get_active(tablist);
+
+ if (active != NULL) {
+ if ((options & AES_TABLIST_OPTION_FORCE_EVENTS) == 0) {
+ if(active->obj_tab == tab)
+ return(0);
+ }
+ }
+
+ tmp = tablist->first;
+ while (tmp != NULL) {
+ if(tmp->obj_tab == tab) {
+ is_tab = 1;
+ }
+ tmp = tmp->next;
+ }
+
+ if(is_tab == 0) {
+ return(0);
+ }
+
+ tmp = tablist->first;
+ while ( tmp != NULL ) {
+ if(tab != tmp->obj_tab) {
+ if (get_state(tablist->tree, tmp->obj_tab, OS_SELECTED) != 0) {
+ deactivated = tmp;
+ set_state(tablist->tree, tmp->obj_tab, OS_SELECTED, 0);
+ }
+ // the tab registers can share the same page, consider that:
+ if (tablist->tree == tmp->page_tree
+ && activated_pg != tmp->obj_page) {
+
+ set_flag(tablist->tree, tmp->obj_page, OF_HIDETREE, 1);
+ }
+ } else {
+ activated = tmp;
+ // this tab must the selected / visible
+ set_state(tablist->tree, tmp->obj_tab, OS_SELECTED, 1);
+ if(tablist->tree == tmp->page_tree)
+ set_flag(tablist->tree, tmp->obj_page, OF_HIDETREE, 0);
+ activated_pg = tmp->obj_page;
+ }
+ tmp = tmp->next;
+ }
+
+ if(tablist->user_func != NULL) {
+ AES_TABLIST_FUNC_ARGS args;
+ if(deactivated){
+ args.event = AES_TABLIST_TAB_DEACTIVATED;
+ args.tab = deactivated;
+ tablist->user_func(tablist, &args);
+ }
+ if(activated){
+ args.event = AES_TABLIST_TAB_ACTIVATED;
+ args.tab = activated;
+ tablist->user_func(tablist, &args);
+ }
+ }
+ return(1);
+}
+
+struct aes_tab_s *tablist_get_active(AES_TABLIST * tablist)
+{
+ AES_TAB *tmp = tablist->first;
+ while( tmp != NULL ) {
+ if(get_state(tablist->tree, tmp->obj_tab, OS_SELECTED) != 0) {
+ // that's the one
+ return(tmp);
+ }
+ tmp = tmp->next;
+ }
+ return(NULL);
+}
+
+AES_TAB * tablist_find(AES_TABLIST * tablist, OBJECT * page, short tab)
+{
+ AES_TAB *tmp = tablist->first;
+ while( tmp != NULL ) {
+ if((tmp->page_tree == page) && (tab == tmp->obj_tab)) {
+ return(tmp);
+ }
+ tmp = tmp->next;
+ }
+ return(NULL);
+}
+
+void tablist_delete(AES_TABLIST *tablist)
+{
+ AES_TAB *tmp = tablist->first, *cur;
+ while ( tmp != NULL ) {
+ cur = tmp;
+ tmp = tmp->next;
+ DEBUG_PRINT(("tablist_delete, Freeing tab: %p\n", cur));
+ free(cur);
+ }
+ DEBUG_PRINT(("tablist_delete, Freeing list: %p\n", tablist));
+ free(tablist);
+}
diff --git a/atari/gemtk/aestabs.h b/atari/gemtk/aestabs.h
new file mode 100644
index 0000000..c72054a
--- /dev/null
+++ b/atari/gemtk/aestabs.h
@@ -0,0 +1,56 @@
+#ifndef AESTABS_H_INCLUDED
+#define AESTABS_H_INCLUDED
+
+struct aes_tab_s;
+struct aes_tablist_s;
+typedef struct aes_tab_s AES_TAB;
+typedef struct aes_tablist_s AES_TABLIST;
+
+#define AES_TABLIST_TAB_ACTIVATED 0x01
+#define AES_TABLIST_TAB_DEACTIVATED 0x02
+
+#define AES_TABLIST_OPTION_FORCE_EVENTS 0x01 // do not eat events which do
+ // not changed the internal state
+ // this is required for tabs which
+ // require "activate" events
+ // for tabs which are already
+ // selected.
+
+
+struct aes_tablist_user_args_s
+{
+ short event;
+ AES_TAB *tab;
+};
+
+typedef struct aes_tablist_user_args_s AES_TABLIST_FUNC_ARGS;
+
+typedef void (*aes_tablist_user_func)(AES_TABLIST * list,
+ AES_TABLIST_FUNC_ARGS * args);
+
+struct aes_tab_s {
+ short obj_tab;
+ short obj_page;
+ OBJECT * page_tree;
+ AES_TAB * next, *prev;
+};
+
+struct aes_tablist_s {
+ OBJECT *tree;
+ AES_TAB * first;
+ aes_tablist_user_func user_func;
+};
+
+
+
+AES_TABLIST * tablist_declare(OBJECT *tree, aes_tablist_user_func user_func);
+void tablist_delete(AES_TABLIST * tablist);
+AES_TAB * tablist_add(AES_TABLIST * tablist, short tab, OBJECT *page_tree,
+ short page);
+short tablist_activate(AES_TABLIST * tablist, short tab, short option);
+struct aes_tab_s *tablist_get_active(AES_TABLIST * tablist);
+AES_TAB * tablist_find(AES_TABLIST * tablist, OBJECT *page, short tab);
+
+#define AES_TAB_IS_ACTIVE(l, x) (tablist_get_active(l) == x)
+
+#endif // AESTABS_H_INCLUDED
diff --git a/atari/gemtk/gemtk.h b/atari/gemtk/gemtk.h
index 1225a0c..9c341ba 100644
--- a/atari/gemtk/gemtk.h
+++ b/atari/gemtk/gemtk.h
@@ -7,6 +7,10 @@
#include <stdint.h>
#include <stdbool.h>
+/* -------------------------------------------------------------------------- */
+/* Utils */
+/* -------------------------------------------------------------------------- */
+
/* System type detection added by [GS] */
/* detect the system type, AES + kernel */
#define SYS_TOS 0x0001
@@ -23,16 +27,34 @@
#define TOS4VER 0x03300 /* this is assumed to be the last single tasking OS */
extern unsigned short _systype_v;
-
-/*
- Utils
-*/
unsigned short _systype (void);
OBJECT *get_tree( int idx );
-/*
-* MultiTOS Drag&Drop
-*/
+#ifndef POINT_WITHIN
+# define POINT_WITHIN(_x,_y, r) ((_x >= r.g_x) && (_x <= r.g_x + r.g_w ) \
+ && (_y >= r.g_y) && (_y <= r.g_y + r.g_h))
+#endif
+
+#ifndef RC_WITHIN
+# define RC_WITHIN(a,b) \
+ (((a)->g_x >= (b)->g_x) \
+ && (((a)->g_x + (a)->g_w) <= ((b)->g_x + (b)->g_w))) \
+ && (((a)->g_y >= (b)->g_y) \
+ && (((a)->g_y + (a)->g_h) <= ((b)->g_y + (b)->g_h)))
+#endif
+
+#ifndef MAX
+# define MAX(_a,_b) ((_a>_b) ? _a : _b)
+#endif
+
+#ifndef MIN
+# define MIN(_a,_b) ((_a<_b) ? _a : _b)
+#endif
+
+
+/* -------------------------------------------------------------------------- */
+/* MultiTOS Drag & Drop */
+/* -------------------------------------------------------------------------- */
short ddcreate(short *pipe);
short ddmessage(short apid, short fd, short winid, short mx, short my, short kstate, short pipename);
short ddrexts(short fd, char *exts);
@@ -45,17 +67,17 @@ short ddsexts(short fd, char *exts);
short ddrtry(short fd, char *name, char *file, char *whichext, long *size);
short ddreply(short fd, char ack);
-/*
- Message box
-*/
+/* -------------------------------------------------------------------------- */
+/* Message Box module */
+/* -------------------------------------------------------------------------- */
#define MSG_BOX_ALERT 1
#define MSG_BOX_CONFIRM 2
short msg_box_show(short type, const char * msg);
-/*
- Guiwin
-*/
+/* -------------------------------------------------------------------------- */
+/* GUIWIN Module */
+/* -------------------------------------------------------------------------- */
#define GW_FLAG_PREPROC_WM 0x01 // let guiwin API handle some events
#define GW_FLAG_RECV_PREPROC_WM 0x02 // get notified even when pre-processed
#define GW_FLAG_HAS_VTOOLBAR 0x04 // the attached toolbar is vertical
@@ -120,29 +142,12 @@ bool guiwin_has_intersection(GUIWIN *win, GRECT *work);
void guiwin_toolbar_redraw(GUIWIN *win, GRECT *clip);
void guiwin_clear(GUIWIN *win);
-/*
-* AES Scroller Object
-*/
-
-#ifndef POINT_WITHIN
-#define POINT_WITHIN(_x,_y, r) ((_x >= r.g_x) && (_x <= r.g_x + r.g_w ) \
- && (_y >= r.g_y) && (_y <= r.g_y + r.g_h))
-#endif
-
-#ifndef RC_WITHIN
-#define RC_WITHIN(a,b) \
- (((a)->g_x >= (b)->g_x) \
- && (((a)->g_x + (a)->g_w) <= ((b)->g_x + (b)->g_w))) \
- && (((a)->g_y >= (b)->g_y) \
- && (((a)->g_y + (a)->g_h) <= ((b)->g_y + (b)->g_h)))
-#endif
-
-#ifndef MAX
-#define MAX(_a,_b) ((_a>_b) ? _a : _b)
-#endif
+/* -------------------------------------------------------------------------- */
+/* AES Scroller module */
+/* -------------------------------------------------------------------------- */
-#ifndef MIN
-#define MIN(_a,_b) ((_a<_b) ? _a : _b)
-#endif
+/* -------------------------------------------------------------------------- */
+/* AES Tabs module */
+/* -------------------------------------------------------------------------- */
#endif // GEMTK_H_INCLUDED
diff --git a/atari/gemtk/guiwin.c b/atari/gemtk/guiwin.c
index e587b97..6e8cfa2 100644
--- a/atari/gemtk/guiwin.c
+++ b/atari/gemtk/guiwin.c
@@ -1,4 +1,20 @@
-//#include "global.h"
+/*
+ * Copyright 2012 Ole Loots <ole(a)monochrom.net>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
#include <stdint.h>
#include <stdbool.h>
@@ -10,8 +26,8 @@
#include <mt_gem.h>
#include "gemtk.h"
-//#define DEBUG_PRINT(x) printf x
-#define DEBUG_PRINT(x)
+#define DEBUG_PRINT(x) printf x
+//#define DEBUG_PRINT(x)
struct gui_window_s {
short handle;
@@ -170,13 +186,20 @@ static short preproc_wm(GUIWIN * gw, EVMULT_OUT *ev_out, short msg[8])
case WM_SIZED:
case WM_REPOSED:
+ wind_get_grect(gw->handle, WF_FULLXYWH, &g2);
wind_get_grect(gw->handle, WF_CURRXYWH, &g);
- wind_set(gw->handle, WF_CURRXYWH, g.g_x, g.g_y, msg[6], msg[7]);
- if((gw->flags & GW_FLAG_CUSTOM_SCROLLING) == 0) {
- if(guiwin_update_slider(gw, GUIWIN_VH_SLIDER)) {
- guiwin_send_redraw(gw, NULL);
- }
+ g.g_w = MIN(msg[6], g2.g_w);
+ g.g_h = MIN(msg[7], g2.g_h);
+ if(g2.g_w != g.g_w || g2.g_h != g.g_h){
+ wind_set(gw->handle, WF_CURRXYWH, g.g_x, g.g_y, g.g_w, g.g_h);
+ if((gw->flags & GW_FLAG_CUSTOM_SCROLLING) == 0) {
+ if(guiwin_update_slider(gw, GUIWIN_VH_SLIDER)) {
+ guiwin_send_redraw(gw, NULL);
+ }
+ }
}
+
+
break;
case WM_FULLED:
@@ -315,7 +338,7 @@ short guiwin_dispatch_event(EVMULT_IN *ev_in, EVMULT_OUT *ev_out, short msg[8])
if (obj_idx > 0) {
if ((dest->toolbar[obj_idx].ob_flags & OF_SELECTABLE)!=0
&& ((dest->flags & GW_FLAG_CUSTOM_TOOLBAR) == 0)
- && ((dest->flags & GW_FLAG_TOOLBAR_REDRAW) == 0)) {
+ && ((dest->flags & GW_FLAG_TOOLBAR_REDRAW) == 1)) {
dest->toolbar[obj_idx].ob_state |= OS_SELECTED;
// TODO: optimize redraw by setting the object clip:
guiwin_toolbar_redraw(dest, NULL);
diff --git a/atari/gui.c b/atari/gui.c
index 51865b9..888f82d 100755
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -144,8 +144,8 @@ void gui_poll(bool active)
}
/* this suits for stuff with lower priority */
/* TBD: really be spare on redraws??? */
- //hotlist_redraw();
- //global_history_redraw();
+ hotlist_redraw();
+ global_history_redraw();
}
// Handle events until there are no more messages pending or
diff --git a/atari/gui.h b/atari/gui.h
index 0fc1a2c..e12cf44 100755
--- a/atari/gui.h
+++ b/atari/gui.h
@@ -98,6 +98,7 @@ typedef struct s_browser * CMP_BROWSER;
*/
struct s_gui_win_root
{
+ short aes_handle;
GUIWIN *win;
CMP_TOOLBAR toolbar;
CMP_STATUSBAR statusbar;
diff --git a/atari/history.c b/atari/history.c
index f9faef5..77df2c9 100755
--- a/atari/history.c
+++ b/atari/history.c
@@ -38,6 +38,10 @@
#include "atari/res/netsurf.rsh"
#include "atari/history.h"
+
+//TODO: remove/add guiwin handle on close / open - so that the list
+// is kept tiny.
+
extern char * tree_directory_icon_name;
extern GRECT desk_area;
@@ -46,6 +50,7 @@ struct s_atari_global_history gl_history;
void global_history_open( void )
{
+ global_history_init();
if (gl_history.init == false ) {
return;
}
@@ -132,10 +137,6 @@ bool global_history_init( void )
void global_history_destroy( void )
{
-void global_history_redraw( void )
-{
- atari_treeview_redraw( gl_history.tv );
-}
if( gl_history.init == false ) {
return;
}
@@ -152,4 +153,9 @@ void global_history_redraw( void )
LOG(("done"));
}
+void global_history_redraw( void )
+{
+ atari_treeview_redraw( gl_history.tv );
+}
+
diff --git a/atari/hotlist.c b/atari/hotlist.c
index 66e7560..ccba088 100755
--- a/atari/hotlist.c
+++ b/atari/hotlist.c
@@ -44,6 +44,9 @@
#include "atari/gemtk/gemtk.h"
#include "atari/res/netsurf.rsh"
+//TODO: remove/add guiwin handle on close / open - so that the list
+// is kept tiny.
+
extern GRECT desk_area;
struct atari_hotlist hl;
@@ -86,7 +89,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
break;
case WM_CLOSED:
- hotlist_close();
+ hotlist_destroy();
break;
default: break;
@@ -101,49 +104,51 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
void hotlist_init(void)
{
- if( strcmp(nsoption_charp(hotlist_file), "") == 0 ){
- atari_find_resource( (char*)&hl.path, "hotlist", "hotlist" );
- } else {
- strncpy( (char*)&hl.path, nsoption_charp(hotlist_file), PATH_MAX-1 );
- }
-
- LOG(("Hotlist: %s", (char*)&hl.path ));
-
- if( hl.window == NULL ){
- int flags = ATARI_TREEVIEW_WIDGETS;
- short handle = -1;
- GRECT desk;
- OBJECT * tree = get_tree(TOOLBAR_HOTLIST);
- assert( tree );
- hl.open = false;
-
- handle = wind_create(flags, 0, 0, desk_area.g_w, desk_area.g_h);
- hl.window = guiwin_add(handle, GW_FLAG_DEFAULTS, NULL);
- if( hl.window == NULL ) {
- LOG(("Failed to allocate Hotlist"));
- return;
+ if (hl.init == false) {
+ if( strcmp(nsoption_charp(hotlist_file), "") == 0 ){
+ atari_find_resource( (char*)&hl.path, "hotlist", "hotlist" );
+ } else {
+ strncpy( (char*)&hl.path, nsoption_charp(hotlist_file), PATH_MAX-1 );
}
- wind_set_str(handle, WF_NAME, (char*)messages_get("Hotlist"));
- guiwin_set_toolbar(hl.window, tree, 0, 0);
- hl.tv = atari_treeview_create(
- hotlist_get_tree_flags(),
- hl.window,
- handle_event
- );
- if (hl.tv == NULL) {
- /* handle it properly, clean up previous allocs */
- LOG(("Failed to allocate treeview"));
- return;
- }
-
- hotlist_initialise(
- hl.tv->tree,
- (char*)&hl.path,
- "dir.png"
- );
- } else {
+ LOG(("Hotlist: %s", (char*)&hl.path ));
+
+ if( hl.window == NULL ){
+ int flags = ATARI_TREEVIEW_WIDGETS;
+ short handle = -1;
+ GRECT desk;
+ OBJECT * tree = get_tree(TOOLBAR_HOTLIST);
+ assert( tree );
+ hl.open = false;
+
+ handle = wind_create(flags, 0, 0, desk_area.g_w, desk_area.g_h);
+ hl.window = guiwin_add(handle, GW_FLAG_DEFAULTS, NULL);
+ if( hl.window == NULL ) {
+ LOG(("Failed to allocate Hotlist"));
+ return;
+ }
+ wind_set_str(handle, WF_NAME, (char*)messages_get("Hotlist"));
+ guiwin_set_toolbar(hl.window, tree, 0, 0);
+ hl.tv = atari_treeview_create(
+ hotlist_get_tree_flags(),
+ hl.window,
+ handle_event
+ );
+ if (hl.tv == NULL) {
+ /* handle it properly, clean up previous allocs */
+ LOG(("Failed to allocate treeview"));
+ return;
+ }
+
+ hotlist_initialise(
+ hl.tv->tree,
+ (char*)&hl.path,
+ "dir.png"
+ );
+
+ } else {
+ }
}
hl.init = true;
}
@@ -151,6 +156,7 @@ void hotlist_init(void)
void hotlist_open(void)
{
+ hotlist_init();
if( hl.init == false ) {
return;
}
@@ -181,17 +187,12 @@ void hotlist_close(void)
void hotlist_destroy(void)
{
-void hotlist_redraw(void)
-{
- int i = 01;
- atari_treeview_redraw(hl.tv);
-}
- if( hl.init == false ) {
+ if( hl.init == false) {
return;
}
if( hl.window != NULL ) {
hotlist_cleanup( (char*)&hl.path );
- if( hl.open )
+ if (hl.open)
hotlist_close();
wind_delete(guiwin_get_handle(hl.window));
guiwin_remove(hl.window);
@@ -202,6 +203,12 @@ void hotlist_redraw(void)
LOG(("done"));
}
+void hotlist_redraw(void)
+{
+ int i = 01;
+ atari_treeview_redraw(hl.tv);
+}
+
struct node;
void atari_hotlist_add_page( const char * url, const char * title )
@@ -212,6 +219,8 @@ void atari_hotlist_add_page( const char * url, const char * title )
NSTREEVIEW tv = hl.tv;
if(hl.tv == NULL )
return;
+ // TODO: do no open hotlist, and remove guiwin on close...
+ hotlist_open();
if( hl.tv->click.x >= 0 && hl.tv->click.y >= 0 ){
hotlist_add_page_xy( url, hl.tv->click.x, hl.tv->click.y );
} else {
diff --git a/atari/misc.c b/atari/misc.c
index d0d4cd5..27c68b6 100755
--- a/atari/misc.c
+++ b/atari/misc.c
@@ -488,8 +488,7 @@ const char * file_select( const char * title, const char * name ) {
}
if( FselInput( path, tmpname, (char*)"", use_title, NULL, NULL)) {
- strncpy( fullname, path, PATH_MAX-1 );
- strncat( fullname, tmpname, PATH_MAX-strlen(fullname)-1 );
+ snprintf(fullname, PATH_MAX, "%s%s", path, tmpname);
return( (const char*)&fullname );
}
return( NULL );
diff --git a/atari/res/netsurf.rsc b/atari/res/netsurf.rsc
index cb8a3a0..da3d251 100755
Binary files a/atari/res/netsurf.rsc and b/atari/res/netsurf.rsc differ
diff --git a/atari/res/netsurf.rsh b/atari/res/netsurf.rsh
index 0b3961c..5ad6b90 100755
--- a/atari/res/netsurf.rsh
+++ b/atari/res/netsurf.rsh
@@ -209,3 +209,20 @@
#define VSCROLLER_BT_DOWN_PIC 5 /* CICON in tree VSCROLLER */
#define VSCROLLER_BT_UP 6 /* IBOX in tree VSCROLLER */
#define VSCROLLER_BT_UP_PIC 4 /* CICON in tree VSCROLLER */
+
+#define SETTINGS 15 /* form/dial */
+#define SETTINGS_EDIT_HOMEPAGE_00 2 /* FTEXT in tree SETTINGS */
+#define SETTINGS_LBL_CB_HIDE_ADVERTISEMENT 3 /* STRING in tree SETTINGS */
+#define SETTINGS_LBL_CB_DISABLE_POPUP_WINDOWS 4 /* STRING in tree SETTINGS */
+#define SETTINGS_CB_HIDE_ADVERTISEMENT 5 /* BOXCHAR in tree SETTINGS */
+#define SETTINGS_CB_DISABLE_POPUP_WINDOWS 6 /* BOXCHAR in tree SETTINGS */
+#define SETTINGS_LBL_CB_SEND_HTTP_REFERRER 7 /* STRING in tree SETTINGS */
+#define SETTINGS_CB_SEND_HTTP_REFERRER 8 /* BOXCHAR in tree SETTINGS */
+#define SETTINGS_LBL_CB_SEND_DO_NOT_TRACK 9 /* STRING in tree SETTINGS */
+#define SETTINGS_CB_SEND_DO_NOT_TRACK 10 /* BOXCHAR in tree SETTINGS */
+#define SETTINGS_DEC_HISTORY_AGE 12 /* BOXCHAR in tree SETTINGS */
+#define SETTINGS_EDIT_HISTORY_AGE 13 /* FTEXT in tree SETTINGS */
+#define SETTINGS_INC_HISTORY_AGE 14 /* BOXCHAR in tree SETTINGS */
+#define SETTINGS_BT_CLEAR_HISTORY 15 /* BUTTON in tree SETTINGS */
+#define SETTINGS_BT_SEL_LOCALE 17 /* BUTTON in tree SETTINGS */
+#define SETTINGS_BT_GUI_LANG 19 /* BUTTON in tree SETTINGS */
diff --git a/atari/res/netsurf.rsm b/atari/res/netsurf.rsm
index 3e12e13..6f9ae05 100755
--- a/atari/res/netsurf.rsm
+++ b/atari/res/netsurf.rsm
@@ -1,9 +1,9 @@
ResourceMaster v3.65
-#C 15@0@0@0@
+#C 16@0@0@0@
#N 99@32@AZAaza___ _@AZAaza090___ _@@_@
#FoC-Header@rsm2out@C-Header@rsh@@@[C-Header@0@
#R 0@0@1@1@1@1@
-#M 20010100@0@7728@624@
+#M 20010100@0@7728@625@
#T 0@1@MAINMENU@@62@@
#O 4@32@T_FILE@@
#O 5@32@T_EDIT@@
@@ -198,4 +198,20 @@ ResourceMaster v3.65
#O 5@33@BT_DOWN_PIC@@
#O 6@25@BT_UP@@
#O 4@33@BT_UP_PIC@@
-#c 205@
+#T 15@2@SETTINGS@@21@@
+#O 2@29@EDIT_HOMEPAGE_00@@
+#O 3@28@LBL_CB_HIDE_ADVERTISEMENT@@
+#O 4@28@LBL_CB_DISABLE_POPUP_WINDOWS@@
+#O 5@27@CB_HIDE_ADVERTISEMENT@@
+#O 6@27@CB_DISABLE_POPUP_WINDOWS@@
+#O 7@28@LBL_CB_SEND_HTTP_REFERRER@@
+#O 8@27@CB_SEND_HTTP_REFERRER@@
+#O 9@28@LBL_CB_SEND_DO_NOT_TRACK@@
+#O 10@27@CB_SEND_DO_NOT_TRACK@@
+#O 12@27@DEC_HISTORY_AGE@@
+#O 13@29@EDIT_HISTORY_AGE@@
+#O 14@27@INC_HISTORY_AGE@@
+#O 15@26@BT_CLEAR_HISTORY@@
+#O 17@26@BT_SEL_LOCALE@@
+#O 19@26@BT_GUI_LANG@@
+#c 28255@
diff --git a/atari/rootwin.c b/atari/rootwin.c
index 3a2af1c..7c85511 100755
--- a/atari/rootwin.c
+++ b/atari/rootwin.c
@@ -165,7 +165,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
short ghandle = wind_find(ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_y);
- if (guiwin_get_handle(data->rootwin->win)==ghandle) {
+ if (data->rootwin->aes_handle==ghandle) {
// The window found at x,y is an gui_window
// and it's the input window.
window_get_grect(data->rootwin, BROWSER_AREA_CONTENT,
@@ -204,7 +204,6 @@ int window_create(struct gui_window * gw,
int err = 0;
bool tb, sb;
int flags;
- short aes_handle;
tb = (inflags & WIDGET_TOOLBAR);
sb = (inflags & WIDGET_STATUSBAR);
@@ -229,13 +228,13 @@ int window_create(struct gui_window * gw,
redraw_slots_init(&gw->root->redraw_slots, 8);
// TODO: use desk size
- aes_handle = wind_create(flags, 40, 40, app.w, app.h);
- if(aes_handle<0) {
+ gw->root->aes_handle = wind_create(flags, 40, 40, app.w, app.h);
+ if(gw->root->aes_handle<0) {
free(gw->root->title);
free(gw->root);
return( -1 );
}
- gw->root->win = guiwin_add(aes_handle,
+ gw->root->win = guiwin_add(gw->root->aes_handle,
GW_FLAG_PREPROC_WM | GW_FLAG_RECV_PREPROC_WM, handle_event);
struct rootwin_data_s * data = malloc(sizeof(struct rootwin_data_s));
@@ -265,10 +264,10 @@ int window_create(struct gui_window * gw,
}
// Setup some window defaults:
- wind_set_str(aes_handle, WF_ICONTITLE, (char*)"NetSurf");
- wind_set(aes_handle, WF_OPTS, 1, WO0_FULLREDRAW, 0, 0);
- wind_set(aes_handle, WF_OPTS, 1, WO0_NOBLITW, 0, 0);
- wind_set(aes_handle, WF_OPTS, 1, WO0_NOBLITH, 0, 0);
+ wind_set_str(gw->root->aes_handle, WF_ICONTITLE, (char*)"NetSurf");
+ wind_set(gw->root->aes_handle, WF_OPTS, 1, WO0_FULLREDRAW, 0, 0);
+ wind_set(gw->root->aes_handle, WF_OPTS, 1, WO0_NOBLITW, 0, 0);
+ wind_set(gw->root->aes_handle, WF_OPTS, 1, WO0_NOBLITH, 0, 0);
if (inflags & WIN_TOP) {
window_set_focus(gw->root, BROWSER, gw->browser);
@@ -332,6 +331,8 @@ int window_destroy(ROOTWIN *rootwin)
free(rootwin->title);
guiwin_remove(rootwin->win);
+ wind_close(rootwin->aes_handle);
+ wind_delete(rootwin->aes_handle);
free(rootwin);
return(err);
}
@@ -344,9 +345,8 @@ void window_open(ROOTWIN *rootwin, GRECT pos)
assert(rootwin->active_gui_window != NULL);
- short aes_handle = guiwin_get_handle(rootwin->win);
- wind_open(aes_handle, pos.g_x, pos.g_y, pos.g_w, pos.g_h );
- wind_set_str(aes_handle, WF_NAME, (char *)"");
+ wind_open(rootwin->aes_handle, pos.g_x, pos.g_y, pos.g_w, pos.g_h );
+ wind_set_str(rootwin->aes_handle, WF_NAME, (char *)"");
rootwin->active_gui_window->browser->attached = true;
if(rootwin->statusbar != NULL) {
@@ -387,7 +387,7 @@ void window_set_stauts(struct s_gui_win_root *rootwin, char * text)
void window_set_title(struct s_gui_win_root * rootwin, char *title)
{
- wind_set_str(guiwin_get_handle(rootwin->win), WF_NAME, title);
+ wind_set_str(rootwin->aes_handle, WF_NAME, title);
}
void window_scroll_by(ROOTWIN *root, int sx, int sy)
@@ -662,13 +662,12 @@ static void window_redraw_content(ROOTWIN *rootwin, GRECT *content_area,
void window_process_redraws(ROOTWIN * rootwin)
{
GRECT work, visible_ro, tb_area, content_area;
- short aes_handle, i;
+ short i;
bool toolbar_rdrw_required;
struct guiwin_scroll_info_s *slid =NULL;
redraw_active = true;
- aes_handle = guiwin_get_handle(rootwin->win);
guiwin_get_grect(rootwin->win, GUIWIN_AREA_TOOLBAR, &tb_area);
guiwin_get_grect(rootwin->win, GUIWIN_AREA_CONTENT, &content_area);
@@ -685,7 +684,7 @@ void window_process_redraws(ROOTWIN * rootwin)
while(plot_lock() == false);
- wind_get_grect(aes_handle, WF_FIRSTXYWH, &visible_ro);
+ wind_get_grect(rootwin->aes_handle, WF_FIRSTXYWH, &visible_ro);
while (visible_ro.g_w > 0 && visible_ro.g_h > 0) {
// TODO: optimze the rectangle list -
@@ -717,7 +716,7 @@ void window_process_redraws(ROOTWIN * rootwin)
}
}
- wind_get_grect(aes_handle, WF_NEXTXYWH, &visible_ro);
+ wind_get_grect(rootwin->aes_handle, WF_NEXTXYWH, &visible_ro);
}
vs_clip(guiwin_get_vdi_handle(rootwin->win), 0, pxy_clip);
rootwin->redraw_slots.areas_used = 0;
@@ -985,10 +984,8 @@ static void on_redraw(ROOTWIN *rootwin, short msg[8])
static void on_resized(ROOTWIN *rootwin)
{
GRECT g;
- short handle;
struct gui_window *gw;
- handle = guiwin_get_handle(rootwin->win);
gw = window_get_active_gui_window(rootwin);
//printf("resized...\n");
@@ -998,7 +995,7 @@ static void on_resized(ROOTWIN *rootwin)
if(gw == NULL)
return;
- wind_get_grect(handle, WF_CURRXYWH, &g);
+ wind_get_grect(rootwin->aes_handle, WF_CURRXYWH, &g);
if (rootwin->loc.g_w != g.g_w || rootwin->loc.g_h != g.g_h) {
if ( gw->browser->bw->current_content != NULL ) {
diff --git a/atari/settings.c b/atari/settings.c
index 0aa78cc..785d6f3 100644
--- a/atari/settings.c
+++ b/atari/settings.c
@@ -1,20 +1,3 @@
-/*
- * Copyright 2012 Ole Loots <ole(a)monochrom.net>
- *
- * This file is part of NetSurf, http://www.netsurf-browser.org/
- *
- * NetSurf is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * NetSurf is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
#include <sys/types.h>
#include <sys/stat.h>
@@ -38,10 +21,10 @@
#include "atari/findfile.h"
#include "atari/gemtk/gemtk.h"
-extern char options[PATH_MAX];
+extern char options[PATH_MAX];
+extern GRECT desk_area;
+
-static OBJECT * dlgtree;
-static WINDOW * dlgwin;
static float tmp_option_memory_cache_size;
static float tmp_option_minimum_gif_delay;
@@ -52,893 +35,139 @@ static unsigned int tmp_option_min_reflow_period;
static unsigned int tmp_option_max_fetchers;
static unsigned int tmp_option_max_fetchers_per_host;
static unsigned int tmp_option_max_cached_fetch_handles;
-static colour tmp_option_atari_toolbar_bg;
-
-/* Tab forms and their buttons: */
-static int frms[] = {
- CHOICES_TAB_BROWSER,
- CHOICES_TAB_RENDER,
- CHOICES_TAB_STYLE,
- CHOICES_TAB_NETWORK,
- CHOICES_TAB_PATH,
- CHOICES_TAB_CACHE
-};
-
-static int buts[] = {
- CHOICES_REG_BROWSER,
- CHOICES_REG_RENDER,
- CHOICES_REG_STYLE,
- CHOICES_REG_NETWORK,
- CHOICES_REG_PATH,
- CHOICES_REG_CACHE
-};
-
-#define OBJ_SELECTED(idx) ((dlgtree[idx].ob_state & SELECTED)!=0)
-#define OBJ_CHECK(idx) SET_BIT(dlgtree[idx].ob_state, SELECTED, 1);
-#define OBJ_UNCHECK(idx) SET_BIT(dlgtree[idx].ob_state, SELECTED, 0);
-
-#define DISABLE_OBJ(idx) SET_BIT(dlgtree[idx].ob_state, DISABLED, 1); \
- ObjcDraw( OC_FORM, dlgwin, idx, 1 )
-
-#define ENABLE_OBJ(idx) SET_BIT(dlgtree[idx].ob_state, DISABLED, 0); \
- ObjcDraw( OC_FORM, dlgwin, idx, 1 )
-
-#define FORMEVENT(idx) form_event( NULL, idx, 0, NULL );
-
-#define INPUT_HOMEPAGE_URL_MAX_LEN 44
-#define INPUT_LOCALE_MAX_LEN 6
-#define INPUT_PROXY_HOST_MAX_LEN 31
-#define INPUT_PROXY_USERNAME_MAX_LEN 36
-#define INPUT_PROXY_PASSWORD_MAX_LEN 36
-#define INPUT_PROXY_PORT_MAX_LEN 5
-#define INPUT_MIN_REFLOW_PERIOD_MAX_LEN 4
-#define LABEL_FONT_RENDERER_MAX_LEN 8
-#define LABEL_PATH_MAX_LEN 43
-#define LABEL_ICONSET_MAX_LEN 8
-#define INPUT_TOOLBAR_COLOR_MAX_LEN 6
-
-static void toggle_objects( void );
-static void display_settings( void );
-static void apply_settings( void );
-static void __CDECL onclose( WINDOW *win, short buff[8] );
-static void __CDECL
- closeform( WINDOW *win, int index, int unused, void *unused2);
-static void __CDECL
- saveform( WINDOW *win, int index, int unused, void *unused2);
-static void __CDECL
- form_event( WINDOW *win, int index, int unused, void *unused2);
-static void __CDECL
- clear_history( WINDOW *win, int index, int unused, void *unused2);
-
-
-
-WINDOW * open_settings()
-{
-
- if( dlgtree == NULL){
- dlgtree = get_tree(CHOICES);
- if( dlgtree == NULL ){
- return( NULL );
- }
- }
-
- if( dlgwin == NULL){
- // TODO: localize title
- dlgwin = FormCreate(dlgtree, WAT_FORM, NULL, (char*)"Settings",
- NULL, TRUE, FALSE);
- if( !dlgwin ){
- return( NULL );
- }
- FormThumb( dlgwin, frms, buts, sizeof(frms) / sizeof(int) );
-
- /* Atach events to dialog buttons: */
- ObjcAttachFormFunc( dlgwin, CHOICES_ABORT, closeform, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_OK, saveform, NULL);
-
- /* Connect interactive dialog elements to generic event handler: */
- ObjcAttachFormFunc( dlgwin, CHOICES_CB_USE_PROXY, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_CB_PROXY_AUTH, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_EDIT_DOWNLOAD_PATH, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_EDIT_HOTLIST_FILE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_EDIT_CA_BUNDLE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_EDIT_CA_CERTS_PATH, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_EDIT_EDITOR, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INC_GIF_DELAY, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_DEC_GIF_DELAY, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INC_INCREMENTAL_REFLOW, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_DEC_INCREMENTAL_REFLOW, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INC_CACHED_CONNECTIONS, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_DEC_CACHED_CONNECTIONS, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INC_MAX_FETCHERS_PER_HOST, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_DEC_MAX_FETCHERS_PER_HOST, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_DEC_MAX_FETCHERS, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INC_MAX_FETCHERS, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INC_DEF_FONT_SIZE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_DEC_DEF_FONT_SIZE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INC_MIN_FONT_SIZE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_DEC_MIN_FONT_SIZE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INC_MEM_CACHE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_DEC_MEM_CACHE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INC_HISTORY_AGE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_DEC_HISTORY_AGE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_BT_SEL_FONT_RENDERER,
- form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_BT_SEL_LOCALE,
- form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INPUT_TOOLBAR_BGCOLOR,
- form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_BT_TOOLBAR_ICONSET,
- form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_BT_CLEAR_HISTORY,
- clear_history, NULL);
-
- EvntAdd( dlgwin, WM_CLOSED, onclose, EV_TOP );
- display_settings();
- toggle_objects();
-
- } else {
- WindTop( dlgwin );
- display_settings();
- toggle_objects();
- }
- return( dlgwin );
-}
-
-void close_settings(void)
-{
- if( dlgwin != NULL ){
- /* Duplicated form tree must be free'd manualy? */
- WindClose(dlgwin);
- dlgwin = NULL;
- }
-
-}
-
-static void set_text( short idx, char * text, int len )
-{
- char spare[255];
-
- if( len > 254 )
- len = 254;
- if( text != NULL ){
- strncpy( spare, text, 254);
- ObjcStrFmt( spare, text, len );
- } else {
- strcpy(spare, "");
- }
- ObjcStrCpy( dlgtree, idx, spare );
-
-}
-
-
-static void __CDECL onclose( WINDOW *win, short buff[8] )
-{
- close_settings();
-}
-
-static void __CDECL
-closeform( WINDOW *win, int index, int unused, void *unused2)
-{
- ObjcChange( OC_FORM, win, index, ~SELECTED, TRUE);
- close_settings();
-}
-
-static void __CDECL
-saveform( WINDOW *win, int index, int unused, void *unused2)
-{
- apply_settings();
- // Save settings
- nsoption_write( (const char*)&options );
- nsoption_read( (const char*)&options );
- close_settings();
- ObjcChange( OC_FORM, win, index, NORMAL, TRUE);
- form_alert(1, "[1][Some options require an netsurf restart!][OK]");
- deskmenu_update();
-}
-
-static void __CDECL clear_history( WINDOW *win, int index, int unused,
- void *unused2)
-{
-
-}
-
-
-static colour color_popup(int x, int y, colour current)
-{
-#define GRID_ROWS 9
-#define GRID_COLS 27
- colour retval = current;
- int boxwidth=6, boxheight=8;
- struct bitmap *palette_img;
- MFDB bg, screen;
- GRECT bgarea = {x, y, GRID_COLS*boxwidth+4, GRID_ROWS*boxheight+4};
- short web_std_colors[6] = {0, 51, 102, 153, 204, 255};
- int r,g,b;
- int xpos = 0, ypos = 0;
- colour palette[216+8];
- int i=0;
-
- plot_style_t drawcolour = {
- .stroke_type = PLOT_OP_TYPE_NONE,
- .fill_type = PLOT_OP_TYPE_SOLID,
- .fill_colour = 0
- };
-
- plot_style_t outline = {
- .stroke_type = PLOT_OP_TYPE_SOLID,
- .stroke_colour = 0xAAAAAA,
- .stroke_width = 2,
- .fill_type = PLOT_OP_TYPE_NONE,
- .fill_colour = 0
- };
-
- /* create a palette array (web colors): */
- for (r=0; r<6; r++) {
- for (g=0; g<6; g++) {
- for (b=0; b<6; b++) {
- palette[i] = ((web_std_colors[b]<<16)
- | (web_std_colors[g]<<8)
- | web_std_colors[r]);
- i++;
- }
- }
- }
-
- /* setup the gray color values: */
- int z = 0;
- colour grays[15] = {0x111111, 0x222222, 0x333333, 0x444444,
- 0x555555, 0x666666, 0x777777, 0x888888,
- 0x999999, 0x999999, 0xAAAAAA, 0xBBBBBB,
- 0xCCCCCC, 0xDDDDDD, 0xEEEEEE};
- for (z=0;i<243;i++) {
- if (z<15)
- palette[i] = grays[z];
- else
- palette[i] = 0x000000;
- z++;
- }
-
- plot_set_dimensions(x, y,
- (GRID_COLS*boxwidth)+4, (GRID_ROWS*boxheight)+4);
- plot_lock();
-
- // store background:
- short pxy[8];
- init_mfdb(app.nplanes, bgarea.g_w, bgarea.g_h, 0, &bg);
- init_mfdb(0, bgarea.g_w, bgarea.g_h, 0, &screen);
-
- pxy[0] = bgarea.g_x;
- pxy[1] = bgarea.g_y;
- pxy[2] = bgarea.g_x + bgarea.g_w - 1;
- pxy[3] = bgarea.g_y + bgarea.g_h - 1;
- pxy[4] = 0;
- pxy[5] = 0;
- pxy[6] = bgarea.g_w - 1;
- pxy[7] = bgarea.g_h - 1;
-
- /* copy screen image */
- vro_cpyfm (app.graf.handle, S_ONLY, pxy, &screen, &bg);
-
- plot_line(x, y, x+(GRID_COLS*boxwidth)+2, y,
- &outline);
-
- plot_line(x, y+(GRID_ROWS*boxheight)+2, x+(GRID_COLS*boxwidth)+2,
- y+(GRID_ROWS*boxheight)+2,
- &outline);
-
- /* draw a 27*8 grid: */
- for (i=0; i<243; i++){
- drawcolour.fill_colour = palette[i];
- plot_rectangle(xpos+2, ypos+2, xpos+boxwidth+2, ypos+boxheight+2,
- &drawcolour);
- xpos += boxwidth;
- if (xpos >= GRID_COLS*boxwidth) {
- xpos = 0;
- ypos += boxheight;
- }
+static colour tmp_option_atari_toolbar_bg;
+
+static short h_aes_win = 0;
+static GUIWIN * settings_guiwin = NULL;
+static OBJECT * dlgtree;
+
+static void on_close(void);
+static void on_redraw(GRECT *clip);
+
+
+static void on_redraw(GRECT *clip)
+{
+ GRECT visible, work, clip_ro;
+ int scroll_px_x, scroll_px_y;
+ struct guiwin_scroll_info_s *slid;
+
+ /*Walk the AES rectangle list and redraw the visible areas of the window: */
+ guiwin_get_grect(settings_guiwin, GUIWIN_AREA_CONTENT, &work);
+ slid = guiwin_get_scroll_info(settings_guiwin);
+
+ dlgtree->ob_x = work.g_x - (slid->x_pos * slid->x_unit_px);
+ dlgtree->ob_y = work.g_y - (slid->y_pos * slid->y_unit_px);
+
+ wind_get_grect(h_aes_win, WF_FIRSTXYWH, &visible);
+ while (visible.g_x && visible.g_y) {
+ if (rc_intersect(clip, &visible)) {
+ objc_draw_grect(dlgtree, 0, 8, &visible);
+ }
+ wind_get_grect(h_aes_win, WF_NEXTXYWH, &visible);
}
+}
- // enable mouse cursor (screen keeps beeing locked):
- graf_mouse(M_ON, NULL);
-
- /* fetch mouse event: */
- mt_EvntDisable(&app, dlgwin, WM_XBUTTON);
- EvntWindom(MU_BUTTON);
- mt_EvntEnable(&app, dlgwin, WM_XBUTTON);
-
- /* calulate clicked grid coords: */
- int row = ((evnt.my-y)/boxheight);
- int col = ((evnt.mx-x)/boxwidth);
-
- if (row >= 0 && row <= GRID_ROWS-1 && col >= 0 && col <= GRID_COLS-1) {
- assert( (GRID_COLS*row)+(col) >= 0 );
- assert( (GRID_COLS*row)+(col) < 243 );
- retval = palette[(GRID_COLS*row)+(col)];
- }
-
- /* restore background: */
- w_put_bkgr(&app, bgarea.g_x, bgarea.g_y, bgarea.g_w, bgarea.g_h, &bg);
- free(bg.fd_addr);
-
- plot_unlock();
-
-#undef GRID_COLS
-#undef GRID_ROWS
-
- return(retval);
-}
-
-/**
-* Displays a popup to select available icon sets,
- the returned string is no longer than 8 characters.
-* \param x x pos of popup
-* \param y y pos of popup
-* \return the selected string or NULL on failure.
-*/
-static char * toolbar_iconset_popup( int x, int y )
-{
- #define MAX_SETS 24
- DIR *dp;
- struct dirent *ep;
- struct stat statbuf;
- char * current = NULL;
- char *avail[MAX_SETS];
- int selected = 0, navail = 0, i, choice=-1;
- static char toolbar_folder[PATH_MAX];
- char fullpath[PATH_MAX];
-
- strncpy( fullpath, nsoption_charp(tree_icons_path), 255 );
- path_add_part( fullpath, 255, "toolbar/" );
-
- /* Get current set (for pre-selection): */
- memset( avail, 0, MAX_SETS );
- current = "";
-
- /* locate the toolbar folder: */
- atari_find_resource( toolbar_folder, fullpath, fullpath );
-
- /* search for iconset folders: */
- dp = opendir (toolbar_folder);
- if (dp != NULL){
- while (ep = readdir (dp)) {
- if (strlen(ep->d_name) < 3)
- continue;
- snprintf(fullpath, PATH_MAX-1, "%s/%s", toolbar_folder, ep->d_name );
- if (is_dir(fullpath)) {
- if (strcmp(ep->d_name, current) == 0)
- selected = navail;
- /* store the folder name: */
- avail[navail] = malloc( strlen(ep->d_name)+1 );
- sprintf( avail[navail], "%s", ep->d_name );
- navail++;
- if( navail >= MAX_SETS )
- break;
- }
- }
- (void) closedir (dp);
- }
-
-
- if (navail > 0){
- choice = MenuPopUp( avail, x, y, navail,
- -1, selected, P_LIST | P_CHCK );
- if (choice > 0)
- snprintf( toolbar_folder, 9, "%s", avail[choice-1] );
- }
-
- for (i=0;i<navail; i++ ) {
- free( avail[i] );
- }
- if (choice > 0)
- return( toolbar_folder );
- else
- return( NULL );
- #undef MAX_SETS
-}
-
-static void __CDECL
-form_event( WINDOW *win, int index, int external, void *unused2)
-{
- char spare[255];
- bool is_button = false;
- bool checked = OBJ_SELECTED( index );
- char * tmp;
-
- /* For font driver popup: */
- const char *font_driver_items[] = {"freetype", "internal" };
- int num_font_drivers = (sizeof(font_driver_items)/sizeof(char*));
-
- /*
- Just a small collection of locales, each country has at least one
- ATARI-clone user! :)
- */
- const char *locales[] = {
- "cs", "de", "de-de" , "en", "en-gb", "en-us", "es",
- "fr", "it", "nl", "no", "pl", "ru", "sk", "sv"
- };
- int num_locales = (sizeof(locales)/sizeof(char*));
- short x, y;
- int choice;
+static short on_aes_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
+{
+ short retval = 0;
+ GRECT clip, work;
- switch( index ){
-
- case CHOICES_CB_USE_PROXY:
- if( checked ){
- ENABLE_OBJ( CHOICES_EDIT_PROXY_HOST );
- ENABLE_OBJ( CHOICES_CB_PROXY_AUTH );
- }
- else {
- DISABLE_OBJ( CHOICES_EDIT_PROXY_HOST );
- DISABLE_OBJ( CHOICES_CB_PROXY_AUTH );
- }
- FORMEVENT( CHOICES_CB_PROXY_AUTH );
- ObjcDrawParent(OC_FORM, dlgwin, index, 9, 1 );
- break;
-
- case CHOICES_CB_PROXY_AUTH:
- if( checked && OBJ_SELECTED( CHOICES_CB_USE_PROXY ) ){
- ENABLE_OBJ(CHOICES_EDIT_PROXY_USERNAME);
- ENABLE_OBJ(CHOICES_EDIT_PROXY_PASSWORD);
- }
- else {
- DISABLE_OBJ(CHOICES_EDIT_PROXY_USERNAME);
- DISABLE_OBJ(CHOICES_EDIT_PROXY_PASSWORD);
- }
- break;
-
- case CHOICES_CB_ENABLE_ANIMATION:
- if( checked ){
- ENABLE_OBJ( CHOICES_EDIT_MIN_GIF_DELAY );
- }
- else {
- DISABLE_OBJ( CHOICES_EDIT_MIN_GIF_DELAY );
- }
- break;
-
- case CHOICES_BT_SEL_FONT_RENDERER:
- if( external ){
- objc_offset( FORM(win), CHOICES_BT_SEL_FONT_RENDERER, &x, &y);
- choice = MenuPopUp ( font_driver_items, x, y,
- num_font_drivers,
- -1, -1, P_LIST + P_WNDW + P_CHCK );
- if( choice > 0 &&
- choice <= num_font_drivers ){
- ObjcStrCpy( dlgtree, CHOICES_BT_SEL_FONT_RENDERER,
- (char*)font_driver_items[choice-1] );
- }
- ObjcChange( OC_FORM, win, index, NORMAL, TRUE);
- }
- tmp = ObjcString( dlgtree, CHOICES_BT_SEL_FONT_RENDERER, NULL);
- if( strcmp(tmp, "freetype") == 0 ){
- ENABLE_OBJ( CHOICES_CB_ANTI_ALIASING );
- } else {
- DISABLE_OBJ( CHOICES_CB_ANTI_ALIASING );
- }
- break;
-
- case CHOICES_BT_SEL_LOCALE:
- objc_offset( FORM(win), CHOICES_BT_SEL_LOCALE, &x, &y);
- choice = MenuPopUp ( locales, x, y,
- num_locales,
- -1, -1, P_LIST + P_WNDW + P_CHCK );
- if( choice > 0 && choice <= num_locales ){
- ObjcStrCpy( dlgtree, CHOICES_BT_SEL_LOCALE,
- (char*)locales[choice-1] );
- }
- ObjcChange( OC_FORM, win, index, NORMAL, TRUE);
- break;
-
- case CHOICES_INPUT_TOOLBAR_BGCOLOR:
- objc_offset( FORM(win), CHOICES_INPUT_TOOLBAR_BGCOLOR, &x, &y );
- choice = color_popup(x, y, tmp_option_atari_toolbar_bg);
- snprintf( spare, 255, "%06x", choice );
- tmp_option_atari_toolbar_bg = choice;
- ObjcStrCpy( dlgtree, CHOICES_INPUT_TOOLBAR_BGCOLOR,
- spare );
- is_button = true;
- ObjcChange( OC_FORM, win, index, NORMAL, TRUE);
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_INPUT_TOOLBAR_BGCOLOR, 2, 1 );
- break;
-
- case CHOICES_BT_TOOLBAR_ICONSET:
- objc_offset( FORM(win), CHOICES_BT_TOOLBAR_ICONSET, &x, &y );
- tmp = toolbar_iconset_popup(x,y);
- if( tmp != NULL ){
- ObjcStrCpy( dlgtree, CHOICES_BT_TOOLBAR_ICONSET, tmp );
- }
- is_button = true;
- ObjcChange( OC_FORM, win, index, NORMAL, TRUE);
- break;
-
- case CHOICES_INC_MEM_CACHE:
- case CHOICES_DEC_MEM_CACHE:
- if( index == CHOICES_DEC_MEM_CACHE )
- tmp_option_memory_cache_size -= 0.1;
- else
- tmp_option_memory_cache_size += 0.1;
-
- if( tmp_option_memory_cache_size < 0.5 )
- tmp_option_memory_cache_size = 0.5;
- if( tmp_option_memory_cache_size > 999.9 )
- tmp_option_memory_cache_size = 999.9;
- snprintf( spare, 255, "%03.1f", tmp_option_memory_cache_size );
- set_text( CHOICES_STR_MAX_MEM_CACHE, spare, 5 );
- is_button = true;
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_STR_MAX_MEM_CACHE, 2, 1 );
- break;
-
- case CHOICES_INC_CACHED_CONNECTIONS:
- case CHOICES_DEC_CACHED_CONNECTIONS:
- if( index == CHOICES_INC_CACHED_CONNECTIONS )
- tmp_option_max_cached_fetch_handles += 1;
- else
- tmp_option_max_cached_fetch_handles -= 1;
- if( tmp_option_max_cached_fetch_handles > 31 )
- tmp_option_max_cached_fetch_handles = 31;
-
- snprintf( spare, 255, "%02d", tmp_option_max_cached_fetch_handles );
- set_text( CHOICES_EDIT_MAX_CACHED_CONNECTIONS, spare, 2 );
- is_button = true;
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_EDIT_MAX_CACHED_CONNECTIONS,
- 2, 1 );
- break;
-
- case CHOICES_INC_MAX_FETCHERS:
- case CHOICES_DEC_MAX_FETCHERS:
- if( index == CHOICES_INC_MAX_FETCHERS )
- tmp_option_max_fetchers += 1;
- else
- tmp_option_max_fetchers -= 1;
- if( tmp_option_max_fetchers > 31 )
- tmp_option_max_fetchers = 31;
-
- snprintf( spare, 255, "%02d", tmp_option_max_fetchers );
- set_text( CHOICES_EDIT_MAX_FETCHERS, spare, 2 );
- is_button = true;
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_EDIT_MAX_FETCHERS,
- 3, 1 );
- break;
-
- case CHOICES_INC_MAX_FETCHERS_PER_HOST:
- case CHOICES_DEC_MAX_FETCHERS_PER_HOST:
- if( index == CHOICES_INC_MAX_FETCHERS_PER_HOST )
- tmp_option_max_fetchers_per_host += 1;
- else
- tmp_option_max_fetchers_per_host -= 1;
- if( tmp_option_max_fetchers_per_host > 31 )
- tmp_option_max_fetchers_per_host = 31;
-
- snprintf( spare, 255, "%02d", tmp_option_max_fetchers_per_host );
- set_text( CHOICES_EDIT_MAX_FETCHERS_PER_HOST, spare, 2 );
- is_button = true;
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_EDIT_MAX_FETCHERS_PER_HOST,
- 2, 1 );
- break;
-
- case CHOICES_INC_HISTORY_AGE:
- case CHOICES_DEC_HISTORY_AGE:
- if( index == CHOICES_INC_HISTORY_AGE )
- tmp_option_expire_url += 1;
- else
- tmp_option_expire_url -= 1;
-
- if( tmp_option_expire_url > 99 )
- tmp_option_expire_url = 0;
-
- snprintf( spare, 255, "%02d", tmp_option_expire_url );
- set_text( CHOICES_EDIT_HISTORY_AGE, spare, 2 );
- is_button = true;
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_EDIT_HISTORY_AGE,
- 3, 1 );
- break;
-
- case CHOICES_INC_GIF_DELAY:
- case CHOICES_DEC_GIF_DELAY:
- if( index == CHOICES_INC_GIF_DELAY )
- tmp_option_minimum_gif_delay += 0.1;
- else
- tmp_option_minimum_gif_delay -= 0.1;
-
- if( tmp_option_minimum_gif_delay < 0.1 )
- tmp_option_minimum_gif_delay = 0.1;
- if( tmp_option_minimum_gif_delay > 9.0 )
- tmp_option_minimum_gif_delay = 9.0;
- snprintf( spare, 255, "%01.1f", tmp_option_minimum_gif_delay );
- set_text( CHOICES_EDIT_MIN_GIF_DELAY, spare, 3 );
- is_button = true;
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_EDIT_MIN_GIF_DELAY, 3, 1 );
- break;
-
- case CHOICES_INC_MIN_FONT_SIZE:
- case CHOICES_DEC_MIN_FONT_SIZE:
- if( index == CHOICES_INC_MIN_FONT_SIZE )
- tmp_option_font_min_size += 1;
- else
- tmp_option_font_min_size -= 1;
-
- if( tmp_option_font_min_size > 500 )
- tmp_option_font_min_size = 500;
- if( tmp_option_font_min_size < 10 )
- tmp_option_font_min_size = 10;
-
- snprintf( spare, 255, "%03d", tmp_option_font_min_size );
- set_text( CHOICES_EDIT_MIN_FONT_SIZE, spare, 3 );
- is_button = true;
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_EDIT_MIN_FONT_SIZE,
- 3, 1 );
- break;
-
- case CHOICES_INC_DEF_FONT_SIZE:
- case CHOICES_DEC_DEF_FONT_SIZE:
- if( index == CHOICES_INC_DEF_FONT_SIZE )
- tmp_option_font_size += 1;
- else
- tmp_option_font_size -= 1;
-
- if( tmp_option_font_size > 999 )
- tmp_option_font_size = 999;
- if( tmp_option_font_size < 50 )
- tmp_option_font_size = 50;
-
- snprintf( spare, 255, "%03d", tmp_option_font_size );
- set_text( CHOICES_EDIT_DEF_FONT_SIZE, spare, 3 );
- is_button = true;
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_EDIT_DEF_FONT_SIZE,
- 3, 1 );
-
- break;
-
- case CHOICES_INC_INCREMENTAL_REFLOW:
- case CHOICES_DEC_INCREMENTAL_REFLOW:
- if( index == CHOICES_INC_INCREMENTAL_REFLOW )
- tmp_option_min_reflow_period += 1;
- else
- tmp_option_min_reflow_period -= 1;
-
- if( tmp_option_min_reflow_period > 9999 )
- tmp_option_min_reflow_period = 10;
-
- snprintf( spare, 255, "%04d", tmp_option_min_reflow_period );
- set_text( CHOICES_EDIT_MIN_REFLOW_PERIOD, spare, 4 );
- is_button = true;
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_EDIT_MIN_REFLOW_PERIOD,
- 3, 1 );
- break;
-
- default: break;
- }
- if( is_button ){
- // remove selection indicator from button element:
- OBJ_UNCHECK( index );
- ObjcDraw( OC_FORM, dlgwin, index, 1 );
- }
-}
-
-/**
- * Toogle all objects which are directly influenced by other GUI elements
- * ( like checkbox )
- */
-static void toggle_objects( void )
-{
- /* enable / disable (refresh) objects depending on radio button values: */
- FORMEVENT(CHOICES_CB_USE_PROXY);
- FORMEVENT(CHOICES_CB_PROXY_AUTH);
- FORMEVENT(CHOICES_BT_SEL_FONT_RENDERER);
-}
-
-
-/* this gets called each time the settings dialog is opened: */
-static void display_settings( void )
-{
- char spare[255];
- // read current settings and display them
-
- /* "Browser" tab: */
- set_text( CHOICES_EDIT_HOMEPAGE, nsoption_charp(homepage_url),
- INPUT_HOMEPAGE_URL_MAX_LEN );
-
- if( nsoption_bool(block_ads) ){
- OBJ_CHECK( CHOICES_CB_HIDE_ADVERTISEMENT );
- } else {
- OBJ_UNCHECK( CHOICES_CB_HIDE_ADVERTISEMENT );
- }
- if( nsoption_bool(target_blank) ){
- OBJ_UNCHECK( CHOICES_CB_DISABLE_POPUP_WINDOWS );
- } else {
- OBJ_CHECK( CHOICES_CB_DISABLE_POPUP_WINDOWS );
- }
- if( nsoption_bool(send_referer) ){
- OBJ_CHECK( CHOICES_CB_SEND_HTTP_REFERRER );
- } else {
- OBJ_UNCHECK( CHOICES_CB_SEND_HTTP_REFERRER );
- }
- if( nsoption_bool(do_not_track) ){
- OBJ_CHECK( CHOICES_CB_SEND_DO_NOT_TRACK );
- } else {
- OBJ_UNCHECK( CHOICES_CB_SEND_DO_NOT_TRACK );
- }
-
- set_text( CHOICES_BT_SEL_LOCALE,
- nsoption_charp(accept_language) ? nsoption_charp(accept_language) : (char*)"en",
- INPUT_LOCALE_MAX_LEN );
-
- tmp_option_expire_url = nsoption_int(expire_url);
- snprintf( spare, 255, "%02d", nsoption_int(expire_url) );
- set_text( CHOICES_EDIT_HISTORY_AGE, spare, 2 );
-
- /* "Cache" tab: */
- tmp_option_memory_cache_size = nsoption_int(memory_cache_size) / 100000;
- snprintf( spare, 255, "%03.1f", tmp_option_memory_cache_size );
- set_text( CHOICES_STR_MAX_MEM_CACHE, spare, 5 );
-
- /* "Paths" tab: */
- set_text( CHOICES_EDIT_DOWNLOAD_PATH, nsoption_charp(downloads_path),
- LABEL_PATH_MAX_LEN );
- set_text( CHOICES_EDIT_HOTLIST_FILE, nsoption_charp(hotlist_file),
- LABEL_PATH_MAX_LEN );
- set_text( CHOICES_EDIT_CA_BUNDLE, nsoption_charp(ca_bundle),
- LABEL_PATH_MAX_LEN );
- set_text( CHOICES_EDIT_CA_CERTS_PATH, nsoption_charp(ca_path),
- LABEL_PATH_MAX_LEN );
- set_text( CHOICES_EDIT_EDITOR, nsoption_charp(atari_editor),
- LABEL_PATH_MAX_LEN );
-
- /* "Rendering" tab: */
- set_text( CHOICES_BT_SEL_FONT_RENDERER, nsoption_charp(atari_font_driver),
- LABEL_FONT_RENDERER_MAX_LEN );
- SET_BIT(dlgtree[CHOICES_CB_TRANSPARENCY].ob_state,
- SELECTED, nsoption_int(atari_transparency) ? 1 : 0 );
- SET_BIT(dlgtree[CHOICES_CB_ENABLE_ANIMATION].ob_state,
- SELECTED, nsoption_bool(animate_images) ? 1 : 0 );
- SET_BIT(dlgtree[CHOICES_CB_INCREMENTAL_REFLOW].ob_state,
- SELECTED, nsoption_bool(incremental_reflow) ? 1 : 0 );
- SET_BIT(dlgtree[CHOICES_CB_ANTI_ALIASING].ob_state,
- SELECTED, nsoption_int(atari_font_monochrom) ? 0 : 1 );
-
- tmp_option_min_reflow_period = nsoption_int(min_reflow_period);
- snprintf( spare, 255, "%04d", tmp_option_min_reflow_period );
- set_text( CHOICES_EDIT_MIN_REFLOW_PERIOD, spare,
- INPUT_MIN_REFLOW_PERIOD_MAX_LEN );
-
- tmp_option_minimum_gif_delay = (float)nsoption_int(minimum_gif_delay) / (float)100;
- snprintf( spare, 255, "%01.1f", tmp_option_minimum_gif_delay );
- set_text( CHOICES_EDIT_MIN_GIF_DELAY, spare, 3 );
-
- /* "Network" tab: */
- set_text( CHOICES_EDIT_PROXY_HOST, nsoption_charp(http_proxy_host),
- INPUT_PROXY_HOST_MAX_LEN );
- snprintf( spare, 255, "%5d", nsoption_int(http_proxy_port) );
- set_text( CHOICES_EDIT_PROXY_PORT, spare,
- INPUT_PROXY_PORT_MAX_LEN );
-
- set_text( CHOICES_EDIT_PROXY_USERNAME, nsoption_charp(http_proxy_auth_user),
- INPUT_PROXY_USERNAME_MAX_LEN );
- set_text( CHOICES_EDIT_PROXY_PASSWORD, nsoption_charp(http_proxy_auth_pass),
- INPUT_PROXY_PASSWORD_MAX_LEN );
- SET_BIT(dlgtree[CHOICES_CB_USE_PROXY].ob_state,
- SELECTED, nsoption_bool(http_proxy) ? 1 : 0 );
- SET_BIT(dlgtree[CHOICES_CB_PROXY_AUTH].ob_state,
- SELECTED, nsoption_int(http_proxy_auth) ? 1 : 0 );
- SET_BIT(dlgtree[CHOICES_CB_FG_IMAGES].ob_state,
- SELECTED, nsoption_bool(foreground_images) ? 1 : 0 );
- SET_BIT(dlgtree[CHOICES_CB_BG_IMAGES].ob_state,
- SELECTED, nsoption_bool(background_images) ? 1 : 0 );
-
- tmp_option_max_cached_fetch_handles = nsoption_int(max_cached_fetch_handles);
- snprintf( spare, 255, "%2d", nsoption_int(max_cached_fetch_handles) );
- set_text( CHOICES_EDIT_MAX_CACHED_CONNECTIONS, spare , 2 );
-
- tmp_option_max_fetchers = nsoption_int(max_fetchers);
- snprintf( spare, 255, "%2d", nsoption_int(max_fetchers) );
- set_text( CHOICES_EDIT_MAX_FETCHERS, spare , 2 );
-
- tmp_option_max_fetchers_per_host = nsoption_int(max_fetchers_per_host);
- snprintf( spare, 255, "%2d", nsoption_int(max_fetchers_per_host) );
- set_text( CHOICES_EDIT_MAX_FETCHERS_PER_HOST, spare , 2 );
-
-
- /* "Style" tab: */
- tmp_option_font_min_size = nsoption_int(font_min_size);
- snprintf( spare, 255, "%3d", nsoption_int(font_min_size) );
- set_text( CHOICES_EDIT_MIN_FONT_SIZE, spare , 3 );
-
- tmp_option_font_size = nsoption_int(font_size);
- snprintf( spare, 255, "%3d", nsoption_int(font_size) );
- set_text( CHOICES_EDIT_DEF_FONT_SIZE, spare , 3 );
-
- /* Only first tab is refreshed: */
- ObjcDraw( OC_FORM, dlgwin, CHOICES_TAB_BROWSER, 4 );
-
- // update elements (enable/disable) chained to form events:
- toggle_objects();
-}
-
-static void apply_settings( void )
-{
- /* "Network" tab: */
- nsoption_set_bool(http_proxy, OBJ_SELECTED(CHOICES_CB_USE_PROXY));
- if ( OBJ_SELECTED(CHOICES_CB_PROXY_AUTH) ) {
- nsoption_set_int(http_proxy_auth, OPTION_HTTP_PROXY_AUTH_BASIC);
- } else {
- nsoption_set_int(http_proxy_auth, OPTION_HTTP_PROXY_AUTH_NONE);
- }
- nsoption_set_charp(http_proxy_auth_pass,
- ObjcString( dlgtree, CHOICES_EDIT_PROXY_PASSWORD, NULL));
- nsoption_set_charp(http_proxy_auth_user,
- ObjcString( dlgtree, CHOICES_EDIT_PROXY_USERNAME, NULL));
- nsoption_set_charp(http_proxy_host,
- ObjcString( dlgtree, CHOICES_EDIT_PROXY_HOST, NULL));
- nsoption_set_int(http_proxy_port,
- atoi( ObjcString( dlgtree, CHOICES_EDIT_PROXY_PORT, NULL) ));
- nsoption_set_int(max_fetchers_per_host,
- atoi( ObjcString( dlgtree, CHOICES_EDIT_MAX_FETCHERS_PER_HOST, NULL)));
- nsoption_set_int(max_cached_fetch_handles,
- atoi( ObjcString( dlgtree, CHOICES_EDIT_MAX_CACHED_CONNECTIONS, NULL)));
- nsoption_set_int(max_fetchers,
- atoi( ObjcString( dlgtree, CHOICES_EDIT_MAX_FETCHERS, NULL) ));
- nsoption_set_bool(foreground_images,
- OBJ_SELECTED( CHOICES_CB_FG_IMAGES ));
- nsoption_set_bool(background_images,
- OBJ_SELECTED( CHOICES_CB_BG_IMAGES ));
-
- /* "Style" tab: */
- nsoption_set_int(font_min_size, tmp_option_font_min_size);
- nsoption_set_int(font_size, tmp_option_font_size);
-
- /* "Rendering" tab: */
- nsoption_set_charp(atari_font_driver,
- ObjcString( dlgtree, CHOICES_BT_SEL_FONT_RENDERER, NULL));
- nsoption_set_bool(atari_transparency,
- OBJ_SELECTED(CHOICES_CB_TRANSPARENCY));
- nsoption_set_bool(animate_images,
- OBJ_SELECTED(CHOICES_CB_ENABLE_ANIMATION));
- nsoption_set_int(minimum_gif_delay,
- (int)(tmp_option_minimum_gif_delay*100+0.5));
- nsoption_set_bool(incremental_reflow,
- OBJ_SELECTED(CHOICES_CB_INCREMENTAL_REFLOW));
- nsoption_set_int(min_reflow_period, tmp_option_min_reflow_period);
- nsoption_set_int(atari_font_monochrom,
- !OBJ_SELECTED( CHOICES_CB_ANTI_ALIASING ));
-
- /* "Paths" tabs: */
- nsoption_set_charp(ca_bundle,
- ObjcString( dlgtree, CHOICES_EDIT_CA_BUNDLE, NULL));
- nsoption_set_charp(ca_path,
- ObjcString( dlgtree, CHOICES_EDIT_CA_CERTS_PATH, NULL));
- nsoption_set_charp(homepage_url,
- ObjcString( dlgtree, CHOICES_EDIT_CA_CERTS_PATH, NULL));
- nsoption_set_charp(hotlist_file,
- ObjcString( dlgtree, CHOICES_EDIT_HOTLIST_FILE, NULL));
- nsoption_set_charp(atari_editor,
- ObjcString( dlgtree, CHOICES_EDIT_EDITOR, NULL));
- nsoption_set_charp(downloads_path,
- ObjcString( dlgtree, CHOICES_EDIT_DOWNLOAD_PATH, NULL));
-
- /* "Cache" tab: */
- nsoption_set_int(memory_cache_size,
- tmp_option_memory_cache_size * 100000);
-
- /* "Browser" tab: */
- nsoption_set_bool(target_blank,
- !OBJ_SELECTED(CHOICES_CB_DISABLE_POPUP_WINDOWS));
- nsoption_set_bool(block_ads,
- OBJ_SELECTED(CHOICES_CB_HIDE_ADVERTISEMENT));
- nsoption_set_charp(accept_language,
- ObjcString( dlgtree, CHOICES_BT_SEL_LOCALE, NULL));
- nsoption_set_int(expire_url,
- atoi(ObjcString( dlgtree, CHOICES_EDIT_HISTORY_AGE, NULL)));
- nsoption_set_bool(send_referer,
- OBJ_SELECTED(CHOICES_CB_SEND_HTTP_REFERRER));
- nsoption_set_bool(do_not_track,
- OBJ_SELECTED(CHOICES_CB_SEND_HTTP_REFERRER));
- nsoption_set_charp(homepage_url,
- ObjcString( dlgtree, CHOICES_EDIT_HOMEPAGE, NULL));
-}
-
-#undef OBJ_SELECTED
-#undef OBJ_CHECK
-#undef OBJ_UNCHECK
-#undef DISABLE_OBJ
-#undef ENABLE_OBJ
-#undef FORMEVENT
-
+ if ((ev_out->emo_events & MU_MESAG) != 0) {
+ // handle message
+ printf("settings win msg: %d\n", msg[0]);
+ switch (msg[0]) {
+
+ case WM_REDRAW:
+ clip.g_x = msg[4];
+ clip.g_y = msg[5];
+ clip.g_w = msg[6];
+ clip.g_h = msg[7];
+ on_redraw(&clip);
+ break;
+
+ case WM_CLOSED:
+ // TODO: this needs to iterate through all gui windows and
+ // check if the rootwin is this window...
+ close_settings();
+ break;
+
+ case WM_SIZED:
+ guiwin_update_slider(win, GUIWIN_VH_SLIDER);
+ break;
+
+ case WM_TOOLBAR:
+ switch(msg[4]){
+ default: break;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+ if ((ev_out->emo_events & MU_KEYBD) != 0) {
+
+
+ }
+ if ((ev_out->emo_events & MU_BUTTON) != 0) {
+
+ struct guiwin_scroll_info_s *slid;
+
+ guiwin_get_grect(settings_guiwin, GUIWIN_AREA_CONTENT, &work);
+ slid = guiwin_get_scroll_info(settings_guiwin);
+ dlgtree->ob_x = work.g_x - (slid->x_pos * slid->x_unit_px);
+ dlgtree->ob_y = work.g_y - (slid->y_pos * slid->y_unit_px);
+
+ short obj = objc_find(dlgtree, 0, 8, ev_out->emo_mouse.p_x,
+ ev_out->emo_mouse.p_y);
+ printf("clicked: %d\n", obj);
+ evnt_timer(150);
+ }
+
+ return(retval);
+}
+
+void open_settings(void)
+{
+ if (h_aes_win == 0) {
+
+ GRECT curr, area;
+ struct guiwin_scroll_info_s *slid;
+ uint32_t kind = CLOSER | NAME | MOVER | VSLIDE | HSLIDE | UPARROW
+ | DNARROW | LFARROW | RTARROW | SIZER | FULLER;
+
+ dlgtree = get_tree(SETTINGS);
+ area.g_x = area.g_y = 0;
+ area.g_w = MIN(dlgtree->ob_width, desk_area.g_w);
+ area.g_h = MIN(dlgtree->ob_height, desk_area.g_h);
+ wind_calc_grect(WC_BORDER, kind, &area, &area);
+ h_aes_win = wind_create_grect(kind, &area);
+ wind_set_str(h_aes_win, WF_NAME, "Settings");
+ settings_guiwin = guiwin_add(h_aes_win, GW_FLAG_DEFAULTS,
+ on_aes_event);
+ curr.g_w = MIN(dlgtree->ob_width, desk_area.g_w);
+ curr.g_h = 200;
+ curr.g_x = (desk_area.g_w / 2) - (curr.g_w / 2);
+ curr.g_y = (desk_area.g_h / 2) - (curr.g_h / 2);
+ wind_calc_grect(WC_BORDER, kind, &curr, &curr);
+ wind_open_grect(h_aes_win, &curr);
+
+ slid = guiwin_get_scroll_info(settings_guiwin);
+ slid->y_unit_px = 32;
+ slid->x_unit_px = 32;
+ guiwin_get_grect(settings_guiwin, GUIWIN_AREA_CONTENT, &area);
+ slid->x_units = (dlgtree->ob_width/slid->x_unit_px);
+ slid->y_units = (dlgtree->ob_height/slid->y_unit_px);
+ guiwin_update_slider(settings_guiwin, GUIWIN_VH_SLIDER);
+ }
+}
+
+void close_settings(void)
+{
+ printf("settings close\n");
+ guiwin_remove(settings_guiwin);
+ settings_guiwin = NULL;
+ wind_close(h_aes_win);
+ wind_delete(h_aes_win);
+ h_aes_win = 0;
+}
diff --git a/atari/settings.h b/atari/settings.h
index 97b1941..ef6ae81 100644
--- a/atari/settings.h
+++ b/atari/settings.h
@@ -3,7 +3,7 @@
#include <windom.h>
-WINDOW * open_settings(void);
+void open_settings(void);
void close_settings(void);
#endif
commitdiff http://git.netsurf-browser.org/netsurf.git/commitdiff/3019368c93600a33544...
commit 3019368c93600a335445c09178c9554074c7f656
Merge: c6a5109 0d803b6
Author: Ole Loots <ole(a)monochrom.net>
Commit: Ole Loots <ole(a)monochrom.net>
Merge branch 'master' into mono/removing-windom-dependency
commitdiff http://git.netsurf-browser.org/netsurf.git/commitdiff/c6a5109a95c1206ccf6...
commit c6a5109a95c1206ccf63d99316fa12b8c43bb7cf
Author: Ole Loots <ole(a)monochrom.net>
Commit: Ole Loots <ole(a)monochrom.net>
Preparing for merge...
diff --git a/atari/Makefile.target b/atari/Makefile.target
index 616fa5a..8494518 100644
--- a/atari/Makefile.target
+++ b/atari/Makefile.target
@@ -73,12 +73,14 @@ LDFLAGS += -L$(GCCSDK_INSTALL_ENV)/lib
# S_ATARI are sources purely for the Atari FreeMiNT build
-S_ATARI := gui.c \
+S_ATARI := \
+ bitmap.c \
+ caret.c \
findfile.c \
filetype.c \
font.c \
+ gui.c \
misc.c \
- bitmap.c \
schedule.c \
download.c \
thumbnail.c \
diff --git a/atari/Makefile.target.orig b/atari/Makefile.target.orig
new file mode 100644
index 0000000..25951b9
--- /dev/null
+++ b/atari/Makefile.target.orig
@@ -0,0 +1,120 @@
+# ----------------------------------------------------------------------------
+# Atari target setup
+# ----------------------------------------------------------------------------
+
+ifeq ($(ATARI_ARCH),68000)
+PRGSUFFIX := 000.app
+PKGNAME := ns000.zip
+endif
+
+ifeq ($(ATARI_ARCH),68020-60)
+CFLAGS += -m68020-60
+LDFLAGS += -m68020-60
+PRGSUFFIX := 020.app
+PKGNAME := ns020.zip
+endif
+
+ifeq ($(ATARI_ARCH),5475)
+CFLAGS += -mcpu=5475
+LDFLAGS += -mcpu=5475
+PRGSUFFIX := v4e.app
+PKGNAME := nsv4e.zip
+endif
+
+# non-pkgconfig components
+
+FREETYPE_FONT_CFLAGS := $(shell freetype-config --cflags) -DWITH_FREETYPE_FONT_DRIVER
+SPIDERMONKEY_CFLAGS := -DWITH_MOZJS -DXP_UNIX -DJS_HAS_FILE_OBJECT=0 -DJSOPTION_JIT=0 -DPOSIX_SOURCE -D_BSD_SOURCE
+
+$(eval $(call feature_enabled,MNG,-DWITH_MNG,-lmng,PNG/MNG/JNG (libmng)))
+$(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng)))
+$(eval $(call feature_enabled,MOZJS,$(SPIDERMONKEY_CFLAGS),-ljs,JavaScript (Spidermonkey)))
+$(eval $(call feature_enabled,ATARI_FREETYPE_FONT,$(FREETYPE_FONT_CFLAGS),-lfreetype,(Freetype)))
+$(eval $(call feature_enabled,ATARI_NETSURF_FONT,-DWITH_INTERNAL_FONT_DRIVER,,(Internal Font)))
+$(eval $(call feature_enabled,ATARI_8BPP_SUPPORT,-DWITH_8BPP_SUPPORT,,(Indexed screen format support)))
+
+# define additional CFLAGS and LDFLAGS requirements for pkg-configed libs here
+NETSURF_FEATURE_RSVG_CFLAGS := -DWITH_RSVG
+NETSURF_FEATURE_HUBBUB_CFLAGS := -DWITH_HUBBUB
+NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
+NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
+NETSURF_FEATURE_JS_CFLAGS := -DWITH_JS -DJS_HAS_FILE_OBJECT=0
+NETSURF_FEATURE_MOZJS_CFLAGS := -DWITH_MOZJS -DJS_HAS_FILE_OBJECT=0
+
+ifeq ($(NETSURF_USE_MOZJS),YES)
+NETSURF_USE_JS:=YES
+NETSURF_USE_MOZJS:=YES
+endif
+
+$(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
+$(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
+
+CFLAGS += -U__STRICT_ANSI__ -std=c99 -I. -Dsmall $(WARNFLAGS) -Dnsatari \
+ -D_BSD_SOURCE \
+ -D_XOPEN_SOURCE=600 \
+ -D_POSIX_C_SOURCE=200112L \
+ $(shell $(PKG_CONFIG) --cflags libhubbub libcss openssl ) \
+ $(shell $(PKG_CONFIG) --cflags libxml-2.0 ) \
+ $(shell $(PKG_CONFIG) --cflags libcurl )
+
+LDFLAGS += -lcflib -lcurl
+LDFLAGS += -lcss -lparserutils -ldom -lwapcaplet -lhubbub
+LDFLAGS += -lssl -lcrypto
+LDFLAGS += -lxml2 -lz -liconv -lcares -lHermes -lwindom -lgem -lm
+LDFLAGS += -L$(GCCSDK_INSTALL_ENV)/lib
+
+
+# S_ATARI are sources purely for the Atari FreeMiNT build
+S_ATARI := gui.c findfile.c filetype.c misc.c bitmap.c schedule.c \
+ download.c thumbnail.c login.c verify_ssl.c treeview.c hotlist.c history.c\
+ search.c font.c \
+ plot/plot.c plot/fontplot.c plot/eddi.s \
+ plot/font_freetype.c plot/font_internal.c \
+ redrawslots.c encoding.c \
+ browser_win.c toolbar.c statusbar.c browser.c \
+ global_evnt.c osspec.c dragdrop.c system_colour.c \
+ ctxmenu.c save.c settings.c
+S_ATARI := $(addprefix atari/,$(S_ATARI))
+
+# This is the final source build list
+# Note this is deliberately *not* expanded here as common and image
+# are not yet available
+SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_ATARI)
+EXETARGET := ns$(SUBTARGET)$(PRGSUFFIX)
+
+# ----------------------------------------------------------------------------
+# Install target
+# ----------------------------------------------------------------------------
+
+<<<<<<< Updated upstream
+install-atari:
+
+# ----------------------------------------------------------------------------
+# Package target
+# ----------------------------------------------------------------------------
+
+package-atari:
+=======
+ATARI_INSTALL_TARGET_DIR := nsatari.package
+ATARI_RES_DIR := atari/res
+
+install-atari: $(PKGNAME)
+ $(VQ)echo Creating $(PKGNAME)
+
+$(PKGNAME): $(EXETARGET)
+ $(Q)rm -rf $(ATARI_INSTALL_TARGET_DIR)
+ $(Q)mkdir $(ATARI_INSTALL_TARGET_DIR)/
+ $(Q)mkdir $(ATARI_INSTALL_TARGET_DIR)/netsurf
+ $(Q)mkdir $(ATARI_INSTALL_TARGET_DIR)/netsurf/doc
+ $(Q)mkdir $(ATARI_INSTALL_TARGET_DIR)/netsurf/download
+ $(Q)mkdir $(ATARI_INSTALL_TARGET_DIR)/netsurf/res
+ $(Q)mkdir $(ATARI_INSTALL_TARGET_DIR)/netsurf/res/fonts
+ #$(Q)mkdir $(ATARI_INSTALL_TARGET_DIR)/netsurf/res/icons
+ $(Q)touch $(ATARI_INSTALL_TARGET_DIR)/netsurf/res/cookies
+ $(Q)cp $(ATARI_RES_DIR)/netsurf.rsc $(ATARI_INSTALL_TARGET_DIR)/netsurf/res/netsurf.rsc
+ $(Q)cp $(ATARI_RES_DIR)/icons/ $(ATARI_INSTALL_TARGET_DIR)/netsurf/res/icons/ -R
+
+
+ $(Q)cp $(EXETARGET) $(ATARI_INSTALL_TARGET_DIR)/netsurf
+
+>>>>>>> Stashed changes
diff --git a/atari/browser.c b/atari/browser.c
index 83fcb43..ec2a64d 100755
--- a/atari/browser.c
+++ b/atari/browser.c
@@ -43,7 +43,6 @@
#include "css/css.h"
#include "utils/log.h"
#include "utils/messages.h"
-
#include "atari/gui.h"
#include "atari/rootwin.h"
#include "atari/misc.h"
@@ -273,9 +272,9 @@ static void __CDECL browser_evnt_mbutton( COMPONENT * c, short buff[8], void * d
rel_cur_x, rel_cur_y);
}
}
- if( browser_redraw_required( gw ) ){
- browser_redraw( gw );
- }
+ //if( browser_redraw_required( gw ) ){
+ //browser_redraw( gw );
+ //}
graf_mkstate(&rel_cur_x, &rel_cur_y, &mbut, &dummy);
rel_cur_x = (rel_cur_x - cwork.g_x) + gw->browser->scroll.current.x;
rel_cur_y = (rel_cur_y - cwork.g_y) + gw->browser->scroll.current.y;
@@ -478,9 +477,9 @@ static void browser_process_scroll( struct gui_window * gw, GRECT bwrect )
}
b->scroll.requested.y = 0;
b->scroll.requested.x = 0;
- if( b->caret.requested.g_w > 0 ){
- b->caret.redraw = true;
- }
+// if( b->caret.requested.g_w > 0 ){
+// b->caret.redraw = true;
+// }
// TODO: implement new sliding
//gw->root->handle->xpos = b->scroll.current.x;
@@ -557,23 +556,23 @@ bool browser_input( struct gui_window * gw, unsigned short nkc )
}
/* determines if a browser window needs redraw */
-bool browser_redraw_required( struct gui_window * gw)
-{
- bool ret = true;
- CMP_BROWSER b = gw->browser;
-
- if( b->bw->current_content == NULL )
- return ( false );
-
- /* disable redraws when the browser awaits WM_REDRAW caused by resize */
- if( b->reformat_pending )
- return( false );
-
- ret = ( ((b->redraw.areas_used > 0) )
- || b->scroll.required
- || b->caret.redraw);
- return( ret );
-}
+//bool browser_redraw_required( struct gui_window * gw)
+//{
+// bool ret = true;
+// CMP_BROWSER b = gw->browser;
+//
+// if( b->bw->current_content == NULL )
+// return ( false );
+//
+// /* disable redraws when the browser awaits WM_REDRAW caused by resize */
+// if( b->reformat_pending )
+// return( false );
+//
+// ret = ( ((b->redraw.areas_used > 0) )
+// || b->scroll.required
+// || b->caret.redraw);
+// return( ret );
+//}
/* schedule a redraw of content */
@@ -640,273 +639,273 @@ static void browser_redraw_content( struct gui_window * gw, int xoff, int yoff,
/*
area: the browser canvas
*/
-void browser_restore_caret_background( struct gui_window * gw, GRECT * area)
-{
- CMP_BROWSER b = gw->browser;
- GRECT rect;
- if( area == NULL ){
- browser_get_rect( gw, BR_CONTENT, &rect );
- area = ▭
- }
- /* This call restores the background and releases the memory: */
- // TODO: only release memory/clear flag when the caret is not clipped.
- // TODO: apply clipping.
- w_put_bkgr( &app,
- area->g_x-b->scroll.current.x+b->caret.current.g_x,
- area->g_y-b->scroll.current.y+b->caret.current.g_y,
- gw->browser->caret.current.g_w,
- gw->browser->caret.current.g_h+1,
- &gw->browser->caret.background
- );
- gw->browser->caret.background.fd_addr = NULL;
-}
+//void browser_restore_caret_background( struct gui_window * gw, GRECT * area)
+//{
+// CMP_BROWSER b = gw->browser;
+// GRECT rect;
+// if( area == NULL ){
+// browser_get_rect( gw, BR_CONTENT, &rect );
+// area = ▭
+// }
+// /* This call restores the background and releases the memory: */
+// // TODO: only release memory/clear flag when the caret is not clipped.
+// // TODO: apply clipping.
+// w_put_bkgr( &app,
+// area->g_x-b->scroll.current.x+b->caret.current.g_x,
+// area->g_y-b->scroll.current.y+b->caret.current.g_y,
+// gw->browser->caret.current.g_w,
+// gw->browser->caret.current.g_h+1,
+// &gw->browser->caret.background
+// );
+// gw->browser->caret.background.fd_addr = NULL;
+//}
/*
area: the browser canvas
*/
-void browser_redraw_caret( struct gui_window * gw, GRECT * area )
-{
-
- if( gw->browser->caret.redraw && gw->browser->caret.requested.g_w > 0 ){
-
- short wind_info[4];
-
- /* Only redraw caret when window is topped. */
- wind_get( 0, WF_TOP, &wind_info[0], &wind_info[1], &wind_info[2], &wind_info[3]);
- if (guiwin_get_handle(gw->root->win) != wind_info[0]) {
- return;
- }
-
-
- GRECT caret;
- struct s_browser * b = gw->browser;
- struct rect old_clip;
- struct rect clip;
-
- if( b->caret.current.g_w > 0 && b->caret.background.fd_addr != NULL ){
- browser_restore_caret_background( gw, area );
- }
-
- caret = b->caret.requested;
- caret.g_x -= b->scroll.current.x - area->g_x;
- caret.g_y -= b->scroll.current.y - area->g_y;
-
- if( !rc_intersect( area, &caret ) ) {
- return;
- }
-
- MFDB screen;
- short pxy[8];
-
- /* save background: */
- //assert( b->caret.background.fd_addr == NULL );
- init_mfdb(app.nplanes, caret.g_w, caret.g_h, 0,
- &b->caret.background);
- init_mfdb(0, caret.g_w, caret.g_h, 0, &screen);
- pxy[0] = caret.g_x;
- pxy[1] = caret.g_y;
- pxy[2] = caret.g_x + caret.g_w;
- pxy[3] = caret.g_y + caret.g_h;
- pxy[4] = 0;
- pxy[5] = 0;
- pxy[6] = caret.g_w;
- pxy[7] = caret.g_h;
- /* hide the mouse */
- v_hide_c (app.graf.handle);
- /* copy screen image */
- vro_cpyfm (app.graf.handle, S_ONLY, pxy, &screen, &b->caret.background);
- /* draw caret: */
- caret.g_x -= area->g_x;
- caret.g_y -= area->g_y;
- clip.x0 = caret.g_x;
- clip.y0 = caret.g_y;
- clip.x1 = caret.g_x + caret.g_w;
- clip.y1 = caret.g_y + caret.g_h;
- /* store old clip before adjusting it: */
- plot_get_clip( &old_clip );
- /* clip to cursor: */
- plot_clip( &clip );
- plot_line( caret.g_x, caret.g_y, caret.g_x, caret.g_y + caret.g_h,
- plot_style_caret );
- /* restore old clip area: */
- plot_clip( &old_clip );
- /* restore the mouse */
- v_show_c ( app.graf.handle, 1);
- b->caret.current.g_x = caret.g_x + gw->browser->scroll.current.x;
- b->caret.current.g_y = caret.g_y + gw->browser->scroll.current.y;
- b->caret.current.g_w = caret.g_w;
- b->caret.current.g_h = caret.g_h;
- }
-}
-
-void browser_redraw( struct gui_window * gw )
-{
- GRECT bwrect;
- struct s_browser * b = gw->browser;
- short todo[4];
- struct rect clip;
- /* used for clipping of content redraw: */
- struct rect redraw_area;
-
- if( b->attached == false || b->bw->current_content == NULL ) {
- return;
- }
-
- browser_get_rect(gw, BR_CONTENT, &bwrect);
-
- plot_set_dimensions(bwrect.g_x, bwrect.g_y, bwrect.g_w, bwrect.g_h);
- clip.x0 = 0;
- clip.y0 = 0;
- clip.x1 = bwrect.g_w;
- clip.y1 = bwrect.g_h;
- plot_clip(&clip);
- if (plot_lock() == false)
- return;
-
- if( b->scroll.required == true && b->bw->current_content != NULL) {
- browser_process_scroll( gw, bwrect );
- b->scroll.required = false;
- }
-
- if ((b->redraw.areas_used > 0) && b->bw->current_content != NULL ) {
- if( (atari_plot_flags & PLOT_FLAG_OFFSCREEN) == 0 ) {
-
- int i;
- GRECT area;
- GRECT fbwork;
- short wf_top[4];
- todo[0] = bwrect.g_x;
- todo[1] = bwrect.g_y;
- todo[2] = todo[0] + bwrect.g_w-1;
- todo[3] = todo[1] + bwrect.g_h-1;
- vs_clip(atari_plot_vdi_handle, 1, (short*)&todo[0]);
-
- wind_get( 0, WF_TOP, &wf_top[0], &wf_top[1],
- &wf_top[2], &wf_top[3] );
-
- if( wf_top[0] == guiwin_get_handle(gw->root->win)
- && wf_top[1] == _AESapid ){
- /* The window is on top, so there is no need to walk the */
- /* AES rectangle list. */
- for( i=0; i<b->redraw.areas_used; i++ ){
- fbwork.g_x = todo[0] - bwrect.g_x;
- fbwork.g_y = todo[1] - bwrect.g_y;
- if( fbwork.g_x < 0 ){
- fbwork.g_w = todo[2] + todo[0];
- fbwork.g_x = 0;
- } else {
- fbwork.g_w = todo[2];
- }
- if( fbwork.g_y < 0 ){
- fbwork.g_h = todo[3] + todo[1];
- fbwork.g_y = 0;
- } else {
- fbwork.g_h = todo[3];
- }
- area.g_x = b->redraw.areas[i].x0;
- area.g_y = b->redraw.areas[i].y0;
- area.g_w = b->redraw.areas[i].x1 - b->redraw.areas[i].x0;
- area.g_h = b->redraw.areas[i].y1 - b->redraw.areas[i].y0;
- if (rc_intersect((GRECT *)&fbwork,(GRECT *)&area)) {
- redraw_area.x0 = area.g_x;
- redraw_area.y0 = area.g_y;
- redraw_area.x1 = area.g_x + area.g_w;
- redraw_area.y1 = area.g_y + area.g_h;
- browser_redraw_content( gw, 0, 0, &redraw_area );
- } else {
- /* the area should be kept scheduled for later redraw,*/
- /* but because this is onscreen plotter, it doesn't */
- /* make much sense anyway... */
- }
- }
- } else {
- /* walk the AES rectangle list: */
- short aes_handle = guiwin_get_handle(gw->root->win);
- if( wind_get(aes_handle, WF_FIRSTXYWH,
- &todo[0], &todo[1], &todo[2], &todo[3] )!=0 ) {
- while (todo[2] && todo[3]) {
- /* convert screen to framebuffer coords: */
- fbwork.g_x = todo[0] - bwrect.g_x;
- fbwork.g_y = todo[1] - bwrect.g_y;
- if( fbwork.g_x < 0 ){
- fbwork.g_w = todo[2] + todo[0];
- fbwork.g_x = 0;
- } else {
- fbwork.g_w = todo[2];
- }
- if( fbwork.g_y < 0 ){
- fbwork.g_h = todo[3] + todo[1];
- fbwork.g_y = 0;
- } else {
- fbwork.g_h = todo[3];
- }
- /* walk the redraw requests: */
- for( i=0; i<b->redraw.areas_used; i++ ){
- area.g_x = b->redraw.areas[i].x0;
- area.g_y = b->redraw.areas[i].y0;
- area.g_w = b->redraw.areas[i].x1 - b->redraw.areas[i].x0;
- area.g_h = b->redraw.areas[i].y1 - b->redraw.areas[i].y0;
- if (rc_intersect((GRECT *)&fbwork,(GRECT *)&area)) {
- redraw_area.x0 = area.g_x;
- redraw_area.y0 = area.g_y;
- redraw_area.x1 = area.g_x + area.g_w;
- redraw_area.y1 = area.g_y + area.g_h;
- browser_redraw_content( gw, 0, 0, &redraw_area );
- } else {
- /* the area should be kept scheduled for later redraw,*/
- /* but because this is onscreen plotter, it doesn't */
- /* make much sense anyway... */
- }
- }
- if (wind_get(aes_handle, WF_NEXTXYWH,
- &todo[0], &todo[1], &todo[2], &todo[3])==0) {
- break;
- }
- }
- }
- }
- vs_clip(atari_plot_vdi_handle, 0, (short*)&todo);
- } else {
-
- /* its save to do a complete redraw without knowledge about GEM windows :) */
- /* walk the redraw requests: */
- int i;
- for( i=0; i<b->redraw.areas_used; i++ ){
- struct redraw_context ctx = {
- .interactive = true,
- .background_images = true,
- .plot = &atari_plotters
- };
- browser_window_redraw( b->bw, -b->scroll.current.x,
- -b->scroll.current.y, &b->redraw.areas[i], &ctx );
- }
- GRECT area;
- area.g_x = bwrect.g_x;
- area.g_y = bwrect.g_y;
- area.g_w = bwrect.g_w;
- area.g_h = bwrect.g_h;
- //plot_blit( plotter, &area );
- }
- b->redraw.areas_used = 0;
- }
- if( b->caret.redraw == true && b->bw->current_content != NULL ) {
- GRECT area;
- todo[0] = bwrect.g_x;
- todo[1] = bwrect.g_y;
- todo[2] = todo[0] + bwrect.g_w;
- todo[3] = todo[1] + bwrect.g_h;
- area.g_x = bwrect.g_x;
- area.g_y = bwrect.g_y;
- area.g_w = bwrect.g_w;
- area.g_h = bwrect.g_h;
- vs_clip(atari_plot_vdi_handle, 1, (short*)&todo[0]);
- browser_redraw_caret( gw, &area );
- vs_clip(atari_plot_vdi_handle, 0, (short*)&todo[0]);
- b->caret.redraw = false;
- }
- plot_unlock();
- /* TODO: if we use offscreen bitmap, trigger content redraw here */
-}
+//void browser_redraw_caret( struct gui_window * gw, GRECT * area )
+//{
+//
+// if( gw->browser->caret.redraw && gw->browser->caret.requested.g_w > 0 ){
+//
+// short wind_info[4];
+//
+// /* Only redraw caret when window is topped. */
+// wind_get( 0, WF_TOP, &wind_info[0], &wind_info[1], &wind_info[2], &wind_info[3]);
+// if (guiwin_get_handle(gw->root->win) != wind_info[0]) {
+// return;
+// }
+//
+//
+// GRECT caret;
+// struct s_browser * b = gw->browser;
+// struct rect old_clip;
+// struct rect clip;
+//
+// if( b->caret.current.g_w > 0 && b->caret.background.fd_addr != NULL ){
+// browser_restore_caret_background( gw, area );
+// }
+//
+// caret = b->caret.requested;
+// caret.g_x -= b->scroll.current.x - area->g_x;
+// caret.g_y -= b->scroll.current.y - area->g_y;
+//
+// if( !rc_intersect( area, &caret ) ) {
+// return;
+// }
+//
+// MFDB screen;
+// short pxy[8];
+//
+// /* save background: */
+// init_mfdb(app.nplanes, caret.g_w, caret.g_h, 0,
+// &b->caret.background);
+// init_mfdb(0, caret.g_w, caret.g_h, 0, &screen);
+// pxy[0] = caret.g_x;
+// pxy[1] = caret.g_y;
+// pxy[2] = caret.g_x + caret.g_w;
+// pxy[3] = caret.g_y + caret.g_h;
+// pxy[4] = 0;
+// pxy[5] = 0;
+// pxy[6] = caret.g_w;
+// pxy[7] = caret.g_h;
+//
+// plot_lock();
+//
+// /* copy screen image behin the caret for later restore: */
+// vro_cpyfm (app.graf.handle, S_ONLY, pxy, &screen, &b->caret.background);
+// /* draw caret: */
+// caret.g_x -= area->g_x;
+// caret.g_y -= area->g_y;
+// clip.x0 = caret.g_x;
+// clip.y0 = caret.g_y;
+// clip.x1 = caret.g_x + caret.g_w;
+// clip.y1 = caret.g_y + caret.g_h;
+// /* store old clip before adjusting it: */
+// plot_get_clip( &old_clip );
+// /* clip to cursor: */
+// plot_clip( &clip );
+// plot_line( caret.g_x, caret.g_y, caret.g_x, caret.g_y + caret.g_h,
+// plot_style_caret );
+// /* restore old clip area: */
+// plot_clip( &old_clip );
+// /* restore the mouse */
+// plot_unlock();
+// b->caret.current.g_x = caret.g_x + gw->browser->scroll.current.x;
+// b->caret.current.g_y = caret.g_y + gw->browser->scroll.current.y;
+// b->caret.current.g_w = caret.g_w;
+// b->caret.current.g_h = caret.g_h;
+// }
+//}
+//
+//void browser_redraw( struct gui_window * gw )
+//{
+// GRECT bwrect;
+// struct s_browser * b = gw->browser;
+// short todo[4];
+// struct rect clip;
+// /* used for clipping of content redraw: */
+// struct rect redraw_area;
+//
+// if( b->attached == false || b->bw->current_content == NULL ) {
+// return;
+// }
+//
+// browser_get_rect(gw, BR_CONTENT, &bwrect);
+//
+// plot_set_dimensions(bwrect.g_x, bwrect.g_y, bwrect.g_w, bwrect.g_h);
+// clip.x0 = 0;
+// clip.y0 = 0;
+// clip.x1 = bwrect.g_w;
+// clip.y1 = bwrect.g_h;
+// plot_clip(&clip);
+// if (plot_lock() == false)
+// return;
+//
+// if( b->scroll.required == true && b->bw->current_content != NULL) {
+// browser_process_scroll( gw, bwrect );
+// b->scroll.required = false;
+// }
+//
+// if ((b->redraw.areas_used > 0) && b->bw->current_content != NULL ) {
+// if( (atari_plot_flags & PLOT_FLAG_OFFSCREEN) == 0 ) {
+//
+// int i;
+// GRECT area;
+// GRECT fbwork;
+// short wf_top[4];
+// todo[0] = bwrect.g_x;
+// todo[1] = bwrect.g_y;
+// todo[2] = todo[0] + bwrect.g_w-1;
+// todo[3] = todo[1] + bwrect.g_h-1;
+// vs_clip(atari_plot_vdi_handle, 1, (short*)&todo[0]);
+//
+// wind_get( 0, WF_TOP, &wf_top[0], &wf_top[1],
+// &wf_top[2], &wf_top[3] );
+//
+// if( wf_top[0] == guiwin_get_handle(gw->root->win)
+// && wf_top[1] == _AESapid ){
+// /* The window is on top, so there is no need to walk the */
+// /* AES rectangle list. */
+// for( i=0; i<b->redraw.areas_used; i++ ){
+// fbwork.g_x = todo[0] - bwrect.g_x;
+// fbwork.g_y = todo[1] - bwrect.g_y;
+// if( fbwork.g_x < 0 ){
+// fbwork.g_w = todo[2] + todo[0];
+// fbwork.g_x = 0;
+// } else {
+// fbwork.g_w = todo[2];
+// }
+// if( fbwork.g_y < 0 ){
+// fbwork.g_h = todo[3] + todo[1];
+// fbwork.g_y = 0;
+// } else {
+// fbwork.g_h = todo[3];
+// }
+// area.g_x = b->redraw.areas[i].x0;
+// area.g_y = b->redraw.areas[i].y0;
+// area.g_w = b->redraw.areas[i].x1 - b->redraw.areas[i].x0;
+// area.g_h = b->redraw.areas[i].y1 - b->redraw.areas[i].y0;
+// if (rc_intersect((GRECT *)&fbwork,(GRECT *)&area)) {
+// redraw_area.x0 = area.g_x;
+// redraw_area.y0 = area.g_y;
+// redraw_area.x1 = area.g_x + area.g_w;
+// redraw_area.y1 = area.g_y + area.g_h;
+// browser_redraw_content( gw, 0, 0, &redraw_area );
+// } else {
+// /* the area should be kept scheduled for later redraw,*/
+// /* but because this is onscreen plotter, it doesn't */
+// /* make much sense anyway... */
+// }
+// }
+// } else {
+// /* walk the AES rectangle list: */
+// short aes_handle = guiwin_get_handle(gw->root->win);
+// if( wind_get(aes_handle, WF_FIRSTXYWH,
+// &todo[0], &todo[1], &todo[2], &todo[3] )!=0 ) {
+// while (todo[2] && todo[3]) {
+// /* convert screen to framebuffer coords: */
+// fbwork.g_x = todo[0] - bwrect.g_x;
+// fbwork.g_y = todo[1] - bwrect.g_y;
+// if( fbwork.g_x < 0 ){
+// fbwork.g_w = todo[2] + todo[0];
+// fbwork.g_x = 0;
+// } else {
+// fbwork.g_w = todo[2];
+// }
+// if( fbwork.g_y < 0 ){
+// fbwork.g_h = todo[3] + todo[1];
+// fbwork.g_y = 0;
+// } else {
+// fbwork.g_h = todo[3];
+// }
+// /* walk the redraw requests: */
+// for( i=0; i<b->redraw.areas_used; i++ ){
+// area.g_x = b->redraw.areas[i].x0;
+// area.g_y = b->redraw.areas[i].y0;
+// area.g_w = b->redraw.areas[i].x1 - b->redraw.areas[i].x0;
+// area.g_h = b->redraw.areas[i].y1 - b->redraw.areas[i].y0;
+// if (rc_intersect((GRECT *)&fbwork,(GRECT *)&area)) {
+// redraw_area.x0 = area.g_x;
+// redraw_area.y0 = area.g_y;
+// redraw_area.x1 = area.g_x + area.g_w;
+// redraw_area.y1 = area.g_y + area.g_h;
+// browser_redraw_content( gw, 0, 0, &redraw_area );
+// } else {
+// /* the area should be kept scheduled for later redraw,*/
+// /* but because this is onscreen plotter, it doesn't */
+// /* make much sense anyway... */
+// }
+// }
+// if (wind_get(aes_handle, WF_NEXTXYWH,
+// &todo[0], &todo[1], &todo[2], &todo[3])==0) {
+// break;
+// }
+// }
+// }
+// }
+// vs_clip(atari_plot_vdi_handle, 0, (short*)&todo);
+// } else {
+//
+// /* its save to do a complete redraw without knowledge about GEM windows :) */
+// /* walk the redraw requests: */
+// int i;
+// for( i=0; i<b->redraw.areas_used; i++ ){
+// struct redraw_context ctx = {
+// .interactive = true,
+// .background_images = true,
+// .plot = &atari_plotters
+// };
+// browser_window_redraw( b->bw, -b->scroll.current.x,
+// -b->scroll.current.y, &b->redraw.areas[i], &ctx );
+// }
+// GRECT area;
+// area.g_x = bwrect.g_x;
+// area.g_y = bwrect.g_y;
+// area.g_w = bwrect.g_w;
+// area.g_h = bwrect.g_h;
+// //plot_blit( plotter, &area );
+// }
+// b->redraw.areas_used = 0;
+// }
+// if( b->caret.redraw == true && b->bw->current_content != NULL ) {
+// GRECT area;
+// todo[0] = bwrect.g_x;
+// todo[1] = bwrect.g_y;
+// todo[2] = todo[0] + bwrect.g_w;
+// todo[3] = todo[1] + bwrect.g_h;
+// area.g_x = bwrect.g_x;
+// area.g_y = bwrect.g_y;
+// area.g_w = bwrect.g_w;
+// area.g_h = bwrect.g_h;
+// vs_clip(atari_plot_vdi_handle, 1, (short*)&todo[0]);
+// browser_redraw_caret( gw, &area );
+// vs_clip(atari_plot_vdi_handle, 0, (short*)&todo[0]);
+// b->caret.redraw = false;
+// }
+// plot_unlock();
+// /* TODO: if we use offscreen bitmap, trigger content redraw here */
+//}
static void __CDECL browser_evnt_redraw( COMPONENT * c, short buff[8], void * data)
{
diff --git a/atari/browser.h b/atari/browser.h
index e855e59..a442380 100755
--- a/atari/browser.h
+++ b/atari/browser.h
@@ -57,7 +57,7 @@ struct s_scroll_info
This struct holds information of the cursor within the browser
viewport.
*/
-struct s_caret
+struct s_caret_old
{
GRECT requested;
GRECT current;
@@ -101,8 +101,8 @@ void browser_set_content_size(struct gui_window * gw, int w, int h);
void browser_scroll( struct gui_window * gw, short MODE, int value, bool abs );
struct gui_window * browser_find_root( struct gui_window * gw );
bool browser_redraw_required( struct gui_window * gw);
-void browser_redraw_caret( struct gui_window * gw, GRECT * area);
-void browser_restore_caret_background(struct gui_window * gw, GRECT * area);
+//void browser_redraw_caret( struct gui_window * gw, GRECT * area);
+//void browser_restore_caret_background(struct gui_window * gw, GRECT * area);
/* update loc / size of the browser widgets: */
void browser_update_rects(struct gui_window * gw );
/*
diff --git a/atari/caret.c b/atari/caret.c
new file mode 100644
index 0000000..42a35a4
--- /dev/null
+++ b/atari/caret.c
@@ -0,0 +1,129 @@
+#include <stdbool.h>
+
+#include "desktop/plot_style.h"
+#include "atari/plot/plot.h"
+#include "atari/caret.h"
+
+extern struct s_vdi_sysinfo vdi_sysinfo;
+
+static void caret_restore_background(struct s_caret *c, VdiHdl vh, GRECT *clip);
+
+void caret_show(struct s_caret *caret, VdiHdl vh, GRECT *dimensions, GRECT *clip)
+{
+ GRECT visible, old_dim;
+ MFDB screen;
+ short pxy[8];
+
+ struct rect old_clip;
+
+ return;
+
+
+
+ plot_get_clip(&old_clip);
+ plot_get_dimensions(&old_dim);
+
+
+ // store background:
+ visible = *dimensions;
+ visible.g_x += clip->g_x;
+ visible.g_y += clip->g_y;
+
+ if(!rc_intersect(clip, &visible)){
+ printf("no isect...\n");
+ return;
+ }
+
+
+ // TODO: do not alloc / free on each move...
+ if (caret->background.fd_addr != NULL) {
+ //caret_restore_background(caret, vh, clip);
+ }
+
+ plot_lock();
+ plot_set_dimensions(clip->g_x, clip->g_y, clip->g_w, clip->g_h);
+
+ caret->dimensions.g_x = dimensions->g_x;
+ caret->dimensions.g_y = dimensions->g_y;
+ caret->dimensions.g_w = visible.g_w;
+ caret->dimensions.g_h = visible.g_h;
+
+ dbg_grect("clip", clip);
+ dbg_grect("visible", &visible);
+ // TODO: do not alloc / free on every redraw...
+ init_mfdb(vdi_sysinfo.scr_bpp, visible.g_w, visible.g_h, 0,
+ &caret->background);
+ init_mfdb(0, visible.g_w, visible.g_h, 0, &screen);
+ pxy[0] = visible.g_x;
+ pxy[1] = visible.g_y;
+ pxy[2] = visible.g_x + visible.g_w;
+ pxy[3] = visible.g_y + visible.g_h;
+ pxy[4] = 0;
+ pxy[5] = 0;
+ pxy[6] = visible.g_w;
+ pxy[7] = visible.g_h;
+ vro_cpyfm (vh, S_ONLY, pxy, &screen, &caret->background);
+
+ plot_line(dimensions->g_x, dimensions->g_y, dimensions->g_x,
+ dimensions->g_y + dimensions->g_h, plot_style_caret);
+
+ plot_set_dimensions(old_clip.x0, old_clip.y0, old_clip.x1, old_clip.y1);
+ plot_clip(&old_clip);
+
+ plot_unlock();
+ caret->visible = true;
+}
+
+void caret_hide(struct s_caret *caret, VdiHdl vh, GRECT *clip)
+{
+ struct rect old_clip;
+ GRECT old_dim;
+
+ plot_lock();
+ plot_get_clip(&old_clip);
+ plot_get_dimensions(&old_dim);
+ plot_set_dimensions(clip->g_x, clip->g_y, clip->g_w, clip->g_h);
+ caret_restore_background(caret, vh, clip);
+ plot_set_dimensions(old_clip.x0, old_clip.y0, old_clip.x1, old_clip.y1);
+ plot_clip(&old_clip);
+ plot_unlock();
+ caret->visible = false;
+}
+
+static void caret_restore_background(struct s_caret *caret, VdiHdl vh, GRECT *clip)
+{
+ MFDB screen;
+ GRECT visible;
+ short pxy[8];
+
+ visible = caret->dimensions;
+ visible.g_x += clip->g_x;
+ visible.g_y += clip->g_y;
+
+ dbg_grect("restore ", &visible);
+
+ if(!rc_intersect(clip, &visible)){
+ goto exit;
+ }
+
+ // TODO: check isect
+
+ // restore mfdb
+
+ init_mfdb(0, caret->dimensions.g_w, caret->dimensions.g_h, 0, &screen);
+ pxy[0] = 0;
+ pxy[1] = 0;
+ pxy[2] = caret->dimensions.g_w;
+ pxy[3] = caret->dimensions.g_h;
+ pxy[4] = clip->g_x + caret->dimensions.g_x;
+ pxy[5] = clip->g_y + caret->dimensions.g_y;
+ pxy[6] = pxy[2];
+ pxy[7] = pxy[3];
+ vro_cpyfm(vh, S_ONLY, pxy, &caret->background, &screen);
+ // exit:
+ // TODO: do not alloc / free on every redraw...
+
+exit:
+ free(caret->background.fd_addr);
+ caret->background.fd_addr = NULL;
+}
diff --git a/atari/caret.h b/atari/caret.h
new file mode 100644
index 0000000..c9352dc
--- /dev/null
+++ b/atari/caret.h
@@ -0,0 +1,17 @@
+#ifndef NS_ATARI_CARET_H
+#define NS_ATARI_CARET_H
+
+#include <mt_gem.h>
+#include <stdbool.h>
+
+struct s_caret {
+ GRECT dimensions;
+ MFDB background;
+ bool visible;
+};
+
+void caret_show(struct s_caret *c, VdiHdl vh, GRECT * dimensions, GRECT *clip);
+void caret_hide(struct s_caret *c, VdiHdl vh, GRECT *clip);
+
+#endif // NS_ATARI_CARET_H
+
diff --git a/atari/download.c b/atari/download.c
index 566f44a..e35f31d 100755
--- a/atari/download.c
+++ b/atari/download.c
@@ -81,12 +81,10 @@ static short on_aes_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
case WM_CLOSED:
// TODO: this needs to iterate through all gui windows and
// check if the rootwin is this window...
- printf("destroy...\n");
- on_close(data);
+ on_close(data);
break;
case WM_TOOLBAR:
- printf("tb idx: %d\n", msg[4]);
switch(msg[4]){
case DOWNLOAD_BT_ABORT:
diff --git a/atari/extract.php b/atari/extract.php
new file mode 100755
index 0000000..865b70e
--- /dev/null
+++ b/atari/extract.php
@@ -0,0 +1,10 @@
+#!/usr/bin/php
+<?
+$lines = file("deskmenu.c");
+
+foreach($lines as $line){
+ if(stripos($line, "static void __CDECL menu_") === 0){
+ echo $line;
+ }
+}
+?>
diff --git a/atari/gemtk/gemtk.h b/atari/gemtk/gemtk.h
index ad9253c..1225a0c 100644
--- a/atari/gemtk/gemtk.h
+++ b/atari/gemtk/gemtk.h
@@ -112,13 +112,14 @@ void *guiwin_get_user_data(GUIWIN *win);
struct guiwin_scroll_info_s * guiwin_get_scroll_info(GUIWIN *win);
bool guiwin_update_slider(GUIWIN *win, short mode);
void guiwin_scroll(GUIWIN *gw, short orientation, int units, bool refresh);
+void guiwin_send_msg(GUIWIN *win, short msgtype, short a, short b, short c,
+ short d);
void guiwin_send_redraw(GUIWIN *win, GRECT *area);
VdiHdl guiwin_get_vdi_handle(GUIWIN *win);
bool guiwin_has_intersection(GUIWIN *win, GRECT *work);
void guiwin_toolbar_redraw(GUIWIN *win, GRECT *clip);
void guiwin_clear(GUIWIN *win);
-
/*
* AES Scroller Object
*/
diff --git a/atari/gemtk/guiwin.c b/atari/gemtk/guiwin.c
index c3042bc..e587b97 100644
--- a/atari/gemtk/guiwin.c
+++ b/atari/gemtk/guiwin.c
@@ -282,12 +282,11 @@ short guiwin_dispatch_event(EVMULT_IN *ev_in, EVMULT_OUT *ev_out, short msg[8])
}
} else {
- short info[4];
- wind_get( 0, WF_TOP, &info[0], &info[1], &info[2], &info[3]);
+ short h_aes;
+ h_aes = wind_find(ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_y);
+ if(h_aes > 0 && (ev_out->emo_events != MU_TIMER)) {
- if(info[0] != 0 && info[1] == gl_apid) {
-
- dest = guiwin_find(info[0]);
+ dest = guiwin_find(h_aes);
if(dest == NULL || dest->handler_func == NULL)
return(0);
@@ -309,16 +308,20 @@ short guiwin_dispatch_event(EVMULT_IN *ev_in, EVMULT_OUT *ev_out, short msg[8])
dest->toolbar_idx, 8,
ev_out->emo_mouse.p_x,
ev_out->emo_mouse.p_y);
+ DEBUG_PRINT(("Toolbar index: %d\n", obj_idx));
short msg_out[8] = {WM_TOOLBAR, gl_apid, 0, dest->handle,
obj_idx, ev_out->emo_mclicks, ev_out->emo_kmeta, 0
};
- if (((dest->flags & GW_FLAG_CUSTOM_TOOLBAR) == 0)
- && (obj_idx > 0)
- && (dest->toolbar[obj_idx].ob_flags & OF_SELECTABLE) != 0) {
- dest->toolbar[obj_idx].ob_state |= OS_SELECTED;
- // TODO: optimize redraw by setting the object clip:
- guiwin_toolbar_redraw(dest, NULL);
- }
+ if (obj_idx > 0) {
+ if ((dest->toolbar[obj_idx].ob_flags & OF_SELECTABLE)!=0
+ && ((dest->flags & GW_FLAG_CUSTOM_TOOLBAR) == 0)
+ && ((dest->flags & GW_FLAG_TOOLBAR_REDRAW) == 0)) {
+ dest->toolbar[obj_idx].ob_state |= OS_SELECTED;
+ // TODO: optimize redraw by setting the object clip:
+ guiwin_toolbar_redraw(dest, NULL);
+ }
+ }
+
short oldevents = ev_out->emo_events;
ev_out->emo_events = MU_MESAG;
// notify the window about toolbar click:
@@ -378,6 +381,8 @@ GUIWIN * guiwin_add(short handle, uint32_t flags, guiwin_event_handler_f cb)
win->prev = tmp;
win->next = NULL;
}
+
+ DEBUG_PRINT(("Added guiwin: %p, tb: %p\n", win, win->toolbar));
return(win);
}
@@ -429,6 +434,9 @@ short guiwin_remove(GUIWIN *win)
void guiwin_get_grect(GUIWIN *win, enum guwin_area_e mode, GRECT *dest)
{
+
+ assert(win != NULL);
+
wind_get_grect(win->handle, WF_WORKXYWH, dest);
if (mode == GUIWIN_AREA_CONTENT) {
GRECT tb_area;
@@ -680,8 +688,16 @@ void guiwin_send_redraw(GUIWIN *win, GRECT *area)
};
EVMULT_OUT event_out;
- if(area == NULL) {
+ if (area == NULL) {
guiwin_get_grect(win, GUIWIN_AREA_WORK, &work);
+ if (work.g_w < 1 || work.g_h < 1) {
+ if (win->toolbar != NULL) {
+ guiwin_get_grect(win, GUIWIN_AREA_TOOLBAR, &work);
+ if (work.g_w < 1 || work.g_h < 1) {
+ return;
+ }
+ }
+ }
area = &work;
}
@@ -786,6 +802,3 @@ void guiwin_clear(GUIWIN *win)
wind_get_grect(win->handle, WF_NEXTXYWH, &g);
}
}
-
-
-
diff --git a/atari/gemtk/redrawslots.c b/atari/gemtk/redrawslots.c
new file mode 100644
index 0000000..ee5627d
--- /dev/null
+++ b/atari/gemtk/redrawslots.c
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2011 Ole Loots <ole(a)monochrom.net>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdbool.h>
+#define WITH_RECT
+#include "gemtk.h"
+#undef WITH_RECT
+
+void redraw_slots_init(struct s_redrw_slots * slots, short size)
+{
+ // TODO: allocate slots dynamically!
+ slots->size = MIN( MAX_REDRW_SLOTS , size);
+ slots->areas_used = 0;
+}
+
+void redraw_slots_free(struct s_redrw_slots * slots)
+{
+ // TOOD: free areas...
+}
+
+
+static inline bool rect_intersect( struct rect * box1, struct rect * box2 )
+{
+ if (box2->x1 < box1->x0)
+ return false;
+
+ if (box2->y1 < box1->y0)
+ return false;
+
+ if (box2->x0 > box1->x1)
+ return false;
+
+ if (box2->y0 > box1->y1)
+ return false;
+
+ return true;
+}
+
+
+void redraw_slot_schedule_grect(struct s_redrw_slots * slots, GRECT *area,
+ bool force)
+{
+ redraw_slot_schedule(slots, area->g_x, area->g_y,
+ area->g_x + area->g_w, area->g_y + area->g_h, force);
+}
+
+/*
+ schedule redraw coords.
+*/
+void redraw_slot_schedule(struct s_redrw_slots * slots, short x0, short y0,
+ short x1, short y1, bool force)
+{
+ int i = 0;
+ struct rect area;
+
+ area.x0 = x0;
+ area.y0 = y0;
+ area.x1 = x1;
+ area.y1 = y1;
+
+ if (force == false) {
+ for (i=0; i<slots->areas_used; i++) {
+ if (slots->areas[i].x0 <= x0
+ && slots->areas[i].x1 >= x1
+ && slots->areas[i].y0 <= y0
+ && slots->areas[i].y1 >= y1) {
+ /* the area is already queued for redraw */
+ return;
+ } else {
+ if (rect_intersect(&slots->areas[i], &area )) {
+ slots->areas[i].x0 = MIN(slots->areas[i].x0, x0);
+ slots->areas[i].y0 = MIN(slots->areas[i].y0, y0);
+ slots->areas[i].x1 = MAX(slots->areas[i].x1, x1);
+ slots->areas[i].y1 = MAX(slots->areas[i].y1, y1);
+ return;
+ }
+ }
+ }
+ }
+
+ if (slots->areas_used < slots->size) {
+ slots->areas[slots->areas_used].x0 = x0;
+ slots->areas[slots->areas_used].x1 = x1;
+ slots->areas[slots->areas_used].y0 = y0;
+ slots->areas[slots->areas_used].y1 = y1;
+ slots->areas_used++;
+ } else {
+ /*
+ we are out of available slots, merge box with last slot
+ this is dumb... but also a very rare case.
+ */
+ slots->areas[slots->size-1].x0 = MIN(slots->areas[i].x0, x0);
+ slots->areas[slots->size-1].y0 = MIN(slots->areas[i].y0, y0);
+ slots->areas[slots->size-1].x1 = MAX(slots->areas[i].x1, x1);
+ slots->areas[slots->size-1].y1 = MAX(slots->areas[i].y1, y1);
+ }
+done:
+ return;
+}
+
+void redraw_slots_remove_area(struct s_redrw_slots * slots, int i)
+{
+ int x;
+ for(x = i+1; i<slots->areas_used; x++){
+ slots->areas[x-1] = slots->areas[x];
+ }
+ slots->areas_used--;
+}
diff --git a/atari/gemtk/redrawslots.h b/atari/gemtk/redrawslots.h
new file mode 100644
index 0000000..d045b39
--- /dev/null
+++ b/atari/gemtk/redrawslots.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2012 Ole Loots <ole(a)monochrom.net>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef ATARI_REDRAW_SLOTS_H
+#define ATARI_REDRAW_SLOTS_H
+
+#include <mt_gem.h>
+#include "utils/types.h"
+
+
+
+#endif
diff --git a/atari/gui.c b/atari/gui.c
index 165fff6..51865b9 100755
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -144,13 +144,23 @@ void gui_poll(bool active)
}
/* this suits for stuff with lower priority */
/* TBD: really be spare on redraws??? */
- hotlist_redraw();
- global_history_redraw();
+ //hotlist_redraw();
+ //global_history_redraw();
}
// Handle events until there are no more messages pending or
// until the engine indicates activity:
- if(!(active || rendering) || (clock() >= next_poll)){
+ bool skip = false;
+/*
+ if (active || rendering){
+ if ((clock() < next_poll)){
+ skip = true;
+ } else {
+ next_poll = clock() + (CLOCKS_PER_SEC>>5);
+ }
+ }
+*/
+ //if (skip == false) {
do {
short mx, my, dummy;
@@ -163,15 +173,14 @@ void gui_poll(bool active)
LOG(("WM: %d\n", aes_msg_out[0]));
switch(aes_msg_out[0]) {
- case MN_SELECTED:
- LOG(("Menu Item: %d\n",aes_msg_out[4]));
- deskmenu_dispatch_item(aes_msg_out[3], aes_msg_out[4]);
- break;
- default:
- break;
- }
+ case MN_SELECTED:
+ LOG(("Menu Item: %d\n",aes_msg_out[4]));
+ deskmenu_dispatch_item(aes_msg_out[3], aes_msg_out[4]);
+ break;
+ default:
+ break;
+ }
}
-
if((aes_event_out.emo_events & MU_KEYBD) != 0) {
uint16_t nkc = gem_to_norm( (short)aes_event_out.emo_kmeta,
(short)aes_event_out.emo_kreturn);
@@ -180,12 +189,12 @@ void gui_poll(bool active)
}
}
} while ( gui_poll_repeat && !(active||rendering));
- if(input_window && input_window->root->redraw_slots.areas_used > 0 && !active){
+ if(input_window && input_window->root->redraw_slots.areas_used > 0){
window_process_redraws(input_window->root);
}
- if(active || rendering)
- next_poll = clock() + (CLOCKS_PER_SEC>>3);
- }
+ //} else {
+ //printf("skip poll %d (%d)\n", next_poll, clock());
+ //}
}
@@ -374,10 +383,11 @@ void gui_window_update_box(struct gui_window *gw, const struct rect *rect)
slid = guiwin_get_scroll_info(gw->root->win);
guiwin_get_grect(gw->root->win, GUIWIN_AREA_CONTENT, &area);
- area.g_x += rect->x0;
- area.g_y += rect->y0;
+ area.g_x += rect->x0 - (slid->x_pos * slid->x_unit_px);
+ area.g_y += rect->y0 - (slid->y_pos * slid->y_unit_px);
area.g_w = rect->x1 - rect->x0;
area.g_h = rect->y1 - rect->y0;
+ //dbg_grect("update box", &area);
window_schedule_redraw_grect(gw->root, &area);
}
@@ -597,15 +607,26 @@ void gui_window_stop_throbber(struct gui_window *w)
/* Place caret in window */
void gui_window_place_caret(struct gui_window *w, int x, int y, int height)
{
+
+ GRECT clip, dim;
+ struct guiwin_scroll_info_s * slid;
if (w == NULL)
return;
- if( w->browser->caret.current.g_w > 0 )
- gui_window_remove_caret( w );
- w->browser->caret.requested.g_x = x;
- w->browser->caret.requested.g_y = y;
- w->browser->caret.requested.g_w = 1;
- w->browser->caret.requested.g_h = height;
- w->browser->caret.redraw = true;
+
+ slid = guiwin_get_scroll_info(w->root->win);
+ window_get_grect(w->root, BROWSER_AREA_CONTENT, &clip);
+ dim.g_x = x - (slid->x_pos * slid->x_unit_px);
+ dim.g_y = y - (slid->y_pos * slid->y_unit_px);
+ dim.g_h = height;
+ dim.g_w = 2;
+ caret_show(&w->caret, guiwin_get_vdi_handle(w->root->win), &dim, &clip);
+// if( w->browser->caret.current.g_w > 0 )
+// gui_window_remove_caret( w );
+// w->browser->caret.requested.g_x = x;
+// w->browser->caret.requested.g_y = y;
+// w->browser->caret.requested.g_w = 1;
+// w->browser->caret.requested.g_h = height;
+// w->browser->caret.redraw = true;
return;
}
@@ -619,11 +640,11 @@ gui_window_remove_caret(struct gui_window *w)
if (w == NULL)
return;
- if( w->browser->caret.background.fd_addr != NULL ) {
- browser_restore_caret_background( w, NULL );
- w->browser->caret.requested.g_w = 0;
- w->browser->caret.current.g_w = 0;
- }
+// if( w->browser->caret.background.fd_addr != NULL ) {
+// browser_restore_caret_background( w, NULL );
+// w->browser->caret.requested.g_w = 0;
+// w->browser->caret.current.g_w = 0;
+// }
return;
}
@@ -829,16 +850,18 @@ void gui_401login_open(nsurl *url, const char *realm,
{
bool bres;
char * out = NULL;
- bres = login_form_do( url, (char*)realm, &out );
- if( bres ) {
+ bres = login_form_do( url, (char*)realm, &out);
+ if (bres) {
LOG(("url: %s, realm: %s, auth: %s\n", url, realm, out ));
- urldb_set_auth_details(url, realm, out );
+ urldb_set_auth_details(url, realm, out);
}
- if( out != NULL ) {
+ if (out != NULL) {
free( out );
}
- if( cb != NULL )
- cb(bres, cbpw);
+ if (cb != NULL) {
+ cb(bres, cbpw);
+ }
+
}
void gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
@@ -1065,6 +1088,7 @@ static void gui_init(int argc, char** argv)
aes_event_in.emi_m1leave = MO_LEAVE;
aes_event_in.emi_m1.g_w = 1;
aes_event_in.emi_m1.g_h = 1;
+ next_poll = clock() + (CLOCKS_PER_SEC>>3);
}
diff --git a/atari/gui.h b/atari/gui.h
index 7bedd2b..0fc1a2c 100755
--- a/atari/gui.h
+++ b/atari/gui.h
@@ -20,6 +20,7 @@
#define NS_ATARI_GUI_H_
#include "atari/redrawslots.h"
+#include "atari/caret.h"
#include "atari/gemtk/gemtk.h"
struct point_s {
@@ -126,6 +127,7 @@ struct gui_window {
char * title;
char * url;
struct bitmap * icon;
+ struct s_caret caret;
struct gui_window *next, *prev;
};
diff --git a/atari/history.c b/atari/history.c
index e7db74b..f9faef5 100755
--- a/atari/history.c
+++ b/atari/history.c
@@ -131,6 +131,11 @@ bool global_history_init( void )
void global_history_destroy( void )
{
+
+void global_history_redraw( void )
+{
+ atari_treeview_redraw( gl_history.tv );
+}
if( gl_history.init == false ) {
return;
}
diff --git a/atari/history.h b/atari/history.h
index 2935793..3ea2621 100755
--- a/atari/history.h
+++ b/atari/history.h
@@ -39,11 +39,8 @@ void global_history_destroy( void );
void global_history_open( void );
void global_history_close( void );
-inline void global_history_redraw( void );
-inline void global_history_redraw( void )
-{
- atari_treeview_redraw( gl_history.tv );
-}
+void global_history_redraw( void );
+
#endif
diff --git a/atari/hotlist.c b/atari/hotlist.c
index f79a161..66e7560 100755
--- a/atari/hotlist.c
+++ b/atari/hotlist.c
@@ -180,6 +180,12 @@ void hotlist_close(void)
void hotlist_destroy(void)
{
+
+void hotlist_redraw(void)
+{
+ int i = 01;
+ atari_treeview_redraw(hl.tv);
+}
if( hl.init == false ) {
return;
}
diff --git a/atari/hotlist.h b/atari/hotlist.h
index 858d1a1..ed965a5 100755
--- a/atari/hotlist.h
+++ b/atari/hotlist.h
@@ -41,10 +41,7 @@ void hotlist_close( void );
void hotlist_destroy( void );
void atari_hotlist_add_page( const char * url, const char * title );
-inline void hotlist_redraw( void );
-inline void hotlist_redraw( void )
-{
- atari_treeview_redraw( hl.tv );
-}
+void hotlist_redraw( void );
+
#endif
diff --git a/atari/res/netsurf.rsc b/atari/res/netsurf.rsc
index 6addf82..cb8a3a0 100755
Binary files a/atari/res/netsurf.rsc and b/atari/res/netsurf.rsc differ
diff --git a/atari/res/netsurf.rsh b/atari/res/netsurf.rsh
index 8245526..0b3961c 100755
--- a/atari/res/netsurf.rsh
+++ b/atari/res/netsurf.rsh
@@ -113,7 +113,7 @@
#define DOWNLOAD_LBL_BYTES 6 /* TEXT in tree DOWNLOAD */
#define DOWNLOAD_LBL_PERCENT 7 /* TEXT in tree DOWNLOAD */
#define DOWNLOAD_LBL_SPEED 8 /* TEXT in tree DOWNLOAD */
-#define DOWNLOAD_CB_CLOSE_RDY 9 /* BUTTON in tree DOWNLOAD */
+#define DOWNLOAD_CB_CLOSE_RDY 9 /* BOXCHAR in tree DOWNLOAD */
#define ABOUT 11 /* form/dial */
diff --git a/atari/res/netsurf.rsm b/atari/res/netsurf.rsm
index 6c8e2e1..3e12e13 100755
--- a/atari/res/netsurf.rsm
+++ b/atari/res/netsurf.rsm
@@ -3,7 +3,7 @@ ResourceMaster v3.65
#N 99@32@AZAaza___ _@AZAaza090___ _@@_@
#FoC-Header@rsm2out@C-Header@rsh@@@[C-Header@0@
#R 0@0@1@1@1@1@
-#M 20010100@0@7728@623@
+#M 20010100@0@7728@624@
#T 0@1@MAINMENU@@62@@
#O 4@32@T_FILE@@
#O 5@32@T_EDIT@@
@@ -107,7 +107,7 @@ ResourceMaster v3.65
#O 6@21@LBL_BYTES@@
#O 7@21@LBL_PERCENT@@
#O 8@21@LBL_SPEED@@
-#O 9@26@CB_CLOSE_RDY@@
+#O 9@27@CB_CLOSE_RDY@@
#T 11@2@ABOUT@@2@@
#T 12@2@POP_CTX@@12@@
#O 1@21@CUT_SEL@@
@@ -198,4 +198,4 @@ ResourceMaster v3.65
#O 5@33@BT_DOWN_PIC@@
#O 6@25@BT_UP@@
#O 4@33@BT_UP_PIC@@
-#c 32640@
+#c 205@
-----------------------------------------------------------------------
Summary of changes:
Makefile | 69 ++-
Makefile.defaults | 340 +-------
Makefile.sources.javascript | 1 -
amiga/Makefile.defaults | 40 +
amiga/Makefile.target | 12 +-
amiga/dist/Install | 4 +
amiga/dist/NetSurf.guide | 4 +-
amiga/download.c | 25 +-
amiga/gui.c | 252 +++++-
amiga/gui.h | 3 +
amiga/gui_options.c | 241 ++++--
amiga/hotlist.c | 37 +-
amiga/menu.c | 144 +++-
amiga/menu.h | 11 +-
amiga/misc.c | 23 +
amiga/misc.h | 1 +
amiga/options.h | 9 +
amiga/tree.c | 2 +
atari/Makefile.defaults | 52 +
atari/Makefile.target | 15 +-
atari/Makefile.target.orig | 120 +++
atari/browser.c | 573 ++++++------
atari/browser.h | 6 +-
atari/caret.c | 129 +++
atari/caret.h | 17 +
atari/deskmenu.c | 3 +-
atari/download.c | 13 +-
atari/extract.php | 10 +
atari/gemtk/aestabs.c | 173 ++++
atari/gemtk/aestabs.h | 56 ++
atari/gemtk/gemtk.h | 80 +-
atari/gemtk/guiwin.c | 84 ++-
atari/{ => gemtk}/redrawslots.c | 6 +-
atari/{save.h => gemtk/redrawslots.h} | 10 +-
atari/gui.c | 90 ++-
atari/gui.h | 3 +
atari/history.c | 11 +
atari/history.h | 7 +-
atari/hotlist.c | 101 ++-
atari/hotlist.h | 7 +-
atari/misc.c | 3 +-
atari/res/netsurf.rsc | Bin 35788 -> 36642 bytes
atari/res/netsurf.rsh | 19 +-
atari/res/netsurf.rsm | 24 +-
atari/rootwin.c | 37 +-
atari/settings.c | 1043 +++-----------------
atari/settings.h | 2 +-
beos/Makefile.defaults | 32 +
beos/Makefile.target | 8 +-
cocoa/Makefile.defaults | 37 +
cocoa/Makefile.target | 8 +-
framebuffer/Makefile.defaults | 47 +
framebuffer/Makefile.target | 10 +-
gtk/Makefile.defaults | 34 +
gtk/Makefile.target | 41 +-
javascript/js.h | 15 +-
javascript/jsapi.c | 164 +++-
javascript/jsapi.h | 21 +-
javascript/jsapi/binding.h | 4 +-
javascript/jsapi/dom.bnd | 10 +-
javascript/jsapi/htmlcollection.bnd | 2 +-
javascript/jsapi/htmldocument.bnd | 289 ++++++
javascript/jsapi/htmlelement.bnd | 336 ++++++-
javascript/jsapi/location.bnd | 12 +-
javascript/jsapi/nodelist.bnd | 11 +-
javascript/jsapi/window.bnd | 91 +-
javascript/none.c | 2 +-
monkey/Makefile.defaults | 13 +
monkey/Makefile.target | 37 +-
render/box.c | 10 +-
render/box.h | 2 +
render/box_construct.c | 5 +-
render/html.c | 143 +--
render/html_interaction.c | 87 ++-
resources/FatMessages | 146 +++-
riscos/Makefile.defaults | 31 +
riscos/Makefile.target | 10 +-
riscos/configure/con_content.c | 9 +
riscos/templates/de | 30 +-
riscos/templates/en | 30 +-
riscos/templates/fr | 30 +-
riscos/templates/nl | 30 +-
...m-document-enumerate.html => document-url.html} | 13 +-
test/js/event-onclick.html | 30 +
test/js/event-onload.html | 10 +-
test/js/index.html | 19 +-
utils/corestrings.c | 3 +
utils/corestrings.h | 1 +
utils/libdom.c | 83 ++-
utils/libdom.h | 14 +-
windows/Makefile.defaults | 24 +
91 files changed, 3671 insertions(+), 2225 deletions(-)
create mode 100644 amiga/Makefile.defaults
create mode 100644 atari/Makefile.defaults
create mode 100644 atari/Makefile.target.orig
create mode 100644 atari/caret.c
create mode 100644 atari/caret.h
create mode 100755 atari/extract.php
create mode 100644 atari/gemtk/aestabs.c
create mode 100644 atari/gemtk/aestabs.h
copy atari/{ => gemtk}/redrawslots.c (95%)
copy atari/{save.h => gemtk/redrawslots.h} (85%)
create mode 100644 beos/Makefile.defaults
create mode 100644 cocoa/Makefile.defaults
create mode 100644 framebuffer/Makefile.defaults
create mode 100644 gtk/Makefile.defaults
create mode 100644 monkey/Makefile.defaults
create mode 100644 riscos/Makefile.defaults
copy test/js/{dom-document-enumerate.html => document-url.html} (59%)
create mode 100644 test/js/event-onclick.html
create mode 100644 windows/Makefile.defaults
diff --git a/Makefile b/Makefile
index 428aa74..baf8354 100644
--- a/Makefile
+++ b/Makefile
@@ -70,8 +70,6 @@ else
ifeq ($(TARGET),)
TARGET := beos
endif
- # BeOS still uses gcc2
- GCCVER := 2
else
ifeq ($(HOST),AmigaOS)
HOST := amiga
@@ -153,6 +151,7 @@ ifeq ($(TARGET),riscos)
SQUEEZE := squeeze
RUNEXT :=
CC := gcc
+ CXX := g++
EXEEXT :=
PKG_CONFIG :=
else
@@ -188,6 +187,7 @@ ifeq ($(TARGET),riscos)
SUBTARGET := -aof
EXEEXT := ,ff8
endif
+ CXX := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*g++)
PKG_CONFIG := $(GCCSDK_INSTALL_ENV)/ro-pkg-config
endif
else
@@ -258,8 +258,21 @@ else
endif
endif
else
- # Building for GTK, Framebuffer
- PKG_CONFIG := pkg-config
+ ifeq ($(TARGET),monkey)
+ ifeq ($(origin GCCSDK_INSTALL_ENV),undefined)
+ PKG_CONFIG := pkg-config
+ else
+ PKG_CONFIG := PKG_CONFIG_LIBDIR="$(GCCSDK_INSTALL_ENV)/lib/pkgconfig" pkg-config
+ endif
+
+ ifneq ($(origin GCCSDK_INSTALL_CROSSBIN),undefined)
+ CC := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*gcc)
+ CXX := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*g++)
+ endif
+ else
+ # All other targets (GTK, Framebuffer)
+ PKG_CONFIG := pkg-config
+ endif
endif
endif
endif
@@ -267,6 +280,13 @@ else
endif
endif
+# compiler versioning to adjust warning flags
+CC_VERSION := $(shell $(CC) -dumpversion)
+CC_MAJOR := $(word 1,$(subst ., ,$(CC_VERSION)))
+CC_MINOR := $(word 2,$(subst ., ,$(CC_VERSION)))
+define cc_ver_ge
+$(shell expr $(CC_MAJOR) \>= $(1) \& $(CC_MINOR) \>= $(2))
+endef
# CCACHE
ifeq ($(origin CCACHE),undefined)
@@ -301,10 +321,37 @@ define feature_enabled
endif
endef
+# Extend flags with appropriate values from pkg-config for enabled features
+#
+# 1: pkg-config required modules for feature
+# 2: Human-readable name for the feature
+define pkg_config_find_and_add
+ ifeq ($$(PKG_CONFIG),)
+ $$(error pkg-config is required to auto-detect feature availability)
+ endif
+
+ PKG_CONFIG_$(1)_EXISTS := $$(shell $$(PKG_CONFIG) --exists $(1) && echo yes)
+
+ ifeq ($$(PKG_CONFIG_$(1)_EXISTS),yes)
+ CFLAGS += $$(shell $$(PKG_CONFIG) --cflags $(1))
+ LDFLAGS += $$(shell $$(PKG_CONFIG) --libs $(1))
+ ifneq ($(MAKECMDGOALS),clean)
+ $$(info PKG.CNFG: $(2) ($(1)) enabled)
+ endif
+ else
+ ifneq ($(MAKECMDGOALS),clean)
+ $$(info PKG.CNFG: $(2) ($(1)) failed)
+ $$(error Unable to find library for: $(2) ($(1)))
+ endif
+ endif
+endef
+
+# Extend flags with appropriate values from pkg-config for enabled features
+#
# 1: Feature name (ie, NETSURF_USE_RSVG -> RSVG)
# 2: pkg-config required modules for feature
# 3: Human-readable name for the feature
-define pkg_config_find_and_add
+define pkg_config_find_and_add_enabled
ifeq ($$(PKG_CONFIG),)
$$(error pkg-config is required to auto-detect feature availability)
endif
@@ -358,10 +405,14 @@ endef
WARNFLAGS = -W -Wall -Wundef -Wpointer-arith \
-Wcast-align -Wwrite-strings -Wstrict-prototypes \
-Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \
- -Wnested-externs
-ifneq ($(GCCVER),2)
+ -Wnested-externs -Wuninitialized
+ifneq ($(CC_MAJOR),2)
WARNFLAGS += -Wno-unused-parameter
endif
+# deal with lots of unwanted warnings from javascript
+ifeq ($(call cc_ver_ge,4,6),1)
+ WARNFLAGS += -Wno-unused-but-set-variable
+endif
# Pull in the configuration
include Makefile.defaults
@@ -432,7 +483,7 @@ $(EXETARGET): $(OBJECTS) $(RESOURCES)
ifneq ($(TARGET)$(SUBTARGET),riscos-elf)
$(Q)$(CC) -o $(EXETARGET) $(OBJECTS) $(LDFLAGS)
else
- $(Q)$(CC) -o $(EXETARGET:,ff8=,e1f) $(OBJECTS) $(LDFLAGS)
+ $(Q)$(CXX) -o $(EXETARGET:,ff8=,e1f) $(OBJECTS) $(LDFLAGS)
$(Q)$(ELF2AIF) $(EXETARGET:,ff8=,e1f) $(EXETARGET)
$(Q)$(RM) $(EXETARGET:,ff8=,e1f)
endif
@@ -552,7 +603,7 @@ endef
# 1 = Source file
# 2 = obj filename, no prefix
# 3 = dep filename, no prefix
-ifeq ($(GCCVER),2)
+ifeq ($(CC_MAJOR),2)
# simpler deps tracking for gcc2...
define compile_target_c
$$(DEPROOT)/$(3) $$(OBJROOT)/$(2): $$(OBJROOT)/created
diff --git a/Makefile.defaults b/Makefile.defaults
index 5633dd2..812a5a9 100644
--- a/Makefile.defaults
+++ b/Makefile.defaults
@@ -98,344 +98,8 @@ CFLAGS :=
# Default installation/execution prefix
PREFIX ?= /usr/local
-# ----------------------------------------------------------------------------
-# RISC OS-specific options
-# ----------------------------------------------------------------------------
-ifeq ($(TARGET),riscos)
-
- # Enable NetSurf's use of libsvgtiny for displaying SVGs
- # Valid options: YES, NO
- NETSURF_USE_NSSVG := YES
-
- # Enable NetSurf's support for displaying RISC OS Draw files
- # Valid options: YES, NO
- NETSURF_USE_DRAW := YES
-
- # Enable NetSurf's support for displaying RISC OS Sprites
- # Valid options: YES, NO
- NETSURF_USE_SPRITE := YES
-
- # Enable NetSurf's use of AWRender for displaying ArtWorks files
- # Valid options: YES, NO
- NETSURF_USE_ARTWORKS := YES
-
- # Enable NetSurf's support for the Acorn plugin protocol
- # Valid options: YES, NO
- NETSURF_USE_PLUGINS := NO
-
- # Enable NetSurf's use of pencil for Drawfile export
- # Valid options: YES, NO
- NETSURF_USE_DRAW_EXPORT := YES
-
- # Optimisation levels
- CFLAGS += -O2 -Wuninitialized
-
-endif
-
-# ----------------------------------------------------------------------------
-# GTK-specific options
-# ----------------------------------------------------------------------------
-ifeq ($(TARGET),gtk)
-
- # Where to search for NetSurf's resources after looking in ~/.netsurf and
- # $NETSURFRES. It must have a trailing /
- NETSURF_GTK_RESOURCES := $(PREFIX)/share/netsurf/
-
- # Where to install the netsurf binary
- NETSURF_GTK_BIN := $(PREFIX)/bin/
-
- # Enable NetSurf's use of librsvg in conjunction with Cairo to display SVGs
- # Valid options: YES, NO, AUTO
- NETSURF_USE_RSVG := AUTO
-
- # Enable NetSurf's use of libsvgtiny for displaying SVGs
- # Valid options: YES, NO, AUTO
- NETSURF_USE_NSSVG := AUTO
-
- # Enable NetSurf's use of librosprite for displaying RISC OS Sprites
- # Valid options: YES, NO, AUTO
- NETSURF_USE_ROSPRITE := AUTO
-
- # Configuration overrides for Mac OS X
- ifeq ($(HOST),macosx)
- NETSURF_USE_LIBICONV_PLUG := NO
- NETSURF_USE_HARU_PDF := NO
- endif
-
- # Set default GTK version to build for (2 or 3)
- NETSURF_GTK_MAJOR := 2
-
- # Optimisation levels
- CFLAGS += -O2 -Wuninitialized
-
-endif
-
-# ----------------------------------------------------------------------------
-# Monkey-specific options
-# ----------------------------------------------------------------------------
-ifeq ($(TARGET),monkey)
- # How did I get mixed up with this fucking monkey anyhow?
- NETSURF_MONKEY_RESOURCES := $(PREFIX)/share/netsurf/
- NETSURF_MONKEY_BIN := $(PREFIX)/bin/
- NETSURF_USE_RSVG := NO
- NETSURF_USE_NSSVG := NO
- NETSURF_USE_ROSPRITE := NO
- NETSURF_USE_HARU_PDF := NO
- NETSURF_USE_LIBICONV_PLUG := NO
- CFLAGS += -O2 -Wuninitialized
-endif
-
-# ----------------------------------------------------------------------------
-# BeOS-specific options
-# ----------------------------------------------------------------------------
-ifeq ($(TARGET),beos)
-
-
- # Where to install the netsurf binary
- NETSURF_BEOS_BIN := /boot/apps/netsurf/
-
- # TODO:HAIKU -- not sure if ~/.netsurf applies in beos
- # Where to search for NetSurf's resources after looking in ~/.netsurf and
- # $NETSURFRES. It must have a trailing /
- NETSURF_BEOS_RESOURCES := /boot/apps/netsurf/res/
-
- # Enable NetSurf's use of libsvgtiny for displaying SVGs
- # Valid options: YES, NO, AUTO
- NETSURF_USE_NSSVG := YES
-
- # Enable NetSurf's use of librosprite for displaying RISC OS Sprites
- # Valid options: YES, NO, AUTO
- NETSURF_USE_ROSPRITE := AUTO
-
- # Enable NetSurf's use of libharu for PDF export.
- # Valid options: YES, NO
- NETSURF_USE_HARU_PDF := NO
-
- # Force using glibc internal iconv implementation instead of external libiconv
- # Valid options: YES, NO
- NETSURF_USE_LIBICONV_PLUG := NO
-
- # Optimisation levels
- CFLAGS += -O2 -Wuninitialized
-
-endif
-
-# ----------------------------------------------------------------------------
-# Amiga-specific options
-# ----------------------------------------------------------------------------
-ifeq ($(TARGET),amiga)
-
- # Force using glibc internal iconv implementation instead of external libiconv
- # Valid options: YES, NO
- NETSURF_USE_LIBICONV_PLUG := YES
-
- # Enable NetSurf's use of librosprite for displaying RISC OS Sprites
- # Valid options: YES, NO, AUTO
- NETSURF_USE_ROSPRITE := NO
-
- # Enable NetSurf's use of libmng for displaying MNGs, JNGs and PNGs
- # Valid options: YES, NO (at least one of PNG/MNG/DT highly recommended)
- NETSURF_USE_MNG := NO
-
- # Enable NetSurf's use of libwebp for displaying WebPs
- # Valid options: YES, NO
- NETSURF_USE_WEBP := NO
-
- # Enable NetSurf to display Amiga icons
- # Valid options: YES, NO (recommended)
- NETSURF_USE_AMIGA_ICON := YES
-
- # Enable NetSurf's use of DataTypes for unknown filetypes
- # Valid options: YES, NO
- NETSURF_USE_AMIGA_DATATYPES := YES
-
- # Enable NetSurf's use of libsvgtiny for displaying SVGs
- # Valid options: YES, NO
- NETSURF_USE_NSSVG := YES
-
- # Enable NetSurf's use of libcairo for some plotter functions
- # This will also link NetSurf with shared objects, and
- # requires AmigaOS 4.1 or higher to run the resulting executable
- # Valid options: YES, NO, AUTO
- NETSURF_USE_AMIGA_CAIRO := AUTO
-
- # Optimisation levels
- CFLAGS += -O2 -Wuninitialized -gstabs
-
-endif
-
-# ----------------------------------------------------------------------------
-# Framebuffer-target-specific options
-# ----------------------------------------------------------------------------
-ifeq ($(TARGET),framebuffer)
- # Optimisation levels
- CFLAGS += -O2 -Wuninitialized
-
- # Framebuffer default surface provider.
- # Valid values are: x, sdl, linux, vnc, able,
- NETSURF_FB_FRONTEND := sdl
-
- # Use libharu to enable PDF export and GTK printing support.
- # Valid options: YES, NO
- NETSURF_USE_HARU_PDF := NO
-
- # Enable NetSurf's use of librosprite for displaying RISC OS Sprites
- # Valid options: YES, NO, AUTO
- NETSURF_USE_ROSPRITE := AUTO
-
- # Library to use for font plotting
- # Valid options: internal, freetype
- NETSURF_FB_FONTLIB := internal
-
- # Default freetype font files
- NETSURF_FB_FONT_SANS_SERIF := DejaVuSans.ttf
- NETSURF_FB_FONT_SANS_SERIF_BOLD := DejaVuSans-Bold.ttf
- NETSURF_FB_FONT_SANS_SERIF_ITALIC := DejaVuSans-Oblique.ttf
- NETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD := DejaVuSans-BoldOblique.ttf
- NETSURF_FB_FONT_SERIF := DejaVuSerif.ttf
- NETSURF_FB_FONT_SERIF_BOLD := DejaVuSerif-Bold.ttf
- NETSURF_FB_FONT_MONOSPACE := DejaVuSansMono.ttf
- NETSURF_FB_FONT_MONOSPACE_BOLD := DejaVuSansMono-Bold.ttf
- NETSURF_FB_FONT_CURSIVE := Comic_Sans_MS.ttf
- NETSURF_FB_FONT_FANTASY := Impact.ttf
-
- # Default binary install path
- NETSURF_FRAMEBUFFER_BIN := $(PREFIX)/bin/
-
- # Default resource install path
- NETSURF_FRAMEBUFFER_RESOURCES := $(PREFIX)/share/netsurf/
-
- # Default framebuffer search path
- NETSURF_FB_RESPATH := $${HOME}/.netsurf/:$${NETSURFRES}:$(NETSURF_FRAMEBUFFER_RESOURCES):./framebuffer/res
-
- # freetype compiled in font serch path
- NETSURF_FB_FONTPATH := /usr/share/fonts/truetype/ttf-dejavu:/usr/share/fonts/truetype/msttcorefonts
-
-
-endif
-
-# ----------------------------------------------------------------------------
-# windows-specific options
-# ----------------------------------------------------------------------------
-ifeq ($(TARGET),windows)
-
- # Enable NetSurf's use of librosprite for displaying RISC OS Sprites
- # Valid options: YES, NO, AUTO
- NETSURF_USE_ROSPRITE := NO
-
- # Enable NetSurf's use of libsvgtiny for displaying SVGs
- # Valid options: YES, NO
- NETSURF_USE_NSSVG := NO
-
- # Force using glibc internal iconv implementation instead of external libiconv
- # Valid options: YES, NO
- NETSURF_USE_LIBICONV_PLUG := NO
-
- # mng support does not currently build on windows
- NETSURF_USE_MNG := NO
-
- # no pdf support
- NETSURF_USE_HARU_PDF := NO
-
- # Optimisation levels
- CFLAGS += -O2 -Wuninitialized
-
-endif
-
-# ----------------------------------------------------------------------------
-# Atari-specific options
-# ----------------------------------------------------------------------------
-ifeq ($(TARGET),atari)
-
- # Force using glibc internal iconv implementation instead of external libiconv
- # Valid options: YES, NO
- NETSURF_USE_LIBICONV_PLUG := NO
-
- # Enable NetSurf's use of librosprite for displaying RISC OS Sprites
- # Valid options: YES, NO, AUTO
- NETSURF_USE_ROSPRITE := NO
-
- # Enable NetSurf's use of libwebp for displaying WebPs
- # Valid options: YES, NO
- NETSURF_USE_WEBP := NO
-
- # Enable NetSurf's use of librsvg in conjunction with Cairo to display SVGs
- # Valid options: YES, NO, AUTO
- NETSURF_USE_RSVG := AUTO
-
- # Enable NetSurf's use of libsvgtiny for displaying SVGs
- # Valid options: YES, NO, AUTO
- NETSURF_USE_NSSVG := AUTO
-
- NETSURF_USE_MNG := NO
-
- # enable true type fonts via freetype2
- # Valid options: YES, NO
- NETSURF_USE_ATARI_FREETYPE_FONT := YES
-
- # Enable use of netsurf embedded font
- # Valid options: YES, NO
- NETSURF_USE_ATARI_NETSURF_FONT := YES
-
- # Configure support for screen drivers with no true colour mode
- # Valid options: YES, NO
- NETSURF_USE_ATARI_8BPP_SUPPORT := NO
-
- # Configure the CPU target
- # Valid options: 68000, 68020-60, 5475 (coldfire)
- ATARI_ARCH = 68020-60
-
- # enable optimizations
- # -O2 is currently broken with m68000 / m68020-60 builds
- CFLAGS += -O1 -Wuninitialized
-
- WARNFLAGS = -W -Wundef -Wpointer-arith \
- -Wcast-align -Wwrite-strings -Wstrict-prototypes \
- -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \
- -Wnested-externs -Wl,-t
-
-endif
-
-# ----------------------------------------------------------------------------
-# Cocoa-specific options
-# ----------------------------------------------------------------------------
-ifeq ($(TARGET),cocoa)
-
- # Force using glibc internal iconv implementation instead of external libiconv
- # Valid options: YES, NO
- NETSURF_USE_LIBICONV_PLUG := NO
-
- # Enable NetSurf's use of librosprite for displaying RISC OS Sprites
- # Valid options: YES, NO, AUTO
- NETSURF_USE_ROSPRITE := NO
-
- # Enable NetSurf's use of libwebp for displaying WebPs
- # Valid options: YES, NO
- NETSURF_USE_WEBP := NO
-
- # Enable NetSurf's use of librsvg in conjunction with Cairo to display SVGs
- # Valid options: YES, NO, AUTO
- NETSURF_USE_RSVG := AUTO
-
- # Enable NetSurf's use of libsvgtiny for displaying SVGs
- # Valid options: YES, NO, AUTO
- NETSURF_USE_NSSVG := AUTO
-
- NETSURF_USE_MNG := NO
- NETSURF_USE_BMP := NO
- NETSURF_USE_GIF := NO
- NETSURF_USE_PNG := NO
- NETSURF_USE_JPEG := NO
- NETSURF_USE_IMAGEIO := YES
-
- DEVELOPER_PATH := /Developer
- MACOSX_VERSION := 10.5
- SDK_VERSION := $(MACOSX_VERSION)
-
- # Optimisation levels
- CFLAGS += -O2 -Wuninitialized
-
-endif
+# Incude defaults specific to a TARGET
+-include $(TARGET)/Makefile.defaults
# Include any local configuration
ifneq ($(MAKEFILE_DEFAULTS_FINISHED),)
diff --git a/Makefile.sources.javascript b/Makefile.sources.javascript
index 1ece3b6..76a6ff1 100644
--- a/Makefile.sources.javascript
+++ b/Makefile.sources.javascript
@@ -54,7 +54,6 @@ 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)))
-
else
S_JAVASCRIPT += none.c
endif
diff --git a/amiga/Makefile.defaults b/amiga/Makefile.defaults
new file mode 100644
index 0000000..42bcb73
--- /dev/null
+++ b/amiga/Makefile.defaults
@@ -0,0 +1,40 @@
+# ----------------------------------------------------------------------------
+# Amiga-specific options
+# ----------------------------------------------------------------------------
+
+ # Force using glibc internal iconv implementation instead of external libiconv
+ # Valid options: YES, NO
+ NETSURF_USE_LIBICONV_PLUG := YES
+
+ # Enable NetSurf's use of librosprite for displaying RISC OS Sprites
+ # Valid options: YES, NO, AUTO
+ NETSURF_USE_ROSPRITE := NO
+
+ # Enable NetSurf's use of libmng for displaying MNGs, JNGs and PNGs
+ # Valid options: YES, NO (at least one of PNG/MNG/DT highly recommended)
+ NETSURF_USE_MNG := NO
+
+ # Enable NetSurf's use of libwebp for displaying WebPs
+ # Valid options: YES, NO
+ NETSURF_USE_WEBP := NO
+
+ # Enable NetSurf to display Amiga icons
+ # Valid options: YES, NO (recommended)
+ NETSURF_USE_AMIGA_ICON := YES
+
+ # Enable NetSurf's use of DataTypes for unknown filetypes
+ # Valid options: YES, NO
+ NETSURF_USE_AMIGA_DATATYPES := YES
+
+ # Enable NetSurf's use of libsvgtiny for displaying SVGs
+ # Valid options: YES, NO
+ NETSURF_USE_NSSVG := YES
+
+ # Enable NetSurf's use of libcairo for some plotter functions
+ # This will also link NetSurf with shared objects, and
+ # requires AmigaOS 4.1 or higher to run the resulting executable
+ # Valid options: YES, NO, AUTO
+ NETSURF_USE_AMIGA_CAIRO := AUTO
+
+ # Optimisation levels
+ CFLAGS += -O2 -gstabs
diff --git a/amiga/Makefile.target b/amiga/Makefile.target
index af4b0bd..ec43fdd 100644
--- a/amiga/Makefile.target
+++ b/amiga/Makefile.target
@@ -41,12 +41,12 @@ ifeq ($(HOST),amiga)
LDFLAGS += -use-dynld -ldl -lcairo -lpixman-1 -lfreetype -lfontconfig -lpng -lexpat
endif
else
- $(eval $(call pkg_config_find_and_add,ROSPRITE,librosprite,Sprite))
- $(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
- $(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
- $(eval $(call pkg_config_find_and_add,PNG,libpng,PNG))
- $(eval $(call pkg_config_find_and_add,NSSVG,libsvgtiny,NSSVG))
- $(eval $(call pkg_config_find_and_add,AMIGA_CAIRO,cairo,Cairo))
+ $(eval $(call pkg_config_find_and_add_enabled,ROSPRITE,librosprite,Sprite))
+ $(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))
+ $(eval $(call pkg_config_find_and_add_enabled,NSSVG,libsvgtiny,NSSVG))
+ $(eval $(call pkg_config_find_and_add_enabled,AMIGA_CAIRO,cairo,Cairo))
$(eval $(call feature_enabled,AMIGA_ICON,-DWITH_AMIGA_ICON,,Amiga icon))
$(eval $(call feature_enabled,AMIGA_DATATYPES,-DWITH_AMIGA_DATATYPES,,DataTypes))
diff --git a/amiga/dist/Install b/amiga/dist/Install
index 7b8c5fe..e320964 100755
--- a/amiga/dist/Install
+++ b/amiga/dist/Install
@@ -474,6 +474,10 @@
(rename (tackon @default-dest "Resources/SearchEngines") (tackon @default-dest "Resources/SearchEngines.backup"))
)
+(run "c:filenote Rexx/CloseTabs.nsrx \"Close other tabs\"")
+(run "c:filenote Rexx/ViewSource.nsrx \"View source\"")
+(run "c:filenote Rexx/GetVideo.nsrx \"Get video\"")
+
(copyfiles
(prompt "Copying files")
(source "")
diff --git a/amiga/dist/NetSurf.guide b/amiga/dist/NetSurf.guide
index b39ea3d..8759b2b 100755
--- a/amiga/dist/NetSurf.guide
+++ b/amiga/dist/NetSurf.guide
@@ -48,6 +48,7 @@ There are a couple of Amiga-specific options which can only be changed directly
@{b}redraw_tile_size_x@{ub}/@{b}redraw_tile_size_y@{ub} Specify the size of the off-screen bitmap. Higher will speed up redraws at the expense of memory. 0 disables tiling (will use a bitmap at least the size of the screen NetSurf is running on)
@{b}font_antialiasing@{ub} Switch text anti-aliasing on or off. Defaults to on in true-colour modes, but text rendering performance can be improved by setting to 0.
@{b}window_simple_refresh@{ub} If set to 1, NetSurf will use SimpleRefresh rather than SmartRefresh windows. These have slower redraw but use less memory. Note that this setting has no noticeable effect if compositing is enabled. Defaults to 0 (SmartRefresh)
+@{b}web_search_width@{ub} Defaults to 0. Larger values will increase the size of the web search gadget next to the URL bar.
@{b}dithering_quality@{ub} Specify the dithering quality from all values supported by picture.datatype. Currently these are 0=None, 1=Normal, 2=High quality. Other values are undefined. This is only used when NetSurf is running in palette-mapped mode.
@{b}mask_alpha@{ub} Threshold to use when determining which alpha values to convert to full transparency (0 - 255, where 255 will convert even opaque pixels to transparent). Defaults to 50 (0x32). This is only used in palette-mapped modes where alpha blending is not currently supported.
@@ -182,9 +183,8 @@ links clicked within NetSurf.
Items from the hotlist can be added to the Hotlist menu as follows:
Select Hotlist => Show hotlist...
-Add a folder called Menu. This must not be placed within any other folder.
-Items in this folder node up to a maximum (currently) of 40 items will be added to the Hotlist menu, within the limits of the Intuition menu system.
+Items in the "Hotlist menu" folder node, up to a maximum (currently) of 40 items, will be added to the Hotlist menu, within the limits of the Intuition menu system.
Items in folders within the Menu folder node will be converted to subitems in the menu.
diff --git a/amiga/download.c b/amiga/download.c
index d5071d3..c0c88bb 100644
--- a/amiga/download.c
+++ b/amiga/download.c
@@ -37,9 +37,10 @@
#include "desktop/options.h"
#include "amiga/bitmap.h"
#include "amiga/iff_dr2d.h"
+#include "amiga/file.h"
+#include "amiga/misc.h"
#include "amiga/theme.h"
#include "amiga/utf8.h"
-#include "amiga/file.h"
#include "desktop/download.h"
#include "desktop/selection.h"
@@ -389,7 +390,7 @@ gui_window_save_link(struct gui_window *g, const char *url, const char *title)
BOOL ami_download_check_overwrite(const char *file, struct Window *win, ULONG size)
{
/* Return TRUE if file can be (over-)written */
- int res = 0;
+ int32 res = 0;
BPTR lock = 0;
BPTR fh = 0;
int64 oldsize = 0;
@@ -415,27 +416,11 @@ BOOL ami_download_check_overwrite(const char *file, struct Window *win, ULONG si
overwritetext = ASPrintf(messages_get("OverwriteFile"));
}
- char *utf8text = ami_utf8_easy(overwritetext);
+ res = ami_warn_user_multi(overwritetext, "Replace", "DontReplace", win);
FreeVec(overwritetext);
-
- char *utf8gadget1 = ami_utf8_easy(messages_get("DontReplace"));
- char *utf8gadget2 = ami_utf8_easy(messages_get("Replace"));
- char *utf8gadgets = ASPrintf("%s|%s", utf8gadget1, utf8gadget2);
- free(utf8gadget1);
- free(utf8gadget2);
-
- res = TimedDosRequesterTags(TDR_ImageType, TDRIMAGE_WARNING,
- TDR_TitleString, messages_get("NetSurf"),
- TDR_FormatString, utf8text,
- TDR_GadgetString, utf8gadgets,
- TDR_Window, win,
- TAG_DONE);
-
- if(utf8text) free(utf8text);
- if(utf8gadgets) FreeVec(utf8gadgets);
}
else return TRUE;
- if(res == 0) return TRUE;
+ if(res == 1) return TRUE;
else return FALSE;
}
diff --git a/amiga/gui.c b/amiga/gui.c
index 064c49c..e1fc19d 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -177,6 +177,7 @@ void ami_get_vscroll_pos(struct gui_window_2 *gwin, ULONG *ys);
ULONG ami_set_border_gadget_balance(struct gui_window_2 *gwin);
ULONG ami_get_border_gadget_balance(struct gui_window_2 *gwin, ULONG *size1, ULONG *size2);
void ami_try_quit(void);
+void ami_quit_netsurf_delayed(void);
Object *ami_gui_splash_open(void);
void ami_gui_splash_close(Object *win_obj);
static uint32 ami_set_search_ico_render_hook(struct Hook *hook, APTR space,
@@ -1190,6 +1191,27 @@ void ami_gui_trap_mouse(struct gui_window_2 *gwin)
}
}
+void ami_gui_menu_update_all(void)
+{
+ struct nsObject *node;
+ struct nsObject *nnode;
+ struct gui_window_2 *gwin;
+
+ if(IsMinListEmpty(window_list)) return;
+
+ node = (struct nsObject *)GetHead((struct List *)window_list);
+
+ do {
+ nnode=(struct nsObject *)GetSucc((struct Node *)node);
+ gwin = node->objstruct;
+
+ if(node->Type == AMINS_WINDOW)
+ {
+ ami_menu_update_checked(gwin);
+ }
+ } while(node = nnode);
+}
+
void ami_handle_msg(void)
{
struct IntuiMessage *message = NULL;
@@ -1206,6 +1228,7 @@ void ami_handle_msg(void)
struct browser_window *closedbw;
struct timeval curtime;
static int drag_x_move = 0, drag_y_move = 0;
+ char *url;
if(IsMinListEmpty(window_list))
{
@@ -1633,6 +1656,7 @@ void ami_handle_msg(void)
ami_gui_history(gwin, false);
break;
+ case GID_HOTLIST:
default:
// printf("GADGET: %ld\n",(result & WMHI_GADGETMASK));
break;
@@ -1640,8 +1664,9 @@ void ami_handle_msg(void)
break;
case WMHI_RAWKEY:
+ ami_update_quals(gwin);
+
storage = result & WMHI_GADGETMASK;
-
if(storage >= IECODE_UP_PREFIX) break;
GetAttr(WINDOW_InputEvent,gwin->objects[OID_MAIN],(ULONG *)&ie);
@@ -1940,6 +1965,11 @@ void ami_handle_msg(void)
ami_menu_window_close = NULL;
}
+
+ if(ami_menu_check_toggled) {
+ ami_gui_menu_update_all();
+ ami_menu_check_toggled = false;
+ }
}
void ami_gui_appicon_remove(struct gui_window_2 *gwin)
@@ -2106,11 +2136,12 @@ void ami_get_msg(void)
ULONG winsignal = 1L << sport->mp_SigBit;
ULONG appsig = 1L << appport->mp_SigBit;
ULONG schedulesig = 1L << msgport->mp_SigBit;
+ ULONG ctrlcsig = SIGBREAKF_CTRL_C;
ULONG signal;
struct TimerRequest *timermsg = NULL;
struct MsgPort *printmsgport = ami_print_get_msgport();
ULONG printsig = 1L << printmsgport->mp_SigBit;
- ULONG signalmask = winsignal | appsig | schedulesig | rxsig | printsig | applibsig;
+ ULONG signalmask = winsignal | appsig | schedulesig | rxsig | printsig | applibsig | ctrlcsig;
signal = Wait(signalmask);
/*
@@ -2142,6 +2173,11 @@ printf("sig recvd %ld (%ld %ld %ld %ld %ld %ld)\n", signal, winsignal , appsig ,
schedule_run(FALSE);
}
}
+
+ if(signal & ctrlcsig)
+ {
+ ami_quit_netsurf_delayed();
+ }
}
void gui_poll(bool active)
@@ -2300,6 +2336,32 @@ void ami_quit_netsurf(void)
}
}
+void ami_quit_netsurf_delayed(void)
+{
+ int res = -1;
+#ifdef __amigaos4__
+ char *utf8text = ami_utf8_easy(messages_get("TCPIPShutdown"));
+ char *utf8gadgets = ami_utf8_easy(messages_get("AbortShutdown"));
+
+ DisplayBeep(NULL);
+
+ res = TimedDosRequesterTags(TDR_ImageType, TDRIMAGE_INFO,
+ TDR_TitleString, messages_get("NetSurf"),
+ TDR_FormatString, utf8text,
+ TDR_GadgetString, utf8gadgets,
+ TDR_Timeout, 5,
+ TDR_Inactive, TRUE,
+ TAG_DONE);
+
+ free(utf8text);
+ free(utf8gadgets);
+#endif
+ if(res == -1) { /* Requester timed out */
+ nsoption_set_bool(tab_close_warn, false);
+ ami_quit_netsurf();
+ }
+}
+
void ami_gui_close_screen(struct Screen *scrn)
{
if(scrn == NULL) return;
@@ -2428,7 +2490,7 @@ void ami_update_buttons(struct gui_window_2 *gwin)
}
}
-void ami_gui_hotlist_scan_2(struct tree *tree, struct node *root, WORD *gen, uint16 *item,
+void ami_gui_hotlist_scan_2(struct tree *tree, struct node *root, WORD *gen, int *item,
struct List *speed_button_list, struct gui_window_2 *gwin)
{
struct node *tempnode;
@@ -2470,14 +2532,14 @@ int ami_gui_hotlist_scan(struct tree *tree, struct List *speed_button_list, stru
struct node *root = tree_node_get_child(tree_get_root(tree));
struct node *node;
struct node_element *element;
- static WORD gen = 0;
- static uint16 item = 0;
+ WORD gen = 0;
+ int item = 0;
for (node = root; node; node = tree_node_get_next(node))
{
element = tree_node_find_element(node, TREE_ELEMENT_TITLE, NULL);
if(!element) element = tree_node_find_element(node, TREE_ELEMENT_TITLE, NULL);
- if(element && (strcmp(tree_node_element_get_text(element), "Toolbar") == 0))
+ if(element && (strcmp(tree_node_element_get_text(element), messages_get("HotlistToolbar")) == 0))
{
ami_gui_hotlist_scan_2(tree, tree_node_get_child(node), &gen, &item, speed_button_list, gwin);
}
@@ -2488,6 +2550,13 @@ int ami_gui_hotlist_scan(struct tree *tree, struct List *speed_button_list, stru
void ami_gui_hotlist_toolbar_add(struct gui_window_2 *gwin)
{
+ struct TagItem attrs[2];
+
+ attrs[0].ti_Tag = CHILD_MinWidth;
+ attrs[0].ti_Data = 0;
+ attrs[1].ti_Tag = TAG_DONE;
+ attrs[1].ti_Data = 0;
+
NewList(&gwin->hotlist_toolbar_list);
if(ami_gui_hotlist_scan(ami_tree_get_tree(hotlist_window), &gwin->hotlist_toolbar_list, gwin) > 0) {
@@ -2495,17 +2564,118 @@ void ami_gui_hotlist_toolbar_add(struct gui_window_2 *gwin)
SpeedBarObject,
GA_ID, GID_HOTLIST,
GA_RelVerify, TRUE,
+ ICA_TARGET, ICTARGET_IDCMP,
+ SPEEDBAR_BevelStyle, BVS_NONE,
SPEEDBAR_Buttons, &gwin->hotlist_toolbar_list,
SpeedBarEnd;
+
+ gwin->objects[GID_HOTLISTSEPBAR] =
+ BevelObject,
+ BEVEL_Style, BVS_SBAR_VERT,
+ BevelEnd;
IDoMethod(gwin->objects[GID_HOTLISTLAYOUT], LM_ADDCHILD,
- gwin->win, gwin->objects[GID_HOTLIST], NULL);
+ gwin->win, gwin->objects[GID_HOTLIST], attrs);
+
+ IDoMethod(gwin->objects[GID_HOTLISTLAYOUT], LM_ADDIMAGE,
+ gwin->win, gwin->objects[GID_HOTLISTSEPBAR], NULL);
+
+ FlushLayoutDomainCache((struct Gadget *)gwin->objects[GID_MAIN]);
+
+ RethinkLayout((struct Gadget *)gwin->objects[GID_MAIN],
+ gwin->win, NULL, TRUE);
+
+ if(gwin->bw) {
+ gwin->redraw_required = true;
+ gwin->bw->reformat_pending = true;
+ }
}
+}
+
+void ami_gui_hotlist_toolbar_free(struct gui_window_2 *gwin, struct List *speed_button_list)
+{
+ int i;
+ struct Node *node;
+ struct Node *nnode;
+
+ if(IsListEmpty(speed_button_list)) return;
+ node = GetHead(speed_button_list);
+
+ do {
+ nnode = GetSucc(node);
+ Remove(node);
+ FreeSpeedButtonNode(node);
+ } while(node = nnode);
+
+ for(i = 0; i < AMI_GUI_TOOLBAR_MAX; i++) {
+ if(gwin->hotlist_toolbar_lab[i]) {
+ free(gwin->hotlist_toolbar_lab[i]);
+ gwin->hotlist_toolbar_lab[i] = NULL;
+ }
+ }
+}
+
+void ami_gui_hotlist_toolbar_remove(struct gui_window_2 *gwin)
+{
+ IDoMethod(gwin->objects[GID_HOTLISTLAYOUT], LM_REMOVECHILD,
+ gwin->win, gwin->objects[GID_HOTLIST]);
+
+ IDoMethod(gwin->objects[GID_HOTLISTLAYOUT], LM_REMOVECHILD,
+ gwin->win, gwin->objects[GID_HOTLISTSEPBAR]);
FlushLayoutDomainCache((struct Gadget *)gwin->objects[GID_MAIN]);
RethinkLayout((struct Gadget *)gwin->objects[GID_MAIN],
gwin->win, NULL, TRUE);
+
+ gwin->redraw_required = true;
+ gwin->bw->reformat_pending = true;
+}
+
+void ami_gui_hotlist_toolbar_update(struct gui_window_2 *gwin)
+{
+ if(IsListEmpty(&gwin->hotlist_toolbar_list)) {
+ ami_gui_hotlist_toolbar_add(gwin);
+ return;
+ }
+
+ /* Below should be SetAttr according to Autodocs */
+ SetGadgetAttrs((struct Gadget *)gwin->objects[GID_HOTLIST],
+ gwin->win, NULL,
+ SPEEDBAR_Buttons, ~0,
+ TAG_DONE);
+
+ ami_gui_hotlist_toolbar_free(gwin, &gwin->hotlist_toolbar_list);
+
+ if(ami_gui_hotlist_scan(ami_tree_get_tree(hotlist_window), &gwin->hotlist_toolbar_list, gwin) > 0) {
+ SetGadgetAttrs((struct Gadget *)gwin->objects[GID_HOTLIST],
+ gwin->win, NULL,
+ SPEEDBAR_Buttons, &gwin->hotlist_toolbar_list,
+ TAG_DONE);
+ } else {
+ ami_gui_hotlist_toolbar_remove(gwin);
+ }
+}
+
+void ami_gui_hotlist_toolbar_update_all(void)
+{
+ struct nsObject *node;
+ struct nsObject *nnode;
+ struct gui_window_2 *gwin;
+
+ if(IsMinListEmpty(window_list)) return;
+
+ node = (struct nsObject *)GetHead((struct List *)window_list);
+
+ do {
+ nnode=(struct nsObject *)GetSucc((struct Node *)node);
+ gwin = node->objstruct;
+
+ if(node->Type == AMINS_WINDOW)
+ {
+ ami_gui_hotlist_toolbar_update(gwin);
+ }
+ } while(node = nnode);
}
void ami_toggletabbar(struct gui_window_2 *gwin, bool show)
@@ -2561,8 +2731,37 @@ void ami_toggletabbar(struct gui_window_2 *gwin, bool show)
RethinkLayout((struct Gadget *)gwin->objects[GID_MAIN],
gwin->win, NULL, TRUE);
- gwin->redraw_required = true;
- gwin->bw->reformat_pending = true;
+ if(gwin->bw) {
+ gwin->redraw_required = true;
+ gwin->bw->reformat_pending = true;
+ }
+}
+
+void ami_gui_tabs_toggle_all(void)
+{
+ struct nsObject *node;
+ struct nsObject *nnode;
+ struct gui_window_2 *gwin;
+
+ if(IsMinListEmpty(window_list)) return;
+
+ node = (struct nsObject *)GetHead((struct List *)window_list);
+
+ do {
+ nnode=(struct nsObject *)GetSucc((struct Node *)node);
+ gwin = node->objstruct;
+
+ if(node->Type == AMINS_WINDOW)
+ {
+ if(gwin->tabs == 1) {
+ if(nsoption_bool(tab_always_show) == true) {
+ ami_toggletabbar(gwin, true);
+ } else {
+ ami_toggletabbar(gwin, false);
+ }
+ }
+ }
+ } while(node = nnode);
}
struct gui_window *gui_create_browser_window(struct browser_window *bw,
@@ -2613,7 +2812,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
g->shared = clone->window->shared;
g->tab = g->shared->next_tab;
- if(g->shared->tabs == 1)
+ if((g->shared->tabs == 1) && (nsoption_bool(tab_always_show) == false))
ami_toggletabbar(g->shared, true);
SetGadgetAttrs((struct Gadget *)g->shared->objects[GID_TABS],
@@ -2961,7 +3160,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
GA_HintInfo, g->shared->helphints[GID_SEARCHSTRING],
StringEnd,
LayoutEnd,
- CHILD_WeightedWidth, 0,
+ CHILD_WeightedWidth, nsoption_int(web_search_width),
LAYOUT_AddChild, g->shared->objects[GID_THROBBER] = SpaceObject,
GA_ID,GID_THROBBER,
SPACE_MinWidth,throbber_width,
@@ -2977,7 +3176,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
BEVEL_Style, BVS_SBAR_VERT,
BevelEnd,
CHILD_WeightedHeight, 0,
- LAYOUT_AddChild, g->shared->objects[GID_HOTLISTLAYOUT] = HGroupObject,
+ LAYOUT_AddChild, g->shared->objects[GID_HOTLISTLAYOUT] = VGroupObject,
LAYOUT_SpaceInner, FALSE,
LayoutEnd,
CHILD_WeightedHeight,0,
@@ -3128,6 +3327,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
g->shared->win, NULL);
ami_gui_hotlist_toolbar_add(g->shared); /* is this the right place for this? */
+ if(nsoption_bool(tab_always_show)) ami_toggletabbar(g->shared, true);
}
else
{
@@ -3207,7 +3407,15 @@ void ami_close_all_tabs(struct gui_window_2 *gwin)
{
struct Node *tab;
struct Node *ntab;
-
+
+ if((gwin->tabs > 1) && (nsoption_bool(tab_close_warn) == true)) {
+ char *req_body = ami_utf8_easy(messages_get("MultiTabClose"));
+ int32 res = ami_warn_user_multi(req_body, "Yes", "No", gwin->win);
+ free(req_body);
+
+ if(res == 0) return;
+ }
+
if(gwin->tabs)
{
tab = GetHead(&gwin->tab_list);
@@ -3281,7 +3489,7 @@ void gui_window_destroy(struct gui_window *g)
g->shared->tabs--;
ami_switch_tab(g->shared,true);
- if(g->shared->tabs == 1)
+ if((g->shared->tabs == 1) && (nsoption_bool(tab_always_show) == false))
ami_toggletabbar(g->shared, false);
ami_utf8_free(g->tabtitle);
@@ -3296,6 +3504,8 @@ void gui_window_destroy(struct gui_window *g)
ami_gui_appicon_remove(g->shared);
if(g->shared->appwin) RemoveAppWindow(g->shared->appwin);
+ ami_gui_hotlist_toolbar_free(g->shared, &g->shared->hotlist_toolbar_list);
+
/* These aren't freed by the above.
* TODO: nav_west etc need freeing too? */
DisposeObject(g->shared->objects[GID_ADDTAB_BM]);
@@ -4173,6 +4383,8 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg
struct gui_window_2 *gwin = hook->h_Data;
struct IntuiWheelData *wheel;
Object *reqrefresh = NULL;
+ struct Node *node = NULL;
+ char *url;
switch(msg->Class)
{
@@ -4189,6 +4401,18 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg
gwin->redraw_required = true;
break;
+
+ case GID_HOTLIST:
+ if(node = (struct Node *)GetTagData(SPEEDBAR_SelectedNode, 0, msg->IAddress)) {
+ GetSpeedButtonNodeAttrs(node, SBNA_UserData, (ULONG *)&url, TAG_DONE);
+
+ if(gwin->key_state & BROWSER_MOUSE_MOD_2) {
+ browser_window_create(url, gwin->bw, NULL, false, true);
+ } else {
+ browser_window_go(gwin->bw, url, NULL, true);
+ }
+ }
+ break;
}
break;
diff --git a/amiga/gui.h b/amiga/gui.h
index 59c60f4..1dff5d3 100755
--- a/amiga/gui.h
+++ b/amiga/gui.h
@@ -66,6 +66,7 @@ enum
GID_TOOLBARLAYOUT,
GID_HOTLIST,
GID_HOTLISTLAYOUT,
+ GID_HOTLISTSEPBAR,
GID_HSCROLL,
GID_LAST
};
@@ -152,6 +153,8 @@ int ami_key_to_nskey(ULONG keycode, struct InputEvent *ie);
bool ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *x, ULONG *y);
BOOL ami_gadget_hit(Object *obj, int x, int y);
void ami_gui_history(struct gui_window_2 *gwin, bool back);
+void ami_gui_hotlist_toolbar_update_all(void);
+void ami_gui_tabs_toggle_all(void);
struct TextFont *origrpfont;
struct MinList *window_list;
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index 27b3c63..66e47d8 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -85,6 +85,7 @@ enum
GID_OPTS_SCREEN,
GID_OPTS_SCREENMODE,
GID_OPTS_SCREENNAME,
+ GID_OPTS_WIN_SIMPLE,
GID_OPTS_THEME,
GID_OPTS_PTRTRUE,
GID_OPTS_PTROS,
@@ -98,6 +99,7 @@ enum
GID_OPTS_FETCHCACHE,
GID_OPTS_NATIVEBM,
GID_OPTS_SCALEQ,
+ GID_OPTS_DITHERQ,
GID_OPTS_ANIMSPEED,
GID_OPTS_ANIMDISABLE,
GID_OPTS_DPI_Y,
@@ -109,6 +111,7 @@ enum
GID_OPTS_FONT_DEFAULT,
GID_OPTS_FONT_SIZE,
GID_OPTS_FONT_MINSIZE,
+ GID_OPTS_FONT_ANTIALIASING,
GID_OPTS_CACHE_MEM,
GID_OPTS_CACHE_DISC,
GID_OPTS_OVERWRITE,
@@ -117,6 +120,8 @@ enum
GID_OPTS_TAB_ACTIVE,
GID_OPTS_TAB_2,
GID_OPTS_TAB_LAST,
+ GID_OPTS_TAB_ALWAYS,
+ GID_OPTS_TAB_CLOSE,
GID_OPTS_SEARCH_PROV,
GID_OPTS_CLIPBOARD,
GID_OPTS_CONTEXTMENU,
@@ -149,6 +154,7 @@ enum
GRP_OPTS_PRIVACY,
GRP_OPTS_MISC,
GRP_OPTS_SCREEN,
+ GRP_OPTS_WINDOW,
GRP_OPTS_THEME,
GRP_OPTS_MOUSE,
GRP_OPTS_PROXY,
@@ -186,10 +192,11 @@ enum
};
#define OPTS_LAST LAB_OPTS_LAST
-#define OPTS_MAX_TABS 9
+#define OPTS_MAX_TABS 10
#define OPTS_MAX_SCREEN 4
#define OPTS_MAX_PROXY 5
#define OPTS_MAX_NATIVEBM 3
+#define OPTS_MAX_DITHER 4
struct ami_gui_opts_window {
struct nsObject *node;
@@ -203,6 +210,7 @@ CONST_STRPTR tabs[OPTS_MAX_TABS];
static STRPTR screenopts[OPTS_MAX_SCREEN];
CONST_STRPTR proxyopts[OPTS_MAX_PROXY];
CONST_STRPTR nativebmopts[OPTS_MAX_NATIVEBM];
+CONST_STRPTR ditheropts[OPTS_MAX_DITHER];
CONST_STRPTR fontopts[6];
CONST_STRPTR gadlab[OPTS_LAST];
STRPTR *websearch_list;
@@ -218,12 +226,13 @@ void ami_gui_opts_setup(void)
tabs[3] = (char *)ami_utf8_easy((char *)messages_get("con_rendering"));
tabs[4] = (char *)ami_utf8_easy((char *)messages_get("con_fonts"));
tabs[5] = (char *)ami_utf8_easy((char *)messages_get("con_cache"));
- tabs[6] = (char *)ami_utf8_easy((char *)messages_get("con_advanced"));
+ tabs[6] = (char *)ami_utf8_easy((char *)messages_get("Tabs"));
+ tabs[7] = (char *)ami_utf8_easy((char *)messages_get("con_advanced"));
#ifdef WITH_PDF_EXPORT
- tabs[7] = (char *)ami_utf8_easy((char *)messages_get("Export"));
- tabs[8] = NULL;
+ tabs[8] = (char *)ami_utf8_easy((char *)messages_get("Export"));
+ tabs[9] = NULL;
#else
- tabs[7] = NULL;
+ tabs[8] = NULL;
#endif
screenopts[0] = (char *)ami_utf8_easy((char *)messages_get("ScreenOwn"));
@@ -242,6 +251,11 @@ void ami_gui_opts_setup(void)
nativebmopts[2] = (char *)ami_utf8_easy((char *)messages_get("All"));
nativebmopts[3] = NULL;
+ ditheropts[0] = (char *)ami_utf8_easy((char *)messages_get("Low"));
+ ditheropts[1] = (char *)ami_utf8_easy((char *)messages_get("Medium"));
+ ditheropts[2] = (char *)ami_utf8_easy((char *)messages_get("High"));
+ ditheropts[3] = NULL;
+
websearch_list = ami_gui_opts_websearch();
gadlab[GID_OPTS_HOMEPAGE] = (char *)ami_utf8_easy((char *)messages_get("HomePageURL"));
@@ -255,6 +269,7 @@ void ami_gui_opts_setup(void)
gadlab[GID_OPTS_REFERRAL] = (char *)ami_utf8_easy((char *)messages_get("SendReferer"));
gadlab[GID_OPTS_DONOTTRACK] = (char *)ami_utf8_easy((char *)messages_get("DoNotTrack"));
gadlab[GID_OPTS_FASTSCROLL] = (char *)ami_utf8_easy((char *)messages_get("FastScrolling"));
+ gadlab[GID_OPTS_WIN_SIMPLE] = (char *)ami_utf8_easy((char *)messages_get("SimpleRefresh"));
gadlab[GID_OPTS_PTRTRUE] = (char *)ami_utf8_easy((char *)messages_get("TrueColour"));
gadlab[GID_OPTS_PTROS] = (char *)ami_utf8_easy((char *)messages_get("OSPointers"));
gadlab[GID_OPTS_PROXY] = (char *)ami_utf8_easy((char *)messages_get("ProxyType"));
@@ -266,6 +281,7 @@ void ami_gui_opts_setup(void)
gadlab[GID_OPTS_FETCHCACHE] = (char *)ami_utf8_easy((char *)messages_get("FetchesCached"));
gadlab[GID_OPTS_NATIVEBM] = (char *)ami_utf8_easy((char *)messages_get("CacheNative"));
gadlab[GID_OPTS_SCALEQ] = (char *)ami_utf8_easy((char *)messages_get("ScaleQuality"));
+ gadlab[GID_OPTS_DITHERQ] = (char *)ami_utf8_easy((char *)messages_get("DitherQuality"));
gadlab[GID_OPTS_ANIMSPEED] = (char *)ami_utf8_easy((char *)messages_get("AnimSpeedLimit"));
gadlab[GID_OPTS_DPI_Y] = (char *)ami_utf8_easy((char *)messages_get("ResolutionY"));
gadlab[GID_OPTS_ANIMDISABLE] = (char *)ami_utf8_easy((char *)messages_get("AnimDisable"));
@@ -277,6 +293,7 @@ void ami_gui_opts_setup(void)
gadlab[GID_OPTS_FONT_DEFAULT] = (char *)ami_utf8_easy((char *)messages_get("Default"));
gadlab[GID_OPTS_FONT_SIZE] = (char *)ami_utf8_easy((char *)messages_get("Default"));
gadlab[GID_OPTS_FONT_MINSIZE] = (char *)ami_utf8_easy((char *)messages_get("Minimum"));
+ gadlab[GID_OPTS_FONT_ANTIALIASING] = (char *)ami_utf8_easy((char *)messages_get("FontAntialiasing"));
gadlab[GID_OPTS_CACHE_MEM] = (char *)ami_utf8_easy((char *)messages_get("Size"));
gadlab[GID_OPTS_CACHE_DISC] = (char *)ami_utf8_easy((char *)messages_get("Duration"));
gadlab[GID_OPTS_OVERWRITE] = (char *)ami_utf8_easy((char *)messages_get("ConfirmOverwrite"));
@@ -285,6 +302,8 @@ void ami_gui_opts_setup(void)
gadlab[GID_OPTS_TAB_ACTIVE] = (char *)ami_utf8_easy((char *)messages_get("TabActive"));
gadlab[GID_OPTS_TAB_2] = (char *)ami_utf8_easy((char *)messages_get("TabMiddle"));
gadlab[GID_OPTS_TAB_LAST] = (char *)ami_utf8_easy((char *)messages_get("TabLast"));
+ gadlab[GID_OPTS_TAB_ALWAYS] = (char *)ami_utf8_easy((char *)messages_get("TabAlways"));
+ gadlab[GID_OPTS_TAB_CLOSE] = (char *)ami_utf8_easy((char *)messages_get("TabClose"));
gadlab[GID_OPTS_SEARCH_PROV] = (char *)ami_utf8_easy((char *)messages_get("SearchProvider"));
gadlab[GID_OPTS_CLIPBOARD] = (char *)ami_utf8_easy((char *)messages_get("ClipboardUTF8"));
gadlab[GID_OPTS_CONTEXTMENU] = (char *)ami_utf8_easy((char *)messages_get("ContextMenu"));
@@ -321,6 +340,7 @@ void ami_gui_opts_setup(void)
gadlab[GRP_OPTS_SCRIPTING] = (char *)ami_utf8_easy((char *)messages_get("Scripting"));
gadlab[GRP_OPTS_MISC] = (char *)ami_utf8_easy((char *)messages_get("Miscellaneous"));
gadlab[GRP_OPTS_SCREEN] = (char *)ami_utf8_easy((char *)messages_get("Screen"));
+ gadlab[GRP_OPTS_WINDOW] = (char *)ami_utf8_easy((char *)messages_get("Window"));
gadlab[GRP_OPTS_THEME] = (char *)ami_utf8_easy((char *)messages_get("Theme"));
gadlab[GRP_OPTS_MOUSE] = (char *)ami_utf8_easy((char *)messages_get("MousePointers"));
gadlab[GRP_OPTS_PROXY] = (char *)ami_utf8_easy((char *)messages_get("Proxy"));
@@ -682,6 +702,18 @@ void ami_gui_opts_open(void)
LAYOUT_AddChild,VGroupObject,
LAYOUT_SpaceOuter, TRUE,
LAYOUT_BevelStyle, BVS_GROUP,
+ LAYOUT_Label, gadlab[GRP_OPTS_WINDOW],
+ LAYOUT_AddChild, gow->objects[GID_OPTS_WIN_SIMPLE] = CheckBoxObject,
+ GA_ID, GID_OPTS_WIN_SIMPLE,
+ GA_RelVerify, TRUE,
+ GA_Text, gadlab[GID_OPTS_WIN_SIMPLE],
+ GA_Selected, nsoption_bool(window_simple_refresh),
+ CheckBoxEnd,
+ LayoutEnd, // window
+ CHILD_WeightedHeight,0,
+ LAYOUT_AddChild,VGroupObject,
+ LAYOUT_SpaceOuter, TRUE,
+ LAYOUT_BevelStyle, BVS_GROUP,
LAYOUT_Label, gadlab[GRP_OPTS_THEME],
LAYOUT_AddChild, gow->objects[GID_OPTS_THEME] = GetFileObject,
GA_ID, GID_OPTS_THEME,
@@ -848,6 +880,16 @@ void ami_gui_opts_open(void)
CHILD_Label, LabelObject,
LABEL_Text, gadlab[GID_OPTS_NATIVEBM],
LabelEnd,
+ LAYOUT_AddChild, gow->objects[GID_OPTS_DITHERQ] = ChooserObject,
+ GA_ID, GID_OPTS_DITHERQ,
+ GA_RelVerify, TRUE,
+ CHOOSER_PopUp, TRUE,
+ CHOOSER_LabelArray, ditheropts,
+ CHOOSER_Selected, nsoption_int(dither_quality),
+ ChooserEnd,
+ CHILD_Label, LabelObject,
+ LABEL_Text, gadlab[GID_OPTS_DITHERQ],
+ LabelEnd,
LAYOUT_AddChild, gow->objects[GID_OPTS_SCALEQ] = CheckBoxObject,
GA_ID, GID_OPTS_SCALEQ,
GA_Disabled, scaledisabled,
@@ -986,46 +1028,59 @@ void ami_gui_opts_open(void)
LabelEnd,
LayoutEnd, // font faces
CHILD_WeightedHeight, 0,
- LAYOUT_AddChild,VGroupObject,
- LAYOUT_SpaceOuter, TRUE,
- LAYOUT_BevelStyle, BVS_GROUP,
- LAYOUT_Label, gadlab[GRP_OPTS_FONTSIZE],
- LAYOUT_AddChild, HGroupObject,
- LAYOUT_LabelColumn, PLACETEXT_RIGHT,
- LAYOUT_AddChild, gow->objects[GID_OPTS_FONT_SIZE] = IntegerObject,
- GA_ID, GID_OPTS_FONT_SIZE,
- GA_RelVerify, TRUE,
- INTEGER_Number, nsoption_int(font_size) / 10,
- INTEGER_Minimum, 1,
- INTEGER_Maximum, 99,
- INTEGER_Arrows, TRUE,
- IntegerEnd,
- CHILD_WeightedWidth, 0,
+ LAYOUT_AddChild, HGroupObject,
+ LAYOUT_AddChild,VGroupObject,
+ LAYOUT_SpaceOuter, TRUE,
+ LAYOUT_BevelStyle, BVS_GROUP,
+ LAYOUT_Label, gadlab[GRP_OPTS_FONTSIZE],
+ LAYOUT_AddChild, HGroupObject,
+ LAYOUT_LabelColumn, PLACETEXT_RIGHT,
+ LAYOUT_AddChild, gow->objects[GID_OPTS_FONT_SIZE] = IntegerObject,
+ GA_ID, GID_OPTS_FONT_SIZE,
+ GA_RelVerify, TRUE,
+ INTEGER_Number, nsoption_int(font_size) / 10,
+ INTEGER_Minimum, 1,
+ INTEGER_Maximum, 99,
+ INTEGER_Arrows, TRUE,
+ IntegerEnd,
+ CHILD_WeightedWidth, 0,
+ CHILD_Label, LabelObject,
+ LABEL_Text, gadlab[LAB_OPTS_PT],
+ LabelEnd,
+ LayoutEnd,
CHILD_Label, LabelObject,
- LABEL_Text, gadlab[LAB_OPTS_PT],
+ LABEL_Text, gadlab[GID_OPTS_FONT_SIZE],
LabelEnd,
- LayoutEnd,
- CHILD_Label, LabelObject,
- LABEL_Text, gadlab[GID_OPTS_FONT_SIZE],
- LabelEnd,
- LAYOUT_AddChild, HGroupObject,
- LAYOUT_LabelColumn, PLACETEXT_RIGHT,
- LAYOUT_AddChild, gow->objects[GID_OPTS_FONT_MINSIZE] = IntegerObject,
- GA_ID, GID_OPTS_FONT_MINSIZE,
- GA_RelVerify, TRUE,
- INTEGER_Number, nsoption_int(font_min_size) / 10,
- INTEGER_Minimum, 1,
- INTEGER_Maximum, 99,
- INTEGER_Arrows, TRUE,
- IntegerEnd,
- CHILD_WeightedWidth, 0,
+ LAYOUT_AddChild, HGroupObject,
+ LAYOUT_LabelColumn, PLACETEXT_RIGHT,
+ LAYOUT_AddChild, gow->objects[GID_OPTS_FONT_MINSIZE] = IntegerObject,
+ GA_ID, GID_OPTS_FONT_MINSIZE,
+ GA_RelVerify, TRUE,
+ INTEGER_Number, nsoption_int(font_min_size) / 10,
+ INTEGER_Minimum, 1,
+ INTEGER_Maximum, 99,
+ INTEGER_Arrows, TRUE,
+ IntegerEnd,
+ CHILD_WeightedWidth, 0,
+ CHILD_Label, LabelObject,
+ LABEL_Text, gadlab[LAB_OPTS_PT],
+ LabelEnd,
+ LayoutEnd,
CHILD_Label, LabelObject,
- LABEL_Text, gadlab[LAB_OPTS_PT],
+ LABEL_Text, gadlab[GID_OPTS_FONT_MINSIZE],
LabelEnd,
LayoutEnd,
- CHILD_Label, LabelObject,
- LABEL_Text, gadlab[GID_OPTS_FONT_MINSIZE],
- LabelEnd,
+ LAYOUT_AddChild,VGroupObject,
+ LAYOUT_SpaceOuter, TRUE,
+ LAYOUT_BevelStyle, BVS_GROUP,
+ LAYOUT_Label, gadlab[GRP_OPTS_MISC],
+ LAYOUT_AddChild, gow->objects[GID_OPTS_FONT_ANTIALIASING] = CheckBoxObject,
+ GA_ID, GID_OPTS_FONT_ANTIALIASING,
+ GA_RelVerify, TRUE,
+ GA_Text, gadlab[GID_OPTS_FONT_ANTIALIASING],
+ GA_Selected, nsoption_bool(font_antialiasing),
+ CheckBoxEnd,
+ LayoutEnd,
LayoutEnd,
CHILD_WeightedHeight, 0,
LayoutEnd, // page vgroup
@@ -1089,6 +1144,51 @@ void ami_gui_opts_open(void)
CHILD_WeightedHeight, 0,
PageEnd, // page object
/*
+ ** Tabs
+ */
+ PAGE_Add, LayoutObject,
+ LAYOUT_AddChild,VGroupObject,
+ LAYOUT_AddChild,HGroupObject,
+ LAYOUT_AddChild,VGroupObject,
+ LAYOUT_SpaceOuter, TRUE,
+ LAYOUT_BevelStyle, BVS_GROUP,
+ LAYOUT_Label, gadlab[GRP_OPTS_TABS],
+ LAYOUT_AddChild, gow->objects[GID_OPTS_TAB_ACTIVE] = CheckBoxObject,
+ GA_ID, GID_OPTS_TAB_ACTIVE,
+ GA_RelVerify, TRUE,
+ GA_Text, gadlab[GID_OPTS_TAB_ACTIVE],
+ GA_Selected, !nsoption_bool(new_tab_active),
+ CheckBoxEnd,
+ LAYOUT_AddChild, gow->objects[GID_OPTS_TAB_LAST] = CheckBoxObject,
+ GA_ID, GID_OPTS_TAB_LAST,
+ GA_RelVerify, TRUE,
+ GA_Text, gadlab[GID_OPTS_TAB_LAST],
+ GA_Selected, nsoption_bool(new_tab_last),
+ CheckBoxEnd,
+ LAYOUT_AddChild, gow->objects[GID_OPTS_TAB_2] = CheckBoxObject,
+ GA_ID, GID_OPTS_TAB_2,
+ GA_RelVerify, TRUE,
+ GA_Text, gadlab[GID_OPTS_TAB_2],
+ GA_Selected, nsoption_bool(button_2_tab),
+ CheckBoxEnd,
+ LAYOUT_AddChild, gow->objects[GID_OPTS_TAB_ALWAYS] = CheckBoxObject,
+ GA_ID, GID_OPTS_TAB_ALWAYS,
+ GA_RelVerify, TRUE,
+ GA_Text, gadlab[GID_OPTS_TAB_ALWAYS],
+ GA_Selected, nsoption_bool(tab_always_show),
+ CheckBoxEnd,
+ LAYOUT_AddChild, gow->objects[GID_OPTS_TAB_CLOSE] = CheckBoxObject,
+ GA_ID, GID_OPTS_TAB_CLOSE,
+ GA_RelVerify, TRUE,
+ GA_Text, gadlab[GID_OPTS_TAB_CLOSE],
+ GA_Selected, nsoption_bool(tab_close_warn),
+ CheckBoxEnd,
+ LayoutEnd, // tabbed browsing
+ LayoutEnd,
+ LayoutEnd, // page vgroup
+ CHILD_WeightedHeight, 0,
+ PageEnd, // page object
+ /*
** Advanced
*/
PAGE_Add, LayoutObject,
@@ -1127,29 +1227,6 @@ void ami_gui_opts_open(void)
LayoutEnd, // downloads
CHILD_WeightedHeight, 0,
LAYOUT_AddChild,HGroupObject,
- LAYOUT_AddChild,VGroupObject,
- LAYOUT_SpaceOuter, TRUE,
- LAYOUT_BevelStyle, BVS_GROUP,
- LAYOUT_Label, gadlab[GRP_OPTS_TABS],
- LAYOUT_AddChild, gow->objects[GID_OPTS_TAB_ACTIVE] = CheckBoxObject,
- GA_ID, GID_OPTS_TAB_ACTIVE,
- GA_RelVerify, TRUE,
- GA_Text, gadlab[GID_OPTS_TAB_ACTIVE],
- GA_Selected, !nsoption_bool(new_tab_active),
- CheckBoxEnd,
- LAYOUT_AddChild, gow->objects[GID_OPTS_TAB_LAST] = CheckBoxObject,
- GA_ID, GID_OPTS_TAB_LAST,
- GA_RelVerify, TRUE,
- GA_Text, gadlab[GID_OPTS_TAB_LAST],
- GA_Selected, nsoption_bool(new_tab_last),
- CheckBoxEnd,
- LAYOUT_AddChild, gow->objects[GID_OPTS_TAB_2] = CheckBoxObject,
- GA_ID, GID_OPTS_TAB_2,
- GA_RelVerify, TRUE,
- GA_Text, gadlab[GID_OPTS_TAB_2],
- GA_Selected, nsoption_bool(button_2_tab),
- CheckBoxEnd,
- LayoutEnd, // tabbed browsing
LAYOUT_AddChild, VGroupObject,
LAYOUT_SpaceOuter, TRUE,
@@ -1423,6 +1500,7 @@ void ami_gui_opts_use(bool save)
struct TextAttr *tattr;
char *dot;
bool rescan_fonts = false;
+ bool old_tab_always_show;
SetWindowPointer(gow->win,
WA_BusyPointer, TRUE,
@@ -1506,6 +1584,13 @@ void ami_gui_opts_use(bool save)
nsoption_set_charp(modeid, modeid);
}
+ GetAttr(GA_Selected,gow->objects[GID_OPTS_WIN_SIMPLE],(ULONG *)&data);
+ if (data) {
+ nsoption_set_bool(window_simple_refresh, true);
+ } else {
+ nsoption_set_bool(window_simple_refresh, false);
+ }
+
GetAttr(GETFILE_Drawer,gow->objects[GID_OPTS_THEME],(ULONG *)&data);
nsoption_set_charp(theme, (char *)strdup((char *)data));
@@ -1558,6 +1643,8 @@ void ami_gui_opts_use(bool save)
nsoption_set_bool(scale_quality, false);
}
+ GetAttr(CHOOSER_Selected,gow->objects[GID_OPTS_DITHERQ],(ULONG *)&nsoption_int(dither_quality));
+
GetAttr(STRINGA_TextVal,gow->objects[GID_OPTS_ANIMSPEED],(ULONG *)&data);
animspeed = strtof((char *)data, NULL);
nsoption_set_int(minimum_gif_delay, (int)(animspeed * 100));
@@ -1611,6 +1698,13 @@ void ami_gui_opts_use(bool save)
GetAttr(INTEGER_Number,gow->objects[GID_OPTS_FONT_MINSIZE],(ULONG *)&nsoption_int(font_min_size));
nsoption_set_int(font_min_size, nsoption_int(font_min_size) * 10);
+ GetAttr(GA_Selected, gow->objects[GID_OPTS_FONT_ANTIALIASING], (ULONG *)&data);
+ if(data) {
+ nsoption_set_bool(font_antialiasing, true);
+ } else {
+ nsoption_set_bool(font_antialiasing, false);
+ }
+
GetAttr(INTEGER_Number,gow->objects[GID_OPTS_CACHE_MEM],(ULONG *)&nsoption_int(memory_cache_size));
nsoption_set_int(memory_cache_size, nsoption_int(memory_cache_size) * 1048576);
@@ -1654,6 +1748,25 @@ void ami_gui_opts_use(bool save)
nsoption_set_bool(button_2_tab, false);
}
+ GetAttr(GA_Selected,gow->objects[GID_OPTS_TAB_CLOSE],(ULONG *)&data);
+ if (data) {
+ nsoption_set_bool(tab_close_warn, true);
+ } else {
+ nsoption_set_bool(tab_close_warn, false);
+ }
+
+ GetAttr(GA_Selected,gow->objects[GID_OPTS_TAB_ALWAYS],(ULONG *)&data);
+ old_tab_always_show = nsoption_bool(tab_always_show);
+
+ if (data) {
+ nsoption_set_bool(tab_always_show, true);
+ } else {
+ nsoption_set_bool(tab_always_show, false);
+ }
+
+ if(old_tab_always_show != nsoption_bool(tab_always_show))
+ ami_gui_tabs_toggle_all();
+
GetAttr(CHOOSER_Selected,gow->objects[GID_OPTS_SEARCH_PROV],(ULONG *)&nsoption_int(search_provider));
search_web_provider_details(nsoption_int(search_provider));
search_web_retrieve_ico(false);
@@ -1748,6 +1861,8 @@ void ami_gui_opts_use(bool save)
ami_font_savescanner(); /* just in case it has changed and been used only */
}
+ ami_menu_check_toggled = true;
+
SetWindowPointer(gow->win,
WA_Pointer, NULL,
TAG_DONE);
diff --git a/amiga/hotlist.c b/amiga/hotlist.c
index 6469cbd..c82b92f 100755
--- a/amiga/hotlist.c
+++ b/amiga/hotlist.c
@@ -18,8 +18,41 @@
#include <proto/exec.h>
#include "amiga/hotlist.h"
-#include "desktop/hotlist.h"
#include "amiga/tree.h"
+#include "desktop/hotlist.h"
+#include "utils/messages.h"
+
+bool ami_hotlist_find_dir(struct tree *tree, const char *dir_name)
+{
+ struct node *root = tree_node_get_child(tree_get_root(tree));
+ struct node *node;
+ struct node_element *element;
+
+ for (node = root; node; node = tree_node_get_next(node))
+ {
+ element = tree_node_find_element(node, TREE_ELEMENT_TITLE, NULL);
+ if(!element) element = tree_node_find_element(node, TREE_ELEMENT_TITLE, NULL);
+ if(element && (strcmp(tree_node_element_get_text(element), dir_name) == 0))
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void ami_hotlist_add_default_dirs(struct tree *tree)
+{
+ if(ami_hotlist_find_dir(tree, messages_get("HotlistMenu")) == false) {
+ tree_create_folder_node(tree, tree_get_root(tree),
+ messages_get("HotlistMenu"), true, true, false);
+ }
+
+ if(ami_hotlist_find_dir(tree, messages_get("HotlistToolbar")) == false) {
+ tree_create_folder_node(tree, tree_get_root(tree),
+ messages_get("HotlistToolbar"), true, true, false);
+ }
+}
void ami_hotlist_initialise(const char *hotlist_file)
{
@@ -30,6 +63,8 @@ void ami_hotlist_initialise(const char *hotlist_file)
hotlist_initialise(ami_tree_get_tree(hotlist_window),
hotlist_file,
tree_directory_icon_name);
+
+ ami_hotlist_add_default_dirs(ami_tree_get_tree(hotlist_window));
}
void ami_hotlist_free(const char *hotlist_file)
diff --git a/amiga/menu.c b/amiga/menu.c
index b116e1b..58a4d51 100755
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -103,6 +103,9 @@ static void ami_menu_item_browser_find(struct Hook *hook, APTR window, struct In
static void ami_menu_item_browser_localhistory(struct Hook *hook, APTR window, struct IntuiMessage *msg);
static void ami_menu_item_browser_globalhistory(struct Hook *hook, APTR window, struct IntuiMessage *msg);
static void ami_menu_item_browser_cookies(struct Hook *hook, APTR window, struct IntuiMessage *msg);
+static void ami_menu_item_browser_foreimg(struct Hook *hook, APTR window, struct IntuiMessage *msg);
+static void ami_menu_item_browser_backimg(struct Hook *hook, APTR window, struct IntuiMessage *msg);
+static void ami_menu_item_browser_enablejs(struct Hook *hook, APTR window, struct IntuiMessage *msg);
static void ami_menu_item_browser_scale_decrease(struct Hook *hook, APTR window, struct IntuiMessage *msg);
static void ami_menu_item_browser_scale_normal(struct Hook *hook, APTR window, struct IntuiMessage *msg);
static void ami_menu_item_browser_scale_increase(struct Hook *hook, APTR window, struct IntuiMessage *msg);
@@ -325,25 +328,44 @@ void ami_init_menulabs(struct gui_window_2 *gwin)
gwin->menu_hook[37].h_Entry = (HOOKFUNC)ami_menu_item_browser_scale_increase;
gwin->menutype[38] = NM_ITEM;
- gwin->menulab[38] = ami_utf8_easy((char *)messages_get("Redraw"));
- gwin->menu_hook[38].h_Entry = (HOOKFUNC)ami_menu_item_browser_redraw;
-
- gwin->menutype[39] = NM_TITLE;
- gwin->menulab[39] = ami_utf8_easy((char *)messages_get("Hotlist"));
-
- gwin->menutype[40] = NM_ITEM;
- gwin->menulab[40] = ami_utf8_easy((char *)messages_get("HotlistAdd"));
- gwin->menukey[40] = 'B';
- gwin->menu_hook[40].h_Entry = (HOOKFUNC)ami_menu_item_hotlist_add;
-
+ gwin->menulab[38] = ami_utf8_easy((char *)messages_get("Images"));
+
+ gwin->menutype[39] = NM_SUB;
+ gwin->menulab[39] = ami_utf8_easy((char *)messages_get("ForeImg"));
+ gwin->menu_hook[39].h_Entry = (HOOKFUNC)ami_menu_item_browser_foreimg;
+
+ gwin->menutype[40] = NM_SUB;
+ gwin->menulab[40] = ami_utf8_easy((char *)messages_get("BackImg"));
+ gwin->menu_hook[40].h_Entry = (HOOKFUNC)ami_menu_item_browser_backimg;
+
gwin->menutype[41] = NM_ITEM;
- gwin->menulab[41] = ami_utf8_easy((char *)messages_get("HotlistShowNS"));
- gwin->menukey[41] = 'H';
- gwin->menu_hook[41].h_Entry = (HOOKFUNC)ami_menu_item_hotlist_show;
+ gwin->menulab[41] = ami_utf8_easy((char *)messages_get("EnableJS"));
+ gwin->menu_hook[41].h_Entry = (HOOKFUNC)ami_menu_item_browser_enablejs;
+ gwin->menukey[41] = 'J';
gwin->menutype[42] = NM_ITEM;
gwin->menulab[42] = NM_BARLABEL;
+ gwin->menutype[43] = NM_ITEM;
+ gwin->menulab[43] = ami_utf8_easy((char *)messages_get("Redraw"));
+ gwin->menu_hook[43].h_Entry = (HOOKFUNC)ami_menu_item_browser_redraw;
+
+ gwin->menutype[44] = NM_TITLE;
+ gwin->menulab[44] = ami_utf8_easy((char *)messages_get("Hotlist"));
+
+ gwin->menutype[45] = NM_ITEM;
+ gwin->menulab[45] = ami_utf8_easy((char *)messages_get("HotlistAdd"));
+ gwin->menukey[45] = 'B';
+ gwin->menu_hook[45].h_Entry = (HOOKFUNC)ami_menu_item_hotlist_add;
+
+ gwin->menutype[46] = NM_ITEM;
+ gwin->menulab[46] = ami_utf8_easy((char *)messages_get("HotlistShowNS"));
+ gwin->menukey[46] = 'H';
+ gwin->menu_hook[46].h_Entry = (HOOKFUNC)ami_menu_item_hotlist_show;
+
+ gwin->menutype[47] = NM_ITEM;
+ gwin->menulab[47] = NM_BARLABEL;
+
gwin->menutype[AMI_MENU_HOTLIST_MAX + 1] = NM_TITLE;
gwin->menulab[AMI_MENU_HOTLIST_MAX + 1] = ami_utf8_easy((char *)messages_get("Settings"));
@@ -415,9 +437,23 @@ struct NewMenu *ami_create_menu(struct gui_window_2 *gwin)
#ifndef WITH_PDF_EXPORT
gwin->menu[9].nm_Flags = NM_ITEMDISABLED;
#endif
+#if !defined(WITH_JS) && !defined(WITH_MOZJS)
+ gwin->menu[41].nm_Flags = NM_ITEMDISABLED | CHECKIT | MENUTOGGLE;
+#else
+ gwin->menu[41].nm_Flags = CHECKIT | MENUTOGGLE;
+ if(nsoption_bool(enable_javascript) == true)
+ gwin->menu[41].nm_Flags |= CHECKED;
+#endif
gwin->menu[15].nm_Flags = NM_ITEMDISABLED;
+ gwin->menu[39].nm_Flags = CHECKIT | MENUTOGGLE;
+ if(nsoption_bool(foreground_images) == true)
+ gwin->menu[39].nm_Flags |= CHECKED;
+ gwin->menu[40].nm_Flags = CHECKIT | MENUTOGGLE;
+ if(nsoption_bool(background_images) == true)
+ gwin->menu[40].nm_Flags |= CHECKED;
+
ami_menu_scan(ami_tree_get_tree(hotlist_window), false, gwin);
ami_menu_arexx_scan(gwin);
@@ -497,8 +533,8 @@ ULONG ami_menu_scan(struct tree *tree, bool count, struct gui_window_2 *gwin)
struct node *root = tree_node_get_child(tree_get_root(tree));
struct node *node;
struct node_element *element;
- static WORD gen = 0;
- static ULONG item;
+ WORD gen = 0;
+ ULONG item;
item = AMI_MENU_HOTLIST;
@@ -506,17 +542,17 @@ ULONG ami_menu_scan(struct tree *tree, bool count, struct gui_window_2 *gwin)
{
element = tree_node_find_element(node, TREE_ELEMENT_TITLE, NULL);
if(!element) element = tree_node_find_element(node, TREE_ELEMENT_TITLE, NULL);
- if(element && (strcmp(tree_node_element_get_text(element),"Menu")==0))
+ if(element && (strcmp(tree_node_element_get_text(element), messages_get("HotlistMenu")) == 0))
{
// found menu
- ami_menu_scan_2(tree,tree_node_get_child(node),&gen,&item,count,gwin);
+ ami_menu_scan_2(tree, tree_node_get_child(node), &gen, &item, count, gwin);
}
}
return(item - AMI_MENU_HOTLIST);
}
-void ami_menu_scan_2(struct tree *tree,struct node *root,WORD *gen,
+void ami_menu_scan_2(struct tree *tree, struct node *root, WORD *gen,
ULONG *item, bool count, struct gui_window_2 *gwin)
{
struct node *tempnode;
@@ -565,6 +601,40 @@ void ami_menu_scan_2(struct tree *tree,struct node *root,WORD *gen,
*gen = *gen - 1;
}
+void ami_menu_update_checked(struct gui_window_2 *gwin)
+{
+ struct Menu *menustrip;
+
+ GetAttr(WINDOW_MenuStrip, gwin->objects[OID_MAIN], (ULONG *)&menustrip);
+ if(!menustrip) return;
+
+ if(nsoption_bool(enable_javascript) == true) {
+ if((ItemAddress(menustrip, AMI_MENU_JS)->Flags & CHECKED) == 0)
+ ItemAddress(menustrip, AMI_MENU_JS)->Flags ^= CHECKED;
+ } else {
+ if(ItemAddress(menustrip, AMI_MENU_JS)->Flags & CHECKED)
+ ItemAddress(menustrip, AMI_MENU_JS)->Flags ^= CHECKED;
+ }
+
+ if(nsoption_bool(foreground_images) == true) {
+ if((ItemAddress(menustrip, AMI_MENU_FOREIMG)->Flags & CHECKED) == 0)
+ ItemAddress(menustrip, AMI_MENU_FOREIMG)->Flags ^= CHECKED;
+ } else {
+ if(ItemAddress(menustrip, AMI_MENU_FOREIMG)->Flags & CHECKED)
+ ItemAddress(menustrip, AMI_MENU_FOREIMG)->Flags ^= CHECKED;
+ }
+
+ if(nsoption_bool(background_images) == true) {
+ if((ItemAddress(menustrip, AMI_MENU_BACKIMG)->Flags & CHECKED) == 0)
+ ItemAddress(menustrip, AMI_MENU_BACKIMG)->Flags ^= CHECKED;
+ } else {
+ if(ItemAddress(menustrip, AMI_MENU_BACKIMG)->Flags & CHECKED)
+ ItemAddress(menustrip, AMI_MENU_BACKIMG)->Flags ^= CHECKED;
+ }
+
+ ResetMenuStrip(gwin->win, menustrip);
+}
+
void ami_menu_update_disabled(struct gui_window *g, hlcache_handle *c)
{
struct Window *win = g->shared->win;
@@ -824,6 +894,42 @@ static void ami_menu_item_browser_cookies(struct Hook *hook, APTR window, struct
ami_tree_open(cookies_window,AMI_TREE_COOKIES);
}
+static void ami_menu_item_browser_foreimg(struct Hook *hook, APTR window, struct IntuiMessage *msg)
+{
+ struct Menu *menustrip;
+ bool checked = false;
+
+ GetAttr(WINDOW_MenuStrip, (Object *)window, (ULONG *)&menustrip);
+ if(ItemAddress(menustrip, msg->Code)->Flags & CHECKED) checked = true;
+
+ nsoption_set_bool(foreground_images, checked);
+ ami_menu_check_toggled = true;
+}
+
+static void ami_menu_item_browser_backimg(struct Hook *hook, APTR window, struct IntuiMessage *msg)
+{
+ struct Menu *menustrip;
+ bool checked = false;
+
+ GetAttr(WINDOW_MenuStrip, (Object *)window, (ULONG *)&menustrip);
+ if(ItemAddress(menustrip, msg->Code)->Flags & CHECKED) checked = true;
+
+ nsoption_set_bool(background_images, checked);
+ ami_menu_check_toggled = true;
+}
+
+static void ami_menu_item_browser_enablejs(struct Hook *hook, APTR window, struct IntuiMessage *msg)
+{
+ struct Menu *menustrip;
+ bool checked = false;
+
+ GetAttr(WINDOW_MenuStrip, (Object *)window, (ULONG *)&menustrip);
+ if(ItemAddress(menustrip, msg->Code)->Flags & CHECKED) checked = true;
+
+ nsoption_set_bool(enable_javascript, checked);
+ ami_menu_check_toggled = true;
+}
+
static void ami_menu_item_browser_scale_decrease(struct Hook *hook, APTR window, struct IntuiMessage *msg)
{
struct gui_window_2 *gwin;
diff --git a/amiga/menu.h b/amiga/menu.h
index d692320..8cff2d5 100755
--- a/amiga/menu.h
+++ b/amiga/menu.h
@@ -30,10 +30,10 @@
/* Maximum number of menu items - first value is number of static items
* (ie. everything not intially defined as NM_IGNORE) */
-#define AMI_MENU_MAX 52 + AMI_HOTLIST_ITEMS
+#define AMI_MENU_MAX 57 + AMI_HOTLIST_ITEMS
/* Where the hotlist entries start */
-#define AMI_MENU_HOTLIST 43
+#define AMI_MENU_HOTLIST 48
/* Where the hotlist entries end */
#define AMI_MENU_HOTLIST_MAX AMI_MENU_HOTLIST+AMI_HOTLIST_ITEMS
@@ -62,17 +62,22 @@
#define AMI_MENU_SELECTALL FULLMENUNUM(1,4,0)
#define AMI_MENU_CLEAR FULLMENUNUM(1,5,0)
#define AMI_MENU_FIND FULLMENUNUM(2,0,0)
+#define AMI_MENU_FOREIMG FULLMENUNUM(2,8,0)
+#define AMI_MENU_BACKIMG FULLMENUNUM(2,8,1)
+#define AMI_MENU_JS FULLMENUNUM(2,9,0)
/* A special value for ami_menu_window_close */
-#define AMI_MENU_WINDOW_CLOSE_ALL 1
+#define AMI_MENU_WINDOW_CLOSE_ALL (void *)1
struct gui_window;
struct gui_window_2;
struct gui_window_2 *ami_menu_window_close;
+bool ami_menu_check_toggled;
void ami_free_menulabs(struct gui_window_2 *gwin);
struct NewMenu *ami_create_menu(struct gui_window_2 *gwin);
void ami_menu_refresh(struct gui_window_2 *gwin);
+void ami_menu_update_checked(struct gui_window_2 *gwin);
void ami_menu_update_disabled(struct gui_window *g, hlcache_handle *c);
#endif
diff --git a/amiga/misc.c b/amiga/misc.c
index 8e8fa76..4359c79 100755
--- a/amiga/misc.c
+++ b/amiga/misc.c
@@ -71,6 +71,29 @@ void warn_user(const char *warning, const char *detail)
if(utf8warning) free(utf8warning);
}
+int32 ami_warn_user_multi(const char *body, const char *opt1, const char *opt2, struct Window *win)
+{
+ int res = 0;
+ char *utf8text = ami_utf8_easy(body);
+ char *utf8gadget1 = ami_utf8_easy(messages_get(opt1));
+ char *utf8gadget2 = ami_utf8_easy(messages_get(opt2));
+ char *utf8gadgets = ASPrintf("%s|%s", utf8gadget1, utf8gadget2);
+ free(utf8gadget1);
+ free(utf8gadget2);
+
+ res = TimedDosRequesterTags(TDR_ImageType, TDRIMAGE_WARNING,
+ TDR_TitleString, messages_get("NetSurf"),
+ TDR_FormatString, utf8text,
+ TDR_GadgetString, utf8gadgets,
+ TDR_Window, win,
+ TAG_DONE);
+
+ if(utf8text) free(utf8text);
+ if(utf8gadgets) FreeVec(utf8gadgets);
+
+ return res;
+}
+
void die(const char *error)
{
TimedDosRequesterTags(TDR_ImageType,TDRIMAGE_ERROR,
diff --git a/amiga/misc.h b/amiga/misc.h
index c863c79..34a85fa 100644
--- a/amiga/misc.h
+++ b/amiga/misc.h
@@ -19,4 +19,5 @@
#ifndef AMIGA_MISC_H
#define AMIGA_MISC_H
char *translate_escape_chars(const char *s);
+int32 ami_warn_user_multi(const char *body, const char *opt1, const char *opt2, struct Window *win);
#endif
diff --git a/amiga/options.h b/amiga/options.h
index 5e47778..dc0274d 100644
--- a/amiga/options.h
+++ b/amiga/options.h
@@ -39,6 +39,8 @@
bool use_openurl_lib; \
bool new_tab_active; \
bool new_tab_last; \
+ bool tab_close_warn; \
+ bool tab_always_show; \
bool kiosk_mode; \
char *search_engines_file; \
char *arexx_dir; \
@@ -74,6 +76,7 @@
int cookies_window_ypos; \
int cookies_window_xsize; \
int cookies_window_ysize; \
+ int web_search_width; \
int cairo_renderer; \
bool direct_render; \
bool window_simple_refresh; \
@@ -101,6 +104,8 @@
.use_openurl_lib = false, \
.new_tab_active = false, \
.new_tab_last = false, \
+ .tab_close_warn = true, \
+ .tab_always_show = false, \
.kiosk_mode = false, \
.search_engines_file = NULL, \
.arexx_dir = NULL, \
@@ -136,6 +141,7 @@
.cookies_window_ypos = 0, \
.cookies_window_xsize = 0, \
.cookies_window_ysize = 0, \
+ .web_search_width = 0, \
.cairo_renderer = 0, \
.direct_render = false, \
.window_simple_refresh = false, \
@@ -162,6 +168,8 @@
{ "use_openurl_lib", OPTION_BOOL, &nsoptions.use_openurl_lib}, \
{ "new_tab_is_active", OPTION_BOOL, &nsoptions.new_tab_active}, \
{ "new_tab_last", OPTION_BOOL, &nsoptions.new_tab_last}, \
+{ "tab_close_warn", OPTION_BOOL, &nsoptions.tab_close_warn}, \
+{ "tab_always_show", OPTION_BOOL, &nsoptions.tab_always_show}, \
{ "kiosk_mode", OPTION_BOOL, &nsoptions.kiosk_mode}, \
{ "search_engines_file",OPTION_STRING, &nsoptions.search_engines_file }, \
{ "arexx_dir", OPTION_STRING, &nsoptions.arexx_dir }, \
@@ -197,6 +205,7 @@
{ "cookies_window_ypos", OPTION_INTEGER, &nsoptions.cookies_window_ypos}, \
{ "cookies_window_xsize", OPTION_INTEGER, &nsoptions.cookies_window_xsize}, \
{ "cookies_window_ysize", OPTION_INTEGER, &nsoptions.cookies_window_ysize}, \
+{ "web_search_width", OPTION_INTEGER, &nsoptions.web_search_width}, \
{ "cairo_renderer", OPTION_INTEGER, &nsoptions.cairo_renderer}, \
{ "direct_render", OPTION_BOOL, &nsoptions.direct_render}, \
{ "window_simple_refresh", OPTION_BOOL, &nsoptions.window_simple_refresh}, \
diff --git a/amiga/tree.c b/amiga/tree.c
index f2ef3cc..95a68dc 100755
--- a/amiga/tree.c
+++ b/amiga/tree.c
@@ -690,6 +690,8 @@ void ami_tree_close(struct treeview_window *twin)
ami_utf8_free(twin->sslreject);
ami_ssl_free(twin);
}
+
+ ami_gui_hotlist_toolbar_update_all();
}
void ami_tree_update_quals(struct treeview_window *twin)
diff --git a/atari/Makefile.defaults b/atari/Makefile.defaults
new file mode 100644
index 0000000..155ba8d
--- /dev/null
+++ b/atari/Makefile.defaults
@@ -0,0 +1,52 @@
+# ----------------------------------------------------------------------------
+# Atari-specific options
+# ----------------------------------------------------------------------------
+
+ # Force using glibc internal iconv implementation instead of external libiconv
+ # Valid options: YES, NO
+ NETSURF_USE_LIBICONV_PLUG := NO
+
+ # Enable NetSurf's use of librosprite for displaying RISC OS Sprites
+ # Valid options: YES, NO, AUTO
+ NETSURF_USE_ROSPRITE := NO
+
+ # Enable NetSurf's use of libwebp for displaying WebPs
+ # Valid options: YES, NO
+ NETSURF_USE_WEBP := NO
+
+ # Enable NetSurf's use of librsvg in conjunction with Cairo to display SVGs
+ # Valid options: YES, NO, AUTO
+ NETSURF_USE_RSVG := AUTO
+
+ # Enable NetSurf's use of libsvgtiny for displaying SVGs
+ # Valid options: YES, NO, AUTO
+ NETSURF_USE_NSSVG := AUTO
+
+ NETSURF_USE_MNG := NO
+
+ # enable true type fonts via freetype2
+ # Valid options: YES, NO
+ NETSURF_USE_ATARI_FREETYPE_FONT := YES
+
+ # Enable use of netsurf embedded font
+ # Valid options: YES, NO
+ NETSURF_USE_ATARI_NETSURF_FONT := YES
+
+ # Configure support for screen drivers with no true colour mode
+ # Valid options: YES, NO
+ NETSURF_USE_ATARI_8BPP_SUPPORT := NO
+
+ # Configure the CPU target
+ # Valid options: 68000, 68020-60, 5475 (coldfire)
+ ATARI_ARCH = 68020-60
+
+ # enable optimizations
+ # -O2 is currently broken with m68000 / m68020-60 builds
+ CFLAGS += -O3
+
+ # override warning flags removing -Wall
+ WARNFLAGS = -W -Wundef -Wpointer-arith \
+ -Wcast-align -Wwrite-strings -Wstrict-prototypes \
+ -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \
+ -Wnested-externs -Wuninitialized -Wl,-t
+
diff --git a/atari/Makefile.target b/atari/Makefile.target
index 616fa5a..275eb56 100644
--- a/atari/Makefile.target
+++ b/atari/Makefile.target
@@ -55,8 +55,8 @@ NETSURF_USE_JS:=YES
NETSURF_USE_MOZJS:=YES
endif
-$(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
-$(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
+$(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 \
-D_BSD_SOURCE \
@@ -73,12 +73,14 @@ LDFLAGS += -L$(GCCSDK_INSTALL_ENV)/lib
# S_ATARI are sources purely for the Atari FreeMiNT build
-S_ATARI := gui.c \
+S_ATARI := \
+ bitmap.c \
+ caret.c \
findfile.c \
filetype.c \
font.c \
+ gui.c \
misc.c \
- bitmap.c \
schedule.c \
download.c \
thumbnail.c \
@@ -104,10 +106,11 @@ S_ATARI := gui.c \
plot/eddi.s \
plot/font_freetype.c \
plot/font_internal.c \
- gemtk/utils.c \
+ gemtk/aestabs.c \
gemtk/dragdrop.c \
+ gemtk/guiwin.c \
gemtk/msgbox.c \
- gemtk/guiwin.c
+ gemtk/utils.c
S_ATARI := $(addprefix atari/,$(S_ATARI))
diff --git a/atari/Makefile.target.orig b/atari/Makefile.target.orig
new file mode 100644
index 0000000..25951b9
--- /dev/null
+++ b/atari/Makefile.target.orig
@@ -0,0 +1,120 @@
+# ----------------------------------------------------------------------------
+# Atari target setup
+# ----------------------------------------------------------------------------
+
+ifeq ($(ATARI_ARCH),68000)
+PRGSUFFIX := 000.app
+PKGNAME := ns000.zip
+endif
+
+ifeq ($(ATARI_ARCH),68020-60)
+CFLAGS += -m68020-60
+LDFLAGS += -m68020-60
+PRGSUFFIX := 020.app
+PKGNAME := ns020.zip
+endif
+
+ifeq ($(ATARI_ARCH),5475)
+CFLAGS += -mcpu=5475
+LDFLAGS += -mcpu=5475
+PRGSUFFIX := v4e.app
+PKGNAME := nsv4e.zip
+endif
+
+# non-pkgconfig components
+
+FREETYPE_FONT_CFLAGS := $(shell freetype-config --cflags) -DWITH_FREETYPE_FONT_DRIVER
+SPIDERMONKEY_CFLAGS := -DWITH_MOZJS -DXP_UNIX -DJS_HAS_FILE_OBJECT=0 -DJSOPTION_JIT=0 -DPOSIX_SOURCE -D_BSD_SOURCE
+
+$(eval $(call feature_enabled,MNG,-DWITH_MNG,-lmng,PNG/MNG/JNG (libmng)))
+$(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng)))
+$(eval $(call feature_enabled,MOZJS,$(SPIDERMONKEY_CFLAGS),-ljs,JavaScript (Spidermonkey)))
+$(eval $(call feature_enabled,ATARI_FREETYPE_FONT,$(FREETYPE_FONT_CFLAGS),-lfreetype,(Freetype)))
+$(eval $(call feature_enabled,ATARI_NETSURF_FONT,-DWITH_INTERNAL_FONT_DRIVER,,(Internal Font)))
+$(eval $(call feature_enabled,ATARI_8BPP_SUPPORT,-DWITH_8BPP_SUPPORT,,(Indexed screen format support)))
+
+# define additional CFLAGS and LDFLAGS requirements for pkg-configed libs here
+NETSURF_FEATURE_RSVG_CFLAGS := -DWITH_RSVG
+NETSURF_FEATURE_HUBBUB_CFLAGS := -DWITH_HUBBUB
+NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
+NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
+NETSURF_FEATURE_JS_CFLAGS := -DWITH_JS -DJS_HAS_FILE_OBJECT=0
+NETSURF_FEATURE_MOZJS_CFLAGS := -DWITH_MOZJS -DJS_HAS_FILE_OBJECT=0
+
+ifeq ($(NETSURF_USE_MOZJS),YES)
+NETSURF_USE_JS:=YES
+NETSURF_USE_MOZJS:=YES
+endif
+
+$(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
+$(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
+
+CFLAGS += -U__STRICT_ANSI__ -std=c99 -I. -Dsmall $(WARNFLAGS) -Dnsatari \
+ -D_BSD_SOURCE \
+ -D_XOPEN_SOURCE=600 \
+ -D_POSIX_C_SOURCE=200112L \
+ $(shell $(PKG_CONFIG) --cflags libhubbub libcss openssl ) \
+ $(shell $(PKG_CONFIG) --cflags libxml-2.0 ) \
+ $(shell $(PKG_CONFIG) --cflags libcurl )
+
+LDFLAGS += -lcflib -lcurl
+LDFLAGS += -lcss -lparserutils -ldom -lwapcaplet -lhubbub
+LDFLAGS += -lssl -lcrypto
+LDFLAGS += -lxml2 -lz -liconv -lcares -lHermes -lwindom -lgem -lm
+LDFLAGS += -L$(GCCSDK_INSTALL_ENV)/lib
+
+
+# S_ATARI are sources purely for the Atari FreeMiNT build
+S_ATARI := gui.c findfile.c filetype.c misc.c bitmap.c schedule.c \
+ download.c thumbnail.c login.c verify_ssl.c treeview.c hotlist.c history.c\
+ search.c font.c \
+ plot/plot.c plot/fontplot.c plot/eddi.s \
+ plot/font_freetype.c plot/font_internal.c \
+ redrawslots.c encoding.c \
+ browser_win.c toolbar.c statusbar.c browser.c \
+ global_evnt.c osspec.c dragdrop.c system_colour.c \
+ ctxmenu.c save.c settings.c
+S_ATARI := $(addprefix atari/,$(S_ATARI))
+
+# This is the final source build list
+# Note this is deliberately *not* expanded here as common and image
+# are not yet available
+SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_ATARI)
+EXETARGET := ns$(SUBTARGET)$(PRGSUFFIX)
+
+# ----------------------------------------------------------------------------
+# Install target
+# ----------------------------------------------------------------------------
+
+<<<<<<< Updated upstream
+install-atari:
+
+# ----------------------------------------------------------------------------
+# Package target
+# ----------------------------------------------------------------------------
+
+package-atari:
+=======
+ATARI_INSTALL_TARGET_DIR := nsatari.package
+ATARI_RES_DIR := atari/res
+
+install-atari: $(PKGNAME)
+ $(VQ)echo Creating $(PKGNAME)
+
+$(PKGNAME): $(EXETARGET)
+ $(Q)rm -rf $(ATARI_INSTALL_TARGET_DIR)
+ $(Q)mkdir $(ATARI_INSTALL_TARGET_DIR)/
+ $(Q)mkdir $(ATARI_INSTALL_TARGET_DIR)/netsurf
+ $(Q)mkdir $(ATARI_INSTALL_TARGET_DIR)/netsurf/doc
+ $(Q)mkdir $(ATARI_INSTALL_TARGET_DIR)/netsurf/download
+ $(Q)mkdir $(ATARI_INSTALL_TARGET_DIR)/netsurf/res
+ $(Q)mkdir $(ATARI_INSTALL_TARGET_DIR)/netsurf/res/fonts
+ #$(Q)mkdir $(ATARI_INSTALL_TARGET_DIR)/netsurf/res/icons
+ $(Q)touch $(ATARI_INSTALL_TARGET_DIR)/netsurf/res/cookies
+ $(Q)cp $(ATARI_RES_DIR)/netsurf.rsc $(ATARI_INSTALL_TARGET_DIR)/netsurf/res/netsurf.rsc
+ $(Q)cp $(ATARI_RES_DIR)/icons/ $(ATARI_INSTALL_TARGET_DIR)/netsurf/res/icons/ -R
+
+
+ $(Q)cp $(EXETARGET) $(ATARI_INSTALL_TARGET_DIR)/netsurf
+
+>>>>>>> Stashed changes
diff --git a/atari/browser.c b/atari/browser.c
index 83fcb43..ec2a64d 100755
--- a/atari/browser.c
+++ b/atari/browser.c
@@ -43,7 +43,6 @@
#include "css/css.h"
#include "utils/log.h"
#include "utils/messages.h"
-
#include "atari/gui.h"
#include "atari/rootwin.h"
#include "atari/misc.h"
@@ -273,9 +272,9 @@ static void __CDECL browser_evnt_mbutton( COMPONENT * c, short buff[8], void * d
rel_cur_x, rel_cur_y);
}
}
- if( browser_redraw_required( gw ) ){
- browser_redraw( gw );
- }
+ //if( browser_redraw_required( gw ) ){
+ //browser_redraw( gw );
+ //}
graf_mkstate(&rel_cur_x, &rel_cur_y, &mbut, &dummy);
rel_cur_x = (rel_cur_x - cwork.g_x) + gw->browser->scroll.current.x;
rel_cur_y = (rel_cur_y - cwork.g_y) + gw->browser->scroll.current.y;
@@ -478,9 +477,9 @@ static void browser_process_scroll( struct gui_window * gw, GRECT bwrect )
}
b->scroll.requested.y = 0;
b->scroll.requested.x = 0;
- if( b->caret.requested.g_w > 0 ){
- b->caret.redraw = true;
- }
+// if( b->caret.requested.g_w > 0 ){
+// b->caret.redraw = true;
+// }
// TODO: implement new sliding
//gw->root->handle->xpos = b->scroll.current.x;
@@ -557,23 +556,23 @@ bool browser_input( struct gui_window * gw, unsigned short nkc )
}
/* determines if a browser window needs redraw */
-bool browser_redraw_required( struct gui_window * gw)
-{
- bool ret = true;
- CMP_BROWSER b = gw->browser;
-
- if( b->bw->current_content == NULL )
- return ( false );
-
- /* disable redraws when the browser awaits WM_REDRAW caused by resize */
- if( b->reformat_pending )
- return( false );
-
- ret = ( ((b->redraw.areas_used > 0) )
- || b->scroll.required
- || b->caret.redraw);
- return( ret );
-}
+//bool browser_redraw_required( struct gui_window * gw)
+//{
+// bool ret = true;
+// CMP_BROWSER b = gw->browser;
+//
+// if( b->bw->current_content == NULL )
+// return ( false );
+//
+// /* disable redraws when the browser awaits WM_REDRAW caused by resize */
+// if( b->reformat_pending )
+// return( false );
+//
+// ret = ( ((b->redraw.areas_used > 0) )
+// || b->scroll.required
+// || b->caret.redraw);
+// return( ret );
+//}
/* schedule a redraw of content */
@@ -640,273 +639,273 @@ static void browser_redraw_content( struct gui_window * gw, int xoff, int yoff,
/*
area: the browser canvas
*/
-void browser_restore_caret_background( struct gui_window * gw, GRECT * area)
-{
- CMP_BROWSER b = gw->browser;
- GRECT rect;
- if( area == NULL ){
- browser_get_rect( gw, BR_CONTENT, &rect );
- area = ▭
- }
- /* This call restores the background and releases the memory: */
- // TODO: only release memory/clear flag when the caret is not clipped.
- // TODO: apply clipping.
- w_put_bkgr( &app,
- area->g_x-b->scroll.current.x+b->caret.current.g_x,
- area->g_y-b->scroll.current.y+b->caret.current.g_y,
- gw->browser->caret.current.g_w,
- gw->browser->caret.current.g_h+1,
- &gw->browser->caret.background
- );
- gw->browser->caret.background.fd_addr = NULL;
-}
+//void browser_restore_caret_background( struct gui_window * gw, GRECT * area)
+//{
+// CMP_BROWSER b = gw->browser;
+// GRECT rect;
+// if( area == NULL ){
+// browser_get_rect( gw, BR_CONTENT, &rect );
+// area = ▭
+// }
+// /* This call restores the background and releases the memory: */
+// // TODO: only release memory/clear flag when the caret is not clipped.
+// // TODO: apply clipping.
+// w_put_bkgr( &app,
+// area->g_x-b->scroll.current.x+b->caret.current.g_x,
+// area->g_y-b->scroll.current.y+b->caret.current.g_y,
+// gw->browser->caret.current.g_w,
+// gw->browser->caret.current.g_h+1,
+// &gw->browser->caret.background
+// );
+// gw->browser->caret.background.fd_addr = NULL;
+//}
/*
area: the browser canvas
*/
-void browser_redraw_caret( struct gui_window * gw, GRECT * area )
-{
-
- if( gw->browser->caret.redraw && gw->browser->caret.requested.g_w > 0 ){
-
- short wind_info[4];
-
- /* Only redraw caret when window is topped. */
- wind_get( 0, WF_TOP, &wind_info[0], &wind_info[1], &wind_info[2], &wind_info[3]);
- if (guiwin_get_handle(gw->root->win) != wind_info[0]) {
- return;
- }
-
-
- GRECT caret;
- struct s_browser * b = gw->browser;
- struct rect old_clip;
- struct rect clip;
-
- if( b->caret.current.g_w > 0 && b->caret.background.fd_addr != NULL ){
- browser_restore_caret_background( gw, area );
- }
-
- caret = b->caret.requested;
- caret.g_x -= b->scroll.current.x - area->g_x;
- caret.g_y -= b->scroll.current.y - area->g_y;
-
- if( !rc_intersect( area, &caret ) ) {
- return;
- }
-
- MFDB screen;
- short pxy[8];
-
- /* save background: */
- //assert( b->caret.background.fd_addr == NULL );
- init_mfdb(app.nplanes, caret.g_w, caret.g_h, 0,
- &b->caret.background);
- init_mfdb(0, caret.g_w, caret.g_h, 0, &screen);
- pxy[0] = caret.g_x;
- pxy[1] = caret.g_y;
- pxy[2] = caret.g_x + caret.g_w;
- pxy[3] = caret.g_y + caret.g_h;
- pxy[4] = 0;
- pxy[5] = 0;
- pxy[6] = caret.g_w;
- pxy[7] = caret.g_h;
- /* hide the mouse */
- v_hide_c (app.graf.handle);
- /* copy screen image */
- vro_cpyfm (app.graf.handle, S_ONLY, pxy, &screen, &b->caret.background);
- /* draw caret: */
- caret.g_x -= area->g_x;
- caret.g_y -= area->g_y;
- clip.x0 = caret.g_x;
- clip.y0 = caret.g_y;
- clip.x1 = caret.g_x + caret.g_w;
- clip.y1 = caret.g_y + caret.g_h;
- /* store old clip before adjusting it: */
- plot_get_clip( &old_clip );
- /* clip to cursor: */
- plot_clip( &clip );
- plot_line( caret.g_x, caret.g_y, caret.g_x, caret.g_y + caret.g_h,
- plot_style_caret );
- /* restore old clip area: */
- plot_clip( &old_clip );
- /* restore the mouse */
- v_show_c ( app.graf.handle, 1);
- b->caret.current.g_x = caret.g_x + gw->browser->scroll.current.x;
- b->caret.current.g_y = caret.g_y + gw->browser->scroll.current.y;
- b->caret.current.g_w = caret.g_w;
- b->caret.current.g_h = caret.g_h;
- }
-}
-
-void browser_redraw( struct gui_window * gw )
-{
- GRECT bwrect;
- struct s_browser * b = gw->browser;
- short todo[4];
- struct rect clip;
- /* used for clipping of content redraw: */
- struct rect redraw_area;
-
- if( b->attached == false || b->bw->current_content == NULL ) {
- return;
- }
-
- browser_get_rect(gw, BR_CONTENT, &bwrect);
-
- plot_set_dimensions(bwrect.g_x, bwrect.g_y, bwrect.g_w, bwrect.g_h);
- clip.x0 = 0;
- clip.y0 = 0;
- clip.x1 = bwrect.g_w;
- clip.y1 = bwrect.g_h;
- plot_clip(&clip);
- if (plot_lock() == false)
- return;
-
- if( b->scroll.required == true && b->bw->current_content != NULL) {
- browser_process_scroll( gw, bwrect );
- b->scroll.required = false;
- }
-
- if ((b->redraw.areas_used > 0) && b->bw->current_content != NULL ) {
- if( (atari_plot_flags & PLOT_FLAG_OFFSCREEN) == 0 ) {
-
- int i;
- GRECT area;
- GRECT fbwork;
- short wf_top[4];
- todo[0] = bwrect.g_x;
- todo[1] = bwrect.g_y;
- todo[2] = todo[0] + bwrect.g_w-1;
- todo[3] = todo[1] + bwrect.g_h-1;
- vs_clip(atari_plot_vdi_handle, 1, (short*)&todo[0]);
-
- wind_get( 0, WF_TOP, &wf_top[0], &wf_top[1],
- &wf_top[2], &wf_top[3] );
-
- if( wf_top[0] == guiwin_get_handle(gw->root->win)
- && wf_top[1] == _AESapid ){
- /* The window is on top, so there is no need to walk the */
- /* AES rectangle list. */
- for( i=0; i<b->redraw.areas_used; i++ ){
- fbwork.g_x = todo[0] - bwrect.g_x;
- fbwork.g_y = todo[1] - bwrect.g_y;
- if( fbwork.g_x < 0 ){
- fbwork.g_w = todo[2] + todo[0];
- fbwork.g_x = 0;
- } else {
- fbwork.g_w = todo[2];
- }
- if( fbwork.g_y < 0 ){
- fbwork.g_h = todo[3] + todo[1];
- fbwork.g_y = 0;
- } else {
- fbwork.g_h = todo[3];
- }
- area.g_x = b->redraw.areas[i].x0;
- area.g_y = b->redraw.areas[i].y0;
- area.g_w = b->redraw.areas[i].x1 - b->redraw.areas[i].x0;
- area.g_h = b->redraw.areas[i].y1 - b->redraw.areas[i].y0;
- if (rc_intersect((GRECT *)&fbwork,(GRECT *)&area)) {
- redraw_area.x0 = area.g_x;
- redraw_area.y0 = area.g_y;
- redraw_area.x1 = area.g_x + area.g_w;
- redraw_area.y1 = area.g_y + area.g_h;
- browser_redraw_content( gw, 0, 0, &redraw_area );
- } else {
- /* the area should be kept scheduled for later redraw,*/
- /* but because this is onscreen plotter, it doesn't */
- /* make much sense anyway... */
- }
- }
- } else {
- /* walk the AES rectangle list: */
- short aes_handle = guiwin_get_handle(gw->root->win);
- if( wind_get(aes_handle, WF_FIRSTXYWH,
- &todo[0], &todo[1], &todo[2], &todo[3] )!=0 ) {
- while (todo[2] && todo[3]) {
- /* convert screen to framebuffer coords: */
- fbwork.g_x = todo[0] - bwrect.g_x;
- fbwork.g_y = todo[1] - bwrect.g_y;
- if( fbwork.g_x < 0 ){
- fbwork.g_w = todo[2] + todo[0];
- fbwork.g_x = 0;
- } else {
- fbwork.g_w = todo[2];
- }
- if( fbwork.g_y < 0 ){
- fbwork.g_h = todo[3] + todo[1];
- fbwork.g_y = 0;
- } else {
- fbwork.g_h = todo[3];
- }
- /* walk the redraw requests: */
- for( i=0; i<b->redraw.areas_used; i++ ){
- area.g_x = b->redraw.areas[i].x0;
- area.g_y = b->redraw.areas[i].y0;
- area.g_w = b->redraw.areas[i].x1 - b->redraw.areas[i].x0;
- area.g_h = b->redraw.areas[i].y1 - b->redraw.areas[i].y0;
- if (rc_intersect((GRECT *)&fbwork,(GRECT *)&area)) {
- redraw_area.x0 = area.g_x;
- redraw_area.y0 = area.g_y;
- redraw_area.x1 = area.g_x + area.g_w;
- redraw_area.y1 = area.g_y + area.g_h;
- browser_redraw_content( gw, 0, 0, &redraw_area );
- } else {
- /* the area should be kept scheduled for later redraw,*/
- /* but because this is onscreen plotter, it doesn't */
- /* make much sense anyway... */
- }
- }
- if (wind_get(aes_handle, WF_NEXTXYWH,
- &todo[0], &todo[1], &todo[2], &todo[3])==0) {
- break;
- }
- }
- }
- }
- vs_clip(atari_plot_vdi_handle, 0, (short*)&todo);
- } else {
-
- /* its save to do a complete redraw without knowledge about GEM windows :) */
- /* walk the redraw requests: */
- int i;
- for( i=0; i<b->redraw.areas_used; i++ ){
- struct redraw_context ctx = {
- .interactive = true,
- .background_images = true,
- .plot = &atari_plotters
- };
- browser_window_redraw( b->bw, -b->scroll.current.x,
- -b->scroll.current.y, &b->redraw.areas[i], &ctx );
- }
- GRECT area;
- area.g_x = bwrect.g_x;
- area.g_y = bwrect.g_y;
- area.g_w = bwrect.g_w;
- area.g_h = bwrect.g_h;
- //plot_blit( plotter, &area );
- }
- b->redraw.areas_used = 0;
- }
- if( b->caret.redraw == true && b->bw->current_content != NULL ) {
- GRECT area;
- todo[0] = bwrect.g_x;
- todo[1] = bwrect.g_y;
- todo[2] = todo[0] + bwrect.g_w;
- todo[3] = todo[1] + bwrect.g_h;
- area.g_x = bwrect.g_x;
- area.g_y = bwrect.g_y;
- area.g_w = bwrect.g_w;
- area.g_h = bwrect.g_h;
- vs_clip(atari_plot_vdi_handle, 1, (short*)&todo[0]);
- browser_redraw_caret( gw, &area );
- vs_clip(atari_plot_vdi_handle, 0, (short*)&todo[0]);
- b->caret.redraw = false;
- }
- plot_unlock();
- /* TODO: if we use offscreen bitmap, trigger content redraw here */
-}
+//void browser_redraw_caret( struct gui_window * gw, GRECT * area )
+//{
+//
+// if( gw->browser->caret.redraw && gw->browser->caret.requested.g_w > 0 ){
+//
+// short wind_info[4];
+//
+// /* Only redraw caret when window is topped. */
+// wind_get( 0, WF_TOP, &wind_info[0], &wind_info[1], &wind_info[2], &wind_info[3]);
+// if (guiwin_get_handle(gw->root->win) != wind_info[0]) {
+// return;
+// }
+//
+//
+// GRECT caret;
+// struct s_browser * b = gw->browser;
+// struct rect old_clip;
+// struct rect clip;
+//
+// if( b->caret.current.g_w > 0 && b->caret.background.fd_addr != NULL ){
+// browser_restore_caret_background( gw, area );
+// }
+//
+// caret = b->caret.requested;
+// caret.g_x -= b->scroll.current.x - area->g_x;
+// caret.g_y -= b->scroll.current.y - area->g_y;
+//
+// if( !rc_intersect( area, &caret ) ) {
+// return;
+// }
+//
+// MFDB screen;
+// short pxy[8];
+//
+// /* save background: */
+// init_mfdb(app.nplanes, caret.g_w, caret.g_h, 0,
+// &b->caret.background);
+// init_mfdb(0, caret.g_w, caret.g_h, 0, &screen);
+// pxy[0] = caret.g_x;
+// pxy[1] = caret.g_y;
+// pxy[2] = caret.g_x + caret.g_w;
+// pxy[3] = caret.g_y + caret.g_h;
+// pxy[4] = 0;
+// pxy[5] = 0;
+// pxy[6] = caret.g_w;
+// pxy[7] = caret.g_h;
+//
+// plot_lock();
+//
+// /* copy screen image behin the caret for later restore: */
+// vro_cpyfm (app.graf.handle, S_ONLY, pxy, &screen, &b->caret.background);
+// /* draw caret: */
+// caret.g_x -= area->g_x;
+// caret.g_y -= area->g_y;
+// clip.x0 = caret.g_x;
+// clip.y0 = caret.g_y;
+// clip.x1 = caret.g_x + caret.g_w;
+// clip.y1 = caret.g_y + caret.g_h;
+// /* store old clip before adjusting it: */
+// plot_get_clip( &old_clip );
+// /* clip to cursor: */
+// plot_clip( &clip );
+// plot_line( caret.g_x, caret.g_y, caret.g_x, caret.g_y + caret.g_h,
+// plot_style_caret );
+// /* restore old clip area: */
+// plot_clip( &old_clip );
+// /* restore the mouse */
+// plot_unlock();
+// b->caret.current.g_x = caret.g_x + gw->browser->scroll.current.x;
+// b->caret.current.g_y = caret.g_y + gw->browser->scroll.current.y;
+// b->caret.current.g_w = caret.g_w;
+// b->caret.current.g_h = caret.g_h;
+// }
+//}
+//
+//void browser_redraw( struct gui_window * gw )
+//{
+// GRECT bwrect;
+// struct s_browser * b = gw->browser;
+// short todo[4];
+// struct rect clip;
+// /* used for clipping of content redraw: */
+// struct rect redraw_area;
+//
+// if( b->attached == false || b->bw->current_content == NULL ) {
+// return;
+// }
+//
+// browser_get_rect(gw, BR_CONTENT, &bwrect);
+//
+// plot_set_dimensions(bwrect.g_x, bwrect.g_y, bwrect.g_w, bwrect.g_h);
+// clip.x0 = 0;
+// clip.y0 = 0;
+// clip.x1 = bwrect.g_w;
+// clip.y1 = bwrect.g_h;
+// plot_clip(&clip);
+// if (plot_lock() == false)
+// return;
+//
+// if( b->scroll.required == true && b->bw->current_content != NULL) {
+// browser_process_scroll( gw, bwrect );
+// b->scroll.required = false;
+// }
+//
+// if ((b->redraw.areas_used > 0) && b->bw->current_content != NULL ) {
+// if( (atari_plot_flags & PLOT_FLAG_OFFSCREEN) == 0 ) {
+//
+// int i;
+// GRECT area;
+// GRECT fbwork;
+// short wf_top[4];
+// todo[0] = bwrect.g_x;
+// todo[1] = bwrect.g_y;
+// todo[2] = todo[0] + bwrect.g_w-1;
+// todo[3] = todo[1] + bwrect.g_h-1;
+// vs_clip(atari_plot_vdi_handle, 1, (short*)&todo[0]);
+//
+// wind_get( 0, WF_TOP, &wf_top[0], &wf_top[1],
+// &wf_top[2], &wf_top[3] );
+//
+// if( wf_top[0] == guiwin_get_handle(gw->root->win)
+// && wf_top[1] == _AESapid ){
+// /* The window is on top, so there is no need to walk the */
+// /* AES rectangle list. */
+// for( i=0; i<b->redraw.areas_used; i++ ){
+// fbwork.g_x = todo[0] - bwrect.g_x;
+// fbwork.g_y = todo[1] - bwrect.g_y;
+// if( fbwork.g_x < 0 ){
+// fbwork.g_w = todo[2] + todo[0];
+// fbwork.g_x = 0;
+// } else {
+// fbwork.g_w = todo[2];
+// }
+// if( fbwork.g_y < 0 ){
+// fbwork.g_h = todo[3] + todo[1];
+// fbwork.g_y = 0;
+// } else {
+// fbwork.g_h = todo[3];
+// }
+// area.g_x = b->redraw.areas[i].x0;
+// area.g_y = b->redraw.areas[i].y0;
+// area.g_w = b->redraw.areas[i].x1 - b->redraw.areas[i].x0;
+// area.g_h = b->redraw.areas[i].y1 - b->redraw.areas[i].y0;
+// if (rc_intersect((GRECT *)&fbwork,(GRECT *)&area)) {
+// redraw_area.x0 = area.g_x;
+// redraw_area.y0 = area.g_y;
+// redraw_area.x1 = area.g_x + area.g_w;
+// redraw_area.y1 = area.g_y + area.g_h;
+// browser_redraw_content( gw, 0, 0, &redraw_area );
+// } else {
+// /* the area should be kept scheduled for later redraw,*/
+// /* but because this is onscreen plotter, it doesn't */
+// /* make much sense anyway... */
+// }
+// }
+// } else {
+// /* walk the AES rectangle list: */
+// short aes_handle = guiwin_get_handle(gw->root->win);
+// if( wind_get(aes_handle, WF_FIRSTXYWH,
+// &todo[0], &todo[1], &todo[2], &todo[3] )!=0 ) {
+// while (todo[2] && todo[3]) {
+// /* convert screen to framebuffer coords: */
+// fbwork.g_x = todo[0] - bwrect.g_x;
+// fbwork.g_y = todo[1] - bwrect.g_y;
+// if( fbwork.g_x < 0 ){
+// fbwork.g_w = todo[2] + todo[0];
+// fbwork.g_x = 0;
+// } else {
+// fbwork.g_w = todo[2];
+// }
+// if( fbwork.g_y < 0 ){
+// fbwork.g_h = todo[3] + todo[1];
+// fbwork.g_y = 0;
+// } else {
+// fbwork.g_h = todo[3];
+// }
+// /* walk the redraw requests: */
+// for( i=0; i<b->redraw.areas_used; i++ ){
+// area.g_x = b->redraw.areas[i].x0;
+// area.g_y = b->redraw.areas[i].y0;
+// area.g_w = b->redraw.areas[i].x1 - b->redraw.areas[i].x0;
+// area.g_h = b->redraw.areas[i].y1 - b->redraw.areas[i].y0;
+// if (rc_intersect((GRECT *)&fbwork,(GRECT *)&area)) {
+// redraw_area.x0 = area.g_x;
+// redraw_area.y0 = area.g_y;
+// redraw_area.x1 = area.g_x + area.g_w;
+// redraw_area.y1 = area.g_y + area.g_h;
+// browser_redraw_content( gw, 0, 0, &redraw_area );
+// } else {
+// /* the area should be kept scheduled for later redraw,*/
+// /* but because this is onscreen plotter, it doesn't */
+// /* make much sense anyway... */
+// }
+// }
+// if (wind_get(aes_handle, WF_NEXTXYWH,
+// &todo[0], &todo[1], &todo[2], &todo[3])==0) {
+// break;
+// }
+// }
+// }
+// }
+// vs_clip(atari_plot_vdi_handle, 0, (short*)&todo);
+// } else {
+//
+// /* its save to do a complete redraw without knowledge about GEM windows :) */
+// /* walk the redraw requests: */
+// int i;
+// for( i=0; i<b->redraw.areas_used; i++ ){
+// struct redraw_context ctx = {
+// .interactive = true,
+// .background_images = true,
+// .plot = &atari_plotters
+// };
+// browser_window_redraw( b->bw, -b->scroll.current.x,
+// -b->scroll.current.y, &b->redraw.areas[i], &ctx );
+// }
+// GRECT area;
+// area.g_x = bwrect.g_x;
+// area.g_y = bwrect.g_y;
+// area.g_w = bwrect.g_w;
+// area.g_h = bwrect.g_h;
+// //plot_blit( plotter, &area );
+// }
+// b->redraw.areas_used = 0;
+// }
+// if( b->caret.redraw == true && b->bw->current_content != NULL ) {
+// GRECT area;
+// todo[0] = bwrect.g_x;
+// todo[1] = bwrect.g_y;
+// todo[2] = todo[0] + bwrect.g_w;
+// todo[3] = todo[1] + bwrect.g_h;
+// area.g_x = bwrect.g_x;
+// area.g_y = bwrect.g_y;
+// area.g_w = bwrect.g_w;
+// area.g_h = bwrect.g_h;
+// vs_clip(atari_plot_vdi_handle, 1, (short*)&todo[0]);
+// browser_redraw_caret( gw, &area );
+// vs_clip(atari_plot_vdi_handle, 0, (short*)&todo[0]);
+// b->caret.redraw = false;
+// }
+// plot_unlock();
+// /* TODO: if we use offscreen bitmap, trigger content redraw here */
+//}
static void __CDECL browser_evnt_redraw( COMPONENT * c, short buff[8], void * data)
{
diff --git a/atari/browser.h b/atari/browser.h
index e855e59..a442380 100755
--- a/atari/browser.h
+++ b/atari/browser.h
@@ -57,7 +57,7 @@ struct s_scroll_info
This struct holds information of the cursor within the browser
viewport.
*/
-struct s_caret
+struct s_caret_old
{
GRECT requested;
GRECT current;
@@ -101,8 +101,8 @@ void browser_set_content_size(struct gui_window * gw, int w, int h);
void browser_scroll( struct gui_window * gw, short MODE, int value, bool abs );
struct gui_window * browser_find_root( struct gui_window * gw );
bool browser_redraw_required( struct gui_window * gw);
-void browser_redraw_caret( struct gui_window * gw, GRECT * area);
-void browser_restore_caret_background(struct gui_window * gw, GRECT * area);
+//void browser_redraw_caret( struct gui_window * gw, GRECT * area);
+//void browser_restore_caret_background(struct gui_window * gw, GRECT * area);
/* update loc / size of the browser widgets: */
void browser_update_rects(struct gui_window * gw );
/*
diff --git a/atari/caret.c b/atari/caret.c
new file mode 100644
index 0000000..42a35a4
--- /dev/null
+++ b/atari/caret.c
@@ -0,0 +1,129 @@
+#include <stdbool.h>
+
+#include "desktop/plot_style.h"
+#include "atari/plot/plot.h"
+#include "atari/caret.h"
+
+extern struct s_vdi_sysinfo vdi_sysinfo;
+
+static void caret_restore_background(struct s_caret *c, VdiHdl vh, GRECT *clip);
+
+void caret_show(struct s_caret *caret, VdiHdl vh, GRECT *dimensions, GRECT *clip)
+{
+ GRECT visible, old_dim;
+ MFDB screen;
+ short pxy[8];
+
+ struct rect old_clip;
+
+ return;
+
+
+
+ plot_get_clip(&old_clip);
+ plot_get_dimensions(&old_dim);
+
+
+ // store background:
+ visible = *dimensions;
+ visible.g_x += clip->g_x;
+ visible.g_y += clip->g_y;
+
+ if(!rc_intersect(clip, &visible)){
+ printf("no isect...\n");
+ return;
+ }
+
+
+ // TODO: do not alloc / free on each move...
+ if (caret->background.fd_addr != NULL) {
+ //caret_restore_background(caret, vh, clip);
+ }
+
+ plot_lock();
+ plot_set_dimensions(clip->g_x, clip->g_y, clip->g_w, clip->g_h);
+
+ caret->dimensions.g_x = dimensions->g_x;
+ caret->dimensions.g_y = dimensions->g_y;
+ caret->dimensions.g_w = visible.g_w;
+ caret->dimensions.g_h = visible.g_h;
+
+ dbg_grect("clip", clip);
+ dbg_grect("visible", &visible);
+ // TODO: do not alloc / free on every redraw...
+ init_mfdb(vdi_sysinfo.scr_bpp, visible.g_w, visible.g_h, 0,
+ &caret->background);
+ init_mfdb(0, visible.g_w, visible.g_h, 0, &screen);
+ pxy[0] = visible.g_x;
+ pxy[1] = visible.g_y;
+ pxy[2] = visible.g_x + visible.g_w;
+ pxy[3] = visible.g_y + visible.g_h;
+ pxy[4] = 0;
+ pxy[5] = 0;
+ pxy[6] = visible.g_w;
+ pxy[7] = visible.g_h;
+ vro_cpyfm (vh, S_ONLY, pxy, &screen, &caret->background);
+
+ plot_line(dimensions->g_x, dimensions->g_y, dimensions->g_x,
+ dimensions->g_y + dimensions->g_h, plot_style_caret);
+
+ plot_set_dimensions(old_clip.x0, old_clip.y0, old_clip.x1, old_clip.y1);
+ plot_clip(&old_clip);
+
+ plot_unlock();
+ caret->visible = true;
+}
+
+void caret_hide(struct s_caret *caret, VdiHdl vh, GRECT *clip)
+{
+ struct rect old_clip;
+ GRECT old_dim;
+
+ plot_lock();
+ plot_get_clip(&old_clip);
+ plot_get_dimensions(&old_dim);
+ plot_set_dimensions(clip->g_x, clip->g_y, clip->g_w, clip->g_h);
+ caret_restore_background(caret, vh, clip);
+ plot_set_dimensions(old_clip.x0, old_clip.y0, old_clip.x1, old_clip.y1);
+ plot_clip(&old_clip);
+ plot_unlock();
+ caret->visible = false;
+}
+
+static void caret_restore_background(struct s_caret *caret, VdiHdl vh, GRECT *clip)
+{
+ MFDB screen;
+ GRECT visible;
+ short pxy[8];
+
+ visible = caret->dimensions;
+ visible.g_x += clip->g_x;
+ visible.g_y += clip->g_y;
+
+ dbg_grect("restore ", &visible);
+
+ if(!rc_intersect(clip, &visible)){
+ goto exit;
+ }
+
+ // TODO: check isect
+
+ // restore mfdb
+
+ init_mfdb(0, caret->dimensions.g_w, caret->dimensions.g_h, 0, &screen);
+ pxy[0] = 0;
+ pxy[1] = 0;
+ pxy[2] = caret->dimensions.g_w;
+ pxy[3] = caret->dimensions.g_h;
+ pxy[4] = clip->g_x + caret->dimensions.g_x;
+ pxy[5] = clip->g_y + caret->dimensions.g_y;
+ pxy[6] = pxy[2];
+ pxy[7] = pxy[3];
+ vro_cpyfm(vh, S_ONLY, pxy, &caret->background, &screen);
+ // exit:
+ // TODO: do not alloc / free on every redraw...
+
+exit:
+ free(caret->background.fd_addr);
+ caret->background.fd_addr = NULL;
+}
diff --git a/atari/caret.h b/atari/caret.h
new file mode 100644
index 0000000..c9352dc
--- /dev/null
+++ b/atari/caret.h
@@ -0,0 +1,17 @@
+#ifndef NS_ATARI_CARET_H
+#define NS_ATARI_CARET_H
+
+#include <mt_gem.h>
+#include <stdbool.h>
+
+struct s_caret {
+ GRECT dimensions;
+ MFDB background;
+ bool visible;
+};
+
+void caret_show(struct s_caret *c, VdiHdl vh, GRECT * dimensions, GRECT *clip);
+void caret_hide(struct s_caret *c, VdiHdl vh, GRECT *clip);
+
+#endif // NS_ATARI_CARET_H
+
diff --git a/atari/deskmenu.c b/atari/deskmenu.c
index 646a09c..601ba99 100644
--- a/atari/deskmenu.c
+++ b/atari/deskmenu.c
@@ -353,9 +353,8 @@ static void __CDECL menu_find(short item, short title, void *data)
static void __CDECL menu_choices(short item, short title, void *data)
{
- static WINDOW * settings_dlg = NULL;
LOG(("%s", __FUNCTION__));
- settings_dlg = open_settings();
+ open_settings();
}
static void __CDECL menu_stop(short item, short title, void *data)
diff --git a/atari/download.c b/atari/download.c
index 566f44a..bf3105f 100755
--- a/atari/download.c
+++ b/atari/download.c
@@ -81,12 +81,10 @@ static short on_aes_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
case WM_CLOSED:
// TODO: this needs to iterate through all gui windows and
// check if the rootwin is this window...
- printf("destroy...\n");
- on_close(data);
+ on_close(data);
break;
case WM_TOOLBAR:
- printf("tb idx: %d\n", msg[4]);
switch(msg[4]){
case DOWNLOAD_BT_ABORT:
@@ -206,9 +204,10 @@ static void gui_download_window_destroy( struct gui_download_window * gdw)
}
if (gdw->fbuf != NULL) {
free( gdw->fbuf );
- }
- wind_close(gdw->aes_handle);
- guiwin_remove(gdw->guiwin);
+ }
+ guiwin_remove(gdw->guiwin);
+ wind_close(gdw->aes_handle);
+ wind_delete(gdw->aes_handle);
free(gdw);
}
@@ -271,7 +270,7 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
gemdos_realpath(nsoption_charp(downloads_path), gdos_path);
dstsize = strlen(gdos_path) + strlen(filename) + 2;
destination = malloc( dstsize );
- snprintf( destination, dstsize, "%s/%s", gdos_path, filename );
+ snprintf(destination, dstsize, "%s/%s", gdos_path, filename);
}
gdw = calloc(1, sizeof(struct gui_download_window));
diff --git a/atari/extract.php b/atari/extract.php
new file mode 100755
index 0000000..865b70e
--- /dev/null
+++ b/atari/extract.php
@@ -0,0 +1,10 @@
+#!/usr/bin/php
+<?
+$lines = file("deskmenu.c");
+
+foreach($lines as $line){
+ if(stripos($line, "static void __CDECL menu_") === 0){
+ echo $line;
+ }
+}
+?>
diff --git a/atari/gemtk/aestabs.c b/atari/gemtk/aestabs.c
new file mode 100644
index 0000000..414d5c2
--- /dev/null
+++ b/atari/gemtk/aestabs.c
@@ -0,0 +1,173 @@
+#include <stdlib.h>
+#include <assert.h>
+#include <gem.h>
+#include <cflib.h>
+#include "aestabs.h"
+
+#ifndef NDEBUG
+# define DEBUG_PRINT(x) printf x
+#else
+# define DEBUG_PRINT(x)
+#endif
+
+
+AES_TABLIST * tablist_declare(OBJECT *tree, aes_tablist_user_func user_func)
+{
+ AES_TABLIST * newlist = malloc(sizeof(AES_TABLIST));
+
+ newlist->first = NULL;
+ newlist->tree = tree;
+ newlist->user_func = user_func;
+ DEBUG_PRINT(("aes_tablist_declare: %p\n", newlist));
+ return(newlist);
+}
+
+
+AES_TAB * tablist_add(AES_TABLIST * tablist, short obj_tab, OBJECT * page_tree,
+ short obj_page)
+{
+ AES_TAB * newtab = malloc(sizeof(AES_TAB));
+
+ assert(newtab);
+ assert(tablist);
+
+ newtab->next = NULL;
+ newtab->prev = NULL;
+ newtab->obj_tab = obj_tab;
+ newtab->obj_page = obj_page;
+ newtab->page_tree = page_tree;
+
+ if(newtab->page_tree == NULL){
+ newtab->page_tree = tablist->tree;
+ }
+
+ if (tablist->first == NULL) {
+ tablist->first = newtab;
+ set_state(tablist->tree, newtab->obj_tab, OS_SELECTED, 0);
+ } else {
+ AES_TAB *tmp = tablist->first;
+ while( tmp->next != NULL ) {
+ tmp = tmp->next;
+ }
+ tmp->next = newtab;
+ newtab->prev = tmp;
+ newtab->next = NULL;
+ set_state(tablist->tree, newtab->obj_tab, OS_SELECTED, 0);
+ }
+
+ // TODO: Set the visible flag on that register?
+
+ DEBUG_PRINT(("tablist_add: Tab=%p\n", newtab));
+
+ return(newtab);
+}
+
+
+short tablist_activate(AES_TABLIST * tablist, short tab, short options)
+{
+ AES_TAB *tmp, *activated=NULL, *deactivated=NULL;
+ struct aes_tab_s *active;
+ short activated_pg = -1;
+ short is_tab = 0;
+
+ assert(tablist);
+ assert(tablist->first);
+
+ active = tablist_get_active(tablist);
+
+ if (active != NULL) {
+ if ((options & AES_TABLIST_OPTION_FORCE_EVENTS) == 0) {
+ if(active->obj_tab == tab)
+ return(0);
+ }
+ }
+
+ tmp = tablist->first;
+ while (tmp != NULL) {
+ if(tmp->obj_tab == tab) {
+ is_tab = 1;
+ }
+ tmp = tmp->next;
+ }
+
+ if(is_tab == 0) {
+ return(0);
+ }
+
+ tmp = tablist->first;
+ while ( tmp != NULL ) {
+ if(tab != tmp->obj_tab) {
+ if (get_state(tablist->tree, tmp->obj_tab, OS_SELECTED) != 0) {
+ deactivated = tmp;
+ set_state(tablist->tree, tmp->obj_tab, OS_SELECTED, 0);
+ }
+ // the tab registers can share the same page, consider that:
+ if (tablist->tree == tmp->page_tree
+ && activated_pg != tmp->obj_page) {
+
+ set_flag(tablist->tree, tmp->obj_page, OF_HIDETREE, 1);
+ }
+ } else {
+ activated = tmp;
+ // this tab must the selected / visible
+ set_state(tablist->tree, tmp->obj_tab, OS_SELECTED, 1);
+ if(tablist->tree == tmp->page_tree)
+ set_flag(tablist->tree, tmp->obj_page, OF_HIDETREE, 0);
+ activated_pg = tmp->obj_page;
+ }
+ tmp = tmp->next;
+ }
+
+ if(tablist->user_func != NULL) {
+ AES_TABLIST_FUNC_ARGS args;
+ if(deactivated){
+ args.event = AES_TABLIST_TAB_DEACTIVATED;
+ args.tab = deactivated;
+ tablist->user_func(tablist, &args);
+ }
+ if(activated){
+ args.event = AES_TABLIST_TAB_ACTIVATED;
+ args.tab = activated;
+ tablist->user_func(tablist, &args);
+ }
+ }
+ return(1);
+}
+
+struct aes_tab_s *tablist_get_active(AES_TABLIST * tablist)
+{
+ AES_TAB *tmp = tablist->first;
+ while( tmp != NULL ) {
+ if(get_state(tablist->tree, tmp->obj_tab, OS_SELECTED) != 0) {
+ // that's the one
+ return(tmp);
+ }
+ tmp = tmp->next;
+ }
+ return(NULL);
+}
+
+AES_TAB * tablist_find(AES_TABLIST * tablist, OBJECT * page, short tab)
+{
+ AES_TAB *tmp = tablist->first;
+ while( tmp != NULL ) {
+ if((tmp->page_tree == page) && (tab == tmp->obj_tab)) {
+ return(tmp);
+ }
+ tmp = tmp->next;
+ }
+ return(NULL);
+}
+
+void tablist_delete(AES_TABLIST *tablist)
+{
+ AES_TAB *tmp = tablist->first, *cur;
+ while ( tmp != NULL ) {
+ cur = tmp;
+ tmp = tmp->next;
+ DEBUG_PRINT(("tablist_delete, Freeing tab: %p\n", cur));
+ free(cur);
+ }
+ DEBUG_PRINT(("tablist_delete, Freeing list: %p\n", tablist));
+ free(tablist);
+}
diff --git a/atari/gemtk/aestabs.h b/atari/gemtk/aestabs.h
new file mode 100644
index 0000000..c72054a
--- /dev/null
+++ b/atari/gemtk/aestabs.h
@@ -0,0 +1,56 @@
+#ifndef AESTABS_H_INCLUDED
+#define AESTABS_H_INCLUDED
+
+struct aes_tab_s;
+struct aes_tablist_s;
+typedef struct aes_tab_s AES_TAB;
+typedef struct aes_tablist_s AES_TABLIST;
+
+#define AES_TABLIST_TAB_ACTIVATED 0x01
+#define AES_TABLIST_TAB_DEACTIVATED 0x02
+
+#define AES_TABLIST_OPTION_FORCE_EVENTS 0x01 // do not eat events which do
+ // not changed the internal state
+ // this is required for tabs which
+ // require "activate" events
+ // for tabs which are already
+ // selected.
+
+
+struct aes_tablist_user_args_s
+{
+ short event;
+ AES_TAB *tab;
+};
+
+typedef struct aes_tablist_user_args_s AES_TABLIST_FUNC_ARGS;
+
+typedef void (*aes_tablist_user_func)(AES_TABLIST * list,
+ AES_TABLIST_FUNC_ARGS * args);
+
+struct aes_tab_s {
+ short obj_tab;
+ short obj_page;
+ OBJECT * page_tree;
+ AES_TAB * next, *prev;
+};
+
+struct aes_tablist_s {
+ OBJECT *tree;
+ AES_TAB * first;
+ aes_tablist_user_func user_func;
+};
+
+
+
+AES_TABLIST * tablist_declare(OBJECT *tree, aes_tablist_user_func user_func);
+void tablist_delete(AES_TABLIST * tablist);
+AES_TAB * tablist_add(AES_TABLIST * tablist, short tab, OBJECT *page_tree,
+ short page);
+short tablist_activate(AES_TABLIST * tablist, short tab, short option);
+struct aes_tab_s *tablist_get_active(AES_TABLIST * tablist);
+AES_TAB * tablist_find(AES_TABLIST * tablist, OBJECT *page, short tab);
+
+#define AES_TAB_IS_ACTIVE(l, x) (tablist_get_active(l) == x)
+
+#endif // AESTABS_H_INCLUDED
diff --git a/atari/gemtk/gemtk.h b/atari/gemtk/gemtk.h
index ad9253c..9c341ba 100644
--- a/atari/gemtk/gemtk.h
+++ b/atari/gemtk/gemtk.h
@@ -7,6 +7,10 @@
#include <stdint.h>
#include <stdbool.h>
+/* -------------------------------------------------------------------------- */
+/* Utils */
+/* -------------------------------------------------------------------------- */
+
/* System type detection added by [GS] */
/* detect the system type, AES + kernel */
#define SYS_TOS 0x0001
@@ -23,16 +27,34 @@
#define TOS4VER 0x03300 /* this is assumed to be the last single tasking OS */
extern unsigned short _systype_v;
-
-/*
- Utils
-*/
unsigned short _systype (void);
OBJECT *get_tree( int idx );
-/*
-* MultiTOS Drag&Drop
-*/
+#ifndef POINT_WITHIN
+# define POINT_WITHIN(_x,_y, r) ((_x >= r.g_x) && (_x <= r.g_x + r.g_w ) \
+ && (_y >= r.g_y) && (_y <= r.g_y + r.g_h))
+#endif
+
+#ifndef RC_WITHIN
+# define RC_WITHIN(a,b) \
+ (((a)->g_x >= (b)->g_x) \
+ && (((a)->g_x + (a)->g_w) <= ((b)->g_x + (b)->g_w))) \
+ && (((a)->g_y >= (b)->g_y) \
+ && (((a)->g_y + (a)->g_h) <= ((b)->g_y + (b)->g_h)))
+#endif
+
+#ifndef MAX
+# define MAX(_a,_b) ((_a>_b) ? _a : _b)
+#endif
+
+#ifndef MIN
+# define MIN(_a,_b) ((_a<_b) ? _a : _b)
+#endif
+
+
+/* -------------------------------------------------------------------------- */
+/* MultiTOS Drag & Drop */
+/* -------------------------------------------------------------------------- */
short ddcreate(short *pipe);
short ddmessage(short apid, short fd, short winid, short mx, short my, short kstate, short pipename);
short ddrexts(short fd, char *exts);
@@ -45,17 +67,17 @@ short ddsexts(short fd, char *exts);
short ddrtry(short fd, char *name, char *file, char *whichext, long *size);
short ddreply(short fd, char ack);
-/*
- Message box
-*/
+/* -------------------------------------------------------------------------- */
+/* Message Box module */
+/* -------------------------------------------------------------------------- */
#define MSG_BOX_ALERT 1
#define MSG_BOX_CONFIRM 2
short msg_box_show(short type, const char * msg);
-/*
- Guiwin
-*/
+/* -------------------------------------------------------------------------- */
+/* GUIWIN Module */
+/* -------------------------------------------------------------------------- */
#define GW_FLAG_PREPROC_WM 0x01 // let guiwin API handle some events
#define GW_FLAG_RECV_PREPROC_WM 0x02 // get notified even when pre-processed
#define GW_FLAG_HAS_VTOOLBAR 0x04 // the attached toolbar is vertical
@@ -112,36 +134,20 @@ void *guiwin_get_user_data(GUIWIN *win);
struct guiwin_scroll_info_s * guiwin_get_scroll_info(GUIWIN *win);
bool guiwin_update_slider(GUIWIN *win, short mode);
void guiwin_scroll(GUIWIN *gw, short orientation, int units, bool refresh);
+void guiwin_send_msg(GUIWIN *win, short msgtype, short a, short b, short c,
+ short d);
void guiwin_send_redraw(GUIWIN *win, GRECT *area);
VdiHdl guiwin_get_vdi_handle(GUIWIN *win);
bool guiwin_has_intersection(GUIWIN *win, GRECT *work);
void guiwin_toolbar_redraw(GUIWIN *win, GRECT *clip);
void guiwin_clear(GUIWIN *win);
+/* -------------------------------------------------------------------------- */
+/* AES Scroller module */
+/* -------------------------------------------------------------------------- */
-/*
-* AES Scroller Object
-*/
-
-#ifndef POINT_WITHIN
-#define POINT_WITHIN(_x,_y, r) ((_x >= r.g_x) && (_x <= r.g_x + r.g_w ) \
- && (_y >= r.g_y) && (_y <= r.g_y + r.g_h))
-#endif
-
-#ifndef RC_WITHIN
-#define RC_WITHIN(a,b) \
- (((a)->g_x >= (b)->g_x) \
- && (((a)->g_x + (a)->g_w) <= ((b)->g_x + (b)->g_w))) \
- && (((a)->g_y >= (b)->g_y) \
- && (((a)->g_y + (a)->g_h) <= ((b)->g_y + (b)->g_h)))
-#endif
-
-#ifndef MAX
-#define MAX(_a,_b) ((_a>_b) ? _a : _b)
-#endif
-
-#ifndef MIN
-#define MIN(_a,_b) ((_a<_b) ? _a : _b)
-#endif
+/* -------------------------------------------------------------------------- */
+/* AES Tabs module */
+/* -------------------------------------------------------------------------- */
#endif // GEMTK_H_INCLUDED
diff --git a/atari/gemtk/guiwin.c b/atari/gemtk/guiwin.c
index c3042bc..6e8cfa2 100644
--- a/atari/gemtk/guiwin.c
+++ b/atari/gemtk/guiwin.c
@@ -1,4 +1,20 @@
-//#include "global.h"
+/*
+ * Copyright 2012 Ole Loots <ole(a)monochrom.net>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
#include <stdint.h>
#include <stdbool.h>
@@ -10,8 +26,8 @@
#include <mt_gem.h>
#include "gemtk.h"
-//#define DEBUG_PRINT(x) printf x
-#define DEBUG_PRINT(x)
+#define DEBUG_PRINT(x) printf x
+//#define DEBUG_PRINT(x)
struct gui_window_s {
short handle;
@@ -170,13 +186,20 @@ static short preproc_wm(GUIWIN * gw, EVMULT_OUT *ev_out, short msg[8])
case WM_SIZED:
case WM_REPOSED:
+ wind_get_grect(gw->handle, WF_FULLXYWH, &g2);
wind_get_grect(gw->handle, WF_CURRXYWH, &g);
- wind_set(gw->handle, WF_CURRXYWH, g.g_x, g.g_y, msg[6], msg[7]);
- if((gw->flags & GW_FLAG_CUSTOM_SCROLLING) == 0) {
- if(guiwin_update_slider(gw, GUIWIN_VH_SLIDER)) {
- guiwin_send_redraw(gw, NULL);
- }
+ g.g_w = MIN(msg[6], g2.g_w);
+ g.g_h = MIN(msg[7], g2.g_h);
+ if(g2.g_w != g.g_w || g2.g_h != g.g_h){
+ wind_set(gw->handle, WF_CURRXYWH, g.g_x, g.g_y, g.g_w, g.g_h);
+ if((gw->flags & GW_FLAG_CUSTOM_SCROLLING) == 0) {
+ if(guiwin_update_slider(gw, GUIWIN_VH_SLIDER)) {
+ guiwin_send_redraw(gw, NULL);
+ }
+ }
}
+
+
break;
case WM_FULLED:
@@ -282,12 +305,11 @@ short guiwin_dispatch_event(EVMULT_IN *ev_in, EVMULT_OUT *ev_out, short msg[8])
}
} else {
- short info[4];
- wind_get( 0, WF_TOP, &info[0], &info[1], &info[2], &info[3]);
+ short h_aes;
+ h_aes = wind_find(ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_y);
+ if(h_aes > 0 && (ev_out->emo_events != MU_TIMER)) {
- if(info[0] != 0 && info[1] == gl_apid) {
-
- dest = guiwin_find(info[0]);
+ dest = guiwin_find(h_aes);
if(dest == NULL || dest->handler_func == NULL)
return(0);
@@ -309,16 +331,20 @@ short guiwin_dispatch_event(EVMULT_IN *ev_in, EVMULT_OUT *ev_out, short msg[8])
dest->toolbar_idx, 8,
ev_out->emo_mouse.p_x,
ev_out->emo_mouse.p_y);
+ DEBUG_PRINT(("Toolbar index: %d\n", obj_idx));
short msg_out[8] = {WM_TOOLBAR, gl_apid, 0, dest->handle,
obj_idx, ev_out->emo_mclicks, ev_out->emo_kmeta, 0
};
- if (((dest->flags & GW_FLAG_CUSTOM_TOOLBAR) == 0)
- && (obj_idx > 0)
- && (dest->toolbar[obj_idx].ob_flags & OF_SELECTABLE) != 0) {
- dest->toolbar[obj_idx].ob_state |= OS_SELECTED;
- // TODO: optimize redraw by setting the object clip:
- guiwin_toolbar_redraw(dest, NULL);
- }
+ if (obj_idx > 0) {
+ if ((dest->toolbar[obj_idx].ob_flags & OF_SELECTABLE)!=0
+ && ((dest->flags & GW_FLAG_CUSTOM_TOOLBAR) == 0)
+ && ((dest->flags & GW_FLAG_TOOLBAR_REDRAW) == 1)) {
+ dest->toolbar[obj_idx].ob_state |= OS_SELECTED;
+ // TODO: optimize redraw by setting the object clip:
+ guiwin_toolbar_redraw(dest, NULL);
+ }
+ }
+
short oldevents = ev_out->emo_events;
ev_out->emo_events = MU_MESAG;
// notify the window about toolbar click:
@@ -378,6 +404,8 @@ GUIWIN * guiwin_add(short handle, uint32_t flags, guiwin_event_handler_f cb)
win->prev = tmp;
win->next = NULL;
}
+
+ DEBUG_PRINT(("Added guiwin: %p, tb: %p\n", win, win->toolbar));
return(win);
}
@@ -429,6 +457,9 @@ short guiwin_remove(GUIWIN *win)
void guiwin_get_grect(GUIWIN *win, enum guwin_area_e mode, GRECT *dest)
{
+
+ assert(win != NULL);
+
wind_get_grect(win->handle, WF_WORKXYWH, dest);
if (mode == GUIWIN_AREA_CONTENT) {
GRECT tb_area;
@@ -680,8 +711,16 @@ void guiwin_send_redraw(GUIWIN *win, GRECT *area)
};
EVMULT_OUT event_out;
- if(area == NULL) {
+ if (area == NULL) {
guiwin_get_grect(win, GUIWIN_AREA_WORK, &work);
+ if (work.g_w < 1 || work.g_h < 1) {
+ if (win->toolbar != NULL) {
+ guiwin_get_grect(win, GUIWIN_AREA_TOOLBAR, &work);
+ if (work.g_w < 1 || work.g_h < 1) {
+ return;
+ }
+ }
+ }
area = &work;
}
@@ -786,6 +825,3 @@ void guiwin_clear(GUIWIN *win)
wind_get_grect(win->handle, WF_NEXTXYWH, &g);
}
}
-
-
-
diff --git a/atari/redrawslots.c b/atari/gemtk/redrawslots.c
similarity index 95%
copy from atari/redrawslots.c
copy to atari/gemtk/redrawslots.c
index fdc3555..ee5627d 100644
--- a/atari/redrawslots.c
+++ b/atari/gemtk/redrawslots.c
@@ -17,9 +17,9 @@
*/
#include <stdbool.h>
-#include "windom.h"
-#include "utils/types.h"
-#include "atari/redrawslots.h"
+#define WITH_RECT
+#include "gemtk.h"
+#undef WITH_RECT
void redraw_slots_init(struct s_redrw_slots * slots, short size)
{
diff --git a/atari/save.h b/atari/gemtk/redrawslots.h
similarity index 85%
copy from atari/save.h
copy to atari/gemtk/redrawslots.h
index 0775723..d045b39 100644
--- a/atari/save.h
+++ b/atari/gemtk/redrawslots.h
@@ -16,7 +16,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef NSATARI_SAVE_H
-#define NSATARI_SAVE_H
+
+#ifndef ATARI_REDRAW_SLOTS_H
+#define ATARI_REDRAW_SLOTS_H
+
+#include <mt_gem.h>
+#include "utils/types.h"
+
+
#endif
diff --git a/atari/gui.c b/atari/gui.c
index 165fff6..888f82d 100755
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -150,7 +150,17 @@ void gui_poll(bool active)
// Handle events until there are no more messages pending or
// until the engine indicates activity:
- if(!(active || rendering) || (clock() >= next_poll)){
+ bool skip = false;
+/*
+ if (active || rendering){
+ if ((clock() < next_poll)){
+ skip = true;
+ } else {
+ next_poll = clock() + (CLOCKS_PER_SEC>>5);
+ }
+ }
+*/
+ //if (skip == false) {
do {
short mx, my, dummy;
@@ -163,15 +173,14 @@ void gui_poll(bool active)
LOG(("WM: %d\n", aes_msg_out[0]));
switch(aes_msg_out[0]) {
- case MN_SELECTED:
- LOG(("Menu Item: %d\n",aes_msg_out[4]));
- deskmenu_dispatch_item(aes_msg_out[3], aes_msg_out[4]);
- break;
- default:
- break;
- }
+ case MN_SELECTED:
+ LOG(("Menu Item: %d\n",aes_msg_out[4]));
+ deskmenu_dispatch_item(aes_msg_out[3], aes_msg_out[4]);
+ break;
+ default:
+ break;
+ }
}
-
if((aes_event_out.emo_events & MU_KEYBD) != 0) {
uint16_t nkc = gem_to_norm( (short)aes_event_out.emo_kmeta,
(short)aes_event_out.emo_kreturn);
@@ -180,12 +189,12 @@ void gui_poll(bool active)
}
}
} while ( gui_poll_repeat && !(active||rendering));
- if(input_window && input_window->root->redraw_slots.areas_used > 0 && !active){
+ if(input_window && input_window->root->redraw_slots.areas_used > 0){
window_process_redraws(input_window->root);
}
- if(active || rendering)
- next_poll = clock() + (CLOCKS_PER_SEC>>3);
- }
+ //} else {
+ //printf("skip poll %d (%d)\n", next_poll, clock());
+ //}
}
@@ -374,10 +383,11 @@ void gui_window_update_box(struct gui_window *gw, const struct rect *rect)
slid = guiwin_get_scroll_info(gw->root->win);
guiwin_get_grect(gw->root->win, GUIWIN_AREA_CONTENT, &area);
- area.g_x += rect->x0;
- area.g_y += rect->y0;
+ area.g_x += rect->x0 - (slid->x_pos * slid->x_unit_px);
+ area.g_y += rect->y0 - (slid->y_pos * slid->y_unit_px);
area.g_w = rect->x1 - rect->x0;
area.g_h = rect->y1 - rect->y0;
+ //dbg_grect("update box", &area);
window_schedule_redraw_grect(gw->root, &area);
}
@@ -597,15 +607,26 @@ void gui_window_stop_throbber(struct gui_window *w)
/* Place caret in window */
void gui_window_place_caret(struct gui_window *w, int x, int y, int height)
{
+
+ GRECT clip, dim;
+ struct guiwin_scroll_info_s * slid;
if (w == NULL)
return;
- if( w->browser->caret.current.g_w > 0 )
- gui_window_remove_caret( w );
- w->browser->caret.requested.g_x = x;
- w->browser->caret.requested.g_y = y;
- w->browser->caret.requested.g_w = 1;
- w->browser->caret.requested.g_h = height;
- w->browser->caret.redraw = true;
+
+ slid = guiwin_get_scroll_info(w->root->win);
+ window_get_grect(w->root, BROWSER_AREA_CONTENT, &clip);
+ dim.g_x = x - (slid->x_pos * slid->x_unit_px);
+ dim.g_y = y - (slid->y_pos * slid->y_unit_px);
+ dim.g_h = height;
+ dim.g_w = 2;
+ caret_show(&w->caret, guiwin_get_vdi_handle(w->root->win), &dim, &clip);
+// if( w->browser->caret.current.g_w > 0 )
+// gui_window_remove_caret( w );
+// w->browser->caret.requested.g_x = x;
+// w->browser->caret.requested.g_y = y;
+// w->browser->caret.requested.g_w = 1;
+// w->browser->caret.requested.g_h = height;
+// w->browser->caret.redraw = true;
return;
}
@@ -619,11 +640,11 @@ gui_window_remove_caret(struct gui_window *w)
if (w == NULL)
return;
- if( w->browser->caret.background.fd_addr != NULL ) {
- browser_restore_caret_background( w, NULL );
- w->browser->caret.requested.g_w = 0;
- w->browser->caret.current.g_w = 0;
- }
+// if( w->browser->caret.background.fd_addr != NULL ) {
+// browser_restore_caret_background( w, NULL );
+// w->browser->caret.requested.g_w = 0;
+// w->browser->caret.current.g_w = 0;
+// }
return;
}
@@ -829,16 +850,18 @@ void gui_401login_open(nsurl *url, const char *realm,
{
bool bres;
char * out = NULL;
- bres = login_form_do( url, (char*)realm, &out );
- if( bres ) {
+ bres = login_form_do( url, (char*)realm, &out);
+ if (bres) {
LOG(("url: %s, realm: %s, auth: %s\n", url, realm, out ));
- urldb_set_auth_details(url, realm, out );
+ urldb_set_auth_details(url, realm, out);
}
- if( out != NULL ) {
+ if (out != NULL) {
free( out );
}
- if( cb != NULL )
- cb(bres, cbpw);
+ if (cb != NULL) {
+ cb(bres, cbpw);
+ }
+
}
void gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
@@ -1065,6 +1088,7 @@ static void gui_init(int argc, char** argv)
aes_event_in.emi_m1leave = MO_LEAVE;
aes_event_in.emi_m1.g_w = 1;
aes_event_in.emi_m1.g_h = 1;
+ next_poll = clock() + (CLOCKS_PER_SEC>>3);
}
diff --git a/atari/gui.h b/atari/gui.h
index 7bedd2b..e12cf44 100755
--- a/atari/gui.h
+++ b/atari/gui.h
@@ -20,6 +20,7 @@
#define NS_ATARI_GUI_H_
#include "atari/redrawslots.h"
+#include "atari/caret.h"
#include "atari/gemtk/gemtk.h"
struct point_s {
@@ -97,6 +98,7 @@ typedef struct s_browser * CMP_BROWSER;
*/
struct s_gui_win_root
{
+ short aes_handle;
GUIWIN *win;
CMP_TOOLBAR toolbar;
CMP_STATUSBAR statusbar;
@@ -126,6 +128,7 @@ struct gui_window {
char * title;
char * url;
struct bitmap * icon;
+ struct s_caret caret;
struct gui_window *next, *prev;
};
diff --git a/atari/history.c b/atari/history.c
index e7db74b..77df2c9 100755
--- a/atari/history.c
+++ b/atari/history.c
@@ -38,6 +38,10 @@
#include "atari/res/netsurf.rsh"
#include "atari/history.h"
+
+//TODO: remove/add guiwin handle on close / open - so that the list
+// is kept tiny.
+
extern char * tree_directory_icon_name;
extern GRECT desk_area;
@@ -46,6 +50,7 @@ struct s_atari_global_history gl_history;
void global_history_open( void )
{
+ global_history_init();
if (gl_history.init == false ) {
return;
}
@@ -131,6 +136,7 @@ bool global_history_init( void )
void global_history_destroy( void )
{
+
if( gl_history.init == false ) {
return;
}
@@ -147,4 +153,9 @@ void global_history_destroy( void )
LOG(("done"));
}
+void global_history_redraw( void )
+{
+ atari_treeview_redraw( gl_history.tv );
+}
+
diff --git a/atari/history.h b/atari/history.h
index 2935793..3ea2621 100755
--- a/atari/history.h
+++ b/atari/history.h
@@ -39,11 +39,8 @@ void global_history_destroy( void );
void global_history_open( void );
void global_history_close( void );
-inline void global_history_redraw( void );
-inline void global_history_redraw( void )
-{
- atari_treeview_redraw( gl_history.tv );
-}
+void global_history_redraw( void );
+
#endif
diff --git a/atari/hotlist.c b/atari/hotlist.c
index f79a161..ccba088 100755
--- a/atari/hotlist.c
+++ b/atari/hotlist.c
@@ -44,6 +44,9 @@
#include "atari/gemtk/gemtk.h"
#include "atari/res/netsurf.rsh"
+//TODO: remove/add guiwin handle on close / open - so that the list
+// is kept tiny.
+
extern GRECT desk_area;
struct atari_hotlist hl;
@@ -86,7 +89,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
break;
case WM_CLOSED:
- hotlist_close();
+ hotlist_destroy();
break;
default: break;
@@ -101,49 +104,51 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
void hotlist_init(void)
{
- if( strcmp(nsoption_charp(hotlist_file), "") == 0 ){
- atari_find_resource( (char*)&hl.path, "hotlist", "hotlist" );
- } else {
- strncpy( (char*)&hl.path, nsoption_charp(hotlist_file), PATH_MAX-1 );
- }
-
- LOG(("Hotlist: %s", (char*)&hl.path ));
-
- if( hl.window == NULL ){
- int flags = ATARI_TREEVIEW_WIDGETS;
- short handle = -1;
- GRECT desk;
- OBJECT * tree = get_tree(TOOLBAR_HOTLIST);
- assert( tree );
- hl.open = false;
-
- handle = wind_create(flags, 0, 0, desk_area.g_w, desk_area.g_h);
- hl.window = guiwin_add(handle, GW_FLAG_DEFAULTS, NULL);
- if( hl.window == NULL ) {
- LOG(("Failed to allocate Hotlist"));
- return;
+ if (hl.init == false) {
+ if( strcmp(nsoption_charp(hotlist_file), "") == 0 ){
+ atari_find_resource( (char*)&hl.path, "hotlist", "hotlist" );
+ } else {
+ strncpy( (char*)&hl.path, nsoption_charp(hotlist_file), PATH_MAX-1 );
}
- wind_set_str(handle, WF_NAME, (char*)messages_get("Hotlist"));
- guiwin_set_toolbar(hl.window, tree, 0, 0);
- hl.tv = atari_treeview_create(
- hotlist_get_tree_flags(),
- hl.window,
- handle_event
- );
- if (hl.tv == NULL) {
- /* handle it properly, clean up previous allocs */
- LOG(("Failed to allocate treeview"));
- return;
- }
-
- hotlist_initialise(
- hl.tv->tree,
- (char*)&hl.path,
- "dir.png"
- );
- } else {
+ LOG(("Hotlist: %s", (char*)&hl.path ));
+
+ if( hl.window == NULL ){
+ int flags = ATARI_TREEVIEW_WIDGETS;
+ short handle = -1;
+ GRECT desk;
+ OBJECT * tree = get_tree(TOOLBAR_HOTLIST);
+ assert( tree );
+ hl.open = false;
+
+ handle = wind_create(flags, 0, 0, desk_area.g_w, desk_area.g_h);
+ hl.window = guiwin_add(handle, GW_FLAG_DEFAULTS, NULL);
+ if( hl.window == NULL ) {
+ LOG(("Failed to allocate Hotlist"));
+ return;
+ }
+ wind_set_str(handle, WF_NAME, (char*)messages_get("Hotlist"));
+ guiwin_set_toolbar(hl.window, tree, 0, 0);
+ hl.tv = atari_treeview_create(
+ hotlist_get_tree_flags(),
+ hl.window,
+ handle_event
+ );
+ if (hl.tv == NULL) {
+ /* handle it properly, clean up previous allocs */
+ LOG(("Failed to allocate treeview"));
+ return;
+ }
+
+ hotlist_initialise(
+ hl.tv->tree,
+ (char*)&hl.path,
+ "dir.png"
+ );
+
+ } else {
+ }
}
hl.init = true;
}
@@ -151,6 +156,7 @@ void hotlist_init(void)
void hotlist_open(void)
{
+ hotlist_init();
if( hl.init == false ) {
return;
}
@@ -180,12 +186,13 @@ void hotlist_close(void)
void hotlist_destroy(void)
{
- if( hl.init == false ) {
+
+ if( hl.init == false) {
return;
}
if( hl.window != NULL ) {
hotlist_cleanup( (char*)&hl.path );
- if( hl.open )
+ if (hl.open)
hotlist_close();
wind_delete(guiwin_get_handle(hl.window));
guiwin_remove(hl.window);
@@ -196,6 +203,12 @@ void hotlist_destroy(void)
LOG(("done"));
}
+void hotlist_redraw(void)
+{
+ int i = 01;
+ atari_treeview_redraw(hl.tv);
+}
+
struct node;
void atari_hotlist_add_page( const char * url, const char * title )
@@ -206,6 +219,8 @@ void atari_hotlist_add_page( const char * url, const char * title )
NSTREEVIEW tv = hl.tv;
if(hl.tv == NULL )
return;
+ // TODO: do no open hotlist, and remove guiwin on close...
+ hotlist_open();
if( hl.tv->click.x >= 0 && hl.tv->click.y >= 0 ){
hotlist_add_page_xy( url, hl.tv->click.x, hl.tv->click.y );
} else {
diff --git a/atari/hotlist.h b/atari/hotlist.h
index 858d1a1..ed965a5 100755
--- a/atari/hotlist.h
+++ b/atari/hotlist.h
@@ -41,10 +41,7 @@ void hotlist_close( void );
void hotlist_destroy( void );
void atari_hotlist_add_page( const char * url, const char * title );
-inline void hotlist_redraw( void );
-inline void hotlist_redraw( void )
-{
- atari_treeview_redraw( hl.tv );
-}
+void hotlist_redraw( void );
+
#endif
diff --git a/atari/misc.c b/atari/misc.c
index d0d4cd5..27c68b6 100755
--- a/atari/misc.c
+++ b/atari/misc.c
@@ -488,8 +488,7 @@ const char * file_select( const char * title, const char * name ) {
}
if( FselInput( path, tmpname, (char*)"", use_title, NULL, NULL)) {
- strncpy( fullname, path, PATH_MAX-1 );
- strncat( fullname, tmpname, PATH_MAX-strlen(fullname)-1 );
+ snprintf(fullname, PATH_MAX, "%s%s", path, tmpname);
return( (const char*)&fullname );
}
return( NULL );
diff --git a/atari/res/netsurf.rsc b/atari/res/netsurf.rsc
index 6addf82..da3d251 100755
Binary files a/atari/res/netsurf.rsc and b/atari/res/netsurf.rsc differ
diff --git a/atari/res/netsurf.rsh b/atari/res/netsurf.rsh
index 8245526..5ad6b90 100755
--- a/atari/res/netsurf.rsh
+++ b/atari/res/netsurf.rsh
@@ -113,7 +113,7 @@
#define DOWNLOAD_LBL_BYTES 6 /* TEXT in tree DOWNLOAD */
#define DOWNLOAD_LBL_PERCENT 7 /* TEXT in tree DOWNLOAD */
#define DOWNLOAD_LBL_SPEED 8 /* TEXT in tree DOWNLOAD */
-#define DOWNLOAD_CB_CLOSE_RDY 9 /* BUTTON in tree DOWNLOAD */
+#define DOWNLOAD_CB_CLOSE_RDY 9 /* BOXCHAR in tree DOWNLOAD */
#define ABOUT 11 /* form/dial */
@@ -209,3 +209,20 @@
#define VSCROLLER_BT_DOWN_PIC 5 /* CICON in tree VSCROLLER */
#define VSCROLLER_BT_UP 6 /* IBOX in tree VSCROLLER */
#define VSCROLLER_BT_UP_PIC 4 /* CICON in tree VSCROLLER */
+
+#define SETTINGS 15 /* form/dial */
+#define SETTINGS_EDIT_HOMEPAGE_00 2 /* FTEXT in tree SETTINGS */
+#define SETTINGS_LBL_CB_HIDE_ADVERTISEMENT 3 /* STRING in tree SETTINGS */
+#define SETTINGS_LBL_CB_DISABLE_POPUP_WINDOWS 4 /* STRING in tree SETTINGS */
+#define SETTINGS_CB_HIDE_ADVERTISEMENT 5 /* BOXCHAR in tree SETTINGS */
+#define SETTINGS_CB_DISABLE_POPUP_WINDOWS 6 /* BOXCHAR in tree SETTINGS */
+#define SETTINGS_LBL_CB_SEND_HTTP_REFERRER 7 /* STRING in tree SETTINGS */
+#define SETTINGS_CB_SEND_HTTP_REFERRER 8 /* BOXCHAR in tree SETTINGS */
+#define SETTINGS_LBL_CB_SEND_DO_NOT_TRACK 9 /* STRING in tree SETTINGS */
+#define SETTINGS_CB_SEND_DO_NOT_TRACK 10 /* BOXCHAR in tree SETTINGS */
+#define SETTINGS_DEC_HISTORY_AGE 12 /* BOXCHAR in tree SETTINGS */
+#define SETTINGS_EDIT_HISTORY_AGE 13 /* FTEXT in tree SETTINGS */
+#define SETTINGS_INC_HISTORY_AGE 14 /* BOXCHAR in tree SETTINGS */
+#define SETTINGS_BT_CLEAR_HISTORY 15 /* BUTTON in tree SETTINGS */
+#define SETTINGS_BT_SEL_LOCALE 17 /* BUTTON in tree SETTINGS */
+#define SETTINGS_BT_GUI_LANG 19 /* BUTTON in tree SETTINGS */
diff --git a/atari/res/netsurf.rsm b/atari/res/netsurf.rsm
index 6c8e2e1..6f9ae05 100755
--- a/atari/res/netsurf.rsm
+++ b/atari/res/netsurf.rsm
@@ -1,9 +1,9 @@
ResourceMaster v3.65
-#C 15@0@0@0@
+#C 16@0@0@0@
#N 99@32@AZAaza___ _@AZAaza090___ _@@_@
#FoC-Header@rsm2out@C-Header@rsh@@@[C-Header@0@
#R 0@0@1@1@1@1@
-#M 20010100@0@7728@623@
+#M 20010100@0@7728@625@
#T 0@1@MAINMENU@@62@@
#O 4@32@T_FILE@@
#O 5@32@T_EDIT@@
@@ -107,7 +107,7 @@ ResourceMaster v3.65
#O 6@21@LBL_BYTES@@
#O 7@21@LBL_PERCENT@@
#O 8@21@LBL_SPEED@@
-#O 9@26@CB_CLOSE_RDY@@
+#O 9@27@CB_CLOSE_RDY@@
#T 11@2@ABOUT@@2@@
#T 12@2@POP_CTX@@12@@
#O 1@21@CUT_SEL@@
@@ -198,4 +198,20 @@ ResourceMaster v3.65
#O 5@33@BT_DOWN_PIC@@
#O 6@25@BT_UP@@
#O 4@33@BT_UP_PIC@@
-#c 32640@
+#T 15@2@SETTINGS@@21@@
+#O 2@29@EDIT_HOMEPAGE_00@@
+#O 3@28@LBL_CB_HIDE_ADVERTISEMENT@@
+#O 4@28@LBL_CB_DISABLE_POPUP_WINDOWS@@
+#O 5@27@CB_HIDE_ADVERTISEMENT@@
+#O 6@27@CB_DISABLE_POPUP_WINDOWS@@
+#O 7@28@LBL_CB_SEND_HTTP_REFERRER@@
+#O 8@27@CB_SEND_HTTP_REFERRER@@
+#O 9@28@LBL_CB_SEND_DO_NOT_TRACK@@
+#O 10@27@CB_SEND_DO_NOT_TRACK@@
+#O 12@27@DEC_HISTORY_AGE@@
+#O 13@29@EDIT_HISTORY_AGE@@
+#O 14@27@INC_HISTORY_AGE@@
+#O 15@26@BT_CLEAR_HISTORY@@
+#O 17@26@BT_SEL_LOCALE@@
+#O 19@26@BT_GUI_LANG@@
+#c 28255@
diff --git a/atari/rootwin.c b/atari/rootwin.c
index 3a2af1c..7c85511 100755
--- a/atari/rootwin.c
+++ b/atari/rootwin.c
@@ -165,7 +165,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
short ghandle = wind_find(ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_y);
- if (guiwin_get_handle(data->rootwin->win)==ghandle) {
+ if (data->rootwin->aes_handle==ghandle) {
// The window found at x,y is an gui_window
// and it's the input window.
window_get_grect(data->rootwin, BROWSER_AREA_CONTENT,
@@ -204,7 +204,6 @@ int window_create(struct gui_window * gw,
int err = 0;
bool tb, sb;
int flags;
- short aes_handle;
tb = (inflags & WIDGET_TOOLBAR);
sb = (inflags & WIDGET_STATUSBAR);
@@ -229,13 +228,13 @@ int window_create(struct gui_window * gw,
redraw_slots_init(&gw->root->redraw_slots, 8);
// TODO: use desk size
- aes_handle = wind_create(flags, 40, 40, app.w, app.h);
- if(aes_handle<0) {
+ gw->root->aes_handle = wind_create(flags, 40, 40, app.w, app.h);
+ if(gw->root->aes_handle<0) {
free(gw->root->title);
free(gw->root);
return( -1 );
}
- gw->root->win = guiwin_add(aes_handle,
+ gw->root->win = guiwin_add(gw->root->aes_handle,
GW_FLAG_PREPROC_WM | GW_FLAG_RECV_PREPROC_WM, handle_event);
struct rootwin_data_s * data = malloc(sizeof(struct rootwin_data_s));
@@ -265,10 +264,10 @@ int window_create(struct gui_window * gw,
}
// Setup some window defaults:
- wind_set_str(aes_handle, WF_ICONTITLE, (char*)"NetSurf");
- wind_set(aes_handle, WF_OPTS, 1, WO0_FULLREDRAW, 0, 0);
- wind_set(aes_handle, WF_OPTS, 1, WO0_NOBLITW, 0, 0);
- wind_set(aes_handle, WF_OPTS, 1, WO0_NOBLITH, 0, 0);
+ wind_set_str(gw->root->aes_handle, WF_ICONTITLE, (char*)"NetSurf");
+ wind_set(gw->root->aes_handle, WF_OPTS, 1, WO0_FULLREDRAW, 0, 0);
+ wind_set(gw->root->aes_handle, WF_OPTS, 1, WO0_NOBLITW, 0, 0);
+ wind_set(gw->root->aes_handle, WF_OPTS, 1, WO0_NOBLITH, 0, 0);
if (inflags & WIN_TOP) {
window_set_focus(gw->root, BROWSER, gw->browser);
@@ -332,6 +331,8 @@ int window_destroy(ROOTWIN *rootwin)
free(rootwin->title);
guiwin_remove(rootwin->win);
+ wind_close(rootwin->aes_handle);
+ wind_delete(rootwin->aes_handle);
free(rootwin);
return(err);
}
@@ -344,9 +345,8 @@ void window_open(ROOTWIN *rootwin, GRECT pos)
assert(rootwin->active_gui_window != NULL);
- short aes_handle = guiwin_get_handle(rootwin->win);
- wind_open(aes_handle, pos.g_x, pos.g_y, pos.g_w, pos.g_h );
- wind_set_str(aes_handle, WF_NAME, (char *)"");
+ wind_open(rootwin->aes_handle, pos.g_x, pos.g_y, pos.g_w, pos.g_h );
+ wind_set_str(rootwin->aes_handle, WF_NAME, (char *)"");
rootwin->active_gui_window->browser->attached = true;
if(rootwin->statusbar != NULL) {
@@ -387,7 +387,7 @@ void window_set_stauts(struct s_gui_win_root *rootwin, char * text)
void window_set_title(struct s_gui_win_root * rootwin, char *title)
{
- wind_set_str(guiwin_get_handle(rootwin->win), WF_NAME, title);
+ wind_set_str(rootwin->aes_handle, WF_NAME, title);
}
void window_scroll_by(ROOTWIN *root, int sx, int sy)
@@ -662,13 +662,12 @@ static void window_redraw_content(ROOTWIN *rootwin, GRECT *content_area,
void window_process_redraws(ROOTWIN * rootwin)
{
GRECT work, visible_ro, tb_area, content_area;
- short aes_handle, i;
+ short i;
bool toolbar_rdrw_required;
struct guiwin_scroll_info_s *slid =NULL;
redraw_active = true;
- aes_handle = guiwin_get_handle(rootwin->win);
guiwin_get_grect(rootwin->win, GUIWIN_AREA_TOOLBAR, &tb_area);
guiwin_get_grect(rootwin->win, GUIWIN_AREA_CONTENT, &content_area);
@@ -685,7 +684,7 @@ void window_process_redraws(ROOTWIN * rootwin)
while(plot_lock() == false);
- wind_get_grect(aes_handle, WF_FIRSTXYWH, &visible_ro);
+ wind_get_grect(rootwin->aes_handle, WF_FIRSTXYWH, &visible_ro);
while (visible_ro.g_w > 0 && visible_ro.g_h > 0) {
// TODO: optimze the rectangle list -
@@ -717,7 +716,7 @@ void window_process_redraws(ROOTWIN * rootwin)
}
}
- wind_get_grect(aes_handle, WF_NEXTXYWH, &visible_ro);
+ wind_get_grect(rootwin->aes_handle, WF_NEXTXYWH, &visible_ro);
}
vs_clip(guiwin_get_vdi_handle(rootwin->win), 0, pxy_clip);
rootwin->redraw_slots.areas_used = 0;
@@ -985,10 +984,8 @@ static void on_redraw(ROOTWIN *rootwin, short msg[8])
static void on_resized(ROOTWIN *rootwin)
{
GRECT g;
- short handle;
struct gui_window *gw;
- handle = guiwin_get_handle(rootwin->win);
gw = window_get_active_gui_window(rootwin);
//printf("resized...\n");
@@ -998,7 +995,7 @@ static void on_resized(ROOTWIN *rootwin)
if(gw == NULL)
return;
- wind_get_grect(handle, WF_CURRXYWH, &g);
+ wind_get_grect(rootwin->aes_handle, WF_CURRXYWH, &g);
if (rootwin->loc.g_w != g.g_w || rootwin->loc.g_h != g.g_h) {
if ( gw->browser->bw->current_content != NULL ) {
diff --git a/atari/settings.c b/atari/settings.c
index 0aa78cc..785d6f3 100644
--- a/atari/settings.c
+++ b/atari/settings.c
@@ -1,20 +1,3 @@
-/*
- * Copyright 2012 Ole Loots <ole(a)monochrom.net>
- *
- * This file is part of NetSurf, http://www.netsurf-browser.org/
- *
- * NetSurf is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * NetSurf is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
#include <sys/types.h>
#include <sys/stat.h>
@@ -38,10 +21,10 @@
#include "atari/findfile.h"
#include "atari/gemtk/gemtk.h"
-extern char options[PATH_MAX];
+extern char options[PATH_MAX];
+extern GRECT desk_area;
+
-static OBJECT * dlgtree;
-static WINDOW * dlgwin;
static float tmp_option_memory_cache_size;
static float tmp_option_minimum_gif_delay;
@@ -52,893 +35,139 @@ static unsigned int tmp_option_min_reflow_period;
static unsigned int tmp_option_max_fetchers;
static unsigned int tmp_option_max_fetchers_per_host;
static unsigned int tmp_option_max_cached_fetch_handles;
-static colour tmp_option_atari_toolbar_bg;
-
-/* Tab forms and their buttons: */
-static int frms[] = {
- CHOICES_TAB_BROWSER,
- CHOICES_TAB_RENDER,
- CHOICES_TAB_STYLE,
- CHOICES_TAB_NETWORK,
- CHOICES_TAB_PATH,
- CHOICES_TAB_CACHE
-};
-
-static int buts[] = {
- CHOICES_REG_BROWSER,
- CHOICES_REG_RENDER,
- CHOICES_REG_STYLE,
- CHOICES_REG_NETWORK,
- CHOICES_REG_PATH,
- CHOICES_REG_CACHE
-};
-
-#define OBJ_SELECTED(idx) ((dlgtree[idx].ob_state & SELECTED)!=0)
-#define OBJ_CHECK(idx) SET_BIT(dlgtree[idx].ob_state, SELECTED, 1);
-#define OBJ_UNCHECK(idx) SET_BIT(dlgtree[idx].ob_state, SELECTED, 0);
-
-#define DISABLE_OBJ(idx) SET_BIT(dlgtree[idx].ob_state, DISABLED, 1); \
- ObjcDraw( OC_FORM, dlgwin, idx, 1 )
-
-#define ENABLE_OBJ(idx) SET_BIT(dlgtree[idx].ob_state, DISABLED, 0); \
- ObjcDraw( OC_FORM, dlgwin, idx, 1 )
-
-#define FORMEVENT(idx) form_event( NULL, idx, 0, NULL );
-
-#define INPUT_HOMEPAGE_URL_MAX_LEN 44
-#define INPUT_LOCALE_MAX_LEN 6
-#define INPUT_PROXY_HOST_MAX_LEN 31
-#define INPUT_PROXY_USERNAME_MAX_LEN 36
-#define INPUT_PROXY_PASSWORD_MAX_LEN 36
-#define INPUT_PROXY_PORT_MAX_LEN 5
-#define INPUT_MIN_REFLOW_PERIOD_MAX_LEN 4
-#define LABEL_FONT_RENDERER_MAX_LEN 8
-#define LABEL_PATH_MAX_LEN 43
-#define LABEL_ICONSET_MAX_LEN 8
-#define INPUT_TOOLBAR_COLOR_MAX_LEN 6
-
-static void toggle_objects( void );
-static void display_settings( void );
-static void apply_settings( void );
-static void __CDECL onclose( WINDOW *win, short buff[8] );
-static void __CDECL
- closeform( WINDOW *win, int index, int unused, void *unused2);
-static void __CDECL
- saveform( WINDOW *win, int index, int unused, void *unused2);
-static void __CDECL
- form_event( WINDOW *win, int index, int unused, void *unused2);
-static void __CDECL
- clear_history( WINDOW *win, int index, int unused, void *unused2);
-
-
-
-WINDOW * open_settings()
-{
-
- if( dlgtree == NULL){
- dlgtree = get_tree(CHOICES);
- if( dlgtree == NULL ){
- return( NULL );
- }
- }
-
- if( dlgwin == NULL){
- // TODO: localize title
- dlgwin = FormCreate(dlgtree, WAT_FORM, NULL, (char*)"Settings",
- NULL, TRUE, FALSE);
- if( !dlgwin ){
- return( NULL );
- }
- FormThumb( dlgwin, frms, buts, sizeof(frms) / sizeof(int) );
-
- /* Atach events to dialog buttons: */
- ObjcAttachFormFunc( dlgwin, CHOICES_ABORT, closeform, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_OK, saveform, NULL);
-
- /* Connect interactive dialog elements to generic event handler: */
- ObjcAttachFormFunc( dlgwin, CHOICES_CB_USE_PROXY, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_CB_PROXY_AUTH, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_EDIT_DOWNLOAD_PATH, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_EDIT_HOTLIST_FILE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_EDIT_CA_BUNDLE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_EDIT_CA_CERTS_PATH, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_EDIT_EDITOR, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INC_GIF_DELAY, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_DEC_GIF_DELAY, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INC_INCREMENTAL_REFLOW, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_DEC_INCREMENTAL_REFLOW, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INC_CACHED_CONNECTIONS, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_DEC_CACHED_CONNECTIONS, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INC_MAX_FETCHERS_PER_HOST, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_DEC_MAX_FETCHERS_PER_HOST, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_DEC_MAX_FETCHERS, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INC_MAX_FETCHERS, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INC_DEF_FONT_SIZE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_DEC_DEF_FONT_SIZE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INC_MIN_FONT_SIZE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_DEC_MIN_FONT_SIZE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INC_MEM_CACHE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_DEC_MEM_CACHE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INC_HISTORY_AGE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_DEC_HISTORY_AGE, form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_BT_SEL_FONT_RENDERER,
- form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_BT_SEL_LOCALE,
- form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_INPUT_TOOLBAR_BGCOLOR,
- form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_BT_TOOLBAR_ICONSET,
- form_event, NULL);
- ObjcAttachFormFunc( dlgwin, CHOICES_BT_CLEAR_HISTORY,
- clear_history, NULL);
-
- EvntAdd( dlgwin, WM_CLOSED, onclose, EV_TOP );
- display_settings();
- toggle_objects();
-
- } else {
- WindTop( dlgwin );
- display_settings();
- toggle_objects();
- }
- return( dlgwin );
-}
-
-void close_settings(void)
-{
- if( dlgwin != NULL ){
- /* Duplicated form tree must be free'd manualy? */
- WindClose(dlgwin);
- dlgwin = NULL;
- }
-
-}
-
-static void set_text( short idx, char * text, int len )
-{
- char spare[255];
-
- if( len > 254 )
- len = 254;
- if( text != NULL ){
- strncpy( spare, text, 254);
- ObjcStrFmt( spare, text, len );
- } else {
- strcpy(spare, "");
- }
- ObjcStrCpy( dlgtree, idx, spare );
-
-}
-
-
-static void __CDECL onclose( WINDOW *win, short buff[8] )
-{
- close_settings();
-}
-
-static void __CDECL
-closeform( WINDOW *win, int index, int unused, void *unused2)
-{
- ObjcChange( OC_FORM, win, index, ~SELECTED, TRUE);
- close_settings();
-}
-
-static void __CDECL
-saveform( WINDOW *win, int index, int unused, void *unused2)
-{
- apply_settings();
- // Save settings
- nsoption_write( (const char*)&options );
- nsoption_read( (const char*)&options );
- close_settings();
- ObjcChange( OC_FORM, win, index, NORMAL, TRUE);
- form_alert(1, "[1][Some options require an netsurf restart!][OK]");
- deskmenu_update();
-}
-
-static void __CDECL clear_history( WINDOW *win, int index, int unused,
- void *unused2)
-{
-
-}
-
-
-static colour color_popup(int x, int y, colour current)
-{
-#define GRID_ROWS 9
-#define GRID_COLS 27
- colour retval = current;
- int boxwidth=6, boxheight=8;
- struct bitmap *palette_img;
- MFDB bg, screen;
- GRECT bgarea = {x, y, GRID_COLS*boxwidth+4, GRID_ROWS*boxheight+4};
- short web_std_colors[6] = {0, 51, 102, 153, 204, 255};
- int r,g,b;
- int xpos = 0, ypos = 0;
- colour palette[216+8];
- int i=0;
-
- plot_style_t drawcolour = {
- .stroke_type = PLOT_OP_TYPE_NONE,
- .fill_type = PLOT_OP_TYPE_SOLID,
- .fill_colour = 0
- };
-
- plot_style_t outline = {
- .stroke_type = PLOT_OP_TYPE_SOLID,
- .stroke_colour = 0xAAAAAA,
- .stroke_width = 2,
- .fill_type = PLOT_OP_TYPE_NONE,
- .fill_colour = 0
- };
-
- /* create a palette array (web colors): */
- for (r=0; r<6; r++) {
- for (g=0; g<6; g++) {
- for (b=0; b<6; b++) {
- palette[i] = ((web_std_colors[b]<<16)
- | (web_std_colors[g]<<8)
- | web_std_colors[r]);
- i++;
- }
- }
- }
-
- /* setup the gray color values: */
- int z = 0;
- colour grays[15] = {0x111111, 0x222222, 0x333333, 0x444444,
- 0x555555, 0x666666, 0x777777, 0x888888,
- 0x999999, 0x999999, 0xAAAAAA, 0xBBBBBB,
- 0xCCCCCC, 0xDDDDDD, 0xEEEEEE};
- for (z=0;i<243;i++) {
- if (z<15)
- palette[i] = grays[z];
- else
- palette[i] = 0x000000;
- z++;
- }
-
- plot_set_dimensions(x, y,
- (GRID_COLS*boxwidth)+4, (GRID_ROWS*boxheight)+4);
- plot_lock();
-
- // store background:
- short pxy[8];
- init_mfdb(app.nplanes, bgarea.g_w, bgarea.g_h, 0, &bg);
- init_mfdb(0, bgarea.g_w, bgarea.g_h, 0, &screen);
-
- pxy[0] = bgarea.g_x;
- pxy[1] = bgarea.g_y;
- pxy[2] = bgarea.g_x + bgarea.g_w - 1;
- pxy[3] = bgarea.g_y + bgarea.g_h - 1;
- pxy[4] = 0;
- pxy[5] = 0;
- pxy[6] = bgarea.g_w - 1;
- pxy[7] = bgarea.g_h - 1;
-
- /* copy screen image */
- vro_cpyfm (app.graf.handle, S_ONLY, pxy, &screen, &bg);
-
- plot_line(x, y, x+(GRID_COLS*boxwidth)+2, y,
- &outline);
-
- plot_line(x, y+(GRID_ROWS*boxheight)+2, x+(GRID_COLS*boxwidth)+2,
- y+(GRID_ROWS*boxheight)+2,
- &outline);
-
- /* draw a 27*8 grid: */
- for (i=0; i<243; i++){
- drawcolour.fill_colour = palette[i];
- plot_rectangle(xpos+2, ypos+2, xpos+boxwidth+2, ypos+boxheight+2,
- &drawcolour);
- xpos += boxwidth;
- if (xpos >= GRID_COLS*boxwidth) {
- xpos = 0;
- ypos += boxheight;
- }
+static colour tmp_option_atari_toolbar_bg;
+
+static short h_aes_win = 0;
+static GUIWIN * settings_guiwin = NULL;
+static OBJECT * dlgtree;
+
+static void on_close(void);
+static void on_redraw(GRECT *clip);
+
+
+static void on_redraw(GRECT *clip)
+{
+ GRECT visible, work, clip_ro;
+ int scroll_px_x, scroll_px_y;
+ struct guiwin_scroll_info_s *slid;
+
+ /*Walk the AES rectangle list and redraw the visible areas of the window: */
+ guiwin_get_grect(settings_guiwin, GUIWIN_AREA_CONTENT, &work);
+ slid = guiwin_get_scroll_info(settings_guiwin);
+
+ dlgtree->ob_x = work.g_x - (slid->x_pos * slid->x_unit_px);
+ dlgtree->ob_y = work.g_y - (slid->y_pos * slid->y_unit_px);
+
+ wind_get_grect(h_aes_win, WF_FIRSTXYWH, &visible);
+ while (visible.g_x && visible.g_y) {
+ if (rc_intersect(clip, &visible)) {
+ objc_draw_grect(dlgtree, 0, 8, &visible);
+ }
+ wind_get_grect(h_aes_win, WF_NEXTXYWH, &visible);
}
+}
- // enable mouse cursor (screen keeps beeing locked):
- graf_mouse(M_ON, NULL);
-
- /* fetch mouse event: */
- mt_EvntDisable(&app, dlgwin, WM_XBUTTON);
- EvntWindom(MU_BUTTON);
- mt_EvntEnable(&app, dlgwin, WM_XBUTTON);
-
- /* calulate clicked grid coords: */
- int row = ((evnt.my-y)/boxheight);
- int col = ((evnt.mx-x)/boxwidth);
-
- if (row >= 0 && row <= GRID_ROWS-1 && col >= 0 && col <= GRID_COLS-1) {
- assert( (GRID_COLS*row)+(col) >= 0 );
- assert( (GRID_COLS*row)+(col) < 243 );
- retval = palette[(GRID_COLS*row)+(col)];
- }
-
- /* restore background: */
- w_put_bkgr(&app, bgarea.g_x, bgarea.g_y, bgarea.g_w, bgarea.g_h, &bg);
- free(bg.fd_addr);
-
- plot_unlock();
-
-#undef GRID_COLS
-#undef GRID_ROWS
-
- return(retval);
-}
-
-/**
-* Displays a popup to select available icon sets,
- the returned string is no longer than 8 characters.
-* \param x x pos of popup
-* \param y y pos of popup
-* \return the selected string or NULL on failure.
-*/
-static char * toolbar_iconset_popup( int x, int y )
-{
- #define MAX_SETS 24
- DIR *dp;
- struct dirent *ep;
- struct stat statbuf;
- char * current = NULL;
- char *avail[MAX_SETS];
- int selected = 0, navail = 0, i, choice=-1;
- static char toolbar_folder[PATH_MAX];
- char fullpath[PATH_MAX];
-
- strncpy( fullpath, nsoption_charp(tree_icons_path), 255 );
- path_add_part( fullpath, 255, "toolbar/" );
-
- /* Get current set (for pre-selection): */
- memset( avail, 0, MAX_SETS );
- current = "";
-
- /* locate the toolbar folder: */
- atari_find_resource( toolbar_folder, fullpath, fullpath );
-
- /* search for iconset folders: */
- dp = opendir (toolbar_folder);
- if (dp != NULL){
- while (ep = readdir (dp)) {
- if (strlen(ep->d_name) < 3)
- continue;
- snprintf(fullpath, PATH_MAX-1, "%s/%s", toolbar_folder, ep->d_name );
- if (is_dir(fullpath)) {
- if (strcmp(ep->d_name, current) == 0)
- selected = navail;
- /* store the folder name: */
- avail[navail] = malloc( strlen(ep->d_name)+1 );
- sprintf( avail[navail], "%s", ep->d_name );
- navail++;
- if( navail >= MAX_SETS )
- break;
- }
- }
- (void) closedir (dp);
- }
-
-
- if (navail > 0){
- choice = MenuPopUp( avail, x, y, navail,
- -1, selected, P_LIST | P_CHCK );
- if (choice > 0)
- snprintf( toolbar_folder, 9, "%s", avail[choice-1] );
- }
-
- for (i=0;i<navail; i++ ) {
- free( avail[i] );
- }
- if (choice > 0)
- return( toolbar_folder );
- else
- return( NULL );
- #undef MAX_SETS
-}
-
-static void __CDECL
-form_event( WINDOW *win, int index, int external, void *unused2)
-{
- char spare[255];
- bool is_button = false;
- bool checked = OBJ_SELECTED( index );
- char * tmp;
-
- /* For font driver popup: */
- const char *font_driver_items[] = {"freetype", "internal" };
- int num_font_drivers = (sizeof(font_driver_items)/sizeof(char*));
-
- /*
- Just a small collection of locales, each country has at least one
- ATARI-clone user! :)
- */
- const char *locales[] = {
- "cs", "de", "de-de" , "en", "en-gb", "en-us", "es",
- "fr", "it", "nl", "no", "pl", "ru", "sk", "sv"
- };
- int num_locales = (sizeof(locales)/sizeof(char*));
- short x, y;
- int choice;
+static short on_aes_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
+{
+ short retval = 0;
+ GRECT clip, work;
- switch( index ){
-
- case CHOICES_CB_USE_PROXY:
- if( checked ){
- ENABLE_OBJ( CHOICES_EDIT_PROXY_HOST );
- ENABLE_OBJ( CHOICES_CB_PROXY_AUTH );
- }
- else {
- DISABLE_OBJ( CHOICES_EDIT_PROXY_HOST );
- DISABLE_OBJ( CHOICES_CB_PROXY_AUTH );
- }
- FORMEVENT( CHOICES_CB_PROXY_AUTH );
- ObjcDrawParent(OC_FORM, dlgwin, index, 9, 1 );
- break;
-
- case CHOICES_CB_PROXY_AUTH:
- if( checked && OBJ_SELECTED( CHOICES_CB_USE_PROXY ) ){
- ENABLE_OBJ(CHOICES_EDIT_PROXY_USERNAME);
- ENABLE_OBJ(CHOICES_EDIT_PROXY_PASSWORD);
- }
- else {
- DISABLE_OBJ(CHOICES_EDIT_PROXY_USERNAME);
- DISABLE_OBJ(CHOICES_EDIT_PROXY_PASSWORD);
- }
- break;
-
- case CHOICES_CB_ENABLE_ANIMATION:
- if( checked ){
- ENABLE_OBJ( CHOICES_EDIT_MIN_GIF_DELAY );
- }
- else {
- DISABLE_OBJ( CHOICES_EDIT_MIN_GIF_DELAY );
- }
- break;
-
- case CHOICES_BT_SEL_FONT_RENDERER:
- if( external ){
- objc_offset( FORM(win), CHOICES_BT_SEL_FONT_RENDERER, &x, &y);
- choice = MenuPopUp ( font_driver_items, x, y,
- num_font_drivers,
- -1, -1, P_LIST + P_WNDW + P_CHCK );
- if( choice > 0 &&
- choice <= num_font_drivers ){
- ObjcStrCpy( dlgtree, CHOICES_BT_SEL_FONT_RENDERER,
- (char*)font_driver_items[choice-1] );
- }
- ObjcChange( OC_FORM, win, index, NORMAL, TRUE);
- }
- tmp = ObjcString( dlgtree, CHOICES_BT_SEL_FONT_RENDERER, NULL);
- if( strcmp(tmp, "freetype") == 0 ){
- ENABLE_OBJ( CHOICES_CB_ANTI_ALIASING );
- } else {
- DISABLE_OBJ( CHOICES_CB_ANTI_ALIASING );
- }
- break;
-
- case CHOICES_BT_SEL_LOCALE:
- objc_offset( FORM(win), CHOICES_BT_SEL_LOCALE, &x, &y);
- choice = MenuPopUp ( locales, x, y,
- num_locales,
- -1, -1, P_LIST + P_WNDW + P_CHCK );
- if( choice > 0 && choice <= num_locales ){
- ObjcStrCpy( dlgtree, CHOICES_BT_SEL_LOCALE,
- (char*)locales[choice-1] );
- }
- ObjcChange( OC_FORM, win, index, NORMAL, TRUE);
- break;
-
- case CHOICES_INPUT_TOOLBAR_BGCOLOR:
- objc_offset( FORM(win), CHOICES_INPUT_TOOLBAR_BGCOLOR, &x, &y );
- choice = color_popup(x, y, tmp_option_atari_toolbar_bg);
- snprintf( spare, 255, "%06x", choice );
- tmp_option_atari_toolbar_bg = choice;
- ObjcStrCpy( dlgtree, CHOICES_INPUT_TOOLBAR_BGCOLOR,
- spare );
- is_button = true;
- ObjcChange( OC_FORM, win, index, NORMAL, TRUE);
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_INPUT_TOOLBAR_BGCOLOR, 2, 1 );
- break;
-
- case CHOICES_BT_TOOLBAR_ICONSET:
- objc_offset( FORM(win), CHOICES_BT_TOOLBAR_ICONSET, &x, &y );
- tmp = toolbar_iconset_popup(x,y);
- if( tmp != NULL ){
- ObjcStrCpy( dlgtree, CHOICES_BT_TOOLBAR_ICONSET, tmp );
- }
- is_button = true;
- ObjcChange( OC_FORM, win, index, NORMAL, TRUE);
- break;
-
- case CHOICES_INC_MEM_CACHE:
- case CHOICES_DEC_MEM_CACHE:
- if( index == CHOICES_DEC_MEM_CACHE )
- tmp_option_memory_cache_size -= 0.1;
- else
- tmp_option_memory_cache_size += 0.1;
-
- if( tmp_option_memory_cache_size < 0.5 )
- tmp_option_memory_cache_size = 0.5;
- if( tmp_option_memory_cache_size > 999.9 )
- tmp_option_memory_cache_size = 999.9;
- snprintf( spare, 255, "%03.1f", tmp_option_memory_cache_size );
- set_text( CHOICES_STR_MAX_MEM_CACHE, spare, 5 );
- is_button = true;
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_STR_MAX_MEM_CACHE, 2, 1 );
- break;
-
- case CHOICES_INC_CACHED_CONNECTIONS:
- case CHOICES_DEC_CACHED_CONNECTIONS:
- if( index == CHOICES_INC_CACHED_CONNECTIONS )
- tmp_option_max_cached_fetch_handles += 1;
- else
- tmp_option_max_cached_fetch_handles -= 1;
- if( tmp_option_max_cached_fetch_handles > 31 )
- tmp_option_max_cached_fetch_handles = 31;
-
- snprintf( spare, 255, "%02d", tmp_option_max_cached_fetch_handles );
- set_text( CHOICES_EDIT_MAX_CACHED_CONNECTIONS, spare, 2 );
- is_button = true;
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_EDIT_MAX_CACHED_CONNECTIONS,
- 2, 1 );
- break;
-
- case CHOICES_INC_MAX_FETCHERS:
- case CHOICES_DEC_MAX_FETCHERS:
- if( index == CHOICES_INC_MAX_FETCHERS )
- tmp_option_max_fetchers += 1;
- else
- tmp_option_max_fetchers -= 1;
- if( tmp_option_max_fetchers > 31 )
- tmp_option_max_fetchers = 31;
-
- snprintf( spare, 255, "%02d", tmp_option_max_fetchers );
- set_text( CHOICES_EDIT_MAX_FETCHERS, spare, 2 );
- is_button = true;
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_EDIT_MAX_FETCHERS,
- 3, 1 );
- break;
-
- case CHOICES_INC_MAX_FETCHERS_PER_HOST:
- case CHOICES_DEC_MAX_FETCHERS_PER_HOST:
- if( index == CHOICES_INC_MAX_FETCHERS_PER_HOST )
- tmp_option_max_fetchers_per_host += 1;
- else
- tmp_option_max_fetchers_per_host -= 1;
- if( tmp_option_max_fetchers_per_host > 31 )
- tmp_option_max_fetchers_per_host = 31;
-
- snprintf( spare, 255, "%02d", tmp_option_max_fetchers_per_host );
- set_text( CHOICES_EDIT_MAX_FETCHERS_PER_HOST, spare, 2 );
- is_button = true;
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_EDIT_MAX_FETCHERS_PER_HOST,
- 2, 1 );
- break;
-
- case CHOICES_INC_HISTORY_AGE:
- case CHOICES_DEC_HISTORY_AGE:
- if( index == CHOICES_INC_HISTORY_AGE )
- tmp_option_expire_url += 1;
- else
- tmp_option_expire_url -= 1;
-
- if( tmp_option_expire_url > 99 )
- tmp_option_expire_url = 0;
-
- snprintf( spare, 255, "%02d", tmp_option_expire_url );
- set_text( CHOICES_EDIT_HISTORY_AGE, spare, 2 );
- is_button = true;
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_EDIT_HISTORY_AGE,
- 3, 1 );
- break;
-
- case CHOICES_INC_GIF_DELAY:
- case CHOICES_DEC_GIF_DELAY:
- if( index == CHOICES_INC_GIF_DELAY )
- tmp_option_minimum_gif_delay += 0.1;
- else
- tmp_option_minimum_gif_delay -= 0.1;
-
- if( tmp_option_minimum_gif_delay < 0.1 )
- tmp_option_minimum_gif_delay = 0.1;
- if( tmp_option_minimum_gif_delay > 9.0 )
- tmp_option_minimum_gif_delay = 9.0;
- snprintf( spare, 255, "%01.1f", tmp_option_minimum_gif_delay );
- set_text( CHOICES_EDIT_MIN_GIF_DELAY, spare, 3 );
- is_button = true;
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_EDIT_MIN_GIF_DELAY, 3, 1 );
- break;
-
- case CHOICES_INC_MIN_FONT_SIZE:
- case CHOICES_DEC_MIN_FONT_SIZE:
- if( index == CHOICES_INC_MIN_FONT_SIZE )
- tmp_option_font_min_size += 1;
- else
- tmp_option_font_min_size -= 1;
-
- if( tmp_option_font_min_size > 500 )
- tmp_option_font_min_size = 500;
- if( tmp_option_font_min_size < 10 )
- tmp_option_font_min_size = 10;
-
- snprintf( spare, 255, "%03d", tmp_option_font_min_size );
- set_text( CHOICES_EDIT_MIN_FONT_SIZE, spare, 3 );
- is_button = true;
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_EDIT_MIN_FONT_SIZE,
- 3, 1 );
- break;
-
- case CHOICES_INC_DEF_FONT_SIZE:
- case CHOICES_DEC_DEF_FONT_SIZE:
- if( index == CHOICES_INC_DEF_FONT_SIZE )
- tmp_option_font_size += 1;
- else
- tmp_option_font_size -= 1;
-
- if( tmp_option_font_size > 999 )
- tmp_option_font_size = 999;
- if( tmp_option_font_size < 50 )
- tmp_option_font_size = 50;
-
- snprintf( spare, 255, "%03d", tmp_option_font_size );
- set_text( CHOICES_EDIT_DEF_FONT_SIZE, spare, 3 );
- is_button = true;
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_EDIT_DEF_FONT_SIZE,
- 3, 1 );
-
- break;
-
- case CHOICES_INC_INCREMENTAL_REFLOW:
- case CHOICES_DEC_INCREMENTAL_REFLOW:
- if( index == CHOICES_INC_INCREMENTAL_REFLOW )
- tmp_option_min_reflow_period += 1;
- else
- tmp_option_min_reflow_period -= 1;
-
- if( tmp_option_min_reflow_period > 9999 )
- tmp_option_min_reflow_period = 10;
-
- snprintf( spare, 255, "%04d", tmp_option_min_reflow_period );
- set_text( CHOICES_EDIT_MIN_REFLOW_PERIOD, spare, 4 );
- is_button = true;
- ObjcDrawParent(OC_FORM, dlgwin, CHOICES_EDIT_MIN_REFLOW_PERIOD,
- 3, 1 );
- break;
-
- default: break;
- }
- if( is_button ){
- // remove selection indicator from button element:
- OBJ_UNCHECK( index );
- ObjcDraw( OC_FORM, dlgwin, index, 1 );
- }
-}
-
-/**
- * Toogle all objects which are directly influenced by other GUI elements
- * ( like checkbox )
- */
-static void toggle_objects( void )
-{
- /* enable / disable (refresh) objects depending on radio button values: */
- FORMEVENT(CHOICES_CB_USE_PROXY);
- FORMEVENT(CHOICES_CB_PROXY_AUTH);
- FORMEVENT(CHOICES_BT_SEL_FONT_RENDERER);
-}
-
-
-/* this gets called each time the settings dialog is opened: */
-static void display_settings( void )
-{
- char spare[255];
- // read current settings and display them
-
- /* "Browser" tab: */
- set_text( CHOICES_EDIT_HOMEPAGE, nsoption_charp(homepage_url),
- INPUT_HOMEPAGE_URL_MAX_LEN );
-
- if( nsoption_bool(block_ads) ){
- OBJ_CHECK( CHOICES_CB_HIDE_ADVERTISEMENT );
- } else {
- OBJ_UNCHECK( CHOICES_CB_HIDE_ADVERTISEMENT );
- }
- if( nsoption_bool(target_blank) ){
- OBJ_UNCHECK( CHOICES_CB_DISABLE_POPUP_WINDOWS );
- } else {
- OBJ_CHECK( CHOICES_CB_DISABLE_POPUP_WINDOWS );
- }
- if( nsoption_bool(send_referer) ){
- OBJ_CHECK( CHOICES_CB_SEND_HTTP_REFERRER );
- } else {
- OBJ_UNCHECK( CHOICES_CB_SEND_HTTP_REFERRER );
- }
- if( nsoption_bool(do_not_track) ){
- OBJ_CHECK( CHOICES_CB_SEND_DO_NOT_TRACK );
- } else {
- OBJ_UNCHECK( CHOICES_CB_SEND_DO_NOT_TRACK );
- }
-
- set_text( CHOICES_BT_SEL_LOCALE,
- nsoption_charp(accept_language) ? nsoption_charp(accept_language) : (char*)"en",
- INPUT_LOCALE_MAX_LEN );
-
- tmp_option_expire_url = nsoption_int(expire_url);
- snprintf( spare, 255, "%02d", nsoption_int(expire_url) );
- set_text( CHOICES_EDIT_HISTORY_AGE, spare, 2 );
-
- /* "Cache" tab: */
- tmp_option_memory_cache_size = nsoption_int(memory_cache_size) / 100000;
- snprintf( spare, 255, "%03.1f", tmp_option_memory_cache_size );
- set_text( CHOICES_STR_MAX_MEM_CACHE, spare, 5 );
-
- /* "Paths" tab: */
- set_text( CHOICES_EDIT_DOWNLOAD_PATH, nsoption_charp(downloads_path),
- LABEL_PATH_MAX_LEN );
- set_text( CHOICES_EDIT_HOTLIST_FILE, nsoption_charp(hotlist_file),
- LABEL_PATH_MAX_LEN );
- set_text( CHOICES_EDIT_CA_BUNDLE, nsoption_charp(ca_bundle),
- LABEL_PATH_MAX_LEN );
- set_text( CHOICES_EDIT_CA_CERTS_PATH, nsoption_charp(ca_path),
- LABEL_PATH_MAX_LEN );
- set_text( CHOICES_EDIT_EDITOR, nsoption_charp(atari_editor),
- LABEL_PATH_MAX_LEN );
-
- /* "Rendering" tab: */
- set_text( CHOICES_BT_SEL_FONT_RENDERER, nsoption_charp(atari_font_driver),
- LABEL_FONT_RENDERER_MAX_LEN );
- SET_BIT(dlgtree[CHOICES_CB_TRANSPARENCY].ob_state,
- SELECTED, nsoption_int(atari_transparency) ? 1 : 0 );
- SET_BIT(dlgtree[CHOICES_CB_ENABLE_ANIMATION].ob_state,
- SELECTED, nsoption_bool(animate_images) ? 1 : 0 );
- SET_BIT(dlgtree[CHOICES_CB_INCREMENTAL_REFLOW].ob_state,
- SELECTED, nsoption_bool(incremental_reflow) ? 1 : 0 );
- SET_BIT(dlgtree[CHOICES_CB_ANTI_ALIASING].ob_state,
- SELECTED, nsoption_int(atari_font_monochrom) ? 0 : 1 );
-
- tmp_option_min_reflow_period = nsoption_int(min_reflow_period);
- snprintf( spare, 255, "%04d", tmp_option_min_reflow_period );
- set_text( CHOICES_EDIT_MIN_REFLOW_PERIOD, spare,
- INPUT_MIN_REFLOW_PERIOD_MAX_LEN );
-
- tmp_option_minimum_gif_delay = (float)nsoption_int(minimum_gif_delay) / (float)100;
- snprintf( spare, 255, "%01.1f", tmp_option_minimum_gif_delay );
- set_text( CHOICES_EDIT_MIN_GIF_DELAY, spare, 3 );
-
- /* "Network" tab: */
- set_text( CHOICES_EDIT_PROXY_HOST, nsoption_charp(http_proxy_host),
- INPUT_PROXY_HOST_MAX_LEN );
- snprintf( spare, 255, "%5d", nsoption_int(http_proxy_port) );
- set_text( CHOICES_EDIT_PROXY_PORT, spare,
- INPUT_PROXY_PORT_MAX_LEN );
-
- set_text( CHOICES_EDIT_PROXY_USERNAME, nsoption_charp(http_proxy_auth_user),
- INPUT_PROXY_USERNAME_MAX_LEN );
- set_text( CHOICES_EDIT_PROXY_PASSWORD, nsoption_charp(http_proxy_auth_pass),
- INPUT_PROXY_PASSWORD_MAX_LEN );
- SET_BIT(dlgtree[CHOICES_CB_USE_PROXY].ob_state,
- SELECTED, nsoption_bool(http_proxy) ? 1 : 0 );
- SET_BIT(dlgtree[CHOICES_CB_PROXY_AUTH].ob_state,
- SELECTED, nsoption_int(http_proxy_auth) ? 1 : 0 );
- SET_BIT(dlgtree[CHOICES_CB_FG_IMAGES].ob_state,
- SELECTED, nsoption_bool(foreground_images) ? 1 : 0 );
- SET_BIT(dlgtree[CHOICES_CB_BG_IMAGES].ob_state,
- SELECTED, nsoption_bool(background_images) ? 1 : 0 );
-
- tmp_option_max_cached_fetch_handles = nsoption_int(max_cached_fetch_handles);
- snprintf( spare, 255, "%2d", nsoption_int(max_cached_fetch_handles) );
- set_text( CHOICES_EDIT_MAX_CACHED_CONNECTIONS, spare , 2 );
-
- tmp_option_max_fetchers = nsoption_int(max_fetchers);
- snprintf( spare, 255, "%2d", nsoption_int(max_fetchers) );
- set_text( CHOICES_EDIT_MAX_FETCHERS, spare , 2 );
-
- tmp_option_max_fetchers_per_host = nsoption_int(max_fetchers_per_host);
- snprintf( spare, 255, "%2d", nsoption_int(max_fetchers_per_host) );
- set_text( CHOICES_EDIT_MAX_FETCHERS_PER_HOST, spare , 2 );
-
-
- /* "Style" tab: */
- tmp_option_font_min_size = nsoption_int(font_min_size);
- snprintf( spare, 255, "%3d", nsoption_int(font_min_size) );
- set_text( CHOICES_EDIT_MIN_FONT_SIZE, spare , 3 );
-
- tmp_option_font_size = nsoption_int(font_size);
- snprintf( spare, 255, "%3d", nsoption_int(font_size) );
- set_text( CHOICES_EDIT_DEF_FONT_SIZE, spare , 3 );
-
- /* Only first tab is refreshed: */
- ObjcDraw( OC_FORM, dlgwin, CHOICES_TAB_BROWSER, 4 );
-
- // update elements (enable/disable) chained to form events:
- toggle_objects();
-}
-
-static void apply_settings( void )
-{
- /* "Network" tab: */
- nsoption_set_bool(http_proxy, OBJ_SELECTED(CHOICES_CB_USE_PROXY));
- if ( OBJ_SELECTED(CHOICES_CB_PROXY_AUTH) ) {
- nsoption_set_int(http_proxy_auth, OPTION_HTTP_PROXY_AUTH_BASIC);
- } else {
- nsoption_set_int(http_proxy_auth, OPTION_HTTP_PROXY_AUTH_NONE);
- }
- nsoption_set_charp(http_proxy_auth_pass,
- ObjcString( dlgtree, CHOICES_EDIT_PROXY_PASSWORD, NULL));
- nsoption_set_charp(http_proxy_auth_user,
- ObjcString( dlgtree, CHOICES_EDIT_PROXY_USERNAME, NULL));
- nsoption_set_charp(http_proxy_host,
- ObjcString( dlgtree, CHOICES_EDIT_PROXY_HOST, NULL));
- nsoption_set_int(http_proxy_port,
- atoi( ObjcString( dlgtree, CHOICES_EDIT_PROXY_PORT, NULL) ));
- nsoption_set_int(max_fetchers_per_host,
- atoi( ObjcString( dlgtree, CHOICES_EDIT_MAX_FETCHERS_PER_HOST, NULL)));
- nsoption_set_int(max_cached_fetch_handles,
- atoi( ObjcString( dlgtree, CHOICES_EDIT_MAX_CACHED_CONNECTIONS, NULL)));
- nsoption_set_int(max_fetchers,
- atoi( ObjcString( dlgtree, CHOICES_EDIT_MAX_FETCHERS, NULL) ));
- nsoption_set_bool(foreground_images,
- OBJ_SELECTED( CHOICES_CB_FG_IMAGES ));
- nsoption_set_bool(background_images,
- OBJ_SELECTED( CHOICES_CB_BG_IMAGES ));
-
- /* "Style" tab: */
- nsoption_set_int(font_min_size, tmp_option_font_min_size);
- nsoption_set_int(font_size, tmp_option_font_size);
-
- /* "Rendering" tab: */
- nsoption_set_charp(atari_font_driver,
- ObjcString( dlgtree, CHOICES_BT_SEL_FONT_RENDERER, NULL));
- nsoption_set_bool(atari_transparency,
- OBJ_SELECTED(CHOICES_CB_TRANSPARENCY));
- nsoption_set_bool(animate_images,
- OBJ_SELECTED(CHOICES_CB_ENABLE_ANIMATION));
- nsoption_set_int(minimum_gif_delay,
- (int)(tmp_option_minimum_gif_delay*100+0.5));
- nsoption_set_bool(incremental_reflow,
- OBJ_SELECTED(CHOICES_CB_INCREMENTAL_REFLOW));
- nsoption_set_int(min_reflow_period, tmp_option_min_reflow_period);
- nsoption_set_int(atari_font_monochrom,
- !OBJ_SELECTED( CHOICES_CB_ANTI_ALIASING ));
-
- /* "Paths" tabs: */
- nsoption_set_charp(ca_bundle,
- ObjcString( dlgtree, CHOICES_EDIT_CA_BUNDLE, NULL));
- nsoption_set_charp(ca_path,
- ObjcString( dlgtree, CHOICES_EDIT_CA_CERTS_PATH, NULL));
- nsoption_set_charp(homepage_url,
- ObjcString( dlgtree, CHOICES_EDIT_CA_CERTS_PATH, NULL));
- nsoption_set_charp(hotlist_file,
- ObjcString( dlgtree, CHOICES_EDIT_HOTLIST_FILE, NULL));
- nsoption_set_charp(atari_editor,
- ObjcString( dlgtree, CHOICES_EDIT_EDITOR, NULL));
- nsoption_set_charp(downloads_path,
- ObjcString( dlgtree, CHOICES_EDIT_DOWNLOAD_PATH, NULL));
-
- /* "Cache" tab: */
- nsoption_set_int(memory_cache_size,
- tmp_option_memory_cache_size * 100000);
-
- /* "Browser" tab: */
- nsoption_set_bool(target_blank,
- !OBJ_SELECTED(CHOICES_CB_DISABLE_POPUP_WINDOWS));
- nsoption_set_bool(block_ads,
- OBJ_SELECTED(CHOICES_CB_HIDE_ADVERTISEMENT));
- nsoption_set_charp(accept_language,
- ObjcString( dlgtree, CHOICES_BT_SEL_LOCALE, NULL));
- nsoption_set_int(expire_url,
- atoi(ObjcString( dlgtree, CHOICES_EDIT_HISTORY_AGE, NULL)));
- nsoption_set_bool(send_referer,
- OBJ_SELECTED(CHOICES_CB_SEND_HTTP_REFERRER));
- nsoption_set_bool(do_not_track,
- OBJ_SELECTED(CHOICES_CB_SEND_HTTP_REFERRER));
- nsoption_set_charp(homepage_url,
- ObjcString( dlgtree, CHOICES_EDIT_HOMEPAGE, NULL));
-}
-
-#undef OBJ_SELECTED
-#undef OBJ_CHECK
-#undef OBJ_UNCHECK
-#undef DISABLE_OBJ
-#undef ENABLE_OBJ
-#undef FORMEVENT
-
+ if ((ev_out->emo_events & MU_MESAG) != 0) {
+ // handle message
+ printf("settings win msg: %d\n", msg[0]);
+ switch (msg[0]) {
+
+ case WM_REDRAW:
+ clip.g_x = msg[4];
+ clip.g_y = msg[5];
+ clip.g_w = msg[6];
+ clip.g_h = msg[7];
+ on_redraw(&clip);
+ break;
+
+ case WM_CLOSED:
+ // TODO: this needs to iterate through all gui windows and
+ // check if the rootwin is this window...
+ close_settings();
+ break;
+
+ case WM_SIZED:
+ guiwin_update_slider(win, GUIWIN_VH_SLIDER);
+ break;
+
+ case WM_TOOLBAR:
+ switch(msg[4]){
+ default: break;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+ if ((ev_out->emo_events & MU_KEYBD) != 0) {
+
+
+ }
+ if ((ev_out->emo_events & MU_BUTTON) != 0) {
+
+ struct guiwin_scroll_info_s *slid;
+
+ guiwin_get_grect(settings_guiwin, GUIWIN_AREA_CONTENT, &work);
+ slid = guiwin_get_scroll_info(settings_guiwin);
+ dlgtree->ob_x = work.g_x - (slid->x_pos * slid->x_unit_px);
+ dlgtree->ob_y = work.g_y - (slid->y_pos * slid->y_unit_px);
+
+ short obj = objc_find(dlgtree, 0, 8, ev_out->emo_mouse.p_x,
+ ev_out->emo_mouse.p_y);
+ printf("clicked: %d\n", obj);
+ evnt_timer(150);
+ }
+
+ return(retval);
+}
+
+void open_settings(void)
+{
+ if (h_aes_win == 0) {
+
+ GRECT curr, area;
+ struct guiwin_scroll_info_s *slid;
+ uint32_t kind = CLOSER | NAME | MOVER | VSLIDE | HSLIDE | UPARROW
+ | DNARROW | LFARROW | RTARROW | SIZER | FULLER;
+
+ dlgtree = get_tree(SETTINGS);
+ area.g_x = area.g_y = 0;
+ area.g_w = MIN(dlgtree->ob_width, desk_area.g_w);
+ area.g_h = MIN(dlgtree->ob_height, desk_area.g_h);
+ wind_calc_grect(WC_BORDER, kind, &area, &area);
+ h_aes_win = wind_create_grect(kind, &area);
+ wind_set_str(h_aes_win, WF_NAME, "Settings");
+ settings_guiwin = guiwin_add(h_aes_win, GW_FLAG_DEFAULTS,
+ on_aes_event);
+ curr.g_w = MIN(dlgtree->ob_width, desk_area.g_w);
+ curr.g_h = 200;
+ curr.g_x = (desk_area.g_w / 2) - (curr.g_w / 2);
+ curr.g_y = (desk_area.g_h / 2) - (curr.g_h / 2);
+ wind_calc_grect(WC_BORDER, kind, &curr, &curr);
+ wind_open_grect(h_aes_win, &curr);
+
+ slid = guiwin_get_scroll_info(settings_guiwin);
+ slid->y_unit_px = 32;
+ slid->x_unit_px = 32;
+ guiwin_get_grect(settings_guiwin, GUIWIN_AREA_CONTENT, &area);
+ slid->x_units = (dlgtree->ob_width/slid->x_unit_px);
+ slid->y_units = (dlgtree->ob_height/slid->y_unit_px);
+ guiwin_update_slider(settings_guiwin, GUIWIN_VH_SLIDER);
+ }
+}
+
+void close_settings(void)
+{
+ printf("settings close\n");
+ guiwin_remove(settings_guiwin);
+ settings_guiwin = NULL;
+ wind_close(h_aes_win);
+ wind_delete(h_aes_win);
+ h_aes_win = 0;
+}
diff --git a/atari/settings.h b/atari/settings.h
index 97b1941..ef6ae81 100644
--- a/atari/settings.h
+++ b/atari/settings.h
@@ -3,7 +3,7 @@
#include <windom.h>
-WINDOW * open_settings(void);
+void open_settings(void);
void close_settings(void);
#endif
diff --git a/beos/Makefile.defaults b/beos/Makefile.defaults
new file mode 100644
index 0000000..d5bf6b3
--- /dev/null
+++ b/beos/Makefile.defaults
@@ -0,0 +1,32 @@
+# ----------------------------------------------------------------------------
+# BeOS-specific options
+# ----------------------------------------------------------------------------
+
+
+ # Where to install the netsurf binary
+ NETSURF_BEOS_BIN := /boot/apps/netsurf/
+
+ # TODO:HAIKU -- not sure if ~/.netsurf applies in beos
+ # Where to search for NetSurf's resources after looking in ~/.netsurf and
+ # $NETSURFRES. It must have a trailing /
+ NETSURF_BEOS_RESOURCES := /boot/apps/netsurf/res/
+
+ # Enable NetSurf's use of libsvgtiny for displaying SVGs
+ # Valid options: YES, NO, AUTO
+ NETSURF_USE_NSSVG := YES
+
+ # Enable NetSurf's use of librosprite for displaying RISC OS Sprites
+ # Valid options: YES, NO, AUTO
+ NETSURF_USE_ROSPRITE := AUTO
+
+ # Enable NetSurf's use of libharu for PDF export.
+ # Valid options: YES, NO
+ NETSURF_USE_HARU_PDF := NO
+
+ # Force using glibc internal iconv implementation instead of external libiconv
+ # Valid options: YES, NO
+ NETSURF_USE_LIBICONV_PLUG := NO
+
+ # Optimisation levels
+ CFLAGS += -O2
+
diff --git a/beos/Makefile.target b/beos/Makefile.target
index 27981be..4edde01 100644
--- a/beos/Makefile.target
+++ b/beos/Makefile.target
@@ -62,7 +62,7 @@
NETLDFLAGS := -lnetwork
endif
LDFLAGS += -lbe -ltranslation -ltracker $(NETLDFLAGS)
- ifeq ($(GCCVER),2)
+ ifeq ($(CC_MAJOR),2)
LDFLAGS += -lstdc++.r4
else
LDFLAGS += -lstdc++ -lsupc++
@@ -78,9 +78,9 @@
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,BMP,libnsbmp,BMP))
- $(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
- $(eval $(call pkg_config_find_and_add,PNG,libpng,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
# ----------------------------------------------------------------------------
diff --git a/cocoa/Makefile.defaults b/cocoa/Makefile.defaults
new file mode 100644
index 0000000..b2f64ec
--- /dev/null
+++ b/cocoa/Makefile.defaults
@@ -0,0 +1,37 @@
+# ----------------------------------------------------------------------------
+# Cocoa-specific options
+# ----------------------------------------------------------------------------
+
+ # Force using glibc internal iconv implementation instead of external libiconv
+ # Valid options: YES, NO
+ NETSURF_USE_LIBICONV_PLUG := NO
+
+ # Enable NetSurf's use of librosprite for displaying RISC OS Sprites
+ # Valid options: YES, NO, AUTO
+ NETSURF_USE_ROSPRITE := NO
+
+ # Enable NetSurf's use of libwebp for displaying WebPs
+ # Valid options: YES, NO
+ NETSURF_USE_WEBP := NO
+
+ # Enable NetSurf's use of librsvg in conjunction with Cairo to display SVGs
+ # Valid options: YES, NO, AUTO
+ NETSURF_USE_RSVG := AUTO
+
+ # Enable NetSurf's use of libsvgtiny for displaying SVGs
+ # Valid options: YES, NO, AUTO
+ NETSURF_USE_NSSVG := AUTO
+
+ NETSURF_USE_MNG := NO
+ NETSURF_USE_BMP := NO
+ NETSURF_USE_GIF := NO
+ NETSURF_USE_PNG := NO
+ NETSURF_USE_JPEG := NO
+ NETSURF_USE_IMAGEIO := YES
+
+ DEVELOPER_PATH := /Developer
+ MACOSX_VERSION := 10.5
+ SDK_VERSION := $(MACOSX_VERSION)
+
+ # Optimisation levels
+ CFLAGS += -O2
diff --git a/cocoa/Makefile.target b/cocoa/Makefile.target
index 27f3b08..d975a0c 100644
--- a/cocoa/Makefile.target
+++ b/cocoa/Makefile.target
@@ -53,10 +53,10 @@ endif
NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG
- $(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
- $(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
- $(eval $(call pkg_config_find_and_add,PNG,libpng,PNG))
- $(eval $(call pkg_config_find_and_add,NSSVG,libsvgtiny,SVG))
+ $(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))
+ $(eval $(call pkg_config_find_and_add_enabled,NSSVG,libsvgtiny,SVG))
$(eval $(call feature_enabled,IMAGEIO,-DWITH_APPLE_IMAGE,,Apple ImageIO ))
ifneq ($(UNIVERSAL),)
diff --git a/framebuffer/Makefile.defaults b/framebuffer/Makefile.defaults
new file mode 100644
index 0000000..6e2a3d1
--- /dev/null
+++ b/framebuffer/Makefile.defaults
@@ -0,0 +1,47 @@
+# ----------------------------------------------------------------------------
+# Framebuffer-target-specific options
+# ----------------------------------------------------------------------------
+
+ # Optimisation levels
+ CFLAGS += -O2
+
+ # Framebuffer default surface provider.
+ # Valid values are: x, sdl, linux, vnc, able,
+ NETSURF_FB_FRONTEND := sdl
+
+ # Use libharu to enable PDF export and GTK printing support.
+ # Valid options: YES, NO
+ NETSURF_USE_HARU_PDF := NO
+
+ # Enable NetSurf's use of librosprite for displaying RISC OS Sprites
+ # Valid options: YES, NO, AUTO
+ NETSURF_USE_ROSPRITE := AUTO
+
+ # Library to use for font plotting
+ # Valid options: internal, freetype
+ NETSURF_FB_FONTLIB := internal
+
+ # Default freetype font files
+ NETSURF_FB_FONT_SANS_SERIF := DejaVuSans.ttf
+ NETSURF_FB_FONT_SANS_SERIF_BOLD := DejaVuSans-Bold.ttf
+ NETSURF_FB_FONT_SANS_SERIF_ITALIC := DejaVuSans-Oblique.ttf
+ NETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD := DejaVuSans-BoldOblique.ttf
+ NETSURF_FB_FONT_SERIF := DejaVuSerif.ttf
+ NETSURF_FB_FONT_SERIF_BOLD := DejaVuSerif-Bold.ttf
+ NETSURF_FB_FONT_MONOSPACE := DejaVuSansMono.ttf
+ NETSURF_FB_FONT_MONOSPACE_BOLD := DejaVuSansMono-Bold.ttf
+ NETSURF_FB_FONT_CURSIVE := Comic_Sans_MS.ttf
+ NETSURF_FB_FONT_FANTASY := Impact.ttf
+
+ # Default binary install path
+ NETSURF_FRAMEBUFFER_BIN := $(PREFIX)/bin/
+
+ # Default resource install path
+ NETSURF_FRAMEBUFFER_RESOURCES := $(PREFIX)/share/netsurf/
+
+ # Default framebuffer search path
+ NETSURF_FB_RESPATH := $${HOME}/.netsurf/:$${NETSURFRES}:$(NETSURF_FRAMEBUFFER_RESOURCES):./framebuffer/res
+
+ # freetype compiled in font serch path
+ NETSURF_FB_FONTPATH := /usr/share/fonts/truetype/ttf-dejavu:/usr/share/fonts/truetype/msttcorefonts
+
diff --git a/framebuffer/Makefile.target b/framebuffer/Makefile.target
index f554997..f3d91de 100644
--- a/framebuffer/Makefile.target
+++ b/framebuffer/Makefile.target
@@ -38,11 +38,11 @@ CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE_BOLD="$(NETSURF_FB_FONT_MONOSPACE_BOLD)"'
CFLAGS += '-DNETSURF_FB_FONT_CURSIVE="$(NETSURF_FB_FONT_CURSIVE)"'
CFLAGS += '-DNETSURF_FB_FONT_FANTASY="$(NETSURF_FB_FONT_FANTASY)"'
-$(eval $(call pkg_config_find_and_add,ROSPRITE,librosprite,Sprite))
-$(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
-$(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
-$(eval $(call pkg_config_find_and_add,MOZJS,mozjs185,JavaScript))
-$(eval $(call pkg_config_find_and_add,JS,mozilla-js,JavaScript))
+$(eval $(call pkg_config_find_and_add_enabled,ROSPRITE,librosprite,Sprite))
+$(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,MOZJS,mozjs185,JavaScript))
+$(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
CFLAGS += -std=c99 -g -I. -Dsmall $(WARNFLAGS) \
-D_BSD_SOURCE \
diff --git a/gtk/Makefile.defaults b/gtk/Makefile.defaults
new file mode 100644
index 0000000..23d4c17
--- /dev/null
+++ b/gtk/Makefile.defaults
@@ -0,0 +1,34 @@
+# ----------------------------------------------------------------------------
+# GTK-specific options
+# ----------------------------------------------------------------------------
+
+ # Where to search for NetSurf's resources after looking in ~/.netsurf and
+ # $NETSURFRES. It must have a trailing /
+ NETSURF_GTK_RESOURCES := $(PREFIX)/share/netsurf/
+
+ # Where to install the netsurf binary
+ NETSURF_GTK_BIN := $(PREFIX)/bin/
+
+ # Enable NetSurf's use of librsvg in conjunction with Cairo to display SVGs
+ # Valid options: YES, NO, AUTO
+ NETSURF_USE_RSVG := AUTO
+
+ # Enable NetSurf's use of libsvgtiny for displaying SVGs
+ # Valid options: YES, NO, AUTO
+ NETSURF_USE_NSSVG := AUTO
+
+ # Enable NetSurf's use of librosprite for displaying RISC OS Sprites
+ # Valid options: YES, NO, AUTO
+ NETSURF_USE_ROSPRITE := AUTO
+
+ # Configuration overrides for Mac OS X
+ ifeq ($(HOST),macosx)
+ NETSURF_USE_LIBICONV_PLUG := NO
+ NETSURF_USE_HARU_PDF := NO
+ endif
+
+ # Set default GTK version to build for (2 or 3)
+ NETSURF_GTK_MAJOR := 2
+
+ # Optimisation levels
+ CFLAGS += -O2
diff --git a/gtk/Makefile.target b/gtk/Makefile.target
index 1b2bef5..f9b5436 100644
--- a/gtk/Makefile.target
+++ b/gtk/Makefile.target
@@ -7,9 +7,6 @@
# GTK flag setup (using pkg-config)
# ----------------------------------------------------------------------------
-LDFLAGS += $(shell $(PKG_CONFIG) --libs libcurl libdom libcss)
-LDFLAGS += $(shell $(PKG_CONFIG) --libs openssl)
-
# define additional CFLAGS and LDFLAGS requirements for pkg-configed libs here
NETSURF_FEATURE_RSVG_CFLAGS := -DWITH_RSVG
NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG
@@ -24,16 +21,16 @@ NETSURF_FEATURE_VIDEO_CFLAGS := -DWITH_VIDEO
# add a line similar to below for each optional lib here
# note: webp lacks pkg-config file
-$(eval $(call pkg_config_find_and_add,PNG,libpng,PNG ))
-$(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
-$(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
-$(eval $(call pkg_config_find_and_add,RSVG,librsvg-2.0,SVG))
-$(eval $(call pkg_config_find_and_add,NSSVG,libsvgtiny,SVG))
-$(eval $(call pkg_config_find_and_add,ROSPRITE,librosprite,Sprite))
+$(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,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,RSVG,librsvg-2.0,SVG))
+$(eval $(call pkg_config_find_and_add_enabled,NSSVG,libsvgtiny,SVG))
+$(eval $(call pkg_config_find_and_add_enabled,ROSPRITE,librosprite,Sprite))
$(eval $(call feature_enabled,WEBP,-DWITH_WEBP,-lwebp,WebP (libwebp)))
-$(eval $(call pkg_config_find_and_add,MOZJS,mozjs185,JavaScript))
-$(eval $(call pkg_config_find_and_add,JS,mozilla-js,JavaScript))
-$(eval $(call pkg_config_find_and_add,VIDEO,gstreamer-0.10,Video))
+$(eval $(call pkg_config_find_and_add_enabled,MOZJS,mozjs185,JavaScript))
+$(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
+$(eval $(call pkg_config_find_and_add_enabled,VIDEO,gstreamer-0.10,Video))
# GTK and GLIB flags to disable depricated usage
GTKDEPFLAGS := -DG_DISABLE_SINGLE_INCLUDES \
@@ -54,16 +51,22 @@ GTKCFLAGS := -std=c99 -Dgtk -Dnsgtk \
-D_POSIX_C_SOURCE=200112L \
-D_NETBSD_SOURCE \
-DGTK_RESPATH=\"$(NETSURF_GTK_RESOURCES)\" \
- $(WARNFLAGS) -I. -g \
- $(shell $(PKG_CONFIG) --cflags gtk+-$(NETSURF_GTK_MAJOR).0) \
- $(shell $(PKG_CONFIG) --cflags libhubbub libcurl) \
- $(shell $(PKG_CONFIG) --cflags openssl) \
- $(shell xml2-config --cflags)
+ $(WARNFLAGS) -I. -g
+
+# non optional pkg-configed libs
+$(eval $(call pkg_config_find_and_add,libcss,CSS))
+$(eval $(call pkg_config_find_and_add,libdom,DOM))
+$(eval $(call pkg_config_find_and_add,libhubbub,Hubbub))
+$(eval $(call pkg_config_find_and_add,openssl,OpenSSL))
+$(eval $(call pkg_config_find_and_add,libcurl,Curl ))
+$(eval $(call pkg_config_find_and_add,gtk+-$(NETSURF_GTK_MAJOR).0,GTK-$(NETSURF_GTK_MAJOR)))
+$(eval $(call pkg_config_find_and_add,gthread-2.0,GThread2))
+$(eval $(call pkg_config_find_and_add,gmodule-2.0,GModule2))
+$(eval $(call pkg_config_find_and_add,lcms,lcms))
-GTKLDFLAGS := $(shell $(PKG_CONFIG) --cflags --libs gtk+-$(NETSURF_GTK_MAJOR).0 gthread-2.0 gmodule-2.0 lcms)
CFLAGS += $(GTKCFLAGS)
-LDFLAGS += -lm $(GTKLDFLAGS)
+LDFLAGS += -lm
# ---------------------------------------------------------------------------
# Windows flag setup
diff --git a/javascript/js.h b/javascript/js.h
index 4dd8f15..44de4fe 100644
--- a/javascript/js.h
+++ b/javascript/js.h
@@ -26,6 +26,10 @@
typedef struct jscontext jscontext;
typedef struct jsobject jsobject;
+struct dom_document;
+struct dom_node;
+struct dom_string;
+
/** Initialise javascript interpreter */
void js_initialise(void);
@@ -51,7 +55,16 @@ jsobject *js_newcompartment(jscontext *ctx, void *win_priv, void *doc_priv);
/* execute some javascript in a context */
bool js_exec(jscontext *ctx, const char *txt, size_t txtlen);
+
/* fire an event at a dom node */
-bool js_fire_event(jscontext *ctx, const char *type, void *target);
+bool js_fire_event(jscontext *ctx, const char *type, struct dom_document *doc, struct dom_node *target);
+
+bool
+js_dom_event_add_listener(jscontext *ctx,
+ struct dom_document *document,
+ struct dom_node *node,
+ struct dom_string *event_type_dom,
+ void *js_funcval);
+
#endif /* _NETSURF_JAVASCRIPT_JS_H_ */
diff --git a/javascript/jsapi.c b/javascript/jsapi.c
index bec5653..ef34371 100644
--- a/javascript/jsapi.c
+++ b/javascript/jsapi.c
@@ -32,14 +32,16 @@ void js_initialise(void)
/* Create a JS runtime. */
#if JS_VERSION >= 180
- JS_SetCStringsAreUTF8(); /* we prefer our runtime to be utf-8 */
+ JS_SetCStringsAreUTF8(); /* we prefer our runtime to be utf-8 */
#endif
rt = JS_NewRuntime(8L * 1024L * 1024L);
JSLOG("New runtime handle %p", rt);
- /* register script content handler */
- javascript_init();
+ if (rt != NULL) {
+ /* register script content handler */
+ javascript_init();
+ }
}
void js_finalise(void)
@@ -97,7 +99,7 @@ void js_destroycontext(jscontext *ctx)
*
* This performs the following actions
* 1. constructs a new global object by initialising a window class
- * 2. Instantiate the global a window object
+ * 2. Instantiate the global a window object
*/
jsobject *js_newcompartment(jscontext *ctx, void *win_priv, void *doc_priv)
{
@@ -116,7 +118,7 @@ jsobject *js_newcompartment(jscontext *ctx, void *win_priv, void *doc_priv)
}
window = jsapi_new_Window(cx, window_proto, NULL, win_priv, doc_priv);
-
+
return (jsobject *)window;
}
@@ -139,9 +141,9 @@ bool js_exec(jscontext *ctx, const char *txt, size_t txtlen)
return false;
}
- if (JS_EvaluateScript(cx,
- JS_GetGlobalObject(cx),
- txt, txtlen,
+ if (JS_EvaluateScript(cx,
+ JS_GetGlobalObject(cx),
+ txt, txtlen,
"<head>", 0, &rval) == JS_TRUE) {
return true;
@@ -153,7 +155,7 @@ bool js_exec(jscontext *ctx, const char *txt, size_t txtlen)
dom_exception _dom_event_create(dom_document *doc, dom_event **evt);
#define dom_event_create(d, e) _dom_event_create((dom_document *)(d), (dom_event **) (e))
-bool js_fire_event(jscontext *ctx, const char *type, void *target)
+bool js_fire_event(jscontext *ctx, const char *type, dom_document *doc, dom_node *target)
{
JSContext *cx = (JSContext *)ctx;
dom_node *node = target;
@@ -165,18 +167,23 @@ bool js_fire_event(jscontext *ctx, const char *type, void *target)
dom_event *event;
dom_string *type_dom;
+ if (cx == NULL) {
+ return false;
+ }
+
if (node == NULL) {
- /* deliver to window */
- if (cx == NULL) {
- return false;
- }
+ /* deliver manufactured event to window */
+ JSLOG("Dispatching event %s at window", type);
- exc = dom_string_create((unsigned char*)type, strlen(type), &type_dom);
+ /* create and initialise and event object */
+ exc = dom_string_create((unsigned char*)type,
+ strlen(type),
+ &type_dom);
if (exc != DOM_NO_ERR) {
return false;
}
- exc = dom_event_create(-1, &event);
+ exc = dom_event_create(doc, &event);
if (exc != DOM_NO_ERR) {
return false;
}
@@ -192,18 +199,133 @@ bool js_fire_event(jscontext *ctx, const char *type, void *target)
return false;
}
+ /* dispatch event at the window object */
argv[0] = OBJECT_TO_JSVAL(jsevent);
- ret = JS_CallFunctionName(cx,
- JS_GetGlobalObject(cx),
- "dispatchEvent",
- 1,
- argv,
+ ret = JS_CallFunctionName(cx,
+ JS_GetGlobalObject(cx),
+ "dispatchEvent",
+ 1,
+ argv,
&rval);
- }
+ } else {
+ JSLOG("Dispatching event %s at %p", type, node);
+
+ /* create and initialise and event object */
+ exc = dom_string_create((unsigned char*)type,
+ strlen(type),
+ &type_dom);
+ if (exc != DOM_NO_ERR) {
+ return false;
+ }
+
+ exc = dom_event_create(doc, &event);
+ if (exc != DOM_NO_ERR) {
+ return false;
+ }
+
+ exc = dom_event_init(event, type_dom, true, true);
+ dom_string_unref(type_dom);
+ if (exc != DOM_NO_ERR) {
+ return false;
+ }
+
+ dom_event_target_dispatch_event(node, event, &ret);
+
+ }
if (ret == JS_TRUE) {
return true;
}
return false;
}
+
+struct js_dom_event_private {
+ JSContext *cx; /* javascript context */
+ jsval funcval; /* javascript function to call */
+ struct dom_node *node; /* dom node event listening on */
+ dom_string *type; /* event type */
+ dom_event_listener *listener; /* the listener containing this */
+};
+
+static void
+js_dom_event_listener(struct dom_event *event, void *pw)
+{
+ struct js_dom_event_private *private = pw;
+ jsval event_argv[1];
+ jsval event_rval;
+ JSObject *jsevent;
+
+ JSLOG("WOOT dom event with %p", private);
+
+ if (!JSVAL_IS_VOID(private->funcval)) {
+ jsevent = jsapi_new_Event(private->cx, NULL, NULL, event);
+ if (jsevent != NULL) {
+
+ /* dispatch event at the window object */
+ event_argv[0] = OBJECT_TO_JSVAL(jsevent);
+
+ JS_CallFunctionValue(private->cx,
+ NULL,
+ private->funcval,
+ 1,
+ event_argv,
+ &event_rval);
+ }
+ }
+}
+
+/* add a listener to a dom node
+ *
+ * 1. Create a dom_event_listener From a handle_event function pointer
+ * and a private word In a document context
+ *
+ * 2. Register for your events on a target (dom nodes are targets)
+ * dom_event_target_add_event_listener(node, evt_name, listener,
+ * capture_or_not)
+ *
+ */
+
+bool
+js_dom_event_add_listener(jscontext *ctx,
+ struct dom_document *document,
+ struct dom_node *node,
+ struct dom_string *event_type_dom,
+ void *js_funcval)
+{
+ JSContext *cx = (JSContext *)ctx;
+ dom_exception exc;
+ struct js_dom_event_private *private;
+
+ private = malloc(sizeof(struct js_dom_event_private));
+ if (private == NULL) {
+ return false;
+ }
+
+ exc = dom_event_listener_create(document,
+ js_dom_event_listener,
+ private,
+ &private->listener);
+ if (exc != DOM_NO_ERR) {
+ return false;
+ }
+
+ private->cx = cx;
+ private->funcval = *(jsval *)js_funcval;
+ private->node = node;
+ private->type = event_type_dom;
+
+ JSLOG("adding %p to listener", private);
+
+ JSAPI_ADD_VALUE_ROOT(cx, &private->funcval);
+ exc = dom_event_target_add_event_listener(private->node,
+ private->type,
+ private->listener,
+ true);
+ if (exc != DOM_NO_ERR) {
+ JSLOG("failed to add listener");
+ JSAPI_REMOVE_VALUE_ROOT(cx, &private->funcval);
+ }
+
+ return true;
+}
diff --git a/javascript/jsapi.h b/javascript/jsapi.h
index 6b0f112..e3295fe 100644
--- a/javascript/jsapi.h
+++ b/javascript/jsapi.h
@@ -35,11 +35,13 @@
#include <string.h>
-# ifndef JSVERSION_LATEST
-# define JSVERSION_LATEST JS_VERSION
-# endif
-
+#ifndef JSVERSION_LATEST
+#define JSVERSION_LATEST JS_VERSION
+#endif
+#ifndef JSOPTION_JIT
+#define JSOPTION_JIT 0
+#endif
/* *CAUTION* these native function macros introduce and use jsapi_this
* and jsapi_rval variables, native function code should not conflict
@@ -79,7 +81,7 @@
jsapi_property_##name##_set(cx, obj, jsval jsapi_id, vp)
/* native property return value */
-#define JSAPI_PROP_RVAL(cx, vp) (vp)
+#define JSAPI_PROP_RVAL(cx, vp) (*(vp))
/* native property getter return value */
#define JSAPI_PROP_SET_RVAL(cx, vp, v) (*(vp) = (v))
@@ -150,6 +152,9 @@ JS_NewCompartmentAndGlobalObject(JSContext *cx,
#define JSAPI_ADD_OBJECT_ROOT(cx, obj) JS_AddRoot(cx, obj)
#define JSAPI_REMOVE_OBJECT_ROOT(cx, obj) JS_RemoveRoot(cx, obj)
+#define JSAPI_ADD_VALUE_ROOT(cx, obj) JS_AddRoot(cx, obj)
+#define JSAPI_REMOVE_VALUE_ROOT(cx, obj) JS_RemoveRoot(cx, obj)
+
#elif JS_VERSION == 180
/************************** Spidermonkey 1.8.0 **************************/
@@ -263,6 +268,9 @@ JS_NewCompartmentAndGlobalObject(JSContext *cx,
#define JSAPI_ADD_OBJECT_ROOT(cx, obj) JS_AddRoot(cx, obj)
#define JSAPI_REMOVE_OBJECT_ROOT(cx, obj) JS_RemoveRoot(cx, obj)
+#define JSAPI_ADD_VALUE_ROOT(cx, obj) JS_AddRoot(cx, obj)
+#define JSAPI_REMOVE_VALUE_ROOT(cx, obj) JS_RemoveRoot(cx, obj)
+
#else /* #if JS_VERSION == 180 */
@@ -365,6 +373,9 @@ JS_NewCompartmentAndGlobalObject(JSContext *cx,
#define JSAPI_ADD_OBJECT_ROOT(cx, obj) JS_AddObjectRoot(cx, obj)
#define JSAPI_REMOVE_OBJECT_ROOT(cx, obj) JS_RemoveObjectRoot(cx, obj)
+#define JSAPI_ADD_VALUE_ROOT(cx, val) JS_AddValueRoot(cx, val)
+#define JSAPI_REMOVE_VALUE_ROOT(cx, val) JS_RemoveValueRoot(cx, val)
+
#endif
#define JSLOG(args...) LOG((args))
diff --git a/javascript/jsapi/binding.h b/javascript/jsapi/binding.h
index f274935..7b0f614 100644
--- a/javascript/jsapi/binding.h
+++ b/javascript/jsapi/binding.h
@@ -45,8 +45,8 @@ JSObject *jsapi_InitClass_Location(JSContext *cx, JSObject *parent);
JSObject *jsapi_new_Location(JSContext *cx,
JSObject *window,
JSObject *parent,
- struct browser_window *bw,
- nsurl *url);
+ nsurl *url,
+ html_content *htmlc);
JSObject *jsapi_InitClass_Document(JSContext *cx, JSObject *parent);
diff --git a/javascript/jsapi/dom.bnd b/javascript/jsapi/dom.bnd
index 89d0d84..e781b33 100644
--- a/javascript/jsapi/dom.bnd
+++ b/javascript/jsapi/dom.bnd
@@ -1,4 +1,12 @@
-/* DOM bindings entries */
+/* Binding to generate interfaces for the DOM IDL
+ *
+ * Copyright 2012 Vincent Sanders <vince(a)netsurf-browser.org>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * Released under the terms of the MIT License,
+ * http://www.opensource.org/licenses/mit-license
+ */
webidlfile "dom.idl";
diff --git a/javascript/jsapi/htmlcollection.bnd b/javascript/jsapi/htmlcollection.bnd
index f4a1154..5e99e48 100644
--- a/javascript/jsapi/htmlcollection.bnd
+++ b/javascript/jsapi/htmlcollection.bnd
@@ -1,4 +1,4 @@
-/* Binding to generate HTMLcolelction interface
+/* Binding to generate HTMLcollection interface
*
* The js_libdom (javascript to libdom) binding type is currently the
* only one implemented and this principly describes that binding.
diff --git a/javascript/jsapi/htmldocument.bnd b/javascript/jsapi/htmldocument.bnd
index 0ed7ac1..c29e470 100644
--- a/javascript/jsapi/htmldocument.bnd
+++ b/javascript/jsapi/htmldocument.bnd
@@ -28,6 +28,7 @@ preamble %{
#include "content/urldb.h"
+#include "javascript/js.h"
#include "javascript/jsapi.h"
#include "javascript/jsapi/binding.h"
@@ -43,6 +44,12 @@ binding document {
*/
private "dom_document *" node;
private "struct html_content *" htmlc;
+
+ /** location instantiated on first use */
+ property unshared location;
+
+ /* events through a single interface */
+ property unshared type EventHandler;
}
api finalise %{
@@ -53,6 +60,37 @@ api finalise %{
}
%}
+
+getter location %{
+ if (!JSVAL_IS_VOID(JSAPI_PROP_RVAL(cx,vp))) {
+ /* already created - return it */
+ return JS_TRUE;
+ }
+ jsret = jsapi_new_Location(cx,
+ NULL,
+ NULL,
+ llcache_handle_get_url(private->htmlc->base.llcache),
+ private->htmlc);
+%}
+
+getter URL %{
+ jsval loc;
+ jsval jsstr = JSVAL_NULL;
+ if (JS_GetProperty(cx, obj, "location", &loc) == JS_TRUE) {
+ JS_GetProperty(cx, JSVAL_TO_OBJECT(loc), "href", &jsstr);
+ }
+ jsret = JSVAL_TO_STRING(jsstr);
+%}
+
+getter documentURI %{
+ jsval loc;
+ jsval jsstr = JSVAL_NULL;
+ if (JS_GetProperty(cx, obj, "location", &loc) == JS_TRUE) {
+ JS_GetProperty(cx, JSVAL_TO_OBJECT(loc), "href", &jsstr);
+ }
+ jsret = JSVAL_TO_STRING(jsstr);
+%}
+
getter cookie %{
char *cookie_str;
cookie_str = urldb_get_cookie(llcache_handle_get_url(private->htmlc->base.llcache), false);
@@ -238,3 +276,254 @@ operation createElement %{
JSLOG("returning jsobject %p",jsret);
%}
+
+getter EventHandler %{
+ JSLOG("propname[%d].name=\"%s\"",
+ tinyid,
+ jsclass_properties[tinyid].name);
+%}
+
+
+setter EventHandler %{
+ dom_string *event_type_dom;
+
+ JSLOG("propname[%d].name=\"%s\"",
+ tinyid,
+ jsclass_properties[tinyid].name);
+
+ switch (tinyid) {
+ case JSAPI_PROP_TINYID_onabort:
+ event_type_dom = corestring_dom_abort;
+ break;
+
+ case JSAPI_PROP_TINYID_onblur:
+ event_type_dom = corestring_dom_blur;
+ break;
+
+ case JSAPI_PROP_TINYID_oncancel:
+ event_type_dom = corestring_dom_cancel;
+ break;
+
+ case JSAPI_PROP_TINYID_oncanplay:
+ event_type_dom = corestring_dom_canplay;
+ break;
+
+ case JSAPI_PROP_TINYID_oncanplaythrough:
+ event_type_dom = corestring_dom_canplaythrough;
+ break;
+
+ case JSAPI_PROP_TINYID_onchange:
+ event_type_dom = corestring_dom_change;
+ break;
+
+ case JSAPI_PROP_TINYID_onclick:
+ event_type_dom = corestring_dom_click;
+ break;
+
+ case JSAPI_PROP_TINYID_onclose:
+ event_type_dom = corestring_dom_close;
+ break;
+
+ case JSAPI_PROP_TINYID_oncontextmenu:
+ event_type_dom = corestring_dom_contextmenu;
+ break;
+
+ case JSAPI_PROP_TINYID_oncuechange:
+ event_type_dom = corestring_dom_cuechange;
+ break;
+
+ case JSAPI_PROP_TINYID_ondblclick:
+ event_type_dom = corestring_dom_dblclick;
+ break;
+
+ case JSAPI_PROP_TINYID_ondrag:
+ event_type_dom = corestring_dom_drag;
+ break;
+
+ case JSAPI_PROP_TINYID_ondragend:
+ event_type_dom = corestring_dom_dragend;
+ break;
+
+ case JSAPI_PROP_TINYID_ondragenter:
+ event_type_dom = corestring_dom_dragenter;
+ break;
+
+ case JSAPI_PROP_TINYID_ondragleave:
+ event_type_dom = corestring_dom_dragleave;
+ break;
+
+ case JSAPI_PROP_TINYID_ondragover:
+ event_type_dom = corestring_dom_dragover;
+ break;
+
+ case JSAPI_PROP_TINYID_ondragstart:
+ event_type_dom = corestring_dom_dragstart;
+ break;
+
+ case JSAPI_PROP_TINYID_ondrop:
+ event_type_dom = corestring_dom_drop;
+ break;
+
+ case JSAPI_PROP_TINYID_ondurationchange:
+ event_type_dom = corestring_dom_durationchange;
+ break;
+
+ case JSAPI_PROP_TINYID_onemptied:
+ event_type_dom = corestring_dom_emptied;
+ break;
+
+ case JSAPI_PROP_TINYID_onended:
+ event_type_dom = corestring_dom_ended;
+ break;
+
+ case JSAPI_PROP_TINYID_onerror:
+ event_type_dom = corestring_dom_error;
+ break;
+
+ case JSAPI_PROP_TINYID_onfocus:
+ event_type_dom = corestring_dom_focus;
+ break;
+
+ case JSAPI_PROP_TINYID_oninput:
+ event_type_dom = corestring_dom_input;
+ break;
+
+ case JSAPI_PROP_TINYID_oninvalid:
+ event_type_dom = corestring_dom_invalid;
+ break;
+
+ case JSAPI_PROP_TINYID_onkeydown:
+ event_type_dom = corestring_dom_keydown;
+ break;
+
+ case JSAPI_PROP_TINYID_onkeypress:
+ event_type_dom = corestring_dom_keypress;
+ break;
+
+ case JSAPI_PROP_TINYID_onkeyup:
+ event_type_dom = corestring_dom_keyup;
+ break;
+
+ case JSAPI_PROP_TINYID_onload:
+ event_type_dom = corestring_dom_load;
+ break;
+
+ case JSAPI_PROP_TINYID_onloadeddata:
+ event_type_dom = corestring_dom_loadeddata;
+ break;
+
+ case JSAPI_PROP_TINYID_onloadedmetadata:
+ event_type_dom = corestring_dom_loadedmetadata;
+ break;
+
+ case JSAPI_PROP_TINYID_onloadstart:
+ event_type_dom = corestring_dom_loadstart;
+ break;
+
+ case JSAPI_PROP_TINYID_onmousedown:
+ event_type_dom = corestring_dom_mousedown;
+ break;
+
+ case JSAPI_PROP_TINYID_onmousemove:
+ event_type_dom = corestring_dom_mousemove;
+ break;
+
+ case JSAPI_PROP_TINYID_onmouseout:
+ event_type_dom = corestring_dom_mouseout;
+ break;
+
+ case JSAPI_PROP_TINYID_onmouseover:
+ event_type_dom = corestring_dom_mouseover;
+ break;
+
+ case JSAPI_PROP_TINYID_onmouseup:
+ event_type_dom = corestring_dom_mouseup;
+ break;
+
+ case JSAPI_PROP_TINYID_onmousewheel:
+ event_type_dom = corestring_dom_mousewheel;
+ break;
+
+ case JSAPI_PROP_TINYID_onpause:
+ event_type_dom = corestring_dom_pause;
+ break;
+
+ case JSAPI_PROP_TINYID_onplay:
+ event_type_dom = corestring_dom_play;
+ break;
+
+ case JSAPI_PROP_TINYID_onplaying:
+ event_type_dom = corestring_dom_playing;
+ break;
+
+ case JSAPI_PROP_TINYID_onprogress:
+ event_type_dom = corestring_dom_progress;
+ break;
+
+ case JSAPI_PROP_TINYID_onratechange:
+ event_type_dom = corestring_dom_ratechange;
+ break;
+
+ case JSAPI_PROP_TINYID_onreset:
+ event_type_dom = corestring_dom_reset;
+ break;
+
+ case JSAPI_PROP_TINYID_onscroll:
+ event_type_dom = corestring_dom_scroll;
+ break;
+
+ case JSAPI_PROP_TINYID_onseeked:
+ event_type_dom = corestring_dom_seeked;
+ break;
+
+ case JSAPI_PROP_TINYID_onseeking:
+ event_type_dom = corestring_dom_seeking;
+ break;
+
+ case JSAPI_PROP_TINYID_onselect:
+ event_type_dom = corestring_dom_select;
+ break;
+
+ case JSAPI_PROP_TINYID_onshow:
+ event_type_dom = corestring_dom_show;
+ break;
+
+ case JSAPI_PROP_TINYID_onstalled:
+ event_type_dom = corestring_dom_stalled;
+ break;
+
+ case JSAPI_PROP_TINYID_onsubmit:
+ event_type_dom = corestring_dom_submit;
+ break;
+
+ case JSAPI_PROP_TINYID_onsuspend:
+ event_type_dom = corestring_dom_suspend;
+ break;
+
+ case JSAPI_PROP_TINYID_ontimeupdate:
+ event_type_dom = corestring_dom_timeupdate;
+ break;
+
+ case JSAPI_PROP_TINYID_onvolumechange:
+ event_type_dom = corestring_dom_volumechange;
+ break;
+
+ case JSAPI_PROP_TINYID_onwaiting:
+ event_type_dom = corestring_dom_waiting;
+ break;
+
+ case JSAPI_PROP_TINYID_onreadystatechange:
+ event_type_dom = corestring_dom_readystatechange;
+ break;
+
+ default:
+ JSLOG("called with unknown tinyid");
+ return JS_TRUE;
+ }
+
+ js_dom_event_add_listener((struct jscontext *)cx,
+ private->node,
+ (dom_node *)private->node,
+ event_type_dom,
+ vp);
+%}
diff --git a/javascript/jsapi/htmlelement.bnd b/javascript/jsapi/htmlelement.bnd
index 71bb31b..3ede93b 100644
--- a/javascript/jsapi/htmlelement.bnd
+++ b/javascript/jsapi/htmlelement.bnd
@@ -23,19 +23,96 @@ 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"
%}
binding htmlelement {
- type js_libdom; /* the binding type */
-
- interface HTMLElement; /* Web IDL interface to generate */
-
- private "dom_element *" node;
- private "struct html_content *" htmlc;
+ type js_libdom; /* the binding type */
+
+ interface HTMLElement; /* Web IDL interface to generate */
+ /* superclasses
+
+ interface HTMLAnchorElement
+ interface HTMLAppletElement
+ interface HTMLAreaElement
+ interface HTMLBaseElement
+ interface HTMLBaseFontElement
+ interface HTMLBodyElement
+ interface HTMLBRElement
+ interface HTMLButtonElement
+ interface HTMLCanvasElement
+ interface HTMLCommandElement
+ interface HTMLDataElement
+ interface HTMLDataListElement
+ interface HTMLDetailsElement
+ interface HTMLDialogElement
+ interface HTMLDirectoryElement
+ interface HTMLDivElement
+ interface HTMLDListElement
+ interface HTMLEmbedElement
+ interface HTMLFieldSetElement
+ interface HTMLFontElement
+ interface HTMLFormElement
+ interface HTMLFrameElement
+ interface HTMLFrameSetElement
+ interface HTMLHeadElement
+ interface HTMLHeadingElement
+ interface HTMLHRElement
+ interface HTMLHtmlElement
+ interface HTMLIFrameElement
+ interface HTMLImageElement
+ interface HTMLInputElement
+ interface HTMLKeygenElement
+ interface HTMLLabelElement
+ interface HTMLLegendElement
+ interface HTMLLIElement
+ interface HTMLLinkElement
+ interface HTMLMapElement
+ interface HTMLMarqueeElement
+ interface HTMLMediaElement
+ interface HTMLMenuElement
+ interface HTMLMetaElement
+ interface HTMLMeterElement
+ interface HTMLModElement
+ interface HTMLObjectElement
+ interface HTMLOListElement
+ interface HTMLOptGroupElement
+ interface HTMLOptionElement
+ interface HTMLOutputElement
+ interface HTMLParagraphElement
+ interface HTMLParamElement
+ interface HTMLPreElement
+ interface HTMLProgressElement
+ interface HTMLQuoteElement
+ interface HTMLScriptElement
+ interface HTMLSelectElement
+ interface HTMLSourceElement
+ interface HTMLSpanElement
+ interface HTMLStyleElement
+ interface HTMLTableCaptionElement
+ interface HTMLTableCellElement
+ interface HTMLTableColElement
+ interface HTMLTableElement
+ interface HTMLTableRowElement
+ interface HTMLTableSectionElement
+ interface HTMLTextAreaElement
+ interface HTMLTimeElement
+ interface HTMLTitleElement
+ interface HTMLTrackElement
+ interface HTMLUListElement
+ interface HTMLUnknownElement
+ */
+
+ private "dom_element *" node;
+ private "struct html_content *" htmlc;
+
+ /* events through a single interface */
+ property unshared type EventHandler;
}
api finalise %{
@@ -214,3 +291,250 @@ getter childElementCount %{
}
}
%}
+
+getter EventHandler %{
+ JSLOG("propname[%d].name=\"%s\"",
+ tinyid,
+ jsclass_properties[tinyid].name);
+%}
+
+
+setter EventHandler %{
+ dom_string *event_type_dom;
+
+ JSLOG("propname[%d].name=\"%s\"",
+ tinyid,
+ jsclass_properties[tinyid].name);
+
+ switch (tinyid) {
+ case JSAPI_PROP_TINYID_onabort:
+ event_type_dom = corestring_dom_abort;
+ break;
+
+ case JSAPI_PROP_TINYID_onblur:
+ event_type_dom = corestring_dom_blur;
+ break;
+
+ case JSAPI_PROP_TINYID_oncancel:
+ event_type_dom = corestring_dom_cancel;
+ break;
+
+ case JSAPI_PROP_TINYID_oncanplay:
+ event_type_dom = corestring_dom_canplay;
+ break;
+
+ case JSAPI_PROP_TINYID_oncanplaythrough:
+ event_type_dom = corestring_dom_canplaythrough;
+ break;
+
+ case JSAPI_PROP_TINYID_onchange:
+ event_type_dom = corestring_dom_change;
+ break;
+
+ case JSAPI_PROP_TINYID_onclick:
+ event_type_dom = corestring_dom_click;
+ break;
+
+ case JSAPI_PROP_TINYID_onclose:
+ event_type_dom = corestring_dom_close;
+ break;
+
+ case JSAPI_PROP_TINYID_oncontextmenu:
+ event_type_dom = corestring_dom_contextmenu;
+ break;
+
+ case JSAPI_PROP_TINYID_oncuechange:
+ event_type_dom = corestring_dom_cuechange;
+ break;
+
+ case JSAPI_PROP_TINYID_ondblclick:
+ event_type_dom = corestring_dom_dblclick;
+ break;
+
+ case JSAPI_PROP_TINYID_ondrag:
+ event_type_dom = corestring_dom_drag;
+ break;
+
+ case JSAPI_PROP_TINYID_ondragend:
+ event_type_dom = corestring_dom_dragend;
+ break;
+
+ case JSAPI_PROP_TINYID_ondragenter:
+ event_type_dom = corestring_dom_dragenter;
+ break;
+
+ case JSAPI_PROP_TINYID_ondragleave:
+ event_type_dom = corestring_dom_dragleave;
+ break;
+
+ case JSAPI_PROP_TINYID_ondragover:
+ event_type_dom = corestring_dom_dragover;
+ break;
+
+ case JSAPI_PROP_TINYID_ondragstart:
+ event_type_dom = corestring_dom_dragstart;
+ break;
+
+ case JSAPI_PROP_TINYID_ondrop:
+ event_type_dom = corestring_dom_drop;
+ break;
+
+ case JSAPI_PROP_TINYID_ondurationchange:
+ event_type_dom = corestring_dom_durationchange;
+ break;
+
+ case JSAPI_PROP_TINYID_onemptied:
+ event_type_dom = corestring_dom_emptied;
+ break;
+
+ case JSAPI_PROP_TINYID_onended:
+ event_type_dom = corestring_dom_ended;
+ break;
+
+ case JSAPI_PROP_TINYID_onerror:
+ event_type_dom = corestring_dom_error;
+ break;
+
+ case JSAPI_PROP_TINYID_onfocus:
+ event_type_dom = corestring_dom_focus;
+ break;
+
+ case JSAPI_PROP_TINYID_oninput:
+ event_type_dom = corestring_dom_input;
+ break;
+
+ case JSAPI_PROP_TINYID_oninvalid:
+ event_type_dom = corestring_dom_invalid;
+ break;
+
+ case JSAPI_PROP_TINYID_onkeydown:
+ event_type_dom = corestring_dom_keydown;
+ break;
+
+ case JSAPI_PROP_TINYID_onkeypress:
+ event_type_dom = corestring_dom_keypress;
+ break;
+
+ case JSAPI_PROP_TINYID_onkeyup:
+ event_type_dom = corestring_dom_keyup;
+ break;
+
+ case JSAPI_PROP_TINYID_onload:
+ event_type_dom = corestring_dom_load;
+ break;
+
+ case JSAPI_PROP_TINYID_onloadeddata:
+ event_type_dom = corestring_dom_loadeddata;
+ break;
+
+ case JSAPI_PROP_TINYID_onloadedmetadata:
+ event_type_dom = corestring_dom_loadedmetadata;
+ break;
+
+ case JSAPI_PROP_TINYID_onloadstart:
+ event_type_dom = corestring_dom_loadstart;
+ break;
+
+ case JSAPI_PROP_TINYID_onmousedown:
+ event_type_dom = corestring_dom_mousedown;
+ break;
+
+ case JSAPI_PROP_TINYID_onmousemove:
+ event_type_dom = corestring_dom_mousemove;
+ break;
+
+ case JSAPI_PROP_TINYID_onmouseout:
+ event_type_dom = corestring_dom_mouseout;
+ break;
+
+ case JSAPI_PROP_TINYID_onmouseover:
+ event_type_dom = corestring_dom_mouseover;
+ break;
+
+ case JSAPI_PROP_TINYID_onmouseup:
+ event_type_dom = corestring_dom_mouseup;
+ break;
+
+ case JSAPI_PROP_TINYID_onmousewheel:
+ event_type_dom = corestring_dom_mousewheel;
+ break;
+
+ case JSAPI_PROP_TINYID_onpause:
+ event_type_dom = corestring_dom_pause;
+ break;
+
+ case JSAPI_PROP_TINYID_onplay:
+ event_type_dom = corestring_dom_play;
+ break;
+
+ case JSAPI_PROP_TINYID_onplaying:
+ event_type_dom = corestring_dom_playing;
+ break;
+
+ case JSAPI_PROP_TINYID_onprogress:
+ event_type_dom = corestring_dom_progress;
+ break;
+
+ case JSAPI_PROP_TINYID_onratechange:
+ event_type_dom = corestring_dom_ratechange;
+ break;
+
+ case JSAPI_PROP_TINYID_onreset:
+ event_type_dom = corestring_dom_reset;
+ break;
+
+ case JSAPI_PROP_TINYID_onscroll:
+ event_type_dom = corestring_dom_scroll;
+ break;
+
+ case JSAPI_PROP_TINYID_onseeked:
+ event_type_dom = corestring_dom_seeked;
+ break;
+
+ case JSAPI_PROP_TINYID_onseeking:
+ event_type_dom = corestring_dom_seeking;
+ break;
+
+ case JSAPI_PROP_TINYID_onselect:
+ event_type_dom = corestring_dom_select;
+ break;
+
+ case JSAPI_PROP_TINYID_onshow:
+ event_type_dom = corestring_dom_show;
+ break;
+
+ case JSAPI_PROP_TINYID_onstalled:
+ event_type_dom = corestring_dom_stalled;
+ break;
+
+ case JSAPI_PROP_TINYID_onsubmit:
+ event_type_dom = corestring_dom_submit;
+ break;
+
+ case JSAPI_PROP_TINYID_onsuspend:
+ event_type_dom = corestring_dom_suspend;
+ break;
+
+ case JSAPI_PROP_TINYID_ontimeupdate:
+ event_type_dom = corestring_dom_timeupdate;
+ break;
+
+ case JSAPI_PROP_TINYID_onvolumechange:
+ event_type_dom = corestring_dom_volumechange;
+ break;
+
+ case JSAPI_PROP_TINYID_onwaiting:
+ event_type_dom = corestring_dom_waiting;
+ break;
+
+ default:
+ JSLOG("called with unknown tinyid");
+ return JS_TRUE;
+ }
+
+ js_dom_event_add_listener((struct jscontext *)cx,
+ private->htmlc->document,
+ (dom_node *)private->node,
+ event_type_dom,
+ vp);
+%}
diff --git a/javascript/jsapi/location.bnd b/javascript/jsapi/location.bnd
index 32e38da..32677d1 100644
--- a/javascript/jsapi/location.bnd
+++ b/javascript/jsapi/location.bnd
@@ -32,19 +32,27 @@ binding location {
interface Location; /* Web IDL interface to generate */
- private "struct browser_window *" bw;
private "nsurl *" url;
+ private "struct html_content *" htmlc;
+
+ property unshared href;
}
operation reload %{
- browser_window_reload(private->bw, false);
+ browser_window_reload(private->htmlc->bw, false);
%}
getter href %{
char *url_s = NULL;
size_t url_l;
+
+ if (!JSVAL_IS_VOID(JSAPI_PROP_RVAL(cx,vp))) {
+ /* already created - return it */
+ return JS_TRUE;
+ }
+
nsurl_get(private->url, NSURL_COMPLETE, &url_s, &url_l);
if (url_s != NULL) {
jsret = JS_NewStringCopyN(cx, url_s, url_l);
diff --git a/javascript/jsapi/nodelist.bnd b/javascript/jsapi/nodelist.bnd
index d6e9fe9..b57dc6e 100644
--- a/javascript/jsapi/nodelist.bnd
+++ b/javascript/jsapi/nodelist.bnd
@@ -1,8 +1,5 @@
/* Binding to generate NodeList interface
*
- * The js_libdom (javascript to libdom) binding type is currently the
- * only one implemented and this principly describes that binding.
- *
* Copyright 2012 Vincent Sanders <vince(a)netsurf-browser.org>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
@@ -32,12 +29,12 @@ preamble %{
webidlfile "dom.idl";
binding nodelist {
- type js_libdom; /* the binding type */
+ type js_libdom; /* the binding type */
- interface NodeList; /* The WebIDL interface to generate a binding for */
+ interface NodeList; /* The WebIDL interface to generate a binding for */
- private "dom_nodelist *" nodelist;
- private "struct html_content *" htmlc;
+ private "dom_nodelist *" nodelist;
+ private "struct html_content *" htmlc;
}
getter length %{
diff --git a/javascript/jsapi/window.bnd b/javascript/jsapi/window.bnd
index 610aa71..6153e90 100644
--- a/javascript/jsapi/window.bnd
+++ b/javascript/jsapi/window.bnd
@@ -42,7 +42,6 @@ binding window {
internal "JSObject *" document;
internal "JSObject *" navigator;
internal "JSObject *" console;
- internal "JSObject *" location;
property unshared type EventHandler;
}
@@ -58,9 +57,6 @@ api mark %{
if (private->console != NULL) {
JSAPI_GCMARK(private->console);
}
- if (private->location != NULL) {
- JSAPI_GCMARK(private->location);
- }
}
%}
@@ -180,13 +176,6 @@ api new %{
return NULL;
}
- private->location = jsapi_new_Location(cx, NULL, newobject, bw,
- llcache_handle_get_url(private->htmlc->base.llcache));
- if (private->location == NULL) {
- free(private);
- return NULL;
- }
-
private->console = jsapi_new_Console(cx, NULL, newobject);
if (private->console == NULL) {
free(private);
@@ -210,14 +199,6 @@ operation prompt %{
warn_user(message, NULL);
%}
-getter window %{
- jsret = obj;
-%}
-
-getter self %{
- jsret = obj;
-%}
-
/* boolean dispatchEvent(Event event); */
operation dispatchEvent %{
/* this implementation is unique to the window object as it is
@@ -225,49 +206,63 @@ operation dispatchEvent %{
*/
/* caution, this must match the struct generated from event.bnd */
- if (event == JSVAL_VOID) {
+ struct {
+ dom_event *event;
+ } *event_private;
+ dom_string *type_dom = NULL;
+ dom_exception exc;
+ jsval eventval = JSVAL_VOID;
+ jsval event_argv[1];
+ jsval event_rval;
+
+ event_private = JS_GetInstancePrivate(cx, event, &JSClass_Event, NULL);
+ if (event_private->event == NULL) {
+ /** @todo type error? */
jsret = JS_FALSE;
} else {
- struct {
- dom_event *event;
- } *event_private;
- dom_string *type_dom = NULL;
- dom_exception exc;
- jsval eventval = JSVAL_VOID;
- jsval event_argv[1];
- jsval event_rval;
-
- event_private = JS_GetInstancePrivate(cx, event, &JSClass_Event, NULL);
- if (event_private->event == NULL) {
- /** @todo type error? */
- jsret = JS_FALSE;
- } else {
- exc = dom_event_get_type(event_private->event, &type_dom);
- if (exc == DOM_NO_ERR) {
-
- if (dom_string_isequal(type_dom, corestring_dom_load)) {
- JS_GetProperty(cx, JSAPI_THIS_OBJECT(cx, vp), "onload", &eventval);
- }
-
- if (eventval != JSVAL_VOID) {
- event_argv[0] = eventval;
- jsret = JS_CallFunctionValue(cx, NULL, eventval, 1, event_argv, &event_rval);
- }
+ exc = dom_event_get_type(event_private->event, &type_dom);
+ if (exc == DOM_NO_ERR) {
+
+ if (dom_string_isequal(type_dom, corestring_dom_load)) {
+ JS_GetProperty(cx, JSAPI_THIS_OBJECT(cx, vp), "onload", &eventval);
+ }
+
+ if (!JSVAL_IS_VOID(eventval)) {
+ event_argv[0] = eventval;
+ jsret = JS_CallFunctionValue(cx, NULL, eventval, 1, event_argv, &event_rval);
}
}
- }
+ }
+%}
+
+getter location %{
+ jsval loc;
+ JS_GetProperty(cx, private->document, "location", &loc);
+ jsret = JSVAL_TO_OBJECT(loc);
+%}
+
+getter window %{
+ jsret = obj;
+%}
+
+getter self %{
+ jsret = obj;
%}
getter EventHandler %{
/* this implementation is unique to the window object as it is
* not a dom node.
*/
- JSLOG("propname[%d] %s %s", tinyid , jsclass_properties[tinyid].name, JS_GetTypeName(cx, JS_TypeOfValue(cx, tinyid_jsval)));
+ JSLOG("propname[%d]=\"%s\"",
+ tinyid,
+ jsclass_properties[tinyid].name);
%}
setter EventHandler %{
/* this implementation is unique to the window object as it is
* not a dom node.
*/
- JSLOG("propname[%d] %s %s", tinyid, jsclass_properties[tinyid].name, JS_GetTypeName(cx, JS_TypeOfValue(cx, tinyid_jsval)));
+ JSLOG("propname[%d]=\"%s\"",
+ tinyid,
+ jsclass_properties[tinyid].name);
%}
diff --git a/javascript/none.c b/javascript/none.c
index 6354a12..3e7b39c 100644
--- a/javascript/none.c
+++ b/javascript/none.c
@@ -54,7 +54,7 @@ bool js_exec(jscontext *ctx, const char *txt, size_t txtlen)
return true;
}
-bool js_fire_event(jscontext *ctx, const char *type, void *target)
+bool js_fire_event(jscontext *ctx, const char *type, struct dom_document *doc, struct dom_node *target)
{
return true;
}
diff --git a/monkey/Makefile.defaults b/monkey/Makefile.defaults
new file mode 100644
index 0000000..659c1e3
--- /dev/null
+++ b/monkey/Makefile.defaults
@@ -0,0 +1,13 @@
+# ----------------------------------------------------------------------------
+# Monkey-specific options
+# ----------------------------------------------------------------------------
+
+ # How did I get mixed up with this fucking monkey anyhow?
+ NETSURF_MONKEY_RESOURCES := $(PREFIX)/share/netsurf/
+ NETSURF_MONKEY_BIN := $(PREFIX)/bin/
+ NETSURF_USE_RSVG := NO
+ NETSURF_USE_NSSVG := NO
+ NETSURF_USE_ROSPRITE := NO
+ NETSURF_USE_HARU_PDF := NO
+ NETSURF_USE_LIBICONV_PLUG := NO
+ CFLAGS += -O2
diff --git a/monkey/Makefile.target b/monkey/Makefile.target
index b8891d3..fa15a50 100644
--- a/monkey/Makefile.target
+++ b/monkey/Makefile.target
@@ -22,18 +22,20 @@ NETSURF_FEATURE_JS_CFLAGS := -DWITH_JS -DJS_HAS_FILE_OBJECT=0
NETSURF_FEATURE_MOZJS_CFLAGS := -DWITH_MOZJS -DJS_HAS_FILE_OBJECT=0
# add a line similar to below for each optional pkg-configed lib here
-$(eval $(call pkg_config_find_and_add,NSSVG,libsvgtiny,SVG))
-$(eval $(call pkg_config_find_and_add,ROSPRITE,librosprite,Sprite))
-$(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
-$(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
-$(eval $(call pkg_config_find_and_add,PNG,libpng,PNG ))
-$(eval $(call pkg_config_find_and_add,MOZJS,mozjs185,JavaScript))
-$(eval $(call pkg_config_find_and_add,JS,mozilla-js,JavaScript))
+$(eval $(call pkg_config_find_and_add_enabled,NSSVG,libsvgtiny,SVG))
+$(eval $(call pkg_config_find_and_add_enabled,ROSPRITE,librosprite,Sprite))
+$(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 ))
+$(eval $(call pkg_config_find_and_add_enabled,MOZJS,mozjs185,JavaScript))
+$(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
# no pkg-config for this library
$(eval $(call feature_enabled,WEBP,-DWITH_WEBP,-lwebp -lvpx,WebP (libwebp)))
- MONKEYCFLAGS := -std=c99 -Dmonkey -Dnsmonkey \
+WARNFLAGS += -Werror
+
+MONKEYCFLAGS := -std=c99 -Dmonkey -Dnsmonkey \
-D_BSD_SOURCE \
-D_XOPEN_SOURCE=600 \
-D_POSIX_C_SOURCE=200112L \
@@ -45,18 +47,19 @@ $(eval $(call feature_enabled,WEBP,-DWITH_WEBP,-lwebp -lvpx,WebP (libwebp)))
$(shell $(PKG_CONFIG) --cflags openssl) \
$(shell xml2-config --cflags)
- MONKEYLDFLAGS := -lm $(shell $(PKG_CONFIG) --cflags --libs glib-2.0 lcms)
+MONKEYLDFLAGS := -lm $(shell $(PKG_CONFIG) --cflags --libs glib-2.0 lcms)
+
- CFLAGS += $(MONKEYCFLAGS) -Werror -Wno-unused-but-set-variable
- LDFLAGS += $(MONKEYLDFLAGS)
+CFLAGS += $(MONKEYCFLAGS)
+LDFLAGS += $(MONKEYLDFLAGS)
- # ---------------------------------------------------------------------------
- # Windows flag setup
- # ---------------------------------------------------------------------------
+# ---------------------------------------------------------------------------
+# Windows flag setup
+# ---------------------------------------------------------------------------
- ifeq ($(HOST),Windows_NT)
- CFLAGS += -U__STRICT_ANSI__
- endif
+ifeq ($(HOST),Windows_NT)
+ CFLAGS += -U__STRICT_ANSI__
+endif
# ----------------------------------------------------------------------------
# Source file setup
diff --git a/render/box.c b/render/box.c
index b9d0598..5dfada0 100644
--- a/render/box.c
+++ b/render/box.c
@@ -92,9 +92,14 @@ static int box_talloc_destructor(struct box *b)
if (b->href != NULL)
nsurl_unref(b->href);
- if (b->id != NULL)
+ if (b->id != NULL) {
lwc_string_unref(b->id);
-
+ }
+
+ if (b->node != NULL) {
+ dom_node_unref(b->node);
+ }
+
return 0;
}
@@ -172,6 +177,7 @@ struct box * box_create(css_select_results *styles, css_computed_style *style,
box->object = NULL;
box->object_params = NULL;
box->iframe = NULL;
+ box->node = NULL;
return box;
}
diff --git a/render/box.h b/render/box.h
index a4622e3..0953d9f 100644
--- a/render/box.h
+++ b/render/box.h
@@ -265,6 +265,8 @@ struct box {
/** Iframe's browser_window, or NULL if none */
struct browser_window *iframe;
+
+ struct dom_node *node; /**< DOM node that generated this box or NULL */
};
/** Table column data. */
diff --git a/render/box_construct.c b/render/box_construct.c
index 6357587..52c8cfe 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -994,12 +994,15 @@ bool box_construct_element(struct box_construct_ctx *ctx,
return true;
}
- /* Attach box to DOM node */
+ /* Attach DOM node to box */
err = dom_node_set_user_data(ctx->n, kstr_box_key, box, NULL,
(void *) &old_box);
if (err != DOM_NO_ERR)
return false;
+ /* Attach box to DOM node */
+ box->node = dom_node_ref(ctx->n);
+
if (props.inline_container == NULL &&
(box->type == BOX_INLINE ||
box->type == BOX_BR ||
diff --git a/render/html.c b/render/html.c
index fc60843..19ea5a9 100644
--- a/render/html.c
+++ b/render/html.c
@@ -43,6 +43,7 @@
#include "render/imagemap.h"
#include "render/layout.h"
#include "render/search.h"
+#include "javascript/js.h"
#include "utils/corestrings.h"
#include "utils/http.h"
#include "utils/libdom.h"
@@ -111,60 +112,6 @@ static nserror css_error_to_nserror(css_error error)
return NSERROR_CSS;
}
-static nserror
-dom_hubbub_error_to_nserror(dom_hubbub_error error)
-{
- switch (error) {
-
- /* HUBBUB_REPROCESS is not handled here because it can
- * never occur outside the hubbub treebuilder
- */
-
- case DOM_HUBBUB_OK:
- /* parsed ok */
- return NSERROR_OK;
-
- case (DOM_HUBBUB_HUBBUB_ERR | HUBBUB_PAUSED):
- /* hubbub input paused */
- return NSERROR_OK;
-
- case DOM_HUBBUB_NOMEM:
- /* out of memory error from DOM */
- return NSERROR_NOMEM;
-
- case (DOM_HUBBUB_HUBBUB_ERR | HUBBUB_ENCODINGCHANGE):
- /* encoding changed */
- return NSERROR_ENCODING_CHANGE;
-
- case (DOM_HUBBUB_HUBBUB_ERR | HUBBUB_NOMEM):
- /* out of memory error from parser */
- return NSERROR_NOMEM;
-
- case (DOM_HUBBUB_HUBBUB_ERR | HUBBUB_BADPARM):
- return NSERROR_BAD_PARAMETER;
-
- case (DOM_HUBBUB_HUBBUB_ERR | HUBBUB_INVALID):
- return NSERROR_INVALID;
-
- case (DOM_HUBBUB_HUBBUB_ERR | HUBBUB_FILENOTFOUND):
- return NSERROR_NOT_FOUND;
-
- case (DOM_HUBBUB_HUBBUB_ERR | HUBBUB_NEEDDATA):
- return NSERROR_NEED_DATA;
-
- case (DOM_HUBBUB_HUBBUB_ERR | HUBBUB_BADENCODING):
- return NSERROR_BAD_ENCODING;
-
- case (DOM_HUBBUB_HUBBUB_ERR | HUBBUB_UNKNOWN):
- /* currently only generated by the libdom hubbub binding */
- return NSERROR_DOM;
- default:
- /* unknown error */
- /** @todo better error handling and reporting */
- return NSERROR_UNKNOWN;
- }
- return NSERROR_UNKNOWN;
-}
static void html_destroy_objects(html_content *html)
{
@@ -335,7 +282,7 @@ void html_finish_conversion(html_content *c)
* object, but with its target set to the Document object (and
* the currentTarget set to the Window object)
*/
- js_fire_event(c->jscontext, "load", NULL);
+ js_fire_event(c->jscontext, "load", c->document, NULL);
/* convert dom tree to box tree */
LOG(("DOM to box (%p)", c));
@@ -370,6 +317,8 @@ html_create_html_data(html_content *c, const http_parameter *params)
{
lwc_string *charset;
nserror nerror;
+ dom_hubbub_parser_params parse_params;
+ dom_hubbub_error error;
c->parser = NULL;
c->document = NULL;
@@ -423,36 +372,38 @@ html_create_html_data(html_content *c, const http_parameter *params)
}
/* Create the parser binding */
- c->parser = dom_hubbub_parser_create(c->encoding,
- true,
- nsoption_bool(enable_javascript),
- NULL,
- html_process_script,
- c,
- &c->document);
- if ((c->parser == NULL) && (c->encoding != NULL)) {
+ parse_params.enc = c->encoding;
+ parse_params.fix_enc = true;
+ parse_params.enable_script = nsoption_bool(enable_javascript);
+ parse_params.msg = NULL;
+ parse_params.script = html_process_script;
+ parse_params.ctx = c;
+ parse_params.daf = NULL;
+
+ error = dom_hubbub_parser_create(&parse_params,
+ &c->parser,
+ &c->document);
+ if ((error != DOM_HUBBUB_OK) && (c->encoding != NULL)) {
/* Ok, we don't support the declared encoding. Bailing out
* isn't exactly user-friendly, so fall back to autodetect */
free(c->encoding);
c->encoding = NULL;
- c->parser = dom_hubbub_parser_create(c->encoding,
- true,
- nsoption_bool(enable_javascript),
- NULL,
- html_process_script,
- c,
- &c->document);
+ parse_params.enc = c->encoding;
+
+ error = dom_hubbub_parser_create(&parse_params,
+ &c->parser,
+ &c->document);
}
- if (c->parser == NULL) {
+ if (error != DOM_HUBBUB_OK) {
nsurl_unref(c->base_url);
c->base_url = NULL;
lwc_string_unref(c->universal);
c->universal = NULL;
- return NSERROR_NOMEM;
+ return libdom_hubbub_error_to_nserror(error);
}
return NSERROR_OK;
@@ -509,6 +460,7 @@ html_process_encoding_change(struct content *c,
unsigned int size)
{
html_content *html = (html_content *) c;
+ dom_hubbub_parser_params parse_params;
dom_hubbub_error error;
const char *encoding;
const char *source_data;
@@ -538,15 +490,19 @@ html_process_encoding_change(struct content *c,
dom_node_unref(html->document);
}
+ parse_params.enc = html->encoding;
+ parse_params.fix_enc = true;
+ parse_params.enable_script = nsoption_bool(enable_javascript);
+ parse_params.msg = NULL;
+ parse_params.script = html_process_script;
+ parse_params.ctx = html;
+ parse_params.daf = NULL;
+
/* Create new binding, using the new encoding */
- html->parser = dom_hubbub_parser_create(html->encoding,
- true,
- nsoption_bool(enable_javascript),
- NULL,
- html_process_script,
- html,
- &html->document);
- if (html->parser == NULL) {
+ error = dom_hubbub_parser_create(&parse_params,
+ &html->parser,
+ &html->document);
+ if (error != DOM_HUBBUB_OK) {
/* Ok, we don't support the declared encoding. Bailing out
* isn't exactly user-friendly, so fall back to Windows-1252 */
free(html->encoding);
@@ -554,21 +510,14 @@ html_process_encoding_change(struct content *c,
if (html->encoding == NULL) {
return NSERROR_NOMEM;
}
+ parse_params.enc = html->encoding;
- html->parser = dom_hubbub_parser_create(html->encoding,
- true,
- nsoption_bool(enable_javascript),
- NULL,
- html_process_script,
- html,
- &html->document);
-
- if (html->parser == NULL) {
- /** @todo add a message callback function and pass the
- * parser errors back instead of everything being
- * OOM
- */
- return NSERROR_NOMEM;
+ error = dom_hubbub_parser_create(&parse_params,
+ &html->parser,
+ &html->document);
+
+ if (error != DOM_HUBBUB_OK) {
+ return libdom_hubbub_error_to_nserror(error);
}
}
@@ -583,7 +532,7 @@ html_process_encoding_change(struct content *c,
(const uint8_t *)source_data,
source_size);
- return dom_hubbub_error_to_nserror(error);
+ return libdom_hubbub_error_to_nserror(error);
}
@@ -602,7 +551,7 @@ html_process_data(struct content *c, const char *data, unsigned int size)
(const uint8_t *) data,
size);
- err = dom_hubbub_error_to_nserror(dom_ret);
+ err = libdom_hubbub_error_to_nserror(dom_ret);
/* deal with encoding change */
if (err == NSERROR_ENCODING_CHANGE) {
@@ -1992,7 +1941,7 @@ html_begin_conversion(html_content *htmlc)
LOG(("Parsing failed"));
content_broadcast_errorcode(&htmlc->base,
- dom_hubbub_error_to_nserror(error));
+ libdom_hubbub_error_to_nserror(error));
return false;
}
diff --git a/render/html_interaction.c b/render/html_interaction.c
index 2b6bc9a..d22869e 100644
--- a/render/html_interaction.c
+++ b/render/html_interaction.c
@@ -42,6 +42,7 @@
#include "render/html_internal.h"
#include "render/imagemap.h"
#include "render/textinput.h"
+#include "javascript/js.h"
#include "utils/messages.h"
#include "utils/utils.h"
@@ -323,6 +324,7 @@ void html_mouse_action(struct content *c, struct browser_window *bw,
int padding_left, padding_right, padding_top, padding_bottom;
browser_drag_type drag_type = browser_window_get_drag_type(bw);
union content_msg_data msg_data;
+ struct dom_node *node = NULL;
if (drag_type != DRAGGING_NONE && !mouse &&
html->visible_select_menu != NULL) {
@@ -389,7 +391,8 @@ void html_mouse_action(struct content *c, struct browser_window *bw,
browser_window_set_drag_type(bw, DRAGGING_NONE, NULL);
/* search the box tree for a link, imagemap, form control, or
- * box with scrollbars */
+ * box with scrollbars
+ */
box = html->layout;
@@ -397,13 +400,48 @@ void html_mouse_action(struct content *c, struct browser_window *bw,
box_x = box->margin[LEFT];
box_y = box->margin[TOP];
- while ((next_box = box_at_point(box, x, y, &box_x, &box_y)) !=
- NULL) {
+ /* descend through visible boxes setting more specific values for:
+ * box - deepest box at point
+ * html_object_box - html object
+ * html_object_pos_x - html object
+ * html_object_pos_y - html object
+ * object - non html object
+ * iframe - iframe
+ * url - href or imagemap
+ * target - href or imagemap or gadget
+ * url_box - href or imagemap
+ * imagemap - imagemap
+ * gadget - gadget
+ * gadget_box - gadget
+ * gadget_box_x - gadget
+ * gadget_box_y - gadget
+ * title - title
+ * pointer
+ *
+ * drag_candidate - first box with scroll
+ * padding_left - box with scroll
+ * padding_right
+ * padding_top
+ * padding_bottom
+ * scrollbar - inside padding box stops decent
+ * scroll_mouse_x - inside padding box stops decent
+ * scroll_mouse_y - inside padding box stops decent
+ *
+ * text_box - text box
+ * text_box_x - text_box
+ */
+ while ((next_box = box_at_point(box, x, y, &box_x, &box_y)) != NULL) {
box = next_box;
- if (box->style && css_computed_visibility(box->style) ==
- CSS_VISIBILITY_HIDDEN)
+ if ((box->style != NULL) &&
+ (css_computed_visibility(box->style) ==
+ CSS_VISIBILITY_HIDDEN)) {
continue;
+ }
+
+ if (box->node != NULL) {
+ node = box->node;
+ }
if (box->object) {
if (content_get_type(box->object) == CONTENT_HTML) {
@@ -415,8 +453,9 @@ void html_mouse_action(struct content *c, struct browser_window *bw,
}
}
- if (box->iframe)
+ if (box->iframe) {
iframe = box->iframe;
+ }
if (box->href) {
url = box->href;
@@ -442,16 +481,19 @@ void html_mouse_action(struct content *c, struct browser_window *bw,
target = gadget->form->target;
}
- if (box->title)
+ if (box->title) {
title = box->title;
+ }
pointer = get_pointer_shape(box, false);
-
- if ((box->scroll_x != NULL || box->scroll_y != NULL) &&
- drag_candidate == NULL)
- drag_candidate = box;
- if (box->scroll_y != NULL || box->scroll_x != NULL) {
+ if ((box->scroll_x != NULL) ||
+ (box->scroll_y != NULL)) {
+
+ if (drag_candidate == NULL) {
+ drag_candidate = box;
+ }
+
padding_left = box_x +
scrollbar_get_offset(box->scroll_x);
padding_right = padding_left + box->padding[LEFT] +
@@ -461,12 +503,14 @@ void html_mouse_action(struct content *c, struct browser_window *bw,
padding_bottom = padding_top + box->padding[TOP] +
box->height + box->padding[BOTTOM];
- if (x > padding_left && x < padding_right &&
- y > padding_top && y < padding_bottom) {
+ if ((x > padding_left) &&
+ (x < padding_right) &&
+ (y > padding_top) &&
+ (y < padding_bottom)) {
/* mouse inside padding box */
- if (box->scroll_y != NULL && x > padding_right -
- SCROLLBAR_WIDTH) {
+ if ((box->scroll_y != NULL) &&
+ (x > (padding_right - SCROLLBAR_WIDTH))) {
/* mouse above vertical box scroll */
scrollbar = box->scroll_y;
@@ -475,9 +519,8 @@ void html_mouse_action(struct content *c, struct browser_window *bw,
scroll_mouse_y = y - padding_top;
break;
- } else if (box->scroll_x != NULL &&
- y > padding_bottom -
- SCROLLBAR_WIDTH) {
+ } else if ((box->scroll_x != NULL) &&
+ (y > (padding_bottom - SCROLLBAR_WIDTH))) {
/* mouse above horizontal box scroll */
scrollbar = box->scroll_x;
@@ -842,6 +885,12 @@ void html_mouse_action(struct content *c, struct browser_window *bw,
content_broadcast(c, CONTENT_MSG_POINTER, msg_data);
}
+ /* fire dom click event */
+ if ((mouse & BROWSER_MOUSE_CLICK_1) ||
+ (mouse & BROWSER_MOUSE_CLICK_2)) {
+ js_fire_event(html->jscontext, "click", html->document, node);
+ }
+
/* deferred actions that can cause this browser_window to be destroyed
* and must therefore be done after set_status/pointer
*/
diff --git a/resources/FatMessages b/resources/FatMessages
index 45b3086..4abd847 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -1207,6 +1207,19 @@ fr.all.HotlistFeatureRequest:Demandes de nouvelles fonctions de Netsurf
it.all.HotlistFeatureRequest:Suggerimenti per NetSurf
nl.all.HotlistFeatureRequest:NetSurf feature requests
+# Default (Amiga) hotlist folder names
+#
+en.ami.HotlistMenu:Hotlist menu
+de.ami.HotlistMenu:Hotlist menu
+fr.ami.HotlistMenu:Hotlist menu
+it.ami.HotlistMenu:Menu segnalibri
+nl.ami.HotlistMenu:Hotlist menu
+en.ami.HotlistToolbar:Hotlist toolbar
+de.ami.HotlistToolbar:Hotlist toolbar
+fr.ami.HotlistToolbar:Hotlist toolbar
+it.ami.HotlistToolbar:Barra segnalibri
+nl.ami.HotlistToolbar:Hotlist toolbar
+
# Global history user interface tokens
# ====================================
@@ -2326,62 +2339,62 @@ nl.all.SelectMenu:Select
en.all.DrawTitle:%s (Draw image %lux%lu pixels)
de.all.DrawTitle:%s (Draw Bild %lux%lu pixels)
fr.all.DrawTitle:%s (Image Draw %lux%lu pixels)
-it.all.DrawTitle:%s (Immagine Draw %lux%lu pixels)
+it.all.DrawTitle:%s (Immagine Draw %lux%lu pixel)
nl.all.DrawTitle:%s (Draw image %lux%lu pixels)
en.all.GIFTitle:%s (GIF image %lux%lu pixels)
de.all.GIFTitle:%s (GIF Bild %lux%lu pixels)
fr.all.GIFTitle:%s (Image GIF %lux%lu pixels)
-it.all.GIFTitle:%s (Immagine GIF %lux%lu pixels)
+it.all.GIFTitle:%s (Immagine GIF %lux%lu pixel)
nl.all.GIFTitle:%s (GIF image %lux%lu pixels)
en.all.BMPTitle:%s (BMP image %lux%lu pixels)
de.all.BMPTitle:%s (BMP Bild %lux%lu pixels)
fr.all.BMPTitle:%s (Image BMP %lux%lu pixels)
-it.all.BMPTitle:%s (Immagine BMP %lux%lu pixels)
+it.all.BMPTitle:%s (Immagine BMP %lux%lu pixel)
nl.all.BMPTitle:%s (BMP image %lux%lu pixels)
en.all.ICOTitle:%s (ICO image %lux%lu pixels)
de.all.ICOTitle:%s (ICO Bild %lux%lu pixels)
fr.all.ICOTitle:%s (Image BMP %lux%lu pixels)
-it.all.ICOTitle:%s (Immagine ICO %lux%lu pixels)
+it.all.ICOTitle:%s (Immagine ICO %lux%lu pixel)
nl.all.ICOTitle:%s (ICO image %lux%lu pixels)
en.all.JPEGTitle:%s (JPEG image %lux%lu pixels)
de.all.JPEGTitle:%s (JPEG Bild %lux%lu pixels)
fr.all.JPEGTitle:%s (Image JPEG %lux%lu pixels)
-it.all.JPEGTitle:%s (Immagine JPEG %lux%lu pixels)
+it.all.JPEGTitle:%s (Immagine JPEG %lux%lu pixel)
nl.all.JPEGTitle:%s (JPEG image %lux%lu pixels)
en.all.PNGTitle:%s (PNG image %lux%lu pixels)
de.all.PNGTitle:%s (PNG Bild %lux%lu pixels)
fr.all.PNGTitle:%s (Image PNG %lux%lu pixels)
-it.all.PNGTitle:%s (Immagine PNG %lux%lu pixels)
+it.all.PNGTitle:%s (Immagine PNG %lux%lu pixel)
nl.all.PNGTitle:%s (PNG image %lux%lu pixels)
en.all.JNGTitle:%s (JNG image %lux%lu pixels)
de.all.JNGTitle:%s (JNG Bild %lux%lu pixels)
fr.all.JNGTitle:%s (Image JNG %lux%lu pixels)
-it.all.JNGTitle:%s (Immagine JNG %lux%lu pixels)
+it.all.JNGTitle:%s (Immagine JNG %lux%lu pixel)
nl.all.JNGTitle:%s (JNG image %lux%lu pixels)
en.all.MNGTitle:%s (MNG image %lux%lu pixels)
de.all.MNGTitle:%s (MNG Bild %lux%lu pixels)
fr.all.MNGTitle:%s (Image MNG %lux%lu pixels)
-it.all.MNGTitle:%s (Immagine MNG %lux%lu pixels)
+it.all.MNGTitle:%s (Immagine MNG %lux%lu pixel)
nl.all.MNGTitle:%s (MNG image %lux%lu pixels)
en.all.WebPTitle:%s (WebP image %lux%lu pixels)
de.all.WebPTitle:%s (WebP Bild %lux%lu pixels)
fr.all.WebPTitle:%s (Image WebP %lux%lu pixels)
-it.all.WebPTitle:%s (Immagine WebP %lux%lu pixels)
+it.all.WebPTitle:%s (Immagine WebP %lux%lu pixel)
nl.all.WebPTitle:%s (WebP image %lux%lu pixels)
en.all.SpriteTitle:%s (Sprite image %lux%lu pixels)
de.all.SpriteTitle:%s (Sprite Bild %lux%lu pixels)
fr.all.SpriteTitle:%s (Image Sprite %lux%lu pixels)
-it.all.SpriteTitle:%s (Immagine Sprite %lux%lu pixels)
+it.all.SpriteTitle:%s (Immagine Sprite %lux%lu pixel)
nl.all.SpriteTitle:%s (Sprite image %lux%lu pixels)
en.all.ArtWorksTitle:%s (ArtWorks image %lux%lu pixels)
de.all.ArtWorksTitle:%s (ArtWorks Bild %lux%lu pixels)
fr.all.ArtWorksTitle:%s (Image ArtWorks %lux%lu pixels)
-it.all.ArtWorksTitle:%s (Immagine ArtWorks %lux%lu pixels)
+it.all.ArtWorksTitle:%s (Immagine ArtWorks %lux%lu pixel)
nl.all.ArtWorksTitle:%s (ArtWorks image %lux%lu pixels)
en.ami.DataTypesTitle:%s (%s image %lux%lu pixels)
de.ami.DataTypesTitle:%s (%s Bild %lux%lu pixels)
fr.ami.DataTypesTitle:%s (Image %s %lux%lu pixels)
-it.ami.DataTypesTitle:%s (Immagine %s %lux%lu pixels)
+it.ami.DataTypesTitle:%s (Immagine %s %lux%lu pixel)
nl.ami.DataTypesTitle:%s (%s image %lux%lu pixels)
# HTML page character set
@@ -2662,6 +2675,22 @@ de.ami.CompError:Nicht zu öffnen
fr.ami.CompError:Unable to open
it.ami.CompError:Impossibile aprire
nl.ami.CompError:Unable to open
+en.ami.MultiTabClose:Are you sure you want to close multiple tabs?
+de.ami.MultiTabClose:Are you sure you want to close multiple tabs?
+fr.ami.MultiTabClose:Are you sure you want to close multiple tabs?
+it.ami.MultiTabClose:Sono rimaste aperte più schede, sei sicuro di voler uscire da NetSurf?
+nl.ami.MultiTabClose:Are you sure you want to close multiple tabs?
+en.ami.TCPIPShutdown:The TCP/IP stack has signalled that it is about to shutdown and NetSurf must exit. NetSurf will quit in 5 seconds unless this shutdown is aborted.
+de.ami.TCPIPShutdown:The TCP/IP stack has signalled that it is about to shutdown and NetSurf must exit. NetSurf will quit in 5 seconds unless this shutdown is aborted.
+fr.ami.TCPIPShutdown:The TCP/IP stack has signalled that it is about to shutdown and NetSurf must exit. NetSurf will quit in 5 seconds unless this shutdown is aborted.
+it.ami.TCPIPShutdown:Lo stack TCP/IP ha dato segnale di essere in procinto di arresto, NetSurf verrà chiuso. NetSurf si chiuderà entro 5 secondi a meno che lo shutdown non venga interrotto.
+nl.ami.TCPIPShutdown:The TCP/IP stack has signalled that it is about to shutdown and NetSurf must exit. NetSurf will quit in 5 seconds unless this shutdown is aborted.
+en.ami.AbortShutdown:Abort shutdown
+de.ami.AbortShutdown:Abort shutdown
+fr.ami.AbortShutdown:Abort shutdown
+it.ami.AbortShutdown:Interrompi lo shutdown
+nl.ami.AbortShutdown:Abort shutdown
+
# Queries
# =======
@@ -5213,11 +5242,11 @@ de.all.Scripting:Scripting
fr.all.Scripting:Scripting
it.all.Scripting:Scripting
nl.all.Scripting:Scripting
-en.all.EnableJS:Enable Javascript
-de.all.EnableJS:Enable Javascript
-fr.all.EnableJS:Enable Javascript
-it.all.EnableJS:Attiva Javascript
-nl.all.EnableJS:Enable Javascript
+en.all.EnableJS:Enable JavaScript
+de.all.EnableJS:Enable JavaScript
+fr.all.EnableJS:Enable JavaScript
+it.all.EnableJS:Attiva JavaScript
+nl.all.EnableJS:Enable JavaScript
en.all.Miscellaneous:Miscellaneous
de.all.Miscellaneous:Verschiedenes
fr.all.Miscellaneous:Miscellaneous
@@ -5267,6 +5296,11 @@ de.ami.ScreenPublic:Public Screen
fr.ami.ScreenPublic:Public screen
it.ami.ScreenPublic:Schermo pubblico
nl.ami.ScreenPublic:Public screen
+en.ami.SimpleRefresh:Simple refresh
+de.ami.SimpleRefresh:Simple refresh
+fr.ami.SimpleRefresh:Simple refresh
+it.ami.SimpleRefresh:Refresh semplice
+nl.ami.SimpleRefresh:Simple refresh
en.all.Theme:Theme
de.all.Theme:Thema
fr.all.Theme:Theme
@@ -5335,6 +5369,26 @@ de.all.ScaleQuality:Skalieren hoher Qualität
fr.all.ScaleQuality:Higher quality scaling
it.all.ScaleQuality:Massima qualità di visualizzazione
nl.all.ScaleQuality:Higher quality scaling
+en.ami.DitherQuality:Dither quality (<= 8-bit modes only)
+de.ami.DitherQuality:Dither quality (<= 8-bit modes only)
+fr.ami.DitherQuality:Dither quality (<= 8-bit modes only)
+it.ami.DitherQuality:Qualità dither (<= solo modi a 8-bit)
+nl.ami.DitherQuality:Dither quality (<= 8-bit modes only)
+en.ami.Low:Low
+de.ami.Low:Low
+fr.ami.Low:Low
+it.ami.Low:Bassa
+nl.ami.Low:Low
+en.ami.Medium:Medium
+de.ami.Medium:Medium
+fr.ami.Medium:Medium
+it.ami.Medium:Media
+nl.ami.Medium:Medium
+en.ami.High:High
+de.ami.High:High
+fr.ami.High:High
+it.ami.High:Alta
+nl.ami.High:High
en.all.Animations:Animations
de.all.Animations:Animationen
fr.all.Animations:Animations
@@ -5446,6 +5500,11 @@ de.all.Pt:pt
fr.all.Pt:pt
it.all.Pt:pt
nl.all.Pt:pt
+en.ami.FontAntialiasing:Use anti-aliasing (when possible)
+de.ami.FontAntialiasing:Use anti-aliasing (when possible)
+fr.ami.FontAntialiasing:Use anti-aliasing (when possible)
+it.ami.FontAntialiasing:Usa anti-aliasing (quando possibile)
+nl.ami.FontAntialiasing:Use anti-aliasing (when possible)
# Font scanning
en.ami.FontScanning:Scanning fonts...
@@ -5483,24 +5542,14 @@ fr.all.Duration:Duration
it.all.Duration:Durata
nl.all.Duration:Duration
-# Advanced
+# Tabs
#
-en.all.Downloads:Downloads
-de.all.Downloads:Downloads
-fr.all.Downloads:Downloads
-it.all.Downloads:Trasferimenti
-nl.all.Downloads:Downloads
-en.all.ConfirmOverwrite:Request confirmation when overwriting
-de.all.ConfirmOverwrite:vor Überschreiben nachfragen
-fr.all.ConfirmOverwrite:Request confirmation when overwriting
-it.all.ConfirmOverwrite:Richiedi conferma prima di sovrascrivere
-nl.all.ConfirmOverwrite:Request confirmation when overwriting
-en.all.DownloadDir:Initial download location
-de.all.DownloadDir:Downloadverzeichnis
-fr.all.DownloadDir:Initial download location
-it.all.DownloadDir:Percorso predefinito
-nl.all.DownloadDir:Initial download location
+en.ami.Tabs:Tabs
+de.ami.Tabs:Tabs
+fr.ami.Tabs:Tabs
+it.ami.Tabs:Schede
+nl.ami.Tabs:Tabs
en.all.TabbedBrowsing:Tabbed browsing
de.all.TabbedBrowsing:Registernavigation (Tabs)
fr.all.TabbedBrowsing:Tabbed browsing
@@ -5514,13 +5563,42 @@ nl.all.TabActive:Open new tabs in background
en.all.TabMiddle:Middle mouse button opens tabs
de.all.TabMiddle:Mittlere Maustaste öffnet Tab
fr.all.TabMiddle:Middle mouse button opens tabs
-it.all.TabMiddle:Tasto centrale per l'apertura delle schede
+it.all.TabMiddle:Usa tasto centrale del mouse per aprire le schede
nl.all.TabMiddle:Middle mouse button opens tabs
en.all.TabLast:Open new tabs after all existing tabs
de.all.TabLast:Open new tabs after all existing tabs
fr.all.TabLast:Open new tabs after all existing tabs
it.all.TabLast:Apri le nuove schede dopo quella corrente
nl.all.TabLast:Open new tabs after all existing tabs
+en.ami.TabClose:Warn when closing multiple tabs
+de.ami.TabClose:Warn when closing multiple tabs
+fr.ami.TabClose:Warn when closing multiple tabs
+it.ami.TabClose:Avvisa quando si chiudono più schede
+nl.ami.TabClose:Warn when closing multiple tabs
+en.ami.TabAlways:Always show tabs
+de.ami.TabAlways:Always show tabs
+fr.ami.TabAlways:Always show tabs
+it.ami.TabAlways:Mostra sempre la barra delle schede
+nl.ami.TabAlways:Always show tabs
+
+# Advanced
+#
+
+en.all.Downloads:Downloads
+de.all.Downloads:Downloads
+fr.all.Downloads:Downloads
+it.all.Downloads:Trasferimenti
+nl.all.Downloads:Downloads
+en.all.ConfirmOverwrite:Request confirmation when overwriting
+de.all.ConfirmOverwrite:vor Überschreiben nachfragen
+fr.all.ConfirmOverwrite:Request confirmation when overwriting
+it.all.ConfirmOverwrite:Richiedi conferma prima di sovrascrivere
+nl.all.ConfirmOverwrite:Request confirmation when overwriting
+en.all.DownloadDir:Initial download location
+de.all.DownloadDir:Downloadverzeichnis
+fr.all.DownloadDir:Initial download location
+it.all.DownloadDir:Percorso predefinito
+nl.all.DownloadDir:Initial download location
en.all.DownloadNotify:Notify on completion
de.all.DownloadNotify:Downloadende melden
fr.all.DownloadNotify:Notify on completion
diff --git a/riscos/Makefile.defaults b/riscos/Makefile.defaults
new file mode 100644
index 0000000..f48024f
--- /dev/null
+++ b/riscos/Makefile.defaults
@@ -0,0 +1,31 @@
+# ----------------------------------------------------------------------------
+# RISC OS-specific options
+# ----------------------------------------------------------------------------
+
+ # Enable NetSurf's use of libsvgtiny for displaying SVGs
+ # Valid options: YES, NO
+ NETSURF_USE_NSSVG := YES
+
+ # Enable NetSurf's support for displaying RISC OS Draw files
+ # Valid options: YES, NO
+ NETSURF_USE_DRAW := YES
+
+ # Enable NetSurf's support for displaying RISC OS Sprites
+ # Valid options: YES, NO
+ NETSURF_USE_SPRITE := YES
+
+ # Enable NetSurf's use of AWRender for displaying ArtWorks files
+ # Valid options: YES, NO
+ NETSURF_USE_ARTWORKS := YES
+
+ # Enable NetSurf's support for the Acorn plugin protocol
+ # Valid options: YES, NO
+ NETSURF_USE_PLUGINS := NO
+
+ # Enable NetSurf's use of pencil for Drawfile export
+ # Valid options: YES, NO
+ NETSURF_USE_DRAW_EXPORT := YES
+
+ # Optimisation levels
+ CFLAGS += -O2
+
diff --git a/riscos/Makefile.target b/riscos/Makefile.target
index 53b3296..e7370e7 100644
--- a/riscos/Makefile.target
+++ b/riscos/Makefile.target
@@ -28,9 +28,13 @@ 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,BMP,libnsbmp,BMP))
- $(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
- $(eval $(call pkg_config_find_and_add,PNG,libpng,PNG ))
+ NETSURF_FEATURE_JS_CFLAGS := -DWITH_JS -DJS_HAS_FILE_OBJECT=0
+ NETSURF_FEATURE_MOZJS_CFLAGS := -DWITH_MOZJS -DJS_HAS_FILE_OBJECT=0
+ $(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 ))
+ $(eval $(call pkg_config_find_and_add_enabled,MOZJS,mozjs185,JavaScript))
+ $(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
endif
TPD_RISCOS = $(foreach TPL,$(notdir $(TPL_RISCOS)), \
diff --git a/riscos/configure/con_content.c b/riscos/configure/con_content.c
index a8e9f78..81537bc 100644
--- a/riscos/configure/con_content.c
+++ b/riscos/configure/con_content.c
@@ -35,6 +35,7 @@
#define CONTENT_DEFAULT_BUTTON 8
#define CONTENT_CANCEL_BUTTON 9
#define CONTENT_OK_BUTTON 10
+#define CONTENT_NO_JAVASCRIPT 11
static void ro_gui_options_content_default(wimp_pointer *pointer);
static bool ro_gui_options_content_ok(wimp_w w);
@@ -50,12 +51,15 @@ bool ro_gui_options_content_initialise(wimp_w w)
nsoption_bool(no_plugins));
ro_gui_set_icon_selected_state(w, CONTENT_TARGET_BLANK,
nsoption_bool(target_blank));
+ ro_gui_set_icon_selected_state(w, CONTENT_NO_JAVASCRIPT,
+ !nsoption_bool(enable_javascript));
/* initialise all functions for a newly created window */
ro_gui_wimp_event_register_checkbox(w, CONTENT_BLOCK_ADVERTISEMENTS);
ro_gui_wimp_event_register_checkbox(w, CONTENT_BLOCK_POPUPS);
ro_gui_wimp_event_register_checkbox(w, CONTENT_NO_PLUGINS);
ro_gui_wimp_event_register_checkbox(w, CONTENT_TARGET_BLANK);
+ ro_gui_wimp_event_register_checkbox(w, CONTENT_NO_JAVASCRIPT);
ro_gui_wimp_event_register_button(w, CONTENT_DEFAULT_BUTTON,
ro_gui_options_content_default);
ro_gui_wimp_event_register_cancel(w, CONTENT_CANCEL_BUTTON);
@@ -78,6 +82,8 @@ void ro_gui_options_content_default(wimp_pointer *pointer)
false);
ro_gui_set_icon_selected_state(pointer->w, CONTENT_TARGET_BLANK,
true);
+ ro_gui_set_icon_selected_state(pointer->w, CONTENT_NO_JAVASCRIPT,
+ false);
}
bool ro_gui_options_content_ok(wimp_w w)
@@ -93,6 +99,9 @@ bool ro_gui_options_content_ok(wimp_w w)
nsoption_set_bool(target_blank,
ro_gui_get_icon_selected_state(w, CONTENT_TARGET_BLANK));
+ nsoption_set_bool(enable_javascript,
+ !ro_gui_get_icon_selected_state(w, CONTENT_NO_JAVASCRIPT));
+
ro_gui_save_options();
return true;
}
diff --git a/riscos/templates/de b/riscos/templates/de
index ed26c7d..b6357f2 100644
--- a/riscos/templates/de
+++ b/riscos/templates/de
@@ -3794,7 +3794,7 @@ wimp_window {
wimp_window {
template_name:"con_content"
- visible:236,800,876,1252
+ visible:1404,424,2044,924
xscroll:0
yscroll:0
next:wimp_TOP
@@ -3807,7 +3807,7 @@ wimp_window {
scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
highlight_bg:wimp_COLOUR_CREAM
extra_flags:
- extent:0,-452,640,0
+ extent:0,-500,640,0
title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | 0x27000000
work_flags:
sprite_area:&1
@@ -3815,7 +3815,7 @@ wimp_window {
ymin:452
text_only:"Content"
wimp_icon {
- extent:16,-220,624,-24
+ extent:16,-272,624,-24
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3855,7 +3855,7 @@ wimp_window {
text_and_sprite.validation:"Soptoff,opton"
}
wimp_icon {
- extent:32,-204,496,-160
+ extent:32,-256,496,-212
#ifdef WITH_PLUGIN
icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
#else
@@ -3869,7 +3869,7 @@ wimp_window {
text_and_sprite.validation:"Soptoff,opton"
}
wimp_icon {
- extent:16,-340,624,-248
+ extent:16,-384,624,-292
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3879,7 +3879,7 @@ wimp_window {
text.validation:"R4"
}
wimp_icon {
- extent:32,-276,492,-232
+ extent:32,-320,492,-276
icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3889,7 +3889,7 @@ wimp_window {
text_and_sprite.validation:""
}
wimp_icon {
- extent:32,-324,612,-280
+ extent:32,-368,612,-324
icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3899,7 +3899,7 @@ wimp_window {
text_and_sprite.validation:"Soptoff,opton"
}
wimp_icon {
- extent:24,-424,188,-372
+ extent:24,-468,188,-416
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3909,7 +3909,7 @@ wimp_window {
text.validation:"R5,3"
}
wimp_icon {
- extent:256,-424,420,-372
+ extent:256,-468,420,-416
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3919,7 +3919,7 @@ wimp_window {
text.validation:"R5,3"
}
wimp_icon {
- extent:436,-432,620,-364
+ extent:436,-476,620,-408
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3928,4 +3928,14 @@ wimp_window {
text.size:4
text.validation:"R6,3"
}
+ wimp_icon {
+ extent:32,-204,376,-160
+ icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
+ icon_esg:0
+ icon_fg:wimp_COLOUR_BLACK
+ icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
+ text_and_sprite.text:"Disable JavaScript"
+ text_and_sprite.size:19
+ text_and_sprite.validation:"Soptoff,opton"
+ }
}
diff --git a/riscos/templates/en b/riscos/templates/en
index 2b91764..2edf0dd 100644
--- a/riscos/templates/en
+++ b/riscos/templates/en
@@ -3386,7 +3386,7 @@ wimp_window {
wimp_window {
template_name:"con_content"
- visible:1248,902,1912,1354
+ visible:1248,854,1912,1354
xscroll:0
yscroll:0
next:wimp_TOP
@@ -3399,7 +3399,7 @@ wimp_window {
scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
highlight_bg:wimp_COLOUR_CREAM
extra_flags:
- extent:0,-452,664,0
+ extent:0,-500,664,0
title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | 0x27000000
work_flags:
sprite_area:&1
@@ -3407,7 +3407,7 @@ wimp_window {
ymin:452
text_only:"Content"
wimp_icon {
- extent:16,-220,644,-24
+ extent:16,-272,644,-24
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3447,7 +3447,7 @@ wimp_window {
text_and_sprite.validation:"Soptoff,opton"
}
wimp_icon {
- extent:32,-204,344,-160
+ extent:32,-256,344,-212
#ifdef WITH_PLUGIN
icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
#else
@@ -3461,7 +3461,7 @@ wimp_window {
text_and_sprite.validation:"Soptoff,opton"
}
wimp_icon {
- extent:16,-340,644,-248
+ extent:16,-384,644,-292
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3471,7 +3471,7 @@ wimp_window {
text.validation:"R4"
}
wimp_icon {
- extent:32,-276,492,-232
+ extent:32,-320,492,-276
icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3481,7 +3481,7 @@ wimp_window {
text_and_sprite.validation:""
}
wimp_icon {
- extent:32,-324,632,-280
+ extent:32,-368,632,-324
icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3491,7 +3491,7 @@ wimp_window {
text_and_sprite.validation:"Soptoff,opton"
}
wimp_icon {
- extent:24,-424,188,-372
+ extent:24,-468,188,-416
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3501,7 +3501,7 @@ wimp_window {
text.validation:"R5,3"
}
wimp_icon {
- extent:280,-424,444,-372
+ extent:280,-468,444,-416
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3511,7 +3511,7 @@ wimp_window {
text.validation:"R5,3"
}
wimp_icon {
- extent:460,-432,644,-364
+ extent:460,-476,644,-408
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3520,6 +3520,16 @@ wimp_window {
text.size:*
text.validation:"R6,3"
}
+ wimp_icon {
+ extent:32,-204,376,-160
+ icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
+ icon_esg:0
+ icon_fg:wimp_COLOUR_BLACK
+ icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
+ text_and_sprite.text:"Disable JavaScript"
+ text_and_sprite.size:19
+ text_and_sprite.validation:"Soptoff,opton"
+ }
}
wimp_window {
diff --git a/riscos/templates/fr b/riscos/templates/fr
index 4a8cce4..3df0a61 100644
--- a/riscos/templates/fr
+++ b/riscos/templates/fr
@@ -3020,7 +3020,7 @@ wimp_window {
wimp_window {
template_name:"con_content"
- visible:598,888,1338,1336
+ visible:598,836,1350,1336
xscroll:0
yscroll:0
next:
@@ -3033,7 +3033,7 @@ wimp_window {
scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
highlight_bg:wimp_COLOUR_CREAM
extra_flags:
- extent:0,-452,752,0
+ extent:0,-500,752,0
title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | 0x27000000
work_flags:
sprite_area:&1
@@ -3041,7 +3041,7 @@ wimp_window {
ymin:448
text_only:"Contenu"
wimp_icon {
- extent:16,-220,724,-24
+ extent:16,-272,732,-24
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3081,7 +3081,7 @@ wimp_window {
text_and_sprite.validation:"Soptoff,opton"
}
wimp_icon {
- extent:32,-204,404,-160
+ extent:32,-256,404,-212
#ifdef WITH_PLUGIN
icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
#else
@@ -3095,7 +3095,7 @@ wimp_window {
text_and_sprite.validation:"Soptoff,opton"
}
wimp_icon {
- extent:16,-340,724,-248
+ extent:16,-384,732,-292
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3105,7 +3105,7 @@ wimp_window {
text.validation:"R4"
}
wimp_icon {
- extent:32,-276,492,-232
+ extent:32,-320,492,-276
icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3115,7 +3115,7 @@ wimp_window {
text_and_sprite.validation:""
}
wimp_icon {
- extent:32,-328,716,-280
+ extent:32,-372,716,-324
icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3125,7 +3125,7 @@ wimp_window {
text_and_sprite.validation:"Soptoff,opton"
}
wimp_icon {
- extent:24,-424,188,-372
+ extent:24,-468,188,-416
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3135,7 +3135,7 @@ wimp_window {
text.validation:"R5,3"
}
wimp_icon {
- extent:368,-424,532,-372
+ extent:372,-468,536,-416
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3145,7 +3145,7 @@ wimp_window {
text.validation:"R5,3"
}
wimp_icon {
- extent:540,-432,724,-364
+ extent:544,-476,728,-408
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3154,6 +3154,16 @@ wimp_window {
text.size:*
text.validation:"R6,3"
}
+ wimp_icon {
+ extent:32,-204,376,-160
+ icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
+ icon_esg:0
+ icon_fg:wimp_COLOUR_BLACK
+ icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
+ text_and_sprite.text:"Disable JavaScript"
+ text_and_sprite.size:19
+ text_and_sprite.validation:"Soptoff,opton"
+ }
}
wimp_window {
diff --git a/riscos/templates/nl b/riscos/templates/nl
index 19dd843..53915d3 100644
--- a/riscos/templates/nl
+++ b/riscos/templates/nl
@@ -3394,7 +3394,7 @@ wimp_window {
wimp_window {
template_name:"con_content"
- visible:272,306,912,758
+ visible:1632,750,2272,1250
xscroll:0
yscroll:0
next:wimp_TOP
@@ -3407,7 +3407,7 @@ wimp_window {
scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
highlight_bg:wimp_COLOUR_CREAM
extra_flags:
- extent:0,-452,640,0
+ extent:0,-500,640,0
title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | 0x27000000
work_flags:
sprite_area:&1
@@ -3415,7 +3415,7 @@ wimp_window {
ymin:452
text_only:"Inhoud"
wimp_icon {
- extent:16,-220,624,-24
+ extent:16,-272,624,-24
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3455,7 +3455,7 @@ wimp_window {
text_and_sprite.validation:"Soptoff,opton"
}
wimp_icon {
- extent:32,-204,344,-160
+ extent:32,-256,344,-212
#ifdef WITH_PLUGIN
icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
#else
@@ -3469,7 +3469,7 @@ wimp_window {
text_and_sprite.validation:"Soptoff,opton"
}
wimp_icon {
- extent:16,-340,624,-248
+ extent:16,-380,624,-288
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3479,7 +3479,7 @@ wimp_window {
text.validation:"R4"
}
wimp_icon {
- extent:32,-276,492,-232
+ extent:32,-316,492,-272
icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3489,7 +3489,7 @@ wimp_window {
text_and_sprite.validation:""
}
wimp_icon {
- extent:32,-324,636,-280
+ extent:32,-364,636,-320
icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3499,7 +3499,7 @@ wimp_window {
text_and_sprite.validation:"Soptoff,opton"
}
wimp_icon {
- extent:24,-424,188,-372
+ extent:24,-464,188,-412
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3509,7 +3509,7 @@ wimp_window {
text.validation:"R5,3"
}
wimp_icon {
- extent:256,-424,420,-372
+ extent:256,-464,420,-412
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3519,7 +3519,7 @@ wimp_window {
text.validation:"R5,3"
}
wimp_icon {
- extent:436,-432,620,-364
+ extent:436,-472,620,-404
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -3528,6 +3528,16 @@ wimp_window {
text.size:*
text.validation:"R6,3"
}
+ wimp_icon {
+ extent:32,-204,376,-160
+ icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
+ icon_esg:0
+ icon_fg:wimp_COLOUR_BLACK
+ icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
+ text_and_sprite.text:"Disable JavaScript"
+ text_and_sprite.size:19
+ text_and_sprite.validation:"Soptoff,opton"
+ }
}
wimp_window {
diff --git a/test/js/dom-document-enumerate.html b/test/js/document-url.html
similarity index 59%
copy from test/js/dom-document-enumerate.html
copy to test/js/document-url.html
index 18146ab..2299b57 100644
--- a/test/js/dom-document-enumerate.html
+++ b/test/js/document-url.html
@@ -1,11 +1,12 @@
<html>
<head>
-<title>document interface enumeration</title>
+<title>document location and URL interface</title>
<link rel="stylesheet" type="text/css" href="tst.css">
</head>
<body>
-<h1>Document interface enumeration</h1>
+<h1>document location and URL interface</h1>
+<h2>Document location enumeration</h2>
<script>
function output(x,y) {
document.body.appendChild(document.createTextNode(x));
@@ -18,9 +19,13 @@ function output(x,y) {
document.body.appendChild(document.createElement('br'));
}
-for(var key in document) {
- output(key, document[key]);
+for(var key in document.location) {
+ output(key, document.location[key]);
}
</script>
+<h2>Document URL</h2>
+<script>output("document.URL", document.URL);</script>
+<h2>DocumentURI</h2>
+<script>output("document.documentURI", document.documentURI);</script>
</body>
</html>
diff --git a/test/js/event-onclick.html b/test/js/event-onclick.html
new file mode 100644
index 0000000..b2060e5
--- /dev/null
+++ b/test/js/event-onclick.html
@@ -0,0 +1,30 @@
+<html>
+<head>
+<title>alert onclick example</title>
+
+<script type="text/javascript">
+
+function causealert()
+{
+var txt = document.getElementById("p1").textContent;
+alert(txt);
+}
+
+</script>
+</head>
+
+<body>
+<div style="border: 1px solid red">
+<p id="p1">First line of paragraph.<br /></p>
+</div><br />
+
+<button id="button1" >add another textNode.</button>
+
+<script>
+var button = document.getElementById("button1");
+
+button.onclick = causealert;
+</script>
+
+</body>
+</html>
diff --git a/test/js/event-onload.html b/test/js/event-onload.html
index aede985..cd9e705 100644
--- a/test/js/event-onload.html
+++ b/test/js/event-onload.html
@@ -6,9 +6,7 @@
function addTextNode()
{
-var newtext = document.createTextNode(" Some text added dynamically. ");
-var para = document.getElementById("p1");
-para.appendChild(newtext);
+para.appendChild(document.createTextNode(" Some text added dynamically. "));
}
</script>
@@ -19,10 +17,14 @@ para.appendChild(newtext);
<p id="p1">First line of paragraph.<br /></p>
</div><br />
-<button onclick="addTextNode();">add another textNode.</button>
+<button id="button1" >add another textNode.</button>
<script>
+var button = document.getElementById("button1");
+var para = document.getElementById("p1");
+
window.onload = addTextNode;
+button.onclick = addTextNode;
</script>
</body>
diff --git a/test/js/index.html b/test/js/index.html
index 7a17c95..bb2918c 100644
--- a/test/js/index.html
+++ b/test/js/index.html
@@ -5,12 +5,15 @@
</head>
<body>
<h1>JavaScript Tests</h1>
+
+
<h2>Window</h2>
<ul>
<li><a href="window.lately.html">location</a></li>
<li><a href="window-enumerate.html">enumerate</a></li>
</ul>
+
<h2>Document write</h2>
<ul>
<li><a href="inline-doc-write-simple.html">Simple document write</a></li>
@@ -22,7 +25,9 @@
<li><a href="inline-innerhtml.html">Inline script innerHtml test</a></li>
</ul>
+
<h2>DOM tests</h2>
+
<h3>Reference method tests</h3>
<ul>
<li><a href="dom-element-firstElementChild.html">firstElementChild</a></li>
@@ -31,24 +36,34 @@
<li><a href="dom-element-childElementCount.html">childElementCount</a></li>
<li><a href="doc-dom2.html">getElementById</a></li>
<li><a href="dom-getElementsByTagName.html">getElementsByTagName</a></li>
-
</ul>
+
<h3>Enumeration tests</h3>
<ul>
<li><a href="dom-node-enumerate.html">Node element interface</a></li>
<li><a href="dom-body-enumerate.html">Body element interface</a></li>
<li><a href="dom-document-enumerate.html">Document interface</a></li>
</ul>
+
<h3>Document element specific</h3>
<ul>
<li><a href="dom-doc-cookie.html">Cookie dispaly (only from server)</a></li>
<li><a href="dom-doc-location.html">location</a></li>
</ul>
+
+
+<h2>Dom events</h2>
+<ul>
+<li><a href="event-onload.html">window.onload</a></li>
+<li><a href="event-onclick.html">button.onclick</a></li>
+</ul>
+
+
<h2>Assorted</h2>
<ul>
<li><a href="assorted-log-doc-write.html">console.log and document.write</a></li>
-
<li><a href="wikipedia-lcm.html">Example from wikipedia</a></li>
</ul>
+
</body>
</html>
diff --git a/utils/corestrings.c b/utils/corestrings.c
index ee50757..f970c10 100644
--- a/utils/corestrings.c
+++ b/utils/corestrings.c
@@ -193,6 +193,7 @@ dom_string *corestring_dom_playing;
dom_string *corestring_dom_popstate;
dom_string *corestring_dom_progress;
dom_string *corestring_dom_ratechange;
+dom_string *corestring_dom_readystatechange;
dom_string *corestring_dom_rect;
dom_string *corestring_dom_rel;
dom_string *corestring_dom_reset;
@@ -414,6 +415,7 @@ void corestrings_fini(void)
CSS_DOM_STRING_UNREF(popstate);
CSS_DOM_STRING_UNREF(progress);
CSS_DOM_STRING_UNREF(ratechange);
+ CSS_DOM_STRING_UNREF(readystatechange);
CSS_DOM_STRING_UNREF(rect);
CSS_DOM_STRING_UNREF(rel);
CSS_DOM_STRING_UNREF(reset);
@@ -666,6 +668,7 @@ nserror corestrings_init(void)
CSS_DOM_STRING_INTERN(popstate);
CSS_DOM_STRING_INTERN(progress);
CSS_DOM_STRING_INTERN(ratechange);
+ CSS_DOM_STRING_INTERN(readystatechange);
CSS_DOM_STRING_INTERN(rect);
CSS_DOM_STRING_INTERN(rel);
CSS_DOM_STRING_INTERN(reset);
diff --git a/utils/corestrings.h b/utils/corestrings.h
index e8c9b6f..61771c1 100644
--- a/utils/corestrings.h
+++ b/utils/corestrings.h
@@ -199,6 +199,7 @@ extern struct dom_string *corestring_dom_playing;
extern struct dom_string *corestring_dom_popstate;
extern struct dom_string *corestring_dom_progress;
extern struct dom_string *corestring_dom_ratechange;
+extern struct dom_string *corestring_dom_readystatechange;
extern struct dom_string *corestring_dom_rect;
extern struct dom_string *corestring_dom_rel;
extern struct dom_string *corestring_dom_reset;
diff --git a/utils/libdom.c b/utils/libdom.c
index 3b6cd15..9e7e776 100644
--- a/utils/libdom.c
+++ b/utils/libdom.c
@@ -22,7 +22,6 @@
#include <assert.h>
#include <dom/dom.h>
-#include <dom/bindings/hubbub/parser.h>
#include "utils/config.h"
#include "utils/log.h"
@@ -254,6 +253,70 @@ void libdom_iterate_child_elements(dom_node *parent,
dom_nodelist_unref(children);
}
+/* exported interface documented in libdom.h */
+nserror libdom_hubbub_error_to_nserror(dom_hubbub_error error)
+{
+ switch (error) {
+
+ /* HUBBUB_REPROCESS is not handled here because it can
+ * never occur outside the hubbub treebuilder
+ */
+
+ case DOM_HUBBUB_OK:
+ /* parsed ok */
+ return NSERROR_OK;
+
+ case (DOM_HUBBUB_HUBBUB_ERR | HUBBUB_PAUSED):
+ /* hubbub input paused */
+ return NSERROR_OK;
+
+ case DOM_HUBBUB_NOMEM:
+ /* out of memory error from DOM */
+ return NSERROR_NOMEM;
+
+ case DOM_HUBBUB_BADPARM:
+ /* Bad parameter passed to creation */
+ return NSERROR_BAD_PARAMETER;
+
+ case DOM_HUBBUB_DOM:
+ /* DOM call returned error */
+ return NSERROR_DOM;
+
+ case (DOM_HUBBUB_HUBBUB_ERR | HUBBUB_ENCODINGCHANGE):
+ /* encoding changed */
+ return NSERROR_ENCODING_CHANGE;
+
+ case (DOM_HUBBUB_HUBBUB_ERR | HUBBUB_NOMEM):
+ /* out of memory error from parser */
+ return NSERROR_NOMEM;
+
+ case (DOM_HUBBUB_HUBBUB_ERR | HUBBUB_BADPARM):
+ return NSERROR_BAD_PARAMETER;
+
+ case (DOM_HUBBUB_HUBBUB_ERR | HUBBUB_INVALID):
+ return NSERROR_INVALID;
+
+ case (DOM_HUBBUB_HUBBUB_ERR | HUBBUB_FILENOTFOUND):
+ return NSERROR_NOT_FOUND;
+
+ case (DOM_HUBBUB_HUBBUB_ERR | HUBBUB_NEEDDATA):
+ return NSERROR_NEED_DATA;
+
+ case (DOM_HUBBUB_HUBBUB_ERR | HUBBUB_BADENCODING):
+ return NSERROR_BAD_ENCODING;
+
+ case (DOM_HUBBUB_HUBBUB_ERR | HUBBUB_UNKNOWN):
+ /* currently only generated by the libdom hubbub binding */
+ return NSERROR_DOM;
+ default:
+ /* unknown error */
+ /** @todo better error handling and reporting */
+ return NSERROR_UNKNOWN;
+ }
+ return NSERROR_UNKNOWN;
+}
+
+
static void ignore_dom_msg(uint32_t severity, void *ctx, const char *msg, ...)
{
}
@@ -261,6 +324,7 @@ static void ignore_dom_msg(uint32_t severity, void *ctx, const char *msg, ...)
/* exported interface documented in libdom.h */
nserror libdom_parse_file(const char *filename, const char *encoding, dom_document **doc)
{
+ dom_hubbub_parser_params parse_params;
dom_hubbub_error error;
dom_hubbub_parser *parser;
dom_document *document;
@@ -273,11 +337,18 @@ nserror libdom_parse_file(const char *filename, const char *encoding, dom_docume
return NSERROR_NOT_FOUND;
}
- parser = dom_hubbub_parser_create(encoding, false, false,
- ignore_dom_msg, NULL, NULL, &document);
- if (parser == NULL) {
+ parse_params.enc = encoding;
+ parse_params.fix_enc = false;
+ parse_params.enable_script = false;
+ parse_params.msg = ignore_dom_msg;
+ parse_params.script = NULL;
+ parse_params.ctx = NULL;
+ parse_params.daf = NULL;
+
+ error = dom_hubbub_parser_create(&parse_params, &parser, &document);
+ if (error != DOM_HUBBUB_OK) {
fclose(fp);
- return NSERROR_DOM;
+ return libdom_hubbub_error_to_nserror(error);
}
while (feof(fp) == 0) {
@@ -297,7 +368,7 @@ nserror libdom_parse_file(const char *filename, const char *encoding, dom_docume
dom_node_unref(document);
dom_hubbub_parser_destroy(parser);
fclose(fp);
- return NSERROR_DOM;
+ return libdom_hubbub_error_to_nserror(error);
}
dom_hubbub_parser_destroy(parser);
diff --git a/utils/libdom.h b/utils/libdom.h
index d79c92d..36caf01 100644
--- a/utils/libdom.h
+++ b/utils/libdom.h
@@ -28,7 +28,11 @@
#include <dom/dom.h>
-/* depth-first walk the dom calling callback for each element
+#include <dom/bindings/hubbub/parser.h>
+#include <dom/bindings/hubbub/errors.h>
+
+/**
+ * depth-first walk the dom calling callback for each element
*
* \param root the dom node to use as the root of the tree walk
* \return true if all nodes were examined, false if the callback terminated
@@ -65,4 +69,12 @@ void libdom_iterate_child_elements(dom_node *parent,
nserror libdom_parse_file(const char *filename, const char *encoding,
dom_document **doc);
+/**
+ * Convert libdom hubbub binding errors to nserrors.
+ *
+ * \param error The hubbub binding error to convert
+ * \return The appropriate nserror
+ */
+nserror libdom_hubbub_error_to_nserror(dom_hubbub_error error);
+
#endif
diff --git a/windows/Makefile.defaults b/windows/Makefile.defaults
new file mode 100644
index 0000000..68fb7af
--- /dev/null
+++ b/windows/Makefile.defaults
@@ -0,0 +1,24 @@
+# ----------------------------------------------------------------------------
+# windows-specific options
+# ----------------------------------------------------------------------------
+
+ # Enable NetSurf's use of librosprite for displaying RISC OS Sprites
+ # Valid options: YES, NO, AUTO
+ NETSURF_USE_ROSPRITE := NO
+
+ # Enable NetSurf's use of libsvgtiny for displaying SVGs
+ # Valid options: YES, NO
+ NETSURF_USE_NSSVG := NO
+
+ # Force using glibc internal iconv implementation instead of external libiconv
+ # Valid options: YES, NO
+ NETSURF_USE_LIBICONV_PLUG := NO
+
+ # mng support does not currently build on windows
+ NETSURF_USE_MNG := NO
+
+ # no pdf support
+ NETSURF_USE_HARU_PDF := NO
+
+ # Optimisation levels
+ CFLAGS += -O2
--
NetSurf Browser
10 years, 3 months
netsurf: branch master updated. 68565113f382cc742dd6cb4f685f68996ed32779
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/68565113f382cc742dd6c...
...commit http://git.netsurf-browser.org/netsurf.git/commit/68565113f382cc742dd6cb4...
...tree http://git.netsurf-browser.org/netsurf.git/tree/68565113f382cc742dd6cb4f6...
The branch, master has been updated
via 68565113f382cc742dd6cb4f685f68996ed32779 (commit)
from 27873fa9fee23c6cd0f498420c5130aec7379aa0 (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/68565113f382cc742dd...
commit 68565113f382cc742dd6cb4f685f68996ed32779
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
link order matters
diff --git a/windows/Makefile.target b/windows/Makefile.target
index c373ff5..33a9492 100644
--- a/windows/Makefile.target
+++ b/windows/Makefile.target
@@ -20,13 +20,13 @@ $(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))
- $(eval $(call pkg_config_find_and_add,libcurl,Curl))
else
LDFLAGS += -lhubbub -lcss -lparserutils -lwapcaplet -lcurl -lz
endif
-----------------------------------------------------------------------
Summary of changes:
windows/Makefile.target | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/windows/Makefile.target b/windows/Makefile.target
index c373ff5..33a9492 100644
--- a/windows/Makefile.target
+++ b/windows/Makefile.target
@@ -20,13 +20,13 @@ $(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))
- $(eval $(call pkg_config_find_and_add,libcurl,Curl))
else
LDFLAGS += -lhubbub -lcss -lparserutils -lwapcaplet -lcurl -lz
endif
--
NetSurf Browser
10 years, 3 months
netsurf: branch master updated. 27873fa9fee23c6cd0f498420c5130aec7379aa0
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/27873fa9fee23c6cd0f49...
...commit http://git.netsurf-browser.org/netsurf.git/commit/27873fa9fee23c6cd0f4984...
...tree http://git.netsurf-browser.org/netsurf.git/tree/27873fa9fee23c6cd0f498420...
The branch, master has been updated
via 27873fa9fee23c6cd0f498420c5130aec7379aa0 (commit)
from c0f9ae95b9f5ac169f225d2b52d57d05599b6772 (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/27873fa9fee23c6cd0f...
commit 27873fa9fee23c6cd0f498420c5130aec7379aa0
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
add explicit stdlib include for definition of free()
diff --git a/javascript/jsapi/event.bnd b/javascript/jsapi/event.bnd
index b0880d9..b8b0aff 100644
--- a/javascript/jsapi/event.bnd
+++ b/javascript/jsapi/event.bnd
@@ -16,6 +16,7 @@ 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>
-----------------------------------------------------------------------
Summary of changes:
javascript/jsapi/event.bnd | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/javascript/jsapi/event.bnd b/javascript/jsapi/event.bnd
index b0880d9..b8b0aff 100644
--- a/javascript/jsapi/event.bnd
+++ b/javascript/jsapi/event.bnd
@@ -16,6 +16,7 @@ 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>
--
NetSurf Browser
10 years, 3 months
netsurf: branch master updated. c0f9ae95b9f5ac169f225d2b52d57d05599b6772
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/c0f9ae95b9f5ac169f225...
...commit http://git.netsurf-browser.org/netsurf.git/commit/c0f9ae95b9f5ac169f225d2...
...tree http://git.netsurf-browser.org/netsurf.git/tree/c0f9ae95b9f5ac169f225d2b5...
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/c0f9ae95b9f5ac169f2...
commit c0f9ae95b9f5ac169f225d2b52d57d05599b6772
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)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 <vince(a)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/484fa8b110fb10b1980...
commit 484fa8b110fb10b19808e73c49b345be638cb1db
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)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 <vince(a)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
10 years, 3 months
netsurf-website: branch master updated. cea2032985626853287b3a9a2aa0b1022139def8
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf-website.git/shortlog/cea2032985626...
...commit http://git.netsurf-browser.org/netsurf-website.git/commit/cea203298562685...
...tree http://git.netsurf-browser.org/netsurf-website.git/tree/cea20329856268532...
The branch, master has been updated
via cea2032985626853287b3a9a2aa0b1022139def8 (commit)
from 49375e5df98f16434b4a501a2ab7f649afc7f3c5 (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-website.git/commitdiff/cea20329856...
commit cea2032985626853287b3a9a2aa0b1022139def8
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Update progress.
diff --git a/documentation/progress.en b/documentation/progress.en
index 8642410..e0f3164 100644
--- a/documentation/progress.en
+++ b/documentation/progress.en
@@ -67,15 +67,15 @@
<li><a href="#NSF">NetSurf features</a></li>
</ul>
-<p class="updated">Last updated 30 April 2009</p>
+<p class="updated">Last updated 20 December 2012</p>
<h2 id="General"></h2>
<table class="progress">
<tr><th class="progresstitle">Title</th><th class="progressstatus">Status</th><th>Notes</th></tr>
-<tr class="inprogress"><td>Web standards</td><td>In progress</td><td>Most of HTML 4 and CSS 2.1 are implemented which enabled NetSurf to access most of the web, however, JavaScript is currently unimplemented. This means NetSurf currently lacks support for certain dynamic content.</td></tr>
+<tr class="inprogress"><td>Web standards</td><td>In progress</td><td>Most of HTML 4 and CSS 2.1 are implemented which enables NetSurf to access most of the web, however, JavaScript support is currently at a very early stage of development. This means NetSurf currently lacks support for dynamic content.</td></tr>
<tr class="nearlydone"><td>User interface (RISC OS)</td><td>Nearly done</td><td>RISC OS interface is mature.</td></tr>
-<tr class="inprogress"><td>User interface (GTK)</td><td>In progress</td><td>The nsgtk user interface is sufficient to allow web browsing but currently lacks many features expected of a web browser.</td></tr>
+<tr class="nearlydone"><td>User interface (GTK)</td><td>In progress</td><td>The nsgtk user interface is sufficient to allow web browsing and supports many features expected of a web browser.</td></tr>
<tr class="inprogress"><td>Documentation</td><td>In progress</td><td>Much of the core functionality and RISC OS specific features are documented. There is very scant documentation for nsgtk.</td></tr>
</table>
@@ -96,7 +96,7 @@
<tr class="juststarted"><td>DOM Level 1</td><td>Just started</td><td>Core mostly complete.</td></tr>
<tr class="juststarted"><td>DOM Level 2</td><td>Just started</td><td>Core mostly complete.</td></tr>
<tr class="juststarted"><td>DOM Level 3</td><td>Just started</td><td>Core mostly complete.</td></tr>
-<tr class="notstarted"><td>JavaScript</td><td>Not started</td><td>Details on the <a href="info#JavaScript">User Information</a> page.</td></tr>
+<tr class="juststarted"><td>JavaScript</td><td>Just started</td><td>Details on the <a href="info#JavaScript">User Information</a> page.</td></tr>
</table>
<h3 id="ImportantHTML">Important HTML features</h3>
@@ -114,12 +114,12 @@
<table class="progress">
<tr><th class="progresstitle">Title</th><th class="progressstatus">Status</th><th>Notes</th></tr>
-<tr class="nearlydone"><td>Selectors</td><td>Nearly done</td><td>CSS 1 and CSS 2 selectors implemented. A few CSS 3 selectors are implemented too.</td></tr>
-<tr class="juststarted"><td>Pseudo-classes</td><td>Just started</td><td></td></tr>
-<tr class="juststarted"><td>Pseudo-elements</td><td>Just started</td><td></td></tr>
+<tr class="nearlydone"><td>Selectors</td><td>Nearly done</td><td>CSS 1 and CSS 2 selectors implemented. Most CSS 3 selectors are implemented too.</td></tr>
+<tr class="nearlydone"><td>Pseudo-classes</td><td>Nearly done</td><td></td></tr>
+<tr class="nearlydone"><td>Pseudo-elements</td><td>Nearly done</td><td></td></tr>
<tr class="nearlydone"><td>Media types</td><td>Nearly done</td><td>NetSurf currently only uses the screen-targetted CSS, even when printing.</td></tr>
<tr class="complete"><td>@import</td><td>Complete</td><td></td></tr>
-<tr class="nearlydone"><td>Cascade</td><td>Nearly done</td><td>There is no user stylesheet.</td></tr>
+<tr class="complete"><td>Cascade</td><td>Complete</td><td></td></tr>
</table>
<h3 id="CSSProperties">CSS properties</h3>
@@ -143,7 +143,7 @@
<tr class="complete"><td>bottom</td><td>Complete</td><td></td></tr>
<tr class="notstarted"><td>caption-side</td><td>Not started</td><td></td></tr>
<tr class="nearlydone"><td>clear</td><td>Nearly done</td><td>Some issues with floats remain.</td></tr>
-<tr class="notstarted"><td>clip</td><td>Not started</td><td></td></tr>
+<tr class="complete"><td>clip</td><td>Complete</td><td></td></tr>
<tr class="complete"><td>color</td><td>Complete</td><td></td></tr>
<tr class="notstarted"><td>content</td><td>Not started</td><td></td></tr>
<tr class="complete"><td>counter-increment</td><td>Complete</td><td>Can't be used until content property is implemented.</td></tr>
@@ -232,7 +232,7 @@
<tr><th class="progresstitle">Title</th><th class="progressstatus">Status</th><th>Notes</th></tr>
<tr class="complete"><td>Acorn URI Protocol</td><td>Complete</td><td></td></tr>
<tr class="complete"><td>Ant URL Protocol</td><td>Complete</td><td></td></tr>
-<tr class="nearlydone"><td>Plugin Protocol</td><td>Nearly done</td><td>Incomplete implementation.</td></tr>
+<tr class="notstarted"><td>Plugin Protocol</td><td>Not started</td><td>Old, dodgy implementation removed.</td></tr>
</table>
<h2 id="NSF">NetSurf features</h2>
@@ -250,15 +250,15 @@
<tr class="complete"><td>Downloads (RISC OS)</td><td>Complete</td><td>Following a link to a file NetSurf can't render opens the download dialogue box.</td></tr>
<tr class="complete"><td>Downloads (GTK)</td><td>Complete</td><td></td></tr>
<tr class="nearlydone"><td>Find Text (RISC OS)</td><td>Nearly done</td><td>Doesn't find phrases if they are split across lines.</td></tr>
-<tr class="juststarted"><td>Find Text (GTK)</td><td>Just started</td><td></td></tr>
+<tr class="nearlydone"><td>Find Text (GTK)</td><td>Nearly done</td><td></td></tr>
<tr class="nearlydone"><td>Full Save (RISC OS)</td><td>Nearly done</td><td>Save pages with CSS files and images.<br>Doesn't rewrite URLs for CSS background images.</td></tr>
-<tr class="notstarted"><td>Full Save (GTK)</td><td>Not started</td><td></td></tr>
+<tr class="nearlydone"><td>Full Save (GTK)</td><td>Nearly done</td><td></td></tr>
<tr class="nearlydone"><td>History - Global (RISC OS)</td><td>Nearly done</td><td>Details in the <a href="guide#History">User Guide</a>.</td></tr>
-<tr class="juststarted"><td>History - Global (GTK)</td><td>Just started</td><td>Some support but very incomplete.</td></tr>
+<tr class="nearlydone"><td>History - Global (GTK)</td><td>Nearly done</td><td></td></tr>
<tr class="complete"><td>History - Local (RISC OS)</td><td>Complete</td><td>Details in the <a href="guide#History">User Guide</a>.</td></tr>
<tr class="nearlydone"><td>History - Local (GTK)</td><td>Nearly done</td><td></td></tr>
<tr class="nearlydone"><td>Hotlist / bookmarks (RISC OS)</td><td>Nearly done</td><td>Details in the <a href="guide#Hotlist">User Guide</a>.</td></tr>
-<tr class="notstarted"><td>Hotlist / bookmarks (GTK)</td><td>Not started</td><td></td></tr>
+<tr class="nearlydone"><td>Hotlist / bookmarks (GTK)</td><td>Nearly done</td><td></td></tr>
<tr class="nearlydone"><td>Interactive Help (RISC OS)</td><td>Nearly done</td><td></td></tr>
<tr class="nearlydone"><td>Interactive Help (GTK)</td><td>Nearly done</td><td>Extensive tool tips for GUI but none for rendering area.</td></tr>
<tr class="complete"><td>Memory Cache</td><td>Complete</td><td></td></tr>
-----------------------------------------------------------------------
Summary of changes:
documentation/progress.en | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/documentation/progress.en b/documentation/progress.en
index 8642410..e0f3164 100644
--- a/documentation/progress.en
+++ b/documentation/progress.en
@@ -67,15 +67,15 @@
<li><a href="#NSF">NetSurf features</a></li>
</ul>
-<p class="updated">Last updated 30 April 2009</p>
+<p class="updated">Last updated 20 December 2012</p>
<h2 id="General"></h2>
<table class="progress">
<tr><th class="progresstitle">Title</th><th class="progressstatus">Status</th><th>Notes</th></tr>
-<tr class="inprogress"><td>Web standards</td><td>In progress</td><td>Most of HTML 4 and CSS 2.1 are implemented which enabled NetSurf to access most of the web, however, JavaScript is currently unimplemented. This means NetSurf currently lacks support for certain dynamic content.</td></tr>
+<tr class="inprogress"><td>Web standards</td><td>In progress</td><td>Most of HTML 4 and CSS 2.1 are implemented which enables NetSurf to access most of the web, however, JavaScript support is currently at a very early stage of development. This means NetSurf currently lacks support for dynamic content.</td></tr>
<tr class="nearlydone"><td>User interface (RISC OS)</td><td>Nearly done</td><td>RISC OS interface is mature.</td></tr>
-<tr class="inprogress"><td>User interface (GTK)</td><td>In progress</td><td>The nsgtk user interface is sufficient to allow web browsing but currently lacks many features expected of a web browser.</td></tr>
+<tr class="nearlydone"><td>User interface (GTK)</td><td>In progress</td><td>The nsgtk user interface is sufficient to allow web browsing and supports many features expected of a web browser.</td></tr>
<tr class="inprogress"><td>Documentation</td><td>In progress</td><td>Much of the core functionality and RISC OS specific features are documented. There is very scant documentation for nsgtk.</td></tr>
</table>
@@ -96,7 +96,7 @@
<tr class="juststarted"><td>DOM Level 1</td><td>Just started</td><td>Core mostly complete.</td></tr>
<tr class="juststarted"><td>DOM Level 2</td><td>Just started</td><td>Core mostly complete.</td></tr>
<tr class="juststarted"><td>DOM Level 3</td><td>Just started</td><td>Core mostly complete.</td></tr>
-<tr class="notstarted"><td>JavaScript</td><td>Not started</td><td>Details on the <a href="info#JavaScript">User Information</a> page.</td></tr>
+<tr class="juststarted"><td>JavaScript</td><td>Just started</td><td>Details on the <a href="info#JavaScript">User Information</a> page.</td></tr>
</table>
<h3 id="ImportantHTML">Important HTML features</h3>
@@ -114,12 +114,12 @@
<table class="progress">
<tr><th class="progresstitle">Title</th><th class="progressstatus">Status</th><th>Notes</th></tr>
-<tr class="nearlydone"><td>Selectors</td><td>Nearly done</td><td>CSS 1 and CSS 2 selectors implemented. A few CSS 3 selectors are implemented too.</td></tr>
-<tr class="juststarted"><td>Pseudo-classes</td><td>Just started</td><td></td></tr>
-<tr class="juststarted"><td>Pseudo-elements</td><td>Just started</td><td></td></tr>
+<tr class="nearlydone"><td>Selectors</td><td>Nearly done</td><td>CSS 1 and CSS 2 selectors implemented. Most CSS 3 selectors are implemented too.</td></tr>
+<tr class="nearlydone"><td>Pseudo-classes</td><td>Nearly done</td><td></td></tr>
+<tr class="nearlydone"><td>Pseudo-elements</td><td>Nearly done</td><td></td></tr>
<tr class="nearlydone"><td>Media types</td><td>Nearly done</td><td>NetSurf currently only uses the screen-targetted CSS, even when printing.</td></tr>
<tr class="complete"><td>@import</td><td>Complete</td><td></td></tr>
-<tr class="nearlydone"><td>Cascade</td><td>Nearly done</td><td>There is no user stylesheet.</td></tr>
+<tr class="complete"><td>Cascade</td><td>Complete</td><td></td></tr>
</table>
<h3 id="CSSProperties">CSS properties</h3>
@@ -143,7 +143,7 @@
<tr class="complete"><td>bottom</td><td>Complete</td><td></td></tr>
<tr class="notstarted"><td>caption-side</td><td>Not started</td><td></td></tr>
<tr class="nearlydone"><td>clear</td><td>Nearly done</td><td>Some issues with floats remain.</td></tr>
-<tr class="notstarted"><td>clip</td><td>Not started</td><td></td></tr>
+<tr class="complete"><td>clip</td><td>Complete</td><td></td></tr>
<tr class="complete"><td>color</td><td>Complete</td><td></td></tr>
<tr class="notstarted"><td>content</td><td>Not started</td><td></td></tr>
<tr class="complete"><td>counter-increment</td><td>Complete</td><td>Can't be used until content property is implemented.</td></tr>
@@ -232,7 +232,7 @@
<tr><th class="progresstitle">Title</th><th class="progressstatus">Status</th><th>Notes</th></tr>
<tr class="complete"><td>Acorn URI Protocol</td><td>Complete</td><td></td></tr>
<tr class="complete"><td>Ant URL Protocol</td><td>Complete</td><td></td></tr>
-<tr class="nearlydone"><td>Plugin Protocol</td><td>Nearly done</td><td>Incomplete implementation.</td></tr>
+<tr class="notstarted"><td>Plugin Protocol</td><td>Not started</td><td>Old, dodgy implementation removed.</td></tr>
</table>
<h2 id="NSF">NetSurf features</h2>
@@ -250,15 +250,15 @@
<tr class="complete"><td>Downloads (RISC OS)</td><td>Complete</td><td>Following a link to a file NetSurf can't render opens the download dialogue box.</td></tr>
<tr class="complete"><td>Downloads (GTK)</td><td>Complete</td><td></td></tr>
<tr class="nearlydone"><td>Find Text (RISC OS)</td><td>Nearly done</td><td>Doesn't find phrases if they are split across lines.</td></tr>
-<tr class="juststarted"><td>Find Text (GTK)</td><td>Just started</td><td></td></tr>
+<tr class="nearlydone"><td>Find Text (GTK)</td><td>Nearly done</td><td></td></tr>
<tr class="nearlydone"><td>Full Save (RISC OS)</td><td>Nearly done</td><td>Save pages with CSS files and images.<br>Doesn't rewrite URLs for CSS background images.</td></tr>
-<tr class="notstarted"><td>Full Save (GTK)</td><td>Not started</td><td></td></tr>
+<tr class="nearlydone"><td>Full Save (GTK)</td><td>Nearly done</td><td></td></tr>
<tr class="nearlydone"><td>History - Global (RISC OS)</td><td>Nearly done</td><td>Details in the <a href="guide#History">User Guide</a>.</td></tr>
-<tr class="juststarted"><td>History - Global (GTK)</td><td>Just started</td><td>Some support but very incomplete.</td></tr>
+<tr class="nearlydone"><td>History - Global (GTK)</td><td>Nearly done</td><td></td></tr>
<tr class="complete"><td>History - Local (RISC OS)</td><td>Complete</td><td>Details in the <a href="guide#History">User Guide</a>.</td></tr>
<tr class="nearlydone"><td>History - Local (GTK)</td><td>Nearly done</td><td></td></tr>
<tr class="nearlydone"><td>Hotlist / bookmarks (RISC OS)</td><td>Nearly done</td><td>Details in the <a href="guide#Hotlist">User Guide</a>.</td></tr>
-<tr class="notstarted"><td>Hotlist / bookmarks (GTK)</td><td>Not started</td><td></td></tr>
+<tr class="nearlydone"><td>Hotlist / bookmarks (GTK)</td><td>Nearly done</td><td></td></tr>
<tr class="nearlydone"><td>Interactive Help (RISC OS)</td><td>Nearly done</td><td></td></tr>
<tr class="nearlydone"><td>Interactive Help (GTK)</td><td>Nearly done</td><td>Extensive tool tips for GUI but none for rendering area.</td></tr>
<tr class="complete"><td>Memory Cache</td><td>Complete</td><td></td></tr>
--
NetSurf website source for *.netsurf-browser.org
10 years, 3 months
nsgenjsbind: branch master updated. 841ecdf404e166945f5cc6cd320ca15dfb93b57c
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/nsgenjsbind.git/shortlog/841ecdf404e166945...
...commit http://git.netsurf-browser.org/nsgenjsbind.git/commit/841ecdf404e166945f5...
...tree http://git.netsurf-browser.org/nsgenjsbind.git/tree/841ecdf404e166945f5cc...
The branch, master has been updated
via 841ecdf404e166945f5cc6cd320ca15dfb93b57c (commit)
from 8c1dc149575cfab4f3fdac91d9fd3c41be9d75bc (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/nsgenjsbind.git/commitdiff/841ecdf404e1669...
commit 841ecdf404e166945f5cc6cd320ca15dfb93b57c
Author: Vincent Sanders <vincent.sanders(a)collabora.co.uk>
Commit: Vincent Sanders <vincent.sanders(a)collabora.co.uk>
allow generation of header for exported interfaces and structures.
diff --git a/src/jsapi-libdom.c b/src/jsapi-libdom.c
index 3e0bf08..4fbe67b 100644
--- a/src/jsapi-libdom.c
+++ b/src/jsapi-libdom.c
@@ -1,7 +1,7 @@
/* binding output generator for jsapi(spidermonkey) to libdom
*
* This file is part of nsgenbind.
- * Licensed under the MIT License,
+ * Published under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2012 Vincent Sanders <vince(a)netsurf-browser.org>
*/
@@ -17,8 +17,18 @@
#include "webidl-ast.h"
#include "jsapi-libdom.h"
-#define HDR_COMMENT_SEP "\n * \n * "
-#define HDR_COMMENT_PREABLE "Generated by nsgenbind "
+#define HDR_COMMENT_SEP "\n * \n * "
+#define HDR_COMMENT_PREAMBLE "/* Generated by nsgenbind from %s\n" \
+ " *\n" \
+ " * nsgenbind is published under the MIT Licence.\n" \
+ " * nsgenbind is similar to a compiler is a purely transformative tool which\n" \
+ " * explicitly makes no copyright claim on this generated output"
+
+#define HDROUTF(bndg, fmt, args...) do { \
+ if (bndg->hdrfile != NULL) { \
+ fprintf(bndg->hdrfile, fmt, ##args); \
+ } \
+ } while(0)
static int webidl_file_cb(struct genbind_node *node, void *ctx)
@@ -249,7 +259,18 @@ output_class_init(struct binding *binding)
int res = 0;
struct genbind_node *api_node;
- /* class Initialisor */
+ /* class Initialisor declaration */
+ if (binding->hdrfile) {
+ binding->outfile = binding->hdrfile;
+
+ fprintf(binding->outfile,
+ "JSObject *jsapi_InitClass_%s(JSContext *cx, JSObject *parent);\n",
+ binding->interface);
+
+ binding->outfile = binding->srcfile;
+ }
+
+ /* class Initialisor definition */
fprintf(binding->outfile,
"JSObject *jsapi_InitClass_%s(JSContext *cx, JSObject *parent)\n"
"{\n"
@@ -294,7 +315,27 @@ output_class_new(struct binding *binding)
int res = 0;
struct genbind_node *api_node;
- /* constructor */
+ /* constructor declaration */
+ if (binding->hdrfile) {
+ binding->outfile = binding->hdrfile;
+
+ fprintf(binding->outfile,
+ "JSObject *jsapi_new_%s(JSContext *cx,\n"
+ "\t\tJSObject *prototype,\n"
+ "\t\tJSObject *parent",
+ binding->interface);
+
+ genbind_node_for_each_type(binding->binding_list,
+ GENBIND_NODE_TYPE_BINDING_PRIVATE,
+ webidl_private_param_cb,
+ binding);
+
+ fprintf(binding->outfile, ");");
+
+ binding->outfile = binding->srcfile;
+ }
+
+ /* constructor definition */
fprintf(binding->outfile,
"JSObject *jsapi_new_%s(JSContext *cx,\n"
"\t\tJSObject *prototype,\n"
@@ -436,7 +477,10 @@ output_jsclass(struct binding *binding)
fprintf(binding->outfile,
"static JSPropertySpec jsclass_properties[];\n\n");
- /* output the class */
+ /* output the class declaration */
+ HDROUTF(binding, "JSClass JSClass_%s;\n", binding->interface);
+
+ /* output the class definition */
fprintf(binding->outfile,
"JSClass JSClass_%s = {\n"
"\t\"%s\",\n",
@@ -559,7 +603,8 @@ output_preamble(struct binding *binding)
static int
output_header_comments(struct binding *binding)
{
- fprintf(binding->outfile, "/* "HDR_COMMENT_PREABLE);
+ const char *preamble = HDR_COMMENT_PREAMBLE;
+ fprintf(binding->outfile, preamble, options->infilename);
genbind_node_for_each_type(binding->gb_ast,
GENBIND_NODE_TYPE_HDRCOMMENT,
@@ -567,6 +612,21 @@ output_header_comments(struct binding *binding)
binding);
fprintf(binding->outfile,"\n */\n\n");
+
+ if (binding->hdrfile != NULL) {
+ binding->outfile = binding->hdrfile;
+
+ fprintf(binding->outfile, preamble, options->infilename);
+
+ genbind_node_for_each_type(binding->gb_ast,
+ GENBIND_NODE_TYPE_HDRCOMMENT,
+ webidl_hdrcomment_cb,
+ binding);
+
+ fprintf(binding->outfile,"\n */\n\n");
+
+ binding->outfile = binding->srcfile;
+ }
return 0;
}
@@ -608,14 +668,17 @@ binding_has_global(struct binding *binding)
}
static struct binding *
-binding_new(char *outfilename, struct genbind_node *genbind_ast)
+binding_new(char *outfilename,
+ char *hdrfilename,
+ struct genbind_node *genbind_ast)
{
struct binding *nb;
struct genbind_node *binding_node;
struct genbind_node *binding_list;
struct genbind_node *ident_node;
struct genbind_node *interface_node;
- FILE *outfile ; /* output file */
+ FILE *outfile = NULL; /* output source file */
+ FILE *hdrfile = NULL; /* output header file */
struct webidl_node *webidl_ast = NULL;
int res;
@@ -659,12 +722,24 @@ binding_new(char *outfilename, struct genbind_node *genbind_ast)
outfile = fopen(outfilename, "w");
}
if (outfile == NULL) {
- fprintf(stderr, "Error opening output %s: %s\n",
+ fprintf(stderr, "Error opening source output %s: %s\n",
outfilename,
strerror(errno));
return NULL;
}
+ /* output header file if required */
+ if (hdrfilename != NULL) {
+ hdrfile = fopen(hdrfilename, "w");
+ if (hdrfile == NULL) {
+ fprintf(stderr, "Error opening header output %s: %s\n",
+ hdrfilename,
+ strerror(errno));
+ fclose(outfile);
+ return NULL;
+ }
+ }
+
nb = calloc(1, sizeof(struct binding));
nb->gb_ast = genbind_ast;
@@ -672,6 +747,8 @@ binding_new(char *outfilename, struct genbind_node *genbind_ast)
nb->name = genbind_node_gettext(ident_node);
nb->interface = genbind_node_gettext(interface_node);
nb->outfile = outfile;
+ nb->srcfile = outfile;
+ nb->hdrfile = hdrfile;
nb->has_private = binding_has_private(binding_list);
nb->has_global = binding_has_global(nb);
nb->binding_list = binding_list;
@@ -692,13 +769,16 @@ binding_new(char *outfilename, struct genbind_node *genbind_ast)
}
-int jsapi_libdom_output(char *outfilename, struct genbind_node *genbind_ast)
+int
+jsapi_libdom_output(char *outfilename,
+ char *hdrfilename,
+ struct genbind_node *genbind_ast)
{
int res;
struct binding *binding;
/* get general binding information used in output */
- binding = binding_new(outfilename, genbind_ast);
+ binding = binding_new(outfilename, hdrfilename, genbind_ast);
if (binding == NULL) {
return 40;
}
diff --git a/src/jsapi-libdom.h b/src/jsapi-libdom.h
index 8af39b2..bdc941d 100644
--- a/src/jsapi-libdom.h
+++ b/src/jsapi-libdom.h
@@ -24,11 +24,16 @@ struct binding {
struct genbind_node *finalise; /* binding api finalise node or NULL */
struct genbind_node *mark; /* binding api mark node or NULL */
- FILE *outfile ; /* output file */
+ FILE *outfile ; /* file handle output should be written to,
+ * allows reuse of callback routines to output
+ * to headers and source files
+ */
+ FILE *srcfile ; /* output source file */
+ FILE *hdrfile ; /* output header file */
};
/** Generate binding between jsapi and netsurf libdom */
-int jsapi_libdom_output(char *outfile, struct genbind_node *genbind_root);
+int jsapi_libdom_output(char *outfile, char *hdrfile, struct genbind_node *genbind_root);
/** output code block from a node */
void output_code_block(struct binding *binding, struct genbind_node *codelist);
diff --git a/src/nsgenbind.c b/src/nsgenbind.c
index 0f549f9..1c5100e 100644
--- a/src/nsgenbind.c
+++ b/src/nsgenbind.c
@@ -30,7 +30,7 @@ static struct options* process_cmdline(int argc, char **argv)
return NULL;
}
- while ((opt = getopt(argc, argv, "vDW::d:I:o:")) != -1) {
+ while ((opt = getopt(argc, argv, "vDW::d:I:o:h:")) != -1) {
switch (opt) {
case 'I':
options->idlpath = strdup(optarg);
@@ -40,6 +40,10 @@ static struct options* process_cmdline(int argc, char **argv)
options->outfilename = strdup(optarg);
break;
+ case 'h':
+ options->hdrfilename = strdup(optarg);
+ break;
+
case 'd':
options->depfilename = strdup(optarg);
break;
@@ -58,7 +62,7 @@ static struct options* process_cmdline(int argc, char **argv)
default: /* '?' */
fprintf(stderr,
- "Usage: %s [-d depfilename] [-I idlpath] [-o filename] inputfile\n",
+ "Usage: %s [-v] [-D] [-W] [-d depfilename] [-I idlpath] [-o filename] [-h headerfile] inputfile\n",
argv[0]);
free(options);
return NULL;
@@ -131,10 +135,17 @@ int main(int argc, char **argv)
genbind_ast_dump(genbind_root, 0);
}
- res = jsapi_libdom_output(options->outfilename, genbind_root);
+ res = jsapi_libdom_output(options->outfilename,
+ options->hdrfilename,
+ genbind_root);
if (res != 0) {
fprintf(stderr, "Error: output failed with code %d\n", res);
- unlink(options->outfilename);
+ if (options->outfilename != NULL) {
+ unlink(options->outfilename);
+ }
+ if (options->hdrfilename != NULL) {
+ unlink(options->hdrfilename);
+ }
return res;
}
diff --git a/src/options.h b/src/options.h
index 5ded73a..ca71078 100644
--- a/src/options.h
+++ b/src/options.h
@@ -9,15 +9,20 @@
#ifndef nsgenbind_options_h
#define nsgenbind_options_h
+/** global options */
struct options {
- char *outfilename;
- char *infilename;
- char *depfilename;
- FILE *depfilehandle;
- char *idlpath;
- bool verbose; /* verbose processing */
- bool debug; /* debug enabled */
- unsigned int warnings; /* warning flags */
+ char *infilename; /**< binding source */
+
+ char *outfilename; /**< output source file */
+ char *hdrfilename; /**< output header file */
+
+ char *depfilename; /**< dependancy output*/
+ FILE *depfilehandle; /**< dependancy file handle */
+ char *idlpath; /**< path to IDL files */
+
+ bool verbose; /**< verbose processing */
+ bool debug; /**< debug enabled */
+ unsigned int warnings; /**< warning flags */
};
extern struct options *options;
diff --git a/test/testrunner.sh b/test/testrunner.sh
index 3c8a0ae..1349b84 100755
--- a/test/testrunner.sh
+++ b/test/testrunner.sh
@@ -28,9 +28,9 @@ for TEST in ${BINDINGTESTS};do
echo -n " TEST: ${TESTNAME}......"
outline
- echo ${GENJSBIND} -D -v -I ${IDLDIR} -o ${BUILDDIR}/test_${TESTNAME}.c ${TEST} >>${LOGFILE} 2>&1
+ echo ${GENJSBIND} -D -v -I ${IDLDIR} -o ${BUILDDIR}/test_${TESTNAME}.c -h ${BUILDDIR}/test_${TESTNAME}.h ${TEST} >>${LOGFILE} 2>&1
- ${GENJSBIND} -D -v -I ${IDLDIR} -o ${BUILDDIR}/test_${TESTNAME}.c ${TEST} >>${LOGFILE} 2>&1
+ ${GENJSBIND} -D -v -I ${IDLDIR} -o ${BUILDDIR}/test_${TESTNAME}.c -h ${BUILDDIR}/test_${TESTNAME}.h ${TEST} >>${LOGFILE} 2>&1
if [ $? -eq 0 ]; then
echo "PASS"
-----------------------------------------------------------------------
Summary of changes:
src/jsapi-libdom.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++------
src/jsapi-libdom.h | 9 +++-
src/nsgenbind.c | 19 +++++++--
src/options.h | 21 ++++++----
test/testrunner.sh | 4 +-
5 files changed, 129 insertions(+), 28 deletions(-)
diff --git a/src/jsapi-libdom.c b/src/jsapi-libdom.c
index 3e0bf08..4fbe67b 100644
--- a/src/jsapi-libdom.c
+++ b/src/jsapi-libdom.c
@@ -1,7 +1,7 @@
/* binding output generator for jsapi(spidermonkey) to libdom
*
* This file is part of nsgenbind.
- * Licensed under the MIT License,
+ * Published under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2012 Vincent Sanders <vince(a)netsurf-browser.org>
*/
@@ -17,8 +17,18 @@
#include "webidl-ast.h"
#include "jsapi-libdom.h"
-#define HDR_COMMENT_SEP "\n * \n * "
-#define HDR_COMMENT_PREABLE "Generated by nsgenbind "
+#define HDR_COMMENT_SEP "\n * \n * "
+#define HDR_COMMENT_PREAMBLE "/* Generated by nsgenbind from %s\n" \
+ " *\n" \
+ " * nsgenbind is published under the MIT Licence.\n" \
+ " * nsgenbind is similar to a compiler is a purely transformative tool which\n" \
+ " * explicitly makes no copyright claim on this generated output"
+
+#define HDROUTF(bndg, fmt, args...) do { \
+ if (bndg->hdrfile != NULL) { \
+ fprintf(bndg->hdrfile, fmt, ##args); \
+ } \
+ } while(0)
static int webidl_file_cb(struct genbind_node *node, void *ctx)
@@ -249,7 +259,18 @@ output_class_init(struct binding *binding)
int res = 0;
struct genbind_node *api_node;
- /* class Initialisor */
+ /* class Initialisor declaration */
+ if (binding->hdrfile) {
+ binding->outfile = binding->hdrfile;
+
+ fprintf(binding->outfile,
+ "JSObject *jsapi_InitClass_%s(JSContext *cx, JSObject *parent);\n",
+ binding->interface);
+
+ binding->outfile = binding->srcfile;
+ }
+
+ /* class Initialisor definition */
fprintf(binding->outfile,
"JSObject *jsapi_InitClass_%s(JSContext *cx, JSObject *parent)\n"
"{\n"
@@ -294,7 +315,27 @@ output_class_new(struct binding *binding)
int res = 0;
struct genbind_node *api_node;
- /* constructor */
+ /* constructor declaration */
+ if (binding->hdrfile) {
+ binding->outfile = binding->hdrfile;
+
+ fprintf(binding->outfile,
+ "JSObject *jsapi_new_%s(JSContext *cx,\n"
+ "\t\tJSObject *prototype,\n"
+ "\t\tJSObject *parent",
+ binding->interface);
+
+ genbind_node_for_each_type(binding->binding_list,
+ GENBIND_NODE_TYPE_BINDING_PRIVATE,
+ webidl_private_param_cb,
+ binding);
+
+ fprintf(binding->outfile, ");");
+
+ binding->outfile = binding->srcfile;
+ }
+
+ /* constructor definition */
fprintf(binding->outfile,
"JSObject *jsapi_new_%s(JSContext *cx,\n"
"\t\tJSObject *prototype,\n"
@@ -436,7 +477,10 @@ output_jsclass(struct binding *binding)
fprintf(binding->outfile,
"static JSPropertySpec jsclass_properties[];\n\n");
- /* output the class */
+ /* output the class declaration */
+ HDROUTF(binding, "JSClass JSClass_%s;\n", binding->interface);
+
+ /* output the class definition */
fprintf(binding->outfile,
"JSClass JSClass_%s = {\n"
"\t\"%s\",\n",
@@ -559,7 +603,8 @@ output_preamble(struct binding *binding)
static int
output_header_comments(struct binding *binding)
{
- fprintf(binding->outfile, "/* "HDR_COMMENT_PREABLE);
+ const char *preamble = HDR_COMMENT_PREAMBLE;
+ fprintf(binding->outfile, preamble, options->infilename);
genbind_node_for_each_type(binding->gb_ast,
GENBIND_NODE_TYPE_HDRCOMMENT,
@@ -567,6 +612,21 @@ output_header_comments(struct binding *binding)
binding);
fprintf(binding->outfile,"\n */\n\n");
+
+ if (binding->hdrfile != NULL) {
+ binding->outfile = binding->hdrfile;
+
+ fprintf(binding->outfile, preamble, options->infilename);
+
+ genbind_node_for_each_type(binding->gb_ast,
+ GENBIND_NODE_TYPE_HDRCOMMENT,
+ webidl_hdrcomment_cb,
+ binding);
+
+ fprintf(binding->outfile,"\n */\n\n");
+
+ binding->outfile = binding->srcfile;
+ }
return 0;
}
@@ -608,14 +668,17 @@ binding_has_global(struct binding *binding)
}
static struct binding *
-binding_new(char *outfilename, struct genbind_node *genbind_ast)
+binding_new(char *outfilename,
+ char *hdrfilename,
+ struct genbind_node *genbind_ast)
{
struct binding *nb;
struct genbind_node *binding_node;
struct genbind_node *binding_list;
struct genbind_node *ident_node;
struct genbind_node *interface_node;
- FILE *outfile ; /* output file */
+ FILE *outfile = NULL; /* output source file */
+ FILE *hdrfile = NULL; /* output header file */
struct webidl_node *webidl_ast = NULL;
int res;
@@ -659,12 +722,24 @@ binding_new(char *outfilename, struct genbind_node *genbind_ast)
outfile = fopen(outfilename, "w");
}
if (outfile == NULL) {
- fprintf(stderr, "Error opening output %s: %s\n",
+ fprintf(stderr, "Error opening source output %s: %s\n",
outfilename,
strerror(errno));
return NULL;
}
+ /* output header file if required */
+ if (hdrfilename != NULL) {
+ hdrfile = fopen(hdrfilename, "w");
+ if (hdrfile == NULL) {
+ fprintf(stderr, "Error opening header output %s: %s\n",
+ hdrfilename,
+ strerror(errno));
+ fclose(outfile);
+ return NULL;
+ }
+ }
+
nb = calloc(1, sizeof(struct binding));
nb->gb_ast = genbind_ast;
@@ -672,6 +747,8 @@ binding_new(char *outfilename, struct genbind_node *genbind_ast)
nb->name = genbind_node_gettext(ident_node);
nb->interface = genbind_node_gettext(interface_node);
nb->outfile = outfile;
+ nb->srcfile = outfile;
+ nb->hdrfile = hdrfile;
nb->has_private = binding_has_private(binding_list);
nb->has_global = binding_has_global(nb);
nb->binding_list = binding_list;
@@ -692,13 +769,16 @@ binding_new(char *outfilename, struct genbind_node *genbind_ast)
}
-int jsapi_libdom_output(char *outfilename, struct genbind_node *genbind_ast)
+int
+jsapi_libdom_output(char *outfilename,
+ char *hdrfilename,
+ struct genbind_node *genbind_ast)
{
int res;
struct binding *binding;
/* get general binding information used in output */
- binding = binding_new(outfilename, genbind_ast);
+ binding = binding_new(outfilename, hdrfilename, genbind_ast);
if (binding == NULL) {
return 40;
}
diff --git a/src/jsapi-libdom.h b/src/jsapi-libdom.h
index 8af39b2..bdc941d 100644
--- a/src/jsapi-libdom.h
+++ b/src/jsapi-libdom.h
@@ -24,11 +24,16 @@ struct binding {
struct genbind_node *finalise; /* binding api finalise node or NULL */
struct genbind_node *mark; /* binding api mark node or NULL */
- FILE *outfile ; /* output file */
+ FILE *outfile ; /* file handle output should be written to,
+ * allows reuse of callback routines to output
+ * to headers and source files
+ */
+ FILE *srcfile ; /* output source file */
+ FILE *hdrfile ; /* output header file */
};
/** Generate binding between jsapi and netsurf libdom */
-int jsapi_libdom_output(char *outfile, struct genbind_node *genbind_root);
+int jsapi_libdom_output(char *outfile, char *hdrfile, struct genbind_node *genbind_root);
/** output code block from a node */
void output_code_block(struct binding *binding, struct genbind_node *codelist);
diff --git a/src/nsgenbind.c b/src/nsgenbind.c
index 0f549f9..1c5100e 100644
--- a/src/nsgenbind.c
+++ b/src/nsgenbind.c
@@ -30,7 +30,7 @@ static struct options* process_cmdline(int argc, char **argv)
return NULL;
}
- while ((opt = getopt(argc, argv, "vDW::d:I:o:")) != -1) {
+ while ((opt = getopt(argc, argv, "vDW::d:I:o:h:")) != -1) {
switch (opt) {
case 'I':
options->idlpath = strdup(optarg);
@@ -40,6 +40,10 @@ static struct options* process_cmdline(int argc, char **argv)
options->outfilename = strdup(optarg);
break;
+ case 'h':
+ options->hdrfilename = strdup(optarg);
+ break;
+
case 'd':
options->depfilename = strdup(optarg);
break;
@@ -58,7 +62,7 @@ static struct options* process_cmdline(int argc, char **argv)
default: /* '?' */
fprintf(stderr,
- "Usage: %s [-d depfilename] [-I idlpath] [-o filename] inputfile\n",
+ "Usage: %s [-v] [-D] [-W] [-d depfilename] [-I idlpath] [-o filename] [-h headerfile] inputfile\n",
argv[0]);
free(options);
return NULL;
@@ -131,10 +135,17 @@ int main(int argc, char **argv)
genbind_ast_dump(genbind_root, 0);
}
- res = jsapi_libdom_output(options->outfilename, genbind_root);
+ res = jsapi_libdom_output(options->outfilename,
+ options->hdrfilename,
+ genbind_root);
if (res != 0) {
fprintf(stderr, "Error: output failed with code %d\n", res);
- unlink(options->outfilename);
+ if (options->outfilename != NULL) {
+ unlink(options->outfilename);
+ }
+ if (options->hdrfilename != NULL) {
+ unlink(options->hdrfilename);
+ }
return res;
}
diff --git a/src/options.h b/src/options.h
index 5ded73a..ca71078 100644
--- a/src/options.h
+++ b/src/options.h
@@ -9,15 +9,20 @@
#ifndef nsgenbind_options_h
#define nsgenbind_options_h
+/** global options */
struct options {
- char *outfilename;
- char *infilename;
- char *depfilename;
- FILE *depfilehandle;
- char *idlpath;
- bool verbose; /* verbose processing */
- bool debug; /* debug enabled */
- unsigned int warnings; /* warning flags */
+ char *infilename; /**< binding source */
+
+ char *outfilename; /**< output source file */
+ char *hdrfilename; /**< output header file */
+
+ char *depfilename; /**< dependancy output*/
+ FILE *depfilehandle; /**< dependancy file handle */
+ char *idlpath; /**< path to IDL files */
+
+ bool verbose; /**< verbose processing */
+ bool debug; /**< debug enabled */
+ unsigned int warnings; /**< warning flags */
};
extern struct options *options;
diff --git a/test/testrunner.sh b/test/testrunner.sh
index 3c8a0ae..1349b84 100755
--- a/test/testrunner.sh
+++ b/test/testrunner.sh
@@ -28,9 +28,9 @@ for TEST in ${BINDINGTESTS};do
echo -n " TEST: ${TESTNAME}......"
outline
- echo ${GENJSBIND} -D -v -I ${IDLDIR} -o ${BUILDDIR}/test_${TESTNAME}.c ${TEST} >>${LOGFILE} 2>&1
+ echo ${GENJSBIND} -D -v -I ${IDLDIR} -o ${BUILDDIR}/test_${TESTNAME}.c -h ${BUILDDIR}/test_${TESTNAME}.h ${TEST} >>${LOGFILE} 2>&1
- ${GENJSBIND} -D -v -I ${IDLDIR} -o ${BUILDDIR}/test_${TESTNAME}.c ${TEST} >>${LOGFILE} 2>&1
+ ${GENJSBIND} -D -v -I ${IDLDIR} -o ${BUILDDIR}/test_${TESTNAME}.c -h ${BUILDDIR}/test_${TESTNAME}.h ${TEST} >>${LOGFILE} 2>&1
if [ $? -eq 0 ]; then
echo "PASS"
--
NetSurf Generator for JavaScript bindings
10 years, 3 months
netsurf: branch mono/removing-windom-dependency updated. 59a44380a6951b220c91d109532c24ecc7148361
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/59a44380a6951b220c91d...
...commit http://git.netsurf-browser.org/netsurf.git/commit/59a44380a6951b220c91d10...
...tree http://git.netsurf-browser.org/netsurf.git/tree/59a44380a6951b220c91d1095...
The branch, mono/removing-windom-dependency has been updated
via 59a44380a6951b220c91d109532c24ecc7148361 (commit)
from 037b7e0b75972470d9670def49893da8e24f056b (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/59a44380a6951b220c9...
commit 59a44380a6951b220c91d109532c24ecc7148361
Author: Ole Loots <ole(a)monochrom.net>
Commit: Ole Loots <ole(a)monochrom.net>
Download window works now without windom, except file select.
diff --git a/atari/download.c b/atari/download.c
index 28cf35b..566f44a 100755
--- a/atari/download.c
+++ b/atari/download.c
@@ -52,6 +52,7 @@ extern GRECT desk_area;
static void gui_download_window_destroy( struct gui_download_window * gdw );
static void on_abort_click(struct gui_download_window *dw);
+static void on_cbrdy_click(struct gui_download_window *dw);
static void on_close(struct gui_download_window * dw);
static void on_redraw(struct gui_download_window *dw, GRECT *clip);
@@ -66,7 +67,7 @@ static short on_aes_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
if ((ev_out->emo_events & MU_MESAG) != 0) {
// handle message
- printf("download win msg: %d\n", msg[0]);
+ //printf("download win msg: %d\n", msg[0]);
switch (msg[0]) {
case WM_REDRAW:
@@ -85,6 +86,7 @@ static short on_aes_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
break;
case WM_TOOLBAR:
+ printf("tb idx: %d\n", msg[4]);
switch(msg[4]){
case DOWNLOAD_BT_ABORT:
@@ -92,6 +94,7 @@ static short on_aes_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
break;
case DOWNLOAD_CB_CLOSE_RDY:
+ on_cbrdy_click(data);
break;
default: break;
@@ -119,7 +122,7 @@ static void on_redraw(struct gui_download_window *dw, GRECT *clip)
GRECT work, visible;
uint32_t p = 0;
- guiwin_get_grect(dw->guiwin, GUIWIN_AREA_CONTENT, &work);
+ guiwin_get_grect(dw->guiwin, GUIWIN_AREA_TOOLBAR, &work);
tree->ob_x = work.g_x;
tree->ob_y = work.g_y;
@@ -145,6 +148,7 @@ static void on_redraw(struct gui_download_window *dw, GRECT *clip)
} else {
tree[DOWNLOAD_CB_CLOSE_RDY].ob_state &= ~(SELECTED | CROSSED);
}
+ tree[DOWNLOAD_BT_ABORT].ob_state &= ~SELECTED;
/*Walk the AES rectangle list and redraw the visible areas of the window: */
wind_get_grect(dw->aes_handle, WF_FIRSTXYWH, &visible);
@@ -169,11 +173,12 @@ static void on_abort_click(struct gui_download_window *dw)
static void on_cbrdy_click(struct gui_download_window *dw)
{
- dw->close_on_finish = (dw->tree[DOWNLOAD_CB_CLOSE_RDY].ob_state & SELECTED);
+ dw->close_on_finish = !dw->close_on_finish;
if (dw->close_on_finish && dw->status == NSATARI_DOWNLOAD_COMPLETE) {
guiwin_send_msg(dw->guiwin, WM_CLOSED, 0,0,0,0);
}
- guiwin_send_redraw(dw->guiwin, NULL);
+ guiwin_send_redraw(dw->guiwin, NULL);
+ evnt_timer(250);
}
static void on_close(struct gui_download_window * dw)
@@ -251,8 +256,7 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
}
filename = download_context_get_filename(ctx);
- //dlgres = form_alert(2, "[2][Accept download?][Yes|Save as...|No]");
- dlgres = 1;
+ dlgres = form_alert(2, "[2][Accept download?][Yes|Save as...|No]");
if( dlgres == 3){
return( NULL );
}
@@ -270,7 +274,7 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
snprintf( destination, dstsize, "%s/%s", gdos_path, filename );
}
- gdw = calloc( 1, sizeof(struct gui_download_window) );
+ gdw = calloc(1, sizeof(struct gui_download_window));
if( gdw == NULL ){
warn_user(NULL, "Out of memory!");
free( destination );
@@ -290,12 +294,12 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
gdw->tree = tree;
url = download_context_get_url(ctx);
- gdw->fd = fopen(gdw->destination, "wb" );
+ gdw->fd = fopen(gdw->destination, "wb");
if( gdw->fd == NULL ){
char spare[200];
snprintf(spare, 200, "Couldn't open %s for writing!", gdw->destination);
msg_box_show(MSG_BOX_ALERT, spare);
- free( filename );
+ free(filename);
gui_download_window_destroy(gdw);
return( NULL );
}
@@ -305,9 +309,11 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
setvbuf( gdw->fd, gdw->fbuf, _IOFBF, gdw->fbufsize );
}
- gdw->aes_handle = wind_create_grect(CLOSER | MOVER | NAME, &desk_area);
+ gdw->aes_handle = wind_create_grect(CLOSER | NAME | MOVER, &desk_area);
wind_set_str(gdw->aes_handle, WF_NAME, "Download");
- gdw->guiwin = guiwin_add(gdw->aes_handle, GW_FLAG_DEFAULTS, on_aes_event);
+ unsigned long gwflags = GW_FLAG_DEFAULTS;
+ gwflags &= ~GW_FLAG_TOOLBAR_REDRAW;
+ gdw->guiwin = guiwin_add(gdw->aes_handle, gwflags, on_aes_event);
if( gdw->guiwin == NULL || gdw->fd == NULL ){
die("could not create guiwin");
free( filename );
@@ -315,9 +321,9 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
return( NULL );
}
guiwin_set_user_data(gdw->guiwin, gdw);
- //guiwin_set_toolbar(gdw->guiwin, tree, 0, 0);
+ guiwin_set_toolbar(gdw->guiwin, tree, 0, 0);
- //strncpy((char*)&gdw->lbl_file, filename, MAX_SLEN_LBL_FILE-1);
+ strncpy((char*)&gdw->lbl_file, filename, MAX_SLEN_LBL_FILE-1);
free( filename );
LOG(("created download: %s (total size: %d)",
gdw->destination, gdw->size_total
@@ -334,9 +340,8 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
curr.g_x = (desk_area.g_w / 2) - (curr.g_w / 2);
curr.g_y = (desk_area.g_h / 2) - (curr.g_h / 2);
- dbg_grect("download window", &curr);
-
wind_open_grect(gdw->aes_handle, &curr);
+ gdw->lastrdw = clock() / (CLOCKS_PER_SEC >> 3);
return(gdw);
}
@@ -345,9 +350,10 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
nserror gui_download_window_data(struct gui_download_window *dw,
const char *data, unsigned int size)
{
-
- uint32_t tnow = clock() / CLOCKS_PER_SEC;
- uint32_t sdiff = tnow - dw->start;
+
+ uint32_t clck = clock();
+ uint32_t tnow = clck / (CLOCKS_PER_SEC>>3);
+ uint32_t sdiff = (clck / (CLOCKS_PER_SEC)) - dw->start;
uint32_t p = 0;
float speed;
float pf = 0;
@@ -368,10 +374,8 @@ nserror gui_download_window_data(struct gui_download_window *dw,
fwrite( data , size, sizeof(unsigned char),dw->fd );
dw->size_downloaded += size;
- return NSERROR_OK;
-
- /* Update the progress bar... */
- if( tnow - dw->lastrdw > 1 ) {
+ /* Update GUI */
+ if ((tnow - dw->lastrdw) > 1) {
dw->lastrdw = tnow;
speed = dw->size_downloaded / sdiff;
@@ -406,14 +410,16 @@ void gui_download_window_error(struct gui_download_window *dw,
strncpy((char*)&dw->lbl_file, error_msg, MAX_SLEN_LBL_FILE-1);
dw->status = NSATARI_DOWNLOAD_ERROR;
guiwin_send_redraw(dw->guiwin, NULL);
- gui_window_set_status(input_window, messages_get("Done") );
+ gui_window_set_status(input_window, messages_get("Done") );
+ // TODO: change abort to close
}
void gui_download_window_done(struct gui_download_window *dw)
{
OBJECT * tree;
LOG((""));
-
+
+// TODO: change abort to close
dw->status = NSATARI_DOWNLOAD_COMPLETE;
if( dw->fd != NULL ) {
-----------------------------------------------------------------------
Summary of changes:
atari/download.c | 54 ++++++++++++++++++++++++++++++------------------------
1 files changed, 30 insertions(+), 24 deletions(-)
diff --git a/atari/download.c b/atari/download.c
index 28cf35b..566f44a 100755
--- a/atari/download.c
+++ b/atari/download.c
@@ -52,6 +52,7 @@ extern GRECT desk_area;
static void gui_download_window_destroy( struct gui_download_window * gdw );
static void on_abort_click(struct gui_download_window *dw);
+static void on_cbrdy_click(struct gui_download_window *dw);
static void on_close(struct gui_download_window * dw);
static void on_redraw(struct gui_download_window *dw, GRECT *clip);
@@ -66,7 +67,7 @@ static short on_aes_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
if ((ev_out->emo_events & MU_MESAG) != 0) {
// handle message
- printf("download win msg: %d\n", msg[0]);
+ //printf("download win msg: %d\n", msg[0]);
switch (msg[0]) {
case WM_REDRAW:
@@ -85,6 +86,7 @@ static short on_aes_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
break;
case WM_TOOLBAR:
+ printf("tb idx: %d\n", msg[4]);
switch(msg[4]){
case DOWNLOAD_BT_ABORT:
@@ -92,6 +94,7 @@ static short on_aes_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
break;
case DOWNLOAD_CB_CLOSE_RDY:
+ on_cbrdy_click(data);
break;
default: break;
@@ -119,7 +122,7 @@ static void on_redraw(struct gui_download_window *dw, GRECT *clip)
GRECT work, visible;
uint32_t p = 0;
- guiwin_get_grect(dw->guiwin, GUIWIN_AREA_CONTENT, &work);
+ guiwin_get_grect(dw->guiwin, GUIWIN_AREA_TOOLBAR, &work);
tree->ob_x = work.g_x;
tree->ob_y = work.g_y;
@@ -145,6 +148,7 @@ static void on_redraw(struct gui_download_window *dw, GRECT *clip)
} else {
tree[DOWNLOAD_CB_CLOSE_RDY].ob_state &= ~(SELECTED | CROSSED);
}
+ tree[DOWNLOAD_BT_ABORT].ob_state &= ~SELECTED;
/*Walk the AES rectangle list and redraw the visible areas of the window: */
wind_get_grect(dw->aes_handle, WF_FIRSTXYWH, &visible);
@@ -169,11 +173,12 @@ static void on_abort_click(struct gui_download_window *dw)
static void on_cbrdy_click(struct gui_download_window *dw)
{
- dw->close_on_finish = (dw->tree[DOWNLOAD_CB_CLOSE_RDY].ob_state & SELECTED);
+ dw->close_on_finish = !dw->close_on_finish;
if (dw->close_on_finish && dw->status == NSATARI_DOWNLOAD_COMPLETE) {
guiwin_send_msg(dw->guiwin, WM_CLOSED, 0,0,0,0);
}
- guiwin_send_redraw(dw->guiwin, NULL);
+ guiwin_send_redraw(dw->guiwin, NULL);
+ evnt_timer(250);
}
static void on_close(struct gui_download_window * dw)
@@ -251,8 +256,7 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
}
filename = download_context_get_filename(ctx);
- //dlgres = form_alert(2, "[2][Accept download?][Yes|Save as...|No]");
- dlgres = 1;
+ dlgres = form_alert(2, "[2][Accept download?][Yes|Save as...|No]");
if( dlgres == 3){
return( NULL );
}
@@ -270,7 +274,7 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
snprintf( destination, dstsize, "%s/%s", gdos_path, filename );
}
- gdw = calloc( 1, sizeof(struct gui_download_window) );
+ gdw = calloc(1, sizeof(struct gui_download_window));
if( gdw == NULL ){
warn_user(NULL, "Out of memory!");
free( destination );
@@ -290,12 +294,12 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
gdw->tree = tree;
url = download_context_get_url(ctx);
- gdw->fd = fopen(gdw->destination, "wb" );
+ gdw->fd = fopen(gdw->destination, "wb");
if( gdw->fd == NULL ){
char spare[200];
snprintf(spare, 200, "Couldn't open %s for writing!", gdw->destination);
msg_box_show(MSG_BOX_ALERT, spare);
- free( filename );
+ free(filename);
gui_download_window_destroy(gdw);
return( NULL );
}
@@ -305,9 +309,11 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
setvbuf( gdw->fd, gdw->fbuf, _IOFBF, gdw->fbufsize );
}
- gdw->aes_handle = wind_create_grect(CLOSER | MOVER | NAME, &desk_area);
+ gdw->aes_handle = wind_create_grect(CLOSER | NAME | MOVER, &desk_area);
wind_set_str(gdw->aes_handle, WF_NAME, "Download");
- gdw->guiwin = guiwin_add(gdw->aes_handle, GW_FLAG_DEFAULTS, on_aes_event);
+ unsigned long gwflags = GW_FLAG_DEFAULTS;
+ gwflags &= ~GW_FLAG_TOOLBAR_REDRAW;
+ gdw->guiwin = guiwin_add(gdw->aes_handle, gwflags, on_aes_event);
if( gdw->guiwin == NULL || gdw->fd == NULL ){
die("could not create guiwin");
free( filename );
@@ -315,9 +321,9 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
return( NULL );
}
guiwin_set_user_data(gdw->guiwin, gdw);
- //guiwin_set_toolbar(gdw->guiwin, tree, 0, 0);
+ guiwin_set_toolbar(gdw->guiwin, tree, 0, 0);
- //strncpy((char*)&gdw->lbl_file, filename, MAX_SLEN_LBL_FILE-1);
+ strncpy((char*)&gdw->lbl_file, filename, MAX_SLEN_LBL_FILE-1);
free( filename );
LOG(("created download: %s (total size: %d)",
gdw->destination, gdw->size_total
@@ -334,9 +340,8 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
curr.g_x = (desk_area.g_w / 2) - (curr.g_w / 2);
curr.g_y = (desk_area.g_h / 2) - (curr.g_h / 2);
- dbg_grect("download window", &curr);
-
wind_open_grect(gdw->aes_handle, &curr);
+ gdw->lastrdw = clock() / (CLOCKS_PER_SEC >> 3);
return(gdw);
}
@@ -345,9 +350,10 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
nserror gui_download_window_data(struct gui_download_window *dw,
const char *data, unsigned int size)
{
-
- uint32_t tnow = clock() / CLOCKS_PER_SEC;
- uint32_t sdiff = tnow - dw->start;
+
+ uint32_t clck = clock();
+ uint32_t tnow = clck / (CLOCKS_PER_SEC>>3);
+ uint32_t sdiff = (clck / (CLOCKS_PER_SEC)) - dw->start;
uint32_t p = 0;
float speed;
float pf = 0;
@@ -368,10 +374,8 @@ nserror gui_download_window_data(struct gui_download_window *dw,
fwrite( data , size, sizeof(unsigned char),dw->fd );
dw->size_downloaded += size;
- return NSERROR_OK;
-
- /* Update the progress bar... */
- if( tnow - dw->lastrdw > 1 ) {
+ /* Update GUI */
+ if ((tnow - dw->lastrdw) > 1) {
dw->lastrdw = tnow;
speed = dw->size_downloaded / sdiff;
@@ -406,14 +410,16 @@ void gui_download_window_error(struct gui_download_window *dw,
strncpy((char*)&dw->lbl_file, error_msg, MAX_SLEN_LBL_FILE-1);
dw->status = NSATARI_DOWNLOAD_ERROR;
guiwin_send_redraw(dw->guiwin, NULL);
- gui_window_set_status(input_window, messages_get("Done") );
+ gui_window_set_status(input_window, messages_get("Done") );
+ // TODO: change abort to close
}
void gui_download_window_done(struct gui_download_window *dw)
{
OBJECT * tree;
LOG((""));
-
+
+// TODO: change abort to close
dw->status = NSATARI_DOWNLOAD_COMPLETE;
if( dw->fd != NULL ) {
--
NetSurf Browser
10 years, 3 months
netsurf: branch master updated. 0d803b6c0d252c3a1a9fa07e37d9a0b08ce567b8
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/0d803b6c0d252c3a1a9fa...
...commit http://git.netsurf-browser.org/netsurf.git/commit/0d803b6c0d252c3a1a9fa07...
...tree http://git.netsurf-browser.org/netsurf.git/tree/0d803b6c0d252c3a1a9fa07e3...
The branch, master has been updated
via 0d803b6c0d252c3a1a9fa07e37d9a0b08ce567b8 (commit)
from e913a58ee77643b46138a3c9db37170ef2ed55af (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/0d803b6c0d252c3a1a9...
commit 0d803b6c0d252c3a1a9fa07e37d9a0b08ce567b8
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
add coment on superclasses
diff --git a/javascript/jsapi/htmlelement.bnd b/javascript/jsapi/htmlelement.bnd
index c5fc9a3..3ede93b 100644
--- a/javascript/jsapi/htmlelement.bnd
+++ b/javascript/jsapi/htmlelement.bnd
@@ -35,6 +35,78 @@ binding htmlelement {
type js_libdom; /* the binding type */
interface HTMLElement; /* Web IDL interface to generate */
+ /* superclasses
+
+ interface HTMLAnchorElement
+ interface HTMLAppletElement
+ interface HTMLAreaElement
+ interface HTMLBaseElement
+ interface HTMLBaseFontElement
+ interface HTMLBodyElement
+ interface HTMLBRElement
+ interface HTMLButtonElement
+ interface HTMLCanvasElement
+ interface HTMLCommandElement
+ interface HTMLDataElement
+ interface HTMLDataListElement
+ interface HTMLDetailsElement
+ interface HTMLDialogElement
+ interface HTMLDirectoryElement
+ interface HTMLDivElement
+ interface HTMLDListElement
+ interface HTMLEmbedElement
+ interface HTMLFieldSetElement
+ interface HTMLFontElement
+ interface HTMLFormElement
+ interface HTMLFrameElement
+ interface HTMLFrameSetElement
+ interface HTMLHeadElement
+ interface HTMLHeadingElement
+ interface HTMLHRElement
+ interface HTMLHtmlElement
+ interface HTMLIFrameElement
+ interface HTMLImageElement
+ interface HTMLInputElement
+ interface HTMLKeygenElement
+ interface HTMLLabelElement
+ interface HTMLLegendElement
+ interface HTMLLIElement
+ interface HTMLLinkElement
+ interface HTMLMapElement
+ interface HTMLMarqueeElement
+ interface HTMLMediaElement
+ interface HTMLMenuElement
+ interface HTMLMetaElement
+ interface HTMLMeterElement
+ interface HTMLModElement
+ interface HTMLObjectElement
+ interface HTMLOListElement
+ interface HTMLOptGroupElement
+ interface HTMLOptionElement
+ interface HTMLOutputElement
+ interface HTMLParagraphElement
+ interface HTMLParamElement
+ interface HTMLPreElement
+ interface HTMLProgressElement
+ interface HTMLQuoteElement
+ interface HTMLScriptElement
+ interface HTMLSelectElement
+ interface HTMLSourceElement
+ interface HTMLSpanElement
+ interface HTMLStyleElement
+ interface HTMLTableCaptionElement
+ interface HTMLTableCellElement
+ interface HTMLTableColElement
+ interface HTMLTableElement
+ interface HTMLTableRowElement
+ interface HTMLTableSectionElement
+ interface HTMLTextAreaElement
+ interface HTMLTimeElement
+ interface HTMLTitleElement
+ interface HTMLTrackElement
+ interface HTMLUListElement
+ interface HTMLUnknownElement
+ */
private "dom_element *" node;
private "struct html_content *" htmlc;
-----------------------------------------------------------------------
Summary of changes:
javascript/jsapi/htmlelement.bnd | 72 ++++++++++++++++++++++++++++++++++++++
1 files changed, 72 insertions(+), 0 deletions(-)
diff --git a/javascript/jsapi/htmlelement.bnd b/javascript/jsapi/htmlelement.bnd
index c5fc9a3..3ede93b 100644
--- a/javascript/jsapi/htmlelement.bnd
+++ b/javascript/jsapi/htmlelement.bnd
@@ -35,6 +35,78 @@ binding htmlelement {
type js_libdom; /* the binding type */
interface HTMLElement; /* Web IDL interface to generate */
+ /* superclasses
+
+ interface HTMLAnchorElement
+ interface HTMLAppletElement
+ interface HTMLAreaElement
+ interface HTMLBaseElement
+ interface HTMLBaseFontElement
+ interface HTMLBodyElement
+ interface HTMLBRElement
+ interface HTMLButtonElement
+ interface HTMLCanvasElement
+ interface HTMLCommandElement
+ interface HTMLDataElement
+ interface HTMLDataListElement
+ interface HTMLDetailsElement
+ interface HTMLDialogElement
+ interface HTMLDirectoryElement
+ interface HTMLDivElement
+ interface HTMLDListElement
+ interface HTMLEmbedElement
+ interface HTMLFieldSetElement
+ interface HTMLFontElement
+ interface HTMLFormElement
+ interface HTMLFrameElement
+ interface HTMLFrameSetElement
+ interface HTMLHeadElement
+ interface HTMLHeadingElement
+ interface HTMLHRElement
+ interface HTMLHtmlElement
+ interface HTMLIFrameElement
+ interface HTMLImageElement
+ interface HTMLInputElement
+ interface HTMLKeygenElement
+ interface HTMLLabelElement
+ interface HTMLLegendElement
+ interface HTMLLIElement
+ interface HTMLLinkElement
+ interface HTMLMapElement
+ interface HTMLMarqueeElement
+ interface HTMLMediaElement
+ interface HTMLMenuElement
+ interface HTMLMetaElement
+ interface HTMLMeterElement
+ interface HTMLModElement
+ interface HTMLObjectElement
+ interface HTMLOListElement
+ interface HTMLOptGroupElement
+ interface HTMLOptionElement
+ interface HTMLOutputElement
+ interface HTMLParagraphElement
+ interface HTMLParamElement
+ interface HTMLPreElement
+ interface HTMLProgressElement
+ interface HTMLQuoteElement
+ interface HTMLScriptElement
+ interface HTMLSelectElement
+ interface HTMLSourceElement
+ interface HTMLSpanElement
+ interface HTMLStyleElement
+ interface HTMLTableCaptionElement
+ interface HTMLTableCellElement
+ interface HTMLTableColElement
+ interface HTMLTableElement
+ interface HTMLTableRowElement
+ interface HTMLTableSectionElement
+ interface HTMLTextAreaElement
+ interface HTMLTimeElement
+ interface HTMLTitleElement
+ interface HTMLTrackElement
+ interface HTMLUListElement
+ interface HTMLUnknownElement
+ */
private "dom_element *" node;
private "struct html_content *" htmlc;
--
NetSurf Browser
10 years, 3 months