mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
Previously, the LibWeb bindings generator would output multiple per interface files like Prototype/Constructor/Namespace/GlobalMixin depending on the contents of that IDL file. This complicates the build system as it means that it does not know what files will be generated without knowledge of the contents of that IDL file. Instead, for each IDL file only generate a single Bindings/<IDLFile>.h and Bindings/<IDLFile>.cpp.
39 lines
1.2 KiB
C++
39 lines
1.2 KiB
C++
/*
|
|
* Copyright (c) 2025, Ladybird contributors
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibJS/Forward.h>
|
|
|
|
// FIXME: this needs to be shared inside the idl, this is not that easily fixable, so until that we are just using the definition of ImageDataPrototype and CanvasRenderingContext2DPrototype, and assert that it's the same in all duplicate declarations
|
|
#include <LibWeb/Bindings/CanvasRenderingContext2D.h>
|
|
#include <LibWeb/Bindings/ImageData.h>
|
|
|
|
namespace Web::HTML {
|
|
|
|
struct CanvasRenderingContext2DSettings {
|
|
bool alpha { true };
|
|
bool desynchronized { false };
|
|
Web::Bindings::PredefinedColorSpace color_space { Web::Bindings::PredefinedColorSpace::Srgb };
|
|
Web::Bindings::CanvasColorType color_type { Web::Bindings::CanvasColorType::Unorm8 };
|
|
bool will_read_frequently { false };
|
|
|
|
[[nodiscard]] static JS::ThrowCompletionOr<CanvasRenderingContext2DSettings> from_js_value(JS::VM&, JS::Value);
|
|
};
|
|
|
|
// https://html.spec.whatwg.org/multipage/canvas.html#canvassettings
|
|
class CanvasSettings {
|
|
public:
|
|
virtual ~CanvasSettings() = default;
|
|
|
|
virtual CanvasRenderingContext2DSettings get_context_attributes() const = 0;
|
|
|
|
protected:
|
|
CanvasSettings() = default;
|
|
};
|
|
|
|
}
|