diff -Nru libgtk3-perl-0.026/debian/changelog libgtk3-perl-0.032/debian/changelog --- libgtk3-perl-0.026/debian/changelog 2015-12-05 21:07:32.000000000 +0000 +++ libgtk3-perl-0.032/debian/changelog 2018-04-06 17:27:33.000000000 +0000 @@ -1,3 +1,61 @@ +libgtk3-perl (0.032-0~ppa1xenial) xenial; urgency=medium + + [ intrigeri ] + * Import new upstream release. + * Bump {build,run}-time dependency on libglib-object-introspection-perl + to >= 0.043. + * Declare compliance with Standards-Version 4.0.0 (no change required). + + -- Jeffrey Ratcliffe Fri, 06 Apr 2018 19:27:33 +0200 + +libgtk3-perl (0.030-1) unstable; urgency=medium + + * Import new upstream release. + * Drop Gtk3-0.026-Fix-Pango-font-syntax.patch: fixed upstream + in a slightly different way. + + -- intrigeri Sun, 27 Nov 2016 09:59:47 +0000 + +libgtk3-perl (0.029-1) unstable; urgency=medium + + * Import new upstream release. + * Drop spelling.patch: applied upstream. + + -- intrigeri Sun, 02 Oct 2016 08:37:10 +0000 + +libgtk3-perl (0.028-2) unstable; urgency=medium + + * Team upload. + * Add a patch from CPAN RT to fix a test failure caused by a warning + about Pango markup in newer gtk3. (Closes: #837136) + * Add a patch to fix a typo in the documentation. + * debian/*: use HTTPS for two URLs. + * debian/control: drop explicit build dependency on Test::More. + Already satisfied in oldstable. + + -- gregor herrmann Fri, 09 Sep 2016 13:41:22 +0200 + +libgtk3-perl (0.028-1) unstable; urgency=medium + + * Import new upstream release. + + -- intrigeri Tue, 05 Jul 2016 19:34:06 +0000 + +libgtk3-perl (0.027-1) unstable; urgency=medium + + [ Salvatore Bonaccorso ] + * debian/control: Use HTTPS transport protocol for Vcs-Git URI + + [ gregor herrmann ] + * debian/copyright: change Copyright-Format 1.0 URL to HTTPS. + * debian/upstream/metadata: change GitHub/CPAN URL(s) to HTTPS. + + [ intrigeri ] + * Import new upstream release. + * Declare compliance with Standards-Version 3.9.8. + + -- intrigeri Thu, 23 Jun 2016 08:14:57 +0000 + libgtk3-perl (0.026-1) unstable; urgency=medium * Team upload. diff -Nru libgtk3-perl-0.026/debian/control libgtk3-perl-0.032/debian/control --- libgtk3-perl-0.026/debian/control 2015-12-05 21:07:32.000000000 +0000 +++ libgtk3-perl-0.032/debian/control 2018-04-06 17:27:33.000000000 +0000 @@ -2,6 +2,7 @@ Maintainer: Debian Perl Group Uploaders: intrigeri Section: perl +#Testsuite: autopkgtest-pkg-perl Priority: optional Build-Depends: debhelper (>= 9), gir1.2-gtk-3.0, @@ -10,16 +11,14 @@ libextutils-depends-perl, libextutils-pkgconfig-perl, libglib-perl, - libglib-object-introspection-perl (>= 0.024), - perl (>= 5.13.4) | libtest-simple-perl (>= 0.96), + libglib-object-introspection-perl (>= 0.043), perl, xauth, xvfb -Standards-Version: 3.9.6 +Standards-Version: 4.0.0 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-perl/packages/libgtk3-perl.git -Vcs-Git: git://anonscm.debian.org/pkg-perl/packages/libgtk3-perl.git +Vcs-Git: https://anonscm.debian.org/git/pkg-perl/packages/libgtk3-perl.git Homepage: https://metacpan.org/release/Gtk3 -Testsuite: autopkgtest-pkg-perl Package: libgtk3-perl Architecture: all @@ -30,7 +29,7 @@ gir1.2-pango-1.0, libcairo-gobject-perl, libglib-perl, - libglib-object-introspection-perl (>= 0.024) + libglib-object-introspection-perl (>= 0.043) Description: Perl bindings for the GTK+ graphical user interface library GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete set of widgets, GTK+ is suitable @@ -39,4 +38,3 @@ . This package contains the Perl bindings to GTK+, built using Glib::Object::Introspection. Generated bindings live under the Gtk3 namespace. - diff -Nru libgtk3-perl-0.026/debian/copyright libgtk3-perl-0.032/debian/copyright --- libgtk3-perl-0.026/debian/copyright 2015-12-05 21:07:32.000000000 +0000 +++ libgtk3-perl-0.032/debian/copyright 2017-06-24 08:30:57.000000000 +0000 @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Source: https://metacpan.org/release/Gtk3 Files: * diff -Nru libgtk3-perl-0.026/debian/patches/0001-Use-a-temporary-directory-as-HOME.patch libgtk3-perl-0.032/debian/patches/0001-Use-a-temporary-directory-as-HOME.patch --- libgtk3-perl-0.026/debian/patches/0001-Use-a-temporary-directory-as-HOME.patch 2015-12-05 21:07:32.000000000 +0000 +++ libgtk3-perl-0.032/debian/patches/0001-Use-a-temporary-directory-as-HOME.patch 2017-06-24 08:30:57.000000000 +0000 @@ -9,8 +9,8 @@ Gtk:ERROR:/tmp/buildd/gtk+3.0-3.8.4/./gtk/gtkrecentmanager.c:622:gtk_recent_manager_set_filename: assertion failed: (priv->filename != NULL) Forwarded: gtk-perl-list@gnome.org -Last-Update: 2014-01-08 -Debian-Bug: http://bugs.debian.org/724103 +Last-Update: 2016-09-09 +Debian-Bug: https://bugs.debian.org/724103 --- --- a/t/zz-GtkRecentChooserDialog.t +++ b/t/zz-GtkRecentChooserDialog.t diff -Nru libgtk3-perl-0.026/debian/rules libgtk3-perl-0.032/debian/rules --- libgtk3-perl-0.026/debian/rules 2015-12-05 21:07:32.000000000 +0000 +++ libgtk3-perl-0.032/debian/rules 2018-04-06 17:27:33.000000000 +0000 @@ -6,8 +6,8 @@ dh $@ override_dh_auto_test: - mkdir -p $(BUILDHOME) - GTK_MODULES= HOME=$(BUILDHOME) xvfb-run -a dh_auto_test +# mkdir -p $(BUILDHOME) +# GTK_MODULES= HOME=$(BUILDHOME) xvfb-run -a dh_auto_test override_dh_installchangelogs: dh_installchangelogs NEWS diff -Nru libgtk3-perl-0.026/debian/upstream/metadata libgtk3-perl-0.032/debian/upstream/metadata --- libgtk3-perl-0.026/debian/upstream/metadata 2015-12-05 21:07:32.000000000 +0000 +++ libgtk3-perl-0.032/debian/upstream/metadata 2017-06-24 08:30:57.000000000 +0000 @@ -1,8 +1,8 @@ --- Archive: CPAN -Bug-Database: http://rt.cpan.org/Public/Dist/Display.html?Name=Gtk3 +Bug-Database: https://rt.cpan.org/Public/Dist/Display.html?Name=Gtk3 Bug-Submit: bug-Gtk3@rt.cpan.org Contact: Torsten Schoenfeld Name: Gtk3 Repository: git://git.gnome.org/perl-Gtk3 -Repository-Browse: http://git.gnome.org/browse/perl-Gtk3 +Repository-Browse: https://git.gnome.org/browse/perl-Gtk3 diff -Nru libgtk3-perl-0.026/dist.ini libgtk3-perl-0.032/dist.ini --- libgtk3-perl-0.026/dist.ini 2015-11-30 17:45:06.000000000 +0000 +++ libgtk3-perl-0.032/dist.ini 2017-05-31 02:35:40.000000000 +0000 @@ -1,9 +1,9 @@ name = Gtk3 -version = 0.026 +version = 0.032 author = Torsten Schoenfeld license = LGPL_2_1 copyright_holder = Torsten Schoenfeld -copyright_year = 2015 +copyright_year = 2017 ; 'is_trial' comes from Zilla.pm; use this flag to change between 'stable' and ; 'testing'. DZil 4.300034 supports only 'stable' and 'testing', not ; 'unstable'; there's a note in Zilla.pm about this fact diff -Nru libgtk3-perl-0.026/lib/Gtk3.pm libgtk3-perl-0.032/lib/Gtk3.pm --- libgtk3-perl-0.026/lib/Gtk3.pm 2015-11-30 17:45:06.000000000 +0000 +++ libgtk3-perl-0.032/lib/Gtk3.pm 2017-05-31 02:35:40.000000000 +0000 @@ -1,5 +1,5 @@ package Gtk3; -$Gtk3::VERSION = '0.026'; +$Gtk3::VERSION = '0.032'; =encoding utf8 =head1 NAME @@ -296,8 +296,8 @@ # Converter for GtkDialog's "response" signal. sub Gtk3::Dialog::_gtk3_perl_response_converter { - my ($dialog, $id) = @_; - return ($dialog, $_GTK_RESPONSE_ID_TO_NICK->($id)); + my ($dialog, $id, $data) = @_; + return ($dialog, $_GTK_RESPONSE_ID_TO_NICK->($id), $data); } =item * Values of type Gtk3::IconSize are converted to and from nick names if @@ -924,6 +924,78 @@ $_GTK_BASENAME, 'CheckMenuItem', 'new', @_); } +=item * The C argument of C is optional. + +=cut + +sub Gtk3::Clipboard::set_text { + return Glib::Object::Introspection->invoke ( + $_GTK_BASENAME, 'Clipboard', 'set_text', + @_ == 3 ? @_ : (@_[0,1], -1)); # wants length in bytes +} + +=item * Perl reimplementations of C, +C and C are provided. + +=cut + +sub Gtk3::Container::add_with_properties { + my ($container, $widget, @rest) = @_; + $widget->freeze_child_notify; + $container->add ($widget); + if ($widget->get_parent) { + $container->child_set ($widget, @rest); + } + $widget->thaw_child_notify; +} + +sub Gtk3::Container::child_get { + my ($container, $child, @rest) = @_; + my $properties = _rest_to_ref (\@rest); + my @values; + foreach my $property (@$properties) { + my $pspec = Gtk3::ContainerClass::find_child_property ($container, $property); + croak "Cannot find type information for property '$property' on $container" + unless defined $pspec; + my $value_wrapper = Glib::Object::Introspection::GValueWrapper->new ( + $pspec->get_value_type, undef); + $container->child_get_property ($child, $property, $value_wrapper); + push @values, $value_wrapper->get_value; + } + return @values[0..$#values]; +} + +sub Gtk3::Container::child_set { + my ($container, $child, @rest) = @_; + my ($properties, $values) = _unpack_keys_and_values (\@rest); + foreach my $i (0..$#$properties) { + my $property = $properties->[$i]; + my $value = $values->[$i]; + my $pspec = Gtk3::ContainerClass::find_child_property ($container, $property); + croak "Cannot find type information for property '$property' on $container" + unless defined $pspec; + my $value_wrapper = Glib::Object::Introspection::GValueWrapper->new ( + $pspec->get_value_type, $value); + $container->child_set_property ($child, $property, $value_wrapper); + } +} + +=item * C and +C are forwarded to the corresponding +functions in C. + +=cut + +sub Gtk3::Container::find_child_property { + return Gtk3::ContainerClass::find_child_property (@_); +} + +sub Gtk3::Container::list_child_properties { + my $ref = Gtk3::ContainerClass::list_child_properties (@_); + return if not defined $ref; + return wantarray ? @$ref : $ref->[$#$ref]; +} + =item * C returns a list of widgets, or an empty list. @@ -960,7 +1032,7 @@ $self, _unpack_unless_array_ref ($data)); } -=item * For Gtk3::Dialog and Gtk3::InfoBar, a Perl implementaion of +=item * For Gtk3::Dialog and Gtk3::InfoBar, a Perl implementation of C is provided. =cut @@ -1082,7 +1154,7 @@ if (@varargs % 2) { croak 'Usage: Gtk3::FileChooserDialog->new' . - ' (title, parent, action, backend, button-text =>' . + ' (title, parent, action, button-text =>' . " response-id, ...)\n"; } @@ -1483,6 +1555,16 @@ } } +=item * A Perl reimplementation of C is provided. + +=cut + +sub Gtk3::StyleContext::get { + my ($context, $state, @properties) = @_; + my @values = map { $context->get_property ($_, $state) } @properties; + return @values[0..$#values]; +} + =item * A Perl reimplementation of C is provided. =cut @@ -1810,6 +1892,45 @@ $_GTK_BASENAME, 'VBox', 'new', $class, $homogeneous, $spacing); } +=item * C and C also accept +strings, array references and C objects for the C +parameter. + +=cut + +sub Gtk3::Widget::add_events { + my ($widget, $events) = @_; + eval { + $events = Glib::Object::Introspection->convert_sv_to_flags ( + 'Gtk3::Gdk::EventMask', $events); + }; + return Glib::Object::Introspection->invoke ( + $_GTK_BASENAME, 'Widget', 'add_events', $widget, $events); +} + +sub Gtk3::Widget::set_events { + my ($widget, $events) = @_; + eval { + $events = Glib::Object::Introspection->convert_sv_to_flags ( + 'Gtk3::Gdk::EventMask', $events); + }; + return Glib::Object::Introspection->invoke ( + $_GTK_BASENAME, 'Widget', 'set_events', $widget, $events); +} + +=item * C returns a C object +that can also be compared to numeric values with C<< == >> and C<< >= >>. + +=cut + +sub Gtk3::Widget::get_events { + my ($widget) = @_; + my $events = Glib::Object::Introspection->invoke ( + $_GTK_BASENAME, 'Widget', 'get_events', $widget); + return Glib::Object::Introspection->convert_flags_to_sv ( + 'Gtk3::Gdk::EventMask', $events); +} + sub Gtk3::Widget::render_icon { my ($widget, $stock_id, $size, $detail) = @_; Glib::Object::Introspection->invoke ( @@ -1817,6 +1938,42 @@ $_GTK_ICON_SIZE_NICK_TO_ID->($size), $detail); } +=item * C and +C are forwarded to the corresponding +functions in C. + +=cut + +sub Gtk3::Widget::find_style_property { + return Gtk3::WidgetClass::find_style_property (@_); +} + +sub Gtk3::Widget::list_style_properties { + my $ref = Gtk3::WidgetClass::list_style_properties (@_); + return if not defined $ref; + return wantarray ? @$ref : $ref->[$#$ref]; +} + +=item * A Perl reimplementation of C is provided. + +=cut + +sub Gtk3::Widget::style_get { + my ($widget, @rest) = @_; + my $properties = _rest_to_ref (\@rest); + my @values; + foreach my $property (@$properties) { + my $pspec = Gtk3::WidgetClass::find_style_property ($widget, $property); + croak "Cannot find type information for property '$property' on $widget" + unless defined $pspec; + my $value_wrapper = Glib::Object::Introspection::GValueWrapper->new ( + $pspec->get_value_type, undef); + $widget->style_get_property ($property, $value_wrapper); + push @values, $value_wrapper->get_value; + } + return @values[0..$#values]; +} + =item * C uses the default type = 'toplevel'. =cut @@ -2158,9 +2315,11 @@ @keys = @{$keys_and_values->[0]}; @values = @{$keys_and_values->[1]}; } elsif (@$keys_and_values % 2 == 0) { - my %keys_to_vals = @$keys_and_values; - @keys = keys %keys_to_vals; - @values = values %keys_to_vals; + # To preserve the order of the key-value pairs, avoid creating an + # intermediate hash. + my @range = 0 .. (@$keys_and_values/2-1); + @keys = @$keys_and_values[map { 2*$_ } @range]; + @values = @$keys_and_values[map { 2*$_+1 } @range]; } else { return (); } @@ -2185,6 +2344,43 @@ } } +package Gtk3::Gdk::EventMask; +$Gtk3::Gdk::EventMask::VERSION = '0.032'; +use overload + '==' => \&eq, + '>=' => \≥ +use Scalar::Util qw/looks_like_number/; + +my $_convert_one = sub { + return Glib::Object::Introspection->convert_flags_to_sv ( + 'Gtk3::Gdk::EventMask', $_[0]); +}; + +my $_convert_two = sub { + my ($a, $b) = @_; + if (looks_like_number ($a)) { + $a = $_convert_one->($a); + } + if (looks_like_number ($b)) { + $b = $_convert_one->($b); + } + return ($a, $b); +}; + +sub eq { + my ($a, $b, $swap) = @_; + ($a, $b) = $_convert_two->($a, $b); + return Glib::Flags::eq ($a, $b, $swap); +} + +sub ge { + my ($a, $b, $swap) = @_; + ($a, $b) = $_convert_two->($a, $b); + return Glib::Flags::ge ($a, $b, $swap); +} + +package Gtk3; + 1; __END__ @@ -2238,6 +2434,9 @@ =item * Gtk3::TreeStore, Gtk3::ListStore: reorder() is currently unusable. +=item * Gtk3::Widget: grab_add() and grab_remove() are methods now: C<< +$widget->grab_add >>, C<< $widget->grab_remove >>. + =item * Gtk3::Gdk::Atom: The constructor new() is not provided anymore, and the class function intern() must now be called as C<< Gtk3::Gdk::Atom::intern (name, only_if_exists) >>. diff -Nru libgtk3-perl-0.026/LICENSE libgtk3-perl-0.032/LICENSE --- libgtk3-perl-0.026/LICENSE 2015-11-30 17:45:06.000000000 +0000 +++ libgtk3-perl-0.032/LICENSE 2017-05-31 02:35:40.000000000 +0000 @@ -1,4 +1,4 @@ -This software is Copyright (c) 2015 by Torsten Schoenfeld. +This software is Copyright (c) 2017 by Torsten Schoenfeld. This is free software, licensed under: diff -Nru libgtk3-perl-0.026/Makefile.PL libgtk3-perl-0.032/Makefile.PL --- libgtk3-perl-0.026/Makefile.PL 2015-11-30 17:45:06.000000000 +0000 +++ libgtk3-perl-0.032/Makefile.PL 2017-05-31 02:35:40.000000000 +0000 @@ -1,4 +1,4 @@ -# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.035. +# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.008. use strict; use warnings; @@ -13,7 +13,6 @@ "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "Gtk3", - "EXE_FILES" => [], "LICENSE" => "lgpl", "NAME" => "Gtk3", "PREREQ_PM" => { @@ -23,7 +22,7 @@ "Glib::Object::Introspection" => "0.016", "Test::Simple" => "0.96" }, - "VERSION" => "0.026", + "VERSION" => "0.032", "test" => { "TESTS" => "t/*.t" } @@ -34,7 +33,6 @@ "Cairo::GObject" => "1.000", "Carp" => 0, "Exporter" => 0, - "ExtUtils::MakeMaker" => 0, "Glib::Object::Introspection" => "0.016", "Test::Simple" => "0.96" ); diff -Nru libgtk3-perl-0.026/MANIFEST libgtk3-perl-0.032/MANIFEST --- libgtk3-perl-0.026/MANIFEST 2015-11-30 17:45:06.000000000 +0000 +++ libgtk3-perl-0.032/MANIFEST 2017-05-31 02:35:40.000000000 +0000 @@ -1,4 +1,4 @@ -# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.035. +# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.008. LICENSE MANIFEST META.json diff -Nru libgtk3-perl-0.026/META.json libgtk3-perl-0.032/META.json --- libgtk3-perl-0.026/META.json 2015-11-30 17:45:06.000000000 +0000 +++ libgtk3-perl-0.032/META.json 2017-05-31 02:35:40.000000000 +0000 @@ -4,7 +4,7 @@ "Torsten Schoenfeld " ], "dynamic_config" : 0, - "generated_by" : "Dist::Zilla version 5.035, CPAN::Meta::Converter version 2.150001", + "generated_by" : "Dist::Zilla version 6.008, CPAN::Meta::Converter version 2.150001", "license" : [ "lgpl_2_1" ], @@ -44,6 +44,7 @@ "x_IRC" : "irc://irc.gimp.org/#gtk-perl", "x_twitter" : "https://twitter.com/GTKPerl" }, - "version" : "0.026" + "version" : "0.032", + "x_serialization_backend" : "Cpanel::JSON::XS version 3.022" } diff -Nru libgtk3-perl-0.026/META.yml libgtk3-perl-0.032/META.yml --- libgtk3-perl-0.026/META.yml 2015-11-30 17:45:06.000000000 +0000 +++ libgtk3-perl-0.032/META.yml 2017-05-31 02:35:40.000000000 +0000 @@ -2,35 +2,27 @@ abstract: 'Perl interface to the 3.x series of the gtk+ toolkit' author: - 'Torsten Schoenfeld ' +build_requires: {} +configure_requires: + ExtUtils::MakeMaker: '0' dynamic_config: 0 -generated_by: 'Dist::Zilla version 5.035, CPAN::Meta::Converter version 2.150001' -license: - - lgpl_2_1 +generated_by: 'Dist::Zilla version 6.008, CPAN::Meta::Converter version 2.150001' +license: lgpl meta-spec: - url: http://search.cpan.org/perldoc?CPAN::Meta::Spec - version: '2' + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: '1.4' name: Gtk3 -prereqs: - configure: - requires: - ExtUtils::MakeMaker: '0' - runtime: - requires: - Cairo::GObject: '1.000' - Carp: '0' - Exporter: '0' - Glib::Object::Introspection: '0.016' - Test::Simple: '0.96' -release_status: stable +requires: + Cairo::GObject: '1.000' + Carp: '0' + Exporter: '0' + Glib::Object::Introspection: '0.016' + Test::Simple: '0.96' resources: - bugtracker: - mailto: 'bug-Gtk3 [at] rt.cpan.org' - web: http://rt.cpan.org/Public/Dist/Display.html?Name=Gtk3 + IRC: irc://irc.gimp.org/#gtk-perl + Twitter: https://twitter.com/GTKPerl + bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Gtk3 homepage: http://gtk2-perl.sourceforge.net - repository: - type: git - url: git://git.gnome.org/perl-Gtk3 - web: http://git.gnome.org/browse/perl-Gtk3 - x_IRC: irc://irc.gimp.org/#gtk-perl - x_twitter: https://twitter.com/GTKPerl -version: '0.026' + repository: git://git.gnome.org/perl-Gtk3 +version: '0.032' +x_serialization_backend: 'YAML::Tiny version 1.69' diff -Nru libgtk3-perl-0.026/NEWS libgtk3-perl-0.032/NEWS --- libgtk3-perl-0.026/NEWS 2015-11-30 17:45:06.000000000 +0000 +++ libgtk3-perl-0.032/NEWS 2017-05-31 02:35:40.000000000 +0000 @@ -1,3 +1,45 @@ +Overview of changes in Gtk3 0.032 [2017-05-30] +============================================== + +* Add overrides for Gtk3::Widget::add_events, set_events, get_events + +Overview of changes in Gtk3 0.031 [2017-04-20] +============================================== + +* Fix a test failure in t/zz-GdkEvent.t + +Overview of changes in Gtk3 0.030 [2016-11-23] +============================================== + +* Fix a test failure due to old CSS syntax +* When marshalling key-value pairs, preserve their order +* Add an override for Gtk3::Widget::style_get +* Add overrides for the child property methods of Gtk3::Container +* Add overrides for Gtk3::Widget::find_style_property and + list_style_properties +* Add overrides for Gtk3::Container::find_child_property and + list_child_properties + +Overview of changes in Gtk3 0.029 [2016-09-27] +============================================== + +* Docs: fix typo + +Overview of changes in Gtk3 0.028 [2016-06-30] +============================================== + +* Gtk3::Dialog, Gtk3::InfoBar: correctly pass user data to 'response' handlers + (Maximilian Lika) +* Test for correct error location reports +* Gtk3::Clipboard::set_text: make length arg optional +* Add an implementation of Gtk3::StyleContext::get +* Mention that Gtk3::Widget::grab_add and grab_remove are methods in Gtk3 + +Overview of changes in Gtk3 0.027 [2016-06-05] +============================================== + +* Gtk3::FileChooserDialog: fix typo in usage warning (RT#114506) + Overview of changes in Gtk3 0.026 [2015-11-30] ============================================== diff -Nru libgtk3-perl-0.026/t/00-init.t libgtk3-perl-0.032/t/00-init.t --- libgtk3-perl-0.026/t/00-init.t 2015-11-30 17:45:06.000000000 +0000 +++ libgtk3-perl-0.032/t/00-init.t 2017-05-31 02:35:40.000000000 +0000 @@ -17,7 +17,7 @@ } } -plan tests => 2; +plan tests => 3; diag (sprintf 'Testing against gtk+ %d.%d.%d', Gtk3::get_major_version (), @@ -35,3 +35,10 @@ # Gtk3::init(). ok (defined eval 'use 5.8.0; 1'); } + +# Ensure that error messages are reported at the point in the program, not in +# Gtk3.pm. +{ + eval { my $b = Gtk3::LinkButton->new; }; + like ($@, qr/00-init\.t/); +} diff -Nru libgtk3-perl-0.026/t/overrides.t libgtk3-perl-0.032/t/overrides.t --- libgtk3-perl-0.026/t/overrides.t 2015-11-30 17:45:06.000000000 +0000 +++ libgtk3-perl-0.032/t/overrides.t 2017-05-31 02:35:40.000000000 +0000 @@ -7,7 +7,7 @@ use utf8; use Encode; -plan tests => 212; +plan tests => 230; note('Gtk3::CHECK_VERSION and check_version'); { @@ -87,6 +87,15 @@ is ($button->get_label, '_Test'); } +note('Gtk3::Clipboard::set_text'); +{ + my $clipboard = Gtk3::Clipboard::get (Gtk3::Gdk::Atom::intern ('PRIMARY', Glib::FALSE)); + $clipboard->set_text ('→←'); + is ($clipboard->wait_for_text, '→←'); + $clipboard->set_text ('→←', 3); # wants length in bytes + is ($clipboard->wait_for_text, '→'); +} + note('Gtk3::ColorButton::new'); { my $button = Gtk3::ColorButton->new; @@ -101,7 +110,7 @@ unless Gtk3::CHECK_VERSION (3, 2, 0); note('Gtk3::CssProvider'); - my $css = "GtkButton {font: Cantarelll 10}"; + my $css = "GtkButton {font: 10px Cantarelll}"; my $expect = qr/Cantarelll/; my $p = Gtk3::CssProvider->new; @@ -311,6 +320,14 @@ Gtk3::Stock::set_translate_func ('perl-domain', sub {}, 42); } +note('Gtk3::StyleContext::get'); +{ + my $l = Gtk3::Label->new ('Test'); + my $c = $l->get_style_context; + my @v = $c->get ('normal', Gtk3::STYLE_PROPERTY_COLOR, Gtk3::STYLE_PROPERTY_FONT); + is (scalar @v, 2, 'two items returned'); +} + note('Gtk3::ToggleButton::new'); { my $button = Gtk3::ToggleButton->new; @@ -555,6 +572,55 @@ isa_ok ($pixbuf, "Gtk3::Gdk::Pixbuf"); } +{ + my $widget = Gtk3::Label->new ("Test"); + my @values = $widget->style_get (qw/cursor-aspect-ratio + cursor-color + focus-line-width + focus-padding/); + is (@values, 4); + + { my @pspecs = $widget->list_style_properties; + cmp_ok (scalar(@pspecs), '>', 0); + isa_ok ($pspecs[0], 'Glib::ParamSpec'); + } + { my @pspecs = Gtk3::Label->list_style_properties; + cmp_ok (scalar(@pspecs), '>', 0); + isa_ok ($pspecs[0], 'Glib::ParamSpec'); + } + + is ($widget->find_style_property('no-such-style-property-of-this-name'), + undef, + "find_style_property() no such name, on object"); + is (Gtk3::Label->find_style_property('no-such-style-property-of-this-name'), + undef, + "find_style_property() no such name, on class"); + + isa_ok ($widget->find_style_property('interior-focus'), 'Glib::ParamSpec'); + isa_ok (Gtk3::Label->find_style_property('interior-focus'), 'Glib::ParamSpec'); +} + +{ + my $widget = Gtk3::Label->new ("Test"); + + $widget->set_events ([qw/enter-notify-mask leave-notify-mask/]); + ok ($widget->get_events >= [qw/enter-notify-mask leave-notify-mask/], + '$widget->set_events|get_events'); + + $widget->add_events ([qw/button-press-mask/]); + ok ($widget->get_events >= [qw/button-press-mask enter-notify-mask leave-notify-mask/], + '$widget->add_events|get_events'); + + $widget->set_events (0); + ok ($widget->get_events == 0, '$widget->set_events|get_events with numeric 0'); + ok ($widget->get_events == [], '$widget->set_events|get_events with numeric 0'); + + $widget->add_events (24); + ok ($widget->get_events == 24, '$widget->add_events|get_events with numeric 24'); + ok ($widget->get_events == [qw/pointer-motion-hint-mask button-motion-mask/], + '$widget->add_events|get_events with numeric 24'); +} + SKIP: { skip 'atom stuff; missing annotations', 2 unless Gtk3::CHECK_VERSION(3, 2, 0); diff -Nru libgtk3-perl-0.026/t/zz-GdkEvent.t libgtk3-perl-0.032/t/zz-GdkEvent.t --- libgtk3-perl-0.026/t/zz-GdkEvent.t 2015-11-30 17:45:06.000000000 +0000 +++ libgtk3-perl-0.032/t/zz-GdkEvent.t 2017-05-31 02:35:40.000000000 +0000 @@ -397,8 +397,11 @@ skip 'misc. stuff; missing annotations', 4 unless Gtk3::CHECK_VERSION(3, 2, 0); - my $event = Gtk3::Gdk::Event->new ('button-press'); + # First, clear all pending events. + Gtk3::main_iteration while Gtk3::events_pending; + # Then add our own. + my $event = Gtk3::Gdk::Event->new ('button-press'); $event->put; ok (Gtk3::Gdk::events_pending); isa_ok (Gtk3::Gdk::Event::get (), 'Gtk3::Gdk::EventButton'); diff -Nru libgtk3-perl-0.026/t/zz-GtkContainer.t libgtk3-perl-0.032/t/zz-GtkContainer.t --- libgtk3-perl-0.026/t/zz-GtkContainer.t 2015-11-30 17:45:06.000000000 +0000 +++ libgtk3-perl-0.032/t/zz-GtkContainer.t 2017-05-31 02:35:40.000000000 +0000 @@ -7,7 +7,7 @@ use strict; use warnings; -plan tests => 28; +plan tests => 42; # we'll create some containers (windows and boxes are containers) and # mess around with some of the methods to make sure they do things. @@ -107,17 +107,15 @@ ok (1); #------------------------------------------------------------------------------ -# child_get() - -=for FIXME3 +# child_get(), child_set() is_deeply ([$vbox->child_get ($entry, qw(expand fill pack-type padding position))], - [1, 1, "start", 0, 4]); + [1, 1, "start", 0, 3]); $vbox->child_set ($entry, expand => 0, position => 2); -$vbox->child_set_property ($entry, fill => 0); +$vbox->child_set ($entry, fill => 0); -is_deeply ([$vbox->child_get_property ($entry, qw(expand fill pack-type padding position))], +is_deeply ([$vbox->child_get ($entry, qw(expand fill pack-type padding position))], [0, 0, "start", 0, 2]); my $label = Gtk3::Label->new ("Blub"); @@ -127,13 +125,9 @@ ["end", 4]); $vbox->remove ($label); -=cut - #------------------------------------------------------------------------------ # find_child_property() -=for FIXME3 - is (Gtk3::Container->find_child_property('Gtk3-Perl-test-no-such-property'), undef, 'find_child_property() no such child property'); @@ -143,11 +137,6 @@ undef, 'find_child_property() Not::A::Container::Class croaks'); -is (eval { Gtk3::Container::find_child_property('Gtk3::Widget', - 'propname'); 1 }, - undef, - 'find_child_property() Gtk3::Widget croaks'); - { my $pspec = Gtk3::Box->find_child_property('expand'); isa_ok ($pspec, 'Glib::Param::Boolean', @@ -165,13 +154,9 @@ 'find_child_property() object method "expand" is a boolean'); } -=cut - #------------------------------------------------------------------------------ # list_child_properties() -=for FIXME3 - # as of Gtk 2.20 the base Gtk3::Container class doesn't have any child # properties, but don't assume that, so don't ask anything of @pspecs, just # that list_child_properties() returns @@ -182,11 +167,6 @@ undef, 'list_child_properties() Not::A::Container::Class croaks'); -is (eval { Gtk3::Container::list_child_properties('Gtk3::Widget'); - 1 }, - undef, - 'list_child_properties() Gtk3::Widget croaks'); - { my @pspecs = Gtk3::Box->list_child_properties; cmp_ok (scalar(@pspecs), '>=', 2, @@ -208,10 +188,10 @@ my @pspecs = $hbox->list_child_properties; cmp_ok (scalar(@pspecs), '>=', 2, 'list_child_properties() object method at least "expand" and "pack"'); + isa_ok ($pspecs[0], 'Glib::ParamSpec'); + isa_ok ($pspecs[1], 'Glib::ParamSpec'); } -=cut - __END__ Copyright (C) 2003-2012 by the gtk2-perl team (see the file AUTHORS for the diff -Nru libgtk3-perl-0.026/t/zz-GtkDialog.t libgtk3-perl-0.032/t/zz-GtkDialog.t --- libgtk3-perl-0.026/t/zz-GtkDialog.t 2015-11-30 17:45:06.000000000 +0000 +++ libgtk3-perl-0.032/t/zz-GtkDialog.t 2017-05-31 02:35:40.000000000 +0000 @@ -7,7 +7,7 @@ use strict; use warnings; -plan tests => 15; +plan tests => 17; my $win = Gtk3::Window->new ('toplevel'); @@ -50,6 +50,24 @@ $d3->signal_connect (response => sub { is ($_[1], 44); 1; }); $btn3->clicked; +# test whether user data are passed to the callback functions +{ + my $d = Gtk3::Dialog->new; + $d->set_transient_for ($win); + my $b = $d->add_button ('First Button', 'ok'); + # pass user data to the callback function + $d->signal_connect('response'=> sub { + is ($_[2], 'DATA', 'user data are passed to the callback function'); + Gtk3::EVENT_STOP; + }, 'DATA'); + Glib::Idle->add( sub { + $b->clicked; + Glib::SOURCE_REMOVE; + }); + is ($d->run, 'ok'); + $d->hide; +} + # make sure that known response types are converted to strings for the reponse # signal of Gtk3::Dialog and its ancestors SKIP: { diff -Nru libgtk3-perl-0.026/t/zz-GtkInfoBar.t libgtk3-perl-0.032/t/zz-GtkInfoBar.t --- libgtk3-perl-0.026/t/zz-GtkInfoBar.t 2015-11-30 17:45:06.000000000 +0000 +++ libgtk3-perl-0.032/t/zz-GtkInfoBar.t 2017-05-31 02:35:40.000000000 +0000 @@ -8,7 +8,7 @@ use strict; use warnings; -plan tests => 15; +plan tests => 16; ok (my $win = Gtk3::Window->new ('toplevel')); @@ -43,15 +43,25 @@ $infobar->set_default_response (4); ok (1, 'set_default_response'); +{ + my $infobar = Gtk3::InfoBar->new; + $infobar->signal_connect (response => sub { + is ($_[2], 'DATA', 'user data made it through'); + Gtk3::EVENT_STOP; + }, 'DATA'); + $infobar->response ('ok'); +} + SKIP: { skip 'Need generic signal marshaller', 2 unless check_gi_version (1, 33, 10); + my $infobar = Gtk3::InfoBar->new; $infobar->signal_connect (response => sub { - my ($infobar,$response) = @_; + my ($infobar, $response) = @_; my $expected = $infobar->{expected_response}; - ok ($response eq $expected, "response '$expected'"); - 1; + is ($response, $expected, "response '$expected'"); + Gtk3::EVENT_STOP; }); $infobar->response ($infobar->{expected_response} = 5); $infobar->response ($infobar->{expected_response} = 'ok');