106 lines
3.5 KiB
Plaintext
106 lines
3.5 KiB
Plaintext
<%
|
||
const properties = locals.properties;
|
||
const type = locals.type;
|
||
const doc = locals.doc;
|
||
-%>
|
||
// This file is generated.
|
||
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
|
||
|
||
#import <CoreLocation/CoreLocation.h>
|
||
|
||
#import "MLNFoundation.h"
|
||
#import "MLNStyleValue.h"
|
||
|
||
NS_ASSUME_NONNULL_BEGIN
|
||
|
||
<% for (const property of properties) { -%>
|
||
<% if (property.type == "enum") { -%>
|
||
/**
|
||
<%- propertyDoc(property.name, property, type, 'enum').wrap(80, 1) %>
|
||
*/
|
||
typedef NS_ENUM(NSUInteger, MLNLight<%- camelize(property.name) %>) {
|
||
<% for (const value in property.values) { -%>
|
||
/**
|
||
<%- propertyDoc(property.name, property.values[value], type, 'enum').wrap(80, 4+1) %>
|
||
*/
|
||
MLNLightAnchor<%- camelize(value) %>,
|
||
<% } -%>
|
||
};
|
||
<% } -%>
|
||
<% } -%>
|
||
|
||
/**
|
||
A structure containing information about the position of the light source
|
||
relative to lit geometries.
|
||
*/
|
||
typedef struct __attribute__((objc_boxable)) MLNSphericalPosition {
|
||
/** Distance from the center of the base of an object to its light. */
|
||
CGFloat radial;
|
||
/** Position of the light relative to 0° (0° when ``MLNLight/anchor`` is set to viewport corresponds
|
||
to the top of the viewport, or 0° when ``MLNLight/anchor`` is set to map corresponds to due north,
|
||
and degrees proceed clockwise). */
|
||
CLLocationDirection azimuthal;
|
||
/** Indicates the height of the light (from 0°, directly above, to 180°, directly below). */
|
||
CLLocationDirection polar;
|
||
} MLNSphericalPosition;
|
||
|
||
/**
|
||
Creates a new ``MLNSphericalPosition`` from the given radial, azimuthal, polar.
|
||
|
||
@param radial The radial coordinate.
|
||
@param azimuthal The azimuthal angle.
|
||
@param polar The polar angle.
|
||
|
||
@return Returns a ``MLNSphericalPosition`` struct containing the position attributes.
|
||
*/
|
||
NS_INLINE MLNSphericalPosition MLNSphericalPositionMake(CGFloat radial, CLLocationDirection azimuthal, CLLocationDirection polar) {
|
||
MLNSphericalPosition position;
|
||
position.radial = radial;
|
||
position.azimuthal = azimuthal;
|
||
position.polar = polar;
|
||
|
||
return position;
|
||
}
|
||
|
||
/**
|
||
<%- doc.wrap(80, 1) %>
|
||
*/
|
||
MLN_EXPORT
|
||
@interface MLNLight : NSObject
|
||
<% if (properties.length) { -%>
|
||
|
||
<% for (const property of properties) { -%>
|
||
/**
|
||
<%- propertyDoc(property.name, property, type, 'light').wrap(80, 1) %>
|
||
|
||
This property corresponds to the <a
|
||
href="https://maplibre.org/maplibre-style-spec/light/#<%- originalPropertyName(property) %>"><code><%- originalPropertyName(property) %></code></a>
|
||
light property in the MapLibre Style Spec.
|
||
<% if (property.examples) { -%>
|
||
|
||
#### Related examples
|
||
<%- propertyExample(property).wrap(80, 1) %>
|
||
<% } -%>
|
||
*/
|
||
@property (nonatomic<% if (property.getter) { %>, getter=<%- objCGetter(property) -%><% } %>) NSExpression *<%- camelizeWithLeadingLowercase(property.name) %>;
|
||
|
||
<% if (property.transition) { -%>
|
||
/**
|
||
The transition affecting any changes to this layer’s `<%- camelizeWithLeadingLowercase(property.name) %>` property.
|
||
|
||
This property corresponds to the `<%- originalPropertyName(property) %>-transition` property in the style JSON file format.
|
||
*/
|
||
@property (nonatomic) MLNTransition <%- camelizeWithLeadingLowercase(property.name) %>Transition;
|
||
|
||
<% } -%>
|
||
<% if (property.original) { -%>
|
||
@property (nonatomic<% if (!property.required) { %>, null_resettable<% } %>) NSExpression *<%- camelizeWithLeadingLowercase(originalPropertyName(property)) %> __attribute__((unavailable("Use <%- camelizeWithLeadingLowercase(property.name) %> instead.")));
|
||
|
||
<% } -%>
|
||
<% } -%>
|
||
<% } -%>
|
||
|
||
@end
|
||
|
||
NS_ASSUME_NONNULL_END
|