30 #include <nsutils/time.h> 115 for (b = box; b; b = b->
parent)
145 switch (event->
type) {
207 NSLOG(netsurf, INFO,
"%d fetches active",
230 css_fixed hpos = 0, vpos = 0;
231 css_unit hunit = CSS_UNIT_PX;
232 css_unit vunit = CSS_UNIT_PX;
240 css_computed_background_position(
box->
style,
241 &hpos, &hunit, &vpos, &vunit);
244 if (hunit == CSS_UNIT_PCT) {
245 l = (width - w) * hpos / INTTOFIX(100);
253 if (vunit == CSS_UNIT_PCT) {
254 t = (height - h) * vpos / INTTOFIX(100);
262 switch (css_computed_background_repeat(
264 case CSS_BACKGROUND_REPEAT_REPEAT:
271 case CSS_BACKGROUND_REPEAT_REPEAT_X:
277 case CSS_BACKGROUND_REPEAT_REPEAT_Y:
283 case CSS_BACKGROUND_REPEAT_NO_REPEAT:
346 *(
event->data.jsthread) = NULL;
350 *(
event->data.getdims.viewport_width) =
352 *(
event->data.getdims.viewport_height) =
372 event->data.dragsave.content;
393 case CONTENT_CARET_REMOVE:
394 case CONTENT_CARET_HIDE:
396 true, 0, 0, 0, NULL);
398 case CONTENT_CARET_SET_POS:
416 case CONTENT_DRAG_NONE:
420 case CONTENT_DRAG_SCROLL:
423 case CONTENT_DRAG_SELECTION:
442 sel_owner.
none =
true;
475 nsu_getmonotonic_ms(&ms_now);
507 assert(
object != NULL);
508 assert(object->
box != NULL);
519 NSLOG(netsurf, INFO,
"%d fetches active",
524 object->content = NULL;
526 object->box->object = NULL;
539 for (page = c; page != NULL; page = page->
page) {
564 if (refresh_url == NULL)
578 for (
object = html->
object_list;
object != NULL;
object = next) {
581 if (object->
content == NULL || object->
box == NULL)
601 object = object->
next) {
621 object->content = NULL;
622 if (object->
box != NULL) {
624 NSLOG(netsurf, INFO,
"%d fetches active",
639 for (
object = html->
object_list;
object != NULL;
object = next) {
642 if (object->
content == NULL || object->
box == NULL)
682 int available_width,
int available_height,
697 if (
object == NULL) {
701 object->parent = (
struct content *) c;
703 object->content = NULL;
705 object->permitted_types = permitted_types;
bool quirks
Whether parent is quirky.
void content_invalidate_reuse_data(struct hlcache_handle *h)
Invalidate content reuse data.
struct content_msg_data::@106 redraw
CONTENT_MSG_REDRAW - Area of content which needs redrawing.
void content_reformat(hlcache_handle *h, bool background, int width, int height)
Reformat to new size.
struct content_msg_data::@112::@118 pos
With CONTENT_CARET_SET_POS.
unsigned int num_objects
Number of entries in object_list.
void html_set_focus(html_content *html, html_focus_type focus_type, union html_focus_owner focus_owner, bool hide_caret, int x, int y, int height, const struct rect *clip)
Set our input focus, and inform whatever owns the content.
struct object_params * object_params
Parameters for the object, or NULL.
Interface to utility string handling.
union content_msg_data data
Event data.
content_msg type
Event type.
box_flags flags
Box flags.
struct content_msg_data::@112 caret
CONTENT_MSG_CARET - set caret position or, hide caret.
Content is being fetched or converted and is not safe to display.
Public content interface.
A gadget has been clicked on (mainly for file)
uint64_t reformat_time
Earliest time to attempt a period reflow while fetching a page's objects.
int padding[4]
Padding: TOP, RIGHT, BOTTOM, LEFT.
Interface to text/html content handler.
bool quirks
Content is in quirks mode.
Context for retrieving a child object.
struct scrollbar * scroll_x
Horizontal scroll.
Focus belongs to child content.
int available_height
Viewport height.
Interface to platform-specific miscellaneous browser operation table.
void box_coords(struct box *box, int *x, int *y)
Find the absolute coordinates of a box.
static void html_object_done(struct box *box, hlcache_handle *object, bool background)
Update a box whose content has completed rendering.
HTML Box tree inspection interface.
High-level resource cache interface.
struct scrollbar * scroll_y
Vertical scroll.
bool html_fetch_object(html_content *c, nsurl *url, struct box *box, content_type permitted_types, int available_width, int available_height, bool background)
Start a fetch for an object required by a page.
void html_set_drag_type(html_content *html, html_drag_type drag_type, union html_drag_owner drag_owner, const struct rect *rect)
Set our drag status, and inform whatever owns the content.
#define UNKNOWN_MAX_WIDTH
Option reading and saving interface.
nserror
Enumeration of error codes.
bool box_visible(struct box *box)
Determine if a box is visible when the tree is rendered.
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.
nserror html_object_open_objects(html_content *html, struct browser_window *bw)
nsurl * content_get_url(struct content *c)
Retrieve URL associated with content.
struct content * parent
Parent document.
struct gui_misc_table * misc
Browser table.
void html_set_selection(html_content *html, html_selection_type selection_type, union html_selection_owner selection_owner, bool read_only)
Set our selection status, and inform whatever owns the content.
struct hlcache_handle * content
if NULL, save the content generating the message
Useful interned string pointers (interface).
nserror html_object_close_objects(html_content *html)
Corresponds to a single URL.
bool content_can_reformat(hlcache_handle *h)
Get whether a content can reformat.
Private data for text/html content.
content_type
The type of a content.
struct content_msg_data::@108 scroll
CONTENT_MSG_SCROLL - Part of content to scroll to show.
const char * charset
Charset of parent.
struct content_msg_data::@109 dragsave
CONTENT_MSG_DRAGSAVE - Drag save a content.
#define NSLOG(catname, level, logmsg, args...)
unsigned int active
Number of child fetches or conversions currently in progress.
Not own; drag in child content.
Allow drag saving of content.
A selection made or cleared.
Selection in this html content.
content_status content_get_status(hlcache_handle *h)
Retrieve status of content.
int content_get_height(struct hlcache_handle *h)
Retrieve height of content.
bool selection
false for selection cleared
struct content * hlcache_handle_get_content(const hlcache_handle *handle)
Retrieve a content object from a cache handle.
void content__reformat(struct content *c, bool background, int width, int height)
For drags we don't own.
bool background
This object is a background image.
Some parts of content still being loaded, but can be displayed.
nserror(* schedule)(int t, void(*callback)(void *p), void *p)
Schedule a callback.
content_status status
Current status.
static nserror html_object_callback(hlcache_handle *object, const hlcache_event *event, void *pw)
Callback for hlcache_handle_retrieve() for objects.
struct hlcache_handle * content
Content, or 0.
static void html_object_failed(struct box *box, html_content *content, bool background)
Handle object fetching or loading failure.
static bool html_replace_object(struct content_html_object *object, nsurl *url)
Start a fetch for an object required by a page, replacing an existing object.
void content_set_done(struct content *c)
Put a content in status CONTENT_STATUS_DONE.
void content_broadcast(struct content *c, content_msg msg, const union content_msg_data *data)
Send a message to all users.
int content__get_width(struct content *c)
Retrieve width of content.
int height
Height of content box (excluding padding etc.).
Not own; drag in textarea widget.
int delay
CONTENT_MSG_REFRESH - Minimum delay.
nserror html_object_abort_objects(html_content *htmlc)
box_type type
Type of box.
css_fixed nscss_len2px(const nscss_len_ctx *ctx, css_fixed length, css_unit unit, const css_computed_style *style)
Convert a CSS length to pixels.
nserror hlcache_handle_abort(hlcache_handle *handle)
Abort a high-level cache fetch.
struct html_content * page
Content of type CONTENT_HTML containing this, or NULL if not an object within a page.
static void html_object_refresh(void *p)
schedule callback for object refresh
struct content_html_object * html_get_objects(hlcache_handle *h, unsigned int *n)
Retrieve objects used by HTML document.
struct browser_window * bw
Browser window containing this document, or NULL if not open.
struct hlcache_handle * background
Background image for this box, or NULL if none.
nsurl * content_get_refresh_url(hlcache_handle *h)
Retrieve the refresh URL for a content.
enum content_msg_data::@109::@116 type
content_type content_get_type(struct hlcache_handle *h)
Retrieve computed type of content.
int width
Width of content box (excluding padding etc.).
struct hlcache_handle * object
Object in this box (usually an image), or NULL if none.
bool aborted
Content has been aborted in the LOADING state.
int available_width
Viewport width.
int content_get_width(struct hlcache_handle *h)
Retrieve width of content.
nserror html_object_free_objects(html_content *html)
An object (img, object, etc.
nserror hlcache_handle_retrieve(nsurl *url, uint32_t flags, nsurl *referer, llcache_post_data *post, hlcache_handle_callback cb, void *pw, hlcache_child_context *child, content_type accepted_types, hlcache_handle **result)
Retrieve a high-level cache handle for an object.
struct box * next
Next sibling box, or NULL.
struct box * parent
Parent box, or NULL.
int max_width
Width that would be taken with no line breaks.
nscss_len_ctx len_ctx
CSS length conversion context for document.
int content__get_height(struct content *c)
Retrieve height of content.
char * encoding
Encoding of source, NULL if unknown.
Wants a specific mouse pointer set.
void content_add_error(struct content *c, const char *token, unsigned int line)
struct box * box
Node in box tree containing it.
Data specific to CONTENT_HTML.
Interface to core interface table.
css_computed_style * style
Style for this box.
nserror hlcache_handle_release(hlcache_handle *handle)
Release a high-level cache handle.
struct netsurf_table * guit
The global interface table.
struct nsurl nsurl
NetSurf URL object.
struct content_html_object * next
Next in chain.
For getting at selections in this content or things in this content.
#define nsoption_bool(OPTION)
Get the value of a boolean option.
struct content_html_object * object_list
List of objects.
Extra data for some content_msg messages.
nserror content_close(hlcache_handle *h)
The window containing the content has been closed.
content_type permitted_types
Bitmap of acceptable content types.
bool had_initial_layout
Whether an initial layout has been done.
struct content_msg_data::@113 drag
CONTENT_MSG_DRAG - Drag start or end.
Request to scroll content.