2012-06-13 02:59:49 +08:00
|
|
|
#ifndef _CCB_CCNODELOADER_H_
|
|
|
|
#define _CCB_CCNODELOADER_H_
|
2012-05-31 02:28:50 +08:00
|
|
|
|
|
|
|
#include "cocos2d.h"
|
|
|
|
#include "CCBReader.h"
|
|
|
|
|
|
|
|
NS_CC_EXT_BEGIN
|
|
|
|
|
2012-06-05 06:52:49 +08:00
|
|
|
struct BlockData {
|
|
|
|
SEL_MenuHandler mSELMenuHandler;
|
|
|
|
CCObject * mTarget;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BlockCCControlData {
|
2012-06-07 05:32:15 +08:00
|
|
|
SEL_CCControlHandler mSELCCControlHandler;
|
2012-06-05 06:52:49 +08:00
|
|
|
CCObject * mTarget;
|
|
|
|
int mControlEvents;
|
|
|
|
};
|
|
|
|
|
2012-05-31 02:28:50 +08:00
|
|
|
/* Forward declaration. */
|
|
|
|
class CCBReader;
|
|
|
|
|
2012-06-06 08:15:28 +08:00
|
|
|
class CC_DLL CCNodeLoader : public CCObject {
|
2012-05-31 02:28:50 +08:00
|
|
|
public:
|
2012-06-06 08:15:28 +08:00
|
|
|
STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCNodeLoader, loader);
|
|
|
|
|
2012-05-31 07:51:33 +08:00
|
|
|
virtual CCNode * loadCCNode(CCNode *, CCBReader *);
|
|
|
|
virtual void parseProperties(CCNode *, CCNode *, CCBReader *);
|
2012-05-31 02:28:50 +08:00
|
|
|
|
|
|
|
protected:
|
2012-05-31 07:51:33 +08:00
|
|
|
virtual CCNode * createCCNode(CCNode *, CCBReader *);
|
2012-05-31 02:28:50 +08:00
|
|
|
|
2012-05-31 07:51:33 +08:00
|
|
|
virtual CCPoint parsePropTypePosition(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual CCPoint parsePropTypePoint(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual CCPoint parsePropTypePointLock(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual CCSize parsePropTypeSize(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual float * parsePropTypeScaleLock(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual float parsePropTypeFloat(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual float parsePropTypeDegrees(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual float parsePropTypeFloatScale(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual int parsePropTypeInteger(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual int parsePropTypeIntegerLabeled(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual float * parsePropTypeFloatVar(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual bool parsePropTypeCheck(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual CCSpriteFrame * parsePropTypeSpriteFrame(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual CCAnimation * parsePropTypeAnimation(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual CCTexture2D * parsePropTypeTexture(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual unsigned char parsePropTypeByte(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual ccColor3B parsePropTypeColor3(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual ccColor4F * parsePropTypeColor4FVar(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual bool * parsePropTypeFlip(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual ccBlendFunc parsePropTypeBlendFunc(CCNode *, CCNode *, CCBReader *);
|
2012-06-05 08:45:25 +08:00
|
|
|
virtual const char * parsePropTypeFntFile(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual const char * parsePropTypeString(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual const char * parsePropTypeText(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual const char * parsePropTypeFontTTF(CCNode *, CCNode *, CCBReader *);
|
2012-06-05 06:52:49 +08:00
|
|
|
virtual BlockData * parsePropTypeBlock(CCNode *, CCNode *, CCBReader *);
|
|
|
|
virtual BlockCCControlData * parsePropTypeBlockCCControl(CCNode *, CCNode *, CCBReader *);
|
2012-06-01 05:57:13 +08:00
|
|
|
virtual CCNode * parsePropTypeCCBFile(CCNode *, CCNode *, CCBReader *);
|
2012-05-31 02:28:50 +08:00
|
|
|
|
|
|
|
|
2012-06-05 08:45:25 +08:00
|
|
|
virtual void onHandlePropTypePosition(CCNode *, CCNode *, const char *, CCPoint, CCBReader *);
|
|
|
|
virtual void onHandlePropTypePoint(CCNode *, CCNode *, const char *, CCPoint, CCBReader *);
|
|
|
|
virtual void onHandlePropTypePointLock(CCNode *, CCNode *, const char *, CCPoint, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeSize(CCNode *, CCNode *, const char *, CCSize, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeScaleLock(CCNode *, CCNode *, const char *, float *, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeFloat(CCNode *, CCNode *, const char *, float, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeDegrees(CCNode *, CCNode *, const char *, float, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeFloatScale(CCNode *, CCNode *, const char *, float, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeInteger(CCNode *, CCNode *, const char *, int, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeIntegerLabeled(CCNode *, CCNode *, const char *, int, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeFloatVar(CCNode *, CCNode *, const char *, float *, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeCheck(CCNode *, CCNode *, const char *, bool, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeSpriteFrame(CCNode *, CCNode *, const char *, CCSpriteFrame *, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeAnimation(CCNode *, CCNode *, const char *, CCAnimation *, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeTexture(CCNode *, CCNode *, const char *, CCTexture2D *, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeByte(CCNode *, CCNode *, const char *, unsigned char, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeColor3(CCNode *, CCNode *, const char *, ccColor3B, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeColor4FVar(CCNode *, CCNode *, const char *, ccColor4F *, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeFlip(CCNode *, CCNode *, const char *, bool *, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeBlendFunc(CCNode *, CCNode *, const char *, ccBlendFunc, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeFntFile(CCNode *, CCNode *, const char *, const char *, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeString(CCNode *, CCNode *, const char *, const char *, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeText(CCNode *, CCNode *, const char *, const char *, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeFontTTF(CCNode *, CCNode *, const char *, const char *, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeBlock(CCNode *, CCNode *, const char *, BlockData *, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeBlockCCControl(CCNode *, CCNode *, const char *, BlockCCControlData *, CCBReader *);
|
|
|
|
virtual void onHandlePropTypeCCBFile(CCNode *, CCNode *, const char *, CCNode *, CCBReader *);
|
2012-05-31 02:28:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
NS_CC_EXT_END
|
|
|
|
|
|
|
|
#endif
|