/* * Copyright (c) 2021, Linus Groh * Copyright (c) 2025, Sam Atkins * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include namespace Web::CSS { class Screen final : public DOM::EventTarget { WEB_PLATFORM_OBJECT(Screen, DOM::EventTarget); GC_DECLARE_ALLOCATOR(Screen); public: [[nodiscard]] static GC::Ref create(HTML::Window&); i32 width() const; i32 height() const; i32 avail_width() const; i32 avail_height() const; u32 color_depth() const; u32 pixel_depth() const; GC::Ref orientation(); bool is_extended() const; void set_onchange(GC::Ptr event_handler); GC::Ptr onchange(); private: explicit Screen(HTML::Window&); virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; HTML::Window const& window() const { return *m_window; } GC::Ref m_window; GC::Ptr m_orientation; }; }