From 5bc95780c0429203c9609edc0f07db4424694a12 Mon Sep 17 00:00:00 2001 From: dualface Date: Sun, 2 Dec 2012 15:48:15 +0800 Subject: [PATCH] update luabinding --- .../cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id | 2 +- tools/tolua++/CCApplication.pkg | 1 + tools/tolua++/CCDirector.pkg | 6 +++--- tools/tolua++/CCKeypadDispatcher.pkg | 6 ++++++ tools/tolua++/CCLabelBMFont.pkg | 2 -- tools/tolua++/CCLayer.pkg | 8 +++++++- tools/tolua++/CCSprite.pkg | 2 -- tools/tolua++/CCTouchDispatcher.pkg | 6 ++++++ tools/tolua++/Cocos2d.pkg | 2 ++ tools/tolua++/basic.lua | 11 ----------- 10 files changed, 26 insertions(+), 20 deletions(-) create mode 100644 tools/tolua++/CCKeypadDispatcher.pkg create mode 100644 tools/tolua++/CCTouchDispatcher.pkg diff --git a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id index 34b07dcf1c..a65a4bc0a8 100644 --- a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id +++ b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id @@ -1 +1 @@ -58e432f8cbf9f340398f9d6db2b61303b6a06034 \ No newline at end of file +4aaca551348faf166a1d43ff3db90b59bcd16212 \ No newline at end of file diff --git a/tools/tolua++/CCApplication.pkg b/tools/tolua++/CCApplication.pkg index 669cea1698..3f283ab186 100644 --- a/tools/tolua++/CCApplication.pkg +++ b/tools/tolua++/CCApplication.pkg @@ -23,6 +23,7 @@ enum TargetPlatform class CCApplication { + ~CCApplication(); static CCApplication* sharedApplication(); ccLanguageType getCurrentLanguage(); TargetPlatform getTargetPlatform(); diff --git a/tools/tolua++/CCDirector.pkg b/tools/tolua++/CCDirector.pkg index 85a61cb6df..84cce1fb53 100644 --- a/tools/tolua++/CCDirector.pkg +++ b/tools/tolua++/CCDirector.pkg @@ -13,7 +13,6 @@ class CCDirector : public CCObject double getAnimationInterval(void); bool isDisplayStats(void); - void setDisplayStats(bool bDisplayFPS); bool isPaused(void); unsigned int getTotalFrames(void); @@ -37,12 +36,13 @@ class CCDirector : public CCObject void end @ endToLua (); float getContentScaleFactor(void); + void setContentScaleFactor(float scaleFactor); CCScheduler* getScheduler(); CCActionManager* getActionManager(); CCTouchDispatcher* getTouchDispatcher(); - CCKeypadDispatcher* getKeypadDispatcher(); - CCAccelerometer* getAccelerometer(); + // CCKeypadDispatcher* getKeypadDispatcher(); + // CCAccelerometer* getAccelerometer(); void setDepthTest(bool var); void setProjection(ccDirectorProjection kProjection); diff --git a/tools/tolua++/CCKeypadDispatcher.pkg b/tools/tolua++/CCKeypadDispatcher.pkg new file mode 100644 index 0000000000..868e390bec --- /dev/null +++ b/tools/tolua++/CCKeypadDispatcher.pkg @@ -0,0 +1,6 @@ + +typedef enum { + // the back key clicked msg + kTypeBackClicked = 1, + kTypeMenuClicked, +} ccKeypadMSGType; diff --git a/tools/tolua++/CCLabelBMFont.pkg b/tools/tolua++/CCLabelBMFont.pkg index 7c7aca953b..08d31a8c14 100644 --- a/tools/tolua++/CCLabelBMFont.pkg +++ b/tools/tolua++/CCLabelBMFont.pkg @@ -31,8 +31,6 @@ class CCLabelBMFont : public CCNode bool isOpacityModifyRGB(); void setOpacityModifyRGB(bool isOpacityModifyRGB); - tolua_property__CCOpacity GLubyte opacity; - static void purgeCachedData(); static CCLabelBMFont * create(const char *str, const char *fntFile, float width = kCCLabelAutomaticWidth, CCTextAlignment alignment = kCCTextAlignmentLeft, CCPoint imageOffset = CCPointMake(0, 0)); static CCLabelBMFont * create(); diff --git a/tools/tolua++/CCLayer.pkg b/tools/tolua++/CCLayer.pkg index 67036125fa..d9f5becb69 100644 --- a/tools/tolua++/CCLayer.pkg +++ b/tools/tolua++/CCLayer.pkg @@ -10,12 +10,18 @@ class CCLayer : public CCNode void setKeypadEnabled(bool bValue); bool isKeypadEnabled(); - void registerScriptTouchHandler(LUA_FUNCTION funcID, + void registerScriptTouchHandler(LUA_FUNCTION nHandler, bool bIsMultiTouches = false, int nPriority = 0, bool bSwallowsTouches = false); void unregisterScriptTouchHandler(); + void registerScriptKeypadHandler(LUA_FUNCTION nHandler); + void unregisterScriptKeypadHandler(void); + + void registerScriptAccelerateHandler(LUA_FUNCTION nHandler); + void unregisterScriptAccelerateHandler(void); + static CCLayer *create(void); }; diff --git a/tools/tolua++/CCSprite.pkg b/tools/tolua++/CCSprite.pkg index 8076c4619c..294dad79e3 100644 --- a/tools/tolua++/CCSprite.pkg +++ b/tools/tolua++/CCSprite.pkg @@ -68,8 +68,6 @@ class CCSprite : public CCNode void setOpacity(GLubyte opacity); GLubyte getOpacity(void); - tolua_property__CCOpacity GLubyte opacity; - void setColor(ccColor3B color3); ccColor3B getColor(void); void setOpacityModifyRGB(bool bValue); diff --git a/tools/tolua++/CCTouchDispatcher.pkg b/tools/tolua++/CCTouchDispatcher.pkg new file mode 100644 index 0000000000..8ef8227d07 --- /dev/null +++ b/tools/tolua++/CCTouchDispatcher.pkg @@ -0,0 +1,6 @@ + +class CCTouchDispatcher : public CCObject +{ + bool isDispatchEvents(void); + void setDispatchEvents(bool bDispatchEvents); +}; diff --git a/tools/tolua++/Cocos2d.pkg b/tools/tolua++/Cocos2d.pkg index b7f3442638..f507c15007 100644 --- a/tools/tolua++/Cocos2d.pkg +++ b/tools/tolua++/Cocos2d.pkg @@ -16,9 +16,11 @@ $pfile "CCFileUtils.pkg" $pfile "CCDrawingPrimitives.pkg" $pfile "CCAffineTransform.pkg" $pfile "CCApplication.pkg" +$pfile "CCTouchDispatcher.pkg" $pfile "CCDirector.pkg" $pfile "CCUserDefault.pkg" $pfile "CCNotificationCenter.pkg" +$pfile "CCKeypadDispatcher.pkg" $pfile "CCNode.pkg" $pfile "CCTexture2D.pkg" diff --git a/tools/tolua++/basic.lua b/tools/tolua++/basic.lua index d7eec9a4e9..e6ea8a63f9 100644 --- a/tools/tolua++/basic.lua +++ b/tools/tolua++/basic.lua @@ -201,14 +201,3 @@ _to_functions["LUA_FUNCTION"] = "toluafix_ref_function" _is_functions["LUA_FUNCTION"] = "toluafix_isfunction" _to_functions["LUA_TABLE"] = "toluafix_totable" _is_functions["LUA_TABLE"] = "toluafix_istable" - - -function get_property_methods_hook(ptype, name) - if ptype == "IsVisible" then - return "isVisible", "setVisible" - end - if string.sub(ptype, 1, 2) == "CC" then - ptype = string.sub(ptype, 3) - end - return "get"..ptype, "set"..ptype -end