2010-08-30 Alejandro G. Castro <alex@igalia.com>
authoralex@webkit.org <alex@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Aug 2010 19:06:06 +0000 (19:06 +0000)
committeralex@webkit.org <alex@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Aug 2010 19:06:06 +0000 (19:06 +0000)
        Reviewed by Martin Robinson.

        [Gtk] gdk_display_get_core_pointer and gdk_device_get_core_pointer
        are deprecated
        https://bugs.webkit.org/show_bug.cgi?id=44787

        We have replaced GtkVersioning.cpp with GtkVersioning.c and
        created a function (getDefaultGDKPointerDevice) to get the pointer
        of the window with the new APIs. We added that function to DRT and
        copyandpaste unit test.

        * GNUmakefile.am:
        * platform/gtk/GtkVersioning.c: Added.
        (gtk_adjustment_set_value):
        (gtk_adjustment_configure):
        (getDefaultGDKPointerDevice):
        * platform/gtk/GtkVersioning.cpp: Removed.
        * platform/gtk/GtkVersioning.h:

2010-08-30  Alejandro G. Castro  <alex@igalia.com>

        Reviewed by Martin Robinson.

        [Gtk] gdk_display_get_core_pointer and gdk_device_get_core_pointer
        are deprecated
        https://bugs.webkit.org/show_bug.cgi?id=44787

        We have replaced GtkVersioning.cpp with GtkVersioning.c and
        created a function (getDefaultGDKPointerDevice) to get the pointer
        of the window with the new APIs. We added that function to DRT and
        copyandpaste unit test.

        * GNUmakefile.am:

2010-08-30  Alejandro G. Castro  <alex@igalia.com>

        Reviewed by Martin Robinson.

        [Gtk] gdk_display_get_core_pointer and gdk_device_get_core_pointer
        are deprecated
        https://bugs.webkit.org/show_bug.cgi?id=44787

        We have replaced GtkVersioning.cpp with GtkVersioning.c and
        created a function (getDefaultGDKPointerDevice) to get the pointer
        of the window with the new APIs. We added that function to DRT and
        copyandpaste unit test.

        * DumpRenderTree/gtk/EventSender.cpp:
        (prepareMouseButtonEvent):
        (mouseMoveToCallback):
        (keyDownCallback):
        * GNUmakefile.am:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@66398 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
GNUmakefile.am
WebCore/ChangeLog
WebCore/GNUmakefile.am
WebCore/platform/gtk/GtkVersioning.c [moved from WebCore/platform/gtk/GtkVersioning.cpp with 82% similarity]
WebCore/platform/gtk/GtkVersioning.h
WebKit/gtk/ChangeLog
WebKit/gtk/tests/testcopyandpaste.c
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/gtk/EventSender.cpp
WebKitTools/GNUmakefile.am

index eaab040..7d9fb36 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2010-08-30  Alejandro G. Castro  <alex@igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [Gtk] gdk_display_get_core_pointer and gdk_device_get_core_pointer
+        are deprecated
+        https://bugs.webkit.org/show_bug.cgi?id=44787
+
+        We have replaced GtkVersioning.cpp with GtkVersioning.c and
+        created a function (getDefaultGDKPointerDevice) to get the pointer
+        of the window with the new APIs. We added that function to DRT and
+        copyandpaste unit test.
+
+        * GNUmakefile.am:
+
 2010-08-30  Martin Robinson  <mrobinson@igalia.com>
 
         Reviewed by Xan Lopez.
index ddc5cc7..747125d 100644 (file)
@@ -695,8 +695,11 @@ Programs_unittests_testkeyevents_CFLAGS = $(webkit_tests_cflags)
 Programs_unittests_testkeyevents_LDADD = $(webkit_tests_ldadd)
 Programs_unittests_testkeyevents_LDFLAGS = $(webkit_tests_ldflags)
 
-Programs_unittests_testcopyandpaste_SOURCES = WebKit/gtk/tests/testcopyandpaste.c
-Programs_unittests_testcopyandpaste_CFLAGS = $(webkit_tests_cflags)
+Programs_unittests_testcopyandpaste_SOURCES = WebKit/gtk/tests/testcopyandpaste.c \
+       WebCore/platform/gtk/GtkVersioning.c
+Programs_unittests_testcopyandpaste_CFLAGS = $(webkit_tests_cflags) \
+       -I$(srcdir)/WebCore/platform/gtk \
+       -I$(srcdir)/WebCore
 Programs_unittests_testcopyandpaste_LDADD = $(webkit_tests_ldadd)
 Programs_unittests_testcopyandpaste_LDFLAGS = $(webkit_tests_ldflags)
 
