NetSurf
Macros | Functions | Variables
content.c File Reference

Content handling implementation. More...

#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <nsutils/time.h>
#include "netsurf/inttypes.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/corestrings.h"
#include "netsurf/browser_window.h"
#include "netsurf/bitmap.h"
#include "netsurf/content.h"
#include "desktop/knockout.h"
#include "content/content_protected.h"
#include "content/textsearch.h"
#include "content/content_debug.h"
#include "content/hlcache.h"
#include "content/urldb.h"
Include dependency graph for content.c:

Go to the source code of this file.

Macros

#define URL_FMT_SPC   "%.140s"
 

Functions

static void content_convert (struct content *c)
 All data has arrived, convert for display. More...
 
static nserror content_llcache_callback (llcache_handle *llcache, const llcache_event *event, void *pw)
 Handler for low-level cache events. More...
 
static void content_update_status (struct content *c)
 update content status message More...
 
nserror content__init (struct content *c, const content_handler *handler, lwc_string *imime_type, const struct http_parameter *params, llcache_handle *llcache, const char *fallback_charset, bool quirks)
 
bool content_can_reformat (hlcache_handle *h)
 Get whether a content can reformat. More...
 
void content_set_status (struct content *c, const char *status_message)
 Updates content with new status. More...
 
void content_set_ready (struct content *c)
 Put a content in status CONTENT_STATUS_READY and unlock the content. More...
 
void content_set_done (struct content *c)
 Put a content in status CONTENT_STATUS_DONE. More...
 
void content_set_error (struct content *c)
 Put a content in status CONTENT_STATUS_ERROR and unlock the content. More...
 
void content_reformat (hlcache_handle *h, bool background, int width, int height)
 Reformat to new size. More...
 
void content__reformat (struct content *c, bool background, int width, int height)
 cause a content to be reformatted. More...
 
void content_destroy (struct content *c)
 Destroy and free a content. More...
 
void content_mouse_track (hlcache_handle *h, struct browser_window *bw, browser_mouse_state mouse, int x, int y)
 Handle mouse movements in a content window. More...
 
void content_mouse_action (hlcache_handle *h, struct browser_window *bw, browser_mouse_state mouse, int x, int y)
 Handle mouse clicks and movements in a content window. More...
 
bool content_keypress (struct hlcache_handle *h, uint32_t key)
 Handle keypresses. More...
 
void content_request_redraw (struct hlcache_handle *h, int x, int y, int width, int height)
 Request a redraw of an area of a content. More...
 
void content__request_redraw (struct content *c, int x, int y, int width, int height)
 Request a redraw of an area of a content. More...
 
bool content_exec (struct hlcache_handle *h, const char *src, size_t srclen)
 Execute some JavaScript code inside a content object. More...
 
bool content_saw_insecure_objects (struct hlcache_handle *h)
 Determine if the content referred to any insecure objects. More...
 
bool content_redraw (hlcache_handle *h, struct content_redraw_data *data, const struct rect *clip, const struct redraw_context *ctx)
 Display content on screen with optional tiling. More...
 
bool content_scaled_redraw (struct hlcache_handle *h, int width, int height, const struct redraw_context *ctx)
 Redraw a content with scale set for horizontal fit. More...
 
bool content_add_user (struct content *c, void(*callback)(struct content *c, content_msg msg, const union content_msg_data *data, void *pw), void *pw)
 Register a user for callbacks. More...
 
void content_remove_user (struct content *c, void(*callback)(struct content *c, content_msg msg, const union content_msg_data *data, void *pw), void *pw)
 Remove a callback user. More...
 
uint32_t content_count_users (struct content *c)
 Count users for the content. More...
 
bool content_matches_quirks (struct content *c, bool quirks)
 Determine if quirks mode matches. More...
 
bool content_is_shareable (struct content *c)
 Determine if a content is shareable. More...
 
void content_broadcast (struct content *c, content_msg msg, const union content_msg_data *data)
 Send a message to all users. More...
 
void content_broadcast_error (struct content *c, nserror errorcode, const char *msg)
 Send an error message to all users. More...
 
nserror content_open (hlcache_handle *h, struct browser_window *bw, struct content *page, struct object_params *params)
 A window containing the content has been opened. More...
 
nserror content_close (hlcache_handle *h)
 The window containing the content has been closed. More...
 
void content_clear_selection (hlcache_handle *h)
 Tell a content that any selection it has, or one of its objects has, must be cleared. More...
 
char * content_get_selection (hlcache_handle *h)
 Get a text selection from a content. More...
 
nserror content_get_contextual_content (struct hlcache_handle *h, int x, int y, struct browser_window_features *data)
 Get positional contextural information for a content. More...
 
bool content_scroll_at_point (struct hlcache_handle *h, int x, int y, int scrx, int scry)
 scroll content at coordnate More...
 
bool content_drop_file_at_point (struct hlcache_handle *h, int x, int y, char *file)
 Drag and drop a file at coordinate. More...
 
nserror content_debug_dump (struct hlcache_handle *h, FILE *f, enum content_debug op)
 Dump debug information to file. More...
 
nserror content_debug (struct hlcache_handle *h, enum content_debug op)
 Control debug con a content. More...
 
struct content_rfc5988_linkcontent_find_rfc5988_link (hlcache_handle *h, lwc_string *rel)
 find link in content that matches the rel string. More...
 
struct content_rfc5988_linkcontent__free_rfc5988_link (struct content_rfc5988_link *link)
 free a rfc5988 link More...
 
bool content__add_rfc5988_link (struct content *c, const struct content_rfc5988_link *link)
 associate a metadata link with a content. More...
 
nsurlcontent_get_url (struct content *c)
 Retrieve URL associated with content. More...
 
content_type content_get_type (hlcache_handle *h)
 Retrieve computed type of content. More...
 
lwc_string * content_get_mime_type (hlcache_handle *h)
 Retrieve mime-type of content. More...
 
lwc_string * content__get_mime_type (struct content *c)
 Retrieve mime-type of content. More...
 
bool content__set_title (struct content *c, const char *title)
 Set title associated with content. More...
 
const char * content_get_title (hlcache_handle *h)
 Retrieve title associated with content. More...
 
const char * content__get_title (struct content *c)
 Retrieve title associated with content. More...
 
content_status content_get_status (hlcache_handle *h)
 Retrieve status of content. More...
 
content_status content__get_status (struct content *c)
 Retrieve status of content. More...
 
