*** Cairo-1.106/CairoSurface.xs~ 2013-09-29 06:49:21.000000000 +0200
--- Cairo-1.106/CairoSurface.xs 2019-08-18 22:08:54.565352385 +0200
***************
*** 580,585 ****
--- 580,591 ----
#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
# --------------------------------------------------------------------------- #
*** Cairo-1.106/Makefile.PL~ 2015-09-26 19:10:29.000000000 +0200
--- Cairo-1.106/Makefile.PL 2019-08-18 22:32:53.033563091 +0200
***************
*** 325,330 ****
--- 325,331 ----
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,505 ****
--- 501,522 ----
$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 = (
*** Cairo-1.106/t/CairoSurface.t~ 2011-11-27 08:56:45.000000000 +0100
--- Cairo-1.106/t/CairoSurface.t 2019-08-19 08:48:20.157001297 +0200
***************
*** 12,18 ****
use Config; # for byteorder
! use Test::More tests => 88;
use constant IMG_WIDTH => 256;
use constant IMG_HEIGHT => 256;
--- 12,18 ----
use Config; # for byteorder
! use Test::More tests => 89;
use constant IMG_WIDTH => 256;
use constant IMG_HEIGHT => 256;
***************
*** 268,273 ****
--- 268,283 ----
like (Cairo::PdfSurface->version_to_string('1-4'), qr/1\.4/);
}
+ SKIP: {
+ skip 'new stuff', 3
+ 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';
}
*** Cairo-1.106/lib/Cairo.pm~ 2015-09-29 07:05:09.000000000 +0200
--- Cairo-1.106/lib/Cairo.pm 2019-08-19 08:50:47.637235873 +0200
***************
*** 1491,1496 ****
--- 1509,1524 ----
=back
+ =item $surface->set_metadata($name, $value) [1.16]
+
+ =over
+
+ =item $name: string
+
+ =item $value: string
+
+ =back
+
=back
=cut