diff options
author | Vincent Sanders <vince@kyllikki.org> | 2014-11-06 22:51:46 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2014-11-06 22:51:46 +0000 |
commit | 8c2cfecfb5e83d023609914dd101c23777fd2906 (patch) | |
tree | df076fe2b22f0ecc6ec97d32a6b59f8ffa278d9b /render | |
parent | 46f369ca9ee79af5e7a121551fe9715101d27395 (diff) | |
download | netsurf-8c2cfecfb5e83d023609914dd101c23777fd2906.tar.gz netsurf-8c2cfecfb5e83d023609914dd101c23777fd2906.tar.bz2 |
Allow content handlers to have debug values set through API
Previously content handler debugging features were accessed by global
variables. This allows the setting of debugging parameters via a
content API giving per content control over debugging features.
Currently only used by the html content handler to toggle global
redraw debugging.
Diffstat (limited to 'render')
-rw-r--r-- | render/html.c | 19 | ||||
-rw-r--r-- | render/html.h | 3 | ||||
-rw-r--r-- | render/html_internal.h | 3 |
3 files changed, 20 insertions, 5 deletions
diff --git a/render/html.c b/render/html.c index d4ce3366f..4e9347aa5 100644 --- a/render/html.c +++ b/render/html.c @@ -1978,10 +1978,26 @@ static bool html_drop_file_at_point(struct content *c, int x, int y, char *file) /** + * set debug status. + * + * \param c The content to debug + * \param op The debug operation type + */ +static nserror +html_debug(struct content *c, enum content_debug op) +{ + html_redraw_debug = !html_redraw_debug; + + return NSERROR_OK; +} + + +/** * Dump debug info concerning the html_content * - * \param bw The browser window + * \param c The content to debug * \param f The file to dump to + * \param op The debug dump type */ static nserror html_debug_dump(struct content *c, FILE *f, enum content_debug op) @@ -2261,6 +2277,7 @@ static const content_handler html_content_handler = { .search = html_search, .search_clear = html_search_clear, .debug_dump = html_debug_dump, + .debug = html_debug, .clone = html_clone, .get_encoding = html_encoding, .type = html_content_type, diff --git a/render/html.h b/render/html.h index 145471827..6503c91fe 100644 --- a/render/html.h +++ b/render/html.h @@ -149,9 +149,6 @@ struct content_html_iframe { #define STYLESHEET_USER 3 /* user stylesheet */ #define STYLESHEET_START 4 /* start of document stylesheets */ -/** Render padding and margin box outlines in html_redraw(). */ -extern bool html_redraw_debug; - nserror html_init(void); void html_redraw_a_box(struct hlcache_handle *h, struct box *box); diff --git a/render/html_internal.h b/render/html_internal.h index b57f240bd..1a878031b 100644 --- a/render/html_internal.h +++ b/render/html_internal.h @@ -176,7 +176,8 @@ typedef struct html_content { } html_content; - +/** Render padding and margin box outlines in html_redraw(). */ +extern bool html_redraw_debug; void html_set_status(html_content *c, const char *extra); |