diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-02-26 15:07:41 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-02-27 14:08:28 +0100 |
commit | ce03adbff727cfad99e7103068b73f7782cbc9f7 (patch) | |
tree | 0c64d468b357533bc2d26d7e6d7963f2a7406a06 /include | |
parent | 51d84cb3b67ab17f2eae1530044d531320e6a5fa (diff) | |
download | mupdf-ce03adbff727cfad99e7103068b73f7782cbc9f7.tar.xz |
Improve line ending style accessors.
Diffstat (limited to 'include')
-rw-r--r-- | include/mupdf/pdf/annot.h | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/include/mupdf/pdf/annot.h b/include/mupdf/pdf/annot.h index 1fb0ab0e..4c3a8b75 100644 --- a/include/mupdf/pdf/annot.h +++ b/include/mupdf/pdf/annot.h @@ -32,7 +32,7 @@ enum pdf_annot_type }; const char *pdf_string_from_annot_type(fz_context *ctx, enum pdf_annot_type type); -int pdf_annot_type_from_string(fz_context *ctx, const char *subtype); +enum pdf_annot_type pdf_annot_type_from_string(fz_context *ctx, const char *subtype); enum { @@ -48,20 +48,25 @@ enum PDF_ANNOT_IS_LOCKED_CONTENTS = 1 << (10-1) }; -enum +enum pdf_line_ending { - PDF_ANNOT_LINE_ENDING_NONE = 0, - PDF_ANNOT_LINE_ENDING_SQUARE, - PDF_ANNOT_LINE_ENDING_CIRCLE, - PDF_ANNOT_LINE_ENDING_DIAMOND, - PDF_ANNOT_LINE_ENDING_OPENARROW, - PDF_ANNOT_LINE_ENDING_CLOSEDARROW, - PDF_ANNOT_LINE_ENDING_BUTT, - PDF_ANNOT_LINE_ENDING_ROPENARROW, - PDF_ANNOT_LINE_ENDING_RCLOSEDARROW, - PDF_ANNOT_LINE_ENDING_SLASH + PDF_ANNOT_LE_NONE = 0, + PDF_ANNOT_LE_SQUARE, + PDF_ANNOT_LE_CIRCLE, + PDF_ANNOT_LE_DIAMOND, + PDF_ANNOT_LE_OPEN_ARROW, + PDF_ANNOT_LE_CLOSED_ARROW, + PDF_ANNOT_LE_BUTT, + PDF_ANNOT_LE_R_OPEN_ARROW, + PDF_ANNOT_LE_R_CLOSED_ARROW, + PDF_ANNOT_LE_SLASH }; +enum pdf_line_ending pdf_line_ending_from_name(fz_context *ctx, pdf_obj *end); +enum pdf_line_ending pdf_line_ending_from_string(fz_context *ctx, const char *end); +pdf_obj *pdf_name_from_line_ending(fz_context *ctx, enum pdf_line_ending end); +const char *pdf_string_from_line_ending(fz_context *ctx, enum pdf_line_ending end); + /* pdf_first_annot: Return the first annotation on a page. */ @@ -174,11 +179,11 @@ void pdf_set_annot_ink_list(fz_context *ctx, pdf_annot *annot, int n, const int void pdf_clear_annot_ink_list(fz_context *ctx, pdf_annot *annot); void pdf_add_annot_ink_list(fz_context *ctx, pdf_annot *annot, int n, fz_point stroke[]); -void pdf_set_annot_line_ending_styles(fz_context *ctx, pdf_annot *annot, int start_style, int end_style); +void pdf_set_annot_line_ending_styles(fz_context *ctx, pdf_annot *annot, enum pdf_line_ending start_style, enum pdf_line_ending end_style); void pdf_set_annot_icon_name(fz_context *ctx, pdf_annot *annot, const char *name); void pdf_set_annot_is_open(fz_context *ctx, pdf_annot *annot, int is_open); -void pdf_annot_line_ending_styles(fz_context *ctx, pdf_annot *annot, int *start_style, int *end_style); +void pdf_annot_line_ending_styles(fz_context *ctx, pdf_annot *annot, enum pdf_line_ending *start_style, enum pdf_line_ending *end_style); const char *pdf_annot_icon_name(fz_context *ctx, pdf_annot *annot); int pdf_annot_is_open(fz_context *ctx, pdf_annot *annot); |