Commit 78e97bec authored by Johan Vromans's avatar Johan Vromans Committed by Torsten Schönfeld

Add a binding for cairo_pdf_surface_set_metadata

parent 4c225159
......@@ -580,6 +580,12 @@ cairo_pdf_surface_version_to_string (...)
#endif
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 16, 0)
void cairo_pdf_surface_set_metadata (cairo_surface_t *surface, cairo_pdf_metadata_t metadata, const char_utf8 * utf8);
#endif
#endif
# --------------------------------------------------------------------------- #
......
......@@ -325,6 +325,7 @@ my $have_cairo_1_4 = ExtUtils::PkgConfig->atleast_version("cairo", "1.4.0");
my $have_cairo_1_6 = ExtUtils::PkgConfig->atleast_version("cairo", "1.6.0");
my $have_cairo_1_8 = ExtUtils::PkgConfig->atleast_version("cairo", "1.8.0");
my $have_cairo_1_10 = ExtUtils::PkgConfig->atleast_version("cairo", "1.10.0");
my $have_cairo_1_16 = ExtUtils::PkgConfig->atleast_version("cairo", "1.16.0");
if ($have_cairo_1_2) {
add_new_enum_values(
......@@ -500,6 +501,21 @@ if ($have_cairo_1_10) {
$enums{cairo_region_overlap_t} = [];
}
if ($have_cairo_1_16) {
$enums{cairo_pdf_metadata_t} = [qw/
CAIRO_PDF_METADATA_
CAIRO_PDF_METADATA_TITLE
CAIRO_PDF_METADATA_AUTHOR
CAIRO_PDF_METADATA_SUBJECT
CAIRO_PDF_METADATA_KEYWORDS
CAIRO_PDF_METADATA_CREATOR
CAIRO_PDF_METADATA_CREATE_DATE
CAIRO_PDF_METADATA_MOD_DATE
/];
} else {
$enums{cairo_pdf_metadata_t} = [];
}
# --------------------------------------------------------------------------- #
my %object_guards = (
......
......@@ -1509,6 +1509,16 @@ For hysterical reasons, you can also use the following syntax:
=back
=item $surface->set_metadata($name, $value) [1.16]
=over
=item $name: string
=item $value: string
=back
=back
=cut
......
......@@ -12,7 +12,7 @@ use warnings;
use Config; # for byteorder
use Test::More tests => 88;
use Test::More tests => 89;
use constant IMG_WIDTH => 256;
use constant IMG_HEIGHT => 256;
......@@ -216,7 +216,7 @@ SKIP: {
}
SKIP: {
skip 'pdf surface', 13
skip 'pdf surface', 14
unless Cairo::HAS_PDF_SURFACE;
my $surf = Cairo::PdfSurface->create ('tmp.pdf', IMG_WIDTH, IMG_HEIGHT);
......@@ -268,6 +268,16 @@ SKIP: {
like (Cairo::PdfSurface->version_to_string('1-4'), qr/1\.4/);
}
SKIP: {
skip 'new stuff', 1
unless Cairo::VERSION >= Cairo::VERSION_ENCODE (1, 16, 0);
$surf->set_metadata("title","Testing metadata");
$surf->set_metadata("author","Johan Vromans");
$surf->set_metadata("subject","cairo_pdf_set_metadata");
ok(1); # No get_metadata, so assume OK if we're still alive
}
unlink 'tmp.pdf';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment