diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-06-19 16:46:32 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-06-20 10:34:21 +0100 |
commit | 8ab661d54fe25afc058cdef6f00a130778c7c416 (patch) | |
tree | 19d9b9667ffaa1ef42a5b1560df2c17f9db4730c /pdf/mupdf.h | |
parent | f18dc92eb8014b335afdb720a8f5bc9c3bd7ceb7 (diff) | |
download | mupdf-8ab661d54fe25afc058cdef6f00a130778c7c416.tar.xz |
Add better mechanism for enumerating annotation rectangles.
Rather than having a dedicated call to enumerate the rectangles for the
annotations on a page, add an interface for enumerating annotations
with accessor functions. Currently the only accessor function is
the one to get the annotation rectangle.
Use this new scheme in place of fz_bound_annots within mudraw.
Also use this scheme to set the caret cursor in the viewer when over
a data field.
Diffstat (limited to 'pdf/mupdf.h')
-rw-r--r-- | pdf/mupdf.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/pdf/mupdf.h b/pdf/mupdf.h index d7cf85f7..c2566c02 100644 --- a/pdf/mupdf.h +++ b/pdf/mupdf.h @@ -232,14 +232,28 @@ fz_rect pdf_bound_page(pdf_document *doc, pdf_page *page); */ void pdf_free_page(pdf_document *doc, pdf_page *page); +typedef struct pdf_annot_s pdf_annot; + /* - pdf_bound_annots: Bound the annotations on a page. + pdf_first_annot: Return the first annotation on a page. + + Does not throw exceptions. +*/ +pdf_annot *pdf_first_annot(pdf_document *doc, pdf_page *page); - (Temporary function - do not rely on this remaining in future) +/* + pdf_next_annot: Return the next annotation on a page. - Does not throw exceptions (unless the callback does). + Does not throw exceptions. +*/ +pdf_annot *pdf_next_annot(pdf_document *doc, pdf_annot *annot); + +/* + pdf_bound_annot: Return the rectangle for an annotation on a page. + + Does not throw exceptions. */ -void pdf_bound_annots(pdf_document *doc, pdf_page *page, void(*callback)(void *arg, fz_rect *), void *arg); +fz_rect pdf_bound_annot(pdf_document *doc, pdf_annot *annot); /* pdf_run_page: Interpret a loaded page and render it on a device. |