From 786057a2c19f33d7e95fca13d3711ce60d388966 Mon Sep 17 00:00:00 2001 From: fred ross-perry Date: Fri, 12 Aug 2016 14:05:03 -0700 Subject: Android viewer: get experimental proofing to build again. - use FZ_ENABLE_GPRF everywhere - chasing changed fz APIs in gprf-doc.c --- platform/android/viewer/build.gradle | 26 ++++++++++++++++---------- platform/android/viewer/jni/Android.mk | 4 ++-- platform/android/viewer/jni/Core.mk | 8 ++++---- platform/android/viewer/jni/mupdf.c | 6 +++--- source/gprf/gprf-doc.c | 4 ++-- 5 files changed, 27 insertions(+), 21 deletions(-) diff --git a/platform/android/viewer/build.gradle b/platform/android/viewer/build.gradle index 1736e939..3d8088d2 100644 --- a/platform/android/viewer/build.gradle +++ b/platform/android/viewer/build.gradle @@ -1,5 +1,3 @@ -import org.apache.tools.ant.taskdefs.condition.Os - buildscript { repositories { jcenter() @@ -58,29 +56,37 @@ android { } } -/* This defines the path to Android's ndk-build. */ +// This defines the path to Android's ndk-build. +import org.apache.tools.ant.taskdefs.condition.Os def ndkBuildPath = plugins.getPlugin('com.android.application').sdkHandler.getNdkFolder().absolutePath + File.separator + 'ndk-build' if (Os.isFamily(Os.FAMILY_WINDOWS)) { ndkBuildPath +='.cmd' } -/* This task builds the native part */ +// This task builds the native part +// To build with experimental proofing enabled, define FZ_ENABLE_GPRF, +// as shown below, and put a copy of libgs.so in the +// JNI folder before building. + task buildNative(type: Exec,description: 'Compile JNI source via NDK') { println('executing buildNative') - commandLine ndkBuildPath, '-C', file('.').absolutePath, ' FZ_ENABLE_GPRF=1' - //'NDK_PROJECT_PATH=build','APP_BUILD_SCRIPT=src/main/jni/Android.mk'//force using appropriate Makefile +// commandLine ndkBuildPath, '-C', file('.').absolutePath, ' FZ_ENABLE_GPRF=1' + commandLine ndkBuildPath, '-C', file('.').absolutePath } -/* This task cleans the native part */ +// This task cleans the native part + task cleanNative(type: Exec, description: 'Clean JNI object files') { println('executing cleanNative') commandLine ndkBuildPath, '-C', file('.').absolutePath, 'clean' } -/* cleaning should also include cleaning native */ +// cleaning should also include cleaning native + clean.dependsOn 'cleanNative' -/* building should include native */ -tasks.withType(JavaCompile){ +// building should include native + +tasks.withType(JavaCompile) { compileTask -> compileTask.dependsOn buildNative } diff --git a/platform/android/viewer/jni/Android.mk b/platform/android/viewer/jni/Android.mk index 0a1dbf38..27f481a8 100644 --- a/platform/android/viewer/jni/Android.mk +++ b/platform/android/viewer/jni/Android.mk @@ -30,8 +30,8 @@ ifdef NDK_PROFILER LOCAL_CFLAGS += -pg -DNDK_PROFILER LOCAL_STATIC_LIBRARIES += andprof endif -ifdef SUPPORT_GPROOF -LOCAL_CFLAGS += -DSUPPORT_GPROOF +ifdef FZ_ENABLE_GPRF +LOCAL_CFLAGS += -DFZ_ENABLE_GPRF endif LOCAL_LDLIBS := -lm -llog -ljnigraphics diff --git a/platform/android/viewer/jni/Core.mk b/platform/android/viewer/jni/Core.mk index 7a0913b4..4f9a3136 100644 --- a/platform/android/viewer/jni/Core.mk +++ b/platform/android/viewer/jni/Core.mk @@ -1,6 +1,6 @@ LOCAL_PATH := $(call my-dir) -ifdef SUPPORT_GPROOF +ifdef FZ_ENABLE_GPRF include $(CLEAR_VARS) LOCAL_MODULE := gsso LOCAL_SRC_FILES := libgs.so @@ -19,8 +19,8 @@ ifdef NDK_PROFILER LOCAL_CFLAGS += -pg -DNDK_PROFILER endif endif -ifdef SUPPORT_GPROOF -LOCAL_CFLAGS += -DSUPPORT_GPROOF +ifdef FZ_ENABLE_GPRF +LOCAL_CFLAGS += -DFZ_ENABLE_GPRF endif LOCAL_CFLAGS += -DAA_BITS=8 ifdef MEMENTO @@ -69,7 +69,7 @@ LOCAL_SRC_FILES := \ $(wildcard $(MY_ROOT)/source/html/*.c) \ $(wildcard $(MY_ROOT)/generated/*.c) -ifdef SUPPORT_GPROOF +ifdef FZ_ENABLE_GPRF LOCAL_SHARED_LIBRARIES := gsso endif LOCAL_LDLIBS := -lm -llog -ljnigraphics diff --git a/platform/android/viewer/jni/mupdf.c b/platform/android/viewer/jni/mupdf.c index 55c37e43..83560aad 100644 --- a/platform/android/viewer/jni/mupdf.c +++ b/platform/android/viewer/jni/mupdf.c @@ -2749,7 +2749,7 @@ static char *tmp_gproof_path(char *path) JNIEXPORT jstring JNICALL JNI_FN(MuPDFCore_startProofInternal)(JNIEnv * env, jobject thiz, int inResolution) { -#ifdef SUPPORT_GPROOF +#ifdef FZ_ENABLE_GPRF globals *glo = get_globals(env, thiz); fz_context *ctx = glo->ctx; char *tmp; @@ -2790,7 +2790,7 @@ JNI_FN(MuPDFCore_startProofInternal)(JNIEnv * env, jobject thiz, int inResolutio JNIEXPORT void JNICALL JNI_FN(MuPDFCore_endProofInternal)(JNIEnv * env, jobject thiz, jstring jfilename) { -#ifdef SUPPORT_GPROOF +#ifdef FZ_ENABLE_GPRF globals *glo = get_globals(env, thiz); fz_context *ctx = glo->ctx; const char *tmp; @@ -2812,7 +2812,7 @@ JNI_FN(MuPDFCore_endProofInternal)(JNIEnv * env, jobject thiz, jstring jfilename JNIEXPORT jboolean JNICALL JNI_FN(MuPDFCore_gprfSupportedInternal)(JNIEnv * env) { -#ifdef SUPPORT_GPROOF +#ifdef FZ_ENABLE_GPRF return JNI_TRUE; #else return JNI_FALSE; diff --git a/source/gprf/gprf-doc.c b/source/gprf/gprf-doc.c index e7458043..70de2639 100644 --- a/source/gprf/gprf-doc.c +++ b/source/gprf/gprf-doc.c @@ -791,7 +791,7 @@ gprf_load_page(fz_context *ctx, fz_document *doc_, int number) { page->super.bound_page = gprf_bound_page; page->super.run_page_contents = gprf_run_page; - page->super.drop_page_imp = gprf_drop_page_imp; + page->super.drop_page = gprf_drop_page_imp; page->super.count_separations = gprf_count_separations; page->super.control_separation = gprf_control_separation; page->super.separation_disabled = gprf_separation_disabled; @@ -844,7 +844,7 @@ gprf_open_document_with_stream(fz_context *ctx, fz_stream *file) gprf_document *doc; doc = fz_new_document(ctx, gprf_document); - doc->super.close = gprf_close_document; + doc->super.drop_document = gprf_close_document; doc->super.count_pages = gprf_count_pages; doc->super.load_page = gprf_load_page; doc->super.lookup_metadata = gprf_lookup_metadata; -- cgit v1.2.3