OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ppapi/shared_impl/input_event_impl.h" |
| 6 |
| 7 namespace ppapi { |
| 8 |
| 9 InputEventData::InputEventData() |
| 10 : is_filtered(false), |
| 11 event_type(PP_INPUTEVENT_TYPE_UNDEFINED), |
| 12 event_time_stamp(0.0), |
| 13 event_modifiers(0), |
| 14 mouse_button(PP_INPUTEVENT_MOUSEBUTTON_NONE), |
| 15 mouse_position(PP_MakePoint(0, 0)), |
| 16 mouse_click_count(0), |
| 17 wheel_delta(PP_MakeFloatPoint(0.0f, 0.0f)), |
| 18 wheel_ticks(PP_MakeFloatPoint(0.0f, 0.0f)), |
| 19 wheel_scroll_by_page(false), |
| 20 key_code(0), |
| 21 character_text() { |
| 22 } |
| 23 |
| 24 InputEventData::~InputEventData() { |
| 25 } |
| 26 |
| 27 InputEventImpl::InputEventImpl(const InputEventData& data) : data_(data) { |
| 28 } |
| 29 |
| 30 const InputEventData& InputEventImpl::GetInputEventData() const { |
| 31 return data_; |
| 32 } |
| 33 |
| 34 PP_InputEvent_Type InputEventImpl::GetEventType() { |
| 35 return data_.event_type; |
| 36 } |
| 37 |
| 38 PP_TimeTicks InputEventImpl::GetEventTimeStamp() { |
| 39 return data_.event_time_stamp; |
| 40 } |
| 41 |
| 42 uint32_t InputEventImpl::GetEventModifiers() { |
| 43 return data_.event_modifiers; |
| 44 } |
| 45 |
| 46 PP_InputEvent_MouseButton InputEventImpl::GetMouseButton() { |
| 47 return data_.mouse_button; |
| 48 } |
| 49 |
| 50 PP_Point InputEventImpl::GetMousePosition() { |
| 51 return data_.mouse_position; |
| 52 } |
| 53 |
| 54 int32_t InputEventImpl::GetMouseClickCount() { |
| 55 return data_.mouse_click_count; |
| 56 } |
| 57 |
| 58 PP_FloatPoint InputEventImpl::GetWheelDelta() { |
| 59 return data_.wheel_delta; |
| 60 } |
| 61 |
| 62 PP_FloatPoint InputEventImpl::GetWheelTicks() { |
| 63 return data_.wheel_ticks; |
| 64 } |
| 65 |
| 66 PP_Bool InputEventImpl::GetWheelScrollByPage() { |
| 67 return PP_FromBool(data_.wheel_scroll_by_page); |
| 68 } |
| 69 |
| 70 uint32_t InputEventImpl::GetKeyCode() { |
| 71 return data_.key_code; |
| 72 } |
| 73 |
| 74 PP_Var InputEventImpl::GetCharacterText() { |
| 75 return StringToPPVar(data_.character_text); |
| 76 } |
| 77 |
| 78 } // namespace ppapi |
| 79 |
OLD | NEW |