summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-09-22 16:00:21 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-10-07 17:22:58 +0200
commit8e244f7e2add3606283c0c797d75067fd01ad740 (patch)
tree1d3d70646b637792865c0b14be37127eb5eef250 /include
parent170f35a5802ec7093b00fb2e39bbde3756516f15 (diff)
downloadmupdf-8e244f7e2add3606283c0c797d75067fd01ad740.tar.xz
Remove separate tmp/deleted/changed annotation lists.
Use a flag in the pdf_annot struct instead. Don't pass pdf_document to annotation edit functions.
Diffstat (limited to 'include')
-rw-r--r--include/mupdf/pdf/annot.h17
-rw-r--r--include/mupdf/pdf/document.h4
-rw-r--r--include/mupdf/pdf/page.h9
3 files changed, 10 insertions, 20 deletions
diff --git a/include/mupdf/pdf/annot.h b/include/mupdf/pdf/annot.h
index a7a83348..8aeae76c 100644
--- a/include/mupdf/pdf/annot.h
+++ b/include/mupdf/pdf/annot.h
@@ -93,8 +93,9 @@ struct pdf_annot_s
pdf_xobject *ap;
int ap_iteration;
+ int changed;
+
pdf_annot *next;
- pdf_annot *next_changed;
};
fz_link_dest pdf_parse_link_dest(fz_context *ctx, pdf_document *doc, fz_link_kind kind, pdf_obj *dest);
@@ -107,8 +108,8 @@ pdf_obj *pdf_load_name_tree(fz_context *ctx, pdf_document *doc, pdf_obj *which);
fz_link *pdf_load_link_annots(fz_context *ctx, pdf_document *, pdf_obj *annots, const fz_matrix *page_ctm);
void pdf_annot_transform(fz_context *ctx, pdf_annot *annot, fz_matrix *annot_ctm);
-void pdf_load_annots(fz_context *ctx, pdf_document *, pdf_page *page, pdf_obj *annots);
-void pdf_update_annot(fz_context *ctx, pdf_document *, pdf_annot *annot);
+void pdf_load_annots(fz_context *ctx, pdf_page *page, pdf_obj *annots);
+void pdf_update_annot(fz_context *ctx, pdf_annot *annot);
void pdf_drop_annots(fz_context *ctx, pdf_annot *annot_list);
/*
@@ -116,12 +117,12 @@ 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_document *doc, pdf_page *page, fz_annot_type type);
+pdf_annot *pdf_create_annot(fz_context *ctx, pdf_page *page, fz_annot_type type);
/*
pdf_delete_annot: delete an annotation
*/
-void pdf_delete_annot(fz_context *ctx, pdf_document *doc, pdf_page *page, pdf_annot *annot);
+void pdf_delete_annot(fz_context *ctx, pdf_page *page, pdf_annot *annot);
/*
pdf_set_markup_annot_quadpoints: set the quadpoints for a text-markup annotation.
@@ -171,12 +172,6 @@ pdf_obj *pdf_annot_irt(fz_context *ctx, pdf_annot *annot);
void pdf_set_free_text_details(fz_context *ctx, pdf_document *doc, pdf_annot *annot, fz_point *pos, char *text, char *font_name, float font_size, float color[3]);
/*
- pdf_poll_changed_annot: enumerate the changed annotations recorded
- by a call to pdf_update_page.
-*/
-pdf_annot *pdf_poll_changed_annot(fz_context *ctx, pdf_document *idoc, pdf_page *page);
-
-/*
pdf_new_annot: Internal function for creating a new pdf annotation.
*/
pdf_annot *pdf_new_annot(fz_context *ctx, pdf_page *page);
diff --git a/include/mupdf/pdf/document.h b/include/mupdf/pdf/document.h
index 0078c4a9..5b9632ff 100644
--- a/include/mupdf/pdf/document.h
+++ b/include/mupdf/pdf/document.h
@@ -140,7 +140,7 @@ struct pdf_ocg_descriptor_s
are out of date, checks for cases where different appearance streams
should be selected because of state changes, and records internally
each annotation that has changed appearance. The list of changed annotations
- is then available via pdf_poll_changed_annot. Note that a call to
+ is then available via querying the annot->changed flag. Note that a call to
pdf_pass_event for one page may lead to changes on any other, so an app
should call pdf_update_page for every page it currently displays. Also
it is important that the pdf_page object is the one used to last render
@@ -148,7 +148,7 @@ struct pdf_ocg_descriptor_s
a call to pdf_update_page would not reliably be able to report all changed
areas.
*/
-void pdf_update_page(fz_context *ctx, pdf_document *doc, pdf_page *page);
+void pdf_update_page(fz_context *ctx, pdf_page *page);
/*
Determine whether changes have been made since the
diff --git a/include/mupdf/pdf/page.h b/include/mupdf/pdf/page.h
index e3efb1e7..a5a60be8 100644
--- a/include/mupdf/pdf/page.h
+++ b/include/mupdf/pdf/page.h
@@ -175,15 +175,10 @@ struct pdf_page_s
pdf_obj *obj;
int transparency;
+ int incomplete;
fz_link *links;
- pdf_annot *annots;
- pdf_annot **annot_tailp;
- pdf_annot *changed_annots;
- pdf_annot *deleted_annots;
- pdf_annot *tmp_annots;
-
- int incomplete;
+ pdf_annot *annots, **annot_tailp;
};
enum