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

Unified 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, 6 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/shared_impl/input_event_impl.cc
===================================================================
--- ppapi/shared_impl/input_event_impl.cc (revision 0)
+++ ppapi/shared_impl/input_event_impl.cc (revision 0)
@@ -0,0 +1,79 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/shared_impl/input_event_impl.h"
+
+namespace ppapi {
+
+InputEventData::InputEventData()
+ : is_filtered(false),
+ event_type(PP_INPUTEVENT_TYPE_UNDEFINED),
+ event_time_stamp(0.0),
+ event_modifiers(0),
+ mouse_button(PP_INPUTEVENT_MOUSEBUTTON_NONE),
+ mouse_position(PP_MakePoint(0, 0)),
dmichael (off chromium) 2011/07/01 20:04:19 PP_MakeFloatPoint?
+ mouse_click_count(0),
+ wheel_delta(PP_MakeFloatPoint(0.0f, 0.0f)),
+ wheel_ticks(PP_MakeFloatPoint(0.0f, 0.0f)),
+ wheel_scroll_by_page(false),
+ key_code(0),
+ character_text() {
+}
+
+InputEventData::~InputEventData() {
+}
+
+InputEventImpl::InputEventImpl(const InputEventData& data) : data_(data) {
+}
+
+const InputEventData& InputEventImpl::GetInputEventData() const {
+ return data_;
+}
+
+PP_InputEvent_Type InputEventImpl::GetEventType() {
+ return data_.event_type;
+}
+
+PP_TimeTicks InputEventImpl::GetEventTimeStamp() {
+ return data_.event_time_stamp;
+}
+
+uint32_t InputEventImpl::GetEventModifiers() {
+ return data_.event_modifiers;
+}
+
+PP_InputEvent_MouseButton InputEventImpl::GetMouseButton() {
+ return data_.mouse_button;
+}
+
+PP_Point InputEventImpl::GetMousePosition() {
dmichael (off chromium) 2011/07/01 20:04:19 I think you want PP_FloatPoint here
+ return data_.mouse_position;
+}
+
+int32_t InputEventImpl::GetMouseClickCount() {
+ return data_.mouse_click_count;
+}
+
+PP_FloatPoint InputEventImpl::GetWheelDelta() {
+ return data_.wheel_delta;
+}
+
+PP_FloatPoint InputEventImpl::GetWheelTicks() {
+ return data_.wheel_ticks;
+}
+
+PP_Bool InputEventImpl::GetWheelScrollByPage() {
+ return PP_FromBool(data_.wheel_scroll_by_page);
+}
+
+uint32_t InputEventImpl::GetKeyCode() {
+ return data_.key_code;
+}
+
+PP_Var InputEventImpl::GetCharacterText() {
+ return StringToPPVar(data_.character_text);
+}
+
+} // namespace ppapi
+
Property changes on: ppapi/shared_impl/input_event_impl.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698