Hello community,
here is the log from the commit of package perl-Glib-Object-Introspection for
openSUSE:Factory checked in at 2017-05-16 14:43:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Glib-Object-Introspection (Old)
and /work/SRC/openSUSE:Factory/.perl-Glib-Object-Introspection.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Glib-Object-Introspection"
Tue May 16 14:43:01 2017 rev:9 rq:494271 version:0.042
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-Glib-Object-Introspection/perl-Glib-Object-Introspection.changes
2015-12-29 13:00:19.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.perl-Glib-Object-Introspection.new/perl-Glib-Object-Introspection.changes
2017-05-16 14:44:18.850219740 +0200
@@ -1,0 +2,21 @@
+Tue May 9 16:45:47 UTC 2017 - [email protected]
+
+- Update to version 0.042 (changes since 0.040):
+ ∗ Tweak the test environment to work with newer
+ ExtUtils::MakeMaker.
+ * Use the stack in favour of heap allocation during marshalling.
+ * Use custom code to find struct methods in order to avoid a bug.
+ * Remove an unused internal variable.
+ * Add support for object class functions.
+ * Add support for marshalling GParamSpec.
+ * Add Glib::Object::Introspection::GValueWrapper::get_value.
+ * perli11ndoc: Put special classes and records into their own
+ category.
+ * perli11ndoc: List functions of enums and bitfields.
+ * perli11ndoc: Fix the synopsis formatting for class struct
+ functions.
+ * perli11ndoc: Correctly display array and callback
+ parameters/return values/fields.
+ * Fix "occuring" typo in POD (bgo#775169).
+
+-------------------------------------------------------------------
Old:
----
Glib-Object-Introspection-0.040.tar.gz
New:
----
Glib-Object-Introspection-0.042.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Glib-Object-Introspection.spec ++++++
--- /var/tmp/diff_new_pack.AVYJK5/_old 2017-05-16 14:44:19.498128703 +0200
+++ /var/tmp/diff_new_pack.AVYJK5/_new 2017-05-16 14:44:19.502128141 +0200
@@ -1,7 +1,7 @@
#
# spec file for package perl-Glib-Object-Introspection
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%define cpan_name Glib-Object-Introspection
Name: perl-Glib-Object-Introspection
-Version: 0.040
+Version: 0.042
Release: 0
Summary: GObject Introspection bindings for Perl
License: LGPL-2.1+
@@ -27,6 +27,7 @@
Source:
https://cpan.metacpan.org/authors/id/X/XA/XAOC/%{cpan_name}-%{version}.tar.gz
BuildRequires: perl
BuildRequires: perl-macros
+BuildRequires: pkgconfig
BuildRequires: perl(ExtUtils::Depends)
BuildRequires: perl(ExtUtils::PkgConfig)
BuildRequires: perl(Glib) >= 1.320
@@ -45,8 +46,8 @@
%setup -q -n %{cpan_name}-%{version}
%build
-perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE='%{optflags}'
-make %{?_smp_mflags}
+perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
+make %{?_smp_mflags} V=1
%install
%perl_make_install
++++++ Glib-Object-Introspection-0.040.tar.gz ->
Glib-Object-Introspection-0.042.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Glib-Object-Introspection-0.040/GObjectIntrospection.xs
new/Glib-Object-Introspection-0.042/GObjectIntrospection.xs
--- old/Glib-Object-Introspection-0.040/GObjectIntrospection.xs 2015-04-24
02:10:35.000000000 +0200
+++ new/Glib-Object-Introspection-0.042/GObjectIntrospection.xs 2016-11-21
14:44:53.000000000 +0100
@@ -104,15 +104,15 @@
guint current_pos;
/* Information about the args from the typelib. */
- GIArgInfo ** arg_infos;
- GITypeInfo ** arg_types;
+ GIArgInfo * arg_infos;
+ GITypeInfo * arg_types;
/* An array of places for storing out out/in-out or automatic args. */
GIArgument * aux_args;
gboolean has_return_value;
ffi_type * return_type_ffi;
- GITypeInfo * return_type_info;
+ GITypeInfo return_type_info;
GITransfer return_type_transfer;
GSList * callback_infos;
@@ -230,7 +230,7 @@
GPerlI11nInvocationInfo * invocation_info);
static SV * instance_pointer_to_sv (GICallableInfo *info, gpointer pointer);
-static gpointer instance_sv_to_pointer (GICallableInfo *info, SV *sv);
+static gpointer instance_sv_to_pointer (GICallableInfo *info, SV *sv,
GPerlI11nInvocationInfo *iinfo);
static void sv_to_arg (SV * sv,
GIArgument * arg,
@@ -1039,6 +1039,16 @@
OUTPUT:
RETVAL
+SV *
+get_value (SV *sv)
+ PREINIT:
+ GValue *v;
+ CODE:
+ v = SvGValueWrapper (sv);
+ RETVAL = gperl_sv_from_value (v);
+ OUTPUT:
+ RETVAL
+
void
DESTROY (SV *sv)
PREINIT:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Glib-Object-Introspection-0.040/MANIFEST
new/Glib-Object-Introspection-0.042/MANIFEST
--- old/Glib-Object-Introspection-0.040/MANIFEST 2015-12-21
20:19:20.000000000 +0100
+++ new/Glib-Object-Introspection-0.042/MANIFEST 2016-12-23
23:34:38.000000000 +0100
@@ -43,6 +43,7 @@
t/inc/setup.pl
t/interface-implementation.t
t/objects.t
+t/param-specs.t
t/structs.t
t/values.t
t/variants.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Glib-Object-Introspection-0.040/META.json
new/Glib-Object-Introspection-0.042/META.json
--- old/Glib-Object-Introspection-0.040/META.json 2015-12-21
20:19:20.000000000 +0100
+++ new/Glib-Object-Introspection-0.042/META.json 2016-12-23
23:34:38.000000000 +0100
@@ -1,11 +1,13 @@
{
"abstract" : "Dynamically create Perl language bindings",
"author" : [
+ "unknown",
"Glib::Object::Introspection Team <gtk-perl-list at gnome dot org>"
],
"dynamic_config" : 1,
- "generated_by" : "ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter
version 2.150001",
+ "generated_by" : "ExtUtils::MakeMaker version 7.18, CPAN::Meta::Converter
version 2.150005",
"license" : [
+ "unknown",
"lgpl_2_1"
],
"meta-spec" : {
@@ -66,5 +68,6 @@
"x_IRC" : "irc://irc.gimp.org/#gtk-perl",
"x_MailingList" : "https://mail.gnome.org/mailman/listinfo/gtk-perl-list"
},
- "version" : "0.040"
+ "version" : "0.042",
+ "x_serialization_backend" : "JSON::PP version 2.27300"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Glib-Object-Introspection-0.040/META.yml
new/Glib-Object-Introspection-0.042/META.yml
--- old/Glib-Object-Introspection-0.040/META.yml 2015-12-21
20:19:20.000000000 +0100
+++ new/Glib-Object-Introspection-0.042/META.yml 2016-12-23
23:34:38.000000000 +0100
@@ -1,6 +1,7 @@
---
abstract: 'Dynamically create Perl language bindings'
author:
+ - unknown
- 'Glib::Object::Introspection Team <gtk-perl-list at gnome dot org>'
build_requires:
ExtUtils::MakeMaker: '0'
@@ -10,8 +11,8 @@
ExtUtils::PkgConfig: '1'
Glib: '1.32'
dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version
2.150001'
-license: lgpl
+generated_by: 'ExtUtils::MakeMaker version 7.18, CPAN::Meta::Converter version
2.150005'
+license: unknown
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
@@ -36,4 +37,5 @@
homepage: http://gtk2-perl.sourceforge.net
license: http://www.gnu.org/licenses/lgpl-2.1.html
repository: git://git.gnome.org/perl-Glib-Object-Introspection
-version: '0.040'
+version: '0.042'
+x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Glib-Object-Introspection-0.040/Makefile.PL
new/Glib-Object-Introspection-0.042/Makefile.PL
--- old/Glib-Object-Introspection-0.040/Makefile.PL 2015-12-21
20:13:20.000000000 +0100
+++ new/Glib-Object-Introspection-0.042/Makefile.PL 2016-11-21
14:44:53.000000000 +0100
@@ -294,14 +294,15 @@
sub test {
my $inherited = shift->SUPER::test(@_);
+ my $target = qr/test_dynamic :: (?:pure_all|subdirs-test_dynamic)\n\t/;
if ($^O eq 'MSWin32') {
# put "build" into PATH for the tests
# FIXME: Might need tweaking for nmake...
- $inherited =~ s/(test_dynamic :: pure_all\n\t)/.IMPORT: PATH\nPATH +=
;build\n.EXPORT: PATH\n$1/;
+ $inherited =~ s/($target)/.IMPORT: PATH\nPATH += ;build\n.EXPORT:
PATH\n$1/;
}
else {
# put "build" into LD_LIBRARY_PATH for the tests
- $inherited =~ s/(test_dynamic ::
pure_all)\n\t/$1\n\tLD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:build /;
+ $inherited =~ s/($target)/${1}LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:build /;
}
$inherited;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Glib-Object-Introspection-0.040/NEWS
new/Glib-Object-Introspection-0.042/NEWS
--- old/Glib-Object-Introspection-0.040/NEWS 2015-12-21 20:18:23.000000000
+0100
+++ new/Glib-Object-Introspection-0.042/NEWS 2016-12-23 23:25:56.000000000
+0100
@@ -1,3 +1,24 @@
+Overview of changes in Glib::Object::Introspection 0.042
+========================================================
+
+* perli11ndoc: put special classes and records into their own category
+* perli11ndoc: list functions of enums and bitfields
+* perli11ndoc: fix the synopsis formatting for class struct functions
+* perli11ndoc: correctly display array and callback parameters/return
+ values/fields
+* Fix "occuring" typo in POD (Bugzilla #775169)
+
+Overview of changes in Glib::Object::Introspection 0.041
+========================================================
+
+∗ Tweak the test environment to work with newer ExtUtils::MakeMaker
+* Use the stack in favor of heap allocation during marshalling
+* Use custom code to find struct methods in order to avoid a bug
+* Remove an unused internal variable
+* Add support for object class functions
+* Add support for marshalling GParamSpec
+* Add Glib::Object::Introspection::GValueWrapper::get_value
+
Overview of changes in Glib::Object::Introspection 0.040
========================================================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Glib-Object-Introspection-0.040/bin/perli11ndoc
new/Glib-Object-Introspection-0.042/bin/perli11ndoc
--- old/Glib-Object-Introspection-0.040/bin/perli11ndoc 2015-11-22
03:31:05.000000000 +0100
+++ new/Glib-Object-Introspection-0.042/bin/perli11ndoc 2016-12-19
13:48:30.000000000 +0100
@@ -240,8 +240,27 @@
sub find_type_name {
my ($self, $element) = @_;
- # FIXME: Sometimes, fields or parameters have a <callback> or <array> element
- # as its type, not <type> directly.
+
+ # arrays
+ my $array_list = $self->{xpc}->find ('core:array', $element);
+ if ($array_list->size == 1) {
+ my $array = $array_list->pop;
+ my $prefix = 'reference to array of ';
+ my $child_type_name = $self->find_type_name ($array);
+ return $prefix . $child_type_name;
+ }
+
+ # callbacks
+ my $callback_list = $self->{xpc}->find ('core:callback', $element);
+ if ($callback_list->size == 1) {
+ my $callback = $callback_list->pop;
+ my ($in, $retval, $out) = $self->find_parameters_and_return_value
($callback);
+ my $in_list = join ', ', map { $self->find_type_name ($_) } @$in;
+ my $out_list = join ', ', map { $self->find_type_name ($_) } ($retval,
@$out);
+ return "callback (in: $in_list; out: $out_list)";
+ }
+
+ # bare types
my $type_list = $self->{xpc}->find ('core:type', $element);
return '[unknown type]' unless $type_list->size == 1;
my $type = $type_list->pop;
@@ -271,16 +290,29 @@
[Fields => 'core:field'],
);
+ my @enum_and_bitfield_sub_categories = (
+ [Functions => 'core:function'],
+ );
+
my @categories = (
- [Classes => 'core:class', \@class_and_interface_sub_categories],
+ [Classes => 'core:class', \@class_and_interface_sub_categories, sub {
shift =~ /Accessible$/ }],
[Interfaces => 'core:interface', \@class_and_interface_sub_categories],
+ [Records => 'core:record', \@record_sub_categories, sub { shift =~
/(?:Class|Iface|Interface|Private)$/ }],
+ [Enumerations => 'core:enumeration', \@enum_and_bitfield_sub_categories],
+ [Bitfields => 'core:bitfield', \@enum_and_bitfield_sub_categories],
[Functions => 'core:function'],
- [Enumerations => 'core:enumeration'],
- [Bitfields => 'core:bitfield'],
[Callbacks => 'core:callback'],
- [Records => 'core:record', \@record_sub_categories, sub { shift =~
/(?:Class|Private)$/ }],
[Constants => 'core:constant'],
[Aliases => 'core:alias', undef, sub { shift =~ /_autoptr$/ }],
+ ['Classes for accessibility' => 'core:class',
+ \@class_and_interface_sub_categories,
+ sub { shift !~ /Accessible$/ }],
+ ['Records for object classes' => 'core:record',
+ \@record_sub_categories,
+ sub { shift !~ /Class$/ }],
+ ['Records for interfaces' => 'core:record',
+ \@record_sub_categories,
+ sub { shift !~ /(?:Iface|Interface)$/ }],
);
my @results;
@@ -540,7 +572,6 @@
if (@$out) {
foreach my $parameter (@$out) {
my $name = $self->find_attribute ($parameter, 'name');
- push @out_names, $name;
my $type_name = $self->find_type_name ($parameter);
my $full_type_name = $self->format_full_type_name ($type_name);
$text .= " • $name: $full_type_name\n";
@@ -583,6 +614,17 @@
sub format_method {
my ($self, $element) = @_;
my $synopsis_format = '[[OUT_LIST_ASSIGN]]$object->[[NAME]] ([[IN_LIST]])';
+
+ # Treat methods of class structs as functions.
+ {
+ my $parent = $element->parentNode;
+ if ($parent->nodeName eq 'record' &&
+ defined $self->find_attribute ($parent, 'glib:is-gtype-struct-for'))
+ {
+ $synopsis_format = '[[OUT_LIST_ASSIGN]][[FULL_NAME]]
($package[[IN_LIST_PRE_COMMA]])';
+ }
+ }
+
return $self->format_callable ($element, 'METHOD', $synopsis_format);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Glib-Object-Introspection-0.040/gperl-i11n-info.c
new/Glib-Object-Introspection-0.042/gperl-i11n-info.c
--- old/Glib-Object-Introspection-0.040/gperl-i11n-info.c 2015-04-24
02:10:35.000000000 +0200
+++ new/Glib-Object-Introspection-0.042/gperl-i11n-info.c 2016-11-21
14:44:53.000000000 +0100
@@ -1,6 +1,25 @@
/* -*- mode: c; indent-tabs-mode: t; c-basic-offset: 8; -*- */
static GIFunctionInfo *
+_find_struct_method (GIStructInfo *info, const gchar *method)
+{
+ /* g_struct_info_find_method is broken for class structs like
+ * GtkWidgetClass, so we search manually. See
+ * <https://bugzilla.gnome.org/show_bug.cgi?id=700338>. */
+ gint n_methods;
+ gint i;
+ n_methods = g_struct_info_get_n_methods (info);
+ for (i = 0; i < n_methods; i++) {
+ GIFunctionInfo *method_info =
+ g_struct_info_get_method (info, i);
+ if (strEQ (g_base_info_get_name (method_info), method))
+ return method_info;
+ g_base_info_unref (method_info);
+ }
+ return NULL;
+}
+
+static GIFunctionInfo *
_find_enum_method (GIEnumInfo *info, const gchar *method)
{
#if GI_CHECK_VERSION (1, 29, 17)
@@ -48,7 +67,7 @@
break;
case GI_INFO_TYPE_BOXED:
case GI_INFO_TYPE_STRUCT:
- function_info = g_struct_info_find_method (
+ function_info = _find_struct_method (
(GIStructInfo *) namespace_info,
method);
break;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Glib-Object-Introspection-0.040/gperl-i11n-invoke-c.c
new/Glib-Object-Introspection-0.042/gperl-i11n-invoke-c.c
--- old/Glib-Object-Introspection-0.040/gperl-i11n-invoke-c.c 2015-04-24
02:10:35.000000000 +0200
+++ new/Glib-Object-Introspection-0.042/gperl-i11n-invoke-c.c 2016-11-21
14:44:53.000000000 +0100
@@ -46,7 +46,7 @@
_check_n_args (&iinfo);
if (iinfo.is_method) {
- instance = instance_sv_to_pointer (info, ST (0 +
iinfo.stack_offset));
+ instance = instance_sv_to_pointer (info, ST (0 +
iinfo.stack_offset), &iinfo.base);
iinfo.arg_types_ffi[0] = &ffi_type_pointer;
iinfo.args[0] = &instance;
}
@@ -63,8 +63,8 @@
gint perl_stack_pos, ffi_stack_pos;
SV *current_sv;
- arg_info = iinfo.base.arg_infos[i];
- arg_type = iinfo.base.arg_types[i];
+ arg_info = &(iinfo.base.arg_infos[i]);
+ arg_type = &(iinfo.base.arg_types[i]);
transfer = g_arg_info_get_ownership_transfer (arg_info);
may_be_null = g_arg_info_may_be_null (arg_info);
#if GI_CHECK_VERSION (1, 29, 0)
@@ -157,8 +157,8 @@
GITypeInfo * arg_type;
if (!iinfo.is_automatic_arg[i])
continue;
- arg_info = iinfo.base.arg_infos[i];
- arg_type = iinfo.base.arg_types[i];
+ arg_info = &(iinfo.base.arg_infos[i]);
+ arg_type = &(iinfo.base.arg_types[i]);
switch (g_arg_info_get_direction (arg_info)) {
case GI_DIRECTION_IN:
_handle_automatic_arg (i, arg_info, arg_type,
&iinfo.in_args[i], &iinfo);
@@ -217,7 +217,7 @@
#if GI_CHECK_VERSION (1, 32, 0)
/* libffi has special semantics for return value storage; see `man
* ffi_call`. We use gobject-introspection's extraction helper. */
- gi_type_info_extract_ffi_return_value (iinfo.base.return_type_info,
+ gi_type_info_extract_ffi_return_value (&iinfo.base.return_type_info,
&ffi_return_value,
&return_value);
#endif
@@ -232,9 +232,9 @@
)
{
SV *value;
- dwarn ("return value: type = %p\n",
iinfo.base.return_type_info);
+ dwarn ("return value: type = %p\n",
&iinfo.base.return_type_info);
value = SAVED_STACK_SV (arg_to_sv (&return_value,
- iinfo.base.return_type_info,
+ &iinfo.base.return_type_info,
iinfo.base.return_type_transfer,
&iinfo.base));
if (value) {
@@ -248,7 +248,7 @@
GIArgInfo * arg_info;
if (iinfo.is_automatic_arg[i])
continue;
- arg_info = iinfo.base.arg_infos[i];
+ arg_info = &(iinfo.base.arg_infos[i]);
#if GI_CHECK_VERSION (1, 29, 0)
if (g_arg_info_is_skip (arg_info)) {
continue;
@@ -266,7 +266,7 @@
? GI_TRANSFER_CONTAINER
: g_arg_info_get_ownership_transfer (arg_info);
sv = SAVED_STACK_SV (arg_to_sv
(iinfo.out_args[i].v_pointer,
- iinfo.base.arg_types[i],
+
&(iinfo.base.arg_types[i]),
transfer,
&iinfo.base));
if (sv) {
@@ -380,8 +380,8 @@
/* Make a first pass to mark args that are filled in automatically, and
* thus have no counterpart on the Perl side. */
for (i = 0 ; i < iinfo->base.n_args ; i++) {
- GIArgInfo * arg_info = iinfo->base.arg_infos[i];
- GITypeInfo * arg_type = iinfo->base.arg_types[i];
+ GIArgInfo * arg_info = &(iinfo->base.arg_infos[i]);
+ GITypeInfo * arg_type = &(iinfo->base.arg_types[i]);
GITypeTag arg_tag = g_type_info_get_tag (arg_type);
if (arg_tag == GI_TYPE_TAG_ARRAY) {
@@ -410,8 +410,8 @@
iinfo->n_expected_args = iinfo->constructor_offset +
iinfo->method_offset;
iinfo->n_nullable_args = 0;
for (i = 0 ; i < iinfo->base.n_args ; i++) {
- GIArgInfo * arg_info = iinfo->base.arg_infos[i];
- GITypeInfo * arg_type = iinfo->base.arg_types[i];
+ GIArgInfo * arg_info = &(iinfo->base.arg_infos[i]);
+ GITypeInfo * arg_type = &(iinfo->base.arg_types[i]);
GITypeTag arg_tag = g_type_info_get_tag (arg_type);
gboolean is_out = GI_DIRECTION_OUT == g_arg_info_get_direction
(arg_info);
gboolean is_automatic = iinfo->is_automatic_arg[i];
@@ -429,10 +429,10 @@
/* If the return value is an array which comes with an outbound length
* arg, then mark that length arg as automatic, too. */
- if (g_type_info_get_tag (iinfo->base.return_type_info) ==
GI_TYPE_TAG_ARRAY) {
- gint pos = g_type_info_get_array_length
(iinfo->base.return_type_info);
+ if (g_type_info_get_tag (&iinfo->base.return_type_info) ==
GI_TYPE_TAG_ARRAY) {
+ gint pos = g_type_info_get_array_length
(&iinfo->base.return_type_info);
if (pos >= 0) {
- GIArgInfo * arg_info = iinfo->base.arg_infos[pos];
+ GIArgInfo * arg_info = &(iinfo->base.arg_infos[pos]);
if (GI_DIRECTION_OUT == g_arg_info_get_direction
(arg_info)) {
dwarn (" pos %d is automatic (array
length)\n", pos);
iinfo->is_automatic_arg[pos] = TRUE;
@@ -461,9 +461,9 @@
* descendant that returns a floating object but passes no reference on
* to us, then we need to revisit this. */
if (iinfo->is_constructor &&
- g_type_info_get_tag (iinfo->base.return_type_info) ==
GI_TYPE_TAG_INTERFACE)
+ g_type_info_get_tag (&iinfo->base.return_type_info) ==
GI_TYPE_TAG_INTERFACE)
{
- GIBaseInfo * interface = g_type_info_get_interface
(iinfo->base.return_type_info);
+ GIBaseInfo * interface = g_type_info_get_interface
(&iinfo->base.return_type_info);
if (GI_IS_REGISTERED_TYPE_INFO (interface) &&
g_type_is_a (get_gtype (interface),
G_TYPE_INITIALLY_UNOWNED))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Glib-Object-Introspection-0.040/gperl-i11n-invoke-perl.c
new/Glib-Object-Introspection-0.042/gperl-i11n-invoke-perl.c
--- old/Glib-Object-Introspection-0.040/gperl-i11n-invoke-perl.c
2015-04-24 02:10:35.000000000 +0200
+++ new/Glib-Object-Introspection-0.042/gperl-i11n-invoke-perl.c
2016-11-21 14:44:53.000000000 +0100
@@ -78,8 +78,8 @@
* stack */
in_inout = 0;
for (i = 0; i < iinfo.base.n_args; i++) {
- GIArgInfo *arg_info = iinfo.base.arg_infos[i];
- GITypeInfo *arg_type = iinfo.base.arg_types[i];
+ GIArgInfo *arg_info = &(iinfo.base.arg_infos[i]);
+ GITypeInfo *arg_type = &(iinfo.base.arg_types[i]);
GITransfer transfer = g_arg_info_get_ownership_transfer
(arg_info);
GIDirection direction = g_arg_info_get_direction (arg_info);
@@ -191,8 +191,8 @@
out_index = 0;
for (i = 0; i < iinfo.base.n_args; i++) {
- GIArgInfo *arg_info = iinfo.base.arg_infos[i];
- GITypeInfo *arg_type = iinfo.base.arg_types[i];
+ GIArgInfo *arg_info = &(iinfo.base.arg_infos[i]);
+ GITypeInfo *arg_type = &(iinfo.base.arg_types[i]);
GIDirection direction = g_arg_info_get_direction
(arg_info);
gpointer out_pointer = * (gpointer *)
args[i+args_offset];
@@ -240,7 +240,7 @@
GITransfer transfer;
gboolean may_be_null;
- type_info = iinfo.base.return_type_info;
+ type_info = &iinfo.base.return_type_info;
transfer = iinfo.base.return_type_transfer;
may_be_null = g_callable_info_may_return_null (cb_interface);
/* FIXME */
@@ -352,13 +352,13 @@
/* Find array length arguments and store their value in aux_args so
* that array_to_sv can later fetch them. */
for (i = 0 ; i < iinfo->base.n_args ; i++) {
- GITypeInfo *arg_type = iinfo->base.arg_types[i];
+ GITypeInfo *arg_type = &(iinfo->base.arg_types[i]);
GITypeTag arg_tag = g_type_info_get_tag (arg_type);
if (arg_tag == GI_TYPE_TAG_ARRAY) {
gint pos = g_type_info_get_array_length (arg_type);
if (pos >= 0) {
- GITypeInfo *length_arg_type =
iinfo->base.arg_types[pos];
+ GITypeInfo *length_arg_type =
&(iinfo->base.arg_types[pos]);
raw_to_arg (args[pos],
&iinfo->base.aux_args[pos], length_arg_type);
dwarn (" pos %d is array length =>
%"G_GSIZE_FORMAT"\n",
pos, iinfo->base.aux_args[pos].v_size);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Glib-Object-Introspection-0.040/gperl-i11n-invoke.c
new/Glib-Object-Introspection-0.042/gperl-i11n-invoke.c
--- old/Glib-Object-Introspection-0.040/gperl-i11n-invoke.c 2015-04-24
02:10:35.000000000 +0200
+++ new/Glib-Object-Introspection-0.042/gperl-i11n-invoke.c 2016-11-21
14:44:53.000000000 +0100
@@ -24,8 +24,8 @@
dwarn (" n_args = %u\n", iinfo->n_args);
if (iinfo->n_args) {
- iinfo->arg_infos = gperl_alloc_temp (sizeof (GITypeInfo*) *
iinfo->n_args);
- iinfo->arg_types = gperl_alloc_temp (sizeof (GITypeInfo*) *
iinfo->n_args);
+ iinfo->arg_infos = gperl_alloc_temp (sizeof (GITypeInfo) *
iinfo->n_args);
+ iinfo->arg_types = gperl_alloc_temp (sizeof (GITypeInfo) *
iinfo->n_args);
iinfo->aux_args = gperl_alloc_temp (sizeof (GIArgument) *
iinfo->n_args);
} else {
iinfo->arg_infos = NULL;
@@ -34,14 +34,14 @@
}
for (i = 0 ; i < iinfo->n_args ; i++) {
- iinfo->arg_infos[i] = g_callable_info_get_arg (info, (gint) i);
- iinfo->arg_types[i] = g_arg_info_get_type (iinfo->arg_infos[i]);
+ g_callable_info_load_arg (info, (gint) i,
&(iinfo->arg_infos[i]));
+ g_arg_info_load_type (&(iinfo->arg_infos[i]),
&(iinfo->arg_types[i]));
}
- iinfo->return_type_info = g_callable_info_get_return_type (info);
+ g_callable_info_load_return_type (info, &iinfo->return_type_info);
iinfo->has_return_value =
- GI_TYPE_TAG_VOID != g_type_info_get_tag
(iinfo->return_type_info);
- iinfo->return_type_ffi = g_type_info_get_ffi_type
(iinfo->return_type_info);
+ GI_TYPE_TAG_VOID != g_type_info_get_tag
(&iinfo->return_type_info);
+ iinfo->return_type_ffi = g_type_info_get_ffi_type
(&iinfo->return_type_info);
iinfo->return_type_transfer = g_callable_info_get_caller_owns (info);
iinfo->callback_infos = NULL;
@@ -53,13 +53,6 @@
static void
clear_invocation_info (GPerlI11nInvocationInfo *iinfo)
{
- guint i;
-
- for (i = 0 ; i < iinfo->n_args ; i++) {
- g_base_info_unref ((GIBaseInfo *) iinfo->arg_types[i]);
- g_base_info_unref ((GIBaseInfo *) iinfo->arg_infos[i]);
- }
-
g_slist_free (iinfo->free_after_call);
iinfo->free_after_call = NULL;
@@ -71,9 +64,6 @@
g_slist_foreach (iinfo->array_infos, (GFunc) g_free, NULL);
g_slist_free (iinfo->array_infos);
iinfo->array_infos = NULL;
-
- g_base_info_unref ((GIBaseInfo *) iinfo->return_type_info);
- iinfo->return_type_info = NULL;
}
/* ------------------------------------------------------------------------- */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Glib-Object-Introspection-0.040/gperl-i11n-marshal-array.c
new/Glib-Object-Introspection-0.042/gperl-i11n-marshal-array.c
--- old/Glib-Object-Introspection-0.040/gperl-i11n-marshal-array.c
2015-04-24 02:10:35.000000000 +0200
+++ new/Glib-Object-Introspection-0.042/gperl-i11n-marshal-array.c
2016-11-21 14:44:53.000000000 +0100
@@ -106,7 +106,7 @@
gint length_pos = g_type_info_get_array_length
(info);
g_assert (iinfo && iinfo->aux_args);
conversion_sv = arg_to_sv
(&(iinfo->aux_args[length_pos]),
-
iinfo->arg_types[length_pos],
+
&(iinfo->arg_types[length_pos]),
GI_TRANSFER_NOTHING,
NULL);
length = SvIV (conversion_sv);
SvREFCNT_dec (conversion_sv);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Glib-Object-Introspection-0.040/gperl-i11n-marshal-callback.c
new/Glib-Object-Introspection-0.042/gperl-i11n-marshal-callback.c
--- old/Glib-Object-Introspection-0.040/gperl-i11n-marshal-callback.c
2015-04-24 02:10:35.000000000 +0200
+++ new/Glib-Object-Introspection-0.042/gperl-i11n-marshal-callback.c
2016-11-21 14:44:53.000000000 +0100
@@ -98,7 +98,7 @@
static SV *
callback_to_sv (GICallableInfo *interface, gpointer func,
GPerlI11nInvocationInfo *invocation_info)
{
- GIArgInfo *arg_info;
+ GIArgInfo arg_info;
GPerlI11nCCallbackInfo *callback_info;
HV *stash;
SV *code_sv, *data_sv;
@@ -116,17 +116,17 @@
}
}
- arg_info = g_callable_info_get_arg (invocation_info->interface,
- (gint)
invocation_info->current_pos);
+ g_callable_info_load_arg (invocation_info->interface,
+ (gint) invocation_info->current_pos,
+ &arg_info);
dwarn ("C callback: pos = %d, name = %s\n",
invocation_info->current_pos,
- g_base_info_get_name (arg_info));
+ g_base_info_get_name (&arg_info));
callback_info = create_c_callback_closure (interface, func);
- callback_info->data_pos = g_arg_info_get_closure (arg_info);
- callback_info->destroy_pos = g_arg_info_get_destroy (arg_info);
- g_base_info_unref (arg_info);
+ callback_info->data_pos = g_arg_info_get_closure (&arg_info);
+ callback_info->destroy_pos = g_arg_info_get_destroy (&arg_info);
if (func) {
data_sv = newSViv (PTR2IV (callback_info));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Glib-Object-Introspection-0.040/gperl-i11n-marshal-interface.c
new/Glib-Object-Introspection-0.042/gperl-i11n-marshal-interface.c
--- old/Glib-Object-Introspection-0.040/gperl-i11n-marshal-interface.c
2015-04-24 02:10:35.000000000 +0200
+++ new/Glib-Object-Introspection-0.042/gperl-i11n-marshal-interface.c
2016-11-21 14:44:53.000000000 +0100
@@ -4,7 +4,34 @@
gint _retrieve_enum (GIEnumInfo * info, GIArgument * arg);
static gpointer
-instance_sv_to_pointer (GICallableInfo *info, SV *sv)
+instance_sv_to_class_struct_pointer (SV *sv, GPerlI11nInvocationInfo *iinfo)
+{
+ gpointer pointer = NULL;
+ GType class_type = 0;
+ dwarn (" -> gtype struct?\n");
+ if (gperl_sv_is_ref (sv)) { /* instance? */
+ const char *package = sv_reftype (SvRV (sv), TRUE);
+ class_type = gperl_type_from_package (package);
+ } else { /* package? */
+ class_type = gperl_type_from_package (SvPV_nolen (sv));
+ }
+ dwarn (" class_type = %s (%lu), is_classed = %d\n",
+ g_type_name (class_type), class_type, G_TYPE_IS_CLASSED
(class_type));
+ if (G_TYPE_IS_CLASSED (class_type)) {
+ pointer = g_type_class_peek (class_type);
+ if (!pointer) {
+ /* If peek() produced NULL, the class has not been
+ * instantiated yet and needs to be created. */
+ pointer = g_type_class_ref (class_type);
+ free_after_call (iinfo, (GFunc) g_type_class_unref,
pointer);
+ }
+ dwarn (" type class = %p\n", pointer);
+ }
+ return pointer;
+}
+
+static gpointer
+instance_sv_to_pointer (GICallableInfo *info, SV *sv, GPerlI11nInvocationInfo
*iinfo)
{
// We do *not* own container.
GIBaseInfo *container = g_base_info_get_container (info);
@@ -30,11 +57,16 @@
{
GType type = get_gtype ((GIRegisteredTypeInfo *) container);
if (!type || type == G_TYPE_NONE) {
- dwarn (" -> untyped record\n");
- pointer = sv_to_struct (GI_TRANSFER_NOTHING,
- container,
- info_type,
- sv);
+ if (g_struct_info_is_gtype_struct (container)) {
+ pointer = instance_sv_to_class_struct_pointer
(sv, iinfo);
+ }
+ if (!pointer) {
+ dwarn (" -> untyped record\n");
+ pointer = sv_to_struct (GI_TRANSFER_NOTHING,
+ container,
+ info_type,
+ sv);
+ }
} else {
dwarn (" -> boxed: type=%s (%"G_GSIZE_FORMAT")\n",
g_type_name (type), type);
@@ -126,21 +158,35 @@
if (may_be_null && !gperl_sv_is_defined (sv)) {
arg->v_pointer = NULL;
} else {
- arg->v_pointer = gperl_get_object_check (sv, get_gtype
(interface));
- }
- if (arg->v_pointer) {
- GObject *object = arg->v_pointer;
- if (transfer == GI_TRANSFER_NOTHING &&
- object->ref_count == 1 &&
- SvTEMP (sv) && SvREFCNT (SvRV (sv)) == 1)
+ /* GParamSpecs are represented as classes of
+ * fundamental type, but gperl_get_object_check cannot
+ * handle this. So we do it here. */
+ if (info_type == GI_INFO_TYPE_OBJECT &&
+ g_object_info_get_fundamental (interface))
{
- cwarn ("*** Asked to hand out object without
ownership transfer, "
- "but object is about to be destroyed; "
- "adding an additional reference for
safety");
- transfer = GI_TRANSFER_EVERYTHING;
- }
- if (transfer >= GI_TRANSFER_CONTAINER) {
- g_object_ref (arg->v_pointer);
+ GType type = G_TYPE_FUNDAMENTAL (get_gtype
(interface));
+ switch (type) {
+ case G_TYPE_PARAM:
+ arg->v_pointer = SvGParamSpec (sv);
+ break;
+ default:
+ ccroak ("sv_to_interface: Don't know
how to handle fundamental type %s (%lu)\n",
+ g_type_name (type), type);
+ }
+ } else {
+ arg->v_pointer = gperl_get_object_check (sv,
get_gtype (interface));
+ if (arg->v_pointer && transfer ==
GI_TRANSFER_NOTHING &&
+ ((GObject *) arg->v_pointer)->ref_count ==
1 &&
+ SvTEMP (sv) && SvREFCNT (SvRV (sv)) == 1)
+ {
+ cwarn ("*** Asked to hand out object
without ownership transfer, "
+ "but object is about to be
destroyed; "
+ "adding an additional reference
for safety");
+ transfer = GI_TRANSFER_EVERYTHING;
+ }
+ if (transfer >= GI_TRANSFER_CONTAINER) {
+ g_object_ref (arg->v_pointer);
+ }
}
}
break;
@@ -310,6 +356,28 @@
switch (info_type) {
case GI_INFO_TYPE_OBJECT:
+ /* GParamSpecs are represented as classes of fundamental type,
+ * but gperl_new_object cannot handle this. So we do it
+ * here. */
+ if (g_object_info_get_fundamental (interface)) {
+ GType type = G_TYPE_FUNDAMENTAL (get_gtype (interface));
+ switch (type) {
+ case G_TYPE_PARAM:
+ sv = newSVGParamSpec (arg->v_pointer); /* does
ref & sink */
+ /* FIXME: What if own=true and the pspec is not
+ * floating? Then we would leak. We do not
+ * have the API to detect this. But it is
+ * probably also quite rare. */
+ break;
+ default:
+ ccroak ("interface_to_sv: Don't know how to
handle fundamental type %s (%lu)\n",
+ g_type_name (type), type);
+ }
+ } else {
+ sv = gperl_new_object (arg->v_pointer, own);
+ }
+ break;
+
case GI_INFO_TYPE_INTERFACE:
sv = gperl_new_object (arg->v_pointer, own);
break;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Glib-Object-Introspection-0.040/lib/Glib/Object/Introspection.pm
new/Glib-Object-Introspection-0.042/lib/Glib/Object/Introspection.pm
--- old/Glib-Object-Introspection-0.040/lib/Glib/Object/Introspection.pm
2015-12-21 19:12:53.000000000 +0100
+++ new/Glib-Object-Introspection-0.042/lib/Glib/Object/Introspection.pm
2016-12-23 23:26:08.000000000 +0100
@@ -19,7 +19,7 @@
use warnings;
use Glib;
-our $VERSION = '0.040';
+our $VERSION = '0.042';
use Carp;
$Carp::Internal{(__PACKAGE__)}++;
@@ -474,19 +474,7 @@
place, either by using weak references in the userdata, or possibly locating a
parent dynamically with C<< $widget->get_ancestor >>.
-=head2 Miscellaneous
-
-In C you can only return one value from a function, and it is a common practice
-to modify pointers passed in to simulate returning multiple values. In Perl,
-you can return lists; any functions which modify arguments are changed to
-return them instead.
-
-Arguments and return values that have the types GList or GSList or which are C
-arrays of values will be converted to and from references to normal Perl
-arrays. The same holds for GHashTable and references to normal Perl hashes.
-
-You don't need to specify string lengths. You can always use C<substr> to pass
-different parts of a string.
+=head2 Exception handling
Anything that uses GError in C will C<croak> on failure, setting $@ to a
magical exception object, which is overloaded to print as the
@@ -517,6 +505,28 @@
on a possibly localized error message; you can match errors by explicit and
predictable conditions. See L<Glib::Error> for more information.
+=head2 Output arguments, lists, hashes
+
+In C you can only return one value from a function, and it is a common practice
+to modify pointers passed in to simulate returning multiple values. In Perl,
+you can return lists; any functions which modify arguments are changed to
+return them instead.
+
+Arguments and return values that have the types GList or GSList or which are C
+arrays of values will be converted to and from references to normal Perl
+arrays. The same holds for GHashTable and references to normal Perl hashes.
+
+=head2 Object class functions
+
+Object class functions like C<Gtk3::WidgetClass::find_style_propery> can be
+called either with a package name or with an instance of the package. For
+example:
+
+ Gtk3::WidgetClass::find_style_property ('Gtk3::Button', 'image-spacing')
+
+ my $button = Gtk3::Button->new;
+ Gtk3::WidgetClass::find_style_property ($button, 'image-spacing')
+
=head1 DESCRIPTION FOR LIBRARY BINDING AUTHORS
=head2 C<< Glib::Object::Introspection->setup >>
@@ -565,7 +575,7 @@
'Gtk3::Window::list_toplevels'
]
-The function names refer to those after name corrections. Functions occuring
+The function names refer to those after name corrections. Functions occurring
in C<flatten_array_ref_return_for> may also occur in C<class_static_methods>.
=item handle_sentinel_boolean_for => [ function1, ... ]
@@ -582,7 +592,7 @@
'Gtk3::TreeSelection::get_selected'
]
-The function names refer to those after name corrections. Functions occuring
+The function names refer to those after name corrections. Functions occurring
in C<handle_sentinel_boolean_for> may also occur in C<class_static_methods>.
=item use_generic_signal_marshaller_for => [ [package1, signal1,
[arg_converter1]], ... ]
@@ -663,12 +673,21 @@
...
my $type = ...; # somehow get the package name that
# corresponds to the correct GType
- my $real_value =
+ my $wrapper =
Glib::Object::Introspection::GValueWrapper->new ($type, $value);
# now use Glib::Object::Introspection->invoke and
- # substitute $real_value where you'd use $value
+ # substitute $wrapper where you'd use $value
...
+If you need to call a function that expects an already set-up GValue and
+modifies it, use C<get_value> on the wrapper afterwards to obtain the value.
+For example:
+
+ my $wrapper =
+ Glib::Object::Introspection::GValueWrapper->new ('Glib::Boolean', 0);
+ $box->child_get_property ($label, 'expand', $gvalue);
+ my $value = $gvalue->get_value
+
=head2 Handling extendable enumerations
If you need to handle extendable enumerations for which more than the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Glib-Object-Introspection-0.040/t/param-specs.t
new/Glib-Object-Introspection-0.042/t/param-specs.t
--- old/Glib-Object-Introspection-0.040/t/param-specs.t 1970-01-01
01:00:00.000000000 +0100
+++ new/Glib-Object-Introspection-0.042/t/param-specs.t 2016-11-21
14:44:53.000000000 +0100
@@ -0,0 +1,21 @@
+#!/usr/bin/env perl
+
+BEGIN { require './t/inc/setup.pl' };
+
+use strict;
+use warnings;
+
+plan tests => 7;
+
+GI::param_spec_in_bool (Glib::ParamSpec->boolean ('mybool', 'mybool',
'mybool', Glib::FALSE, []));
+pass;
+
+my $ps1 = GI::param_spec_return;
+isa_ok ($ps1, 'Glib::Param::String');
+is ($ps1->get_name, 'test_param');
+is ($ps1->get_default_value, '42');
+
+my $ps2 = GI::param_spec_out;
+isa_ok ($ps2, 'Glib::Param::String');
+is ($ps2->get_name, 'test_param');
+is ($ps2->get_default_value, '42');
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Glib-Object-Introspection-0.040/t/values.t
new/Glib-Object-Introspection-0.042/t/values.t
--- old/Glib-Object-Introspection-0.040/t/values.t 2011-11-27
08:57:04.000000000 +0100
+++ new/Glib-Object-Introspection-0.042/t/values.t 2016-11-21
14:44:53.000000000 +0100
@@ -5,10 +5,20 @@
use strict;
use warnings;
-plan tests => 2;
+plan tests => 3;
-SKIP: {
- skip 'SV → GValue not implemented', 1;
- is (Regress::test_int_value_arg (23), 23);
+{
+ my $wrapper = Glib::Object::Introspection::GValueWrapper->new ('Glib::Int',
23);
+ is (Regress::test_int_value_arg ($wrapper), 23);
}
+
is (Regress::test_value_return (23), 23);
+
+SKIP: {
+ skip 'more GValue tests', 1
+ unless check_gi_version (1, 38, 0);
+
+ my $wrapper = Glib::Object::Introspection::GValueWrapper->new ('Glib::Int',
42);
+ GI::gvalue_in_with_modification ($wrapper);
+ is ($wrapper->get_value, 24);
+}