Change the translation of the "Help" menu item to "?", so that the menu can be displa...
[reactos.git] / rosapps / smartpdf / fitz / include / mupdf / syntax.h
1 /*
2 * tokenizer and low-level object parser
3 */
4
5 enum
6 {
7 PDF_TERROR, PDF_TEOF,
8 PDF_TOARRAY, PDF_TCARRAY,
9 PDF_TODICT, PDF_TCDICT,
10 PDF_TOBRACE, PDF_TCBRACE,
11 PDF_TNAME, PDF_TINT, PDF_TREAL, PDF_TSTRING, PDF_TKEYWORD,
12 PDF_TR, PDF_TTRUE, PDF_TFALSE, PDF_TNULL,
13 PDF_TOBJ, PDF_TENDOBJ,
14 PDF_TSTREAM, PDF_TENDSTREAM,
15 PDF_TXREF, PDF_TTRAILER, PDF_TSTARTXREF,
16 PDF_NTOKENS
17 };
18
19 /* lex.c */
20 int pdf_lex(fz_stream *f, unsigned char *buf, int n, int *len);
21
22 /* parse.c */
23 fz_error *pdf_parsearray(fz_obj **op, fz_stream *f, char *buf, int cap);
24 fz_error *pdf_parsedict(fz_obj **op, fz_stream *f, char *buf, int cap);
25 fz_error *pdf_parsestmobj(fz_obj **op, fz_stream *f, char *buf, int cap);
26 fz_error *pdf_parseindobj(fz_obj **op, fz_stream *f, char *buf, int cap, int *oid, int *gid, int *stmofs);
27
28 fz_rect pdf_torect(fz_obj *array);
29 fz_matrix pdf_tomatrix(fz_obj *array);
30 fz_error *pdf_toutf8(char **dstp, fz_obj *src);
31 fz_error *pdf_toucs2(unsigned short **dstp, fz_obj *src);
32
33 /*
34 * Encryption
35 */
36
37 /* Permission bits on pdf_crypt_s->p field */
38 #define PDF_PERM_PRINT (1<<2) // bit 3
39 #define PDF_PERM_CHANGE (1<<3) // bit 4
40 #define PDF_PERM_COPY (1<<4) // bit 5
41 #define PDF_PERM_NOTES (1<<5) // bit 6
42 #define PDF_PERM_FILL_FORM (1<<8) // bit 9
43 #define PDF_PERM_ACCESSIBILITY (1<<9) // bit 10
44 #define PDF_PERM_ASSEMBLE (1<<10) // bit 11
45 #define PDF_PERM_HIGH_RES_PRINT (1<<11) // bit 12
46 #define PDF_DEFAULT_PERM_FLAGS 0xfffc
47
48 typedef struct pdf_crypt_s pdf_crypt;
49
50 struct pdf_crypt_s
51 {
52 unsigned char o[32];
53 unsigned char u[32];
54 unsigned int p;
55 int r;
56 int n;
57
58 fz_obj *encrypt;
59 fz_obj *id;
60
61 unsigned char key[16];
62 int keylen;
63 };
64
65 /* crypt.c */
66 fz_error *pdf_newdecrypt(pdf_crypt **cp, fz_obj *enc, fz_obj *id);
67 fz_error *pdf_newencrypt(pdf_crypt **cp, char *userpw, char *ownerpw, int p, int n, fz_obj *id);
68 fz_error *pdf_setpassword(pdf_crypt *crypt, char *pw);
69 fz_error *pdf_setuserpassword(pdf_crypt *crypt, char *pw, int pwlen);
70 fz_error *pdf_setownerpassword(pdf_crypt *crypt, char *pw, int pwlen);
71 fz_error *pdf_cryptstream(fz_filter **fp, pdf_crypt *crypt, int oid, int gid);
72 void pdf_cryptobj(pdf_crypt *crypt, fz_obj *obj, int oid, int gid);
73 void pdf_dropcrypt(pdf_crypt *crypt);
74