summaryrefslogtreecommitdiff
path: root/content/content.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2010-03-29 22:33:21 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2010-03-29 22:33:21 +0000
commit9aca901eb1db3b6f373882fe8b707e44959e2ec1 (patch)
treee21e30e702cab909eacdebc067a78dbd17ff8f8f /content/content.c
parent2a53c4c811a22b7382f0fd071a2f3ce477594340 (diff)
downloadnetsurf-9aca901eb1db3b6f373882fe8b707e44959e2ec1.tar.gz
netsurf-9aca901eb1db3b6f373882fe8b707e44959e2ec1.tar.bz2
The convert stage of a content's state progression no longer reflows the content to the provided dimensions.
It is now defined as converting the content into a state in which it is ready for use. The user of the content is now responsible for performing an initial reformat (sic) of the content before it can be redrawn. Purge width/height parameters from hlcache_handle_retrieve/content_convert/*_convert APIs. Fix up content handlers affected by the above change in semantics. Ensure that browser_window_callback performs an initial reformat of its content. svn path=/trunk/netsurf/; revision=10207
Diffstat (limited to 'content/content.c')
-rw-r--r--content/content.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/content/content.c b/content/content.c
index 621f15cb1..0ea929ae7 100644
--- a/content/content.c
+++ b/content/content.c
@@ -248,7 +248,7 @@ const char * const content_status_name[] = {
struct handler_entry {
bool (*create)(struct content *c, const http_parameter *params);
bool (*process_data)(struct content *c, char *data, unsigned int size);
- bool (*convert)(struct content *c, int width, int height);
+ bool (*convert)(struct content *c);
void (*reformat)(struct content *c, int width, int height);
void (*destroy)(struct content *c);
void (*stop)(struct content *c);
@@ -344,7 +344,7 @@ static const struct handler_entry handler_map[] = {
#endif
#ifdef WITH_NS_SVG
{svg_create, 0, svg_convert,
- 0, svg_destroy, 0, svg_redraw, 0, 0, 0, true},
+ svn_reformat, svg_destroy, 0, svg_redraw, 0, 0, 0, true},
#endif
#ifdef WITH_RSVG
{rsvg_create, rsvg_process_data, rsvg_convert,
@@ -356,7 +356,7 @@ static const struct handler_entry handler_map[] = {
static nserror content_llcache_callback(llcache_handle *llcache,
const llcache_event *event, void *pw);
-static void content_convert(struct content *c, int width, int height);
+static void content_convert(struct content *c);
static void content_update_status(struct content *c);
@@ -537,7 +537,7 @@ nserror content_llcache_callback(llcache_handle *llcache,
content_set_status(c, messages_get("Converting"), source_size);
content_broadcast(c, CONTENT_MSG_STATUS, msg_data);
- content_convert(c, c->width, c->height);
+ content_convert(c);
}
break;
case LLCACHE_EVENT_ERROR:
@@ -635,7 +635,7 @@ void content_update_status(struct content *c)
* be destroyed and must no longer be used.
*/
-void content_convert(struct content *c, int width, int height)
+void content_convert(struct content *c)
{
union content_msg_data msg_data;
@@ -649,9 +649,8 @@ void content_convert(struct content *c, int width, int height)
LOG(("content %s (%p)", llcache_handle_get_url(c->llcache), c));
c->locked = true;
- c->available_width = width;
if (handler_map[c->type].convert) {
- if (!handler_map[c->type].convert(c, width, height)) {
+ if (!handler_map[c->type].convert(c)) {
c->status = CONTENT_STATUS_ERROR;
c->locked = false;
return;