cocos2d-x  3.0alpha1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
js_bindings_config.h File Reference
#include "cocos2d.h"

Macros

#define JSB_ASSERT_ON_FAIL   0
 Whether or not to assert when the arguments or conversions are incorrect. More...
 
#define JSB_PRECONDITION(condition,...)
#define JSB_PRECONDITION2(condition, context, ret_value,...)
#define ASSERT(condition, error_msg)
#define JSB_PRECONDITION3(condition, context, ret_value,...)
#define JSB_REPRESENT_LONGLONG_AS_STR   1
 When JSB_REPRESENT_LONGLONG_AS_STR is defined, the long long will be represented as JS strings. More...
 
#define JSB_INCLUDE_NS   1
 Whether or not it should include JS bindings for basic NS* / Cocoa / CocoaTouch objects. More...
 
#define JSB_INCLUDE_COCOS2D   1
 Whether or not it should include JS bindings for cocos2d. More...
 
#define JSB_INCLUDE_CHIPMUNK   1
 Whether or not it should include JS bindings for Chipmunk. More...
 
#define JSB_INCLUDE_COCOSBUILDERREADER   1
 Whether or not it should include JS bindings for CocosBuilder Reader. More...
 
#define JSB_INCLUDE_COCOSDENSHION   1
 Whether or not it should include bindings for CocosDenshion (sound engine) More...
 
#define JSB_ENSURE_AUTOCOMPARTMENT(cx, obj)
#define JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET   JSAutoCompartment __jsb_ac(ScriptingCore::getInstance()->getGlobalContext(), ScriptingCore::getInstance()->getGlobalObject());
#define JSB_DEBUGGER_PORT   5086
 The port number, where the client will be listening on. More...
 
#define JSB_INCLUDE_SYSTEM   1
 Whether or not it should include bindings for system components like LocalStorage. More...
 
#define JSB_INCLUDE_OPENGL   1
 Whether or not it should include bindings for WebGL / OpenGL ES 2.0. More...
 
#define JSB_INCLUDE_XMLHTTP   1
 Whether or not it should include bindings for XmlHttpRequest. More...
 
#define JSB_MAX_STACK_QUOTA   500000

Macro Definition Documentation

#define ASSERT (   condition,
  error_msg 
)
Value:
do { \
if( ! (condition) ) { \
CCLOG("jsb: ERROR in %s: %s\n", __FUNCTION__, error_msg); \
return false; \
} \
} while(0)
#define JSB_ASSERT_ON_FAIL   0

Whether or not to assert when the arguments or conversions are incorrect.

It is recommened to turn it off in Release mode.

var JSB_ASSERT_ON_FAIL   0

Whether or not to assert when the arguments or conversions are incorrect.

It is recommened to turn it off in Release mode.

local JSB_ASSERT_ON_FAIL   0

Whether or not to assert when the arguments or conversions are incorrect.

It is recommened to turn it off in Release mode.

#define
JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET   JSAutoCompartment __jsb_ac(ScriptingCore::getInstance()->getGlobalContext(), ScriptingCore::getInstance()->getGlobalObject());
var
JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET   JSAutoCompartment __jsb_ac(ScriptingCore::getInstance()->getGlobalContext(), ScriptingCore::getInstance()->getGlobalObject());
local
JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET   JSAutoCompartment __jsb_ac(ScriptingCore::getInstance()->getGlobalContext(), ScriptingCore::getInstance()->getGlobalObject());
#define JSB_DEBUGGER_PORT   5086

The port number, where the client will be listening on.

var JSB_DEBUGGER_PORT   5086

The port number, where the client will be listening on.

local JSB_DEBUGGER_PORT   5086

The port number, where the client will be listening on.

#define JSB_ENSURE_AUTOCOMPARTMENT (   cx,
  obj 
)
var JSB_ENSURE_AUTOCOMPARTMENT (   var,
  var 
)
local JSB_ENSURE_AUTOCOMPARTMENT (   local,
  local 
)
#define JSB_INCLUDE_CHIPMUNK   1

Whether or not it should include JS bindings for Chipmunk.

