mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 04:26:50 +03:00
[project @ 2005-01-24 23:02:37 by bursa]
Reformat pages loaded from memory cache to window width. svn path=/import/netsurf/; revision=1467
This commit is contained in:
parent
2583180b79
commit
04f0525fbf
@ -414,7 +414,9 @@ bool content_set_type(struct content *c, content_type type,
|
||||
}
|
||||
content_remove_user(c, callback, p1, p2);
|
||||
content_broadcast(clone, CONTENT_MSG_NEWPTR, msg_data);
|
||||
fetchcache_go(clone, 0, callback, p1, p2, 0, 0, false);
|
||||
fetchcache_go(clone, 0, callback, p1, p2,
|
||||
clone->width, clone->height,
|
||||
0, 0, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -123,6 +123,8 @@ struct content * fetchcache(const char *url,
|
||||
* the new content
|
||||
* \param p1 user parameter for callback
|
||||
* \param p2 user parameter for callback
|
||||
* \param width available space
|
||||
* \param height available space
|
||||
* \param post_urlenc url encoded post data, or 0 if none
|
||||
* \param post_multipart multipart post data, or 0 if none
|
||||
* \param cookies send and accept cookies
|
||||
@ -134,6 +136,7 @@ void fetchcache_go(struct content *content, char *referer,
|
||||
void (*callback)(content_msg msg, struct content *c, void *p1,
|
||||
void *p2, union content_msg_data data),
|
||||
void *p1, void *p2,
|
||||
int width, int height,
|
||||
char *post_urlenc,
|
||||
struct form_successful_control *post_multipart,
|
||||
bool cookies)
|
||||
@ -182,6 +185,8 @@ void fetchcache_go(struct content *content, char *referer,
|
||||
|
||||
} else if (content->status == CONTENT_STATUS_DONE) {
|
||||
callback(CONTENT_MSG_LOADING, content, p1, p2, msg_data);
|
||||
if (content->available_width != width)
|
||||
content_reformat(content, width, height);
|
||||
if (content_find_user(content, callback, p1, p2))
|
||||
callback(CONTENT_MSG_READY, content, p1, p2, msg_data);
|
||||
if (content_find_user(content, callback, p1, p2))
|
||||
|
@ -35,6 +35,7 @@ void fetchcache_go(struct content *content, char *referer,
|
||||
void (*callback)(content_msg msg, struct content *c, void *p1,
|
||||
void *p2, union content_msg_data data),
|
||||
void *p1, void *p2,
|
||||
int width, int height,
|
||||
char *post_urlenc,
|
||||
struct form_successful_control *post_multipart,
|
||||
bool cookies);
|
||||
|
@ -807,6 +807,7 @@ void css_atimport(struct content *c, struct css_node *node)
|
||||
c->active++;
|
||||
fetchcache_go(c->data.css.import_content[i], c->url,
|
||||
css_atimport_callback, c, (void *) i,
|
||||
c->width, c->height,
|
||||
0, 0, false);
|
||||
}
|
||||
|
||||
@ -870,6 +871,7 @@ void css_atimport_callback(content_msg msg, struct content *css,
|
||||
fetchcache_go(c->data.css.import_content[i],
|
||||
c->url, css_atimport_callback,
|
||||
c, (void *) i,
|
||||
css->width, css->height,
|
||||
0, 0, false);
|
||||
}
|
||||
break;
|
||||
|
@ -220,6 +220,7 @@ void browser_window_go_post(struct browser_window *bw, const char *url,
|
||||
|
||||
fetchcache_go(c, option_send_referer ? referer : 0,
|
||||
browser_window_callback, bw, 0,
|
||||
gui_window_get_width(bw->window), 0,
|
||||
post_urlenc, post_multipart, true);
|
||||
}
|
||||
|
||||
|
@ -445,7 +445,8 @@ bool html_find_stylesheets(struct content *c, xmlNode *head)
|
||||
c->active++;
|
||||
fetchcache_go(c->data.html.stylesheet_content[STYLESHEET_BASE], 0,
|
||||
html_convert_css_callback, c,
|
||||
(void *) STYLESHEET_BASE, 0, 0, false);
|
||||
(void *) STYLESHEET_BASE, c->width, c->height,
|
||||
0, 0, false);
|
||||
|
||||
if (option_block_ads) {
|
||||
c->data.html.stylesheet_content[STYLESHEET_ADBLOCK] =
|
||||
@ -459,7 +460,8 @@ bool html_find_stylesheets(struct content *c, xmlNode *head)
|
||||
fetchcache_go(c->data.html.
|
||||
stylesheet_content[STYLESHEET_ADBLOCK],
|
||||
0, html_convert_css_callback, c,
|
||||
(void *) STYLESHEET_ADBLOCK, 0, 0, false);
|
||||
(void *) STYLESHEET_ADBLOCK, c->width,
|
||||
c->height, 0, 0, false);
|
||||
}
|
||||
|
||||
for (node = head == 0 ? 0 : head->children; node; node = node->next) {
|
||||
@ -527,7 +529,7 @@ bool html_find_stylesheets(struct content *c, xmlNode *head)
|
||||
fetchcache_go(c->data.html.stylesheet_content[i],
|
||||
c->url,
|
||||
html_convert_css_callback,
|
||||
c, (void *) i,
|
||||
c, (void *) i, c->width, c->height,
|
||||
0, 0, false);
|
||||
free(url);
|
||||
i++;
|
||||
@ -681,8 +683,8 @@ void html_convert_css_callback(content_msg msg, struct content *css,
|
||||
fetchcache_go(c->data.html.stylesheet_content[i],
|
||||
c->url,
|
||||
html_convert_css_callback,
|
||||
c, (void *) i,
|
||||
0, 0, false);
|
||||
c, (void *) i, css->width,
|
||||
css->height, 0, 0, false);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -747,6 +749,7 @@ bool html_fetch_object(struct content *c, char *url, struct box *box,
|
||||
c->active++;
|
||||
fetchcache_go(c->data.html.object[i].content, c->url,
|
||||
html_object_callback, c, (void *) i,
|
||||
available_width, available_height,
|
||||
0, 0, false);
|
||||
|
||||
return true;
|
||||
@ -840,6 +843,7 @@ void html_object_callback(content_msg msg, struct content *object,
|
||||
c->url,
|
||||
html_object_callback,
|
||||
c, (void * ) i,
|
||||
0, 0,
|
||||
0, 0, false);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user