From d68576c3785572c1f5d41f83015b8fe6bbcbe9e8 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 30 Mar 2016 17:49:04 +0200 Subject: Reorganize java and android source. platform/java and platform/android are reorganized: platform/java The new JNI Java classes, mupdf_native.{c,h}, Makefile and Makejar. platform/java/example The example desktop viewer classes. platform/android/viewer The original demo viewer. ndk-build is used to build libmupdf_java.so, making reference to mupdf_native.{c,h} in platform/java. --- .../com/artifex/mupdfdemo/MuPDFAlertInternal.java | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 platform/android/viewer/src/com/artifex/mupdfdemo/MuPDFAlertInternal.java (limited to 'platform/android/viewer/src/com/artifex/mupdfdemo/MuPDFAlertInternal.java') diff --git a/platform/android/viewer/src/com/artifex/mupdfdemo/MuPDFAlertInternal.java b/platform/android/viewer/src/com/artifex/mupdfdemo/MuPDFAlertInternal.java new file mode 100644 index 00000000..5d65768f --- /dev/null +++ b/platform/android/viewer/src/com/artifex/mupdfdemo/MuPDFAlertInternal.java @@ -0,0 +1,30 @@ +package com.artifex.mupdfdemo; + +// Version of MuPDFAlert without enums to simplify JNI +public class MuPDFAlertInternal { + public final String message; + public final int iconType; + public final int buttonGroupType; + public final String title; + public int buttonPressed; + + MuPDFAlertInternal(String aMessage, int aIconType, int aButtonGroupType, String aTitle, int aButtonPressed) { + message = aMessage; + iconType = aIconType; + buttonGroupType = aButtonGroupType; + title = aTitle; + buttonPressed = aButtonPressed; + } + + MuPDFAlertInternal(MuPDFAlert alert) { + message = alert.message; + iconType = alert.iconType.ordinal(); + buttonGroupType = alert.buttonGroupType.ordinal(); + title = alert.message; + buttonPressed = alert.buttonPressed.ordinal(); + } + + MuPDFAlert toAlert() { + return new MuPDFAlert(message, MuPDFAlert.IconType.values()[iconType], MuPDFAlert.ButtonGroupType.values()[buttonGroupType], title, MuPDFAlert.ButtonPressed.values()[buttonPressed]); + } +} -- cgit v1.2.3