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/MGLSymbolStyleLayer.mm | |
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/MGLSymbolStyleLayer.mm')
-rw-r--r-- | platform/darwin/src/MGLSymbolStyleLayer.mm | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLSymbolStyleLayer.mm b/platform/darwin/src/MGLSymbolStyleLayer.mm index 464a3d9505..3cfaee986b 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.mm +++ b/platform/darwin/src/MGLSymbolStyleLayer.mm @@ -987,3 +987,107 @@ 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 |