2022-03-10 14:02:25 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <LibWeb/Layout/ImageBox.h>
|
2022-03-10 23:13:37 +01:00
|
|
|
#include <LibWeb/Painting/PaintableBox.h>
|
2022-03-10 14:02:25 +01:00
|
|
|
|
|
|
|
|
namespace Web::Painting {
|
|
|
|
|
|
2023-05-09 07:02:28 +02:00
|
|
|
class ImagePaintable final
|
|
|
|
|
: public PaintableBox
|
2023-08-23 18:58:42 +02:00
|
|
|
, public DOM::Document::ViewportClient {
|
2023-01-11 12:51:49 +01:00
|
|
|
JS_CELL(ImagePaintable, PaintableBox);
|
|
|
|
|
|
2022-03-10 14:02:25 +01:00
|
|
|
public:
|
2023-01-11 12:51:49 +01:00
|
|
|
static JS::NonnullGCPtr<ImagePaintable> create(Layout::ImageBox const&);
|
2022-03-10 14:02:25 +01:00
|
|
|
|
|
|
|
|
virtual void paint(PaintContext&, PaintPhase) const override;
|
|
|
|
|
|
|
|
|
|
Layout::ImageBox const& layout_box() const;
|
|
|
|
|
|
|
|
|
|
private:
|
2023-05-09 07:02:28 +02:00
|
|
|
// ^JS::Cell
|
|
|
|
|
virtual void finalize() override;
|
|
|
|
|
|
2023-08-23 18:58:42 +02:00
|
|
|
// ^Document::ViewportClient
|
|
|
|
|
virtual void did_set_viewport_rect(CSSPixelRect const&) final;
|
2023-05-09 07:02:28 +02:00
|
|
|
|
2022-03-10 14:02:25 +01:00
|
|
|
ImagePaintable(Layout::ImageBox const&);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|