<% const type = locals.type; const layoutProperties = locals.layoutProperties; const paintProperties = locals.paintProperties; -%> // clang-format off // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. #pragma once #include #include #include _layer.hpp> #include #include #include #include #include namespace mbgl { namespace style { <% for (const property of layoutProperties) { -%> struct <%- camelize(property.name) %> : <%- layoutPropertyType(property, type) %> { static constexpr const char *name() { return "<%- property.name %>"; } static <%- evaluatedType(property) %> defaultValue() { return <%- defaultValue(property) %>; } }; <% } -%> <% for (const property of paintProperties) { -%> <% if (property['property-type'] === 'color-ramp') { -%> struct <%- camelize(property.name) %> : ColorRampProperty { }; <% } else { -%> struct <%- camelize(property.name) %> : <%- paintPropertyType(property, type) %> { static <%- evaluatedType(property) %> defaultValue() { return <%- defaultValue(property) %>; } <% if (property.name === 'line-floor-width') { -%> using EvaluatorType = DataDrivenPropertyEvaluator; <% } -%> <% if (isOverridable(property)) { -%> static constexpr const char *name() { return "<%- property.name %>"; } static constexpr auto expressionType() { return expression::type::<%- expressionType(property) %>{}; }; template static bool hasOverride(const T& t) { return !!t.<%- camelizeWithLeadingLowercase(property.name) %>; }; <% } -%> }; <% } -%> <% } -%> <% if (layoutProperties.length) { -%> class <%- camelize(type) %>LayoutProperties : public Properties< <% for (const property of layoutProperties.slice(0, -1)) { -%> <%- camelize(property.name) %>, <% } -%> <%- camelize(layoutProperties.slice(-1)[0].name) %> > {}; <% } -%> class <%- camelize(type) %>PaintProperties : public Properties< <% for (const property of paintProperties.slice(0, -1)) { -%> <%- camelize(property.name) %>, <% } -%> <%- camelize(paintProperties.slice(-1)[0].name) %> > {}; class <%- camelize(type) %>LayerProperties final : public LayerProperties { public: explicit <%- camelize(type) %>LayerProperties(Immutable<<%- camelize(type) %>Layer::Impl>); <%- camelize(type) %>LayerProperties( Immutable<<%- camelize(type) %>Layer::Impl>, <% if (type === 'background' || type === 'fill' || type === 'line' || type === 'fill-extrusion') { -%> CrossfadeParameters, <% } -%> <%- camelize(type) %>PaintProperties::PossiblyEvaluated); ~<%- camelize(type) %>LayerProperties() override; unsigned long constantsMask() const override; const <%- camelize(type) %>Layer::Impl& layerImpl() const; // Data members. <% if (type === 'background' || type === 'fill' || type === 'line' || type === 'fill-extrusion') { -%> CrossfadeParameters crossfade; <% } -%> <%- camelize(type) %>PaintProperties::PossiblyEvaluated evaluated; }; } // namespace style } // namespace mbgl // clang-format on