Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] Introduce PropertyValue<T>
Browse files Browse the repository at this point in the history
PropertyValue<T> represents the three possible types of style property value: undefined, constant, or function.
  • Loading branch information
jfirebaugh committed Apr 26, 2016
1 parent 0b73d32 commit 976397a
Show file tree
Hide file tree
Showing 27 changed files with 761 additions and 681 deletions.
13 changes: 7 additions & 6 deletions include/mbgl/layer/background_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#pragma once

#include <mbgl/style/layer.hpp>
#include <mbgl/style/property_value.hpp>

namespace mbgl {

Expand All @@ -13,14 +14,14 @@ class BackgroundLayer : public Layer {

// Paint properties

Function<Color> getBackgroundColor() const;
void setBackgroundColor(Function<Color>);
PropertyValue<Color> getBackgroundColor() const;
void setBackgroundColor(PropertyValue<Color>);

Function<std::string> getBackgroundPattern() const;
void setBackgroundPattern(Function<std::string>);
PropertyValue<std::string> getBackgroundPattern() const;
void setBackgroundPattern(PropertyValue<std::string>);

Function<float> getBackgroundOpacity() const;
void setBackgroundOpacity(Function<float>);
PropertyValue<float> getBackgroundOpacity() const;
void setBackgroundOpacity(PropertyValue<float>);

// Private implementation

Expand Down
25 changes: 13 additions & 12 deletions include/mbgl/layer/circle_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#pragma once

#include <mbgl/style/layer.hpp>
#include <mbgl/style/property_value.hpp>

namespace mbgl {

Expand All @@ -19,23 +20,23 @@ class CircleLayer : public Layer {

// Paint properties

Function<float> getCircleRadius() const;
void setCircleRadius(Function<float>);
PropertyValue<float> getCircleRadius() const;
void setCircleRadius(PropertyValue<float>);

Function<Color> getCircleColor() const;
void setCircleColor(Function<Color>);
PropertyValue<Color> getCircleColor() const;
void setCircleColor(PropertyValue<Color>);

Function<float> getCircleBlur() const;
void setCircleBlur(Function<float>);
PropertyValue<float> getCircleBlur() const;
void setCircleBlur(PropertyValue<float>);

Function<float> getCircleOpacity() const;
void setCircleOpacity(Function<float>);
PropertyValue<float> getCircleOpacity() const;
void setCircleOpacity(PropertyValue<float>);

Function<std::array<float, 2>> getCircleTranslate() const;
void setCircleTranslate(Function<std::array<float, 2>>);
PropertyValue<std::array<float, 2>> getCircleTranslate() const;
void setCircleTranslate(PropertyValue<std::array<float, 2>>);

Function<TranslateAnchorType> getCircleTranslateAnchor() const;
void setCircleTranslateAnchor(Function<TranslateAnchorType>);
PropertyValue<TranslateAnchorType> getCircleTranslateAnchor() const;
void setCircleTranslateAnchor(PropertyValue<TranslateAnchorType>);

// Private implementation

Expand Down
29 changes: 15 additions & 14 deletions include/mbgl/layer/fill_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#pragma once

#include <mbgl/style/layer.hpp>
#include <mbgl/style/property_value.hpp>

namespace mbgl {

Expand All @@ -19,26 +20,26 @@ class FillLayer : public Layer {

// Paint properties

Function<bool> getFillAntialias() const;
void setFillAntialias(Function<bool>);
PropertyValue<bool> getFillAntialias() const;
void setFillAntialias(PropertyValue<bool>);

Function<float> getFillOpacity() const;
void setFillOpacity(Function<float>);
PropertyValue<float> getFillOpacity() const;
void setFillOpacity(PropertyValue<float>);

Function<Color> getFillColor() const;
void setFillColor(Function<Color>);
PropertyValue<Color> getFillColor() const;
void setFillColor(PropertyValue<Color>);

Function<Color> getFillOutlineColor() const;
void setFillOutlineColor(Function<Color>);
PropertyValue<Color> getFillOutlineColor() const;
void setFillOutlineColor(PropertyValue<Color>);

Function<std::array<float, 2>> getFillTranslate() const;
void setFillTranslate(Function<std::array<float, 2>>);
PropertyValue<std::array<float, 2>> getFillTranslate() const;
void setFillTranslate(PropertyValue<std::array<float, 2>>);

Function<TranslateAnchorType> getFillTranslateAnchor() const;
void setFillTranslateAnchor(Function<TranslateAnchorType>);
PropertyValue<TranslateAnchorType> getFillTranslateAnchor() const;
void setFillTranslateAnchor(PropertyValue<TranslateAnchorType>);

Function<std::string> getFillPattern() const;
void setFillPattern(Function<std::string>);
PropertyValue<std::string> getFillPattern() const;
void setFillPattern(PropertyValue<std::string>);

// Private implementation

Expand Down
57 changes: 29 additions & 28 deletions include/mbgl/layer/line_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#pragma once

#include <mbgl/style/layer.hpp>
#include <mbgl/style/property_value.hpp>

#include <vector>

Expand All @@ -21,49 +22,49 @@ class LineLayer : public Layer {

// Layout properties

Function<LineCapType> getLineCap() const;
void setLineCap(Function<LineCapType>);
PropertyValue<LineCapType> getLineCap() const;
void setLineCap(PropertyValue<LineCapType>);

Function<LineJoinType> getLineJoin() const;
void setLineJoin(Function<LineJoinType>);
PropertyValue<LineJoinType> getLineJoin() const;
void setLineJoin(PropertyValue<LineJoinType>);

Function<float> getLineMiterLimit() const;
void setLineMiterLimit(Function<float>);
PropertyValue<float> getLineMiterLimit() const;
void setLineMiterLimit(PropertyValue<float>);

Function<float> getLineRoundLimit() const;
void setLineRoundLimit(Function<float>);
PropertyValue<float> getLineRoundLimit() const;
void setLineRoundLimit(PropertyValue<float>);

// Paint properties

Function<float> getLineOpacity() const;
void setLineOpacity(Function<float>);
PropertyValue<float> getLineOpacity() const;
void setLineOpacity(PropertyValue<float>);

Function<Color> getLineColor() const;
void setLineColor(Function<Color>);
PropertyValue<Color> getLineColor() const;
void setLineColor(PropertyValue<Color>);

Function<std::array<float, 2>> getLineTranslate() const;
void setLineTranslate(Function<std::array<float, 2>>);
PropertyValue<std::array<float, 2>> getLineTranslate() const;
void setLineTranslate(PropertyValue<std::array<float, 2>>);

Function<TranslateAnchorType> getLineTranslateAnchor() const;
void setLineTranslateAnchor(Function<TranslateAnchorType>);
PropertyValue<TranslateAnchorType> getLineTranslateAnchor() const;
void setLineTranslateAnchor(PropertyValue<TranslateAnchorType>);

Function<float> getLineWidth() const;
void setLineWidth(Function<float>);
PropertyValue<float> getLineWidth() const;
void setLineWidth(PropertyValue<float>);

Function<float> getLineGapWidth() const;
void setLineGapWidth(Function<float>);
PropertyValue<float> getLineGapWidth() const;
void setLineGapWidth(PropertyValue<float>);

Function<float> getLineOffset() const;
void setLineOffset(Function<float>);
PropertyValue<float> getLineOffset() const;
void setLineOffset(PropertyValue<float>);

Function<float> getLineBlur() const;
void setLineBlur(Function<float>);
PropertyValue<float> getLineBlur() const;
void setLineBlur(PropertyValue<float>);

Function<std::vector<float>> getLineDasharray() const;
void setLineDasharray(Function<std::vector<float>>);
PropertyValue<std::vector<float>> getLineDasharray() const;
void setLineDasharray(PropertyValue<std::vector<float>>);

Function<std::string> getLinePattern() const;
void setLinePattern(Function<std::string>);
PropertyValue<std::string> getLinePattern() const;
void setLinePattern(PropertyValue<std::string>);

// Private implementation

Expand Down
29 changes: 15 additions & 14 deletions include/mbgl/layer/raster_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#pragma once

#include <mbgl/style/layer.hpp>
#include <mbgl/style/property_value.hpp>

namespace mbgl {

Expand All @@ -18,26 +19,26 @@ class RasterLayer : public Layer {

// Paint properties

Function<float> getRasterOpacity() const;
void setRasterOpacity(Function<float>);
PropertyValue<float> getRasterOpacity() const;
void setRasterOpacity(PropertyValue<float>);

Function<float> getRasterHueRotate() const;
void setRasterHueRotate(Function<float>);
PropertyValue<float> getRasterHueRotate() const;
void setRasterHueRotate(PropertyValue<float>);

Function<float> getRasterBrightnessMin() const;
void setRasterBrightnessMin(Function<float>);
PropertyValue<float> getRasterBrightnessMin() const;
void setRasterBrightnessMin(PropertyValue<float>);

Function<float> getRasterBrightnessMax() const;
void setRasterBrightnessMax(Function<float>);
PropertyValue<float> getRasterBrightnessMax() const;
void setRasterBrightnessMax(PropertyValue<float>);

Function<float> getRasterSaturation() const;
void setRasterSaturation(Function<float>);
PropertyValue<float> getRasterSaturation() const;
void setRasterSaturation(PropertyValue<float>);

Function<float> getRasterContrast() const;
void setRasterContrast(Function<float>);
PropertyValue<float> getRasterContrast() const;
void setRasterContrast(PropertyValue<float>);

Function<float> getRasterFadeDuration() const;
void setRasterFadeDuration(Function<float>);
PropertyValue<float> getRasterFadeDuration() const;
void setRasterFadeDuration(PropertyValue<float>);

// Private implementation

Expand Down
Loading

0 comments on commit 976397a

Please sign in to comment.