NetSurf
Data Structures | Typedefs | Functions
browser_private.h File Reference

Browser window private structure. More...

#include "content/fetch.h"
#include "desktop/frame_types.h"
Include dependency graph for browser_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  history_page
 history entry page information More...
 
struct  history_entry
 A node in the history tree. More...
 
struct  history
 History tree for a window. More...
 
struct  browser_fetch_parameters
 The parameters for a fetch. More...
 
struct  browser_window
 Browser window data. More...
 

Typedefs

typedef nserror(* browser_window_query_callback) (bool proceed, void *pw)
 Type for handling query responses short-term. More...
 

Functions

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...
 
nserror browser_window_destroy_internal (struct browser_window *bw)
 Release all memory associated with a browser window. 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_update_extent (struct browser_window *bw)
 Update the extent of the inside of a browser window to that of the current content. 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_set_status (struct browser_window *bw, const char *text)
 Change the status bar of a browser window. More...
 
struct browser_windowbrowser_window_get_root (struct browser_window *bw)
 Get the root level browser window. More...
 
nserror browser_window_history_create (struct browser_window *bw)
 Create a new history tree for a browser window window. More...
 
nserror browser_window_history_clone (const struct browser_window *existing, struct browser_window *clone)
 Clone a bw's history tree for new bw. More...
 
nserror browser_window_history_add (struct browser_window *bw, struct hlcache_handle *content, lwc_string *frag_id)
 Insert a url into the history tree. More...
 
nserror browser_window_history_update (struct browser_window *bw, struct hlcache_handle *content)
 Update the thumbnail and scroll offsets for the current entry. More...
 
nserror browser_window_history_get_scroll (struct browser_window *bw, float *sx, float *sy)
 Retrieve the stored scroll offsets for the current history entry. More...
 
void browser_window_history_destroy (struct browser_window *bw)
 Free a history structure. More...
 
nserror browser_window__reload_current_parameters (struct browser_window *bw)
 Navigate a browser window to the current parameters. More...
 

Detailed Description

Browser window private structure.

Definition in file browser_private.h.

Typedef Documentation

◆ browser_window_query_callback

typedef nserror(* browser_window_query_callback) (bool proceed, void *pw)

Type for handling query responses short-term.

Definition at line 411 of file browser_private.h.

Function Documentation

◆ 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 4644 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_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_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 4017 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_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 2908 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_history_add()

nserror browser_window_history_add ( struct browser_window bw,
struct hlcache_handle content,
lwc_string *  frag_id 
)

Insert a url into the history tree.

Parameters
bwbrowser window with history object
contentcontent to add to history
frag_idfragment identifier, or NULL.
Returns
NSERROR_OK or error code on faliure.

The page is added after the current entry and becomes current.

Definition at line 352 of file browser_history.c.

References history_entry::back, history_page::bitmap, netsurf_table::bitmap, BITMAP_CLEAR, BITMAP_OPAQUE, browser_window_history__layout(), history_entry::children, content_get_title(), gui_bitmap_table::create, history::current, history_entry::forward, history_entry::forward_last, history_entry::forward_pref, history_page::frag_id, guit, browser_window::history, hlcache_handle_get_url(), LOCAL_HISTORY_HEIGHT, LOCAL_HISTORY_WIDTH, history_entry::next, NSERROR_NOMEM, NSERROR_OK, NSLOG, nsurl_access(), nsurl_ref(), history_entry::page, gui_bitmap_table::render, history_page::scroll_x, history_page::scroll_y, history::start, history_page::title, and history_page::url.

Referenced by browser_window_content_ready(), and browser_window_navigate().

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

◆ browser_window_history_clone()

nserror browser_window_history_clone ( const struct browser_window existing,
struct browser_window clone 
)

Clone a bw's history tree for new bw.

Parameters
existingbrowser window with history to clone.
clonebrowser window to make cloned history for.
Returns
NSERROR_OK or appropriate error otherwise

Definition at line 317 of file browser_history.c.

References browser_window_history__clone_entry(), browser_window_history_create(), browser_window_history_destroy(), browser_window::history, NSERROR_NOMEM, NSERROR_OK, NSLOG, and history::start.

Referenced by browser_window_initialise_common().

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

◆ browser_window_history_create()

nserror browser_window_history_create ( struct browser_window bw)

Create a new history tree for a browser window window.

Parameters
bwbrowser window to create history for.
Returns
NSERROR_OK or appropriate error otherwise

Definition at line 296 of file browser_history.c.

References history::height, browser_window::history, LOCAL_HISTORY_BOTTOM_MARGIN, LOCAL_HISTORY_RIGHT_MARGIN, NSERROR_NOMEM, NSERROR_OK, and history::width.

Referenced by browser_window_history_clone(), and browser_window_initialise_common().

Here is the caller graph for this function:

◆ browser_window_history_destroy()

void browser_window_history_destroy ( struct browser_window bw)

Free a history structure.

Parameters
bwThe browser window to destroy the history within.

Definition at line 502 of file browser_history.c.

References browser_window_history__free_entry(), browser_window::history, and history::start.

Referenced by browser_window_destroy_internal(), and browser_window_history_clone().

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

◆ browser_window_history_get_scroll()

nserror browser_window_history_get_scroll ( struct browser_window bw,
float *  sx,
float *  sy 
)

Retrieve the stored scroll offsets for the current history entry.

Parameters
bwThe browser window to retrieve scroll offsets for.
sxPointer to a float for the X scroll offset
syPointer to a float for the Y scroll offset
Returns
NSERROR_OK or error code on failure.

Definition at line 482 of file browser_history.c.

References history::current, browser_window::history, NSERROR_INVALID, NSERROR_OK, history_entry::page, history_page::scroll_x, and history_page::scroll_y.

Referenced by browser_window_content_done().

Here is the caller graph for this function:

◆ browser_window_history_update()

nserror browser_window_history_update ( struct browser_window bw,
struct hlcache_handle content 
)

Update the thumbnail and scroll offsets for the current entry.

Parameters
bwThe browser window to update the history within.
contentcontent for current entry
Returns
NSERROR_OK or error code on faliure.

Definition at line 427 of file browser_history.c.

References history_page::bitmap, netsurf_table::bitmap, content_get_height(), content_get_title(), content_get_width(), history::current, gui_window_table::get_scroll, guit, browser_window::history, NSERROR_INVALID, NSERROR_NOMEM, NSERROR_OK, NSLOG, history_entry::page, gui_bitmap_table::render, history_page::scroll_x, history_page::scroll_y, history_page::title, history_page::url, browser_window::window, and netsurf_table::window.

Referenced by browser_window_content_done(), browser_window_history_go(), browser_window_navigate(), and frag_scroll().

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

◆ 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 3186 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 4057 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_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 4179 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_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 2790 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: