mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 09:12:13 -05:00
27478ec7d4
The following command was used to clang-format these files: clang-format-19 -i $(find . \ -not \( -path "./\.*" -prune \) \ -not \( -path "./Build/*" -prune \) \ -not \( -path "./Toolchain/*" -prune \) \ -type f -name "*.cpp" -o -name "*.mm" -o -name "*.h")
53 lines
1.8 KiB
C++
53 lines
1.8 KiB
C++
/*
|
|
* Copyright (c) 2023, Andrew Kaster <akaster@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibGfx/Rect.h>
|
|
#include <LibWeb/Page/Page.h>
|
|
#include <LibWeb/PixelUnits.h>
|
|
#include <WebWorker/Forward.h>
|
|
|
|
namespace WebWorker {
|
|
|
|
class PageHost final : public Web::PageClient {
|
|
GC_CELL(PageHost, Web::PageClient);
|
|
GC_DECLARE_ALLOCATOR(PageHost);
|
|
|
|
public:
|
|
static GC::Ref<PageHost> create(JS::VM& vm, ConnectionFromClient& client);
|
|
|
|
virtual ~PageHost();
|
|
|
|
virtual Web::Page& page() override;
|
|
virtual Web::Page const& page() const override;
|
|
virtual bool is_connection_open() const override;
|
|
virtual Gfx::Palette palette() const override;
|
|
virtual Web::DevicePixelRect screen_rect() const override;
|
|
virtual double device_pixels_per_css_pixel() const override;
|
|
virtual Web::CSS::PreferredColorScheme preferred_color_scheme() const override;
|
|
virtual Web::CSS::PreferredContrast preferred_contrast() const override;
|
|
virtual Web::CSS::PreferredMotion preferred_motion() const override;
|
|
virtual void paint_next_frame() override { }
|
|
virtual void process_screenshot_requests() override { }
|
|
virtual void paint(Web::DevicePixelRect const&, Web::Painting::BackingStore&, Web::PaintOptions = {}) override;
|
|
virtual void request_file(Web::FileRequest) override;
|
|
virtual bool is_ready_to_paint() const override { return true; }
|
|
virtual Web::DisplayListPlayerType display_list_player_type() const override { VERIFY_NOT_REACHED(); }
|
|
virtual bool is_headless() const override { VERIFY_NOT_REACHED(); }
|
|
|
|
private:
|
|
explicit PageHost(ConnectionFromClient&);
|
|
virtual void visit_edges(JS::Cell::Visitor&) override;
|
|
|
|
void setup_palette();
|
|
|
|
ConnectionFromClient& m_client;
|
|
GC::Ref<Web::Page> m_page;
|
|
RefPtr<Gfx::PaletteImpl> m_palette_impl;
|
|
};
|
|
|
|
}
|