From 4069e52998d2cb2b54e65e8a8b418868ffa73bee Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Tue, 17 Apr 2012 00:40:43 +0100 Subject: Add Meta interface to fz_document. Use this to reintroduce "Document Properties..." in mupdf viewer. --- cbz/mucbz.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'cbz') 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; } -- cgit v1.2.3