const char * content_get_status_message (hlcache_handle *h)
 Retrieve status message associated with content. More...
 
const char * content__get_status_message (struct content *c)
 Retrieve status message associated with content. More...
 
int content_get_width (hlcache_handle *h)
 Retrieve width of content. More...
 
int content__get_width (struct content *c)
 Retrieve width of content. More...
 
int content_get_height (hlcache_handle *h)
 Retrieve height of content. More...
 
int content__get_height (struct content *c)
 Retrieve height of content. More...
 
int content_get_available_width (hlcache_handle *h)
 Retrieve available width of content. More...
 
int content__get_available_width (struct content *c)
 Retrieve available width of content. More...
 
const uint8_t * content_get_source_data (hlcache_handle *h, size_t *size)
 Retrieve source of content. More...
 
const uint8_t * content__get_source_data (struct content *c, size_t *size)
 Retrieve source of content. More...
 
void content_invalidate_reuse_data (hlcache_handle *h)
 Invalidate content reuse data. More...
 
void content__invalidate_reuse_data (struct content *c)
 Invalidate content reuse data. More...
 
nsurlcontent_get_refresh_url (hlcache_handle *h)
 Retrieve the refresh URL for a content. More...
 
nsurlcontent__get_refresh_url (struct content *c)
 Retrieve the refresh URL for a content. More...
 
struct bitmapcontent_get_bitmap (hlcache_handle *h)
 Retrieve the bitmap contained in an image content. More...
 
struct bitmapcontent__get_bitmap (struct content *c)
 Retrieve the bitmap contained in an image content. More...
 
bool content_get_opaque (hlcache_handle *h)
 Determine if a content is opaque from handle. More...
 
bool content__get_opaque (struct content *c)
 Determine if a content is opaque. More...
 
bool content_get_quirks (hlcache_handle *h)
 Retrieve quirkiness of a content. More...
 
const char * content_get_encoding (hlcache_handle *h, enum content_encoding_type op)
 Retrieve the encoding of a content. More...
 
const char * content__get_encoding (struct content *c, enum content_encoding_type op)
 Retrieve the encoding of a content. More...
 
bool content_is_locked (hlcache_handle *h)
 Return whether a content is currently locked. More...
 
bool content__is_locked (struct content *c)
 Return whether a content is currently locked. More...
 
const llcache_handlecontent_get_llcache_handle (struct content *c)
 Retrieve the low-level cache handle for a content. More...
 
struct contentcontent_clone (struct content *c)
 Clone a content object in its current state. More...
 
nserror content__clone (const struct content *c, struct content *nc)
 Clone a content's data members. More...
 
nserror content_abort (struct content *c)
 Abort a content object. More...
 

Variables

const char *const content_status_name []
 

Detailed Description

Content handling implementation.

Definition in file content.c.

Macro Definition Documentation

◆ URL_FMT_SPC

#define URL_FMT_SPC   "%.140s"

Definition at line 44 of file content.c.

Function Documentation

◆ content__add_rfc5988_link()

bool content__add_rfc5988_link ( struct content c,
const struct content_rfc5988_link link 
)

associate a metadata link with a content.

Parameters
ccontent to add link to
linkThe rfc5988 link to add

Definition at line 1001 of file content.c.

References content_broadcast(), CONTENT_MSG_LINK, content_rfc5988_link::href, content_rfc5988_link::hreflang, content::links, content_rfc5988_link::media, content_rfc5988_link::next, nsurl_ref(), content_rfc5988_link::rel, content_msg_data::rfc5988_link, content_rfc5988_link::sizes, and content_rfc5988_link::type.

Referenced by html_process_inserted_link().

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

◆ content__clone()

nserror content__clone ( const struct content c,
struct content nc 
)

Clone a content's data members.

Parameters
cContent to clone
ncContent to populate
Returns
NSERROR_OK on success, appropriate error otherwise

Definition at line 1382 of file content.c.

References content::active, content::available_width, content_llcache_callback(), content::fallback_charset, content::handler, content::height, content::http_code, content::llcache, llcache_handle_change_callback(), llcache_handle_clone(), content::locked, content::mime_type, NSERROR_NOMEM, NSERROR_OK, nsurl_ref(), content::quirks, content::reformat_time, content::refresh, content::size, content::status, content::status_message, content::sub_status, content::time, content::title, content::total_size, content::user_list, and content::width.

Referenced by amiga_plugin_hack_clone(), gif_clone(), javascript_clone(), nsbmp_clone(), nscss_clone(), nsico_clone(), nsjpeg_clone(), nsjpegxl_clone(), nspng_clone(), nssprite_clone(), rsvg_clone(), svg_clone(), textplain_clone(), and webp_clone().

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

◆ content__free_rfc5988_link()

struct content_rfc5988_link * content__free_rfc5988_link ( struct content_rfc5988_link link)

free a rfc5988 link

Parameters
linkThe link to free
Returns
The next link in the chain

Definition at line 973 of file content.c.

References content_rfc5988_link::href, content_rfc5988_link::hreflang, content_rfc5988_link::media, content_rfc5988_link::next, nsurl_unref(), content_rfc5988_link::rel, content_rfc5988_link::sizes, and content_rfc5988_link::type.

Referenced by content_destroy().

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

◆ content__get_available_width()

int content__get_available_width ( struct content c)

Retrieve available width of content.

Parameters
ccontent to get available width of.
Returns
Available width of content.

Definition at line 1199 of file content.c.

References content::available_width.

Referenced by content_get_available_width().

Here is the caller graph for this function:

◆ content__get_bitmap()

struct bitmap * content__get_bitmap ( struct content c)

Retrieve the bitmap contained in an image content.

Parameters
cContent to retrieve opacity from
Returns
Pointer to bitmap or NULL if none.

Definition at line 1271 of file content.c.

References bitmap(), CONTENT_IMAGE, content_handler::get_internal, content::handler, and content_handler::type.

Referenced by content_get_bitmap().

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

◆ content__get_encoding()

const char * content__get_encoding ( struct content c,
enum content_encoding_type  op 
)

Retrieve the encoding of a content.

Parameters
cthe content to examine the encoding of.
opencoding operation.
Returns
Pointer to content info or NULL if none.

Definition at line 1329 of file content.c.

References content_handler::get_encoding, and content::handler.

Referenced by content_get_encoding().

Here is the caller graph for this function:

◆ content__get_height()

int content__get_height ( struct content c)

Retrieve height of content.

Parameters
cContent to retrieve height of
Returns
Content height

