From 46edb645e1a08fb76835e4b3b8960ec3cce5e298 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Sun, 6 Apr 2003 18:09:34 +0000 Subject: [project @ 2003-04-06 18:09:34 by bursa] @import, more status messages. svn path=/import/netsurf/; revision=116 --- content/content.c | 3 ++- content/content.h | 12 +++++++++--- content/fetchcache.c | 12 +++++++++++- 3 files changed, 22 insertions(+), 5 deletions(-) (limited to 'content') diff --git a/content/content.c b/content/content.c index be528d787..439c0fba2 100644 --- a/content/content.c +++ b/content/content.c @@ -1,5 +1,5 @@ /** - * $Id: content.c,v 1.5 2003/04/05 21:38:06 bursa Exp $ + * $Id: content.c,v 1.6 2003/04/06 18:09:34 bursa Exp $ */ #include @@ -74,6 +74,7 @@ struct content * content_create(content_type type, char *url) c->type = type; c->status = CONTENT_LOADING; c->size = sizeof(struct content); + c->status_callback = 0; handler_map[type].create(c); return c; } diff --git a/content/content.h b/content/content.h index b0711488d..ff0dbc6dd 100644 --- a/content/content.h +++ b/content/content.h @@ -1,5 +1,5 @@ /** - * $Id: content.h,v 1.4 2003/04/05 21:38:06 bursa Exp $ + * $Id: content.h,v 1.5 2003/04/06 18:09:34 bursa Exp $ */ #ifndef _NETSURF_DESKTOP_CONTENT_H_ @@ -57,7 +57,6 @@ struct content unsigned int stylesheet_count; char **stylesheet_url; struct content **stylesheet_content; - struct css_stylesheet* stylesheet; struct css_style* style; struct { struct box_position start; @@ -69,7 +68,12 @@ struct content struct page_elements elements; } html; - struct css_stylesheet *css; + struct + { + struct css_stylesheet *css; + unsigned int import_count; + struct content **import_content; + } css; struct { @@ -84,6 +88,8 @@ struct content char *title; unsigned int active; int error; + void (*status_callback)(void *p, const char *status); + void *status_p; }; diff --git a/content/fetchcache.c b/content/fetchcache.c index 3d2529f68..9adaee544 100644 --- a/content/fetchcache.c +++ b/content/fetchcache.c @@ -1,5 +1,5 @@ /** - * $Id: fetchcache.c,v 1.5 2003/03/08 20:26:31 bursa Exp $ + * $Id: fetchcache.c,v 1.6 2003/04/06 18:09:34 bursa Exp $ */ #include @@ -24,6 +24,7 @@ struct fetchcache { static void fetchcache_free(struct fetchcache *fc); static void fetchcache_callback(fetchcache_msg msg, void *p, char *data, unsigned long size); +static void status_callback(void *p, const char *status); void fetchcache(const char *url, char *referer, @@ -81,6 +82,8 @@ void fetchcache_callback(fetch_msg msg, void *p, char *data, unsigned long size) free(fc); } else { fc->c = content_create(type, fc->url); + fc->c->status_callback = status_callback; + fc->c->status_p = fc; } free(mime_type); break; @@ -119,6 +122,13 @@ void fetchcache_callback(fetch_msg msg, void *p, char *data, unsigned long size) } +void status_callback(void *p, const char *status) +{ + struct fetchcache *fc = p; + fc->callback(FETCHCACHE_STATUS, fc->c, fc->p, status); +} + + #ifdef TEST #include -- cgit v1.2.3