From 71577f214da0e53b845b0c0a41496b0f1d0eead5 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 28 Nov 2012 22:08:11 +0000 Subject: [PATCH 01/75] use macro to compare --- javascript/jsapi/window.bnd | 46 +++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/javascript/jsapi/window.bnd b/javascript/jsapi/window.bnd index 610aa71ab..7ad54dbac 100644 --- a/javascript/jsapi/window.bnd +++ b/javascript/jsapi/window.bnd @@ -225,37 +225,33 @@ 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; + exc = dom_event_get_type(event_private->event, &type_dom); + if (exc == DOM_NO_ERR) { - 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 (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); - } + if (JSVAL_IS_VOID(eventval)) { + event_argv[0] = eventval; + jsret = JS_CallFunctionValue(cx, NULL, eventval, 1, event_argv, &event_rval); } } - } + } %} getter EventHandler %{ From 4865886721f76373cf9902f5c3fe2f159a375ee6 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 28 Nov 2012 22:35:40 +0000 Subject: [PATCH 02/75] fix logic --- javascript/jsapi/window.bnd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/jsapi/window.bnd b/javascript/jsapi/window.bnd index 7ad54dbac..56b2ff090 100644 --- a/javascript/jsapi/window.bnd +++ b/javascript/jsapi/window.bnd @@ -246,7 +246,7 @@ operation dispatchEvent %{ JS_GetProperty(cx, JSAPI_THIS_OBJECT(cx, vp), "onload", &eventval); } - if (JSVAL_IS_VOID(eventval)) { + if (!JSVAL_IS_VOID(eventval)) { event_argv[0] = eventval; jsret = JS_CallFunctionValue(cx, NULL, eventval, 1, event_argv, &event_rval); } From d80bb6210dcad46997b190793efa5d472a1809c1 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 28 Nov 2012 22:41:20 +0000 Subject: [PATCH 03/75] add missing include --- render/html.c | 1 + 1 file changed, 1 insertion(+) diff --git a/render/html.c b/render/html.c index fc6084332..f90d1ee18 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" From 168d09c8780de36daa580a2b584059e37744b53b Mon Sep 17 00:00:00 2001 From: Chris Young Date: Wed, 28 Nov 2012 22:42:23 +0000 Subject: [PATCH 04/75] Improve the look of the hotlist toolbar --- amiga/gui.c | 11 ++++++++++- amiga/gui.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/amiga/gui.c b/amiga/gui.c index 064c49cbd..2cbceac1e 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -2495,11 +2495,20 @@ void ami_gui_hotlist_toolbar_add(struct gui_window_2 *gwin) SpeedBarObject, GA_ID, GID_HOTLIST, GA_RelVerify, TRUE, + 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); + + IDoMethod(gwin->objects[GID_HOTLISTLAYOUT], LM_ADDIMAGE, + gwin->win, gwin->objects[GID_HOTLISTSEPBAR], NULL); } FlushLayoutDomainCache((struct Gadget *)gwin->objects[GID_MAIN]); @@ -2977,7 +2986,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, diff --git a/amiga/gui.h b/amiga/gui.h index 59c60f4c9..14cec107d 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 }; From d66e9c34a8e5e6081541c2b7bfd1e97012289494 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 29 Nov 2012 22:08:47 +0000 Subject: [PATCH 05/75] Create "menu" and "toolbar" directories in the hotlist if they don't exist on startup --- amiga/hotlist.c | 37 ++++++++++++++++++++++++++++++++++++- resources/FatMessages | 13 +++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/amiga/hotlist.c b/amiga/hotlist.c index 6469cbd90..b67e10fd4 100755 --- a/amiga/hotlist.c +++ b/amiga/hotlist.c @@ -18,8 +18,41 @@ #include #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, false, false); + } + + if(ami_hotlist_find_dir(tree, messages_get("HotlistToolbar")) == false) { + tree_create_folder_node(tree, tree_get_root(tree), + messages_get("HotlistToolbar"), true, false, 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/resources/FatMessages b/resources/FatMessages index 45b308662..e8f22aaf0 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:Hotlist menu +nl.ami.HotlistMenu:Hotlist menu +en.ami.HotlistToolbar:Hotlist toolbar +de.ami.HotlistToolbar:Hotlist toolbar +fr.ami.HotlistToolbar:Hotlist toolbar +it.ami.HotlistToolbar:Hotlist toolbar +nl.ami.HotlistToolbar:Hotlist toolbar + # Global history user interface tokens # ==================================== From 23dc635e1a2386d52779384d6117f020376142f7 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 29 Nov 2012 22:13:42 +0000 Subject: [PATCH 06/75] Make hotlist toolbar work and update (only updates on hotlist window close currently) --- amiga/gui.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++- amiga/gui.h | 1 + amiga/menu.c | 6 ++-- amiga/tree.c | 2 ++ 4 files changed, 105 insertions(+), 4 deletions(-) diff --git a/amiga/gui.c b/amiga/gui.c index 2cbceac1e..93ee08282 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -1600,6 +1600,14 @@ void ami_handle_msg(void) browser_window_go(gwin->bw,(char *)storage, NULL, true); break; + case GID_HOTLIST: + GetAttrs(gwin->objects[GID_HOTLIST], + SPEEDBAR_SelectedNode, &tabnode, TAG_DONE); + GetSpeedButtonNodeAttrs(tabnode, SBNA_UserData, (ULONG *)&storage, TAG_DONE); + + browser_window_go(gwin->bw, (char *)storage, NULL, true); + break; + case GID_HOME: browser_window_go(gwin->bw,nsoption_charp(homepage_url),NULL,true); break; @@ -2477,7 +2485,7 @@ int ami_gui_hotlist_scan(struct tree *tree, struct List *speed_button_list, stru { 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); } @@ -2509,12 +2517,100 @@ void ami_gui_hotlist_toolbar_add(struct gui_window_2 *gwin) 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); } +} + +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; + + ami_gui_hotlist_toolbar_free(gwin, &gwin->hotlist_toolbar_list); +} + +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) @@ -3305,6 +3401,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]); diff --git a/amiga/gui.h b/amiga/gui.h index 14cec107d..6a5434f87 100755 --- a/amiga/gui.h +++ b/amiga/gui.h @@ -153,6 +153,7 @@ 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); struct TextFont *origrpfont; struct MinList *window_list; diff --git a/amiga/menu.c b/amiga/menu.c index b116e1b39..f42860612 100755 --- a/amiga/menu.c +++ b/amiga/menu.c @@ -506,17 +506,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; diff --git a/amiga/tree.c b/amiga/tree.c index f2ef3cc83..95a68dc20 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) From 61872ab3a493d60ede0e5ca2221b4c5c94708171 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 29 Nov 2012 22:44:30 +0000 Subject: [PATCH 07/75] Debug --- amiga/gui.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/amiga/gui.c b/amiga/gui.c index 93ee08282..7482b4b71 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -1206,6 +1206,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)) { @@ -1601,11 +1602,13 @@ void ami_handle_msg(void) break; case GID_HOTLIST: - GetAttrs(gwin->objects[GID_HOTLIST], - SPEEDBAR_SelectedNode, &tabnode, TAG_DONE); - GetSpeedButtonNodeAttrs(tabnode, SBNA_UserData, (ULONG *)&storage, TAG_DONE); - - browser_window_go(gwin->bw, (char *)storage, NULL, true); + GetAttr(SPEEDBAR_SelectedNode, + (Object *)gwin->objects[GID_HOTLIST], + (ULONG *)&tabnode); + printf("%lx %d\n", tabnode, code); + GetSpeedButtonNodeAttrs(tabnode, SBNA_UserData, (ULONG *)&url, TAG_DONE); + printf("%s\n", url); + browser_window_go(gwin->bw, url, NULL, true); break; case GID_HOME: From 31c9ffb4b51b79394f882e5efed629c2df0600d9 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 30 Nov 2012 12:29:54 +0000 Subject: [PATCH 08/75] make boxes keep reference to the DOM node that causes them --- render/box.c | 10 ++++++++-- render/box.h | 2 ++ render/box_construct.c | 5 ++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/render/box.c b/render/box.c index b9d059858..5dfada0c0 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 a4622e374..0953d9f88 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 63575876e..52c8cfee5 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 || From ffcb07b8b2a4d5096d8bd794b1b34c5ffdfd5b17 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 1 Dec 2012 00:27:46 +0000 Subject: [PATCH 09/75] Make hotlist toolbar actually work --- amiga/gui.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/amiga/gui.c b/amiga/gui.c index 7482b4b71..92ad3542a 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -1601,16 +1601,6 @@ void ami_handle_msg(void) browser_window_go(gwin->bw,(char *)storage, NULL, true); break; - case GID_HOTLIST: - GetAttr(SPEEDBAR_SelectedNode, - (Object *)gwin->objects[GID_HOTLIST], - (ULONG *)&tabnode); - printf("%lx %d\n", tabnode, code); - GetSpeedButtonNodeAttrs(tabnode, SBNA_UserData, (ULONG *)&url, TAG_DONE); - printf("%s\n", url); - browser_window_go(gwin->bw, url, NULL, true); - break; - case GID_HOME: browser_window_go(gwin->bw,nsoption_charp(homepage_url),NULL,true); break; @@ -1644,6 +1634,7 @@ void ami_handle_msg(void) ami_gui_history(gwin, false); break; + case GID_HOTLIST: default: // printf("GADGET: %ld\n",(result & WMHI_GADGETMASK)); break; @@ -2506,6 +2497,7 @@ 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; @@ -4283,6 +4275,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) { @@ -4299,6 +4293,13 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg gwin->redraw_required = true; break; + + case GID_HOTLIST: + if(node = GetTagData(SPEEDBAR_SelectedNode, 0, msg->IAddress)) { + GetSpeedButtonNodeAttrs(node, SBNA_UserData, (ULONG *)&url, TAG_DONE); + browser_window_go(gwin->bw, url, NULL, true); + } + break; } break; From 1e2cc766cdb16f1a5ef3201df5601ffbc22a8bc8 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 1 Dec 2012 00:29:53 +0000 Subject: [PATCH 10/75] Update documentation --- amiga/dist/NetSurf.guide | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/amiga/dist/NetSurf.guide b/amiga/dist/NetSurf.guide index b39ea3d3e..f1536a233 100755 --- a/amiga/dist/NetSurf.guide +++ b/amiga/dist/NetSurf.guide @@ -182,9 +182,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. From ee79de52446499e56ff6986af1c08d866fd670d5 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 1 Dec 2012 15:15:12 +0000 Subject: [PATCH 11/75] Attempt to do some re-layout if the toolbar is added after the window opens. --- amiga/gui.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/amiga/gui.c b/amiga/gui.c index 92ad3542a..6efa99ab4 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -2517,6 +2517,11 @@ void ami_gui_hotlist_toolbar_add(struct gui_window_2 *gwin) RethinkLayout((struct Gadget *)gwin->objects[GID_MAIN], gwin->win, NULL, TRUE); + + if(gwin->win) { + gwin->redraw_required = true; + gwin->bw->reformat_pending = true; + } } } @@ -4295,7 +4300,7 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg break; case GID_HOTLIST: - if(node = GetTagData(SPEEDBAR_SelectedNode, 0, msg->IAddress)) { + if(node = (struct Node *)GetTagData(SPEEDBAR_SelectedNode, 0, msg->IAddress)) { GetSpeedButtonNodeAttrs(node, SBNA_UserData, (ULONG *)&url, TAG_DONE); browser_window_go(gwin->bw, url, NULL, true); } From c88c4fa214b3dd23b8f68fe35d9c8eb738d80976 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 1 Dec 2012 15:23:11 +0000 Subject: [PATCH 12/75] Don't need to attempt to free on remove, as the only entry point has already done this. --- amiga/gui.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/amiga/gui.c b/amiga/gui.c index 6efa99ab4..9fa83e1d1 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -2563,8 +2563,6 @@ void ami_gui_hotlist_toolbar_remove(struct gui_window_2 *gwin) gwin->redraw_required = true; gwin->bw->reformat_pending = true; - - ami_gui_hotlist_toolbar_free(gwin, &gwin->hotlist_toolbar_list); } void ami_gui_hotlist_toolbar_update(struct gui_window_2 *gwin) From 22fbe5abfc2797ebba6f330a48b3b6d2ec2058a3 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 1 Dec 2012 15:54:32 +0000 Subject: [PATCH 13/75] Set the newly-created hotlist dirs to be "retain in memory" otherwise NetSurf crashes on hotlist cleanup. --- amiga/hotlist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amiga/hotlist.c b/amiga/hotlist.c index b67e10fd4..c82b92f72 100755 --- a/amiga/hotlist.c +++ b/amiga/hotlist.c @@ -45,12 +45,12 @@ 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, false, false); + 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, false, false); + messages_get("HotlistToolbar"), true, true, false); } } From 30528647735b5bcb689427b3a865f78c57a6070c Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 3 Dec 2012 17:09:44 +0000 Subject: [PATCH 14/75] issue click events at dom --- javascript/js.h | 5 +++- javascript/jsapi.c | 48 +++++++++++++++++++++++++++++++-------- render/html.c | 2 +- render/html_interaction.c | 27 ++++++++++++++++------ test/js/event-onload.html | 10 ++++---- 5 files changed, 70 insertions(+), 22 deletions(-) diff --git a/javascript/js.h b/javascript/js.h index 4dd8f15d3..d7943b1b7 100644 --- a/javascript/js.h +++ b/javascript/js.h @@ -51,7 +51,10 @@ 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); +typedef struct dom_document dom_document; +typedef struct dom_node dom_node; + /* 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, dom_document *doc, dom_node *target); #endif /* _NETSURF_JAVASCRIPT_JS_H_ */ diff --git a/javascript/jsapi.c b/javascript/jsapi.c index bec565316..e5b4ddf6e 100644 --- a/javascript/jsapi.c +++ b/javascript/jsapi.c @@ -153,7 +153,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 +165,23 @@ bool js_fire_event(jscontext *ctx, const char *type, void *target) dom_event *event; dom_string *type_dom; - if (node == NULL) { - /* deliver to window */ - if (cx == NULL) { - return false; - } + if (cx == NULL) { + return false; + } - exc = dom_string_create((unsigned char*)type, strlen(type), &type_dom); + if (node == NULL) { + /* deliver manufactured event to window */ + JSLOG("Dispatching event %s at window", type); + + /* 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,6 +197,7 @@ 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, @@ -200,7 +206,31 @@ bool js_fire_event(jscontext *ctx, const char *type, void *target) 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; diff --git a/render/html.c b/render/html.c index f90d1ee18..812c6909b 100644 --- a/render/html.c +++ b/render/html.c @@ -336,7 +336,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)); diff --git a/render/html_interaction.c b/render/html_interaction.c index 2b6bc9aa0..8dd613bdf 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,14 +400,17 @@ 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) { + 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) continue; + if (box->node != NULL) { + node = box->node; + } + if (box->object) { if (content_get_type(box->object) == CONTENT_HTML) { html_object_box = box; @@ -447,11 +453,12 @@ void html_mouse_action(struct content *c, struct browser_window *bw, 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 (drag_candidate == NULL) { + drag_candidate = box; + } + padding_left = box_x + scrollbar_get_offset(box->scroll_x); padding_right = padding_left + box->padding[LEFT] + @@ -842,6 +849,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/test/js/event-onload.html b/test/js/event-onload.html index aede985a4..cd9e70543 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. ")); } @@ -19,10 +17,14 @@ para.appendChild(newtext);

