[perl-Gnome2-Rsvg] Try to load Cairo from Gnome2::Rsvg



commit 7532c544d7bf28e473b6eb14b197bee430a93766
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Mon May 17 22:01:33 2010 +0200

    Try to load Cairo from Gnome2::Rsvg
    
    Since we already load Gtk2, this was already done for us in most cases
    anyway.  But to be safe and explicit, try to load Cairo here too.

 Rsvg.pm  |   23 ++++++++++++++++++++---
 t/Rsvg.t |    2 --
 2 files changed, 20 insertions(+), 5 deletions(-)
---
diff --git a/Rsvg.pm b/Rsvg.pm
index d599cf1..0ead974 100644
--- a/Rsvg.pm
+++ b/Rsvg.pm
@@ -1,11 +1,14 @@
-# $Id$
-
 package Gnome2::Rsvg;
 
 use 5.008;
 use strict;
 use warnings;
 
+
+# If librsvg-2.0 >= 2.14, we need Cairo.  Gtk2 may or may not load Cairo for,
+# so better do it here.
+eval "use Cairo;";
+
 use Glib;
 use Gtk2;
 
@@ -65,6 +68,20 @@ Torsten Schoenfeld E<lt>kaffeetisch at gmx dot deE<gt>.
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2003-2005 by the gtk2-perl team
+Copyright (C) 2003-2005, 2010  Torsten Schoenfeld
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 =cut
diff --git a/t/Rsvg.t b/t/Rsvg.t
index a5d5f2c..5df416d 100644
--- a/t/Rsvg.t
+++ b/t/Rsvg.t
@@ -95,8 +95,6 @@ SKIP: {
   skip("cairo integretaion is new in 2.14", 0)
     unless (Gnome2::Rsvg -> CHECK_VERSION(2, 14, 0));
 
-  require Cairo;
-  Cairo->import;
   my $surface = Cairo::ImageSurface -> create("argb32", 10, 10);
   my $cr = Cairo::Context -> create($surface);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]