NetSurf
Macros | Functions
browser_window.c File Reference

Browser window creation and manipulation implementation. More...

#include "utils/config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <nsutils/time.h>
#include "utils/errors.h"
#include "utils/log.h"
#include "utils/corestrings.h"
#include "utils/messages.h"
#include "utils/nsoption.h"
#include "netsurf/types.h"
#include "netsurf/browser_window.h"
#include "netsurf/window.h"
#include "netsurf/misc.h"
#include "netsurf/content.h"
#include "netsurf/search.h"
#include "netsurf/plotters.h"
#include "content/content.h"
#include "content/hlcache.h"
#include "content/urldb.h"
#include "content/content_debug.h"
#include "html/html.h"
#include "html/form_internal.h"
#include "javascript/js.h"
#include "desktop/browser_private.h"
#include "desktop/scrollbar.h"
#include "desktop/gui_internal.h"
#include "desktop/download.h"
#include "desktop/frames.h"
#include "desktop/global_history.h"
#include "desktop/textinput.h"
#include "desktop/hotlist.h"
#include "desktop/knockout.h"
#include "desktop/browser_history.h"
#include "desktop/theme.h"
Include dependency graph for browser_window.c:

Go to the source code of this file.

Macros

#define SCALE_MINIMUM   0.2
 smallest scale that can be applied to a browser window More...
 
#define SCALE_MAXIMUM   10.0
 largests scale that can be applied to a browser window More...
 
#define FRAME_DEPTH   8
 maximum frame depth More...
 

Functions

static nserror browser_window__navigate_internal (struct browser_window *bw, struct browser_fetch_parameters *params)
 dispatch to internal query handlers or normal navigation More...
 
static void browser_window_destroy_children (struct browser_window *bw)
 Close and destroy all child browser window. More...
 
static void browser_window__free_fetch_parameters (struct browser_fetch_parameters *params)
 Free the stored fetch parameters. More...
 
static void browser_window_get_scrollbar_pos (struct browser_window *bw, bool horizontal, int *x, int *y)
 Get position of scrollbar widget within browser window. More...
 
static int get_horz_scrollbar_len (struct browser_window *bw)
 Get browser window horizontal scrollbar widget length. More...
 
static int get_vert_scrollbar_len (struct browser_window *bw)
 Get browser window vertical scrollbar widget length. More...
 
static void browser_window_set_selection (struct browser_window *bw, bool selection, bool read_only)
 Set or remove a selection. More...
 
static nserror browser_window_set_scroll (struct browser_window *bw, const struct rect *rect)
 Set the scroll position of a browser window. More...
 
static nserror browser_window__get_contextual_content (struct browser_window *bw, int x, int y, struct browser_window_features *data)
 Internal helper for getting the positional features. More...
 
static nserror browser_window_download (struct browser_window *bw, nsurl *url, nsurl *nsref, uint32_t fetch_flags, bool fetch_is_post, llcache_post_data *post)
 implements the download operation of a window navigate More...
 
static bool browser_window_check_throbber (struct browser_window *bw)
 recursively check browser windows for activity More...
 
static nserror browser_window_start_throbber (struct browser_window *bw)
 Start the busy indicator. More...
 
static nserror browser_window_stop_throbber (struct browser_window *bw)
 Stop the busy indicator. More...
 
static nserror browser_window_favicon_callback (hlcache_handle *c, const hlcache_event *event, void *pw)
 Callback for fetchcache() for browser window favicon fetches. More...
 
static nserror browser_window_update_favicon (hlcache_handle *c, struct browser_window *bw, struct content_rfc5988_link *link)
 update the favicon associated with the browser window More...
 
static void browser_window_refresh (void *p)
 Handle meta http-equiv refresh time elapsing by loading a new page. More...
 
static void browser_window_convert_to_download (struct browser_window *bw, llcache_handle *stream)
 Transfer the loading_content to a new download window. More...
 
static bool frag_scroll (struct browser_window *bw)
 scroll to a fragment if present More...
 
static void browser_window_update (struct browser_window *bw, bool scroll_to_top)
 Redraw browser window, set extent to content, and update title. More...
 
static nserror browser_window_content_ready (struct browser_window *bw)
 handle message for content ready on browser window More...
 
static nserror browser_window_content_done (struct browser_window *bw)
 handle message for content done on browser window More...
 
static nserror browser_window__handle_ssl_query_response (bool proceed, void *pw)
 Handle query responses from SSL requests. More...
 
static nserror browser_window__unpack_userpass (const char *userpass, char **username_out, char **password_out)
 Unpack a "username:password" to components. More...
 
static nserror browser_window__build_userpass (const char *username, const char *password, char **userpass_out)
 Build a "username:password" from components. More...
 
static nserror browser_window__handle_userpass_response (nsurl *url, const char *realm, const char *username, const char *password, void *pw)
 Handle a response from the UI when prompted for credentials. More...
 
static nserror browser_window__handle_login (struct browser_window *bw, const char *realm, nsurl *url)
 Handle login request (BAD_AUTH) during fetch. More...
 
static nserror browser_window__handle_bad_certs (struct browser_window *bw, nsurl *url)
 Handle a certificate verification request (BAD_CERTS) during a fetch. More...
 
static nserror browser_window__handle_timeout (struct browser_window *bw, nsurl *url)
 Handle a timeout during a fetch. More...
 
static nserror browser_window__handle_fetcherror (struct browser_window *bw, const char *reason, nsurl *url)
 Handle non specific errors during a fetch. More...
 
static nserror browser_window__handle_error (struct browser_window *bw, hlcache_handle *c, const hlcache_event *event)
 Handle errors during content fetch. More...
 
static nserror browser_window_refresh_url_bar_internal (struct browser_window *bw, nsurl *url)
 Update URL bar for a given browser window to given URL. More...
 
static nserror browser_window_callback (hlcache_handle *c, const hlcache_event *event, void *pw)
 Browser window content event callback handler. More...
 
static void scheduled_reformat (void *vbw)
 internal scheduled reformat callback. More...
 
nserror browser_window_destroy_internal (struct browser_window *bw)
 Release all memory associated with a browser window. More...
 
static nserror browser_window_set_scale_internal (struct browser_window *bw, float scale)
 Set browser window scale. More...
 
static void browser_window_find_target_internal (struct browser_window *bw, const char *target, int depth, struct browser_window *page, int *rdepth, struct browser_window **bw_target)
 Find browser window. More...
 
static void browser_window_mouse_drag_end (struct browser_window *bw, browser_mouse_state mouse, int x, int y)
 Handles the end of a drag operation in a browser window. More...
 
static void browser_window_mouse_click_internal (struct browser_window *bw, browser_mouse_state mouse, int x, int y)
 Process mouse click event. More...
 
static void browser_window_mouse_track_internal (struct browser_window *bw, browser_mouse_state mouse, int x, int y)
 Process mouse movement event. More...
 
static bool browser_window_scroll_at_point_internal (struct browser_window *bw, int x, int y, int scrx, int scry)
 perform a scroll operation at a given coordinate More...
 
static bool browser_window_drop_file_at_point_internal (struct browser_window *bw, int x, int y, char *file)
 allows a dragged file to be dropped into a browser window at a position More...
 
static bool is_internal_navigate_url (nsurl *url)
 Check if this is an internal navigation URL. More...
 
nserror browser_window_get_name (struct browser_window *bw, const char **out_name)
 Obtain a browsing contexts name. More...
 
nserror browser_window_set_name (struct browser_window *bw, const char *name)
 Set a browsing contexts name. More...
 
bool browser_window_redraw (struct browser_window *bw, int x, int y, const struct rect *clip, const struct redraw_context *ctx)
 Redraw an area of a window. More...
 
bool browser_window_redraw_ready (struct browser_window *bw)
 Check whether browser window is ready for redraw. More...
 
void browser_window_update_extent (struct browser_window *bw)
 Update the extent of the inside of a browser window to that of the current content. More...
 
void browser_window_get_position (struct browser_window *bw, bool root, int *pos_x, int *pos_y)
 Get the position of the current browser window with respect to the root or parent browser window. More...
 
void browser_window_set_position (struct browser_window *bw, int x, int y)
 Set the position of the current browser window with respect to the parent browser window. More...
 
void browser_window_set_drag_type (struct browser_window *bw, browser_drag_type type, const struct rect *rect)
 Set drag type for a browser window, and inform front end. More...
 
browser_drag_type browser_window_get_drag_type (struct browser_window *bw)
 Get type of any current drag for a browser window. More...
 
struct browser_windowbrowser_window_get_root (struct browser_window *bw)
 Get the root level browser window. More...
 
browser_editor_flags browser_window_get_editor_flags (struct browser_window *bw)
 Check whether browser window can accept a cut/copy/paste, or has a selection that could be saved. More...
 
bool browser_window_can_select (struct browser_window *bw)
 Find out if given browser window content is selectable. More...
 
char * browser_window_get_selection (struct browser_window *bw)
 Get the current selection from a root browser window, ownership passed to caller, who must free() it. More...
 
bool browser_window_can_search (struct browser_window *bw)
 Find out if given browser window can be searched. More...
 
bool browser_window_is_frameset (struct browser_window *bw)
 Find out if a browser window contains a frameset. More...
 
nserror browser_window_get_scrollbar_type (struct browser_window *bw, browser_scrolling *h, browser_scrolling *v)
 Get the browser window's scrollbar details. More...
 
nserror browser_window_get_features (struct browser_window *bw, int x, int y, struct browser_window_features *data)
 Get access to any page features at the given coordinates. More...
 
bool browser_window_scroll_at_point (struct browser_window *bw, int x, int y, int scrx, int scry)
 Send a scroll request to a browser window at a particular point. More...
 
bool browser_window_drop_file_at_point (struct browser_window *bw, int x, int y, char *file)
 Drop a file onto a browser window at a particular point, or determine if a file may be dropped onto the content at given point. More...
 
void browser_window_set_gadget_filename (struct browser_window *bw, struct form_control *gadget, const char *fn)
 set filename on form control. More...
 
nserror browser_window_debug_dump (struct browser_window *bw, FILE *f, enum content_debug op)
 Dump debug info concerning the browser window's contents to file. More...
 
nserror browser_window_debug (struct browser_window *bw, enum content_debug op)
 Set debug options on a window. More...
 
nserror browser_window_create (enum browser_window_create_flags flags, nsurl *url, nsurl *referrer, struct browser_window *existing, struct browser_window **bw)
 Create and open a new root browser window with the given page. More...
 
nserror browser_window_initialise_common (enum browser_window_create_flags flags, struct browser_window *bw, const struct browser_window *existing)
 Initialise common parts of a browser window. More...
 
void browser_window_destroy (struct browser_window *bw)
 Close and destroy a browser window. More...
 
nserror browser_window_refresh_url_bar (struct browser_window *bw)
 Update URL bar for a given browser window to bw's content's URL. More...
 
nserror browser_window_navigate (struct browser_window *bw, nsurl *url, nsurl *referrer, enum browser_window_nav_flags flags, char *post_urlenc, struct fetch_multipart_data *post_multipart, hlcache_handle *parent)
 Start fetching a page in a browser window. More...
 
static nserror navigate_internal_real (struct browser_window *bw, struct browser_fetch_parameters *params)
 Internal navigation handler for normal fetches. More...
 
static nserror navigate_internal_query_auth (struct browser_window *bw, struct browser_fetch_parameters *params)
 Internal navigation handler for the authentication query handler. More...
 
static nserror navigate_internal_query_ssl (struct browser_window *bw, struct browser_fetch_parameters *params)
 Internal navigation handler for the SSL/privacy query page. More...
 
static nserror navigate_internal_query_timeout (struct browser_window *bw, struct browser_fetch_parameters *params)
 Internal navigation handler for the timeout query page. More...
 
static nserror navigate_internal_query_fetcherror (struct browser_window *bw, struct browser_fetch_parameters *params)
 Internal navigation handler for the fetch error query page. More...
 
bool browser_window_up_available (struct browser_window *bw)
 Return true if a browser window can navigate upwards. More...
 
nserror browser_window_navigate_up (struct browser_window *bw, bool new_window)
 Navigate to a browser_window's parent URL. More...
 
nsurlbrowser_window_access_url (const struct browser_window *bw)
 Access a browser window's URL. More...
 
nserror browser_window_get_url (struct browser_window *bw, bool fragment, nsurl **url_out)
 Access a browser window's URL. More...
 
const char * browser_window_get_title (struct browser_window *bw)
 Get the title of a browser_window. More...
 
struct historybrowser_window_get_history (struct browser_window *bw)
 Get a browser window's history object. More...
 
bool browser_window_has_content (struct browser_window *bw)
 Find out if a browser window is currently showing a content. More...
 
struct hlcache_handlebrowser_window_get_content (struct browser_window *bw)
 Get a cache handle for the content within a browser window. More...
 
nserror browser_window_get_extents (struct browser_window *bw, bool scaled, int *width, int *height)
 Get a browser window's content extents. More...
 
nserror browser_window_get_dimensions (struct browser_window *bw, int *width, int *height)
 Get the dimensions of the area a browser window occupies. More...
 
void browser_window_set_dimensions (struct browser_window *bw, int width, int height)
 Set the dimensions of the area a browser window occupies. More...
 
nserror browser_window_invalidate_rect (struct browser_window *bw, struct rect *rect)
 Cause an area of a browser window to be marked invalid and hence redrawn. More...
 
void browser_window_stop (struct browser_window *bw)
 Stop all fetching activity in a browser window. More...
 
nserror browser_window_reload (struct browser_window *bw, bool all)
 Reload the page in a browser window. More...
 
