#ifndef EventDispatcher_h
#define EventDispatcher_h
#include "Connection.h"
#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
#include <wtf/RefPtr.h>
#include <wtf/ThreadingPrimitives.h>
namespace WebCore {
class ScrollingTree;
}
namespace WebKit {
class WebEvent;
class WebPage;
class WebWheelEvent;
#if ENABLE(GESTURE_EVENTS)
class WebGestureEvent;
#endif
class EventDispatcher : public CoreIPC::Connection::QueueClient {
WTF_MAKE_NONCOPYABLE(EventDispatcher);
public:
EventDispatcher();
~EventDispatcher();
#if ENABLE(THREADED_SCROLLING)
void addScrollingTreeForPage(WebPage*);
void removeScrollingTreeForPage(WebPage*);
#endif
private:
virtual void didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, bool& didHandleMessage) OVERRIDE;
void didReceiveEventDispatcherMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage);
void wheelEvent(CoreIPC::Connection*, uint64_t pageID, const WebWheelEvent&, bool canGoBack, bool canGoForward);
#if ENABLE(GESTURE_EVENTS)
void gestureEvent(CoreIPC::Connection*, uint64_t pageID, const WebGestureEvent&);
#endif
void dispatchWheelEvent(uint64_t pageID, const WebWheelEvent&);
#if ENABLE(GESTURE_EVENTS)
void dispatchGestureEvent(uint64_t pageID, const WebGestureEvent&);
#endif
#if ENABLE(THREADED_SCROLLING)
void sendDidReceiveEvent(uint64_t pageID, const WebEvent&, bool didHandleEvent);
Mutex m_scrollingTreesMutex;
HashMap<uint64_t, RefPtr<WebCore::ScrollingTree> > m_scrollingTrees;
#endif
};
}
#endif // EventDispatcher_h