Changeset 106803 in webkit


Ignore:
Timestamp:
Feb 6, 2012 6:07:27 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

WebGestureEvent can not encode delta and area.
https://bugs.webkit.org/show_bug.cgi?id=77728

Source/WebCore:

Add area field to PlatformGestureEvent.

Patch by Allan Sandfeld Jensen <allan.jensen@nokia.com> on 2012-02-06
Reviewed by Kenneth Rohde Christiansen.

  • platform/PlatformGestureEvent.h:

(WebCore::PlatformGestureEvent::PlatformGestureEvent):
(WebCore::PlatformGestureEvent::area):

Source/WebKit2:

Support delta and area fields in WebGestureEvent, and send area with Qt tap gesture.

Patch by Allan Sandfeld Jensen <allan.jensen@nokia.com> on 2012-02-06
Reviewed by Kenneth Rohde Christiansen.

  • Shared/WebEvent.h:

(WebKit::WebGestureEvent::area):
(WebKit::WebGestureEvent::delta):

  • Shared/WebEventConversion.cpp:

(WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):

  • Shared/WebGestureEvent.cpp:

(WebKit::WebGestureEvent::WebGestureEvent):
(WebKit::WebGestureEvent::encode):
(WebKit::WebGestureEvent::decode):

  • UIProcess/qt/QtWebPageEventHandler.cpp:

