This source file includes following definitions.
- m_changedTouches
- initTouchEvent
- interfaceName
- isTouchEvent
- trace
- create
- event
- dispatchEvent
#include "config.h"
#include "core/events/TouchEvent.h"
#include "core/events/EventDispatcher.h"
namespace WebCore {
TouchEvent::TouchEvent()
{
ScriptWrappable::init(this);
}
TouchEvent::TouchEvent(TouchList* touches, TouchList* targetTouches,
TouchList* changedTouches, const AtomicString& type,
PassRefPtrWillBeRawPtr<AbstractView> view, int screenX, int screenY, int pageX, int pageY,
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
: MouseRelatedEvent(type, true, true, view, 0, IntPoint(screenX, screenY),
IntPoint(pageX, pageY),
IntPoint(0, 0),
ctrlKey, altKey, shiftKey, metaKey)
, m_touches(touches)
, m_targetTouches(targetTouches)
, m_changedTouches(changedTouches)
{
ScriptWrappable::init(this);
}
TouchEvent::~TouchEvent()
{
}
void TouchEvent::initTouchEvent(TouchList* touches, TouchList* targetTouches,
TouchList* changedTouches, const AtomicString& type,
PassRefPtrWillBeRawPtr<AbstractView> view, int screenX, int screenY, int clientX, int clientY,
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
{
if (dispatched())
return;
initUIEvent(type, true, true, view, 0);
m_touches = touches;
m_targetTouches = targetTouches;
m_changedTouches = changedTouches;
m_screenLocation = IntPoint(screenX, screenY);
m_ctrlKey = ctrlKey;
m_altKey = altKey;
m_shiftKey = shiftKey;
m_metaKey = metaKey;
initCoordinates(IntPoint(clientX, clientY));
}
const AtomicString& TouchEvent::interfaceName() const
{
return EventNames::TouchEvent;
}
bool TouchEvent::isTouchEvent() const
{
return true;
}
void TouchEvent::trace(Visitor* visitor)
{
visitor->trace(m_touches);
visitor->trace(m_targetTouches);
visitor->trace(m_changedTouches);
MouseRelatedEvent::trace(visitor);
}
PassRefPtr<TouchEventDispatchMediator> TouchEventDispatchMediator::create(PassRefPtrWillBeRawPtr<TouchEvent> touchEvent)
{
return adoptRef(new TouchEventDispatchMediator(touchEvent));
}
TouchEventDispatchMediator::TouchEventDispatchMediator(PassRefPtrWillBeRawPtr<TouchEvent> touchEvent)
: EventDispatchMediator(touchEvent)
{
}
TouchEvent* TouchEventDispatchMediator::event() const
{
return toTouchEvent(EventDispatchMediator::event());
}
bool TouchEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) const
{
event()->eventPath().adjustForTouchEvent(dispatcher->node(), *event());
return dispatcher->dispatch();
}
}