[WK2] Make EFL WKView API shareable between ports
authormikhail.pozdnyakov@intel.com <mikhail.pozdnyakov@intel.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Apr 2013 14:45:52 +0000 (14:45 +0000)
committermikhail.pozdnyakov@intel.com <mikhail.pozdnyakov@intel.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Apr 2013 14:45:52 +0000 (14:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=114734

Reviewed by Anders Carlsson.

Source/WebKit2:

EFL-independent part of WKView API (and its implementation) is now
shareable between ports that use Coordinated Graphics and put to
CoordinatedGraphics folders.

* PlatformEfl.cmake:
* UIProcess/API/C/CoordinatedGraphics/WKView.cpp: Renamed from Source/WebKit2/UIProcess/API/C/efl/WKView.cpp.
(WKViewCreate):
(WKViewInitialize):
(WKViewGetSize):
(WKViewSetSize):
(WKViewSetViewClient):
(WKViewIsFocused):
(WKViewSetIsFocused):
(WKViewIsVisible):
(WKViewSetIsVisible):
(WKViewGetContentScaleFactor):
(WKViewSetContentScaleFactor):
(WKViewGetContentPosition):
(WKViewSetContentPosition):
(WKViewSetUserViewportTranslation):
(WKViewUserViewportToContents):
(WKViewPaintToCurrentGLContext):
(WKViewGetPage):
(WKViewSetDrawsBackground):
(WKViewGetDrawsBackground):
(WKViewSetDrawsTransparentBackground):
(WKViewGetDrawsTransparentBackground):
(WKViewSetThemePath):
(WKViewSuspendActiveDOMObjectsAndAnimations):
(WKViewResumeActiveDOMObjectsAndAnimations):
(WKViewSetShowsAsSource):
(WKViewGetShowsAsSource):
(WKViewExitFullScreen):
* UIProcess/API/C/CoordinatedGraphics/WKView.h: Renamed from Source/WebKit2/UIProcess/API/C/efl/WKView.h.
* UIProcess/API/C/efl/WKViewEfl.cpp: Added.
(WKViewPaintToCairoSurface):
(WKViewCreateSnapshot):
* UIProcess/API/C/efl/WKViewEfl.h: Added.
* UIProcess/API/efl/EwkView.cpp:
(EwkView::EwkView):
* UIProcess/API/efl/EwkView.h:
* UIProcess/CoordinatedGraphics/WebView.cpp: Renamed from Source/WebKit2/UIProcess/efl/WebView.cpp.
(WebKit):
(WebKit::WebView::WebView):
(WebKit::WebView::~WebView):
(WebKit::WebView::initialize):
(WebKit::WebView::setSize):
(WebKit::WebView::setFocused):
(WebKit::WebView::setVisible):
(WebKit::WebView::setUserViewportTranslation):
(WebKit::WebView::userViewportToContents):
(WebKit::WebView::paintToCurrentGLContext):
(WebKit::WebView::setThemePath):
(WebKit::WebView::setDrawsBackground):
(WebKit::WebView::drawsBackground):
(WebKit::WebView::setDrawsTransparentBackground):
(WebKit::WebView::drawsTransparentBackground):
(WebKit::WebView::suspendActiveDOMObjectsAndAnimations):
(WebKit::WebView::resumeActiveDOMObjectsAndAnimations):
(WebKit::WebView::setShowsAsSource):
(WebKit::WebView::showsAsSource):
(WebKit::WebView::exitFullScreen):
(WebKit::WebView::initializeClient):
(WebKit::WebView::didChangeContentsSize):
(WebKit::WebView::transformFromScene):
(WebKit::WebView::transformToScene):
(WebKit::WebView::coordinatedGraphicsScene):
(WebKit::WebView::updateViewportSize):
(WebKit::WebView::dipSize):
(WebKit::WebView::createDrawingAreaProxy):
(WebKit::WebView::setViewNeedsDisplay):
(WebKit::WebView::displayView):
(WebKit::WebView::scrollView):
(WebKit::WebView::viewSize):
(WebKit::WebView::isViewWindowActive):
(WebKit::WebView::isViewFocused):
(WebKit::WebView::isViewVisible):
(WebKit::WebView::isViewInWindow):
(WebKit::WebView::processDidCrash):
(WebKit::WebView::didRelaunchProcess):
(WebKit::WebView::pageClosed):
(WebKit::WebView::toolTipChanged):
(WebKit::WebView::setCursor):
(WebKit::WebView::setCursorHiddenUntilMouseMoves):
(WebKit::WebView::registerEditCommand):
(WebKit::WebView::clearAllEditCommands):
(WebKit::WebView::canUndoRedo):
(WebKit::WebView::executeUndoRedo):
(WebKit::WebView::screenToWindow):
(WebKit::WebView::windowToScreen):
(WebKit::WebView::doneWithKeyEvent):
(WebKit::WebView::doneWithTouchEvent):
(WebKit::WebView::createPopupMenuProxy):
(WebKit::WebView::createContextMenuProxy):
(WebKit::WebView::createColorChooserProxy):
(WebKit::WebView::setFindIndicator):
(WebKit::WebView::enterAcceleratedCompositingMode):
(WebKit::WebView::exitAcceleratedCompositingMode):
(WebKit::WebView::updateAcceleratedCompositingMode):
(WebKit::WebView::didCommitLoadForMainFrame):
(WebKit::WebView::didFinishLoadingDataForCustomRepresentation):
(WebKit::WebView::customRepresentationZoomFactor):
(WebKit::WebView::setCustomRepresentationZoomFactor):
(WebKit::WebView::flashBackingStoreUpdates):
(WebKit::WebView::findStringInCustomRepresentation):
(WebKit::WebView::countStringMatchesInCustomRepresentation):
(WebKit::WebView::updateTextInputState):
(WebKit::WebView::handleDownloadRequest):
(WebKit::WebView::convertToDeviceSpace):
(WebKit::WebView::convertToUserSpace):
(WebKit::WebView::didChangeViewportProperties):
(WebKit::WebView::pageDidRequestScroll):
(WebKit::WebView::didRenderFrame):
(WebKit::WebView::pageTransitionViewportReady):
* UIProcess/CoordinatedGraphics/WebView.h: Renamed from Source/WebKit2/UIProcess/efl/WebView.h.
(WebCore):
(WebKit):
(WebView):
(WebKit::WebView::size):
(WebKit::WebView::isFocused):
(WebKit::WebView::isVisible):
(WebKit::WebView::setContentScaleFactor):
(WebKit::WebView::contentScaleFactor):
(WebKit::WebView::setContentPosition):
(WebKit::WebView::contentPosition):
(WebKit::WebView::pageRef):
(WebKit::WebView::page):
* UIProcess/CoordinatedGraphics/WebViewClient.cpp: Renamed from Source/WebKit2/UIProcess/efl/WebViewClient.cpp.
(WebKit):
(WebKit::WebViewClient::viewNeedsDisplay):
(WebKit::WebViewClient::didChangeContentsSize):
(WebKit::WebViewClient::webProcessCrashed):
(WebKit::WebViewClient::webProcessDidRelaunch):
(WebKit::WebViewClient::didChangeContentsPosition):
(WebKit::WebViewClient::didRenderFrame):
(WebKit::WebViewClient::didCompletePageTransition):
(WebKit::WebViewClient::didChangeViewportAttributes):
(WebKit::WebViewClient::didChangeTooltip):
* UIProcess/CoordinatedGraphics/WebViewClient.h: Renamed from Source/WebKit2/UIProcess/efl/WebViewClient.h.
(WebCore):
(WebKit):
* UIProcess/efl/WebViewEfl.cpp: Added.
(WebKit):
(WebKit::WebView::create):
(WebKit::WebViewEfl::WebViewEfl):
(WebKit::WebViewEfl::setEwkView):
(WebKit::WebViewEfl::paintToCairoSurface):
(WebKit::WebViewEfl::createPopupMenuProxy):
(WebKit::WebViewEfl::createContextMenuProxy):
(WebKit::WebViewEfl::setCursor):
(WebKit::WebViewEfl::updateTextInputState):
(WebKit::WebViewEfl::handleDownloadRequest):
* UIProcess/efl/WebViewEfl.h: Added.
(WebKit):
(WebViewEfl):
(WebKit::WebViewEfl::ewkView):

Tools:

* TestWebKitAPI/PlatformEfl.cmake:
* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:

    Updated project files accordingly to updated WKView API files
    structure.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@148963 268f45cc-cd09-0410-ab3c-d52691b4dbfc

17 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/PlatformEfl.cmake
Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.cpp [moved from Source/WebKit2/UIProcess/API/C/efl/WKView.cpp with 89% similarity]
Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.h [moved from Source/WebKit2/UIProcess/API/C/efl/WKView.h with 96% similarity]
Source/WebKit2/UIProcess/API/C/efl/WKViewEfl.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/API/C/efl/WKViewEfl.h [new file with mode: 0644]
Source/WebKit2/UIProcess/API/efl/EwkView.cpp
Source/WebKit2/UIProcess/API/efl/EwkView.h
Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp [moved from Source/WebKit2/UIProcess/efl/WebView.cpp with 84% similarity]
Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h [moved from Source/WebKit2/UIProcess/efl/WebView.h with 55% similarity]
Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.cpp [moved from Source/WebKit2/UIProcess/efl/WebViewClient.cpp with 98% similarity]
Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.h [moved from Source/WebKit2/UIProcess/efl/WebViewClient.h with 97% similarity]
Source/WebKit2/UIProcess/efl/WebViewEfl.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/efl/WebViewEfl.h [new file with mode: 0644]
Tools/ChangeLog
Tools/TestWebKitAPI/PlatformEfl.cmake
Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp

index 95816f2..7919ee4 100644 (file)
@@ -1,3 +1,167 @@
+2013-04-23  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
+
+        [WK2] Make EFL WKView API shareable between ports
+        https://bugs.webkit.org/show_bug.cgi?id=114734
+
+        Reviewed by Anders Carlsson.
+
+        EFL-independent part of WKView API (and its implementation) is now
+        shareable between ports that use Coordinated Graphics and put to
+        CoordinatedGraphics folders.
+
+        * PlatformEfl.cmake:
+        * UIProcess/API/C/CoordinatedGraphics/WKView.cpp: Renamed from Source/WebKit2/UIProcess/API/C/efl/WKView.cpp.
+        (WKViewCreate):
+        (WKViewInitialize):
+        (WKViewGetSize):
+        (WKViewSetSize):
+        (WKViewSetViewClient):
+        (WKViewIsFocused):
+        (WKViewSetIsFocused):
+        (WKViewIsVisible):
+        (WKViewSetIsVisible):
+        (WKViewGetContentScaleFactor):
+        (WKViewSetContentScaleFactor):
+        (WKViewGetContentPosition):
+        (WKViewSetContentPosition):
+        (WKViewSetUserViewportTranslation):
+        (WKViewUserViewportToContents):
+        (WKViewPaintToCurrentGLContext):
+        (WKViewGetPage):
+        (WKViewSetDrawsBackground):
+        (WKViewGetDrawsBackground):
+        (WKViewSetDrawsTransparentBackground):
+        (WKViewGetDrawsTransparentBackground):
+        (WKViewSetThemePath):
+        (WKViewSuspendActiveDOMObjectsAndAnimations):
+        (WKViewResumeActiveDOMObjectsAndAnimations):
+        (WKViewSetShowsAsSource):
+        (WKViewGetShowsAsSource):
+        (WKViewExitFullScreen):
+        * UIProcess/API/C/CoordinatedGraphics/WKView.h: Renamed from Source/WebKit2/UIProcess/API/C/efl/WKView.h.
+        * UIProcess/API/C/efl/WKViewEfl.cpp: Added.
+        (WKViewPaintToCairoSurface):
+        (WKViewCreateSnapshot):
+        * UIProcess/API/C/efl/WKViewEfl.h: Added.
+        * UIProcess/API/efl/EwkView.cpp:
+        (EwkView::EwkView):
+        * UIProcess/API/efl/EwkView.h:
+        * UIProcess/CoordinatedGraphics/WebView.cpp: Renamed from Source/WebKit2/UIProcess/efl/WebView.cpp.
+        (WebKit):
+        (WebKit::WebView::WebView):
+        (WebKit::WebView::~WebView):
+        (WebKit::WebView::initialize):
+        (WebKit::WebView::setSize):
+        (WebKit::WebView::setFocused):
+        (WebKit::WebView::setVisible):
+        (WebKit::WebView::setUserViewportTranslation):
+        (WebKit::WebView::userViewportToContents):
+        (WebKit::WebView::paintToCurrentGLContext):
+        (WebKit::WebView::setThemePath):
+        (WebKit::WebView::setDrawsBackground):
+        (WebKit::WebView::drawsBackground):
+        (WebKit::WebView::setDrawsTransparentBackground):
+        (WebKit::WebView::drawsTransparentBackground):
+        (WebKit::WebView::suspendActiveDOMObjectsAndAnimations):
+        (WebKit::WebView::resumeActiveDOMObjectsAndAnimations):
+        (WebKit::WebView::setShowsAsSource):
+        (WebKit::WebView::showsAsSource):
+        (WebKit::WebView::exitFullScreen):
+        (WebKit::WebView::initializeClient):
+        (WebKit::WebView::didChangeContentsSize):
+        (WebKit::WebView::transformFromScene):
+        (WebKit::WebView::transformToScene):
+        (WebKit::WebView::coordinatedGraphicsScene):
+        (WebKit::WebView::updateViewportSize):
+        (WebKit::WebView::dipSize):
+        (WebKit::WebView::createDrawingAreaProxy):
+        (WebKit::WebView::setViewNeedsDisplay):
+        (WebKit::WebView::displayView):
+        (WebKit::WebView::scrollView):
+        (WebKit::WebView::viewSize):
+        (WebKit::WebView::isViewWindowActive):
+        (WebKit::WebView::isViewFocused):
+        (WebKit::WebView::isViewVisible):
+        (WebKit::WebView::isViewInWindow):
+        (WebKit::WebView::processDidCrash):
+        (WebKit::WebView::didRelaunchProcess):
+        (WebKit::WebView::pageClosed):
+        (WebKit::WebView::toolTipChanged):
+        (WebKit::WebView::setCursor):
+        (WebKit::WebView::setCursorHiddenUntilMouseMoves):
+        (WebKit::WebView::registerEditCommand):
+        (WebKit::WebView::clearAllEditCommands):
+        (WebKit::WebView::canUndoRedo):
+        (WebKit::WebView::executeUndoRedo):
+        (WebKit::WebView::screenToWindow):
+        (WebKit::WebView::windowToScreen):
+        (WebKit::WebView::doneWithKeyEvent):
+        (WebKit::WebView::doneWithTouchEvent):
+        (WebKit::WebView::createPopupMenuProxy):
+        (WebKit::WebView::createContextMenuProxy):
+        (WebKit::WebView::createColorChooserProxy):
+        (WebKit::WebView::setFindIndicator):
+        (WebKit::WebView::enterAcceleratedCompositingMode):
+        (WebKit::WebView::exitAcceleratedCompositingMode):
+        (WebKit::WebView::updateAcceleratedCompositingMode):
+        (WebKit::WebView::didCommitLoadForMainFrame):
+        (WebKit::WebView::didFinishLoadingDataForCustomRepresentation):
+        (WebKit::WebView::customRepresentationZoomFactor):
+        (WebKit::WebView::setCustomRepresentationZoomFactor):
+        (WebKit::WebView::flashBackingStoreUpdates):
+        (WebKit::WebView::findStringInCustomRepresentation):
+        (WebKit::WebView::countStringMatchesInCustomRepresentation):
+        (WebKit::WebView::updateTextInputState):
+        (WebKit::WebView::handleDownloadRequest):
+        (WebKit::WebView::convertToDeviceSpace):
+        (WebKit::WebView::convertToUserSpace):
+        (WebKit::WebView::didChangeViewportProperties):
+        (WebKit::WebView::pageDidRequestScroll):
+        (WebKit::WebView::didRenderFrame):
+        (WebKit::WebView::pageTransitionViewportReady):
+        * UIProcess/CoordinatedGraphics/WebView.h: Renamed from Source/WebKit2/UIProcess/efl/WebView.h.
+        (WebCore):
+        (WebKit):
+        (WebView):
+        (WebKit::WebView::size):
+        (WebKit::WebView::isFocused):
+        (WebKit::WebView::isVisible):
+        (WebKit::WebView::setContentScaleFactor):
+        (WebKit::WebView::contentScaleFactor):
+        (WebKit::WebView::setContentPosition):
+        (WebKit::WebView::contentPosition):
+        (WebKit::WebView::pageRef):
+        (WebKit::WebView::page):
+        * UIProcess/CoordinatedGraphics/WebViewClient.cpp: Renamed from Source/WebKit2/UIProcess/efl/WebViewClient.cpp.
+        (WebKit):
+        (WebKit::WebViewClient::viewNeedsDisplay):
+        (WebKit::WebViewClient::didChangeContentsSize):
+        (WebKit::WebViewClient::webProcessCrashed):
+        (WebKit::WebViewClient::webProcessDidRelaunch):
+        (WebKit::WebViewClient::didChangeContentsPosition):
+        (WebKit::WebViewClient::didRenderFrame):
+        (WebKit::WebViewClient::didCompletePageTransition):
+        (WebKit::WebViewClient::didChangeViewportAttributes):
+        (WebKit::WebViewClient::didChangeTooltip):
+        * UIProcess/CoordinatedGraphics/WebViewClient.h: Renamed from Source/WebKit2/UIProcess/efl/WebViewClient.h.
+        (WebCore):
+        (WebKit):
+        * UIProcess/efl/WebViewEfl.cpp: Added.
+        (WebKit):
+        (WebKit::WebView::create):
+        (WebKit::WebViewEfl::WebViewEfl):
+        (WebKit::WebViewEfl::setEwkView):
+        (WebKit::WebViewEfl::paintToCairoSurface):
+        (WebKit::WebViewEfl::createPopupMenuProxy):
+        (WebKit::WebViewEfl::createContextMenuProxy):
+        (WebKit::WebViewEfl::setCursor):
+        (WebKit::WebViewEfl::updateTextInputState):
+        (WebKit::WebViewEfl::handleDownloadRequest):
+        * UIProcess/efl/WebViewEfl.h: Added.
+        (WebKit):
+        (WebViewEfl):
+        (WebKit::WebViewEfl::ewkView):
+
 2013-04-23  Antoine Quint  <graouts@apple.com>
 
         Initial advance of text runs should be taken into account
index 01c5f61..b9b2b85 100644 (file)
@@ -46,10 +46,12 @@ list(APPEND WebKit2_SOURCES
 
     UIProcess/API/C/cairo/WKIconDatabaseCairo.cpp
 
+    UIProcess/API/C/CoordinatedGraphics/WKView.cpp
+
     UIProcess/API/C/efl/WKPageEfl.cpp
     UIProcess/API/C/efl/WKPopupItem.cpp
     UIProcess/API/C/efl/WKPopupMenuListener.cpp
-    UIProcess/API/C/efl/WKView.cpp
+    UIProcess/API/C/efl/WKViewEfl.cpp
 
     UIProcess/API/cpp/efl/WKEinaSharedString.cpp
 
@@ -94,6 +96,9 @@ list(APPEND WebKit2_SOURCES
 
     UIProcess/cairo/BackingStoreCairo.cpp
 
+    UIProcess/CoordinatedGraphics/WebView.cpp
+    UIProcess/CoordinatedGraphics/WebViewClient.cpp
+
     UIProcess/efl/BatteryProvider.cpp
     UIProcess/efl/ContextHistoryClientEfl.cpp
     UIProcess/efl/ContextMenuClientEfl.cpp
@@ -111,6 +116,7 @@ list(APPEND WebKit2_SOURCES
     UIProcess/efl/TextCheckerEfl.cpp
     UIProcess/efl/VibrationClientEfl.cpp
     UIProcess/efl/ViewClientEfl.cpp
+    UIProcess/efl/WebViewEfl.cpp
     UIProcess/efl/WebContextEfl.cpp
     UIProcess/efl/WebContextMenuProxyEfl.cpp
     UIProcess/efl/WebFullScreenManagerProxyEfl.cpp
@@ -121,8 +127,6 @@ list(APPEND WebKit2_SOURCES
     UIProcess/efl/WebPreferencesEfl.cpp
     UIProcess/efl/WebProcessProxyEfl.cpp
     UIProcess/efl/WebUIPopupMenuClient.cpp
-    UIProcess/efl/WebView.cpp
-    UIProcess/efl/WebViewClient.cpp
 
     UIProcess/InspectorServer/efl/WebInspectorServerEfl.cpp
     UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp
@@ -184,6 +188,7 @@ list(APPEND WebKit2_INCLUDE_DIRECTORIES
     "${WEBKIT2_DIR}/Shared/efl"
     "${WEBKIT2_DIR}/Shared/soup"
     "${WEBKIT2_DIR}/UIProcess/API/C/cairo"
+    "${WEBKIT2_DIR}/UIProcess/API/C/CoordinatedGraphics"
     "${WEBKIT2_DIR}/UIProcess/API/C/efl"
     "${WEBKIT2_DIR}/UIProcess/API/C/soup"
     "${WEBKIT2_DIR}/UIProcess/API/cpp/efl"
  */
 
 #include "config.h"
+#if USE(COORDINATED_GRAPHICS)
+
 #include "WKView.h"
 
-#include "EwkView.h"
 #include "WKAPICast.h"
-#include "ewk_context_private.h"
-#include "ewk_page_group_private.h"
-#include <WebKit2/WKImageCairo.h>
+#include "WebView.h"
 
 using namespace WebKit;
 
@@ -107,17 +106,10 @@ WKPoint WKViewUserViewportToContents(WKViewRef viewRef, WKPoint point)
     return WKPointMake(result.x(), result.y());
 }
 
-#if USE(ACCELERATED_COMPOSITING)
 void WKViewPaintToCurrentGLContext(WKViewRef viewRef)
 {
     toImpl(viewRef)->paintToCurrentGLContext();
 }
-#endif
-
-void WKViewPaintToCairoSurface(WKViewRef viewRef, cairo_surface_t* surface)
-{
-    toImpl(viewRef)->paintToCairoSurface(surface);
-}
 
 WKPageRef WKViewGetPage(WKViewRef viewRef)
 {
@@ -178,8 +170,4 @@ void WKViewExitFullScreen(WKViewRef viewRef)
 #endif
 }
 
-WKImageRef WKViewCreateSnapshot(WKViewRef viewRef)
-{
-    EwkView* ewkView = toEwkView(toImpl(viewRef)->evasObject());
-    return WKImageCreateFromCairoSurface(ewkView->takeSnapshot().get(), 0 /* options */);
-}
+#endif // USE(COORDINATED_GRAPHICS)
@@ -24,8 +24,6 @@
 #include <WebKit2/WKBase.h>
 #include <WebKit2/WKGeometry.h>
 
-typedef struct _cairo_surface cairo_surface_t;
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -83,7 +81,6 @@ WK_EXPORT void WKViewSetUserViewportTranslation(WKViewRef, double tx, double ty)
 WK_EXPORT WKPoint WKViewUserViewportToContents(WKViewRef, WKPoint);
 
 WK_EXPORT void WKViewPaintToCurrentGLContext(WKViewRef);
-WK_EXPORT void WKViewPaintToCairoSurface(WKViewRef, cairo_surface_t*);
 
 WK_EXPORT WKPageRef WKViewGetPage(WKViewRef);
 
@@ -103,8 +100,6 @@ WK_EXPORT bool WKViewGetShowsAsSource(WKViewRef);
 
 WK_EXPORT void WKViewExitFullScreen(WKViewRef);
 
-WK_EXPORT WKImageRef WKViewCreateSnapshot(WKViewRef);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/Source/WebKit2/UIProcess/API/C/efl/WKViewEfl.cpp b/Source/WebKit2/UIProcess/API/C/efl/WKViewEfl.cpp
new file mode 100644 (file)
index 0000000..05c116d
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKViewEfl.h"
+
+#include "EwkView.h"
+#include "WKAPICast.h"
+#include "WebViewEfl.h"
+#include <WebKit2/WKImageCairo.h>
+
+using namespace WebKit;
+
+void WKViewPaintToCairoSurface(WKViewRef viewRef, cairo_surface_t* surface)
+{
+    static_cast<WebViewEfl*>(toImpl(viewRef))->paintToCairoSurface(surface);
+}
+
+WKImageRef WKViewCreateSnapshot(WKViewRef viewRef)
+{
+    EwkView* ewkView = static_cast<WebViewEfl*>(toImpl(viewRef))->ewkView();
+    return WKImageCreateFromCairoSurface(ewkView->takeSnapshot().get(), 0 /* options */);
+}
diff --git a/Source/WebKit2/UIProcess/API/C/efl/WKViewEfl.h b/Source/WebKit2/UIProcess/API/C/efl/WKViewEfl.h
new file mode 100644 (file)
index 0000000..bbcd2ec
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKViewEfl_h
+#define WKViewEfl_h
+
+#include <WebKit2/WKBase.h>
+
+typedef struct _cairo_surface cairo_surface_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT void WKViewPaintToCairoSurface(WKViewRef, cairo_surface_t*);
+
+WK_EXPORT WKImageRef WKViewCreateSnapshot(WKViewRef);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKViewEfl_h */
index 88a151f..71c32e5 100644 (file)
@@ -43,6 +43,7 @@
 #include "WKPopupItem.h"
 #include "WKString.h"
 #include "WKView.h"
+#include "WKViewEfl.h"
 #include "WebContext.h"
 #include "WebImage.h"
 #include "WebPageGroup.h"
@@ -282,7 +283,7 @@ EwkView::EwkView(WKViewRef view, Evas_Object* evasObject)
     ASSERT(m_context);
 
     // FIXME: Remove when possible.
-    webView()->setEwkView(this);
+    static_cast<WebViewEfl*>(webView())->setEwkView(this);
 #if USE(ACCELERATED_COMPOSITING)
     m_evasGL = adoptPtr(evas_gl_new(evas_object_evas_get(m_evasObject)));
     if (m_evasGL)
index d311835..b0f3d3d 100644 (file)
@@ -29,7 +29,7 @@
 #include "WKEinaSharedString.h"
 #include "WKGeometry.h"
 #include "WKRetainPtr.h"
-#include "WebView.h"
+#include "WebViewEfl.h"
 #include "ewk_url_request_private.h"
 #include <Evas.h>
 #include <WebCore/FloatPoint.h>
  */
 
 #include "config.h"
+#if USE(COORDINATED_GRAPHICS)
+
 #include "WebView.h"
 
 #include "CoordinatedLayerTreeHostProxy.h"
-#include "DownloadManagerEfl.h"
 #include "DrawingAreaProxyImpl.h"
-#include "EwkView.h"
-#include "InputMethodContextEfl.h"
 #include "NotImplemented.h"
-#include "PageViewportController.h"
-#include "PageViewportControllerClientEfl.h"
-#include "WebContextMenuProxyEfl.h"
+#include "WebContextMenuProxy.h"
 #include "WebPageProxy.h"
-#include "WebPopupMenuListenerEfl.h"
-#include "ewk_context_private.h"
 #include <WebCore/CoordinatedGraphicsScene.h>
-#include <WebCore/PlatformContextCairo.h>
 
 #if ENABLE(FULLSCREEN_API)
 #include "WebFullScreenManagerProxy.h"
 #endif
 
-using namespace EwkViewCallbacks;
 using namespace WebCore;
 
 namespace WebKit {
 
 WebView::WebView(WebContext* context, WebPageGroup* pageGroup)
-    : m_ewkView(0)
-    , m_page(context->createWebPage(this, pageGroup))
+    : m_page(context->createWebPage(this, pageGroup))
     , m_focused(false)
     , m_visible(false)
     , m_contentScaleFactor(1.0)
@@ -75,29 +67,11 @@ WebView::~WebView()
     m_page->close();
 }
 
-PassRefPtr<WebView> WebView::create(WebContext* context, WebPageGroup* pageGroup)
-{
-    return adoptRef(new WebView(context, pageGroup));
-}
-
-// FIXME: Remove when possible.
-void WebView::setEwkView(EwkView* ewkView)
-{
-    m_ewkView = ewkView;
-
-#if ENABLE(FULLSCREEN_API)
-    m_page->fullScreenManager()->setWebView(ewkView->evasObject());
-#endif
-
-}
-
 void WebView::initialize()
 {
     m_page->initializeWebPage();
-#if USE(COORDINATED_GRAPHICS)
     if (CoordinatedGraphicsScene* scene = coordinatedGraphicsScene())
         scene->setActive(true);
-#endif
 }
 
 void WebView::setSize(const WebCore::IntSize& size)
@@ -135,7 +109,6 @@ IntPoint WebView::userViewportToContents(const IntPoint& point) const
     return m_userViewportTransform.mapPoint(point);
 }
 
-#if USE(COORDINATED_GRAPHICS)
 void WebView::paintToCurrentGLContext()
 {
     CoordinatedGraphicsScene* scene = coordinatedGraphicsScene();
@@ -148,31 +121,6 @@ void WebView::paintToCurrentGLContext()
 
     scene->paintToCurrentGLContext(transformToScene().toTransformationMatrix(), /* opacity */ 1, viewport);
 }
-#endif
-
-void WebView::paintToCairoSurface(cairo_surface_t* surface)
-{
-#if USE(COORDINATED_GRAPHICS)
-    CoordinatedGraphicsScene* scene = coordinatedGraphicsScene();
-    if (!scene)
-        return;
-#endif
-    PlatformContextCairo context(cairo_create(surface));
-
-    const FloatPoint& position = contentPosition();
-    double effectiveScale = m_page->deviceScaleFactor() * contentScaleFactor();
-
-    cairo_matrix_t transform = { effectiveScale, 0, 0, effectiveScale, - position.x() * m_page->deviceScaleFactor(), - position.y() * m_page->deviceScaleFactor() };
-    cairo_set_matrix(context.cr(), &transform);
-#if USE(COORDINATED_GRAPHICS)
-    scene->paintToGraphicsContext(&context);
-#endif
-}
-
-Evas_Object* WebView::evasObject()
-{
-    return m_ewkView->evasObject();
-}
 
 void WebView::setThemePath(const String& theme)
 {
@@ -253,7 +201,6 @@ AffineTransform WebView::transformToScene() const
     return transform.toAffineTransform();
 }
 
-#if USE(COORDINATED_GRAPHICS)
 CoordinatedGraphicsScene* WebView::coordinatedGraphicsScene()
 {
     DrawingAreaProxy* drawingArea = m_page->drawingArea();
@@ -266,7 +213,6 @@ CoordinatedGraphicsScene* WebView::coordinatedGraphicsScene()
 
     return layerTreeHostProxy->coordinatedGraphicsScene();
 }
-#endif
 
 void WebView::updateViewportSize()
 {
@@ -355,9 +301,9 @@ void WebView::toolTipChanged(const String&, const String& newToolTip)
     m_client.didChangeTooltip(this, newToolTip);
 }
 
-void WebView::setCursor(const Cursor& cursor)
+void WebView::setCursor(const WebCore::Cursor&)
 {
-    m_ewkView->setCursor(cursor);
+    notImplemented();
 }
 
 void WebView::setCursorHiddenUntilMouseMoves(bool)
@@ -411,12 +357,14 @@ void WebView::doneWithTouchEvent(const NativeWebTouchEvent&, bool /*wasEventHand
 
 PassRefPtr<WebPopupMenuProxy> WebView::createPopupMenuProxy(WebPageProxy* page)
 {
-    return WebPopupMenuListenerEfl::create(page);
+    notImplemented();
+    return 0;
 }
 
 PassRefPtr<WebContextMenuProxy> WebView::createContextMenuProxy(WebPageProxy* page)
 {
-    return WebContextMenuProxyEfl::create(m_ewkView, page);
+    notImplemented();
+    return 0;
 }
 
 #if ENABLE(INPUT_TYPE_COLOR)
@@ -432,7 +380,6 @@ void WebView::setFindIndicator(PassRefPtr<FindIndicator>, bool, bool)
     notImplemented();
 }
 
-#if USE(COORDINATED_GRAPHICS)
 void WebView::enterAcceleratedCompositingMode(const LayerTreeContext&)
 {
     if (CoordinatedGraphicsScene* scene = coordinatedGraphicsScene())
@@ -444,7 +391,6 @@ void WebView::exitAcceleratedCompositingMode()
     if (CoordinatedGraphicsScene* scene = coordinatedGraphicsScene())
         scene->setActive(false);
 }
-#endif
 
 void WebView::updateAcceleratedCompositingMode(const LayerTreeContext&)
 {
@@ -489,15 +435,12 @@ void WebView::countStringMatchesInCustomRepresentation(const String&, FindOption
 
 void WebView::updateTextInputState()
 {
-    InputMethodContextEfl* inputMethodContext = m_ewkView->inputMethodContext();
-    if (inputMethodContext)
-        inputMethodContext->updateTextInputState();
+    notImplemented();
 }
 
-void WebView::handleDownloadRequest(DownloadProxy* download)
+void WebView::handleDownloadRequest(DownloadProxy*)
 {
-    EwkContext* context = m_ewkView->ewkContext();
-    context->downloadManager()->registerDownloadJob(toAPI(download), m_ewkView);
+    notImplemented();
 }
 
 FloatRect WebView::convertToDeviceSpace(const FloatRect& userRect)
@@ -549,3 +492,6 @@ void WebView::pageTransitionViewportReady()
 }
 
 } // namespace WebKit
+
+#endif // USE(COORDINATED_GRAPHICS)
+
@@ -27,6 +27,8 @@
 #ifndef WebView_h
 #define WebView_h
 
+#if USE(COORDINATED_GRAPHICS)
+
 #include "APIObject.h"
 #include "DefaultUndoController.h"
 #include "PageClient.h"
@@ -38,8 +40,6 @@
 #include "WebViewClient.h"
 #include <WebCore/TransformationMatrix.h>
 
-class EwkView;
-
 namespace WebCore {
 class CoordinatedGraphicsScene;
 }
@@ -52,9 +52,6 @@ public:
 
     static PassRefPtr<WebView> create(WebContext*, WebPageGroup*);
 
-    // FIXME: Remove when possible.
-    void setEwkView(EwkView*);
-
     void initialize();
 
     void setSize(const WebCore::IntSize&);
@@ -76,7 +73,6 @@ public:
     WebCore::IntPoint userViewportToContents(const WebCore::IntPoint&) const;
 
     void paintToCurrentGLContext();
-    void paintToCairoSurface(cairo_surface_t*);
 
     WKPageRef pageRef() const { return toAPI(m_page.get()); }
 
@@ -100,8 +96,6 @@ public:
     // View client.
     void initializeClient(const WKViewClient*);
 
-    // FIXME: Remove when possible.
-    Evas_Object* evasObject();
     WebPageProxy* page() { return m_page.get(); }
 
     void didChangeContentsSize(const WebCore::IntSize&);
@@ -110,88 +104,87 @@ public:
     WebCore::AffineTransform transformFromScene() const;
     WebCore::AffineTransform transformToScene() const;
 
-private:
+protected:
     WebView(WebContext*, WebPageGroup*);
     WebCore::CoordinatedGraphicsScene* coordinatedGraphicsScene();
 
     void updateViewportSize();
     WebCore::FloatSize dipSize() const;
     // PageClient
-    PassOwnPtr<DrawingAreaProxy> createDrawingAreaProxy() OVERRIDE;
+    virtual PassOwnPtr<DrawingAreaProxy> createDrawingAreaProxy() OVERRIDE;
 
-    void setViewNeedsDisplay(const WebCore::IntRect&) OVERRIDE;
+    virtual void setViewNeedsDisplay(const WebCore::IntRect&) OVERRIDE;
 
-    void displayView() OVERRIDE;
+    virtual void displayView() OVERRIDE;
 
-    bool canScrollView() OVERRIDE { return false; }
-    void scrollView(const WebCore::IntRect&, const WebCore::IntSize&) OVERRIDE;
+    virtual bool canScrollView() OVERRIDE { return false; }
+    virtual void scrollView(const WebCore::IntRect&, const WebCore::IntSize&) OVERRIDE;
 
-    WebCore::IntSize viewSize() OVERRIDE;
+    virtual WebCore::IntSize viewSize() OVERRIDE;
 
-    bool isViewWindowActive() OVERRIDE;
-    bool isViewFocused() OVERRIDE;
-    bool isViewVisible() OVERRIDE;
-    bool isViewInWindow() OVERRIDE;
+    virtual bool isViewWindowActive() OVERRIDE;
+    virtual bool isViewFocused() OVERRIDE;
+    virtual bool isViewVisible() OVERRIDE;
+    virtual bool isViewInWindow() OVERRIDE;
 
-    void processDidCrash() OVERRIDE;
-    void didRelaunchProcess() OVERRIDE;
-    void pageClosed() OVERRIDE;
+    virtual void processDidCrash() OVERRIDE;
+    virtual void didRelaunchProcess() OVERRIDE;
+    virtual void pageClosed() OVERRIDE;
 
-    void toolTipChanged(const String&, const String&) OVERRIDE;
+    virtual void toolTipChanged(const String&, const String&) OVERRIDE;
 
-    void pageDidRequestScroll(const WebCore::IntPoint&) OVERRIDE;
-    void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect) OVERRIDE;
-    void pageTransitionViewportReady() OVERRIDE;
+    virtual void pageDidRequestScroll(const WebCore::IntPoint&) OVERRIDE;
+    virtual void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect) OVERRIDE;
+    virtual void pageTransitionViewportReady() OVERRIDE;
 
-    void setCursor(const WebCore::Cursor&) OVERRIDE;
-    void setCursorHiddenUntilMouseMoves(bool) OVERRIDE;
+    virtual void setCursor(const WebCore::Cursor&) OVERRIDE;
+    virtual void setCursorHiddenUntilMouseMoves(bool) OVERRIDE;
 
-    void didChangeViewportProperties(const WebCore::ViewportAttributes&) OVERRIDE;
+    virtual void didChangeViewportProperties(const WebCore::ViewportAttributes&) OVERRIDE;
 
-    void registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo) OVERRIDE;
-    void clearAllEditCommands() OVERRIDE;
-    bool canUndoRedo(WebPageProxy::UndoOrRedo) OVERRIDE;
-    void executeUndoRedo(WebPageProxy::UndoOrRedo) OVERRIDE;
+    virtual void registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo) OVERRIDE;
+    virtual void clearAllEditCommands() OVERRIDE;
+    virtual bool canUndoRedo(WebPageProxy::UndoOrRedo) OVERRIDE;
+    virtual void executeUndoRedo(WebPageProxy::UndoOrRedo) OVERRIDE;
 
-    WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&) OVERRIDE;
-    WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&) OVERRIDE;
-    WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) OVERRIDE;
-    WebCore::IntRect windowToScreen(const WebCore::IntRect&) OVERRIDE;
+    virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&) OVERRIDE;
+    virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&) OVERRIDE;
+    virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) OVERRIDE;
+    virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) OVERRIDE;
 
-    void updateTextInputState() OVERRIDE;
+    virtual void updateTextInputState() OVERRIDE;
 
-    void handleDownloadRequest(DownloadProxy*) OVERRIDE;
+    virtual void handleDownloadRequest(DownloadProxy*) OVERRIDE;
 
-    void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool) OVERRIDE;
+    virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool) OVERRIDE;
 #if ENABLE(TOUCH_EVENTS)
-    void doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled) OVERRIDE;
+    virtual void doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled) OVERRIDE;
 #endif
 
-    PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*) OVERRIDE;
-    PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*) OVERRIDE;
+    virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*) OVERRIDE;
+    virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*) OVERRIDE;
 #if ENABLE(INPUT_TYPE_COLOR)
-    PassRefPtr<WebColorChooserProxy> createColorChooserProxy(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&) OVERRIDE;
+    virtual PassRefPtr<WebColorChooserProxy> createColorChooserProxy(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&) OVERRIDE;
 #endif
 
-    void setFindIndicator(PassRefPtr<FindIndicator>, bool, bool) OVERRIDE;
+    virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool, bool) OVERRIDE;
 
-    void enterAcceleratedCompositingMode(const LayerTreeContext&) OVERRIDE;
-    void exitAcceleratedCompositingMode() OVERRIDE;
-    void updateAcceleratedCompositingMode(const LayerTreeContext&) OVERRIDE;
+    virtual void enterAcceleratedCompositingMode(const LayerTreeContext&) OVERRIDE;
+    virtual void exitAcceleratedCompositingMode() OVERRIDE;
+    virtual void updateAcceleratedCompositingMode(const LayerTreeContext&) OVERRIDE;
 
-    void didCommitLoadForMainFrame(bool) OVERRIDE;
-    void didFinishLoadingDataForCustomRepresentation(const String&, const CoreIPC::DataReference&) OVERRIDE;
+    virtual void didCommitLoadForMainFrame(bool) OVERRIDE;
+    virtual void didFinishLoadingDataForCustomRepresentation(const String&, const CoreIPC::DataReference&) OVERRIDE;
 
-    double customRepresentationZoomFactor() OVERRIDE;
-    void setCustomRepresentationZoomFactor(double) OVERRIDE;
+    virtual double customRepresentationZoomFactor() OVERRIDE;
+    virtual void setCustomRepresentationZoomFactor(double) OVERRIDE;
 
-    void flashBackingStoreUpdates(const Vector<WebCore::IntRect>&) OVERRIDE;
-    void findStringInCustomRepresentation(const String&, FindOptions, unsigned) OVERRIDE;
-    void countStringMatchesInCustomRepresentation(const String&, FindOptions, unsigned) OVERRIDE;
+    virtual void flashBackingStoreUpdates(const Vector<WebCore::IntRect>&) OVERRIDE;
+    virtual void findStringInCustomRepresentation(const String&, FindOptions, unsigned) OVERRIDE;
+    virtual void countStringMatchesInCustomRepresentation(const String&, FindOptions, unsigned) OVERRIDE;
 
-private:
+protected:
     WebViewClient m_client;
-    EwkView* m_ewkView;
     RefPtr<WebPageProxy> m_page;
     DefaultUndoController m_undoController;
     WebCore::TransformationMatrix m_userViewportTransform;
@@ -202,6 +195,8 @@ private:
     WebCore::FloatPoint m_contentPosition; // Position in UI units.
 };
 
-}
+} // namespace WebKit
 
-#endif
+#endif // USE(COORDINATED_GRAPHICS)
+
+#endif // WebView_h
  */
 
 #include "config.h"
+
+#if USE(COORDINATED_GRAPHICS)
+
 #include "WebViewClient.h"
-#include "WebViewportAttributes.h"
 
 #include "WKAPICast.h"
 #include "WKBase.h"
 #include "WKRetainPtr.h"
+#include "WebViewportAttributes.h"
 
 using namespace WebCore;
 
@@ -109,3 +112,5 @@ void WebViewClient::didChangeTooltip(WebView* view, const String& tooltip)
 }
 
 } // namespace WebKit
+
+#endif // USE(COORDINATED_GRAPHICS)
@@ -26,6 +26,8 @@
 #ifndef WebViewClient_h
 #define WebViewClient_h
 
+#if USE(COORDINATED_GRAPHICS)
+
 #include "APIClient.h"
 #include "WKView.h"
 #include <wtf/text/WTFString.h>
@@ -56,4 +58,6 @@ public:
 
 } // namespace WebKit
 
+#endif // USE(COORDINATED_GRAPHICS)
+
 #endif // WebViewClient_h
diff --git a/Source/WebKit2/UIProcess/efl/WebViewEfl.cpp b/Source/WebKit2/UIProcess/efl/WebViewEfl.cpp
new file mode 100644 (file)
index 0000000..e00f0ea
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebViewEfl.h"
+
+#include "DownloadManagerEfl.h"
+#include "EwkView.h"
+#include "InputMethodContextEfl.h"
+#include "WebContextMenuProxyEfl.h"
+#include "WebPopupMenuListenerEfl.h"
+#include "ewk_context_private.h"
+#include <WebCore/CoordinatedGraphicsScene.h>
+#include <WebCore/PlatformContextCairo.h>
+
+#if ENABLE(FULLSCREEN_API)
+#include "WebFullScreenManagerProxy.h"
+#endif
+
+using namespace EwkViewCallbacks;
+using namespace WebCore;
+
+namespace WebKit {
+
+PassRefPtr<WebView> WebView::create(WebContext* context, WebPageGroup* pageGroup)
+{
+    return adoptRef(new WebViewEfl(context, pageGroup));
+}
+
+WebViewEfl::WebViewEfl(WebContext* context, WebPageGroup* pageGroup)
+    : WebView(context, pageGroup)
+    , m_ewkView(0)
+{
+}
+
+void WebViewEfl::setEwkView(EwkView* ewkView)
+{
+    m_ewkView = ewkView;
+
+#if ENABLE(FULLSCREEN_API)
+    m_page->fullScreenManager()->setWebView(ewkView->evasObject());
+#endif
+}
+
+void WebViewEfl::paintToCairoSurface(cairo_surface_t* surface)
+{
+    CoordinatedGraphicsScene* scene = coordinatedGraphicsScene();
+    if (!scene)
+        return;
+
+    PlatformContextCairo context(cairo_create(surface));
+
+    const FloatPoint& position = contentPosition();
+    double effectiveScale = m_page->deviceScaleFactor() * contentScaleFactor();
+
+    cairo_matrix_t transform = { effectiveScale, 0, 0, effectiveScale, - position.x() * m_page->deviceScaleFactor(), - position.y() * m_page->deviceScaleFactor() };
+    cairo_set_matrix(context.cr(), &transform);
+    scene->paintToGraphicsContext(&context);
+}
+
+PassRefPtr<WebPopupMenuProxy> WebViewEfl::createPopupMenuProxy(WebPageProxy* page)
+{
+    return WebPopupMenuListenerEfl::create(page);
+}
+
+PassRefPtr<WebContextMenuProxy> WebViewEfl::createContextMenuProxy(WebPageProxy* page)
+{
+    return WebContextMenuProxyEfl::create(m_ewkView, page);
+}
+
+void WebViewEfl::setCursor(const Cursor& cursor)
+{
+    m_ewkView->setCursor(cursor);
+}
+
+void WebViewEfl::updateTextInputState()
+{
+    if (InputMethodContextEfl* inputMethodContext = m_ewkView->inputMethodContext())
+        inputMethodContext->updateTextInputState();
+}
+
+void WebViewEfl::handleDownloadRequest(DownloadProxy* download)
+{
+    EwkContext* context = m_ewkView->ewkContext();
+    context->downloadManager()->registerDownloadJob(toAPI(download), m_ewkView);
+}
+
+
+} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/efl/WebViewEfl.h b/Source/WebKit2/UIProcess/efl/WebViewEfl.h
new file mode 100644 (file)
index 0000000..c2e7ef3
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebViewEfl_h
+#define WebViewEfl_h
+
+#include "WebView.h"
+
+class EwkView;
+
+namespace WebKit {
+
+class WebViewEfl : public WebView {
+public:
+    void setEwkView(EwkView*);
+    EwkView* ewkView() { return m_ewkView; }
+
+    void paintToCairoSurface(cairo_surface_t*);
+
+private:
+    WebViewEfl(WebContext*, WebPageGroup*);
+
+    void setCursor(const WebCore::Cursor&) OVERRIDE;
+    PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*) OVERRIDE;
+    PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*) OVERRIDE;
+    void updateTextInputState() OVERRIDE;
+    void handleDownloadRequest(DownloadProxy*) OVERRIDE;
+
+private:
+    EwkView* m_ewkView;
+
+    friend class WebView;
+};
+
+} // namespace WebKit
+
+#endif // WebViewEfl_h
index abf9178..55fef68 100644 (file)
@@ -1,3 +1,16 @@
+2013-04-23  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
+
+        [WK2] Make EFL WKView API shareable between ports
+        https://bugs.webkit.org/show_bug.cgi?id=114734
+
+        Reviewed by Anders Carlsson.
+
+        * TestWebKitAPI/PlatformEfl.cmake:
+        * WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
+
+            Updated project files accordingly to updated WKView API files
+            structure.
+
 2013-04-23  Andreas Kling  <akling@apple.com>
 
         Add Benjamin Poulain's @apple.com address to his entry. Unreviewed.
index 98b76ff..d038a3e 100644 (file)
@@ -11,6 +11,7 @@ add_custom_target(forwarding-headersSoupForTestWebKitAPI
 set(ForwardingNetworkHeadersForTestWebKitAPI_NAME forwarding-headersSoupForTestWebKitAPI)
 
 include_directories(
+    ${WEBKIT2_DIR}/UIProcess/API/C/CoordinatedGraphics
     ${WEBKIT2_DIR}/UIProcess/API/C/soup
     ${WEBKIT2_DIR}/UIProcess/API/C/efl
     ${WEBKIT2_DIR}/UIProcess/API/efl
index a4eb07a..1bf6579 100644 (file)
@@ -27,6 +27,7 @@
 #include <Ecore_Evas.h>
 #include <WebCore/RefPtrCairo.h>
 #include <WebKit2/WKImageCairo.h>
+#include <WebKit2/WKViewEfl.h>
 #include <cairo.h>
 
 using namespace WebKit;