summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2003-04-06 18:09:34 +0000
committerJames Bursa <james@netsurf-browser.org>2003-04-06 18:09:34 +0000
commit46edb645e1a08fb76835e4b3b8960ec3cce5e298 (patch)
treeb1824939242a04900cf0737f620b425543d34754 /content
parent2253e38be8cbcf4243e43fc0d317cfda08bffeb2 (diff)
downloadnetsurf-46edb645e1a08fb76835e4b3b8960ec3cce5e298.tar.gz
netsurf-46edb645e1a08fb76835e4b3b8960ec3cce5e298.tar.bz2
[project @ 2003-04-06 18:09:34 by bursa]
@import, more status messages. svn path=/import/netsurf/; revision=116
Diffstat (limited to 'content')
-rw-r--r--content/content.c3
-rw-r--r--content/content.h12
-rw-r--r--content/fetchcache.c12
3 files changed, 22 insertions, 5 deletions
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 <assert.h>
@@ -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 <assert.h>
@@ -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 <unistd.h>