Definition at line 1182 of file content.c.

References content::height.

Referenced by content_get_height(), and html_object_callback().

Here is the caller graph for this function:

◆ content__get_mime_type()

lwc_string * content__get_mime_type ( struct content c)

Retrieve mime-type of content.

Parameters
cContent to retrieve mime-type of
Returns
Pointer to referenced mime-type, or NULL if not found.

Definition at line 1080 of file content.c.

References content::mime_type.

Referenced by amiga_plugin_hack_redraw(), and content_get_mime_type().

Here is the caller graph for this function:

◆ content__get_opaque()

bool content__get_opaque ( struct content c)

Determine if a content is opaque.

Parameters
cContent to retrieve opacity from
Returns
false if the content is not opaque or information is not known else true.

Definition at line 1295 of file content.c.

References content::handler, and content_handler::is_opaque.

Referenced by content_get_opaque().

Here is the caller graph for this function:

◆ content__get_refresh_url()

nsurl * content__get_refresh_url ( struct content c)

Retrieve the refresh URL for a content.

Parameters
cContent to retrieve refresh URL from
Returns
Pointer to URL or NULL if none

Definition at line 1254 of file content.c.

References content::refresh.

Referenced by content_get_refresh_url().

Here is the caller graph for this function:

◆ content__get_source_data()

const uint8_t * content__get_source_data ( struct content c,
size_t *  size 
)

Retrieve source of content.

Parameters
cContent to retrieve source of.
sizePointer to location to receive byte size of source.
Returns
Pointer to source data.
Todo:
check if the content check should be an assert

Definition at line 1216 of file content.c.

References content::llcache, llcache_handle_get_source_data(), and content::size.

Referenced by content_get_source_data(), gif_convert(), html_process_encoding_change(), jpeg_cache_convert(), jpegxl_cache_convert(), nsbmp_convert(), nscss_clone(), nsico_convert(), nsjpeg_convert(), nsjpegxl_convert(), nspng_clone(), nssprite_convert(), png_cache_convert(), rsvg_clone(), rsvg_convert(), svg_reformat(), textplain_clone(), webp_cache_convert(), and webp_convert().

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

◆ content__get_status()

content_status content__get_status ( struct content c)

Retrieve status of content.

Parameters
cContent to retrieve status from.
Returns
Content status

Definition at line 1131 of file content.c.

References CONTENT_STATUS_ERROR, and content::status.

Referenced by content_get_status(), hlcache_clean(), and html_proceed_to_done().

Here is the caller graph for this function:

◆ content__get_status_message()

const char * content__get_status_message ( struct content c)

Retrieve status message associated with content.

Parameters
cContent to retrieve status message from
Returns
Pointer to status message, or NULL if not found.

Definition at line 1148 of file content.c.

References content::status_message.

Referenced by content_get_status_message().

Here is the caller graph for this function:

◆ content__get_title()

const char * content__get_title ( struct content c)

Retrieve title associated with content.

Parameters
cContent to retrieve title from
Returns
Pointer to title, or NULL if not found.

Definition at line 1113 of file content.c.

References content::llcache, llcache_handle_get_url(), nsurl_access(), and content::title.

Referenced by content_get_title().

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

◆ content__get_width()

int content__get_width ( struct content c)

Retrieve width of content.

Parameters
cContent to retrieve width of
Returns
Content width

Definition at line 1165 of file content.c.

References content::width.

Referenced by content_get_width(), and html_object_callback().

Here is the caller graph for this function:

◆ content__init()

nserror content__init ( struct content c,
const content_handler handler,
lwc_string *  imime_type,
const struct http_parameter params,
llcache_handle llcache,
const char *  fallback_charset,
bool  quirks 
)

◆ content__invalidate_reuse_data()

void content__invalidate_reuse_data ( struct content c)

Invalidate content reuse data.

causes subsequent requests for content URL to query server to determine if content can be reused. This is required behaviour for forced reloads etc.

Parameters
cContent to invalidate.

Definition at line 1236 of file content.c.

References content::llcache, and llcache_handle_invalidate_cache_data().

Referenced by content_invalidate_reuse_data().

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

◆ content__is_locked()

bool content__is_locked ( struct content c)

Return whether a content is currently locked.

Parameters
cContent to test
Returns
true iff locked, else false

Definition at line 1351 of file content.c.

References content::locked.

Referenced by content_is_locked().

Here is the caller graph for this function:

◆ content__reformat()

void content__reformat ( struct content c,
bool  background,
int  width,
int  height 
)

cause a content to be reformatted.

Parameters
ccontent to be reformatted
backgroundperform reformat in background
widthThe available width to reformat content in
heightThe available height to reformat content in

Definition at line 331 of file content.c.

References content::available_height, content::available_width, content_msg_data::background, content_broadcast(), CONTENT_MSG_REFORMAT, CONTENT_STATUS_DONE, CONTENT_STATUS_READY, content::handler, height, content::locked, content_handler::reformat, content::status, and width.

Referenced by content_reformat(), and html_object_callback().

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

◆ content__request_redraw()

void content__request_redraw ( struct content c,
int  x,
int  y,
int  width,
int  height 
)

Request a redraw of an area of a content.

Parameters
cContent
xx co-ord of left edge
yy co-ord of top edge
widthWidth of rectangle
heightHeight of rectangle

Definition at line 459 of file content.c.

References content_broadcast(), CONTENT_MSG_REDRAW, content_msg_data::height, height, content_msg_data::redraw, content_msg_data::width, width, content_msg_data::x, and content_msg_data::y.

Referenced by box_textarea_callback(), content_request_redraw(), form_select_menu_callback(), html__redraw_a_box(), html_textselection_redraw(), and textplain_textselection_redraw().

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

◆ content__set_title()

bool content__set_title ( struct content c,
const char *  title 
)

Set title associated with content.

Parameters
cContent to set title on.
titleThe new title to set.
Returns
true on sucess else false.

Definition at line 1090 of file content.c.

References content::title.

Referenced by gif_convert(), html_process_title(), nsbmp_convert(), nsico_convert(), nsjpeg_convert(), nsjpegxl_convert(), nspng_convert(), and nssprite_convert().

Here is the caller graph for this function:

◆ content_abort()

nserror content_abort ( struct content c)

Abort a content object.

Parameters
cThe content object to abort
Returns
NSERROR_OK on success, otherwise appropriate error

Definition at line 1448 of file content.c.

