diff options
Diffstat (limited to 'content/handlers/pdf/pdf.c')
-rw-r--r-- | content/handlers/pdf/pdf.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/content/handlers/pdf/pdf.c b/content/handlers/pdf/pdf.c index ec283aa3a..bc8a365f3 100644 --- a/content/handlers/pdf/pdf.c +++ b/content/handlers/pdf/pdf.c @@ -37,7 +37,9 @@ #include "netsurf/content.h" #include "netsurf/browser_window.h" #include "content/llcache.h" +#include "content/content.h" #include "content/content_protected.h" +#include "content/content_factory.h" #include "pdf.h" @@ -137,13 +139,13 @@ static bool pdf_convert(struct content *c) content_data, content_length); if (pdfres != NSPDFERROR_OK) { - content_broadcast_errorcode(c, NSERROR_INVALID); + content_broadcast_error(c, NSERROR_INVALID, NULL); return false; } pdfres = nspdf_page_count(pdfc->doc, &pdfc->page_count); if (pdfres != NSPDFERROR_OK) { - content_broadcast_errorcode(c, NSERROR_INVALID); + content_broadcast_error(c, NSERROR_INVALID, NULL); return false; } @@ -243,6 +245,7 @@ pdf_change_page(struct pdf_content *pdfc, float page_width; float page_height; nspdferror pdfres; + union content_msg_data msgdata; /* ensure page stays in bounds */ if (page_number >= pdfc->page_count) { @@ -265,10 +268,15 @@ pdf_change_page(struct pdf_content *pdfc, page_height); } - browser_window_update(bw, false); + msgdata.redraw.x = 0; + msgdata.redraw.y = 0; + msgdata.redraw.width = pdfc->base.width; + msgdata.redraw.height = pdfc->base.height; + + content_broadcast(&pdfc->base, CONTENT_MSG_REDRAW, &msgdata); } -static void +static nserror pdf_mouse_action(struct content *c, struct browser_window *bw, browser_mouse_state mouse, @@ -287,6 +295,7 @@ pdf_mouse_action(struct content *c, pdf_change_page(pdfc, bw, pdfc->current_page + 1); } } + return NSERROR_OK; } static const content_handler nspdf_content_handler = { |