Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / dom / base / Pose.h
blob803574e28cf8a6ff3e71592cea834d14e6a4c397
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"
11 #include "nsCOMPtr.h"
12 #include "nsWrapperCache.h"
14 namespace mozilla {
15 class ErrorResult;
17 namespace dom {
19 class Pose : public nsWrapperCache {
20 public:
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);
51 protected:
52 virtual ~Pose();
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;
64 } // namespace dom
65 } // namespace mozilla
67 #endif // mozilla_dom_Pose_h