| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ppapi/c/pp_errors.h" | 5 #include "ppapi/c/pp_errors.h" |
| 6 #include "ppapi/thunk/thunk.h" | 6 #include "ppapi/thunk/thunk.h" |
| 7 #include "ppapi/thunk/enter.h" | 7 #include "ppapi/thunk/enter.h" |
| 8 #include "ppapi/thunk/ppb_input_event_api.h" | 8 #include "ppapi/thunk/ppb_input_event_api.h" |
| 9 #include "ppapi/thunk/ppb_instance_api.h" | 9 #include "ppapi/thunk/ppb_instance_api.h" |
| 10 #include "ppapi/thunk/resource_creation_api.h" | 10 #include "ppapi/thunk/resource_creation_api.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 &RequestFilteringInputEvents, | 73 &RequestFilteringInputEvents, |
| 74 &ClearInputEventRequest, | 74 &ClearInputEventRequest, |
| 75 &IsInputEvent, | 75 &IsInputEvent, |
| 76 &GetType, | 76 &GetType, |
| 77 &GetTimeStamp, | 77 &GetTimeStamp, |
| 78 &GetModifiers | 78 &GetModifiers |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 // Mouse ----------------------------------------------------------------------- | 81 // Mouse ----------------------------------------------------------------------- |
| 82 | 82 |
| 83 PP_Resource CreateMouseInputEvent1_0(PP_Instance instance, | 83 PP_Resource CreateMouseInputEvent(PP_Instance instance, |
| 84 PP_InputEvent_Type type, | 84 PP_InputEvent_Type type, |
| 85 PP_TimeTicks time_stamp, | 85 PP_TimeTicks time_stamp, |
| 86 uint32_t modifiers, | 86 uint32_t modifiers, |
| 87 PP_InputEvent_MouseButton mouse_button, | 87 PP_InputEvent_MouseButton mouse_button, |
| 88 const PP_Point* mouse_position, | 88 const PP_Point* mouse_position, |
| 89 int32_t click_count) { | 89 int32_t click_count) { |
| 90 EnterFunction<ResourceCreationAPI> enter(instance, true); | 90 EnterFunction<ResourceCreationAPI> enter(instance, true); |
| 91 if (enter.failed()) | 91 if (enter.failed()) |
| 92 return 0; | 92 return 0; |
| 93 | 93 |
| 94 PP_Point mouse_movement = PP_MakePoint(0, 0); | 94 PP_Point mouse_movement = PP_MakePoint(0, 0); |
| 95 return enter.functions()->CreateMouseInputEvent(instance, type, time_stamp, | 95 return enter.functions()->CreateMouseInputEvent(instance, type, time_stamp, |
| 96 modifiers, mouse_button, | 96 modifiers, mouse_button, |
| 97 mouse_position, click_count, | 97 mouse_position, click_count, |
| 98 &mouse_movement); | 98 &mouse_movement); |
| 99 } | 99 } |
| 100 | 100 |
| 101 PP_Resource CreateMouseInputEvent1_1(PP_Instance instance, | 101 PP_Resource CreateMouseInputEventDev(PP_Instance instance, |
| 102 PP_InputEvent_Type type, | 102 PP_InputEvent_Type type, |
| 103 PP_TimeTicks time_stamp, | 103 PP_TimeTicks time_stamp, |
| 104 uint32_t modifiers, | 104 uint32_t modifiers, |
| 105 PP_InputEvent_MouseButton mouse_button, | 105 PP_InputEvent_MouseButton mouse_button, |
| 106 const PP_Point* mouse_position, | 106 const PP_Point* mouse_position, |
| 107 int32_t click_count, | 107 int32_t click_count, |
| 108 const PP_Point* mouse_movement) { | 108 const PP_Point* mouse_movement) { |
| 109 EnterFunction<ResourceCreationAPI> enter(instance, true); | 109 EnterFunction<ResourceCreationAPI> enter(instance, true); |
| 110 if (enter.failed()) | 110 if (enter.failed()) |
| 111 return 0; | 111 return 0; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 return enter.object()->GetMouseClickCount(); | 148 return enter.object()->GetMouseClickCount(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 PP_Point GetMouseMovement(PP_Resource mouse_event) { | 151 PP_Point GetMouseMovement(PP_Resource mouse_event) { |
| 152 EnterInputEvent enter(mouse_event, true); | 152 EnterInputEvent enter(mouse_event, true); |
| 153 if (enter.failed()) | 153 if (enter.failed()) |
| 154 return PP_MakePoint(0, 0); | 154 return PP_MakePoint(0, 0); |
| 155 return enter.object()->GetMouseMovement(); | 155 return enter.object()->GetMouseMovement(); |
| 156 } | 156 } |
| 157 | 157 |
| 158 const PPB_MouseInputEvent_1_0 g_ppb_mouse_input_event_1_0_thunk = { | 158 const PPB_MouseInputEvent g_ppb_mouse_input_event_thunk = { |
| 159 &CreateMouseInputEvent1_0, | 159 &CreateMouseInputEvent, |
| 160 &IsMouseInputEvent, | 160 &IsMouseInputEvent, |
| 161 &GetMouseButton, | 161 &GetMouseButton, |
| 162 &GetMousePosition, | 162 &GetMousePosition, |
| 163 &GetMouseClickCount | 163 &GetMouseClickCount |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 const PPB_MouseInputEvent g_ppb_mouse_input_event_1_1_thunk = { | 166 const PPB_MouseInputEvent_Dev g_ppb_mouse_input_event_dev_thunk = { |
| 167 &CreateMouseInputEvent1_1, | 167 &CreateMouseInputEventDev, |
| 168 &IsMouseInputEvent, | 168 &IsMouseInputEvent, |
| 169 &GetMouseButton, | 169 &GetMouseButton, |
| 170 &GetMousePosition, | 170 &GetMousePosition, |
| 171 &GetMouseClickCount, | 171 &GetMouseClickCount, |
| 172 &GetMouseMovement | 172 &GetMouseMovement |
| 173 }; | 173 }; |
| 174 | 174 |
| 175 // Wheel ----------------------------------------------------------------------- | 175 // Wheel ----------------------------------------------------------------------- |
| 176 | 176 |
| 177 PP_Resource CreateWheelInputEvent(PP_Instance instance, | 177 PP_Resource CreateWheelInputEvent(PP_Instance instance, |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 &GetKeyCode, | 270 &GetKeyCode, |
| 271 &GetCharacterText | 271 &GetCharacterText |
| 272 }; | 272 }; |
| 273 | 273 |
| 274 } // namespace | 274 } // namespace |
| 275 | 275 |
| 276 const PPB_InputEvent* GetPPB_InputEvent_Thunk() { | 276 const PPB_InputEvent* GetPPB_InputEvent_Thunk() { |
| 277 return &g_ppb_input_event_thunk; | 277 return &g_ppb_input_event_thunk; |
| 278 } | 278 } |
| 279 | 279 |
| 280 const PPB_MouseInputEvent_1_0* GetPPB_MouseInputEvent_1_0_Thunk() { | 280 const PPB_MouseInputEvent* GetPPB_MouseInputEvent_Thunk() { |
| 281 return &g_ppb_mouse_input_event_1_0_thunk; | 281 return &g_ppb_mouse_input_event_thunk; |
| 282 } | 282 } |
| 283 | 283 |
| 284 const PPB_MouseInputEvent* GetPPB_MouseInputEvent_1_1_Thunk() { | 284 const PPB_MouseInputEvent_Dev* GetPPB_MouseInputEvent_Dev_Thunk() { |
| 285 return &g_ppb_mouse_input_event_1_1_thunk; | 285 return &g_ppb_mouse_input_event_dev_thunk; |
| 286 } | 286 } |
| 287 | 287 |
| 288 const PPB_KeyboardInputEvent* GetPPB_KeyboardInputEvent_Thunk() { | 288 const PPB_KeyboardInputEvent* GetPPB_KeyboardInputEvent_Thunk() { |
| 289 return &g_ppb_keyboard_input_event_thunk; | 289 return &g_ppb_keyboard_input_event_thunk; |
| 290 } | 290 } |
| 291 | 291 |
| 292 const PPB_WheelInputEvent* GetPPB_WheelInputEvent_Thunk() { | 292 const PPB_WheelInputEvent* GetPPB_WheelInputEvent_Thunk() { |
| 293 return &g_ppb_wheel_input_event_thunk; | 293 return &g_ppb_wheel_input_event_thunk; |
| 294 } | 294 } |
| 295 | 295 |
| 296 } // namespace thunk | 296 } // namespace thunk |
| 297 } // namespace ppapi | 297 } // namespace ppapi |
| OLD | NEW |