Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
InterfaceScripted.h File Reference
Include dependency graph for InterfaceScripted.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BEGIN_INTERFACE_WRAPPER(iname)
 
#define END_INTERFACE_WRAPPER(iname)
 
#define DEFINE_INTERFACE_METHOD(scriptname, classname, methodname)    ScriptFunction::Wrap<&classname::methodname, ComponentGetter<classname, &class_##classname>>(scriptname),
 

Functions

template<typename T , JSClass * jsClass>
TComponentGetter (const ScriptRequest &rq, JS::CallArgs &args)
 

Macro Definition Documentation

◆ BEGIN_INTERFACE_WRAPPER

#define BEGIN_INTERFACE_WRAPPER (   iname)
Value:
JSClass class_ICmp##iname = { \
"ICmp" #iname, JSCLASS_HAS_PRIVATE \
}; \
static JSFunctionSpec methods_ICmp##iname[] = {

◆ DEFINE_INTERFACE_METHOD

#define DEFINE_INTERFACE_METHOD (   scriptname,
  classname,
  methodname 
)     ScriptFunction::Wrap<&classname::methodname, ComponentGetter<classname, &class_##classname>>(scriptname),

◆ END_INTERFACE_WRAPPER

#define END_INTERFACE_WRAPPER (   iname)
Value:
JS_FS_END \
}; \
void ICmp##iname::InterfaceInit(ScriptInterface& scriptInterface) { \
scriptInterface.DefineCustomObjectType(&class_ICmp##iname, NULL, 0, NULL, methods_ICmp##iname, NULL, NULL); \
} \
bool ICmp##iname::NewJSObject(const ScriptInterface& scriptInterface, JS::MutableHandleObject out) const\
{ \
out.set(scriptInterface.CreateCustomObject("ICmp" #iname)); \
return true; \
} \
void RegisterComponentInterface_##iname(ScriptInterface& scriptInterface) { \
ICmp##iname::InterfaceInit(scriptInterface); \
}
Abstraction around a SpiderMonkey JS::Realm.
Definition: ScriptInterface.h:72
JSObject * CreateCustomObject(const std::string &typeName) const
Definition: ScriptInterface.cpp:518
static void out(const wchar_t *fmt,...)
Definition: wdbg_sym.cpp:407

Function Documentation

◆ ComponentGetter()

template<typename T , JSClass * jsClass>
T * ComponentGetter ( const ScriptRequest rq,
JS::CallArgs &  args 
)
inline