WebPlatformTouchPointIOS.cpp [plain text]
#include "config.h"
#include "WebEvent.h"
#if ENABLE(TOUCH_EVENTS)
#include "WebCoreArgumentCoders.h"
using namespace WebCore;
namespace WebKit {
void WebPlatformTouchPoint::encode(IPC::Encoder& encoder) const
{
encoder << m_identifier;
encoder << m_location;
encoder << m_phase;
#if ENABLE(IOS_TOUCH_EVENTS)
encoder << m_radiusX;
encoder << m_radiusY;
encoder << m_rotationAngle;
encoder << m_force;
encoder << m_altitudeAngle;
encoder << m_azimuthAngle;
encoder << m_touchType;
#endif
}
std::optional<WebPlatformTouchPoint> WebPlatformTouchPoint::decode(IPC::Decoder& decoder)
{
WebPlatformTouchPoint result;
if (!decoder.decode(result.m_identifier))
return std::nullopt;
if (!decoder.decode(result.m_location))
return std::nullopt;
if (!decoder.decode(result.m_phase))
return std::nullopt;
#if ENABLE(IOS_TOUCH_EVENTS)
if (!decoder.decode(result.m_radiusX))
return std::nullopt;
if (!decoder.decode(result.m_radiusY))
return std::nullopt;
if (!decoder.decode(result.m_rotationAngle))
return std::nullopt;
if (!decoder.decode(result.m_force))
return std::nullopt;
if (!decoder.decode(result.m_altitudeAngle))
return std::nullopt;
if (!decoder.decode(result.m_azimuthAngle))
return std::nullopt;
if (!decoder.decode(result.m_touchType))
return std::nullopt;
#endif
return WTFMove(result);
}
}
#endif // ENABLE(TOUCH_EVENTS)