summaryrefslogtreecommitdiff
path: root/cbz
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-04-17 00:40:43 +0100
committerRobin Watts <robin.watts@artifex.com>2012-04-17 09:25:03 +0100
commit4069e52998d2cb2b54e65e8a8b418868ffa73bee (patch)
tree423024feca20fdb07224ecb40c807dbb3fbd4644 /cbz
parent00851c1b04215f2e5688836be57e4efdb198483b (diff)
downloadmupdf-4069e52998d2cb2b54e65e8a8b418868ffa73bee.tar.xz
Add Meta interface to fz_document.
Use this to reintroduce "Document Properties..." in mupdf viewer.
Diffstat (limited to 'cbz')
-rw-r--r--cbz/mucbz.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/cbz/mucbz.c b/cbz/mucbz.c
index 1ab05799..e8e8faa3 100644
--- a/cbz/mucbz.c
+++ b/cbz/mucbz.c
@@ -490,6 +490,22 @@ static void cbz_free_page_shim(fz_document *doc, fz_page *page)
cbz_free_page((cbz_document*)doc, (cbz_page*)page);
}
+static int cbz_meta(fz_document *doc_, int key, void *ptr, int size)
+{
+ cbz_document *doc = (cbz_document *)doc_;
+
+ doc = doc;
+
+ switch(key)
+ {
+ case FZ_META_FORMAT_INFO:
+ sprintf((char *)ptr, "CBZ");
+ return FZ_META_OK;
+ default:
+ return FZ_META_UNKNOWN_KEY;
+ }
+}
+
static void
cbz_init_document(cbz_document *doc)
{
@@ -503,4 +519,5 @@ cbz_init_document(cbz_document *doc)
doc->super.bound_page = cbz_bound_page_shim;
doc->super.run_page = cbz_run_page_shim;
doc->super.free_page = cbz_free_page_shim;
+ doc->super.meta = cbz_meta;
}