From a643f05330b69a509480241c8185e3a9de3da457 Mon Sep 17 00:00:00 2001 From: Mircea Rila Date: Tue, 11 Nov 2014 18:00:34 +0200 Subject: [PATCH] add touch callback types --- cocos/base/CCEventListenerTouch.h | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/cocos/base/CCEventListenerTouch.h b/cocos/base/CCEventListenerTouch.h index 353c938e9d..603160b1e9 100644 --- a/cocos/base/CCEventListenerTouch.h +++ b/cocos/base/CCEventListenerTouch.h @@ -52,10 +52,14 @@ public: // public: - std::function onTouchBegan; - std::function onTouchMoved; - std::function onTouchEnded; - std::function onTouchCancelled; + + typedef std::function ccTouchBeganCallback; + typedef std::function ccTouchCallback; + + ccTouchBeganCallback onTouchBegan; + ccTouchCallback onTouchMoved; + ccTouchCallback onTouchEnded; + ccTouchCallback onTouchCancelled; CC_CONSTRUCTOR_ACCESS: EventListenerTouchOneByOne(); @@ -82,10 +86,13 @@ public: virtual bool checkAvailable() override; // public: - std::function&, Event*)> onTouchesBegan; - std::function&, Event*)> onTouchesMoved; - std::function&, Event*)> onTouchesEnded; - std::function&, Event*)> onTouchesCancelled; + + typedef std::function&, Event*)> ccTouchesCallback; + + ccTouchesCallback onTouchesBegan; + ccTouchesCallback onTouchesMoved; + ccTouchesCallback onTouchesEnded; + ccTouchesCallback onTouchesCancelled; CC_CONSTRUCTOR_ACCESS: EventListenerTouchAllAtOnce();