2020-10-08 22:32:07 +08:00
|
|
|
\#include "scripting/js-bindings/auto/${out_file}.hpp"
|
|
|
|
#if $macro_judgement
|
|
|
|
$macro_judgement
|
|
|
|
#end if
|
|
|
|
\#include "scripting/js-bindings/manual/cocos2d_specifics.hpp"
|
2020-07-20 18:46:15 +08:00
|
|
|
#for header in $headers
|
2020-10-08 22:32:07 +08:00
|
|
|
#set include_header = os.path.basename(header)
|
|
|
|
#if $replace_headers.has_key(include_header)
|
|
|
|
\#include "${replace_headers[include_header]}"
|
|
|
|
#else
|
|
|
|
#set relative = os.path.relpath(header, $search_path)
|
|
|
|
#if not '..' in relative
|
|
|
|
\#include "${relative.replace(os.path.sep, '/')}"
|
|
|
|
#else
|
|
|
|
\#include "${include_header}"
|
|
|
|
#end if
|
|
|
|
#end if
|
|
|
|
#end for
|
|
|
|
#if $cpp_headers
|
|
|
|
#for header in $cpp_headers
|
|
|
|
\#include "${header}"
|
2020-07-20 18:46:15 +08:00
|
|
|
#end for
|
|
|
|
#end if
|
|
|
|
|
2020-10-08 22:32:07 +08:00
|
|
|
template<class T>
|
|
|
|
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp)
|
|
|
|
{
|
|
|
|
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
|
|
|
return false;
|
2020-07-20 18:46:15 +08:00
|
|
|
}
|
|
|
|
|
2020-10-08 22:32:07 +08:00
|
|
|
static bool empty_constructor(JSContext *cx, uint32_t argc, jsval *vp) {
|
|
|
|
return false;
|
2020-07-20 18:46:15 +08:00
|
|
|
}
|
|
|
|
|
2020-10-08 22:32:07 +08:00
|
|
|
static bool js_is_native_obj(JSContext *cx, uint32_t argc, jsval *vp)
|
|
|
|
{
|
|
|
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
|
|
|
args.rval().setBoolean(true);
|
|
|
|
return true;
|
|
|
|
}
|