References content::handler, content::llcache, llcache_handle_abort(), NSLOG, and content_handler::stop.

Referenced by hlcache_clean(), and hlcache_handle_abort().

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

◆ content_add_user()

bool content_add_user ( struct content h,
void(*)(struct content *c, content_msg msg, const union content_msg_data *data, void *pw)  callback,
void *  pw 
)

Register a user for callbacks.

Parameters
cthe content to register
callbackthe user callback function
pwcallback private data
Returns
true on success, false otherwise on memory exhaustion

The callback will be called when content_broadcast() is called with the content.

Definition at line 654 of file content.c.

References content_handler::add_user, content_user::callback, content::handler, content::llcache, llcache_handle_get_url(), content_user::next, NSLOG, nsurl_access_log(), content_user::pw, URL_FMT_SPC, and content::user_list.

Referenced by hlcache_find_content(), and hlcache_handle_abort().

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

◆ content_broadcast()

void content_broadcast ( struct content c,
content_msg  msg,
const union content_msg_data data 
)

◆ content_broadcast_error()

void content_broadcast_error ( struct content c,
nserror  errorcode,
const char *  msg 
)

◆ content_can_reformat()

bool content_can_reformat ( struct hlcache_handle h)

Get whether a content can reformat.

Parameters
hcontent to check
Returns
whether the content can reformat

Definition at line 258 of file content.c.

References content::handler, hlcache_handle_get_content(), and content_handler::reformat.

Referenced by browser_window_set_scale_internal(), html_object_callback(), layout_block_object(), and layout_line().

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

◆ content_clear_selection()

void content_clear_selection ( hlcache_handle h)

Tell a content that any selection it has, or one of its objects has, must be cleared.

Definition at line 847 of file content.c.

References content_handler::clear_selection, content_handler::get_selection, content::handler, and hlcache_handle_get_content().

Referenced by browser_window_set_selection(), html_clear_selection(), and html_set_selection().

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

◆ content_clone()

struct content * content_clone ( struct content c)

Clone a content object in its current state.

Parameters
cContent to clone
Returns
Clone of c

Definition at line 1368 of file content.c.

References content_handler::clone, content::handler, and NSERROR_OK.

Referenced by hlcache_handle_abort().

Here is the caller graph for this function:

◆ content_close()

nserror content_close ( struct hlcache_handle h)

The window containing the content has been closed.

Calls the close function for the content.

Definition at line 813 of file content.c.

References content_handler::close, CONTENT_STATUS_DONE, CONTENT_STATUS_READY, content_textsearch_destroy(), content::context, content::handler, hlcache_handle_get_content(), content::llcache, llcache_handle_get_url(), NSERROR_BAD_PARAMETER, NSERROR_INVALID, NSERROR_OK, NSLOG, nsurl_access_log(), content::status, and content::textsearch.

Referenced by browser_window_content_ready(), browser_window_destroy_internal(), browser_window_favicon_callback(), and html_object_close_objects().

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

◆ content_convert()

static void content_convert ( struct content c)
static

All data has arrived, convert for display.

Calls the convert function for the content.

  • If the conversion succeeds, but there is still some processing required (eg. loading images), the content gets status CONTENT_STATUS_READY, and a CONTENT_MSG_READY is sent to all users.
  • If the conversion succeeds and is complete, the content gets status CONTENT_STATUS_DONE, and CONTENT_MSG_READY then CONTENT_MSG_DONE are sent.
  • If the conversion fails, CONTENT_MSG_ERROR is sent. The content will soon be destroyed and must no longer be used.

Definition at line 67 of file content.c.

References content_set_done(), content_set_error(), content_set_ready(), CONTENT_STATUS_ERROR, CONTENT_STATUS_LOADING, content_handler::data_complete, content::handler, content::llcache, llcache_handle_get_url(), content::locked, NSLOG, nsurl_access_log(), content::status, and URL_FMT_SPC.

Referenced by content_llcache_callback().

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

◆ content_count_users()

uint32_t content_count_users ( struct content c)

Count users for the content.

Parameters
cContent to consider

Definition at line 718 of file content.c.

References content_user::next, and content::user_list.

Referenced by gif_add_user(), gif_remove_user(), hlcache_clean(), hlcache_finalise(), and hlcache_handle_abort().

Here is the caller graph for this function:

◆ content_debug()

nserror content_debug ( struct hlcache_handle h,
enum content_debug  op 
)

Control debug con a content.

Parameters
hcontent handle to debug.
opDebug operation type.

Definition at line 936 of file content.c.

References content_handler::debug, content::handler, hlcache_handle_get_content(), NSERROR_BAD_PARAMETER, and NSERROR_NOT_IMPLEMENTED.

Here is the call graph for this function:

◆ content_debug_dump()

nserror content_debug_dump ( struct hlcache_handle h,
FILE *  f,
enum content_debug  op 
)

Dump debug information to file.

Parameters
hcontent handle to debug.
fFile to write output to.
opDebug operation type.

Definition at line 922 of file content.c.

References content_handler::debug_dump, content::handler, hlcache_handle_get_content(), and NSERROR_NOT_IMPLEMENTED.

Referenced by browser_window_debug_dump().

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

◆ content_destroy()

void content_destroy ( struct content c)

Destroy and free a content.

Calls the destroy function for the content, and frees the structure.

Definition at line 354 of file content.c.

References content__free_rfc5988_link(), content_handler::destroy, content::fallback_charset, content::handler, content::links, content::llcache, llcache_handle_get_url(), llcache_handle_release(), content::locked, content::mime_type, NSLOG, nsurl_access_log(), content::title, and content::user_list.

Referenced by amiga_plugin_hack_clone(), gif_clone(), hlcache_clean(), hlcache_handle_abort(), javascript_clone(), nsbmp_clone(), nscss_clone(), nsico_clone(), nsjpeg_clone(), nsjpegxl_clone(), nspng_clone(), nssprite_clone(), rsvg_clone(), svg_clone(), textplain_clone(), and webp_clone().

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

◆ content_drop_file_at_point()

bool content_drop_file_at_point ( struct hlcache_handle h,
int  x,
int  y,
char *  file 
)

Drag and drop a file at coordinate.

Parameters
[in]hHandle to content to examine.
[in]xThe x coordinate to examine.
[in]yThe y coordinate to examine.

Definition at line 906 of file content.c.

References content_handler::drop_file_at_point, content::handler, and hlcache_handle_get_content().

Referenced by browser_window_drop_file_at_point_internal(), and html_drop_file_at_point().

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

