beta-0.89.2
[luatex.git] / source / texk / web2c / luatexdir / pdf / pdfthread.h
blobdd9078444fc4cea8c6047bebfe92bb6dba6ae6f8
1 /* pdfthread.h
3 Copyright 2009 Taco Hoekwater <taco@luatex.org>
5 This file is part of LuaTeX.
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.
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.
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/>.
22 #ifndef PDFTHREAD_H
23 # define PDFTHREAD_H
25 /* data structure of threads; words 1..4 represent the coordinates of the corners */
27 # define obj_thread_first obj_aux /* pointer to the first bead */
29 /* data structure of beads */
30 # define pdfmem_bead_size 5 /* size of memory in |pdf->mem| which |obj_bead_ptr| points to */
32 # define set_pdf_thread_attr(A,B) pdf_thread_attr(A)=B
33 # define set_pdf_thread_id(A,B) pdf_thread_id(A)=B
34 # define set_pdf_thread_named_id(A,B) pdf_thread_named_id(A)=B
36 # define obj_bead_ptr obj_aux /* pointer to |pdf->mem| */
37 # define obj_bead_rect(pdf,A) pdf->mem[obj_bead_ptr(pdf,A)]
38 # define obj_bead_page(pdf,A) pdf->mem[obj_bead_ptr(pdf,A) + 1]
39 # define obj_bead_next(pdf,A) pdf->mem[obj_bead_ptr(pdf,A) + 2]
40 # define obj_bead_prev(pdf,A) pdf->mem[obj_bead_ptr(pdf,A) + 3]
41 # define obj_bead_attr(pdf,A) pdf->mem[obj_bead_ptr(pdf,A) + 4]
42 # define obj_bead_data obj_bead_rect
43 # define set_obj_bead_data set_obj_bead_rect
45 # define set_obj_bead_rect(pdf,A,B) obj_bead_rect(pdf,A)=B
46 # define set_obj_bead_page(pdf,A,B) obj_bead_page(pdf,A)=B
47 # define set_obj_bead_next(pdf,A,B) obj_bead_next(pdf,A)=B
48 # define set_obj_bead_prev(pdf,A,B) obj_bead_prev(pdf,A)=B
49 # define set_obj_bead_attr(pdf,A,B) obj_bead_attr(pdf,A)=B
53 pointer to the corresponding whatsit node; |obj_bead_rect| is needed only when the bead
54 rectangle has been written out and after that |obj_bead_data| is not needed any more
55 so we can use this field for both
58 extern void append_bead(PDF pdf, halfword p);
59 extern void do_thread(PDF pdf, halfword parent_box, halfword p, scaledpos cur);
60 extern void append_thread(PDF pdf, halfword parent_box, scaledpos cur);
61 extern void end_thread(PDF pdf, halfword p);
62 extern void scan_thread_id(void);
64 extern void thread_title(PDF pdf, int t);
65 extern void pdf_fix_thread(PDF pdf, int t);
66 extern void out_thread(PDF pdf, int t);
68 extern void check_running_thread(PDF pdf, halfword this_box, scaledpos cur);
69 extern void print_bead_rectangles(PDF pdf);
70 extern void flush_beads_list(void);
72 #endif