From e5720af140822099b4f309e98ca5d269af4f8aee Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 15 Feb 2018 16:12:28 +0100 Subject: Remove typedef in favor of explicit enum keyword. Avoids the silliness of fz_annot_type pdf_annot_type(). --- include/mupdf/pdf/annot.h | 8 ++++---- include/mupdf/pdf/appearance.h | 2 +- source/pdf/pdf-annot-edit.c | 4 ++-- source/pdf/pdf-appearance.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/mupdf/pdf/annot.h b/include/mupdf/pdf/annot.h index c55f22c5..576ab310 100644 --- a/include/mupdf/pdf/annot.h +++ b/include/mupdf/pdf/annot.h @@ -1,7 +1,7 @@ #ifndef MUPDF_PDF_ANNOT_H #define MUPDF_PDF_ANNOT_H -typedef enum +enum pdf_annot_type { PDF_ANNOT_TEXT, PDF_ANNOT_LINK, @@ -29,9 +29,9 @@ typedef enum PDF_ANNOT_WATERMARK, PDF_ANNOT_3D, PDF_ANNOT_UNKNOWN = -1 -} fz_annot_type; +}; -const char *pdf_string_from_annot_type(fz_context *ctx, fz_annot_type 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 @@ -130,7 +130,7 @@ void pdf_drop_annots(fz_context *ctx, pdf_annot *annot_list); specified page. The returned pdf_annot structure is owned by the page and does not need to be freed. */ -pdf_annot *pdf_create_annot(fz_context *ctx, pdf_page *page, fz_annot_type type); +pdf_annot *pdf_create_annot(fz_context *ctx, pdf_page *page, enum pdf_annot_type type); /* pdf_delete_annot: delete an annotation diff --git a/include/mupdf/pdf/appearance.h b/include/mupdf/pdf/appearance.h index 53d29636..7aa5058a 100644 --- a/include/mupdf/pdf/appearance.h +++ b/include/mupdf/pdf/appearance.h @@ -17,7 +17,7 @@ void pdf_update_text_appearance(fz_context *ctx, pdf_document *doc, pdf_obj *obj void pdf_update_combobox_appearance(fz_context *ctx, pdf_document *doc, pdf_obj *obj); void pdf_update_listbox_appearance(fz_context *ctx, pdf_document *doc, pdf_obj *obj); void pdf_update_pushbutton_appearance(fz_context *ctx, pdf_document *doc, pdf_obj *obj); -void pdf_update_text_markup_appearance(fz_context *ctx, pdf_document *doc, pdf_annot *annot, fz_annot_type type); +void pdf_update_text_markup_appearance(fz_context *ctx, pdf_document *doc, pdf_annot *annot, enum pdf_annot_type type); void pdf_update_ink_appearance(fz_context *ctx, pdf_document *doc, pdf_annot *annot); void pdf_update_text_annot_appearance(fz_context *ctx, pdf_document *doc, pdf_annot *annot); /* diff --git a/source/pdf/pdf-annot-edit.c b/source/pdf/pdf-annot-edit.c index 5142b8c1..e6f5f0d7 100644 --- a/source/pdf/pdf-annot-edit.c +++ b/source/pdf/pdf-annot-edit.c @@ -13,7 +13,7 @@ #define isdigit(c) (c >= '0' && c <= '9') const char * -pdf_string_from_annot_type(fz_context *ctx, fz_annot_type type) +pdf_string_from_annot_type(fz_context *ctx, enum pdf_annot_type type) { switch (type) { @@ -97,7 +97,7 @@ static void check_allowed_subtypes(fz_context *ctx, pdf_annot *annot, pdf_obj *p } pdf_annot * -pdf_create_annot(fz_context *ctx, pdf_page *page, fz_annot_type type) +pdf_create_annot(fz_context *ctx, pdf_page *page, enum pdf_annot_type type) { pdf_annot *annot = NULL; pdf_document *doc = page->doc; diff --git a/source/pdf/pdf-appearance.c b/source/pdf/pdf-appearance.c index 685ef8dc..2355637f 100644 --- a/source/pdf/pdf-appearance.c +++ b/source/pdf/pdf-appearance.c @@ -1532,7 +1532,7 @@ void pdf_update_pushbutton_appearance(fz_context *ctx, pdf_document *doc, pdf_ob } } -void pdf_update_text_markup_appearance(fz_context *ctx, pdf_document *doc, pdf_annot *annot, fz_annot_type type) +void pdf_update_text_markup_appearance(fz_context *ctx, pdf_document *doc, pdf_annot *annot, enum pdf_annot_type type) { float color[3]; float alpha; @@ -2460,7 +2460,7 @@ void pdf_update_appearance(fz_context *ctx, pdf_document *doc, pdf_annot *annot) if (!ap || !pdf_dict_get(ctx, ap, PDF_NAME_N) || pdf_obj_is_dirty(ctx, obj)) { - fz_annot_type type = pdf_annot_type(ctx, annot); + enum pdf_annot_type type = pdf_annot_type(ctx, annot); switch (type) { case PDF_ANNOT_WIDGET: -- cgit v1.2.3