local JSB_INCLUDE_CHIPMUNK   1

Whether or not it should include JS bindings for Chipmunk.

#define JSB_INCLUDE_COCOS2D   1

Whether or not it should include JS bindings for cocos2d.

var JSB_INCLUDE_COCOS2D   1

Whether or not it should include JS bindings for cocos2d.

local JSB_INCLUDE_COCOS2D   1

Whether or not it should include JS bindings for cocos2d.

#define
JSB_INCLUDE_COCOSBUILDERREADER   1

Whether or not it should include JS bindings for CocosBuilder Reader.

var JSB_INCLUDE_COCOSBUILDERREADER   1

Whether or not it should include JS bindings for CocosBuilder Reader.

local
JSB_INCLUDE_COCOSBUILDERREADER   1

Whether or not it should include JS bindings for CocosBuilder Reader.

#define JSB_INCLUDE_COCOSDENSHION   1

Whether or not it should include bindings for CocosDenshion (sound engine)

var JSB_INCLUDE_COCOSDENSHION   1

Whether or not it should include bindings for CocosDenshion (sound engine)

local JSB_INCLUDE_COCOSDENSHION   1

Whether or not it should include bindings for CocosDenshion (sound engine)

#define JSB_INCLUDE_NS   1

Whether or not it should include JS bindings for basic NS* / Cocoa / CocoaTouch objects.

It should be enabled in order to support bindings for any objective-c projects. Not needed for pure C projects. Enabled by default.

var JSB_INCLUDE_NS   1

Whether or not it should include JS bindings for basic NS* / Cocoa / CocoaTouch objects.

It should be enabled in order to support bindings for any objective-c projects. Not needed for pure C projects. Enabled by default.

local JSB_INCLUDE_NS   1

Whether or not it should include JS bindings for basic NS* / Cocoa / CocoaTouch objects.

It should be enabled in order to support bindings for any objective-c projects. Not needed for pure C projects. Enabled by default.

#define JSB_INCLUDE_OPENGL   1

Whether or not it should include bindings for WebGL / OpenGL ES 2.0.

var JSB_INCLUDE_OPENGL   1

Whether or not it should include bindings for WebGL / OpenGL ES 2.0.

local JSB_INCLUDE_OPENGL   1

Whether or not it should include bindings for WebGL / OpenGL ES 2.0.

#define JSB_INCLUDE_SYSTEM   1

Whether or not it should include bindings for system components like LocalStorage.

var JSB_INCLUDE_SYSTEM   1

Whether or not it should include bindings for system components like LocalStorage.

local JSB_INCLUDE_SYSTEM   1

Whether or not it should include bindings for system components like LocalStorage.

#define JSB_INCLUDE_XMLHTTP   1

Whether or not it should include bindings for XmlHttpRequest.

var JSB_INCLUDE_XMLHTTP   1

Whether or not it should include bindings for XmlHttpRequest.

local JSB_INCLUDE_XMLHTTP   1

Whether or not it should include bindings for XmlHttpRequest.

