This source file includes following definitions.
- m_orientation
- initDeviceOrientationEvent
- alpha
- beta
- gamma
- absolute
- interfaceName
- trace
#include "config.h"
#include "modules/device_orientation/DeviceOrientationEvent.h"
#include "modules/device_orientation/DeviceOrientationData.h"
namespace WebCore {
DeviceOrientationEvent::~DeviceOrientationEvent()
{
}
DeviceOrientationEvent::DeviceOrientationEvent()
: m_orientation(DeviceOrientationData::create())
{
ScriptWrappable::init(this);
}
DeviceOrientationEvent::DeviceOrientationEvent(const AtomicString& eventType, DeviceOrientationData* orientation)
: Event(eventType, false, false)
, m_orientation(orientation)
{
ScriptWrappable::init(this);
}
void DeviceOrientationEvent::initDeviceOrientationEvent(const AtomicString& type, bool bubbles, bool cancelable, DeviceOrientationData* orientation)
{
if (dispatched())
return;
initEvent(type, bubbles, cancelable);
m_orientation = orientation;
}
double DeviceOrientationEvent::alpha(bool& isNull) const
{
if (m_orientation->canProvideAlpha())
return m_orientation->alpha();
isNull = true;
return 0;
}
double DeviceOrientationEvent::beta(bool& isNull) const
{
if (m_orientation->canProvideBeta())
return m_orientation->beta();
isNull = true;
return 0;
}
double DeviceOrientationEvent::gamma(bool& isNull) const
{
if (m_orientation->canProvideGamma())
return m_orientation->gamma();
isNull = true;
return 0;
}
bool DeviceOrientationEvent::absolute(bool& isNull) const
{
if (m_orientation->canProvideAbsolute())
return m_orientation->absolute();
isNull = true;
return 0;
}
const AtomicString& DeviceOrientationEvent::interfaceName() const
{
return EventNames::DeviceOrientationEvent;
}
void DeviceOrientationEvent::trace(Visitor* visitor)
{
visitor->trace(m_orientation);
Event::trace(visitor);
}
}