◆ content_exec()

bool content_exec ( struct hlcache_handle h,
const char *  src,
size_t  srclen 
)

Execute some JavaScript code inside a content object.

Runs the passed in JavaScript code in the content object's context.

Parameters
hThe handle to the content
srcThe JavaScript source code
srclenThe length of the source code
Returns
Whether the JS function was successfully injected into the content

Definition at line 477 of file content.c.

References content_handler::exec, content::handler, hlcache_handle_get_content(), content::locked, and NSLOG.

Referenced by browser_window_exec().

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

◆ content_find_rfc5988_link()

struct content_rfc5988_link * content_find_rfc5988_link ( struct hlcache_handle h,
lwc_string *  rel 
)

find link in content that matches the rel string.

Parameters
hhandle to the content to retrieve tyoe of.
relThe string to match.
Returns
A matching rfc5988 link or NULL if none is found.

Definition at line 954 of file content.c.

References hlcache_handle_get_content(), content::links, content_rfc5988_link::next, and content_rfc5988_link::rel.

Referenced by browser_window_update_favicon().

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

◆ content_get_available_width()

int content_get_available_width ( struct hlcache_handle h)

Retrieve available width of content.

Parameters
hhandle to the content to get available width of.
Returns
Available width of content.

Definition at line 1192 of file content.c.

References content__get_available_width(), and hlcache_handle_get_content().

Referenced by layout_line().

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

◆ content_get_bitmap()

struct bitmap * content_get_bitmap ( struct hlcache_handle h)

Retrieve the bitmap contained in an image content.

Parameters
hhandle to the content.
Returns
Pointer to bitmap, or NULL if none.

Definition at line 1264 of file content.c.

References content__get_bitmap(), and hlcache_handle_get_content().

Referenced by ami_file_save(), ami_gui_menu_update_disabled(), ami_gui_update_hotlist_button(), amiga_icon_superimpose_favicon_internal(), browser_window_history_get_thumbnail(), default_ico_callback(), gui_window_set_icon(), HOOKF(), ro_gui_save_object_native(), search_web_get_provider_bitmap(), search_web_ico_callback(), and search_web_select_provider().

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

◆ content_get_contextual_content()

nserror content_get_contextual_content ( struct hlcache_handle h,
int  x,
int  y,
struct browser_window_features data 
)

Get positional contextural information for a content.

Parameters
[in]hHandle to content to examine.
[in]xThe x coordinate to examine.
[in]yThe y coordinate to examine.
[out]dataThe context structure to fill in.

Definition at line 872 of file content.c.

References content_handler::get_contextual_content, content::handler, hlcache_handle_get_content(), NSERROR_OK, and browser_window_features::object.

Referenced by browser_window__get_contextual_content(), and html_get_contextual_content().

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

◆ content_get_encoding()

const char * content_get_encoding ( struct hlcache_handle h,
enum content_encoding_type  op 
)

Retrieve the encoding of a content.

Parameters
hhandle to the content.
opencoding operation.
Returns
Pointer to content info or NULL if none.

Definition at line 1321 of file content.c.

References content__get_encoding(), and hlcache_handle_get_content().

Referenced by browser_window_navigate(), nsgtk_viewsource(), and ro_gui_window_prepare_pageinfo().

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

◆ content_get_height()

int content_get_height ( struct hlcache_handle h)

Retrieve height of content.

Parameters
hhandle to the content to get height of.
Returns
Content height

Definition at line 1175 of file content.c.

References content__get_height(), and hlcache_handle_get_content().

Referenced by browser_window_content_done(), browser_window_get_extents(), browser_window_handle_scrollbars(), browser_window_history_update(), browser_window_redraw(), html_object_callback(), html_redraw_background(), html_redraw_inline_background(), layout_calculate_descendant_bboxes(), layout_get_object_dimensions(), layout_line(), layout_lists(), print_apply_settings(), print_basic_run(), print_declare_fonts(), print_document(), print_set_up(), ro_gui_url_bar_res_cb(), ro_gui_url_bar_set_site_favicon(), and treeview_res_cb().

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

◆ content_get_llcache_handle()

const llcache_handle * content_get_llcache_handle ( struct content c)

Retrieve the low-level cache handle for a content.

Note
only used by hlcache
Parameters
cContent to retrieve from
Returns
Low-level cache handle

Definition at line 1358 of file content.c.

References content::llcache.

Referenced by hlcache_find_content().

Here is the caller graph for this function:

◆ content_get_mime_type()

lwc_string * content_get_mime_type ( struct hlcache_handle h)

Retrieve mime-type of content.

Parameters
hhandle to the content to retrieve mime type from
Returns
Pointer to referenced mime type, or NULL if not found.

Definition at line 1073 of file content.c.

References content__get_mime_type(), and hlcache_handle_get_content().

Referenced by ami_mime_compare(), ami_mime_content_to_cmd(), ami_mime_content_to_filetype(), nsbeos_gui_view_source(), ro_content_filetype(), ro_gui_window_prepare_objectinfo(), ro_gui_window_prepare_pageinfo(), save_complete_save_html_document(), save_complete_save_html_object(), and save_complete_save_stylesheet().

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

◆ content_get_opaque()

bool content_get_opaque ( struct hlcache_handle h)

Determine if a content is opaque from handle.

Parameters
hhigh level cache handle to retrieve opacity from.
Returns
false if the content is not opaque or information is not known else true.

Definition at line 1288 of file content.c.

References content__get_opaque(), and hlcache_handle_get_content().

Referenced by html_redraw_background(), and html_redraw_inline_background().

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

◆ content_get_quirks()

bool content_get_quirks ( struct hlcache_handle h)

Retrieve quirkiness of a content.

Parameters
hContent to examine
Returns
True if content is quirky, false otherwise

Definition at line 1308 of file content.c.

References hlcache_handle_get_content(), and content::quirks.

Referenced by browser_window_navigate().

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

◆ content_get_refresh_url()

nsurl * content_get_refresh_url ( struct hlcache_handle h)

Retrieve the refresh URL for a content.

Parameters
hContent to retrieve refresh URL from
Returns
Pointer to URL, or NULL if none

Definition at line 1247 of file content.c.

References content__get_refresh_url(), and hlcache_handle_get_content().

Referenced by browser_window_refresh(), and html_object_refresh().

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

◆ content_get_selection()

char * content_get_selection ( struct hlcache_handle h)

Get a text selection from a content.

