2012-06-13 02:59:49 +08:00
|
|
|
#ifndef _CCB_CCBSELECTORRESOLVER_H_
|
|
|
|
#define _CCB_CCBSELECTORRESOLVER_H_
|
2012-06-05 06:52:49 +08:00
|
|
|
|
|
|
|
#include "cocos2d.h"
|
2012-07-20 14:05:52 +08:00
|
|
|
#include "ExtensionMacros.h"
|
2012-09-19 08:38:33 +08:00
|
|
|
#include "../GUI/CCControlExtension/CCInvocation.h"
|
2012-06-05 06:52:49 +08:00
|
|
|
|
2012-09-24 11:47:33 +08:00
|
|
|
|
2012-06-05 06:52:49 +08:00
|
|
|
NS_CC_EXT_BEGIN
|
|
|
|
|
2012-06-15 09:16:54 +08:00
|
|
|
#define CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(TARGET, SELECTORNAME, METHOD) if(pTarget == TARGET && pSelectorName->compare(SELECTORNAME) == 0) { \
|
|
|
|
return menu_selector(METHOD); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define CCB_SELECTORRESOLVER_CCCONTROL_GLUE(TARGET, SELECTORNAME, METHOD) if(pTarget == TARGET && pSelectorName->compare(SELECTORNAME) == 0) { \
|
|
|
|
return cccontrol_selector(METHOD); \
|
|
|
|
}
|
|
|
|
|
2012-07-20 14:05:52 +08:00
|
|
|
class CCBSelectorResolver {
|
2012-06-05 06:52:49 +08:00
|
|
|
public:
|
2012-06-19 03:03:06 +08:00
|
|
|
virtual ~CCBSelectorResolver() {};
|
2012-09-24 11:08:10 +08:00
|
|
|
virtual SEL_MenuHandler onResolveCCBCCMenuItemSelector(CCObject * pTarget, CCString * pSelectorName) = 0;
|
2012-09-19 08:38:33 +08:00
|
|
|
|
2012-11-23 15:07:19 +08:00
|
|
|
virtual SEL_CCControlHandler onResolveCCBCCControlSelector(CCObject * pTarget, CCString * pSelectorName) = 0;
|
2012-06-05 06:52:49 +08:00
|
|
|
};
|
|
|
|
|
2012-09-19 08:38:33 +08:00
|
|
|
|
|
|
|
class CCBScriptOwnerProtocol {
|
|
|
|
public:
|
|
|
|
virtual ~CCBScriptOwnerProtocol() {};
|
|
|
|
virtual CCBSelectorResolver * createNew() = 0;
|
|
|
|
};
|
|
|
|
|
2012-06-05 06:52:49 +08:00
|
|
|
NS_CC_EXT_END
|
|
|
|
|
|
|
|
#endif
|