Remove GestureEvent.idl

This interface no longer has any clients.
This commit is contained in:
Adam Barth
2015-09-21 17:11:49 -07:00
parent 77d5aa16b3
commit ffb27159d7
5 changed files with 0 additions and 194 deletions
-4
View File
@@ -318,8 +318,6 @@ sky_core_files = [
"events/Event.cpp",
"events/Event.h",
"events/EventSender.h",
"events/GestureEvent.cpp",
"events/GestureEvent.h",
"events/GestureVelocity.cpp",
"events/GestureVelocity.h",
"events/KeyboardEvent.cpp",
@@ -638,7 +636,6 @@ core_idl_files = get_path_info([
"dom/Range.idl",
"dom/Text.idl",
"events/Event.idl",
"events/GestureEvent.idl",
"events/GestureVelocity.idl",
"events/KeyboardEvent.idl",
"events/PointerEvent.idl",
@@ -708,7 +705,6 @@ core_dart_files = get_path_info([
# interfaces that inherit from Event, including Event itself
core_event_idl_files = get_path_info([
"events/Event.idl",
"events/GestureEvent.idl",
"events/KeyboardEvent.idl",
"events/PointerEvent.idl",
"events/WheelEvent.idl",
-105
View File
@@ -1,105 +0,0 @@
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "gen/sky/core/EventNames.h"
#include "gen/sky/core/EventTypeNames.h"
#include "sky/engine/core/dom/Element.h"
#include "sky/engine/core/events/GestureEvent.h"
#include "sky/engine/wtf/text/AtomicString.h"
namespace blink {
static AtomicString stringForType(WebInputEvent::Type type)
{
if (type == WebInputEvent::GestureScrollBegin)
return EventTypeNames::gesturescrollstart;
if (type == WebInputEvent::GestureScrollEnd)
return EventTypeNames::gesturescrollend;
if (type == WebInputEvent::GestureScrollUpdate)
return EventTypeNames::gesturescrollupdate;
if (type == WebInputEvent::GestureScrollUpdateWithoutPropagation)
return EventTypeNames::gesturescrollupdate;
if (type == WebInputEvent::GestureFlingStart)
return EventTypeNames::gestureflingstart;
if (type == WebInputEvent::GestureFlingCancel)
return EventTypeNames::gestureflingcancel;
if (type == WebInputEvent::GestureShowPress)
return EventTypeNames::gestureshowpress;
if (type == WebInputEvent::GestureTap)
return EventTypeNames::gesturetap;
if (type == WebInputEvent::GestureTapUnconfirmed)
return EventTypeNames::gesturetapunconfirmed;
if (type == WebInputEvent::GestureTapDown)
return EventTypeNames::gesturetapdown;
if (type == WebInputEvent::GestureTapCancel)
return EventTypeNames::gesturetapcancel;
if (type == WebInputEvent::GestureDoubleTap)
return EventTypeNames::gesturedoubletap;
if (type == WebInputEvent::GestureTwoFingerTap)
return EventTypeNames::gesturetwofingertap;
if (type == WebInputEvent::GestureLongPress)
return EventTypeNames::gesturelongpress;
if (type == WebInputEvent::GestureLongTap)
return EventTypeNames::gesturelongtap;
if (type == WebInputEvent::GesturePinchBegin)
return EventTypeNames::gesturepinchstart;
if (type == WebInputEvent::GesturePinchEnd)
return EventTypeNames::gesturepinchend;
if (type == WebInputEvent::GesturePinchUpdate)
return EventTypeNames::gesturepinchupdate;
ASSERT_NOT_REACHED();
return AtomicString();
}
GestureEvent::~GestureEvent()
{
}
const AtomicString& GestureEvent::interfaceName() const
{
return EventNames::GestureEvent;
}
GestureEvent::GestureEvent()
: GestureEvent(AtomicString(), GestureEventInit())
{
}
GestureEvent::GestureEvent(const WebGestureEvent& event)
: Event(stringForType(event.type), true, true)
, m_primaryPointer(event.primaryPointer)
, m_x(event.x)
, m_y(event.y)
, m_dx(0)
, m_dy(0)
, m_velocityX(0)
, m_velocityY(0)
{
m_timeStamp = event.timeStampMS;
if (event.type == WebInputEvent::GestureFlingStart) {
m_velocityX = event.data.flingStart.velocityX;
m_velocityY = event.data.flingStart.velocityY;
} else if (event.type == WebInputEvent::GestureScrollUpdate
|| event.type == WebInputEvent::GestureScrollUpdateWithoutPropagation) {
m_dx = event.data.scrollUpdate.deltaX;
m_dy = event.data.scrollUpdate.deltaY;
m_velocityX = event.data.scrollUpdate.velocityX;
m_velocityY = event.data.scrollUpdate.velocityY;
}
}
GestureEvent::GestureEvent(const AtomicString& type, const GestureEventInit& initializer)
: Event(type, initializer)
, m_primaryPointer(initializer.primaryPointer)
, m_x(initializer.x)
, m_y(initializer.y)
, m_dx(initializer.dx)
, m_dy(initializer.dy)
, m_velocityX(initializer.velocityX)
, m_velocityY(initializer.velocityY)
{
}
} // namespace blink
-66
View File
@@ -1,66 +0,0 @@
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SKY_ENGINE_CORE_EVENTS_GESTUREEVENT_H_
#define SKY_ENGINE_CORE_EVENTS_GESTUREEVENT_H_
#include "sky/engine/core/events/Event.h"
#include "sky/engine/public/platform/WebInputEvent.h"
namespace blink {
struct GestureEventInit : public EventInit {
int primaryPointer = 0;
double x = 0;
double y = 0;
double dx = 0;
double dy = 0;
double velocityX = 0;
double velocityY = 0;
};
class GestureEvent : public Event {
DEFINE_WRAPPERTYPEINFO();
public:
static PassRefPtr<GestureEvent> create()
{
return adoptRef(new GestureEvent);
}
static PassRefPtr<GestureEvent> create(const WebGestureEvent& event)
{
return adoptRef(new GestureEvent(event));
}
static PassRefPtr<GestureEvent> create(const AtomicString& type, const GestureEventInit& initializer)
{
return adoptRef(new GestureEvent(type, initializer));
}
~GestureEvent() override;
const AtomicString& interfaceName() const override;
int primaryPointer() const { return m_primaryPointer; }
float x() const { return m_x; }
float y() const { return m_y; }
float dx() const { return m_dx; }
float dy() const { return m_dy; }
float velocityX() const { return m_velocityX; }
float velocityY() const { return m_velocityY; }
private:
GestureEvent();
explicit GestureEvent(const WebGestureEvent&);
GestureEvent(const AtomicString& type, const GestureEventInit&);
int m_primaryPointer;
float m_x;
float m_y;
float m_dx;
float m_dy;
float m_velocityX;
float m_velocityY;
};
} // namespace blink
#endif // SKY_ENGINE_CORE_EVENTS_GESTUREEVENT_H_
-15
View File
@@ -1,15 +0,0 @@
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
EventConstructor,
] interface GestureEvent : Event {
[InitializedByEventConstructor] readonly attribute long primaryPointer;
[InitializedByEventConstructor] readonly attribute double x;
[InitializedByEventConstructor] readonly attribute double y;
[InitializedByEventConstructor] readonly attribute double dx;
[InitializedByEventConstructor] readonly attribute double dy;
[InitializedByEventConstructor] readonly attribute double velocityX;
[InitializedByEventConstructor] readonly attribute double velocityY;
};
-4
View File
@@ -6,7 +6,6 @@
#include "base/bind.h"
#include "base/trace_event/trace_event.h"
#include "sky/engine/core/events/GestureEvent.h"
#include "sky/engine/core/events/KeyboardEvent.h"
#include "sky/engine/core/events/PointerEvent.h"
#include "sky/engine/core/events/WheelEvent.h"
@@ -77,9 +76,6 @@ void SkyView::HandleInputEvent(const WebInputEvent& inputEvent) {
if (WebInputEvent::isPointerEventType(inputEvent.type)) {
const WebPointerEvent& event = static_cast<const WebPointerEvent&>(inputEvent);
view_->handleInputEvent(PointerEvent::create(event));
} else if (WebInputEvent::isGestureEventType(inputEvent.type)) {
const WebGestureEvent& event = static_cast<const WebGestureEvent&>(inputEvent);
view_->handleInputEvent(GestureEvent::create(event));
} else if (WebInputEvent::isKeyboardEventType(inputEvent.type)) {
const WebKeyboardEvent& event = static_cast<const WebKeyboardEvent&>(inputEvent);
view_->handleInputEvent(KeyboardEvent::create(event));