68 new_entry = calloc(1,
sizeof *entry);
81 if (new_entry->
page.
url == NULL) {
102 unsigned char *bmsrc_data;
103 unsigned char *bmdst_data;
116 memcpy(bmdst_data, bmsrc_data, bmsize);
128 for (child = new_entry->
forward; child != NULL; child = child->
next) {
130 if (new_child == NULL) {
143 new_child->
back = new_entry;
145 prev->
next = new_child;
146 if (new_entry->
forward == child)
147 new_entry->
forward = new_child;
213 for (child = entry->
forward; child; child = child->
next) {
276 if (!cb(bw, entry->
x, entry->
y,
282 for (child = entry->
forward; child; child = child->
next) {
324 if (existing == NULL || existing->
history == NULL ||
330 new_history = malloc(
sizeof *new_history);
335 memcpy(new_history, existing->
history,
sizeof *new_history);
339 if (!new_history->
start) {
340 NSLOG(netsurf, INFO,
"Insufficient memory to clone history");
367 entry = malloc(
sizeof *entry);
380 entry->
page.
frag_id = frag_id ? lwc_string_ref(frag_id) : NULL;
386 NSLOG(netsurf, DEBUG,
396 NSLOG(netsurf, WARNING,
"Thumbnail render failed");
449 NSLOG(netsurf, INFO,
"Updating history entry for %s", title);
457 if ((bw->
window != NULL) &&
462 if (content_height < 1) {
465 if (content_width < 1) {
470 (float)sx / (
float)content_width;
472 (float)sy / (
float)content_height;
473 NSLOG(netsurf, INFO,
"Updated scroll offsets to %g by %g",
483 float *sx,
float *sy)
529 corestring_nsurl_about_blank,
579 struct bitmap **bitmap_out)
626 url, NULL, bw, NULL);
685 if (bw == NULL || bw->
history == NULL)
nserror browser_window_history_add(struct browser_window *bw, struct hlcache_handle *content, lwc_string *frag_id)
Insert a url into the history tree.
static void browser_window_history__layout(struct history *history)
Compute node positions.
void browser_window_history_enumerate_back(const struct browser_window *bw, browser_window_history_enumerate_cb cb, void *user_data)
Enumerate all entries that will be reached by the 'back' button.
nserror browser_window_history_update(struct browser_window *bw, struct hlcache_handle *content)
Update the thumbnail and scroll offsets for the current entry.
nserror browser_window_history_get_thumbnail(struct browser_window *bw, struct bitmap **bitmap_out)
Get the thumbnail bitmap for the current history entry.
static struct history_entry * browser_window_history__clone_entry(struct history *history, struct history_entry *entry)
Clone a history entry.
nserror browser_window_history_forward(struct browser_window *bw, bool new_window)
Go forward in the history.
nserror browser_window_history_create(struct browser_window *bw)
Create a new history tree for a browser window window.
nsurl * browser_window_history_entry_get_url(const struct history_entry *entry)
Returns the URL to a history entry.
nserror browser_window_history_get_scroll(struct browser_window *bw, float *sx, float *sy)
Retrieve the stored scroll offsets for the current history entry.
nserror browser_window_history_go(struct browser_window *bw, struct history_entry *entry, bool new_window)
Navigate to specified history entry, optionally in new window.
static bool browser_window_history__enumerate_entry(const struct browser_window *bw, const struct history_entry *entry, browser_window_history_enumerate_cb cb, void *ud)
Enumerate subentries in history See also history_enumerate()
static int browser_window_history__layout_subtree(struct history *history, struct history_entry *entry, int x, int y)
Recursively position a subtree.
void browser_window_history_enumerate_forward(const struct browser_window *bw, browser_window_history_enumerate_cb cb, void *user_data)
Enumerate all entries that will be reached by the 'forward' button.
static void browser_window_history__free_entry(struct history_entry *entry)
Free an entry in the tree recursively.
const char * browser_window_history_entry_get_title(const struct history_entry *entry)
Returns the title of a history entry.
nserror browser_window_history_clone(const struct browser_window *existing, struct browser_window *clone)
Clone a bw's history tree for new bw.
void browser_window_history_enumerate(const struct browser_window *bw, browser_window_history_enumerate_cb cb, void *user_data)
Enumerate all entries in the history.
bool browser_window_history_forward_available(struct browser_window *bw)
Check whether it is pssible to go forwards in the history.
const char * browser_window_history_entry_get_fragment_id(const struct history_entry *entry)
Returns the URL to a history entry.
bool browser_window_history_back_available(struct browser_window *bw)
Check whether it is pssible to go back in the history.
nserror browser_window_history_back(struct browser_window *bw, bool new_window)
Go back in the history.
void browser_window_history_destroy(struct browser_window *bw)
Free a history structure.
Interface to browser history operations.
bool(* browser_window_history_enumerate_cb)(const struct browser_window *bw, int x0, int y0, int x1, int y1, const struct history_entry *entry, void *user_data)
Callback function type for history enumeration.
Browser window private structure.
nserror browser_window__reload_current_parameters(struct browser_window *bw)
Navigate a browser window to the current parameters.
Browser window creation and manipulation interface.
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.
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.
@ BW_CREATE_CLONE
New gui_window to be clone of "existing" gui_window.
@ BW_NAVIGATE_HISTORY
this will form a new history node (don't set for back/reload/etc)
@ BW_NAVIGATE_NO_TERMINAL_HISTORY_UPDATE
suppress initial history updates (used by back/fwd/etc)
Useful interned string pointers (interface).
nserror
Enumeration of error codes.
@ NSERROR_BAD_PARAMETER
Bad Parameter.
@ NSERROR_INVALID
Invalid data.
@ NSERROR_NOMEM
Memory exhaustion.
struct netsurf_table * guit
The global interface table.
Interface to core interface table.
High-level resource cache interface.
Generic bitmap handling interface.
@ BITMAP_CLEAR
memory should be wiped to 0
@ BITMAP_OPAQUE
image is opaque
Public content interface.
struct nsurl * hlcache_handle_get_url(const struct hlcache_handle *handle)
Retrieve the URL associated with a high level cache handle.
const char * content_get_title(struct hlcache_handle *h)
Retrieve title associated with content.
int content_get_height(struct hlcache_handle *h)
Retrieve height of content.
struct bitmap * content_get_bitmap(struct hlcache_handle *h)
Retrieve the bitmap contained in an image content.
int content_get_width(struct hlcache_handle *h)
Retrieve width of content.
Interface to platform-specific layout operation table.
Interface to platform-specific graphical user interface window operations.
Interface to browser history private operations.
#define LOCAL_HISTORY_RIGHT_MARGIN
#define LOCAL_HISTORY_WIDTH
#define LOCAL_HISTORY_BOTTOM_MARGIN
#define LOCAL_HISTORY_HEIGHT
#define NSLOG(catname, level, logmsg, args...)
void nsurl_unref(nsurl *url)
Drop a reference to a NetSurf URL object.
nserror nsurl_refragment(const nsurl *url, lwc_string *frag, nsurl **new_url)
Create a NetSurf URL object, adding a fragment to an existing URL object.
const char * nsurl_access(const nsurl *url)
Access a NetSurf URL object as a string.
nsurl * nsurl_ref(nsurl *url)
Increment the reference count to a NetSurf URL object.
struct nsurl nsurl
NetSurf URL object.
Interface to utility string handling.
RISC OS wimp toolkit bitmap.
struct nsurl * url
The URL to fetch.
struct gui_window * window
Platform specific window data only valid at top level.
struct history * history
local history handle.
struct hlcache_handle * current_content
Content handle of page currently displayed which must have READY or DONE status or NULL for no conten...
bool internal_nav
Internal navigation, do not update URL etc.
struct browser_fetch_parameters current_parameters
The fetch parameters for the current content.
Content which corresponds to a single URL.
int(* get_height)(void *bitmap)
Get the bitmap height.
void(* destroy)(void *bitmap)
Destroy a bitmap.
void *(* create)(int width, int height, enum gui_bitmap_flags flags)
Create a new bitmap.
nserror(* render)(struct bitmap *bitmap, struct hlcache_handle *content)
Render content into a bitmap.
size_t(* get_rowstride)(void *bitmap)
Get the number of bytes per row of the image.
unsigned char *(* get_buffer)(void *bitmap)
Get the image buffer from a bitmap.
bool(* get_scroll)(struct gui_window *gw, int *sx, int *sy)
Get the scroll position of a browser window.
A node in the history tree.
struct history_entry * forward_last
Last child.
struct history_entry * back
Parent.
unsigned int children
Number of children.
struct history_entry * forward
First child.
struct history_entry * next
Next sibling.
struct history_entry * forward_pref
Child in direction of current entry.
float scroll_y
Scroll Y offset when visited.
float scroll_x
Scroll X offset when visited.
struct bitmap * bitmap
Thumbnail bitmap, or NULL.
char * title
Fragment identifier, or NULL.
struct nsurl * url
Page URL, never NULL.
History tree for a window.
int width
Width of layout.
int height
Height of layout.
struct history_entry * current
Current position in tree.
struct history_entry * start
First page in tree (page that window opened with).
struct gui_window_table * window
Window table.
struct gui_bitmap_table * bitmap
Bitmap table.
Interface to time operations.
Unified URL information database internal interface.
Interface to a number of general purpose functionality.
static nserror bitmap(const struct redraw_context *ctx, struct bitmap *bitmap, int x, int y, int width, int height, colour bg, bitmap_flags_t flags)
Plot a bitmap.