diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-01-04 18:33:33 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-01-04 19:13:41 +0000 |
commit | 2ae2a7b68381f0fc5940e983ccdec5b4cc08d188 (patch) | |
tree | a0ff2e359868cf6d4bcc6de7fabc06d9ade9774a /pdf/mupdf.h | |
parent | 94439d77f23763d59457b9946ba35bd354ea4841 (diff) | |
download | mupdf-2ae2a7b68381f0fc5940e983ccdec5b4cc08d188.tar.xz |
Bug 692739: Add ability to abort time consuming actions
A new 'cookie' parameter is added to page rendering/interpretation
functions. Supply this as NULL to get existing behaviour.
If you supply a non-NULL cookie, then this is taken as a pointer to
a struct that can be used for simple, non-thread locked communication
between caller and library.
The entire struct should be memset to zero before entry, except for
specific flags (thus coping with future extensions to this struct).
The abort flag should be zero on entry. It will be checked periodically
by the library - if the caller sets it non-zero (via another thread)
then the current operation will be aborted. No guarantees are given as
to how often this will be checked, or how fast it will be responded to.
The progress_max field will be set to an integer (-1 for unknown)
representing the number of 'things' to do. The progress field will
count up from 0 to this number as time goes by. No guarantees are
made as to the accuracy of this information, but it should be
useful for offering some sort of progress bar etc. Note that
progress_max may increase during the job.
In general, callers should be careful to accept out of range or
invalid data in this structure as this is deliberately
accessed 'unlocked'.
Diffstat (limited to 'pdf/mupdf.h')
-rw-r--r-- | pdf/mupdf.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pdf/mupdf.h b/pdf/mupdf.h index bc912987..cd3c1d82 100644 --- a/pdf/mupdf.h +++ b/pdf/mupdf.h @@ -462,8 +462,8 @@ void pdf_free_page(fz_context *ctx, pdf_page *page); * Content stream parsing */ -void pdf_run_page_with_usage(pdf_xref *xref, pdf_page *page, fz_device *dev, fz_matrix ctm, char *event); -void pdf_run_page(pdf_xref *xref, pdf_page *page, fz_device *dev, fz_matrix ctm); +void pdf_run_page_with_usage(pdf_xref *xref, pdf_page *page, fz_device *dev, fz_matrix ctm, char *event, fz_cookie *cookie); +void pdf_run_page(pdf_xref *xref, pdf_page *page, fz_device *dev, fz_matrix ctm, fz_cookie *cookie); void pdf_run_glyph(pdf_xref *xref, fz_obj *resources, fz_buffer *contents, fz_device *dev, fz_matrix ctm); #endif |