r31720 - in /branches/upstream/libgtk2-perl/current: ./ pm/ t/ xs/
ryan52-guest at users.alioth.debian.org
ryan52-guest at users.alioth.debian.org
Sun Mar 8 21:52:24 UTC 2009
Author: ryan52-guest
Date: Sun Mar 8 21:52:21 2009
New Revision: 31720
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=31720
Log:
[svn-upgrade] Integrating new upstream version, libgtk2-perl (1.212)
Modified:
branches/upstream/libgtk2-perl/current/ChangeLog
branches/upstream/libgtk2-perl/current/Gtk2.pm
branches/upstream/libgtk2-perl/current/META.yml
branches/upstream/libgtk2-perl/current/Makefile.PL
branches/upstream/libgtk2-perl/current/NEWS
branches/upstream/libgtk2-perl/current/README
branches/upstream/libgtk2-perl/current/pm/Helper.pm
branches/upstream/libgtk2-perl/current/pm/TestHelper.pm
branches/upstream/libgtk2-perl/current/t/00.Gtk2.t
branches/upstream/libgtk2-perl/current/t/GdkKeys.t
branches/upstream/libgtk2-perl/current/t/GtkHBox.t
branches/upstream/libgtk2-perl/current/t/GtkStyle.t
branches/upstream/libgtk2-perl/current/t/GtkTreeModelFilter.t
branches/upstream/libgtk2-perl/current/t/GtkTreeModelIface.t
branches/upstream/libgtk2-perl/current/xs/Gtk2.xs
branches/upstream/libgtk2-perl/current/xs/GtkAccelGroup.xs
branches/upstream/libgtk2-perl/current/xs/GtkStyle.xs
branches/upstream/libgtk2-perl/current/xs/GtkTreeModel.xs
branches/upstream/libgtk2-perl/current/xs/GtkTreeModelFilter.xs
branches/upstream/libgtk2-perl/current/xs/GtkWidget.xs
branches/upstream/libgtk2-perl/current/xs/GtkWindow.xs
Modified: branches/upstream/libgtk2-perl/current/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/ChangeLog?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/ChangeLog (original)
+++ branches/upstream/libgtk2-perl/current/ChangeLog Sun Mar 8 21:52:21 2009
@@ -1,3 +1,68 @@
+2009-03-08 Torsten Schoenfeld <kaffeetisch at gmx.de>
+
+ * Gtk2.pm
+ * Makefile
+ * NEWS
+ * README: Unstable release 1.212.
+
+2009-03-08 Torsten Schoenfeld <kaffeetisch at gmx.de>
+
+ * t/GtkHBox.t: Test that widgets packed into a box are completely
+ freed upon removal even if they previously appeared as a callback
+ argument. This is a test for a recent memory leak fix in Glib.
+
+ * t/GtkTreeModelIface.t: The leak fix mentioned above causes this
+ test to correctly run FINALIZE_INSTANCE now, so adjust the test
+ plan.
+
+2009-03-08 Torsten Schoenfeld <kaffeetisch at gmx.de>
+
+ * t/GtkTreeModelFilter.t
+ * xs/GtkTreeModelFilter.xs: Take ownership of objects returned by
+ gtk_tree_model_filter_new to avoid leaking them. Patch by
+ Kevin Ryde.
+
+2009-03-08 Torsten Schoenfeld <kaffeetisch at gmx.de>
+
+ * t/GtkStyle.t
+ * xs/GtkStyle.xs: Remove the get_property() alias for
+ Gtk2::Style::get() so that calling get_property() on a Gtk2::Style
+ resolves to Glib::Object::get_property().
+
+2009-03-01 Torsten Schoenfeld <kaffeetisch at gmx.de>
+
+ * xs/GtkAccelGroup.xs: Remove two FIXME comments which turned out
+ to be incorrect. Patch by Kevin Ryde.
+
+2009-02-22 Torsten Schoenfeld <kaffeetisch at gmx.de>
+
+ * t/GdkKeys.t: Skip most tests if we can't find a key entry to
+ test against.
+
+2009-02-22 Torsten Schoenfeld <kaffeetisch at gmx.de>
+
+ * t/00.Gtk2.t: Don't fail if there is no valid DISPLAY.
+
+2009-02-22 Torsten Schoenfeld <kaffeetisch at gmx.de>
+
+ * pm/TestHelper.pm
+ * pm/Helper.pm
+ * Gtk2.pm: Fix more POD errors.
+
+2009-02-22 Torsten Schoenfeld <kaffeetisch at gmx.de>
+
+ * xs/Gtk2.xs
+ * xs/GtkTreeModel.xs
+ * xs/GtkWidget.xs
+ * xs/GtkWindow.xs: Fix POD errors reported by podchecker.
+
+2009-02-21 Torsten Schoenfeld <kaffeetisch at gmx.de>
+
+ * t/GtkStyle.t
+ * xs/GtkStyle.xs: Wrap the gtk_style_get() family of methods as
+ Gtk2::Style::get(), and make Gtk2::Style::get_property() an alias
+ for get(). Patch by Emmanuel Rodriguez.
+
2009-02-13 Torsten Schoenfeld <kaffeetisch at gmx.de>
* Gtk2.pm
Modified: branches/upstream/libgtk2-perl/current/Gtk2.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/Gtk2.pm?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/Gtk2.pm (original)
+++ branches/upstream/libgtk2-perl/current/Gtk2.pm Sun Mar 8 21:52:21 2009
@@ -16,7 +16,7 @@
# along with this library; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA.
#
-# $Id: Gtk2.pm 2142 2009-02-13 15:58:53Z tsch $
+# $Id: Gtk2.pm 2155 2009-03-08 20:00:50Z tsch $
#
package Gtk2;
@@ -73,7 +73,7 @@
use Exporter;
require DynaLoader;
-our $VERSION = '1.211';
+our $VERSION = '1.212';
our @ISA = qw(DynaLoader Exporter);
@@ -390,6 +390,8 @@
=head1 AUTHORS
+=encoding utf8
+
The gtk2-perl team:
muppet <scott at asofyet dot org>
Modified: branches/upstream/libgtk2-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/META.yml?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/META.yml (original)
+++ branches/upstream/libgtk2-perl/current/META.yml Sun Mar 8 21:52:21 2009
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Gtk2
-version: 1.211
+version: 1.212
abstract: Perl interface to the 2.x series of the Gimp Toolkit library
author: []
license: unknown
@@ -10,13 +10,13 @@
ExtUtils::Depends: 0.300
ExtUtils::MakeMaker: 0
ExtUtils::PkgConfig: 1.030
- Glib: 1.212
+ Glib: 1.214
Pango: 1.210
requires:
Cairo: 1.000
ExtUtils::Depends: 0.300
ExtUtils::PkgConfig: 1.030
- Glib: 1.212
+ Glib: 1.214
Pango: 1.210
no_index:
directory:
Modified: branches/upstream/libgtk2-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/Makefile.PL?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/Makefile.PL (original)
+++ branches/upstream/libgtk2-perl/current/Makefile.PL Sun Mar 8 21:52:21 2009
@@ -15,7 +15,7 @@
# along with this library; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA.
#
-# $Id: Makefile.PL 2140 2009-02-13 15:36:37Z tsch $
+# $Id: Makefile.PL 2155 2009-03-08 20:00:50Z tsch $
#
BEGIN { require 5.008; }
@@ -33,8 +33,8 @@
our %build_reqs = (
'perl-ExtUtils-Depends' => '0.300',
'perl-ExtUtils-PkgConfig' => '1.030',
- 'perl-Glib' => '1.212', # FIXME: 1.220
- 'perl-Pango' => '1.210',
+ 'perl-Glib' => '1.214', # FIXME: Glib 1.220
+ 'perl-Pango' => '1.210', # FIXME: Pango 1.220
'perl-Cairo' => '1.000',
'Gtk+' => '2.0.0',
);
Modified: branches/upstream/libgtk2-perl/current/NEWS
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/NEWS?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/NEWS (original)
+++ branches/upstream/libgtk2-perl/current/NEWS Sun Mar 8 21:52:21 2009
@@ -1,3 +1,11 @@
+Overview of changes in Gtk2 1.212
+=================================
+
+* Wrap gtk_style_get.
+* Fix a leak in Gtk2::TreeModelFilter::new.
+* Fix a few POD errors.
+* Fix some test suite issues.
+
Overview of changes in Gtk2 1.211
=================================
Modified: branches/upstream/libgtk2-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/README?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/README (original)
+++ branches/upstream/libgtk2-perl/current/README Sun Mar 8 21:52:21 2009
@@ -1,4 +1,4 @@
-Gtk2 version 1.211
+Gtk2 version 1.212
==================
Perl bindings to the 2.x series of the Gtk+ graphical user interface library.
@@ -102,4 +102,4 @@
with this library; if not, write to the Free Software Foundation, Inc., 59
Temple Place - Suite 330, Boston, MA 02111-1307 USA.
-# $Id: README 2142 2009-02-13 15:58:53Z tsch $
+# $Id: README 2155 2009-03-08 20:00:50Z tsch $
Modified: branches/upstream/libgtk2-perl/current/pm/Helper.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/pm/Helper.pm?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/pm/Helper.pm (original)
+++ branches/upstream/libgtk2-perl/current/pm/Helper.pm Sun Mar 8 21:52:21 2009
@@ -1,5 +1,5 @@
#
-# $Id: Helper.pm 2054 2008-10-05 12:49:36Z tsch $
+# $Id: Helper.pm 2148 2009-02-22 16:46:43Z tsch $
#
package Gtk2::Helper;
@@ -184,11 +184,13 @@
=head1 AUTHOR
-Jörn Reder E<lt>joern AT zyn.deE<gt>
+=encoding utf8
+
+Jörn Reder E<lt>joern AT zyn.deE<gt>
=head1 COPYRIGHT AND LICENSE
-Copyright 2003 by Jörn Reder
+Copyright 2003 by Jörn Reder
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
Modified: branches/upstream/libgtk2-perl/current/pm/TestHelper.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/pm/TestHelper.pm?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/pm/TestHelper.pm (original)
+++ branches/upstream/libgtk2-perl/current/pm/TestHelper.pm Sun Mar 8 21:52:21 2009
@@ -1,5 +1,5 @@
#
-# $Id: TestHelper.pm 2054 2008-10-05 12:49:36Z tsch $
+# $Id: TestHelper.pm 2148 2009-02-22 16:46:43Z tsch $
#
package Gtk2::TestHelper;
@@ -219,8 +219,6 @@
with all of the GInterfaces that the type system claims it supports. Something
like an isa_ok() in steroids.
-=back
-
=item delta_ok (A, B [, NAME])
Checks that the absolute difference of the numbers A and B is smaller than
Modified: branches/upstream/libgtk2-perl/current/t/00.Gtk2.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/t/00.Gtk2.t?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/t/00.Gtk2.t (original)
+++ branches/upstream/libgtk2-perl/current/t/00.Gtk2.t Sun Mar 8 21:52:21 2009
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
-# $Id: 00.Gtk2.t 2095 2008-11-22 14:49:27Z tsch $
+# $Id: 00.Gtk2.t 2149 2009-02-22 17:32:48Z tsch $
#
use strict;
@@ -165,7 +165,7 @@
my $context = Glib::OptionContext->new ('- urgsify your life');
$context->add_main_entries ($options, 'C');
- $context->add_group (Gtk2->get_option_group (1));
+ $context->add_group (Gtk2->get_option_group (0));
@ARGV = qw(--name Foo --foos 23);
$context->parse ();
Modified: branches/upstream/libgtk2-perl/current/t/GdkKeys.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/t/GdkKeys.t?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/t/GdkKeys.t (original)
+++ branches/upstream/libgtk2-perl/current/t/GdkKeys.t Sun Mar 8 21:52:21 2009
@@ -2,7 +2,7 @@
use strict;
use Gtk2::TestHelper tests => 43;
-# $Id: GdkKeys.t 2054 2008-10-05 12:49:36Z tsch $
+# $Id: GdkKeys.t 2150 2009-02-22 17:33:48Z tsch $
use Gtk2::Gdk::Keysyms;
@@ -18,6 +18,11 @@
}
my @keys = $map -> get_entries_for_keyval($Gtk2::Gdk::Keysyms{ Escape });
+
+SKIP: {
+skip 'No key entries for Escape found in the keymap', 41
+ unless scalar @keys;
+
isa_ok($keys[0], "HASH");
like($keys[0] -> { keycode }, qr/^\d+$/);
like($keys[0] -> { group }, qr/^\d+$/);
@@ -98,6 +103,8 @@
my $unicode = Gtk2::Gdk -> keyval_to_unicode($a);
is(Gtk2::Gdk -> unicode_to_keyval($unicode), $a);
+}
+
__END__
Copyright (C) 2003 by the gtk2-perl team (see the file AUTHORS for the
Modified: branches/upstream/libgtk2-perl/current/t/GtkHBox.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/t/GtkHBox.t?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/t/GtkHBox.t (original)
+++ branches/upstream/libgtk2-perl/current/t/GtkHBox.t Sun Mar 8 21:52:21 2009
@@ -1,13 +1,32 @@
#!/usr/bin/perl -w
use strict;
-use Gtk2::TestHelper tests => 1, noinit => 1;
+use Gtk2::TestHelper tests => 3, noinit => 1;
-# $Id: GtkHBox.t 2054 2008-10-05 12:49:36Z tsch $
+# $Id: GtkHBox.t 2154 2009-03-08 18:40:43Z tsch $
my $box = Gtk2::HBox -> new();
isa_ok($box, "Gtk2::HBox");
+{
+ my $label = Gtk2::Label->new ('hello');
+ $box->pack_start ($label, 0,0,0);
+ $box->remove($label);
+ require Scalar::Util;
+ Scalar::Util::weaken ($label);
+ is ($label, undef, 'child destroyed by weakening after being in box');
+}
+{
+ my $label = Gtk2::Label->new ('hello');
+ $box->pack_start ($label, 0,0,0);
+ $box->foreach (sub { });
+ $box->remove($label);
+ require Scalar::Util;
+ Scalar::Util::weaken ($label);
+ is ($label, undef,
+ 'child destroyed by weakening after being in box -- and foreach()');
+}
+
__END__
-Copyright (C) 2003 by the gtk2-perl team (see the file AUTHORS for the
+Copyright (C) 2003, 2009 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
Modified: branches/upstream/libgtk2-perl/current/t/GtkStyle.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/t/GtkStyle.t?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/t/GtkStyle.t (original)
+++ branches/upstream/libgtk2-perl/current/t/GtkStyle.t Sun Mar 8 21:52:21 2009
@@ -1,9 +1,10 @@
#!/usr/bin/perl -w
# vim: set ft=perl expandtab shiftwidth=2 softtabstop=2 :
use strict;
-use Gtk2::TestHelper tests => 113;
-
-# $Id: GtkStyle.t 2054 2008-10-05 12:49:36Z tsch $
+use Gtk2::TestHelper tests => 124;
+use Carp;
+
+# $Id: GtkStyle.t 2152 2009-03-08 17:01:28Z tsch $
my $window = Gtk2::Window -> new();
$window -> realize();
@@ -133,7 +134,129 @@
ok (1);
}
+SKIP: {
+ skip("get is new in 2.16", 12)
+ unless (Gtk2->CHECK_VERSION(2, 15, 0)); # FIXME 2.16
+
+ # Test different properties (gint, gboolean, gchar* and GObject)
+ my $treeview = Gtk2::TreeView -> new();
+
+ # get gboolean
+ is (
+ $style -> get('Gtk2::TreeView', 'allow-rules'),
+ $treeview -> style_get_property('allow-rules'),
+ "get_property gboolean"
+ );
+
+ # get gint
+ is (
+ $style -> get('Gtk2::TreeView', 'expander-size'),
+ $treeview -> style_get_property('expander-size'),
+ "get_property gint"
+ );
+
+ # get gchar*
+ is (
+ $style -> get('Gtk2::TreeView', 'grid_line-pattern'),
+ $treeview -> style_get_property('grid_line-pattern'),
+ "get_property gchar*"
+ );
+
+ # get GObject (a color)
+ is (
+ $style -> get('Gtk2::TreeView', 'even-row-color'),
+ $treeview -> style_get_property('even-row-color'),
+ "get_property GObject*"
+ );
+
+
+
+ # Get multiple properties simultaneously
+ my @properties = $style -> get('Gtk2::TreeView', 'expander-size', 'even-row-color', 'grid_line-pattern');
+ is_deeply (
+ \@properties,
+ [
+ $treeview -> style_get_property('expander-size'),
+ $treeview -> style_get_property('even-row-color'),
+ $treeview -> style_get_property('grid_line-pattern'),
+ ],
+ 'get multiple properties',
+ );
+
+
+
+ # Make sure that Glib::GObject::get() and Gtk2::Style::get() can coexist.
+ my $custom_style = Custom::Style -> new();
+ is ($custom_style -> Glib::Object::get('perl-string'), 'empty');
+ is ($custom_style -> get_property('perl-string'), 'empty');
+ is ($custom_style -> get('Gtk2::Button', 'image-spacing'), 2);
+
+
+
+ # Test for bad usage
+ # Bad class
+ test_die(
+ sub { $style -> get('wrong::class', 'border'); },
+ qr/^package wrong::class is not registered with GPerl/
+ );
+
+ # Non existing property
+ test_die(
+ sub { $style -> get('Gtk2::Button', 'image-spacing', 'perl-var', 'default-border'); },
+ qr/^type Gtk2::Button does not support style property 'perl-var'/
+ );
+
+ # Not a Gtk2::Widget
+ test_die(
+ sub { $style -> get('Glib::Object', 'prop'); },
+ qr/^Glib::Object is not a subclass of Gtk2::Widget/
+ );
+}
+
+
+# Test that an error is thrown
+sub test_die {
+ my ($code, $regexp) = @_;
+ croak "usage(code, regexp)" unless ref $code eq 'CODE';
+
+ my $passed = FALSE;
+ eval {
+ $code->();
+ };
+ if (my $error = $@) {
+ if ($error =~ /$regexp/) {
+ $passed = TRUE;
+ }
+ else {
+ diag("Expected $regexp but got $error");
+ }
+ }
+
+ return Test::More->builder->ok($passed);
+}
+
+
+#
+# Used to test if Gtk2::Style::get() conflicts with Glib::GObject::get(). A new
+# package is needed because as of gtk+ 2.16, Gtk2::Style defines no properties.
+#
+package Custom::Style;
+
+use Glib::Object::Subclass 'Gtk2::Style' =>
+
+ properties => [
+ Glib::ParamSpec->string(
+ 'perl-string',
+ 'Test string',
+ 'A test string.',
+ 'empty',
+ ['readable', 'writable'],
+ ),
+ ],
+;
+
+
__END__
-Copyright (C) 2003-2006 by the gtk2-perl team (see the file AUTHORS for the
+Copyright (C) 2003-2009 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
Modified: branches/upstream/libgtk2-perl/current/t/GtkTreeModelFilter.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/t/GtkTreeModelFilter.t?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/t/GtkTreeModelFilter.t (original)
+++ branches/upstream/libgtk2-perl/current/t/GtkTreeModelFilter.t Sun Mar 8 21:52:21 2009
@@ -1,11 +1,11 @@
#!/usr/bin/perl -w
use strict;
use Gtk2::TestHelper
- tests => 26,
+ tests => 27,
noinit => 1,
at_least_version => [2, 4, 0, "GtkTreeModelFilter is new in 2.4"];
-# $Id: GtkTreeModelFilter.t 2054 2008-10-05 12:49:36Z tsch $
+# $Id: GtkTreeModelFilter.t 2153 2009-03-08 17:59:16Z tsch $
my $list = Gtk2::ListStore -> new("Glib::Int", "Glib::String");
@@ -76,7 +76,14 @@
$filter -> set_visible_column(0);
+{
+ require Scalar::Util;
+ my $f = Gtk2::TreeModelFilter->new($list);
+ Scalar::Util::weaken($f);
+ is ($f, undef, 'destroyed by weakening');
+}
+
__END__
-Copyright (C) 2003-2005 by the gtk2-perl team (see the file AUTHORS for the
+Copyright (C) 2003-2009 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
Modified: branches/upstream/libgtk2-perl/current/t/GtkTreeModelIface.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/t/GtkTreeModelIface.t?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/t/GtkTreeModelIface.t (original)
+++ branches/upstream/libgtk2-perl/current/t/GtkTreeModelIface.t Sun Mar 8 21:52:21 2009
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
-# $Id: GtkTreeModelIface.t 2054 2008-10-05 12:49:36Z tsch $
+# $Id: GtkTreeModelIface.t 2154 2009-03-08 18:40:43Z tsch $
package CustomList;
@@ -346,7 +346,7 @@
package main;
-use Gtk2::TestHelper tests => 179, noinit => 1;
+use Gtk2::TestHelper tests => 180, noinit => 1;
use strict;
use warnings;
@@ -456,6 +456,9 @@
$model->sort(3);
$model->sort(23);
+# This should result in a call to FINALIZE_INSTANCE
+$model = undef;
+
# Exercise Gtk2::TreeIter->set.
{ my $myvar;
my $stamp = 123;
Modified: branches/upstream/libgtk2-perl/current/xs/Gtk2.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/xs/Gtk2.xs?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/xs/Gtk2.xs (original)
+++ branches/upstream/libgtk2-perl/current/xs/Gtk2.xs Sun Mar 8 21:52:21 2009
@@ -16,7 +16,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307 USA.
*
- * $Id: Gtk2.xs 2103 2009-01-01 21:40:13Z tsch $
+ * $Id: Gtk2.xs 2147 2009-02-22 16:12:47Z tsch $
*/
#include "gtk2perl.h"
@@ -167,7 +167,9 @@
C<$Gtk2::VERSION> for the version of the bindings, all-caps
(MAJOR|MINOR|MICRO)_VERSION functions for the bound version, and
lower-case (major|minor|micro)_version functions for the runtime version.
-See L<Glib::version> and http://developer.gnome.org/doc/API/2.0/gtk/gtk-Feature-Test-Macros.html for more information.
+See L<Glib::version> and
+L<http://developer.gnome.org/doc/API/2.0/gtk/gtk-Feature-Test-Macros.html>
+for more information.
Note also that gtk_check_version() and GTK_CHECK_VERSION() have different
semantics in C, and we have preserved those faithfully.
@@ -282,11 +284,11 @@
PUSHs (sv_2mortal (newSViv (GTK_MICRO_VERSION)));
PERL_UNUSED_VAR (ax);
-=for apidoc
+=for apidoc
Provides a mechanism for checking the version information that Gtk2 was
compiled against. Essentially equvilent to the macro GTK_CHECK_VERSION. In most
cases this function should be used rather than
-L<check_version ()|Gtk2-E<gt>check_version>.
+L<check_version ()|/"string = Gtk2-E<gt>B<check_version> ($required_major, $required_minor, $required_micro)">.
=cut
gboolean
CHECK_VERSION (class, guint required_major, guint required_minor, guint required_micro)
Modified: branches/upstream/libgtk2-perl/current/xs/GtkAccelGroup.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/xs/GtkAccelGroup.xs?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/xs/GtkAccelGroup.xs (original)
+++ branches/upstream/libgtk2-perl/current/xs/GtkAccelGroup.xs Sun Mar 8 21:52:21 2009
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003 by the gtk2-perl team (see the file AUTHORS)
+ * Copyright (c) 2003, 2009 by the gtk2-perl team (see the file AUTHORS)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -16,7 +16,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307 USA.
*
- * $Id: GtkAccelGroup.xs 2067 2008-10-18 22:24:19Z tsch $
+ * $Id: GtkAccelGroup.xs 2151 2009-03-01 17:10:09Z tsch $
*/
#include "gtk2perl.h"
@@ -84,14 +84,12 @@
PREINIT:
GClosure * closure;
CODE:
+ /* gtk_accel_group_connect() sinks the floating ref from creation in
+ * gperl_closure_new()
+ */
closure = gperl_closure_new (func, NULL, FALSE);
gtk_accel_group_connect (accel_group, accel_key, accel_mods,
accel_flags, closure);
- /* i would swear until i was blue in the face that this unref
- * is the right thing to do, but with it in there i get a critical
- * assertion failure from glib when i try to disconnect the closure,
- * saying that the refcount was zero somehow. */
- /* g_closure_unref (closure); FIXME */
## void gtk_accel_group_connect_by_path (GtkAccelGroup *accel_group, const gchar *accel_path, GClosure *closure)
void
@@ -102,10 +100,11 @@
PREINIT:
GClosure * closure;
CODE:
+ /* gtk_accel_group_connect_by_path() sinks the floating ref from
+ * creation in gperl_closure_new()
+ */
closure = gperl_closure_new (func, NULL, FALSE);
gtk_accel_group_connect_by_path (accel_group, accel_path, closure);
- /* i wonder if we get the same problem here as above? */
- /* g_closure_unref (closure); FIXME */
# this will not work quite as advertised --- a GClosure can be
# attached to only one GtkAccelGroup, but we'll be creating a new
Modified: branches/upstream/libgtk2-perl/current/xs/GtkStyle.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/xs/GtkStyle.xs?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/xs/GtkStyle.xs (original)
+++ branches/upstream/libgtk2-perl/current/xs/GtkStyle.xs Sun Mar 8 21:52:21 2009
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2006 by the gtk2-perl team (see the file AUTHORS)
+ * Copyright (c) 2003-2009 by the gtk2-perl team (see the file AUTHORS)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -16,7 +16,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307 USA.
*
- * $Id: GtkStyle.xs 2054 2008-10-05 12:49:36Z tsch $
+ * $Id: GtkStyle.xs 2152 2009-03-08 17:01:28Z tsch $
*/
#include "gtk2perl.h"
@@ -572,3 +572,72 @@
RETVAL
#endif
+
+#if GTK_CHECK_VERSION (2, 15, 0) /* FIXME 2.16 */
+
+=for apidoc
+=for signature list = $style->get (widget_package, ...)
+=for arg widget_package (string) widget package name (ex: 'Gtk2::TreeView')
+=for arg ... (list) list of property names
+
+Fetch and return the values for the style properties named in I<...> for a
+widget of type I<widget_package>.
+
+B<Note>: This method shadows I<Glib::Object::get>. This shouldn't be a problem
+since I<Gtk2::Style> defines no properties (as of gtk+ 2.16). If you have a
+class that's derived from Gtk2::Style and adds a property or if a new version
+of gtk+ adds a property to I<Gtk2::Style>, the property can be accessed with
+I<get_property> which still resolves to I<Glib::Object::get_property>:
+
+ my $value = $style->get_property('property');
+
+=cut
+void
+gtk_style_get (style, widget_package, ...)
+ GtkStyle *style
+ const char *widget_package
+ PREINIT:
+ int i;
+ GType widget_type;
+ gpointer class;
+ CODE:
+ /* Use CODE: instead of PPCODE: so we can handle the stack ourselves in
+ * order to avoid that xsubs called by gtk_style_get_property overwrite
+ * what we put on the stack. */
+
+ widget_type = gperl_type_from_package (widget_package);
+ if (widget_type == 0)
+ croak ("package %s is not registered with GPerl", widget_package);
+
+ if (! g_type_is_a (widget_type, GTK_TYPE_WIDGET))
+ croak ("%s is not a subclass of Gtk2::Widget", widget_package);
+
+
+ class = g_type_class_ref (widget_type);
+ if (class == NULL)
+ croak ("can't find type class for type %s", widget_package);
+
+ for (i = 2 ; i < items ; i++) {
+ GValue value = {0, };
+ gchar *name = SvGChar (ST (i));
+ GParamSpec *pspec =
+ gtk_widget_class_find_style_property (class, name);
+
+ if (pspec) {
+ g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
+ gtk_style_get_property (style, widget_type, name, &value);
+ ST (i - 2) = sv_2mortal (gperl_sv_from_value (&value));
+ g_value_unset (&value);
+ }
+ else {
+ g_type_class_unref (class);
+ croak ("type %s does not support style property '%s'",
+ widget_package, name);
+ }
+ }
+
+ g_type_class_unref (class);
+
+ XSRETURN (items - 2);
+
+#endif
Modified: branches/upstream/libgtk2-perl/current/xs/GtkTreeModel.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/xs/GtkTreeModel.xs?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/xs/GtkTreeModel.xs (original)
+++ branches/upstream/libgtk2-perl/current/xs/GtkTreeModel.xs Sun Mar 8 21:52:21 2009
@@ -3,7 +3,7 @@
*
* Licensed under the LGPL, see LICENSE file for more information.
*
- * $Id: GtkTreeModel.xs 2100 2008-12-30 14:47:41Z tsch $
+ * $Id: GtkTreeModel.xs 2147 2009-02-22 16:12:47Z tsch $
*/
#include "gtk2perl.h"
@@ -1108,7 +1108,7 @@
=for apidoc get_value
=for arg ... of column indices
-Alias for L<get|list = $tree_model-E<gt>get ($iter, ...)>.
+Alias for L<get|/"$tree_model-E<gt>B<get> ($iter, ...)">.
=cut
=for apidoc
Modified: branches/upstream/libgtk2-perl/current/xs/GtkTreeModelFilter.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/xs/GtkTreeModelFilter.xs?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/xs/GtkTreeModelFilter.xs (original)
+++ branches/upstream/libgtk2-perl/current/xs/GtkTreeModelFilter.xs Sun Mar 8 21:52:21 2009
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2005 by the gtk2-perl team (see the file AUTHORS for a
+ * Copyright (C) 2003-2009 by the gtk2-perl team (see the file AUTHORS for a
* full list)
*
* This library is free software; you can redistribute it and/or
@@ -66,9 +66,19 @@
gperl_prepend_isa ("Gtk2::TreeModelFilter", "Gtk2::TreeModel");
## GtkTreeModel *gtk_tree_model_filter_new (GtkTreeModel *child_model, GtkTreePath *root);
-GtkTreeModel *gtk_tree_model_filter_new (class, GtkTreeModel *child_model, GtkTreePath_ornull *root=NULL);
- C_ARGS:
- child_model, root
+ ##
+ ## Use GtkTreeModelFilter_noinc return to take ownership of the
+ ## reference on the returned object. (GtkTreeModel is only a
+ ## GInterface and the typemaps for it don't include a _noinc or _own
+ ## variant.)
+ ##
+GtkTreeModelFilter_noinc *
+gtk_tree_model_filter_new (class, GtkTreeModel *child_model, GtkTreePath_ornull *root=NULL);
+ CODE:
+ RETVAL = (GtkTreeModelFilter *)
+ gtk_tree_model_filter_new(child_model, root);
+ OUTPUT:
+ RETVAL
## void gtk_tree_model_filter_set_visible_func (GtkTreeModelFilter *filter, GtkTreeModelFilterVisibleFunc func, gpointer data, GtkDestroyNotify destroy);
void
Modified: branches/upstream/libgtk2-perl/current/xs/GtkWidget.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/xs/GtkWidget.xs?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/xs/GtkWidget.xs (original)
+++ branches/upstream/libgtk2-perl/current/xs/GtkWidget.xs Sun Mar 8 21:52:21 2009
@@ -3,7 +3,7 @@
*
* Licensed under the LGPL, see LICENSE file for more information.
*
- * $Id: GtkWidget.xs 2086 2008-11-01 19:13:31Z tsch $
+ * $Id: GtkWidget.xs 2147 2009-02-22 16:12:47Z tsch $
*/
#include "gtk2perl.h"
@@ -571,7 +571,7 @@
Also remember that the size request is not necessarily the size a widget will
actually be allocated.
-See also L<get_child_requisition ()|requisistion = $widget-E<gt>get_child_requisition ()>
+See also L<get_child_requisition ()|/"requisition = $widget-E<gt>B<get_child_requisition>">
=cut
GtkRequisition_copy *
gtk_widget_size_request (widget)
@@ -600,7 +600,7 @@
geometry instead of the widget's requisition.
This function differs from
-L<size_request()|requisition = $widget-E<gt>size_request ()>
+L<size_request()|/"requisition = $widget-E<gt>B<size_request>">
in that it retrieves the last size request value from
C<< $widget->requisition >>,
while C<size_request()> actually calls the C<size_request> virtual method
@@ -788,9 +788,9 @@
C<set_size_request()>. A value of -1 for I<width> or I<height> indicates
that the dimension has not been explicitly set and the natural requisition
of the widget will be used instead.
-See L<set_size_request()|$widget-E<gt>set_size_request ($width-=1, $height=-1)>.
+See L<set_size_request()|/"$widget-E<gt>B<set_size_request> ($width=-1, $height=-1)">.
To get the size a widget will actually use, call
-L<size_request()|requisition = $widget-E<gt>size_request ()> instead of
+L<size_request()|/"requisition = $widget-E<gt>B<size_request>"> instead of
this function.
=cut
void
Modified: branches/upstream/libgtk2-perl/current/xs/GtkWindow.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgtk2-perl/current/xs/GtkWindow.xs?rev=31720&op=diff
==============================================================================
--- branches/upstream/libgtk2-perl/current/xs/GtkWindow.xs (original)
+++ branches/upstream/libgtk2-perl/current/xs/GtkWindow.xs Sun Mar 8 21:52:21 2009
@@ -16,7 +16,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307 USA.
*
- * $Id: GtkWindow.xs 2103 2009-01-01 21:40:13Z tsch $
+ * $Id: GtkWindow.xs 2147 2009-02-22 16:12:47Z tsch $
*/
#include "gtk2perl.h"
@@ -305,11 +305,11 @@
environments may also place it in the window frame, or display it in other
contexts.
-L<set_icon_list ()|$window-E<gt>set_icon_list> allows you to pass in the same icon in several
-hand-drawn sizes. The list should contain the natural sizes your icon is
-available in; that is, don't scale the image before passing it to GTK+.
-Scaling is postponed until the last minute, when the desired final size is
-known, to allow best quality.
+L<set_icon_list ()|/"$window-E<gt>B<set_icon_list> (...)"> allows you to pass
+in the same icon in several hand-drawn sizes. The list should contain the
+natural sizes your icon is available in; that is, don't scale the image before
+passing it to GTK+. Scaling is postponed until the last minute, when the
+desired final size is known, to allow best quality.
By passing several sizes, you may improve the final image quality of the icon,
by reducing or eliminating automatic image scaling.
@@ -333,7 +333,7 @@
# GList* gtk_window_get_icon_list (GtkWindow *window)
=for apidoc
-Retrieves the list of icons set by L<set_icon_list ()|$window-E<gt>set_icon_list>.
+Retrieves the list of icons set by L<set_icon_list()|/"$window-E<gt>B<set_icon_list> (...)">.
=cut
void
gtk_window_get_icon_list (window)
More information about the Pkg-perl-cvs-commits
mailing list