From 7609158e702ece6e182b19cec8b0192b1af598e8 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 22 Feb 2016 15:00:29 +0100 Subject: 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. --- .../src/com/artifex/mupdf/fitz/AndroidDrawDevice.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'platform/android/src') 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); } -- cgit v1.2.3