index 3db3f0a..39d1e2a 100644 (file)
@@ -1,3 +1,24 @@
+2010-08-30  Alejandro G. Castro  <alex@igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [Gtk] gdk_display_get_core_pointer and gdk_device_get_core_pointer
+        are deprecated
+        https://bugs.webkit.org/show_bug.cgi?id=44787
+
+        We have replaced GtkVersioning.cpp with GtkVersioning.c and
+        created a function (getDefaultGDKPointerDevice) to get the pointer
+        of the window with the new APIs. We added that function to DRT and
+        copyandpaste unit test.
+
+        * GNUmakefile.am:
+        * platform/gtk/GtkVersioning.c: Added.
+        (gtk_adjustment_set_value):
+        (gtk_adjustment_configure):
+        (getDefaultGDKPointerDevice):
+        * platform/gtk/GtkVersioning.cpp: Removed.
+        * platform/gtk/GtkVersioning.h:
+
 2010-08-30  Darin Adler  <darin@apple.com>
 
         Reviewed by Sam Weinig.
index bc57c66..1e1de03 100644 (file)
@@ -2495,7 +2495,7 @@ webcoregtk_sources += \
        WebCore/platform/gtk/gtkdrawing.h \
        WebCore/platform/gtk/GtkPluginWidget.cpp \
        WebCore/platform/gtk/GtkPluginWidget.h \
-       WebCore/platform/gtk/GtkVersioning.cpp \
+       WebCore/platform/gtk/GtkVersioning.c \
        WebCore/platform/gtk/GtkVersioning.h \
        WebCore/platform/gtk/KeyEventGtk.cpp \
        WebCore/platform/gtk/KURLGtk.cpp \
similarity index 82%
rename from WebCore/platform/gtk/GtkVersioning.cpp
rename to WebCore/platform/gtk/GtkVersioning.c
index e7734a8..0871d81 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2010 Collabora Ltd.
+ * Copyright (C) 2010 Igalia, S.L.
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Library General Public
@@ -17,7 +18,6 @@
  *  Boston, MA 02110-1301, USA.
  */
 
-#include "config.h"
 #include "GtkVersioning.h"
 
 #include <gtk/gtk.h>
@@ -48,3 +48,14 @@ void gtk_adjustment_configure(GtkAdjustment* adjustment, gdouble value, gdouble
     gtk_adjustment_value_changed(adjustment);
 }
 #endif
+
+GdkDevice *getDefaultGDKPointerDevice(GdkWindow* window)
+{
+#ifndef GTK_API_VERSION_2
+    GdkDeviceManager *manager =  gdk_display_get_device_manager(gdk_drawable_get_display(window));
+    return gdk_device_manager_get_client_pointer(manager);
+#else
+    return gdk_device_get_core_pointer();
+#endif // GTK_API_VERSION_2
+}
+
index 34e6081..6ef8a0f 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2010 Collabora Ltd.
+ * Copyright (C) 2010 Igalia, S.L.
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Library General Public
@@ -22,6 +23,8 @@
 
 #include <gtk/gtk.h>
 
+G_BEGIN_DECLS
+
 // Macros to avoid deprecation checking churn
 #if !GTK_CHECK_VERSION(2, 21, 2)
 #define gdk_visual_get_depth(visual) (visual)->depth
