diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Tools/TestWebKitAPI/PlatformWebView.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Tools/TestWebKitAPI/PlatformWebView.h')
-rw-r--r-- | Tools/TestWebKitAPI/PlatformWebView.h | 45 |
1 files changed, 18 insertions, 27 deletions
diff --git a/Tools/TestWebKitAPI/PlatformWebView.h b/Tools/TestWebKitAPI/PlatformWebView.h index 8679fa2c4..9c807321c 100644 --- a/Tools/TestWebKitAPI/PlatformWebView.h +++ b/Tools/TestWebKitAPI/PlatformWebView.h @@ -30,7 +30,11 @@ #include <CoreGraphics/CGGeometry.h> #endif -#ifdef __APPLE__ +#if PLATFORM(MAC) +#include <objc/objc.h> +#endif + +#if defined(__APPLE__) && !PLATFORM(GTK) #ifdef __OBJC__ @class WKView; @class NSWindow; @@ -40,32 +44,24 @@ class NSWindow; #endif typedef WKView *PlatformWKView; typedef NSWindow *PlatformWindow; -#elif defined(WIN32) || defined(_WIN32) -typedef WKViewRef PlatformWKView; -typedef HWND PlatformWindow; #elif PLATFORM(GTK) typedef WKViewRef PlatformWKView; typedef GtkWidget *PlatformWindow; #elif PLATFORM(EFL) -typedef struct _Ecore_Evas Ecore_Evas; -#if USE(EO) -typedef struct _Eo_Opaque Evas_Object; -#else -typedef struct _Evas_Object Evas_Object; -#endif typedef Evas_Object* PlatformWKView; typedef Ecore_Evas* PlatformWindow; #endif namespace TestWebKitAPI { -#if PLATFORM(WIN) -class WindowMessageObserver; -#endif - class PlatformWebView { public: - PlatformWebView(WKContextRef, WKPageGroupRef = 0); + explicit PlatformWebView(WKPageConfigurationRef); + explicit PlatformWebView(WKContextRef, WKPageGroupRef = 0); + explicit PlatformWebView(WKPageRef relatedPage); +#if PLATFORM(MAC) + explicit PlatformWebView(WKContextRef, WKPageGroupRef, Class wkViewSubclass); +#endif ~PlatformWebView(); WKPageRef page() const; @@ -76,25 +72,20 @@ public: void simulateSpacebarKeyPress(); void simulateAltKeyPress(); void simulateRightClick(unsigned x, unsigned y); - void simulateMouseMove(unsigned x, unsigned y); - -#if PLATFORM(WIN) - void simulateAKeyDown(); - void setParentWindowMessageObserver(WindowMessageObserver* observer) { m_parentWindowMessageObserver = observer; } + void simulateMouseMove(unsigned x, unsigned y, WKEventModifiers = 0); +#if PLATFORM(MAC) + void simulateButtonClick(WKEventMouseButton, unsigned x, unsigned y, WKEventModifiers); #endif private: -#if PLATFORM(WIN) - static void registerWindowClass(); - static LRESULT CALLBACK wndProc(HWND, UINT message, WPARAM, LPARAM); +#if PLATFORM(MAC) + void initialize(WKPageConfigurationRef, Class wkViewSubclass); +#elif PLATFORM(GTK) + void initialize(WKPageConfigurationRef); #endif PlatformWKView m_view; PlatformWindow m_window; - -#if PLATFORM(WIN) - WindowMessageObserver* m_parentWindowMessageObserver; -#endif }; } // namespace TestWebKitAPI |