From 62ea1f21858c69f6921c775ba7a3de201f0514d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Thu, 26 Jan 2017 18:52:44 +0100 Subject: [core] remove trailing whitespace, add trailing newlines, add space after // --- platform/macos/app/AppDelegate.m | 28 ++++---- platform/macos/app/DroppedPinAnnotation.m | 2 +- platform/macos/app/LimeGreenStyleLayer.m | 8 +-- platform/macos/app/MGLVectorSource+MBXAdditions.m | 2 +- platform/macos/app/MapDocument.m | 80 +++++++++++----------- .../macos/app/OfflinePackNameValueTransformer.m | 4 +- platform/macos/app/StyleLayerIconTransformer.m | 2 +- platform/macos/app/TimeIntervalTransformer.m | 6 +- 8 files changed, 66 insertions(+), 66 deletions(-) (limited to 'platform/macos/app') diff --git a/platform/macos/app/AppDelegate.m b/platform/macos/app/AppDelegate.m index 44f87092c9..5b848cc79b 100644 --- a/platform/macos/app/AppDelegate.m +++ b/platform/macos/app/AppDelegate.m @@ -20,10 +20,10 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; switch (self.state) { case MGLOfflinePackStateComplete: return [NSImage imageNamed:@"NSMenuOnStateTemplate"]; - + case MGLOfflinePackStateActive: return [NSImage imageNamed:@"NSFollowLinkFreestandingTemplate"]; - + default: return nil; } @@ -104,7 +104,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; andSelector:@selector(handleGetURLEvent:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL]; - + if (![[NSUserDefaults standardUserDefaults] boolForKey:@"NSQuitAlwaysKeepsWindows"]) { NSData *cameraData = [[NSUserDefaults standardUserDefaults] objectForKey:MGLLastMapCameraDefaultsKey]; if (cameraData) { @@ -130,7 +130,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; [alert runModal]; [self showPreferences:nil]; } - + [self.offlinePacksArrayController bind:@"content" toObject:[MGLOfflineStorage sharedOfflineStorage] withKeyPath:@"packs" options:nil]; } @@ -148,7 +148,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; [[NSUserDefaults standardUserDefaults] setInteger:mapView.debugMask forKey:MGLLastMapDebugMaskDefaultsKey]; } } - + [self.offlinePacksArrayController unbind:@"content"]; } @@ -164,16 +164,16 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; params[parts[0]] = [parts[1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; } } - + MGLMapCamera *camera = [MGLMapCamera camera]; NSString *zoomLevelString = params[@"zoom"]; self.pendingZoomLevel = zoomLevelString.length ? zoomLevelString.doubleValue : -1; - + NSString *directionString = params[@"bearing"]; if (directionString.length) { camera.heading = directionString.doubleValue; } - + NSString *centerString = params[@"center"]; if (centerString) { NSArray *coordinateValues = [centerString componentsSeparatedByString:@","]; @@ -182,12 +182,12 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; [coordinateValues[1] doubleValue]); } } - + NSString *pitchString = params[@"pitch"]; if (pitchString.length) { camera.pitch = pitchString.doubleValue; } - + self.pendingCamera = camera; [[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error:NULL]; } @@ -196,7 +196,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; - (IBAction)showOfflinePacksPanel:(id)sender { [self.offlinePacksPanel makeKeyAndOrderFront:sender]; - + for (MGLOfflinePack *pack in self.offlinePacksArrayController.arrangedObjects) { [pack requestProgress]; } @@ -226,15 +226,15 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; } break; } - + case MGLOfflinePackStateInactive: [pack resume]; break; - + case MGLOfflinePackStateActive: [pack suspend]; break; - + default: break; } diff --git a/platform/macos/app/DroppedPinAnnotation.m b/platform/macos/app/DroppedPinAnnotation.m index 5b19fd7401..d7bd4068dc 100644 --- a/platform/macos/app/DroppedPinAnnotation.m +++ b/platform/macos/app/DroppedPinAnnotation.m @@ -11,7 +11,7 @@ static MGLCoordinateFormatter *DroppedPinCoordinateFormatter; NSTimer *_timer; NSTimeInterval _priorShownTimeInterval; NSDate *_dateShown; - + NSValueTransformer *_timeIntervalTransformer; } diff --git a/platform/macos/app/LimeGreenStyleLayer.m b/platform/macos/app/LimeGreenStyleLayer.m index 0d2e642db9..40c336cd98 100644 --- a/platform/macos/app/LimeGreenStyleLayer.m +++ b/platform/macos/app/LimeGreenStyleLayer.m @@ -14,11 +14,11 @@ - (void)didMoveToMapView:(MGLMapView *)mapView { static const GLchar *vertexShaderSource = "attribute vec2 a_pos; void main() { gl_Position = vec4(a_pos, 0, 1); }"; static const GLchar *fragmentShaderSource = "void main() { gl_FragColor = vec4(0, 1, 0, 1); }"; - + _program = glCreateProgram(); _vertexShader = glCreateShader(GL_VERTEX_SHADER); _fragmentShader = glCreateShader(GL_FRAGMENT_SHADER); - + glShaderSource(_vertexShader, 1, &vertexShaderSource, NULL); glCompileShader(_vertexShader); glAttachShader(_program, _vertexShader); @@ -27,7 +27,7 @@ glAttachShader(_program, _fragmentShader); glLinkProgram(_program); _aPos = glGetAttribLocation(_program, "a_pos"); - + GLfloat background[] = { -1,-1, 1,-1, -1,1, 1,1 }; glGenBuffers(1, &_buffer); glBindBuffer(GL_ARRAY_BUFFER, _buffer); @@ -48,7 +48,7 @@ if (!_program) { return; } - + glDeleteBuffers(1, &_buffer); glDetachShader(_program, _vertexShader); glDetachShader(_program, _fragmentShader); diff --git a/platform/macos/app/MGLVectorSource+MBXAdditions.m b/platform/macos/app/MGLVectorSource+MBXAdditions.m index f59b72aa9f..644b43a651 100644 --- a/platform/macos/app/MGLVectorSource+MBXAdditions.m +++ b/platform/macos/app/MGLVectorSource+MBXAdditions.m @@ -35,7 +35,7 @@ if (!self.mapboxStreets) { return @{}; } - + // Replace {name} and {name_*} with the matching localized name tag. NSString *localizedKey = preferredLanguage ? [NSString stringWithFormat:@"name_%@", preferredLanguage] : @"name"; NSMutableDictionary *localizedKeysByKey = [NSMutableDictionary dictionaryWithObject:localizedKey forKey:@"name"]; diff --git a/platform/macos/app/MapDocument.m b/platform/macos/app/MapDocument.m index 40fd9e4600..225bb4d3af 100644 --- a/platform/macos/app/MapDocument.m +++ b/platform/macos/app/MapDocument.m @@ -40,7 +40,7 @@ NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id *)layer.text rawValue]; layer.text = [MGLStyleValue valueWithRawValue:stringByLocalizingString(textField)]; @@ -391,7 +391,7 @@ NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id region = [[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:self.mapView.styleURL bounds:self.mapView.visibleCoordinateBounds fromZoomLevel:self.mapView.zoomLevel toZoomLevel:self.mapView.maximumZoomLevel]; NSData *context = [[NSValueTransformer valueTransformerForName:@"OfflinePackNameValueTransformer"] reverseTransformedValue:nameTextField.stringValue]; [[MGLOfflineStorage sharedOfflineStorage] addPackForRegion:region withContext:context completionHandler:^(MGLOfflinePack * _Nullable pack, NSError * _Nullable error) { @@ -687,27 +687,27 @@ NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id valueWithStops:@{ @0.0: [MGLStyleValue valueWithRawValue:[NSColor redColor]], @10.0: [MGLStyleValue valueWithRawValue:[NSColor yellowColor]], @20.0: [MGLStyleValue valueWithRawValue:[NSColor blackColor]], }]; fillStyleLayer.fillColor = colorFunction; - + NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"]; NSURL *geoJSONURL = [NSURL fileURLWithPath:filePath]; MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"ams" URL:geoJSONURL options:nil]; [self.mapView.style addSource:source]; - + MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"test" source:source]; fillLayer.fillColor = [MGLStyleValue valueWithRawValue:[NSColor greenColor]]; fillLayer.predicate = [NSPredicate predicateWithFormat:@"%K == %@", @"type", @"park"]; [self.mapView.style addLayer:fillLayer]; - + NSImage *image = [NSImage imageNamed:NSImageNameIChatTheaterTemplate]; [self.mapView.style setImage:image forName:NSImageNameIChatTheaterTemplate]; - + MGLSource *streetsSource = [self.mapView.style sourceWithIdentifier:@"composite"]; MGLSymbolStyleLayer *theaterLayer = [[MGLSymbolStyleLayer alloc] initWithIdentifier:@"theaters" source:streetsSource]; theaterLayer.sourceLayerIdentifier = @"poi_label"; @@ -740,7 +740,7 @@ NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id