(QtWebPageEventHandler::handleSingleTapEvent):

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106802 r106803  
     12012-02-06  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
     2
     3        WebGestureEvent can not encode delta and area.
     4        https://bugs.webkit.org/show_bug.cgi?id=77728
     5
     6        Add area field to PlatformGestureEvent.
     7
     8        Reviewed by Kenneth Rohde Christiansen.
     9
     10        * platform/PlatformGestureEvent.h:
     11        (WebCore::PlatformGestureEvent::PlatformGestureEvent):
     12        (WebCore::PlatformGestureEvent::area):
     13
    1142012-02-06  Charles Wei  <charles.wei@torchmobile.com.cn>
    215
  • trunk/Source/WebCore/platform/PlatformGestureEvent.h

    r103643 r106803  
    2929#if ENABLE(GESTURE_EVENTS)
    3030
     31#include "FloatPoint.h"
    3132#include "IntPoint.h"
     33#include "IntSize.h"
    3234#include "PlatformEvent.h"
    3335
     
    5254    }
    5355
     56    PlatformGestureEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, double timestamp, const IntSize& area, const FloatPoint& delta, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey)
     57        : PlatformEvent(type, shiftKey, ctrlKey, altKey, metaKey, timestamp)
     58        , m_position(position)
     59        , m_globalPosition(globalPosition)
     60        , m_area(area)
     61        , m_deltaX(delta.x())
     62        , m_deltaY(delta.y())
     63    {
     64    }
     65
    5466    const IntPoint& position() const { return m_position; } // PlatformWindow coordinates.
    5567    const IntPoint& globalPosition() const { return m_globalPosition; } // Screen coordinates.
     68
     69    const IntSize& area() const { return m_area; }
    5670
    5771    float deltaX() const { return m_deltaX; }
     
    6175    IntPoint m_position;
    6276    IntPoint m_globalPosition;
     77    IntSize m_area;
    6378    float m_deltaX;
    6479    float m_deltaY;
  • trunk/Source/WebKit2/ChangeLog

    r106800 r106803  
     12012-02-06  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
     2
     3        WebGestureEvent can not encode delta and area.
     4        https://bugs.webkit.org/show_bug.cgi?id=77728
     5
     6        Support delta and area fields in WebGestureEvent, and send area with Qt tap gesture.
     7
     8        Reviewed by Kenneth Rohde Christiansen.
     9
     10        * Shared/WebEvent.h:
     11        (WebKit::WebGestureEvent::area):
     12        (WebKit::WebGestureEvent::delta):
     13        * Shared/WebEventConversion.cpp:
     14        (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
     15        * Shared/WebGestureEvent.cpp:
     16        (WebKit::WebGestureEvent::WebGestureEvent):
     17        (WebKit::WebGestureEvent::encode):
     18        (WebKit::WebGestureEvent::decode):
     19        * UIProcess/qt/QtWebPageEventHandler.cpp:
     20        (QtWebPageEventHandler::handleSingleTapEvent):
     21
    1222012-02-03  Zalan Bujtas  <zbujtas@gmail.com>  and  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
    223
  • trunk/Source/WebKit2/Shared/WebEvent.h

    r106021 r106803  
    3030// we can use them as the event type.
    3131
     32#include <WebCore/FloatPoint.h>
    3233#include <WebCore/FloatSize.h>
    3334#include <WebCore/IntPoint.h>
     35#include <WebCore/IntSize.h>
    3436#include <wtf/text/WTFString.h>
    3537
     
    255257    WebGestureEvent() { }
    256258    WebGestureEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, Modifiers, double timestamp);
     259    WebGestureEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, Modifiers, double timestamp, const WebCore::IntSize& area, const WebCore::FloatPoint& delta);
    257260
    258261    const WebCore::IntPoint position() const { return m_position; }
    259262    const WebCore::IntPoint globalPosition() const { return m_globalPosition; }
     263    const WebCore::IntSize area() const { return m_area; }
     264    const WebCore::FloatPoint delta() const { return m_delta; }
    260265
    261266    void encode(CoreIPC::ArgumentEncoder*) const;
     
    267272    WebCore::IntPoint m_position;
    268273    WebCore::IntPoint m_globalPosition;
     274    WebCore::IntSize m_area;
     275    WebCore::FloatPoint m_delta;
    269276};
    270277#endif // ENABLE(GESTURE_EVENTS)
  • trunk/Source/WebKit2/Shared/WebEventConversion.cpp

    r103700 r106803  
    233233        m_position = webEvent.position();
    234234        m_globalPosition = webEvent.globalPosition();
     235
     236        m_area = webEvent.area();
     237        m_deltaX = webEvent.delta().x();
     238        m_deltaY = webEvent.delta().y();
    235239    }
    236240};
  • trunk/Source/WebKit2/Shared/WebGestureEvent.cpp

    r98943 r106803  
    4444}
    4545
     46WebGestureEvent::WebGestureEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, Modifiers modifiers, double timestamp, const IntSize& area, const FloatPoint& delta)
     47    : WebEvent(type, modifiers, timestamp)
     48    , m_position(position)
     49    , m_globalPosition(globalPosition)
     50    , m_area(area)
     51    , m_delta(delta)
     52{
     53    ASSERT(isGestureEventType(type));
     54}
     55
    4656void WebGestureEvent::encode(CoreIPC::ArgumentEncoder* encoder) const
    4757{
     
    5060    encoder->encode(m_position);
    5161    encoder->encode(m_globalPosition);
     62    encoder->encode(m_area);
     63    encoder->encode(m_delta);
    5264}
    5365
     
    5971        return false;
    6072    if (!decoder->decode(t.m_globalPosition))
     73        return false;
     74    if (!decoder->decode(t.m_area))
     75        return false;
     76    if (!decoder->decode(t.m_delta))
    6177        return false;
    6278    return true;
  • trunk/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp

    r106658 r106803  
    299299
    300300    QTransform fromItemTransform = m_webPage->transformFromItem();
    301     WebGestureEvent gesture(WebEvent::GestureSingleTap, fromItemTransform.map(point.pos()).toPoint(), point.screenPos().toPoint(), WebEvent::Modifiers(0), 0);
     301    WebGestureEvent gesture(WebEvent::GestureSingleTap, fromItemTransform.map(point.pos()).toPoint(), point.screenPos().toPoint(), WebEvent::Modifiers(0), 0, IntSize(point.rect().size().toSize()), FloatPoint(0, 0));
    302302    m_webPageProxy->handleGestureEvent(gesture);
    303303}
Note: See TracChangeset for help on using the changeset viewer.