mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-22 22:41:30 +03:00
Allow tab creation without history clone. Changes browser_window_create and browser_window_navigate flags.
This commit is contained in:
parent
9720c02483
commit
af014bce99
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
72
amiga/gui.c
72
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);
|
||||
|
10
amiga/menu.c
10
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);
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
@ -295,8 +295,8 @@ void context_popup(struct gui_window * gw, short x, short y)
|
||||
|
||||
error = nsurl_create(ctx->ccdata.link_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(gw->browser->bw->current_content),
|
||||
gw->browser->bw,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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],
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
14
riscos/gui.c
14
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,
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user