[cairo-commit] cairo-perl/t Cairo.t, 1.6, 1.7 CairoFont.t, 1.2, 1.3 CairoPattern.t, 1.3, 1.4 CairoSurface.t, 1.4, 1.5

Torsten Schoenfeld commit at pdx.freedesktop.org
Sun May 7 07:17:41 PDT 2006


Committed by: tsch

Update of /cvs/cairo/cairo-perl/t
In directory kemper:/tmp/cvs-serv11703/t

Modified Files:
	Cairo.t CairoFont.t CairoPattern.t CairoSurface.t 
Log Message:
	* .cvsignore, MANIFEST.SKIP: Update.
	
	* Cairo.pm: Update copyright notice.
	
	* MANIFEST, cairo-perl-private.h: Add a private header file for
	non-public declarations that are used in more than one place.
	
	* MakeHelper.pm: Improve the enum converters to produce more useful
	error messages.
	
	* Makefile.PL: Incorporate a slightly modified patch from  Christopher
	Oezbek to prompt the user if he wants to install EU::Depends and
	EU::PkgConfig if they can't be found.  Require cairo >= 1.1.6.  Update
	and rearrange enums.
	
	* cairo-perl.h, Cairo.xs: Move CAIRO_PERL_CALL_BOOT to Cairo.xs.
	
	* cairo-perl.h, CairoSurface.xs, CairoPattern.xs, Makefile.PL: Use
	cairo_surface_get_type and cairo_pattern_get_type to redo the sub-type
	handling for surfaces and patterns.
	
	* cairo-perl-private.h, Cairo.xs, CairoMatrix.xs, CairoPattern.xs: Add
	pcairo_copy_matrix and use it all over the place to make matrix handling
	more robust.

	* Cairo.xs, t/Cairo.t: Wrap cairo_version, cairo_version_string,
	cairo_push_group, cairo_push_group_with_content, cairo_pop_group,
	cairo_pop_group_to_source, cairo_new_sub_path, cairo_set_scaled_font,
	and cairo_get_group_target.

	* CairoFont.xs, t/CairoFont.t: Wrap cairo_font_face_get_type,
	cairo_scaled_font_get_type, cairo_scaled_font_text_extents,
	cairo_scaled_font_get_font_face, cairo_scaled_font_get_font_matrix,
	cairo_scaled_font_get_ctm, and cairo_scaled_font_get_font_options.

	* CairoPattern.xs, t/CairoPattern.t: Wrap cairo_pattern_get_type.

	* CairoSurface.xs, t/CairoSurface.t: Wrap
	cairo_surface_get_device_offset, cairo_surface_get_type,
	cairo_pdf_surface_set_size, cairo_ps_surface_set_dpi,
	cairo_ps_surface_set_size, cairo_ps_surface_dsc_comment,
	cairo_ps_surface_dsc_begin_setup, and cairo_ps_surface_dsc_begin_setup.


Index: Cairo.t
===================================================================
RCS file: /cvs/cairo/cairo-perl/t/Cairo.t,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Cairo.t	10 Aug 2005 17:01:54 -0000	1.6
+++ Cairo.t	7 May 2006 14:17:39 -0000	1.7
@@ -9,7 +9,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 50;
+use Test::More tests => 54;
 
 use constant {
 	IMG_WIDTH => 256,
@@ -20,6 +20,9 @@
 	use_ok ('Cairo');
 }
 
+ok(Cairo::version > 0);
+ok(defined Cairo::version_string);
+
 my $surf = Cairo::ImageSurface->create ('rgb24', IMG_WIDTH, IMG_HEIGHT);
 isa_ok ($surf, 'Cairo::Surface');
 
@@ -29,6 +32,13 @@
 $cr->save;
 $cr->restore;
 
+$cr->push_group();
+isa_ok ($cr->get_group_target, 'Cairo::Surface');
+isa_ok ($cr->pop_group(), 'Cairo::Pattern');
+
+$cr->push_group_with_content('color');
+$cr->pop_group_to_source();
+
 $cr->set_operator ('clear');
 is ($cr->get_operator, 'clear');
 
@@ -82,6 +92,7 @@
 is_deeply ([$cr->device_to_user_distance (1, 2)], [1, 2]);
 
 $cr->new_path;
+$cr->new_sub_path;
 $cr->move_to (1.1, 2.2);
 $cr->line_to (2.2, 3.3);
 $cr->curve_to (3.3, 4.4, 5.5, 6.6, 7.7, 8.8);
@@ -160,6 +171,12 @@
 $cr->text_path ('Urgs?');
 $cr->glyph_path (@glyphs);
 
