50 #ifndef __SPIDERMONKEYTYPES_H__
51 #define __SPIDERMONKEYTYPES_H__
91 #ifdef HAVE_SPIDERMONKEY
103 namespace SpiderMonkey {
121 int array_index = -1, X3DTypes::X3DType x3dt = X3DTypes::UNKNOWN_X3D_TYPE );
128 JSBool
haveFunction( JSContext* cx, JSObject *obj,
const char * name );
131 template<
class Po
interType >
141 bool _internal_pointer,
142 int _array_index = -1
145 internal_pointer( _internal_pointer ),
146 array_index( _array_index ),
153 if( ptr && internal_pointer ) {
181 bool internal_pointer;
186 typedef PointerPrivateData< Field > FieldObjectPrivate;
187 typedef PointerPrivateData< SAI::ExecutionContext > ExecutionContextPrivate;
188 typedef PointerPrivateData< SAI::Browser > BrowserPrivate;
192 template<
class Po
interType >
194 PointerType *private_data =
195 static_cast<PointerType *
>(JS_GetPrivate(cx,obj));
204 JSBool FieldObject_toString(JSContext *cx, JSObject *obj,
205 uintN argc, jsval *argv,
209 template<
class FieldType>
210 JSBool FieldObject_toString2(JSContext *cx, JSObject *obj,
211 uintN argc, jsval *argv, jsval *rval);
219 SFVEC2F_X, SFVEC2F_Y, SFVEC2F_Z
222 JSBool SFVec2f_toString(JSContext *cx, JSObject *obj,
223 uintN argc, jsval *argv,
234 JSObject *SFVec2f_newInstance( JSContext *cx,
Field *field,
bool internal_field,
int array_index = -1 );
238 JSBool SFVec2f_setProperty(JSContext *cx,
245 JSBool SFVec2f_getProperty(JSContext *cx, JSObject *obj, jsval
id, jsval *vp);
249 JSBool SFVec2f_construct(JSContext *cx, JSObject *obj,
250 uintN argc, jsval *argv,
254 JSBool SFVec2f_add(JSContext *cx, JSObject *obj,
255 uintN argc, jsval *argv,
257 JSBool SFVec2f_divide(JSContext *cx, JSObject *obj,
258 uintN argc, jsval *argv,
260 JSBool SFVec2f_dot(JSContext *cx, JSObject *obj,
261 uintN argc, jsval *argv,
263 JSBool SFVec2f_length(JSContext *cx, JSObject *obj,
264 uintN argc, jsval *argv,
266 JSBool SFVec2f_multiple(JSContext *cx, JSObject *obj,
267 uintN argc, jsval *argv,
269 JSBool SFVec2f_negate(JSContext *cx, JSObject *obj,
270 uintN argc, jsval *argv,
272 JSBool SFVec2f_normalize(JSContext *cx, JSObject *obj,
273 uintN argc, jsval *argv,
275 JSBool SFVec2f_subtract(JSContext *cx, JSObject *obj,
276 uintN argc, jsval *argv,
280 static JSPropertySpec SFVec2f_properties[] = {
281 {
"x", SFVEC2F_X, JSPROP_PERMANENT},
282 {
"y", SFVEC2F_Y, JSPROP_PERMANENT},
286 static JSFunctionSpec SFVec2f_functions[] = {
287 {
"add", SFVec2f_add, 1, 0, 0 },
288 {
"divide", SFVec2f_divide, 1, 0, 0 },
289 {
"dot", SFVec2f_dot, 1, 0, 0 },
290 {
"length", SFVec2f_length, 0, 0, 0 },
291 {
"multiple", SFVec2f_multiple, 1, 0, 0 },
292 {
"negate", SFVec2f_negate, 0, 0, 0 },
293 {
"normalize", SFVec2f_normalize, 0, 0, 0 },
294 {
"subtract", SFVec2f_subtract, 1, 0, 0 },
295 {
"toString", SFVec2f_toString, 0, 0, 0 },
300 static JSClass SFVec2fClass = {
308 SpiderMonkey::SFVec2f_getProperty,
309 SpiderMonkey::SFVec2f_setProperty,
313 PrivatePointer_finalize<FieldObjectPrivate>,
329 SFVEC2D_X, SFVEC2D_Y, SFVEC2D_Z
332 JSBool SFVec2d_toString(JSContext *cx, JSObject *obj,
333 uintN argc, jsval *argv,
344 JSObject *SFVec2d_newInstance( JSContext *cx,
Field *field,
bool internal_field,
int array_index = -1 );
348 JSBool SFVec2d_setProperty(JSContext *cx, JSObject *obj, jsval
id, jsval *vp);
352 JSBool SFVec2d_getProperty(JSContext *cx, JSObject *obj, jsval
id, jsval *vp);
356 JSBool SFVec2d_construct(JSContext *cx, JSObject *obj,
357 uintN argc, jsval *argv,
361 JSBool SFVec2d_add(JSContext *cx, JSObject *obj,
362 uintN argc, jsval *argv,
364 JSBool SFVec2d_divide(JSContext *cx, JSObject *obj,
365 uintN argc, jsval *argv,
367 JSBool SFVec2d_dot(JSContext *cx, JSObject *obj,
368 uintN argc, jsval *argv,
370 JSBool SFVec2d_length(JSContext *cx, JSObject *obj,
371 uintN argc, jsval *argv,
373 JSBool SFVec2d_multiple(JSContext *cx, JSObject *obj,
374 uintN argc, jsval *argv,
376 JSBool SFVec2d_negate(JSContext *cx, JSObject *obj,
377 uintN argc, jsval *argv,
379 JSBool SFVec2d_normalize(JSContext *cx, JSObject *obj,
380 uintN argc, jsval *argv,
382 JSBool SFVec2d_subtract(JSContext *cx, JSObject *obj,
383 uintN argc, jsval *argv,
387 static JSPropertySpec SFVec2d_properties[] = {
388 {
"x", SFVEC2D_X, JSPROP_PERMANENT},
389 {
"y", SFVEC2D_Y, JSPROP_PERMANENT},
393 static JSFunctionSpec SFVec2d_functions[] = {
394 {
"add", SFVec2d_add, 1, 0, 0 },
395 {
"divide", SFVec2d_divide, 1, 0, 0 },
396 {
"dot", SFVec2d_dot, 1, 0, 0 },
397 {
"length", SFVec2d_length, 0, 0, 0 },
398 {
"multiple", SFVec2d_multiple, 1, 0, 0 },
399 {
"negate", SFVec2d_negate, 0, 0, 0 },
400 {
"normalize", SFVec2d_normalize, 0, 0, 0 },
401 {
"subtract", SFVec2d_subtract, 1, 0, 0 },
402 {
"toString", SFVec2d_toString, 0, 0, 0 },
407 static JSClass SFVec2dClass = {
415 SpiderMonkey::SFVec2d_getProperty,
416 SpiderMonkey::SFVec2d_setProperty,
420 PrivatePointer_finalize<FieldObjectPrivate>,
440 enum SFImagePropertyId {
441 SFImage_WIDTH, SFImage_HEIGHT, SFImage_COMP, SFImage_ARRAY,
444 JSBool SFImage_toString(JSContext *cx, JSObject *obj,
445 uintN argc, jsval *argv, jsval *rval);
455 JSObject *SFImage_newInstance( JSContext *cx,
Field *field,
bool internal_field,
int array_index = -1 );
459 JSBool SFImage_setProperty(JSContext *cx, JSObject *obj,
460 jsval
id, jsval *vp);
464 JSBool SFImage_getProperty(JSContext *cx, JSObject *obj,
465 jsval
id, jsval *vp);
469 JSBool SFImage_construct(JSContext *cx, JSObject *obj,
470 uintN argc, jsval *argv,
473 JSBool SFImage_toString(JSContext *cx, JSObject *obj,
474 uintN argc, jsval *argv,
479 static JSPropertySpec SFImage_properties[] = {
480 {
"width", SFImage_WIDTH, JSPROP_PERMANENT},
481 {
"height", SFImage_HEIGHT, JSPROP_PERMANENT},
482 {
"comp", SFImage_COMP, JSPROP_PERMANENT},
483 {
"array", SFImage_ARRAY, JSPROP_PERMANENT},
487 static JSFunctionSpec SFImage_functions[] = {
488 {
"toString", SFImage_toString, 0, 0, 0 },
493 static JSClass SFImageClass = {
501 SpiderMonkey::SFImage_getProperty,
502 SpiderMonkey::SFImage_setProperty,
506 PrivatePointer_finalize<FieldObjectPrivate>,
523 SFVEC3F_X, SFVEC3F_Y, SFVEC3F_Z
526 JSBool SFVec3f_toString(JSContext *cx, JSObject *obj,
527 uintN argc, jsval *argv,
538 JSObject *SFVec3f_newInstance( JSContext *cx,
Field *field,
bool internal_field,
int array_index = -1 );
542 JSBool SFVec3f_setProperty(JSContext *cx,
549 JSBool SFVec3f_getProperty(JSContext *cx,
556 JSBool SFVec3f_construct(JSContext *cx, JSObject *obj,
557 uintN argc, jsval *argv,
561 JSBool SFVec3f_add(JSContext *cx, JSObject *obj,
562 uintN argc, jsval *argv,
564 JSBool SFVec3f_cross(JSContext *cx, JSObject *obj,
565 uintN argc, jsval *argv,
567 JSBool SFVec3f_divide(JSContext *cx, JSObject *obj,
568 uintN argc, jsval *argv,
570 JSBool SFVec3f_dot(JSContext *cx, JSObject *obj,
571 uintN argc, jsval *argv,
573 JSBool SFVec3f_length(JSContext *cx, JSObject *obj,
574 uintN argc, jsval *argv,
576 JSBool SFVec3f_multiple(JSContext *cx, JSObject *obj,
577 uintN argc, jsval *argv,
579 JSBool SFVec3f_negate(JSContext *cx, JSObject *obj,
580 uintN argc, jsval *argv,
582 JSBool SFVec3f_normalize(JSContext *cx, JSObject *obj,
583 uintN argc, jsval *argv,
585 JSBool SFVec3f_subtract(JSContext *cx, JSObject *obj,
586 uintN argc, jsval *argv,
590 static JSPropertySpec SFVec3f_properties[] = {
591 {
"x", SFVEC3F_X, JSPROP_PERMANENT},
592 {
"y", SFVEC3F_Y, JSPROP_PERMANENT},
593 {
"z", SFVEC3F_Z, JSPROP_PERMANENT},
597 static JSFunctionSpec SFVec3f_functions[] = {
598 {
"add", SFVec3f_add, 1, 0, 0 },
599 {
"cross", SFVec3f_cross, 1, 0, 0 },
600 {
"divide", SFVec3f_divide, 1, 0, 0 },
601 {
"dot", SFVec3f_dot, 1, 0, 0 },
602 {
"length", SFVec3f_length, 0, 0, 0 },
603 {
"multiple", SFVec3f_multiple, 1, 0, 0 },
604 {
"negate", SFVec3f_negate, 0, 0, 0 },
605 {
"normalize", SFVec3f_normalize, 0, 0, 0 },
606 {
"subtract", SFVec3f_subtract, 1, 0, 0 },
607 {
"toString", SFVec3f_toString, 0, 0, 0 },
612 static JSClass SFVec3fClass = {
620 SpiderMonkey::SFVec3f_getProperty,
621 SpiderMonkey::SFVec3f_setProperty,
625 PrivatePointer_finalize<FieldObjectPrivate>,
650 JSBool SFMatrix3fRow_toString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
651 JSBool SFMatrix3fRow_setProperty(JSContext *cx, JSObject *obj, jsval
id, jsval *vp);
652 JSBool SFMatrix3fRow_getProperty(JSContext *cx, JSObject *obj, jsval
id, jsval *vp);
653 JSBool SFMatrix3fRow_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
654 JSObject *SFMatrix3fRow_newInstance( JSContext *cx,
Field *field,
bool internal_field );
656 enum SFMatrix3fRowPropertyId {
659 static JSPropertySpec SFMatrix3fRow_properties[] = {
663 static JSFunctionSpec SFMatrix3fRow_functions[] = {
664 {
"toString", SFMatrix3fRow_toString , 0, 0, 0 },
667 static JSClass SFMatrix3fRowClass = {
675 SpiderMonkey::SFMatrix3fRow_getProperty,
676 SpiderMonkey::SFMatrix3fRow_setProperty,
680 PrivatePointer_finalize<FieldObjectPrivate>,
691 JSBool X3DMatrix3_toString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
692 JSBool X3DMatrix3_setProperty(JSContext *cx, JSObject *obj, jsval
id, jsval *vp);
693 JSBool X3DMatrix3_getProperty(JSContext *cx, JSObject *obj, jsval
id, jsval *vp);
694 JSBool X3DMatrix3_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
695 JSBool X3DMatrix3_setTransform(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
697 JSBool X3DMatrix3_inverse(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
698 JSBool X3DMatrix3_transpose(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
699 JSBool X3DMatrix3_multLeft(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
700 JSBool X3DMatrix3_multRight(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
701 JSBool X3DMatrix3_multVecMatrix(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
702 JSBool X3DMatrix3_multMatrixVec(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
703 JSObject *X3DMatrix3_newInstance( JSContext *cx, Field *field,
bool internal_field );
705 enum X3DMatrix3PropertyId {
708 static JSPropertySpec X3DMatrix3_properties[] = {
712 static JSFunctionSpec X3DMatrix3_functions[] = {
713 {
"inverse", X3DMatrix3_inverse, 0, 0, 0 },
714 {
"transpose", X3DMatrix3_transpose, 0, 0, 0 },
715 {
"setTransform", X3DMatrix3_setTransform, 5, 0, 0 },
717 {
"multLeft", X3DMatrix3_multLeft, 1, 0, 0 },
718 {
"multRight", X3DMatrix3_multRight, 1, 0, 0 },
719 {
"multVecMatrix", X3DMatrix3_multVecMatrix, 1, 0, 0 },
720 {
"multMatrixVec", X3DMatrix3_multMatrixVec, 1, 0, 0 },
721 {
"toString", X3DMatrix3_toString , 0, 0, 0 },
725 static JSClass X3DMatrix3Class = {
733 SpiderMonkey::X3DMatrix3_getProperty,
734 SpiderMonkey::X3DMatrix3_setProperty,
738 PrivatePointer_finalize<FieldObjectPrivate>,
742 X3DMatrix3_construct,
762 JSBool SFMatrix4fRow_toString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
763 JSBool SFMatrix4fRow_setProperty(JSContext *cx, JSObject *obj, jsval
id, jsval *vp);
764 JSBool SFMatrix4fRow_getProperty(JSContext *cx, JSObject *obj, jsval
id, jsval *vp);
765 JSBool SFMatrix4fRow_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
766 JSObject *SFMatrix4fRow_newInstance( JSContext *cx,
Field *field,
bool internal_field );
768 enum SFMatrix4fRowPropertyId {
771 static JSPropertySpec SFMatrix4fRow_properties[] = {
775 static JSFunctionSpec SFMatrix4fRow_functions[] = {
776 {
"toString", SFMatrix4fRow_toString , 0, 0, 0 },
779 static JSClass SFMatrix4fRowClass = {
787 SpiderMonkey::SFMatrix4fRow_getProperty,
788 SpiderMonkey::SFMatrix4fRow_setProperty,
792 PrivatePointer_finalize<FieldObjectPrivate>,
803 JSBool X3DMatrix4_toString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
804 JSBool X3DMatrix4_setProperty(JSContext *cx, JSObject *obj, jsval
id, jsval *vp);
805 JSBool X3DMatrix4_getProperty(JSContext *cx, JSObject *obj, jsval
id, jsval *vp);
806 JSBool X3DMatrix4_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
809 JSBool X3DMatrix4_inverse(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
810 JSBool X3DMatrix4_transpose(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
811 JSBool X3DMatrix4_multLeft(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
812 JSBool X3DMatrix4_multRight(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
813 JSBool X3DMatrix4_multVecMatrix(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
814 JSBool X3DMatrix4_multMatrixVec(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
815 JSObject *X3DMatrix4_newInstance( JSContext *cx, Field *field,
bool internal_field );
817 enum X3DMatrix4PropertyId {
820 static JSPropertySpec X3DMatrix4_properties[] = {
824 static JSFunctionSpec X3DMatrix4_functions[] = {
825 {
"inverse", X3DMatrix4_inverse, 0, 0, 0 },
826 {
"transpose", X3DMatrix4_transpose, 0, 0, 0 },
829 {
"multLeft", X3DMatrix4_multLeft, 1, 0, 0 },
830 {
"multRight", X3DMatrix4_multRight, 1, 0, 0 },
831 {
"multVecMatrix", X3DMatrix4_multVecMatrix, 1, 0, 0 },
832 {
"multMatrixVec", X3DMatrix4_multMatrixVec, 1, 0, 0 },
833 {
"toString", X3DMatrix4_toString , 0, 0, 0 },
837 static JSClass X3DMatrix4Class = {
845 SpiderMonkey::X3DMatrix4_getProperty,
846 SpiderMonkey::X3DMatrix4_setProperty,
850 PrivatePointer_finalize<FieldObjectPrivate>,
854 X3DMatrix4_construct,
867 SFVEC3D_X, SFVEC3D_Y, SFVEC3D_Z
870 JSBool SFVec3d_toString(JSContext *cx, JSObject *obj,
871 uintN argc, jsval *argv,
882 JSObject *SFVec3d_newInstance( JSContext *cx,
Field *field,
bool internal_field,
int array_index = -1 );
886 JSBool SFVec3d_setProperty(JSContext *cx,
893 JSBool SFVec3d_getProperty(JSContext *cx,
900 JSBool SFVec3d_construct(JSContext *cx, JSObject *obj,
901 uintN argc, jsval *argv,
905 JSBool SFVec3d_add(JSContext *cx, JSObject *obj,
906 uintN argc, jsval *argv,
908 JSBool SFVec3d_cross(JSContext *cx, JSObject *obj,
909 uintN argc, jsval *argv,
911 JSBool SFVec3d_divide(JSContext *cx, JSObject *obj,
912 uintN argc, jsval *argv,
914 JSBool SFVec3d_dot(JSContext *cx, JSObject *obj,
915 uintN argc, jsval *argv,
917 JSBool SFVec3d_length(JSContext *cx, JSObject *obj,
918 uintN argc, jsval *argv,
920 JSBool SFVec3d_multiple(JSContext *cx, JSObject *obj,
921 uintN argc, jsval *argv,
923 JSBool SFVec3d_negate(JSContext *cx, JSObject *obj,
924 uintN argc, jsval *argv,
926 JSBool SFVec3d_normalize(JSContext *cx, JSObject *obj,
927 uintN argc, jsval *argv,
929 JSBool SFVec3d_subtract(JSContext *cx, JSObject *obj,
930 uintN argc, jsval *argv,
934 static JSPropertySpec SFVec3d_properties[] = {
935 {
"x", SFVEC3D_X, JSPROP_PERMANENT},
936 {
"y", SFVEC3D_Y, JSPROP_PERMANENT},
937 {
"z", SFVEC3D_Z, JSPROP_PERMANENT},
941 static JSFunctionSpec SFVec3d_functions[] = {
942 {
"add", SFVec3d_add, 1, 0, 0 },
943 {
"cross", SFVec3d_cross, 1, 0, 0 },
944 {
"divide", SFVec3d_divide, 1, 0, 0 },
945 {
"dot", SFVec3d_dot, 1, 0, 0 },
946 {
"length", SFVec3d_length, 0, 0, 0 },
947 {
"multiple", SFVec3d_multiple, 1, 0, 0 },
948 {
"negate", SFVec3d_negate, 0, 0, 0 },
949 {
"normalize", SFVec3d_normalize, 0, 0, 0 },
950 {
"subtract", SFVec3d_subtract, 1, 0, 0 },
951 {
"toString", SFVec3d_toString, 0, 0, 0 },
956 static JSClass SFVec3dClass = {
964 SpiderMonkey::SFVec3d_getProperty,
965 SpiderMonkey::SFVec3d_setProperty,
969 PrivatePointer_finalize<FieldObjectPrivate>,
986 SFVEC4F_X, SFVEC4F_Y, SFVEC4F_Z, SFVEC4F_W,
990 JSBool SFVec4f_toString(JSContext *cx, JSObject *obj,
991 uintN argc, jsval *argv,
1002 JSObject *SFVec4f_newInstance( JSContext *cx,
Field *field,
bool internal_field,
int array_index = -1 );
1006 JSBool SFVec4f_setProperty(JSContext *cx,
1013 JSBool SFVec4f_getProperty(JSContext *cx,
1020 JSBool SFVec4f_construct(JSContext *cx, JSObject *obj,
1021 uintN argc, jsval *argv,
1025 JSBool SFVec4f_add(JSContext *cx, JSObject *obj,
1026 uintN argc, jsval *argv,
1028 JSBool SFVec4f_divide(JSContext *cx, JSObject *obj,
1029 uintN argc, jsval *argv,
1031 JSBool SFVec4f_dot(JSContext *cx, JSObject *obj,
1032 uintN argc, jsval *argv,
1034 JSBool SFVec4f_multiple(JSContext *cx, JSObject *obj,
1035 uintN argc, jsval *argv,
1037 JSBool SFVec4f_negate(JSContext *cx, JSObject *obj,
1038 uintN argc, jsval *argv,
1040 JSBool SFVec4f_subtract(JSContext *cx, JSObject *obj,
1041 uintN argc, jsval *argv,
1045 static JSPropertySpec SFVec4f_properties[] = {
1046 {
"x", SFVEC4F_X, JSPROP_PERMANENT},
1047 {
"y", SFVEC4F_Y, JSPROP_PERMANENT},
1048 {
"z", SFVEC4F_Z, JSPROP_PERMANENT},
1049 {
"w", SFVEC4F_W, JSPROP_PERMANENT},
1053 static JSFunctionSpec SFVec4f_functions[] = {
1054 {
"add", SFVec4f_add, 1, 0, 0 },
1055 {
"divide", SFVec4f_divide, 1, 0, 0 },
1056 {
"dot", SFVec4f_dot, 1, 0, 0 },
1057 {
"multiple", SFVec4f_multiple, 1, 0, 0 },
1058 {
"negate", SFVec4f_negate, 0, 0, 0 },
1059 {
"subtract", SFVec4f_subtract, 1, 0, 0 },
1060 {
"toString", SFVec4f_toString, 0, 0, 0 },
1065 static JSClass SFVec4fClass = {
1067 JSCLASS_HAS_PRIVATE,
1073 SpiderMonkey::SFVec4f_getProperty,
1074 SpiderMonkey::SFVec4f_setProperty,
1078 PrivatePointer_finalize<FieldObjectPrivate>,
1094 SFVEC4D_X, SFVEC4D_Y, SFVEC4D_Z, SFVEC4D_W,
1097 JSBool SFVec4d_toString(JSContext *cx, JSObject *obj,
1098 uintN argc, jsval *argv,
1108 JSObject *SFVec4d_newInstance( JSContext *cx,
Field *field,
bool internal_field,
int array_index = -1 );
1112 JSBool SFVec4d_setProperty(JSContext *cx,
1119 JSBool SFVec4d_getProperty(JSContext *cx,
1126 JSBool SFVec4d_construct(JSContext *cx, JSObject *obj,
1127 uintN argc, jsval *argv,
1131 JSBool SFVec4d_add(JSContext *cx, JSObject *obj,
1132 uintN argc, jsval *argv,
1134 JSBool SFVec4d_divide(JSContext *cx, JSObject *obj,
1135 uintN argc, jsval *argv,
1137 JSBool SFVec4d_dot(JSContext *cx, JSObject *obj,
1138 uintN argc, jsval *argv,
1140 JSBool SFVec4d_multiple(JSContext *cx, JSObject *obj,
1141 uintN argc, jsval *argv,
1143 JSBool SFVec4d_negate(JSContext *cx, JSObject *obj,
1144 uintN argc, jsval *argv,
1146 JSBool SFVec4d_subtract(JSContext *cx, JSObject *obj,
1147 uintN argc, jsval *argv,
1151 static JSPropertySpec SFVec4d_properties[] = {
1152 {
"x", SFVEC4D_X, JSPROP_PERMANENT},
1153 {
"y", SFVEC4D_Y, JSPROP_PERMANENT},
1154 {
"z", SFVEC4D_Z, JSPROP_PERMANENT},
1155 {
"w", SFVEC4D_W, JSPROP_PERMANENT},
1159 static JSFunctionSpec SFVec4d_functions[] = {
1160 {
"add", SFVec4d_add, 1, 0, 0 },
1161 {
"divide", SFVec4d_divide, 1, 0, 0 },
1162 {
"dot", SFVec4d_dot, 1, 0, 0 },
1163 {
"multiple", SFVec4d_multiple, 1, 0, 0 },
1164 {
"negate", SFVec4d_negate, 0, 0, 0 },
1165 {
"subtract", SFVec4d_subtract, 1, 0, 0 },
1166 {
"toString", SFVec4d_toString, 0, 0, 0 },
1171 static JSClass SFVec4dClass = {
1173 JSCLASS_HAS_PRIVATE,
1179 SpiderMonkey::SFVec4d_getProperty,
1180 SpiderMonkey::SFVec4d_setProperty,
1184 PrivatePointer_finalize<FieldObjectPrivate>,
1201 SFRotation_X, SFRotation_Y, SFRotation_Z, SFRotation_ANGLE,
1204 JSBool SFRotation_toString(JSContext *cx, JSObject *obj,
1205 uintN argc, jsval *argv,
1215 JSObject *SFRotation_newInstance( JSContext *cx,
Field *field,
bool internal_field,
int array_index = -1 );
1219 JSBool SFRotation_setProperty(JSContext *cx, JSObject *obj, jsval
id, jsval *vp);
1223 JSBool SFRotation_getProperty(JSContext *cx, JSObject *obj, jsval
id, jsval *vp);
1227 JSBool SFRotation_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,jsval *rval);
1230 JSBool SFRotation_getAxis( JSContext *cx, JSObject *obj, uintN argc, jsval *argv,jsval *rval );
1231 JSBool SFRotation_inverse( JSContext *cx, JSObject *obj, uintN argc, jsval *argv,jsval *rval );
1232 JSBool SFRotation_multiply( JSContext *cx, JSObject *obj, uintN argc, jsval *argv,jsval *rval );
1233 JSBool SFRotation_multiVec( JSContext *cx, JSObject *obj, uintN argc, jsval *argv,jsval *rval );
1234 JSBool SFRotation_setAxis( JSContext *cx, JSObject *obj, uintN argc, jsval *argv,jsval *rval );
1235 JSBool SFRotation_slerp( JSContext *cx, JSObject *obj, uintN argc, jsval *argv,jsval *rval );
1238 static JSPropertySpec SFRotation_properties[] = {
1239 {
"x", SFRotation_X, JSPROP_PERMANENT},
1240 {
"y", SFRotation_Y, JSPROP_PERMANENT},
1241 {
"z", SFRotation_Z, JSPROP_PERMANENT},
1242 {
"angle", SFRotation_ANGLE, JSPROP_PERMANENT},
1246 static JSFunctionSpec SFRotation_functions[] = {
1247 {
"getAxis", SFRotation_getAxis, 0, 0, 0 },
1248 {
"inverse", SFRotation_inverse, 0, 0, 0 },
1249 {
"multiply", SFRotation_multiply, 1, 0, 0 },
1250 {
"multiVec", SFRotation_multiVec, 1, 0, 0 },
1251 {
"setAxis", SFRotation_setAxis, 1, 0, 0 },
1252 {
"slerp", SFRotation_slerp, 2, 0, 0 },
1253 {
"toString", SFRotation_toString, 0, 0, 0 },
1257 static JSClass SFRotationClass = {
1259 JSCLASS_HAS_PRIVATE,
1265 SpiderMonkey::SFRotation_getProperty,
1266 SpiderMonkey::SFRotation_setProperty,
1270 PrivatePointer_finalize<FieldObjectPrivate>,
1296 bool internal_field,
int array_index = -1 );
1315 uintN argc, jsval *argv,
1319 JSBool SFNode_getNodeName(JSContext *cx, JSObject *obj,
1320 uintN argc, jsval *argv,
1322 JSBool SFNode_getNodeType(JSContext *cx, JSObject *obj,
1323 uintN argc, jsval *argv,
1325 JSBool SFNode_getFieldDefinitions(JSContext *cx, JSObject *obj,
1326 uintN argc, jsval *argv,
1328 JSBool SFNode_toVRMLString(JSContext *cx, JSObject *obj,
1329 uintN argc, jsval *argv,
1331 JSBool SFNode_toX3DString(JSContext *cx, JSObject *obj,
1332 uintN argc, jsval *argv,
1336 static JSFunctionSpec SFNode_functions[] = {
1337 {
"getNodeName", SFNode_getNodeName, 0, 0, 0 },
1338 {
"getNodeType", SFNode_getNodeType, 0, 0, 0 },
1339 {
"getFieldDefinitions", SFNode_getFieldDefinitions, 0, 0, 0 },
1340 {
"toString", SFNode_toX3DString, 0, 0, 0 },
1341 {
"toX3DString", SFNode_toX3DString, 0, 0, 0 },
1342 {
"toVRMLString", SFNode_toVRMLString, 0, 0, 0 },
1346 static JSClass SFNodeClass = {
1348 JSCLASS_HAS_PRIVATE,
1354 SpiderMonkey::SFNode_getProperty,
1355 SpiderMonkey::SFNode_setProperty,
1359 PrivatePointer_finalize< FieldObjectPrivate >,
1375 SFCOLOR_R, SFCOLOR_G, SFCOLOR_B
1385 JSObject *SFColor_newInstance( JSContext *cx,
1387 bool internal_field,
int array_index = -1 );
1391 JSBool SFColor_setProperty(JSContext *cx, JSObject *obj, jsval
id, jsval *vp);
1395 JSBool SFColor_getProperty(JSContext *cx,
1402 JSBool SFColor_construct(JSContext *cx, JSObject *obj,
1403 uintN argc, jsval *argv,
1407 JSBool SFColor_getHSV(JSContext *cx, JSObject *obj,
1408 uintN argc, jsval *argv,
1410 JSBool SFColor_setHSV(JSContext *cx, JSObject *obj,
1411 uintN argc, jsval *argv,
1414 JSBool SFColor_toString(JSContext *cx, JSObject *obj,
1415 uintN argc, jsval *argv,
1419 static JSPropertySpec SFColor_properties[] = {
1420 {
"r", SFCOLOR_R, JSPROP_PERMANENT},
1421 {
"g", SFCOLOR_G, JSPROP_PERMANENT},
1422 {
"b", SFCOLOR_B, JSPROP_PERMANENT},
1426 static JSFunctionSpec SFColor_functions[] = {
1427 {
"getHSV", SFColor_getHSV, 1, 0, 0 },
1428 {
"setHSV", SFColor_setHSV, 1, 0, 0 },
1429 {
"toString", SFColor_toString, 0, 0, 0 },
1433 static JSClass SFColorClass = {
1435 JSCLASS_HAS_PRIVATE,
1441 SpiderMonkey::SFColor_getProperty,
1442 SpiderMonkey::SFColor_setProperty,
1446 PrivatePointer_finalize< FieldObjectPrivate >,
1462 X3DEXECUTIONCONTEXT_ROOTNODES
1472 JSObject *X3DExecutionContext_newInstance( JSContext *cx,
1473 SAI::ExecutionContext *field,
1474 bool internal_field );
1478 JSBool X3DExecutionContext_setProperty(JSContext *cx,
1485 JSBool X3DExecutionContext_getProperty(JSContext *cx,
1493 uintN argc, jsval *argv,
1498 JSBool X3DExecutionContext_createNode(JSContext *cx, JSObject *obj,
1499 uintN argc, jsval *argv,
1503 static JSPropertySpec X3DExecutionContext_properties[] = {
1504 {
"rootNodes", X3DEXECUTIONCONTEXT_ROOTNODES, JSPROP_PERMANENT},
1508 static JSFunctionSpec X3DExecutionContext_functions[] = {
1509 {
"createNode", X3DExecutionContext_createNode, 1, 0, 0 },
1513 static JSClass X3DExecutionContextClass = {
1514 "X3DExecutionContext",
1515 JSCLASS_HAS_PRIVATE,
1521 SpiderMonkey::X3DExecutionContext_getProperty,
1522 SpiderMonkey::X3DExecutionContext_setProperty,
1526 PrivatePointer_finalize< ExecutionContextPrivate >,
1553 JSObject *X3DScene_newInstance( JSContext *cx,
1554 SAI::SAIScene *field,
1555 bool internal_field );
1559 JSBool X3DScene_setProperty(JSContext *cx,
1566 JSBool X3DScene_getProperty(JSContext *cx,
1574 uintN argc, jsval *argv,
1581 static JSPropertySpec X3DScene_properties[] = {
1582 {
"rootNodes", X3DSCENE_ROOTNODES, JSPROP_PERMANENT},
1586 static JSFunctionSpec X3DScene_functions[] = {
1587 {
"createNode", X3DExecutionContext_createNode, 1, 0, 0 },
1591 static JSClass X3DSceneClass = {
1593 JSCLASS_HAS_PRIVATE,
1599 SpiderMonkey::X3DScene_getProperty,
1600 SpiderMonkey::X3DScene_setProperty,
1604 PrivatePointer_finalize< ExecutionContextPrivate >,
1624 JSBool Browser_setProperty(JSContext *cx,
1629 JSObject *Browser_newInstance( JSContext *cx,
1630 SAI::Browser *browser,
1631 bool internal_field );
1634 JSBool Browser_print(JSContext *cx,
1635 JSObject *obj, uintN argc,
1636 jsval *argv, jsval *rval);
1638 JSBool Browser_println(JSContext *cx,
1639 JSObject *obj, uintN argc,
1640 jsval *argv, jsval *rval);
1642 JSBool Browser_createX3DFromString(JSContext *cx,
1643 JSObject *obj, uintN argc,
1644 jsval *argv, jsval *rval);
1646 JSBool Browser_createX3DFromURL(JSContext *cx,
1647 JSObject *obj, uintN argc,
1648 jsval *argv, jsval *rval);
1650 enum BrowserPropertyId {
1651 BROWSER_NAME, BROWSER_VERSION, BROWSER_CURRENT_SCENE
1654 static JSPropertySpec browser_properties[] = {
1655 {
"version", BROWSER_VERSION, JSPROP_READONLY},
1656 {
"name", BROWSER_NAME, JSPROP_READONLY},
1657 {
"currentScene", BROWSER_CURRENT_SCENE, JSPROP_READONLY},
1661 static JSFunctionSpec browser_functions[] = {
1662 {
"println", Browser_println, 0, 0, 0 },
1663 {
"print", Browser_print, 0, 0, 0 },
1664 {
"createX3DFromString", Browser_createX3DFromString, 0, 0, 0 },
1665 {
"createX3DFromURL", Browser_createX3DFromURL, 0, 0, 0 },
1669 static JSClass BrowserClass = {
1671 JSCLASS_HAS_PRIVATE,
1678 Browser_setProperty,
1682 PrivatePointer_finalize<BrowserPrivate>,
1683 JSCLASS_NO_OPTIONAL_MEMBERS
1689 template<
class MFieldType,
class ElementType >
1701 bool internal_field,
int array_index = -1 );
1719 static JSBool
construct(JSContext *cx, JSObject *obj,
1720 uintN argc, jsval *argv,
1725 static JSClass js_class;
1726 static JSPropertySpec properties[1];
1728 static JSBool initClass( JSContext *cx, JSObject *obj,
const char *name ) {
1730 JSPropertySpec p[] = {
1734 properties[0] = p[0];
1737 JSFunctionSpec f[2] = {
1746 JSCLASS_HAS_PRIVATE,
1757 PrivatePointer_finalize< FieldObjectPrivate >,
1770 JSObject *proto = JS_InitClass( cx, obj, NULL,
1778 template<
class MFieldType,
class ElementType >
1781 template<
class MFieldType,
class ElementType >
1782 JSClass JS_MField< MFieldType, ElementType >::js_class;
1784 template<
class MFieldType,
class ElementType >
1785 JSPropertySpec JS_MField< MFieldType, ElementType >::properties[1];
1787 template<
class MFieldType,
class ElementType >
1791 bool internal_field,
1797 js_field = JS_NewObject( cx, &js_class, NULL, NULL );
1799 JS_DefineProperties(cx, js_field,
1801 JS_DefineFunctions(cx, js_field,
1857 typedef enum { O_ADD, O_SUBTRACT, O_CROSS, O_DOT, O_DIVIDE, O_MULTIPLE, } BinaryOperator;
1861 T* helper_extractPrivateObject( JSContext* cx, JSObject* jsobj);
1866 bool helper_calculate2_TTT(JSContext *cx, JSObject *this_obj, jsval *arg, T*
const rval, BinaryOperator op);
1867 template <
class T,
class N>
1868 bool helper_calculate2_TNT(JSContext *cx, JSObject *this_obj, jsval *arg, T*
const rval, BinaryOperator op);
1869 template <
class T,
class N>
1870 bool helper_calculate2_TTN(JSContext *cx, JSObject *this_obj, jsval *arg, jsval*
const rjsval, BinaryOperator op);
1873 static JSClass SFNumberClass = {
1875 JSCLASS_HAS_PRIVATE,
1876 JS_PropertyStub, JS_PropertyStub,
1877 JS_PropertyStub, JS_PropertyStub,
1878 JS_EnumerateStub, JS_ResolveStub,
1879 JS_ConvertStub, JS_FinalizeStub,
1880 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
1884 bool helper_sanityCheck(JSContext *cx, JSObject *obj, uintN argc,
1885 jsval *argv, uintN e_argc, JSClass** e_argtypes);
Contains the MFBool field class.
Contains the MFColor field class.
Contains the MFDouble field class.
Contains the MFFloat field class.
Contains the MFInt32 field class.
Contains the MFNode class.
Contains the MFRotation field class.
Contains the MFString field class.
Contains the MFTime field class.
Contains the MFVec2d field class.
Contains the MFVec2f field class.
Contains the MFVec3d field class.
Contains the MFVec3f field class.
Contains the MFVec4d field class.
Contains the MFVec4f field class.
Header file for common SAI interface classes and functions for use by script engine implementations s...
Contains the SFBool field class.
Contains the SFColor field class.
Contains the SFDouble field class.
Contains the SFFloat field class.
Contains the SFInt32 field class.
Contains the SFMatrix3f field class.
Contains the SFMatrix4f field class.
Contains the SFNode class.
Contains the SFRotation field class.
Contains the SFString field class.
Contains the SFTime field class.
Contains the SFVec2d field class.
Contains the SFVec2f field class.
Contains the SFVec3d field class.
Contains the SFVec3f field class.
Contains the SFVec4d field class.
Contains the SFVec4f field class.
JSBool SFVec4d_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
Construct callback function for creating a new instance of SFVec4d.
Definition: SpiderMonkeyTypes.cpp:1744
JSBool SFVec2d_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
Construct callback function for creating a new instance of SFVec2d.
Definition: SpiderMonkeyTypes.cpp:665
JSBool X3DMatrix4_getTransform(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
X3DMatrix4.
Definition: SpiderMonkeyTypes.cpp:4225
JSBool SFNode_setProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
Callback setter function for properties of a SFNode object.
Definition: SpiderMonkeyTypes.cpp:2327
JSBool haveFunction(JSContext *cx, JSObject *obj, const char *name)
Returns JS_TRUE if the name is a function in the given object.
Definition: SpiderMonkeyTypes.cpp:3772
SFRotationPropertyId
SFRotation.
Definition: SpiderMonkeyTypes.h:1200
JSBool SFVec3f_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
Construct callback function for creating a new instance of SFVec3f.
Definition: SpiderMonkeyTypes.cpp:919
JSBool SFNode_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
Construct callback function for creating a new instance of SFNode.
Definition: SpiderMonkeyTypes.cpp:2277
JSBool Browser_getProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
Browser.
Definition: SpiderMonkeyTypes.cpp:3209
JSBool SFColor_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
Construct callback function for creating a new instance of SFColor.
Definition: SpiderMonkeyTypes.cpp:2459
SFVec3dPropertyId
SFVec3d.
Definition: SpiderMonkeyTypes.h:866
SFVec4dPropertyId
SFVec4d.
Definition: SpiderMonkeyTypes.h:1093
X3DScenePropertyId
X3DScene.
Definition: SpiderMonkeyTypes.h:1542
JSBool setFieldValueFromjsval(JSContext *cx, Field *f, jsval v)
Sets the field value to the value of the jsval v.
Definition: SpiderMonkeyTypes.cpp:3607
X3DExecutionContextPropertyId
X3DExecutionContext.
Definition: SpiderMonkeyTypes.h:1461
JSBool SFVec4f_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
Construct callback function for creating a new instance of SFVec4f.
Definition: SpiderMonkeyTypes.cpp:1493
void setJSException(JSContext *cx, const SAI::SAIError &e)
Set a JS API exception based on the c++ SAIError exception.
Definition: SpiderMonkeyTypes.cpp:3786
bool insertH3DTypes(JSContext *cx, JSObject *obj)
Insert the H3D data types, such as SFFloat, MFInt32 etc into the context and object given.
Definition: SpiderMonkeyTypes.cpp:3262
void PrivatePointer_finalize(JSContext *cx, JSObject *obj)
Destruct callback for JSObject with a private datamember.
Definition: SpiderMonkeyTypes.h:193
SFVec2dPropertyId
SFVec2d.
Definition: SpiderMonkeyTypes.h:328
JSBool SFRotation_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
Construct callback function for creating a new instance of SFRotation.
Definition: SpiderMonkeyTypes.cpp:1998
JSBool FieldObject_toString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
Callback function for converting a JSObject with a FieldObjectPrivate private data member to a JSStri...
Definition: SpiderMonkeyTypes.cpp:158
JSBool SFVec2f_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
Construct callback function for creating a new instance of SFVec2f.
Definition: SpiderMonkeyTypes.cpp:412
SFVec2fPropertyId
SFVec2f.
Definition: SpiderMonkeyTypes.h:218
jsval jsvalFromField(JSContext *cx, Field *f, bool make_copy, int array_index=-1, X3DTypes::X3DType x3dt=X3DTypes::UNKNOWN_X3D_TYPE)
Create a jsval object containing the value of the field(and possibly encapsulating the field).
Definition: SpiderMonkeyTypes.cpp:3362
SFColorPropertyId
SFColor.
Definition: SpiderMonkeyTypes.h:1374
JSBool X3DScene_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
Construct callback function for creating a new instance of X3DScene.
SFVec3fPropertyId
SFVec3f.
Definition: SpiderMonkeyTypes.h:522
JSBool X3DExecutionContext_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
Construct callback function for creating a new instance of X3DExecutionContext.
JSBool X3DMatrix3_getTransform(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
X3DMATRIX3.
Definition: SpiderMonkeyTypes.cpp:3976
JSBool SFImage_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
Construct callback function for creating a new instance of SFImage.
Definition: SpiderMonkeyTypes.cpp:2653
JSBool SFVec3d_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
Construct callback function for creating a new instance of SFVec3d.
Definition: SpiderMonkeyTypes.cpp:1205
SFVec4fPropertyId
SFVec4f.
Definition: SpiderMonkeyTypes.h:985
JSBool SFNode_getProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
Callback getter function for properties of a SFNode object.
Definition: SpiderMonkeyTypes.cpp:2294
JSBool X3DMatrix4_setTransform(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
Definition: SpiderMonkeyTypes.cpp:4270
JSObject * SFNode_newInstance(JSContext *cx, Field *field, bool internal_field, int array_index=-1)
SFNode.
Definition: SpiderMonkeyTypes.cpp:2352
Header file for X3DTexture2DNode, X3D scene-graph node.
The Field class.
Definition: Field.h:46
The SFMatrix3f field contains a Matrix3f.
Definition: SFMatrix3f.h:41
The SFMatrix4f field contains a Matrix4f.
Definition: SFMatrix4f.h:41
Class used as the private data in field JSObject classes.
Definition: SpiderMonkeyTypes.h:132
PointerType * getPointer()
Get the pointer the JSObject encapsulates.
Definition: SpiderMonkeyTypes.h:159
void dispose()
Dispose the object. Sets the dispose flag to true.
Definition: SpiderMonkeyTypes.h:175
bool isDisposed()
Returns true if this data object has been disposed.
Definition: SpiderMonkeyTypes.h:164
int getArrayIndex()
Return the array index (in case we using (MF, index) to represent an SF object Return -1 if it IS an ...
Definition: SpiderMonkeyTypes.h:170
PointerPrivateData(PointerType *_ptr, bool _internal_pointer, int _array_index=-1)
Constructor.
Definition: SpiderMonkeyTypes.h:140
~PointerPrivateData()
Destructor.
Definition: SpiderMonkeyTypes.h:152
X3DMatrix3.
Definition: SpiderMonkeyTypes.h:642
X3DMatrix4.
Definition: SpiderMonkeyTypes.h:754
A SFNode encapsulating an Image class.
Definition: X3DTexture2DNode.h:49
H3D API namespace.
Definition: Anchor.h:38
MField template.
Definition: SpiderMonkeyTypes.h:1690
static JSObject * newInstance(JSContext *cx, Field *field, bool internal_field, int array_index=-1)
Returns a new JSObject object encapsulating a field.
Definition: SpiderMonkeyTypes.h:1788
static JSBool construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
Construct callback function for creating a new instance of JS_MField.
Definition: SpiderMonkeyTypes.cpp:275
static JSFunctionSpec functions[2]
Member functions.
Definition: SpiderMonkeyTypes.h:1724
static JSBool setProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
Callback setter function for properties of a JS_MField object.
Definition: SpiderMonkeyTypes.cpp:306
static JSBool getProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
Callback getter function for properties of a JS_MField object.
Definition: SpiderMonkeyTypes.cpp:206