Ownership is passed to the caller, who must free() it.

Definition at line 858 of file content.c.

References content_handler::get_selection, content::handler, and hlcache_handle_get_content().

Referenced by browser_window_get_selection(), and html_get_selection().

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

◆ content_get_source_data()

const uint8_t * content_get_source_data ( struct hlcache_handle h,
size_t *  size 
)

Retrieve source of content.

Parameters
hContent handle to retrieve source of
sizePointer to location to receive byte size of source
Returns
Pointer to source data

Definition at line 1209 of file content.c.

References content__get_source_data(), hlcache_handle_get_content(), and content::size.

Referenced by ami_file_save(), context_popup(), convert_script_sync_cb(), html_script_exec(), nsbeos_gui_view_source(), nsgtk_viewsource(), ro_gui_save_content(), ro_gui_save_object_native(), ro_gui_theme_install_apply(), ro_gui_view_source(), RXHOOKF(), save_complete_save_html_object(), save_complete_save_stylesheet(), and theme_install_callback().

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

◆ content_get_status()

content_status content_get_status ( struct hlcache_handle h)

Retrieve status of content.

Parameters
hhandle to the content to retrieve status from
Returns
Content status

Definition at line 1124 of file content.c.

References content__get_status(), and hlcache_handle_get_content().

Referenced by browser_window_exec(), browser_window_refresh(), browser_window_set_pointer(), browser_window_stop(), browser_window_stop_available(), hlcache_find_content(), html_css_process_modified_style(), html_object_abort_objects(), html_replace_object(), html_script_exec(), and nscss_register_imports().

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

◆ content_get_status_message()

const char * content_get_status_message ( struct hlcache_handle h)

Retrieve status message associated with content.

Parameters
hhandle to the content to retrieve status message from
Returns
Pointer to status message, or NULL if not found.

Definition at line 1141 of file content.c.

References content__get_status_message(), and hlcache_handle_get_content().

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

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

◆ content_get_title()

const char * content_get_title ( struct hlcache_handle h)

Retrieve title associated with content.

Parameters
hhandle to the content to retrieve title from
Returns
Pointer to title, or NULL if not found.

Definition at line 1106 of file content.c.

References content__get_title(), and hlcache_handle_get_content().

Referenced by ami_file_save(), browser_window_content_ready(), browser_window_get_title(), browser_window_history_add(), browser_window_history_update(), browser_window_update(), print_send_printsave(), ro_gui_save_complete(), ro_gui_window_menu_warning(), and ro_gui_window_prepare_pageinfo().

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

◆ content_get_type()

content_type content_get_type ( struct hlcache_handle h)

Retrieve computed type of content.

Parameters
hhandle to the content to retrieve type of.
Returns
Computed content type

Definition at line 1061 of file content.c.

References CONTENT_NONE, content::handler, hlcache_handle_get_content(), and content_handler::type.

Referenced by ami_gui_menu_update_disabled(), ami_mime_content_to_filetype(), browser_window_callback(), browser_window_can_search(), browser_window_can_select(), browser_window_content_ready(), browser_window_create_frameset(), browser_window_create_frameset_internal(), browser_window_create_iframes(), browser_window_find_target(), browser_window_mouse_click_internal(), browser_window_navigate(), browser_window_recalculate_frameset(), browser_window_redraw(), browser_window_reload(), convert_script_sync_cb(), get_context_info(), get_mouse_action_node(), html_get_id_offset(), html_object_callback(), html_object_close_objects(), html_object_free_objects(), html_object_open_objects(), html_object_refresh(), html_redraw_box(), html_script_exec(), layout_block_add_scrollbar(), layout_block_find_dimensions(), layout_calculate_descendant_bboxes(), layout_float_find_dimensions(), layout_minmax_block(), layout_update_descendant_bbox(), nsgtk_viewsource(), print_button_clicked_cb(), print_document(), ro_content_filetype(), ro_gui_save_content(), ro_gui_search_bw_searchable(), ro_gui_url_bar_set_site_favicon(), ro_gui_window_content_export_types(), ro_gui_window_menu_warning(), ro_gui_window_prepare_pageinfo(), save_as_text(), save_complete_save_html(), save_complete_save_html_object(), and theme_install_start().

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

◆ content_get_url()

nsurl * content_get_url ( struct content c)

Retrieve URL associated with content.

Parameters
cContent to retrieve URL from
Returns
Pointer to URL, or NULL if not found.

Definition at line 1051 of file content.c.

References content::llcache, and llcache_handle_get_url().

Referenced by amiga_plugin_hack_open(), box_textarea_keypress(), exec_src_script(), hlcache_handle_get_url(), html_begin_conversion(), html_create_html_data(), html_css_new_stylesheets(), html_css_process_link(), html_css_quirks_stylesheets(), html_fetch_object(), html_process_inserted_meta(), html_replace_object(), html_stylesheet_from_domnode(), layout_document(), link_mouse_action(), mouse_action_drag_none(), nscss_clone(), nscss_create(), and svg_reformat().

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

◆ content_get_width()

int content_get_width ( struct hlcache_handle h)

Retrieve width of content.

Parameters
hhandle to the content to get width of.
Returns
Content width

Definition at line 1158 of file content.c.

References content__get_width(), and hlcache_handle_get_content().

Referenced by bitmap_render(), browser_window_content_done(), browser_window_get_extents(), browser_window_handle_scrollbars(), browser_window_history_update(), browser_window_redraw(), html_object_callback(), html_redraw_background(), html_redraw_inline_background(), layout_calculate_descendant_bboxes(), layout_get_object_dimensions(), layout_lists(), layout_minmax_block(), print_apply_settings(), print_declare_fonts(), print_document(), and ro_gui_url_bar_set_site_favicon().

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

◆ content_invalidate_reuse_data()

void content_invalidate_reuse_data ( struct hlcache_handle h)

Invalidate content reuse data.

causes subsequent requests for content URL to query server to determine if content can be reused. This is required behaviour for forced reloads etc.

Parameters
hContent handle to invalidate.

Definition at line 1229 of file content.c.

References content__invalidate_reuse_data(), and hlcache_handle_get_content().

Referenced by browser_window_refresh(), browser_window_reload(), html_object_refresh(), nsbeos_scaffolding_dispatch_event(), ro_gui_window_menu_select(), and theme_install_start().

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

◆ content_is_locked()

bool content_is_locked ( struct hlcache_handle h)

Return whether a content is currently locked.

