Hello community, here is the log from the commit of package perl-Cairo for openSUSE:Factory checked in at 2020-12-01 14:23:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Cairo (Old) and /work/SRC/openSUSE:Factory/.perl-Cairo.new.5913 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Cairo" Tue Dec 1 14:23:48 2020 rev:40 rq:852330 version:1.108 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Cairo/perl-Cairo.changes 2019-10-14 12:44:02.690301281 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Cairo.new.5913/perl-Cairo.changes 2020-12-01 14:24:05.917678480 +0100 @@ -1,0 +2,11 @@ +Tue Dec 1 11:13:34 UTC 2020 - Tina Müller <[email protected]> + +- Add some files to skip_doc + +------------------------------------------------------------------- +Wed Nov 25 03:06:31 UTC 2020 - Tina Müller <[email protected]> + +- updated to 1.108 + see /usr/share/doc/packages/perl-Cairo/ChangeLog.pre-git + +------------------------------------------------------------------- Old: ---- Cairo-1.107.tar.gz New: ---- Cairo-1.108.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Cairo.spec ++++++ --- /var/tmp/diff_new_pack.8PUnoA/_old 2020-12-01 14:24:06.605679224 +0100 +++ /var/tmp/diff_new_pack.8PUnoA/_new 2020-12-01 14:24:06.609679228 +0100 @@ -1,7 +1,7 @@ # # spec file for package perl-Cairo # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,14 +17,14 @@ Name: perl-Cairo -Version: 1.107 +Version: 1.108 Release: 0 #Upstream: CHECK(Artistic-1.0 or GPL-1.0-or-later) %define cpan_name Cairo Summary: Perl interface to the cairo 2d vector graphics library License: LGPL-2.1-or-later Group: Development/Libraries/Perl -Url: https://metacpan.org/release/%{cpan_name} +URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/X/XA/XAOC/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -59,7 +59,7 @@ %files -f %{name}.files %defattr(-,root,root,755) -%doc cairo-perl.typemap ChangeLog.pre-git doctypes examples NEWS perl-Cairo.doap README TODO +%doc ChangeLog.pre-git examples NEWS README TODO %license LICENSE %changelog ++++++ Cairo-1.107.tar.gz -> Cairo-1.108.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cairo-1.107/Cairo.xs new/Cairo-1.108/Cairo.xs --- old/Cairo-1.107/Cairo.xs 2019-09-29 03:48:25.000000000 +0200 +++ new/Cairo-1.108/Cairo.xs 2020-11-24 07:31:53.000000000 +0100 @@ -904,6 +904,11 @@ void cairo_tag_end (cairo_t * cr, const char_utf8 * tag_name); +BOOT: + HV *stash = gv_stashpv("Cairo", 0); + newCONSTSUB (stash, "TAG_DEST", newSVpv (CAIRO_TAG_DEST, 0)); + newCONSTSUB (stash, "TAG_LINK", newSVpv (CAIRO_TAG_LINK, 0)); + #endif # --------------------------------------------------------------------------- # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cairo-1.107/CairoSurface.xs new/Cairo-1.108/CairoSurface.xs --- old/Cairo-1.107/CairoSurface.xs 2019-09-29 03:48:25.000000000 +0200 +++ new/Cairo-1.108/CairoSurface.xs 2020-11-24 07:31:53.000000000 +0100 @@ -295,6 +295,14 @@ /* -------------------------------------------------------------------------- */ +static void +data_destroy (void *data) +{ + SvREFCNT_dec ((SV *) data); +} + +/* -------------------------------------------------------------------------- */ + MODULE = Cairo::Surface PACKAGE = Cairo::Surface PREFIX = cairo_surface_ void DESTROY (cairo_surface_t * surface); @@ -374,6 +382,70 @@ #endif +#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0) + +# cairo_status_t cairo_surface_set_mime_data (cairo_surface_t *surface, const char *mime_type, const unsigned char *data, unsigned long length, cairo_destroy_func_t destroy, void *closure); +cairo_status_t +cairo_surface_set_mime_data (cairo_surface_t *surface, const char *mime_type, SV *data); + PREINIT: + const unsigned char *mime_data; + unsigned long length; + CODE: + SvREFCNT_inc (data); + mime_data = (const unsigned char *) SvPV(data, length); + RETVAL = cairo_surface_set_mime_data (surface, mime_type, mime_data, length, data_destroy, data); + OUTPUT: + RETVAL + +# void cairo_surface_get_mime_data (cairo_surface_t *surface, const char *mime_type, const unsigned char **data, unsigned long *length); +SV * +cairo_surface_get_mime_data (cairo_surface_t *surface, const char *mime_type); + PREINIT: + const unsigned char *data; + unsigned long length; + CODE: + cairo_surface_get_mime_data (surface, mime_type, &data, &length); + RETVAL = newSVpvn ((const char *) data, length); + OUTPUT: + RETVAL + +BOOT: + HV *stashsurface = gv_stashpv("Cairo::Surface", 0); + newCONSTSUB (stashsurface, "MIME_TYPE_JP2", newSVpv (CAIRO_MIME_TYPE_JP2, 0)); + newCONSTSUB (stashsurface, "MIME_TYPE_JPEG", newSVpv (CAIRO_MIME_TYPE_JPEG, 0)); + newCONSTSUB (stashsurface, "MIME_TYPE_PNG", newSVpv (CAIRO_MIME_TYPE_PNG, 0)); + newCONSTSUB (stashsurface, "MIME_TYPE_URI", newSVpv (CAIRO_MIME_TYPE_URI, 0)); + +#endif + +#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0) + +cairo_bool_t cairo_surface_supports_mime_type (cairo_surface_t *surface, const char *mime_type); + +BOOT: + newCONSTSUB (stashsurface, "MIME_TYPE_UNIQUE_ID", newSVpv (CAIRO_MIME_TYPE_UNIQUE_ID, 0)); + +#endif + +#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0) + +BOOT: + newCONSTSUB (stashsurface, "MIME_TYPE_JBIG2", newSVpv (CAIRO_MIME_TYPE_JBIG2, 0)); + newCONSTSUB (stashsurface, "MIME_TYPE_JBIG2_GLOBAL", newSVpv (CAIRO_MIME_TYPE_JBIG2_GLOBAL, 0)); + newCONSTSUB (stashsurface, "MIME_TYPE_JBIG2_GLOBAL_ID", newSVpv (CAIRO_MIME_TYPE_JBIG2_GLOBAL_ID, 0)); + +#endif + +#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 16, 0) + +BOOT: + newCONSTSUB (stashsurface, "MIME_TYPE_CCITT_FAX", newSVpv (CAIRO_MIME_TYPE_CCITT_FAX, 0)); + newCONSTSUB (stashsurface, "MIME_TYPE_CCITT_FAX_PARAMS", newSVpv (CAIRO_MIME_TYPE_CCITT_FAX_PARAMS, 0)); + newCONSTSUB (stashsurface, "MIME_TYPE_EPS", newSVpv (CAIRO_MIME_TYPE_EPS, 0)); + newCONSTSUB (stashsurface, "MIME_TYPE_EPS_PARAMS", newSVpv (CAIRO_MIME_TYPE_EPS_PARAMS, 0)); + +#endif + #ifdef CAIRO_HAS_PNG_FUNCTIONS cairo_status_t cairo_surface_write_to_png (cairo_surface_t *surface, const char *filename); @@ -582,8 +654,18 @@ #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 16, 0) +int cairo_pdf_surface_add_outline (cairo_surface_t *surface, int parent_id, const char *utf8, const char *link_attribs, cairo_pdf_outline_flags_t flags); + +BOOT: + HV *stashpdfsurface = gv_stashpv("Cairo::PdfSurface", 0); + newCONSTSUB(stashpdfsurface, "OUTLINE_ROOT", newSViv(CAIRO_PDF_OUTLINE_ROOT)); + void cairo_pdf_surface_set_metadata (cairo_surface_t *surface, cairo_pdf_metadata_t metadata, const char_utf8 * utf8); +void cairo_pdf_surface_set_page_label (cairo_surface_t *surface, const char *utf8); + +void cairo_pdf_surface_set_thumbnail_size (cairo_surface_t *surface, int width, int height); + #endif #endif @@ -765,6 +847,22 @@ void cairo_recording_surface_ink_extents (cairo_surface_t *surface, OUTLIST double x0, OUTLIST double y0, OUTLIST double width, OUTLIST double height); +#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0) + +# cairo_bool_t cairo_recording_surface_get_extents (cairo_surface_t *surface, cairo_rectangle_t *extents); +cairo_rectangle_t * +cairo_recording_surface_get_extents (cairo_surface_t *surface) + PREINIT: + cairo_bool_t status; + cairo_rectangle_t rect; + CODE: + status = cairo_recording_surface_get_extents (surface, &rect); + RETVAL = status ? &rect : NULL; + OUTPUT: + RETVAL + +#endif + #endif # --------------------------------------------------------------------------- # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cairo-1.107/MANIFEST new/Cairo-1.108/MANIFEST --- old/Cairo-1.107/MANIFEST 2019-10-07 06:36:38.000000000 +0200 +++ new/Cairo-1.108/MANIFEST 2020-11-24 18:51:22.000000000 +0100 @@ -13,6 +13,8 @@ doctypes examples/freetype-font.pl examples/glyph-text.pl +examples/mime-unique-id.pl +examples/pdf-tagged-text.pl examples/png-streams.pl examples/png/bevels.pl examples/png/caps_joins.pl @@ -37,7 +39,7 @@ MANIFEST MANIFEST.SKIP NEWS -perl-Cairo.doap +perl-cairo.doap ppport.h README t/00-loading.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cairo-1.107/META.json new/Cairo-1.108/META.json --- old/Cairo-1.107/META.json 2019-10-07 06:36:38.000000000 +0200 +++ new/Cairo-1.108/META.json 2020-11-24 18:51:22.000000000 +0100 @@ -61,11 +61,11 @@ ], "repository" : { "type" : "git", - "url" : "git://git.gnome.org/perl-Cairo", - "web" : "http://git.gnome.org/browse/perl-Cairo" + "url" : "https://gitlab.gnome.org/GNOME/perl-cairo.git", + "web" : "https://gitlab.gnome.org/GNOME/perl-cairo" }, "x_MailingList" : "https://mail.gnome.org/mailman/listinfo/gtk-perl-list" }, - "version" : "1.107", + "version" : "1.108", "x_serialization_backend" : "JSON::PP version 2.97001" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cairo-1.107/META.yml new/Cairo-1.108/META.yml --- old/Cairo-1.107/META.yml 2019-10-07 06:36:38.000000000 +0200 +++ new/Cairo-1.108/META.yml 2020-11-24 18:51:22.000000000 +0100 @@ -30,6 +30,6 @@ bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Cairo homepage: http://gtk2-perl.sourceforge.net license: http://www.gnu.org/licenses/lgpl-2.1.html - repository: git://git.gnome.org/perl-Cairo -version: '1.107' + repository: https://gitlab.gnome.org/GNOME/perl-cairo.git +version: '1.108' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cairo-1.107/Makefile.PL new/Cairo-1.108/Makefile.PL --- old/Cairo-1.107/Makefile.PL 2019-09-29 03:48:25.000000000 +0200 +++ new/Cairo-1.108/Makefile.PL 2020-11-24 07:31:53.000000000 +0100 @@ -45,9 +45,9 @@ mailto => 'bug-Cairo [at] rt.cpan.org', }, repository => { - url => 'git://git.gnome.org/perl-Cairo', + url => 'https://gitlab.gnome.org/GNOME/perl-cairo.git', type => 'git', - web => 'http://git.gnome.org/browse/perl-Cairo', + web => 'https://gitlab.gnome.org/GNOME/perl-cairo', }, }, prereqs => { @@ -325,6 +325,8 @@ 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_12 = ExtUtils::PkgConfig->atleast_version("cairo", "1.12.0"); +my $have_cairo_1_14 = ExtUtils::PkgConfig->atleast_version("cairo", "1.14.0"); my $have_cairo_1_16 = ExtUtils::PkgConfig->atleast_version("cairo", "1.16.0"); if ($have_cairo_1_2) { @@ -448,6 +450,10 @@ if ($have_cairo_1_10) { add_new_enum_values( + cairo_status_t => [qw/CAIRO_STATUS_INVALID_SIZE + CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED + CAIRO_STATUS_DEVICE_TYPE_MISMATCH + CAIRO_STATUS_DEVICE_ERROR/], cairo_surface_type_t => [ qw/CAIRO_SURFACE_TYPE_SCRIPT CAIRO_SURFACE_TYPE_QT @@ -501,7 +507,28 @@ $enums{cairo_region_overlap_t} = []; } +if ($have_cairo_1_12) { + add_new_enum_values( + cairo_status_t => [qw/CAIRO_STATUS_INVALID_MESH_CONSTRUCTION + CAIRO_STATUS_DEVICE_FINISHED/], + ); +} else { +} + +if ($have_cairo_1_14) { + add_new_enum_values( + cairo_status_t => [qw/CAIRO_STATUS_JBIG2_GLOBAL_MISSING/], + ); +} else { +} + if ($have_cairo_1_16) { + add_new_enum_values( + cairo_status_t => [qw/CAIRO_STATUS_PNG_ERROR + CAIRO_STATUS_FREETYPE_ERROR + CAIRO_STATUS_WIN32_GDI_ERROR + CAIRO_STATUS_TAG_ERROR/], + ); $enums{cairo_pdf_metadata_t} = [qw/ CAIRO_PDF_METADATA_ CAIRO_PDF_METADATA_TITLE @@ -512,8 +539,21 @@ CAIRO_PDF_METADATA_CREATE_DATE CAIRO_PDF_METADATA_MOD_DATE /]; + + $flags{cairo_pdf_outline_flags_t} = [qw/ + CAIRO_PDF_OUTLINE_FLAG_ + CAIRO_PDF_OUTLINE_FLAG_OPEN + CAIRO_PDF_OUTLINE_FLAG_BOLD + CAIRO_PDF_OUTLINE_FLAG_ITALIC + /]; + + push @exports, qw/newSVCairoPdfOutline + SvCairoPdfOutline + cairo_pdf_outline_flags_from_sv + cairo_pdf_outline_flags_to_sv/; } else { $enums{cairo_pdf_metadata_t} = []; + $flags{cairo_pdf_outline_flags_t} = []; } # --------------------------------------------------------------------------- # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cairo-1.107/NEWS new/Cairo-1.108/NEWS --- old/Cairo-1.107/NEWS 2019-10-07 06:33:40.000000000 +0200 +++ new/Cairo-1.108/NEWS 2020-11-24 07:54:20.000000000 +0100 @@ -1,3 +1,14 @@ +Overview of changes in Cairo 1.108 +================================== + +* Add missing status codes +* Add Perl bindings for Cairo surface mime type setting/getting and get extents +* Add bindings for PDF outline support +* Add example file for PDF outline support bindings +* Updated MANIFEST file with newly added files +* Makefile.PL: updated Git URLs +* Add defined constants for MIME types, pdf outlining, and tags + Overview of changes in Cairo 1.107 ================================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cairo-1.107/examples/mime-unique-id.pl new/Cairo-1.108/examples/mime-unique-id.pl --- old/Cairo-1.107/examples/mime-unique-id.pl 1970-01-01 01:00:00.000000000 +0100 +++ new/Cairo-1.108/examples/mime-unique-id.pl 2020-11-24 07:31:53.000000000 +0100 @@ -0,0 +1,279 @@ +#! /usr/bin/perl + +# Adapted and translated to Perl from the test/mime-unique-id.c file in the +# Cairo (version 1.17.3) source repository. + +# Check that source surfaces with same CAIRO_MIME_TYPE_UNIQUE_ID are +# embedded only once in PDF/PS. +# +# To exercise all the surface embedding code in PDF, four types of +# source surfaces are painted on each page, each with its own UNIQUE_ID: +# - an image surface +# - a recording surface with a jpeg mime attached +# - a bounded recording surface +# - an unbounded recording surface. +# +# Four pages are generated. Each source is clipped starting with the +# smallest area on the first page increasing to the unclipped size on +# the last page. This is to ensure the output does not embed the +# source clipped to a smaller size than used on subsequent pages. + + +use strict; +use warnings; +use Cairo; + +use Fcntl; + +use feature 'say'; + +use constant + { + NUM_PAGES => 4, + WIDTH => 275, + HEIGHT => 275, + RECORDING_SIZE => 800, + TILE_SIZE => 40, + PNG_FILENAME => 'romedalen.png', + JPG_FILENAME => 'romedalen.jpg', + OUTPUT_FILENAME => 'mime-unique-id.perl.pdf', + M_PI => 3.1415926, + }; + + +sub create_image_surface + { + my $surface = Cairo::ImageSurface->create_from_png(PNG_FILENAME); + my $status = $surface->status(); + if ($status ne 'success') + { + say $surface->status(); + die; + } + + $surface->set_mime_data($surface->MIME_TYPE_UNIQUE_ID, PNG_FILENAME); + + $surface->set_mime_data($surface->MIME_TYPE_UNIQUE_ID, 'image'); + + return $surface; + } + + +sub create_recording_surface_with_mime_jpg + { + my $surface = Cairo::RecordingSurface->create('alpha', {x => 0, y => 0, width => 1, height => 1}); + if ($surface->status() ne 'success') + { + say $surface->status(); + die; + } + + my ($FH, $want, $data); + unless (sysopen($FH, JPG_FILENAME, O_RDONLY|O_BINARY)) + { + die; + } + $want = -s $FH; + $data = ''; + while (1) + { + my $rc = sysread($FH, $data, $want, length($data)); + die unless defined $rc; + last if $rc == 0; + $want -= $rc; + last if $want <= 0; + } + close($FH); + + $surface->set_mime_data($surface->MIME_TYPE_JPEG, $data); + if ($surface->status() ne 'success') + { + say $surface->status(); + die; + } + + $surface->set_mime_data($surface->MIME_TYPE_UNIQUE_ID, 'jpeg'); + if ($surface->status() ne 'success') + { + say $surface->status(); + die; + } + + return $surface; + } + + +sub draw_tile + { + my ($cr) = @_; + + $cr->move_to(10+5, 10); + $cr->arc(10, 10, 5, 0, 2*M_PI); + $cr->close_path(); + $cr->set_source_rgb(1, 0, 0); + $cr->fill(); + + $cr->move_to(30, 10-10*0.43); + $cr->line_to(25, 10+10*0.43); + $cr->line_to(35, 10+10*0.43); + $cr->close_path(); + $cr->set_source_rgb(0, 1, 0); + $cr->fill(); + + $cr->rectangle(5, 25, 10, 10); + $cr->set_source_rgb(0, 0, 0); + $cr->fill(); + + $cr->save(); + $cr->translate(30, 30); + $cr->rotate(M_PI/4.0); + $cr->rectangle(-5, -5, 10, 10); + $cr->set_source_rgb(1, 0, 1); + $cr->fill(); + $cr->restore(); + } + + +sub create_recording_surface + { + my ($bounded) = @_; + + my ($surface, $start, $size); + + if ($bounded) + { + $surface = Cairo::RecordingSurface->create('alpha', {x => 0, y => 0, width => RECORDING_SIZE, height => RECORDING_SIZE}); + ($start, $size) = (0, RECORDING_SIZE); + } + else + { + $surface = Cairo::RecordingSurface->create('alpha', undef); + ($start, $size) = (RECORDING_SIZE/2, RECORDING_SIZE*2); + } + + # Draw each tile instead of creating a cairo pattern to make size + # of the emitted recording as large as possible. + + my ($cr) = Cairo::Context->create($surface); + $cr->set_source_rgb(1, 1, 0); + $cr->paint(); + my $ctm = $cr->get_matrix(); + for (my $y = $start; $y < $size; $y += TILE_SIZE) + { + for (my $x = $start; $x < $size; $x += TILE_SIZE) + { + draw_tile($cr); + $cr->translate(TILE_SIZE, 0); + } + $ctm->translate(0, TILE_SIZE); + $cr->set_matrix($ctm); + } + $cr = undef; + + $surface->set_mime_data($surface->MIME_TYPE_UNIQUE_ID, $bounded ? 'recording bounded' : 'recording unbounded'); + if ($surface->status() ne 'success') + { + say $surface->status(); + die; + } + + return $surface; + } + +# Draw @source scaled to fit @rect and clipped to a rectangle +# @clip_margin units smaller on each side. @rect will be stroked +# with a solid line and the clip rect stroked with a dashed line. + +sub draw_surface + { + my ($cr, $source, $rect, $clip_margin) = @_; + my ($width, $height); + + my $type = $source->get_type(); + if ($type eq 'image') + { + $width = $source->get_width(); + $height = $source->get_height(); + } + elsif (defined(my $extents = $source->get_extents())) + { + $width = $$extents{width}; + $height = $$extents{height}; + } + else + { + $width = RECORDING_SIZE; + $height = RECORDING_SIZE; + } + + $cr->save(); + $cr->rectangle($$rect{x}, $$rect{y}, $$rect{width}, $$rect{height}); + $cr->stroke(); + $cr->rectangle($$rect{x}+$clip_margin, $$rect{y}+$clip_margin, $$rect{width}-$clip_margin*2, $$rect{height}-$clip_margin*2); + $cr->set_dash(0, 2, 2); + $cr->stroke_preserve(); + $cr->clip(); + + $cr->translate($$rect{x}, $$rect{y}); + $cr->scale($$rect{width}/$width, $$rect{height}/$height); + $cr->set_source_surface($source, 0, 0); + $cr->paint(); + + $cr->restore(); + } + + +sub draw_pages + { + my ($surface) = @_; + + my $cr = Cairo::Context->create($surface); + + # Draw the image and recording surface on each page. The sources + # are clipped starting with a small clip area on the first page + # and increasing to the source size on last page to ensure the + # embedded source is not clipped to the area used on the first + # page. + # + # The sources are created each time they are used to ensure + # CAIRO_MIME_TYPE_UNIQUE_ID is tested. + + for (my $i=0; $i<NUM_PAGES; $i++) + { + my $clip_margin = (NUM_PAGES-$i-1)*5; + + my $source = create_image_surface(); + draw_surface($cr, $source, {x => 25, y => 25, width => 100, height => 100,}, $clip_margin); + $source = undef; + + $source = create_recording_surface_with_mime_jpg(); + draw_surface($cr, $source, {x => 150, y => 25, width => 100, height => 100,}, $clip_margin); + $source = undef; + + $source = create_recording_surface(1); + draw_surface($cr, $source, {x => 25, y => 150, width => 100, height => 100,}, $clip_margin); + $source = undef; + + $source = create_recording_surface(0); + draw_surface($cr, $source, {x => 150, y => 150, width => 100, height => 100,}, $clip_margin); + $source = undef; # REQUIRED! + + $cr->show_page(); + } + + $cr = undef; + } + + + + +my $surface = Cairo::PdfSurface->create(OUTPUT_FILENAME, WIDTH, HEIGHT); +if ($surface->status() ne 'success') + { + say $surface->status(); + die; + } +draw_pages($surface); +$surface->finish(); + +0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cairo-1.107/examples/pdf-tagged-text.pl new/Cairo-1.108/examples/pdf-tagged-text.pl --- old/Cairo-1.107/examples/pdf-tagged-text.pl 1970-01-01 01:00:00.000000000 +0100 +++ new/Cairo-1.108/examples/pdf-tagged-text.pl 2020-11-24 07:31:53.000000000 +0100 @@ -0,0 +1,340 @@ +#! /usr/bin/perl + +# Adapted and translated to Perl from the file test/pdf-tagged-test.c in the +# Cairo (version 1.17.3) source repository by Adrian Johnson <[email protected]>. + + +use strict; +use warnings; +use Cairo; + +use feature 'say'; + + +# This test checks PDF with +# - tagged text +# - hyperlinks +# - document outline +# - metadata +# - thumbnails +# - page labels + + +use constant + { + FILENAME => 'pdf-tagged-text.pl.pdf', + + PAGE_WIDTH => 595, + PAGE_HEIGHT => 842, + + HEADING1_SIZE => 16, + HEADING2_SIZE => 14, + HEADING3_SIZE => 12, + TEXT_SIZE => 12, + HEADING_HEIGHT => 50, + MARGIN => 50, + }; + + +my @contents = + ( + [ 0, "Chapter 1", 1 ], + [ 1, "Section 1.1", 4 ], + [ 2, "Section 1.1.1", 3 ], + [ 1, "Section 1.2", 2 ], + [ 2, "Section 1.2.1", 4 ], + [ 2, "Section 1.2.2", 4 ], + [ 1, "Section 1.3", 2 ], + [ 0, "Chapter 2", 1 ], + [ 1, "Section 2.1", 4 ], + [ 2, "Section 2.1.1", 3 ], + [ 1, "Section 2.2", 2 ], + [ 2, "Section 2.2.1", 4 ], + [ 2, "Section 2.2.2", 4 ], + [ 1, "Section 2.3", 2 ], + [ 0, "Chapter 3", 1 ], + [ 1, "Section 3.1", 4 ], + [ 2, "Section 3.1.1", 3 ], + [ 1, "Section 3.2", 2 ], + [ 2, "Section 3.2.1", 4 ], + [ 2, "Section 3.2.2", 4 ], + [ 1, "Section 3.3", 2 ], + ); + +my @level_data = + ( + [HEADING1_SIZE, 'H1', ['bold', 'open'],], + [HEADING2_SIZE, 'H2', [],], + [HEADING3_SIZE, 'H3', ['italic'],], + ); + +my @ipsum_lorem = split(' ', "Lorem ipsum dolor sit amet, consectetur adipiscing" + . " elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + . " Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi" + . " ut aliquip ex ea commodo consequat. Duis aute irure dolor in" + . " reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla" + . " pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa" + . " qui officia deserunt mollit anim id est laborum."); + +my @roman_numerals = ( "i", "ii", "iii", "iv", "v", ); + + +my @paragraph_text; +my $paragraph_height = 0; +my $line_height = 0; +my $y_pos = 0; +my @outline_parents; +my $page_num = 0; + + +sub layout_paragraph + { + my ($cr) = @_; + + $cr->select_font_face('Serif', 'normal', 'normal'); + $cr->set_font_size(TEXT_SIZE); + + my $font_extents = $cr->font_extents(); + $line_height = $$font_extents{height}; + + my $curr = $ipsum_lorem[0]; + foreach (@ipsum_lorem[1..$#ipsum_lorem]) + { + my $next = join(' ', $curr, $_); + my $text_extents = $cr->text_extents($next); + if ($$text_extents{width} + 2*MARGIN > PAGE_WIDTH) + { + push @paragraph_text, $curr; + $next = $_; + } + $curr = $next; + } + if ($curr ne '') + { + push @paragraph_text, $curr; + } + + $paragraph_height = $line_height * (scalar @paragraph_text + 1); + } + + +sub draw_paragraph + { + my ($cr) = @_; + + $cr->select_font_face('Serif', 'normal', 'normal'); + $cr->set_font_size(TEXT_SIZE); + + $cr->tag_begin('P', ''); + foreach (@paragraph_text) + { + $cr->move_to(MARGIN, $y_pos); + $cr->show_text($_); + $y_pos += $line_height; + } + $cr->tag_end('P'); + + $y_pos += $line_height; + } + + +sub draw_page_num + { + my ($cr, $prefix, $num) = @_; + + my $buf = '' + . (defined $prefix) ? $prefix : '' + . ($num) ? $num : ''; + + $cr->save(); + + $cr->select_font_face('Sans', 'normal', 'normal'); + $cr->set_font_size(12); + + $cr->move_to(PAGE_WIDTH/2, PAGE_HEIGHT - MARGIN); + $cr->show_text($buf); + + $cr->restore(); + + $cr->get_target()->set_page_label($buf); + } + + +sub draw_contents + { + my ($cr, $section) = @_; + + if ($y_pos + HEADING_HEIGHT + MARGIN > PAGE_HEIGHT) + { + $cr->show_page(); + draw_page_num($cr, $roman_numerals[$page_num++], 0); + $y_pos = MARGIN; + } + + $cr->move_to(MARGIN, $y_pos); + + $cr->select_font_face('Sans', 'normal', 'normal'); + $cr->set_font_size($level_data[$$section[0]]->[0]); + + $cr->save(); + $cr->set_source_rgb(0, 0, 1); + + $cr->tag_begin('TOCI', ''); + $cr->tag_begin('Reference', ''); + $cr->tag_begin(Cairo::TAG_LINK, "dest='".$$section[1]."'"); + $cr->show_text($$section[1]); + $cr->tag_end(Cairo::TAG_LINK); + $cr->tag_end('Reference'); + $cr->tag_end('TOCI'); + + $cr->restore(); + + $y_pos += HEADING_HEIGHT; + } + + +sub draw_section + { + my ($cr, $section) = @_; + + my $parent; + + if ($$section[0] == 0) + { + $cr->show_page(); + draw_page_num($cr, undef, $page_num++); + $y_pos = MARGIN; + + $parent = $cr->get_target->OUTLINE_ROOT; + } + else + { + if ($y_pos + HEADING_HEIGHT + $paragraph_height + MARGIN > PAGE_HEIGHT) + { + $cr->show_page(); + draw_page_num($cr, undef, $page_num++); + $y_pos = MARGIN; + } + + $parent = $outline_parents[$$section[0]-1]; + } + + $cr->tag_begin('Sect', ''); + + $cr->select_font_face('Sans', 'normal', 'bold'); + $cr->set_font_size($level_data[$$section[0]]->[0]); + + $cr->move_to(MARGIN, $y_pos); + + $cr->tag_begin($level_data[$$section[0]]->[1], ''); + $cr->tag_begin(Cairo::TAG_DEST, "name='".$$section[1]."'"); + $cr->show_text($$section[1]); + $cr->tag_end(Cairo::TAG_DEST); + $cr->tag_end($level_data[$$section[0]]->[1]); + + $y_pos += HEADING_HEIGHT; + $outline_parents[$$section[0]] = $cr->get_target()->add_outline($parent, $$section[1], "dest='".$$section[1]."'", $level_data[$$section[0]]->[2]); + + for (my $i=0; $i<$$section[2]; $i++) + { + if ($y_pos + $paragraph_height + MARGIN > PAGE_HEIGHT) + { + $cr->show_page(); + draw_page_num($cr, undef, $page_num++); + $y_pos = MARGIN; + } + draw_paragraph($cr); + } + + $cr->tag_end('Sect'); + } + + +sub draw_cover + { + my ($cr) = @_; + + $cr->select_font_face("Sans", 'normal', 'bold'); + $cr->set_font_size(16); + + $cr->move_to(PAGE_WIDTH/3, PAGE_HEIGHT/2); + + $cr->tag_begin("Span", ''); + $cr->show_text("PDF Features Test"); + $cr->tag_end("Span"); + + draw_page_num($cr, "cover", 0); + } + + +sub create_document + { + my ($surface, $cr) = @_; + + layout_paragraph($cr); + + $surface->set_thumbnail_size(PAGE_WIDTH/10, PAGE_HEIGHT/10); + + $surface->set_metadata('title', "PDF Features Test"); + $surface->set_metadata('author', "cairo test suite"); + $surface->set_metadata('subject', "cairo test"); + $surface->set_metadata('keywords', "tags, links, outline, page labels, metadata, thumbnails"); + $surface->set_metadata('creator', "pdf-features"); + $surface->set_metadata('create-date', "2016-01-01T12:34:56+10:30"); + $surface->set_metadata('mod-date', "2016-06-21T05:43:21Z"); + + $cr->tag_begin("Document", ''); + + draw_cover($cr); + $surface->add_outline($surface->OUTLINE_ROOT, 'Cover', 'page=1', ['bold']); + $cr->show_page(); + + $page_num = 0; + draw_page_num($cr, $roman_numerals[$page_num++], 0); + $y_pos = MARGIN; + + $surface->add_outline($surface->OUTLINE_ROOT, "Contents", "dest='TOC'", ['bold']); + + $cr->tag_begin(Cairo::TAG_DEST, "name='TOC' internal"); + $cr->tag_begin("TOC", ''); + + foreach (@contents) + { + draw_contents($cr, $_); + } + + $cr->tag_end("TOC"); + $cr->tag_end(Cairo::TAG_DEST); + + $page_num = 1; + foreach (@contents) + { + draw_section($cr, $_); + } + + $cr->tag_end("Document"); + } + + +my $surface = Cairo::PdfSurface->create(FILENAME, PAGE_WIDTH, PAGE_HEIGHT); + +my $cr = Cairo::Context->create($surface); +create_document($surface, $cr); + +my $status = $cr->status(); +$cr = undef; +$surface->finish(); +my $status2 = $surface->status(); +if ($status ne 'success') + { + $status = $status2; + } + +$surface = undef; +if ($status ne 'success') + { + say "Failed to create pdf surface: $status"; + die; + } + +0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cairo-1.107/lib/Cairo.pm new/Cairo-1.108/lib/Cairo.pm --- old/Cairo-1.107/lib/Cairo.pm 2019-10-07 06:35:50.000000000 +0200 +++ new/Cairo-1.108/lib/Cairo.pm 2020-11-24 07:54:42.000000000 +0100 @@ -14,7 +14,7 @@ our @ISA = qw/DynaLoader/; -our $VERSION = '1.107'; +our $VERSION = '1.108'; sub dl_load_flags { $^O eq 'darwin' ? 0x00 : 0x01 } @@ -358,6 +358,16 @@ =back +=item Predefined names: + +=over + +=item Cairo::TAG_DEST [1.16] + +=item Cairo::TAG_LINK [1.16] + +=back + =item $cr->copy_page =item $cr->show_page @@ -1369,6 +1379,54 @@ =item $type = $surface->get_type [1.2] +=item $surface->set_mime_data ($mime_type, $mime_data) [1.10] + +=item $mime_data = $surface->get_mime_data ($mime_type) [1.10] + +=item $bool = $surface->supports_mime_type ($mime_type) [1.12] + +=over + +=item $mime_type: string + +=over + +=item Predefined MIME types: + +=over + +=item Cairo::Surface::MIME_TYPE_JP2 [1.10] + +=item Cairo::Surface::MIME_TYPE_JPEG [1.10] + +=item Cairo::Surface::MIME_TYPE_PNG [1.10] + +=item Cairo::Surface::MIME_TYPE_URI [1.10] + +=item Cairo::Surface::MIME_TYPE_UNIQUE_ID [1.12] + +=item Cairo::Surface::MIME_TYPE_JBIG2 [1.14] + +=item Cairo::Surface::MIME_TYPE_JBIG2_GLOBAL [1.14] + +=item Cairo::Surface::MIME_TYPE_JBIG2_GLOBAL_PARAMS [1.14] + +=item Cairo::Surface::MIME_TYPE_CCITT_FAX [1.16] + +=item Cairo::Surface::MIME_TYPE_CCITT_FAX_PARAMS [1.16] + +=item Cairo::Surface::MIME_TYPE_EPS [1.16] + +=item Cairo::Surface::MIME_TYPE_EPS_PARAMS [1.16] + +=back + +=back + +=item $mime_data: binary data string + +=back + =item $status = $surface->copy_page [1.6] =over @@ -1509,6 +1567,22 @@ =back +=item $item_id = $surface->add_outline($parent_id, $name, $attributes, $flags) [1.16] + +=over + +=item $item_id: int, item ID + +=item $parent_id: parent item id or Cairo::PdfSurface::OUTLINE_ROOT + +=item $name: string, item display + +=item $attributes: string, item attributes + +=item $flags: list reference, item flags + +=back + =item $surface->set_metadata($name, $value) [1.16] =over @@ -1519,6 +1593,24 @@ =back +=item $surface->set_page_label($label) [1.16] + +=over + +=item $label: string, page label + +=back + +=item $surface->set_thumbnail_size($width, $height) [1.16] + +=over + +=item $width: int, thumbnail width + +=item $height: int, thumbnail height + +=back + =back =cut @@ -1695,6 +1787,14 @@ =item ($x0, $y0, $width, $height) = $surface->ink_extents [1.10] +=item $extents_ref = $surface->get_extents [1.12] + +=over + +=item $extents_ref: I<Cairo::Rectangle> reference + +=back + =back =cut diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cairo-1.107/perl-Cairo.doap new/Cairo-1.108/perl-Cairo.doap --- old/Cairo-1.107/perl-Cairo.doap 2019-09-29 03:48:25.000000000 +0200 +++ new/Cairo-1.108/perl-Cairo.doap 1970-01-01 01:00:00.000000000 +0100 @@ -1,20 +0,0 @@ -<Project xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" - xmlns:foaf="http://xmlns.com/foaf/0.1/" - xmlns:gnome="http://api.gnome.org/doap-extensions#" - xmlns="http://usefulinc.com/ns/doap#"> - - <name xml:lang="en">Cairo</name> - <shortdesc xml:lang="en">Perl interface to the cairo 2d vector graphics library</shortdesc> - <homepage rdf:resource="http://gtk2-perl.sourceforge.net/" /> - <mailing-list rdf:resource="http://mail.gnome.org/mailman/listinfo/gtk-perl-list" /> - - <maintainer> - <foaf:Person> - <foaf:name>Torsten Schönfeld</foaf:name> - <foaf:mbox rdf:resource="mailto:[email protected]" /> - <gnome:userid>tsch</gnome:userid> - </foaf:Person> - </maintainer> - -</Project> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cairo-1.107/perl-cairo.doap new/Cairo-1.108/perl-cairo.doap --- old/Cairo-1.107/perl-cairo.doap 1970-01-01 01:00:00.000000000 +0100 +++ new/Cairo-1.108/perl-cairo.doap 2019-09-29 03:48:25.000000000 +0200 @@ -0,0 +1,20 @@ +<Project xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:foaf="http://xmlns.com/foaf/0.1/" + xmlns:gnome="http://api.gnome.org/doap-extensions#" + xmlns="http://usefulinc.com/ns/doap#"> + + <name xml:lang="en">Cairo</name> + <shortdesc xml:lang="en">Perl interface to the cairo 2d vector graphics library</shortdesc> + <homepage rdf:resource="http://gtk2-perl.sourceforge.net/" /> + <mailing-list rdf:resource="http://mail.gnome.org/mailman/listinfo/gtk-perl-list" /> + + <maintainer> + <foaf:Person> + <foaf:name>Torsten Schönfeld</foaf:name> + <foaf:mbox rdf:resource="mailto:[email protected]" /> + <gnome:userid>tsch</gnome:userid> + </foaf:Person> + </maintainer> + +</Project> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cairo-1.107/t/CairoSurface.t new/Cairo-1.108/t/CairoSurface.t --- old/Cairo-1.107/t/CairoSurface.t 2019-09-29 03:48:25.000000000 +0200 +++ new/Cairo-1.108/t/CairoSurface.t 2020-11-24 07:31:53.000000000 +0100 @@ -12,7 +12,7 @@ use Config; # for byteorder -use Test::More tests => 89; +use Test::More tests => 100; use constant IMG_WIDTH => 256; use constant IMG_HEIGHT => 256; @@ -216,7 +216,7 @@ } SKIP: { - skip 'pdf surface', 14 + skip 'pdf surface', 18 unless Cairo::HAS_PDF_SURFACE; my $surf = Cairo::PdfSurface->create ('tmp.pdf', IMG_WIDTH, IMG_HEIGHT); @@ -269,6 +269,30 @@ } SKIP: { + skip 'new stuff', 4 + unless Cairo::VERSION >= Cairo::VERSION_ENCODE (1, 10, 0); + + my $mime_data = 'mime data for {set,get}_mime_data'; + is ($surf->MIME_TYPE_JPEG, 'image/jpeg'); + is ($surf->set_mime_data($surf->MIME_TYPE_JPEG, $mime_data), 'success'); + + my $recovered_mime_data = $surf->get_mime_data('unset mime type'); + is ($recovered_mime_data, undef); + + $recovered_mime_data = $surf->get_mime_data($surf->MIME_TYPE_JPEG); + is ($recovered_mime_data, $mime_data); + } + + SKIP: { + skip 'new stuff', 2 + unless Cairo::VERSION >= Cairo::VERSION_ENCODE (1, 12, 0); + + is ($surf->supports_mime_type(Cairo::Surface::MIME_TYPE_JPEG), 1); + is ($surf->supports_mime_type('unsupported mime type'), 0); + + } + + SKIP: { skip 'new stuff', 1 unless Cairo::VERSION >= Cairo::VERSION_ENCODE (1, 16, 0); @@ -278,6 +302,24 @@ ok(1); # No get_metadata, so assume OK if we're still alive } + SKIP: { + skip 'new stuff', 3 + unless Cairo::VERSION >= Cairo::VERSION_ENCODE (1, 16, 0); + + $surf->set_page_label('Page label'); + is ($surf->status(), 'success'); + + $surf->set_thumbnail_size(20, 20); + is ($surf->status(), 'success'); + + my $parent = $surf->add_outline($surf->OUTLINE_ROOT(), 'Cover', "dest='page=1'", ['bold']); + $parent = $surf->add_outline($parent, 'Chapter 1', 'page=2', ['bold', 'open']); + $parent = $surf->add_outline($parent, 'Section 1', 'page=2', ['open']); + $parent = $surf->add_outline($parent, 'Section 1.1', 'page=2', ['italic']); + $parent = $surf->add_outline($parent, 'Review', 'page=2', []); + is ($surf->status(), 'success'); + } + unlink 'tmp.pdf'; } @@ -392,7 +434,7 @@ } SKIP: { - skip 'svg surface', 5 + skip 'recording surface', 7 unless Cairo::HAS_RECORDING_SURFACE; my $surf = Cairo::RecordingSurface->create ( @@ -411,4 +453,15 @@ $surf = Cairo::RecordingSurface->create ('color', undef); isa_ok ($surf, 'Cairo::RecordingSurface'); isa_ok ($surf, 'Cairo::Surface'); + + SKIP: { + skip 'get_extents', 2 + unless Cairo::VERSION >= Cairo::VERSION_ENCODE (1, 12, 0); + + $surf = Cairo::RecordingSurface->create ('color', undef); + is ($surf->get_extents(), undef); + + $surf = Cairo::RecordingSurface->create ('color', {x => 5, y => 10, width => 15, height => 20}); + is_deeply ($surf->get_extents(), {x => 5, y => 10, width => 15, height => 20}); + } } ++++++ cpanspec.yml ++++++ --- /var/tmp/diff_new_pack.8PUnoA/_old 2020-12-01 14:24:06.733679362 +0100 +++ /var/tmp/diff_new_pack.8PUnoA/_new 2020-12-01 14:24:06.737679367 +0100 @@ -21,3 +21,4 @@ #custom_test: |- #startserver && make test #ignore_requires: Bizarre::Module +skip_doc: ^(cairo-perl.typemap|doctypes|perl-cairo.doap)$ _______________________________________________ openSUSE Commits mailing list -- [email protected] To unsubscribe, email [email protected] List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/[email protected]