void browser_window_set_status (struct browser_window *bw, const char *text)
 Change the status bar of a browser window. More...
 
void browser_window_set_pointer (struct browser_window *bw, browser_pointer_shape shape)
 Change the shape of the mouse pointer. More...
 
nserror browser_window_schedule_reformat (struct browser_window *bw)
 Reformat the browser window contents in a safe context. More...
 
void browser_window_reformat (struct browser_window *bw, bool background, int width, int height)
 Reformat a browser window contents to a new width or height. More...
 
nserror browser_window_set_scale (struct browser_window *bw, float scale, bool absolute)
 Sets the scale of a browser window. More...
 
float browser_window_get_scale (struct browser_window *bw)
 Gets the scale of a browser window. More...
 
struct browser_windowbrowser_window_find_target (struct browser_window *bw, const char *target, browser_mouse_state mouse)
 Locate a browser window in the specified stack according. More...
 
void browser_window_mouse_track (struct browser_window *bw, browser_mouse_state mouse, int x, int y)
 Handle non-click mouse action in a browser window. More...
 
void browser_window_mouse_click (struct browser_window *bw, browser_mouse_state mouse, int x, int y)
 Handle mouse clicks in a browser window. More...
 
void browser_window_page_drag_start (struct browser_window *bw, int x, int y)
 Start drag scrolling the contents of the browser window. More...
 
bool browser_window_back_available (struct browser_window *bw)
 Check availability of Back action for a given browser window. More...
 
bool browser_window_forward_available (struct browser_window *bw)
 Check availability of Forward action for a given browser window. More...
 
bool browser_window_reload_available (struct browser_window *bw)
 Check availability of Reload action for a given browser window. More...
 
bool browser_window_stop_available (struct browser_window *bw)
 Check availability of Stop action for a given browser window. More...
 
bool browser_window_exec (struct browser_window *bw, const char *src, size_t srclen)
 Execute some JavaScript code in a browsing context. More...
 
nserror browser_window_console_log (struct browser_window *bw, browser_window_console_source src, const char *msg, size_t msglen, browser_window_console_flags flags)
 Log a console message into the browser window console. More...
 
nserror browser_window__reload_current_parameters (struct browser_window *bw)
 Navigate a browser window to the current parameters. More...
 
browser_window_page_info_state browser_window_get_page_info_state (const struct browser_window *bw)
 Request the current browser window page info state. More...
 
nserror browser_window_get_ssl_chain (struct browser_window *bw, struct cert_chain **chain)
 Request the current browser window SSL certificate chain. More...
 
int browser_window_get_cookie_count (const struct browser_window *bw)
 Get the number of cookies in use for the current page. More...
 
nserror browser_window_show_cookies (const struct browser_window *bw)
 Open cookie viewer for the current page. More...
 
nserror browser_window_show_certificates (struct browser_window *bw)
 Show the certificate page for the current page. More...
 

Detailed Description

Browser window creation and manipulation implementation.

Definition in file browser_window.c.

Macro Definition Documentation

◆ FRAME_DEPTH

#define FRAME_DEPTH   8

maximum frame depth

Definition at line 84 of file browser_window.c.

◆ SCALE_MAXIMUM

#define SCALE_MAXIMUM   10.0

largests scale that can be applied to a browser window

Definition at line 79 of file browser_window.c.

◆ SCALE_MINIMUM

#define SCALE_MINIMUM   0.2

smallest scale that can be applied to a browser window

Definition at line 74 of file browser_window.c.

Function Documentation

◆ browser_window__build_userpass()

static nserror browser_window__build_userpass ( const char *  username,
const char *  password,
char **  userpass_out 
)
static

Build a "username:password" from components.

Parameters
[in]usernameThe username component.
[in]passwordThe password component.
[out]userpass_outReturns combined string on success. Owned by caller.
Returns
NSERROR_OK, or appropriate error code.

Definition at line 1079 of file browser_window.c.

References NSERROR_NOMEM, and NSERROR_OK.

Referenced by browser_window__handle_userpass_response(), and navigate_internal_query_auth().

Here is the caller graph for this function:

◆ browser_window__free_fetch_parameters()

static void browser_window__free_fetch_parameters ( struct browser_fetch_parameters params)
static

Free the stored fetch parameters.

Parameters
bwThe browser window

Definition at line 118 of file browser_window.c.

References fetch_multipart_data_destroy(), nsurl_unref(), browser_fetch_parameters::parent_charset, browser_fetch_parameters::post_multipart, browser_fetch_parameters::post_urlenc, browser_fetch_parameters::referrer, and browser_fetch_parameters::url.

Referenced by browser_window__handle_bad_certs(), browser_window__handle_fetcherror(), browser_window__handle_login(), browser_window__handle_timeout(), browser_window__reload_current_parameters(), browser_window_content_ready(), browser_window_destroy_internal(), browser_window_navigate(), and navigate_internal_query_auth().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window__get_contextual_content()

static nserror browser_window__get_contextual_content ( struct browser_window bw,
int  x,
int  y,
struct browser_window_features data 
)
static

Internal helper for getting the positional features.

Parameters
[in]bwbrowser window to examine.
[in]xx-coordinate of point of interest
[in]yy-coordinate of point of interest
[out]dataFeature structure to update.
Returns
NSERROR_OK or appropriate error code on faliure.

Definition at line 268 of file browser_window.c.

References browser_window__get_contextual_content(), browser_window::bw, browser_window::children, browser_window::cols, content_get_contextual_content(), browser_window::current_content, browser_window::height, browser_window_features::main, NSERROR_OK, browser_window::rows, browser_window::scroll_x, browser_window::scroll_y, scrollbar_get_offset(), browser_window::width, browser_window::x, and browser_window::y.

Referenced by browser_window__get_contextual_content(), and browser_window_get_features().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window__handle_bad_certs()

static nserror browser_window__handle_bad_certs ( struct browser_window bw,
nsurl url 
)
static

Handle a certificate verification request (BAD_CERTS) during a fetch.

Definition at line 1225 of file browser_window.c.

References browser_window__free_fetch_parameters(), browser_window__navigate_internal(), BW_NAVIGATE_HISTORY, BW_NAVIGATE_INTERNAL, BW_NAVIGATE_NO_TERMINAL_HISTORY_UPDATE, cert_chain_to_query(), cert_chain::certs, cert_chain::depth, cert_chain::err, fetch_multipart_data_new_kv(), browser_fetch_parameters::flags, browser_window::internal_nav, browser_window::loading_cert_chain, messages_get_sslcode(), NSERROR_OK, nsurl_access(), nsurl_ref(), nsurl_unref(), browser_fetch_parameters::post_multipart, browser_fetch_parameters::referrer, SSL_CERT_ERR_OK, SSL_CERT_ERR_UNKNOWN, and browser_fetch_parameters::url.

Referenced by browser_window__handle_error().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window__handle_error()

static nserror browser_window__handle_error ( struct browser_window bw,
hlcache_handle c,
const hlcache_event event 
)
static

Handle errors during content fetch.

Definition at line 1376 of file browser_window.c.

References browser_window__handle_bad_certs(), browser_window__handle_fetcherror(), browser_window__handle_login(), browser_window__handle_timeout(), browser_window_remove_caret(), browser_window::current_content, hlcache_handle_get_url(), hlcache_handle_release(), browser_window::loading_content, messages_get(), messages_get_errorcode(), NSERROR_BAD_AUTH, NSERROR_BAD_CERTS, NSERROR_OK, NSERROR_TIMEOUT, and browser_fetch_parameters::url.

Referenced by browser_window_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window__handle_fetcherror()

static nserror browser_window__handle_fetcherror ( struct browser_window bw,
const char *  reason,
nsurl url 
)
static

Handle non specific errors during a fetch.

Definition at line 1332 of file browser_window.c.

References browser_window__free_fetch_parameters(), browser_window__navigate_internal(), BW_NAVIGATE_HISTORY, BW_NAVIGATE_INTERNAL, BW_NAVIGATE_NO_TERMINAL_HISTORY_UPDATE, fetch_multipart_data_new_kv(), browser_fetch_parameters::flags, browser_window::internal_nav, NSERROR_OK, nsurl_access(), nsurl_ref(), browser_fetch_parameters::post_multipart, browser_fetch_parameters::referrer, and browser_fetch_parameters::url.

Referenced by browser_window__handle_error().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window__handle_login()

static nserror browser_window__handle_login ( struct browser_window bw,
const char *  realm,
nsurl url 
)
static

Handle login request (BAD_AUTH) during fetch.

Definition at line 1145 of file browser_window.c.

References browser_window__free_fetch_parameters(), browser_window__handle_userpass_response(), browser_window__navigate_internal(), browser_window__unpack_userpass(), BW_NAVIGATE_HISTORY, BW_NAVIGATE_INTERNAL, BW_NAVIGATE_NO_TERMINAL_HISTORY_UPDATE, fetch_multipart_data_new_kv(), browser_fetch_parameters::flags, guit, browser_window::internal_nav, gui_misc_table::login, netsurf_table::misc, NSERROR_NOT_IMPLEMENTED, NSERROR_OK, nsurl_access(), nsurl_ref(), browser_fetch_parameters::post_multipart, browser_fetch_parameters::referrer, browser_fetch_parameters::url, and urldb_get_auth_details().

Referenced by browser_window__handle_error().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window__handle_ssl_query_response()

static nserror browser_window__handle_ssl_query_response ( bool  proceed,
void *  pw 
)
static

Handle query responses from SSL requests.

Definition at line 977 of file browser_window.c.

References browser_window__navigate_internal(), browser_window__reload_current_parameters(), browser_window_destroy_children(), browser_window_destroy_iframes(), browser_window_remove_caret(), browser_window_stop(), browser_window::bw, browser_window::internal_nav, browser_window::loading_content, browser_window::loading_parameters, browser_fetch_parameters::url, and urldb_set_cert_permissions().

Referenced by navigate_internal_query_ssl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window__handle_timeout()

static nserror browser_window__handle_timeout ( struct browser_window bw,
nsurl url 
)
static

Handle a timeout during a fetch.

Definition at line 1297 of file browser_window.c.

References browser_window__free_fetch_parameters(), browser_window__navigate_internal(), BW_NAVIGATE_HISTORY, BW_NAVIGATE_INTERNAL, BW_NAVIGATE_NO_TERMINAL_HISTORY_UPDATE, fetch_multipart_data_new_kv(), browser_fetch_parameters::flags, browser_window::internal_nav, NSERROR_OK, nsurl_access(), nsurl_ref(), browser_fetch_parameters::post_multipart, browser_fetch_parameters::referrer, and browser_fetch_parameters::url.

Referenced by browser_window__handle_error().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window__handle_userpass_response()

static nserror browser_window__handle_userpass_response ( nsurl url,
const char *  realm,
const char *  username,
const char *  password,
void *  pw 
)
static

Handle a response from the UI when prompted for credentials.

Todo:
QUERY - Eventually this should fill out the form NOT nav to the original location

Definition at line 1104 of file browser_window.c.

References browser_window__build_userpass(), browser_window__navigate_internal(), browser_window_destroy_children(), browser_window_destroy_iframes(), browser_window_remove_caret(), browser_window_stop(), browser_window::bw, browser_window::internal_nav, browser_window::loading_content, browser_window::loading_parameters, NSERROR_OK, and urldb_set_auth_details().

Referenced by browser_window__handle_login().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window__navigate_internal()

nserror browser_window__navigate_internal ( struct browser_window bw,
struct browser_fetch_parameters params 
)
static

dispatch to internal query handlers or normal navigation

Here we determine if we're navigating to an internal query URI and if so, what we need to do about it.

Note
these check must match those in is_internal_navigate_url()

If we're not, then we just move on to the real navigate.

Definition at line 3791 of file browser_window.c.

References navigate_internal_query_auth(), navigate_internal_query_fetcherror(), navigate_internal_query_ssl(), navigate_internal_query_timeout(), navigate_internal_real(), nsurl_get_component(), NSURL_PATH, NSURL_SCHEME, path(), and browser_fetch_parameters::url.

Referenced by browser_window__handle_bad_certs(), browser_window__handle_fetcherror(), browser_window__handle_login(), browser_window__handle_ssl_query_response(), browser_window__handle_timeout(), browser_window__handle_userpass_response(), browser_window__reload_current_parameters(), browser_window_navigate(), and navigate_internal_query_auth().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window__reload_current_parameters()

nserror browser_window__reload_current_parameters ( struct browser_window bw)

Navigate a browser window to the current parameters.

Parameters
bwThe browser window to cause to navigate

Definition at line 4634 of file browser_window.c.

References browser_window__free_fetch_parameters(), browser_window__navigate_internal(), browser_window::bw, browser_window::current_parameters, fetch_multipart_data_destroy(), browser_fetch_parameters::flags, browser_window::internal_nav, browser_window::loading_parameters, nsurl_ref(), browser_fetch_parameters::post_multipart, browser_fetch_parameters::post_urlenc, and browser_fetch_parameters::url.

Referenced by browser_window__handle_ssl_query_response(), browser_window_history_back(), navigate_internal_query_fetcherror(), and navigate_internal_query_timeout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window__unpack_userpass()

static nserror browser_window__unpack_userpass ( const char *  userpass,
char **  username_out,
char **  password_out 
)
static

Unpack a "username:password" to components.

Parameters
[in]userpassThe input string to split.
[in]username_outReturns username on success. Owned by caller.
[out]password_outReturns password on success. Owned by caller.
Returns
NSERROR_OK, or appropriate error code.

