Changeset 55572 in webkit


Ignore:
Timestamp:
Mar 4, 2010 10:09:23 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-03-04 Garret Kelly <gdk@chromium.org>

Reviewed by Darin Fisher.

Changing private members from PlatformTouchEvent and PlatformTouchPoint
to be protected, so that Chromium's PlatformTouchEventBuilder and
PlatformTouchPointBuilder can access them. Exercised by the
fast/events/touch tests.
https://bugs.webkit.org/show_bug.cgi?id=35760

  • platform/PlatformTouchEvent.h: (WebCore::PlatformTouchEvent::~PlatformTouchEvent):
  • platform/PlatformTouchPoint.h: (WebCore::PlatformTouchPoint::~PlatformTouchPoint):

2010-03-04 Garret Kelly <gdk@chromium.org>

Reviewed by Darin Fisher.

Adding PlatformTouchEventBuilder and PlatformTouchPointBuilder for
converting Chromium WebTouchEvent and WebTouchPoint types to
corresponding WebCore types.
https://bugs.webkit.org/show_bug.cgi?id=35760

  • src/WebInputEventConversion.cpp: (WebKit::toPlatformTouchEventType): (WebKit::toPlatformTouchPointState): (WebKit::PlatformTouchPointBuilder::PlatformTouchPointBuilder): (WebKit::PlatformTouchEventBuilder::PlatformTouchEventBuilder):
  • src/WebInputEventConversion.h:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r55570 r55572  
     12010-03-04  Garret Kelly  <gdk@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Changing private members from PlatformTouchEvent and PlatformTouchPoint
     6        to be protected, so that Chromium's PlatformTouchEventBuilder and
     7        PlatformTouchPointBuilder can access them. Exercised by the
     8        fast/events/touch tests.
     9        https://bugs.webkit.org/show_bug.cgi?id=35760
     10
     11        * platform/PlatformTouchEvent.h:
     12        (WebCore::PlatformTouchEvent::~PlatformTouchEvent):
     13        * platform/PlatformTouchPoint.h:
     14        (WebCore::PlatformTouchPoint::~PlatformTouchPoint):
     15
    1162010-03-04  Fumitoshi Ukai  <ukai@chromium.org>
    217
  • trunk/WebCore/platform/PlatformTouchEvent.h

    r53994 r55572  
    6868    bool metaKey() const { return m_metaKey; }
    6969
    70 private:
     70protected:
    7171    TouchEventType m_type;
    7272    Vector<PlatformTouchPoint> m_touchPoints;
  • trunk/WebCore/platform/PlatformTouchPoint.h

    r55230 r55572  
    5656    IntPoint pos() const { return m_pos; }
    5757   
    58 private:
     58protected:
    5959    unsigned m_id;
    6060    State m_state;
  • trunk/WebKit/chromium/ChangeLog

    r55571 r55572  
     12010-03-04  Garret Kelly  <gdk@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Adding PlatformTouchEventBuilder and PlatformTouchPointBuilder for
     6        converting Chromium WebTouchEvent and WebTouchPoint types to
     7        corresponding WebCore types.
     8        https://bugs.webkit.org/show_bug.cgi?id=35760
     9
     10        * src/WebInputEventConversion.cpp:
     11        (WebKit::toPlatformTouchEventType):
     12        (WebKit::toPlatformTouchPointState):
     13        (WebKit::PlatformTouchPointBuilder::PlatformTouchPointBuilder):
     14        (WebKit::PlatformTouchEventBuilder::PlatformTouchEventBuilder):
     15        * src/WebInputEventConversion.h:
     16
    1172010-03-04  John Gregg  <johnnyg@google.com>
    218
  • trunk/WebKit/chromium/src/WebInputEventConversion.cpp

    r51904 r55572  
    169169}
    170170
     171#if ENABLE(TOUCH_EVENTS)
     172static inline TouchEventType toPlatformTouchEventType(const WebInputEvent::Type type)
     173{
     174    switch (type) {
     175    case WebInputEvent::TouchStart:
     176        return TouchStart;
     177    case WebInputEvent::TouchMove:
     178        return TouchMove;
     179    case WebInputEvent::TouchEnd:
     180        return TouchEnd;
     181    case WebInputEvent::TouchCancel:
     182        return TouchCancel;
     183    default:
     184        ASSERT_NOT_REACHED();
     185    }
     186}
     187
     188static inline PlatformTouchPoint::State toPlatformTouchPointState(const WebTouchPoint::State state)
     189{
     190    switch (state) {
     191    case WebTouchPoint::StateReleased:
     192        return PlatformTouchPoint::TouchReleased;
     193    case WebTouchPoint::StatePressed:
     194        return PlatformTouchPoint::TouchPressed;
     195    case WebTouchPoint::StateMoved:
     196        return PlatformTouchPoint::TouchMoved;
     197    case WebTouchPoint::StateStationary:
     198        return PlatformTouchPoint::TouchStationary;
     199    case WebTouchPoint::StateCancelled:
     200        return PlatformTouchPoint::TouchCancelled;
     201    case WebTouchPoint::StateUndefined:
     202        ASSERT_NOT_REACHED();
     203    }
     204}
     205
     206PlatformTouchPointBuilder::PlatformTouchPointBuilder(Widget* widget, const WebTouchPoint& point)
     207{
     208    m_id = point.id;
     209    m_state = toPlatformTouchPointState(point.state);
     210    m_pos = widget->convertFromContainingWindow(point.position);
     211    m_screenPos = point.screenPosition;
     212}
     213
     214PlatformTouchEventBuilder::PlatformTouchEventBuilder(Widget* widget, const WebTouchEvent& event)
     215{
     216    m_type = toPlatformTouchEventType(event.type);
     217    m_ctrlKey = event.modifiers & WebInputEvent::ControlKey;
     218    m_altKey = event.modifiers & WebInputEvent::AltKey;
     219    m_shiftKey = event.modifiers & WebInputEvent::ShiftKey;
     220    m_metaKey = event.modifiers & WebInputEvent::MetaKey;
     221
     222    m_touchPoints.resize(event.touchPointsLength);
     223    for (int i = 0; i < event.touchPointsLength; ++i)
     224        m_touchPoints.append(PlatformTouchPointBuilder(widget, event.touchPoints[i]));
     225}
     226#endif
     227
    171228static int getWebInputModifiers(const UIEventWithKeyState& event)
    172229{
  • trunk/WebKit/chromium/src/WebInputEventConversion.h

    r50721 r55572  
    3838#include "PlatformKeyboardEvent.h"
    3939#include "PlatformMouseEvent.h"
     40#include "PlatformTouchEvent.h"
    4041#include "PlatformWheelEvent.h"
    4142
     
    7374};
    7475
     76#if ENABLE(TOUCH_EVENTS)
     77class PlatformTouchPointBuilder : public WebCore::PlatformTouchPoint {
     78public:
     79    PlatformTouchPointBuilder(WebCore::Widget*, const WebTouchPoint&);
     80};
     81
     82class PlatformTouchEventBuilder : public WebCore::PlatformTouchEvent {
     83public:
     84    PlatformTouchEventBuilder(WebCore::Widget*, const WebTouchEvent&);
     85};
     86#endif
     87
    7588// Converts a WebCore::MouseEvent to a corresponding WebMouseEvent. view is
    7689// the ScrollView corresponding to the event.  Returns true if successful.
Note: See TracChangeset for help on using the changeset viewer.