...
 
Commits (3)
......@@ -898,6 +898,14 @@ void cairo_append_path (cairo_t *cr, cairo_path_t *path);
cairo_status_t cairo_status (cairo_t *cr);
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 16, 0)
void cairo_tag_begin (cairo_t * cr, const char_utf8 * tag_name, const char_utf8 * attributes);
void cairo_tag_end (cairo_t * cr, const char_utf8 * tag_name);
#endif
# --------------------------------------------------------------------------- #
MODULE = Cairo PACKAGE = Cairo PREFIX = cairo_
......
......@@ -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 = (
......
......@@ -340,6 +340,24 @@ C<$cr-E<gt>restore> to restore to the saved state.
=back
=item $cr->tag_begin($name, $atts) [1.16]
=over
=item $name: string
=item $atts: string
=back
=item $cr->tag_end($name) [1.16]
=over
=item $name: string
=back
=item $cr->copy_page
=item $cr->show_page
......@@ -1491,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
......
......@@ -10,7 +10,7 @@
use strict;
use warnings;
use Test::More tests => 70;
use Test::More tests => 72;
unless (eval 'use Test::Number::Delta; 1;') {
my $reason = 'Test::Number::Delta not available';
......@@ -286,3 +286,13 @@ isa_ok ($path, 'ARRAY');
$cr->append_path ($path);
is ($cr->status, 'success');
SKIP: {
skip 'new stuff', 2
unless Cairo::VERSION >= Cairo::VERSION_ENCODE (1, 16, 0);
$cr->tag_begin("Link","https://www.perl.org");
is ($cr->status, 'success');
$cr->tag_end("Link");
is ($cr->status, 'success');
}
......@@ -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';
}
......