2013-08-09 10:07:10 +08:00
|
|
|
#ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_MANUAL_H
|
|
|
|
#define COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_MANUAL_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
#include "tolua++.h"
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-12-22 22:10:21 +08:00
|
|
|
#include "cocos2d.h"
|
2013-12-23 11:19:55 +08:00
|
|
|
#include "LuaScriptHandlerMgr.h"
|
2013-12-22 22:10:21 +08:00
|
|
|
|
|
|
|
NS_CC_BEGIN
|
|
|
|
class LuaEventListenerCustom
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static EventListenerCustom* create(const std::string& eventName);
|
|
|
|
};
|
|
|
|
|
|
|
|
class LuaEventListenerAcceleration
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static EventListenerAcceleration* create();
|
|
|
|
};
|
|
|
|
NS_CC_END
|
|
|
|
|
|
|
|
USING_NS_CC;
|
|
|
|
|
|
|
|
TOLUA_API int register_all_cocos2dx_manual(lua_State* tolua_S);
|
|
|
|
|
|
|
|
TOLUA_API int register_cocos2dx_event_releated(lua_State* tolua_S);
|
|
|
|
|
|
|
|
struct LuaEventListenerAccelerationData
|
|
|
|
{
|
|
|
|
void* acc;
|
|
|
|
Event* event;
|
|
|
|
|
|
|
|
LuaEventListenerAccelerationData(void* inAcc,Event* inEvent)
|
|
|
|
:acc(inAcc),event(inEvent)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct LuaEventListenerKeyboarData
|
|
|
|
{
|
|
|
|
enum class KeyboardStatus :int
|
|
|
|
{
|
|
|
|
PRESSED = 0,
|
|
|
|
RELEASE,
|
|
|
|
};
|
|
|
|
int keyCode;
|
|
|
|
Event* event;
|
2013-12-23 11:19:55 +08:00
|
|
|
ScriptHandlerMgr::HandlerType type;
|
2013-12-22 22:10:21 +08:00
|
|
|
|
2013-12-23 11:19:55 +08:00
|
|
|
LuaEventListenerKeyboarData(int inKeyCode,Event* inEvent,ScriptHandlerMgr::HandlerType inType)
|
|
|
|
:keyCode(inKeyCode),event(inEvent),type(inType)
|
2013-12-22 22:10:21 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct LuaEventListenerTouchData
|
|
|
|
{
|
2013-12-23 11:19:55 +08:00
|
|
|
ScriptHandlerMgr::HandlerType type;
|
2013-12-22 22:10:21 +08:00
|
|
|
void* nativeObject;
|
|
|
|
Touch* touch;
|
|
|
|
Event* event;
|
|
|
|
|
2013-12-23 11:19:55 +08:00
|
|
|
LuaEventListenerTouchData(ScriptHandlerMgr::HandlerType inType, void* inNativeObject, Touch* inTouch, Event* inEvent)
|
|
|
|
: type(inType),
|
2013-12-22 22:10:21 +08:00
|
|
|
nativeObject(inNativeObject),
|
|
|
|
touch(inTouch),
|
|
|
|
event(inEvent)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct LuaEventListenerTouchesData
|
|
|
|
{
|
2013-12-23 11:19:55 +08:00
|
|
|
ScriptHandlerMgr::HandlerType type;
|
2013-12-22 22:10:21 +08:00
|
|
|
void* nativeObject;
|
|
|
|
std::vector<Touch*> touches;
|
|
|
|
Event* event;
|
|
|
|
|
2013-12-23 11:19:55 +08:00
|
|
|
LuaEventListenerTouchesData(ScriptHandlerMgr::HandlerType inType, void* inNativeObject, std::vector<Touch*> inTouches, Event* inEvent)
|
|
|
|
: type(inType),
|
2013-12-22 22:10:21 +08:00
|
|
|
nativeObject(inNativeObject),
|
|
|
|
touches(inTouches),
|
|
|
|
event(inEvent)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct LuaEventListenerMouseData
|
|
|
|
{
|
2013-12-23 11:19:55 +08:00
|
|
|
ScriptHandlerMgr::HandlerType type;
|
2013-12-22 22:10:21 +08:00
|
|
|
void* nativeObject;
|
|
|
|
Event* event;
|
|
|
|
|
2013-12-23 11:19:55 +08:00
|
|
|
LuaEventListenerMouseData(ScriptHandlerMgr::HandlerType inType, void* inNativeObject, Event* inEvent)
|
|
|
|
: type(inType),
|
2013-12-22 22:10:21 +08:00
|
|
|
nativeObject(inNativeObject),
|
|
|
|
event(inEvent)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
2013-08-09 10:07:10 +08:00
|
|
|
|
|
|
|
#endif // #ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_MANUAL_H
|