|
Lines 176-186
void EventSenderProxy::mouseScrollBy(int horizontal, int vertical)
a/Tools/WebKitTestRunner/wpe/EventSenderProxyWPE.cpp_sec1
|
| 176 |
return; |
176 |
return; |
| 177 |
|
177 |
|
| 178 |
if (horizontal) { |
178 |
if (horizontal) { |
| 179 |
struct wpe_input_axis_event event = { wpe_input_axis_event_type_motion, secToMsTimestamp(m_time), static_cast<int>(m_position.x), static_cast<int>(m_position.y), HorizontalScroll, horizontal, 0}; |
179 |
struct wpe_input_axis_event event = { wpe_input_axis_event_type_motion, secToMsTimestamp(m_time), static_cast<int>(m_position.x), static_cast<int>(m_position.y), HorizontalScroll, horizontal, 0 }; |
| 180 |
wpe_view_backend_dispatch_axis_event(viewBackend(*m_testController), &event); |
180 |
wpe_view_backend_dispatch_axis_event(viewBackend(*m_testController), &event); |
| 181 |
} |
181 |
} |
| 182 |
if (vertical) { |
182 |
if (vertical) { |
| 183 |
struct wpe_input_axis_event event = { wpe_input_axis_event_type_motion, secToMsTimestamp(m_time), static_cast<int>(m_position.x), static_cast<int>(m_position.y), VerticalScroll, vertical, 0}; |
183 |
struct wpe_input_axis_event event = { wpe_input_axis_event_type_motion, secToMsTimestamp(m_time), static_cast<int>(m_position.x), static_cast<int>(m_position.y), VerticalScroll, vertical, 0 }; |
| 184 |
wpe_view_backend_dispatch_axis_event(viewBackend(*m_testController), &event); |
184 |
wpe_view_backend_dispatch_axis_event(viewBackend(*m_testController), &event); |
| 185 |
} |
185 |
} |
| 186 |
} |
186 |
} |
|
Lines 320-326
void EventSenderProxy::keyDown(WKStringRef keyRef, WKEventModifiers wkModifiers,
a/Tools/WebKitTestRunner/wpe/EventSenderProxyWPE.cpp_sec2
|
| 320 |
struct wpe_input_xkb_keymap_entry* entries; |
320 |
struct wpe_input_xkb_keymap_entry* entries; |
| 321 |
uint32_t entriesCount; |
321 |
uint32_t entriesCount; |
| 322 |
wpe_input_xkb_context_get_entries_for_key_code(wpe_input_xkb_context_get_default(), keySym, &entries, &entriesCount); |
322 |
wpe_input_xkb_context_get_entries_for_key_code(wpe_input_xkb_context_get_default(), keySym, &entries, &entriesCount); |
| 323 |
struct wpe_input_keyboard_event event { secToMsTimestamp(m_time), keySym, entriesCount ? entries[0].hardware_key_code : 0, true, modifiers}; |
323 |
struct wpe_input_keyboard_event event { secToMsTimestamp(m_time), keySym, entriesCount ? entries[0].hardware_key_code : 0, true, modifiers }; |
| 324 |
wpe_view_backend_dispatch_keyboard_event(viewBackend(*m_testController), &event); |
324 |
wpe_view_backend_dispatch_keyboard_event(viewBackend(*m_testController), &event); |
| 325 |
event.pressed = false; |
325 |
event.pressed = false; |
| 326 |
wpe_view_backend_dispatch_keyboard_event(viewBackend(*m_testController), &event); |
326 |
wpe_view_backend_dispatch_keyboard_event(viewBackend(*m_testController), &event); |
|
Lines 335-340
void EventSenderProxy::rawKeyUp(WKStringRef key, WKEventModifiers modifiers, uns
a/Tools/WebKitTestRunner/wpe/EventSenderProxyWPE.cpp_sec3
|
| 335 |
{ |
335 |
{ |
| 336 |
} |
336 |
} |
| 337 |
|
337 |
|
|
|
338 |
#if ENABLE(TOUCH_EVENTS) |
| 339 |
|
| 338 |
void EventSenderProxy::addTouchPoint(int x, int y) |
340 |
void EventSenderProxy::addTouchPoint(int x, int y) |
| 339 |
{ |
341 |
{ |
| 340 |
struct wpe_input_touch_event_raw rawEvent { wpe_input_touch_event_type_down, secToMsTimestamp(m_time), static_cast<int>(m_touchEvents.size()), static_cast<int32_t>(x), static_cast<int32_t>(y) }; |
342 |
struct wpe_input_touch_event_raw rawEvent { wpe_input_touch_event_type_down, secToMsTimestamp(m_time), static_cast<int>(m_touchEvents.size()), static_cast<int32_t>(x), static_cast<int32_t>(y) }; |
|
Lines 364-396
void EventSenderProxy::setTouchPointRadius(int, int)
a/Tools/WebKitTestRunner/wpe/EventSenderProxyWPE.cpp_sec4
|
| 364 |
notImplemented(); |
366 |
notImplemented(); |
| 365 |
} |
367 |
} |
| 366 |
|
368 |
|
| 367 |
Vector<struct wpe_input_touch_event_raw> EventSenderProxy::getUpdatedTouchEvents() |
|
|
| 368 |
{ |
| 369 |
Vector<wpe_input_touch_event_raw> events; |
| 370 |
for (auto id : m_updatedTouchEvents) |
| 371 |
events.append(m_touchEvents[id]); |
| 372 |
return events; |
| 373 |
} |
| 374 |
|
| 375 |
void EventSenderProxy::removeUpdatedTouchEvents() |
| 376 |
{ |
| 377 |
for (auto id : m_updatedTouchEvents) |
| 378 |
m_touchEvents[id].type = wpe_input_touch_event_type_null; |
| 379 |
m_touchEvents.removeAllMatching([] (auto current) { |
| 380 |
return current.type == wpe_input_touch_event_type_null; |
| 381 |
}); |
| 382 |
} |
| 383 |
|
| 384 |
void EventSenderProxy::prepareAndDispatchTouchEvent(enum wpe_input_touch_event_type eventType) |
| 385 |
{ |
| 386 |
auto updatedEvents = getUpdatedTouchEvents(); |
| 387 |
struct wpe_input_touch_event event = { updatedEvents.data(), updatedEvents.size(), eventType, 0, secToMsTimestamp(m_time), 0 }; |
| 388 |
wpe_view_backend_dispatch_touch_event(viewBackend(*m_testController), &event); |
| 389 |
if (eventType == wpe_input_touch_event_type_up) |
| 390 |
removeUpdatedTouchEvents(); |
| 391 |
m_updatedTouchEvents.clear(); |
| 392 |
} |
| 393 |
|
| 394 |
void EventSenderProxy::touchStart() |
369 |
void EventSenderProxy::touchStart() |
| 395 |
{ |
370 |
{ |
| 396 |
prepareAndDispatchTouchEvent(wpe_input_touch_event_type_down); |
371 |
prepareAndDispatchTouchEvent(wpe_input_touch_event_type_down); |
|
Lines 432-435
void EventSenderProxy::cancelTouchPoint(int)
a/Tools/WebKitTestRunner/wpe/EventSenderProxyWPE.cpp_sec5
|
| 432 |
notImplemented(); |
407 |
notImplemented(); |
| 433 |
} |
408 |
} |
| 434 |
|
409 |
|
|
|
410 |
Vector<struct wpe_input_touch_event_raw> EventSenderProxy::getUpdatedTouchEvents() |
| 411 |
{ |
| 412 |
Vector<wpe_input_touch_event_raw> events; |
| 413 |
for (auto id : m_updatedTouchEvents) |
| 414 |
events.append(m_touchEvents[id]); |
| 415 |
return events; |
| 416 |
} |
| 417 |
|
| 418 |
void EventSenderProxy::removeUpdatedTouchEvents() |
| 419 |
{ |
| 420 |
for (auto id : m_updatedTouchEvents) |
| 421 |
m_touchEvents[id].type = wpe_input_touch_event_type_null; |
| 422 |
m_touchEvents.removeAllMatching([] (auto current) { |
| 423 |
return current.type == wpe_input_touch_event_type_null; |
| 424 |
}); |
| 425 |
} |
| 426 |
|
| 427 |
void EventSenderProxy::prepareAndDispatchTouchEvent(enum wpe_input_touch_event_type eventType) |
| 428 |
{ |
| 429 |
auto updatedEvents = getUpdatedTouchEvents(); |
| 430 |
struct wpe_input_touch_event event = { updatedEvents.data(), updatedEvents.size(), eventType, 0, secToMsTimestamp(m_time), 0 }; |
| 431 |
wpe_view_backend_dispatch_touch_event(viewBackend(*m_testController), &event); |
| 432 |
if (eventType == wpe_input_touch_event_type_up) |
| 433 |
removeUpdatedTouchEvents(); |
| 434 |
m_updatedTouchEvents.clear(); |
| 435 |
} |
| 436 |
|
| 437 |
#endif // ENABLE(TOUCH_EVENTS) |
| 438 |
|
| 435 |
} // namespace WTR |
439 |
} // namespace WTR |