First line of paragraph.


- + From 70ece8a428de80d2efacef58d4a2ec259def54b8 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 3 Dec 2012 17:34:03 +0000 Subject: [PATCH 15/75] add stub implemntation for event handling in elements --- javascript/js.h | 6 +++--- javascript/jsapi/htmlelement.bnd | 25 +++++++++++++++++++++++++ javascript/jsapi/window.bnd | 8 ++++++-- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/javascript/js.h b/javascript/js.h index d7943b1b7..643ce5a56 100644 --- a/javascript/js.h +++ b/javascript/js.h @@ -51,10 +51,10 @@ 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); -typedef struct dom_document dom_document; -typedef struct dom_node dom_node; +struct dom_document; +struct dom_node; /* fire an event at a dom node */ -bool js_fire_event(jscontext *ctx, const char *type, dom_document *doc, dom_node *target); +bool js_fire_event(jscontext *ctx, const char *type, struct dom_document *doc, struct dom_node *target); #endif /* _NETSURF_JAVASCRIPT_JS_H_ */ diff --git a/javascript/jsapi/htmlelement.bnd b/javascript/jsapi/htmlelement.bnd index 71bb31bc1..15fe83e9c 100644 --- a/javascript/jsapi/htmlelement.bnd +++ b/javascript/jsapi/htmlelement.bnd @@ -36,6 +36,8 @@ binding htmlelement { private "dom_element *" node; private "struct html_content *" htmlc; + + property unshared type EventHandler; } api finalise %{ @@ -214,3 +216,26 @@ getter childElementCount %{ } } %} + +getter EventHandler %{ + JSLOG("propname[%d]=\"%s\"", + tinyid, + jsclass_properties[tinyid].name); +%} + +setter EventHandler %{ + JSLOG("propname[%d]=\"%s\"", + tinyid, + jsclass_properties[tinyid].name); + +/* +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) + + */ + +%} diff --git a/javascript/jsapi/window.bnd b/javascript/jsapi/window.bnd index 56b2ff090..d7f47ce44 100644 --- a/javascript/jsapi/window.bnd +++ b/javascript/jsapi/window.bnd @@ -258,12 +258,16 @@ 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); %} From 878fe3e68cbda4f3d51cce7bc3b0ffcc27135367 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 3 Dec 2012 17:53:14 +0000 Subject: [PATCH 16/75] fix disabled javascript function signature --- javascript/none.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/none.c b/javascript/none.c index 6354a12ff..3e7b39cb3 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; } From 897acff532415ed81f9066b8b811ae744918da84 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Tue, 4 Dec 2012 18:01:11 +0000 Subject: [PATCH 17/75] make events work on elements --- javascript/js.h | 14 +- javascript/jsapi.c | 120 +++++++++++++-- javascript/jsapi/htmlelement.bnd | 246 +++++++++++++++++++++++++++++-- test/js/event-onclick.html | 30 ++++ test/js/index.html | 19 ++- 5 files changed, 400 insertions(+), 29 deletions(-) create mode 100644 test/js/event-onclick.html diff --git a/javascript/js.h b/javascript/js.h index 643ce5a56..44de4fe3d 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,10 +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); -struct dom_document; -struct dom_node; /* fire an event at a dom node */ 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 e5b4ddf6e..eebb33fee 100644 --- a/javascript/jsapi.c +++ b/javascript/jsapi.c @@ -32,7 +32,7 @@ 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); @@ -97,7 +97,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 +116,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 +139,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, "", 0, &rval) == JS_TRUE) { return true; @@ -174,8 +174,8 @@ bool js_fire_event(jscontext *ctx, const char *type, dom_document *doc, dom_node JSLOG("Dispatching event %s at window", type); /* create and initialise and event object */ - exc = dom_string_create((unsigned char*)type, - strlen(type), + exc = dom_string_create((unsigned char*)type, + strlen(type), &type_dom); if (exc != DOM_NO_ERR) { return false; @@ -200,18 +200,18 @@ bool js_fire_event(jscontext *ctx, const char *type, dom_document *doc, dom_node /* 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), + exc = dom_string_create((unsigned char*)type, + strlen(type), &type_dom); if (exc != DOM_NO_ERR) { return false; @@ -237,3 +237,93 @@ bool js_fire_event(jscontext *ctx, const char *type, dom_document *doc, dom_node } 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); + + JS_AddValueRoot(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"); + JS_RemoveValueRoot(cx, &private->funcval); + } + + return true; +} diff --git a/javascript/jsapi/htmlelement.bnd b/javascript/jsapi/htmlelement.bnd index 15fe83e9c..e1bd2c813 100644 --- a/javascript/jsapi/htmlelement.bnd +++ b/javascript/jsapi/htmlelement.bnd @@ -23,7 +23,9 @@ 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" @@ -218,24 +220,248 @@ getter childElementCount %{ %} getter EventHandler %{ - JSLOG("propname[%d]=\"%s\"", + JSLOG("propname[%d].name=\"%s\"", tinyid, jsclass_properties[tinyid].name); %} + setter EventHandler %{ - JSLOG("propname[%d]=\"%s\"", - tinyid, + dom_string *event_type_dom; + + JSLOG("propname[%d].name=\"%s\"", + tinyid, jsclass_properties[tinyid].name); -/* -1. Create a dom_event_listener From a handle_event function pointer - and a private word In a document context + switch (tinyid) { + case JSAPI_PROP_TINYID_onabort: + event_type_dom = corestring_dom_abort; + break; -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) + 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/test/js/event-onclick.html b/test/js/event-onclick.html new file mode 100644 index 000000000..b2060e517 --- /dev/null +++ b/test/js/event-onclick.html @@ -0,0 +1,30 @@ + + +alert onclick example + + + + + +
+

First line of paragraph.

+

+ + + + + + + diff --git a/test/js/index.html b/test/js/index.html index 7a17c95d3..bb2918cac 100644 --- a/test/js/index.html +++ b/test/js/index.html @@ -5,12 +5,15 @@

JavaScript Tests

+ +

Window

+

Document write

+

DOM tests

+

Reference method tests

+

Enumeration tests

+

Document element specific

+ + +

Dom events

+ + +

Assorted

