mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Moving WebInputEvent into public/platform lets us refer to it directly in core, which will let us remove the PlatformFooEvent classes. The final pipeline will be: 1) mojo::InputEvent (IPC type, device pixels) 2) blink::WebInputEvent (platform abstraction, logical pixels) 3) blink::Event (DOM type, logical pixels) If mojo::InputEvent used logical pixels, it would probably be easier to just use mojo::InputEvent as the platform abstraction, but instead we use the mojo-to-blink conversion to translate between device and logical pixels, like we do everywhere else in Sky. R=eseidel@google.com, eseidel@chromium.org Review URL: https://codereview.chromium.org/860593003
74 lines
2.4 KiB
C++
74 lines
2.4 KiB
C++
/*
|
|
* Copyright (C) 2010 Google Inc. All rights reserved.
|
|
*
|
|
* Redistribution and use in source and binary forms, with or without
|
|
* modification, are permitted provided that the following conditions are
|
|
* met:
|
|
*
|
|
* * Redistributions of source code must retain the above copyright
|
|
* notice, this list of conditions and the following disclaimer.
|
|
* * Redistributions in binary form must reproduce the above
|
|
* copyright notice, this list of conditions and the following disclaimer
|
|
* in the documentation and/or other materials provided with the
|
|
* distribution.
|
|
* * Neither the name of Google Inc. nor the names of its
|
|
* contributors may be used to endorse or promote products derived from
|
|
* this software without specific prior written permission.
|
|
*
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
*/
|
|
|
|
#ifndef SKY_ENGINE_PUBLIC_PLATFORM_WEBTOUCHPOINT_H_
|
|
#define SKY_ENGINE_PUBLIC_PLATFORM_WEBTOUCHPOINT_H_
|
|
|
|
#include "sky/engine/public/platform/WebCommon.h"
|
|
#include "sky/engine/public/platform/WebFloatPoint.h"
|
|
|
|
namespace blink {
|
|
|
|
class WebTouchPoint {
|
|
public:
|
|
WebTouchPoint()
|
|
: id(0)
|
|
, state(StateUndefined)
|
|
, radiusX(0)
|
|
, radiusY(0)
|
|
, rotationAngle(0)
|
|
, force(0)
|
|
{
|
|
}
|
|
|
|
enum State {
|
|
StateUndefined,
|
|
StateReleased,
|
|
StatePressed,
|
|
StateMoved,
|
|
StateStationary,
|
|
StateCancelled,
|
|
};
|
|
|
|
int id;
|
|
State state;
|
|
WebFloatPoint screenPosition;
|
|
WebFloatPoint position;
|
|
|
|
float radiusX;
|
|
float radiusY;
|
|
float rotationAngle;
|
|
float force;
|
|
};
|
|
|
|
} // namespace blink
|
|
|
|
#endif // SKY_ENGINE_PUBLIC_PLATFORM_WEBTOUCHPOINT_H_
|