From 80292f4511278d6ec3c7b3c0cc8d860f1d9bb8c5 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 20 Mar 2014 16:55:55 +0100 Subject: 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. --- platform/android/jni/mupdf.c | 6 +++++- platform/x11/pdfapp.c | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'platform') 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)) { -- cgit v1.2.3