[perl-Glib-Object-Introspection] Implement GValue → SV



commit ecd2d0c70e066af211cc07d98b19cecf9e4babc8
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Wed Nov 10 22:15:15 2010 +0100

    Implement GValue â?? SV

 GObjectIntrospection.xs |    7 +++++++
 t/values.t              |   14 ++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/GObjectIntrospection.xs b/GObjectIntrospection.xs
index 432322d..098f0ba 100644
--- a/GObjectIntrospection.xs
+++ b/GObjectIntrospection.xs
@@ -799,6 +799,10 @@ sv_to_interface (GIArgInfo * arg_info,
 			/* FIXME: User cannot supply user data. */
 			dwarn ("    closure type\n");
 			arg->v_pointer = gperl_closure_new (sv, NULL, FALSE);
+		} else if (type == G_TYPE_VALUE) {
+			dwarn ("    value type\n");
+			croak ("FIXME - don't know how to convert an arbitrary SV "
+			       "to a GValue");
 		} else {
 			dwarn ("    boxed type: %s (%d)\n",
 			       g_type_name (type), type);
@@ -872,6 +876,9 @@ interface_to_sv (GITypeInfo* info, GArgument *arg, gboolean own)
 		if (!type || type == G_TYPE_NONE) {
 			dwarn ("    unboxed type\n");
 			sv = struct_to_sv (interface, info_type, pointer, own);
+		} else if (type == G_TYPE_VALUE) {
+			dwarn ("    value type\n");
+			sv = gperl_sv_from_value (pointer);
 		} else {
 			dwarn ("    boxed type: %d (%s)\n",
 			       type, g_type_name (type));
diff --git a/t/values.t b/t/values.t
new file mode 100644
index 0000000..3baad8e
--- /dev/null
+++ b/t/values.t
@@ -0,0 +1,14 @@
+#!/usr/bin/env perl
+
+BEGIN { require './t/inc/setup.pl' };
+
+use strict;
+use warnings;
+
+plan tests => 2;
+
+SKIP: {
+  skip 'SV â?? GValue not implemented', 1;
+  is (test_int_value_arg (23), 23);
+}
+is (test_value_return (23), 23);



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