summaryrefslogtreecommitdiff
path: root/pdf/mupdf.h
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-06-13 19:02:12 +0100
committerRobin Watts <robin.watts@artifex.com>2012-06-14 19:15:53 +0100
commit836d6a62162e51e7d7925773064c30ef500ded94 (patch)
tree87fc5e7d94b9ec1ba9538523f1f6c16c3cfa9707 /pdf/mupdf.h
parentf5d721764811484be4e98d7cddc5b83ae72e6277 (diff)
downloadmupdf-836d6a62162e51e7d7925773064c30ef500ded94.tar.xz
Add -j flag to mudraw; create simple mujstest scripts automatically.
We add a new fz_bound_annots function (and associated pdf_bound_annots function) that calls a given callback with the page rectangle of the annotations on a given page. This is marked as being a 'temporary' function, so we can remove it/change it in future if required. It seems likely that we'll want to have some sort of 'iterate over annotations' function eventually, and this does the job for now. Add a -j flag to mudraw that outputs a simple mujstest script. For each page with annotations, the script jumps to that page, then for each annotation on the page, it sets some text to be entered, and clicks the annotation. In the case of text fields, this will cause the text to be entered into that text field; in the case of buttons it will execute the button. At the end of each page with annotations, the script is told to snapshot the page. These test scripts are not designed to be full tests, but they do at least provide an easy way for us to generate scripts where every field in our test suite is interacted with.
Diffstat (limited to 'pdf/mupdf.h')
-rw-r--r--pdf/mupdf.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/pdf/mupdf.h b/pdf/mupdf.h
index b3807852..d7cf85f7 100644
--- a/pdf/mupdf.h
+++ b/pdf/mupdf.h
@@ -233,6 +233,15 @@ fz_rect pdf_bound_page(pdf_document *doc, pdf_page *page);
void pdf_free_page(pdf_document *doc, pdf_page *page);
/*
+ pdf_bound_annots: Bound the annotations on a page.
+
+ (Temporary function - do not rely on this remaining in future)
+
+ Does not throw exceptions (unless the callback does).
+*/
+void pdf_bound_annots(pdf_document *doc, pdf_page *page, void(*callback)(void *arg, fz_rect *), void *arg);
+
+/*
pdf_run_page: Interpret a loaded page and render it on a device.
page: A page loaded by pdf_load_page.