1 /* pdfxform.h
2 
3    Copyright 2009 Taco Hoekwater <taco@luatex.org>
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 PDFXFORM_H
22 #  define PDFXFORM_H
23 
24 /* data structure for \.{\\pdfxform} and \.{\\pdfrefxform} */
25 
26 #  define pdfmem_xform_size        6    /* size of memory in |pdf->mem| which |obj_data_ptr| holds */
27 
28 #  define set_pdf_xform_objnum(A,B) pdf_xform_objnum(A)=B
29 
30 #  define obj_xform_width(pdf,A)       pdf->mem[obj_data_ptr(pdf,A) + 0]
31 #  define obj_xform_height(pdf,A)      pdf->mem[obj_data_ptr(pdf,A) + 1]
32 #  define obj_xform_depth(pdf,A)       pdf->mem[obj_data_ptr(pdf,A) + 2]
33 #  define obj_xform_box(pdf,A)         pdf->mem[obj_data_ptr(pdf,A) + 3]        /* this field holds
34                                                                                    pointer to the corresponding box */
35 #  define obj_xform_attr(pdf,A)        pdf->mem[obj_data_ptr(pdf,A) + 4]        /* additional xform
36                                                                                    attributes */
37 #  define obj_xform_resources(pdf,A)   pdf->mem[obj_data_ptr(pdf,A) + 5]        /* additional xform
38                                                                                    Resources */
39 
40 
41 #  define set_obj_xform_width(pdf,A,B) obj_xform_width(pdf,A)=B
42 #  define set_obj_xform_height(pdf,A,B) obj_xform_height(pdf,A)=B
43 #  define set_obj_xform_depth(pdf,A,B) obj_xform_depth(pdf,A)=B
44 #  define set_obj_xform_box(pdf,A,B) obj_xform_box(pdf,A)=B
45 #  define set_obj_xform_attr(pdf,A,B) obj_xform_attr(pdf,A)=B
46 #  define set_obj_xform_resources(pdf,A,B) obj_xform_resources(pdf,A)=B
47 
48 extern int pdf_cur_form;        /* the form being output */
49 
50 void pdf_place_form(PDF pdf, halfword p);
51 
52 void scan_pdfxform(PDF pdf);
53 void scan_pdfrefxform(PDF pdf);
54 
55 #endif
56