2009-05-20 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
authorkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 May 2009 14:51:34 +0000 (14:51 +0000)
committerkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 May 2009 14:51:34 +0000 (14:51 +0000)
        Rubber-stamped by Eric Seidel.

        Enable code that was commented out waiting for a way to get a
        GdkPixbuf from an image, effectively enabling copying images to
        the clipboard.

        * platform/gtk/PasteboardGtk.cpp:
        (WebCore::Pasteboard::writeImage):

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

WebCore/ChangeLog
WebCore/platform/gtk/PasteboardGtk.cpp

index 750ad8b..d3d6691 100644 (file)
@@ -1,3 +1,14 @@
+2009-05-20  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Rubber-stamped by Eric Seidel.
+
+        Enable code that was commented out waiting for a way to get a
+        GdkPixbuf from an image, effectively enabling copying images to
+        the clipboard.
+
+        * platform/gtk/PasteboardGtk.cpp:
+        (WebCore::Pasteboard::writeImage):
+
 2009-05-20  Xan Lopez  <xlopez@igalia.com>
 
         Reviewed by Jan Alonzo.
index 143ae46..062ecb8 100644 (file)
@@ -127,9 +127,6 @@ void Pasteboard::writeURL(const KURL& url, const String&, Frame* frame)
 
 void Pasteboard::writeImage(Node* node, const KURL&, const String&)
 {
-    // TODO: Enable this when Image gets GdkPixbuf support
-
-    /*
     GtkClipboard* clipboard = gtk_clipboard_get_for_display(gdk_display_get_default(), GDK_SELECTION_CLIPBOARD);
 
     ASSERT(node && node->renderer() && node->renderer()->isImage());
@@ -139,10 +136,9 @@ void Pasteboard::writeImage(Node* node, const KURL&, const String&)
     Image* image = cachedImage->image();
     ASSERT(image);
 
-    gtk_clipboard_set_image(clipboard, image->pixbuf());
-    */
-
-    notImplemented();
+    GdkPixbuf* pixbuf = image->getGdkPixbuf();
+    gtk_clipboard_set_image(clipboard, pixbuf);
+    g_object_unref(pixbuf);
 }
 
 void Pasteboard::clear()