From 2549804dec28b23d18a2bb181613cacb9ea5b419 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 20 Sep 2013 20:09:39 +0800 Subject: [PATCH] fix compiling errors --- .../javascript/bindings/ScriptingCore.cpp | 36 +++++++++---------- scripting/javascript/bindings/ScriptingCore.h | 6 ++-- .../cocos2d_specifics.cpp.REMOVED.git-id | 2 +- .../javascript/bindings/cocos2d_specifics.hpp | 2 +- .../lua/cocos2dx_support/CCLuaEngine.cpp | 22 ++++++------ 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/scripting/javascript/bindings/ScriptingCore.cpp b/scripting/javascript/bindings/ScriptingCore.cpp index 9b51d0b503..3a6f4aa4ae 100644 --- a/scripting/javascript/bindings/ScriptingCore.cpp +++ b/scripting/javascript/bindings/ScriptingCore.cpp @@ -106,38 +106,38 @@ static void executeJSFunctionFromReservedSpot(JSContext *cx, JSObject *obj, } } -static void getTouchesFuncName(TouchEvent::EventCode eventCode, std::string &funcName) +static void getTouchesFuncName(EventTouch::EventCode eventCode, std::string &funcName) { switch(eventCode) { - case TouchEvent::EventCode::BEGAN: + case EventTouch::EventCode::BEGAN: funcName = "onTouchesBegan"; break; - case TouchEvent::EventCode::ENDED: + case EventTouch::EventCode::ENDED: funcName = "onTouchesEnded"; break; - case TouchEvent::EventCode::MOVED: + case EventTouch::EventCode::MOVED: funcName = "onTouchesMoved"; break; - case TouchEvent::EventCode::CANCELLED: + case EventTouch::EventCode::CANCELLED: funcName = "onTouchesCancelled"; break; } } -static void getTouchFuncName(TouchEvent::EventCode eventCode, std::string &funcName) +static void getTouchFuncName(EventTouch::EventCode eventCode, std::string &funcName) { switch(eventCode) { - case TouchEvent::EventCode::BEGAN: + case EventTouch::EventCode::BEGAN: funcName = "onTouchBegan"; break; - case TouchEvent::EventCode::ENDED: + case EventTouch::EventCode::ENDED: funcName = "onTouchEnded"; break; - case TouchEvent::EventCode::MOVED: + case EventTouch::EventCode::MOVED: funcName = "onTouchMoved"; break; - case TouchEvent::EventCode::CANCELLED: + case EventTouch::EventCode::CANCELLED: funcName = "onTouchCancelled"; break; } @@ -839,7 +839,7 @@ int ScriptingCore::handleTouchesEvent(void* data) return 0; Layer* pLayer = static_cast(touchesScriptData->nativeObject); - TouchEvent::EventCode eventType = touchesScriptData->actionType; + EventTouch::EventCode eventType = touchesScriptData->actionType; const std::vector& touches = touchesScriptData->touches; std::string funcName = ""; @@ -884,7 +884,7 @@ int ScriptingCore::handleTouchEvent(void* data) return 0; Layer* pLayer = static_cast(touchScriptData->nativeObject); - TouchEvent::EventCode eventType = touchScriptData->actionType; + EventTouch::EventCode eventType = touchScriptData->actionType; Touch *pTouch = touchScriptData->touch; @@ -980,7 +980,7 @@ int ScriptingCore::handleKeypadEvent(void* data) if (NULL == keypadScriptData->nativeObject) return 0; - KeyboardEvent::KeyCode action = keypadScriptData->actionType; + EventKeyboard::KeyCode action = keypadScriptData->actionType; js_proxy_t * p = jsb_get_native_proxy(keypadScriptData->nativeObject); @@ -989,7 +989,7 @@ int ScriptingCore::handleKeypadEvent(void* data) JSBool ret = JS_FALSE; switch(action) { - case KeyboardEvent::KeyCode::KEY_BACKSPACE: + case EventKeyboard::KeyCode::KEY_BACKSPACE: ret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), "onBackClicked"); if (!ret) { @@ -1000,7 +1000,7 @@ int ScriptingCore::handleKeypadEvent(void* data) } } break; - case KeyboardEvent::KeyCode::KEY_MENU: + case EventKeyboard::KeyCode::KEY_MENU: ret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), "onMenuClicked"); if (!ret) { @@ -1021,7 +1021,7 @@ int ScriptingCore::handleKeypadEvent(void* data) } -int ScriptingCore::executeCustomTouchesEvent(TouchEvent::EventCode eventType, +int ScriptingCore::executeCustomTouchesEvent(EventTouch::EventCode eventType, const std::vector& touches, JSObject *obj) { jsval retval; @@ -1055,7 +1055,7 @@ int ScriptingCore::executeCustomTouchesEvent(TouchEvent::EventCode eventType, } -int ScriptingCore::executeCustomTouchEvent(TouchEvent::EventCode eventType, +int ScriptingCore::executeCustomTouchEvent(EventTouch::EventCode eventType, Touch *pTouch, JSObject *obj) { jsval retval; @@ -1074,7 +1074,7 @@ int ScriptingCore::executeCustomTouchEvent(TouchEvent::EventCode eventType, } -int ScriptingCore::executeCustomTouchEvent(TouchEvent::EventCode eventType, +int ScriptingCore::executeCustomTouchEvent(EventTouch::EventCode eventType, Touch *pTouch, JSObject *obj, jsval &retval) { diff --git a/scripting/javascript/bindings/ScriptingCore.h b/scripting/javascript/bindings/ScriptingCore.h index a6ce6c5348..f7b8cb29e1 100644 --- a/scripting/javascript/bindings/ScriptingCore.h +++ b/scripting/javascript/bindings/ScriptingCore.h @@ -140,11 +140,11 @@ public: static void removeAllRoots(JSContext *cx); - int executeCustomTouchEvent(TouchEvent::EventCode eventType, + int executeCustomTouchEvent(EventTouch::EventCode eventType, Touch *pTouch, JSObject *obj, jsval &retval); - int executeCustomTouchEvent(TouchEvent::EventCode eventType, + int executeCustomTouchEvent(EventTouch::EventCode eventType, Touch *pTouch, JSObject *obj); - int executeCustomTouchesEvent(TouchEvent::EventCode eventType, + int executeCustomTouchesEvent(EventTouch::EventCode eventType, const std::vector& touches, JSObject *obj); /** * @return the global context diff --git a/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id b/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id index ec646e0263..ec4aa352c7 100644 --- a/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id +++ b/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id @@ -1 +1 @@ -7756f6d4cf4b992057e4f9b619a10021af30cd11 \ No newline at end of file +b88df18e2512b5111debda3991f51c2e72a2e5da \ No newline at end of file diff --git a/scripting/javascript/bindings/cocos2d_specifics.hpp b/scripting/javascript/bindings/cocos2d_specifics.hpp index 72b452a73e..1072cc8064 100644 --- a/scripting/javascript/bindings/cocos2d_specifics.hpp +++ b/scripting/javascript/bindings/cocos2d_specifics.hpp @@ -218,7 +218,7 @@ private: typedef std::pair TouchDelegatePair; static TouchDelegateMap sTouchDelegateMap; bool _needUnroot; - TouchEventListener* _touchListener; + EventListenerTouch* _touchListener; }; diff --git a/scripting/lua/cocos2dx_support/CCLuaEngine.cpp b/scripting/lua/cocos2dx_support/CCLuaEngine.cpp index ea380dcd76..21ded3f9b9 100644 --- a/scripting/lua/cocos2dx_support/CCLuaEngine.cpp +++ b/scripting/lua/cocos2dx_support/CCLuaEngine.cpp @@ -400,14 +400,14 @@ int LuaEngine::handleKeypadEvent(void* data) if (0 == handler) return 0; - KeyboardEvent::KeyCode action = keypadScriptData->actionType; + EventKeyboard::KeyCode action = keypadScriptData->actionType; switch(action) { - case KeyboardEvent::KeyCode::KEY_BACKSPACE: + case EventKeyboard::KeyCode::KEY_BACKSPACE: _stack->pushString("backClicked"); break; - case KeyboardEvent::KeyCode::KEY_MENU: + case EventKeyboard::KeyCode::KEY_MENU: _stack->pushString("menuClicked"); break; default: @@ -484,19 +484,19 @@ int LuaEngine::handleTouchEvent(void* data) switch (touchScriptData->actionType) { - case TouchEvent::EventCode::BEGAN: + case EventTouch::EventCode::BEGAN: _stack->pushString("began"); break; - case TouchEvent::EventCode::MOVED: + case EventTouch::EventCode::MOVED: _stack->pushString("moved"); break; - case TouchEvent::EventCode::ENDED: + case EventTouch::EventCode::ENDED: _stack->pushString("ended"); break; - case TouchEvent::EventCode::CANCELLED: + case EventTouch::EventCode::CANCELLED: _stack->pushString("cancelled"); break; @@ -533,19 +533,19 @@ int LuaEngine::handleTouchesEvent(void* data) switch (touchesScriptData->actionType) { - case TouchEvent::EventCode::BEGAN: + case EventTouch::EventCode::BEGAN: _stack->pushString("began"); break; - case TouchEvent::EventCode::MOVED: + case EventTouch::EventCode::MOVED: _stack->pushString("moved"); break; - case TouchEvent::EventCode::ENDED: + case EventTouch::EventCode::ENDED: _stack->pushString("ended"); break; - case TouchEvent::EventCode::CANCELLED: + case EventTouch::EventCode::CANCELLED: _stack->pushString("cancelled"); break;