mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-19 08:51:57 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
68
Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.h
Normal file
68
Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.h
Normal file
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
|
||||
* Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
|
||||
* Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
|
||||
* Copyright (c) 2022-2023, MacDue <macdue@dueutil.tech>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
#include <LibJS/Heap/Handle.h>
|
||||
#include <LibURL/URL.h>
|
||||
#include <LibWeb/CSS/Enums.h>
|
||||
#include <LibWeb/CSS/StyleValues/AbstractImageStyleValue.h>
|
||||
#include <LibWeb/HTML/SharedResourceRequest.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
class ImageStyleValue final
|
||||
: public AbstractImageStyleValue
|
||||
, public Weakable<ImageStyleValue> {
|
||||
public:
|
||||
static ValueComparingNonnullRefPtr<ImageStyleValue> create(URL::URL const& url)
|
||||
{
|
||||
return adopt_ref(*new (nothrow) ImageStyleValue(url));
|
||||
}
|
||||
virtual ~ImageStyleValue() override;
|
||||
|
||||
void visit_edges(JS::Cell::Visitor& visitor) const;
|
||||
|
||||
virtual String to_string() const override;
|
||||
virtual bool equals(CSSStyleValue const& other) const override;
|
||||
|
||||
virtual void load_any_resources(DOM::Document&) override;
|
||||
|
||||
Optional<CSSPixels> natural_width() const override;
|
||||
Optional<CSSPixels> natural_height() const override;
|
||||
Optional<CSSPixelFraction> natural_aspect_ratio() const override;
|
||||
|
||||
virtual bool is_paintable() const override;
|
||||
void paint(PaintContext& context, DevicePixelRect const& dest_rect, CSS::ImageRendering image_rendering) const override;
|
||||
|
||||
virtual Optional<Gfx::Color> color_if_single_pixel_bitmap() const override;
|
||||
Gfx::ImmutableBitmap const* current_frame_bitmap(DevicePixelRect const& dest_rect) const;
|
||||
|
||||
Function<void()> on_animate;
|
||||
|
||||
JS::GCPtr<HTML::DecodedImageData> image_data() const;
|
||||
|
||||
private:
|
||||
ImageStyleValue(URL::URL const&);
|
||||
|
||||
JS::GCPtr<HTML::SharedResourceRequest> m_resource_request;
|
||||
|
||||
void animate();
|
||||
Gfx::ImmutableBitmap const* bitmap(size_t frame_index, Gfx::IntSize = {}) const;
|
||||
|
||||
URL::URL m_url;
|
||||
WeakPtr<DOM::Document> m_document;
|
||||
|
||||
size_t m_current_frame_index { 0 };
|
||||
size_t m_loops_completed { 0 };
|
||||
JS::GCPtr<Platform::Timer> m_timer;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue