| OLD | NEW |
| 1 // Copyright (c) 2011 The Native Client Authors. All rights reserved. | 1 // Copyright (c) 2011 The Native Client Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can | 2 // Use of this source code is governed by a BSD-style license that can |
| 3 // be found in the LICENSE file. | 3 // be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_INPUT_EVENT_H_ | 5 #ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_INPUT_EVENT_H_ |
| 6 #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_INPUT_EVENT_H_ | 6 #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_INPUT_EVENT_H_ |
| 7 | 7 |
| 8 #include "native_client/src/include/nacl_macros.h" | 8 #include "native_client/src/include/nacl_macros.h" |
| 9 #include "native_client/src/shared/ppapi_proxy/input_event_data.h" | 9 #include "native_client/src/shared/ppapi_proxy/input_event_data.h" |
| 10 #include "native_client/src/shared/ppapi_proxy/plugin_resource.h" | 10 #include "native_client/src/shared/ppapi_proxy/plugin_resource.h" |
| 11 #include "ppapi/c/dev/ppb_input_event_dev.h" |
| 11 #include "ppapi/c/ppb_input_event.h" | 12 #include "ppapi/c/ppb_input_event.h" |
| 12 | 13 |
| 13 namespace ppapi_proxy { | 14 namespace ppapi_proxy { |
| 14 | 15 |
| 15 // Implements the untrusted side of the PPB_InputEvent interface. | 16 // Implements the untrusted side of the PPB_InputEvent interface. |
| 16 class PluginInputEvent : public PluginResource { | 17 class PluginInputEvent : public PluginResource { |
| 17 public: | 18 public: |
| 18 PluginInputEvent(); | 19 PluginInputEvent(); |
| 19 // Init the PluginInputEvent resource with the given data. Assumes | 20 // Init the PluginInputEvent resource with the given data. Assumes |
| 20 // character_text has been AddRefed if it's a string, and takes ownership. | 21 // character_text has been AddRefed if it's a string, and takes ownership. |
| 21 void Init(const InputEventData& input_event_data, PP_Var character_text); | 22 void Init(const InputEventData& input_event_data, PP_Var character_text); |
| 22 virtual ~PluginInputEvent(); | 23 virtual ~PluginInputEvent(); |
| 23 | 24 |
| 24 // PluginResource implementation. | 25 // PluginResource implementation. |
| 25 virtual bool InitFromBrowserResource(PP_Resource /*resource*/) { | 26 virtual bool InitFromBrowserResource(PP_Resource /*resource*/) { |
| 26 return true; | 27 return true; |
| 27 } | 28 } |
| 28 | 29 |
| 29 static const PPB_InputEvent* GetInterface(); | 30 static const PPB_InputEvent* GetInterface(); |
| 30 static const PPB_MouseInputEvent_1_0* GetMouseInterface1_0(); | 31 static const PPB_MouseInputEvent* GetMouseInterface(); |
| 31 static const PPB_MouseInputEvent* GetMouseInterface1_1(); | 32 static const PPB_MouseInputEvent_Dev* GetMouseDevInterface(); |
| 32 static const PPB_WheelInputEvent* GetWheelInterface(); | 33 static const PPB_WheelInputEvent* GetWheelInterface(); |
| 33 static const PPB_KeyboardInputEvent* GetKeyboardInterface(); | 34 static const PPB_KeyboardInputEvent* GetKeyboardInterface(); |
| 34 | 35 |
| 35 PP_InputEvent_Type GetType() const; | 36 PP_InputEvent_Type GetType() const; |
| 36 PP_TimeTicks GetTimeStamp() const; | 37 PP_TimeTicks GetTimeStamp() const; |
| 37 uint32_t GetModifiers() const; | 38 uint32_t GetModifiers() const; |
| 38 | 39 |
| 39 PP_InputEvent_MouseButton GetMouseButton() const; | 40 PP_InputEvent_MouseButton GetMouseButton() const; |
| 40 PP_Point GetMousePosition() const; | 41 PP_Point GetMousePosition() const; |
| 41 int32_t GetMouseClickCount() const; | 42 int32_t GetMouseClickCount() const; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 52 IMPLEMENT_RESOURCE(PluginInputEvent); | 53 IMPLEMENT_RESOURCE(PluginInputEvent); |
| 53 NACL_DISALLOW_COPY_AND_ASSIGN(PluginInputEvent); | 54 NACL_DISALLOW_COPY_AND_ASSIGN(PluginInputEvent); |
| 54 | 55 |
| 55 InputEventData input_event_data_; | 56 InputEventData input_event_data_; |
| 56 PP_Var character_text_; // Undefined if this is not a character event. | 57 PP_Var character_text_; // Undefined if this is not a character event. |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 } // namespace ppapi_proxy | 60 } // namespace ppapi_proxy |
| 60 | 61 |
| 61 #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_INPUT_EVENT_H_ | 62 #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_INPUT_EVENT_H_ |
| OLD | NEW |