1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 2009, 2010, 2014, 2020 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17 #ifndef OUTPUT_CAIRO_PAGER_H
18 #define OUTPUT_CAIRO_PAGER_H 1
24 /* Cairo output driver paginater. */
26 #include <cairo/cairo.h>
27 #include <pango/pango-font.h>
28 #include "output/cairo-fsm.h"
29 #include "output/page-setup-item.h"
30 #include "output/table.h"
36 int margins[TABLE_N_AXES][2]; /* Margins. */
38 struct page_heading headings[2]; /* Top and bottom headings. */
40 int initial_page_number;
43 /* Whether to include an outline in PDF output. (The only reason I know to
44 omit it is to avoid a Cairo bug that caused crashes in some cases.) */
47 struct xr_page_style *xr_page_style_ref (const struct xr_page_style *);
48 struct xr_page_style *xr_page_style_unshare (struct xr_page_style *);
49 void xr_page_style_unref (struct xr_page_style *);
50 bool xr_page_style_equals (const struct xr_page_style *,
51 const struct xr_page_style *);
52 struct xr_page_style *xr_page_style_default (void);
55 xr_page_style_paper_size (const struct xr_page_style *ps,
56 const struct xr_fsm_style *fs, enum table_axis a)
58 return fs->size[a] + ps->margins[a][0] + ps->margins[a][1];
61 struct xr_pager *xr_pager_create (const struct xr_page_style *,
62 const struct xr_fsm_style *);
63 void xr_pager_destroy (struct xr_pager *);
65 bool xr_pager_has_item (const struct xr_pager *);
66 void xr_pager_add_item (struct xr_pager *, const struct output_item *);
68 bool xr_pager_has_page (const struct xr_pager *);
69 void xr_pager_add_page (struct xr_pager *, cairo_t *);
70 void xr_pager_finish_page (struct xr_pager *);
71 bool xr_pager_needs_new_page (struct xr_pager *);
73 #endif /* HAVE_CAIRO */
75 #endif /* output/cairo-pager.h */