summaryrefslogtreecommitdiff
path: root/src/mbgl/style/layers/layer_properties.hpp.ejs
blob: d18ad44efd8fcbdfef95175e09a9e421bc0113aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<%
  const type = locals.type;
  const layoutProperties = locals.layoutProperties;
  const paintProperties = locals.paintProperties;
-%>
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.

#pragma once

#include <mbgl/style/types.hpp>
#include <mbgl/style/layout_property.hpp>
#include <mbgl/style/paint_property.hpp>

namespace mbgl {
namespace style {

<% for (const property of layoutProperties) { -%>
struct <%- camelize(property.name) %> : LayoutProperty<<%- propertyType(property) %>> {
    static constexpr const char * key = "<%- property.name %>";
    static <%- propertyType(property) %> defaultValue() { return <%- defaultValue(property) %>; }
};

<% } -%>
<% for (const property of paintProperties) { -%>
struct <%- camelize(property.name) %> : <%
if (/-pattern$/.test(property.name) || property.name === 'line-dasharray') {
%>CrossFaded<% } -%>PaintProperty<<%- propertyType(property) %>> {
    static <%- propertyType(property) %> defaultValue() { return <%- defaultValue(property) %>; }
};

<% } -%>
<% if (layoutProperties.length) { -%>
class <%- camelize(type) %>LayoutProperties : public LayoutProperties<
<% for (const property of layoutProperties.slice(0, -1)) { -%>
    <%- camelize(property.name) %>,
<% } -%>
    <%- camelize(layoutProperties.slice(-1)[0].name) %>
> {};

<% } -%>
class <%- camelize(type) %>PaintProperties : public PaintProperties<
<% for (const property of paintProperties.slice(0, -1)) { -%>
    <%- camelize(property.name) %>,
<% } -%>
    <%- camelize(paintProperties.slice(-1)[0].name) %>
> {};

} // namespace style
} // namespace mbgl