diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2014-03-20 16:55:55 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2014-03-25 16:44:44 +0000 |
commit | 80292f4511278d6ec3c7b3c0cc8d860f1d9bb8c5 (patch) | |
tree | 3e4366e31fa24cca79617164408cefb12a28c42c /platform | |
parent | 95361b7f10880776f0db3030030842d94ba341a9 (diff) | |
download | mupdf-80292f4511278d6ec3c7b3c0cc8d860f1d9bb8c5.tar.xz |
Break dependencies on pdf-form.c and pdf-js.c
Split functions out of pdf-form.c that shouldn't be there, and make
javascript initialization explicit.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/jni/mupdf.c | 6 | ||||
-rw-r--r-- | platform/x11/pdfapp.c | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/platform/android/jni/mupdf.c b/platform/android/jni/mupdf.c index 347c1a80..15470509 100644 --- a/platform/android/jni/mupdf.c +++ b/platform/android/jni/mupdf.c @@ -199,6 +199,9 @@ static void alerts_init(globals *glo) if (!idoc || glo->alerts_initialised) return; + if (idoc) + pdf_enable_js(idoc); + glo->alerts_active = 0; glo->alert_request = 0; glo->alert_reply = 0; @@ -572,7 +575,8 @@ JNI_FN(MuPDFCore_getPageHeight)(JNIEnv *env, jobject thiz) JNIEXPORT jboolean JNICALL JNI_FN(MuPDFCore_javascriptSupported)(JNIEnv *env, jobject thiz) { - return fz_javascript_supported(); + globals *glo = get_globals(env, thiz); + return pdf_js_supported(glo->doc); } static void update_changed_rects(globals *glo, page_cache *pc, pdf_document *idoc) diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c index bb619614..7ab5488e 100644 --- a/platform/x11/pdfapp.c +++ b/platform/x11/pdfapp.c @@ -249,7 +249,10 @@ void pdfapp_open_progressive(pdfapp_t *app, char *filename, int reload, int bps) idoc = pdf_specifics(app->doc); if (idoc) + { + pdf_enable_js(idoc); pdf_set_doc_event_callback(idoc, event_cb, app); + } if (fz_needs_password(app->doc)) { |