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 /desktop | |
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 'desktop')
-rw-r--r-- | desktop/browser.c | 14 | ||||
-rw-r--r-- | desktop/browser.h | 14 |
2 files changed, 23 insertions, 5 deletions
diff --git a/desktop/browser.c b/desktop/browser.c index f7acec491..528fb1fe5 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -736,11 +736,19 @@ void browser_window_set_gadget_filename(struct browser_window *bw, nserror browser_window_debug_dump(struct browser_window *bw, FILE *f, enum content_debug op) { - if (bw->current_content == NULL) { - return NSERROR_OK; + if (bw->current_content != NULL) { + return content_debug_dump(bw->current_content, f, op); } + return NSERROR_OK; +} - return content_debug_dump(bw->current_content, f, op); +/* exported interface, documented in browser.h */ +nserror browser_window_debug(struct browser_window *bw, enum content_debug op) +{ + if (bw->current_content != NULL) { + return content_debug(bw->current_content, op); + } + return NSERROR_OK; } /** slow script handler diff --git a/desktop/browser.h b/desktop/browser.h index c384c7f65..b24885d4f 100644 --- a/desktop/browser.h +++ b/desktop/browser.h @@ -668,9 +668,19 @@ int browser_get_dpi(void); /** * Dump debug info concerning the browser window's contents to file * - * \param bw The browser window - * \param f The file to dump to + * \param bw The browser window. + * \param f The file to dump to. + * \param op The debug operation type to dump. + * \return NSERROR_OK on success or error code on faliure. */ nserror browser_window_debug_dump(struct browser_window *bw, FILE *f, enum content_debug op); +/** + * set debug options on a window + * \param bw The browser window. + * \param op The debug operation type. + * \return NSERROR_OK on success or error code on faliure. + */ +nserror browser_window_debug(struct browser_window *bw, enum content_debug op); + #endif |