Changeset 57028 in webkit


Ignore:
Timestamp:
Apr 2, 2010 3:48:06 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-04-02 Evan Stade <estade@chromium.org>

Reviewed by Eric Seidel.

[chromium] need DragImage implementation
https://bugs.webkit.org/show_bug.cgi?id=35811

Basic implementation using SkBitmap. Transformations are not supported
yet. No implementation for mac.

  • WebCore.gyp/WebCore.gyp:
  • WebCore.gypi:
  • platform/chromium/DragImageChromium.cpp:
  • platform/chromium/DragImageRef.h:

2010-04-02 Evan Stade <estade@chromium.org>

Reviewed by Eric Seidel.

[chromium] need DragImage implementation
https://bugs.webkit.org/show_bug.cgi?id=35811

Use the DragImageRef that the DragController passes to us.

  • public/WebViewClient.h: (WebKit::WebViewClient::startDragging):
  • src/DragClientImpl.cpp: (WebKit::DragClientImpl::startDrag):
  • src/WebViewImpl.cpp: (WebKit::WebViewImpl::startDragging):
  • src/WebViewImpl.h:
Location:
trunk
Files:
1 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r57027 r57028  
     12010-04-02  Evan Stade  <estade@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [chromium] need DragImage implementation
     6        https://bugs.webkit.org/show_bug.cgi?id=35811
     7
     8        Basic implementation using SkBitmap. Transformations are not supported
     9        yet. No implementation for mac.
     10
     11        * WebCore.gyp/WebCore.gyp:
     12        * WebCore.gypi:
     13        * platform/chromium/DragImageChromium.cpp:
     14        * platform/chromium/DragImageRef.h:
     15
    1162010-04-02  Evan Martin  <evan@chromium.org>
    217
  • trunk/WebCore/WebCore.gyp/WebCore.gyp

    r56197 r57028  
    10651065            '../platform/image-decoders/xbm/XBMImageDecoder.cpp',
    10661066            '../platform/image-decoders/xbm/XBMImageDecoder.h',
     1067
     1068            # Again, Skia is not used on Mac.
     1069            '../platform/chromium/DragImageChromiumSkia.cpp',
    10671070          ],
    10681071          'direct_dependent_settings': {
  • trunk/WebCore/WebCore.gypi

    r57004 r57028  
    19501950            'platform/chromium/DragDataChromium.cpp',
    19511951            'platform/chromium/DragDataRef.h',
    1952             'platform/chromium/DragImageChromium.cpp',
     1952            'platform/chromium/DragImageChromiumMac.cpp',
     1953            'platform/chromium/DragImageChromiumSkia.cpp',
    19531954            'platform/chromium/DragImageRef.h',
    19541955            'platform/chromium/FileChooserChromium.cpp',
  • trunk/WebCore/platform/chromium/DragImageRef.h

    r39903 r57028  
    3030#define DragImageRef_h
    3131
     32class SkBitmap;
     33
    3234namespace WebCore {
    3335
    34     // FIXME: Need to support image drag-n-drop.  For now, we just allow things
    35     // to compile by defining this dummy type.
    36     typedef void* DragImageRef;
     36#if OS(DARWIN)
     37// FIXME: not implemented.
     38typedef void* DragImageRef;
     39#else
     40typedef SkBitmap* DragImageRef;
     41#endif
    3742
    3843} // namespace WebCore
  • trunk/WebKit/chromium/ChangeLog

    r57026 r57028  
     12010-04-02  Evan Stade  <estade@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [chromium] need DragImage implementation
     6        https://bugs.webkit.org/show_bug.cgi?id=35811
     7
     8        Use the DragImageRef that the DragController passes to us.
     9
     10        * public/WebViewClient.h:
     11        (WebKit::WebViewClient::startDragging):
     12        * src/DragClientImpl.cpp:
     13        (WebKit::DragClientImpl::startDrag):
     14        * src/WebViewImpl.cpp:
     15        (WebKit::WebViewImpl::startDragging):
     16        * src/WebViewImpl.h:
     17
    1182010-04-02  Rafael Weinstein  <rafaelw@chromium.org>
    219
  • trunk/WebKit/chromium/public/WebViewClient.h

    r57014 r57028  
    4949class WebFrame;
    5050class WebGeolocationService;
     51class WebImage;
    5152class WebNode;
    5253class WebNotificationPresenter;
     
    225226    // Called when a drag-n-drop operation should begin.
    226227    virtual void startDragging(
    227         const WebPoint& from, const WebDragData&, WebDragOperationsMask) { }
     228        const WebDragData&, WebDragOperationsMask, const WebImage&, const WebPoint&) { }
    228229
    229230    // Called to determine if drag-n-drop operations may initiate a page
  • trunk/WebKit/chromium/src/DragClientImpl.cpp

    r53296 r57028  
    3131#include "config.h"
    3232#include "DragClientImpl.h"
    33 
     33#include "DragImageRef.h"
    3434#include "ChromiumDataObject.h"
    3535#include "ClipboardChromium.h"
    3636#include "Frame.h"
     37#include "NativeImageSkia.h"
     38#include "WebCommon.h"
    3739#include "WebDragData.h"
     40#include "WebImage.h"
    3841#include "WebViewClient.h"
    3942#include "WebViewImpl.h"
     
    8285    DragOperation dragOperationMask = clipboard->sourceOperation();
    8386
     87    IntSize offsetSize(eventPos - dragImageOrigin);
     88    WebPoint offsetPoint(offsetSize.width(), offsetSize.height());
     89#if WEBKIT_USING_SKIA
    8490    m_webView->startDragging(
    85         eventPos, dragData, static_cast<WebDragOperationsMask>(dragOperationMask));
     91        dragData, static_cast<WebDragOperationsMask>(dragOperationMask),
     92        WebImage(*dragImage), offsetPoint);
     93#else
     94    // FIXME: When DragImageRef is implemented for CG, we can probably just remove
     95    // this #if fork. For now, pass an empty image.
     96    m_webView->startDragging(
     97        dragData, static_cast<WebDragOperationsMask>(dragOperationMask),
     98        WebImage(), WebPoint());
     99#endif
    86100}
    87101
  • trunk/WebKit/chromium/src/WebViewImpl.cpp

    r56706 r57028  
    8888#include "WebDragData.h"
    8989#include "WebFrameImpl.h"
     90#include "WebImage.h"
    9091#include "WebInputEvent.h"
    9192#include "WebInputEventConversion.h"
     
    19331934}
    19341935
    1935 void WebViewImpl::startDragging(const WebPoint& eventPos,
    1936                                 const WebDragData& dragData,
    1937                                 WebDragOperationsMask mask)
     1936void WebViewImpl::startDragging(const WebDragData& dragData,
     1937                                WebDragOperationsMask mask,
     1938                                const WebImage& dragImage,
     1939                                const WebPoint& dragImageOffset)
    19381940{
    19391941    if (!m_client)
     
    19411943    ASSERT(!m_doingDragAndDrop);
    19421944    m_doingDragAndDrop = true;
    1943     m_client->startDragging(eventPos, dragData, mask);
     1945    m_client->startDragging(dragData, mask, dragImage, dragImageOffset);
    19441946}
    19451947
  • trunk/WebKit/chromium/src/WebViewImpl.h

    r56603 r57028  
    7575class WebDevToolsAgentPrivate;
    7676class WebFrameImpl;
     77class WebImage;
    7778class WebKeyboardEvent;
    7879class WebMouseEvent;
     
    275276    // Start a system drag and drop operation.
    276277    void startDragging(
    277         const WebPoint& eventPos,
    278278        const WebDragData& dragData,
    279         WebDragOperationsMask dragSourceOperationMask);
     279        WebDragOperationsMask mask,
     280        const WebImage& dragImage,
     281        const WebPoint& dragImageOffset);
    280282
    281283    void suggestionsPopupDidHide()
Note: See TracChangeset for help on using the changeset viewer.