[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

mrobinson at webkit.org mrobinson at webkit.org
Wed Dec 22 14:26:13 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 5e7c10ede03fec2795ddc556958e19f9ceb1c461
Author: mrobinson at webkit.org <mrobinson at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 8 16:02:17 2010 +0000

    2010-10-08  Martin Robinson  <mrobinson at igalia.com>
    
            Reviewed by Xan Lopez.
    
            [GTK] Remove duplicate code in WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
            https://bugs.webkit.org/show_bug.cgi?id=47367
    
            Remove as much duplicate code as possible from DragClientGtk. Most of this code
            is GTK2/GTK3 independent, so only the bits that aren't should be protected by
            #ifdefs.
    
            * WebCoreSupport/DragClientGtk.cpp:
            (WebKit::dragIconWindowDrawEventCallback): Modified the name of this callback
            so that it is shared between build types.
            (WebKit::DragClient::DragClient): Updated the signal connectors to reflect the change above.
            (WebKit::DragClient::~DragClient): The build types share the callback name, so remove
            the #ifdef here.
            (WebKit::DragClient::drawDragIconWindow): Changed the name of this method and make it
            independent of the build type.
            * WebCoreSupport/DragClientGtk.h: Update method declaration and remove #ifdefs.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69403 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index 620dd45..69f5009 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,24 @@
+2010-10-08  Martin Robinson  <mrobinson at igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [GTK] Remove duplicate code in WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=47367
+
+        Remove as much duplicate code as possible from DragClientGtk. Most of this code
+        is GTK2/GTK3 independent, so only the bits that aren't should be protected by
+        #ifdefs.
+
+        * WebCoreSupport/DragClientGtk.cpp:
+        (WebKit::dragIconWindowDrawEventCallback): Modified the name of this callback
+        so that it is shared between build types.
+        (WebKit::DragClient::DragClient): Updated the signal connectors to reflect the change above.
+        (WebKit::DragClient::~DragClient): The build types share the callback name, so remove
+        the #ifdef here.
+        (WebKit::DragClient::drawDragIconWindow): Changed the name of this method and make it
+        independent of the build type.
+        * WebCoreSupport/DragClientGtk.h: Update method declaration and remove #ifdefs.
+
 2010-10-07  Carlos Garcia Campos  <cgarcia at igalia.com>
 
         Reviewed by Xan Lopez.
diff --git a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
index c0550a2..b850cec 100644
--- a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) Igalia S.L.
+ * Copyright (C) 2009, 2010 Igalia S.L.
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Lesser General Public
@@ -42,19 +42,18 @@ using namespace WebCore;
 namespace WebKit {
 
 #ifdef GTK_API_VERSION_2
-static gboolean dragIconWindowExposeEventCallback(GtkWidget* widget, GdkEventExpose* event, DragClient* client)
+static gboolean dragIconWindowDrawEventCallback(GtkWidget* widget, GdkEventExpose* event, DragClient* client)
 {
-    client->dragIconWindowExposeEvent(widget, event);
+    PlatformRefPtr<cairo_t> context = adoptPlatformRef(gdk_cairo_create(event->window));
+    client->drawDragIconWindow(widget, context.get());
     return TRUE;
 }
 #else
-static gboolean dragIconWindowDrawCallback(GtkWidget* widget, cairo_t* cr, DragClient* client)
+static gboolean dragIconWindowDrawEventCallback(GtkWidget* widget, cairo_t* context, DragClient* client)
 {
-    GdkRectangle clipRect;
-
-    if (!gdk_cairo_get_clip_rectangle(cr, &clipRect))
+    if (!gdk_cairo_get_clip_rectangle(context, 0))
         return FALSE;
-    client->dragIconWindowDraw(widget, cr);
+    client->drawDragIconWindow(widget, context);
     return TRUE;
 }
 #endif // GTK_API_VERSION_2
@@ -65,19 +64,15 @@ DragClient::DragClient(WebKitWebView* webView)
     , m_dragIconWindow(gtk_window_new(GTK_WINDOW_POPUP))
 {
 #ifdef GTK_API_VERSION_2
-    g_signal_connect(m_dragIconWindow.get(), "expose-event", G_CALLBACK(dragIconWindowExposeEventCallback), this);
+    g_signal_connect(m_dragIconWindow.get(), "expose-event", G_CALLBACK(dragIconWindowDrawEventCallback), this);
 #else
-    g_signal_connect(m_dragIconWindow.get(), "draw", G_CALLBACK(dragIconWindowDrawCallback), this);
+    g_signal_connect(m_dragIconWindow.get(), "draw", G_CALLBACK(dragIconWindowDrawEventCallback), this);
 #endif
 }
 
 DragClient::~DragClient()
 {
-#ifdef GTK_API_VERSION_2
-    g_signal_handlers_disconnect_by_func(m_dragIconWindow.get(), (gpointer) dragIconWindowExposeEventCallback, this);
-#else
-    g_signal_handlers_disconnect_by_func(m_dragIconWindow.get(), (gpointer) dragIconWindowDrawCallback, this);
-#endif
+    g_signal_handlers_disconnect_by_func(m_dragIconWindow.get(), (gpointer) dragIconWindowDrawEventCallback, this);
 }
 
 void DragClient::willPerformDragDestinationAction(DragDestinationAction, DragData*)
@@ -144,28 +139,16 @@ void DragClient::startDrag(DragImageRef image, const IntPoint& dragImageOrigin,
     } else
         gtk_drag_set_icon_default(context);
 }
