Skip Menu |

This queue is for tickets about the Cairo CPAN distribution.

Report information
The Basics
Id: 130326
Status: resolved
Priority: 0/
Queue: Cairo

People
Owner: Nobody in particular
Requestors: jv [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Request for tag link functions
Please add the API functions cairo_tag_begin cairo_tag_end Thanks!
The attached patch against 1.106 adds tag_begin and tag_end to the context. It includes test and documentation updates. Thanks.
Subject: perl-Cairo-1.106-tag.patch
*** Cairo-1.106/Cairo.xs~ 2013-02-03 07:07:45.000000000 +0100 --- Cairo-1.106/Cairo.xs 2019-08-18 21:46:42.700001288 +0200 *************** *** 898,903 **** --- 898,907 ---- cairo_status_t cairo_status (cairo_t *cr); + 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); + # --------------------------------------------------------------------------- # MODULE = Cairo PACKAGE = Cairo PREFIX = cairo_ *** Cairo-1.106/lib/Cairo.pm~ 2015-09-29 07:05:09.000000000 +0200 --- Cairo-1.106/lib/Cairo.pm 2019-08-19 08:33:36.933610608 +0200 *************** *** 340,345 **** --- 340,363 ---- =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 *** Cairo-1.106/t/Cairo.t~ 2012-01-20 07:48:37.000000000 +0100 --- Cairo-1.106/t/Cairo.t 2019-08-19 08:38:41.376156929 +0200 *************** *** 10,16 **** use strict; use warnings; ! use Test::More tests => 70; unless (eval 'use Test::Number::Delta; 1;') { my $reason = 'Test::Number::Delta not available'; --- 10,16 ---- use strict; use warnings; ! use Test::More tests => 72; unless (eval 'use Test::Number::Delta; 1;') { my $reason = 'Test::Number::Delta not available'; *************** *** 286,288 **** --- 286,298 ---- $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'); + }
On Mon Aug 19 03:33:39 2019, JV wrote: Show quoted text
> The attached patch against 1.106 adds tag_begin and tag_end to the context. > It includes test and documentation updates. > Thanks.
Thank you for your contribution, and sorry for the late reply. The XS code needs to be protected with: #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 16, 0) ... #endif Apart from this, the patch looks fine.
Revised patch.
Subject: perl-Cairo-1.106-tag.patch
*** Cairo-1.106/Cairo.xs~ 2013-02-03 07:07:45.000000000 +0100 --- Cairo-1.106/Cairo.xs 2019-08-18 21:46:42.700001288 +0200 *************** *** 898,903 **** --- 898,911 ---- 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_ *** Cairo-1.106/lib/Cairo.pm~ 2015-09-29 07:05:09.000000000 +0200 --- Cairo-1.106/lib/Cairo.pm 2019-08-19 08:33:36.933610608 +0200 *************** *** 340,345 **** --- 340,363 ---- =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 *** Cairo-1.106/t/Cairo.t~ 2012-01-20 07:48:37.000000000 +0100 --- Cairo-1.106/t/Cairo.t 2019-08-19 08:38:41.376156929 +0200 *************** *** 10,16 **** use strict; use warnings; ! use Test::More tests => 70; unless (eval 'use Test::Number::Delta; 1;') { my $reason = 'Test::Number::Delta not available'; --- 10,16 ---- use strict; use warnings; ! use Test::More tests => 72; unless (eval 'use Test::Number::Delta; 1;') { my $reason = 'Test::Number::Delta not available'; *************** *** 286,288 **** --- 286,298 ---- $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'); + }