[perl-Gtk2] Wrap overlooked gtk+ 2.20 and 2.22 API



commit bca58c872602ab4c0717c82bba01c484551e0cfc
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Thu Dec 30 02:38:44 2010 +0100

    Wrap overlooked gtk+ 2.20 and 2.22 API

 t/01.GtkWindow.t |   20 ++++++++++++++++++--
 t/GtkPaned.t     |   13 ++++++++++++-
 xs/GtkPaned.xs   |    5 +++++
 xs/GtkWindow.xs  |   14 ++++++++++++++
 4 files changed, 49 insertions(+), 3 deletions(-)
---
diff --git a/t/01.GtkWindow.t b/t/01.GtkWindow.t
index 528bd1f..6d9ff20 100644
--- a/t/01.GtkWindow.t
+++ b/t/01.GtkWindow.t
@@ -10,7 +10,7 @@
 
 #########################
 
-use Gtk2::TestHelper tests => 117;
+use Gtk2::TestHelper tests => 120;
 
 ok( my $win = Gtk2::Window->new );
 ok( $win = Gtk2::Window->new('popup') );
@@ -400,12 +400,28 @@ SKIP: {
 }
 
 SKIP: {
-	skip 'new 2.20 stuff', 1
+	skip 'new 2.20 stuff', 2
 		unless Gtk2->CHECK_VERSION(2, 20, 0);
 
 	my $window = Gtk2::Window->new;
 	is ($window->get_window_type, 'toplevel');
+
 	$window->set_mnemonics_visible (TRUE);
+	ok ($window->get_mnemonics_visible);
+}
+
+SKIP: {
+	skip 'new 2.22 stuff', 2
+		unless Gtk2->CHECK_VERSION(2, 22, 0);
+
+	my $window = Gtk2::Window->new;
+	my $group = Gtk2::WindowGroup->new ();
+	$group->add_window ($window);
+
+	ok ($window->has_group);
+
+	my $grab = $group->get_current_grab;
+	ok ((defined $grab && $grab->isa ('Gtk2::Widget')) || !defined $grab);
 }
 
 
diff --git a/t/GtkPaned.t b/t/GtkPaned.t
index 3a12063..aeb81cf 100644
--- a/t/GtkPaned.t
+++ b/t/GtkPaned.t
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-use Gtk2::TestHelper tests => 9;
+use Gtk2::TestHelper tests => 10;
 
 # $Id$
 
@@ -49,6 +49,17 @@ $vpaned->child2_shrink (42);
 
 $hpaned->compute_position (23, 10, 10);
 
+SKIP: {
+  skip 'new 2.20 stuff', 1
+    unless Gtk2->CHECK_VERSION(2, 20, 0);
+
+  my $window = Gtk2::Window->new;
+  my $paned = Gtk2::HPaned->new;
+  $window->add ($paned);
+  $paned->realize;
+  isa_ok ($paned->get_handle_window, 'Gtk2::Gdk::Window');
+}
+
 __END__
 
 # The following 50 tests are disabled because they proved unreliable.
diff --git a/xs/GtkPaned.xs b/xs/GtkPaned.xs
index a07d17c..790b54b 100644
--- a/xs/GtkPaned.xs
+++ b/xs/GtkPaned.xs
@@ -160,3 +160,8 @@ gtk_paned_compute_position (paned, allocation, child1_req, child2_req)
 	gint       child1_req
 	gint       child2_req
 
+#if GTK_CHECK_VERSION (2, 20, 0)
+
+GdkWindow * gtk_paned_get_handle_window (GtkPaned *paned);
+
+#endif /* 2.20 */
diff --git a/xs/GtkWindow.xs b/xs/GtkWindow.xs
index 4e783a1..35a74a0 100644
--- a/xs/GtkWindow.xs
+++ b/xs/GtkWindow.xs
@@ -750,8 +750,16 @@ GtkWindowType gtk_window_get_window_type (GtkWindow *window);
 
 void gtk_window_set_mnemonics_visible (GtkWindow *window, gboolean setting);
 
+gboolean gtk_window_get_mnemonics_visible (GtkWindow *window);
+
 #endif /* 2.20 */
 
+#if GTK_CHECK_VERSION (2, 22, 0)
+
+gboolean gtk_window_has_group (GtkWindow *window);
+
+#endif /* 2.22 */
+
 MODULE = Gtk2::Window	PACKAGE = Gtk2::WindowGroup	PREFIX = gtk_window_group_
 
 ## GtkWindowGroup * gtk_window_group_new (void)
@@ -788,6 +796,12 @@ gtk_window_group_list_windows (GtkWindowGroup *window_group)
 
 #endif /* 2.14 */
 
+#if GTK_CHECK_VERSION (2, 22, 0)
+
+GtkWidget * gtk_window_group_get_current_grab (GtkWindowGroup *window_group);
+
+#endif /* 2.22 */
+
  ## er... dunno about these.
  ##
  ##void



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