projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
work on docs
[pspp]
/
src
/
output
/
cairo.c
diff --git
a/src/output/cairo.c
b/src/output/cairo.c
index 1c043bb93d3418a7d0948eafe09107d9397ec64c..a08771bb449ae68cb2d0d126c3c439a0e2907395 100644
(file)
--- a/
src/output/cairo.c
+++ b/
src/output/cairo.c
@@
-26,6
+26,7
@@
#include "output/cairo-pager.h"
#include "output/driver-provider.h"
#include "output/options.h"
#include "output/cairo-pager.h"
#include "output/driver-provider.h"
#include "output/options.h"
+#include "output/output-item.h"
#include "output/table.h"
#include <cairo/cairo-pdf.h>
#include "output/table.h"
#include <cairo/cairo-pdf.h>
@@
-186,7
+187,7
@@
static struct xr_driver *
xr_allocate (const char *name, int device_type,
enum xr_output_type output_type, struct string_map *o)
{
xr_allocate (const char *name, int device_type,
enum xr_output_type output_type, struct string_map *o)
{
- struct xr_driver *xr =
xzalloc (sizeof *x
r);
+ struct xr_driver *xr =
XZALLOC (struct xr_drive
r);
struct output_driver *d = &xr->driver;
output_driver_init (d, &cairo_driver_class, name, device_type);
struct output_driver *d = &xr->driver;
output_driver_init (d, &cairo_driver_class, name, device_type);
@@
-602,31
+603,32
@@
xr_update_page_setup (struct output_driver *driver,
}
static void
}
static void
-xr_submit (struct output_driver *driver, const struct output_item *
output_
item)
+xr_submit (struct output_driver *driver, const struct output_item *item)
{
struct xr_driver *xr = xr_driver_cast (driver);
{
struct xr_driver *xr = xr_driver_cast (driver);
- if (is_page_setup_item (output_item))
- {
- if (!xr->pager)
- xr_update_page_setup (driver,
- to_page_setup_item (output_item)->page_setup);
- return;
- }
-
if (!xr->pager)
{
xr->pager = xr_pager_create (xr->page_style, xr->fsm_style);
xr_pager_add_page (xr->pager, cairo_create (xr->drawing_surface));
}
if (!xr->pager)
{
xr->pager = xr_pager_create (xr->page_style, xr->fsm_style);
xr_pager_add_page (xr->pager, cairo_create (xr->drawing_surface));
}
- xr_pager_add_item (xr->pager,
output_
item);
+ xr_pager_add_item (xr->pager, item);
while (xr_pager_needs_new_page (xr->pager))
{
xr_finish_page (xr);
xr_pager_add_page (xr->pager, cairo_create (xr->drawing_surface));
}
}
while (xr_pager_needs_new_page (xr->pager))
{
xr_finish_page (xr);
xr_pager_add_page (xr->pager, cairo_create (xr->drawing_surface));
}
}
+
+static void
+xr_setup (struct output_driver *driver, const struct page_setup *ps)
+{
+ struct xr_driver *xr = xr_driver_cast (driver);
+
+ if (!xr->pager)
+ xr_update_page_setup (driver, ps);
+}
\f
struct output_driver_factory pdf_driver_factory =
{ "pdf", "pspp.pdf", xr_pdf_create };
\f
struct output_driver_factory pdf_driver_factory =
{ "pdf", "pspp.pdf", xr_pdf_create };
@@
-639,8
+641,9
@@
struct output_driver_factory png_driver_factory =
static const struct output_driver_class cairo_driver_class =
{
static const struct output_driver_class cairo_driver_class =
{
- "cairo",
- xr_destroy,
- xr_submit,
- NULL,
+ .name = "cairo",
+ .destroy = xr_destroy,
+ .submit = xr_submit,
+ .setup = xr_setup,
+ .handles_groups = true,
};
};