summaryrefslogtreecommitdiff
path: root/platform/java
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-02-26 15:07:41 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-02-27 14:08:28 +0100
commitce03adbff727cfad99e7103068b73f7782cbc9f7 (patch)
tree0c64d468b357533bc2d26d7e6d7963f2a7406a06 /platform/java
parent51d84cb3b67ab17f2eae1530044d531320e6a5fa (diff)
downloadmupdf-ce03adbff727cfad99e7103068b73f7782cbc9f7.tar.xz
Improve line ending style accessors.
Diffstat (limited to 'platform/java')
-rw-r--r--platform/java/mupdf_native.c25
-rw-r--r--platform/java/mupdf_native.h16
-rw-r--r--platform/java/src/com/artifex/mupdf/fitz/PDFAnnotation.java8
3 files changed, 26 insertions, 23 deletions
diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c
index 69546564..29e87b8b 100644
--- a/platform/java/mupdf_native.c
+++ b/platform/java/mupdf_native.c
@@ -247,16 +247,16 @@ static int check_enums()
valid &= com_artifex_mupdf_fitz_PDFAnnotation_TYPE_3D == PDF_ANNOT_3D;
valid &= com_artifex_mupdf_fitz_PDFAnnotation_TYPE_UNKNOWN == PDF_ANNOT_UNKNOWN;
- valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_NONE == PDF_ANNOT_LINE_ENDING_NONE;
- valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_SQUARE == PDF_ANNOT_LINE_ENDING_SQUARE;
- valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_CIRCLE == PDF_ANNOT_LINE_ENDING_CIRCLE;
- valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_DIAMOND == PDF_ANNOT_LINE_ENDING_DIAMOND;
- valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_OPENARROW == PDF_ANNOT_LINE_ENDING_OPENARROW;
- valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_CLOSEDARROW == PDF_ANNOT_LINE_ENDING_CLOSEDARROW;
- valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_BUTT == PDF_ANNOT_LINE_ENDING_BUTT;
- valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_ROPENARR == PDF_ANNOT_LINE_ENDING_ROPENARROW;
- valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_RCLOSEDARROW == PDF_ANNOT_LINE_ENDING_RCLOSEDARROW;
- valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_SLASH == PDF_ANNOT_LINE_ENDING_SLASH;
+ valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_NONE == PDF_ANNOT_LE_NONE;
+ valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_SQUARE == PDF_ANNOT_LE_SQUARE;
+ valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_CIRCLE == PDF_ANNOT_LE_CIRCLE;
+ valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_DIAMOND == PDF_ANNOT_LE_DIAMOND;
+ valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_OPEN_ARROW == PDF_ANNOT_LE_OPEN_ARROW;
+ valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_CLOSED_ARROW == PDF_ANNOT_LE_CLOSED_ARROW;
+ valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_BUTT == PDF_ANNOT_LE_BUTT;
+ valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_R_OPEN_ARROW == PDF_ANNOT_LE_R_OPEN_ARROW;
+ valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_R_CLOSED_ARROW == PDF_ANNOT_LE_R_CLOSED_ARROW;
+ valid &= com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_SLASH == PDF_ANNOT_LE_SLASH;
return valid ? 1 : 0;
}
@@ -9379,16 +9379,19 @@ FUN(PDFAnnotation_getLineEndingStyles)(JNIEnv *env, jobject self)
{
fz_context *ctx = get_context(env);
pdf_annot *annot = from_PDFAnnotation(env, self);
+ enum pdf_line_ending s = 0, e = 0;
int line_endings[2];
jintArray jline_endings = NULL;
if (!ctx || !annot) return NULL;
fz_try(ctx)
- pdf_annot_line_ending_styles(ctx, annot, &line_endings[0], &line_endings[1]);
+ pdf_annot_line_ending_styles(ctx, annot, &s, &e);
fz_catch(ctx)
jni_rethrow(env, ctx);
+ line_endings[0] = s;
+ line_endings[1] = e;
jline_endings = (*env)->NewIntArray(env, 2);
(*env)->SetIntArrayRegion(env, jline_endings, 0, 2, &line_endings[0]);
if ((*env)->ExceptionCheck(env)) return NULL;
diff --git a/platform/java/mupdf_native.h b/platform/java/mupdf_native.h
index 2ccaf01f..8bfe3480 100644
--- a/platform/java/mupdf_native.h
+++ b/platform/java/mupdf_native.h
@@ -1423,16 +1423,16 @@ extern "C" {
#define com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_CIRCLE 2L
#undef com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_DIAMOND
#define com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_DIAMOND 3L
-#undef com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_OPENARROW
-#define com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_OPENARROW 4L
-#undef com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_CLOSEDARROW
-#define com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_CLOSEDARROW 5L
+#undef com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_OPEN_ARROW
+#define com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_OPEN_ARROW 4L
+#undef com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_CLOSED_ARROW
+#define com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_CLOSED_ARROW 5L
#undef com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_BUTT
#define com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_BUTT 6L
-#undef com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_ROPENARR
-#define com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_ROPENARR 7L
-#undef com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_RCLOSEDARROW
-#define com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_RCLOSEDARROW 8L
+#undef com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_R_OPEN_ARROW
+#define com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_R_OPEN_ARROW 7L
+#undef com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_R_CLOSED_ARROW
+#define com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_R_CLOSED_ARROW 8L
#undef com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_SLASH
#define com_artifex_mupdf_fitz_PDFAnnotation_LINE_ENDING_SLASH 9L
/*
diff --git a/platform/java/src/com/artifex/mupdf/fitz/PDFAnnotation.java b/platform/java/src/com/artifex/mupdf/fitz/PDFAnnotation.java
index 52a433de..2e4a83cd 100644
--- a/platform/java/src/com/artifex/mupdf/fitz/PDFAnnotation.java
+++ b/platform/java/src/com/artifex/mupdf/fitz/PDFAnnotation.java
@@ -42,11 +42,11 @@ public class PDFAnnotation extends Annotation
public static final int LINE_ENDING_SQUARE = 1;
public static final int LINE_ENDING_CIRCLE = 2;
public static final int LINE_ENDING_DIAMOND = 3;
- public static final int LINE_ENDING_OPENARROW = 4;
- public static final int LINE_ENDING_CLOSEDARROW = 5;
+ public static final int LINE_ENDING_OPEN_ARROW = 4;
+ public static final int LINE_ENDING_CLOSED_ARROW = 5;
public static final int LINE_ENDING_BUTT = 6;
- public static final int LINE_ENDING_ROPENARR = 7;
- public static final int LINE_ENDING_RCLOSEDARROW = 8;
+ public static final int LINE_ENDING_R_OPEN_ARROW = 7;
+ public static final int LINE_ENDING_R_CLOSED_ARROW = 8;
public static final int LINE_ENDING_SLASH = 9;
public native int getType();