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_PPB_INPUT_EVENT_SHARED_H_ |
6 #define PPAPI_SHARED_IMPL_INPUT_EVENT_IMPL_H_ | 6 #define PPAPI_SHARED_IMPL_PPB_INPUT_EVENT_SHARED_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "ppapi/shared_impl/resource.h" | 13 #include "ppapi/shared_impl/resource.h" |
14 #include "ppapi/thunk/ppb_input_event_api.h" | 14 #include "ppapi/thunk/ppb_input_event_api.h" |
15 | 15 |
16 namespace ppapi { | 16 namespace ppapi { |
(...skipping 27 matching lines...) Expand all Loading... |
44 std::string character_text; | 44 std::string character_text; |
45 | 45 |
46 std::vector<uint32_t> composition_segment_offsets; | 46 std::vector<uint32_t> composition_segment_offsets; |
47 int32_t composition_target_segment; | 47 int32_t composition_target_segment; |
48 uint32_t composition_selection_start; | 48 uint32_t composition_selection_start; |
49 uint32_t composition_selection_end; | 49 uint32_t composition_selection_end; |
50 }; | 50 }; |
51 | 51 |
52 // This simple class implements the PPB_InputEvent_API in terms of the | 52 // This simple class implements the PPB_InputEvent_API in terms of the |
53 // shared InputEventData structure | 53 // shared InputEventData structure |
54 class PPAPI_SHARED_EXPORT InputEventImpl | 54 class PPAPI_SHARED_EXPORT PPB_InputEvent_Shared |
55 : public Resource, | 55 : public Resource, |
56 public thunk::PPB_InputEvent_API { | 56 public thunk::PPB_InputEvent_API { |
57 public: | 57 public: |
58 struct InitAsImpl {}; | 58 struct InitAsImpl {}; |
59 struct InitAsProxy {}; | 59 struct InitAsProxy {}; |
60 | 60 |
61 // The dummy arguments control which version of Resource's constructor is | 61 // The dummy arguments control which version of Resource's constructor is |
62 // called for this base class. | 62 // called for this base class. |
63 InputEventImpl(const InitAsImpl&, | 63 PPB_InputEvent_Shared(const InitAsImpl&, |
64 PP_Instance instance, | 64 PP_Instance instance, |
65 const InputEventData& data); | 65 const InputEventData& data); |
66 InputEventImpl(const InitAsProxy&, | 66 PPB_InputEvent_Shared(const InitAsProxy&, |
67 PP_Instance instance, | 67 PP_Instance instance, |
68 const InputEventData& data); | 68 const InputEventData& data); |
69 | 69 |
70 // Resource overrides. | 70 // Resource overrides. |
71 virtual PPB_InputEvent_API* AsPPB_InputEvent_API() OVERRIDE; | 71 virtual PPB_InputEvent_API* AsPPB_InputEvent_API() OVERRIDE; |
72 | 72 |
73 // PPB_InputEvent_API implementation. | 73 // PPB_InputEvent_API implementation. |
74 virtual const InputEventData& GetInputEventData() const OVERRIDE; | 74 virtual const InputEventData& GetInputEventData() const OVERRIDE; |
75 virtual PP_InputEvent_Type GetType() OVERRIDE; | 75 virtual PP_InputEvent_Type GetType() OVERRIDE; |
76 virtual PP_TimeTicks GetTimeStamp() OVERRIDE; | 76 virtual PP_TimeTicks GetTimeStamp() OVERRIDE; |
77 virtual uint32_t GetModifiers() OVERRIDE; | 77 virtual uint32_t GetModifiers() OVERRIDE; |
78 virtual PP_InputEvent_MouseButton GetMouseButton() OVERRIDE; | 78 virtual PP_InputEvent_MouseButton GetMouseButton() OVERRIDE; |
79 virtual PP_Point GetMousePosition() OVERRIDE; | 79 virtual PP_Point GetMousePosition() OVERRIDE; |
80 virtual int32_t GetMouseClickCount() OVERRIDE; | 80 virtual int32_t GetMouseClickCount() OVERRIDE; |
81 virtual PP_Point GetMouseMovement() OVERRIDE; | 81 virtual PP_Point GetMouseMovement() OVERRIDE; |
82 virtual PP_FloatPoint GetWheelDelta() OVERRIDE; | 82 virtual PP_FloatPoint GetWheelDelta() OVERRIDE; |
83 virtual PP_FloatPoint GetWheelTicks() OVERRIDE; | 83 virtual PP_FloatPoint GetWheelTicks() OVERRIDE; |
84 virtual PP_Bool GetWheelScrollByPage() OVERRIDE; | 84 virtual PP_Bool GetWheelScrollByPage() OVERRIDE; |
85 virtual uint32_t GetKeyCode() OVERRIDE; | 85 virtual uint32_t GetKeyCode() OVERRIDE; |
86 virtual PP_Var GetCharacterText() OVERRIDE; | 86 virtual PP_Var GetCharacterText() OVERRIDE; |
87 virtual uint32_t GetIMESegmentNumber() OVERRIDE; | 87 virtual uint32_t GetIMESegmentNumber() OVERRIDE; |
88 virtual uint32_t GetIMESegmentOffset(uint32_t index) OVERRIDE; | 88 virtual uint32_t GetIMESegmentOffset(uint32_t index) OVERRIDE; |
89 virtual int32_t GetIMETargetSegment() OVERRIDE; | 89 virtual int32_t GetIMETargetSegment() OVERRIDE; |
90 virtual void GetIMESelection(uint32_t* start, uint32_t* end) OVERRIDE; | 90 virtual void GetIMESelection(uint32_t* start, uint32_t* end) OVERRIDE; |
91 | 91 |
92 private: | 92 private: |
93 InputEventData data_; | 93 InputEventData data_; |
94 | 94 |
95 DISALLOW_IMPLICIT_CONSTRUCTORS(InputEventImpl); | 95 DISALLOW_IMPLICIT_CONSTRUCTORS(PPB_InputEvent_Shared); |
96 }; | 96 }; |
97 | 97 |
98 } // namespace ppapi | 98 } // namespace ppapi |
99 | 99 |
100 #endif // PPAPI_SHARED_IMPL_INPUT_EVENT_IMPL_H_ | 100 #endif // PPAPI_SHARED_IMPL_PPB_INPUT_EVENT_SHARED_H_ |
OLD | NEW |