summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2004-06-20 23:09:52 +0000
committerJames Bursa <james@netsurf-browser.org>2004-06-20 23:09:52 +0000
commitf8825b81e4e671abbf7f4cbc730030be9c265f69 (patch)
tree7d211a09daf8ee15d3a3f599cf9bde163bd78181 /render
parentb08c7135fe65d383ec96c679ce2a7aedda6a6d1c (diff)
downloadnetsurf-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')
-rw-r--r--render/html.c41
-rw-r--r--render/html.h1
2 files changed, 37 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.
*/
diff --git a/render/html.h b/render/html.h
index 9580beacb..6d9ad8b80 100644
--- a/render/html.h
+++ b/render/html.h
@@ -92,6 +92,7 @@ void html_fetch_object(struct content *c, char *url, struct box *box,
const content_type *permitted_types,
int available_width, int available_height,
bool background);
+void html_stop(struct content *c);
/* in riscos/htmlinstance.c */
void html_add_instance(struct content *c, struct browser_window *bw,