Parameters
hhandle to the content.
Returns
true iff locked, else false

Definition at line 1344 of file content.c.

References content__is_locked(), and hlcache_handle_get_content().

Referenced by browser_window_redraw_ready().

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

◆ content_is_shareable()

bool content_is_shareable ( struct content c)

Determine if a content is shareable.

Parameters
cContent to consider
Returns
True if content is shareable, false otherwise

Definition at line 745 of file content.c.

References content::handler, and content_handler::no_share.

Referenced by hlcache_find_content().

Here is the caller graph for this function:

◆ content_keypress()

bool content_keypress ( struct hlcache_handle h,
uint32_t  key 
)

Handle keypresses.

Parameters
hContent handle
keyThe UCS4 character codepoint
Returns
true if key handled, false otherwise

Definition at line 437 of file content.c.

References content::handler, hlcache_handle_get_content(), and content_handler::keypress.

Referenced by browser_window_key_press(), and html_keypress().

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

◆ content_llcache_callback()

static nserror content_llcache_callback ( llcache_handle llcache,
const llcache_event event,
void *  pw 
)
static

Handler for low-level cache events.

Parameters
llcacheLow-level cache handle
eventEvent details
pwPointer to our context
Returns
NSERROR_OK on success, appropriate error otherwise
Todo:
It's not clear what error this is
Todo:
Error page?

Definition at line 104 of file content.c.

References llcache_event::buf, content_broadcast(), content_convert(), CONTENT_MSG_ERROR, CONTENT_MSG_REDIRECT, CONTENT_MSG_STATUS, content_set_status(), CONTENT_STATUS_ERROR, llcache_event::data, content_msg_data::errorcode, content_msg_data::errordata, content_msg_data::errormsg, content_msg_data::explicit_status_text, content_msg_data::from, content::handler, llcache_event::len, content::llcache, llcache, LLCACHE_EVENT_DONE, LLCACHE_EVENT_ERROR, LLCACHE_EVENT_GOT_CERTS, LLCACHE_EVENT_HAD_DATA, LLCACHE_EVENT_HAD_HEADERS, LLCACHE_EVENT_PROGRESS, LLCACHE_EVENT_REDIRECT, llcache_handle_abort(), llcache_handle_get_source_data(), messages_get(), NSERROR_NOMEM, NSERROR_OK, content_handler::process_data, llcache_event::progress_msg, content_msg_data::redirect, content::status, content_msg_data::to, and llcache_event::type.

Referenced by content__clone(), and content__init().

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

◆ content_matches_quirks()

bool content_matches_quirks ( struct content c,
bool  quirks 
)

Determine if quirks mode matches.

Parameters
cContent to consider
quirksQuirks mode to match
Returns
True if quirks match, false otherwise

Definition at line 735 of file content.c.

References content::handler, and content_handler::matches_quirks.

Referenced by hlcache_find_content().

Here is the caller graph for this function:

◆ content_mouse_action()

void content_mouse_action ( struct hlcache_handle h,
struct browser_window bw,
browser_mouse_state  mouse,
int  x,
int  y 
)

Handle mouse clicks and movements in a content window.

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

