Line data Source code
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/. */
6 :
7 : #ifndef mozilla_dom_Pose_h
8 : #define mozilla_dom_Pose_h
9 :
10 : #include "nsWrapperCache.h"
11 :
12 : namespace mozilla {
13 : namespace dom {
14 :
15 : class Pose : public nsWrapperCache
16 : {
17 : public:
18 : explicit Pose(nsISupports* aParent);
19 :
20 0 : NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(Pose)
21 0 : NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(Pose)
22 :
23 : nsISupports* GetParentObject() const;
24 :
25 : virtual void GetPosition(JSContext* aJSContext,
26 : JS::MutableHandle<JSObject*> aRetval,
27 : ErrorResult& aRv) = 0;
28 : virtual void GetLinearVelocity(JSContext* aJSContext,
29 : JS::MutableHandle<JSObject*> aRetval,
30 : ErrorResult& aRv) = 0;
31 : virtual void GetLinearAcceleration(JSContext* aJSContext,
32 : JS::MutableHandle<JSObject*> aRetval,
33 : ErrorResult& aRv) = 0;
34 : virtual void GetOrientation(JSContext* aJSContext,
35 : JS::MutableHandle<JSObject*> aRetval,
36 : ErrorResult& aRv) = 0;
37 : virtual void GetAngularVelocity(JSContext* aJSContext,
38 : JS::MutableHandle<JSObject*> aRetval,
39 : ErrorResult& aRv) = 0;
40 : virtual void GetAngularAcceleration(JSContext* aJSContext,
41 : JS::MutableHandle<JSObject*> aRetval,
42 : ErrorResult& aRv) = 0;
43 :
44 : protected:
45 : virtual ~Pose();
46 :
47 : void SetFloat32Array(JSContext* aJSContext, JS::MutableHandle<JSObject*> aRetVal,
48 : JS::Heap<JSObject*>& aObj, float* aVal, uint32_t sizeOfVal,
49 : bool bCreate, ErrorResult& aRv);
50 :
51 : nsCOMPtr<nsISupports> mParent;
52 :
53 : JS::Heap<JSObject*> mPosition;
54 : JS::Heap<JSObject*> mLinearVelocity;
55 : JS::Heap<JSObject*> mLinearAcceleration;
56 : JS::Heap<JSObject*> mOrientation;
57 : JS::Heap<JSObject*> mAngularVelocity;
58 : JS::Heap<JSObject*> mAngularAcceleration;
59 : };
60 :
61 : } // namespace dom
62 : } // namespace mozilla
63 :
64 : #endif // mozilla_dom_Pose_h
|