diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/mupdf/fitz/annotation.h | 4 | ||||
-rw-r--r-- | include/mupdf/fitz/document.h | 25 | ||||
-rw-r--r-- | include/mupdf/fitz/util.h | 2 | ||||
-rw-r--r-- | include/mupdf/pdf/annot.h | 7 |
4 files changed, 25 insertions, 13 deletions
diff --git a/include/mupdf/fitz/annotation.h b/include/mupdf/fitz/annotation.h index 122777de..82a902e6 100644 --- a/include/mupdf/fitz/annotation.h +++ b/include/mupdf/fitz/annotation.h @@ -52,13 +52,13 @@ fz_annot *fz_first_annot(fz_context *ctx, fz_page *page); Does not throw exceptions. */ -fz_annot *fz_next_annot(fz_context *ctx, fz_page *page, fz_annot *annot); +fz_annot *fz_next_annot(fz_context *ctx, fz_annot *annot); /* fz_bound_annot: Return the bounding rectangle of the annotation. Does not throw exceptions. */ -fz_rect *fz_bound_annot(fz_context *ctx, fz_page *page, fz_annot *annot, fz_rect *rect); +fz_rect *fz_bound_annot(fz_context *ctx, fz_annot *annot, fz_rect *rect); #endif diff --git a/include/mupdf/fitz/document.h b/include/mupdf/fitz/document.h index 32f5bba6..f8e67668 100644 --- a/include/mupdf/fitz/document.h +++ b/include/mupdf/fitz/document.h @@ -43,15 +43,24 @@ typedef void (fz_page_drop_page_imp_fn)(fz_context *ctx, fz_page *page); typedef fz_transition *(fz_page_page_presentation_fn)(fz_context *ctx, fz_page *page, float *duration); typedef fz_annot *(fz_page_first_annot_fn)(fz_context *ctx, fz_page *page); -typedef fz_annot *(fz_page_next_annot_fn)(fz_context *ctx, fz_page *page, fz_annot *annot); -typedef fz_rect *(fz_page_bound_annot_fn)(fz_context *ctx, fz_page *page, fz_annot *annot, fz_rect *rect); -typedef void (fz_page_run_annot_fn)(fz_context *ctx, fz_page *page, fz_annot *annot, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie); typedef void (fz_page_control_separation_fn)(fz_context *ctx, fz_page *page, int separation, int disable); typedef int (fz_page_separation_disabled_fn)(fz_context *ctx, fz_page *page, int separation); typedef int (fz_page_count_separations_fn)(fz_context *ctx, fz_page *page); typedef const char *(fz_page_get_separation_fn)(fz_context *ctx, fz_page *page, int separation, uint32_t *rgb, uint32_t *cmyk); +typedef fz_annot *(fz_annot_next_fn)(fz_context *ctx, fz_annot *annot); +typedef fz_rect *(fz_annot_bound_fn)(fz_context *ctx, fz_annot *annot, fz_rect *rect); +typedef void (fz_annot_run_fn)(fz_context *ctx, fz_annot *annot, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie); + +struct fz_annot_s +{ + int refs; + fz_annot_bound_fn *bound_annot; + fz_annot_run_fn *run_annot; + fz_annot_next_fn *next_annot; +}; + struct fz_page_s { int refs; @@ -60,9 +69,6 @@ struct fz_page_s fz_page_run_page_contents_fn *run_page_contents; fz_page_load_links_fn *load_links; fz_page_first_annot_fn *first_annot; - fz_page_next_annot_fn *next_annot; - fz_page_bound_annot_fn *bound_annot; - fz_page_run_annot_fn *run_annot; fz_page_page_presentation_fn *page_presentation; fz_page_control_separation_fn *control_separation; fz_page_separation_disabled_fn *separation_disabled; @@ -294,7 +300,7 @@ void fz_run_page_contents(fz_context *ctx, fz_page *page, fz_device *dev, const fields inside cookie are continually updated while the page is rendering. */ -void fz_run_annot(fz_context *ctx, fz_page *page, fz_annot *annot, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie); +void fz_run_annot(fz_context *ctx, fz_annot *annot, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie); /* fz_keep_page: Keep a reference to a loaded page. @@ -311,6 +317,11 @@ fz_page *fz_keep_page(fz_context *ctx, fz_page *page); void fz_drop_page(fz_context *ctx, fz_page *page); /* + fz_new_annot: Create and initialize an annotation struct. +*/ +void *fz_new_annot(fz_context *ctx, int size); + +/* fz_page_presentation: Get the presentation details for a given page. duration: NULL, or a pointer to a place to set the page duration in diff --git a/include/mupdf/fitz/util.h b/include/mupdf/fitz/util.h index 96c9e7a8..ffc13382 100644 --- a/include/mupdf/fitz/util.h +++ b/include/mupdf/fitz/util.h @@ -31,7 +31,7 @@ fz_pixmap *fz_new_pixmap_from_page_contents(fz_context *ctx, fz_page *page, cons fz_new_pixmap_from_annot: Render an annotation to a transparent pixmap, suitable for blending on top of the opaque pixmap returned by fz_new_pixmap_from_page_contents. */ -fz_pixmap *fz_new_pixmap_from_annot(fz_context *ctx, fz_page *page, fz_annot *annot, const fz_matrix *ctm, fz_colorspace *cs); +fz_pixmap *fz_new_pixmap_from_annot(fz_context *ctx, fz_annot *annot, const fz_matrix *ctm, fz_colorspace *cs); /* fz_new_stext_page_from_page: Extract structured text from a page. The sheet must not be NULL. diff --git a/include/mupdf/pdf/annot.h b/include/mupdf/pdf/annot.h index fb9d3a69..7328be4d 100644 --- a/include/mupdf/pdf/annot.h +++ b/include/mupdf/pdf/annot.h @@ -27,14 +27,14 @@ pdf_annot *pdf_first_annot(fz_context *ctx, pdf_page *page); Does not throw exceptions. */ -pdf_annot *pdf_next_annot(fz_context *ctx, pdf_page *page, pdf_annot *annot); +pdf_annot *pdf_next_annot(fz_context *ctx, pdf_annot *annot); /* pdf_bound_annot: Return the rectangle for an annotation on a page. Does not throw exceptions. */ -fz_rect *pdf_bound_annot(fz_context *ctx, pdf_page *page, pdf_annot *annot, fz_rect *rect); +fz_rect *pdf_bound_annot(fz_context *ctx, pdf_annot *annot, fz_rect *rect); /* pdf_annot_type: Return the type of an annotation @@ -53,10 +53,11 @@ fz_annot_type pdf_annot_type(fz_context *ctx, pdf_annot *annot); ctm: A transformation matrix applied to the objects on the page, e.g. to scale or rotate the page contents as desired. */ -void pdf_run_annot(fz_context *ctx, pdf_page *page, pdf_annot *annot, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie); +void pdf_run_annot(fz_context *ctx, pdf_annot *annot, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie); struct pdf_annot_s { + fz_annot super; pdf_page *page; pdf_obj *obj; fz_rect rect; |