summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2014-03-20 16:55:55 +0100
committerRobin Watts <robin.watts@artifex.com>2014-03-25 16:44:44 +0000
commit80292f4511278d6ec3c7b3c0cc8d860f1d9bb8c5 (patch)
tree3e4366e31fa24cca79617164408cefb12a28c42c /platform
parent95361b7f10880776f0db3030030842d94ba341a9 (diff)
downloadmupdf-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.c6
-rw-r--r--platform/x11/pdfapp.c3
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))
{