[perl-Gtk2] Wrap overlooked gtk+ 2.16 API



commit ebc5479de2a2a626886327d6e3219f208a686c36
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Thu Dec 30 16:37:43 2010 +0100

    Wrap overlooked gtk+ 2.16 API

 NEWS                 |    2 +-
 maps-2.16            |    2 ++
 t/GtkActivatable.t   |   24 ++++++++++++++++++++++++
 t/GtkEntry.t         |   10 +++++++---
 t/GtkMenuItem.t      |   22 ++++++++++++----------
 xs/GtkActivatable.xs |   23 +++++++++++++++++++++++
 xs/GtkEntry.xs       |    4 ++++
 xs/GtkMenuItem.xs    |    4 ++++
 xs_files-2.16        |    1 +
 9 files changed, 78 insertions(+), 14 deletions(-)
---
diff --git a/NEWS b/NEWS
index 3efe968..0c423e4 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,7 @@
 Overview of changes in the next unstable release
 ================================================
 
-* Wrap missing gtk+ 2.20 API.
+* Wrap missing gtk+ 2.16, 2.18 and 2.20 API.
 * Wrap gtk+ 2.22 API.
 * Gtk2::Notebook: fix invocation of window creation hooks.
 * Fix length of Gtk2::Gdk::Pixbuf->get_pixels() return.
diff --git a/maps-2.16 b/maps-2.16
index 21f59a0..a9752c9 100644
--- a/maps-2.16
+++ b/maps-2.16
@@ -1,2 +1,4 @@
+GTK_TYPE_ACTIVATABLE	GtkActivatable	GInterface	Gtk2::Activatable
+GTK_TYPE_ARROW_PLACEMENT	GtkArrowPlacement	GEnum	Gtk2::ArrowPlacement
 GTK_TYPE_ORIENTABLE  GtkOrientable  GInterface  Gtk2::Orientable
 GTK_TYPE_ENTRY_ICON_POSITION  GtkEntryIconPosition  GEnum  Gtk2::EntryIconPosition
diff --git a/t/GtkActivatable.t b/t/GtkActivatable.t
new file mode 100644
index 0000000..7878f71
--- /dev/null
+++ b/t/GtkActivatable.t
@@ -0,0 +1,24 @@
+#!/usr/bin/env perl
+use Gtk2::TestHelper
+  tests => 4,
+  at_least_version => [2, 16, 0, "Gtk2::Activatable is new in 2.16"];
+
+my $activatable = Gtk2::Button->new ('Test');
+isa_ok ($activatable, 'Gtk2::Activatable');
+
+my $action = Gtk2::Action->new ('name', 'label', 'tooltip', 'gtk-ok');
+
+is ($activatable->get_related_action, undef);
+$activatable->set_related_action ($action);
+is ($activatable->get_related_action, $action);
+
+$activatable->set_use_action_appearance (TRUE);
+ok ($activatable->get_use_action_appearance);
+
+$activatable->do_set_related_action ($action);
+$activatable->sync_action_properties ($action);
+
+__END__
+
+Copyright (C) 2010 by the gtk2-perl team (see the file AUTHORS for the
+full list).  See LICENSE for more information.
diff --git a/t/GtkEntry.t b/t/GtkEntry.t
index be17afb..e6a6643 100644
--- a/t/GtkEntry.t
+++ b/t/GtkEntry.t
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 use strict;
-use Gtk2::TestHelper tests => 68;
+use Gtk2::TestHelper tests => 76;
 
 # $Id$
 
