summaryrefslogtreecommitdiff
path: root/src/mbgl/style/layers/background_layer_properties.hpp
blob: bd62ef0a586f7f32e65900e83c9e0f5caee1d77a (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
50
51
52
53
54
55
56
57
58
59
60
61
62
// 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>
#include <mbgl/style/properties.hpp>
#include <mbgl/programs/attributes.hpp>
#include <mbgl/programs/uniforms.hpp>

namespace mbgl {
namespace style {

struct BackgroundColor : PaintProperty<Color> {
    static Color defaultValue() { return Color::black(); }
};

struct BackgroundPattern : CrossFadedPaintProperty<std::string> {
    static std::string defaultValue() { return ""; }
};

struct BackgroundOpacity : PaintProperty<float> {
    static float defaultValue() { return 1; }
};

class BackgroundPaintProperties {
public:

    class PossiblyEvaluated {
    public:
        Color backgroundColor;
        Faded<std::string> backgroundPattern;
        float backgroundOpacity;
    };

    class Unevaluated {
    public:
        style::Transitioning<PropertyValue<Color>> backgroundColor;
        style::Transitioning<PropertyValue<std::string>> backgroundPattern;
        style::Transitioning<PropertyValue<float>> backgroundOpacity;

        bool hasTransition() const;
        PossiblyEvaluated evaluate(const PropertyEvaluationParameters&) const;
    };

    class Transitionable {
    public:
        style::Transitionable<PropertyValue<Color>> backgroundColor;
        style::Transitionable<PropertyValue<std::string>> backgroundPattern;
        style::Transitionable<PropertyValue<float>> backgroundOpacity;

        Unevaluated transitioned(const TransitionParameters&, Unevaluated&& prior) const;
        Unevaluated untransitioned() const;

        bool hasDataDrivenPropertyDifference(const Transitionable& other) const;
    };
};


} // namespace style
} // namespace mbgl