From 6ffac07a8102bec17efd4590d0a35293c21697f3 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 19 Jul 2013 11:08:47 +0800 Subject: [PATCH] More getter functions: e.g. MenuItemFont::fontSize --> MenuItemFont::getFontSize --- cocos2dx/menu_nodes/CCMenuItem.cpp | 6 +++--- cocos2dx/menu_nodes/CCMenuItem.h | 9 ++++++--- scripting/javascript/bindings/js/jsb_deprecated.js | 11 +++++++++++ tools/tojs/cocos2dx.ini | 6 +++--- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/cocos2dx/menu_nodes/CCMenuItem.cpp b/cocos2dx/menu_nodes/CCMenuItem.cpp index e4aeb9e606..ba73052259 100644 --- a/cocos2dx/menu_nodes/CCMenuItem.cpp +++ b/cocos2dx/menu_nodes/CCMenuItem.cpp @@ -373,7 +373,7 @@ void MenuItemFont::setFontSize(unsigned int s) _globalFontSize = s; } -unsigned int MenuItemFont::fontSize() +unsigned int MenuItemFont::getFontSize() { return _globalFontSize; } @@ -388,7 +388,7 @@ void MenuItemFont::setFontName(const char *name) _globalFontNameRelease = true; } -const char * MenuItemFont::fontName() +const char * MenuItemFont::getFontName() { return _globalFontName.c_str(); } @@ -457,7 +457,7 @@ void MenuItemFont::setFontSizeObj(unsigned int s) recreateLabel(); } -unsigned int MenuItemFont::fontSizeObj() +unsigned int MenuItemFont::getFontSizeObj() const { return _fontSize; } diff --git a/cocos2dx/menu_nodes/CCMenuItem.h b/cocos2dx/menu_nodes/CCMenuItem.h index 0bb6ea7bcb..37cddc1523 100644 --- a/cocos2dx/menu_nodes/CCMenuItem.h +++ b/cocos2dx/menu_nodes/CCMenuItem.h @@ -206,11 +206,13 @@ public: /** set default font size */ static void setFontSize(unsigned int s); /** get default font size */ - static unsigned int fontSize(); + static unsigned int getFontSize(); + CC_DEPRECATED_ATTRIBUTE static unsigned int fontSize() { return MenuItemFont::getFontSize(); }; /** set the default font name */ static void setFontName(const char *name); /** get the default font name */ - static const char *fontName(); + static const char *getFontName(); + CC_DEPRECATED_ATTRIBUTE static const char *fontName() { return MenuItemFont::getFontName(); }; /** set font size * c++ can not overload static and non-static member functions with the same parameter types @@ -219,7 +221,8 @@ public: void setFontSizeObj(unsigned int s); /** get font size */ - unsigned int fontSizeObj(); + unsigned int getFontSizeObj() const; + CC_DEPRECATED_ATTRIBUTE unsigned int fontSizeObj() const { return getFontSizeObj(); }; /** set the font name * c++ can not overload static and non-static member functions with the same parameter types diff --git a/scripting/javascript/bindings/js/jsb_deprecated.js b/scripting/javascript/bindings/js/jsb_deprecated.js index 058c13cdc4..efaf19f4c2 100644 --- a/scripting/javascript/bindings/js/jsb_deprecated.js +++ b/scripting/javascript/bindings/js/jsb_deprecated.js @@ -45,4 +45,15 @@ var cc = cc || {}; return cc.Node.prototype.getParentToNodeTransform.apply(this, arguments); }; + cc.Node.prototype.numberOfRunningActions = function() { + logW("cc.Node.numberOfRunningActions", "cc.Node.getNumberOfRunningActions"); + return cc.Node.prototype.getNumberOfRunningActions.apply(this, arguments); + }; + + cc.Node.prototype.numberOfRunningActionsInTarget = function() { + logW("cc.Node.numberOfRunningActionsInTarget", "cc.Node.getNumberOfRunningActionsInTarget"); + return cc.Node.prototype.getNumberOfRunningActionsInTarget.apply(this, arguments); + }; + + })(); diff --git a/tools/tojs/cocos2dx.ini b/tools/tojs/cocos2dx.ini index aa049283ce..7987ae5e24 100644 --- a/tools/tojs/cocos2dx.ini +++ b/tools/tojs/cocos2dx.ini @@ -97,7 +97,7 @@ skip = Node::[^setPosition$ getGrid setGLServerState description getUserObject . CardinalSpline.*::[create actionWithDuration setPoints], Scheduler::[pause resume unschedule schedule update isTargetPaused], TextureCache::[addPVRTCImage], - Timer::[getSelector], + Timer::[getSelector createWithScriptHandler], *::[copyWith.* onEnter.* onExit.* ^description$ getObjectType], FileUtils::[(g|s)etSearchResolutionsOrder$ (g|s)etSearchPaths$ getClassTypeInfo], SimpleAudioEngine::[getClassTypeInfo], @@ -105,8 +105,8 @@ skip = Node::[^setPosition$ getGrid setGLServerState description getUserObject . Camera::[getEyeXYZ getCenterXYZ getUpXYZ], ccFontDefinition::[*] -rename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames spriteFrameByName=getSpriteFrame isFlipX=isFlippedX isFlipY=isFlippedY], - MenuItemFont::[setFontNameObj=setFontName setFontSizeObj=setFontSize fontSizeObj=fontSize fontNameObj=fontName], +rename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames getSpriteFrameByName=getSpriteFrame isFlipX=isFlippedX isFlipY=isFlippedY], + MenuItemFont::[setFontNameObj=setFontName setFontSizeObj=setFontSize getFontSizeObj=getFontSize getFontNameObj=getFontName], ProgressTimer::[setReverseProgress=setReverseDirection], Animation::[addSpriteFrameWithFileName=addSpriteFrameWithFile], AnimationCache::[addAnimationsWithFile=addAnimations animationByName=getAnimation removeAnimationByName=removeAnimation],