NetSurf
Data Structures | Enumerations | Functions
browser_window.h File Reference

Browser window creation and manipulation interface. More...

#include <stdbool.h>
#include <stdio.h>
#include "utils/errors.h"
#include "netsurf/mouse.h"
#include "netsurf/console.h"
Include dependency graph for browser_window.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  browser_window_features
 Page features at a specific spatial location. More...
 

Enumerations

enum  browser_drag_type {
  DRAGGING_NONE , DRAGGING_SELECTION , DRAGGING_PAGE_SCROLL , DRAGGING_FRAME ,
  DRAGGING_SCR_X , DRAGGING_SCR_Y , DRAGGING_CONTENT_SCROLLBAR , DRAGGING_OTHER
}
 type of browser window drag in progess More...
 
enum  browser_window_page_info_state {
  PAGE_STATE_UNKNOWN , PAGE_STATE_INTERNAL , PAGE_STATE_LOCAL , PAGE_STATE_INSECURE ,
  PAGE_STATE_SECURE_OVERRIDE , PAGE_STATE_SECURE_ISSUES , PAGE_STATE_SECURE , PAGE_STATE__COUNT
}
 Browser window page information states. More...
 
enum  browser_editor_flags { BW_EDITOR_NONE = 0 , BW_EDITOR_CAN_COPY = (1 << 0) , BW_EDITOR_CAN_CUT = (1 << 1) , BW_EDITOR_CAN_PASTE = (1 << 2) }
 
enum  browser_scrolling { BW_SCROLLING_AUTO , BW_SCROLLING_YES , BW_SCROLLING_NO }
 
enum  browser_window_create_flags {
  BW_CREATE_NONE = 0 , BW_CREATE_HISTORY = (1 << 0) , BW_CREATE_TAB = (1 << 1) , BW_CREATE_CLONE = (1 << 2) ,
  BW_CREATE_UNVERIFIABLE = (1 << 3) , BW_CREATE_FOREGROUND = (1 << 4) , BW_CREATE_FOCUS_LOCATION = (1 << 5)
}
 flags to browser_window_create More...
 
enum  browser_window_nav_flags {
  BW_NAVIGATE_NONE = 0 , BW_NAVIGATE_HISTORY = (1 << 0) , BW_NAVIGATE_DOWNLOAD = (1 << 1) , BW_NAVIGATE_UNVERIFIABLE = (1 << 2) ,
  BW_NAVIGATE_NO_TERMINAL_HISTORY_UPDATE = (1 << 3) , BW_NAVIGATE_INTERNAL = (1 << 4)
}
 flags to browser_window_navigate
More...
 

Functions

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. More...
 
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. 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...
 
struct 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, struct 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...
 
nserror browser_window_get_extents (struct browser_window *bw, bool scaled, int *width, int *height)
 Get a browser window's content extents. 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...
 
void browser_window_set_dimensions (struct browser_window *bw, int width, int height)
 Set the dimensions of the area a browser window occupies. 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_destroy (struct browser_window *bw)
 Close and destroy a browser window. 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...
 
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_refresh_url_bar (struct browser_window *bw)
 Update URL bar for a given browser window to bw's content's URL. 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_mouse_track (struct browser_window *bw, browser_mouse_state mouse, int x, int y)
 Handle non-click mouse action in 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...
 
nserror browser_window_schedule_reformat (struct browser_window *bw)
 Reformat the browser window contents in a safe context. More...
 
void browser_window_set_pointer (struct browser_window *bw, browser_pointer_shape shape)
 Change the shape of the mouse pointer. 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_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_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...
 
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_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_get_name (struct browser_window *bw, const char **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_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...
 
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 interface.

Definition in file browser_window.h.

Enumeration Type Documentation

◆ browser_drag_type

type of browser window drag in progess

Enumerator
DRAGGING_NONE 
DRAGGING_SELECTION 
DRAGGING_PAGE_SCROLL 
DRAGGING_FRAME 
DRAGGING_SCR_X 
DRAGGING_SCR_Y 
DRAGGING_CONTENT_SCROLLBAR 
DRAGGING_OTHER 

Definition at line 51 of file browser_window.h.

◆ browser_editor_flags

Enumerator
BW_EDITOR_NONE 

No selection, no editing.

BW_EDITOR_CAN_COPY 

Have selection.

BW_EDITOR_CAN_CUT 

Selection not read-only.

BW_EDITOR_CAN_PASTE 

Can paste, input.

Definition at line 76 of file browser_window.h.

◆ browser_scrolling

Enumerator
BW_SCROLLING_AUTO 
BW_SCROLLING_YES 
BW_SCROLLING_NO 

Definition at line 83 of file browser_window.h.

◆ browser_window_create_flags

flags to browser_window_create

Enumerator
BW_CREATE_NONE 

No flags set.

BW_CREATE_HISTORY 

this will form a new history node (don't set for back/reload/etc)

BW_CREATE_TAB 

New gui_window to be tab in same window as "existing" gui_window.

BW_CREATE_CLONE 

New gui_window to be clone of "existing" gui_window.

BW_CREATE_UNVERIFIABLE 

Window not opened by user interaction (e.g.

JS popup)

   rfc2965:
      A transaction is verifiable if the user, or a
      user-designated agent, has the option to review
      the request-URI prior to its use in the transaction.
      A transaction is unverifiable if the user does not
      have that option.
BW_CREATE_FOREGROUND 

Request foreground opening.

BW_CREATE_FOCUS_LOCATION 

Request location bar focus.

Definition at line 90 of file browser_window.h.

◆ browser_window_nav_flags

flags to browser_window_navigate

Enumerator
BW_NAVIGATE_NONE 

No flags set.

BW_NAVIGATE_HISTORY 

this will form a new history node (don't set for back/reload/etc)

BW_NAVIGATE_DOWNLOAD 

download rather than render the uri

BW_NAVIGATE_UNVERIFIABLE 

Transation not caused by user interaction (e.g.

JS-caused)

   rfc2965:
      A transaction is verifiable if the user, or a
      user-designated agent, has the option to review
      the request-URI prior to its use in the transaction.
      A transaction is unverifiable if the user does not
      have that option.
BW_NAVIGATE_NO_TERMINAL_HISTORY_UPDATE 

suppress initial history updates (used by back/fwd/etc)

BW_NAVIGATE_INTERNAL 

Internal navigation (set only by core features using such)

Definition at line 122 of file browser_window.h.

◆ browser_window_page_info_state

Browser window page information states.

Enumerator
PAGE_STATE_UNKNOWN 

Unable to determine.

PAGE_STATE_INTERNAL 

Page loaded from internal handler.

PAGE_STATE_LOCAL 

Page loaded from file:/// etc.

PAGE_STATE_INSECURE 

Insecure page load.

PAGE_STATE_SECURE_OVERRIDE 

Secure load, but had to override.

PAGE_STATE_SECURE_ISSUES 

Secure load, but has insecure elements.

PAGE_STATE_SECURE 

Secure load.

PAGE_STATE__COUNT 

Count of number of valid page states.

Definition at line 65 of file browser_window.h.

Function Documentation

◆ browser_window_access_url()

struct 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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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: