Browser: Rename function to access bw URL.

This commit is contained in:
Michael Drake 2018-07-23 10:47:26 +01:00
parent aa95a75332
commit 09b015bf11
13 changed files with 35 additions and 35 deletions

View File

@ -28,7 +28,7 @@ init Window(struct browser_window *win, struct html_content *htmlc)
NSLOG(netsurf, INFO, "win=%p htmlc=%p", priv->win, priv->htmlc);
NSLOG(netsurf, INFO,
"URL is %s", nsurl_access(browser_window_get_url(priv->win)));
"URL is %s", nsurl_access(browser_window_access_url(priv->win)));
%}
prototype Window()

View File

@ -2225,7 +2225,7 @@ nserror browser_window_navigate_up(struct browser_window *bw, bool new_window)
if (bw == NULL)
return NSERROR_BAD_PARAMETER;
current = browser_window_get_url(bw);
current = browser_window_access_url(bw);
err = nsurl_parent(current, &parent);
if (err != NSERROR_OK) {
@ -2251,8 +2251,8 @@ nserror browser_window_navigate_up(struct browser_window *bw, bool new_window)
}
/* Exported interface, documented in browser.h */
nsurl* browser_window_get_url(struct browser_window *bw)
/* Exported interface, documented in include/netsurf/browser_window.h */
nsurl* browser_window_access_url(struct browser_window *bw)
{
assert(bw != NULL);

View File

@ -366,7 +366,7 @@ RXHOOKF(rx_save)
FWrite(fh, source_data, 1, source_size);
FClose(fh);
SetComment((char *)cmd->ac_ArgList[0], nsurl_access(browser_window_get_url(gw->bw)));
SetComment((char *)cmd->ac_ArgList[0], nsurl_access(browser_window_access_url(gw->bw)));
}
ami_reset_pointer(gw->shared);
@ -395,7 +395,7 @@ RXHOOKF(rx_geturl)
if(gw && gw->bw)
{
strcpy(result, nsurl_access(browser_window_get_url(gw->bw)));
strcpy(result, nsurl_access(browser_window_access_url(gw->bw)));
}
else
{

View File

@ -146,7 +146,7 @@ HOOKF(void, ami_ctxmenu_item_urlopentab, APTR, window, struct IntuiMessage *)
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
nserror error = browser_window_create(BW_CREATE_CLONE | BW_CREATE_HISTORY | BW_CREATE_TAB,
url,
browser_window_get_url(gwin->gw->bw),
browser_window_access_url(gwin->gw->bw),
gwin->gw->bw,
&bw);
@ -163,7 +163,7 @@ HOOKF(void, ami_ctxmenu_item_urlopenwin, APTR, window, struct IntuiMessage *)
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
nserror error = browser_window_create(BW_CREATE_CLONE | BW_CREATE_HISTORY,
url,
browser_window_get_url(gwin->gw->bw),
browser_window_access_url(gwin->gw->bw),
gwin->gw->bw,
&bw);
@ -180,7 +180,7 @@ HOOKF(void, ami_ctxmenu_item_urldownload, APTR, window, struct IntuiMessage *)
browser_window_navigate(gwin->gw->bw,
url,
browser_window_get_url(gwin->gw->bw),
browser_window_access_url(gwin->gw->bw),
BW_NAVIGATE_DOWNLOAD,
NULL,
NULL,
@ -200,7 +200,7 @@ HOOKF(void, ami_ctxmenu_item_objshow, APTR, window, struct IntuiMessage *)
browser_window_navigate(gwin->gw->bw,
hlcache_handle_get_url(hook->h_Data),
browser_window_get_url(gwin->gw->bw),
browser_window_access_url(gwin->gw->bw),
BW_NAVIGATE_HISTORY,
NULL,
NULL,
@ -240,7 +240,7 @@ HOOKF(void, ami_ctxmenu_item_frameshow, APTR, window, struct IntuiMessage *)
browser_window_navigate(gwin->gw->bw,
hlcache_handle_get_url(hook->h_Data),
browser_window_get_url(gwin->gw->bw),
browser_window_access_url(gwin->gw->bw),
BW_NAVIGATE_HISTORY,
NULL,
NULL,

View File

@ -261,7 +261,7 @@ HOOKF(void, ami_menu_item_edit_copy, APTR, window, struct IntuiMessage *)
* the objects containing the values returned (and the
* constness cast away) is safe.
*/
ami_bitmap_set_url(bm, browser_window_get_url(gwin->gw->bw));
ami_bitmap_set_url(bm, browser_window_access_url(gwin->gw->bw));
ami_bitmap_set_title(bm, browser_window_get_title(gwin->gw->bw));
ami_easy_clipboard_bitmap(bm);
}
@ -419,7 +419,7 @@ HOOKF(void, ami_menu_item_hotlist_add, APTR, window, struct IntuiMessage *)
if (bw == NULL || browser_window_has_content(bw) == false)
return;
hotlist_add_url(browser_window_get_url(bw));
hotlist_add_url(browser_window_access_url(bw));
ami_gui_update_hotlist_button(gwin);
}

View File

@ -2142,7 +2142,7 @@ static BOOL ami_gui_opts_event(void *w)
case GID_OPTS_HOMEPAGE_CURRENT:
if(cur_gw) RefreshSetGadgetAttrs((struct Gadget *)gow->objects[GID_OPTS_HOMEPAGE],
gow->win, NULL, STRINGA_TextVal,
nsurl_access(browser_window_get_url(cur_gw->bw)), TAG_DONE);
nsurl_access(browser_window_access_url(cur_gw->bw)), TAG_DONE);
break;
case GID_OPTS_HOMEPAGE_BLANK:

View File

@ -216,7 +216,7 @@ void context_popup(struct gui_window * gw, short x, short y)
browser_window_navigate(
gw->browser->bw,
hlcache_handle_get_url(ctx->ccdata.object),
browser_window_get_url(gw->browser->bw),
browser_window_access_url(gw->browser->bw),
BW_NAVIGATE_DOWNLOAD,
NULL,
NULL,
@ -232,7 +232,7 @@ void context_popup(struct gui_window * gw, short x, short y)
error = browser_window_navigate(
gw->browser->bw,
ctx->ccdata.link,
browser_window_get_url(gw->browser->bw),
browser_window_access_url(gw->browser->bw),
BW_NAVIGATE_DOWNLOAD,
NULL,
NULL,
@ -269,7 +269,7 @@ void context_popup(struct gui_window * gw, short x, short y)
error = browser_window_create(
BW_CREATE_HISTORY | BW_CREATE_CLONE,
ctx->ccdata.link,
browser_window_get_url(gw->browser->bw),
browser_window_access_url(gw->browser->bw),
gw->browser->bw,
NULL);
if (error != NSERROR_OK) {

View File

@ -510,7 +510,7 @@ static void __CDECL menu_add_bookmark(short item, short title, void *data)
if (input_window) {
if( browser_window_has_content(input_window->browser->bw) ){
atari_hotlist_add_page(
nsurl_access(browser_window_get_url(input_window->browser->bw)),
nsurl_access(browser_window_access_url(input_window->browser->bw)),
NULL
);
}

View File

@ -826,7 +826,7 @@ ENTRY_SIGNALS(entryHomePageURL, homepage_url)
G_MODULE_EXPORT void
nsgtk_preferences_setCurrentPage_clicked(GtkButton *button, struct ppref *priv)
{
const gchar *url = nsurl_access(browser_window_get_url(priv->bw));
const gchar *url = nsurl_access(browser_window_access_url(priv->bw));
if (priv->entryHomePageURL != NULL) {
gtk_entry_set_text(GTK_ENTRY(priv->entryHomePageURL), url);

View File

@ -780,7 +780,7 @@ MULTIHANDLER(savepage)
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fc), filter);
gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(fc), filter);
res = nsurl_nice(browser_window_get_url(
res = nsurl_nice(browser_window_access_url(
nsgtk_get_browser_window(g->top_level)), &path, false);
if (res != NSERROR_OK) {
path = strdup(messages_get("SaveText"));
@ -842,7 +842,7 @@ MULTIHANDLER(pdf)
NSLOG(netsurf, INFO, "Print preview (generating PDF) started.");
res = nsurl_nice(browser_window_get_url(bw), &url_name, true);
res = nsurl_nice(browser_window_access_url(bw), &url_name, true);
if (res != NSERROR_OK) {
nsgtk_warning(messages_get_errorcode(res), 0);
return TRUE;
@ -915,7 +915,7 @@ MULTIHANDLER(plaintext)
char *filename;
nserror res;
res = nsurl_nice(browser_window_get_url(
res = nsurl_nice(browser_window_access_url(
nsgtk_get_browser_window(g->top_level)),
&filename, false);
if (res != NSERROR_OK) {
@ -1616,7 +1616,7 @@ MULTIHANDLER(addbookmarks)
if (bw == NULL || !browser_window_has_content(bw))
return TRUE;
hotlist_add_url(browser_window_get_url(bw));
hotlist_add_url(browser_window_access_url(bw));
return TRUE;
}

View File

@ -52,7 +52,7 @@ nserror nsgtk_viewsource(GtkWindow *parent, struct browser_window *bw)
source_data = content_get_source_data(hlcontent, &source_size);
ret = nsurl_nice(browser_window_get_url(bw), &filename, false);
ret = nsurl_nice(browser_window_access_url(bw), &filename, false);
if (ret != NSERROR_OK) {
filename = strdup(messages_get("SaveSource"));
if (filename == NULL) {
@ -60,12 +60,12 @@ nserror nsgtk_viewsource(GtkWindow *parent, struct browser_window *bw)
}
}
title = malloc(strlen(nsurl_access(browser_window_get_url(bw))) + SLEN("Source of - NetSurf") + 1);
title = malloc(strlen(nsurl_access(browser_window_access_url(bw))) + SLEN("Source of - NetSurf") + 1);
if (title == NULL) {
free(filename);
return NSERROR_NOMEM;
}
sprintf(title, "Source of %s - NetSurf", nsurl_access(browser_window_get_url(bw)));
sprintf(title, "Source of %s - NetSurf", nsurl_access(browser_window_access_url(bw)));
ret = utf8_from_enc(source_data,
content_get_encoding(hlcontent, CONTENT_ENCODING_NORMAL),

View File

@ -583,7 +583,7 @@ static void ro_gui_window_action_add_bookmark(struct gui_window *g)
browser_window_has_content(g->bw) == false)
return;
url = browser_window_get_url(g->bw);
url = browser_window_access_url(g->bw);
ro_gui_hotlist_add_page(url);
ro_toolbar_update_hotlist(g->toolbar);
@ -603,7 +603,7 @@ static void ro_gui_window_action_remove_bookmark(struct gui_window *g)
browser_window_has_content(g->bw) == false)
return;
url = browser_window_get_url(g->bw);
url = browser_window_access_url(g->bw);
ro_gui_hotlist_remove_page(url);
}
@ -840,7 +840,7 @@ ro_gui_window_toolbar_click(void *data,
save_type = GUI_SAVE_LINK_TEXT;
ro_gui_drag_save_link(save_type,
browser_window_get_url(g->bw),
browser_window_access_url(g->bw),
browser_window_get_title(g->bw), g);
}
break;
@ -1009,7 +1009,7 @@ static void ro_gui_window_action_new_window(struct gui_window *g)
return;
error = browser_window_create(BW_CREATE_CLONE,
browser_window_get_url(g->bw),
browser_window_access_url(g->bw),
NULL, g->bw, NULL);
if (error != NSERROR_OK) {
@ -1552,7 +1552,7 @@ static void ro_gui_window_close(wimp_w w)
if (pointer.buttons & wimp_CLICK_ADJUST) {
destroy = !ro_gui_shift_pressed();
url = browser_window_get_url(g->bw);
url = browser_window_access_url(g->bw);
if (url != NULL) {
netsurf_nsurl_to_path(url, &filename);
}
@ -2671,7 +2671,7 @@ ro_gui_window_menu_select(wimp_w w,
error = browser_window_navigate(
bw,
current_menu_url,
browser_window_get_url(bw),
browser_window_access_url(bw),
BW_NAVIGATE_DOWNLOAD,
NULL,
NULL,
@ -2684,7 +2684,7 @@ ro_gui_window_menu_select(wimp_w w,
error = browser_window_create(
BW_CREATE_HISTORY | BW_CREATE_CLONE,
current_menu_url,
browser_window_get_url(bw),
browser_window_access_url(bw),
bw,
NULL);
}

View File

@ -200,14 +200,14 @@ bool browser_window_up_available(struct browser_window *bw);
nserror browser_window_navigate_up(struct browser_window *bw, bool new_window);
/**
* Get a browser window's URL.
* Access a browser window's URL. This URL is always without any fragment.
*
* \param bw browser window
* \return pointer to nsurl. Doesn't create a ref for caller.
*
* \note guaranteed to return a valid nsurl ptr, never returns NULL.
*/
struct nsurl* browser_window_get_url(struct browser_window *bw);
struct nsurl* browser_window_access_url(struct browser_window *bw);
/**
* Get the title of a browser_window.