#define JSB_MAX_STACK_QUOTA   500000
var JSB_MAX_STACK_QUOTA   500000
local JSB_MAX_STACK_QUOTA   500000
#define JSB_PRECONDITION (   condition,
  ... 
)
Value:
do { \
if( ! (condition) ) { \
cocos2d::log("jsb: ERROR: File %s: Line: %d, Function: %s", __FILE__, __LINE__, __FUNCTION__ ); \
cocos2d::log(__VA_ARGS__); \
JSContext* globalContext = ScriptingCore::getInstance()->getGlobalContext(); \
if( ! JS_IsExceptionPending( globalContext ) ) { \
JS_ReportError( globalContext, __VA_ARGS__ ); \
} \
return JS_FALSE; \
} \
} while(0)
var JSB_PRECONDITION (   var,
  ... 
)
Value:
do { \
if( ! (condition) ) { \
cocos2d::log("jsb: ERROR: File %s: Line: %d, Function: %s", __FILE__, __LINE__, __FUNCTION__ ); \
cocos2d::log(__VA_ARGS__); \
JSContext* globalContext = ScriptingCore::getInstance()->getGlobalContext(); \
if( ! JS_IsExceptionPending( globalContext ) ) { \
JS_ReportError( globalContext, __VA_ARGS__ ); \
} \
return JS_FALSE; \
} \
} while(0)
local JSB_PRECONDITION (   local,
  ... 
)
Value:
do { \
if( ! (condition) ) { \
cocos2d::log("jsb: ERROR: File %s: Line: %d, Function: %s", __FILE__, __LINE__, __FUNCTION__ ); \
cocos2d::log(__VA_ARGS__); \
JSContext* globalContext = ScriptingCore::getInstance()->getGlobalContext(); \
if( ! JS_IsExceptionPending( globalContext ) ) { \
JS_ReportError( globalContext, __VA_ARGS__ ); \
} \
return JS_FALSE; \
} \
} while(0)
#define JSB_PRECONDITION2 (   condition,
  context,
  ret_value,
  ... 
)
Value:
do { \
if( ! (condition) ) { \
cocos2d::log("jsb: ERROR: File %s: Line: %d, Function: %s", __FILE__, __LINE__, __FUNCTION__ ); \
cocos2d::log(__VA_ARGS__); \
if( ! JS_IsExceptionPending( context ) ) { \
JS_ReportError( context, __VA_ARGS__ ); \
} \
return ret_value; \
} \
} while(0)
var JSB_PRECONDITION2 (   var,
  var,
  var,
  ... 
)
Value:
do { \
if( ! (condition) ) { \
cocos2d::log("jsb: ERROR: File %s: Line: %d, Function: %s", __FILE__, __LINE__, __FUNCTION__ ); \
cocos2d::log(__VA_ARGS__); \
if( ! JS_IsExceptionPending( context ) ) { \
JS_ReportError( context, __VA_ARGS__ ); \
} \
return ret_value; \
} \
} while(0)
local JSB_PRECONDITION2 (   local,
  local,
  local,
  ... 
)
Value:
do { \
if( ! (condition) ) { \
cocos2d::log("jsb: ERROR: File %s: Line: %d, Function: %s", __FILE__, __LINE__, __FUNCTION__ ); \
cocos2d::log(__VA_ARGS__); \
if( ! JS_IsExceptionPending( context ) ) { \
JS_ReportError( context, __VA_ARGS__ ); \
} \
return ret_value; \
} \
} while(0)
#define JSB_PRECONDITION3 (   condition,
  context,
  ret_value,
  ... 
)
Value:
do { \
if( ! (condition) ) return (ret_value); \
} while(0)
var JSB_PRECONDITION3 (   var,
  var,
  var,
  ... 
)
Value:
do { \
if( ! (condition) ) return (ret_value); \
} while(0)
local JSB_PRECONDITION3 (   local,
  local,
  local,
  ... 
)
Value:
do { \
if( ! (condition) ) return (ret_value); \
} while(0)
#define
JSB_REPRESENT_LONGLONG_AS_STR   1

When JSB_REPRESENT_LONGLONG_AS_STR is defined, the long long will be represented as JS strings.

Otherwise they will be represented as an array of two intengers. It is needed to to use an special representation since there are no 64-bit integers in JS. Representing the long long as string could be a bit slower, but it is easier to debug from JS. Enabled by default.

var JSB_REPRESENT_LONGLONG_AS_STR   1

When JSB_REPRESENT_LONGLONG_AS_STR is defined, the long long will be represented as JS strings.

Otherwise they will be represented as an array of two intengers. It is needed to to use an special representation since there are no 64-bit integers in JS. Representing the long long as string could be a bit slower, but it is easier to debug from JS. Enabled by default.

local JSB_REPRESENT_LONGLONG_AS_STR   1

When JSB_REPRESENT_LONGLONG_AS_STR is defined, the long long will be represented as JS strings.

Otherwise they will be represented as an array of two intengers. It is needed to to use an special representation since there are no 64-bit integers in JS. Representing the long long as string could be a bit slower, but it is easier to debug from JS. Enabled by default.