summaryrefslogtreecommitdiff
path: root/ios/document.h
blob: 0003070e6a3b610d6b8937ce939ab71ba1b86bef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef _DOCUMENT_H_
#define _DOCUMENT_H_

#ifndef _FITZ_H_
#error "fitz.h must be included before document.h"
#endif

#ifndef _MUPDF_H_
#error "mupdf.h must be included before document.h"
#endif

#ifndef _MUXPS_H_
#error "muxps.h must be included before document.h"
#endif

#ifndef _MUCBZ_H_
#error "mucbz.h must be included before document.h"
#endif

struct document
{
	fz_context *ctx;
	pdf_document *pdf;
	xps_document *xps;
	cbz_document *cbz;
	int number;
	pdf_page *pdf_page;
	xps_page *xps_page;
	cbz_page *cbz_page;
	fz_bbox hit_bbox[500];
	int hit_count;
};

struct document *open_document(fz_context *ctx, char *filename);
int needs_password(struct document *doc);
int authenticate_password(struct document *doc, char *password);
fz_outline *load_outline(struct document *doc);
int count_pages(struct document *doc);
void measure_page(struct document *doc, int number, float *w, float *h);
void draw_page(struct document *doc, int number, fz_device *dev, fz_matrix ctm, fz_cookie *cookie);
int search_page(struct document *doc, int number, char *needle, fz_cookie *cookie);
fz_bbox search_result_bbox(struct document *doc, int i);
void close_document(struct document *doc);

#endif