OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2011 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can |
| 4 * be found in the LICENSE file. |
| 5 */ |
| 6 |
| 7 #ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_INPUT_EVENT_DATA_H_ |
| 8 #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_INPUT_EVENT_DATA_H_ |
| 9 |
| 10 #include "native_client/src/include/nacl_macros.h" |
| 11 #include "native_client/src/third_party/ppapi/c/pp_instance.h" |
| 12 #include "native_client/src/third_party/ppapi/c/pp_macros.h" |
| 13 #include "native_client/src/third_party/ppapi/c/pp_rect.h" |
| 14 #include "native_client/src/third_party/ppapi/c/ppb_input_event.h" |
| 15 |
| 16 namespace ppapi_proxy { |
| 17 |
| 18 // The data for a single input event. |
| 19 struct InputEventData { |
| 20 InputEventData(); |
| 21 ~InputEventData(); |
| 22 |
| 23 PP_InputEvent_Type event_type; |
| 24 uint32_t event_modifiers; |
| 25 PP_TimeTicks event_time_stamp; |
| 26 |
| 27 PP_InputEvent_MouseButton mouse_button; |
| 28 int32_t mouse_click_count; |
| 29 PP_Point mouse_position; |
| 30 |
| 31 PP_FloatPoint wheel_delta; |
| 32 PP_FloatPoint wheel_ticks; |
| 33 bool wheel_scroll_by_page; |
| 34 |
| 35 uint32_t key_code; |
| 36 }; |
| 37 // Make sure that the size is consistent across platforms, so the alignment is |
| 38 // consistent. Note the fields above are carefully ordered to make sure it is |
| 39 // consistent. New fields may require some adjustment to keep a consistent size |
| 40 // and alignment. TODO(dmichael): This is only required because we don't pickle |
| 41 // the type. As a short-cut, we memcpy it instead. It would be cleaner to |
| 42 // pickle this struct. |
| 43 PP_COMPILE_ASSERT_SIZE_IN_BYTES(InputEventData, 56); |
| 44 |
| 45 } // namespace ppapi_proxy |
| 46 |
| 47 #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_INPUT_EVENT_DATA_H_ |
OLD | NEW |