axmol/tools/tolua++/selector_protocol.pkg

51 lines
1.9 KiB
Plaintext
Raw Normal View History

2011-06-14 14:31:25 +08:00
namespace cocos2d {
class CCNode;
class CCEvent;
2011-06-20 17:31:38 +08:00
class SelectorProtocol
2011-06-14 14:31:25 +08:00
{
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);
2011-06-20 17:31:38 +08:00
void eventHandler(CCEvent* pEvent);
2011-06-14 14:31:25 +08:00
// 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