From af014bce99d4990f1a0cbb1a779127de0f716a90 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 10 Feb 2014 14:08:45 +0000 Subject: [PATCH] Allow tab creation without history clone. Changes browser_window_create and browser_window_navigate flags. --- amiga/arexx.c | 23 +++--- amiga/context_menu.c | 27 +++---- amiga/download.c | 4 +- amiga/file.c | 4 +- amiga/gui.c | 72 +++++++---------- amiga/menu.c | 10 +-- amiga/tree.c | 4 +- atari/about.c | 3 +- atari/ctxmenu.c | 18 ++--- atari/deskmenu.c | 12 +-- atari/gui.c | 3 +- atari/rootwin.c | 2 +- atari/toolbar.c | 6 +- beos/gui.cpp | 2 +- beos/scaffolding.cpp | 21 +++-- cocoa/BookmarksController.m | 7 +- cocoa/BrowserView.m | 18 ++--- cocoa/BrowserWindowController.m | 5 +- cocoa/NetSurfAppDelegate.m | 12 +-- cocoa/NetsurfApp.m | 3 +- desktop/browser.c | 132 ++++++++++++++++++-------------- desktop/browser.h | 57 ++++++++------ desktop/browser_private.h | 4 +- desktop/frames.c | 10 ++- desktop/global_history.c | 17 ++-- desktop/hotlist.c | 17 ++-- desktop/local_history.c | 6 +- desktop/searchweb.c | 5 +- framebuffer/gui.c | 7 +- gtk/dialogs/about.c | 8 +- gtk/dialogs/source.c | 3 +- gtk/gui.c | 3 +- gtk/scaffolding.c | 53 ++++++------- javascript/jsapi/location.bnd | 8 +- monkey/browser.c | 7 +- render/form.c | 12 +-- render/html_interaction.c | 8 +- riscos/dialog.c | 3 +- riscos/gui.c | 14 ++-- riscos/gui/url_bar.c | 4 +- riscos/iconbar.c | 7 +- riscos/uri.c | 3 +- riscos/url_complete.c | 4 +- riscos/url_protocol.c | 3 +- riscos/window.c | 43 +++++------ windows/gui.c | 14 ++-- windows/main.c | 3 +- 47 files changed, 339 insertions(+), 372 deletions(-) diff --git a/amiga/arexx.c b/amiga/arexx.c index 472aea1ce..515ee6d00 100644 --- a/amiga/arexx.c +++ b/amiga/arexx.c @@ -248,8 +248,8 @@ STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu browser_window_navigate(curbw, url, NULL, - BROWSER_WINDOW_DOWNLOAD | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_DOWNLOAD | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -257,9 +257,8 @@ STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu } else if(cmd->ac_ArgList[2]) { - browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_TAB, + browser_window_create(BW_CREATE_HISTORY | + BW_CREATE_TAB, url, NULL, bw, @@ -267,8 +266,7 @@ STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu } else if(cmd->ac_ArgList[1]) { - browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -281,16 +279,15 @@ STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu browser_window_navigate(bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); } else { - browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -510,8 +507,8 @@ STATIC VOID rx_home(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu browser_window_navigate(bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); diff --git a/amiga/context_menu.c b/amiga/context_menu.c index a1ce624e5..0662a2c33 100644 --- a/amiga/context_menu.c +++ b/amiga/context_menu.c @@ -779,8 +779,7 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved case CMID_URLOPENWIN: error = nsurl_create(userdata, &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_CLONE | BW_CREATE_HISTORY, url, hlcache_handle_get_url(gwin->bw->current_content), gwin->bw, @@ -798,9 +797,7 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved case CMID_URLOPENTAB: error = nsurl_create(userdata, &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_TAB, + error = browser_window_create(BW_CREATE_CLONE | BW_CREATE_HISTORY | BW_CREATE_TAB, url, hlcache_handle_get_url(gwin->bw->current_content), gwin->bw, @@ -823,8 +820,8 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved browser_window_navigate(gwin->bw, url, hlcache_handle_get_url(gwin->bw->current_content), - BROWSER_WINDOW_DOWNLOAD | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_DOWNLOAD | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -838,8 +835,8 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved browser_window_navigate(gwin->bw, hlcache_handle_get_url(userdata), hlcache_handle_get_url(gwin->bw->current_content), - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -855,8 +852,8 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved browser_window_navigate(gwin->bw, url, hlcache_handle_get_url(gwin->bw->current_content), - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -931,8 +928,8 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved browser_window_navigate(gwin->bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -1002,8 +999,8 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved browser_window_navigate(gwin->bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); diff --git a/amiga/download.c b/amiga/download.c index a65fad99f..a716d3862 100644 --- a/amiga/download.c +++ b/amiga/download.c @@ -274,8 +274,8 @@ static void gui_download_window_done(struct gui_download_window *dw) browser_window_navigate(bw, url, NULL, - BROWSER_WINDOW_DOWNLOAD | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_DOWNLOAD | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); diff --git a/amiga/file.c b/amiga/file.c index 9500b4084..8cf460f61 100644 --- a/amiga/file.c +++ b/amiga/file.c @@ -103,8 +103,8 @@ void ami_file_open(struct gui_window_2 *gwin) browser_window_navigate(gwin->bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); diff --git a/amiga/gui.c b/amiga/gui.c index aebdf3ade..137e1593b 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -904,8 +904,7 @@ static void gui_init2(int argc, char** argv) if(temp_homepage_url && notalreadyrunning) { error = nsurl_create(temp_homepage_url, &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -950,8 +949,7 @@ static void gui_init2(int argc, char** argv) if (error == NSERROR_OK) { if(!first) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -961,8 +959,7 @@ static void gui_init2(int argc, char** argv) } else { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_CLONE | BW_CREATE_HISTORY, url, NULL, bw, @@ -1044,8 +1041,7 @@ static void gui_init2(int argc, char** argv) if(!bw && (nsoption_bool(startup_no_window) == false)) { error = nsurl_create(nsoption_charp(homepage_url), &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -1859,8 +1855,8 @@ void ami_handle_msg(void) browser_window_navigate(gwin->bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -1886,8 +1882,8 @@ void ami_handle_msg(void) browser_window_navigate(gwin->bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -1904,8 +1900,8 @@ void ami_handle_msg(void) browser_window_navigate(gwin->bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -1992,8 +1988,7 @@ void ami_handle_msg(void) error = nsurl_create(nsoption_charp(homepage_url), &urlns); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_CLONE | BW_CREATE_HISTORY, urlns, NULL, gwin->bw, @@ -2014,9 +2009,8 @@ void ami_handle_msg(void) error = nsurl_create(nsoption_charp(homepage_url), &urlns); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_TAB, + error = browser_window_create(BW_CREATE_CLONE | BW_CREATE_HISTORY | + BW_CREATE_TAB, urlns, NULL, gwin->bw, @@ -2388,8 +2382,8 @@ void ami_handle_appmsg(void) browser_window_navigate(gwin->bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -2398,9 +2392,8 @@ void ami_handle_appmsg(void) } else { - browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_TAB, + browser_window_create(BW_CREATE_CLONE | BW_CREATE_HISTORY | + BW_CREATE_TAB, url, NULL, gwin->bw, @@ -2429,8 +2422,8 @@ void ami_handle_appmsg(void) browser_window_navigate(gwin->bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -2439,9 +2432,8 @@ void ami_handle_appmsg(void) } else { - browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_TAB, + browser_window_create(BW_CREATE_CLONE | BW_CREATE_HISTORY | + BW_CREATE_TAB, url, NULL, gwin->bw, @@ -2480,8 +2472,7 @@ void ami_handle_applib(void) error = nsurl_create(nsoption_charp(homepage_url), &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -2504,8 +2495,7 @@ void ami_handle_applib(void) error = nsurl_create(tempurl, &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -3202,9 +3192,8 @@ nserror ami_gui_new_blank_tab(struct gui_window_2 *gwin) error = nsurl_create(nsoption_charp(homepage_url), &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_TAB, + error = browser_window_create(BW_CREATE_HISTORY | + BW_CREATE_TAB, url, NULL, gwin->bw, @@ -3216,10 +3205,6 @@ nserror ami_gui_new_blank_tab(struct gui_window_2 *gwin) return error; } - /* Front end /really/ should not be doing this. */ - history_destroy(bw->history); - bw->history = history_create(bw); - return NSERROR_OK; } @@ -4965,8 +4950,7 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg GetSpeedButtonNodeAttrs(node, SBNA_UserData, (ULONG *)&url, TAG_DONE); if(gwin->key_state & BROWSER_MOUSE_MOD_2) { - browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_TAB, + browser_window_create(BW_CREATE_TAB, url, NULL, gwin->bw, @@ -4975,8 +4959,8 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg browser_window_navigate(gwin->bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); diff --git a/amiga/menu.c b/amiga/menu.c index 26f5c2b81..9b3c44d30 100644 --- a/amiga/menu.c +++ b/amiga/menu.c @@ -698,8 +698,7 @@ static void ami_menu_item_project_newwin(struct Hook *hook, APTR window, struct error = nsurl_create(nsoption_charp(homepage_url), &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -811,8 +810,7 @@ static void ami_menu_item_project_about(struct Hook *hook, APTR window, struct I if(url) { if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -1036,8 +1034,8 @@ static void ami_menu_item_hotlist_entries(struct Hook *hook, APTR window, struct browser_window_navigate(gwin->bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); diff --git a/amiga/tree.c b/amiga/tree.c index 42eae4fa6..38b63388c 100644 --- a/amiga/tree.c +++ b/amiga/tree.c @@ -322,8 +322,8 @@ void ami_tree_drag_end(struct treeview_window *twin, int x, int y) browser_window_navigate(gwin->bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); diff --git a/atari/about.c b/atari/about.c index f09dfb358..6e98058ef 100644 --- a/atari/about.c +++ b/atari/about.c @@ -170,8 +170,7 @@ void atari_about_show(void) if (goto_url != NULL) { nserr = nsurl_create(goto_url, &url); if (nserr == NSERROR_OK) { - nserr = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + nserr = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, diff --git a/atari/ctxmenu.c b/atari/ctxmenu.c index ae918c6a5..37c96ef86 100644 --- a/atari/ctxmenu.c +++ b/atari/ctxmenu.c @@ -238,8 +238,8 @@ void context_popup(struct gui_window * gw, short x, short y) gw->browser->bw, hlcache_handle_get_url(ctx->ccdata.object), hlcache_handle_get_url(gw->browser->bw->current_content), - BROWSER_WINDOW_DOWNLOAD | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_DOWNLOAD | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL @@ -258,8 +258,8 @@ void context_popup(struct gui_window * gw, short x, short y) gw->browser->bw, url, hlcache_handle_get_url(gw->browser->bw->current_content), - BROWSER_WINDOW_DOWNLOAD | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_DOWNLOAD | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL @@ -293,11 +293,11 @@ void context_popup(struct gui_window * gw, short x, short y) nsurl *url; nserror error; - error = nsurl_create(ctx->ccdata.link_url, &url); - if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, - url, + error = nsurl_create(ctx->ccdata.link_url, &url); + if (error == NSERROR_OK) { + error = browser_window_create( + BW_CREATE_HISTORY | BW_CREATE_CLONE, + url, hlcache_handle_get_url(gw->browser->bw->current_content), gw->browser->bw, NULL diff --git a/atari/deskmenu.c b/atari/deskmenu.c index a11940827..6a8376def 100644 --- a/atari/deskmenu.c +++ b/atari/deskmenu.c @@ -170,8 +170,7 @@ static void __CDECL menu_about(short item, short title, void *data) error = nsurl_create(buf, &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -202,8 +201,7 @@ static void __CDECL menu_new_win(short item, short title, void *data) /* create an initial browser window */ error = nsurl_create(addr, &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -224,8 +222,7 @@ static void __CDECL menu_open_url(short item, short title, void *data) gw = input_window; if( gw == NULL ) { - browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + browser_window_create(BW_CREATE_HISTORY, NULL, NULL, NULL, @@ -256,8 +253,7 @@ static void __CDECL menu_open_file(short item, short title, void *data) error = nsurl_create(urltxt, &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, diff --git a/atari/gui.c b/atari/gui.c index e43aecbcf..fe927e2bd 100644 --- a/atari/gui.c +++ b/atari/gui.c @@ -1172,8 +1172,7 @@ int main(int argc, char** argv) /* create an initial browser window */ ret = nsurl_create(addr, &url); if (ret == NSERROR_OK) { - ret = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + ret = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, diff --git a/atari/rootwin.c b/atari/rootwin.c index be9846f1b..4ab744271 100755 --- a/atari/rootwin.c +++ b/atari/rootwin.c @@ -1537,7 +1537,7 @@ static void on_file_dropped(ROOTWIN *rootwin, short msg[8]) if ((tmp_url != NULL) && nsurl_create(tmp_url, &ns_url) == NSERROR_OK) { browser_window_navigate(gw->browser->bw, ns_url, NULL, - BROWSER_WINDOW_HISTORY | BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); nsurl_unref(ns_url); } diff --git a/atari/toolbar.c b/atari/toolbar.c index 9a49fbfea..1c3126b13 100644 --- a/atari/toolbar.c +++ b/atari/toolbar.c @@ -715,7 +715,7 @@ bool toolbar_key_input(struct s_toolbar *tb, short nkc) warn_user("NoMemory", 0); } else { browser_window_navigate(gw->browser->bw, url, NULL, - BROWSER_WINDOW_HISTORY | BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); nsurl_unref(url); } @@ -1001,8 +1001,8 @@ void toolbar_home_click(struct s_toolbar *tb) browser_window_navigate(bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); diff --git a/beos/gui.cpp b/beos/gui.cpp index c2eadaa49..b40e6bd75 100644 --- a/beos/gui.cpp +++ b/beos/gui.cpp @@ -645,7 +645,7 @@ static void gui_init(int argc, char** argv) error = nsurl_create(addr, &url); if (error == NSERROR_OK) { error = browser_window_create((browser_window_nav_flags) - (BROWSER_WINDOW_VERIFIABLE | BROWSER_WINDOW_HISTORY), + BW_CREATE_HISTORY, url, NULL, NULL, diff --git a/beos/scaffolding.cpp b/beos/scaffolding.cpp index 0a362ce62..1561cb26c 100644 --- a/beos/scaffolding.cpp +++ b/beos/scaffolding.cpp @@ -888,10 +888,10 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m if (/*message->WasDropped() &&*/ i == 0) { browser_window_navigate(bw, nsurl, NULL, (browser_window_nav_flags) - (BROWSER_WINDOW_HISTORY | BROWSER_WINDOW_VERIFIABLE), + (BW_NAVIGATE_HISTORY | BW_NAVIGATE_VERIFIABLE), NULL, NULL, NULL); } else { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE, + error = browser_window_create(BW_CREATE_CLONE, nsurl, NULL, bw, @@ -915,7 +915,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m for (i = 1; message->FindString("argv", i, &urltxt) >= B_OK; i++) { error = nsurl_create(urltxt.String(), &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE, + error = browser_window_create(BW_CREATE_CLONE, url, NULL, bw, @@ -949,8 +949,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m browser_window_navigate(bw, nsurl, NULL, - (browser_window_nav_flags)(BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE), + (browser_window_nav_flags)(BW_NAVIGATE_HISTORY), NULL, NULL, NULL); @@ -1020,8 +1019,8 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m browser_window_navigate(bw, url, NULL, - (browser_window_nav_flags)(BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE), + (browser_window_nav_flags)(BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE), NULL, NULL, NULL); @@ -1049,8 +1048,8 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m browser_window_navigate(bw, url, NULL, - (browser_window_nav_flags)(BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE), + (browser_window_nav_flags)(BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE), NULL, NULL, NULL); @@ -1133,7 +1132,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m error = nsurl_create(text.String(), &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE, + error = browser_window_create(BW_CREATE_CLONE, url, NULL, bw, @@ -1269,7 +1268,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m if (nserr == NSERROR_OK) { nserr = browser_window_navigate(bw, url, NULL, - (browser_window_nav_flags)(BROWSER_WINDOW_HISTORY | BROWSER_WINDOW_VERIFIABLE), + (browser_window_nav_flags)(BW_NAVIGATE_HISTORY | BW_NAVIGATE_VERIFIABLE), NULL, NULL, NULL); nsurl_unref(url); } diff --git a/cocoa/BookmarksController.m b/cocoa/BookmarksController.m index 7d7173fd8..4ba66ddfa 100644 --- a/cocoa/BookmarksController.m +++ b/cocoa/BookmarksController.m @@ -142,14 +142,13 @@ static const char *cocoa_hotlist_path( void ) error = browser_window_navigate([tab browser], url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); } else { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, diff --git a/cocoa/BrowserView.m b/cocoa/BrowserView.m index 24214128e..d525832db 100644 --- a/cocoa/BrowserView.m +++ b/cocoa/BrowserView.m @@ -581,9 +581,9 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt ) error = nsurl_create([[sender representedObject] UTF8String], &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_TAB, + error = browser_window_create(BW_CREATE_HISTORY | + BW_CREATE_TAB | + BW_CREATE_CLONE, url, NULL, browser, @@ -602,8 +602,8 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt ) error = nsurl_create([[sender representedObject] UTF8String], &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY | + BW_CREATE_CLONE, url, NULL, browser, @@ -623,8 +623,8 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt ) browser_window_navigate(browser, url, NULL, - BROWSER_WINDOW_DOWNLOAD | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_DOWNLOAD | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -688,8 +688,8 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt ) browser_window_navigate(browser, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_DOWNLOAD | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); diff --git a/cocoa/BrowserWindowController.m b/cocoa/BrowserWindowController.m index 36b7164ce..1d70778a1 100644 --- a/cocoa/BrowserWindowController.m +++ b/cocoa/BrowserWindowController.m @@ -161,9 +161,8 @@ error = nsurl_create(NETSURF_HOMEPAGE, &url); } if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_TAB, + error = browser_window_create(BW_CREATE_HISTORY | + BW_CREATE_TAB, url, NULL, [activeBrowser browser], diff --git a/cocoa/NetSurfAppDelegate.m b/cocoa/NetSurfAppDelegate.m index c326c9dd6..e17353529 100644 --- a/cocoa/NetSurfAppDelegate.m +++ b/cocoa/NetSurfAppDelegate.m @@ -51,8 +51,7 @@ } if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -75,8 +74,7 @@ for (NSURL *url in [openPanel URLs]) { error = nsurl_create([[url absoluteString] UTF8String], &u); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, u, NULL, NULL, @@ -98,8 +96,7 @@ error = nsurl_create([urlAsString UTF8String], &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -182,8 +179,7 @@ error = nsurl_create([[urltxt absoluteString] UTF8String], &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, diff --git a/cocoa/NetsurfApp.m b/cocoa/NetsurfApp.m index 5c359114c..88424220d 100644 --- a/cocoa/NetsurfApp.m +++ b/cocoa/NetsurfApp.m @@ -231,8 +231,7 @@ int main( int argc, char **argv ) error = nsurl_create(argv[i], &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, diff --git a/desktop/browser.c b/desktop/browser.c index 5a6cfc727..9bff58b5a 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -690,66 +690,81 @@ static bool slow_script(void *ctx) } /* exported interface, documented in desktop/browser.h */ - -nserror -browser_window_create(enum browser_window_nav_flags flags, - nsurl *url, - nsurl *referrer, - struct browser_window *clone, - struct browser_window **ret_bw) +nserror browser_window_create(enum browser_window_create_flags flags, + nsurl *url, nsurl *referrer, + struct browser_window *existing, + struct browser_window **bw) { - struct browser_window *bw; + gui_window_create_flags gw_flags = GW_CREATE_NONE; + struct browser_window *ret; - /* caller must provide window to clone or be adding to history */ - assert(clone || - ((flags & BROWSER_WINDOW_HISTORY) != 0)); + /* Check parameters */ + if (flags & (BW_CREATE_TAB | BW_CREATE_CLONE)) { + if (existing == NULL) { + assert(0 && "Failed: No existing window provided."); + return NSERROR_BAD_PARAMETER; + } + } + if (!(flags & BW_CREATE_HISTORY)) { + if (!(flags & BW_CREATE_CLONE) || existing == NULL) { + assert(0 && "Failed: Must have existing for history."); + return NSERROR_BAD_PARAMETER; + } + } - if ((bw = calloc(1, sizeof(struct browser_window))) == NULL) { + if ((ret = calloc(1, sizeof(struct browser_window))) == NULL) { warn_user("NoMemory", 0); return NSERROR_NOMEM; } /* new javascript context for window */ - bw->jsctx = js_newcontext(nsoption_int(script_timeout), + ret->jsctx = js_newcontext(nsoption_int(script_timeout), slow_script, NULL); /* Initialise common parts */ - browser_window_initialise_common(bw, clone); + browser_window_initialise_common(flags, ret, existing); /* window characteristics */ - bw->browser_window_type = BROWSER_WINDOW_NORMAL; - bw->scrolling = SCROLLING_YES; - bw->border = true; - bw->no_resize = true; - bw->last_action = wallclock(); - bw->focus = bw; + ret->browser_window_type = BROWSER_WINDOW_NORMAL; + ret->scrolling = SCROLLING_YES; + ret->border = true; + ret->no_resize = true; + ret->last_action = wallclock(); + ret->focus = ret; - /* gui window */ - /* from the front end's pov, it clones the top level browser window, - * so find that. */ - clone = browser_window_get_root(clone); + /* The existing gui_window is on the top-level existing + * browser_window. */ + existing = browser_window_get_root(existing); - bw->window = guit->window->create(bw, - (clone != NULL) ? clone->window : NULL, - ((flags & BROWSER_WINDOW_TAB) ? - GW_CREATE_TAB : GW_CREATE_NONE) | - ((clone != NULL) ? - GW_CREATE_CLONE : GW_CREATE_NONE)); + /* Set up gui_window creation flags */ + if (flags & BW_CREATE_TAB) + gw_flags |= GW_CREATE_TAB; + if (flags & BW_CREATE_CLONE) + gw_flags |= GW_CREATE_CLONE; - if (bw->window == NULL) { - browser_window_destroy(bw); + ret->window = guit->window->create(ret, + (existing != NULL) ? existing->window : NULL, + gw_flags); + + if (ret->window == NULL) { + browser_window_destroy(ret); return NSERROR_BAD_PARAMETER; } if (url != NULL) { - flags |= BROWSER_WINDOW_VERIFIABLE; - browser_window_navigate(bw, url, referrer, flags, NULL, NULL, NULL); + enum browser_window_nav_flags nav_flags = BW_NAVIGATE_NONE; + if (!(flags & BW_CREATE_UNVERIFIABLE)) + nav_flags |= BW_NAVIGATE_VERIFIABLE; + if (flags & BW_CREATE_HISTORY) + nav_flags |= BW_NAVIGATE_HISTORY; + browser_window_navigate(ret, url, referrer, nav_flags, NULL, + NULL, NULL); } - if (ret_bw != NULL) { - *ret_bw = bw; + if (bw != NULL) { + *bw = ret; } return NSERROR_OK; @@ -759,18 +774,21 @@ browser_window_create(enum browser_window_nav_flags flags, /** * Initialise common parts of a browser window * - * \param bw The window to initialise - * \param clone The window to clone, or NULL if none + * \param flags Flags to control operation + * \param bw The window to initialise + * \param existing The existing window if cloning, else NULL */ -void browser_window_initialise_common(struct browser_window *bw, - struct browser_window *clone) +void browser_window_initialise_common(enum browser_window_create_flags flags, + struct browser_window *bw, struct browser_window *existing) { assert(bw); - if (!clone) + if (flags & BW_CREATE_CLONE) { + assert(existing != NULL); + bw->history = history_clone(existing->history, bw); + } else { bw->history = history_create(bw); - else - bw->history = history_clone(clone->history, bw); + } /* window characteristics */ bw->refresh_interval = -1; @@ -1091,7 +1109,7 @@ static void browser_window_refresh(void *p) nsurl *url; nsurl *refresh; hlcache_handle *parent = NULL; - enum browser_window_nav_flags flags = BROWSER_WINDOW_NONE; + enum browser_window_nav_flags flags = BW_NAVIGATE_NONE; assert(bw->current_content != NULL && (content_get_status(bw->current_content) == @@ -1110,7 +1128,7 @@ static void browser_window_refresh(void *p) url = hlcache_handle_get_url(bw->current_content); if ((url == NULL) || (nsurl_compare(url, refresh, NSURL_COMPLETE))) { - flags |= BROWSER_WINDOW_HISTORY; + flags |= BW_NAVIGATE_HISTORY; } /* Treat an (almost) immediate refresh in a top-level browser window as @@ -1121,7 +1139,7 @@ static void browser_window_refresh(void *p) * all. */ if (bw->refresh_interval <= 100 && bw->parent == NULL) { - flags |= BROWSER_WINDOW_VERIFIABLE; + flags |= BW_NAVIGATE_VERIFIABLE; } else { parent = bw->current_content; } @@ -1794,7 +1812,7 @@ nserror browser_window_navigate(struct browser_window *bw, } /* Set up retrieval parameters */ - if ((flags & BROWSER_WINDOW_VERIFIABLE) != 0) { + if ((flags & BW_NAVIGATE_VERIFIABLE) != 0) { fetch_flags |= LLCACHE_RETRIEVE_VERIFIABLE; } @@ -1818,7 +1836,7 @@ nserror browser_window_navigate(struct browser_window *bw, } /* Get download out of the way */ - if ((flags & BROWSER_WINDOW_DOWNLOAD) != 0) { + if ((flags & BW_NAVIGATE_DOWNLOAD) != 0) { error = browser_window_download(bw, url, referrer, @@ -1863,7 +1881,7 @@ nserror browser_window_navigate(struct browser_window *bw, nsurl_unref(referrer); } - if ((flags & BROWSER_WINDOW_HISTORY) != 0) { + if ((flags & BW_NAVIGATE_HISTORY) != 0) { history_add(bw->history, bw->current_content, bw->frag_id); } @@ -1884,10 +1902,10 @@ nserror browser_window_navigate(struct browser_window *bw, LOG(("Loading '%s'", nsurl_access(url))); browser_window_set_status(bw, messages_get("Loading")); - bw->history_add = (flags & BROWSER_WINDOW_HISTORY); + bw->history_add = (flags & BW_NAVIGATE_HISTORY); /* Verifiable fetches may trigger a download */ - if ((flags & BROWSER_WINDOW_VERIFIABLE) != 0) { + if ((flags & BW_NAVIGATE_VERIFIABLE) != 0) { fetch_flags |= HLCACHE_RETRIEVE_MAY_DOWNLOAD; } @@ -2250,7 +2268,7 @@ void browser_window_reload(struct browser_window *bw, bool all) browser_window_navigate(bw, hlcache_handle_get_url(bw->current_content), NULL, - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -2536,8 +2554,9 @@ struct browser_window *browser_window_find_target(struct browser_window *bw, * OR * - button_2 opens in new tab and the link target is "_blank" */ - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_TAB, + error = browser_window_create(BW_CREATE_TAB | + BW_CREATE_HISTORY | + BW_CREATE_CLONE, NULL, NULL, bw, @@ -2563,7 +2582,8 @@ struct browser_window *browser_window_find_target(struct browser_window *bw, * - button_2 doesn't open in new tabs and the link target is * "_blank" */ - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE, + error = browser_window_create(BW_CREATE_HISTORY | + BW_CREATE_CLONE, NULL, NULL, bw, @@ -2602,7 +2622,7 @@ struct browser_window *browser_window_find_target(struct browser_window *bw, if (!nsoption_bool(target_blank)) return bw; - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE, + error = browser_window_create(BW_CREATE_CLONE | BW_CREATE_HISTORY, NULL, NULL, bw, diff --git a/desktop/browser.h b/desktop/browser.h index 39f8b8901..4cb8e012a 100644 --- a/desktop/browser.h +++ b/desktop/browser.h @@ -62,42 +62,53 @@ typedef enum { extern bool browser_reformat_pending; -/** flags to browser window go */ -enum browser_window_nav_flags { +/** flags to browser_window_create */ +enum browser_window_create_flags { /** No flags set */ - BROWSER_WINDOW_NONE = 0, + BW_CREATE_NONE = 0, /** this will form a new history node (don't set for back/reload/etc) */ - BROWSER_WINDOW_HISTORY = (1 << 0), - - /** download rather than render the uri */ - BROWSER_WINDOW_DOWNLOAD = (1 << 1), - - /** this transaction is verifiable */ - BROWSER_WINDOW_VERIFIABLE = (1 << 2), + BW_CREATE_HISTORY = (1 << 0), /** New gui_window to be tab in same window as "existing" gui_window */ - BROWSER_WINDOW_TAB = (1 << 3), + BW_CREATE_TAB = (1 << 1), /** New gui_window to be clone of "existing" gui_window */ - BROWSER_WINDOW_CLONE = (1 << 4) + BW_CREATE_CLONE = (1 << 2), + + /** Window not opened by user interaction (e.g. JS popup) */ + BW_CREATE_UNVERIFIABLE = (1 << 3), +}; + +/** flags to browser_window_navigate */ +enum browser_window_nav_flags { + /** No flags set */ + BW_NAVIGATE_NONE = 0, + + /** this will form a new history node (don't set for back/reload/etc) */ + BW_NAVIGATE_HISTORY = (1 << 0), + + /** download rather than render the uri */ + BW_NAVIGATE_DOWNLOAD = (1 << 1), + + /** this transaction is verifiable */ + BW_NAVIGATE_VERIFIABLE = (1 << 2) }; /** * Create and open a new root browser window with the given page. * - * \param flags Flags to control operation - * \param url URL to start fetching in the new window or NULL for blank - * \param referer The referring uri or NULL if none - * \param clone The browser window to clone - * \param bw pointer to created browser window or untouched on error. - * \return error code + * \param flags Flags to control operation + * \param url URL to fetch in the new window or NULL for blank + * \param referer The referring uri or NULL if none + * \param existing The an existing bw or NULL, required for some flags. + * \param bw Updated to created browser window or untouched on error. + * \return NSERROR_OK, or appropriate error otherwise. */ -nserror browser_window_create(enum browser_window_nav_flags flags, - nsurl *url, - nsurl *referrer, - struct browser_window *clone, - struct browser_window **bw); +nserror browser_window_create(enum browser_window_create_flags flags, + nsurl *url, nsurl *referrer, + struct browser_window *existing, + struct browser_window **bw); /** * Start fetching a page in a browser window. diff --git a/desktop/browser_private.h b/desktop/browser_private.h index 34891f3bd..9007007a8 100644 --- a/desktop/browser_private.h +++ b/desktop/browser_private.h @@ -165,8 +165,8 @@ struct browser_window { -void browser_window_initialise_common(struct browser_window *bw, - struct browser_window *clone); +void browser_window_initialise_common(enum browser_window_create_flags flags, + struct browser_window *bw, struct browser_window *existing); /** * Update the extent of the inside of a browser window to that of the current diff --git a/desktop/frames.c b/desktop/frames.c index 354c70da4..153c78e34 100644 --- a/desktop/frames.c +++ b/desktop/frames.c @@ -209,7 +209,8 @@ void browser_window_create_iframes(struct browser_window *bw, window = &(bw->iframes[index++]); /* Initialise common parts */ - browser_window_initialise_common(window, NULL); + browser_window_initialise_common(BW_CREATE_NONE, + window, NULL); /* window characteristics */ window->browser_window_type = BROWSER_WINDOW_IFRAME; @@ -251,7 +252,7 @@ void browser_window_create_iframes(struct browser_window *bw, browser_window_navigate(window, cur->url, hlcache_handle_get_url(bw->current_content), - BROWSER_WINDOW_NONE, + BW_NAVIGATE_NONE, NULL, NULL, bw->current_content); @@ -314,7 +315,8 @@ void browser_window_create_frameset(struct browser_window *bw, window = &bw->children[index]; /* Initialise common parts */ - browser_window_initialise_common(window, NULL); + browser_window_initialise_common(BW_CREATE_NONE, + window, NULL); /* window characteristics */ if (frame->children) @@ -387,7 +389,7 @@ void browser_window_create_frameset(struct browser_window *bw, browser_window_navigate(window, frame->url, hlcache_handle_get_url(parent), - BROWSER_WINDOW_HISTORY, + BW_NAVIGATE_HISTORY, NULL, NULL, parent); diff --git a/desktop/global_history.c b/desktop/global_history.c index 9d0e47e34..c29b05145 100644 --- a/desktop/global_history.c +++ b/desktop/global_history.c @@ -676,23 +676,22 @@ static nserror global_history_tree_node_entry_cb( case TREE_MSG_NODE_LAUNCH: { nserror error; - struct browser_window *clone = NULL; - enum browser_window_nav_flags flags = - BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_TAB; + struct browser_window *existing = NULL; + enum browser_window_create_flags flags = + BW_CREATE_HISTORY; - /* TODO: Set clone window, to window that new tab appears in */ + /* TODO: Set existing to window that new tab appears in */ if (msg.data.node_launch.mouse & (BROWSER_MOUSE_MOD_1 | BROWSER_MOUSE_MOD_2) || - clone == NULL) { + existing == NULL) { /* Shift or Ctrl launch, open in new window rather * than tab. */ - flags ^= BROWSER_WINDOW_TAB; + /* TODO: flags ^= BW_CREATE_TAB; */ } - error = browser_window_create(flags, e->url, NULL, clone, NULL); + error = browser_window_create(flags, e->url, NULL, + existing, NULL); if (error != NSERROR_OK) { warn_user(messages_get_errorcode(error), 0); } diff --git a/desktop/hotlist.c b/desktop/hotlist.c index 219a348ef..6814f8d2e 100644 --- a/desktop/hotlist.c +++ b/desktop/hotlist.c @@ -472,23 +472,22 @@ static nserror hotlist_tree_node_entry_cb( case TREE_MSG_NODE_LAUNCH: { nserror error; - struct browser_window *clone = NULL; - enum browser_window_nav_flags flags = - BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_TAB; + struct browser_window *existing = NULL; + enum browser_window_create_flags flags = + BW_CREATE_HISTORY; - /* TODO: Set clone window, to window that new tab appears in */ + /* TODO: Set existing to window that new tab appears in */ if (msg.data.node_launch.mouse & (BROWSER_MOUSE_MOD_1 | BROWSER_MOUSE_MOD_2) || - clone == NULL) { + existing == NULL) { /* Shift or Ctrl launch, open in new window rather * than tab. */ - flags ^= BROWSER_WINDOW_TAB; + /* TODO: flags ^= BW_CREATE_TAB; */ } - error = browser_window_create(flags, e->url, NULL, clone, NULL); + error = browser_window_create(flags, e->url, NULL, + existing, NULL); if (error != NSERROR_OK) { warn_user(messages_get_errorcode(error), 0); } diff --git a/desktop/local_history.c b/desktop/local_history.c index b26f266d6..569fa44e4 100644 --- a/desktop/local_history.c +++ b/desktop/local_history.c @@ -150,6 +150,8 @@ struct history *history_clone(struct history *history, return 0; } + new_history->bw = bw; + return new_history; } @@ -455,13 +457,13 @@ void history_go(struct history *history, struct history_entry *entry, current = history->current; history->current = entry; - browser_window_create(BROWSER_WINDOW_VERIFIABLE, + browser_window_create(BW_CREATE_CLONE, url, NULL, history->bw, NULL); history->current = current; } else { history->current = entry; browser_window_navigate(history->bw, url, NULL, - BROWSER_WINDOW_VERIFIABLE, NULL, NULL, NULL); + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); } nsurl_unref(url); diff --git a/desktop/searchweb.c b/desktop/searchweb.c index bdcb2ba8a..368ad051a 100644 --- a/desktop/searchweb.c +++ b/desktop/searchweb.c @@ -71,9 +71,8 @@ bool search_web_new_window(struct browser_window *bw, const char *searchterm) error = nsurl_create(urltxt, &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_TAB, + error = browser_window_create(BW_CREATE_HISTORY | + BW_CREATE_TAB, url, NULL, bw, diff --git a/framebuffer/gui.c b/framebuffer/gui.c index dc81a577f..09dcdcea3 100644 --- a/framebuffer/gui.c +++ b/framebuffer/gui.c @@ -1097,8 +1097,8 @@ fb_url_enter(void *pw, char *text) browser_window_navigate(bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -1874,8 +1874,7 @@ main(int argc, char** argv) ret = nsurl_create(feurl, &url); if (ret == NSERROR_OK) { - ret = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + ret = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, diff --git a/gtk/dialogs/about.c b/gtk/dialogs/about.c index eb662c873..1ebcb283b 100644 --- a/gtk/dialogs/about.c +++ b/gtk/dialogs/about.c @@ -37,8 +37,8 @@ nsgtk_about_dialog_credits(GtkWidget *button, gpointer data) browser_window_navigate(bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -60,8 +60,8 @@ nsgtk_about_dialog_licence(GtkWidget *button, gpointer data) browser_window_navigate(bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); diff --git a/gtk/dialogs/source.c b/gtk/dialogs/source.c index 4f1839d80..326e3fbc9 100644 --- a/gtk/dialogs/source.c +++ b/gtk/dialogs/source.c @@ -313,8 +313,7 @@ void nsgtk_source_tab_init(GtkWindow *parent, struct browser_window *bw) if (error != NSERROR_OK) { warn_user(messages_get_errorcode(error), 0); } else { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_TAB, + error = browser_window_create(BW_CREATE_TAB, url, NULL, bw, diff --git a/gtk/gui.c b/gtk/gui.c index 11140ce8d..a3bf57cb3 100644 --- a/gtk/gui.c +++ b/gtk/gui.c @@ -462,8 +462,7 @@ static void gui_init(int argc, char** argv, char **respath) /* create an initial browser window */ error = nsurl_create(addr, &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, diff --git a/gtk/scaffolding.c b/gtk/scaffolding.c index c4ea674d8..cd54548c1 100644 --- a/gtk/scaffolding.c +++ b/gtk/scaffolding.c @@ -437,8 +437,8 @@ gboolean nsgtk_window_url_activate_event(GtkWidget *widget, gpointer data) browser_window_navigate(bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -550,8 +550,8 @@ static void nsgtk_openfile_open(const char *filename) browser_window_navigate(bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -578,7 +578,7 @@ MULTIHANDLER(newwindow) error = nsurl_create(addr, &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, bw, @@ -611,8 +611,8 @@ nserror nsgtk_scaffolding_new_tab(struct gui_window *gw) } } - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_TAB, + error = browser_window_create(BW_CREATE_HISTORY | + BW_CREATE_TAB, url, NULL, bw, @@ -959,8 +959,8 @@ MENUHANDLER(savelink) browser_window_navigate(bw, url, NULL, - BROWSER_WINDOW_DOWNLOAD | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_DOWNLOAD | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -986,12 +986,9 @@ MENUHANDLER(link_openwin) error = nsurl_create(current_menu_ctx.link_url, &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, - url, - NULL, - bw, - NULL); + error = browser_window_create( + BW_CREATE_CLONE | BW_CREATE_HISTORY, + url, NULL, bw, NULL); nsurl_unref(url); } if (error != NSERROR_OK) { @@ -1019,13 +1016,9 @@ MENUHANDLER(link_opentab) error = nsurl_create(current_menu_ctx.link_url, &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_TAB, - url, - NULL, - bw, - NULL); + error = browser_window_create(BW_CREATE_CLONE | + BW_CREATE_HISTORY | BW_CREATE_TAB, + url, NULL, bw, NULL); nsurl_unref(url); } if (error != NSERROR_OK) { @@ -1466,8 +1459,8 @@ MULTIHANDLER(home) browser_window_navigate(bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -1583,8 +1576,8 @@ MULTIHANDLER(contents) browser_window_navigate(bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -1605,8 +1598,8 @@ MULTIHANDLER(guide) browser_window_navigate(bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -1627,8 +1620,8 @@ MULTIHANDLER(info) browser_window_navigate(bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); diff --git a/javascript/jsapi/location.bnd b/javascript/jsapi/location.bnd index af76836f5..ef71e1d6f 100644 --- a/javascript/jsapi/location.bnd +++ b/javascript/jsapi/location.bnd @@ -62,8 +62,8 @@ operation assign %{ browser_window_navigate(bw, joined, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -84,7 +84,7 @@ operation replace %{ browser_window_navigate(bw, joined, NULL, - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -129,7 +129,7 @@ setter href %{ browser_window_navigate(bw, joined, NULL, - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); diff --git a/monkey/browser.c b/monkey/browser.c index 9be06dc68..489554305 100644 --- a/monkey/browser.c +++ b/monkey/browser.c @@ -350,8 +350,7 @@ monkey_window_handle_new(int argc, char **argv) error = nsurl_create(argv[2], &url); } if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -410,8 +409,8 @@ monkey_window_handle_go(int argc, char **argv) browser_window_navigate(gw->bw, url, ref_url, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); diff --git a/render/form.c b/render/form.c index 50629c2ac..3c54b418b 100644 --- a/render/form.c +++ b/render/form.c @@ -1711,8 +1711,8 @@ void form_submit(nsurl *page_url, struct browser_window *target, browser_window_navigate(target, action_query, page_url, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -1732,8 +1732,8 @@ void form_submit(nsurl *page_url, struct browser_window *target, browser_window_navigate(target, action_url, page_url, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, data, NULL, NULL); @@ -1743,8 +1743,8 @@ void form_submit(nsurl *page_url, struct browser_window *target, browser_window_navigate(target, action_url, page_url, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, success, NULL); diff --git a/render/html_interaction.c b/render/html_interaction.c index 4d797a040..55eed76c6 100644 --- a/render/html_interaction.c +++ b/render/html_interaction.c @@ -823,8 +823,8 @@ void html_mouse_action(struct content *c, struct browser_window *bw, browser_window_navigate(bw, url, content_get_url(c), - BROWSER_WINDOW_DOWNLOAD | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_DOWNLOAD | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -1003,8 +1003,8 @@ void html_mouse_action(struct content *c, struct browser_window *bw, browser_window_navigate(browser_window_find_target(bw, target, mouse), url, content_get_url(c), - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); diff --git a/riscos/dialog.c b/riscos/dialog.c index 434702384..d259c8771 100644 --- a/riscos/dialog.c +++ b/riscos/dialog.c @@ -775,8 +775,7 @@ bool ro_gui_dialog_openurl_apply(wimp_w w) { error = nsurl_create(url2, &url); free(url2); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, diff --git a/riscos/gui.c b/riscos/gui.c index 83add251f..e3826353d 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -941,8 +941,7 @@ static void gui_init2(int argc, char** argv) errorns = nsurl_create(url, &urlns); if (errorns == NSERROR_OK) { - errorns = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + errorns = browser_window_create(BW_CREATE_HISTORY, urlns, NULL, NULL, @@ -1516,8 +1515,8 @@ void ro_msg_dataload(wimp_message *message) error = browser_window_navigate(g->bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -1529,9 +1528,7 @@ void ro_msg_dataload(wimp_message *message) ro_gui_hotlist_url_drop(message, urltxt); #endif } else { - error = browser_window_create( - BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -1906,8 +1903,7 @@ void ro_msg_dataopen(wimp_message *message) free(url); if (error == NSERROR_OK) { /* create a new window with the file */ - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, urlns, NULL, NULL, diff --git a/riscos/gui/url_bar.c b/riscos/gui/url_bar.c index 304a6bf20..18bcb31fa 100644 --- a/riscos/gui/url_bar.c +++ b/riscos/gui/url_bar.c @@ -857,8 +857,8 @@ bool ro_gui_url_bar_menu_select(struct url_bar *url_bar, wimp_i i, browser_window_navigate(g->bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); diff --git a/riscos/iconbar.c b/riscos/iconbar.c index 7e3d73230..e0949b365 100644 --- a/riscos/iconbar.c +++ b/riscos/iconbar.c @@ -135,8 +135,7 @@ bool ro_gui_iconbar_click(wimp_pointer *pointer) /* create an initial browser window */ if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -206,9 +205,7 @@ bool ro_gui_iconbar_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, case HELP_OPEN_CONTENTS: error = nsurl_create("http://www.netsurf-browser.org/documentation/", &url); if (error == NSERROR_OK) { - error = browser_window_create( - BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, diff --git a/riscos/uri.c b/riscos/uri.c index 70f75bc09..bf789ee17 100644 --- a/riscos/uri.c +++ b/riscos/uri.c @@ -74,8 +74,7 @@ void ro_uri_message_received(wimp_message *msg) error = nsurl_create(uri_requested, &url); free(uri_requested); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, diff --git a/riscos/url_complete.c b/riscos/url_complete.c index 01774f62f..6d99016f1 100644 --- a/riscos/url_complete.c +++ b/riscos/url_complete.c @@ -734,8 +734,8 @@ bool ro_gui_url_complete_click(wimp_pointer *pointer) browser_window_navigate(g->bw, url_complete_matches[url_complete_matches_selection], NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); diff --git a/riscos/url_protocol.c b/riscos/url_protocol.c index 171b6205f..76d403147 100644 --- a/riscos/url_protocol.c +++ b/riscos/url_protocol.c @@ -126,8 +126,7 @@ void ro_url_message_received(wimp_message *message) } /* create new browser window */ - errorns = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + errorns = browser_window_create(BW_CREATE_HISTORY, nsurl, NULL, NULL, diff --git a/riscos/window.c b/riscos/window.c index f638b349d..27fdb39fa 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -1923,8 +1923,7 @@ bool ro_gui_window_handle_local_keypress(struct gui_window *g, wimp_key *key, { error = nsurl_create("http://www.netsurf-browser.org/documentation/", &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -2673,8 +2672,7 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, case HELP_OPEN_CONTENTS: error = nsurl_create("http://www.netsurf-browser.org/documentation/", &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -2686,8 +2684,7 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, case HELP_OPEN_GUIDE: error = nsurl_create("http://www.netsurf-browser.org/documentation/guide", &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -2699,8 +2696,7 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, case HELP_OPEN_INFORMATION: error = nsurl_create("http://www.netsurf-browser.org/documentation/info", &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -2712,8 +2708,7 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, case HELP_OPEN_CREDITS: error = nsurl_create("about:credits", &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -2725,8 +2720,7 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, case HELP_OPEN_LICENCE: error = nsurl_create("about:licence", &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, @@ -2837,8 +2831,8 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, error = browser_window_navigate(bw, url, hlcache_handle_get_url(h), - BROWSER_WINDOW_DOWNLOAD | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_DOWNLOAD | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -2851,8 +2845,9 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, if (current_menu_url != NULL) { error = nsurl_create(current_menu_url, &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create( + BW_CREATE_HISTORY | + BW_CREATE_CLONE, url, hlcache_handle_get_url(h), bw, @@ -3728,7 +3723,8 @@ void ro_gui_window_toolbar_click(void *data, hlcache_handle *h = g->bw->current_content; nserror error; - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE, + error = browser_window_create( + BW_CREATE_HISTORY | BW_CREATE_CLONE, NULL, NULL, g->bw, @@ -4010,8 +4006,7 @@ void ro_gui_window_launch_url(struct gui_window *g, const char *url1) browser_window_navigate(g->bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_CREATE_HISTORY, NULL, NULL, NULL); @@ -4051,8 +4046,8 @@ bool ro_gui_window_navigate_up(struct gui_window *g, const char *url) browser_window_navigate(g->bw, parent, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -4088,8 +4083,8 @@ void ro_gui_window_action_home(struct gui_window *g) error = browser_window_navigate(g->bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -4114,7 +4109,7 @@ void ro_gui_window_action_new_window(struct gui_window *g) if (g == NULL || g->bw == NULL || g->bw->current_content == NULL) return; - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE, + error = browser_window_create(BW_CREATE_CLONE, hlcache_handle_get_url(g->bw->current_content), NULL, g->bw, diff --git a/windows/gui.c b/windows/gui.c index 46a557ada..51038a73b 100644 --- a/windows/gui.c +++ b/windows/gui.c @@ -133,8 +133,8 @@ nsws_window_go(HWND hwnd, const char *urltxt) browser_window_navigate(gw->bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -762,7 +762,7 @@ nsws_window_command(HWND hwnd, break; case IDM_FILE_OPEN_WINDOW: - browser_window_create(BROWSER_WINDOW_VERIFIABLE, + browser_window_create(BW_CREATE_NONE, NULL, NULL, gw->bw, @@ -876,8 +876,8 @@ nsws_window_command(HWND hwnd, browser_window_navigate(gw->bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); @@ -1045,8 +1045,8 @@ nsws_window_command(HWND hwnd, browser_window_navigate(gw->bw, url, NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, + BW_NAVIGATE_HISTORY | + BW_NAVIGATE_VERIFIABLE, NULL, NULL, NULL); diff --git a/windows/main.c b/windows/main.c index 6a53e0c72..19cd44a43 100644 --- a/windows/main.c +++ b/windows/main.c @@ -189,8 +189,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hLastInstance, LPSTR lpcli, int ncmd) error = nsurl_create(addr, &url); if (error == NSERROR_OK) { - error = browser_window_create(BROWSER_WINDOW_VERIFIABLE | - BROWSER_WINDOW_HISTORY, + error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL,