18 #ifndef INCLUDED_INTERFACE_SCRIPTED 19 #define INCLUDED_INTERFACE_SCRIPTED 25 #define BEGIN_INTERFACE_WRAPPER(iname) \ 26 JSClass class_ICmp##iname = { \ 27 "ICmp" #iname, JSCLASS_HAS_PRIVATE \ 29 static JSFunctionSpec methods_ICmp##iname[] = { 31 #define END_INTERFACE_WRAPPER(iname) \ 34 void ICmp##iname::InterfaceInit(ScriptInterface& scriptInterface) { \ 35 scriptInterface.DefineCustomObjectType(&class_ICmp##iname, NULL, 0, NULL, methods_ICmp##iname, NULL, NULL); \ 37 bool ICmp##iname::NewJSObject(const ScriptInterface& scriptInterface, JS::MutableHandleObject out) const\ 39 out.set(scriptInterface.CreateCustomObject("ICmp" #iname)); \ 42 void RegisterComponentInterface_##iname(ScriptInterface& scriptInterface) { \ 43 ICmp##iname::InterfaceInit(scriptInterface); \ 46 template <
typename T, JSClass* jsClass>
49 return ScriptInterface::GetPrivate<T>(rq, args, jsClass);
52 #define DEFINE_INTERFACE_METHOD(scriptname, classname, methodname) \ 53 ScriptFunction::Wrap<&classname::methodname, ComponentGetter<classname, &class_##classname>>(scriptname), 55 #endif // INCLUDED_INTERFACE_SCRIPTED
#define T(string_literal)
Definition: secure_crt.cpp:77
T * ComponentGetter(const ScriptRequest &rq, JS::CallArgs &args)
Definition: InterfaceScripted.h:47
Spidermonkey maintains some 'local' state via the JSContext* object.
Definition: ScriptRequest.h:59