Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: ppapi/shared_impl/input_event_impl.cc

Issue 7285010: Implement an input event resource. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(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)),
dmichael (off chromium) 2011/07/01 20:04:19 PP_MakeFloatPoint?
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() {
dmichael (off chromium) 2011/07/01 20:04:19 I think you want PP_FloatPoint here
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698