Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros
InterfaceScripted.h File Reference
#include "scriptinterface/ScriptInterface.h"
#include "js/jsapi.h"

Go to the source code of this file.

Macros

#define BEGIN_INTERFACE_WRAPPER(iname)
 
#define END_INTERFACE_WRAPPER(iname)
 
#define DEFINE_INTERFACE_METHOD_0(scriptname, rettype, classname, methodname)
 
#define DEFINE_INTERFACE_METHOD_1(scriptname, rettype, classname, methodname, arg1)
 
#define DEFINE_INTERFACE_METHOD_2(scriptname, rettype, classname, methodname, arg1, arg2)
 
#define DEFINE_INTERFACE_METHOD_3(scriptname, rettype, classname, methodname, arg1, arg2, arg3)
 
#define DEFINE_INTERFACE_METHOD_4(scriptname, rettype, classname, methodname, arg1, arg2, arg3, arg4)
 
#define DEFINE_INTERFACE_METHOD_5(scriptname, rettype, classname, methodname, arg1, arg2, arg3, arg4, arg5)
 
#define DEFINE_INTERFACE_METHOD_6(scriptname, rettype, classname, methodname, arg1, arg2, arg3, arg4, arg5, arg6)
 
#define DEFINE_INTERFACE_METHOD_7(scriptname, rettype, classname, methodname, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
 

Macro Definition Documentation

#define BEGIN_INTERFACE_WRAPPER (   iname)
Value:
JSClass class_ICmp##iname = { \
"ICmp" #iname, JSCLASS_HAS_PRIVATE, \
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, \
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub, \
JSCLASS_NO_OPTIONAL_MEMBERS \
}; \
static JSFunctionSpec methods_ICmp##iname[] = {

Definition at line 24 of file InterfaceScripted.h.

#define DEFINE_INTERFACE_METHOD_0 (   scriptname,
  rettype,
  classname,
  methodname 
)
Value:
{ scriptname, \
ScriptInterface::callMethod<rettype, &class_##classname, classname, &classname::methodname>, \
0, \
JSPROP_ENUMERATE|JSPROP_READONLY|JSPROP_PERMANENT },

Definition at line 46 of file InterfaceScripted.h.

#define DEFINE_INTERFACE_METHOD_1 (   scriptname,
  rettype,
  classname,
  methodname,
  arg1 
)
Value:
{ scriptname, \
ScriptInterface::callMethod<rettype, arg1, &class_##classname, classname, &classname::methodname>, \
1, \
JSPROP_ENUMERATE|JSPROP_READONLY|JSPROP_PERMANENT },

Definition at line 52 of file InterfaceScripted.h.

#define DEFINE_INTERFACE_METHOD_2 (   scriptname,
  rettype,
  classname,
  methodname,
  arg1,
  arg2 
)
Value:
{ scriptname, \
ScriptInterface::callMethod<rettype, arg1, arg2, &class_##classname, classname, &classname::methodname>, \
2, \
JSPROP_ENUMERATE|JSPROP_READONLY|JSPROP_PERMANENT },

Definition at line 58 of file InterfaceScripted.h.

#define DEFINE_INTERFACE_METHOD_3 (   scriptname,
  rettype,
  classname,
  methodname,
  arg1,
  arg2,
  arg3 
)
Value:
{ scriptname, \
ScriptInterface::callMethod<rettype, arg1, arg2, arg3, &class_##classname, classname, &classname::methodname>, \
3, \
JSPROP_ENUMERATE|JSPROP_READONLY|JSPROP_PERMANENT },

Definition at line 64 of file InterfaceScripted.h.

#define DEFINE_INTERFACE_METHOD_4 (   scriptname,
  rettype,
  classname,
  methodname,
  arg1,
  arg2,
  arg3,
  arg4 
)
Value:
{ scriptname, \
ScriptInterface::callMethod<rettype, arg1, arg2, arg3, arg4, &class_##classname, classname, &classname::methodname>, \
4, \
JSPROP_ENUMERATE|JSPROP_READONLY|JSPROP_PERMANENT },

Definition at line 70 of file InterfaceScripted.h.

#define DEFINE_INTERFACE_METHOD_5 (   scriptname,
  rettype,
  classname,
  methodname,
  arg1,
  arg2,
  arg3,
  arg4,
  arg5 
)
Value:
{ scriptname, \
ScriptInterface::callMethod<rettype, arg1, arg2, arg3, arg4, arg5, &class_##classname, classname, &classname::methodname>, \
5, \
JSPROP_ENUMERATE|JSPROP_READONLY|JSPROP_PERMANENT },

Definition at line 76 of file InterfaceScripted.h.

#define DEFINE_INTERFACE_METHOD_6 (   scriptname,
  rettype,
  classname,
  methodname,
  arg1,
  arg2,
  arg3,
  arg4,
  arg5,
  arg6 
)
Value:
{ scriptname, \
ScriptInterface::callMethod<rettype, arg1, arg2, arg3, arg4, arg5, arg6, &class_##classname, classname, &classname::methodname>, \
6, \
JSPROP_ENUMERATE|JSPROP_READONLY|JSPROP_PERMANENT },

Definition at line 82 of file InterfaceScripted.h.

#define DEFINE_INTERFACE_METHOD_7 (   scriptname,
  rettype,
  classname,
  methodname,
  arg1,
  arg2,
  arg3,
  arg4,
  arg5,
  arg6,
  arg7 
)
Value:
{ scriptname, \
ScriptInterface::callMethod<rettype, arg1, arg2, arg3, arg4, arg5, arg6, arg7, &class_##classname, classname, &classname::methodname>, \
7, \
JSPROP_ENUMERATE|JSPROP_READONLY|JSPROP_PERMANENT },

Definition at line 88 of file InterfaceScripted.h.

#define END_INTERFACE_WRAPPER (   iname)
Value:
{ NULL } \
}; \
void ICmp##iname::InterfaceInit(ScriptInterface& scriptInterface) { \
JSContext* cx = scriptInterface.GetContext(); \
JSObject* global = JS_GetGlobalObject(cx); \
JS_InitClass(cx, global, NULL, &class_ICmp##iname, NULL, 0, NULL, methods_ICmp##iname, NULL, NULL); \
} \
JSClass* ICmp##iname::GetJSClass() const { return &class_ICmp##iname; } \
void RegisterComponentInterface_##iname(ScriptInterface& scriptInterface) { \
ICmp##iname::InterfaceInit(scriptInterface); \
}
Abstraction around a SpiderMonkey JSContext.
JSContext * GetContext() const

Definition at line 33 of file InterfaceScripted.h.