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(GTK)
#include <WebCore/GUniquePtrGtk.h>
typedef union _GdkEvent GdkEvent;
#endif
#if PLATFORM(IOS)
#include <wtf/RetainPtr.h>
OBJC_CLASS WebEvent;
#endif
#if PLATFORM(WPE)
struct wpe_input_pointer_event;
#endif
#if PLATFORM(WIN)
#include <windows.h>
#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(IOS)
NativeWebMouseEvent(::WebEvent *);
#elif PLATFORM(WPE)
NativeWebMouseEvent(struct wpe_input_pointer_event*, float deviceScaleFactor);
#elif PLATFORM(WIN)
NativeWebMouseEvent(HWND, UINT message, WPARAM, LPARAM, bool);
#endif
#if USE(APPKIT)
NSEvent* nativeEvent() const { return m_nativeEvent.get(); }
#elif PLATFORM(GTK)
const GdkEvent* nativeEvent() const { return m_nativeEvent.get(); }
#elif PLATFORM(IOS)
::WebEvent* nativeEvent() const { return m_nativeEvent.get(); }
#elif PLATFORM(WIN)
const MSG* nativeEvent() const { return &m_nativeEvent; }
#else
const void* nativeEvent() const { return nullptr; }
#endif
private:
#if USE(APPKIT)
RetainPtr<NSEvent> m_nativeEvent;
#elif PLATFORM(GTK)
GUniquePtr<GdkEvent> m_nativeEvent;
#elif PLATFORM(IOS)
RetainPtr<::WebEvent> m_nativeEvent;
#elif PLATFORM(WIN)
MSG m_nativeEvent;
#endif
};
}
#endif // NativeWebMouseEvent_h