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/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "ppapi/shared_impl/resource.h" | 12 #include "ppapi/shared_impl/resource.h" |
13 #include "ppapi/thunk/ppb_input_event_api.h" | 13 #include "ppapi/thunk/ppb_input_event_api.h" |
14 | 14 |
15 namespace ppapi { | 15 namespace ppapi { |
16 | 16 |
17 // IF YOU ADD STUFF TO THIS CLASS | 17 // IF YOU ADD STUFF TO THIS CLASS |
18 // ============================== | 18 // ============================== |
19 // Be sure to add it to the STRUCT_TRAITS at the top of ppapi_messages.h | 19 // Be sure to add it to the STRUCT_TRAITS at the top of ppapi_messages.h |
20 struct InputEventData { | 20 struct PPAPI_SHARED_EXPORT InputEventData { |
21 InputEventData(); | 21 InputEventData(); |
22 ~InputEventData(); | 22 ~InputEventData(); |
23 | 23 |
24 // Internal-only value. Set to true when this input event is filtered, that | 24 // Internal-only value. Set to true when this input event is filtered, that |
25 // is, should be delivered synchronously. This is used by the proxy. | 25 // is, should be delivered synchronously. This is used by the proxy. |
26 bool is_filtered; | 26 bool is_filtered; |
27 | 27 |
28 PP_InputEvent_Type event_type; | 28 PP_InputEvent_Type event_type; |
29 PP_TimeTicks event_time_stamp; | 29 PP_TimeTicks event_time_stamp; |
30 uint32_t event_modifiers; | 30 uint32_t event_modifiers; |
31 | 31 |
32 PP_InputEvent_MouseButton mouse_button; | 32 PP_InputEvent_MouseButton mouse_button; |
33 PP_Point mouse_position; | 33 PP_Point mouse_position; |
34 int32_t mouse_click_count; | 34 int32_t mouse_click_count; |
35 | 35 |
36 PP_FloatPoint wheel_delta; | 36 PP_FloatPoint wheel_delta; |
37 PP_FloatPoint wheel_ticks; | 37 PP_FloatPoint wheel_ticks; |
38 bool wheel_scroll_by_page; | 38 bool wheel_scroll_by_page; |
39 | 39 |
40 uint32_t key_code; | 40 uint32_t key_code; |
41 | 41 |
42 std::string character_text; | 42 std::string character_text; |
43 }; | 43 }; |
44 | 44 |
45 // This simple class implements the PPB_InputEvent_API in terms of the | 45 // This simple class implements the PPB_InputEvent_API in terms of the |
46 // shared InputEventData structure | 46 // shared InputEventData structure |
47 class InputEventImpl : public Resource, public thunk::PPB_InputEvent_API { | 47 class PPAPI_SHARED_EXPORT InputEventImpl |
| 48 : public Resource, |
| 49 public thunk::PPB_InputEvent_API { |
48 public: | 50 public: |
49 struct InitAsImpl {}; | 51 struct InitAsImpl {}; |
50 struct InitAsProxy {}; | 52 struct InitAsProxy {}; |
51 | 53 |
52 // The dummy arguments control which version of Resource's constructor is | 54 // The dummy arguments control which version of Resource's constructor is |
53 // called for this base class. | 55 // called for this base class. |
54 InputEventImpl(const InitAsImpl&, | 56 InputEventImpl(const InitAsImpl&, |
55 PP_Instance instance, | 57 PP_Instance instance, |
56 const InputEventData& data); | 58 const InputEventData& data); |
57 InputEventImpl(const InitAsProxy&, | 59 InputEventImpl(const InitAsProxy&, |
(...skipping 20 matching lines...) Expand all Loading... |
78 private: | 80 private: |
79 InputEventData data_; | 81 InputEventData data_; |
80 | 82 |
81 DISALLOW_IMPLICIT_CONSTRUCTORS(InputEventImpl); | 83 DISALLOW_IMPLICIT_CONSTRUCTORS(InputEventImpl); |
82 }; | 84 }; |
83 | 85 |
84 } // namespace ppapi | 86 } // namespace ppapi |
85 | 87 |
86 #endif // PPAPI_SHARED_IMPL_INPUT_EVENT_IMPL_H_ | 88 #endif // PPAPI_SHARED_IMPL_INPUT_EVENT_IMPL_H_ |
87 | 89 |
OLD | NEW |