Definition at line 1018 of file browser_window.c.

References NSERROR_BAD_PARAMETER, NSERROR_NOMEM, and NSERROR_OK.

Referenced by browser_window__handle_login().

Here is the caller graph for this function:

◆ browser_window_access_url()

nsurl * browser_window_access_url ( const struct browser_window bw)

Access a browser window's URL.

This URL is always without any fragment.

Parameters
bwbrowser window
Returns
pointer to nsurl. Doesn't create a ref for caller.
Note
guaranteed to return a valid nsurl ptr, never returns NULL.

Definition at line 3893 of file browser_window.c.

References browser_window::current_content, hlcache_handle_get_url(), and browser_window::loading_content.

Referenced by addbookmarks_button_clicked_cb(), ami_gui_opts_event(), browser_window_get_cookie_count(), browser_window_get_url(), browser_window_navigate_up(), browser_window_show_cookies(), context_popup(), HOOKF(), menu_add_bookmark(), nsgtk_preferences_setCurrentPage_clicked(), nsgtk_saveas_dialog(), nsgtk_viewsource(), page_info__create_from_bw(), ro_gui_window_action_add_bookmark(), ro_gui_window_action_new_window(), ro_gui_window_action_remove_bookmark(), ro_gui_window_close(), ro_gui_window_menu_select(), ro_gui_window_toolbar_click(), and RXHOOKF().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_back_available()

bool browser_window_back_available ( struct browser_window bw)

Check availability of Back action for a given browser window.

Parameters
bwbrowser window
Returns
true if Back action is available

Definition at line 4524 of file browser_window.c.

References browser_window_history_back_available(), browser_window::bw, browser_window::history, and browser_window::internal_nav.

Referenced by ami_gui_history(), ami_update_buttons(), fb_leftarrow_click(), fb_update_back_forward(), ro_gui_window_menu_prepare(), ro_gui_window_update_toolbar_buttons(), toolbar_back_click(), and toolbar_update_buttons().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_callback()

static nserror browser_window_callback ( hlcache_handle c,
const hlcache_event event,
void *  pw 
)
static

Browser window content event callback handler.

Definition at line 1450 of file browser_window.c.

References gui_search_table::add_recent, content_msg_data::area, gui_search_table::back_state, content_msg_data::background, browser_window__handle_error(), browser_window_console_log(), browser_window_content_done(), browser_window_content_ready(), browser_window_convert_to_download(), browser_window_get_dimensions(), browser_window_get_root(), browser_window_invalidate_rect(), browser_window_place_caret(), browser_window_recalculate_frameset(), browser_window_recalculate_iframes(), browser_window_refresh_url_bar(), browser_window_refresh_url_bar_internal(), browser_window_remove_caret(), browser_window_set_drag_type(), browser_window_set_pointer(), browser_window_set_scroll(), browser_window_set_selection(), browser_window_set_status(), browser_window_stop_throbber(), browser_window_update(), browser_window_update_favicon(), browser_window::bw, content_msg_data::caret, cert_chain_dup(), cert_chain_free(), content_msg_data::chain, content_msg_data::clip, content_get_status_message(), content_get_type(), CONTENT_MSG_CARET, CONTENT_MSG_DONE, CONTENT_MSG_DOWNLOAD, CONTENT_MSG_DRAG, CONTENT_MSG_DRAGSAVE, CONTENT_MSG_ERROR, CONTENT_MSG_GADGETCLICK, CONTENT_MSG_GETDIMS, CONTENT_MSG_GETTHREAD, CONTENT_MSG_LINK, CONTENT_MSG_LOADING, CONTENT_MSG_LOG, CONTENT_MSG_POINTER, CONTENT_MSG_READY, CONTENT_MSG_REDIRECT, CONTENT_MSG_REDRAW, CONTENT_MSG_REFORMAT, CONTENT_MSG_REFRESH, CONTENT_MSG_SAVELINK, CONTENT_MSG_SCROLL, CONTENT_MSG_SELECTION, CONTENT_MSG_SELECTMENU, CONTENT_MSG_SSL_CERTS, CONTENT_MSG_STATUS, CONTENT_MSG_TEXTSEARCH, CONTENT_THEME, gui_window_table::create_form_select_menu, content_msg_data::ctx, browser_window::current_content, hlcache_event::data, content_msg_data::download, content_msg_data::drag, gui_window_table::drag_save_object, DRAGGING_CONTENT_SCROLLBAR, DRAGGING_NONE, DRAGGING_SELECTION, content_msg_data::dragsave, content_msg_data::explicit_status_text, gui_window_table::file_gadget_open, content_msg_data::flags, gui_search_table::forward_state, content_msg_data::from, content_msg_data::gadget, content_msg_data::gadget_click, GADGET_FILE, GADGET_SELECT, content_msg_data::getdims, GUI_SAVE_COMPLETE, GUI_SAVE_OBJECT_NATIVE, GUI_SAVE_OBJECT_ORIG, GUI_SAVE_SOURCE, guit, content_msg_data::height, height, hlcache_handle_get_content(), gui_search_table::hourglass, js_newthread(), browser_window::jsheap, browser_window::loading_cert_chain, browser_window::loading_content, content_msg_data::log, content_msg_data::msg, content_msg_data::msglen, NSERROR_OK, content_msg_data::pointer, content_msg_data::pos, content_msg_data::rect, content_msg_data::redirect, browser_window::refresh_interval, content_rfc5988_link::rel, content_msg_data::rfc5988_link, root, gui_window_table::save_link, content_msg_data::savelink, browser_window::scale, content_msg_data::scroll, netsurf_table::search, content_msg_data::select_menu, content_msg_data::selection, content_msg_data::src, content_msg_data::state, browser_window::status, gui_search_table::status, content_msg_data::string, content_msg_data::textsearch, theme_install_start(), content_msg_data::title, content_msg_data::to, content_msg_data::type, form_control::type, hlcache_event::type, content_msg_data::url, urldb_add_url(), urldb_update_url_visit_data(), content_msg_data::viewport_height, width, netsurf_table::window, content_msg_data::x, rect::x0, rect::x1, content_msg_data::y, and rect::y1.

Referenced by navigate_internal_real().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_can_search()

bool browser_window_can_search ( struct browser_window bw)

Find out if given browser window can be searched.

Parameters
bwbrowser window to look at
Returns
true iff browser window is searchable
Todo:
We shouldn't have to know about specific content types here. There should be a content_is_searchable() call.

Definition at line 2960 of file browser_window.c.

References browser_window::bw, content_get_type(), CONTENT_HTML, CONTENT_TEXTPLAIN, and browser_window::current_content.

Referenced by ro_gui_window_action_search(), ro_gui_window_menu_prepare(), and ro_gui_window_update_toolbar_buttons().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_can_select()

bool browser_window_can_select ( struct browser_window bw)

Find out if given browser window content is selectable.

Parameters
bwbrowser window to look at
Returns
true iff browser window is selectable

Definition at line 2929 of file browser_window.c.

References browser_window::bw, content_get_type(), CONTENT_HTML, CONTENT_TEXTPLAIN, and browser_window::current_content.

Referenced by HOOKF(), and ro_gui_window_menu_prepare().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_check_throbber()

static bool browser_window_check_throbber ( struct browser_window bw)
static

recursively check browser windows for activity

Parameters
bwbrowser window to start checking from.

Definition at line 365 of file browser_window.c.

References browser_window_check_throbber(), browser_window::bw, browser_window::children, browser_window::cols, browser_window::iframe_count, browser_window::iframes, browser_window::rows, and browser_window::throbbing.

Referenced by browser_window_check_throbber(), and browser_window_stop_throbber().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_console_log()

nserror browser_window_console_log ( struct browser_window bw,
browser_window_console_source  src,
const char *  msg,
size_t  msglen,
browser_window_console_flags  flags 
)

Log a console message into the browser window console.

If the targetted browser window is a frame, the message will be bubbled to the outermost window to be logged.

Parameters
bwThe browser window
srcThe source of the message
msgThe text of the message
msglenThe length of the text of the message
flagsFlags for the message
Returns
Whether or not the logged message succeeded in being stored

Definition at line 4581 of file browser_window.c.

References browser_window_get_root(), browser_window::bw, BW_CS_FLAG_LEVEL_DEBUG, BW_CS_FLAG_LEVEL_ERROR, BW_CS_FLAG_LEVEL_INFO, BW_CS_FLAG_LEVEL_LOG, BW_CS_FLAG_LEVEL_MASK, BW_CS_FLAG_LEVEL_WARN, BW_CS_INPUT, BW_CS_SCRIPT_CONSOLE, BW_CS_SCRIPT_ERROR, gui_window_table::console_log, guit, NSERROR_OK, NSLOG, root, and netsurf_table::window.

Referenced by browser_window_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_content_done()

static nserror browser_window_content_done ( struct browser_window bw)
static

handle message for content done on browser window

Todo:
update browser window scrollbars before CONTENT_MSG_DONE

Definition at line 926 of file browser_window.c.

References browser_window_handle_scrollbars(), browser_window_history_get_scroll(), browser_window_history_update(), browser_window_reformat(), browser_window_refresh(), browser_window_set_scroll(), browser_window_set_status(), browser_window_stop_throbber(), browser_window_update(), browser_window_update_favicon(), content_get_height(), content_get_status_message(), content_get_width(), browser_window::current_content, guit, browser_window::height, hlcache_handle_get_url(), hotlist_update_url(), browser_window::internal_nav, netsurf_table::misc, NSERROR_OK, NSLOG, browser_window::refresh_interval, gui_misc_table::schedule, browser_window::width, browser_window::window, rect::x0, rect::x1, rect::y0, and rect::y1.

Referenced by browser_window_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_content_ready()

static nserror browser_window_content_ready ( struct browser_window bw)
static

handle message for content ready on browser window

Todo:
Urldb / Thumbnails / Local history brokenness

We add to local history after calling urldb_add_url rather than in the block above. If urldb_add_url fails (as it will for urls like "about:about", "about:config" etc), there would be no local history node, and later calls to history_update will either explode or overwrite the node for the previous URL.

We call it after, rather than before urldb_add_url because history_add calls bitmap render, which tries to register the thumbnail with urldb. That thumbnail registration fails if the url doesn't exist in urldb already, and only urldb-registered thumbnails get freed. So if we called history_add before urldb_add_url we would leak thumbnails for all newly visited URLs. With the history_add call after, we only leak the thumbnails when urldb does not add the URL.

Also, since browser_window_history_add can create a thumbnail (content_redraw), we need to do it after content_reformat.

Definition at line 822 of file browser_window.c.

References browser_window__free_fetch_parameters(), browser_window_create_frameset(), browser_window_create_iframes(), browser_window_get_dimensions(), browser_window_get_root(), browser_window_history_add(), browser_window_refresh_url_bar(), browser_window_remove_caret(), browser_window_set_status(), browser_window_update(), browser_window::bw, cert_chain_free(), content_close(), content_get_status_message(), content_get_title(), content_get_type(), content_open(), content_reformat(), browser_window::current_cert_chain, browser_window::current_content, browser_window::current_parameters, gui_window_table::event, browser_window::frag_id, global_history_add(), guit, GW_EVENT_NEW_CONTENT, GW_EVENT_PAGE_INFO_CHANGE, height, browser_window::history, browser_window::history_add, hlcache_handle_get_url(), hlcache_handle_release(), browser_window::internal_nav, browser_window::loading_cert_chain, browser_window::loading_content, browser_window::loading_parameters, NSERROR_OK, root, browser_window::scale, urldb_add_url(), urldb_get_url(), urldb_set_url_content_type(), urldb_set_url_title(), urldb_update_url_visit_data(), width, browser_window::window, and netsurf_table::window.

Referenced by browser_window_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_convert_to_download()

static void browser_window_convert_to_download ( struct browser_window bw,
llcache_handle stream 
)
static

Transfer the loading_content to a new download window.

Definition at line 673 of file browser_window.c.

References browser_window_get_root(), browser_window_stop_throbber(), browser_window::bw, download_context_create(), hlcache_handle_release(), llcache_handle_abort(), llcache_handle_release(), browser_window::loading_content, NSERROR_OK, and root.

Referenced by browser_window_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_create()

nserror browser_window_create ( enum browser_window_create_flags  flags,
struct nsurl url,
struct nsurl referrer,
struct browser_window existing,
struct browser_window **  bw 
)

Create and open a new root browser window with the given page.

Parameters
flagsFlags to control operation
urlURL to fetch in the new window or NULL for blank
referrerThe referring uri or NULL if none
existingThe an existing bw or NULL, required for some flags.
bwUpdated to created browser window or untouched on error.
Returns
NSERROR_OK, or appropriate error otherwise.

Definition at line 3078 of file browser_window.c.

References browser_window::border, browser_window_destroy(), browser_window_get_root(), browser_window_initialise_common(), browser_window_navigate(), browser_window::BROWSER_WINDOW_NORMAL, browser_window::browser_window_type, browser_window::bw, BW_CREATE_CLONE, BW_CREATE_FOCUS_LOCATION, BW_CREATE_FOREGROUND, BW_CREATE_HISTORY, BW_CREATE_TAB, BW_CREATE_UNVERIFIABLE, BW_NAVIGATE_HISTORY, BW_NAVIGATE_NO_TERMINAL_HISTORY_UPDATE, BW_NAVIGATE_UNVERIFIABLE, BW_SCROLLING_YES, gui_window_table::create, browser_window::focus, guit, GW_CREATE_CLONE, GW_CREATE_FOCUS_LOCATION, GW_CREATE_FOREGROUND, GW_CREATE_NONE, GW_CREATE_TAB, browser_window::last_action, browser_window::no_resize, NSERROR_BAD_PARAMETER, NSERROR_NOMEM, NSERROR_OK, browser_window::scrolling, browser_window::window, and netsurf_table::window.

