[perl-Glib] Register the fundamental type Glib::GType



commit 9096b87cbc53dd4b614f6f6b1c12bf7c721dceeb
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Sun May 16 14:22:01 2010 +0200

    Register the fundamental type Glib::GType
    
    This makes $pspec->get_value_type return 'Glib::GType' instead of
    'GType' (from the fallback call to g_type_name).  It also allows you to
    use 'Glit::GType' wherever a type is asked for, e.g. for columns in a
    tree view.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=591070

 GType.xs |    1 +
 t/e.t    |    6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/GType.xs b/GType.xs
index d3b59f0..bffdae4 100644
--- a/GType.xs
+++ b/GType.xs
@@ -2018,6 +2018,7 @@ BOOT:
 	gperl_register_fundamental (G_TYPE_FLOAT, "Glib::Float");
 	gperl_register_fundamental (G_TYPE_DOUBLE, "Glib::Double");
 	gperl_register_fundamental (G_TYPE_BOOLEAN, "Glib::Boolean");
+	gperl_register_fundamental (G_TYPE_GTYPE, "Glib::GType");
 	gperl_register_boxed (GPERL_TYPE_SV, "Glib::Scalar", NULL);
 
 	/* i love nasty ugly hacks for backwards compat... Glib::UInt used
diff --git a/t/e.t b/t/e.t
index 5d267d6..07b1ee6 100644
--- a/t/e.t
+++ b/t/e.t
@@ -5,7 +5,7 @@
 use strict;
 use utf8;
 use Glib ':constants';
-use Test::More tests => 273;
+use Test::More tests => 275;
 
 # first register some types with which to play below.
 
@@ -223,7 +223,7 @@ foreach (@params) {
 # the testing logic above.
 #
 SKIP: {
-	skip "GParamSpecGType is new in glib 2.10.0", 16
+	skip "GParamSpecGType is new in glib 2.10.0", 18
 		unless Glib->CHECK_VERSION (2, 10, 0);
 	@params = ();
 
@@ -234,6 +234,7 @@ SKIP: {
 	isa_ok ($pspec, 'Glib::Param::GType');
 	isa_ok ($pspec, 'Glib::ParamSpec');
 	is ($pspec->get_is_a_type, 'Glib::Object');
+	is ($pspec->get_value_type, 'Glib::GType');
 	push @params, $pspec;
 
 	$pspec = Glib::ParamSpec->gtype ('type', 'Any type', "Any type",
@@ -241,6 +242,7 @@ SKIP: {
 	isa_ok ($pspec, 'Glib::Param::GType');
 	isa_ok ($pspec, 'Glib::ParamSpec');
 	is ($pspec->get_is_a_type, undef);
+	is ($pspec->get_value_type, 'Glib::GType');
 	push @params, $pspec;
 
 	Glib::Type->register ('Glib::Object' => 'Baz', properties => \ params);



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