summaryrefslogtreecommitdiff
path: root/platform/darwin/src/NSValue+MGLStyleLayerAdditions.h.ejs
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/NSValue+MGLStyleLayerAdditions.h.ejs')
-rw-r--r--platform/darwin/src/NSValue+MGLStyleLayerAdditions.h.ejs44
1 files changed, 44 insertions, 0 deletions
diff --git a/platform/darwin/src/NSValue+MGLStyleLayerAdditions.h.ejs b/platform/darwin/src/NSValue+MGLStyleLayerAdditions.h.ejs
new file mode 100644
index 0000000000..d998e232ec
--- /dev/null
+++ b/platform/darwin/src/NSValue+MGLStyleLayerAdditions.h.ejs
@@ -0,0 +1,44 @@
+// This file is generated.
+// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
+<%
+const enumPropertiesByLayerType = locals.enumPropertiesByLayerType;
+-%>
+
+#import <Foundation/Foundation.h>
+
+<% for (let layerType of Object.getOwnPropertyNames(enumPropertiesByLayerType)) { -%>
+#import "MGL<%- camelize(layerType) %>StyleLayer.h"
+<% } -%>
+
+NS_ASSUME_NONNULL_BEGIN
+
+<% for (let layerType in enumPropertiesByLayerType) { -%>
+<% if (enumPropertiesByLayerType.hasOwnProperty(layerType)) { -%>
+/**
+ Methods for wrapping an enumeration value for a style layer attribute in an
+ `MGL<%- camelize(layerType) %>StyleLayer` object and unwrapping its raw value.
+ */
+@interface NSValue (MGL<%- camelize(layerType) %>StyleLayerAdditions)
+
+#pragma mark Working with <%- camelize(layerType) %> Style Layer Attribute Values
+
+<% for (let property of enumPropertiesByLayerType[layerType]) { -%>
+/**
+ Creates a new value object containing the given `MGL<%- camelize(property.name) %>` enumeration.
+
+ @param <%- objCName(property) %> The value for the new object.
+ @return A new value object that contains the enumeration value.
+ */
++ (instancetype)valueWithMGL<%- camelize(property.name) %>:(MGL<%- camelize(property.name) %>)<%- objCName(property) %>;
+
+/**
+ The `MGL<%- camelize(property.name) %>` enumeration representation of the value.
+ */
+@property (readonly) MGL<%- camelize(property.name) %> MGL<%- camelize(property.name) %>Value;
+
+<% } -%>
+@end
+
+<% } -%>
+<% } -%>
+NS_ASSUME_NONNULL_END