Referenced by about_open(), ami_gui_new_blank_tab(), ami_handle_applib(), ami_handle_appmsg(), atari_about_show(), browser_window_find_target(), browser_window_history_go(), browser_window_navigate_up(), browser_window_show_certificates(), context_popup(), global_history_tree_node_entry_cb(), gui_init(), gui_init2(), HOOKF(), hotlist_tree_node_entry_cb(), main(), menu_new_win(), menu_open_file(), menu_open_url(), monkey_window_handle_new(), nsbeos_scaffolding_dispatch_event(), nsgtk_browser_window_create(), nsgtk_on_link_opentab_activate_menu(), nsgtk_on_link_openwin_activate_menu(), nsgtk_setup(), ro_gui_dialog_openurl_apply(), ro_gui_iconbar_click(), ro_gui_iconbar_menu_select(), ro_gui_window_action_new_window(), ro_gui_window_handle_local_keypress(), ro_gui_window_menu_select(), ro_msg_dataload(), ro_msg_dataopen(), ro_uri_message_received(), ro_url_message_received(), RXHOOKF(), tab_init_fname(), websearch_entry_activate_cb(), win32_open_new_window(), and WinMain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_debug()

nserror browser_window_debug ( struct browser_window bw,
enum content_debug  op 
)

Set debug options on a window.

Parameters
bwThe browser window.
opThe debug operation type.
Returns
NSERROR_OK on success or error code on faliure.

Definition at line 3067 of file browser_window.c.

References browser_window::bw, browser_window::current_content, and NSERROR_OK.

Referenced by nsws_window_command(), ro_gui_window_handle_local_keypress(), and toggledebugging_button_clicked_cb().

Here is the caller graph for this function:

◆ browser_window_debug_dump()

nserror browser_window_debug_dump ( struct browser_window bw,
FILE *  f,
enum content_debug  op 
)

Dump debug info concerning the browser window's contents to file.

Parameters
bwThe browser window.
fThe file to dump to.
opThe debug operation type to dump.
Returns
NSERROR_OK on success or error code on faliure.

Definition at line 3055 of file browser_window.c.

References browser_window::bw, content_debug_dump(), browser_window::current_content, and NSERROR_OK.

Referenced by debugboxtree_button_clicked_cb(), debugdomtree_button_clicked_cb(), and ro_gui_dump_browser_window().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_destroy()

void browser_window_destroy ( struct browser_window bw)

Close and destroy a browser window.

Parameters
bwbrowser window

Definition at line 3228 of file browser_window.c.

References browser_window_destroy_internal(), browser_window::bw, and browser_window::parent.

Referenced by ami_gui_close_tabs(), ami_gui_event(), browser_window_create(), gui_quit(), handle_event(), HOOKF(), main(), monkey_kill_browser_windows(), monkey_window_handle_destroy(), nsbeos_window_destroy_browser(), nsws_window_event_callback(), ro_gui_window_close(), ro_gui_window_handle_local_keypress(), ro_gui_window_quit(), RXHOOKF(), and window_destroy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_destroy_children()

static void browser_window_destroy_children ( struct browser_window bw)
static

Close and destroy all child browser window.

Parameters
bwbrowser window

Definition at line 96 of file browser_window.c.

References browser_window_destroy_internal(), browser_window::children, browser_window::cols, and browser_window::rows.

Referenced by browser_window__handle_ssl_query_response(), browser_window__handle_userpass_response(), browser_window_destroy_internal(), and browser_window_navigate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_destroy_internal()

nserror browser_window_destroy_internal ( struct browser_window bw)

Release all memory associated with a browser window.

Parameters
bwbrowser window

Definition at line 1832 of file browser_window.c.

References browser_window__free_fetch_parameters(), browser_window_destroy_children(), browser_window_destroy_iframes(), browser_window_get_root(), browser_window_history_destroy(), browser_window_refresh(), browser_window_set_selection(), browser_window::bw, cert_chain_free(), content_close(), browser_window::current, browser_window::current_cert_chain, browser_window::current_content, browser_window::current_parameters, gui_window_table::destroy, browser_window::favicon, browser_window::focus, browser_window::frag_id, guit, hlcache_handle_abort(), hlcache_handle_release(), js_destroyheap(), browser_window::jsheap, browser_window::loading, browser_window::loading_cert_chain, browser_window::loading_content, browser_window::loading_parameters, browser_window::match, netsurf_table::misc, browser_window::miss, browser_window::name, NSERROR_OK, NSLOG, gui_misc_table::schedule, scheduled_reformat(), browser_window::scroll_x, browser_window::scroll_y, scrollbar_destroy(), browser_window::selection, browser_window::status, browser_window::text, browser_window::window, and netsurf_table::window.

Referenced by browser_window_destroy(), browser_window_destroy_children(), and browser_window_destroy_iframes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_download()

static nserror browser_window_download ( struct browser_window bw,
nsurl url,
nsurl nsref,
uint32_t  fetch_flags,
bool  fetch_is_post,
llcache_post_data post 
)
static

implements the download operation of a window navigate

Definition at line 321 of file browser_window.c.

References browser_window_get_root(), browser_window::bw, download_context_create(), guit, gui_misc_table::launch_url, llcache_handle_abort(), llcache_handle_release(), llcache_handle_retrieve(), LLCACHE_RETRIEVE_FORCE_FETCH, LLCACHE_RETRIEVE_STREAM_DATA, netsurf_table::misc, NSERROR_NO_FETCH_HANDLER, NSERROR_OK, NSLOG, and root.

Referenced by browser_window_navigate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_drop_file_at_point()

bool browser_window_drop_file_at_point ( struct browser_window bw,
int  x,
int  y,
char *  file 
)

Drop a file onto a browser window at a particular point, or determine if a file may be dropped onto the content at given point.

Parameters
bwbrowser window to look inside
xx-coordinate of point of interest
yy-coordinate of point of interest
filepath to file to be dropped, or NULL to know if drop allowed
Returns
true iff file drop has been handled, or if drop possible (NULL file)

Definition at line 3032 of file browser_window.c.

References browser_window_drop_file_at_point_internal(), browser_window::bw, browser_window::scale, browser_window::x, and browser_window::y.

Referenced by ami_handle_appmsg(), html_drop_file_at_point(), on_file_dropped(), ro_gui_save_drag_end(), and ro_gui_window_dataload().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_drop_file_at_point_internal()

static bool browser_window_drop_file_at_point_internal ( struct browser_window bw,
int  x,
int  y,
char *  file 
)
static

allows a dragged file to be dropped into a browser window at a position

Parameters
bwThe browsing context receiving the event
xThe scaled x co-ordinate of the event
yThe scaled y co-ordinate of the event
filefilename to be put in the widget

Definition at line 2460 of file browser_window.c.

References browser_window_drop_file_at_point_internal(), browser_window::bw, browser_window::children, browser_window::cols, content_drop_file_at_point(), browser_window::current_content, browser_window::height, browser_window::rows, browser_window::scroll_x, browser_window::scroll_y, scrollbar_get_offset(), browser_window::width, browser_window::x, and browser_window::y.

Referenced by browser_window_drop_file_at_point(), and browser_window_drop_file_at_point_internal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_exec()

bool browser_window_exec ( struct browser_window bw,
const char *  src,
size_t  srclen 
)

Execute some JavaScript code in a browsing context.

Runs the passed in JavaScript code in the browsing context.

Parameters
bwThe browser window
srcThe JavaScript source code
srclenThe length of the source code
Returns
Whether the JS function was successfully injected into the content

Definition at line 4558 of file browser_window.c.

References browser_window::bw, content_exec(), content_get_status(), CONTENT_STATUS_DONE, browser_window::current_content, and NSLOG.

Referenced by monkey_window_handle_exec(), and RXHOOKF().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_favicon_callback()

static nserror browser_window_favicon_callback ( hlcache_handle c,
const hlcache_event event,
void *  pw 
)
static

Callback for fetchcache() for browser window favicon fetches.

Parameters
ccontent handle of favicon
eventThe event to process
pwa context containing the browser window
Returns
NSERROR_OK on success else appropriate error code.

Definition at line 438 of file browser_window.c.

References browser_window_favicon_callback(), browser_window::bw, content_close(), CONTENT_IMAGE, CONTENT_MSG_DONE, CONTENT_MSG_ERROR, browser_window::current, browser_window::failed, browser_window::favicon, guit, hlcache_handle_release(), hlcache_handle_retrieve(), HLCACHE_RETRIEVE_SNIFF_TYPE, browser_window::loading, NSERROR_OK, NSLOG, nsurl_create(), nsurl_unref(), gui_window_table::set_icon, hlcache_event::type, browser_window::window, and netsurf_table::window.

Referenced by browser_window_favicon_callback(), and browser_window_update_favicon().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_find_target()

struct browser_window * browser_window_find_target ( struct browser_window bw,
const char *  target,
browser_mouse_state  mouse 
)

Locate a browser window in the specified stack according.

Parameters
bwthe browser_window to search all relatives of
targetthe target to locate
mouseThe current mouse state
Returns
The browser window the mouse is in

Definition at line 4334 of file browser_window.c.

References BROWSER_MOUSE_CLICK_1, BROWSER_MOUSE_CLICK_2, BROWSER_MOUSE_MOD_2, browser_window_create(), browser_window_find_target_internal(), browser_window::bw, BW_CREATE_CLONE, BW_CREATE_HISTORY, BW_CREATE_TAB, content_get_type(), CONTENT_HTML, browser_window::current_content, html_get_base_target(), browser_window::name, NSERROR_OK, nsoption_bool, and browser_window::parent.

Referenced by mouse_action_drag_none().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_find_target_internal()

static void browser_window_find_target_internal ( struct browser_window bw,
const char *  target,
int  depth,
struct browser_window page,
int *  rdepth,
struct browser_window **  bw_target 
)
static

Find browser window.

Parameters
bwBrowser window.
targetName of target.
depthDepth to scan.
pageThe browser window page.
rdepthThe rdepth.
bw_targetthe output browser window.

Definition at line 1983 of file browser_window.c.

References browser_window_find_target_internal(), browser_window::bw, browser_window::children, browser_window::cols, browser_window::iframe_count, browser_window::iframes, browser_window::name, and browser_window::rows.

Referenced by browser_window_find_target(), and browser_window_find_target_internal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_forward_available()

bool browser_window_forward_available ( struct browser_window bw)

Check availability of Forward action for a given browser window.

Parameters
bwbrowser window
Returns
true if Forward action is available

Definition at line 4535 of file browser_window.c.

References browser_window_history_forward_available(), browser_window::bw, and browser_window::history.

Referenced by ami_gui_history(), ami_update_buttons(), fb_rightarrow_click(), fb_update_back_forward(), ro_gui_window_menu_prepare(), ro_gui_window_update_toolbar_buttons(), toolbar_forward_click(), and toolbar_update_buttons().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_get_content()

struct hlcache_handle * browser_window_get_content ( struct browser_window bw)

◆ browser_window_get_cookie_count()

int browser_window_get_cookie_count ( const struct browser_window bw)

Get the number of cookies in use for the current page.

Parameters
bwA browser window.
Returns
Number of cookies in use, or 0 on error.

Definition at line 4743 of file browser_window.c.

References browser_window_access_url(), browser_window::bw, count(), and urldb_get_cookie().

Referenced by page_info__create_from_bw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_get_dimensions()

nserror browser_window_get_dimensions ( struct browser_window bw,
int *  width,
int *  height 
)

Get the dimensions of the area a browser window occupies.

Parameters
bwThe browser window to get dimensions of
widthUpdated to the browser window viewport width
heightUpdated to the browser window viewport height
Returns
NSERROR_OK and width and height updated otherwise error code

Definition at line 4007 of file browser_window.c.

References gui_window_table::get_dimensions, guit, browser_window::height, height, NSERROR_OK, browser_window::width, width, browser_window::window, and netsurf_table::window.

Referenced by browser_window_callback(), browser_window_content_ready(), and browser_window_recalculate_frameset_internal().

Here is the caller graph for this function:

◆ browser_window_get_drag_type()

browser_drag_type browser_window_get_drag_type ( struct browser_window bw)

Get type of any current drag for a browser window.

Parameters
bwbrowser window to set the type of the current drag for
Returns
drag type

Definition at line 2891 of file browser_window.c.

References browser_window::bw, browser_window::drag, and browser_window::type.

Referenced by mouse_action_select_menu(), and textplain_mouse_track().

Here is the caller graph for this function:

◆ browser_window_get_editor_flags()

browser_editor_flags browser_window_get_editor_flags ( struct browser_window bw)

Check whether browser window can accept a cut/copy/paste, or has a selection that could be saved.

Parameters
bwThe browser window
Returns
flags indicating editor flags

Definition at line 2908 of file browser_window.c.

References browser_window::bw, BW_EDITOR_CAN_COPY, BW_EDITOR_CAN_CUT, BW_EDITOR_CAN_PASTE, BW_EDITOR_NONE, browser_window::can_edit, browser_window::parent, browser_window::read_only, browser_window::selection, and browser_window::window.

Referenced by ami_gui_menu_update_disabled(), gui_start_selection(), nsgtk_scaffolding_update_edit_actions_sensitivity(), nsws_update_edit(), ro_gui_window_menu_prepare(), and ro_gui_window_menu_warning().

