diff options
author | Paul Gardiner <paulg.artifex@glidos.net> | 2012-09-19 15:06:04 +0100 |
---|---|---|
committer | Paul Gardiner <paulg.artifex@glidos.net> | 2012-09-19 15:06:04 +0100 |
commit | 7428d9e85791260bf9d481b49e90c4321339453a (patch) | |
tree | b0ca0a6868c47119ade0f5a8a846f4d1ceef6782 /apps | |
parent | 5f8e096b9090577ed93072448339a6500a5178f3 (diff) | |
download | mupdf-7428d9e85791260bf9d481b49e90c4321339453a.tar.xz |
Forms: handle print request, both from javascript and from named action
Currently the app windows app responds with a message box explaining that
the MuPDF library passes print requests to the app, but the app does not
implement printing.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/jstest_main.c | 5 | ||||
-rw-r--r-- | apps/pdfapp.c | 3 | ||||
-rw-r--r-- | apps/pdfapp.h | 1 | ||||
-rw-r--r-- | apps/win_main.c | 5 | ||||
-rw-r--r-- | apps/x11_main.c | 5 |
5 files changed, 19 insertions, 0 deletions
diff --git a/apps/jstest_main.c b/apps/jstest_main.c index a6ff06d1..7f4bc54a 100644 --- a/apps/jstest_main.c +++ b/apps/jstest_main.c @@ -53,6 +53,11 @@ void winalert(pdfapp_t *app, fz_alert_event *alert) } } +void winprint(pdfapp_t *app) +{ + fprintf(stderr, "The MuPDF library supports printing, but this application currently does not"); +} + static char pd_password[256] = ""; static char td_textinput[LONGLINE] = ""; diff --git a/apps/pdfapp.c b/apps/pdfapp.c index 0a87565a..5cb0adea 100644 --- a/apps/pdfapp.c +++ b/apps/pdfapp.c @@ -113,6 +113,9 @@ static void event_cb(fz_doc_event *event, void *data) winalert(app, alert); } break; + case FZ_DOCUMENT_EVENT_PRINT: + winprint(app); + break; } } diff --git a/apps/pdfapp.h b/apps/pdfapp.h index 46dcf291..4f251c4d 100644 --- a/apps/pdfapp.h +++ b/apps/pdfapp.h @@ -38,6 +38,7 @@ extern void winfullscreen(pdfapp_t*, int state); extern int winsavequery(pdfapp_t*); extern int wingetsavepath(pdfapp_t*, char *buf, int len); extern void winalert(pdfapp_t *, fz_alert_event *alert); +extern void winprint(pdfapp_t *); struct pdfapp_s { diff --git a/apps/win_main.c b/apps/win_main.c index 97f927f2..ba9e74a7 100644 --- a/apps/win_main.c +++ b/apps/win_main.c @@ -155,6 +155,11 @@ void winalert(pdfapp_t *app, fz_alert_event *alert) } } +void winprint(pdfapp_t *app) +{ + MessageBoxA(hwndframe, "The MuPDF library supports printing, but this application currently does not", "Print document", MB_ICONWARNING); +} + int winsavequery(pdfapp_t *app) { switch(MessageBoxA(hwndframe, "File has unsaved changes. Do you want to save", "MuPDF", MB_YESNOCANCEL)) diff --git a/apps/x11_main.c b/apps/x11_main.c index 182aadb4..722568d5 100644 --- a/apps/x11_main.c +++ b/apps/x11_main.c @@ -126,6 +126,11 @@ void winalert(pdfapp_t *app, fz_alert_event *alert) } } +void winprint(pdfapp_t *app) +{ + fprintf(stderr, "The MuPDF library supports printing, but this application currently does not"); +} + char *winpassword(pdfapp_t *app, char *filename) { char *r = password; |