[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.
This commit is contained in:
committed by
Minh Nguyễn
parent
80df3090ec
commit
d5d6bcee0f
@@ -368,8 +368,6 @@ global.mbglType = function(property) {
|
||||
const layerH = ejs.compile(fs.readFileSync('platform/darwin/src/MGLStyleLayer.h.ejs', 'utf8'), { strict: true });
|
||||
const layerM = ejs.compile(fs.readFileSync('platform/darwin/src/MGLStyleLayer.mm.ejs', 'utf8'), { strict: true});
|
||||
const testLayers = ejs.compile(fs.readFileSync('platform/darwin/test/MGLStyleLayerTests.m.ejs', 'utf8'), { strict: true});
|
||||
const categoryH = ejs.compile(fs.readFileSync('platform/darwin/src/NSValue+MGLStyleLayerAdditions.h.ejs', 'utf8'), { strict: true});
|
||||
const categoryM = ejs.compile(fs.readFileSync('platform/darwin/src/NSValue+MGLStyleLayerAdditions.mm.ejs', 'utf8'), { strict: true});
|
||||
const guideMD = ejs.compile(fs.readFileSync('platform/darwin/docs/guides/For Style Authors.md.ejs', 'utf8'), { strict: true });
|
||||
|
||||
const layers = _(spec.layer.type.values).map((value, layerType) => {
|
||||
@@ -414,15 +412,13 @@ ${macosComment}${decl}
|
||||
});
|
||||
}
|
||||
|
||||
let enumPropertiesByLayerType = {};
|
||||
var renamedPropertiesByLayerType = {};
|
||||
|
||||
for (var layer of layers) {
|
||||
let properties = _.concat(layer.layoutProperties, layer.paintProperties);
|
||||
let enumProperties = _.filter(properties, prop => prop.type === 'enum');
|
||||
if (enumProperties.length) {
|
||||
enumPropertiesByLayerType[layer.type] = enumProperties;
|
||||
layer.containsEnumerationProperties = true;
|
||||
layer.enumProperties = enumProperties;
|
||||
}
|
||||
|
||||
let renamedProperties = {};
|
||||
@@ -436,13 +432,6 @@ for (var layer of layers) {
|
||||
fs.writeFileSync(`platform/darwin/test/${prefix}${camelize(layer.type)}${suffix}Tests.m`, testLayers(layer));
|
||||
}
|
||||
|
||||
fs.writeFileSync(`platform/darwin/src/NSValue+MGLStyleLayerAdditions.h`, categoryH({
|
||||
enumPropertiesByLayerType: enumPropertiesByLayerType,
|
||||
}));
|
||||
fs.writeFileSync(`platform/darwin/src/NSValue+MGLStyleLayerAdditions.mm`, categoryM({
|
||||
enumPropertiesByLayerType: enumPropertiesByLayerType,
|
||||
}));
|
||||
|
||||
fs.writeFileSync(`platform/ios/docs/guides/For Style Authors.md`, guideMD({
|
||||
os: 'iOS',
|
||||
renamedProperties: renamedPropertiesByLayerType,
|
||||
|
||||
@@ -164,4 +164,40 @@ typedef NS_ENUM(NSUInteger, MGLCircleTranslateAnchor) {
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
Methods for wrapping an enumeration value for a style layer attribute in an
|
||||
`MGLCircleStyleLayer` object and unwrapping its raw value.
|
||||
*/
|
||||
@interface NSValue (MGLCircleStyleLayerAdditions)
|
||||
|
||||
#pragma mark Working with Circle Style Layer Attribute Values
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLCirclePitchScale` enumeration.
|
||||
|
||||
@param circlePitchScale The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLCirclePitchScale:(MGLCirclePitchScale)circlePitchScale;
|
||||
|
||||
/**
|
||||
The `MGLCirclePitchScale` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLCirclePitchScale MGLCirclePitchScaleValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLCircleTranslateAnchor` enumeration.
|
||||
|
||||
@param circleTranslateAnchor The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLCircleTranslateAnchor:(MGLCircleTranslateAnchor)circleTranslateAnchor;
|
||||
|
||||
/**
|
||||
The `MGLCircleTranslateAnchor` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLCircleTranslateAnchor MGLCircleTranslateAnchorValue;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -230,4 +230,28 @@ namespace mbgl {
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSValue (MGLCircleStyleLayerAdditions)
|
||||
|
||||
+ (NSValue *)valueWithMGLCirclePitchScale:(MGLCirclePitchScale)circlePitchScale {
|
||||
return [NSValue value:&circlePitchScale withObjCType:@encode(MGLCirclePitchScale)];
|
||||
}
|
||||
|
||||
- (MGLCirclePitchScale)MGLCirclePitchScaleValue {
|
||||
MGLCirclePitchScale circlePitchScale;
|
||||
[self getValue:&circlePitchScale];
|
||||
return circlePitchScale;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLCircleTranslateAnchor:(MGLCircleTranslateAnchor)circleTranslateAnchor {
|
||||
return [NSValue value:&circleTranslateAnchor withObjCType:@encode(MGLCircleTranslateAnchor)];
|
||||
}
|
||||
|
||||
- (MGLCircleTranslateAnchor)MGLCircleTranslateAnchorValue {
|
||||
MGLCircleTranslateAnchor circleTranslateAnchor;
|
||||
[self getValue:&circleTranslateAnchor];
|
||||
return circleTranslateAnchor;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -144,4 +144,27 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslateAnchor) {
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
Methods for wrapping an enumeration value for a style layer attribute in an
|
||||
`MGLFillStyleLayer` object and unwrapping its raw value.
|
||||
*/
|
||||
@interface NSValue (MGLFillStyleLayerAdditions)
|
||||
|
||||
#pragma mark Working with Fill Style Layer Attribute Values
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLFillTranslateAnchor` enumeration.
|
||||
|
||||
@param fillTranslateAnchor The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLFillTranslateAnchor:(MGLFillTranslateAnchor)fillTranslateAnchor;
|
||||
|
||||
/**
|
||||
The `MGLFillTranslateAnchor` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLFillTranslateAnchor MGLFillTranslateAnchorValue;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -230,4 +230,18 @@ namespace mbgl {
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSValue (MGLFillStyleLayerAdditions)
|
||||
|
||||
+ (NSValue *)valueWithMGLFillTranslateAnchor:(MGLFillTranslateAnchor)fillTranslateAnchor {
|
||||
return [NSValue value:&fillTranslateAnchor withObjCType:@encode(MGLFillTranslateAnchor)];
|
||||
}
|
||||
|
||||
- (MGLFillTranslateAnchor)MGLFillTranslateAnchorValue {
|
||||
MGLFillTranslateAnchor fillTranslateAnchor;
|
||||
[self getValue:&fillTranslateAnchor];
|
||||
return fillTranslateAnchor;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -286,4 +286,53 @@ typedef NS_ENUM(NSUInteger, MGLLineTranslateAnchor) {
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
Methods for wrapping an enumeration value for a style layer attribute in an
|
||||
`MGLLineStyleLayer` object and unwrapping its raw value.
|
||||
*/
|
||||
@interface NSValue (MGLLineStyleLayerAdditions)
|
||||
|
||||
#pragma mark Working with Line Style Layer Attribute Values
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLLineCap` enumeration.
|
||||
|
||||
@param lineCap The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLLineCap:(MGLLineCap)lineCap;
|
||||
|
||||
/**
|
||||
The `MGLLineCap` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLLineCap MGLLineCapValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLLineJoin` enumeration.
|
||||
|
||||
@param lineJoin The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLLineJoin:(MGLLineJoin)lineJoin;
|
||||
|
||||
/**
|
||||
The `MGLLineJoin` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLLineJoin MGLLineJoinValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLLineTranslateAnchor` enumeration.
|
||||
|
||||
@param lineTranslateAnchor The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLLineTranslateAnchor:(MGLLineTranslateAnchor)lineTranslateAnchor;
|
||||
|
||||
/**
|
||||
The `MGLLineTranslateAnchor` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLLineTranslateAnchor MGLLineTranslateAnchorValue;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -342,4 +342,38 @@ namespace mbgl {
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSValue (MGLLineStyleLayerAdditions)
|
||||
|
||||
+ (NSValue *)valueWithMGLLineCap:(MGLLineCap)lineCap {
|
||||
return [NSValue value:&lineCap withObjCType:@encode(MGLLineCap)];
|
||||
}
|
||||
|
||||
- (MGLLineCap)MGLLineCapValue {
|
||||
MGLLineCap lineCap;
|
||||
[self getValue:&lineCap];
|
||||
return lineCap;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLLineJoin:(MGLLineJoin)lineJoin {
|
||||
return [NSValue value:&lineJoin withObjCType:@encode(MGLLineJoin)];
|
||||
}
|
||||
|
||||
- (MGLLineJoin)MGLLineJoinValue {
|
||||
MGLLineJoin lineJoin;
|
||||
[self getValue:&lineJoin];
|
||||
return lineJoin;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLLineTranslateAnchor:(MGLLineTranslateAnchor)lineTranslateAnchor {
|
||||
return [NSValue value:&lineTranslateAnchor withObjCType:@encode(MGLLineTranslateAnchor)];
|
||||
}
|
||||
|
||||
- (MGLLineTranslateAnchor)MGLLineTranslateAnchorValue {
|
||||
MGLLineTranslateAnchor lineTranslateAnchor;
|
||||
[self getValue:&lineTranslateAnchor];
|
||||
return lineTranslateAnchor;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
const type = locals.type;
|
||||
const layoutProperties = locals.layoutProperties;
|
||||
const paintProperties = locals.paintProperties;
|
||||
const containsEnumerationProperties = locals.containsEnumerationProperties;
|
||||
const enumProperties = locals.enumProperties;
|
||||
-%>
|
||||
// This file is generated.
|
||||
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
|
||||
@@ -15,7 +15,7 @@
|
||||
#import "MGL<%- camelize(type) %>StyleLayer.h"
|
||||
|
||||
#include <mbgl/style/layers/<%- type %>_layer.hpp>
|
||||
<% if (containsEnumerationProperties) { -%>
|
||||
<% if (enumProperties) { -%>
|
||||
namespace mbgl {
|
||||
|
||||
<% if (layoutProperties.length) { -%>
|
||||
@@ -243,3 +243,21 @@ namespace mbgl {
|
||||
<% } -%>
|
||||
|
||||
@end
|
||||
<% if (enumProperties) { -%>
|
||||
|
||||
@implementation NSValue (MGL<%- camelize(type) %>StyleLayerAdditions)
|
||||
|
||||
<% for (let property of enumProperties) { -%>
|
||||
+ (NSValue *)valueWithMGL<%- camelize(property.name) %>:(MGL<%- camelize(property.name) %>)<%- objCName(property) %> {
|
||||
return [NSValue value:&<%- objCName(property) %> withObjCType:@encode(MGL<%- camelize(property.name) %>)];
|
||||
}
|
||||
|
||||
- (MGL<%- camelize(property.name) %>)MGL<%- camelize(property.name) %>Value {
|
||||
MGL<%- camelize(property.name) %> <%- objCName(property) %>;
|
||||
[self getValue:&<%- objCName(property) %>];
|
||||
return <%- objCName(property) %>;
|
||||
}
|
||||
|
||||
<% } -%>
|
||||
@end
|
||||
<% } -%>
|
||||
@@ -1064,4 +1064,144 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) {
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
Methods for wrapping an enumeration value for a style layer attribute in an
|
||||
`MGLSymbolStyleLayer` object and unwrapping its raw value.
|
||||
*/
|
||||
@interface NSValue (MGLSymbolStyleLayerAdditions)
|
||||
|
||||
#pragma mark Working with Symbol Style Layer Attribute Values
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLIconRotationAlignment` enumeration.
|
||||
|
||||
@param iconRotationAlignment The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLIconRotationAlignment:(MGLIconRotationAlignment)iconRotationAlignment;
|
||||
|
||||
/**
|
||||
The `MGLIconRotationAlignment` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLIconRotationAlignment MGLIconRotationAlignmentValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLIconTextFit` enumeration.
|
||||
|
||||
@param iconTextFit The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLIconTextFit:(MGLIconTextFit)iconTextFit;
|
||||
|
||||
/**
|
||||
The `MGLIconTextFit` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLIconTextFit MGLIconTextFitValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLSymbolPlacement` enumeration.
|
||||
|
||||
@param symbolPlacement The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLSymbolPlacement:(MGLSymbolPlacement)symbolPlacement;
|
||||
|
||||
/**
|
||||
The `MGLSymbolPlacement` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLSymbolPlacement MGLSymbolPlacementValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLTextAnchor` enumeration.
|
||||
|
||||
@param textAnchor The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLTextAnchor:(MGLTextAnchor)textAnchor;
|
||||
|
||||
/**
|
||||
The `MGLTextAnchor` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLTextAnchor MGLTextAnchorValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLTextJustification` enumeration.
|
||||
|
||||
@param textJustification The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLTextJustification:(MGLTextJustification)textJustification;
|
||||
|
||||
/**
|
||||
The `MGLTextJustification` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLTextJustification MGLTextJustificationValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLTextPitchAlignment` enumeration.
|
||||
|
||||
@param textPitchAlignment The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLTextPitchAlignment:(MGLTextPitchAlignment)textPitchAlignment;
|
||||
|
||||
/**
|
||||
The `MGLTextPitchAlignment` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLTextPitchAlignment MGLTextPitchAlignmentValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLTextRotationAlignment` enumeration.
|
||||
|
||||
@param textRotationAlignment The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLTextRotationAlignment:(MGLTextRotationAlignment)textRotationAlignment;
|
||||
|
||||
/**
|
||||
The `MGLTextRotationAlignment` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLTextRotationAlignment MGLTextRotationAlignmentValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLTextTransform` enumeration.
|
||||
|
||||
@param textTransform The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLTextTransform:(MGLTextTransform)textTransform;
|
||||
|
||||
/**
|
||||
The `MGLTextTransform` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLTextTransform MGLTextTransformValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLIconTranslateAnchor` enumeration.
|
||||
|
||||
@param iconTranslateAnchor The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLIconTranslateAnchor:(MGLIconTranslateAnchor)iconTranslateAnchor;
|
||||
|
||||
/**
|
||||
The `MGLIconTranslateAnchor` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLIconTranslateAnchor MGLIconTranslateAnchorValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLTextTranslateAnchor` enumeration.
|
||||
|
||||
@param textTranslateAnchor The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLTextTranslateAnchor:(MGLTextTranslateAnchor)textTranslateAnchor;
|
||||
|
||||
/**
|
||||
The `MGLTextTranslateAnchor` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLTextTranslateAnchor MGLTextTranslateAnchorValue;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -986,4 +986,108 @@ namespace mbgl {
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSValue (MGLSymbolStyleLayerAdditions)
|
||||
|
||||
+ (NSValue *)valueWithMGLIconRotationAlignment:(MGLIconRotationAlignment)iconRotationAlignment {
|
||||
return [NSValue value:&iconRotationAlignment withObjCType:@encode(MGLIconRotationAlignment)];
|
||||
}
|
||||
|
||||
- (MGLIconRotationAlignment)MGLIconRotationAlignmentValue {
|
||||
MGLIconRotationAlignment iconRotationAlignment;
|
||||
[self getValue:&iconRotationAlignment];
|
||||
return iconRotationAlignment;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLIconTextFit:(MGLIconTextFit)iconTextFit {
|
||||
return [NSValue value:&iconTextFit withObjCType:@encode(MGLIconTextFit)];
|
||||
}
|
||||
|
||||
- (MGLIconTextFit)MGLIconTextFitValue {
|
||||
MGLIconTextFit iconTextFit;
|
||||
[self getValue:&iconTextFit];
|
||||
return iconTextFit;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLSymbolPlacement:(MGLSymbolPlacement)symbolPlacement {
|
||||
return [NSValue value:&symbolPlacement withObjCType:@encode(MGLSymbolPlacement)];
|
||||
}
|
||||
|
||||
- (MGLSymbolPlacement)MGLSymbolPlacementValue {
|
||||
MGLSymbolPlacement symbolPlacement;
|
||||
[self getValue:&symbolPlacement];
|
||||
return symbolPlacement;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLTextAnchor:(MGLTextAnchor)textAnchor {
|
||||
return [NSValue value:&textAnchor withObjCType:@encode(MGLTextAnchor)];
|
||||
}
|
||||
|
||||
- (MGLTextAnchor)MGLTextAnchorValue {
|
||||
MGLTextAnchor textAnchor;
|
||||
[self getValue:&textAnchor];
|
||||
return textAnchor;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLTextJustification:(MGLTextJustification)textJustification {
|
||||
return [NSValue value:&textJustification withObjCType:@encode(MGLTextJustification)];
|
||||
}
|
||||
|
||||
- (MGLTextJustification)MGLTextJustificationValue {
|
||||
MGLTextJustification textJustification;
|
||||
[self getValue:&textJustification];
|
||||
return textJustification;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLTextPitchAlignment:(MGLTextPitchAlignment)textPitchAlignment {
|
||||
return [NSValue value:&textPitchAlignment withObjCType:@encode(MGLTextPitchAlignment)];
|
||||
}
|
||||
|
||||
- (MGLTextPitchAlignment)MGLTextPitchAlignmentValue {
|
||||
MGLTextPitchAlignment textPitchAlignment;
|
||||
[self getValue:&textPitchAlignment];
|
||||
return textPitchAlignment;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLTextRotationAlignment:(MGLTextRotationAlignment)textRotationAlignment {
|
||||
return [NSValue value:&textRotationAlignment withObjCType:@encode(MGLTextRotationAlignment)];
|
||||
}
|
||||
|
||||
- (MGLTextRotationAlignment)MGLTextRotationAlignmentValue {
|
||||
MGLTextRotationAlignment textRotationAlignment;
|
||||
[self getValue:&textRotationAlignment];
|
||||
return textRotationAlignment;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLTextTransform:(MGLTextTransform)textTransform {
|
||||
return [NSValue value:&textTransform withObjCType:@encode(MGLTextTransform)];
|
||||
}
|
||||
|
||||
- (MGLTextTransform)MGLTextTransformValue {
|
||||
MGLTextTransform textTransform;
|
||||
[self getValue:&textTransform];
|
||||
return textTransform;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLIconTranslateAnchor:(MGLIconTranslateAnchor)iconTranslateAnchor {
|
||||
return [NSValue value:&iconTranslateAnchor withObjCType:@encode(MGLIconTranslateAnchor)];
|
||||
}
|
||||
|
||||
- (MGLIconTranslateAnchor)MGLIconTranslateAnchorValue {
|
||||
MGLIconTranslateAnchor iconTranslateAnchor;
|
||||
[self getValue:&iconTranslateAnchor];
|
||||
return iconTranslateAnchor;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLTextTranslateAnchor:(MGLTextTranslateAnchor)textTranslateAnchor {
|
||||
return [NSValue value:&textTranslateAnchor withObjCType:@encode(MGLTextTranslateAnchor)];
|
||||
}
|
||||
|
||||
- (MGLTextTranslateAnchor)MGLTextTranslateAnchorValue {
|
||||
MGLTextTranslateAnchor textTranslateAnchor;
|
||||
[self getValue:&textTranslateAnchor];
|
||||
return textTranslateAnchor;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,261 +0,0 @@
|
||||
// This file is generated.
|
||||
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "MGLCircleStyleLayer.h"
|
||||
#import "MGLFillStyleLayer.h"
|
||||
#import "MGLLineStyleLayer.h"
|
||||
#import "MGLSymbolStyleLayer.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
Methods for wrapping an enumeration value for a style layer attribute in an
|
||||
`MGLCircleStyleLayer` object and unwrapping its raw value.
|
||||
*/
|
||||
@interface NSValue (MGLCircleStyleLayerAdditions)
|
||||
|
||||
#pragma mark Working with Circle Style Layer Attribute Values
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLCirclePitchScale` enumeration.
|
||||
|
||||
@param circlePitchScale The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLCirclePitchScale:(MGLCirclePitchScale)circlePitchScale;
|
||||
|
||||
/**
|
||||
The `MGLCirclePitchScale` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLCirclePitchScale MGLCirclePitchScaleValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLCircleTranslateAnchor` enumeration.
|
||||
|
||||
@param circleTranslateAnchor The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLCircleTranslateAnchor:(MGLCircleTranslateAnchor)circleTranslateAnchor;
|
||||
|
||||
/**
|
||||
The `MGLCircleTranslateAnchor` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLCircleTranslateAnchor MGLCircleTranslateAnchorValue;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
Methods for wrapping an enumeration value for a style layer attribute in an
|
||||
`MGLFillStyleLayer` object and unwrapping its raw value.
|
||||
*/
|
||||
@interface NSValue (MGLFillStyleLayerAdditions)
|
||||
|
||||
#pragma mark Working with Fill Style Layer Attribute Values
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLFillTranslateAnchor` enumeration.
|
||||
|
||||
@param fillTranslateAnchor The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLFillTranslateAnchor:(MGLFillTranslateAnchor)fillTranslateAnchor;
|
||||
|
||||
/**
|
||||
The `MGLFillTranslateAnchor` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLFillTranslateAnchor MGLFillTranslateAnchorValue;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
Methods for wrapping an enumeration value for a style layer attribute in an
|
||||
`MGLLineStyleLayer` object and unwrapping its raw value.
|
||||
*/
|
||||
@interface NSValue (MGLLineStyleLayerAdditions)
|
||||
|
||||
#pragma mark Working with Line Style Layer Attribute Values
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLLineCap` enumeration.
|
||||
|
||||
@param lineCap The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLLineCap:(MGLLineCap)lineCap;
|
||||
|
||||
/**
|
||||
The `MGLLineCap` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLLineCap MGLLineCapValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLLineJoin` enumeration.
|
||||
|
||||
@param lineJoin The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLLineJoin:(MGLLineJoin)lineJoin;
|
||||
|
||||
/**
|
||||
The `MGLLineJoin` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLLineJoin MGLLineJoinValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLLineTranslateAnchor` enumeration.
|
||||
|
||||
@param lineTranslateAnchor The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLLineTranslateAnchor:(MGLLineTranslateAnchor)lineTranslateAnchor;
|
||||
|
||||
/**
|
||||
The `MGLLineTranslateAnchor` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLLineTranslateAnchor MGLLineTranslateAnchorValue;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
Methods for wrapping an enumeration value for a style layer attribute in an
|
||||
`MGLSymbolStyleLayer` object and unwrapping its raw value.
|
||||
*/
|
||||
@interface NSValue (MGLSymbolStyleLayerAdditions)
|
||||
|
||||
#pragma mark Working with Symbol Style Layer Attribute Values
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLIconRotationAlignment` enumeration.
|
||||
|
||||
@param iconRotationAlignment The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLIconRotationAlignment:(MGLIconRotationAlignment)iconRotationAlignment;
|
||||
|
||||
/**
|
||||
The `MGLIconRotationAlignment` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLIconRotationAlignment MGLIconRotationAlignmentValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLIconTextFit` enumeration.
|
||||
|
||||
@param iconTextFit The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLIconTextFit:(MGLIconTextFit)iconTextFit;
|
||||
|
||||
/**
|
||||
The `MGLIconTextFit` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLIconTextFit MGLIconTextFitValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLSymbolPlacement` enumeration.
|
||||
|
||||
@param symbolPlacement The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLSymbolPlacement:(MGLSymbolPlacement)symbolPlacement;
|
||||
|
||||
/**
|
||||
The `MGLSymbolPlacement` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLSymbolPlacement MGLSymbolPlacementValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLTextAnchor` enumeration.
|
||||
|
||||
@param textAnchor The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLTextAnchor:(MGLTextAnchor)textAnchor;
|
||||
|
||||
/**
|
||||
The `MGLTextAnchor` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLTextAnchor MGLTextAnchorValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLTextJustification` enumeration.
|
||||
|
||||
@param textJustification The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLTextJustification:(MGLTextJustification)textJustification;
|
||||
|
||||
/**
|
||||
The `MGLTextJustification` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLTextJustification MGLTextJustificationValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLTextPitchAlignment` enumeration.
|
||||
|
||||
@param textPitchAlignment The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLTextPitchAlignment:(MGLTextPitchAlignment)textPitchAlignment;
|
||||
|
||||
/**
|
||||
The `MGLTextPitchAlignment` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLTextPitchAlignment MGLTextPitchAlignmentValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLTextRotationAlignment` enumeration.
|
||||
|
||||
@param textRotationAlignment The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLTextRotationAlignment:(MGLTextRotationAlignment)textRotationAlignment;
|
||||
|
||||
/**
|
||||
The `MGLTextRotationAlignment` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLTextRotationAlignment MGLTextRotationAlignmentValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLTextTransform` enumeration.
|
||||
|
||||
@param textTransform The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLTextTransform:(MGLTextTransform)textTransform;
|
||||
|
||||
/**
|
||||
The `MGLTextTransform` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLTextTransform MGLTextTransformValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLIconTranslateAnchor` enumeration.
|
||||
|
||||
@param iconTranslateAnchor The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLIconTranslateAnchor:(MGLIconTranslateAnchor)iconTranslateAnchor;
|
||||
|
||||
/**
|
||||
The `MGLIconTranslateAnchor` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLIconTranslateAnchor MGLIconTranslateAnchorValue;
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLTextTranslateAnchor` enumeration.
|
||||
|
||||
@param textTranslateAnchor The value for the new object.
|
||||
@return A new value object that contains the enumeration value.
|
||||
*/
|
||||
+ (instancetype)valueWithMGLTextTranslateAnchor:(MGLTextTranslateAnchor)textTranslateAnchor;
|
||||
|
||||
/**
|
||||
The `MGLTextTranslateAnchor` enumeration representation of the value.
|
||||
*/
|
||||
@property (readonly) MGLTextTranslateAnchor MGLTextTranslateAnchorValue;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -1,44 +0,0 @@
|
||||
// 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
|
||||
@@ -1,181 +0,0 @@
|
||||
// This file is generated.
|
||||
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
|
||||
|
||||
#import "NSValue+MGLStyleLayerAdditions.h"
|
||||
|
||||
@implementation NSValue (MGLCircleStyleLayerAdditions)
|
||||
|
||||
+ (NSValue *)valueWithMGLCirclePitchScale:(MGLCirclePitchScale)circlePitchScale {
|
||||
return [NSValue value:&circlePitchScale withObjCType:@encode(MGLCirclePitchScale)];
|
||||
}
|
||||
|
||||
- (MGLCirclePitchScale)MGLCirclePitchScaleValue {
|
||||
MGLCirclePitchScale circlePitchScale;
|
||||
[self getValue:&circlePitchScale];
|
||||
return circlePitchScale;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLCircleTranslateAnchor:(MGLCircleTranslateAnchor)circleTranslateAnchor {
|
||||
return [NSValue value:&circleTranslateAnchor withObjCType:@encode(MGLCircleTranslateAnchor)];
|
||||
}
|
||||
|
||||
- (MGLCircleTranslateAnchor)MGLCircleTranslateAnchorValue {
|
||||
MGLCircleTranslateAnchor circleTranslateAnchor;
|
||||
[self getValue:&circleTranslateAnchor];
|
||||
return circleTranslateAnchor;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSValue (MGLFillStyleLayerAdditions)
|
||||
|
||||
+ (NSValue *)valueWithMGLFillTranslateAnchor:(MGLFillTranslateAnchor)fillTranslateAnchor {
|
||||
return [NSValue value:&fillTranslateAnchor withObjCType:@encode(MGLFillTranslateAnchor)];
|
||||
}
|
||||
|
||||
- (MGLFillTranslateAnchor)MGLFillTranslateAnchorValue {
|
||||
MGLFillTranslateAnchor fillTranslateAnchor;
|
||||
[self getValue:&fillTranslateAnchor];
|
||||
return fillTranslateAnchor;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSValue (MGLLineStyleLayerAdditions)
|
||||
|
||||
+ (NSValue *)valueWithMGLLineCap:(MGLLineCap)lineCap {
|
||||
return [NSValue value:&lineCap withObjCType:@encode(MGLLineCap)];
|
||||
}
|
||||
|
||||
- (MGLLineCap)MGLLineCapValue {
|
||||
MGLLineCap lineCap;
|
||||
[self getValue:&lineCap];
|
||||
return lineCap;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLLineJoin:(MGLLineJoin)lineJoin {
|
||||
return [NSValue value:&lineJoin withObjCType:@encode(MGLLineJoin)];
|
||||
}
|
||||
|
||||
- (MGLLineJoin)MGLLineJoinValue {
|
||||
MGLLineJoin lineJoin;
|
||||
[self getValue:&lineJoin];
|
||||
return lineJoin;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLLineTranslateAnchor:(MGLLineTranslateAnchor)lineTranslateAnchor {
|
||||
return [NSValue value:&lineTranslateAnchor withObjCType:@encode(MGLLineTranslateAnchor)];
|
||||
}
|
||||
|
||||
- (MGLLineTranslateAnchor)MGLLineTranslateAnchorValue {
|
||||
MGLLineTranslateAnchor lineTranslateAnchor;
|
||||
[self getValue:&lineTranslateAnchor];
|
||||
return lineTranslateAnchor;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSValue (MGLSymbolStyleLayerAdditions)
|
||||
|
||||
+ (NSValue *)valueWithMGLIconRotationAlignment:(MGLIconRotationAlignment)iconRotationAlignment {
|
||||
return [NSValue value:&iconRotationAlignment withObjCType:@encode(MGLIconRotationAlignment)];
|
||||
}
|
||||
|
||||
- (MGLIconRotationAlignment)MGLIconRotationAlignmentValue {
|
||||
MGLIconRotationAlignment iconRotationAlignment;
|
||||
[self getValue:&iconRotationAlignment];
|
||||
return iconRotationAlignment;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLIconTextFit:(MGLIconTextFit)iconTextFit {
|
||||
return [NSValue value:&iconTextFit withObjCType:@encode(MGLIconTextFit)];
|
||||
}
|
||||
|
||||
- (MGLIconTextFit)MGLIconTextFitValue {
|
||||
MGLIconTextFit iconTextFit;
|
||||
[self getValue:&iconTextFit];
|
||||
return iconTextFit;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLSymbolPlacement:(MGLSymbolPlacement)symbolPlacement {
|
||||
return [NSValue value:&symbolPlacement withObjCType:@encode(MGLSymbolPlacement)];
|
||||
}
|
||||
|
||||
- (MGLSymbolPlacement)MGLSymbolPlacementValue {
|
||||
MGLSymbolPlacement symbolPlacement;
|
||||
[self getValue:&symbolPlacement];
|
||||
return symbolPlacement;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLTextAnchor:(MGLTextAnchor)textAnchor {
|
||||
return [NSValue value:&textAnchor withObjCType:@encode(MGLTextAnchor)];
|
||||
}
|
||||
|
||||
- (MGLTextAnchor)MGLTextAnchorValue {
|
||||
MGLTextAnchor textAnchor;
|
||||
[self getValue:&textAnchor];
|
||||
return textAnchor;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLTextJustification:(MGLTextJustification)textJustification {
|
||||
return [NSValue value:&textJustification withObjCType:@encode(MGLTextJustification)];
|
||||
}
|
||||
|
||||
- (MGLTextJustification)MGLTextJustificationValue {
|
||||
MGLTextJustification textJustification;
|
||||
[self getValue:&textJustification];
|
||||
return textJustification;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLTextPitchAlignment:(MGLTextPitchAlignment)textPitchAlignment {
|
||||
return [NSValue value:&textPitchAlignment withObjCType:@encode(MGLTextPitchAlignment)];
|
||||
}
|
||||
|
||||
- (MGLTextPitchAlignment)MGLTextPitchAlignmentValue {
|
||||
MGLTextPitchAlignment textPitchAlignment;
|
||||
[self getValue:&textPitchAlignment];
|
||||
return textPitchAlignment;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLTextRotationAlignment:(MGLTextRotationAlignment)textRotationAlignment {
|
||||
return [NSValue value:&textRotationAlignment withObjCType:@encode(MGLTextRotationAlignment)];
|
||||
}
|
||||
|
||||
- (MGLTextRotationAlignment)MGLTextRotationAlignmentValue {
|
||||
MGLTextRotationAlignment textRotationAlignment;
|
||||
[self getValue:&textRotationAlignment];
|
||||
return textRotationAlignment;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLTextTransform:(MGLTextTransform)textTransform {
|
||||
return [NSValue value:&textTransform withObjCType:@encode(MGLTextTransform)];
|
||||
}
|
||||
|
||||
- (MGLTextTransform)MGLTextTransformValue {
|
||||
MGLTextTransform textTransform;
|
||||
[self getValue:&textTransform];
|
||||
return textTransform;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLIconTranslateAnchor:(MGLIconTranslateAnchor)iconTranslateAnchor {
|
||||
return [NSValue value:&iconTranslateAnchor withObjCType:@encode(MGLIconTranslateAnchor)];
|
||||
}
|
||||
|
||||
- (MGLIconTranslateAnchor)MGLIconTranslateAnchorValue {
|
||||
MGLIconTranslateAnchor iconTranslateAnchor;
|
||||
[self getValue:&iconTranslateAnchor];
|
||||
return iconTranslateAnchor;
|
||||
}
|
||||
|
||||
+ (NSValue *)valueWithMGLTextTranslateAnchor:(MGLTextTranslateAnchor)textTranslateAnchor {
|
||||
return [NSValue value:&textTranslateAnchor withObjCType:@encode(MGLTextTranslateAnchor)];
|
||||
}
|
||||
|
||||
- (MGLTextTranslateAnchor)MGLTextTranslateAnchorValue {
|
||||
MGLTextTranslateAnchor textTranslateAnchor;
|
||||
[self getValue:&textTranslateAnchor];
|
||||
return textTranslateAnchor;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
// This file is generated.
|
||||
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
|
||||
<%
|
||||
const enumPropertiesByLayerType = locals.enumPropertiesByLayerType;
|
||||
-%>
|
||||
|
||||
#import "NSValue+MGLStyleLayerAdditions.h"
|
||||
|
||||
<% for (let layerType in enumPropertiesByLayerType) { -%>
|
||||
<% if (enumPropertiesByLayerType.hasOwnProperty(layerType)) { -%>
|
||||
@implementation NSValue (MGL<%- camelize(layerType) %>StyleLayerAdditions)
|
||||
|
||||
<% for (let property of enumPropertiesByLayerType[layerType]) { -%>
|
||||
+ (NSValue *)valueWithMGL<%- camelize(property.name) %>:(MGL<%- camelize(property.name) %>)<%- objCName(property) %> {
|
||||
return [NSValue value:&<%- objCName(property) %> withObjCType:@encode(MGL<%- camelize(property.name) %>)];
|
||||
}
|
||||
|
||||
- (MGL<%- camelize(property.name) %>)MGL<%- camelize(property.name) %>Value {
|
||||
MGL<%- camelize(property.name) %> <%- objCName(property) %>;
|
||||
[self getValue:&<%- objCName(property) %>];
|
||||
return <%- objCName(property) %>;
|
||||
}
|
||||
|
||||
<% } -%>
|
||||
<% } -%>
|
||||
@end
|
||||
|
||||
<% } -%>
|
||||
@@ -133,10 +133,6 @@
|
||||
4018B1C91CDC288A00F666AF /* MGLAnnotationView_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 4018B1C31CDC277F00F666AF /* MGLAnnotationView_Private.h */; };
|
||||
4018B1CA1CDC288E00F666AF /* MGLAnnotationView.h in Headers */ = {isa = PBXBuildFile; fileRef = 4018B1C51CDC277F00F666AF /* MGLAnnotationView.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
4018B1CB1CDC288E00F666AF /* MGLAnnotationView.h in Headers */ = {isa = PBXBuildFile; fileRef = 4018B1C51CDC277F00F666AF /* MGLAnnotationView.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
4032C5BF1DE1FC780062E8BD /* NSValue+MGLStyleLayerAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4032C5B81DE1EE7D0062E8BD /* NSValue+MGLStyleLayerAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
4032C5C01DE1FC780062E8BD /* NSValue+MGLStyleLayerAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4032C5B81DE1EE7D0062E8BD /* NSValue+MGLStyleLayerAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
4032C5C11DE1FC7E0062E8BD /* NSValue+MGLStyleLayerAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4032C5BD1DE1FC690062E8BD /* NSValue+MGLStyleLayerAdditions.mm */; };
|
||||
4032C5C21DE1FC7E0062E8BD /* NSValue+MGLStyleLayerAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4032C5BD1DE1FC690062E8BD /* NSValue+MGLStyleLayerAdditions.mm */; };
|
||||
404326891D5B9B27007111BD /* MGLAnnotationContainerView_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 404326881D5B9B1A007111BD /* MGLAnnotationContainerView_Private.h */; };
|
||||
4049C29D1DB6CD6C00B3F799 /* MGLPointCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 4049C29B1DB6CD6C00B3F799 /* MGLPointCollection.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
4049C29E1DB6CD6C00B3F799 /* MGLPointCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 4049C29B1DB6CD6C00B3F799 /* MGLPointCollection.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@@ -591,10 +587,6 @@
|
||||
4018B1C41CDC277F00F666AF /* MGLAnnotationView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLAnnotationView.mm; sourceTree = "<group>"; };
|
||||
4018B1C51CDC277F00F666AF /* MGLAnnotationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAnnotationView.h; sourceTree = "<group>"; };
|
||||
402E9DE01CD2C76200FD4519 /* Mapbox.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = Mapbox.playground; sourceTree = "<group>"; };
|
||||
4032C5B71DE1EBB90062E8BD /* NSValue+MGLStyleLayerAdditions.h.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; path = "NSValue+MGLStyleLayerAdditions.h.ejs"; sourceTree = "<group>"; };
|
||||
4032C5B81DE1EE7D0062E8BD /* NSValue+MGLStyleLayerAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSValue+MGLStyleLayerAdditions.h"; sourceTree = "<group>"; };
|
||||
4032C5BC1DE1FAFC0062E8BD /* NSValue+MGLStyleLayerAdditions.mm.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; path = "NSValue+MGLStyleLayerAdditions.mm.ejs"; sourceTree = "<group>"; };
|
||||
4032C5BD1DE1FC690062E8BD /* NSValue+MGLStyleLayerAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSValue+MGLStyleLayerAdditions.mm"; sourceTree = "<group>"; };
|
||||
404326881D5B9B1A007111BD /* MGLAnnotationContainerView_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLAnnotationContainerView_Private.h; sourceTree = "<group>"; };
|
||||
4049C29B1DB6CD6C00B3F799 /* MGLPointCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLPointCollection.h; sourceTree = "<group>"; };
|
||||
4049C29C1DB6CD6C00B3F799 /* MGLPointCollection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLPointCollection.mm; sourceTree = "<group>"; };
|
||||
@@ -927,8 +919,6 @@
|
||||
35599DB81D46AD7F0048254D /* Categories */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4032C5B81DE1EE7D0062E8BD /* NSValue+MGLStyleLayerAdditions.h */,
|
||||
4032C5BD1DE1FC690062E8BD /* NSValue+MGLStyleLayerAdditions.mm */,
|
||||
350098DA1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.h */,
|
||||
350098DB1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.mm */,
|
||||
);
|
||||
@@ -1266,8 +1256,6 @@
|
||||
DA8F25BA1D51D2570010E6B5 /* MGLStyleLayer.h.ejs */,
|
||||
DA8F25BB1D51D2570010E6B5 /* MGLStyleLayer.mm.ejs */,
|
||||
DA8F25B91D51D2570010E6B5 /* MGLStyleLayerTests.m.ejs */,
|
||||
4032C5B71DE1EBB90062E8BD /* NSValue+MGLStyleLayerAdditions.h.ejs */,
|
||||
4032C5BC1DE1FAFC0062E8BD /* NSValue+MGLStyleLayerAdditions.mm.ejs */,
|
||||
);
|
||||
name = "Foundation Templates";
|
||||
path = ../../darwin/src;
|
||||
@@ -1527,7 +1515,6 @@
|
||||
DA88488B1CBB037E00AB86E3 /* SMCalloutView.h in Headers */,
|
||||
DA8847FE1CBAFA5100AB86E3 /* MGLTypes.h in Headers */,
|
||||
DA8847F11CBAFA5100AB86E3 /* MGLGeometry.h in Headers */,
|
||||
4032C5BF1DE1FC780062E8BD /* NSValue+MGLStyleLayerAdditions.h in Headers */,
|
||||
DA8848221CBAFA6200AB86E3 /* MGLOfflineRegion_Private.h in Headers */,
|
||||
35136D4C1D4277FC00C20EFD /* MGLSource.h in Headers */,
|
||||
3566C76C1D4A8DFA008152BC /* MGLRasterSource.h in Headers */,
|
||||
@@ -1570,7 +1557,6 @@
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
4032C5C01DE1FC780062E8BD /* NSValue+MGLStyleLayerAdditions.h in Headers */,
|
||||
35B82BF91D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h in Headers */,
|
||||
DA35A2CA1CCAAAD200E826B2 /* NSValue+MGLAdditions.h in Headers */,
|
||||
350098BC1D480108004B2AF0 /* MGLVectorSource.h in Headers */,
|
||||
@@ -2047,7 +2033,6 @@
|
||||
DA8848301CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.m in Sources */,
|
||||
353AFA161D65AB17005A69F4 /* NSDate+MGLAdditions.mm in Sources */,
|
||||
35D13AC51D3D19DD00AFB4E0 /* MGLFillStyleLayer.mm in Sources */,
|
||||
4032C5C11DE1FC7E0062E8BD /* NSValue+MGLStyleLayerAdditions.mm in Sources */,
|
||||
DA8848241CBAFA6200AB86E3 /* MGLOfflineStorage.mm in Sources */,
|
||||
DA88482A1CBAFA6200AB86E3 /* MGLTilePyramidOfflineRegion.mm in Sources */,
|
||||
4049C29F1DB6CD6C00B3F799 /* MGLPointCollection.mm in Sources */,
|
||||
@@ -2123,7 +2108,6 @@
|
||||
DAA4E4231CBB730400178DFB /* MGLPolygon.mm in Sources */,
|
||||
353AFA171D65AB17005A69F4 /* NSDate+MGLAdditions.mm in Sources */,
|
||||
35D13AC61D3D19DD00AFB4E0 /* MGLFillStyleLayer.mm in Sources */,
|
||||
4032C5C21DE1FC7E0062E8BD /* NSValue+MGLStyleLayerAdditions.mm in Sources */,
|
||||
DAA4E42A1CBB730400178DFB /* NSProcessInfo+MGLAdditions.m in Sources */,
|
||||
DAA4E4211CBB730400178DFB /* MGLOfflineStorage.mm in Sources */,
|
||||
4049C2A01DB6CD6C00B3F799 /* MGLPointCollection.mm in Sources */,
|
||||
|
||||
@@ -52,6 +52,5 @@ FOUNDATION_EXPORT const unsigned char MapboxVersionString[];
|
||||
#import "MGLUserLocation.h"
|
||||
#import "MGLUserLocationAnnotationView.h"
|
||||
#import "NSValue+MGLAdditions.h"
|
||||
#import "NSValue+MGLStyleLayerAdditions.h"
|
||||
#import "MGLStyleValue.h"
|
||||
#import "MGLAttributionInfo.h"
|
||||
|
||||
@@ -44,8 +44,6 @@
|
||||
35C5D84A1D6DD66D00E95907 /* NSCompoundPredicate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35C5D8461D6DD66D00E95907 /* NSCompoundPredicate+MGLAdditions.mm */; };
|
||||
35D65C5A1D65AD5500722C23 /* NSDate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35D65C581D65AD5500722C23 /* NSDate+MGLAdditions.h */; };
|
||||
35D65C5B1D65AD5500722C23 /* NSDate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35D65C591D65AD5500722C23 /* NSDate+MGLAdditions.mm */; };
|
||||
4032C5C51DE1FE930062E8BD /* NSValue+MGLStyleLayerAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4032C5B91DE1EEBA0062E8BD /* NSValue+MGLStyleLayerAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
4032C5C61DE1FE9B0062E8BD /* NSValue+MGLStyleLayerAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4032C5C31DE1FE810062E8BD /* NSValue+MGLStyleLayerAdditions.mm */; };
|
||||
4049C2A51DB6CE7F00B3F799 /* MGLPointCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 4049C2A11DB6CE7800B3F799 /* MGLPointCollection.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
4049C2AD1DB8020600B3F799 /* MGLPointCollection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4049C2A71DB6D09B00B3F799 /* MGLPointCollection.mm */; };
|
||||
408AA85B1DAEECFE00022900 /* MGLShape_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 408AA85A1DAEECF100022900 /* MGLShape_Private.h */; };
|
||||
@@ -293,10 +291,6 @@
|
||||
35C5D84B1D6DD75B00E95907 /* MGLPredicateTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLPredicateTests.mm; path = ../../darwin/test/MGLPredicateTests.mm; sourceTree = "<group>"; };
|
||||
35D65C581D65AD5500722C23 /* NSDate+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+MGLAdditions.h"; sourceTree = "<group>"; };
|
||||
35D65C591D65AD5500722C23 /* NSDate+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSDate+MGLAdditions.mm"; sourceTree = "<group>"; };
|
||||
4032C5B91DE1EEBA0062E8BD /* NSValue+MGLStyleLayerAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSValue+MGLStyleLayerAdditions.h"; sourceTree = "<group>"; };
|
||||
4032C5BA1DE1EECB0062E8BD /* NSValue+MGLStyleLayerAdditions.h.ejs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "NSValue+MGLStyleLayerAdditions.h.ejs"; sourceTree = "<group>"; };
|
||||
4032C5C31DE1FE810062E8BD /* NSValue+MGLStyleLayerAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSValue+MGLStyleLayerAdditions.mm"; sourceTree = "<group>"; };
|
||||
4032C5C71DE1FEAB0062E8BD /* NSValue+MGLStyleLayerAdditions.mm.ejs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "NSValue+MGLStyleLayerAdditions.mm.ejs"; sourceTree = "<group>"; };
|
||||
4049C2A11DB6CE7800B3F799 /* MGLPointCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLPointCollection.h; sourceTree = "<group>"; };
|
||||
4049C2A71DB6D09B00B3F799 /* MGLPointCollection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLPointCollection.mm; sourceTree = "<group>"; };
|
||||
405C03961DB0004E001AC280 /* NSImage+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSImage+MGLAdditions.h"; sourceTree = "<group>"; };
|
||||
@@ -560,8 +554,6 @@
|
||||
352742791D4C235C00A1ECE6 /* Categories */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4032C5B91DE1EEBA0062E8BD /* NSValue+MGLStyleLayerAdditions.h */,
|
||||
4032C5C31DE1FE810062E8BD /* NSValue+MGLStyleLayerAdditions.mm */,
|
||||
DA8F25A61D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.h */,
|
||||
DA8F25A71D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.mm */,
|
||||
);
|
||||
@@ -737,8 +729,6 @@
|
||||
DA8F25B61D51D2240010E6B5 /* MGLStyleLayer.h.ejs */,
|
||||
DA8F25B71D51D2240010E6B5 /* MGLStyleLayer.mm.ejs */,
|
||||
DA8F25B51D51D2240010E6B5 /* MGLStyleLayerTests.m.ejs */,
|
||||
4032C5BA1DE1EECB0062E8BD /* NSValue+MGLStyleLayerAdditions.h.ejs */,
|
||||
4032C5C71DE1FEAB0062E8BD /* NSValue+MGLStyleLayerAdditions.mm.ejs */,
|
||||
);
|
||||
name = "Foundation Templates";
|
||||
path = ../../darwin/src;
|
||||
@@ -1000,7 +990,6 @@
|
||||
352742781D4C220900A1ECE6 /* MGLStyleValue.h in Headers */,
|
||||
DAE6C35E1CC31E0400DB3429 /* MGLMultiPoint.h in Headers */,
|
||||
35602BFF1D3EA9B40050646F /* MGLStyleLayer_Private.h in Headers */,
|
||||
4032C5C51DE1FE930062E8BD /* NSValue+MGLStyleLayerAdditions.h in Headers */,
|
||||
DAF0D8161DFE6B1800B28378 /* MGLAttributionInfo_Private.h in Headers */,
|
||||
DAE6C3971CC31E2A00DB3429 /* NSBundle+MGLAdditions.h in Headers */,
|
||||
DAED385F1D62CED700D7640F /* NSURL+MGLAdditions.h in Headers */,
|
||||
@@ -1274,7 +1263,6 @@
|
||||
DAE6C3931CC31E2A00DB3429 /* MGLShape.mm in Sources */,
|
||||
352742861D4C244700A1ECE6 /* MGLRasterSource.mm in Sources */,
|
||||
DAE6C39D1CC31E2A00DB3429 /* NSString+MGLAdditions.m in Sources */,
|
||||
4032C5C61DE1FE9B0062E8BD /* NSValue+MGLStyleLayerAdditions.mm in Sources */,
|
||||
3598195A1E02F611008FC139 /* NSCoder+MGLAdditions.mm in Sources */,
|
||||
DAE6C3941CC31E2A00DB3429 /* MGLStyle.mm in Sources */,
|
||||
DAE6C3871CC31E2A00DB3429 /* MGLGeometry.mm in Sources */,
|
||||
|
||||
@@ -48,6 +48,5 @@ FOUNDATION_EXPORT const unsigned char MapboxVersionString[];
|
||||
#import "MGLTilePyramidOfflineRegion.h"
|
||||
#import "MGLTypes.h"
|
||||
#import "NSValue+MGLAdditions.h"
|
||||
#import "NSValue+MGLStyleLayerAdditions.h"
|
||||
#import "MGLStyleValue.h"
|
||||
#import "MGLAttributionInfo.h"
|
||||
|
||||
Reference in New Issue
Block a user