Here is the caller graph for this function:

◆ browser_window_get_extents()

nserror browser_window_get_extents ( struct browser_window bw,
bool  scaled,
int *  width,
int *  height 
)

Get a browser window's content extents.

Parameters
bwbrowser window
scaledwhether to apply current browser window scale
widthupdated to content width extent in px
heightupdated to content height extent in px
Returns
NSERROR_OK, or appropriate error otherwise.

Definition at line 3982 of file browser_window.c.

References content_get_height(), content_get_width(), browser_window::current_content, height, NSERROR_BAD_CONTENT, NSERROR_OK, browser_window::scale, and width.

Referenced by ami_gui_scroll_internal(), ami_gui_scroller_update(), gui_window_set_extent(), gui_window_set_scroll(), gui_window_update_extent(), nsws_drawable_hscroll(), nsws_drawable_vscroll(), widget_scroll_x(), widget_scroll_y(), and win32_window_set_scroll().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_get_features()

nserror browser_window_get_features ( struct browser_window bw,
int  x,
int  y,
struct browser_window_features data 
)

Get access to any page features at the given coordinates.

Fetches page features like content, link URLs and objects (images) at the specified co-ordinates within the browsing context.

Fields within the supplied features structure are updated with pointers to any relevent content, or set to NULL if none.

Parameters
[in]bwbrowser window to examine.
[in]xx-coordinate of point of interest
[in]yy-coordinate of point of interest
[out]dataFeature structure to update.
Returns
NSERROR_OK or appropriate error code on faliure.

Definition at line 2999 of file browser_window.c.

References browser_window__get_contextual_content(), browser_window::bw, browser_window_features::form_features, browser_window_features::link, browser_window_features::main, browser_window_features::object, browser_window::scale, browser_window::x, and browser_window::y.

Referenced by ami_text_box_at_point(), get_context_info(), html_get_contextual_content(), nsbeos_scaffolding_popup_menu(), nsgtk_scaffolding_context_menu(), ro_gui_window_handle_local_keypress(), and ro_gui_window_menu_prepare().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_get_history()

struct history * browser_window_get_history ( struct browser_window bw)

Get a browser window's history object.

Parameters
bwbrowser window
Returns
pointer browser window's history object

Clients need history object to make use of the history_* functions.

Definition at line 3953 of file browser_window.c.

References browser_window::history.

◆ browser_window_get_name()

nserror browser_window_get_name ( struct browser_window bw,
const char **  name 
)

Obtain a browsing contexts name.

The returned pointer is owned bu the browsing context and is only valid untill the next operation on that context. The returned name may be NULL if no name has been set.

Todo:
This does not consider behaviour wrt frames
Parameters
bwThe browser window.
namerecives result string.
Returns
NSERROR_OK

Definition at line 2546 of file browser_window.c.

References browser_window::bw, browser_window::name, and NSERROR_OK.

◆ browser_window_get_page_info_state()

browser_window_page_info_state browser_window_get_page_info_state ( const struct browser_window bw)

Request the current browser window page info state.

The page information state is an indicator enumeration to be used by frontends to indicate to the user if the page they are viewing is able to be trusted. This is often shown as a padlock of some kind.

This is also used by the internal page information corewindow to render to the user what the situation is.

Parameters
bwThe browser window
Returns
The state of the browser window

Definition at line 4663 of file browser_window.c.

References browser_window::bw, content_saw_insecure_objects(), browser_window::current_content, hlcache_handle_get_url(), browser_window::match, nsurl_get_component(), NSURL_SCHEME, PAGE_STATE_INSECURE, PAGE_STATE_INTERNAL, PAGE_STATE_LOCAL, PAGE_STATE_SECURE, PAGE_STATE_SECURE_ISSUES, PAGE_STATE_SECURE_OVERRIDE, PAGE_STATE_UNKNOWN, and urldb_get_cert_permissions().

Referenced by gui_page_info_change(), gui_window_report_page_info(), nsgtk_toolbar_page_info_change(), page_info__create_from_bw(), ro_gui_url_bar_page_info_change(), and win32_window_page_info_change().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_get_position()

void browser_window_get_position ( struct browser_window bw,
bool  root,
int *  pos_x,
int *  pos_y 
)

Get the position of the current browser window with respect to the root or parent browser window.

Parameters
bwbrowser window to get the position of
roottrue if we want position wrt root bw, false if wrt parent bw
pos_xupdated to x position of bw
pos_yupdated to y position of bw

Definition at line 2794 of file browser_window.c.

References browser_window::BROWSER_WINDOW_FRAME, browser_window::BROWSER_WINDOW_FRAMESET, browser_window::BROWSER_WINDOW_IFRAME, browser_window::BROWSER_WINDOW_NORMAL, browser_window::browser_window_type, browser_window::bw, browser_window::parent, root, browser_window::scale, browser_window::scroll_x, browser_window::scroll_y, scrollbar_get_offset(), browser_window::x, and browser_window::y.

Referenced by browser_window_frame_resize_start(), browser_window_invalidate_rect(), browser_window_mouse_track_internal(), browser_window_place_caret(), and iframe_mouse_action().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_get_root()

struct browser_window * browser_window_get_root ( struct browser_window bw)

Get the root level browser window.

Parameters
bwbrowser window to set the type of the current drag for
Returns
root browser window

Definition at line 2898 of file browser_window.c.

References browser_window::bw, and browser_window::parent.

Referenced by browser_window_callback(), browser_window_console_log(), browser_window_content_ready(), browser_window_convert_to_download(), browser_window_create(), browser_window_destroy_internal(), browser_window_download(), browser_window_frame_resize_start(), browser_window_invalidate_rect(), browser_window_mouse_click_internal(), browser_window_place_caret(), browser_window_remove_caret(), browser_window_set_drag_type(), browser_window_set_pointer(), browser_window_set_selection(), and selection_click().

Here is the caller graph for this function:

◆ browser_window_get_scale()

float browser_window_get_scale ( struct browser_window bw)

Gets the scale of a browser window.

Parameters
bwThe browser window to get the scale of.
Returns
The scale of the window.

Definition at line 4322 of file browser_window.c.

References browser_window::bw, and browser_window::scale.

Referenced by gui_window_drag_start(), gui_window_set_title(), handle_local_keypress_scale(), html_drop_file_at_point(), html_get_contextual_content(), html_scroll_at_point(), iframe_mouse_action(), ro_gui_dialog_prepare_zoom(), ro_gui_window_default_options(), ro_gui_window_open(), ro_gui_window_scroll(), and window_redraw_content().

Here is the caller graph for this function:

◆ browser_window_get_scrollbar_pos()

static void browser_window_get_scrollbar_pos ( struct browser_window bw,
bool  horizontal,
int *  x,
int *  y 
)
inlinestatic

Get position of scrollbar widget within browser window.

Parameters
bwThe browser window
horizontalWhether to get position of horizontal scrollbar
xUpdated to x-coord of top left of scrollbar widget
yUpdated to y-coord of top left of scrollbar widget

Definition at line 152 of file browser_window.c.

References browser_window::height, SCROLLBAR_WIDTH, and browser_window::width.

Referenced by browser_window_mouse_click_internal(), browser_window_mouse_drag_end(), browser_window_mouse_track_internal(), and browser_window_redraw().

Here is the caller graph for this function:

◆ browser_window_get_scrollbar_type()

nserror browser_window_get_scrollbar_type ( struct browser_window bw,
browser_scrolling h,
browser_scrolling v 
)

Get the browser window's scrollbar details.

Vertical and horizontal scrollbars may be {YES|NO|AUTO}, although it is entirely up to the front end whether this is implemented. e.g. if the gui toolkit style-guide says all windows must have scrollbars then this API can be ignored.

Parameters
bwbrowser window to look at
hUpdated to indicate horizontal scrollbar type
vUpdated to indicate vertical scrollbar type
Returns
NSERROR_OK, or appropriate error otherwise

Definition at line 2986 of file browser_window.c.

References browser_window::bw, NSERROR_OK, and browser_window::scrolling.

Referenced by ami_gui_scroller_update(), and ro_gui_window_open().

Here is the caller graph for this function:

◆ browser_window_get_selection()

char * browser_window_get_selection ( struct browser_window bw)

Get the current selection from a root browser window, ownership passed to caller, who must free() it.

Parameters
bwThe browser window
Returns
the selected text string, or NULL

Definition at line 2946 of file browser_window.c.

References browser_window::bw, content_get_selection(), browser_window::current_content, browser_window::parent, browser_window::selection, and browser_window::window.

Referenced by ami_drag_selection(), ami_file_save(), ro_gui_window_menu_select(), and ro_gui_window_menu_warning().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_get_ssl_chain()

nserror browser_window_get_ssl_chain ( struct browser_window bw,
struct cert_chain **  chain 
)

Request the current browser window SSL certificate chain.

When the page has SSL information, this will retrieve the certificate chain.

If there is no chain available, this will return NSERROR_NOT_FOUND

Parameters
bwThe browser window
chainPointer to be filled out with certificate chain
Returns
Whether or not the chain is available

Definition at line 4728 of file browser_window.c.

References browser_window::bw, browser_window::current_cert_chain, NSERROR_NOT_FOUND, and NSERROR_OK.

◆ browser_window_get_title()

const char * browser_window_get_title ( struct browser_window bw)

Get the title of a browser_window.

Parameters
bwThe browser window.

Definition at line 3939 of file browser_window.c.

References content_get_title(), browser_window::current_content, and nsurl_access().

Referenced by ami_switch_tab(), ami_toggletabbar(), HOOKF(), nsgtk_scaffolding_set_top_level(), and ro_gui_window_toolbar_click().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_get_url()

nserror browser_window_get_url ( struct browser_window bw,
bool  fragment,
struct nsurl **  url_out 
)

Access a browser window's URL.

Parameters
[in]bwbrowser window
[in]fragmentWhether to include any URL fragment.
[out]url_outReturns a ref to the URL on success.
Returns
NSERROR_OK, or appropriate error otherwise.

Definition at line 3911 of file browser_window.c.

References browser_window_access_url(), browser_window::frag_id, browser_window::loading_content, NSERROR_OK, nsurl_ref(), nsurl_refragment(), and browser_fetch_parameters::url.

Referenced by ro_gui_window_toolbar_click().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_has_content()

bool browser_window_has_content ( struct browser_window bw)

◆ browser_window_initialise_common()

nserror browser_window_initialise_common ( enum browser_window_create_flags  flags,
struct browser_window bw,
const struct browser_window existing 
)

Initialise common parts of a browser window.

Parameters
flagsFlags to control operation
bwThe window to initialise
existingThe existing window if cloning, else NULL

Definition at line 3176 of file browser_window.c.

References browser_window_history_clone(), browser_window_history_create(), browser_window::bw, BW_CREATE_CLONE, browser_window::drag, DRAGGING_NONE, browser_window::focus, js_newheap(), browser_window::jsheap, browser_window::match, browser_window::miss, NSERROR_OK, nsoption_int, browser_window::refresh_interval, browser_window::scale, browser_window::scroll_x, browser_window::scroll_y, browser_window::status, browser_window::text, browser_window::text_len, and browser_window::type.

Referenced by browser_window_create(), browser_window_create_frameset_internal(), and browser_window_create_iframes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_invalidate_rect()

nserror browser_window_invalidate_rect ( struct browser_window bw,
struct rect rect 
)

Cause an area of a browser window to be marked invalid and hence redrawn.

Parameters
bwThe browser window to update.
rectThe area to redraw

Definition at line 4047 of file browser_window.c.

References browser_window_get_position(), browser_window_get_root(), browser_window::bw, guit, gui_window_table::invalidate, browser_window::scale, browser_window::window, netsurf_table::window, rect::x0, rect::x1, rect::y0, and rect::y1.

Referenced by browser_window_callback(), browser_window_scroll_callback(), and browser_window_update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_is_frameset()

bool browser_window_is_frameset ( struct browser_window bw)

Find out if a browser window contains a frameset.

Parameters
bwbrowser window to look at
Returns
true iff browser window contains a frameset

Definition at line 2978 of file browser_window.c.

References browser_window::bw, and browser_window::children.

Referenced by ami_gui_scroller_update(), gui_window_set_extent(), ro_gui_window_open(), and ro_gui_window_scroll_action().

Here is the caller graph for this function:

◆ browser_window_mouse_click()

void browser_window_mouse_click ( struct browser_window bw,
browser_mouse_state  mouse,
int  x,
int  y 
)

Handle mouse clicks in a browser window.

Parameters
bwbrowser window
mousestate of mouse buttons and modifier keys
xcoordinate of mouse
ycoordinate of mouse

Definition at line 4487 of file browser_window.c.

References browser_window_mouse_click_internal(), browser_window::bw, browser_window::scale, browser_window::x, and browser_window::y.

Referenced by ami_drag_selection(), ami_gui_event(), fb_browser_window_click(), fb_browser_window_move(), iframe_mouse_action(), monkey_window_handle_click(), nsbeos_dispatch_event(), nsgtk_window_button_press_event(), nsgtk_window_button_release_event(), nsgtk_window_motion_notify_event(), nsws_drawable_mousedown(), nsws_drawable_mousemove(), nsws_drawable_mouseup(), on_content_mouse_click(), and ro_gui_window_click().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_mouse_click_internal()

static void browser_window_mouse_click_internal ( struct browser_window bw,
browser_mouse_state  mouse,
int  x,
int  y 
)
static

Process mouse click event.

Parameters
bwThe browsing context receiving the event
mouseThe mouse event state
xThe scaled x co-ordinate of the event
yThe scaled y co-ordinate of the event

