2022-07-30 12:24:03 -04:00
|
|
|
#ifndef __CCMOUSE_DISPATCHER_H__
|
|
|
|
#define __CCMOUSE_DISPATCHER_H__
|
|
|
|
|
|
|
|
#include "CCMouseDelegate.h"
|
2022-10-17 08:46:36 -04:00
|
|
|
#include "../../cocoa/CCArray.h"
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2024-06-20 08:19:43 -04:00
|
|
|
NS_CC_BEGIN
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2024-06-20 08:19:43 -04:00
|
|
|
// @note RobTop Addition
|
|
|
|
class CC_DLL CCMouseDispatcher : public CCObject
|
|
|
|
{
|
|
|
|
GEODE_FRIEND_MODIFY
|
|
|
|
public:
|
|
|
|
CCMouseDispatcher();
|
|
|
|
virtual ~CCMouseDispatcher();
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2024-06-20 08:19:43 -04:00
|
|
|
void addDelegate(CCMouseDelegate* pDelegate);
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2024-06-20 08:19:43 -04:00
|
|
|
void removeDelegate(CCMouseDelegate* pDelegate);
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2024-06-20 08:19:43 -04:00
|
|
|
void forceAddDelegate(CCMouseDelegate* pDelegate);
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2024-06-20 08:19:43 -04:00
|
|
|
void forceRemoveDelegate(CCMouseDelegate* pDelegate);
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2024-06-20 08:19:43 -04:00
|
|
|
bool dispatchScrollMSG(float x, float y);
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2024-06-20 08:19:43 -04:00
|
|
|
protected:
|
|
|
|
CCArray* m_pMouseHandlers;
|
|
|
|
bool m_bLocked;
|
|
|
|
bool m_bToAdd;
|
|
|
|
bool m_bToRemove;
|
|
|
|
ccCArray* m_pHandlersToAdd;
|
|
|
|
ccCArray* m_pHandlersToRemove;
|
|
|
|
};
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2024-06-20 08:19:43 -04:00
|
|
|
NS_CC_END
|
2022-07-30 12:24:03 -04:00
|
|
|
|
|
|
|
#endif
|