| @@ -0,0 +1,93 @@ | ||
| /* | ||
| * Copyright (C) 2019 Haiku, Inc. | ||
| * | ||
| * 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 "NetworkProcess.h" | ||
|
|
||
| #include "NetworkProcessCreationParameters.h" | ||
| #include <WebCore/NetworkStorageSession.h> | ||
| #include <WebCore/NotImplemented.h> | ||
|
|
||
| namespace WebCore | ||
| { | ||
| class NetworkStorageSession; | ||
| } | ||
|
|
||
| namespace WebKit { | ||
|
|
||
| using namespace WebCore; | ||
|
|
||
| void NetworkProcess::platformInitializeNetworkProcess(const NetworkProcessCreationParameters& parameters) | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void NetworkProcess::allowSpecificHTTPSCertificateForHost(const CertificateInfo& certificateInfo, const String& host) | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| std::unique_ptr<WebCore::NetworkStorageSession> NetworkProcess::platformCreateDefaultStorageSession() const | ||
| { | ||
| return std::make_unique<WebCore::NetworkStorageSession>(PAL::SessionID::defaultSessionID(), nullptr); | ||
| } | ||
|
|
||
| void NetworkProcess::platformProcessDidTransitionToForeground() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void NetworkProcess::platformProcessDidTransitionToBackground() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void NetworkProcess::clearCacheForAllOrigins(uint32_t cachesToClear) | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void NetworkProcess::platformProcessDidResume() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void NetworkProcess::platformTerminate() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void NetworkProcess::platformPrepareToSuspend(CompletionHandler<void()>&& completionHandler) | ||
| { | ||
| notImplemented(); | ||
| completionHandler(); | ||
| } | ||
|
|
||
| void NetworkProcess::clearDiskCache(WallTime modifiedSince, CompletionHandler<void()>&& completionHandler) | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| } // namespace WebKit |
| @@ -0,0 +1,45 @@ | ||
| /* | ||
| * Copyright (C) 2019 Haiku, Inc. | ||
| * | ||
| * 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 THE COPYRIGHT HOLDERS ``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 "NetworkProcessMainUnix.h" | ||
|
|
||
| #include "AuxiliaryProcessMain.h" | ||
| #include "NetworkProcess.h" | ||
|
|
||
| namespace WebKit { | ||
|
|
||
| template<> | ||
| void initializeAuxiliaryProcess<NetworkProcess>(AuxiliaryProcessInitializationParameters&& parameters) | ||
| { | ||
| static NeverDestroyed<NetworkProcess> networkProcess(WTFMove(parameters)); | ||
| } | ||
|
|
||
| int NetworkProcessMainUnix(int argc, char** argv) | ||
| { | ||
| return AuxiliaryProcessMain<NetworkProcess, AuxiliaryProcessMainBase>(argc, argv); | ||
| } | ||
|
|
||
| } // namespace WebKit |
| @@ -0,0 +1,48 @@ | ||
| /* | ||
| * Copyright (C) 2019 Haiku, Inc. | ||
| * | ||
| * 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 "RemoteNetworkingContext.h" | ||
|
|
||
| #include "NetworkProcess.h" | ||
| #include "NetworkSession.h" | ||
| #include "WebsiteDataStoreParameters.h" | ||
| #include <WebCore/NetworkStorageSession.h> | ||
|
|
||
| namespace WebKit { | ||
|
|
||
| using namespace WebCore; | ||
|
|
||
| void RemoteNetworkingContext::ensureWebsiteDataStoreSession(NetworkProcess& networkProcess, WebsiteDataStoreParameters&& parameters) | ||
| { | ||
| auto sessionID = parameters.networkSessionParameters.sessionID; | ||
| if (networkProcess.storageSession(sessionID)) | ||
| return; | ||
|
|
||
| networkProcess.ensureSession(sessionID, String::number(sessionID.sessionID())); | ||
| networkProcess.setSession(sessionID, NetworkSession::create(networkProcess, WTFMove(parameters.networkSessionParameters))); | ||
| } | ||
|
|
||
| } |
| @@ -0,0 +1,47 @@ | ||
| /* | ||
| * Copyright (C) 2019 Haiku Inc. 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 WebEventFactory_h | ||
| #define WebEventFactory_h | ||
|
|
||
| #include "WebEvent.h" | ||
|
|
||
| class BMessage; | ||
|
|
||
| namespace WebKit { | ||
|
|
||
| class WebEventFactory { | ||
| public: | ||
| static WebMouseEvent createWebMouseEvent(const BMessage*, int); | ||
| static WebWheelEvent createWebWheelEvent(const BMessage*); | ||
| static WebKeyboardEvent createWebKeyboardEvent(const BMessage*); | ||
| #if ENABLE(TOUCH_EVENTS) | ||
| //static WebTouchEvent createWebTouchEvent(const GdkEvent*, Vector<WebPlatformTouchPoint>&&); | ||
| #endif | ||
| }; | ||
|
|
||
| } // namespace WebKit | ||
|
|
||
| #endif // WebEventFactory_h |
| @@ -0,0 +1,156 @@ | ||
| /* | ||
| * Copyright (C) 2019 Haiku Inc., | ||
| * | ||
| * 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 "APIWebsiteDataStore.h" | ||
|
|
||
| #include <wtf/FileSystem.h> | ||
|
|
||
| #include "NotImplemented.h" | ||
|
|
||
| namespace API { | ||
|
|
||
| String WebsiteDataStore::defaultApplicationCacheDirectory() | ||
| { | ||
| fprintf(stderr,"error"); | ||
| notImplemented(); | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::defaultCacheStorageDirectory() | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::defaultNetworkCacheDirectory() | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::defaultIndexedDBDatabaseDirectory() | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::defaultServiceWorkerRegistrationDirectory() | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::defaultLocalStorageDirectory() | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::defaultMediaKeysStorageDirectory() | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory() | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::defaultWebSQLDatabaseDirectory() | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::defaultResourceLoadStatisticsDirectory() | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::cacheDirectoryFileSystemRepresentation(const String& directoryName) | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation(const String& directoryName) | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::legacyDefaultApplicationCacheDirectory() | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::legacyDefaultNetworkCacheDirectory() | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory() | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory() | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::legacyDefaultLocalStorageDirectory() | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::legacyDefaultMediaCacheDirectory() | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory() | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory() | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| String WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory() | ||
| { | ||
| return String(); | ||
| } | ||
|
|
||
| Ref<WebKit::WebsiteDataStoreConfiguration> WebsiteDataStore::defaultDataStoreConfiguration() | ||
| { | ||
| auto configuration = WebKit::WebsiteDataStoreConfiguration::create(); | ||
|
|
||
| configuration->setApplicationCacheDirectory(defaultApplicationCacheDirectory()); | ||
| configuration->setNetworkCacheDirectory(defaultNetworkCacheDirectory()); | ||
| configuration->setWebSQLDatabaseDirectory(defaultWebSQLDatabaseDirectory()); | ||
| configuration->setLocalStorageDirectory(defaultLocalStorageDirectory()); | ||
| configuration->setMediaKeysStorageDirectory(defaultMediaKeysStorageDirectory()); | ||
| configuration->setResourceLoadStatisticsDirectory(defaultResourceLoadStatisticsDirectory()); | ||
|
|
||
| return configuration; | ||
| } | ||
|
|
||
| } // namespace API |
| @@ -0,0 +1,317 @@ | ||
| /* | ||
| * Copyright (C) 2019 Haiku, Inc. 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 "PageClientImplHaiku.h" | ||
| #include "WebProcessProxy.h" | ||
| #include "DrawingAreaProxyImpl.h" | ||
| #include "WebViewBase.h" | ||
|
|
||
| namespace WebKit | ||
| { | ||
| using namespace WebCore; | ||
|
|
||
| PageClientImpl::PageClientImpl(WebViewBase& view) | ||
| :fWebView(view) | ||
| { | ||
| //fprintf(stderr,"page client called"); | ||
| } | ||
| std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy( | ||
| WebProcessProxy& process) | ||
| { | ||
| //fprintf(stderr,"called drawing area"); | ||
| return std::make_unique<DrawingAreaProxyImpl>(*fWebView.page(),process); | ||
| } | ||
| void PageClientImpl::setViewNeedsDisplay(const WebCore::Region& region) | ||
| { | ||
| fprintf(stderr,"printing"); | ||
| //fWebView.setViewNeedsDisplay(region); | ||
| } | ||
|
|
||
| void PageClientImpl::requestScroll(const WebCore::FloatPoint&, const WebCore::IntPoint&, bool) | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| WebCore::FloatPoint PageClientImpl::viewScrollPosition() | ||
| { | ||
| notImplemented(); | ||
| return { }; | ||
| } | ||
|
|
||
| WebCore::IntSize PageClientImpl::viewSize() | ||
| { | ||
| notImplemented(); | ||
| /*if (fWebView.drawingArea()) | ||
| return fWebView.drawingArea()->size(); | ||
| return IntSize();*/ | ||
| } | ||
|
|
||
| bool PageClientImpl::isViewWindowActive() | ||
| { | ||
| //return fWebView.isWindowActive(); | ||
| } | ||
|
|
||
| bool PageClientImpl::isViewFocused() | ||
| { | ||
| //return fWebView.isFocused(); | ||
| } | ||
|
|
||
| bool PageClientImpl::isViewVisible() | ||
| { | ||
| //return fWebView.isVisible(); | ||
| } | ||
|
|
||
| bool PageClientImpl::isViewInWindow() | ||
| { | ||
| //return fWebView.isInWindow(); | ||
| } | ||
|
|
||
| void PageClientImpl::PageClientImpl::processDidExit() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::didRelaunchProcess() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::toolTipChanged(const String&, const String& newToolTip) | ||
| { | ||
| //fWebView.setToolTip(newToolTip); | ||
| } | ||
|
|
||
| void PageClientImpl::setCursor(const WebCore::Cursor& cursor) | ||
| { | ||
| //fWebView.setCursor(cursor); | ||
| } | ||
|
|
||
| void PageClientImpl::setCursorHiddenUntilMouseMoves(bool /* hiddenUntilMouseMoves */) | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::didChangeViewportProperties(const WebCore::ViewportAttributes&) | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::registerEditCommand(Ref<WebEditCommandProxy>&& command, UndoOrRedo undoOrRedo) | ||
| { | ||
| fUndoController.registerEditCommand(WTFMove(command), undoOrRedo); | ||
| } | ||
|
|
||
| void PageClientImpl::clearAllEditCommands() | ||
| { | ||
| fUndoController.clearAllEditCommands(); | ||
| } | ||
|
|
||
| bool PageClientImpl::canUndoRedo(UndoOrRedo undoOrRedo) | ||
| { | ||
| return fUndoController.canUndoRedo(undoOrRedo); | ||
| } | ||
|
|
||
| void PageClientImpl::executeUndoRedo(UndoOrRedo undoOrRedo) | ||
| { | ||
| fUndoController.executeUndoRedo(undoOrRedo); | ||
| } | ||
|
|
||
| FloatRect PageClientImpl::convertToDeviceSpace(const FloatRect& viewRect) | ||
| { | ||
| notImplemented(); | ||
| return viewRect; | ||
| } | ||
|
|
||
| FloatRect PageClientImpl::convertToUserSpace(const FloatRect& viewRect) | ||
| { | ||
| notImplemented(); | ||
| return viewRect; | ||
| } | ||
|
|
||
| IntPoint PageClientImpl::screenToRootView(const IntPoint& point) | ||
| { | ||
| return IntPoint(); | ||
| } | ||
|
|
||
| IntRect PageClientImpl::rootViewToScreen(const IntRect& rect) | ||
| { | ||
| return IntRect(); | ||
| } | ||
|
|
||
| void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool wasEventHandled) | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| RefPtr<WebPopupMenuProxy> PageClientImpl::createPopupMenuProxy(WebPageProxy& page) | ||
| { | ||
| fprintf(stderr,"context menu"); | ||
| notImplemented(); | ||
| //return WebPopupMenuProxyWin::create(&fWebView, page); | ||
| } | ||
|
|
||
| #if ENABLE(CONTEXT_MENUS) | ||
| Ref<WebContextMenuProxy> PageClientImpl::createContextMenuProxy(WebPageProxy& page, ContextMenuContextData&& context, const UserData& userData) | ||
| { | ||
| notImplemented(); | ||
| //return WebContextMenuProxyWin::create(page, WTFMove(context), userData); | ||
| } | ||
| #endif | ||
|
|
||
| //#if ENABLE(INPUT_TYPE_COLOR) | ||
| RefPtr<WebColorPicker> PageClientImpl::createColorPicker(WebPageProxy*, const WebCore::Color& intialColor, | ||
| const WebCore::IntRect&, Vector<WebCore::Color>&&) | ||
| { | ||
| return nullptr; | ||
| } | ||
| //#endif | ||
|
|
||
| void PageClientImpl::enterAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext) | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::exitAcceleratedCompositingMode() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::updateAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext) | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::pageClosed() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::preferencesDidChange() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::didChangeContentSize(const IntSize& size) | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::handleDownloadRequest(DownloadProxy* download) | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::didCommitLoadForMainFrame(const String& /* mimeType */, bool /* useCustomContentProvider */ ) | ||
| { | ||
| notImplemented(); | ||
| } | ||
| void PageClientImpl::wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent& event) | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::didFinishLoadingDataForCustomContentProvider(const String&, const IPC::DataReference&) | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::navigationGestureDidBegin() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::navigationGestureWillEnd(bool, WebBackForwardListItem&) | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::navigationGestureDidEnd(bool, WebBackForwardListItem&) | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::navigationGestureDidEnd() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::willRecordNavigationSnapshot(WebBackForwardListItem&) | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::didRemoveNavigationGestureSnapshot() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::didFinishLoadForMainFrame() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::didSameDocumentNavigationForMainFrame(SameDocumentNavigationType) | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::didChangeBackgroundColor() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::isPlayingAudioWillChange() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::isPlayingAudioDidChange() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::refView() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void PageClientImpl::derefView() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| BView* PageClientImpl::viewWidget() | ||
| { | ||
| return fWebView.getView(); | ||
| } | ||
|
|
||
| } | ||
|
|
| @@ -0,0 +1,121 @@ | ||
| /* | ||
| * Copyright (C) 2019 Haiku, Inc. 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. | ||
| */ | ||
| #pragma once | ||
|
|
||
| #include "PageClient.h" | ||
| #include "WebPageProxy.h" | ||
| #include "DefaultUndoController.h" | ||
|
|
||
| namespace WebKit | ||
| { | ||
| class WebViewBase; | ||
| class DrawingAreaProxy; | ||
| class PageClientImpl: public PageClient | ||
| { | ||
| public: | ||
| PageClientImpl(WebViewBase&); | ||
| BView* viewWidget(); | ||
| private: | ||
| //page client def's | ||
| std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy(WebProcessProxy&) override; | ||
| void setViewNeedsDisplay(const WebCore::Region&) override; | ||
| void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, bool isProgrammaticScroll) override; | ||
| WebCore::FloatPoint viewScrollPosition() override; | ||
| WebCore::IntSize viewSize() override; | ||
| bool isViewWindowActive() override; | ||
| bool isViewFocused() override; | ||
| bool isViewVisible() override; | ||
| bool isViewInWindow() override; | ||
| void processDidExit() override; | ||
| void didRelaunchProcess() override; | ||
| void pageClosed() override; | ||
| void preferencesDidChange() override; | ||
| void toolTipChanged(const WTF::String&, const WTF::String&) override; | ||
| void setCursor(const WebCore::Cursor&) override; | ||
| void setCursorHiddenUntilMouseMoves(bool) override; | ||
| void didChangeViewportProperties(const WebCore::ViewportAttributes&) override; | ||
| void registerEditCommand(Ref<WebEditCommandProxy>&&, UndoOrRedo) override; | ||
| void clearAllEditCommands() override; | ||
| bool canUndoRedo(UndoOrRedo) override; | ||
| void executeUndoRedo(UndoOrRedo) override; | ||
| WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&) override; | ||
| WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&) override; | ||
| WebCore::IntPoint screenToRootView(const WebCore::IntPoint&) override; | ||
| WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) override; | ||
| void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) override; | ||
| RefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy&) override; | ||
| Ref<WebContextMenuProxy> createContextMenuProxy(WebPageProxy&, ContextMenuContextData&&, const UserData&) override; | ||
|
|
||
| #if ENABLE(INPUT_TYPE_COLOR) | ||
| RefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& intialColor, | ||
| const WebCore::IntRect&,Vector<WebCore::Color>&&) override; | ||
| #endif | ||
|
|
||
| void enterAcceleratedCompositingMode(const LayerTreeContext&) override; | ||
| void exitAcceleratedCompositingMode() override; | ||
| void updateAcceleratedCompositingMode(const LayerTreeContext&) override; | ||
|
|
||
| void handleDownloadRequest(DownloadProxy*) override; | ||
| void didChangeContentSize(const WebCore::IntSize&) override; | ||
| void didCommitLoadForMainFrame(const String& mimeType, bool useCustomContentProvider) override; | ||
| void didFailLoadForMainFrame() override { } | ||
|
|
||
|
|
||
| void didFinishLoadingDataForCustomContentProvider(const String& suggestedFilename, const IPC::DataReference&) override; | ||
| void navigationGestureDidBegin() override; | ||
| void navigationGestureWillEnd(bool, WebBackForwardListItem&) override; | ||
| void navigationGestureDidEnd(bool, WebBackForwardListItem&) override; | ||
| void navigationGestureDidEnd() override; | ||
| void willRecordNavigationSnapshot(WebBackForwardListItem&) override; | ||
| void didRemoveNavigationGestureSnapshot() override; | ||
|
|
||
| void didFirstVisuallyNonEmptyLayoutForMainFrame() override; | ||
| void didFinishLoadForMainFrame() override; | ||
| void didSameDocumentNavigationForMainFrame(SameDocumentNavigationType) override; | ||
|
|
||
| void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&) override; | ||
|
|
||
| void didChangeBackgroundColor() override; | ||
| void isPlayingAudioWillChange() override; | ||
| void isPlayingAudioDidChange() override; | ||
|
|
||
| void refView() override; | ||
| void derefView() override; | ||
|
|
||
| void didRestoreScrollPosition() override { } | ||
|
|
||
| WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override { return WebCore::UserInterfaceLayoutDirection::LTR; } | ||
|
|
||
| void didFinishProcessingAllPendingMouseEvents() final { } | ||
|
|
||
|
|
||
| DefaultUndoController fUndoController; | ||
|
|
||
| //haiku def | ||
| WebViewBase& fWebView; | ||
| }; | ||
|
|
||
|
|
||
| } |
| @@ -1,44 +1,74 @@ | ||
| /* | ||
| Copyright (C) 2014 Haiku, inc. | ||
| * Copyright (C) 2019 Haiku, Inc. 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. | ||
| */ | ||
|
|
||
| This library is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU Library General Public | ||
| License as published by the Free Software Foundation; either | ||
| version 2 of the License, or (at your option) any later version. | ||
| #include <Window.h> | ||
| #include <View.h> | ||
|
|
||
| This library is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| Library General Public License for more details. | ||
|
|
||
| You should have received a copy of the GNU Library General Public License | ||
| along with this library; see the file COPYING.LIB. If not, write to | ||
| the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
| Boston, MA 02110-1301, USA. | ||
| */ | ||
| #include "WKPageConfigurationRef.h" | ||
| #include "WKPage.h" | ||
| #include "WKView.h" | ||
| #include "WKURL.h" | ||
| #include "WKString.h" | ||
| #include "WKContext.h" | ||
| #include "WKPreferencesRef.h" | ||
|
|
||
| #include "config.h" | ||
| #include "WebView.h" | ||
|
|
||
| #include "NotImplemented.h" | ||
| #include "WebContext.h" | ||
| #include "WebPageGroup.h" | ||
| #include "wtf/RunLoop.h" | ||
|
|
||
| using namespace WebKit; | ||
|
|
||
| BWebView::BWebView(WKContextRef context, WKPageGroupRef pageGroup) | ||
| : BView("web view", B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE) | ||
| #include "WebView.h" | ||
| BWebView::BWebView(BRect frame,BWindow* myWindow) | ||
| { | ||
| fWebView = adoptWK(WKViewCreate(context, pageGroup)); | ||
| initializeOnce(); | ||
| //webkit stuff | ||
| auto config = adoptWK(WKPageConfigurationCreate()); | ||
| auto prefs = WKPreferencesCreate(); | ||
|
|
||
|
|
||
| WKPreferencesSetDeveloperExtrasEnabled(prefs, true); | ||
| WKPageConfigurationSetPreferences(config.get(),prefs); | ||
|
|
||
| fContext = adoptWK(WKContextCreateWithConfiguration(nullptr)); | ||
| //fprintf(stderr,"here"); | ||
| WKPageConfigurationSetContext(config.get(),fContext.get()); | ||
|
|
||
| fViewPort=adoptWK(WKViewCreate("Webkit",frame,myWindow,config.get())); | ||
| // | ||
| } | ||
|
|
||
| WKViewRef BWebView::GetWKView() | ||
| void BWebView::initializeOnce() | ||
| { | ||
| return fWebView.get(); | ||
| WTF::RunLoop::initializeMainRunLoop(); | ||
| WTF::RunLoop::run(); | ||
| } | ||
|
|
||
| WKPageRef BWebView::pageRef() | ||
| void BWebView::loadHTML() | ||
| { | ||
| return WKViewGetPage(GetWKView()); | ||
| fprintf(stderr,"\nim loading"); | ||
| auto page = WKViewGetPage( fViewPort.get()); | ||
| WKRetainPtr<WKURLRef> uri; | ||
| uri = adoptWK(WKURLCreateWithUTF8CString("about:blank")); | ||
| WKRetainPtr<WKStringRef> str; | ||
| str = adoptWK(WKStringCreateWithUTF8CString("<body>Hello world</body>")); | ||
| //WKPageLoadURL(page,uri.get()); | ||
| WKPageLoadHTMLString(page,str.get(),uri.get()); | ||
| } | ||
|
|
| @@ -1,38 +1,42 @@ | ||
| /* | ||
| Copyright (C) 2014 Haiku, inc. | ||
| This library is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU Library General Public | ||
| License as published by the Free Software Foundation; either | ||
| version 2 of the License, or (at your option) any later version. | ||
| This library is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| Library General Public License for more details. | ||
| You should have received a copy of the GNU Library General Public License | ||
| along with this library; see the file COPYING.LIB. If not, write to | ||
| the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
| Boston, MA 02110-1301, USA. | ||
| */ | ||
|
|
||
| #include <View.h> | ||
|
|
||
| #include "APIObject.h" | ||
| #include "WKBase.h" | ||
| #include "WKRetainPtr.h" | ||
| * Copyright (C) 2019 Haiku, Inc. 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 "WKPage.h" | ||
| #include "WKView.h" | ||
|
|
||
| class BWebView: public BView | ||
| #include "WKContext.h" | ||
| #include "WKRetainPtr.h" | ||
| using namespace WebKit; | ||
| class BWebView | ||
| { | ||
| public: | ||
| BWebView(WKContextRef, WKPageGroupRef); | ||
|
|
||
| WKViewRef GetWKView(); | ||
| WKPageRef pageRef(); | ||
|
|
||
| private: | ||
| WKRetainPtr<WKViewRef> fWebView; | ||
| public: | ||
| BWebView(BRect,BWindow*); | ||
| void initializeOnce(); | ||
| void loadHTML(); | ||
| private: | ||
| WKRetainPtr<WKViewRef> fViewPort; | ||
| WKRetainPtr<WKContextRef> fContext; | ||
| }; | ||
|
|
||
|
|
| @@ -0,0 +1,101 @@ | ||
| /* | ||
| * Copyright (C) 2019 Haiku, Inc. 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 "WebViewBase.h" | ||
| #include "APIPageConfiguration.h" | ||
| #include "WebProcessPool.h" | ||
| #include "WebPageGroup.h" | ||
| #include "DrawingAreaProxyImpl.h" | ||
| #include <WebCore/IntRect.h> | ||
|
|
||
| using namespace WebKit; | ||
| using namespace WebCore; | ||
|
|
||
| WebKit::WebViewBase::WebViewBase(const char*name,BRect rect,BWindow* parentWindow, | ||
| const API::PageConfiguration& pageConfig) | ||
| :BView(name,B_WILL_DRAW), | ||
| fViewPort(new BView(name,B_WILL_DRAW)), | ||
| fPageClient(std::make_unique<PageClientImpl>(*this)) | ||
| { | ||
| fprintf(stderr,"Init"); | ||
| parentWindow->AddChild(fViewPort); | ||
| auto config = pageConfig.copy(); | ||
| auto* preferences = config->preferences(); | ||
|
|
||
| if(!preferences && config->pageGroup()) | ||
| { | ||
| fprintf(stderr,"config"); | ||
| preferences = &config->pageGroup()->preferences(); | ||
| config->setPreferences(preferences); | ||
| } | ||
| if(preferences) | ||
| { | ||
| preferences->setAcceleratedCompositingEnabled(false); | ||
| } | ||
|
|
||
| WebProcessPool* processPool = config->processPool(); | ||
| fPage = processPool->createWebPage(*fPageClient,WTFMove(config)); | ||
| fPage->initializeWebPage(); | ||
|
|
||
| if(fPage->drawingArea()) | ||
| { | ||
| fprintf(stderr,"drawing available"); | ||
| fPage->drawingArea()->setSize(IntSize(rect.right - rect.left, | ||
| rect.top - rect.bottom)); | ||
| } | ||
| BRect p(0,0,10,20); | ||
| paint(WebCore::IntRect(p)); | ||
| } | ||
|
|
||
| static void drawPageBackground(const WebPageProxy* page,const BRect& rect) | ||
| { | ||
| if(!page->drawsBackground()) | ||
| return; | ||
|
|
||
|
|
||
| } | ||
|
|
||
| void WebViewBase::paint(const IntRect& dirtyRect) | ||
| { | ||
| if(dirtyRect.isEmpty()) | ||
| { | ||
| fprintf(stderr,"its empty\n"); | ||
| return; | ||
| } | ||
| fPage->endPrinting(); | ||
| if(DrawingAreaProxyImpl* drawingArea = static_cast <DrawingAreaProxyImpl*>(fPage->drawingArea())) | ||
| { | ||
| fprintf(stderr,"its painting\n"); | ||
| WebCore::Region unpainted; | ||
| BView* surface = new BView("drawing_surface",B_WILL_DRAW); | ||
| drawingArea->paint(surface,dirtyRect,unpainted); | ||
| } | ||
| else | ||
| { | ||
| drawPageBackground(fPage.get(),dirtyRect); | ||
| } | ||
| } | ||
|
|
||
|
|
||
|
|
| @@ -0,0 +1,60 @@ | ||
| /* | ||
| * Copyright (C) 2019 Haiku, Inc. 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 <View.h> | ||
| #include <Window.h> | ||
| #include <Rect.h> | ||
| #include "APIObject.h" | ||
| #include "APIPageConfiguration.h" | ||
| #include "WebPageProxy.h" | ||
| #include "PageClientImplHaiku.h" | ||
|
|
||
| using namespace WebKit; | ||
| namespace WebKit | ||
| { | ||
| class WebViewBase:public API::ObjectImpl<API::Object::Type::View>, | ||
| public BView | ||
| { | ||
| public: | ||
| static RefPtr<WebViewBase> create(const char*name,BRect rect, | ||
| BWindow* parentWindow,const API::PageConfiguration& config) | ||
| { | ||
| fprintf(stderr,"yolo"); | ||
| auto fWebView=adoptRef(*new WebViewBase(name,rect,parentWindow,config)); | ||
| fprintf(stderr,"im stuff"); | ||
| return fWebView; | ||
| } | ||
| WebPageProxy* page() const { return fPage.get(); } | ||
| BView* getView() const {return fViewPort;} | ||
| void initializeOnce(); | ||
| private: | ||
| WebViewBase(const char*,BRect,BWindow*,const API::PageConfiguration&); | ||
|
|
||
| void paint(const WebCore::IntRect&); | ||
|
|
||
| BView* fViewPort {nullptr}; | ||
| RefPtr<WebPageProxy> fPage; | ||
| std::unique_ptr<PageClientImpl> fPageClient; | ||
| }; | ||
| } |
| @@ -0,0 +1,16 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>com.apple.security.device.usb</key> | ||
| <true/> | ||
| <key>com.apple.security.temporary-exception.mach-lookup.global-name</key> | ||
| <string>com.apple.Safari.SafeBrowsing.Service</string> | ||
| <key>com.apple.security.app-sandbox</key> | ||
| <true/> | ||
| <key>com.apple.security.network.client</key> | ||
| <true/> | ||
| <key>com.apple.security.temporary-exception.files.absolute-path.read-only</key> | ||
| <string>/</string> | ||
| </dict> | ||
| </plist> |
| @@ -0,0 +1,52 @@ | ||
| /* | ||
| * Copyright (C) 2019 Haiku, Inc. | ||
| * | ||
| * 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 THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT HOLDERS OR | ||
| * 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 "WebsiteDataStore.h" | ||
| #include "WebsiteDataStoreParameters.h" | ||
|
|
||
| #include "NotImplemented.h" | ||
|
|
||
| namespace WebKit { | ||
|
|
||
| void WebsiteDataStore::platformInitialize() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void WebsiteDataStore::platformDestroy() | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void WebsiteDataStore::platformRemoveRecentSearches(WallTime) | ||
| { | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void WebsiteDataStore::platformSetNetworkParameters(WebsiteDataStoreParameters&) | ||
| { | ||
| } | ||
| } // namespace WebKit |
| @@ -0,0 +1,62 @@ | ||
| /* | ||
| * Copyright (C) 2019 Haiku, Inc. | ||
| * | ||
| * 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 "WebProcessPool.h" | ||
|
|
||
| #include "WebProcessCreationParameters.h" | ||
| #include "NotImplemented.h" | ||
|
|
||
| namespace WebKit { | ||
|
|
||
| void WebProcessPool::platformInitialize() | ||
| { | ||
| fprintf(stderr,"YOLO"); | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void WebProcessPool::platformInitializeNetworkProcess(NetworkProcessCreationParameters&) | ||
| { | ||
| fprintf(stderr,"YOLO"); | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters& parameters) | ||
| { | ||
| fprintf(stderr,"YOLO webprocess\n"); | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void WebProcessPool::platformInvalidateContext() | ||
| { | ||
| fprintf(stderr,"YOLO"); | ||
| notImplemented(); | ||
| } | ||
|
|
||
| void WebProcessPool::platformResolvePathsForSandboxExtensions() | ||
| { | ||
| } | ||
|
|
||
| } // namespace WebKit |