Definition at line 2100 of file browser_window.c.

References BROWSER_MOUSE_DRAG_1, BROWSER_MOUSE_DRAG_2, BROWSER_MOUSE_MOD_2, BROWSER_POINTER_DEFAULT, BROWSER_POINTER_MOVE, browser_window_get_root(), browser_window_get_scrollbar_pos(), browser_window_mouse_click_internal(), browser_window_page_drag_start(), browser_window_remove_caret(), browser_window_set_pointer(), browser_window_set_selection(), browser_window_set_status(), browser_window::bw, browser_window::children, browser_window::cols, content_get_type(), CONTENT_HTML, content_mouse_action(), CONTENT_TEXTPLAIN, browser_window::current_content, gui_window_table::drag_save_object, browser_window::focus, get_horz_scrollbar_len(), get_vert_scrollbar_len(), GUI_SAVE_OBJECT_NATIVE, GUI_SAVE_OBJECT_ORIG, guit, browser_window::height, browser_window::rows, browser_window::scroll_x, browser_window::scroll_y, scrollbar_get_offset(), scrollbar_mouse_action(), scrollbar_mouse_status_to_message(), SCROLLBAR_WIDTH, browser_window::status, browser_window::width, browser_window::window, netsurf_table::window, browser_window::x, and browser_window::y.

Referenced by browser_window_mouse_click(), and browser_window_mouse_click_internal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_mouse_drag_end()

static void browser_window_mouse_drag_end ( struct browser_window bw,
browser_mouse_state  mouse,
int  x,
int  y 
)
static

Handles the end of a drag operation in a browser window.

Parameters
bwbrowser window
mousestate of mouse buttons and modifier keys
xcoordinate of mouse
ycoordinate of mouse
Todo:
Remove this function, once these things are associated with content, rather than bw.

Definition at line 2048 of file browser_window.c.

References browser_window_get_scrollbar_pos(), browser_window_set_drag_type(), browser_window::bw, browser_window::drag, DRAGGING_CONTENT_SCROLLBAR, DRAGGING_NONE, DRAGGING_OTHER, DRAGGING_SCR_X, DRAGGING_SCR_Y, DRAGGING_SELECTION, browser_window::scroll_x, browser_window::scroll_y, scrollbar_get_offset(), scrollbar_mouse_drag_end(), browser_window::type, browser_window::x, and browser_window::y.

Referenced by browser_window_mouse_track_internal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_mouse_track()

void browser_window_mouse_track ( struct browser_window bw,
browser_mouse_state  mouse,
int  x,
int  y 
)

Handle non-click mouse action in a browser window.

(drag ends, movements)

Parameters
bwbrowser window
mousestate of mouse buttons and modifier keys
xcoordinate of mouse
ycoordinate of mouse

Definition at line 4475 of file browser_window.c.

References browser_window_mouse_track_internal(), browser_window::bw, browser_window::scale, browser_window::x, and browser_window::y.

Referenced by ami_gui_event(), fb_browser_window_click(), fb_browser_window_move(), iframe_mouse_action(), nsbeos_dispatch_event(), nsgtk_window_button_release_event(), nsgtk_window_motion_notify_event(), nsws_drawable_mousemove(), nsws_drawable_mouseup(), on_content_mouse_click(), on_content_mouse_move(), ro_gui_selection_drag_end(), ro_gui_window_mouse_at(), and ro_gui_window_scroll_end().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_mouse_track_internal()

static void browser_window_mouse_track_internal ( struct browser_window bw,
browser_mouse_state  mouse,
int  x,
int  y 
)
static

Process mouse movement event.

Parameters
bwThe browsing context receiving the event
mouseThe mouse event state
xThe scaled x co-ordinate of the event
yThe scaled y co-ordinate of the event

Definition at line 2235 of file browser_window.c.

References BROWSER_POINTER_DEFAULT, browser_window::BROWSER_WINDOW_FRAME, browser_window_get_position(), browser_window_get_scrollbar_pos(), browser_window::BROWSER_WINDOW_IFRAME, browser_window_mouse_drag_end(), browser_window_mouse_track_internal(), browser_window_resize_frame(), browser_window_set_pointer(), browser_window_set_scroll(), browser_window_set_status(), browser_window::browser_window_type, browser_window::bw, browser_window::children, browser_window::cols, content_mouse_track(), browser_window::current_content, browser_window::drag, DRAGGING_FRAME, DRAGGING_NONE, DRAGGING_PAGE_SCROLL, DRAGGING_SCR_X, DRAGGING_SCR_Y, get_horz_scrollbar_len(), get_vert_scrollbar_len(), browser_window::height, browser_window::rows, browser_window::scale, browser_window::scroll_x, browser_window::scroll_y, scrollbar_get_offset(), scrollbar_mouse_action(), scrollbar_mouse_status_to_message(), SCROLLBAR_WIDTH, browser_window::start_scroll_x, browser_window::start_scroll_y, browser_window::start_x, browser_window::start_y, browser_window::status, browser_window::type, browser_window::width, browser_window::window, browser_window::x, rect::x0, rect::x1, browser_window::y, rect::y0, and rect::y1.

Referenced by browser_window_mouse_track(), and browser_window_mouse_track_internal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_navigate()

nserror browser_window_navigate ( struct browser_window bw,
struct nsurl url,
struct nsurl referrer,
enum browser_window_nav_flags  flags,
char *  post_urlenc,
struct fetch_multipart_data post_multipart,
struct hlcache_handle parent 
)

Start fetching a page in a browser window.

Parameters
bwbrowser window
urlURL to start fetching
flagsFlags to control operation
referrerThe referring uri or NULL if none
post_urlencurl encoded post data or NULL if none
post_multipartmultipart post data or NULL if none
parentParent content or NULL if none

Any existing fetches in the window are aborted.

If post_urlenc and post_multipart are NULL the url is fetched using GET rather than POST.

Definition at line 3290 of file browser_window.c.

References browser_window__free_fetch_parameters(), browser_window__navigate_internal(), browser_window_destroy_children(), browser_window_destroy_iframes(), browser_window_download(), browser_window_history_add(), browser_window_history_update(), browser_window_refresh_url_bar(), browser_window_remove_caret(), browser_window_stop(), browser_window_update(), BW_NAVIGATE_DOWNLOAD, BW_NAVIGATE_HISTORY, BW_NAVIGATE_INTERNAL, BW_NAVIGATE_NO_TERMINAL_HISTORY_UPDATE, BW_NAVIGATE_UNVERIFIABLE, hlcache_child_context::charset, CONTENT_ENCODING_NORMAL, content_get_encoding(), content_get_quirks(), content_get_type(), CONTENT_HTML, history::current, browser_window::current_content, llcache_post_data::data, fetch_multipart_data_clone(), browser_fetch_parameters::flags, browser_window::frag_id, FRAME_DEPTH, browser_window::history, hlcache_handle_get_url(), browser_window::internal_nav, is_internal_navigate_url(), LLCACHE_RETRIEVE_VERIFIABLE, browser_window::loading_parameters, llcache_post_data::multipart, NSERROR_FRAME_DEPTH, NSERROR_NEED_DATA, NSERROR_OK, NSLOG, nsurl_access(), nsurl_compare(), NSURL_COMPLETE, NSURL_FRAGMENT, nsurl_get_component(), nsurl_has_component(), NSURL_QUERY, nsurl_ref(), nsurl_unref(), browser_window::parent, parent, browser_fetch_parameters::parent_charset, browser_fetch_parameters::parent_quirks, browser_fetch_parameters::post_multipart, browser_fetch_parameters::post_urlenc, hlcache_child_context::quirks, browser_fetch_parameters::referrer, llcache_post_data::type, browser_fetch_parameters::url, and llcache_post_data::urlenc.

Referenced by ami_file_open(), ami_gui_event(), ami_handle_appmsg(), ami_history_global_drag_end(), ami_hotlist_drag_end(), browser_window_create(), browser_window_create_frameset_internal(), browser_window_create_iframes(), browser_window_history_back(), browser_window_history_go(), browser_window_navigate_up(), browser_window_refresh(), browser_window_reload(), context_popup(), fb_url_enter(), form_submit(), gui_download_window_done(), HOOKF(), link_mouse_action(), monkey_window_handle_go(), mouse_action_drag_none(), nsbeos_scaffolding_dispatch_event(), nsgtk_completion_match_select(), nsgtk_on_savelink_activate_menu(), nsws_window_command(), nsws_window_go(), on_file_dropped(), openfile_button_clicked_cb(), ro_gui_url_bar_menu_select(), ro_gui_url_complete_click(), ro_gui_window_action_home(), ro_gui_window_launch_url(), ro_gui_window_menu_select(), ro_msg_dataload(), RXHOOKF(), toolbar_home_click(), toolbar_key_input(), toolbar_navigate_to_url(), and url_entry_activate_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_navigate_up()

nserror browser_window_navigate_up ( struct browser_window bw,
bool  new_window 
)

Navigate to a browser_window's parent URL.

Parameters
bwbrowser window
new_windowwhether to open parent in a new window, or existing

Definition at line 3857 of file browser_window.c.

References browser_window_access_url(), browser_window_create(), browser_window_navigate(), BW_CREATE_CLONE, BW_NAVIGATE_HISTORY, NSERROR_BAD_PARAMETER, NSERROR_OK, nsurl_compare(), NSURL_COMPLETE, nsurl_parent(), nsurl_unref(), and parent.

Referenced by ro_gui_window_close(), ro_gui_window_menu_select(), and ro_gui_window_toolbar_click().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_page_drag_start()

void browser_window_page_drag_start ( struct browser_window bw,
int  x,
int  y 
)

Start drag scrolling the contents of the browser window.

Parameters
bwbrowser window
xx ordinate of initial mouse position
yy ordinate

Definition at line 4499 of file browser_window.c.

References browser_window_set_drag_type(), browser_window::bw, browser_window::drag, DRAGGING_PAGE_SCROLL, gui_window_table::event, gui_window_table::get_scroll, guit, GW_EVENT_SCROLL_START, browser_window::scroll_x, browser_window::scroll_y, scrollbar_get_offset(), browser_window::start_scroll_x, browser_window::start_scroll_y, browser_window::start_x, browser_window::start_y, browser_window::window, netsurf_table::window, browser_window::x, and browser_window::y.

Referenced by browser_window_mouse_click_internal(), default_mouse_action(), and textplain_mouse_action().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_redraw()

bool browser_window_redraw ( struct browser_window bw,
int  x,
int  y,
const struct rect clip,
const struct redraw_context ctx 
)

Redraw an area of a window.

Calls the redraw function for the content.

Parameters
bwThe window to redraw
xcoordinate for top-left of redraw
ycoordinate for top-left of redraw
clipclip rectangle coordinates
ctxredraw context
Returns
true if successful, false otherwise

The clip rectangle is guaranteed to be filled to its extents, so there is no need to render a solid background first.

x, y and clip are coordinates from the top left of the canvas area.

The top left corner of the clip rectangle is (x0, y0) and the bottom right corner of the clip rectangle is (x1, y1). Units for x, y and clip are pixels.

Definition at line 2583 of file browser_window.c.

References content_redraw_data::background_colour, browser_window_get_scrollbar_pos(), browser_window_redraw(), browser_window::bw, browser_window::children, clip(), plotter_table::clip, browser_window::cols, content_get_height(), content_get_type(), content_get_width(), CONTENT_HTML, content_redraw(), CONTENT_TEXTPLAIN, browser_window::current_content, browser_window::height, height, content_redraw_data::height, knockout_plot_end(), knockout_plot_start(), NSERROR_OK, NSLOG, plotter_table::option_knockout, redraw_context::plot, plot_style_fill_white, plotter_table::rectangle, content_redraw_data::repeat_x, content_redraw_data::repeat_y, browser_window::rows, browser_window::scale, content_redraw_data::scale, browser_window::scroll_x, browser_window::scroll_y, scrollbar_get_offset(), scrollbar_redraw(), SCROLLBAR_WIDTH, browser_window::width, width, content_redraw_data::width, browser_window::window, browser_window::x, content_redraw_data::x, rect::x0, rect::x1, browser_window::y, content_redraw_data::y, rect::y0, and rect::y1.

Referenced by ami_do_redraw_tiled(), browser_window_redraw(), fb_redraw(), html_redraw_box(), monkey_window_handle_redraw(), nsbeos_window_expose_event(), nsgtk_window_draw_event(), nsws_drawable_paint(), ro_gui_window__redraw_rect(), and window_redraw_content().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_redraw_ready()

bool browser_window_redraw_ready ( struct browser_window bw)

Check whether browser window is ready for redraw.

Parameters
bwThe window to redraw
Returns
true if browser window is ready for redraw

Definition at line 2765 of file browser_window.c.

References browser_window::bw, content_is_locked(), browser_window::current_content, and NSLOG.

Referenced by ami_do_redraw(), ami_do_redraw_limits(), and ro_gui_window_redraw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_reformat()

void browser_window_reformat ( struct browser_window bw,
bool  background,
int  width,
int  height 
)

Reformat a browser window contents to a new width or height.

This API is not safe to call from all contexts and care must be used.

Warning
This API is generally only useful within the browser core and is only exposed for historical reasons. A frontend almost certianly actually wants browser_window_schedule_reformat() and not this.
Parameters
bwThe browser window to reformat.
backgroundReformat in the background.
widthnew width
heightnew height

Definition at line 4255 of file browser_window.c.

