| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
| 8 #include "ppapi/thunk/enter.h" | 8 #include "ppapi/thunk/enter.h" |
| 9 #include "ppapi/thunk/ppb_input_event_api.h" | 9 #include "ppapi/thunk/ppb_input_event_api.h" |
| 10 #include "ppapi/thunk/ppb_instance_api.h" | 10 #include "ppapi/thunk/ppb_instance_api.h" |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 struct PP_TouchPoint GetTouchById(PP_Resource touch_event, | 490 struct PP_TouchPoint GetTouchById(PP_Resource touch_event, |
| 491 PP_TouchListType list, | 491 PP_TouchListType list, |
| 492 uint32_t id) { | 492 uint32_t id) { |
| 493 VLOG(4) << "PPB_TouchInputEvent::GetTouchById()"; | 493 VLOG(4) << "PPB_TouchInputEvent::GetTouchById()"; |
| 494 EnterInputEvent enter(touch_event, true); | 494 EnterInputEvent enter(touch_event, true); |
| 495 if (enter.failed()) | 495 if (enter.failed()) |
| 496 return PP_MakeTouchPoint(); | 496 return PP_MakeTouchPoint(); |
| 497 return enter.object()->GetTouchById(list, id); | 497 return enter.object()->GetTouchById(list, id); |
| 498 } | 498 } |
| 499 | 499 |
| 500 const PPB_TouchInputEvent_1_0 g_ppb_touch_input_event_thunk = { | 500 struct PP_FloatPoint GetTouchTiltByIndex(PP_Resource touch_event, |
| 501 &CreateTouchInputEvent, | 501 PP_TouchListType list, |
| 502 &AddTouchPoint, | 502 uint32_t index) { |
| 503 &IsTouchInputEvent, | 503 VLOG(4) << "PPB_TouchInputEvent::GetTouchTiltByIndex()"; |
| 504 &GetTouchCount, | 504 EnterInputEvent enter(touch_event, true); |
| 505 &GetTouchByIndex, | 505 if (enter.failed()) |
| 506 &GetTouchById | 506 return PP_MakeFloatPoint(0, 0); |
| 507 return enter.object()->GetTouchTiltByIndex(list, index); |
| 508 } |
| 509 |
| 510 struct PP_FloatPoint GetTouchTiltById(PP_Resource touch_event, |
| 511 PP_TouchListType list, |
| 512 uint32_t id) { |
| 513 VLOG(4) << "PPB_TouchInputEvent::GetTouchTiltById()"; |
| 514 EnterInputEvent enter(touch_event, true); |
| 515 if (enter.failed()) |
| 516 return PP_MakeFloatPoint(0, 0); |
| 517 return enter.object()->GetTouchTiltById(list, id); |
| 518 } |
| 519 |
| 520 const PPB_TouchInputEvent_1_0 g_ppb_touch_input_event_1_0_thunk = { |
| 521 &CreateTouchInputEvent, &AddTouchPoint, &IsTouchInputEvent, |
| 522 &GetTouchCount, &GetTouchByIndex, &GetTouchById}; |
| 523 |
| 524 const PPB_TouchInputEvent_1_1 g_ppb_touch_input_event_1_1_thunk = { |
| 525 &CreateTouchInputEvent, &AddTouchPoint, &IsTouchInputEvent, |
| 526 &GetTouchCount, &GetTouchByIndex, &GetTouchById, |
| 527 &GetTouchTiltByIndex, &GetTouchTiltById, |
| 507 }; | 528 }; |
| 508 | 529 |
| 509 } // namespace | 530 } // namespace |
| 510 | 531 |
| 511 const PPB_InputEvent_1_0* GetPPB_InputEvent_1_0_Thunk() { | 532 const PPB_InputEvent_1_0* GetPPB_InputEvent_1_0_Thunk() { |
| 512 return &g_ppb_input_event_thunk; | 533 return &g_ppb_input_event_thunk; |
| 513 } | 534 } |
| 514 | 535 |
| 515 const PPB_MouseInputEvent_1_0* GetPPB_MouseInputEvent_1_0_Thunk() { | 536 const PPB_MouseInputEvent_1_0* GetPPB_MouseInputEvent_1_0_Thunk() { |
| 516 return &g_ppb_mouse_input_event_1_0_thunk; | 537 return &g_ppb_mouse_input_event_1_0_thunk; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 538 | 559 |
| 539 const PPB_IMEInputEvent_Dev_0_2* GetPPB_IMEInputEvent_Dev_0_2_Thunk() { | 560 const PPB_IMEInputEvent_Dev_0_2* GetPPB_IMEInputEvent_Dev_0_2_Thunk() { |
| 540 return &g_ppb_ime_input_event_0_2_thunk; | 561 return &g_ppb_ime_input_event_0_2_thunk; |
| 541 } | 562 } |
| 542 | 563 |
| 543 const PPB_IMEInputEvent_1_0* GetPPB_IMEInputEvent_1_0_Thunk() { | 564 const PPB_IMEInputEvent_1_0* GetPPB_IMEInputEvent_1_0_Thunk() { |
| 544 return &g_ppb_ime_input_event_1_0_thunk; | 565 return &g_ppb_ime_input_event_1_0_thunk; |
| 545 } | 566 } |
| 546 | 567 |
| 547 const PPB_TouchInputEvent_1_0* GetPPB_TouchInputEvent_1_0_Thunk() { | 568 const PPB_TouchInputEvent_1_0* GetPPB_TouchInputEvent_1_0_Thunk() { |
| 548 return &g_ppb_touch_input_event_thunk; | 569 return &g_ppb_touch_input_event_1_0_thunk; |
| 570 } |
| 571 |
| 572 const PPB_TouchInputEvent_1_1* GetPPB_TouchInputEvent_1_1_Thunk() { |
| 573 return &g_ppb_touch_input_event_1_1_thunk; |
| 549 } | 574 } |
| 550 | 575 |
| 551 } // namespace thunk | 576 } // namespace thunk |
| 552 } // namespace ppapi | 577 } // namespace ppapi |
| OLD | NEW |