summaryrefslogtreecommitdiff
path: root/css/css.h
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-02-26 00:58:54 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2011-02-26 00:58:54 +0000
commitdaa8697651893bfa7187f81caa890616803b6210 (patch)
treec864b1647abe5540298d60758a9c58ad850bd9d2 /css/css.h
parent0925ee3cf06060209a302e40062b1263bef99f96 (diff)
downloadnetsurf-daa8697651893bfa7187f81caa890616803b6210.tar.gz
netsurf-daa8697651893bfa7187f81caa890616803b6210.tar.bz2
Parallelise fetch and conversion of imported stylesheets
svn path=/trunk/netsurf/; revision=11817
Diffstat (limited to 'css/css.h')
-rw-r--r--css/css.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/css/css.h b/css/css.h
index 25b91a3e2..6725a0055 100644
--- a/css/css.h
+++ b/css/css.h
@@ -26,19 +26,31 @@
#include "utils/errors.h"
struct content;
+struct content_css_data;
struct hlcache_handle;
struct http_parameter;
struct nscss_import;
/**
+ * Type of callback called when a CSS object has finished
+ *
+ * \param css CSS object that has completed
+ * \param pw Client-specific data
+ */
+typedef void (*nscss_done_callback)(struct content_css_data *css, void *pw);
+
+/**
* CSS content data
*/
struct content_css_data
{
css_stylesheet *sheet; /**< Stylesheet object */
char *charset; /**< Character set of stylesheet */
- uint32_t import_count; /**< Number of sheets imported */
struct nscss_import *imports; /**< Array of imported sheets */
+ uint32_t import_count; /**< Number of sheets imported */
+ uint32_t next_to_register; /**< Index of next import to register */
+ nscss_done_callback done; /**< Completion callback */
+ void *pw; /**< Client data */
};
/**
@@ -49,13 +61,6 @@ struct nscss_import {
uint64_t media; /**< Media types that sheet applies to */
};
-/**
- * Type of callback called when a CSS object has finished importing sheets
- *
- * \param css CSS object that has completed
- * \param pw Client-specific data
- */
-typedef void (*nscss_done_callback)(struct content_css_data *css, void *pw);
bool nscss_create(struct content *c, const struct http_parameter *params);
@@ -68,11 +73,11 @@ void nscss_destroy(struct content *c);
bool nscss_clone(const struct content *old, struct content *new_content);
nserror nscss_create_css_data(struct content_css_data *c,
- const char *url, const char *charset, bool quirks);
+ const char *url, const char *charset, bool quirks,
+ nscss_done_callback done, void *pw);
css_error nscss_process_css_data(struct content_css_data *c, const char *data,
unsigned int size);
-css_error nscss_convert_css_data(struct content_css_data *c,
- nscss_done_callback callback, void *pw);
+css_error nscss_convert_css_data(struct content_css_data *c);
void nscss_destroy_css_data(struct content_css_data *c);
struct nscss_import *nscss_get_imports(struct hlcache_handle *h, uint32_t *n);