mirror of https://github.com/axmolengine/axmol.git
Merge pull request #5143 from pandamicro/develop
closed #3806: SAXParser was supported with manual binding in JSB
This commit is contained in:
commit
9292d92f63
|
@ -1 +1 @@
|
||||||
46ff200bdf412bcf4cfe2d6ceebadf60657fc4eb
|
78c55aef49f55476255cc9ee58d5c1e860933b0f
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include "jsapi.h"
|
#include "jsapi.h"
|
||||||
#include "ScriptingCore.h"
|
#include "ScriptingCore.h"
|
||||||
|
#include "platform/CCSAXParser.h"
|
||||||
|
|
||||||
class JSScheduleWrapper;
|
class JSScheduleWrapper;
|
||||||
|
|
||||||
|
@ -200,5 +201,44 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class CC_DLL __JSSAXDelegator: public cocos2d::SAXDelegator
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static __JSSAXDelegator* getInstance() {
|
||||||
|
static __JSSAXDelegator* pInstance = NULL;
|
||||||
|
if (pInstance == NULL) {
|
||||||
|
pInstance = new __JSSAXDelegator();
|
||||||
|
}
|
||||||
|
return pInstance;
|
||||||
|
};
|
||||||
|
|
||||||
|
~__JSSAXDelegator();
|
||||||
|
|
||||||
|
cocos2d::SAXParser* getParser();
|
||||||
|
|
||||||
|
std::string parse(const std::string& path);
|
||||||
|
|
||||||
|
bool preloadPlist(const std::string& path) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string getList(const std::string& path) {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
// implement pure virtual methods of SAXDelegator
|
||||||
|
void startElement(void *ctx, const char *name, const char **atts);
|
||||||
|
void endElement(void *ctx, const char *name);
|
||||||
|
void textHandler(void *ctx, const char *ch, int len);
|
||||||
|
|
||||||
|
private:
|
||||||
|
cocos2d::SAXParser _parser;
|
||||||
|
JSObject* _obj;
|
||||||
|
std::string _result;
|
||||||
|
bool _isStoringCharacters;
|
||||||
|
std::string _currentValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 301c8e9f6ba2f9d9d6012f6581cb40eddcc3840a
|
Subproject commit 85f476b018cebcb6632b9de1b3a339fb885e8c0f
|
|
@ -26,7 +26,7 @@ headers = %(cocosdir)s/cocos/2d/cocos2d.h %(cocosdir)s/cocos/audio/include/Simpl
|
||||||
|
|
||||||
# what classes to produce code for. You can use regular expressions here. When testing the regular
|
# what classes to produce code for. You can use regular expressions here. When testing the regular
|
||||||
# expression, it will be enclosed in "^$", like this: "^Menu*$".
|
# expression, it will be enclosed in "^$", like this: "^Menu*$".
|
||||||
classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set SimpleAudioEngine Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak TextFieldTTF EGLViewProtocol EGLView Component __NodeRGBA __LayerRGBA
|
classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set SimpleAudioEngine Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak TextFieldTTF EGLViewProtocol EGLView Component __NodeRGBA __LayerRGBA SAXParser
|
||||||
|
|
||||||
classes_need_extend = Node Layer.* Sprite MenuItemFont Scene DrawNode
|
classes_need_extend = Node Layer.* Sprite MenuItemFont Scene DrawNode
|
||||||
|
|
||||||
|
@ -60,11 +60,11 @@ skip = Node::[^setPosition$ setGLServerState description getUserObject .*UserDat
|
||||||
Texture2D::[initWithPVRTCData addPVRTCImage releaseData setTexParameters initWithData keepData getPixelFormatInfoMap],
|
Texture2D::[initWithPVRTCData addPVRTCImage releaseData setTexParameters initWithData keepData getPixelFormatInfoMap],
|
||||||
Set::[begin end acceptVisitor],
|
Set::[begin end acceptVisitor],
|
||||||
IMEDispatcher::[*],
|
IMEDispatcher::[*],
|
||||||
SAXParser::[*],
|
|
||||||
Thread::[*],
|
Thread::[*],
|
||||||
Profiler::[*],
|
Profiler::[*],
|
||||||
ProfilingTimer::[*],
|
ProfilingTimer::[*],
|
||||||
CallFunc::[create initWithFunction],
|
CallFunc::[create initWithFunction],
|
||||||
|
SAXParser::[(?!(init))],
|
||||||
SAXDelegator::[*],
|
SAXDelegator::[*],
|
||||||
Color3bObject::[*],
|
Color3bObject::[*],
|
||||||
TouchDispatcher::[*],
|
TouchDispatcher::[*],
|
||||||
|
@ -105,14 +105,13 @@ skip = Node::[^setPosition$ setGLServerState description getUserObject .*UserDat
|
||||||
TextureCache::[addPVRTCImage addImageAsync],
|
TextureCache::[addPVRTCImage addImageAsync],
|
||||||
Timer::[getSelector createWithScriptHandler],
|
Timer::[getSelector createWithScriptHandler],
|
||||||
*::[copyWith.* onEnter.* onExit.* ^description$ getObjectType onTouch.* onAcc.* onKey.* onRegisterTouchListener],
|
*::[copyWith.* onEnter.* onExit.* ^description$ getObjectType onTouch.* onAcc.* onKey.* onRegisterTouchListener],
|
||||||
FileUtils::[(g|s)etSearchResolutionsOrder$ (g|s)etSearchPaths$ getFileData getDataFromFile getFullPathCache],
|
FileUtils::[(g|s)etSearchResolutionsOrder$ (g|s)etSearchPaths$ getFileData getDataFromFile getWritablePath setPopupNotify destroyInstance getFullPathCache],
|
||||||
Application::[^application.* ^run$],
|
Application::[^application.* ^run$],
|
||||||
Camera::[getEyeXYZ getCenterXYZ getUpXYZ],
|
Camera::[getEyeXYZ getCenterXYZ getUpXYZ],
|
||||||
ccFontDefinition::[*],
|
ccFontDefinition::[*],
|
||||||
NewTextureAtlas::[*],
|
NewTextureAtlas::[*],
|
||||||
RenderTexture::[listenToBackground listenToForeground]
|
RenderTexture::[listenToBackground listenToForeground]
|
||||||
|
|
||||||
|
|
||||||
rename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames getSpriteFrameByName=getSpriteFrame],
|
rename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames getSpriteFrameByName=getSpriteFrame],
|
||||||
MenuItemFont::[setFontNameObj=setFontName setFontSizeObj=setFontSize getFontSizeObj=getFontSize getFontNameObj=getFontName],
|
MenuItemFont::[setFontNameObj=setFontName setFontSizeObj=setFontSize getFontSizeObj=getFontSize getFontNameObj=getFontName],
|
||||||
ProgressTimer::[setReverseProgress=setReverseDirection],
|
ProgressTimer::[setReverseProgress=setReverseDirection],
|
||||||
|
@ -120,7 +119,7 @@ rename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames ge
|
||||||
LayerGradient::[initWithColor=init],
|
LayerGradient::[initWithColor=init],
|
||||||
LayerColor::[initWithColor=init],
|
LayerColor::[initWithColor=init],
|
||||||
GLProgram::[initWithVertexShaderByteArray=initWithString initWithVertexShaderFilename=init programLog=getProgramLog setUniformLocationWith1i=setUniformLocationI32],
|
GLProgram::[initWithVertexShaderByteArray=initWithString initWithVertexShaderFilename=init programLog=getProgramLog setUniformLocationWith1i=setUniformLocationI32],
|
||||||
Node::[removeFromParentAndCleanup=removeFromParent removeAllChildrenWithCleanup=removeAllChildren],
|
Node::[removeFromParentAndCleanup=removeFromParent removeAllChildrenWithCleanup=removeAllChildren getLocalZOrder=getZOrder],
|
||||||
LabelAtlas::[create=_create],
|
LabelAtlas::[create=_create],
|
||||||
Sprite::[initWithFile=init],
|
Sprite::[initWithFile=init],
|
||||||
SpriteBatchNode::[initWithFile=init removeAllChildrenWithCleanup=removeAllChildren],
|
SpriteBatchNode::[initWithFile=init removeAllChildrenWithCleanup=removeAllChildren],
|
||||||
|
@ -137,14 +136,14 @@ rename_classes = ParticleSystemQuad::ParticleSystem,
|
||||||
remove_prefix =
|
remove_prefix =
|
||||||
|
|
||||||
# classes for which there will be no "parent" lookup
|
# classes for which there will be no "parent" lookup
|
||||||
classes_have_no_parents = Node Director SimpleAudioEngine FileUtils TMXMapInfo Application EGLViewProtocol
|
classes_have_no_parents = Node Director SimpleAudioEngine FileUtils TMXMapInfo Application EGLViewProtocol SAXParser
|
||||||
|
|
||||||
# base classes which will be skipped when their sub-classes found them.
|
# base classes which will be skipped when their sub-classes found them.
|
||||||
base_classes_to_skip = Object Clonable
|
base_classes_to_skip = Object Clonable
|
||||||
|
|
||||||
# classes that create no constructor
|
# classes that create no constructor
|
||||||
# Set is special and we will use a hand-written constructor
|
# Set is special and we will use a hand-written constructor
|
||||||
abstract_classes = Action FiniteTimeAction ActionInterval ActionEase EaseRateAction EaseElastic EaseBounce ActionInstant GridAction Grid3DAction TiledGrid3DAction Director SpriteFrameCache TransitionEaseScene Set SimpleAudioEngine FileUtils Application ClippingNode Label EGLViewProtocol EGLView Component
|
abstract_classes = Action FiniteTimeAction ActionInterval ActionEase EaseRateAction EaseElastic EaseBounce ActionInstant GridAction Grid3DAction TiledGrid3DAction Director SpriteFrameCache TransitionEaseScene Set SimpleAudioEngine FileUtils Application ClippingNode Label EGLViewProtocol EGLView Component SAXParser
|
||||||
|
|
||||||
# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.
|
# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.
|
||||||
script_control_cpp = no
|
script_control_cpp = no
|
||||||
|
|
Loading…
Reference in New Issue