From 138b2c4fd1d8722060b6b46ab9160f668cd54d0b Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Thu, 6 Sep 2018 19:38:31 +0800 Subject: jni: Remove unused flags and improve the names of some others. --- platform/java/mupdf_native.h | 164 +++------------------ .../java/src/com/artifex/mupdf/fitz/Device.java | 22 --- .../src/com/artifex/mupdf/fitz/StrokeState.java | 18 +-- 3 files changed, 27 insertions(+), 177 deletions(-) diff --git a/platform/java/mupdf_native.h b/platform/java/mupdf_native.h index 144bfefb..0e581fda 100644 --- a/platform/java/mupdf_native.h +++ b/platform/java/mupdf_native.h @@ -362,28 +362,6 @@ JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Cookie_abort #ifdef __cplusplus extern "C" { #endif -#undef com_artifex_mupdf_fitz_Device_FLAG_MASK -#define com_artifex_mupdf_fitz_Device_FLAG_MASK 1L -#undef com_artifex_mupdf_fitz_Device_FLAG_COLOR -#define com_artifex_mupdf_fitz_Device_FLAG_COLOR 2L -#undef com_artifex_mupdf_fitz_Device_FLAG_UNCACHEABLE -#define com_artifex_mupdf_fitz_Device_FLAG_UNCACHEABLE 4L -#undef com_artifex_mupdf_fitz_Device_FLAG_FILLCOLOR_UNDEFINED -#define com_artifex_mupdf_fitz_Device_FLAG_FILLCOLOR_UNDEFINED 8L -#undef com_artifex_mupdf_fitz_Device_FLAG_STROKECOLOR_UNDEFINED -#define com_artifex_mupdf_fitz_Device_FLAG_STROKECOLOR_UNDEFINED 16L -#undef com_artifex_mupdf_fitz_Device_FLAG_STARTCAP_UNDEFINED -#define com_artifex_mupdf_fitz_Device_FLAG_STARTCAP_UNDEFINED 32L -#undef com_artifex_mupdf_fitz_Device_FLAG_DASHCAP_UNDEFINED -#define com_artifex_mupdf_fitz_Device_FLAG_DASHCAP_UNDEFINED 64L -#undef com_artifex_mupdf_fitz_Device_FLAG_ENDCAP_UNDEFINED -#define com_artifex_mupdf_fitz_Device_FLAG_ENDCAP_UNDEFINED 128L -#undef com_artifex_mupdf_fitz_Device_FLAG_LINEJOIN_UNDEFINED -#define com_artifex_mupdf_fitz_Device_FLAG_LINEJOIN_UNDEFINED 256L -#undef com_artifex_mupdf_fitz_Device_FLAG_MITERLIMIT_UNDEFINED -#define com_artifex_mupdf_fitz_Device_FLAG_MITERLIMIT_UNDEFINED 512L -#undef com_artifex_mupdf_fitz_Device_FLAG_LINEWIDTH_UNDEFINED -#define com_artifex_mupdf_fitz_Device_FLAG_LINEWIDTH_UNDEFINED 1024L #undef com_artifex_mupdf_fitz_Device_BLEND_NORMAL #define com_artifex_mupdf_fitz_Device_BLEND_NORMAL 0L #undef com_artifex_mupdf_fitz_Device_BLEND_MULTIPLY @@ -416,16 +394,6 @@ extern "C" { #define com_artifex_mupdf_fitz_Device_BLEND_COLOR 14L #undef com_artifex_mupdf_fitz_Device_BLEND_LUMINOSITY #define com_artifex_mupdf_fitz_Device_BLEND_LUMINOSITY 15L -#undef com_artifex_mupdf_fitz_Device_BLEND_MODEMASK -#define com_artifex_mupdf_fitz_Device_BLEND_MODEMASK 15L -#undef com_artifex_mupdf_fitz_Device_BLEND_ISOLATED -#define com_artifex_mupdf_fitz_Device_BLEND_ISOLATED 16L -#undef com_artifex_mupdf_fitz_Device_BLEND_KNOCKOUT -#define com_artifex_mupdf_fitz_Device_BLEND_KNOCKOUT 32L -#undef com_artifex_mupdf_fitz_Device_IGNORE_IMAGE -#define com_artifex_mupdf_fitz_Device_IGNORE_IMAGE 1L -#undef com_artifex_mupdf_fitz_Device_IGNORE_SHADE -#define com_artifex_mupdf_fitz_Device_IGNORE_SHADE 2L /* * Class: com_artifex_mupdf_fitz_Device * Method: finalize @@ -512,28 +480,6 @@ JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_DisplayList_run #ifdef __cplusplus extern "C" { #endif -#undef com_artifex_mupdf_fitz_DisplayListDevice_FLAG_MASK -#define com_artifex_mupdf_fitz_DisplayListDevice_FLAG_MASK 1L -#undef com_artifex_mupdf_fitz_DisplayListDevice_FLAG_COLOR -#define com_artifex_mupdf_fitz_DisplayListDevice_FLAG_COLOR 2L -#undef com_artifex_mupdf_fitz_DisplayListDevice_FLAG_UNCACHEABLE -#define com_artifex_mupdf_fitz_DisplayListDevice_FLAG_UNCACHEABLE 4L -#undef com_artifex_mupdf_fitz_DisplayListDevice_FLAG_FILLCOLOR_UNDEFINED -#define com_artifex_mupdf_fitz_DisplayListDevice_FLAG_FILLCOLOR_UNDEFINED 8L -#undef com_artifex_mupdf_fitz_DisplayListDevice_FLAG_STROKECOLOR_UNDEFINED -#define com_artifex_mupdf_fitz_DisplayListDevice_FLAG_STROKECOLOR_UNDEFINED 16L -#undef com_artifex_mupdf_fitz_DisplayListDevice_FLAG_STARTCAP_UNDEFINED -#define com_artifex_mupdf_fitz_DisplayListDevice_FLAG_STARTCAP_UNDEFINED 32L -#undef com_artifex_mupdf_fitz_DisplayListDevice_FLAG_DASHCAP_UNDEFINED -#define com_artifex_mupdf_fitz_DisplayListDevice_FLAG_DASHCAP_UNDEFINED 64L -#undef com_artifex_mupdf_fitz_DisplayListDevice_FLAG_ENDCAP_UNDEFINED -#define com_artifex_mupdf_fitz_DisplayListDevice_FLAG_ENDCAP_UNDEFINED 128L -#undef com_artifex_mupdf_fitz_DisplayListDevice_FLAG_LINEJOIN_UNDEFINED -#define com_artifex_mupdf_fitz_DisplayListDevice_FLAG_LINEJOIN_UNDEFINED 256L -#undef com_artifex_mupdf_fitz_DisplayListDevice_FLAG_MITERLIMIT_UNDEFINED -#define com_artifex_mupdf_fitz_DisplayListDevice_FLAG_MITERLIMIT_UNDEFINED 512L -#undef com_artifex_mupdf_fitz_DisplayListDevice_FLAG_LINEWIDTH_UNDEFINED -#define com_artifex_mupdf_fitz_DisplayListDevice_FLAG_LINEWIDTH_UNDEFINED 1024L #undef com_artifex_mupdf_fitz_DisplayListDevice_BLEND_NORMAL #define com_artifex_mupdf_fitz_DisplayListDevice_BLEND_NORMAL 0L #undef com_artifex_mupdf_fitz_DisplayListDevice_BLEND_MULTIPLY @@ -566,16 +512,6 @@ extern "C" { #define com_artifex_mupdf_fitz_DisplayListDevice_BLEND_COLOR 14L #undef com_artifex_mupdf_fitz_DisplayListDevice_BLEND_LUMINOSITY #define com_artifex_mupdf_fitz_DisplayListDevice_BLEND_LUMINOSITY 15L -#undef com_artifex_mupdf_fitz_DisplayListDevice_BLEND_MODEMASK -#define com_artifex_mupdf_fitz_DisplayListDevice_BLEND_MODEMASK 15L -#undef com_artifex_mupdf_fitz_DisplayListDevice_BLEND_ISOLATED -#define com_artifex_mupdf_fitz_DisplayListDevice_BLEND_ISOLATED 16L -#undef com_artifex_mupdf_fitz_DisplayListDevice_BLEND_KNOCKOUT -#define com_artifex_mupdf_fitz_DisplayListDevice_BLEND_KNOCKOUT 32L -#undef com_artifex_mupdf_fitz_DisplayListDevice_IGNORE_IMAGE -#define com_artifex_mupdf_fitz_DisplayListDevice_IGNORE_IMAGE 1L -#undef com_artifex_mupdf_fitz_DisplayListDevice_IGNORE_SHADE -#define com_artifex_mupdf_fitz_DisplayListDevice_IGNORE_SHADE 2L /* * Class: com_artifex_mupdf_fitz_DisplayListDevice * Method: newNative @@ -793,28 +729,6 @@ JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_DocumentWriter_close #ifdef __cplusplus extern "C" { #endif -#undef com_artifex_mupdf_fitz_DrawDevice_FLAG_MASK -#define com_artifex_mupdf_fitz_DrawDevice_FLAG_MASK 1L -#undef com_artifex_mupdf_fitz_DrawDevice_FLAG_COLOR -#define com_artifex_mupdf_fitz_DrawDevice_FLAG_COLOR 2L -#undef com_artifex_mupdf_fitz_DrawDevice_FLAG_UNCACHEABLE -#define com_artifex_mupdf_fitz_DrawDevice_FLAG_UNCACHEABLE 4L -#undef com_artifex_mupdf_fitz_DrawDevice_FLAG_FILLCOLOR_UNDEFINED -#define com_artifex_mupdf_fitz_DrawDevice_FLAG_FILLCOLOR_UNDEFINED 8L -#undef com_artifex_mupdf_fitz_DrawDevice_FLAG_STROKECOLOR_UNDEFINED -#define com_artifex_mupdf_fitz_DrawDevice_FLAG_STROKECOLOR_UNDEFINED 16L -#undef com_artifex_mupdf_fitz_DrawDevice_FLAG_STARTCAP_UNDEFINED -#define com_artifex_mupdf_fitz_DrawDevice_FLAG_STARTCAP_UNDEFINED 32L -#undef com_artifex_mupdf_fitz_DrawDevice_FLAG_DASHCAP_UNDEFINED -#define com_artifex_mupdf_fitz_DrawDevice_FLAG_DASHCAP_UNDEFINED 64L -#undef com_artifex_mupdf_fitz_DrawDevice_FLAG_ENDCAP_UNDEFINED -#define com_artifex_mupdf_fitz_DrawDevice_FLAG_ENDCAP_UNDEFINED 128L -#undef com_artifex_mupdf_fitz_DrawDevice_FLAG_LINEJOIN_UNDEFINED -#define com_artifex_mupdf_fitz_DrawDevice_FLAG_LINEJOIN_UNDEFINED 256L -#undef com_artifex_mupdf_fitz_DrawDevice_FLAG_MITERLIMIT_UNDEFINED -#define com_artifex_mupdf_fitz_DrawDevice_FLAG_MITERLIMIT_UNDEFINED 512L -#undef com_artifex_mupdf_fitz_DrawDevice_FLAG_LINEWIDTH_UNDEFINED -#define com_artifex_mupdf_fitz_DrawDevice_FLAG_LINEWIDTH_UNDEFINED 1024L #undef com_artifex_mupdf_fitz_DrawDevice_BLEND_NORMAL #define com_artifex_mupdf_fitz_DrawDevice_BLEND_NORMAL 0L #undef com_artifex_mupdf_fitz_DrawDevice_BLEND_MULTIPLY @@ -847,16 +761,6 @@ extern "C" { #define com_artifex_mupdf_fitz_DrawDevice_BLEND_COLOR 14L #undef com_artifex_mupdf_fitz_DrawDevice_BLEND_LUMINOSITY #define com_artifex_mupdf_fitz_DrawDevice_BLEND_LUMINOSITY 15L -#undef com_artifex_mupdf_fitz_DrawDevice_BLEND_MODEMASK -#define com_artifex_mupdf_fitz_DrawDevice_BLEND_MODEMASK 15L -#undef com_artifex_mupdf_fitz_DrawDevice_BLEND_ISOLATED -#define com_artifex_mupdf_fitz_DrawDevice_BLEND_ISOLATED 16L -#undef com_artifex_mupdf_fitz_DrawDevice_BLEND_KNOCKOUT -#define com_artifex_mupdf_fitz_DrawDevice_BLEND_KNOCKOUT 32L -#undef com_artifex_mupdf_fitz_DrawDevice_IGNORE_IMAGE -#define com_artifex_mupdf_fitz_DrawDevice_IGNORE_IMAGE 1L -#undef com_artifex_mupdf_fitz_DrawDevice_IGNORE_SHADE -#define com_artifex_mupdf_fitz_DrawDevice_IGNORE_SHADE 2L /* * Class: com_artifex_mupdf_fitz_DrawDevice * Method: newNative @@ -1097,28 +1001,6 @@ extern "C" { #ifdef __cplusplus extern "C" { #endif -#undef com_artifex_mupdf_fitz_NativeDevice_FLAG_MASK -#define com_artifex_mupdf_fitz_NativeDevice_FLAG_MASK 1L -#undef com_artifex_mupdf_fitz_NativeDevice_FLAG_COLOR -#define com_artifex_mupdf_fitz_NativeDevice_FLAG_COLOR 2L -#undef com_artifex_mupdf_fitz_NativeDevice_FLAG_UNCACHEABLE -#define com_artifex_mupdf_fitz_NativeDevice_FLAG_UNCACHEABLE 4L -#undef com_artifex_mupdf_fitz_NativeDevice_FLAG_FILLCOLOR_UNDEFINED -#define com_artifex_mupdf_fitz_NativeDevice_FLAG_FILLCOLOR_UNDEFINED 8L -#undef com_artifex_mupdf_fitz_NativeDevice_FLAG_STROKECOLOR_UNDEFINED -#define com_artifex_mupdf_fitz_NativeDevice_FLAG_STROKECOLOR_UNDEFINED 16L -#undef com_artifex_mupdf_fitz_NativeDevice_FLAG_STARTCAP_UNDEFINED -#define com_artifex_mupdf_fitz_NativeDevice_FLAG_STARTCAP_UNDEFINED 32L -#undef com_artifex_mupdf_fitz_NativeDevice_FLAG_DASHCAP_UNDEFINED -#define com_artifex_mupdf_fitz_NativeDevice_FLAG_DASHCAP_UNDEFINED 64L -#undef com_artifex_mupdf_fitz_NativeDevice_FLAG_ENDCAP_UNDEFINED -#define com_artifex_mupdf_fitz_NativeDevice_FLAG_ENDCAP_UNDEFINED 128L -#undef com_artifex_mupdf_fitz_NativeDevice_FLAG_LINEJOIN_UNDEFINED -#define com_artifex_mupdf_fitz_NativeDevice_FLAG_LINEJOIN_UNDEFINED 256L -#undef com_artifex_mupdf_fitz_NativeDevice_FLAG_MITERLIMIT_UNDEFINED -#define com_artifex_mupdf_fitz_NativeDevice_FLAG_MITERLIMIT_UNDEFINED 512L -#undef com_artifex_mupdf_fitz_NativeDevice_FLAG_LINEWIDTH_UNDEFINED -#define com_artifex_mupdf_fitz_NativeDevice_FLAG_LINEWIDTH_UNDEFINED 1024L #undef com_artifex_mupdf_fitz_NativeDevice_BLEND_NORMAL #define com_artifex_mupdf_fitz_NativeDevice_BLEND_NORMAL 0L #undef com_artifex_mupdf_fitz_NativeDevice_BLEND_MULTIPLY @@ -1151,16 +1033,6 @@ extern "C" { #define com_artifex_mupdf_fitz_NativeDevice_BLEND_COLOR 14L #undef com_artifex_mupdf_fitz_NativeDevice_BLEND_LUMINOSITY #define com_artifex_mupdf_fitz_NativeDevice_BLEND_LUMINOSITY 15L -#undef com_artifex_mupdf_fitz_NativeDevice_BLEND_MODEMASK -#define com_artifex_mupdf_fitz_NativeDevice_BLEND_MODEMASK 15L -#undef com_artifex_mupdf_fitz_NativeDevice_BLEND_ISOLATED -#define com_artifex_mupdf_fitz_NativeDevice_BLEND_ISOLATED 16L -#undef com_artifex_mupdf_fitz_NativeDevice_BLEND_KNOCKOUT -#define com_artifex_mupdf_fitz_NativeDevice_BLEND_KNOCKOUT 32L -#undef com_artifex_mupdf_fitz_NativeDevice_IGNORE_IMAGE -#define com_artifex_mupdf_fitz_NativeDevice_IGNORE_IMAGE 1L -#undef com_artifex_mupdf_fitz_NativeDevice_IGNORE_SHADE -#define com_artifex_mupdf_fitz_NativeDevice_IGNORE_SHADE 2L /* * Class: com_artifex_mupdf_fitz_NativeDevice * Method: finalize @@ -1308,10 +1180,10 @@ JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_NativeDevice_endMask /* * Class: com_artifex_mupdf_fitz_NativeDevice * Method: beginGroup - * Signature: (Lcom/artifex/mupdf/fitz/Rect;ZZIF)V + * Signature: (Lcom/artifex/mupdf/fitz/Rect;Lcom/artifex/mupdf/fitz/ColorSpace;ZZIF)V */ JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_NativeDevice_beginGroup - (JNIEnv *, jobject, jobject, jboolean, jboolean, jint, jfloat); + (JNIEnv *, jobject, jobject, jobject, jboolean, jboolean, jint, jfloat); /* * Class: com_artifex_mupdf_fitz_NativeDevice @@ -3092,22 +2964,22 @@ JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Shade_finalize #ifdef __cplusplus extern "C" { #endif -#undef com_artifex_mupdf_fitz_StrokeState_LINECAP_BUTT -#define com_artifex_mupdf_fitz_StrokeState_LINECAP_BUTT 0L -#undef com_artifex_mupdf_fitz_StrokeState_LINECAP_ROUND -#define com_artifex_mupdf_fitz_StrokeState_LINECAP_ROUND 1L -#undef com_artifex_mupdf_fitz_StrokeState_LINECAP_SQUARE -#define com_artifex_mupdf_fitz_StrokeState_LINECAP_SQUARE 2L -#undef com_artifex_mupdf_fitz_StrokeState_LINECAP_TRIANGLE -#define com_artifex_mupdf_fitz_StrokeState_LINECAP_TRIANGLE 3L -#undef com_artifex_mupdf_fitz_StrokeState_LINEJOIN_MITER -#define com_artifex_mupdf_fitz_StrokeState_LINEJOIN_MITER 0L -#undef com_artifex_mupdf_fitz_StrokeState_LINEJOIN_ROUND -#define com_artifex_mupdf_fitz_StrokeState_LINEJOIN_ROUND 1L -#undef com_artifex_mupdf_fitz_StrokeState_LINEJOIN_BEVEL -#define com_artifex_mupdf_fitz_StrokeState_LINEJOIN_BEVEL 2L -#undef com_artifex_mupdf_fitz_StrokeState_LINEJOIN_MITER_XPS -#define com_artifex_mupdf_fitz_StrokeState_LINEJOIN_MITER_XPS 3L +#undef com_artifex_mupdf_fitz_StrokeState_LINE_CAP_BUTT +#define com_artifex_mupdf_fitz_StrokeState_LINE_CAP_BUTT 0L +#undef com_artifex_mupdf_fitz_StrokeState_LINE_CAP_ROUND +#define com_artifex_mupdf_fitz_StrokeState_LINE_CAP_ROUND 1L +#undef com_artifex_mupdf_fitz_StrokeState_LINE_CAP_SQUARE +#define com_artifex_mupdf_fitz_StrokeState_LINE_CAP_SQUARE 2L +#undef com_artifex_mupdf_fitz_StrokeState_LINE_CAP_TRIANGLE +#define com_artifex_mupdf_fitz_StrokeState_LINE_CAP_TRIANGLE 3L +#undef com_artifex_mupdf_fitz_StrokeState_LINE_JOIN_MITER +#define com_artifex_mupdf_fitz_StrokeState_LINE_JOIN_MITER 0L +#undef com_artifex_mupdf_fitz_StrokeState_LINE_JOIN_ROUND +#define com_artifex_mupdf_fitz_StrokeState_LINE_JOIN_ROUND 1L +#undef com_artifex_mupdf_fitz_StrokeState_LINE_JOIN_BEVEL +#define com_artifex_mupdf_fitz_StrokeState_LINE_JOIN_BEVEL 2L +#undef com_artifex_mupdf_fitz_StrokeState_LINE_JOIN_MITER_XPS +#define com_artifex_mupdf_fitz_StrokeState_LINE_JOIN_MITER_XPS 3L /* * Class: com_artifex_mupdf_fitz_StrokeState * Method: finalize diff --git a/platform/java/src/com/artifex/mupdf/fitz/Device.java b/platform/java/src/com/artifex/mupdf/fitz/Device.java index 0386cac7..d56a41ad 100644 --- a/platform/java/src/com/artifex/mupdf/fitz/Device.java +++ b/platform/java/src/com/artifex/mupdf/fitz/Device.java @@ -61,19 +61,6 @@ abstract public class Device abstract public void beginLayer(String name); abstract public void endLayer(); - /* Flags */ - public static final int FLAG_MASK = 1; - public static final int FLAG_COLOR = 2; - public static final int FLAG_UNCACHEABLE = 4; - public static final int FLAG_FILLCOLOR_UNDEFINED = 8; - public static final int FLAG_STROKECOLOR_UNDEFINED = 16; - public static final int FLAG_STARTCAP_UNDEFINED = 32; - public static final int FLAG_DASHCAP_UNDEFINED = 64; - public static final int FLAG_ENDCAP_UNDEFINED = 128; - public static final int FLAG_LINEJOIN_UNDEFINED = 256; - public static final int FLAG_MITERLIMIT_UNDEFINED = 512; - public static final int FLAG_LINEWIDTH_UNDEFINED = 1024; - /* PDF 1.4 -- standard separable */ public static final int BLEND_NORMAL = 0; public static final int BLEND_MULTIPLY = 1; @@ -93,13 +80,4 @@ abstract public class Device public static final int BLEND_SATURATION = 13; public static final int BLEND_COLOR = 14; public static final int BLEND_LUMINOSITY = 15; - - /* For packing purposes */ - public static final int BLEND_MODEMASK = 15; - public static final int BLEND_ISOLATED = 16; - public static final int BLEND_KNOCKOUT = 32; - - /* Device hints */ - public static final int IGNORE_IMAGE = 1; - public static final int IGNORE_SHADE = 2; } diff --git a/platform/java/src/com/artifex/mupdf/fitz/StrokeState.java b/platform/java/src/com/artifex/mupdf/fitz/StrokeState.java index 815729c9..c8351808 100644 --- a/platform/java/src/com/artifex/mupdf/fitz/StrokeState.java +++ b/platform/java/src/com/artifex/mupdf/fitz/StrokeState.java @@ -6,15 +6,15 @@ public class StrokeState Context.init(); } - public static final int LINECAP_BUTT = 0; - public static final int LINECAP_ROUND = 1; - public static final int LINECAP_SQUARE = 2; - public static final int LINECAP_TRIANGLE = 3; - - public static final int LINEJOIN_MITER = 0; - public static final int LINEJOIN_ROUND = 1; - public static final int LINEJOIN_BEVEL = 2; - public static final int LINEJOIN_MITER_XPS = 3; + public static final int LINE_CAP_BUTT = 0; + public static final int LINE_CAP_ROUND = 1; + public static final int LINE_CAP_SQUARE = 2; + public static final int LINE_CAP_TRIANGLE = 3; + + public static final int LINE_JOIN_MITER = 0; + public static final int LINE_JOIN_ROUND = 1; + public static final int LINE_JOIN_BEVEL = 2; + public static final int LINE_JOIN_MITER_XPS = 3; private long pointer; -- cgit v1.2.3