mirror of https://github.com/axmolengine/axmol.git
51 lines
1.9 KiB
Plaintext
51 lines
1.9 KiB
Plaintext
namespace cocos2d {
|
|
class CCNode;
|
|
class CCEvent;
|
|
|
|
|
|
class SelectorProtocol
|
|
{
|
|
public:
|
|
SelectorProtocol();
|
|
void update(ccTime dt);
|
|
void tick(ccTime dt);
|
|
void callfunc();
|
|
void callfunc(CCNode* pSender);
|
|
void callfunc(CCNode* pSender, void* pData);
|
|
void menuHandler(CCObject* pSender);
|
|
void eventHandler(CCEvent* pEvent);
|
|
|
|
// the child call responding retain/release function
|
|
void selectorProtocolRetain(void);
|
|
void selectorProtocolRelease(void);
|
|
};
|
|
/*
|
|
class CCNode;
|
|
typedef void (SelectorProtocol::*SEL_SCHEDULE)(ccTime);
|
|
|
|
typedef void (SelectorProtocol::*SEL_CallFunc)();
|
|
typedef void (SelectorProtocol::*SEL_CallFuncN)(CCNode*);
|
|
typedef void (SelectorProtocol::*SEL_CallFuncND)(CCNode*, void*);
|
|
typedef void (SelectorProtocol::*SEL_CallFuncO)(CCObject*);
|
|
typedef void (SelectorProtocol::*SEL_MenuHandler)(CCObject*);
|
|
typedef void (SelectorProtocol::*SEL_EventHandler)(CCEvent*);
|
|
|
|
// #define schedule_selector(_SELECTOR) (SEL_SCHEDULE)(*((SEL_SCHEDULE*)(&(&_SELECTOR))) )
|
|
// #define callfunc_selector(_SELECTOR) (SEL_CallFunc)(*((SEL_CallFunc*)(&(&_SELECTOR))) )
|
|
// #define callfuncN_selector(_SELECTOR) (SEL_CallFuncN)(*((SEL_CallFuncN*)(&(&_SELECTOR))) )
|
|
// #define callfuncND_selector(_SELECTOR) (SEL_CallFuncND)(*((SEL_CallFuncND*)(&(&_SELECTOR))) )
|
|
// #define menu_selector(_SELECTOR) (SEL_MenuHandler)(*((SEL_MenuHandler*)(&(&_SELECTOR)))
|
|
|
|
#define schedule_selector(_SELECTOR) (SEL_SCHEDULE)(&_SELECTOR)
|
|
#define callfunc_selector(_SELECTOR) (SEL_CallFunc)(&_SELECTOR)
|
|
#define callfuncN_selector(_SELECTOR) (SEL_CallFuncN)(&_SELECTOR)
|
|
#define callfuncND_selector(_SELECTOR) (SEL_CallFuncND)(&_SELECTOR)
|
|
#define callfuncO_selector(_SELECTOR) (SEL_CallFuncO)(&_SELECTOR)
|
|
#define menu_selector(_SELECTOR) (SEL_MenuHandler)(&_SELECTOR)
|
|
#define event_selector(_SELECTOR) (SEL_EventHandler)(&_SELECTOR)
|
|
|
|
*/
|
|
}//namespace cocos2d
|
|
|
|
|