References browser_window::BROWSER_WINDOW_IFRAME, browser_window::browser_window_type, browser_window::bw, content_reformat(), browser_window::current_content, height, browser_window::scale, browser_window::scroll_x, browser_window::scroll_y, SCROLLBAR_WIDTH, width, and browser_window::window.

Referenced by browser_window_content_done(), browser_window_recalculate_frameset_internal(), layout_calculate_descendant_bboxes(), menu_debug_render(), on_resized(), scheduled_reformat(), window_close_search(), and window_open_search().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_refresh()

static void browser_window_refresh ( void *  p)
static

Handle meta http-equiv refresh time elapsing by loading a new page.

Parameters
pbrowser window to refresh with new page

Definition at line 617 of file browser_window.c.

References browser_window_navigate(), browser_window::bw, BW_NAVIGATE_HISTORY, BW_NAVIGATE_UNVERIFIABLE, content_get_refresh_url(), content_get_status(), content_invalidate_reuse_data(), CONTENT_STATUS_DONE, CONTENT_STATUS_READY, browser_window::current_content, hlcache_handle_get_url(), nsurl_compare(), NSURL_COMPLETE, browser_window::parent, parent, and browser_window::refresh_interval.

Referenced by browser_window_content_done(), browser_window_destroy_internal(), and browser_window_stop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_refresh_url_bar()

nserror browser_window_refresh_url_bar ( struct browser_window bw)

Update URL bar for a given browser window to bw's content's URL.

Parameters
bwBrowser window to update URL bar for.

Definition at line 3240 of file browser_window.c.

References browser_window_refresh_url_bar_internal(), browser_window::bw, browser_window::current_content, browser_window::frag_id, hlcache_handle_get_url(), browser_window::internal_nav, browser_window::loading_parameters, NSERROR_OK, nsurl_refragment(), nsurl_unref(), browser_window::parent, browser_window::throbbing, and browser_fetch_parameters::url.

Referenced by ami_switch_tab(), browser_window_callback(), browser_window_content_ready(), browser_window_navigate(), and browser_window_stop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_refresh_url_bar_internal()

static nserror browser_window_refresh_url_bar_internal ( struct browser_window bw,
nsurl url 
)
inlinestatic

Update URL bar for a given browser window to given URL.

Parameters
bwBrowser window to update URL bar for.
urlURL for content displayed by bw including any fragment.

Definition at line 1432 of file browser_window.c.

References guit, NSERROR_OK, browser_window::parent, gui_window_table::set_url, browser_fetch_parameters::url, browser_window::window, and netsurf_table::window.

Referenced by browser_window_callback(), browser_window_refresh_url_bar(), and navigate_internal_real().

Here is the caller graph for this function:

◆ browser_window_reload()

nserror browser_window_reload ( struct browser_window bw,
bool  all 
)

Reload the page in a browser window.

Parameters
bwbrowser window
allwhether to reload all objects associated with the page
Returns
NSERROR_OK on success else error code.

Definition at line 4118 of file browser_window.c.

References browser_window_navigate(), BW_NAVIGATE_NONE, content_html_object::content, content_get_type(), CONTENT_HTML, content_invalidate_reuse_data(), count(), browser_window::current_content, hlcache_handle_get_url(), html_get_objects(), html_get_stylesheets(), browser_window::loading_content, NSERROR_INVALID, and STYLESHEET_START.

Referenced by ami_gui_event(), fb_reload_click(), monkey_window_handle_reload(), nsbeos_scaffolding_dispatch_event(), nsws_window_command(), reload_button_clicked_cb(), reloadstop_button_clicked_cb(), ro_gui_window_handle_local_keypress(), ro_gui_window_menu_select(), ro_gui_window_toolbar_click(), RXHOOKF(), and toolbar_reload_click().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_reload_available()

bool browser_window_reload_available ( struct browser_window bw)

Check availability of Reload action for a given browser window.

Parameters
bwbrowser window
Returns
true if Reload action is available

Definition at line 4541 of file browser_window.c.

References browser_window::bw, browser_window::current_content, and browser_window::loading_content.

Referenced by ami_gui_event(), ami_update_buttons(), ro_gui_window_menu_prepare(), ro_gui_window_update_toolbar_buttons(), and toolbar_update_buttons().

Here is the caller graph for this function:

◆ browser_window_schedule_reformat()

nserror browser_window_schedule_reformat ( struct browser_window bw)

Reformat the browser window contents in a safe context.

The browser_window_reformat() call cannot safely be called from some contexts, This interface allows for the reformat to happen from a safe top level context.

The reformat uses the window table get_dimensions() callback as the correct viewport dimensions are only available to the frontend.

Parameters
bwThe browser window to reformat the content of.
Returns
NSERROR_OK on success else appropriate error code.

Definition at line 4243 of file browser_window.c.

References browser_window::bw, guit, netsurf_table::misc, NSERROR_BAD_PARAMETER, gui_misc_table::schedule, scheduled_reformat(), and browser_window::window.

Referenced by ami_gui_event(), ami_gui_scroller_update(), browser_window_set_scale_internal(), nsbeos_reflow_all_windows(), nsbeos_window_resize_event(), nsgtk_window_size_allocate_event(), nsgtk_window_update_all(), nsws_drawable_resize(), nsws_window_command(), resize_browser_widget(), and ro_gui_window_open().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_scroll_at_point()

bool browser_window_scroll_at_point ( struct browser_window bw,
int  x,
int  y,
int  scrx,
int  scry 
)

Send a scroll request to a browser window at a particular point.

The 'deepest' scrollable object which can be scrolled in the requested direction at the given point will consume the scroll.

Parameters
bwbrowser window to look inside
xx-coordinate of point of interest
yy-coordinate of point of interest
scrxnumber of px try to scroll something in x direction
scrynumber of px try to scroll something in y direction
Returns
true iff scroll request has been consumed

Definition at line 3018 of file browser_window.c.

References browser_window_scroll_at_point_internal(), browser_window::bw, browser_window::scale, browser_window::x, and browser_window::y.

Referenced by ami_gui_scroll_internal(), fb_browser_window_click(), html_scroll_at_point(), nsgtk_window_scroll_event(), and ro_gui_window_scroll_action().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_scroll_at_point_internal()

static bool browser_window_scroll_at_point_internal ( struct browser_window bw,
int  x,
int  y,
int  scrx,
int  scry 
)
static

perform a scroll operation at a given coordinate

Parameters
bwThe browsing context receiving the event
xThe scaled x co-ordinate of the event
yThe scaled y co-ordinate of the event

Definition at line 2402 of file browser_window.c.

References browser_window_scroll_at_point_internal(), browser_window::bw, browser_window::children, browser_window::cols, content_scroll_at_point(), browser_window::current_content, browser_window::height, browser_window::rows, browser_window::scroll_x, browser_window::scroll_y, scrollbar_get_offset(), scrollbar_scroll(), browser_window::width, browser_window::x, and browser_window::y.

Referenced by browser_window_scroll_at_point(), and browser_window_scroll_at_point_internal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_set_dimensions()

void browser_window_set_dimensions ( struct browser_window bw,
int  width,
int  height 
)

Set the dimensions of the area a browser window occupies.

Parameters
bwThe browser window to set dimensions of
widthWidth in pixels
heightHeight in pixels

Definition at line 4029 of file browser_window.c.

References browser_window::height, height, NSLOG, browser_window::width, width, and browser_window::window.

Referenced by browser_window_create_iframes(), and layout_calculate_descendant_bboxes().

Here is the caller graph for this function:

◆ browser_window_set_drag_type()

void browser_window_set_drag_type ( struct browser_window bw,
browser_drag_type  type,
const struct rect rect 
)

Set drag type for a browser window, and inform front end.

Parameters
bwbrowser window to set the type of the current drag for
typedrag type
rectarea pointer may be confined to, during drag, or NULL
Todo:
tell front end

Definition at line 2857 of file browser_window.c.

References browser_window_get_root(), browser_window::bw, browser_window::drag, gui_window_table::drag_start, DRAGGING_CONTENT_SCROLLBAR, DRAGGING_NONE, DRAGGING_SCR_X, DRAGGING_SCR_Y, DRAGGING_SELECTION, GDRAGGING_OTHER, GDRAGGING_SCROLLBAR, guit, browser_window::type, type, browser_window::window, and netsurf_table::window.

Referenced by browser_window_callback(), browser_window_mouse_drag_end(), browser_window_page_drag_start(), browser_window_resize_frames(), browser_window_scroll_callback(), form_select_menu_scroll_callback(), textplain_mouse_action(), and textplain_mouse_track().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_set_gadget_filename()

void browser_window_set_gadget_filename ( struct browser_window bw,
struct form_control gadget,
const char *  fn 
)

set filename on form control.

Parameters
bwbrowser window to look inside.
gadgetform control.
fnfilename to set.

Definition at line 3045 of file browser_window.c.

References browser_window::bw, browser_window::current_content, and html_set_file_gadget_filename().

Referenced by gui_file_gadget_open(), and gui_window_file_gadget_open().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_set_name()

nserror browser_window_set_name ( struct browser_window bw,
const char *  name 
)

Set a browsing contexts name.

Changes a browsing contexts name to a copy of that passed and the value is not subsequently referenced.

Parameters
bwThe browser window.
nameThe name string to set.
Returns
NSERROR_OK and the name is updated or NSERROR_NOMEM and the original name is untouched.

Definition at line 2558 of file browser_window.c.

References browser_window::bw, browser_window::name, NSERROR_NOMEM, and NSERROR_OK.

◆ browser_window_set_pointer()

void browser_window_set_pointer ( struct browser_window bw,
browser_pointer_shape  shape 
)

Change the shape of the mouse pointer.

Parameters
bwBrowser window to set shape in
shapeThe pointer shape to use

Definition at line 4203 of file browser_window.c.

References BROWSER_POINTER_AUTO, browser_window_get_root(), browser_window::bw, content_get_status(), CONTENT_STATUS_READY, browser_window::current_content, GUI_POINTER_DEFAULT, GUI_POINTER_PROGRESS, guit, browser_window::last_action, browser_window::loading, browser_window::loading_content, root, gui_window_table::set_pointer, and netsurf_table::window.

Referenced by browser_window_callback(), browser_window_mouse_click_internal(), browser_window_mouse_track_internal(), and browser_window_scroll_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_set_position()

void browser_window_set_position ( struct browser_window bw,
int  x,
int  y 
)

Set the position of the current browser window with respect to the parent browser window.

Parameters
bwbrowser window to set the position of
xx position of bw
yy position of bw

Definition at line 2839 of file browser_window.c.

References browser_window::bw, NSLOG, browser_window::window, browser_window::x, and browser_window::y.

Referenced by browser_window_create_iframes(), and layout_calculate_descendant_bboxes().

Here is the caller graph for this function:

◆ browser_window_set_scale()

nserror browser_window_set_scale ( struct browser_window bw,
float  scale,
bool  absolute 
)

Sets the scale of a browser window.

Parameters
bwThe browser window to scale.
scaleThe new scale.
absoluteIf the scale value is absolute or relative to current value
Returns
NSERROR_OK and scale applied else other error code caused by reflow etc.

Definition at line 4286 of file browser_window.c.

References browser_window_recalculate_frameset(), browser_window_set_scale_internal(), browser_window::bw, NSERROR_OK, browser_window::parent, browser_window::scale, SCALE_MAXIMUM, and SCALE_MINIMUM.

Referenced by ami_gui_adjust_scale(), ami_gui_set_scale(), fb_browser_window_input(), menu_dec_scale(), menu_inc_scale(), nsws_window_command(), ro_gui_window_set_scale(), zoomminus_button_clicked_cb(), zoomnormal_button_clicked_cb(), and zoomplus_button_clicked_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_set_scale_internal()

static nserror browser_window_set_scale_internal ( struct browser_window bw,
float  scale 
)
static

Set browser window scale.

Parameters
bwBrowser window.
absolutescale value.
Returns
NSERROR_OK on success else error code

Definition at line 1939 of file browser_window.c.

References browser_window_schedule_reformat(), browser_window_set_scale_internal(), browser_window_update(), browser_window::bw, browser_window::children, browser_window::cols, content_can_reformat(), browser_window::current_content, browser_window::iframe_count, browser_window::iframes, NSERROR_OK, browser_window::rows, and browser_window::scale.

Referenced by browser_window_set_scale(), and browser_window_set_scale_internal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_set_scroll()

static nserror browser_window_set_scroll ( struct browser_window bw,
const struct rect rect 
)
static

Set the scroll position of a browser window.

scrolls the viewport to ensure the specified rectangle of the content is shown.

Parameters
bwwindow to scroll
rectThe rectangle to ensure is shown.
Returns
NSERROR_OK on success or apropriate error code.

Definition at line 241 of file browser_window.c.

References browser_window::bw, guit, NSERROR_OK, browser_window::scroll_x, browser_window::scroll_y, scrollbar_set(), gui_window_table::set_scroll, browser_window::window, netsurf_table::window, rect::x0, and rect::y0.

Referenced by browser_window_callback(), browser_window_content_done(), browser_window_mouse_track_internal(), browser_window_update(), and frag_scroll().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_set_selection()

static void browser_window_set_selection ( struct browser_window bw,
bool  selection,
bool  read_only 
)
static

Set or remove a selection.

