Pyrogenesis  trunk
Macros | Functions
InterfaceScripted.h File Reference
#include "scriptinterface/FunctionWrapper.h"
#include "scriptinterface/ScriptConversions.h"
#include "scriptinterface/ScriptInterface.h"
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); \
}
static void out(const wchar_t *fmt,...)
Definition: wdbg_sym.cpp:421
JSObject * CreateCustomObject(const std::string &typeName) const
Definition: ScriptInterface.cpp:514
Abstraction around a SpiderMonkey JS::Realm.
Definition: ScriptInterface.h:71

Function Documentation

◆ ComponentGetter()

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