+my $options = Cairo::FontOptions->create;
+my $matrix = Cairo::Matrix->init_identity;
+my $ctm = Cairo::Matrix->init_identity;
+my $font = Cairo::ScaledFont->create ($face, $matrix, $ctm, $options);
+$cr->set_scaled_font ($font);
+
 isa_ok ($cr->get_source, 'Cairo::Pattern');
 
 my @pnt = $cr->get_current_point;

Index: CairoFont.t
===================================================================
RCS file: /cvs/cairo/cairo-perl/t/CairoFont.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CairoFont.t	29 Jul 2005 17:19:55 -0000	1.2
+++ CairoFont.t	7 May 2006 14:17:39 -0000	1.3
@@ -9,7 +9,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 13;
+use Test::More tests => 20;
 
 use constant {
 	IMG_WIDTH => 256,
@@ -48,12 +48,22 @@
 my $face = $cr->get_font_face;
 
 is ($face->status, 'success');
+ok (defined $face->get_type);
 
 my $matrix = Cairo::Matrix->init_identity;
 my $ctm = Cairo::Matrix->init_identity;
 
 my $font = Cairo::ScaledFont->create ($face, $matrix, $ctm, $options);
 isa_ok ($font, 'Cairo::ScaledFont');
+
 is ($font->status, 'success');
+ok (defined $font->get_type);
+
 isa_ok ($font->extents, 'HASH');
+isa_ok ($font->text_extents('Bla'), 'HASH');
 isa_ok ($font->glyph_extents ({ index => 1, x => 2, y => 3 }), 'HASH');
+
+isa_ok ($font->get_font_face, 'Cairo::FontFace');
+isa_ok ($font->get_font_matrix, 'Cairo::Matrix');
+isa_ok ($font->get_ctm, 'Cairo::Matrix');
+isa_ok ($font->get_font_options, 'Cairo::FontOptions');

Index: CairoPattern.t
===================================================================
RCS file: /cvs/cairo/cairo-perl/t/CairoPattern.t,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CairoPattern.t	29 Jan 2006 19:27:21 -0000	1.3
+++ CairoPattern.t	7 May 2006 14:17:39 -0000	1.4
@@ -9,7 +9,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 16;
+use Test::More tests => 17;
 
 use constant {
 	IMG_WIDTH => 256,
@@ -55,3 +55,4 @@
 isa_ok ($pat->get_matrix, 'Cairo::Matrix');
 
 is ($pat->status, 'success');
+is ($pat->get_type, 'radial');

Index: CairoSurface.t
===================================================================
RCS file: /cvs/cairo/cairo-perl/t/CairoSurface.t,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CairoSurface.t	10 Aug 2005 17:01:54 -0000	1.4
+++ CairoSurface.t	7 May 2006 14:17:39 -0000	1.5
@@ -9,7 +9,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 19;
+use Test::More tests => 21;
 
 use constant {
 	IMG_WIDTH => 256,
@@ -32,8 +32,10 @@
 isa_ok ($surf, 'Cairo::Surface');
 
 $surf->set_device_offset (23, 42);
+is_deeply ([$surf->get_device_offset], [23, 42]);
 
 is ($surf->status, 'success');
+is ($surf->get_type, 'image');
 
 $surf->finish;
 
@@ -65,12 +67,14 @@
 	isa_ok ($surf, 'Cairo::PdfSurface');
 	isa_ok ($surf, 'Cairo::Surface');
 
+	$surf->set_dpi (72, 72);
+	$surf->set_size (23, 42);
+
 	$surf = $surf->create_similar ('alpha', IMG_WIDTH, IMG_HEIGHT);
-	isa_ok ($surf, 'Cairo::PdfSurface');
+	# the pdf backend falls back to an image surface currently
+	isa_ok ($surf, 'Cairo::ImageSurface');
 	isa_ok ($surf, 'Cairo::Surface');
 
-	$surf->set_dpi (72, 72);
-
 	unlink 'tmp.pdf';
 }
 
@@ -82,11 +86,17 @@
 	isa_ok ($surf, 'Cairo::PsSurface');
 	isa_ok ($surf, 'Cairo::Surface');
 
+	$surf->set_dpi (72, 72);
+	$surf->set_size (23, 42);
+	
+	$surf->dsc_comment("Bla?");
+	$surf->dsc_begin_setup;
+	$surf->dsc_begin_page_setup;
+
 	$surf = $surf->create_similar ('alpha', IMG_WIDTH, IMG_HEIGHT);
-	isa_ok ($surf, 'Cairo::PsSurface');
+	# the ps backend falls back to an image surface currently
+	isa_ok ($surf, 'Cairo::ImageSurface');
 	isa_ok ($surf, 'Cairo::Surface');
 
-	# $surf->set_dpi (72, 72);
-
 	unlink 'tmp.ps';
 }



More information about the cairo-commit mailing list