| 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 #ifndef PPAPI_SHARED_IMPL_INPUT_EVENT_IMPL_H_ | 5 #ifndef PPAPI_SHARED_IMPL_INPUT_EVENT_IMPL_H_ |
| 6 #define PPAPI_SHARED_IMPL_INPUT_EVENT_IMPL_H_ | 6 #define PPAPI_SHARED_IMPL_INPUT_EVENT_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // is, should be delivered synchronously. This is used by the proxy. | 23 // is, should be delivered synchronously. This is used by the proxy. |
| 24 bool is_filtered; | 24 bool is_filtered; |
| 25 | 25 |
| 26 PP_InputEvent_Type event_type; | 26 PP_InputEvent_Type event_type; |
| 27 PP_TimeTicks event_time_stamp; | 27 PP_TimeTicks event_time_stamp; |
| 28 uint32_t event_modifiers; | 28 uint32_t event_modifiers; |
| 29 | 29 |
| 30 PP_InputEvent_MouseButton mouse_button; | 30 PP_InputEvent_MouseButton mouse_button; |
| 31 PP_Point mouse_position; | 31 PP_Point mouse_position; |
| 32 int32_t mouse_click_count; | 32 int32_t mouse_click_count; |
| 33 PP_Point mouse_movement; |
| 33 | 34 |
| 34 PP_FloatPoint wheel_delta; | 35 PP_FloatPoint wheel_delta; |
| 35 PP_FloatPoint wheel_ticks; | 36 PP_FloatPoint wheel_ticks; |
| 36 bool wheel_scroll_by_page; | 37 bool wheel_scroll_by_page; |
| 37 | 38 |
| 38 uint32_t key_code; | 39 uint32_t key_code; |
| 39 | 40 |
| 40 std::string character_text; | 41 std::string character_text; |
| 41 }; | 42 }; |
| 42 | 43 |
| 43 // This simple class implements the PPB_InputEvent_API in terms of the | 44 // This simple class implements the PPB_InputEvent_API in terms of the |
| 44 // shared InputEventData structure | 45 // shared InputEventData structure |
| 45 class InputEventImpl : public thunk::PPB_InputEvent_API { | 46 class InputEventImpl : public thunk::PPB_InputEvent_API { |
| 46 public: | 47 public: |
| 47 explicit InputEventImpl(const InputEventData& data); | 48 explicit InputEventImpl(const InputEventData& data); |
| 48 | 49 |
| 49 // PPB_InputEvent_API implementation. | 50 // PPB_InputEvent_API implementation. |
| 50 virtual const InputEventData& GetInputEventData() const OVERRIDE; | 51 virtual const InputEventData& GetInputEventData() const OVERRIDE; |
| 51 virtual PP_InputEvent_Type GetType() OVERRIDE; | 52 virtual PP_InputEvent_Type GetType() OVERRIDE; |
| 52 virtual PP_TimeTicks GetTimeStamp() OVERRIDE; | 53 virtual PP_TimeTicks GetTimeStamp() OVERRIDE; |
| 53 virtual uint32_t GetModifiers() OVERRIDE; | 54 virtual uint32_t GetModifiers() OVERRIDE; |
| 54 virtual PP_InputEvent_MouseButton GetMouseButton() OVERRIDE; | 55 virtual PP_InputEvent_MouseButton GetMouseButton() OVERRIDE; |
| 55 virtual PP_Point GetMousePosition() OVERRIDE; | 56 virtual PP_Point GetMousePosition() OVERRIDE; |
| 56 virtual int32_t GetMouseClickCount() OVERRIDE; | 57 virtual int32_t GetMouseClickCount() OVERRIDE; |
| 58 virtual PP_Point GetMouseMovement() OVERRIDE; |
| 57 virtual PP_FloatPoint GetWheelDelta() OVERRIDE; | 59 virtual PP_FloatPoint GetWheelDelta() OVERRIDE; |
| 58 virtual PP_FloatPoint GetWheelTicks() OVERRIDE; | 60 virtual PP_FloatPoint GetWheelTicks() OVERRIDE; |
| 59 virtual PP_Bool GetWheelScrollByPage() OVERRIDE; | 61 virtual PP_Bool GetWheelScrollByPage() OVERRIDE; |
| 60 virtual uint32_t GetKeyCode() OVERRIDE; | 62 virtual uint32_t GetKeyCode() OVERRIDE; |
| 61 virtual PP_Var GetCharacterText() OVERRIDE; | 63 virtual PP_Var GetCharacterText() OVERRIDE; |
| 62 | 64 |
| 63 protected: | 65 protected: |
| 64 // Derived classes override this to convert a string to a PP_Var in either | 66 // Derived classes override this to convert a string to a PP_Var in either |
| 65 // the proxy or the impl. | 67 // the proxy or the impl. |
| 66 virtual PP_Var StringToPPVar(const std::string& str) = 0; | 68 virtual PP_Var StringToPPVar(const std::string& str) = 0; |
| 67 | 69 |
| 68 private: | 70 private: |
| 69 InputEventData data_; | 71 InputEventData data_; |
| 70 }; | 72 }; |
| 71 | 73 |
| 72 } // namespace ppapi | 74 } // namespace ppapi |
| 73 | 75 |
| 74 #endif // PPAPI_SHARED_IMPL_INPUT_EVENT_IMPL_H_ | 76 #endif // PPAPI_SHARED_IMPL_INPUT_EVENT_IMPL_H_ |
| 75 | 77 |
| OLD | NEW |