+ From 0718d809180b1bff9c83f4475be4cb918a8564e2 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Tue, 4 Dec 2012 18:15:14 +0000 Subject: [PATCH 18/75] abstract out GC root manipulation for js values --- javascript/jsapi.c | 4 ++-- javascript/jsapi.h | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/javascript/jsapi.c b/javascript/jsapi.c index eebb33fee..73153fe09 100644 --- a/javascript/jsapi.c +++ b/javascript/jsapi.c @@ -315,14 +315,14 @@ js_dom_event_add_listener(jscontext *ctx, JSLOG("adding %p to listener", private); - JS_AddValueRoot(cx, &private->funcval); + 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"); - JS_RemoveValueRoot(cx, &private->funcval); + JSAPI_REMOVE_VALUE_ROOT(cx, &private->funcval); } return true; diff --git a/javascript/jsapi.h b/javascript/jsapi.h index 6b0f1124d..04932905e 100644 --- a/javascript/jsapi.h +++ b/javascript/jsapi.h @@ -150,6 +150,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 +266,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 +371,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)) From 61723e01c1beed8591d877c92035b65c448f46df Mon Sep 17 00:00:00 2001 From: Chris Young Date: Wed, 5 Dec 2012 18:14:45 +0000 Subject: [PATCH 19/75] Avoid NULL pointer access --- amiga/gui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amiga/gui.c b/amiga/gui.c index 9fa83e1d1..c71afde71 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -2518,7 +2518,7 @@ void ami_gui_hotlist_toolbar_add(struct gui_window_2 *gwin) RethinkLayout((struct Gadget *)gwin->objects[GID_MAIN], gwin->win, NULL, TRUE); - if(gwin->win) { + if(gwin->bw) { gwin->redraw_required = true; gwin->bw->reformat_pending = true; } From 646aed64ff07fa356f8aef034e77792cf634b053 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 6 Dec 2012 18:04:43 +0000 Subject: [PATCH 20/75] change to parameterised parser binding creation --- render/html.c | 136 +++++++++++++++---------------------------------- utils/libdom.c | 82 ++++++++++++++++++++++++++--- utils/libdom.h | 14 ++++- 3 files changed, 130 insertions(+), 102 deletions(-) diff --git a/render/html.c b/render/html.c index 812c6909b..0b2c54365 100644 --- a/render/html.c +++ b/render/html.c @@ -112,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) { @@ -371,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; @@ -424,36 +372,37 @@ 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; + + 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; @@ -510,6 +459,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; @@ -539,15 +489,18 @@ 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; + /* 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); @@ -555,21 +508,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); + error = dom_hubbub_parser_create(&parse_params, + &html->parser, + &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; + if (error != DOM_HUBBUB_OK) { + return libdom_hubbub_error_to_nserror(error); } } @@ -584,7 +530,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); } @@ -603,7 +549,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) { @@ -1993,7 +1939,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/utils/libdom.c b/utils/libdom.c index 3b6cd15b1..ebb90eeb4 100644 --- a/utils/libdom.c +++ b/utils/libdom.c @@ -22,7 +22,6 @@ #include #include -#include #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,17 @@ 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; + + 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 +367,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 d79c92d81..36caf01bf 100644 --- a/utils/libdom.h +++ b/utils/libdom.h @@ -28,7 +28,11 @@ #include -/* depth-first walk the dom calling callback for each element +#include +#include + +/** + * 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 From 912b9de92808c43a78680d41bba1ad982e120d86 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 6 Dec 2012 19:33:25 +0000 Subject: [PATCH 21/75] ensure default action fetcher is set to NULL --- render/html.c | 2 ++ utils/libdom.c | 1 + 2 files changed, 3 insertions(+) diff --git a/render/html.c b/render/html.c index 0b2c54365..19ea5a9d0 100644 --- a/render/html.c +++ b/render/html.c @@ -378,6 +378,7 @@ html_create_html_data(html_content *c, const http_parameter *params) 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, @@ -495,6 +496,7 @@ html_process_encoding_change(struct content *c, 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 */ error = dom_hubbub_parser_create(&parse_params, diff --git a/utils/libdom.c b/utils/libdom.c index ebb90eeb4..9e7e7761a 100644 --- a/utils/libdom.c +++ b/utils/libdom.c @@ -343,6 +343,7 @@ nserror libdom_parse_file(const char *filename, const char *encoding, dom_docume 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) { From 40076ea422458fde1799fd383b475586ee112c3f Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 6 Dec 2012 23:40:13 +0000 Subject: [PATCH 22/75] Allow the size of the web search gadget to be user-set --- amiga/dist/NetSurf.guide | 1 + amiga/gui.c | 2 +- amiga/options.h | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/amiga/dist/NetSurf.guide b/amiga/dist/NetSurf.guide index f1536a233..8759b2b24 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. diff --git a/amiga/gui.c b/amiga/gui.c index c71afde71..a1a9468f0 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -3064,7 +3064,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, diff --git a/amiga/options.h b/amiga/options.h index 5e4777896..957f389ec 100644 --- a/amiga/options.h +++ b/amiga/options.h @@ -74,6 +74,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; \ @@ -136,6 +137,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, \ @@ -197,6 +199,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}, \ From 99f93da0f3a510df51c5a057e7597c570a636f9d Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 7 Dec 2012 12:08:56 +0000 Subject: [PATCH 23/75] correctly handle location --- javascript/jsapi.h | 2 +- javascript/jsapi/htmldocument.bnd | 16 +++++++++++++++ javascript/jsapi/window.bnd | 33 +++++++++++++------------------ 3 files changed, 31 insertions(+), 20 deletions(-) diff --git a/javascript/jsapi.h b/javascript/jsapi.h index 04932905e..d757b7fda 100644 --- a/javascript/jsapi.h +++ b/javascript/jsapi.h @@ -79,7 +79,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)) diff --git a/javascript/jsapi/htmldocument.bnd b/javascript/jsapi/htmldocument.bnd index 0ed7ac153..72bc81482 100644 --- a/javascript/jsapi/htmldocument.bnd +++ b/javascript/jsapi/htmldocument.bnd @@ -43,6 +43,9 @@ binding document { */ private "dom_document *" node; private "struct html_content *" htmlc; + + /** location instantiated on first use */ + property unshared location; } api finalise %{ @@ -53,6 +56,19 @@ 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, + private->htmlc->bw, + llcache_handle_get_url(private->htmlc->base.llcache)); +%} + + getter cookie %{ char *cookie_str; cookie_str = urldb_get_cookie(llcache_handle_get_url(private->htmlc->base.llcache), false); diff --git a/javascript/jsapi/window.bnd b/javascript/jsapi/window.bnd index d7f47ce44..6153e90aa 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 @@ -254,6 +235,20 @@ operation dispatchEvent %{ } %} +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. From 04825c62df92c8adef3f40f89c7b5d88b963f833 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 7 Dec 2012 15:50:24 +0000 Subject: [PATCH 24/75] implement document.URL and document.documentURI --- javascript/jsapi/binding.h | 4 ++-- javascript/jsapi/htmldocument.bnd | 22 ++++++++++++++++++++-- javascript/jsapi/location.bnd | 12 ++++++++++-- test/js/document-url.html | 31 +++++++++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 test/js/document-url.html diff --git a/javascript/jsapi/binding.h b/javascript/jsapi/binding.h index f27493532..7b0f61428 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/htmldocument.bnd b/javascript/jsapi/htmldocument.bnd index 72bc81482..f17190d0c 100644 --- a/javascript/jsapi/htmldocument.bnd +++ b/javascript/jsapi/htmldocument.bnd @@ -56,6 +56,7 @@ api finalise %{ } %} + getter location %{ if (!JSVAL_IS_VOID(JSAPI_PROP_RVAL(cx,vp))) { /* already created - return it */ @@ -64,10 +65,27 @@ getter location %{ jsret = jsapi_new_Location(cx, NULL, NULL, - private->htmlc->bw, - llcache_handle_get_url(private->htmlc->base.llcache)); + 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; diff --git a/javascript/jsapi/location.bnd b/javascript/jsapi/location.bnd index 32e38da93..32677d1b5 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/test/js/document-url.html b/test/js/document-url.html new file mode 100644 index 000000000..2299b5775 --- /dev/null +++ b/test/js/document-url.html @@ -0,0 +1,31 @@ + + +document location and URL interface + + + +

document location and URL interface

+ +

Document location enumeration

+ +

Document URL

+ +

DocumentURI

+ + + From 69647cc6a4f230fc0c1ce5481a30ac21c93db8d2 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Fri, 7 Dec 2012 23:35:57 +0000 Subject: [PATCH 25/75] Respond to Ctrl-C by immediately quitting. TCP/IP stack exit expects this. --- amiga/gui.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/amiga/gui.c b/amiga/gui.c index a1a9468f0..47d75bcd0 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -2108,11 +2108,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); /* @@ -2144,6 +2145,11 @@ printf("sig recvd %ld (%ld %ld %ld %ld %ld %ld)\n", signal, winsignal , appsig , schedule_run(FALSE); } } + + if(signal & ctrlcsig) + { + ami_quit_netsurf(); + } } void gui_poll(bool active) From ffac64fcea44e2840cef67ec2d5bdc6ef0b4b268 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 8 Dec 2012 17:25:25 +0000 Subject: [PATCH 26/75] Move download overwrite warning requester to misc.c --- amiga/download.c | 21 +++------------------ amiga/misc.c | 21 +++++++++++++++++++++ amiga/misc.h | 1 + 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/amiga/download.c b/amiga/download.c index d5071d31f..434d12ee8 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" @@ -415,24 +416,8 @@ 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, "DontReplace", "Replace", 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; diff --git a/amiga/misc.c b/amiga/misc.c index 8e8fa76d0..b5da1787f 100755 --- a/amiga/misc.c +++ b/amiga/misc.c @@ -71,6 +71,27 @@ void warn_user(const char *warning, const char *detail) if(utf8warning) free(utf8warning); } +int 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); +} + void die(const char *error) { TimedDosRequesterTags(TDR_ImageType,TDRIMAGE_ERROR, diff --git a/amiga/misc.h b/amiga/misc.h index c863c7966..e76d6a3b4 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); +int ami_warn_user_multi(const char *body, const char *opt1, const char *opt2, struct Window *win); #endif From ff333828b70a5d31b9efe1c7b2df3216478722a3 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 8 Dec 2012 17:47:57 +0000 Subject: [PATCH 27/75] Warn when closing multiple tabs --- amiga/download.c | 2 +- amiga/gui.c | 10 +++++++++- amiga/misc.c | 4 +++- amiga/misc.h | 2 +- amiga/options.h | 3 +++ resources/FatMessages | 5 +++++ 6 files changed, 22 insertions(+), 4 deletions(-) diff --git a/amiga/download.c b/amiga/download.c index 434d12ee8..224ac29db 100644 --- a/amiga/download.c +++ b/amiga/download.c @@ -390,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; diff --git a/amiga/gui.c b/amiga/gui.c index 47d75bcd0..66aca159e 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -3316,7 +3316,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, "No", "Yes", gwin->win); + free(req_body); + + if(res == 1) return; + } + if(gwin->tabs) { tab = GetHead(&gwin->tab_list); diff --git a/amiga/misc.c b/amiga/misc.c index b5da1787f..4359c79b5 100755 --- a/amiga/misc.c +++ b/amiga/misc.c @@ -71,7 +71,7 @@ void warn_user(const char *warning, const char *detail) if(utf8warning) free(utf8warning); } -int ami_warn_user_multi(const char *body, const char *opt1, const char *opt2, struct Window *win) +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); @@ -90,6 +90,8 @@ int ami_warn_user_multi(const char *body, const char *opt1, const char *opt2, st if(utf8text) free(utf8text); if(utf8gadgets) FreeVec(utf8gadgets); + + return res; } void die(const char *error) diff --git a/amiga/misc.h b/amiga/misc.h index e76d6a3b4..34a85fa90 100644 --- a/amiga/misc.h +++ b/amiga/misc.h @@ -19,5 +19,5 @@ #ifndef AMIGA_MISC_H #define AMIGA_MISC_H char *translate_escape_chars(const char *s); -int ami_warn_user_multi(const char *body, const char *opt1, const char *opt2, struct Window *win); +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 957f389ec..4b477b66c 100644 --- a/amiga/options.h +++ b/amiga/options.h @@ -39,6 +39,7 @@ bool use_openurl_lib; \ bool new_tab_active; \ bool new_tab_last; \ + bool tab_close_warn; \ bool kiosk_mode; \ char *search_engines_file; \ char *arexx_dir; \ @@ -102,6 +103,7 @@ .use_openurl_lib = false, \ .new_tab_active = false, \ .new_tab_last = false, \ + .tab_close_warn = true, \ .kiosk_mode = false, \ .search_engines_file = NULL, \ .arexx_dir = NULL, \ @@ -164,6 +166,7 @@ { "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}, \ { "kiosk_mode", OPTION_BOOL, &nsoptions.kiosk_mode}, \ { "search_engines_file",OPTION_STRING, &nsoptions.search_engines_file }, \ { "arexx_dir", OPTION_STRING, &nsoptions.arexx_dir }, \ diff --git a/resources/FatMessages b/resources/FatMessages index e8f22aaf0..d7bda1a23 100644 --- a/resources/FatMessages +++ b/resources/FatMessages @@ -2675,6 +2675,11 @@ 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:Are you sure you want to close multiple tabs? +nl.ami.MultiTabClose:Are you sure you want to close multiple tabs? # Queries # ======= From dfa287767fee79f479b4cf0d8d69431febc5e934 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 8 Dec 2012 18:08:00 +0000 Subject: [PATCH 28/75] Warn the user and give them an option to stop NetSurf shutting down, if the TCP/IP stack has signalled that it is about to exit. --- amiga/gui.c | 27 ++++++++++++++++++++++++++- resources/FatMessages | 11 +++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/amiga/gui.c b/amiga/gui.c index 66aca159e..1d523e65b 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, @@ -2148,7 +2149,7 @@ printf("sig recvd %ld (%ld %ld %ld %ld %ld %ld)\n", signal, winsignal , appsig , if(signal & ctrlcsig) { - ami_quit_netsurf(); + ami_quit_netsurf_delayed(); } } @@ -2308,6 +2309,30 @@ void ami_quit_netsurf(void) } } +void ami_quit_netsurf_delayed(void) +{ + char *utf8text = ami_utf8_easy(messages_get("TCPIPShutdown")); + char *utf8gadgets = ami_utf8_easy(messages_get("AbortShutdown")); + + DisplayBeep(NULL); + + int32 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); + + 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; diff --git a/resources/FatMessages b/resources/FatMessages index d7bda1a23..075a1e98f 100644 --- a/resources/FatMessages +++ b/resources/FatMessages @@ -2680,6 +2680,17 @@ 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:Are you sure you want to close multiple tabs? 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.\n\nNetSurf 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.\n\nNetSurf 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.\n\nNetSurf will quit in 5 seconds unless this shutdown is aborted. +it.ami.TCPIPShutdown:The TCP/IP stack has signalled that it is about to shutdown and NetSurf must exit.\n\nNetSurf will quit in 5 seconds unless this shutdown is aborted. +nl.ami.TCPIPShutdown:The TCP/IP stack has signalled that it is about to shutdown and NetSurf must exit.\n\nNetSurf 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:Abort shutdown +nl.ami.AbortShutdown:Abort shutdown + # Queries # ======= From c8b3fbbfdd64e23632d414ab0b2986a855960f26 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 8 Dec 2012 19:38:39 +0000 Subject: [PATCH 29/75] TimedDosRequester doesn't support linefeeds through \n --- resources/FatMessages | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/FatMessages b/resources/FatMessages index 075a1e98f..6f7bf0dc3 100644 --- a/resources/FatMessages +++ b/resources/FatMessages @@ -2680,11 +2680,11 @@ 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:Are you sure you want to close multiple tabs? 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.\n\nNetSurf 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.\n\nNetSurf 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.\n\nNetSurf will quit in 5 seconds unless this shutdown is aborted. -it.ami.TCPIPShutdown:The TCP/IP stack has signalled that it is about to shutdown and NetSurf must exit.\n\nNetSurf will quit in 5 seconds unless this shutdown is aborted. -nl.ami.TCPIPShutdown:The TCP/IP stack has signalled that it is about to shutdown and NetSurf must exit.\n\nNetSurf will quit in 5 seconds unless this shutdown is aborted. +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: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. +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 From 083cf492f59529192b1a683fa9064ee2c2300c48 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 9 Dec 2012 18:52:07 +0000 Subject: [PATCH 30/75] Allow ctrl-click on hotlist toolbar to open in a new tab --- amiga/gui.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/amiga/gui.c b/amiga/gui.c index 1d523e65b..522f66aee 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -4339,7 +4339,13 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg case GID_HOTLIST: if(node = (struct Node *)GetTagData(SPEEDBAR_SelectedNode, 0, msg->IAddress)) { GetSpeedButtonNodeAttrs(node, SBNA_UserData, (ULONG *)&url, TAG_DONE); - browser_window_go(gwin->bw, url, NULL, true); + + ami_update_quals(gwin); + 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; } From 70825a5ee24ead041bc331b13e00ae5f86f458c0 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 9 Dec 2012 18:57:07 +0000 Subject: [PATCH 31/75] Set the file comment for the included ARexx scripts as part of the install, as these tend to get lost and don't exist at all in Git. --- amiga/dist/Install | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/amiga/dist/Install b/amiga/dist/Install index 7b8c5fe0b..bb8f737b5 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 "") From 5ee1f09dd2f1535613d1ad88359150f4c6ac53b6 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 9 Dec 2012 19:16:47 +0000 Subject: [PATCH 32/75] Missing double-quote --- amiga/dist/Install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/amiga/dist/Install b/amiga/dist/Install index bb8f737b5..e32096498 100755 --- a/amiga/dist/Install +++ b/amiga/dist/Install @@ -474,9 +474,9 @@ (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\") +(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") From 6b7e67847643dc54ade072c83c5669d7093fb1a3 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 9 Dec 2012 19:39:48 +0000 Subject: [PATCH 33/75] Only bother with the delayed requester on OS4 --- amiga/gui.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/amiga/gui.c b/amiga/gui.c index 522f66aee..22a50fa6a 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -2311,6 +2311,8 @@ 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")); @@ -2326,7 +2328,7 @@ void ami_quit_netsurf_delayed(void) free(utf8text); free(utf8gadgets); - +#endif if(res == -1) { /* Requester timed out */ nsoption_set_bool(tab_close_warn, false); ami_quit_netsurf(); From 3ef843fcb420c94665981519dacdd8d8c03b8ed0 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 9 Dec 2012 19:41:06 +0000 Subject: [PATCH 34/75] Switch Yes/No Replace/Don'tReplace so Esc operates the "don't do anything" operation as expected. --- amiga/download.c | 2 +- amiga/gui.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/amiga/download.c b/amiga/download.c index 224ac29db..4243e6ddc 100644 --- a/amiga/download.c +++ b/amiga/download.c @@ -416,7 +416,7 @@ BOOL ami_download_check_overwrite(const char *file, struct Window *win, ULONG si overwritetext = ASPrintf(messages_get("OverwriteFile")); } - res = ami_warn_user_multi(overwritetext, "DontReplace", "Replace", win); + res = ami_warn_user_multi(overwritetext, "Replace", "DontReplace", win); FreeVec(overwritetext); } else return TRUE; diff --git a/amiga/gui.c b/amiga/gui.c index 22a50fa6a..c30489e27 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -3346,7 +3346,7 @@ void ami_close_all_tabs(struct gui_window_2 *gwin) 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, "No", "Yes", gwin->win); + int32 res = ami_warn_user_multi(req_body, "Yes", "No", gwin->win); free(req_body); if(res == 1) return; From 388ddc6dbd11e28740538a4d39d04f086e16c0c0 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 9 Dec 2012 20:00:11 +0000 Subject: [PATCH 35/75] non-working "always show tabbar" option --- amiga/gui.c | 11 +++++++---- amiga/options.h | 3 +++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/amiga/gui.c b/amiga/gui.c index c30489e27..e2728c270 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -2318,7 +2318,7 @@ void ami_quit_netsurf_delayed(void) DisplayBeep(NULL); - int32 res = TimedDosRequesterTags(TDR_ImageType, TDRIMAGE_INFO, + res = TimedDosRequesterTags(TDR_ImageType, TDRIMAGE_INFO, TDR_TitleString, messages_get("NetSurf"), TDR_FormatString, utf8text, TDR_GadgetString, utf8gadgets, @@ -2697,8 +2697,10 @@ 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; + } } struct gui_window *gui_create_browser_window(struct browser_window *bw, @@ -3264,6 +3266,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 { @@ -3425,7 +3428,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))) ami_toggletabbar(g->shared, false); ami_utf8_free(g->tabtitle); diff --git a/amiga/options.h b/amiga/options.h index 4b477b66c..dc0274da2 100644 --- a/amiga/options.h +++ b/amiga/options.h @@ -40,6 +40,7 @@ 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; \ @@ -104,6 +105,7 @@ .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, \ @@ -167,6 +169,7 @@ { "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 }, \ From 24e1aff974499e7e2cb0996a946a6a2d34fd851d Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 9 Dec 2012 20:00:59 +0000 Subject: [PATCH 36/75] Reverse the logic as well as the req text --- amiga/download.c | 2 +- amiga/gui.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/amiga/download.c b/amiga/download.c index 4243e6ddc..c0c88bb0b 100644 --- a/amiga/download.c +++ b/amiga/download.c @@ -421,6 +421,6 @@ BOOL ami_download_check_overwrite(const char *file, struct Window *win, ULONG si } 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 e2728c270..bace20510 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -3352,7 +3352,7 @@ void ami_close_all_tabs(struct gui_window_2 *gwin) int32 res = ami_warn_user_multi(req_body, "Yes", "No", gwin->win); free(req_body); - if(res == 1) return; + if(res == 0) return; } if(gwin->tabs) From 0c54f2a90260127f7a96b798afc08c691ddebadf Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 9 Dec 2012 20:02:13 +0000 Subject: [PATCH 37/75] Prevent multiple tabbars --- amiga/gui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amiga/gui.c b/amiga/gui.c index bace20510..06d8356c2 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -2751,7 +2751,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], From 083b7c0233635959f1944c2150abbb923c5e0481 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 9 Dec 2012 20:05:22 +0000 Subject: [PATCH 38/75] Enable persistent tab bar through tab_always_show option --- amiga/gui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amiga/gui.c b/amiga/gui.c index 06d8356c2..60d9d3127 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -3428,7 +3428,7 @@ void gui_window_destroy(struct gui_window *g) g->shared->tabs--; ami_switch_tab(g->shared,true); - if((g->shared->tabs == 1) && (nsoption_bool(tab_always_show))) + if((g->shared->tabs == 1) && (nsoption_bool(tab_always_show) == false)) ami_toggletabbar(g->shared, false); ami_utf8_free(g->tabtitle); From 5b5336499479af1e902de62319a95405b45136ac Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 9 Dec 2012 20:18:47 +0000 Subject: [PATCH 39/75] Move tabbed browsing options to new tab --- amiga/gui_options.c | 67 ++++++++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 28 deletions(-) diff --git a/amiga/gui_options.c b/amiga/gui_options.c index 27b3c6314..613ffff8e 100755 --- a/amiga/gui_options.c +++ b/amiga/gui_options.c @@ -186,7 +186,7 @@ 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 @@ -218,12 +218,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")); @@ -1089,6 +1090,39 @@ 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, + LayoutEnd, // tabbed browsing + LayoutEnd, + LayoutEnd, // page vgroup + CHILD_WeightedHeight, 0, + PageEnd, // page object + /* ** Advanced */ PAGE_Add, LayoutObject, @@ -1127,29 +1161,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, From af8c3ef0c359a4c86531755659af7688e8b3f08e Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 9 Dec 2012 20:29:01 +0000 Subject: [PATCH 40/75] Add options for always showing tabbar and warning on closing multiple tabs --- amiga/gui_options.c | 30 +++++++++++++++++++++++++ resources/FatMessages | 51 +++++++++++++++++++++++++++++-------------- 2 files changed, 65 insertions(+), 16 deletions(-) diff --git a/amiga/gui_options.c b/amiga/gui_options.c index 613ffff8e..d4c119844 100755 --- a/amiga/gui_options.c +++ b/amiga/gui_options.c @@ -117,6 +117,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, @@ -286,6 +288,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")); @@ -1116,6 +1120,18 @@ void ami_gui_opts_open(void) 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, @@ -1665,6 +1681,20 @@ 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); + if (data) { + nsoption_set_bool(tab_always_show, true); + } else { + nsoption_set_bool(tab_always_show, false); + } + 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); diff --git a/resources/FatMessages b/resources/FatMessages index 6f7bf0dc3..c391a4191 100644 --- a/resources/FatMessages +++ b/resources/FatMessages @@ -5512,24 +5512,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:Tabs +nl.ami.Tabs:Tabs en.all.TabbedBrowsing:Tabbed browsing de.all.TabbedBrowsing:Registernavigation (Tabs) fr.all.TabbedBrowsing:Tabbed browsing @@ -5550,6 +5540,35 @@ 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:Warn when closing multiple tabs +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:Always show tabs +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 From 02a4bfd375110c268837931a8714fab0dc154d50 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 9 Dec 2012 20:39:10 +0000 Subject: [PATCH 41/75] Toggle the tab bar to the correct state if the option to always show it is changed and only one tab is currently open --- amiga/gui.c | 27 +++++++++++++++++++++++++++ amiga/gui.h | 1 + amiga/gui_options.c | 6 ++++++ 3 files changed, 34 insertions(+) diff --git a/amiga/gui.c b/amiga/gui.c index 60d9d3127..bd0715edb 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -2703,6 +2703,33 @@ void ami_toggletabbar(struct gui_window_2 *gwin, bool show) } } +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, struct browser_window *clone, bool new_tab) { diff --git a/amiga/gui.h b/amiga/gui.h index 6a5434f87..1dff5d3c0 100755 --- a/amiga/gui.h +++ b/amiga/gui.h @@ -154,6 +154,7 @@ 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 d4c119844..a84449eef 100755 --- a/amiga/gui_options.c +++ b/amiga/gui_options.c @@ -1450,6 +1450,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, @@ -1689,12 +1690,17 @@ void ami_gui_opts_use(bool save) } 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); From a6005c9a5bb529bde2e669aef84ff2a7ad25281f Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 9 Dec 2012 21:28:32 +0000 Subject: [PATCH 42/75] Add font anti-aliasing option to GUI --- amiga/gui_options.c | 94 ++++++++++++++++++++++++++----------------- resources/FatMessages | 5 +++ 2 files changed, 63 insertions(+), 36 deletions(-) diff --git a/amiga/gui_options.c b/amiga/gui_options.c index a84449eef..dc8697779 100755 --- a/amiga/gui_options.c +++ b/amiga/gui_options.c @@ -109,6 +109,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, @@ -280,6 +281,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")); @@ -991,46 +993,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, + 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[GID_OPTS_FONT_MINSIZE], 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, - CHILD_Label, LabelObject, - LABEL_Text, gadlab[LAB_OPTS_PT], - 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, - CHILD_Label, LabelObject, - LABEL_Text, gadlab[GID_OPTS_FONT_MINSIZE], - LabelEnd, LayoutEnd, CHILD_WeightedHeight, 0, LayoutEnd, // page vgroup @@ -1639,6 +1654,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); diff --git a/resources/FatMessages b/resources/FatMessages index c391a4191..bfd4caa59 100644 --- a/resources/FatMessages +++ b/resources/FatMessages @@ -5475,6 +5475,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:Use anti-aliasing (when possible) +nl.ami.FontAntialiasing:Use anti-aliasing (when possible) # Font scanning en.ami.FontScanning:Scanning fonts... From 589c8a28a4fb4c6e4ccb0f55cf6fc316dea6cc80 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 9 Dec 2012 21:45:12 +0000 Subject: [PATCH 43/75] Add simple refresh option to GUI --- amiga/gui_options.c | 23 +++++++++++++++++++++++ resources/FatMessages | 5 +++++ 2 files changed, 28 insertions(+) diff --git a/amiga/gui_options.c b/amiga/gui_options.c index dc8697779..edc1856ab 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, @@ -152,6 +153,7 @@ enum GRP_OPTS_PRIVACY, GRP_OPTS_MISC, GRP_OPTS_SCREEN, + GRP_OPTS_WINDOW, GRP_OPTS_THEME, GRP_OPTS_MOUSE, GRP_OPTS_PROXY, @@ -259,6 +261,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")); @@ -328,6 +331,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")); @@ -686,6 +690,18 @@ void ami_gui_opts_open(void) LayoutEnd, LayoutEnd, // screen CHILD_WeightedHeight,0, + 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, @@ -1549,6 +1565,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)); diff --git a/resources/FatMessages b/resources/FatMessages index bfd4caa59..0fe6a6f9c 100644 --- a/resources/FatMessages +++ b/resources/FatMessages @@ -5296,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:Simple refresh +nl.ami.SimpleRefresh:Simple refresh en.all.Theme:Theme de.all.Theme:Thema fr.all.Theme:Theme From 47579b468cb02886b2113e5bfcdee05978c7c940 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 9 Dec 2012 21:57:58 +0000 Subject: [PATCH 44/75] Add dither quality options to GUI --- amiga/gui_options.c | 21 +++++++++++++++++++++ resources/FatMessages | 20 ++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/amiga/gui_options.c b/amiga/gui_options.c index edc1856ab..092bb4cb3 100755 --- a/amiga/gui_options.c +++ b/amiga/gui_options.c @@ -99,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, @@ -195,6 +196,7 @@ enum #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; @@ -208,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; @@ -248,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")); @@ -273,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")); @@ -871,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, @@ -1624,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)); diff --git a/resources/FatMessages b/resources/FatMessages index 0fe6a6f9c..80e7dbdee 100644 --- a/resources/FatMessages +++ b/resources/FatMessages @@ -5369,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:Dither quality (<= 8-bit modes only) +nl.ami.DitherQuality:Dither quality (<= 8-bit modes only) +en.ami.Low:Low +de.ami.Low:Low +fr.ami.Low:Low +it.ami.Low:Low +nl.ami.Low:Low +en.ami.Medium:Medium +de.ami.Medium:Medium +fr.ami.Medium:Medium +it.ami.Medium:Medium +nl.ami.Medium:Medium +en.ami.High:High +de.ami.High:High +fr.ami.High:High +it.ami.High:High +nl.ami.High:High en.all.Animations:Animations de.all.Animations:Animationen fr.all.Animations:Animations From c1c3a067480b90a8d0747d92ea4a1bbb88228b0a Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 3 Dec 2012 18:47:22 +0000 Subject: [PATCH 45/75] document mouse interaction a bit --- render/html_interaction.c | 62 +++++++++++++++++++++++++++++++-------- 1 file changed, 49 insertions(+), 13 deletions(-) diff --git a/render/html_interaction.c b/render/html_interaction.c index 8dd613bdf..d22869edc 100644 --- a/render/html_interaction.c +++ b/render/html_interaction.c @@ -400,12 +400,44 @@ void html_mouse_action(struct content *c, struct browser_window *bw, box_x = box->margin[LEFT]; box_y = box->margin[TOP]; + /* 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; @@ -421,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; @@ -448,12 +481,14 @@ 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_y != NULL || box->scroll_x != NULL) { + + if ((box->scroll_x != NULL) || + (box->scroll_y != NULL)) { if (drag_candidate == NULL) { drag_candidate = box; @@ -468,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; @@ -482,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; From a1876073adc2d13cf0c493c21a485302f6333c77 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 10 Dec 2012 08:43:11 +0000 Subject: [PATCH 46/75] add spidermonkey to riscos makefiles --- riscos/Makefile.target | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/riscos/Makefile.target b/riscos/Makefile.target index 53b329676..bc09b7fc4 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 + 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,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)) endif TPD_RISCOS = $(foreach TPL,$(notdir $(TPL_RISCOS)), \ From 8698245ad2e7885368f71080154b6590b407e7b5 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 10 Dec 2012 11:38:52 +0000 Subject: [PATCH 47/75] use g++ to link on riscos --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 428aa74b4..7b823acd0 100644 --- a/Makefile +++ b/Makefile @@ -153,6 +153,7 @@ ifeq ($(TARGET),riscos) SQUEEZE := squeeze RUNEXT := CC := gcc + CXX := g++ EXEEXT := PKG_CONFIG := else @@ -188,6 +189,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 @@ -432,7 +434,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 From ec7389a18f8cbfd79ec98da5b30ea616573c9f34 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Mon, 10 Dec 2012 20:26:40 +0000 Subject: [PATCH 48/75] Update the current pressed qualifier keys at every RAWKEY event, as the update doesn't work during IDCMP_IDCMPUPDATE --- amiga/gui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amiga/gui.c b/amiga/gui.c index bd0715edb..4a5056636 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -1643,8 +1643,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); @@ -4372,7 +4373,6 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg if(node = (struct Node *)GetTagData(SPEEDBAR_SelectedNode, 0, msg->IAddress)) { GetSpeedButtonNodeAttrs(node, SBNA_UserData, (ULONG *)&url, TAG_DONE); - ami_update_quals(gwin); if(gwin->key_state & BROWSER_MOUSE_MOD_2) { browser_window_create(url, gwin->bw, NULL, false, true); } else { From 30efe4ba306f129f3d92108dee522b3eb132545a Mon Sep 17 00:00:00 2001 From: Chris Young Date: Tue, 11 Dec 2012 20:21:06 +0000 Subject: [PATCH 49/75] Updated Italian translation (credit: Samir Hawamdeh) --- resources/FatMessages | 54 +++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/resources/FatMessages b/resources/FatMessages index 80e7dbdee..99cfce88c 100644 --- a/resources/FatMessages +++ b/resources/FatMessages @@ -1212,12 +1212,12 @@ nl.all.HotlistFeatureRequest:NetSurf feature requests en.ami.HotlistMenu:Hotlist menu de.ami.HotlistMenu:Hotlist menu fr.ami.HotlistMenu:Hotlist menu -it.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:Hotlist toolbar +it.ami.HotlistToolbar:Barra segnalibri nl.ami.HotlistToolbar:Hotlist toolbar @@ -2339,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 @@ -2678,17 +2678,17 @@ 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: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: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:Abort shutdown +it.ami.AbortShutdown:Interrompi lo shutdown nl.ami.AbortShutdown:Abort shutdown @@ -5299,7 +5299,7 @@ nl.ami.ScreenPublic:Public screen en.ami.SimpleRefresh:Simple refresh de.ami.SimpleRefresh:Simple refresh fr.ami.SimpleRefresh:Simple refresh -it.ami.SimpleRefresh:Simple refresh +it.ami.SimpleRefresh:Refresh semplice nl.ami.SimpleRefresh:Simple refresh en.all.Theme:Theme de.all.Theme:Thema @@ -5369,7 +5369,7 @@ 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) +en.ami.DitherQuality:Qualità dither (<= solo modi a 8-bit) de.ami.DitherQuality:Dither quality (<= 8-bit modes only) fr.ami.DitherQuality:Dither quality (<= 8-bit modes only) it.ami.DitherQuality:Dither quality (<= 8-bit modes only) @@ -5377,17 +5377,17 @@ nl.ami.DitherQuality:Dither quality (<= 8-bit modes only) en.ami.Low:Low de.ami.Low:Low fr.ami.Low:Low -it.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:Medium +it.ami.Medium:Media nl.ami.Medium:Medium en.ami.High:High de.ami.High:High fr.ami.High:High -it.ami.High:High +it.ami.High:Alta nl.ami.High:High en.all.Animations:Animations de.all.Animations:Animationen @@ -5503,7 +5503,7 @@ 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:Use anti-aliasing (when possible) +it.ami.FontAntialiasing:Usa anti-aliasing (quando possibile) nl.ami.FontAntialiasing:Use anti-aliasing (when possible) # Font scanning @@ -5548,7 +5548,7 @@ nl.all.Duration:Duration en.ami.Tabs:Tabs de.ami.Tabs:Tabs fr.ami.Tabs:Tabs -it.ami.Tabs:Tabs +it.ami.Tabs:Schede nl.ami.Tabs:Tabs en.all.TabbedBrowsing:Tabbed browsing de.all.TabbedBrowsing:Registernavigation (Tabs) @@ -5563,7 +5563,7 @@ 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 @@ -5573,12 +5573,12 @@ 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: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:Always show tabs +it.ami.TabAlways:Mostra sempre la barra delle schede nl.ami.TabAlways:Always show tabs # Advanced From 1b4604130ebd636df5b932134d651408f35015d7 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Wed, 12 Dec 2012 19:48:48 +0000 Subject: [PATCH 50/75] Correct the designation of en and it strings --- resources/FatMessages | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/FatMessages b/resources/FatMessages index 99cfce88c..8006018b4 100644 --- a/resources/FatMessages +++ b/resources/FatMessages @@ -5369,10 +5369,10 @@ 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:Qualità dither (<= solo modi a 8-bit) +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: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 From 25e85f1429971a13b5f063c65781a73952e0bfcf Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 13 Dec 2012 15:32:34 +0000 Subject: [PATCH 51/75] do not add script handler if runtime cannot be initialised --- javascript/jsapi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/javascript/jsapi.c b/javascript/jsapi.c index 73153fe09..ef34371d1 100644 --- a/javascript/jsapi.c +++ b/javascript/jsapi.c @@ -38,8 +38,10 @@ void js_initialise(void) 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) From 5a5451a0c58903fe5b0590e01a0f06e53c44787d Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 13 Dec 2012 15:33:54 +0000 Subject: [PATCH 52/75] make monkey target take notice of GCCSDK_INSTALL_ENV and GCCSDK_INSTALL_CROSSBIN environment values --- Makefile | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7b823acd0..9cfc4841e 100644 --- a/Makefile +++ b/Makefile @@ -260,8 +260,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 From 0ff9d858139328956cfe60a29f13b3315b6d2ce6 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 13 Dec 2012 15:52:55 +0000 Subject: [PATCH 53/75] let monkey generate unused-but-set-variable without causing an error --- monkey/Makefile.target | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/monkey/Makefile.target b/monkey/Makefile.target index b8891d3e0..18a7dae6b 100644 --- a/monkey/Makefile.target +++ b/monkey/Makefile.target @@ -33,7 +33,7 @@ $(eval $(call pkg_config_find_and_add,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 \ +MONKEYCFLAGS := -std=c99 -Dmonkey -Dnsmonkey \ -D_BSD_SOURCE \ -D_XOPEN_SOURCE=600 \ -D_POSIX_C_SOURCE=200112L \ @@ -45,10 +45,12 @@ $(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) +MONKEYWARNFLAGS := -Werror -Wno-error=unused-but-set-variable + +CFLAGS += $(MONKEYCFLAGS) $(MONKEYWARNFLAGS) +LDFLAGS += $(MONKEYLDFLAGS) # --------------------------------------------------------------------------- # Windows flag setup From 17e20537d4c6cdcb55f1ab68c950264c79ca69b2 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 13 Dec 2012 16:04:06 +0000 Subject: [PATCH 54/75] try without option altogether --- monkey/Makefile.target | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monkey/Makefile.target b/monkey/Makefile.target index 18a7dae6b..d43fe8d9c 100644 --- a/monkey/Makefile.target +++ b/monkey/Makefile.target @@ -47,7 +47,8 @@ MONKEYCFLAGS := -std=c99 -Dmonkey -Dnsmonkey \ MONKEYLDFLAGS := -lm $(shell $(PKG_CONFIG) --cflags --libs glib-2.0 lcms) -MONKEYWARNFLAGS := -Werror -Wno-error=unused-but-set-variable +MONKEYWARNFLAGS := -Werror +#-Wno-unused-but-set-variable CFLAGS += $(MONKEYCFLAGS) $(MONKEYWARNFLAGS) LDFLAGS += $(MONKEYLDFLAGS) From 45906b9dc2c87181f359289abc034f84b44947c4 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 13 Dec 2012 16:31:05 +0000 Subject: [PATCH 55/75] make macro name more correct --- Makefile | 4 +++- amiga/Makefile.target | 12 ++++++------ atari/Makefile.target | 4 ++-- beos/Makefile.target | 6 +++--- cocoa/Makefile.target | 8 ++++---- framebuffer/Makefile.target | 10 +++++----- gtk/Makefile.target | 18 +++++++++--------- monkey/Makefile.target | 33 +++++++++++++++++---------------- riscos/Makefile.target | 10 +++++----- 9 files changed, 54 insertions(+), 51 deletions(-) diff --git a/Makefile b/Makefile index 9cfc4841e..d8ce8a657 100644 --- a/Makefile +++ b/Makefile @@ -316,10 +316,12 @@ define feature_enabled 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 diff --git a/amiga/Makefile.target b/amiga/Makefile.target index af4b0bd83..ec43fdd30 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/atari/Makefile.target b/atari/Makefile.target index ad908075b..7f0573407 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 \ diff --git a/beos/Makefile.target b/beos/Makefile.target index 27981be2d..9a7e79ab8 100644 --- a/beos/Makefile.target +++ b/beos/Makefile.target @@ -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.target b/cocoa/Makefile.target index 27f3b08b9..d975a0c8f 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.target b/framebuffer/Makefile.target index f55499770..f3d91de0d 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.target b/gtk/Makefile.target index 1b2bef526..3da4346a1 100644 --- a/gtk/Makefile.target +++ b/gtk/Makefile.target @@ -24,16 +24,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 \ diff --git a/monkey/Makefile.target b/monkey/Makefile.target index d43fe8d9c..4e8ac81ee 100644 --- a/monkey/Makefile.target +++ b/monkey/Makefile.target @@ -22,17 +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))) +#-Wno-unused-but-set-variable +WARNFLAGS += -Werror + MONKEYCFLAGS := -std=c99 -Dmonkey -Dnsmonkey \ -D_BSD_SOURCE \ -D_XOPEN_SOURCE=600 \ @@ -47,19 +50,17 @@ MONKEYCFLAGS := -std=c99 -Dmonkey -Dnsmonkey \ MONKEYLDFLAGS := -lm $(shell $(PKG_CONFIG) --cflags --libs glib-2.0 lcms) -MONKEYWARNFLAGS := -Werror -#-Wno-unused-but-set-variable -CFLAGS += $(MONKEYCFLAGS) $(MONKEYWARNFLAGS) +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/riscos/Makefile.target b/riscos/Makefile.target index bc09b7fc4..e7370e7ee 100644 --- a/riscos/Makefile.target +++ b/riscos/Makefile.target @@ -30,11 +30,11 @@ else NETSURF_FEATURE_PNG_CFLAGS := -DWITH_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,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,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)), \ From 16d67095a6731f329bad971985e8983cdc054efe Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 13 Dec 2012 17:23:47 +0000 Subject: [PATCH 56/75] add pkg-config macro for libraries which are not controled by configuration --- Makefile | 25 +++++++++++++++++++++++++ gtk/Makefile.target | 25 ++++++++++++++----------- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index d8ce8a657..91f3aac08 100644 --- a/Makefile +++ b/Makefile @@ -316,6 +316,31 @@ 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) diff --git a/gtk/Makefile.target b/gtk/Makefile.target index 3da4346a1..f9b5436af 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,7 +21,7 @@ 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_enabled,PNG,libpng,PNG )) +$(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)) @@ -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 From fa6e1379d0cc8c904c60251eee55d58dabf60784 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 13 Dec 2012 17:36:38 +0000 Subject: [PATCH 57/75] move the cut n pasted -Wuninitialized from Makefile.config alongside all the other warning flags in the standard location --- Makefile | 2 +- Makefile.defaults | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 91f3aac08..a1c6e5dbc 100644 --- a/Makefile +++ b/Makefile @@ -400,7 +400,7 @@ endef WARNFLAGS = -W -Wall -Wundef -Wpointer-arith \ -Wcast-align -Wwrite-strings -Wstrict-prototypes \ -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \ - -Wnested-externs + -Wnested-externs -Wuninitialized ifneq ($(GCCVER),2) WARNFLAGS += -Wno-unused-parameter endif diff --git a/Makefile.defaults b/Makefile.defaults index 5633dd2a2..7e97c6e56 100644 --- a/Makefile.defaults +++ b/Makefile.defaults @@ -128,7 +128,7 @@ ifeq ($(TARGET),riscos) NETSURF_USE_DRAW_EXPORT := YES # Optimisation levels - CFLAGS += -O2 -Wuninitialized + CFLAGS += -O2 endif @@ -166,7 +166,7 @@ ifeq ($(TARGET),gtk) NETSURF_GTK_MAJOR := 2 # Optimisation levels - CFLAGS += -O2 -Wuninitialized + CFLAGS += -O2 endif @@ -182,7 +182,7 @@ ifeq ($(TARGET),monkey) NETSURF_USE_ROSPRITE := NO NETSURF_USE_HARU_PDF := NO NETSURF_USE_LIBICONV_PLUG := NO - CFLAGS += -O2 -Wuninitialized + CFLAGS += -O2 endif # ---------------------------------------------------------------------------- @@ -216,7 +216,7 @@ ifeq ($(TARGET),beos) NETSURF_USE_LIBICONV_PLUG := NO # Optimisation levels - CFLAGS += -O2 -Wuninitialized + CFLAGS += -O2 endif @@ -260,7 +260,7 @@ ifeq ($(TARGET),amiga) NETSURF_USE_AMIGA_CAIRO := AUTO # Optimisation levels - CFLAGS += -O2 -Wuninitialized -gstabs + CFLAGS += -O2 -gstabs endif @@ -269,7 +269,7 @@ endif # ---------------------------------------------------------------------------- ifeq ($(TARGET),framebuffer) # Optimisation levels - CFLAGS += -O2 -Wuninitialized + CFLAGS += -O2 # Framebuffer default surface provider. # Valid values are: x, sdl, linux, vnc, able, @@ -338,7 +338,7 @@ ifeq ($(TARGET),windows) NETSURF_USE_HARU_PDF := NO # Optimisation levels - CFLAGS += -O2 -Wuninitialized + CFLAGS += -O2 endif @@ -366,7 +366,7 @@ ifeq ($(TARGET),atari) # 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 @@ -387,12 +387,13 @@ ifeq ($(TARGET),atari) # enable optimizations # -O2 is currently broken with m68000 / m68020-60 builds - CFLAGS += -O1 -Wuninitialized + CFLAGS += -O1 + # override warning flags removing -Wall WARNFLAGS = -W -Wundef -Wpointer-arith \ -Wcast-align -Wwrite-strings -Wstrict-prototypes \ -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \ - -Wnested-externs -Wl,-t + -Wnested-externs -Wuninitialized -Wl,-t endif @@ -420,7 +421,7 @@ ifeq ($(TARGET),cocoa) # 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 @@ -433,7 +434,7 @@ ifeq ($(TARGET),cocoa) SDK_VERSION := $(MACOSX_VERSION) # Optimisation levels - CFLAGS += -O2 -Wuninitialized + CFLAGS += -O2 endif From c87cbe565580975bf8300578ec556931a5f5a409 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 13 Dec 2012 19:26:24 +0000 Subject: [PATCH 58/75] split target defaults out --- Makefile.defaults | 341 +--------------------------------- amiga/Makefile.defaults | 40 ++++ atari/Makefile.defaults | 52 ++++++ beos/Makefile.defaults | 32 ++++ cocoa/Makefile.defaults | 37 ++++ framebuffer/Makefile.defaults | 47 +++++ gtk/Makefile.defaults | 34 ++++ monkey/Makefile.defaults | 13 ++ riscos/Makefile.defaults | 31 ++++ windows/Makefile.defaults | 24 +++ 10 files changed, 312 insertions(+), 339 deletions(-) create mode 100644 amiga/Makefile.defaults create mode 100644 atari/Makefile.defaults 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 create mode 100644 windows/Makefile.defaults diff --git a/Makefile.defaults b/Makefile.defaults index 7e97c6e56..812a5a950 100644 --- a/Makefile.defaults +++ b/Makefile.defaults @@ -98,345 +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 - -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 - -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 -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 - -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 -gstabs - -endif - -# ---------------------------------------------------------------------------- -# Framebuffer-target-specific options -# ---------------------------------------------------------------------------- -ifeq ($(TARGET),framebuffer) - # 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 - - -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 - -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 - - # 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 - -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 - -endif +# Incude defaults specific to a TARGET +-include $(TARGET)/Makefile.defaults # Include any local configuration ifneq ($(MAKEFILE_DEFAULTS_FINISHED),) diff --git a/amiga/Makefile.defaults b/amiga/Makefile.defaults new file mode 100644 index 000000000..42bcb73ce --- /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/atari/Makefile.defaults b/atari/Makefile.defaults new file mode 100644 index 000000000..150358843 --- /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 += -O1 + + # 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/beos/Makefile.defaults b/beos/Makefile.defaults new file mode 100644 index 000000000..d5bf6b396 --- /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/cocoa/Makefile.defaults b/cocoa/Makefile.defaults new file mode 100644 index 000000000..b2f64ec56 --- /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/framebuffer/Makefile.defaults b/framebuffer/Makefile.defaults new file mode 100644 index 000000000..6e2a3d159 --- /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/gtk/Makefile.defaults b/gtk/Makefile.defaults new file mode 100644 index 000000000..23d4c1749 --- /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/monkey/Makefile.defaults b/monkey/Makefile.defaults new file mode 100644 index 000000000..659c1e336 --- /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/riscos/Makefile.defaults b/riscos/Makefile.defaults new file mode 100644 index 000000000..f48024f5a --- /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/windows/Makefile.defaults b/windows/Makefile.defaults new file mode 100644 index 000000000..68fb7af66 --- /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 From 44487224252ad91c448373cd1974f1ef6c53579f Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 13 Dec 2012 19:27:16 +0000 Subject: [PATCH 59/75] allow flags to be selected based on compiler version --- Makefile | 14 ++++++++++++-- Makefile.sources.javascript | 1 - monkey/Makefile.target | 1 - 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a1c6e5dbc..1f83cba58 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,7 @@ else TARGET := beos endif # BeOS still uses gcc2 - GCCVER := 2 + CC_MAJOR := 2 else ifeq ($(HOST),AmigaOS) HOST := amiga @@ -282,6 +282,12 @@ else endif endif +# compiler versioning to adjust warning flags +CC_MAJOR := $(shell $(CC) -dumpversion | cut -f1 -d. ) +CC_MINOR := $(shell $(CC) -dumpversion | cut -f2 -d. ) +define cc_ver_ge +$(shell expr $(CC_MAJOR) \>= $(1) \& $(CC_MINOR) \>= $(2)) +endef # CCACHE ifeq ($(origin CCACHE),undefined) @@ -401,9 +407,13 @@ WARNFLAGS = -W -Wall -Wundef -Wpointer-arith \ -Wcast-align -Wwrite-strings -Wstrict-prototypes \ -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \ -Wnested-externs -Wuninitialized -ifneq ($(GCCVER),2) +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 diff --git a/Makefile.sources.javascript b/Makefile.sources.javascript index 1ece3b683..76a6ff145 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/monkey/Makefile.target b/monkey/Makefile.target index 4e8ac81ee..fa15a50f2 100644 --- a/monkey/Makefile.target +++ b/monkey/Makefile.target @@ -33,7 +33,6 @@ $(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))) -#-Wno-unused-but-set-variable WARNFLAGS += -Werror MONKEYCFLAGS := -std=c99 -Dmonkey -Dnsmonkey \ From 7c5f9ed8cd029dda34b6167520d6b65fbc40fc69 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 14 Dec 2012 10:53:43 +0000 Subject: [PATCH 60/75] make the Make rules for compiler versioning be more portable with fewer shell calls --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1f83cba58..2d61411c7 100644 --- a/Makefile +++ b/Makefile @@ -283,8 +283,9 @@ else endif # compiler versioning to adjust warning flags -CC_MAJOR := $(shell $(CC) -dumpversion | cut -f1 -d. ) -CC_MINOR := $(shell $(CC) -dumpversion | cut -f2 -d. ) +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 From 6582b4e075e28d17349132ed77862f0a370a9119 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 14 Dec 2012 11:30:14 +0000 Subject: [PATCH 61/75] fix change to CC_MAJOR for beos --- Makefile | 2 +- beos/Makefile.target | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2d61411c7..b57dabfb3 100644 --- a/Makefile +++ b/Makefile @@ -605,7 +605,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/beos/Makefile.target b/beos/Makefile.target index 9a7e79ab8..4edde01a1 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++ From 8685336e2da8a594955d1db97fff9eaac1e276fd Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 14 Dec 2012 11:43:23 +0000 Subject: [PATCH 62/75] remove redundant compiler version override --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index b57dabfb3..baf835421 100644 --- a/Makefile +++ b/Makefile @@ -70,8 +70,6 @@ else ifeq ($(TARGET),) TARGET := beos endif - # BeOS still uses gcc2 - CC_MAJOR := 2 else ifeq ($(HOST),AmigaOS) HOST := amiga From 08cb5a09b2554e4eae7ffa692f540107fc07b5ec Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 15 Dec 2012 13:39:40 +0000 Subject: [PATCH 63/75] Work around a speedbar.gadget layout bug --- amiga/gui.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/amiga/gui.c b/amiga/gui.c index 4a5056636..d41d2510b 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -2464,7 +2464,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; @@ -2507,7 +2507,7 @@ int ami_gui_hotlist_scan(struct tree *tree, struct List *speed_button_list, stru struct node *node; struct node_element *element; static WORD gen = 0; - static uint16 item = 0; + static int item = 0; for (node = root; node; node = tree_node_get_next(node)) { @@ -2524,6 +2524,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) { @@ -2542,7 +2549,7 @@ void ami_gui_hotlist_toolbar_add(struct gui_window_2 *gwin) 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); From ea5096fb8d8233f588145357220f8e3f72bf160e Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 15 Dec 2012 13:43:05 +0000 Subject: [PATCH 64/75] These values shouldn't be declared static --- amiga/gui.c | 4 ++-- amiga/menu.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/amiga/gui.c b/amiga/gui.c index d41d2510b..d92a5c25a 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -2506,8 +2506,8 @@ 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 int item = 0; + WORD gen = 0; + int item = 0; for (node = root; node; node = tree_node_get_next(node)) { diff --git a/amiga/menu.c b/amiga/menu.c index f42860612..a778fe7f0 100755 --- a/amiga/menu.c +++ b/amiga/menu.c @@ -497,8 +497,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; From 51067561c9b6b3fe9f6dd5b032b570bf92f34a02 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 15 Dec 2012 13:46:39 +0000 Subject: [PATCH 65/75] Properly capitalise JavaScript --- resources/FatMessages | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/FatMessages b/resources/FatMessages index 8006018b4..4abd8479e 100644 --- a/resources/FatMessages +++ b/resources/FatMessages @@ -5242,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 From 8c74aeb6e17bbd97544bc41120c2d7d7a5c2b66c Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 15 Dec 2012 14:21:15 +0000 Subject: [PATCH 66/75] Add some options to the browser menu --- amiga/menu.c | 77 +++++++++++++++++++++++++++++++++++++++++++--------- amiga/menu.h | 6 ++-- 2 files changed, 67 insertions(+), 16 deletions(-) diff --git a/amiga/menu.c b/amiga/menu.c index a778fe7f0..a12ed82ff 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); @@ -824,6 +860,21 @@ 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) +{ + nsoption_set_bool(foreground_images, !nsoption_bool(foreground_images)); +} + +static void ami_menu_item_browser_backimg(struct Hook *hook, APTR window, struct IntuiMessage *msg) +{ + nsoption_set_bool(background_images, !nsoption_bool(background_images)); +} + +static void ami_menu_item_browser_enablejs(struct Hook *hook, APTR window, struct IntuiMessage *msg) +{ + nsoption_set_bool(enable_javascript, !nsoption_bool(enable_javascript)); +} + 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 d692320a3..da4a3aaa9 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 @@ -64,7 +64,7 @@ #define AMI_MENU_FIND FULLMENUNUM(2,0,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; From 2a42b028b2c407cdd796a487d738370ee96e7d9b Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 15 Dec 2012 14:39:01 +0000 Subject: [PATCH 67/75] Check the checked state of the menu items a more correct way --- amiga/menu.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/amiga/menu.c b/amiga/menu.c index a12ed82ff..3d9b98e16 100755 --- a/amiga/menu.c +++ b/amiga/menu.c @@ -862,17 +862,35 @@ static void ami_menu_item_browser_cookies(struct Hook *hook, APTR window, struct static void ami_menu_item_browser_foreimg(struct Hook *hook, APTR window, struct IntuiMessage *msg) { - nsoption_set_bool(foreground_images, !nsoption_bool(foreground_images)); + 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); } static void ami_menu_item_browser_backimg(struct Hook *hook, APTR window, struct IntuiMessage *msg) { - nsoption_set_bool(background_images, !nsoption_bool(background_images)); + 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); } static void ami_menu_item_browser_enablejs(struct Hook *hook, APTR window, struct IntuiMessage *msg) { - nsoption_set_bool(enable_javascript, !nsoption_bool(enable_javascript)); + 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); } static void ami_menu_item_browser_scale_decrease(struct Hook *hook, APTR window, struct IntuiMessage *msg) From 79b1496d3054a68cc5dcdf27677ed58667c099b3 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 15 Dec 2012 15:30:26 +0000 Subject: [PATCH 68/75] Update menu checked state --- amiga/menu.c | 36 ++++++++++++++++++++++++++++++++++++ amiga/menu.h | 3 +++ 2 files changed, 39 insertions(+) diff --git a/amiga/menu.c b/amiga/menu.c index 3d9b98e16..76fa9e001 100755 --- a/amiga/menu.c +++ b/amiga/menu.c @@ -601,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; @@ -659,6 +693,8 @@ void ami_menu_update_disabled(struct gui_window *g, hlcache_handle *c) OffMenu(win,AMI_MENU_SAVEAS_IFF); } } + + ami_menu_update_checked(g->shared); } /* diff --git a/amiga/menu.h b/amiga/menu.h index da4a3aaa9..58628ac48 100755 --- a/amiga/menu.h +++ b/amiga/menu.h @@ -62,6 +62,9 @@ #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 (void *)1 From 8e416ec2265fda98de4b1ea027b1ff0998e20205 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 15 Dec 2012 15:39:09 +0000 Subject: [PATCH 69/75] Ensure the menu checked state remain in sync with reality --- amiga/gui.c | 26 ++++++++++++++++++++++++++ amiga/gui_options.c | 2 ++ amiga/menu.c | 5 +++-- amiga/menu.h | 2 ++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/amiga/gui.c b/amiga/gui.c index d92a5c25a..e1fc19d7f 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -1191,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; @@ -1944,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) diff --git a/amiga/gui_options.c b/amiga/gui_options.c index 092bb4cb3..66e47d8ad 100755 --- a/amiga/gui_options.c +++ b/amiga/gui_options.c @@ -1861,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/menu.c b/amiga/menu.c index 76fa9e001..58a4d5115 100755 --- a/amiga/menu.c +++ b/amiga/menu.c @@ -693,8 +693,6 @@ void ami_menu_update_disabled(struct gui_window *g, hlcache_handle *c) OffMenu(win,AMI_MENU_SAVEAS_IFF); } } - - ami_menu_update_checked(g->shared); } /* @@ -905,6 +903,7 @@ static void ami_menu_item_browser_foreimg(struct Hook *hook, APTR window, struct 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) @@ -916,6 +915,7 @@ static void ami_menu_item_browser_backimg(struct Hook *hook, APTR window, struct 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) @@ -927,6 +927,7 @@ static void ami_menu_item_browser_enablejs(struct Hook *hook, APTR window, struc 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) diff --git a/amiga/menu.h b/amiga/menu.h index 58628ac48..8cff2d539 100755 --- a/amiga/menu.h +++ b/amiga/menu.h @@ -73,9 +73,11 @@ 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 From f185ffa2574e7687620e0cdeb8449d480504d0fa Mon Sep 17 00:00:00 2001 From: Steve Fryatt Date: Sat, 15 Dec 2012 16:59:00 +0000 Subject: [PATCH 70/75] Add Enable Javascript configuration to RO GUI. --- riscos/configure/con_content.c | 9 +++++++++ riscos/templates/de | 30 ++++++++++++++++++++---------- riscos/templates/en | 30 ++++++++++++++++++++---------- riscos/templates/fr | 30 ++++++++++++++++++++---------- riscos/templates/nl | 30 ++++++++++++++++++++---------- 5 files changed, 89 insertions(+), 40 deletions(-) diff --git a/riscos/configure/con_content.c b/riscos/configure/con_content.c index a8e9f78b4..81537bcef 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 ed26c7d6b..ce028ca49 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 2b91764f9..afcfe5697 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 4a8cce4c8..464cf6bea 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 19dd8430b..da34e44cf 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 { From b9d6eccf24a7ba1f2242740e981bf6bf3edcd82d Mon Sep 17 00:00:00 2001 From: Steve Fryatt Date: Sun, 16 Dec 2012 14:45:51 +0000 Subject: [PATCH 71/75] Properly capitalise JavaScript --- riscos/templates/de | 2 +- riscos/templates/en | 2 +- riscos/templates/fr | 2 +- riscos/templates/nl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/riscos/templates/de b/riscos/templates/de index ce028ca49..b6357f2dc 100644 --- a/riscos/templates/de +++ b/riscos/templates/de @@ -3934,7 +3934,7 @@ wimp_window { icon_esg:0 icon_fg:wimp_COLOUR_BLACK icon_bg:wimp_COLOUR_VERY_LIGHT_GREY - text_and_sprite.text:"Disable Javascript" + 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 afcfe5697..2edf0dd5f 100644 --- a/riscos/templates/en +++ b/riscos/templates/en @@ -3526,7 +3526,7 @@ wimp_window { icon_esg:0 icon_fg:wimp_COLOUR_BLACK icon_bg:wimp_COLOUR_VERY_LIGHT_GREY - text_and_sprite.text:"Disable Javascript" + text_and_sprite.text:"Disable JavaScript" text_and_sprite.size:19 text_and_sprite.validation:"Soptoff,opton" } diff --git a/riscos/templates/fr b/riscos/templates/fr index 464cf6bea..3df0a6171 100644 --- a/riscos/templates/fr +++ b/riscos/templates/fr @@ -3160,7 +3160,7 @@ wimp_window { icon_esg:0 icon_fg:wimp_COLOUR_BLACK icon_bg:wimp_COLOUR_VERY_LIGHT_GREY - text_and_sprite.text:"Disable Javascript" + text_and_sprite.text:"Disable JavaScript" text_and_sprite.size:19 text_and_sprite.validation:"Soptoff,opton" } diff --git a/riscos/templates/nl b/riscos/templates/nl index da34e44cf..53915d3c2 100644 --- a/riscos/templates/nl +++ b/riscos/templates/nl @@ -3534,7 +3534,7 @@ wimp_window { icon_esg:0 icon_fg:wimp_COLOUR_BLACK icon_bg:wimp_COLOUR_VERY_LIGHT_GREY - text_and_sprite.text:"Disable Javascript" + text_and_sprite.text:"Disable JavaScript" text_and_sprite.size:19 text_and_sprite.validation:"Soptoff,opton" } From 90f0cfb5514b68483a75bd34955433e4739f381b Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 16 Dec 2012 20:51:42 +0000 Subject: [PATCH 72/75] allow for JSOPTION_JIT to not be set --- javascript/jsapi.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/javascript/jsapi.h b/javascript/jsapi.h index d757b7fda..e3295fee9 100644 --- a/javascript/jsapi.h +++ b/javascript/jsapi.h @@ -35,11 +35,13 @@ #include -# 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 From 347fdf0743b01d096c33e4cb089bb4a34b00b18c Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 17 Dec 2012 14:55:16 +0000 Subject: [PATCH 73/75] add dom event handler to document object --- javascript/jsapi/htmldocument.bnd | 255 ++++++++++++++++++++++++++++++ javascript/jsapi/htmlelement.bnd | 11 +- utils/corestrings.c | 3 + utils/corestrings.h | 1 + 4 files changed, 265 insertions(+), 5 deletions(-) diff --git a/javascript/jsapi/htmldocument.bnd b/javascript/jsapi/htmldocument.bnd index f17190d0c..c29e470c2 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" @@ -46,6 +47,9 @@ binding document { /** location instantiated on first use */ property unshared location; + + /* events through a single interface */ + property unshared type EventHandler; } api finalise %{ @@ -272,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 e1bd2c813..c5fc9a305 100644 --- a/javascript/jsapi/htmlelement.bnd +++ b/javascript/jsapi/htmlelement.bnd @@ -32,14 +32,15 @@ preamble %{ %} binding htmlelement { - type js_libdom; /* the binding type */ + type js_libdom; /* the binding type */ - interface HTMLElement; /* Web IDL interface to generate */ + interface HTMLElement; /* Web IDL interface to generate */ - private "dom_element *" node; - private "struct html_content *" htmlc; + private "dom_element *" node; + private "struct html_content *" htmlc; - property unshared type EventHandler; + /* events through a single interface */ + property unshared type EventHandler; } api finalise %{ diff --git a/utils/corestrings.c b/utils/corestrings.c index ee50757e6..f970c107b 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 e8c9b6f1f..61771c178 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; From e913a58ee77643b46138a3c9db37170ef2ed55af Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 17 Dec 2012 15:15:11 +0000 Subject: [PATCH 74/75] add missing copyright header --- javascript/jsapi/dom.bnd | 10 +++++++++- javascript/jsapi/htmlcollection.bnd | 2 +- javascript/jsapi/nodelist.bnd | 11 ++++------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/javascript/jsapi/dom.bnd b/javascript/jsapi/dom.bnd index 89d0d8449..e781b330c 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 + * + * 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 f4a11549b..5e99e48b8 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/nodelist.bnd b/javascript/jsapi/nodelist.bnd index d6e9fe941..b57dc6e05 100644 --- a/javascript/jsapi/nodelist.bnd +++ b/javascript/jsapi/nodelist.bnd @@ -1,7 +1,4 @@ /* 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 * @@ -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 %{ From 0d803b6c0d252c3a1a9fa07e37d9a0b08ce567b8 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 17 Dec 2012 18:33:08 +0000 Subject: [PATCH 75/75] add coment on superclasses --- javascript/jsapi/htmlelement.bnd | 72 ++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/javascript/jsapi/htmlelement.bnd b/javascript/jsapi/htmlelement.bnd index c5fc9a305..3ede93bbf 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;