| 1 |
/* pdfobj.h |
| 2 |
|
| 3 |
Copyright 2009-2011 Taco Hoekwater <[email protected]> |
| 4 |
|
| 5 |
This file is part of LuaTeX. |
| 6 |
|
| 7 |
LuaTeX is free software; you can redistribute it and/or modify it under |
| 8 |
the terms of the GNU General Public License as published by the Free |
| 9 |
Software Foundation; either version 2 of the License, or (at your |
| 10 |
option) any later version. |
| 11 |
|
| 12 |
LuaTeX is distributed in the hope that it will be useful, but WITHOUT |
| 13 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 14 |
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
| 15 |
License for more details. |
| 16 |
|
| 17 |
You should have received a copy of the GNU General Public License along |
| 18 |
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. |
| 19 |
*/ |
| 20 |
|
| 21 |
#ifndef PDFOBJ_H |
| 22 |
# define PDFOBJ_H |
| 23 |
|
| 24 |
/* data structure for \.{\\pdfextension obj} and \.{\\pdfextension refobj} */ |
| 25 |
|
| 26 |
# define set_pdf_obj_objnum(A, B) pdf_obj_objnum(A) = (B) |
| 27 |
|
| 28 |
# define pdfmem_obj_size 5 /* size of memory in |mem| which |obj_data_ptr| holds */ |
| 29 |
|
| 30 |
# define obj_obj_data(pdf, A) pdf->mem[obj_data_ptr((pdf), (A)) + 0] /* object data */ |
| 31 |
# define obj_obj_stream_attr(pdf, A) pdf->mem[obj_data_ptr((pdf), (A)) + 1] /* additional attributes into stream dict */ |
| 32 |
# define obj_obj_flags(pdf, A) pdf->mem[obj_data_ptr((pdf), (A)) + 2] /* stream/file flags */ |
| 33 |
# define obj_obj_pdfcompresslevel(pdf, A) pdf->mem[obj_data_ptr((pdf), (A)) + 3] /* overrides \pdfcompresslevel */ |
| 34 |
# define obj_obj_objstm_threshold(pdf, A) pdf->mem[obj_data_ptr((pdf), (A)) + 4] /* for object stream compression */ |
| 35 |
|
| 36 |
# define OBJ_FLAG_ISSTREAM (1 << 0) |
| 37 |
# define OBJ_FLAG_ISFILE (1 << 1) |
| 38 |
# define OBJ_FLAG_NOLENGTH (1 << 2) |
| 39 |
|
| 40 |
# define obj_obj_is_stream(pdf,A) ((obj_obj_flags((pdf), (A)) & OBJ_FLAG_ISSTREAM) != 0) |
| 41 |
# define set_obj_obj_is_stream(pdf,A) ((obj_obj_flags((pdf), (A)) |= OBJ_FLAG_ISSTREAM)) |
| 42 |
# define unset_obj_obj_is_stream(pdf,A) ((obj_obj_flags((pdf), (A)) &= ~OBJ_FLAG_ISSTREAM)) |
| 43 |
|
| 44 |
# define obj_obj_is_file(pdf,A) ((obj_obj_flags((pdf), (A)) & OBJ_FLAG_ISFILE) != 0) |
| 45 |
# define set_obj_obj_is_file(pdf,A) ((obj_obj_flags((pdf), (A)) |= OBJ_FLAG_ISFILE)) |
| 46 |
# define unset_obj_obj_is_file(pdf,A) ((obj_obj_flags((pdf), (A)) &= ~OBJ_FLAG_ISFILE)) |
| 47 |
|
| 48 |
# define obj_obj_no_length(pdf,A) ((obj_obj_flags((pdf), (A)) & OBJ_FLAG_NOLENGTH) != 0) |
| 49 |
# define set_obj_obj_no_length(pdf,A) ((obj_obj_flags((pdf), (A)) |= OBJ_FLAG_NOLENGTH)) |
| 50 |
# define unset_obj_obj_no_length(pdf,A) ((obj_obj_flags((pdf), (A)) &= ~OBJ_FLAG_NOLENGTH)) |
| 51 |
|
| 52 |
extern void init_obj_obj(PDF pdf, int k); |
| 53 |
extern void pdf_write_obj(PDF pdf, int n); |
| 54 |
extern void scan_obj(PDF pdf); |
| 55 |
extern void scan_refobj(PDF pdf); |
| 56 |
extern void scan_refobj_lua(PDF pdf, int k); |
| 57 |
extern void pdf_ref_obj(PDF pdf, halfword p); |
| 58 |
extern void pdf_ref_obj_lua(PDF pdf, int k); |
| 59 |
|
| 60 |
#endif |