From c902f9098b331302aaa1baac77d1575db624a132 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 26 Apr 2016 16:39:56 -0700 Subject: [core] Rationalize naming for style-related code --- include/mbgl/style/layers/background_layer.hpp | 45 ++++++ include/mbgl/style/layers/circle_layer.hpp | 63 +++++++++ include/mbgl/style/layers/custom_layer.hpp | 71 ++++++++++ include/mbgl/style/layers/fill_layer.hpp | 66 +++++++++ include/mbgl/style/layers/line_layer.hpp | 91 ++++++++++++ include/mbgl/style/layers/raster_layer.hpp | 62 +++++++++ include/mbgl/style/layers/symbol_layer.hpp | 184 +++++++++++++++++++++++++ 7 files changed, 582 insertions(+) create mode 100644 include/mbgl/style/layers/background_layer.hpp create mode 100644 include/mbgl/style/layers/circle_layer.hpp create mode 100644 include/mbgl/style/layers/custom_layer.hpp create mode 100644 include/mbgl/style/layers/fill_layer.hpp create mode 100644 include/mbgl/style/layers/line_layer.hpp create mode 100644 include/mbgl/style/layers/raster_layer.hpp create mode 100644 include/mbgl/style/layers/symbol_layer.hpp (limited to 'include/mbgl/style/layers') diff --git a/include/mbgl/style/layers/background_layer.hpp b/include/mbgl/style/layers/background_layer.hpp new file mode 100644 index 0000000000..2eb84ee499 --- /dev/null +++ b/include/mbgl/style/layers/background_layer.hpp @@ -0,0 +1,45 @@ +// This file is generated. Do not edit. + +#pragma once + +#include +#include +#include + +#include + +namespace mbgl { +namespace style { + +class BackgroundLayer : public Layer { +public: + BackgroundLayer(const std::string& layerID); + ~BackgroundLayer() final; + + // Paint properties + + PropertyValue getBackgroundColor() const; + void setBackgroundColor(PropertyValue); + + PropertyValue getBackgroundPattern() const; + void setBackgroundPattern(PropertyValue); + + PropertyValue getBackgroundOpacity() const; + void setBackgroundOpacity(PropertyValue); + + // Private implementation + + class Impl; + Impl* const impl; + + BackgroundLayer(const Impl&); + BackgroundLayer(const BackgroundLayer&) = delete; +}; + +template <> +inline bool Layer::is() const { + return type == Type::Background; +} + +} // namespace style +} // namespace mbgl diff --git a/include/mbgl/style/layers/circle_layer.hpp b/include/mbgl/style/layers/circle_layer.hpp new file mode 100644 index 0000000000..10d281b6ac --- /dev/null +++ b/include/mbgl/style/layers/circle_layer.hpp @@ -0,0 +1,63 @@ +// This file is generated. Do not edit. + +#pragma once + +#include +#include +#include + +#include + +namespace mbgl { +namespace style { + +class CircleLayer : public Layer { +public: + CircleLayer(const std::string& layerID); + ~CircleLayer() final; + + // Source + + void setSource(const std::string& sourceID, const std::string& sourceLayer); + const std::string& getSourceID() const; + const std::string& getSourceLayer() const; + + void setFilter(const Filter&); + const Filter& getFilter() const; + + // Paint properties + + PropertyValue getCircleRadius() const; + void setCircleRadius(PropertyValue); + + PropertyValue getCircleColor() const; + void setCircleColor(PropertyValue); + + PropertyValue getCircleBlur() const; + void setCircleBlur(PropertyValue); + + PropertyValue getCircleOpacity() const; + void setCircleOpacity(PropertyValue); + + PropertyValue> getCircleTranslate() const; + void setCircleTranslate(PropertyValue>); + + PropertyValue getCircleTranslateAnchor() const; + void setCircleTranslateAnchor(PropertyValue); + + // Private implementation + + class Impl; + Impl* const impl; + + CircleLayer(const Impl&); + CircleLayer(const CircleLayer&) = delete; +}; + +template <> +inline bool Layer::is() const { + return type == Type::Circle; +} + +} // namespace style +} // namespace mbgl diff --git a/include/mbgl/style/layers/custom_layer.hpp b/include/mbgl/style/layers/custom_layer.hpp new file mode 100644 index 0000000000..d3867e2c4f --- /dev/null +++ b/include/mbgl/style/layers/custom_layer.hpp @@ -0,0 +1,71 @@ +#pragma once + +#include + +namespace mbgl { +namespace style { + +/** + * Initialize any GL state needed by the custom layer. This method is called once, from the + * rendering thread, at a point when the GL context is active but before rendering for the + * first time. + * + * Resources that are acquired in this method must be released in the UninitializeFunction. + */ +using CustomLayerInitializeFunction = void (*)(void* context); + +/** + * Parameters that define the current camera position for a CustomLayerRenderFunction. + */ +struct CustomLayerRenderParameters { + double width; + double height; + double latitude; + double longitude; + double zoom; + double bearing; + double pitch; + double altitude; +}; + +/** + * Render the layer. This method is called once per frame. The implementation should not make + * any assumptions about the GL state (other than that the correct context is active). It may + * make changes to the state, and is not required to reset values such as the depth mask, stencil + * mask, and corresponding test flags to their original values. + */ +using CustomLayerRenderFunction = void (*)(void* context, const CustomLayerRenderParameters&); + +/** + * Destroy any GL state needed by the custom layer, and deallocate context, if necessary. This + * method is called once, from the rendering thread, at a point when the GL context is active. + * + * Note that it may be called even when the InitializeFunction has not been called. + */ +using CustomLayerDeinitializeFunction = void (*)(void* context); + +class CustomLayer : public Layer { +public: + CustomLayer(const std::string& id, + CustomLayerInitializeFunction, + CustomLayerRenderFunction, + CustomLayerDeinitializeFunction, + void* context); + ~CustomLayer() final; + + // Private implementation + + class Impl; + Impl* impl; + + CustomLayer(const Impl&); + CustomLayer(const CustomLayer&) = delete; +}; + +template <> +inline bool Layer::is() const { + return type == Type::Custom; +} + +} // namespace style +} // namespace mbgl diff --git a/include/mbgl/style/layers/fill_layer.hpp b/include/mbgl/style/layers/fill_layer.hpp new file mode 100644 index 0000000000..a14bf4a390 --- /dev/null +++ b/include/mbgl/style/layers/fill_layer.hpp @@ -0,0 +1,66 @@ +// This file is generated. Do not edit. + +#pragma once + +#include +#include +#include + +#include + +namespace mbgl { +namespace style { + +class FillLayer : public Layer { +public: + FillLayer(const std::string& layerID); + ~FillLayer() final; + + // Source + + void setSource(const std::string& sourceID, const std::string& sourceLayer); + const std::string& getSourceID() const; + const std::string& getSourceLayer() const; + + void setFilter(const Filter&); + const Filter& getFilter() const; + + // Paint properties + + PropertyValue getFillAntialias() const; + void setFillAntialias(PropertyValue); + + PropertyValue getFillOpacity() const; + void setFillOpacity(PropertyValue); + + PropertyValue getFillColor() const; + void setFillColor(PropertyValue); + + PropertyValue getFillOutlineColor() const; + void setFillOutlineColor(PropertyValue); + + PropertyValue> getFillTranslate() const; + void setFillTranslate(PropertyValue>); + + PropertyValue getFillTranslateAnchor() const; + void setFillTranslateAnchor(PropertyValue); + + PropertyValue getFillPattern() const; + void setFillPattern(PropertyValue); + + // Private implementation + + class Impl; + Impl* const impl; + + FillLayer(const Impl&); + FillLayer(const FillLayer&) = delete; +}; + +template <> +inline bool Layer::is() const { + return type == Type::Fill; +} + +} // namespace style +} // namespace mbgl diff --git a/include/mbgl/style/layers/line_layer.hpp b/include/mbgl/style/layers/line_layer.hpp new file mode 100644 index 0000000000..fb9e37811a --- /dev/null +++ b/include/mbgl/style/layers/line_layer.hpp @@ -0,0 +1,91 @@ +// This file is generated. Do not edit. + +#pragma once + +#include +#include +#include + +#include + +#include + +namespace mbgl { +namespace style { + +class LineLayer : public Layer { +public: + LineLayer(const std::string& layerID); + ~LineLayer() final; + + // Source + + void setSource(const std::string& sourceID, const std::string& sourceLayer); + const std::string& getSourceID() const; + const std::string& getSourceLayer() const; + + void setFilter(const Filter&); + const Filter& getFilter() const; + + // Layout properties + + PropertyValue getLineCap() const; + void setLineCap(PropertyValue); + + PropertyValue getLineJoin() const; + void setLineJoin(PropertyValue); + + PropertyValue getLineMiterLimit() const; + void setLineMiterLimit(PropertyValue); + + PropertyValue getLineRoundLimit() const; + void setLineRoundLimit(PropertyValue); + + // Paint properties + + PropertyValue getLineOpacity() const; + void setLineOpacity(PropertyValue); + + PropertyValue getLineColor() const; + void setLineColor(PropertyValue); + + PropertyValue> getLineTranslate() const; + void setLineTranslate(PropertyValue>); + + PropertyValue getLineTranslateAnchor() const; + void setLineTranslateAnchor(PropertyValue); + + PropertyValue getLineWidth() const; + void setLineWidth(PropertyValue); + + PropertyValue getLineGapWidth() const; + void setLineGapWidth(PropertyValue); + + PropertyValue getLineOffset() const; + void setLineOffset(PropertyValue); + + PropertyValue getLineBlur() const; + void setLineBlur(PropertyValue); + + PropertyValue> getLineDasharray() const; + void setLineDasharray(PropertyValue>); + + PropertyValue getLinePattern() const; + void setLinePattern(PropertyValue); + + // Private implementation + + class Impl; + Impl* const impl; + + LineLayer(const Impl&); + LineLayer(const LineLayer&) = delete; +}; + +template <> +inline bool Layer::is() const { + return type == Type::Line; +} + +} // namespace style +} // namespace mbgl diff --git a/include/mbgl/style/layers/raster_layer.hpp b/include/mbgl/style/layers/raster_layer.hpp new file mode 100644 index 0000000000..6d0c7dd91c --- /dev/null +++ b/include/mbgl/style/layers/raster_layer.hpp @@ -0,0 +1,62 @@ +// This file is generated. Do not edit. + +#pragma once + +#include +#include +#include + +#include + +namespace mbgl { +namespace style { + +class RasterLayer : public Layer { +public: + RasterLayer(const std::string& layerID); + ~RasterLayer() final; + + // Source + + void setSource(const std::string& sourceID); + const std::string& getSourceID() const; + + // Paint properties + + PropertyValue getRasterOpacity() const; + void setRasterOpacity(PropertyValue); + + PropertyValue getRasterHueRotate() const; + void setRasterHueRotate(PropertyValue); + + PropertyValue getRasterBrightnessMin() const; + void setRasterBrightnessMin(PropertyValue); + + PropertyValue getRasterBrightnessMax() const; + void setRasterBrightnessMax(PropertyValue); + + PropertyValue getRasterSaturation() const; + void setRasterSaturation(PropertyValue); + + PropertyValue getRasterContrast() const; + void setRasterContrast(PropertyValue); + + PropertyValue getRasterFadeDuration() const; + void setRasterFadeDuration(PropertyValue); + + // Private implementation + + class Impl; + Impl* const impl; + + RasterLayer(const Impl&); + RasterLayer(const RasterLayer&) = delete; +}; + +template <> +inline bool Layer::is() const { + return type == Type::Raster; +} + +} // namespace style +} // namespace mbgl diff --git a/include/mbgl/style/layers/symbol_layer.hpp b/include/mbgl/style/layers/symbol_layer.hpp new file mode 100644 index 0000000000..3806310c95 --- /dev/null +++ b/include/mbgl/style/layers/symbol_layer.hpp @@ -0,0 +1,184 @@ +// This file is generated. Do not edit. + +#pragma once + +#include +#include +#include + +#include + +#include + +namespace mbgl { +namespace style { + +class SymbolLayer : public Layer { +public: + SymbolLayer(const std::string& layerID); + ~SymbolLayer() final; + + // Source + + void setSource(const std::string& sourceID, const std::string& sourceLayer); + const std::string& getSourceID() const; + const std::string& getSourceLayer() const; + + void setFilter(const Filter&); + const Filter& getFilter() const; + + // Layout properties + + PropertyValue getSymbolPlacement() const; + void setSymbolPlacement(PropertyValue); + + PropertyValue getSymbolSpacing() const; + void setSymbolSpacing(PropertyValue); + + PropertyValue getSymbolAvoidEdges() const; + void setSymbolAvoidEdges(PropertyValue); + + PropertyValue getIconAllowOverlap() const; + void setIconAllowOverlap(PropertyValue); + + PropertyValue getIconIgnorePlacement() const; + void setIconIgnorePlacement(PropertyValue); + + PropertyValue getIconOptional() const; + void setIconOptional(PropertyValue); + + PropertyValue getIconRotationAlignment() const; + void setIconRotationAlignment(PropertyValue); + + PropertyValue getIconSize() const; + void setIconSize(PropertyValue); + + PropertyValue getIconImage() const; + void setIconImage(PropertyValue); + + PropertyValue getIconRotate() const; + void setIconRotate(PropertyValue); + + PropertyValue getIconPadding() const; + void setIconPadding(PropertyValue); + + PropertyValue getIconKeepUpright() const; + void setIconKeepUpright(PropertyValue); + + PropertyValue> getIconOffset() const; + void setIconOffset(PropertyValue>); + + PropertyValue getTextRotationAlignment() const; + void setTextRotationAlignment(PropertyValue); + + PropertyValue getTextField() const; + void setTextField(PropertyValue); + + PropertyValue> getTextFont() const; + void setTextFont(PropertyValue>); + + PropertyValue getTextSize() const; + void setTextSize(PropertyValue); + + PropertyValue getTextMaxWidth() const; + void setTextMaxWidth(PropertyValue); + + PropertyValue getTextLineHeight() const; + void setTextLineHeight(PropertyValue); + + PropertyValue getTextLetterSpacing() const; + void setTextLetterSpacing(PropertyValue); + + PropertyValue getTextJustify() const; + void setTextJustify(PropertyValue); + + PropertyValue getTextAnchor() const; + void setTextAnchor(PropertyValue); + + PropertyValue getTextMaxAngle() const; + void setTextMaxAngle(PropertyValue); + + PropertyValue getTextRotate() const; + void setTextRotate(PropertyValue); + + PropertyValue getTextPadding() const; + void setTextPadding(PropertyValue); + + PropertyValue getTextKeepUpright() const; + void setTextKeepUpright(PropertyValue); + + PropertyValue getTextTransform() const; + void setTextTransform(PropertyValue); + + PropertyValue> getTextOffset() const; + void setTextOffset(PropertyValue>); + + PropertyValue getTextAllowOverlap() const; + void setTextAllowOverlap(PropertyValue); + + PropertyValue getTextIgnorePlacement() const; + void setTextIgnorePlacement(PropertyValue); + + PropertyValue getTextOptional() const; + void setTextOptional(PropertyValue); + + // Paint properties + + PropertyValue getIconOpacity() const; + void setIconOpacity(PropertyValue); + + PropertyValue getIconColor() const; + void setIconColor(PropertyValue); + + PropertyValue getIconHaloColor() const; + void setIconHaloColor(PropertyValue); + + PropertyValue getIconHaloWidth() const; + void setIconHaloWidth(PropertyValue); + + PropertyValue getIconHaloBlur() const; + void setIconHaloBlur(PropertyValue); + + PropertyValue> getIconTranslate() const; + void setIconTranslate(PropertyValue>); + + PropertyValue getIconTranslateAnchor() const; + void setIconTranslateAnchor(PropertyValue); + + PropertyValue getTextOpacity() const; + void setTextOpacity(PropertyValue); + + PropertyValue getTextColor() const; + void setTextColor(PropertyValue); + + PropertyValue getTextHaloColor() const; + void setTextHaloColor(PropertyValue); + + PropertyValue getTextHaloWidth() const; + void setTextHaloWidth(PropertyValue); + + PropertyValue getTextHaloBlur() const; + void setTextHaloBlur(PropertyValue); + + PropertyValue> getTextTranslate() const; + void setTextTranslate(PropertyValue>); + + PropertyValue getTextTranslateAnchor() const; + void setTextTranslateAnchor(PropertyValue); + + // Private implementation + + class Impl; + Impl* const impl; + + SymbolLayer(const Impl&); + SymbolLayer(const SymbolLayer&) = delete; +}; + +template <> +inline bool Layer::is() const { + return type == Type::Symbol; +} + +} // namespace style +} // namespace mbgl -- cgit v1.2.1