Files
ladybird/Libraries/LibWeb/CSS/CSSFontFeatureValuesMap.h
Shannon Booth fd44da6829 LibWeb/Bindings: Emit one bindings header and cpp per IDL
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.
2026-04-21 07:36:13 +02:00

43 lines
1.3 KiB
C++

/*
* Copyright (c) 2026, Callum Law <callumlaw1709@outlook.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibJS/Runtime/MapIterator.h>
#include <LibWeb/Bindings/CSSFontFeatureValuesMap.h>
#include <LibWeb/Bindings/PlatformObject.h>
#include <LibWeb/Forward.h>
namespace Web::CSS {
class CSSFontFeatureValuesMap final : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(CSSFontFeatureValuesMap, Bindings::PlatformObject);
GC_DECLARE_ALLOCATOR(CSSFontFeatureValuesMap);
public:
static GC::Ref<CSSFontFeatureValuesMap> create(JS::Realm&, size_t max_value_count, GC::Ref<CSSFontFeatureValuesRule> parent_rule);
GC::Ref<JS::Map> map_entries() { return m_map_entries; }
WebIDL::ExceptionOr<void> set(String const& feature_value_name, Variant<u32, Vector<u32>> const& values);
void on_map_modified_from_js(Badge<Bindings::CSSFontFeatureValuesMapPrototype>);
OrderedHashMap<FlyString, Vector<u32>> to_ordered_hash_map() const;
private:
CSSFontFeatureValuesMap(JS::Realm&, size_t max_value_count, GC::Ref<CSSFontFeatureValuesRule> parent_rule);
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
GC::Ref<JS::Map> m_map_entries;
size_t m_max_value_count { 0 };
GC::Ref<CSSFontFeatureValuesRule> m_parent_rule;
};
}