michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsIDOMEvent.idl" michael@0: michael@0: [scriptable, builtinclass, uuid(f5921a77-3ac5-4374-bc0c-1ed52fe83123)] michael@0: interface nsIDOMDeviceOrientationEvent : nsIDOMEvent michael@0: { michael@0: void initDeviceOrientationEvent(in DOMString eventTypeArg, michael@0: in boolean canBubbleArg, michael@0: in boolean cancelableArg, michael@0: in double alpha, michael@0: in double beta, michael@0: in double gamma, michael@0: in boolean absolute); michael@0: michael@0: /* michael@0: * W3C specification values: http://dev.w3.org/geo/api/spec-source-orientation.html michael@0: * michael@0: * Alpha, beta and gamma are Tait-Bryan angles (Z-X'-Y''), that is they correspond to michael@0: * yaw, pitch and roll in flight coordinates. More specifically, assume the device michael@0: * is resting face up on a flat surface (its screen is pointing straight up). Then michael@0: * the X axis points to the right when looking at the screen, the Y axis points up michael@0: * when looking at the screen, and the Z axis points toward you when looking at michael@0: * the screen. Alpha/beta/gamma then define the device's orientation by applying michael@0: * the following rotations to the device in order: michael@0: * michael@0: * 1) Rotate it by alpha degrees around its Z axis (like a compass, or like changing michael@0: * the yaw of an aircraft, assuming the Y axis is the nose of the craft); alpha michael@0: * is in [0,360). michael@0: * 2) Rotate it by beta degrees around its X axis (tilting the top of the device michael@0: * towards or away from you, like pitching an aircraft); beta is in [-180,180). michael@0: * 3) Rotate it by gamma degrees around its Y axis (tilting it sideways, like michael@0: * rolling an aircraft); gamma is in [-90,90). michael@0: */ michael@0: michael@0: readonly attribute double alpha; michael@0: readonly attribute double beta; michael@0: readonly attribute double gamma; michael@0: readonly attribute boolean absolute; michael@0: };