NativeWebMouseEvent.h [plain text]
#ifndef NativeWebMouseEvent_h
#define NativeWebMouseEvent_h
#include "WebEvent.h"
#if USE(APPKIT)
#include <wtf/RetainPtr.h>
OBJC_CLASS NSView;
#endif
#if PLATFORM(EFL)
#include "WebEventFactory.h"
#include <Evas.h>
#include <WebCore/AffineTransform.h>
#endif
#if PLATFORM(GTK)
#include <WebCore/GUniquePtrGtk.h>
typedef union _GdkEvent GdkEvent;
#endif
namespace WebKit {
class NativeWebMouseEvent : public WebMouseEvent {
public:
#if USE(APPKIT)
NativeWebMouseEvent(NSEvent *, NSEvent *lastPressureEvent, NSView *);
#elif PLATFORM(GTK)
NativeWebMouseEvent(const NativeWebMouseEvent&);
NativeWebMouseEvent(GdkEvent*, int);
#elif PLATFORM(EFL)
template <typename EvasEventMouse>
NativeWebMouseEvent(const EvasEventMouse*, const WebCore::AffineTransform&, const WebCore::AffineTransform&);
#endif
#if USE(APPKIT)
NSEvent* nativeEvent() const { return m_nativeEvent.get(); }
#elif PLATFORM(GTK)
const GdkEvent* nativeEvent() const { return m_nativeEvent.get(); }
#elif PLATFORM(EFL)
const void* nativeEvent() const { return m_nativeEvent; }
#elif PLATFORM(IOS)
const void* nativeEvent() const { return 0; }
#endif
private:
#if USE(APPKIT)
RetainPtr<NSEvent> m_nativeEvent;
#elif PLATFORM(GTK)
GUniquePtr<GdkEvent> m_nativeEvent;
#elif PLATFORM(EFL)
const void* m_nativeEvent;
#endif
};
#if PLATFORM(EFL)
template <typename EvasEventMouse>
NativeWebMouseEvent::NativeWebMouseEvent(const EvasEventMouse* event, const WebCore::AffineTransform& toWebContent, const WebCore::AffineTransform& toDeviceScreen)
: WebMouseEvent(WebEventFactory::createWebMouseEvent(event, toWebContent, toDeviceScreen))
, m_nativeEvent(event)
{
}
#endif
}
#endif // NativeWebMouseEvent_h