blob: fab278aac85501c27eb759cbf4d3073dfd031e47 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
<%
const type = locals.type;
const layoutProperties = locals.layoutProperties;
const paintProperties = locals.paintProperties;
-%>
#import "NSValue+MGLStyleEnumAttributeAdditions.h"
@implementation NSValue (MGLStyleEnumAttributeAdditions)
<% if (layoutProperties.length) { -%>
<% for (const property of layoutProperties) { -%>
<% if (property.type == "enum") { -%>
+ (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) %> value;
[self getValue:&value];
return value;
}
<% } -%>
<% } -%>
<% } -%>
<% if (paintProperties.length) { -%>
<% for (const property of paintProperties) { -%>
<% if (property.type == "enum") { -%>
+ (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) %> value;
[self getValue:&value];
return value;
}
<% } -%>
<% } -%>
<% } -%>
@end
|