perl-Gtk2 r2119 - in trunk: . t xs
- From: tsch svn gnome org
- To: svn-commits-list gnome org
- Subject: perl-Gtk2 r2119 - in trunk: . t xs
- Date: Tue, 20 Jan 2009 20:22:51 +0000 (UTC)
Author: tsch
Date: Tue Jan 20 20:22:50 2009
New Revision: 2119
URL: http://svn.gnome.org/viewvc/perl-Gtk2?rev=2119&view=rev
Log:
Wrap gdk_x11_atom_to_xatom and gdk_x11_atom_to_xatom_for_display. Patch by
chris. (GNOME #566884)
Modified:
trunk/ChangeLog
trunk/t/GdkX11.t
trunk/xs/GdkX11.xs
Modified: trunk/t/GdkX11.t
==============================================================================
--- trunk/t/GdkX11.t (original)
+++ trunk/t/GdkX11.t Tue Jan 20 20:22:50 2009
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
use strict;
-use Gtk2::TestHelper tests => 11;
+use Gtk2::TestHelper tests => 13;
# $Id$
@@ -8,7 +8,7 @@
$window -> realize();
SKIP: {
- skip("X11 stuff", 9)
+ skip("X11 stuff", 11)
unless $window -> window() -> can("get_xid");
like($window -> window() -> get_xid(), qr/^\d+$/);
@@ -17,7 +17,7 @@
like(Gtk2::Gdk::X11 -> get_server_time($window -> window()), qr/^\d+$/);
SKIP: {
- skip("2.2 stuff", 3)
+ skip("2.2 stuff", 5)
unless Gtk2->CHECK_VERSION(2, 2, 0);
my $display = Gtk2::Gdk::Display -> get_default();
@@ -31,6 +31,18 @@
like($screen -> get_screen_number(), qr/^\d+$/);
ok(defined $screen -> get_window_manager_name());
ok(not $screen -> supports_net_wm_hint(Gtk2::Gdk::Atom -> new("just-testing")));
+
+ # The values for the STRING atom (and others) are defined as part of the
+ # the X11 protocol
+ ok(Gtk2::Gdk::Atom->intern("STRING")->to_xatom_for_display($display) == 31,
+ "to_xatom_for_display");
+
+ SKIP: {
+ skip("not-multihead-safe stuff", 1)
+ unless UNIVERSAL::can("Gtk2::Gdk::X11", "net_wm_supports");
+
+ ok(Gtk2::Gdk::Atom->intern("STRING")->to_xatom() == 31,"to_xatom");
+ }
}
SKIP: {
Modified: trunk/xs/GdkX11.xs
==============================================================================
--- trunk/xs/GdkX11.xs (original)
+++ trunk/xs/GdkX11.xs Tue Jan 20 20:22:50 2009
@@ -27,7 +27,7 @@
* there is no typemap for Display*, Screen*, etc, and indeed no perl-side
* functions to manipulate them, so they are out for the time being.
*
- * XID/XWINDOW is treated as UV.
+ * XID/XWINDOW/XATOM is treated as UV.
*
* all XS blocks are wrapped in #ifdef GDK_WINDOWING_X11 to make sure this
* stuff doesn't exist when wrapping gdk compiled for other backends.
@@ -176,3 +176,28 @@
#endif /* 2.2.0 */
#endif /* GDK_WINDOWING_X11 */
+
+# --------------------------------------------------------------------------- #
+
+MODULE = Gtk2::Gdk::X11 PACKAGE = Gtk2::Gdk::Atom PREFIX = gdk_x11_atom_
+
+#ifdef GDK_WINDOWING_X11
+
+#if GTK_CHECK_VERSION (2, 2, 0)
+
+UV
+to_xatom_for_display (GdkAtom class, GdkDisplay *display)
+ CODE:
+ RETVAL = gdk_x11_atom_to_xatom_for_display(display,class);
+ OUTPUT:
+ RETVAL
+
+#endif /* 2.2.0 */
+
+#ifndef GDK_MULTIHEAD_SAFE
+
+UV gdk_x11_atom_to_xatom (GdkAtom atom);
+
+#endif /* GDK_MULTIHEAD_SAFE */
+
+#endif /* GDK_WINDOWING_X11 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]