Parameters
bwbrowser window with selection
selectiontrue if bw has a selection, false if removing selection
read_onlytrue iff selection is read only (e.g. can't cut it)

Definition at line 201 of file browser_window.c.

References browser_window_get_root(), browser_window::bw, content_clear_selection(), browser_window::current_content, browser_window::read_only, and browser_window::selection.

Referenced by browser_window_callback(), browser_window_destroy_internal(), and browser_window_mouse_click_internal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_set_status()

void browser_window_set_status ( struct browser_window bw,
const char *  text 
)

Change the status bar of a browser window.

Parameters
bwbrowser window
textnew status text (copied)

Definition at line 4169 of file browser_window.c.

References guit, browser_window::match, browser_window::miss, browser_window::parent, gui_window_table::set_status, browser_window::status, browser_window::text, text(), browser_window::text_len, browser_window::window, and netsurf_table::window.

Referenced by browser_window_callback(), browser_window_content_done(), browser_window_content_ready(), browser_window_mouse_click_internal(), browser_window_mouse_track_internal(), and navigate_internal_real().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_show_certificates()

nserror browser_window_show_certificates ( struct browser_window bw)

Show the certificate page for the current page.

Does nothing for a page without certificates.

Parameters
bwA browser window.
Returns
NSERROR_OK, or appropriate error otherwise.

Definition at line 4780 of file browser_window.c.

References browser_window_create(), browser_window::bw, BW_CREATE_FOREGROUND, BW_CREATE_HISTORY, BW_CREATE_TAB, cert_chain_to_query(), browser_window::current_cert_chain, NSERROR_NOT_FOUND, NSERROR_OK, and nsurl_unref().

Referenced by page_info__handle_item_click().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_show_cookies()

nserror browser_window_show_cookies ( const struct browser_window bw)

Open cookie viewer for the current page.

Parameters
bwA browser window.
Returns
NSERROR_OK, or appropriate error otherwise.

Definition at line 4763 of file browser_window.c.

References browser_window_access_url(), browser_window::bw, guit, netsurf_table::misc, nsurl_get_component(), NSURL_HOST, and gui_misc_table::present_cookies.

Referenced by page_info__handle_item_click().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_start_throbber()

static nserror browser_window_start_throbber ( struct browser_window bw)
static

Start the busy indicator.

Parameters
bwbrowser window

Definition at line 396 of file browser_window.c.

References browser_window::bw, gui_window_table::event, guit, GW_EVENT_START_THROBBER, browser_window::parent, browser_window::throbbing, browser_window::window, and netsurf_table::window.

Referenced by navigate_internal_real().

Here is the caller graph for this function:

◆ browser_window_stop()

void browser_window_stop ( struct browser_window bw)

◆ browser_window_stop_available()

bool browser_window_stop_available ( struct browser_window bw)

Check availability of Stop action for a given browser window.

Parameters
bwbrowser window
Returns
true if Stop action is available

Definition at line 4548 of file browser_window.c.

References browser_window::bw, content_get_status(), CONTENT_STATUS_DONE, browser_window::current_content, and browser_window::loading_content.

Referenced by ami_gui_event(), ami_update_buttons(), ro_gui_window_menu_prepare(), ro_gui_window_update_toolbar_buttons(), and toolbar_update_buttons().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_stop_throbber()

static nserror browser_window_stop_throbber ( struct browser_window bw)
static

Stop the busy indicator.

Parameters
bwbrowser window

Definition at line 412 of file browser_window.c.

References browser_window_check_throbber(), browser_window::bw, gui_window_table::event, guit, GW_EVENT_STOP_THROBBER, NSERROR_OK, browser_window::parent, browser_window::throbbing, browser_window::window, and netsurf_table::window.

Referenced by browser_window_callback(), browser_window_content_done(), browser_window_convert_to_download(), and browser_window_stop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_up_available()

bool browser_window_up_available ( struct browser_window bw)

Return true if a browser window can navigate upwards.

Parameters
bwthe browser window to test.
Returns
true if navigation up is possible otherwise false.

Definition at line 3834 of file browser_window.c.

References browser_window::current_content, hlcache_handle_get_url(), NSERROR_OK, nsurl_compare(), NSURL_COMPLETE, nsurl_parent(), nsurl_unref(), parent, and result.

Referenced by ro_gui_window_menu_prepare(), and ro_gui_window_update_toolbar_buttons().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_update()

static void browser_window_update ( struct browser_window bw,
bool  scroll_to_top 
)
static

Redraw browser window, set extent to content, and update title.

Parameters
bwbrowser_window
scroll_to_topmove view to top of page
Todo:
don't do this if the user has scrolled
Todo:
don't do this if the user has scrolled
Todo:
don't do this if the user has scrolled

Definition at line 736 of file browser_window.c.

References browser_window_invalidate_iframe(), browser_window_invalidate_rect(), browser_window_set_scroll(), browser_window::browser_window_type, browser_window_update_extent(), content_get_title(), browser_window::current_content, frag_scroll(), guit, browser_window::height, gui_window_table::invalidate, browser_window::parent, browser_window::scroll_x, browser_window::scroll_y, scrollbar_get_offset(), gui_window_table::set_title, browser_window::width, browser_window::window, netsurf_table::window, rect::x0, rect::x1, rect::y0, and rect::y1.

Referenced by browser_window_callback(), browser_window_content_done(), browser_window_content_ready(), browser_window_navigate(), and browser_window_set_scale_internal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_update_extent()

void browser_window_update_extent ( struct browser_window bw)

Update the extent of the inside of a browser window to that of the current content.

Parameters
bwbrowser_window to update the extent of

Definition at line 2780 of file browser_window.c.

References browser_window_handle_scrollbars(), browser_window::bw, gui_window_table::event, guit, GW_EVENT_UPDATE_EXTENT, browser_window::window, and netsurf_table::window.

Referenced by browser_window_create_frameset_internal(), browser_window_create_iframes(), and browser_window_update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ browser_window_update_favicon()

static nserror browser_window_update_favicon ( hlcache_handle c,
struct browser_window bw,
struct content_rfc5988_link link 
)
static

update the favicon associated with the browser window

Parameters
cthe page content handle.
bwA top level browser window.
linkA link context or NULL to attempt fallback scanning.

Definition at line 512 of file browser_window.c.

References browser_window_favicon_callback(), browser_window::bw, content_find_rfc5988_link(), CONTENT_IMAGE, browser_window::failed, browser_window::favicon, hlcache_handle_get_url(), hlcache_handle_retrieve(), HLCACHE_RETRIEVE_SNIFF_TYPE, content_rfc5988_link::href, browser_window::loading, browser_window::match, NSERROR_OK, NSLOG, nsurl_access(), nsurl_create(), nsurl_get_component(), nsurl_join(), nsurl_ref(), NSURL_SCHEME, nsurl_unref(), content_rfc5988_link::rel, and browser_window::window.

Referenced by browser_window_callback(), and browser_window_content_done().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ frag_scroll()

static bool frag_scroll ( struct browser_window bw)
static

scroll to a fragment if present

Parameters
bwbrowser window
Returns
true if the scroll was sucessful

Definition at line 701 of file browser_window.c.

References browser_window_history_update(), browser_window_set_scroll(), history::current, browser_window::current_content, browser_window::frag_id, browser_window::history, html_get_id_offset(), NSERROR_OK, rect::x0, rect::x1, rect::y0, and rect::y1.

Referenced by browser_window_update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_horz_scrollbar_len()

static int get_horz_scrollbar_len ( struct browser_window bw)
inlinestatic

Get browser window horizontal scrollbar widget length.

Parameters
bwThe browser window
Returns
the scrollbar's length

Definition at line 172 of file browser_window.c.

References browser_window::scroll_y, SCROLLBAR_WIDTH, and browser_window::width.

Referenced by browser_window_mouse_click_internal(), and browser_window_mouse_track_internal().

Here is the caller graph for this function:

◆ get_vert_scrollbar_len()

static int get_vert_scrollbar_len ( struct browser_window bw)
inlinestatic

Get browser window vertical scrollbar widget length.

Parameters
bwThe browser window
Returns
the scrollbar's length

Definition at line 187 of file browser_window.c.

References browser_window::height.

Referenced by browser_window_mouse_click_internal(), and browser_window_mouse_track_internal().

Here is the caller graph for this function:

◆ is_internal_navigate_url()

static bool is_internal_navigate_url ( nsurl url)
static

Check if this is an internal navigation URL.

This safely checks if the given url is an internal navigation even for urls with no scheme or path.

Parameters
urlThe URL to check
Returns
true if an internal navigation url else false

Definition at line 2516 of file browser_window.c.

References nsurl_get_component(), NSURL_PATH, NSURL_SCHEME, and path().

Referenced by browser_window_navigate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ navigate_internal_query_auth()

static nserror navigate_internal_query_auth ( struct browser_window bw,
struct browser_fetch_parameters params 
)
static

Internal navigation handler for the authentication query handler.

If the parameters indicate we're processing a response from the handler then we deal with that, otherwise we pass it on to the about: handler

Definition at line 3601 of file browser_window.c.

References browser_window__build_userpass(), browser_window__free_fetch_parameters(), browser_window__navigate_internal(), BW_NAVIGATE_INTERNAL, BW_NAVIGATE_NO_TERMINAL_HISTORY_UPDATE, fetch_multipart_data_find(), browser_fetch_parameters::flags, browser_window::internal_nav, browser_window::loading_parameters, navigate_internal_real(), NSERROR_INVALID, NSERROR_OK, nsurl_create(), nsurl_ref(), nsurl_unref(), browser_fetch_parameters::post_multipart, browser_fetch_parameters::url, and urldb_set_auth_details().

Referenced by browser_window__navigate_internal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ navigate_internal_query_fetcherror()

static nserror navigate_internal_query_fetcherror ( struct browser_window bw,
struct browser_fetch_parameters params 
)
static

Internal navigation handler for the fetch error query page.

If the parameters indicate we're processing a response from the handler then we deal with that, otherwise we pass it on to the about: handler

Definition at line 3751 of file browser_window.c.

References browser_window__reload_current_parameters(), fetch_multipart_data_find(), browser_window::internal_nav, browser_window::loading_parameters, navigate_internal_real(), NSLOG, and browser_fetch_parameters::post_multipart.

Referenced by browser_window__navigate_internal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ navigate_internal_query_ssl()

static nserror navigate_internal_query_ssl ( struct browser_window bw,
struct browser_fetch_parameters params 
)
static

Internal navigation handler for the SSL/privacy query page.

If the parameters indicate we're processing a response from the handler then we deal with that, otherwise we pass it on to the about: handler

Definition at line 3678 of file browser_window.c.

References browser_window__handle_ssl_query_response(), fetch_multipart_data_find(), browser_window::loading_parameters, navigate_internal_real(), NSERROR_OK, NSLOG, nsurl_create(), nsurl_unref(), browser_fetch_parameters::post_multipart, and browser_fetch_parameters::url.

Referenced by browser_window__navigate_internal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ navigate_internal_query_timeout()

static nserror navigate_internal_query_timeout ( struct browser_window bw,
struct browser_fetch_parameters params 
)
static

Internal navigation handler for the timeout query page.

If the parameters indicate we're processing a response from the handler then we deal with that, otherwise we pass it on to the about: handler

Definition at line 3715 of file browser_window.c.

References browser_window__reload_current_parameters(), fetch_multipart_data_find(), browser_window::internal_nav, browser_window::loading_parameters, navigate_internal_real(), NSLOG, and browser_fetch_parameters::post_multipart.

Referenced by browser_window__navigate_internal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ navigate_internal_real()

static nserror navigate_internal_real ( struct browser_window bw,
struct browser_fetch_parameters params 
)
static

Internal navigation handler for normal fetches.

Todo:
does this always try and download even unverifiable content?

Definition at line 3507 of file browser_window.c.

References browser_window_callback(), browser_window_refresh_url_bar_internal(), browser_window_set_status(), browser_window_start_throbber(), BW_NAVIGATE_HISTORY, BW_NAVIGATE_UNVERIFIABLE, cert_chain_free(), hlcache_child_context::charset, CONTENT_ANY, llcache_post_data::data, browser_fetch_parameters::flags, guit, browser_window::history_add, hlcache_handle_retrieve(), HLCACHE_RETRIEVE_MAY_DOWNLOAD, HLCACHE_RETRIEVE_SNIFF_TYPE, browser_window::internal_nav, browser_window::last_action, gui_misc_table::launch_url, LLCACHE_RETRIEVE_VERIFIABLE, browser_window::loading_cert_chain, browser_window::loading_content, messages_get(), messages_get_errorcode(), netsurf_table::misc, llcache_post_data::multipart, NSERROR_NO_FETCH_HANDLER, NSERROR_OK, NSLOG, nsurl_access(), browser_fetch_parameters::parent_charset, browser_fetch_parameters::parent_quirks, browser_fetch_parameters::post_multipart, browser_fetch_parameters::post_urlenc, hlcache_child_context::quirks, browser_fetch_parameters::referrer, gui_window_table::set_icon, llcache_post_data::type, browser_fetch_parameters::url, llcache_post_data::urlenc, browser_window::window, and netsurf_table::window.

Referenced by browser_window__navigate_internal(), navigate_internal_query_auth(), navigate_internal_query_fetcherror(), navigate_internal_query_ssl(), and navigate_internal_query_timeout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scheduled_reformat()

static void scheduled_reformat ( void *  vbw)
static

internal scheduled reformat callback.

scheduled reformat callback to allow reformats from unthreaded context.

Parameters
vbwThe browser window to be reformatted

Definition at line 1818 of file browser_window.c.

References browser_window_reformat(), browser_window::bw, gui_window_table::get_dimensions, guit, height, NSERROR_OK, width, browser_window::window, and netsurf_table::window.

Referenced by browser_window_destroy_internal(), and browser_window_schedule_reformat().

Here is the call graph for this function:
Here is the caller graph for this function: