Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[ios, macos] Change runtime styling category method prefix to mgl_
Browse files Browse the repository at this point in the history
This makes runtime styling category method naming consistent with the rest of the SDK.
  • Loading branch information
friedbunny authored and 1ec5 committed Oct 17, 2016
1 parent 4522360 commit 49ca625
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions platform/darwin/src/MGLStyleValue_Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class MGLStyleValueTransformer {
}

MGLColor *toMGLRawStyleValue(const mbgl::Color mbglStopValue) {
return [MGLColor mbgl_colorWithColor:mbglStopValue];
return [MGLColor mgl_colorWithColor:mbglStopValue];
}

ObjCType toMGLRawStyleValue(const std::vector<MBGLElement> &mbglStopValue) {
Expand Down Expand Up @@ -142,7 +142,7 @@ class MGLStyleValueTransformer {
}

void getMBGLValue(MGLColor *rawValue, mbgl::Color &mbglValue) {
mbglValue = rawValue.mbgl_color;
mbglValue = rawValue.mgl_color;
}

void getMBGLValue(ObjCType rawValue, std::vector<MBGLElement> &mbglValue) {
Expand Down
4 changes: 2 additions & 2 deletions platform/ios/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3080,15 +3080,15 @@ - (double)alphaForShapeAnnotation:(MGLShape *)annotation
UIColor *color = (_delegateHasStrokeColorsForShapeAnnotations
? [self.delegate mapView:self strokeColorForShapeAnnotation:annotation]
: self.tintColor);
return color.mbgl_color;
return color.mgl_color;
}

- (mbgl::Color)fillColorForPolygonAnnotation:(MGLPolygon *)annotation
{
UIColor *color = (_delegateHasFillColorsForShapeAnnotations
? [self.delegate mapView:self fillColorForPolygonAnnotation:annotation]
: self.tintColor);
return color.mbgl_color;
return color.mgl_color;
}

- (CGFloat)lineWidthForPolylineAnnotation:(MGLPolyline *)annotation
Expand Down
6 changes: 3 additions & 3 deletions platform/ios/src/UIColor+MGLAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

@interface UIColor (MGLAdditions)

- (mbgl::Color)mbgl_color;
- (mbgl::Color)mgl_color;

- (mbgl::style::PropertyValue<mbgl::Color>)mbgl_colorPropertyValue;
- (mbgl::style::PropertyValue<mbgl::Color>)mgl_colorPropertyValue;

+ (UIColor *)mbgl_colorWithColor:(mbgl::Color)color;
+ (UIColor *)mgl_colorWithColor:(mbgl::Color)color;

@end
8 changes: 4 additions & 4 deletions platform/ios/src/UIColor+MGLAdditions.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

@implementation UIColor (MGLAdditions)

- (mbgl::Color)mbgl_color
- (mbgl::Color)mgl_color
{
CGFloat r, g, b, a;
[self getRed:&r green:&g blue:&b alpha:&a];
return { (float)r, (float)g, (float)b, (float)a };
}

- (mbgl::style::PropertyValue<mbgl::Color>)mbgl_colorPropertyValue
- (mbgl::style::PropertyValue<mbgl::Color>)mgl_colorPropertyValue
{
mbgl::Color color = self.mbgl_color;
mbgl::Color color = self.mgl_color;
return {{ color.r, color.g, color.b, color.a }};
}

+ (UIColor *)mbgl_colorWithColor:(mbgl::Color)color
+ (UIColor *)mgl_colorWithColor:(mbgl::Color)color
{
return [UIColor colorWithRed:color.r green:color.g blue:color.b alpha:color.a];
}
Expand Down
4 changes: 2 additions & 2 deletions platform/macos/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2183,14 +2183,14 @@ - (double)alphaForShapeAnnotation:(MGLShape *)annotation {
NSColor *color = (_delegateHasStrokeColorsForShapeAnnotations
? [self.delegate mapView:self strokeColorForShapeAnnotation:annotation]
: [NSColor selectedMenuItemColor]);
return color.mbgl_color;
return color.mgl_color;
}

- (mbgl::Color)fillColorForPolygonAnnotation:(MGLPolygon *)annotation {
NSColor *color = (_delegateHasFillColorsForShapeAnnotations
? [self.delegate mapView:self fillColorForPolygonAnnotation:annotation]
: [NSColor selectedMenuItemColor]);
return color.mbgl_color;
return color.mgl_color;
}

- (CGFloat)lineWidthForPolylineAnnotation:(MGLPolyline *)annotation {
Expand Down
6 changes: 3 additions & 3 deletions platform/macos/src/NSColor+MGLAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
/**
Converts the color into an mbgl::Color in calibrated RGB space.
*/
- (mbgl::Color)mbgl_color;
- (mbgl::Color)mgl_color;

/**
Instantiates `NSColor` from an `mbgl::Color`
*/
+ (NSColor *)mbgl_colorWithColor:(mbgl::Color)color;
+ (NSColor *)mgl_colorWithColor:(mbgl::Color)color;

- (mbgl::style::PropertyValue<mbgl::Color>)mbgl_colorPropertyValue;
- (mbgl::style::PropertyValue<mbgl::Color>)mgl_colorPropertyValue;

@end
8 changes: 4 additions & 4 deletions platform/macos/src/NSColor+MGLAdditions.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

@implementation NSColor (MGLAdditions)

- (mbgl::Color)mbgl_color
- (mbgl::Color)mgl_color
{
CGFloat r, g, b, a;

Expand All @@ -11,14 +11,14 @@ @implementation NSColor (MGLAdditions)
return { (float)r, (float)g, (float)b, (float)a };
}

+ (NSColor *)mbgl_colorWithColor:(mbgl::Color)color
+ (NSColor *)mgl_colorWithColor:(mbgl::Color)color
{
return [NSColor colorWithRed:color.r green:color.g blue:color.b alpha:color.a];
}

- (mbgl::style::PropertyValue<mbgl::Color>)mbgl_colorPropertyValue
- (mbgl::style::PropertyValue<mbgl::Color>)mgl_colorPropertyValue
{
mbgl::Color color = self.mbgl_color;
mbgl::Color color = self.mgl_color;
return {{ color.r, color.g, color.b, color.a }};
}

Expand Down

0 comments on commit 49ca625

Please sign in to comment.