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"
|
2013-10-15 18:00:03 +08:00
|
|
|
#include "extensions//GUI/CCControlExtension/CCInvocation.h"
|
2012-06-05 06:52:49 +08:00
|
|
|
|
2012-09-24 11:47:33 +08:00
|
|
|
|
2013-10-15 18:00:03 +08:00
|
|
|
namespace cocosbuilder {
|
2012-06-05 06:52:49 +08:00
|
|
|
|
2012-11-26 21:51:05 +08:00
|
|
|
#define CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(TARGET, SELECTORNAME, METHOD) if(pTarget == TARGET && strcmp(pSelectorName, SELECTORNAME) == 0) { \
|
2012-06-15 09:16:54 +08:00
|
|
|
return menu_selector(METHOD); \
|
|
|
|
}
|
|
|
|
|
2012-11-26 21:51:05 +08:00
|
|
|
#define CCB_SELECTORRESOLVER_CCCONTROL_GLUE(TARGET, SELECTORNAME, METHOD) if(pTarget == TARGET && strcmp(pSelectorName, SELECTORNAME) == 0) { \
|
2012-06-15 09:16:54 +08:00
|
|
|
return cccontrol_selector(METHOD); \
|
|
|
|
}
|
|
|
|
|
2013-03-19 16:33:23 +08:00
|
|
|
#define CCB_SELECTORRESOLVER_CALLFUNC_GLUE(TARGET, SELECTORNAME, METHOD) if(pTarget == TARGET && strcmp(pSelectorName, SELECTORNAME) == 0) { \
|
|
|
|
return callfuncN_selector(METHOD); \
|
|
|
|
}
|
|
|
|
|
2012-07-20 14:05:52 +08:00
|
|
|
class CCBSelectorResolver {
|
2012-06-05 06:52:49 +08:00
|
|
|
public:
|
2013-09-13 11:41:20 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
|
|
|
virtual ~CCBSelectorResolver() {};
|
2013-10-15 18:00:03 +08:00
|
|
|
virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget, const char* pSelectorName) = 0;
|
|
|
|
virtual cocos2d::SEL_CallFuncN onResolveCCBCCCallFuncSelector(cocos2d::Object * pTarget, const char* pSelectorName) { return NULL; };
|
|
|
|
virtual cocos2d::extension::Control::Handler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char* pSelectorName) = 0;
|
2012-06-05 06:52:49 +08:00
|
|
|
};
|
|
|
|
|
2012-09-19 08:38:33 +08:00
|
|
|
|
|
|
|
class CCBScriptOwnerProtocol {
|
|
|
|
public:
|
2013-09-13 11:41:20 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2012-09-19 08:38:33 +08:00
|
|
|
virtual ~CCBScriptOwnerProtocol() {};
|
|
|
|
virtual CCBSelectorResolver * createNew() = 0;
|
|
|
|
};
|
|
|
|
|
2013-10-15 18:00:03 +08:00
|
|
|
}
|
2012-06-05 06:52:49 +08:00
|
|
|
|
|
|
|
#endif
|