summaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-02-22 15:00:29 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-02-29 16:03:34 +0100
commit7609158e702ece6e182b19cec8b0192b1af598e8 (patch)
treed6611bc8243a457b2fe90bfebd72454e93601288 /platform/android
parente1716629fd92f4580e6b213dc7be54b4935f09f9 (diff)
downloadmupdf-7609158e702ece6e182b19cec8b0192b1af598e8.tar.xz
jni: Various cleanups.
jni: Various cleanups. Fix gcc and clang warnings. Android specific functions are guarded by HAVE_ANDROID define. The java guts of the android stuff is removed for now, to be added back in later. Set up a makefile and simple tests to build for desktop java. Rerig device classes to: Device, NativeDevice, JavaDevice and DrawDevice. Add Pixmap class. Regularize naming. General cleanups and abbreviate naming. Use to_JavaClass and from_JavaClass rather than fz_mupdf_struct_from_JavaClass and JavaClass_from_fz_mupdf_struct. Check for exceptions thrown by java devices and path processor. Tweak constructors and finalizers to remove the JavaDevice subclass. Use toString when rethrowing java exceptions as fitz exceptions.
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/src/com/artifex/mupdf/fitz/AndroidDrawDevice.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/platform/android/src/com/artifex/mupdf/fitz/AndroidDrawDevice.java b/platform/android/src/com/artifex/mupdf/fitz/AndroidDrawDevice.java
index 1537f62a..4a8daaa7 100644
--- a/platform/android/src/com/artifex/mupdf/fitz/AndroidDrawDevice.java
+++ b/platform/android/src/com/artifex/mupdf/fitz/AndroidDrawDevice.java
@@ -2,18 +2,21 @@ package com.artifex.mupdf.fitz;
import android.graphics.Bitmap;
-public final class AndroidDrawDevice extends CDevice
+public final class AndroidDrawDevice extends NativeDevice
{
+ // NOT static.
+ private native long newNative(Bitmap bitmap, int pageX0, int pageY0, int pageX1, int pageY1, int patchX0, int patchY0, int patchX1, int patchY1);
+
// Construction
public AndroidDrawDevice(Bitmap bitmap, int pageX0, int pageY0, int pageX1, int pageY1, int patchX0, int patchY0, int patchX1, int patchY1)
{
- nativeDevice = newNative(bitmap, pageX0, pageY0, pageX1, pageY1, patchX0, patchY0, patchX1, patchY1);
+ super(0);
+ pointer = newNative(bitmap, pageX0, pageY0, pageX1, pageY1, patchX0, patchY0, patchX1, patchY1);
}
public AndroidDrawDevice(Bitmap bitmap, RectI page, RectI patch)
{
- nativeDevice = newNative(bitmap, page.x0, page.y0, page.x1, page.y1, patch.x0, patch.y0, patch.x1, patch.y1);
+ super(0);
+ pointer = newNative(bitmap, page.x0, page.y0, page.x1, page.y1, patch.x0, patch.y0, patch.x1, patch.y1);
}
-
- private native long newNative(Bitmap bitmap, int pageX0, int pageY0, int pageX1, int pageY1, int patchX0, int patchY0, int patchX1, int patchY1);
}