summaryrefslogtreecommitdiffstats
path: root/ppapi/cpp/input_event.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-20 22:04:32 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-20 22:04:32 +0000
commitd912c698831fee8a5dd35ec603c2127663f593ed (patch)
tree2652decd8a67ee8dfe1b409006665ad21cdd0919 /ppapi/cpp/input_event.cc
parent45cce16952513f09dc045533d16e0135094fc3e3 (diff)
downloadchromium_src-d912c698831fee8a5dd35ec603c2127663f593ed.zip
chromium_src-d912c698831fee8a5dd35ec603c2127663f593ed.tar.gz
chromium_src-d912c698831fee8a5dd35ec603c2127663f593ed.tar.bz2
Convert input event to interface version 1.0. Rename some of the mouse and
wheel events to remove the redundant "Mouse" and "Wheel" in the getters. Rename PP_INPUTEVENT_TYPE_MOUSEWHEEL to .._WHEEL so that it doesn't look like a mouse event (it's its own type). Add documentation to the C++ wrapper from the C wrappers. Do some minor documentation updates. Update IDL for some of the recent changes we've made. Update the way points are passed for resource creation since IDL wanted to do it by pointer. TEST=it compiles. Review URL: http://codereview.chromium.org/7464003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93263 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/cpp/input_event.cc')
-rw-r--r--ppapi/cpp/input_event.cc28
1 files changed, 14 insertions, 14 deletions
diff --git a/ppapi/cpp/input_event.cc b/ppapi/cpp/input_event.cc
index d983603..fbf8ac7 100644
--- a/ppapi/cpp/input_event.cc
+++ b/ppapi/cpp/input_event.cc
@@ -96,26 +96,25 @@ MouseInputEvent::MouseInputEvent(Instance* instance,
return;
PassRefFromConstructor(get_interface<PPB_MouseInputEvent>()->Create(
instance->pp_instance(), type, time_stamp, modifiers, mouse_button,
- mouse_position, click_count));
+ &mouse_position.pp_point(), click_count));
}
-PP_InputEvent_MouseButton MouseInputEvent::GetMouseButton() const {
+PP_InputEvent_MouseButton MouseInputEvent::GetButton() const {
if (!has_interface<PPB_MouseInputEvent>())
return PP_INPUTEVENT_MOUSEBUTTON_NONE;
- return get_interface<PPB_MouseInputEvent>()->GetMouseButton(pp_resource());
+ return get_interface<PPB_MouseInputEvent>()->GetButton(pp_resource());
}
-Point MouseInputEvent::GetMousePosition() const {
+Point MouseInputEvent::GetPosition() const {
if (!has_interface<PPB_MouseInputEvent>())
return Point();
- return get_interface<PPB_MouseInputEvent>()->GetMousePosition(pp_resource());
+ return get_interface<PPB_MouseInputEvent>()->GetPosition(pp_resource());
}
-int32_t MouseInputEvent::GetMouseClickCount() const {
+int32_t MouseInputEvent::GetClickCount() const {
if (!has_interface<PPB_MouseInputEvent>())
return 0;
- return get_interface<PPB_MouseInputEvent>()->GetMouseClickCount(
- pp_resource());
+ return get_interface<PPB_MouseInputEvent>()->GetClickCount(pp_resource());
}
// WheelInputEvent -------------------------------------------------------------
@@ -144,20 +143,21 @@ WheelInputEvent::WheelInputEvent(Instance* instance,
if (!has_interface<PPB_WheelInputEvent>())
return;
PassRefFromConstructor(get_interface<PPB_WheelInputEvent>()->Create(
- instance->pp_instance(), time_stamp, modifiers, wheel_delta,
- wheel_ticks, PP_FromBool(scroll_by_page)));
+ instance->pp_instance(), time_stamp, modifiers,
+ &wheel_delta.pp_float_point(), &wheel_ticks.pp_float_point(),
+ PP_FromBool(scroll_by_page)));
}
-FloatPoint WheelInputEvent::GetWheelDelta() const {
+FloatPoint WheelInputEvent::GetDelta() const {
if (!has_interface<PPB_WheelInputEvent>())
return FloatPoint();
- return get_interface<PPB_WheelInputEvent>()->GetWheelDelta(pp_resource());
+ return get_interface<PPB_WheelInputEvent>()->GetDelta(pp_resource());
}
-FloatPoint WheelInputEvent::GetWheelTicks() const {
+FloatPoint WheelInputEvent::GetTicks() const {
if (!has_interface<PPB_WheelInputEvent>())
return FloatPoint();
- return get_interface<PPB_WheelInputEvent>()->GetWheelTicks(pp_resource());
+ return get_interface<PPB_WheelInputEvent>()->GetTicks(pp_resource());
}
bool WheelInputEvent::GetScrollByPage() const {