diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-04-12 10:51:38 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-04-12 12:21:22 +0100 |
commit | 6ad8c96fd81e06cea6ada4a83e7c5614f150f914 (patch) | |
tree | be851b5c27e7fec31d62a10381173a4997104303 /src | |
parent | bf5adaf3942388e58ad3bda30173e53b214df885 (diff) |
ps (API): Export the ability to set the creation date of the surface
A PostScript surface embeds a CreationDate comment into its document
description pre-amble. Normally this is set to the time the surface is
written out, except we set this to a constant value in the boilerplate
for the purposes of mimicking a reference file. It may also be useful
for external applications, so make it a public export.
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/cairo-ps-surface.c | 27 | ||||
-rw-r--r-- | src/cairo-ps.h | 7 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c index c5ea680e..d20d5413 100644 --- a/src/cairo-ps-surface.c +++ b/src/cairo-ps-surface.c @@ -1359,6 +1359,33 @@ cairo_ps_surface_set_size (cairo_surface_t *surface, } /** + * cairo_ps_surface_debug_set_creation_data: + * @surface: a PostScript #cairo_surface_t + * @date: A time_t + * + * Changes the embedded creation date of a PostScript surface. + * + * This function is only intended to be used by conformance test suites which + * require complete control over embedded strings. + * + * This function can be called at any point before the surface is finished, + * + * Since: 1.12.2 + **/ +void +cairo_ps_surface_debug_set_creation_date (cairo_surface_t *abstract_surface, + time_t date) +{ + cairo_ps_surface_t *surface = NULL; + + if (! _extract_ps_surface (abstract_surface, TRUE, &surface)) + return; + + surface->has_creation_date = TRUE; + surface->creation_date = date; +} + +/** * cairo_ps_surface_dsc_comment: * @surface: a PostScript #cairo_surface_t * @comment: a comment string to be emitted into the PostScript output diff --git a/src/cairo-ps.h b/src/cairo-ps.h index 33d0e0d9..ab0bb26e 100644 --- a/src/cairo-ps.h +++ b/src/cairo-ps.h @@ -42,6 +42,7 @@ #if CAIRO_HAS_PS_SURFACE #include <stdio.h> +#include <time.h> CAIRO_BEGIN_DECLS @@ -107,6 +108,12 @@ cairo_ps_surface_dsc_begin_setup (cairo_surface_t *surface); cairo_public void cairo_ps_surface_dsc_begin_page_setup (cairo_surface_t *surface); +/* debug interface */ + +cairo_public void +cairo_ps_surface_debug_set_creation_date (cairo_surface_t *abstract_surface, + time_t date); + CAIRO_END_DECLS #else /* CAIRO_HAS_PS_SURFACE */ |