Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JSInterface_Vector3D.h
Go to the documentation of this file.
1 /* Copyright (C) 2013 Wildfire Games.
2  * This file is part of 0 A.D.
3  *
4  * 0 A.D. is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * 0 A.D. is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 // JSInterface_Entity.h
19 //
20 //
21 // A JavaScript class representing a Pyrogenesis CVector3D object.
22 //
23 // Usage: Used when manipulating objects of class 'Vector3D' in JavaScript.
24 
26 #include "maths/Vector3D.h"
27 
28 #ifndef INCLUDED_JSI_VECTOR3
29 #define INCLUDED_JSI_VECTOR3
30 
31 namespace JSI_Vector3D
32 {
33  enum
34  {
38  };
39  JSBool toString(JSContext* cx, uintN argc, jsval* vp);
40 
42  {
44  public:
45 
50  Vector3D_Info();
51  Vector3D_Info(float x, float y, float z);
52  Vector3D_Info(const CVector3D& copy);
53  Vector3D_Info(CVector3D* attach, IPropertyOwner* _owner);
54  Vector3D_Info(CVector3D* attach, IPropertyOwner* _owner, void(IPropertyOwner::*_updateFn)(void));
55  Vector3D_Info(CVector3D* attach, IPropertyOwner* _owner, void(IPropertyOwner::*_updateFn)(void), void(IPropertyOwner::*_freshenFn)(void));
57  };
58  extern JSClass JSI_class;
59  extern JSPropertySpec JSI_props[];
60  extern JSFunctionSpec JSI_methods[];
61 
62  JSBool getProperty(JSContext* cx, JSObject* obj, jsid id, jsval* vp);
63  JSBool setProperty(JSContext* cx, JSObject* obj, jsid id, JSBool strict, jsval* vp);
64  void finalize(JSContext* cx, JSObject* obj);
65  JSBool construct(JSContext* cx, uintN argc, jsval* vp);
66  void init();
67 }
68 
69 #endif
JSFunctionSpec JSI_methods[]
void finalize(JSContext *cx, JSObject *obj)
JSPropertySpec JSI_props[]
void(IPropertyOwner::* updateFn)()
JSBool setProperty(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)
JSBool construct(JSContext *cx, uintN argc, jsval *vp)
JSBool getProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
void(IPropertyOwner::* freshenFn)()
JSBool toString(JSContext *cx, uintN argc, jsval *vp)