[perl-Gtk2] Wrap gdk 2.20 API
- From: Torsten Schönfeld <tsch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-Gtk2] Wrap gdk 2.20 API
- Date: Fri, 31 Dec 2010 01:38:00 +0000 (UTC)
commit e714254711172e1bdf44f5ab69bc3fe3629269c3
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date: Fri Dec 31 02:07:14 2010 +0100
Wrap gdk 2.20 API
NEWS | 3 ++-
t/GdkKeys.t | 12 +++++++++++-
t/GdkScreen.t | 10 +++++++++-
xs/GdkKeys.xs | 25 +++++++++++++++++++++++++
xs/GdkScreen.xs | 6 ++++++
5 files changed, 53 insertions(+), 3 deletions(-)
---
diff --git a/NEWS b/NEWS
index ab8c263..1e4c6da 100644
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,8 @@ Overview of changes in the next unstable release
================================================
* Wrap missing gtk+ 2.8, 2.10, 2.12, 2.14, 2.16, 2.18 and 2.20 API.
-* Wrap gtk+ and gdk 2.22 API.
+* Wrap gtk+ 2.22 API.
+* Wrap gdk 2.20 and 2.22 API.
* Gtk2::Notebook: fix invocation of window creation hooks.
* Fix length of Gtk2::Gdk::Pixbuf->get_pixels() return.
* Allow Gtk2::Buildable implementations to return undef from
diff --git a/t/GdkKeys.t b/t/GdkKeys.t
index d41bcc6..4477205 100644
--- a/t/GdkKeys.t
+++ b/t/GdkKeys.t
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
use strict;
-use Gtk2::TestHelper tests => 44;
+use Gtk2::TestHelper tests => 46;
# $Id$
@@ -112,6 +112,16 @@ is(Gtk2::Gdk -> unicode_to_keyval($unicode), $a);
}
+SKIP: {
+ skip 'new 2.20 stuff', 2
+ unless Gtk2->CHECK_VERSION(2, 20, 0);
+
+ my $map = Gtk2::Gdk::Keymap -> get_default();
+ ok(defined $map -> add_virtual_modifiers([qw/mod1-mask super-mask/]));
+ my ($result, $new_state) = $map -> map_virtual_modifiers([qw/mod1-mask super-mask/]);
+ ok(defined $result && defined $new_state);
+}
+
__END__
Copyright (C) 2003 by the gtk2-perl team (see the file AUTHORS for the
diff --git a/t/GdkScreen.t b/t/GdkScreen.t
index 2f26fed..3011d1b 100644
--- a/t/GdkScreen.t
+++ b/t/GdkScreen.t
@@ -2,7 +2,7 @@
# vim: set ft=perl :
use strict;
use Gtk2::TestHelper
- tests => 26,
+ tests => 27,
at_least_version => [2, 2, 0, "GdkScreen is new in 2.2"];
# $Id$
@@ -88,6 +88,14 @@ SKIP: {
ok (TRUE);
}
+SKIP: {
+ skip 'new 2.20 stuff', 1
+ unless Gtk2->CHECK_VERSION(2, 20, 0);
+
+ my $screen = Gtk2::Gdk::Screen->get_default ();
+ ok (defined $screen->get_primary_monitor ());
+}
+
__END__
Copyright (C) 2003-2005 by the gtk2-perl team (see the file AUTHORS for the
diff --git a/xs/GdkKeys.xs b/xs/GdkKeys.xs
index 7312ae2..9cbde70 100644
--- a/xs/GdkKeys.xs
+++ b/xs/GdkKeys.xs
@@ -201,6 +201,31 @@ gboolean gdk_keymap_get_caps_lock_state (GdkKeymap *keymap);
#endif
+#if GTK_CHECK_VERSION (2, 20, 0)
+
+GdkModifierType
+gdk_keymap_add_virtual_modifiers (GdkKeymap *keymap, GdkModifierType state)
+ CODE:
+ gdk_keymap_add_virtual_modifiers (keymap, &state);
+ RETVAL = state;
+ OUTPUT:
+ RETVAL
+
+=for apidoc
+=for signature (bool, new_state) = $keymap->map_virtual_modifiers (keymap, state)
+=cut
+void
+gdk_keymap_map_virtual_modifiers (GdkKeymap *keymap, GdkModifierType state)
+ PREINIT:
+ gboolean result;
+ PPCODE:
+ result = gdk_keymap_map_virtual_modifiers (keymap, &state);
+ EXTEND (SP, 2);
+ PUSHs (sv_2mortal (boolSV (result)));
+ PUSHs (sv_2mortal (newSVGdkModifierType (state)));
+
+#endif /* 2.20 */
+
MODULE = Gtk2::Gdk::Keys PACKAGE = Gtk2::Gdk PREFIX = gdk_
gchar *
diff --git a/xs/GdkScreen.xs b/xs/GdkScreen.xs
index cc89192..5c406fb 100644
--- a/xs/GdkScreen.xs
+++ b/xs/GdkScreen.xs
@@ -233,3 +233,9 @@ gint gdk_screen_get_monitor_width_mm (GdkScreen *screen, gint monitor_num);
gchar_own_ornull * gdk_screen_get_monitor_plug_name (GdkScreen *screen, gint monitor_num);
#endif /* 2.14 */
+
+#if GTK_CHECK_VERSION (2, 20, 0)
+
+gint gdk_screen_get_primary_monitor (GdkScreen *screen);
+
+#endif /* 2.20 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]