1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_Pose_h
8 #define mozilla_dom_Pose_h
10 #include "js/RootingAPI.h"
12 #include "nsWrapperCache.h"
19 class Pose
: public nsWrapperCache
{
21 explicit Pose(nsISupports
* aParent
);
23 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(Pose
)
24 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(Pose
)
26 nsISupports
* GetParentObject() const;
28 virtual void GetPosition(JSContext
* aJSContext
,
29 JS::MutableHandle
<JSObject
*> aRetval
,
30 ErrorResult
& aRv
) = 0;
31 virtual void GetLinearVelocity(JSContext
* aJSContext
,
32 JS::MutableHandle
<JSObject
*> aRetval
,
33 ErrorResult
& aRv
) = 0;
34 virtual void GetLinearAcceleration(JSContext
* aJSContext
,
35 JS::MutableHandle
<JSObject
*> aRetval
,
36 ErrorResult
& aRv
) = 0;
37 virtual void GetOrientation(JSContext
* aJSContext
,
38 JS::MutableHandle
<JSObject
*> aRetval
,
39 ErrorResult
& aRv
) = 0;
40 virtual void GetAngularVelocity(JSContext
* aJSContext
,
41 JS::MutableHandle
<JSObject
*> aRetval
,
42 ErrorResult
& aRv
) = 0;
43 virtual void GetAngularAcceleration(JSContext
* aJSContext
,
44 JS::MutableHandle
<JSObject
*> aRetval
,
45 ErrorResult
& aRv
) = 0;
46 static void SetFloat32Array(JSContext
* aJSContext
, nsWrapperCache
* creator
,
47 JS::MutableHandle
<JSObject
*> aRetVal
,
48 JS::Heap
<JSObject
*>& aObj
, float* aVal
,
49 uint32_t aValLength
, ErrorResult
& aRv
);
54 nsCOMPtr
<nsISupports
> mParent
;
56 JS::Heap
<JSObject
*> mPosition
;
57 JS::Heap
<JSObject
*> mLinearVelocity
;
58 JS::Heap
<JSObject
*> mLinearAcceleration
;
59 JS::Heap
<JSObject
*> mOrientation
;
60 JS::Heap
<JSObject
*> mAngularVelocity
;
61 JS::Heap
<JSObject
*> mAngularAcceleration
;
65 } // namespace mozilla
67 #endif // mozilla_dom_Pose_h