summaryrefslogtreecommitdiff
path: root/platform/android/src/com/artifex/mupdfdemo
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/src/com/artifex/mupdfdemo')
-rw-r--r--platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java5
-rw-r--r--platform/android/src/com/artifex/mupdfdemo/MuPDFCore.java18
2 files changed, 23 insertions, 0 deletions
diff --git a/platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java b/platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java
index 172c189a..30e96ecf 100644
--- a/platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java
+++ b/platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java
@@ -76,6 +76,7 @@ public class MuPDFActivity extends Activity implements FilePicker.FilePickerSupp
private ImageButton mSearchFwd;
private EditText mSearchText;
private SearchTask mSearchTask;
+ private ImageButton mProofButton;
private AlertDialog.Builder mAlertBuilder;
private boolean mLinkHighlight = false;
private final Handler mHandler = new Handler();
@@ -887,10 +888,14 @@ public class MuPDFActivity extends Activity implements FilePicker.FilePickerSupp
mSearchText = (EditText)mButtonsView.findViewById(R.id.searchText);
mLinkButton = (ImageButton)mButtonsView.findViewById(R.id.linkButton);
mMoreButton = (ImageButton)mButtonsView.findViewById(R.id.moreButton);
+ mProofButton = (ImageButton)mButtonsView.findViewById(R.id.proofButton);
mTopBarSwitcher.setVisibility(View.INVISIBLE);
mPageNumberView.setVisibility(View.INVISIBLE);
mInfoView.setVisibility(View.INVISIBLE);
mPageSlider.setVisibility(View.INVISIBLE);
+ if (!core.gprfSupported()) {
+ mProofButton.setVisibility(View.INVISIBLE);
+ }
}
public void OnMoreButtonClick(View v) {
diff --git a/platform/android/src/com/artifex/mupdfdemo/MuPDFCore.java b/platform/android/src/com/artifex/mupdfdemo/MuPDFCore.java
index ffab6782..5c8697fb 100644
--- a/platform/android/src/com/artifex/mupdfdemo/MuPDFCore.java
+++ b/platform/android/src/com/artifex/mupdfdemo/MuPDFCore.java
@@ -11,8 +11,19 @@ import android.content.Intent;
public class MuPDFCore
{
/* load our native library */
+ private static boolean gs_so_available = false;
static {
System.loadLibrary("mupdf");
+ if (gprfSupportedInternal())
+ {
+ try {
+ System.loadLibrary("gs");
+ gs_so_available = true;
+ }
+ catch (UnsatisfiedLinkError e) {
+ gs_so_available = false;
+ }
+ }
}
/* Readable members */
@@ -26,6 +37,7 @@ public class MuPDFCore
private final boolean wasOpenedFromBuffer;
/* The native functions */
+ private static native boolean gprfSupportedInternal();
private native long openFile(String filename);
private native long openBuffer(String magic);
private native String fileFormatInternal();
@@ -357,4 +369,10 @@ public class MuPDFCore
public synchronized void endProof(String filename) {
endProofInternal(filename);
}
+
+ public static boolean gprfSupported() {
+ if (gs_so_available == false)
+ return false;
+ return gprfSupportedInternal();
+ }
}