From 7f009acebb75ff88c1ee934b03fa2d15f7785b32 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Fri, 3 Jan 2014 16:50:41 +0000 Subject: Introduce 'document handlers'. We define a document handler for each file type (2 in the case of PDF, one to handle files with the ability to 'run' them, and one without). We then register these handlers with the context at startup, and then call fz_open_document... as usual. This enables people to select the document types they want at will (and even to extend the library with more document types should they wish). --- source/fitz/document-no-run.c | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 source/fitz/document-no-run.c (limited to 'source/fitz/document-no-run.c') diff --git a/source/fitz/document-no-run.c b/source/fitz/document-no-run.c new file mode 100644 index 00000000..b0defe91 --- /dev/null +++ b/source/fitz/document-no-run.c @@ -0,0 +1,9 @@ +#include "mupdf/fitz.h" + +void fz_register_no_run_document_handlers(fz_context *ctx) +{ + fz_register_document_handler(ctx, &pdf_no_run_document_handler); + fz_register_document_handler(ctx, &xps_document_handler); + fz_register_document_handler(ctx, &cbz_document_handler); + fz_register_document_handler(ctx, &img_document_handler); +} -- cgit v1.2.3