@@ -67,4 +70,8 @@ void gtk_adjustment_configure(GtkAdjustment* adjustment, gdouble value, gdouble
 void gtk_adjustment_set_value(GtkAdjustment* adjusment, gdouble value);
 #endif // GTK_CHECK_VERSION(2, 14, 0)
 
+GdkDevice* getDefaultGDKPointerDevice(GdkWindow* window);
+
+G_END_DECLS
+
 #endif // GtkVersioning_h
index 9f8a1b3..e58e693 100644 (file)
@@ -1,3 +1,19 @@
+2010-08-30  Alejandro G. Castro  <alex@igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [Gtk] gdk_display_get_core_pointer and gdk_device_get_core_pointer
+        are deprecated
+        https://bugs.webkit.org/show_bug.cgi?id=44787
+
+        We have replaced GtkVersioning.cpp with GtkVersioning.c and
+        created a function (getDefaultGDKPointerDevice) to get the pointer
+        of the window with the new APIs. We added that function to DRT and
+        copyandpaste unit test.
+
+        * tests/testcopyandpaste.c:
+        (runPasteTestCallback):
+
 2010-08-30  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r66198.
index 58fb764..5e3f5e7 100644 (file)
@@ -25,7 +25,6 @@
 #include <JavaScriptCore/JSStringRef.h>
 #include <JavaScriptCore/JSContextRef.h>
 
-
 #if GTK_CHECK_VERSION(2, 14, 0)
 
 typedef struct {
@@ -134,8 +133,10 @@ static JSValueRef runPasteTestCallback(JSContextRef context, JSObjectRef functio
     event->key.window = gtk_widget_get_window(GTK_WIDGET(currentFixture->webView));
     g_object_ref(event->key.window);
 #ifndef GTK_API_VERSION_2
-    gdk_event_set_device(event, gdk_device_get_associated_device(gdk_display_get_core_pointer(gdk_drawable_get_display(event->key.window))));
+    GdkDeviceManager* manager =  gdk_display_get_device_manager(gdk_drawable_get_display(event->key.window));
+    gdk_event_set_device(event, gdk_device_manager_get_client_pointer(manager));
 #endif
+
     GdkKeymapKey* keys;
     gint n_keys;
     if (gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(), event->key.keyval, &keys, &n_keys)) {
index 97cdb9f..7d5bfda 100644 (file)
@@ -1,3 +1,22 @@
+2010-08-30  Alejandro G. Castro  <alex@igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [Gtk] gdk_display_get_core_pointer and gdk_device_get_core_pointer
+        are deprecated
+        https://bugs.webkit.org/show_bug.cgi?id=44787
+
+        We have replaced GtkVersioning.cpp with GtkVersioning.c and
+        created a function (getDefaultGDKPointerDevice) to get the pointer
+        of the window with the new APIs. We added that function to DRT and
+        copyandpaste unit test.
+
+        * DumpRenderTree/gtk/EventSender.cpp:
+        (prepareMouseButtonEvent):
+        (mouseMoveToCallback):
+        (keyDownCallback):
+        * GNUmakefile.am:
+
 2010-08-30  Zoltan Horvath  <zoltan@webkit.org>
 
         Reviewed by Kenneth Rohde Christiansen.
index fa3af64..49cd745 100644 (file)
@@ -2,6 +2,7 @@
  * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
  * Copyright (C) 2009 Zan Dobersek <zandobersek@gmail.com>
  * Copyright (C) 2009 Holger Hans Peter Freyther
+ * Copyright (C) 2010 Igalia S.L.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -33,6 +34,7 @@
 
 #include "DumpRenderTree.h"
 
+#include <GtkVersioning.h>
 #include <JavaScriptCore/JSObjectRef.h>
 #include <JavaScriptCore/JSRetainPtr.h>
 #include <JavaScriptCore/JSStringRef.h>
@@ -161,7 +163,7 @@ bool prepareMouseButtonEvent(GdkEvent* event, int eventSenderButtonNumber)
     event->button.y = lastMousePositionY;
     event->button.window = gtk_widget_get_window(GTK_WIDGET(view));
     g_object_ref(event->button.window);
-    event->button.device = gdk_device_get_core_pointer();
+    event->button.device = getDefaultGDKPointerDevice(event->button.window);
     event->button.state = getStateFlags();
     event->button.time = GDK_CURRENT_TIME;
     event->button.axes = 0;
@@ -285,7 +287,7 @@ static JSValueRef mouseMoveToCallback(JSContextRef context, JSObjectRef function
     event->motion.time = GDK_CURRENT_TIME;
     event->motion.window = gtk_widget_get_window(GTK_WIDGET(view));
     g_object_ref(event->motion.window);
-    event->motion.device = gdk_device_get_core_pointer();
+    event->button.device = getDefaultGDKPointerDevice(event->motion.window);
     event->motion.state = getStateFlags();
     event->motion.axes = 0;
 
@@ -558,8 +560,9 @@ static JSValueRef keyDownCallback(JSContextRef context, JSObjectRef function, JS
     pressEvent->key.window = gtk_widget_get_window(GTK_WIDGET(view));
     g_object_ref(pressEvent->key.window);
 #ifndef GTK_API_VERSION_2
-    gdk_event_set_device(pressEvent, gdk_device_get_associated_device(gdk_display_get_core_pointer(gdk_drawable_get_display(pressEvent->key.window))));
+    gdk_event_set_device(pressEvent, getDefaultGDKPointerDevice(pressEvent->key.window));
 #endif
+
     // When synthesizing an event, an invalid hardware_keycode value
     // can cause it to be badly processed by Gtk+.
     GdkKeymapKey* keys;
index 33d4614..39df421 100644 (file)
@@ -36,6 +36,7 @@ dumprendertree_cppflags := \
        -I$(srcdir)/WebKitTools/DumpRenderTree/cairo \
        -I$(srcdir)/WebKitTools/DumpRenderTree/gtk \
        -I$(srcdir)/WebKit/gtk \
+       -I$(srcdir)/WebCore/platform/gtk \
        -I$(top_builddir)/WebKit/gtk \
        -I$(top_builddir)/DerivedSources \
        $(global_cppflags) \
@@ -72,7 +73,8 @@ Programs_DumpRenderTree_SOURCES = \
        WebKitTools/DumpRenderTree/gtk/GCControllerGtk.cpp \
        WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp \
        WebKitTools/DumpRenderTree/gtk/PixelDumpSupportGtk.cpp \
-       WebKitTools/DumpRenderTree/gtk/WorkQueueItemGtk.cpp
+       WebKitTools/DumpRenderTree/gtk/WorkQueueItemGtk.cpp \
+       WebCore/platform/gtk/GtkVersioning.c
 
 Programs_DumpRenderTree_CXXFLAGS = \
        $(global_cxxflags) \