@@ -100,7 +100,7 @@ SKIP: {
 }
 
 SKIP: {
-  skip '2.16 stuff', 40
+  skip '2.16 stuff', 48
     unless Gtk2->CHECK_VERSION(2, 16, 0);
 
   ## progress methods
@@ -234,12 +234,16 @@ sub test_icon_methods {
   is($entry -> get_icon_pixbuf($icon_pos), undef);
 
 
-  # This method can't be tested, at least we call them just in case they crash
+  # Icon tooltips
   $entry -> set_icon_tooltip_markup($icon_pos, "<b>Pan</b><i>Go</i> tooltip");
+  is($entry -> get_icon_tooltip_markup($icon_pos), "<b>Pan</b><i>Go</i> tooltip");
   $entry -> set_icon_tooltip_markup($icon_pos, undef);
+  is($entry -> get_icon_tooltip_markup($icon_pos), undef);
 
   $entry -> set_icon_tooltip_text($icon_pos, "Text tooltip");
+  is($entry -> get_icon_tooltip_text($icon_pos), "Text tooltip");
   $entry -> set_icon_tooltip_text($icon_pos, undef);
+  is($entry -> get_icon_tooltip_text($icon_pos), undef);
 
 
   $entry -> set_icon_drag_source(
diff --git a/t/GtkMenuItem.t b/t/GtkMenuItem.t
index 98994ac..5a75dc6 100644
--- a/t/GtkMenuItem.t
+++ b/t/GtkMenuItem.t
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 use strict;
-use Gtk2::TestHelper tests => 19;
+use Gtk2::TestHelper tests => 20;
 
 # $Id$
 
@@ -66,6 +66,17 @@ SKIP: {
   is ($item -> get_accel_path(), '<bla>/bla/bla');
 }
 
+SKIP: {
+  skip 'new 2.16 stuff', 2
+    unless Gtk2->CHECK_VERSION(2, 16, 0);
+
+  my $item = Gtk2::MenuItem->new ("_foo");
+  $item->set_use_underline (TRUE);
+  is ($item->get_use_underline, TRUE, '[gs]et_use_underline');
+  $item->set_label ('Test');
+  is ($item->get_label, 'Test');
+}
+
 #-----------------------------------------------------------------------------
 # circular ref between MenuItem and child AccelLabel
 #
@@ -110,15 +121,6 @@ SKIP: {
   if ($item) { $item->destroy; }
 }
 
-SKIP: {
-  skip 'new 2.18 stuff', 1
-	unless Gtk2->CHECK_VERSION(2, 18, 0);
-
-	my $item = Gtk2::MenuItem->new("_foo");
-	$item->set_use_underline(TRUE);
-	is( $item->get_use_underline, TRUE, '[gs]et_use_underline');
-}
-
 __END__
 
 Copyright (C) 2003, 2010 by the gtk2-perl team (see the file AUTHORS for the
diff --git a/xs/GtkActivatable.xs b/xs/GtkActivatable.xs
new file mode 100644
index 0000000..0c2f3cc
--- /dev/null
+++ b/xs/GtkActivatable.xs
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2010 by the gtk2-perl team (see the file AUTHORS)
+ *
+ * Licensed under the LGPL, see LICENSE file for more information.
+ *
+ * $Id$
+ */
+
+#include "gtk2perl.h"
+
+MODULE = Gtk2::Activatable	PACKAGE = Gtk2::Activatable	PREFIX = gtk_activatable_
+
+void gtk_activatable_do_set_related_action (GtkActivatable *activatable, GtkAction *action);
+
+GtkAction_ornull * gtk_activatable_get_related_action (GtkActivatable *activatable);
+
+gboolean gtk_activatable_get_use_action_appearance (GtkActivatable *activatable);
+
+void gtk_activatable_sync_action_properties (GtkActivatable *activatable, GtkAction *action);
+
+void gtk_activatable_set_related_action (GtkActivatable *activatable, GtkAction *action);
+
+void gtk_activatable_set_use_action_appearance (GtkActivatable *activatable, gboolean use_appearance);
diff --git a/xs/GtkEntry.xs b/xs/GtkEntry.xs
index d88260b..bdb826c 100644
--- a/xs/GtkEntry.xs
+++ b/xs/GtkEntry.xs
@@ -274,8 +274,12 @@ void gtk_entry_set_icon_sensitive (GtkEntry *entry, GtkEntryIconPosition icon_po
 
 void gtk_entry_set_icon_tooltip_markup (GtkEntry *entry, GtkEntryIconPosition icon_pos, const gchar_ornull *tooltip);
 
+gchar_own_ornull * gtk_entry_get_icon_tooltip_markup (GtkEntry *entry, GtkEntryIconPosition icon_pos);
+
 void gtk_entry_set_icon_tooltip_text (GtkEntry *entry, GtkEntryIconPosition icon_pos, const gchar_ornull *tooltip);
 
+gchar_own_ornull * gtk_entry_get_icon_tooltip_text (GtkEntry *entry, GtkEntryIconPosition icon_pos);
+
 void gtk_entry_set_progress_fraction (GtkEntry *entry, gdouble fraction);
 
 void gtk_entry_set_progress_pulse_step (GtkEntry *entry, gdouble fraction);
diff --git a/xs/GtkMenuItem.xs b/xs/GtkMenuItem.xs
index 72dc26f..d60eeed 100644
--- a/xs/GtkMenuItem.xs
+++ b/xs/GtkMenuItem.xs
@@ -183,5 +183,9 @@ gtk_menu_item_get_use_underline (GtkMenuItem *menu_item)
 void
 gtk_menu_item_set_use_underline (GtkMenuItem *menu_item, gboolean use_underline)
 
+const gchar * gtk_menu_item_get_label (GtkMenuItem *menu_item);
+
+void gtk_menu_item_set_label (GtkMenuItem *menu_item, const gchar *label);
+
 #endif /* 2.16 */
 
diff --git a/xs_files-2.16 b/xs_files-2.16
index 74a776d..583536e 100644
--- a/xs_files-2.16
+++ b/xs_files-2.16
@@ -1 +1,2 @@
+xs/GtkActivatable.xs
 xs/GtkOrientable.xs



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