diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2017-01-03 01:42:15 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2017-01-07 14:37:53 -0800 |
commit | d5d6bcee0f2f11cfccb3cc8ee7bc90c4f0ac74e7 (patch) | |
tree | 8da0ad24e34577dc6a4b44312a7ea1c9045c4864 /platform/darwin/src/MGLStyleLayer.h.ejs | |
parent | 80df3090ecc92a4c04890222928f352aaf467b27 (diff) | |
download | qtlocation-mapboxgl-d5d6bcee0f2f11cfccb3cc8ee7bc90c4f0ac74e7.tar.gz |
[ios, macos] Keep style attribute NSValue categories near enum declarations
Eliminated the separate NSValue+MGLStyleLayerAddition files, moving the categories into their respective style layer headers to be closer to the enumeration declarations.
Diffstat (limited to 'platform/darwin/src/MGLStyleLayer.h.ejs')
-rw-r--r-- | platform/darwin/src/MGLStyleLayer.h.ejs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLStyleLayer.h.ejs b/platform/darwin/src/MGLStyleLayer.h.ejs index 17529b8f9d..a10512dbcb 100644 --- a/platform/darwin/src/MGLStyleLayer.h.ejs +++ b/platform/darwin/src/MGLStyleLayer.h.ejs @@ -3,6 +3,7 @@ const type = locals.type; const layoutProperties = locals.layoutProperties; const paintProperties = locals.paintProperties; + const enumProperties = locals.enumProperties; -%> // This file is generated. // Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`. @@ -116,4 +117,31 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(property.name) %>) { <% } -%> @end +<% if (enumProperties) { -%> +/** + Methods for wrapping an enumeration value for a style layer attribute in an + `MGL<%- camelize(type) %>StyleLayer` object and unwrapping its raw value. + */ +@interface NSValue (MGL<%- camelize(type) %>StyleLayerAdditions) + +#pragma mark Working with <%- camelize(type) %> Style Layer Attribute Values + +<% for (let property of enumProperties) { -%> +/** + 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 |