-#ifdef GTK_API_VERSION_2
-void DragClient::dragIconWindowExposeEvent(GtkWidget* widget, GdkEventExpose* event)
-{
-    PlatformRefPtr<cairo_t> context = adoptPlatformRef(gdk_cairo_create(event->window));
-    cairo_rectangle(context.get(), 0, 0,
-                    cairo_image_surface_get_width(m_dragImage.get()),
-                    cairo_image_surface_get_height(m_dragImage.get()));
-    cairo_set_operator(context.get(), CAIRO_OPERATOR_SOURCE);
-    cairo_set_source_surface(context.get(), m_dragImage.get(), 0, 0);
-    cairo_fill(context.get());
-}
-#else
-void DragClient::dragIconWindowDraw(GtkWidget* widget, cairo_t* cr)
+
+void DragClient::drawDragIconWindow(GtkWidget* widget, cairo_t* context)
 {
-    cairo_rectangle(cr, 0, 0,
+    cairo_rectangle(context, 0, 0,
                     cairo_image_surface_get_width(m_dragImage.get()),
                     cairo_image_surface_get_height(m_dragImage.get()));
-    cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
-    cairo_set_source_surface(cr, m_dragImage.get(), 0, 0);
-    cairo_fill(cr);
+    cairo_set_operator(context, CAIRO_OPERATOR_SOURCE);
+    cairo_set_source_surface(context, m_dragImage.get(), 0, 0);
+    cairo_fill(context);
 }
-#endif // GTK_API_VERSION_2
 
 DragImageRef DragClient::createDragImageForLink(KURL&, const String&, Frame*)
 {
diff --git a/WebKit/gtk/WebCoreSupport/DragClientGtk.h b/WebKit/gtk/WebCoreSupport/DragClientGtk.h
index 30acbc4..0d07c88 100644
--- a/WebKit/gtk/WebCoreSupport/DragClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/DragClientGtk.h
@@ -54,11 +54,7 @@ namespace WebKit {
 
         virtual void dragControllerDestroyed();
 
-#ifdef GTK_API_VERSION_2
-        void dragIconWindowExposeEvent(GtkWidget*, GdkEventExpose*);
-#else
-        void dragIconWindowDraw(GtkWidget*, cairo_t*);
-#endif
+        void drawDragIconWindow(GtkWidget*, cairo_t*);
 
     private:
         WebKitWebView* m_webView;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list