FreeWRL / FreeX3D 4.3.0
jsNative.h
1/*
2
3
4CProto.h - this is the object representing a PROTO definition and being
5capable of instantiating it.
6
7We keep a vector of pointers to all that pointers which point to "inner
8memory" and need therefore be updated when copying. Such pointers include
9field-destinations and parts of ROUTEs. Those pointers are then simply
10copied, their new positions put in the new vector, and afterwards are all
11pointers there updated.
12
13*/
14
15/****************************************************************************
16 This file is part of the FreeWRL/FreeX3D Distribution.
17
18 Copyright 2009 CRC Canada. (http://www.crc.gc.ca)
19
20 FreeWRL/FreeX3D is free software: you can redistribute it and/or modify
21 it under the terms of the GNU Lesser Public License as published by
22 the Free Software Foundation, either version 3 of the License, or
23 (at your option) any later version.
24
25 FreeWRL/FreeX3D is distributed in the hope that it will be useful,
26 but WITHOUT ANY WARRANTY; without even the implied warranty of
27 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 GNU General Public License for more details.
29
30 You should have received a copy of the GNU General Public License
31 along with FreeWRL/FreeX3D. If not, see <http://www.gnu.org/licenses/>.
32****************************************************************************/
33
34
35#ifndef __FREEWRL_JS_NATIVE_H__
36#define __FREEWRL_JS_NATIVE_H__
37
38
39typedef struct _BrowserNative {
40 /* int magic; does this really do anything ??? */
41 /* and, this really does nothing SV *sv_js; */
42 int dummyEntry;
44
45typedef struct _AnyNative {
46 int type;
47 int gc;
48 int *valueChanged;
49 union anyVrml *v;
50} AnyNative;
51
52typedef struct _SFNodeNative {
53 int valueChanged;
54 struct X3D_Node *handle;
55 char *X3DString;
56 int fieldsExpanded;
58
59typedef struct _SFRotationNative {
60 int valueChanged;
61 struct SFRotation v;
63
64typedef struct _SFVec2fNative {
65 int valueChanged;
66 struct SFVec2f v;
68
69typedef struct _SFVec3fNative {
70 int valueChanged;
71 struct SFColor v;
73
74typedef struct _SFVec3dNative {
75 int valueChanged;
76 struct SFVec3d v;
78
79typedef struct _SFImageNative {
80 int valueChanged;
82
83typedef struct _SFColorNative {
84 int valueChanged;
85 struct SFColor v;
87
88typedef struct _SFColorRGBANative {
89 int valueChanged;
90 struct SFColorRGBA v;
92
93typedef struct _SFVec4fNative {
94 int valueChanged;
95 struct SFVec4f v;
97
98typedef struct _SFVec4dNative {
99 int valueChanged;
100 struct SFVec4d v;
102
103/*
104 * Adds additional (touchable) property to instance of a native
105 * type.
106 */
107extern JSBool
108addGlobalECMANativeProperty(void *cx,
109 void *glob,
110 char *name);
111
112extern JSBool
113addGlobalAssignProperty(void *cx,
114 void *glob,
115 char *name,
116 char *str);
117
118extern JSBool
119addSFNodeProperty(void *cx,
120 void *glob,
121 char *nodeName,
122 char *name,
123 char *str);
124
125extern void *AnyNativeNew(int type, union anyVrml* source, int *valueChanged);
126extern void AnyNativeAssign(void *top, void *fromp);
127
128extern void *
129SFNodeNativeNew(void);
130
131extern JSBool
132SFNodeNativeAssign(void *top, void *fromp);
133
134extern void *
135SFRotationNativeNew(void);
136
137extern void
138SFRotationNativeAssign(void *top, void *fromp);
139
140extern void
141SFRotationNativeSet(void *p, struct Uni_String *sv);
142
143extern void *
144SFVec3fNativeNew(void);
145
146extern void
147SFVec3fNativeAssign(void *top, void *fromp);
148
149extern void
150SFVec3fNativeSet(void *p, struct Uni_String *sv);
151
152extern void *
153SFVec2fNativeNew(void);
154
155extern void
156SFVec2fNativeAssign(void *top, void *fromp);
157
158extern void
159SFVec2fNativeSet(void *p, struct Uni_String *sv);
160
161extern void *
162SFImageNativeNew(void);
163
164extern void
165SFImageNativeAssign(void *top, void *fromp);
166
167extern void
168SFImageNativeSet(void *p, struct Uni_String *sv);
169
170extern void *
171SFColorNativeNew(void);
172
173extern void
174SFColorNativeAssign(void *top, void *fromp);
175
176extern void
177SFColorNativeSet(void *p, struct Uni_String *sv);
178
179void * SFNodeNativeNew(void);
180int SFNodeNativeAssign(void *top, void *fromp);
181int SFNodeNativeEquals(void *top, void *fromp);
182void * SFColorRGBANativeNew(void);
183void SFColorRGBANativeAssign(void *top, void *fromp);
184void * SFColorNativeNew(void);
185void SFColorNativeAssign(void *top, void *fromp);
186void * SFImageNativeNew(void);
187void SFImageNativeAssign(void *top, void *fromp);
188void * SFRotationNativeNew(void);
189void SFRotationNativeAssign(void *top, void *fromp);
190void * SFVec2fNativeNew(void);
191void SFVec2fNativeAssign(void *top, void *fromp);
192void * SFVec3fNativeNew(void);
193void SFVec3fNativeAssign(void *top, void *fromp);
194void * SFVec3dNativeNew(void);
195void SFVec3dNativeAssign(void *top, void *fromp);
196void * SFVec4fNativeNew(void);
197void SFVec4fNativeAssign(void *top, void *fromp);
198void * SFVec4dNativeNew(void);
199void SFVec4dNativeAssign(void *top, void *fromp);
200
201#endif /* __FREEWRL_JS_NATIVE_H__ */