[perl-Gtk2] Properly wrap gtk_binding_entry_skip in version guards
- From: Torsten Schönfeld <tsch src gnome org>
- To: svn-commits-list gnome org
- Subject: [perl-Gtk2] Properly wrap gtk_binding_entry_skip in version guards
- Date: Sun, 7 Jun 2009 15:08:42 -0400 (EDT)
commit d59eb1dfa91ca7a6110c82dc82fcfdd6daa5329a
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date: Sun Jun 7 21:08:22 2009 +0200
Properly wrap gtk_binding_entry_skip in version guards
Don't try to compile bindings and run tests for gtk_binding_entry_skip if gtk+
isn't new enough.
Original patch by Kevin Ryde and Emmanuel Rodriguez.
---
t/GtkBindings.t | 6 +++++-
xs/GtkBindings.xs | 23 +++++++++++++++++------
2 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/t/GtkBindings.t b/t/GtkBindings.t
index 1a53ec5..e88fdad 100644
--- a/t/GtkBindings.t
+++ b/t/GtkBindings.t
@@ -350,11 +350,15 @@ SKIP: {
#-----------------------------------------------------------------------------
# entry_skip()
-# basic invocation on object doesn't dispatch
SKIP: {
skip 'Need a keymap', 8
unless $have_valid_keymap;
+ skip 'entry_skip() new in 2.12', 8
+ unless Gtk2->CHECK_VERSION(2, 12, 0);
+
+ # see that basic invocation on object doesn't dispatch
+ #
my $skip_bindings = Gtk2::BindingSet->new ('entry_skip_test');
my $keyval = Gtk2::Gdk->keyval_from_name('Return');
my $modifiers = [];
diff --git a/xs/GtkBindings.xs b/xs/GtkBindings.xs
index f97f60a..8f4247d 100644
--- a/xs/GtkBindings.xs
+++ b/xs/GtkBindings.xs
@@ -375,17 +375,28 @@ gtk_binding_entry_add_signal (binding_set, keyval, modifiers, signal_name, ...)
## guint keyval,
## GdkModifierType modifiers);
void
+gtk_binding_entry_remove (binding_set, keyval, modifiers)
+ GtkBindingSet *binding_set
+ guint keyval
+ GdkModifierType modifiers
+ CODE:
+ gtk_binding_entry_remove (binding_set, keyval, modifiers);
+
+#if GTK_CHECK_VERSION (2, 12, 0)
+
+## void gtk_binding_entry_skip (GtkBindingSet *binding_set,
+## guint keyval,
+## GdkModifierType modifiers);
+void
gtk_binding_entry_skip (binding_set, keyval, modifiers)
GtkBindingSet *binding_set
guint keyval
GdkModifierType modifiers
- ALIAS:
- entry_remove = 1
CODE:
- if (ix == 0)
- gtk_binding_entry_skip (binding_set, keyval, modifiers);
- else
- gtk_binding_entry_remove (binding_set, keyval, modifiers);
+ gtk_binding_entry_skip (binding_set, keyval, modifiers);
+
+#endif
+
MODULE = Gtk2::BindingSet PACKAGE = Gtk2::Object PREFIX = gtk_
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]