[perl-Gtk2] Make damage events Gtk2::Gdk::Event::Expose objects



commit 45ae6d88bc0c62cdb5f198d44004e58ecfbeb7f7
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Wed May 12 00:34:48 2010 +0200

    Make damage events Gtk2::Gdk::Event::Expose objects
    
    This makes damage events actually usable, and mimics the relationship of the C
    structs.
    
    Original patch by Quentin Sculo.

 t/GdkEvent.t   |    9 +++++----
 xs/GdkEvent.xs |    7 +++----
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/t/GdkEvent.t b/t/GdkEvent.t
index f2e8112..4e49108 100644
--- a/t/GdkEvent.t
+++ b/t/GdkEvent.t
@@ -8,7 +8,7 @@
 # 	- rm
 #########################
 
-use Gtk2::TestHelper tests => 122;
+use Gtk2::TestHelper tests => 123;
 use Data::Dumper;
 
 # Expose #######################################################################
@@ -455,11 +455,12 @@ SKIP: {
 # Damage ######################################################################
 
 SKIP: {
-	skip ("the damage event is new in 2.14", 1)
+	skip ("the damage event is new in 2.14", 2)
 		unless (Gtk2->CHECK_VERSION (2, 14, 0));
 
-	isa_ok (my $event = Gtk2::Gdk::Event->new ("damage"),
-		"Gtk2::Gdk::Event::Damage");
+	isa_ok (my $event = Gtk2::Gdk::Event->new ('damage'),
+		'Gtk2::Gdk::Event::Expose');
+	is ($event->type, 'damage');
 }
 
 __END__
diff --git a/xs/GdkEvent.xs b/xs/GdkEvent.xs
index 317868b..70fa74a 100644
--- a/xs/GdkEvent.xs
+++ b/xs/GdkEvent.xs
@@ -54,6 +54,9 @@ gdk_event_get_package (GType gtype,
 	    case GDK_UNMAP:
 		return "Gtk2::Gdk::Event";
 	    case GDK_EXPOSE:
+#if GTK_CHECK_VERSION (2, 14, 0)
+	    case GDK_DAMAGE:
+#endif
 		return "Gtk2::Gdk::Event::Expose";
 	    case GDK_MOTION_NOTIFY:
 		return "Gtk2::Gdk::Event::Motion";
@@ -108,10 +111,6 @@ gdk_event_get_package (GType gtype,
 	    case GDK_GRAB_BROKEN:
 		return "Gtk2::Gdk::Event::GrabBroken";
 #endif
-#if GTK_CHECK_VERSION (2, 14, 0)
-	    case GDK_DAMAGE:
-		return "Gtk2::Gdk::Event::Damage";
-#endif
 	    default:
 		{
 		GEnumClass * class = g_type_class_ref (GDK_TYPE_EVENT_TYPE);



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