diff options
author | James Bursa <james@netsurf-browser.org> | 2004-06-20 23:09:52 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2004-06-20 23:09:52 +0000 |
commit | f8825b81e4e671abbf7f4cbc730030be9c265f69 (patch) | |
tree | 7d211a09daf8ee15d3a3f599cf9bde163bd78181 /render/html.c | |
parent | b08c7135fe65d383ec96c679ce2a7aedda6a6d1c (diff) | |
download | netsurf-f8825b81e4e671abbf7f4cbc730030be9c265f69.tar.gz netsurf-f8825b81e4e671abbf7f4cbc730030be9c265f69.tar.bz2 |
[project @ 2004-06-20 23:09:51 by bursa]
Implement content_stop() and html_stop().
svn path=/import/netsurf/; revision=982
Diffstat (limited to 'render/html.c')
-rw-r--r-- | render/html.c | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/render/html.c b/render/html.c index 827660add..a96869313 100644 --- a/render/html.c +++ b/render/html.c @@ -668,15 +668,15 @@ void html_object_callback(content_msg msg, struct content *object, case CONTENT_MSG_REDRAW: box_coords(box, &x, &y); - if (box->object == data.redraw.object) { + if (object == data.redraw.object) { data.redraw.x = data.redraw.x * - box->width / box->object->width; + box->width / object->width; data.redraw.y = data.redraw.y * - box->height / box->object->height; + box->height / object->height; data.redraw.width = data.redraw.width * - box->width / box->object->width; + box->width / object->width; data.redraw.height = data.redraw.height * - box->height / box->object->height; + box->height / object->height; data.redraw.object_width = box->width; data.redraw.object_height = box->height; } @@ -772,6 +772,37 @@ bool html_object_type_permitted(const content_type type, /** + * Stop loading a CONTENT_HTML in state READY. + */ + +void html_stop(struct content *c) +{ + unsigned int i; + struct content *object; + + assert(c->status == CONTENT_STATUS_READY); + + for (i = 0; i != c->data.html.object_count; i++) { + object = c->data.html.object[i].content; + if (!object) + continue; + + if (object->status == CONTENT_STATUS_DONE) + ; /* already loaded: do nothing */ + else if (object->status == CONTENT_STATUS_READY) + content_stop(object, html_object_callback, + c, (void *) i); + else { + content_remove_user(c->data.html.object[i].content, + html_object_callback, c, (void *) i); + c->data.html.object[i].content = 0; + } + } + c->status = CONTENT_STATUS_DONE; +} + + +/** * Reformat a CONTENT_HTML to a new width. */ |