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-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-07-24 17:59:21 +08:00
|
|
|
virtual SEL_MenuHandler onResolveCCBCCMenuItemSelector(Object * pTarget, const char* pSelectorName) = 0;
|
|
|
|
virtual SEL_CallFuncN onResolveCCBCCCallFuncSelector(Object * pTarget, const char* pSelectorName) { return NULL; };
|
2013-07-26 14:37:26 +08:00
|
|
|
virtual Control::Handler onResolveCCBCCControlSelector(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;
|
|
|
|
};
|
|
|
|
|
2012-06-05 06:52:49 +08:00
|
|
|
NS_CC_EXT_END
|
|
|
|
|
|
|
|
#endif
|