From f07fedd90e5d08fba4687283a29760d08cde8d0c Mon Sep 17 00:00:00 2001 From: Paul Gardiner Date: Fri, 21 Jun 2013 13:41:37 +0100 Subject: Update annotation handling in preparation for incremental update When incremental update is in place, functions that alter one structure may have the side-effect of altering another: i.e., updating an annotation may require the Annots array or even the page to be cloned. This commit makes the existing annotation code hardy to this eventuallity. It also cleans up a slight mess of the past where not all annotation-altering functions had access to the pdf_annot struture, instead having to work with just the pdf object. --- include/mupdf/pdf/annot.h | 4 +--- include/mupdf/pdf/document.h | 2 +- include/mupdf/pdf/resource.h | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/mupdf/pdf/annot.h b/include/mupdf/pdf/annot.h index fb5c6f1b..74a68ae0 100644 --- a/include/mupdf/pdf/annot.h +++ b/include/mupdf/pdf/annot.h @@ -91,8 +91,6 @@ void pdf_set_annot_appearance(pdf_document *doc, pdf_annot *annot, fz_rect *rect */ void pdf_set_markup_annot_quadpoints(pdf_document *doc, pdf_annot *annot, fz_point *qp, int n); -void pdf_set_markup_obj_appearance(pdf_document *doc, pdf_obj *annot, float color[3], float alpha, float line_thickness, float line_height); - /* fz_set_markup_appearance: set the appearance stream of a text markup annotations, basing it on its QuadPoints array @@ -104,7 +102,7 @@ void pdf_set_markup_appearance(pdf_document *doc, pdf_annot *annot, float color[ are carried in a single array, with the counts for each arc held in a secondary array. */ void pdf_set_ink_annot_list(pdf_document *doc, pdf_annot *annot, fz_point *pts, int *counts, int ncount, float color[3], float thickness); -void pdf_set_ink_obj_appearance(pdf_document *doc, pdf_obj *annot); +void pdf_set_ink_appearance(pdf_document *doc, pdf_annot *annot); fz_annot_type pdf_annot_obj_type(pdf_obj *obj); diff --git a/include/mupdf/pdf/document.h b/include/mupdf/pdf/document.h index a8bc332a..a491e1de 100644 --- a/include/mupdf/pdf/document.h +++ b/include/mupdf/pdf/document.h @@ -201,7 +201,7 @@ struct pdf_document_s pdf_js *js; int recalculating; int dirty; - void (*update_appearance)(pdf_document *xref, pdf_obj *annot); + void (*update_appearance)(pdf_document *xref, pdf_annot *annot); pdf_doc_event_cb *event_cb; void *event_cb_data; diff --git a/include/mupdf/pdf/resource.h b/include/mupdf/pdf/resource.h index b52a1589..ff2f5218 100644 --- a/include/mupdf/pdf/resource.h +++ b/include/mupdf/pdf/resource.h @@ -72,6 +72,6 @@ pdf_xobject *pdf_keep_xobject(fz_context *ctx, pdf_xobject *xobj); void pdf_drop_xobject(fz_context *ctx, pdf_xobject *xobj); void pdf_update_xobject_contents(pdf_document *xref, pdf_xobject *form, fz_buffer *buffer); -void pdf_update_appearance(pdf_document *doc, pdf_obj *obj); +void pdf_update_appearance(pdf_document *doc, pdf_annot *annot); #endif -- cgit v1.2.3