From 8f4001b6b6d484c7274b98dcd971927d1db1ed88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Thu, 2 May 2019 15:25:48 +0200 Subject: [build] change style code generator to sort properties alphabetically JSON keys in our style specification don't have a defined order. This change sorts them alphabetically so that we can rely on the order remaining them same across code generation runs. --- src/mbgl/style/layers/symbol_layer_properties.hpp | 280 +++++++++++----------- 1 file changed, 140 insertions(+), 140 deletions(-) (limited to 'src/mbgl/style/layers/symbol_layer_properties.hpp') diff --git a/src/mbgl/style/layers/symbol_layer_properties.hpp b/src/mbgl/style/layers/symbol_layer_properties.hpp index 6e3fa54241..7b630a1ca3 100644 --- a/src/mbgl/style/layers/symbol_layer_properties.hpp +++ b/src/mbgl/style/layers/symbol_layer_properties.hpp @@ -14,39 +14,34 @@ namespace mbgl { namespace style { -struct SymbolPlacement : LayoutProperty { - static constexpr const char *name() { return "symbol-placement"; } - static SymbolPlacementType defaultValue() { return SymbolPlacementType::Point; } +struct IconAllowOverlap : LayoutProperty { + static constexpr const char *name() { return "icon-allow-overlap"; } + static bool defaultValue() { return false; } }; -struct SymbolSpacing : LayoutProperty { - static constexpr const char *name() { return "symbol-spacing"; } - static float defaultValue() { return 250; } +struct IconAnchor : DataDrivenLayoutProperty { + static constexpr const char *name() { return "icon-anchor"; } + static SymbolAnchorType defaultValue() { return SymbolAnchorType::Center; } }; -struct SymbolAvoidEdges : LayoutProperty { - static constexpr const char *name() { return "symbol-avoid-edges"; } +struct IconIgnorePlacement : LayoutProperty { + static constexpr const char *name() { return "icon-ignore-placement"; } static bool defaultValue() { return false; } }; -struct SymbolSortKey : DataDrivenLayoutProperty { - static constexpr const char *name() { return "symbol-sort-key"; } - static float defaultValue() { return 0; } -}; - -struct SymbolZOrder : LayoutProperty { - static constexpr const char *name() { return "symbol-z-order"; } - static SymbolZOrderType defaultValue() { return SymbolZOrderType::Auto; } +struct IconImage : DataDrivenLayoutProperty { + static constexpr const char *name() { return "icon-image"; } + static std::string defaultValue() { return ""; } }; -struct IconAllowOverlap : LayoutProperty { - static constexpr const char *name() { return "icon-allow-overlap"; } +struct IconKeepUpright : LayoutProperty { + static constexpr const char *name() { return "icon-keep-upright"; } static bool defaultValue() { return false; } }; -struct IconIgnorePlacement : LayoutProperty { - static constexpr const char *name() { return "icon-ignore-placement"; } - static bool defaultValue() { return false; } +struct IconOffset : DataDrivenLayoutProperty> { + static constexpr const char *name() { return "icon-offset"; } + static std::array defaultValue() { return {{ 0, 0 }}; } }; struct IconOptional : LayoutProperty { @@ -54,6 +49,21 @@ struct IconOptional : LayoutProperty { static bool defaultValue() { return false; } }; +struct IconPadding : LayoutProperty { + static constexpr const char *name() { return "icon-padding"; } + static float defaultValue() { return 2; } +}; + +struct IconPitchAlignment : LayoutProperty { + static constexpr const char *name() { return "icon-pitch-alignment"; } + static AlignmentType defaultValue() { return AlignmentType::Auto; } +}; + +struct IconRotate : DataDrivenLayoutProperty { + static constexpr const char *name() { return "icon-rotate"; } + static float defaultValue() { return 0; } +}; + struct IconRotationAlignment : LayoutProperty { static constexpr const char *name() { return "icon-rotation-alignment"; } static AlignmentType defaultValue() { return AlignmentType::Auto; } @@ -74,49 +84,39 @@ struct IconTextFitPadding : LayoutProperty> { static std::array defaultValue() { return {{ 0, 0, 0, 0 }}; } }; -struct IconImage : DataDrivenLayoutProperty { - static constexpr const char *name() { return "icon-image"; } - static std::string defaultValue() { return ""; } -}; - -struct IconRotate : DataDrivenLayoutProperty { - static constexpr const char *name() { return "icon-rotate"; } - static float defaultValue() { return 0; } -}; - -struct IconPadding : LayoutProperty { - static constexpr const char *name() { return "icon-padding"; } - static float defaultValue() { return 2; } +struct SymbolAvoidEdges : LayoutProperty { + static constexpr const char *name() { return "symbol-avoid-edges"; } + static bool defaultValue() { return false; } }; -struct IconKeepUpright : LayoutProperty { - static constexpr const char *name() { return "icon-keep-upright"; } - static bool defaultValue() { return false; } +struct SymbolPlacement : LayoutProperty { + static constexpr const char *name() { return "symbol-placement"; } + static SymbolPlacementType defaultValue() { return SymbolPlacementType::Point; } }; -struct IconOffset : DataDrivenLayoutProperty> { - static constexpr const char *name() { return "icon-offset"; } - static std::array defaultValue() { return {{ 0, 0 }}; } +struct SymbolSortKey : DataDrivenLayoutProperty { + static constexpr const char *name() { return "symbol-sort-key"; } + static float defaultValue() { return 0; } }; -struct IconAnchor : DataDrivenLayoutProperty { - static constexpr const char *name() { return "icon-anchor"; } - static SymbolAnchorType defaultValue() { return SymbolAnchorType::Center; } +struct SymbolSpacing : LayoutProperty { + static constexpr const char *name() { return "symbol-spacing"; } + static float defaultValue() { return 250; } }; -struct IconPitchAlignment : LayoutProperty { - static constexpr const char *name() { return "icon-pitch-alignment"; } - static AlignmentType defaultValue() { return AlignmentType::Auto; } +struct SymbolZOrder : LayoutProperty { + static constexpr const char *name() { return "symbol-z-order"; } + static SymbolZOrderType defaultValue() { return SymbolZOrderType::Auto; } }; -struct TextPitchAlignment : LayoutProperty { - static constexpr const char *name() { return "text-pitch-alignment"; } - static AlignmentType defaultValue() { return AlignmentType::Auto; } +struct TextAllowOverlap : LayoutProperty { + static constexpr const char *name() { return "text-allow-overlap"; } + static bool defaultValue() { return false; } }; -struct TextRotationAlignment : LayoutProperty { - static constexpr const char *name() { return "text-rotation-alignment"; } - static AlignmentType defaultValue() { return AlignmentType::Auto; } +struct TextAnchor : DataDrivenLayoutProperty { + static constexpr const char *name() { return "text-anchor"; } + static SymbolAnchorType defaultValue() { return SymbolAnchorType::Center; } }; struct TextField : DataDrivenLayoutProperty { @@ -129,19 +129,19 @@ struct TextFont : DataDrivenLayoutProperty> { static std::vector defaultValue() { return { "Open Sans Regular", "Arial Unicode MS Regular" }; } }; -struct TextSize : DataDrivenLayoutProperty { - static constexpr const char *name() { return "text-size"; } - static float defaultValue() { return 16; } +struct TextIgnorePlacement : LayoutProperty { + static constexpr const char *name() { return "text-ignore-placement"; } + static bool defaultValue() { return false; } }; -struct TextMaxWidth : DataDrivenLayoutProperty { - static constexpr const char *name() { return "text-max-width"; } - static float defaultValue() { return 10; } +struct TextJustify : DataDrivenLayoutProperty { + static constexpr const char *name() { return "text-justify"; } + static TextJustifyType defaultValue() { return TextJustifyType::Center; } }; -struct TextLineHeight : LayoutProperty { - static constexpr const char *name() { return "text-line-height"; } - static float defaultValue() { return 1.2; } +struct TextKeepUpright : LayoutProperty { + static constexpr const char *name() { return "text-keep-upright"; } + static bool defaultValue() { return true; } }; struct TextLetterSpacing : DataDrivenLayoutProperty { @@ -149,34 +149,29 @@ struct TextLetterSpacing : DataDrivenLayoutProperty { static float defaultValue() { return 0; } }; -struct TextJustify : DataDrivenLayoutProperty { - static constexpr const char *name() { return "text-justify"; } - static TextJustifyType defaultValue() { return TextJustifyType::Center; } -}; - -struct TextRadialOffset : DataDrivenLayoutProperty { - static constexpr const char *name() { return "text-radial-offset"; } - static float defaultValue() { return 0; } +struct TextLineHeight : LayoutProperty { + static constexpr const char *name() { return "text-line-height"; } + static float defaultValue() { return 1.2; } }; -struct TextVariableAnchor : LayoutProperty> { - static constexpr const char *name() { return "text-variable-anchor"; } - static std::vector defaultValue() { return { }; } +struct TextMaxAngle : LayoutProperty { + static constexpr const char *name() { return "text-max-angle"; } + static float defaultValue() { return 45; } }; -struct TextAnchor : DataDrivenLayoutProperty { - static constexpr const char *name() { return "text-anchor"; } - static SymbolAnchorType defaultValue() { return SymbolAnchorType::Center; } +struct TextMaxWidth : DataDrivenLayoutProperty { + static constexpr const char *name() { return "text-max-width"; } + static float defaultValue() { return 10; } }; -struct TextMaxAngle : LayoutProperty { - static constexpr const char *name() { return "text-max-angle"; } - static float defaultValue() { return 45; } +struct TextOffset : DataDrivenLayoutProperty> { + static constexpr const char *name() { return "text-offset"; } + static std::array defaultValue() { return {{ 0, 0 }}; } }; -struct TextRotate : DataDrivenLayoutProperty { - static constexpr const char *name() { return "text-rotate"; } - static float defaultValue() { return 0; } +struct TextOptional : LayoutProperty { + static constexpr const char *name() { return "text-optional"; } + static bool defaultValue() { return false; } }; struct TextPadding : LayoutProperty { @@ -184,44 +179,49 @@ struct TextPadding : LayoutProperty { static float defaultValue() { return 2; } }; -struct TextKeepUpright : LayoutProperty { - static constexpr const char *name() { return "text-keep-upright"; } - static bool defaultValue() { return true; } +struct TextPitchAlignment : LayoutProperty { + static constexpr const char *name() { return "text-pitch-alignment"; } + static AlignmentType defaultValue() { return AlignmentType::Auto; } }; -struct TextTransform : DataDrivenLayoutProperty { - static constexpr const char *name() { return "text-transform"; } - static TextTransformType defaultValue() { return TextTransformType::None; } +struct TextRadialOffset : DataDrivenLayoutProperty { + static constexpr const char *name() { return "text-radial-offset"; } + static float defaultValue() { return 0; } }; -struct TextOffset : DataDrivenLayoutProperty> { - static constexpr const char *name() { return "text-offset"; } - static std::array defaultValue() { return {{ 0, 0 }}; } +struct TextRotate : DataDrivenLayoutProperty { + static constexpr const char *name() { return "text-rotate"; } + static float defaultValue() { return 0; } }; -struct TextAllowOverlap : LayoutProperty { - static constexpr const char *name() { return "text-allow-overlap"; } - static bool defaultValue() { return false; } +struct TextRotationAlignment : LayoutProperty { + static constexpr const char *name() { return "text-rotation-alignment"; } + static AlignmentType defaultValue() { return AlignmentType::Auto; } }; -struct TextIgnorePlacement : LayoutProperty { - static constexpr const char *name() { return "text-ignore-placement"; } - static bool defaultValue() { return false; } +struct TextSize : DataDrivenLayoutProperty { + static constexpr const char *name() { return "text-size"; } + static float defaultValue() { return 16; } }; -struct TextOptional : LayoutProperty { - static constexpr const char *name() { return "text-optional"; } - static bool defaultValue() { return false; } +struct TextTransform : DataDrivenLayoutProperty { + static constexpr const char *name() { return "text-transform"; } + static TextTransformType defaultValue() { return TextTransformType::None; } }; -struct IconOpacity : DataDrivenPaintProperty { - static float defaultValue() { return 1; } +struct TextVariableAnchor : LayoutProperty> { + static constexpr const char *name() { return "text-variable-anchor"; } + static std::vector defaultValue() { return { }; } }; struct IconColor : DataDrivenPaintProperty { static Color defaultValue() { return Color::black(); } }; +struct IconHaloBlur : DataDrivenPaintProperty { + static float defaultValue() { return 0; } +}; + struct IconHaloColor : DataDrivenPaintProperty { static Color defaultValue() { return {}; } }; @@ -230,8 +230,8 @@ struct IconHaloWidth : DataDrivenPaintProperty { - static float defaultValue() { return 0; } +struct IconOpacity : DataDrivenPaintProperty { + static float defaultValue() { return 1; } }; struct IconTranslate : PaintProperty> { @@ -242,10 +242,6 @@ struct IconTranslateAnchor : PaintProperty { static TranslateAnchorType defaultValue() { return TranslateAnchorType::Map; } }; -struct TextOpacity : DataDrivenPaintProperty { - static float defaultValue() { return 1; } -}; - struct TextColor : DataDrivenPaintProperty { static Color defaultValue() { return Color::black(); } static constexpr const char *name() { return "text-color"; } @@ -253,6 +249,10 @@ struct TextColor : DataDrivenPaintProperty static bool hasOverride(const T& t) { return !!t.textColor; }; }; +struct TextHaloBlur : DataDrivenPaintProperty { + static float defaultValue() { return 0; } +}; + struct TextHaloColor : DataDrivenPaintProperty { static Color defaultValue() { return {}; } }; @@ -261,8 +261,8 @@ struct TextHaloWidth : DataDrivenPaintProperty { - static float defaultValue() { return 0; } +struct TextOpacity : DataDrivenPaintProperty { + static float defaultValue() { return 1; } }; struct TextTranslate : PaintProperty> { @@ -274,61 +274,61 @@ struct TextTranslateAnchor : PaintProperty { }; class SymbolLayoutProperties : public Properties< - SymbolPlacement, - SymbolSpacing, - SymbolAvoidEdges, - SymbolSortKey, - SymbolZOrder, IconAllowOverlap, + IconAnchor, IconIgnorePlacement, + IconImage, + IconKeepUpright, + IconOffset, IconOptional, + IconPadding, + IconPitchAlignment, + IconRotate, IconRotationAlignment, IconSize, IconTextFit, IconTextFitPadding, - IconImage, - IconRotate, - IconPadding, - IconKeepUpright, - IconOffset, - IconAnchor, - IconPitchAlignment, - TextPitchAlignment, - TextRotationAlignment, + SymbolAvoidEdges, + SymbolPlacement, + SymbolSortKey, + SymbolSpacing, + SymbolZOrder, + TextAllowOverlap, + TextAnchor, TextField, TextFont, - TextSize, - TextMaxWidth, - TextLineHeight, - TextLetterSpacing, + TextIgnorePlacement, TextJustify, - TextRadialOffset, - TextVariableAnchor, - TextAnchor, + TextKeepUpright, + TextLetterSpacing, + TextLineHeight, TextMaxAngle, - TextRotate, + TextMaxWidth, + TextOffset, + TextOptional, TextPadding, - TextKeepUpright, + TextPitchAlignment, + TextRadialOffset, + TextRotate, + TextRotationAlignment, + TextSize, TextTransform, - TextOffset, - TextAllowOverlap, - TextIgnorePlacement, - TextOptional + TextVariableAnchor > {}; class SymbolPaintProperties : public Properties< - IconOpacity, IconColor, + IconHaloBlur, IconHaloColor, IconHaloWidth, - IconHaloBlur, + IconOpacity, IconTranslate, IconTranslateAnchor, - TextOpacity, TextColor, + TextHaloBlur, TextHaloColor, TextHaloWidth, - TextHaloBlur, + TextOpacity, TextTranslate, TextTranslateAnchor > {}; -- cgit v1.2.1