Changeset 45414 in webkit
- Timestamp:
- Jun 30, 2009 7:16:13 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r45413 r45414 1 2009-06-30 Zan Dobersek <zandobersek@gmail.com> 2 3 Reviewed by Gustavo Noronha. 4 5 [GTK] Drag and drop support 6 https://bugs.webkit.org/show_bug.cgi?id=23642 7 8 Define DragImageRef as GdkPixbuf and implement essential 9 functions which manipulate drag images. 10 11 * platform/DragImage.h: 12 * platform/gtk/DragImageGtk.cpp: 13 (WebCore::dragImageSize): 14 (WebCore::deleteDragImage): 15 (WebCore::scaleDragImage): 16 (WebCore::createDragImageFromImage): 17 1 18 2009-06-30 Maxime Simon <simon.maxime@gmail.com> 2 19 -
trunk/WebCore/platform/DragImage.h
r37599 r45414 47 47 #elif PLATFORM(CHROMIUM) 48 48 #include "DragImageRef.h" 49 #elif PLATFORM(GTK) 50 typedef struct _GdkPixbuf GdkPixbuf; 49 51 #endif 50 52 … … 70 72 typedef wxDragImage* DragImageRef; 71 73 #elif PLATFORM(GTK) 72 typedef void* DragImageRef;74 typedef GdkPixbuf* DragImageRef; 73 75 #endif 74 76 -
trunk/WebCore/platform/gtk/DragImageGtk.cpp
r29961 r45414 21 21 #include "Image.h" 22 22 23 #include <gtk/gtk.h> 24 23 25 namespace WebCore { 24 26 25 IntSize dragImageSize(DragImageRef )27 IntSize dragImageSize(DragImageRef image) 26 28 { 29 if (image) 30 return IntSize(gdk_pixbuf_get_width(image), gdk_pixbuf_get_height(image)); 31 27 32 return IntSize(0, 0); 28 33 } 29 34 30 void deleteDragImage(DragImageRef )35 void deleteDragImage(DragImageRef image) 31 36 { 37 if (image) 38 g_object_unref(image); 32 39 } 33 40 34 DragImageRef scaleDragImage(DragImageRef image, FloatSize )41 DragImageRef scaleDragImage(DragImageRef image, FloatSize scale) 35 42 { 36 return image; 43 if (image) { 44 IntSize imageSize = dragImageSize(image); 45 GdkPixbuf* scaledImage = gdk_pixbuf_scale_simple(image, 46 imageSize.width() * scale.width(), 47 imageSize.height() * scale.height(), 48 GDK_INTERP_BILINEAR); 49 deleteDragImage(image); 50 return scaledImage; 51 } 52 53 return 0; 37 54 } 38 55 … … 42 59 } 43 60 44 DragImageRef createDragImageFromImage(Image* )61 DragImageRef createDragImageFromImage(Image* image) 45 62 { 46 return 0;63 return image->getGdkPixbuf(); 47 64 } 48 65
Note: See TracChangeset
for help on using the changeset viewer.