This function handles both hovering and clicking. It is important that the code path is identical (except that hovering doesn't carry out the action), so that the status bar reflects exactly what will happen. Having separate code paths opens the possibility that an attacker will make the status bar show some harmless action where clicking will be harmful.

Definition at line 421 of file content.c.

References content::handler, hlcache_handle_get_content(), and content_handler::mouse_action.

Referenced by browser_window_mouse_click_internal(), and html_object_mouse_action().

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

◆ content_mouse_track()

void content_mouse_track ( struct hlcache_handle h,
struct browser_window bw,
browser_mouse_state  mouse,
int  x,
int  y 
)

Handle mouse movements in a content window.

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

Definition at line 398 of file content.c.

References BROWSER_POINTER_AUTO, content_broadcast(), CONTENT_MSG_POINTER, content::handler, hlcache_handle_get_content(), content_handler::mouse_track, and content_msg_data::pointer.

Referenced by browser_window_mouse_track_internal(), html_object_mouse_action(), and mouse_action_drag_content().

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

◆ content_open()

nserror content_open ( struct hlcache_handle h,
struct browser_window bw,
struct content page,
struct object_params params 
)

A window containing the content has been opened.

Parameters
hhandle to content that has been opened
bwbrowser window containing the content
pagecontent of type CONTENT_HTML containing h, or NULL if not an object within a page
paramsobject parameters, or NULL if not an object

Calls the open function for the content.

Definition at line 791 of file content.c.

References content::handler, hlcache_handle_get_content(), content::llcache, llcache_handle_get_url(), NSERROR_OK, NSLOG, nsurl_access_log(), and content_handler::open.

Referenced by browser_window_content_ready(), html_object_callback(), and html_object_open_objects().

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

◆ content_redraw()

bool content_redraw ( struct hlcache_handle h,
struct content_redraw_data data,
const struct rect clip,
const struct redraw_context ctx 
)

Display content on screen with optional tiling.

Parameters
hThe content to redraw.
dataThe contents redraw data.
clipThe clipping rectangle to use when redrawing the content.
ctxcurrent redraw context.
Returns
true if successful otherwise false.

Calls the redraw function for the content.

Definition at line 558 of file content.c.

References clip(), content::handler, hlcache_handle_get_content(), content::locked, and content_handler::redraw.

Referenced by browser_window_redraw(), html_redraw_background(), html_redraw_box(), html_redraw_inline_background(), print_declare_fonts(), print_document(), print_draw_next_page(), ro_gui_url_bar_redraw(), treeview_redraw(), treeview_redraw_search(), and treeview_redraw_tree().

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

◆ content_reformat()

void content_reformat ( struct hlcache_handle h,
bool  background,
int  width,
int  height 
)

Reformat to new size.

Calls the reformat function for the content.

Definition at line 321 of file content.c.

References content__reformat(), height, hlcache_handle_get_content(), and width.

Referenced by browser_window_content_ready(), browser_window_reformat(), html_object_callback(), layout_block_object(), layout_line(), print_apply_settings(), and print_document().

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

◆ content_remove_user()

void content_remove_user ( struct content c,
void(*)(struct content *c, content_msg msg, const union content_msg_data *data, void *pw)  callback,
void *  ctx 
)

Remove a callback user.

The callback function and pw must be identical to those passed to content_add_user().

Parameters
cContent to remove user from
callbackpassed when added
ctxContext passed when added

Definition at line 684 of file content.c.

References content_user::callback, content::handler, content::llcache, llcache_handle_get_url(), content_user::next, NSLOG, nsurl_access_log(), content_user::pw, content_handler::remove_user, URL_FMT_SPC, and content::user_list.

Referenced by hlcache_handle_abort(), and hlcache_handle_release().

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

◆ content_request_redraw()

void content_request_redraw ( struct hlcache_handle h,
int  x,
int  y,
int  width,
int  height 
)

Request a redraw of an area of a content.

Parameters
hhigh-level cache handle
xx co-ord of left edge
yy co-ord of top edge
widthWidth of rectangle
heightHeight of rectangle

Definition at line 450 of file content.c.

References content__request_redraw(), height, hlcache_handle_get_content(), and width.

Referenced by html_redraw_a_box(), and mouse_action_select_menu().

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

◆ content_saw_insecure_objects()

bool content_saw_insecure_objects ( struct hlcache_handle h)

Determine if the content referred to any insecure objects.

Query the content to determine if any of its referred objects were loaded in a manner not considered secure. For a content to be recursively secure it must only load over https and must not have certificate overrides in place.

Parameters
hThe handle to the content
Returns
Whether the content referred to any insecure objects

Definition at line 500 of file content.c.

References content::handler, hlcache_handle_get_content(), hlcache_handle_get_url(), nsurl_get_component(), NSURL_SCHEME, content_handler::saw_insecure_objects, and urldb_get_cert_permissions().

Referenced by browser_window_get_page_info_state(), html_css_saw_insecure_stylesheets(), html_saw_insecure_objects(), and html_saw_insecure_scripts().

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

◆ content_scaled_redraw()

bool content_scaled_redraw ( struct hlcache_handle h,
int  width,
int  height,
const struct redraw_context ctx 
)

Redraw a content with scale set for horizontal fit.

Redraws the content at a specified width and height with the content drawing scaled to fit within the area.

Parameters
hThe content to redraw
widthThe target width
heightThe target height
ctxcurrent redraw context
Returns
true if successful, false otherwise

The thumbnail is guaranteed to be filled to its width/height extents, so there is no need to render a solid background first.

Units for width and height are pixels.

Definition at line 583 of file content.c.

References content_redraw_data::background_colour, clip(), plotter_table::clip, content::handler, height, content_redraw_data::height, hlcache_handle_get_content(), knockout_plot_end(), knockout_plot_start(), content::locked, NSERROR_OK, NSLOG, plotter_table::option_knockout, redraw_context::plot, plot_style_fill_white, plotter_table::rectangle, content_handler::redraw, content_redraw_data::repeat_x, content_redraw_data::repeat_y, content_redraw_data::scale, content::width, width, content_redraw_data::width, content_redraw_data::x, and content_redraw_data::y.

Referenced by bitmap_render(), and riscos_bitmap_render().

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

◆ content_scroll_at_point()

bool content_scroll_at_point ( struct hlcache_handle h,
int  x,
int  y,
int  scrx,
int  scry 
)

scroll content at coordnate

Parameters
[in]hHandle to content to examine.
[in]xThe x coordinate to examine.
[in]yThe y coordinate to examine.

Definition at line 890 of file content.c.

References content::handler, hlcache_handle_get_content(), and content_handler::scroll_at_point.

Referenced by browser_window_scroll_at_point_internal(), and html_scroll_at_point().

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

◆ content_set_done()

void content_set_done ( struct content c)

Put a content in status CONTENT_STATUS_DONE.

Definition at line 299 of file content.c.

References content_broadcast(), CONTENT_MSG_DONE, CONTENT_STATUS_DONE, content_update_status(), content::status, and content::time.

Referenced by amiga_plugin_hack_convert(), content_convert(), gif_convert(), html_object_callback(), html_proceed_to_done(), html_stop(), javascript_convert(), nsbmp_convert(), nscss_content_done(), nsico_convert(), nsjpeg_convert(), nsjpegxl_convert(), nspng_convert(), nssprite_convert(), rsvg_convert(), svg_convert(), textplain_convert(), and webp_convert().

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

◆ content_set_error()

void content_set_error ( struct content c)

Put a content in status CONTENT_STATUS_ERROR and unlock the content.

Note
We expect the caller to broadcast an error report if needed.

Definition at line 313 of file content.c.

References CONTENT_STATUS_ERROR, content::locked, and content::status.

Referenced by content_convert(), hlcache_clean(), html_begin_conversion(), html_box_convert_done(), html_finish_conversion(), and nscss_content_done().

Here is the caller graph for this function:

◆ content_set_ready()

void content_set_ready ( struct content c)

Put a content in status CONTENT_STATUS_READY and unlock the content.

Definition at line 285 of file content.c.

References content_broadcast(), CONTENT_MSG_READY, CONTENT_STATUS_READY, content_update_status(), content::locked, and content::status.

Referenced by amiga_plugin_hack_convert(), content_convert(), gif_convert(), html_box_convert_done(), javascript_convert(), nsbmp_convert(), nscss_content_done(), nsico_convert(), nsjpeg_convert(), nsjpegxl_convert(), nspng_convert(), nssprite_convert(), rsvg_convert(), svg_convert(), textplain_convert(), and webp_convert().

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

◆ content_set_status()

void content_set_status ( struct content c,
const char *  status_message 
)

Updates content with new status.

The textual status contained in the content is updated with given string.

Parameters
cThe content to set status in.
status_messagenew textual status

Definition at line 270 of file content.c.

References content_update_status(), content::status_message, and content::sub_status.

Referenced by amiga_plugin_hack_convert(), content__init(), content_llcache_callback(), gif_convert(), html_finish_conversion(), nsbmp_convert(), nsico_convert(), nsjpeg_convert(), nsjpegxl_convert(), nspng_convert(), nssprite_convert(), rsvg_convert(), svg_convert(), and textplain_convert().

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

◆ content_update_status()

static void content_update_status ( struct content c)
static

update content status message

Parameters
cthe content to update.

Definition at line 171 of file content.c.

References CONTENT_STATUS_LOADING, CONTENT_STATUS_READY, messages_get(), content::status, content::status_message, content::sub_status, and content::time.

Referenced by content_set_done(), content_set_ready(), and content_set_status().

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

Variable Documentation

◆ content_status_name

const char* const content_status_name[]
Initial value:
= {
"LOADING",
"READY",
"DONE",
"ERROR"
}

Definition at line 46 of file content.c.