mirror of
https://github.com/RGBCube/serenity
synced 2025-05-17 15:45:08 +00:00

SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
42 lines
941 B
C++
42 lines
941 B
C++
/*
|
|
* Copyright (c) 2021, Linus Groh <mail@linusgroh.de>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibGfx/Rect.h>
|
|
#include <LibWeb/Bindings/Wrappable.h>
|
|
#include <LibWeb/Forward.h>
|
|
|
|
namespace Web::CSS {
|
|
|
|
class Screen final
|
|
: public RefCounted<Screen>
|
|
, public Bindings::Wrappable {
|
|
|
|
public:
|
|
using WrapperType = Bindings::ScreenWrapper;
|
|
|
|
static NonnullRefPtr<Screen> create(DOM::Window& window)
|
|
{
|
|
return adopt(*new Screen(window));
|
|
}
|
|
|
|
i32 width() const { return screen_rect().width(); }
|
|
i32 height() const { return screen_rect().height(); }
|
|
i32 avail_width() const { return screen_rect().width(); }
|
|
i32 avail_height() const { return screen_rect().height(); }
|
|
u32 color_depth() const { return 24; }
|
|
u32 pixel_depth() const { return 24; }
|
|
|
|
private:
|
|
explicit Screen(DOM::Window&);
|
|
|
|
Gfx::IntRect screen_rect() const;
|
|
|
|
DOM::Window& m_window;
|
|
};
|
|
|
|
}
|