summaryrefslogtreecommitdiff
path: root/platform/osx/src
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-03-05 18:00:11 -0800
committerMinh Nguyễn <mxn@1ec5.org>2016-03-10 17:08:58 -0800
commite36218a8668316e8c1b0bcc06d43dad31461615c (patch)
tree04d5e58ae0c4dea4b0a50e034a8a630564cb7a53 /platform/osx/src
parent081ee9fbefbdb37f116a5bf2c0383586bce6608a (diff)
downloadqtlocation-mapboxgl-e36218a8668316e8c1b0bcc06d43dad31461615c.tar.gz
[osx] Added OS X support for offline downloads
Diffstat (limited to 'platform/osx/src')
-rw-r--r--platform/osx/src/MGLAccountManager.m54
-rw-r--r--platform/osx/src/MGLAccountManager_Private.h15
-rw-r--r--platform/osx/src/MGLAnnotationImage.m2
-rw-r--r--platform/osx/src/MGLMapView+IBAdditions.m2
-rw-r--r--platform/osx/src/MGLMapView.mm16
-rw-r--r--platform/osx/src/MGLMapView_Private.h2
-rw-r--r--platform/osx/src/NSBundle+MGLAdditions.h16
-rw-r--r--platform/osx/src/NSBundle+MGLAdditions.m13
-rw-r--r--platform/osx/src/NSProcessInfo+MGLAdditions.h11
-rw-r--r--platform/osx/src/NSProcessInfo+MGLAdditions.m11
10 files changed, 11 insertions, 131 deletions
diff --git a/platform/osx/src/MGLAccountManager.m b/platform/osx/src/MGLAccountManager.m
deleted file mode 100644
index 8458248357..0000000000
--- a/platform/osx/src/MGLAccountManager.m
+++ /dev/null
@@ -1,54 +0,0 @@
-#import "MGLAccountManager_Private.h"
-
-#import <MGLMapView.h>
-
-@interface MGLAccountManager ()
-
-@property (atomic) NSString *accessToken;
-
-@end
-
-@implementation MGLAccountManager
-
-#pragma mark - Internal
-
-+ (void)load {
- // Read the initial configuration from Info.plist.
- NSString *accessToken = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MGLMapboxAccessToken"];
- if (accessToken.length) {
- self.accessToken = accessToken;
- }
-}
-
-+ (instancetype)sharedManager {
- static dispatch_once_t onceToken;
- static MGLAccountManager *_sharedManager;
- void (^setupBlock)() = ^{
- dispatch_once(&onceToken, ^{
- _sharedManager = [[self alloc] init];
- });
- };
- if (![[NSThread currentThread] isMainThread]) {
- dispatch_sync(dispatch_get_main_queue(), ^{
- setupBlock();
- });
- }
- else {
- setupBlock();
- }
- return _sharedManager;
-}
-
-+ (void)setAccessToken:(NSString *)accessToken {
- accessToken = [accessToken stringByTrimmingCharactersInSet:
- [NSCharacterSet whitespaceAndNewlineCharacterSet]];
- if (![accessToken length]) return;
-
- [MGLAccountManager sharedManager].accessToken = accessToken;
-}
-
-+ (NSString *)accessToken {
- return [MGLAccountManager sharedManager].accessToken;
-}
-
-@end
diff --git a/platform/osx/src/MGLAccountManager_Private.h b/platform/osx/src/MGLAccountManager_Private.h
deleted file mode 100644
index 5088c8dfd2..0000000000
--- a/platform/osx/src/MGLAccountManager_Private.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#import <MGLAccountManager.h>
-
-@interface MGLAccountManager (Private)
-
-/**
- Returns the shared instance of the `MGLAccountManager` class.
-
- This method can be called from any thread.
- */
-+ (instancetype)sharedManager;
-
-/// The current global access token.
-@property (atomic) NSString *accessToken;
-
-@end
diff --git a/platform/osx/src/MGLAnnotationImage.m b/platform/osx/src/MGLAnnotationImage.m
index e65a6d15cf..49346b073b 100644
--- a/platform/osx/src/MGLAnnotationImage.m
+++ b/platform/osx/src/MGLAnnotationImage.m
@@ -1,4 +1,4 @@
-#import <MGLAnnotationImage.h>
+#import "MGLAnnotationImage.h"
@interface MGLAnnotationImage ()
diff --git a/platform/osx/src/MGLMapView+IBAdditions.m b/platform/osx/src/MGLMapView+IBAdditions.m
index cafd4511f1..da18760645 100644
--- a/platform/osx/src/MGLMapView+IBAdditions.m
+++ b/platform/osx/src/MGLMapView+IBAdditions.m
@@ -1,4 +1,4 @@
-#import <MGLMapView+IBAdditions.h>
+#import "MGLMapView+IBAdditions.h"
#import "MGLMapView_Private.h"
diff --git a/platform/osx/src/MGLMapView.mm b/platform/osx/src/MGLMapView.mm
index 67729c2607..07c080663f 100644
--- a/platform/osx/src/MGLMapView.mm
+++ b/platform/osx/src/MGLMapView.mm
@@ -1,18 +1,18 @@
#import "MGLMapView_Private.h"
-#import "MGLAccountManager_Private.h"
#import "MGLAttributionButton.h"
#import "MGLCompassCell.h"
#import "MGLOpenGLLayer.h"
#import "MGLStyle.h"
+#import "../../darwin/src/MGLAccountManager_Private.h"
#import "../../darwin/src/MGLGeometry_Private.h"
#import "../../darwin/src/MGLMultiPoint_Private.h"
-#import <MGLMapCamera.h>
-#import <MGLPolygon.h>
-#import <MGLPolyline.h>
-#import <MGLAnnotationImage.h>
-#import <MGLMapViewDelegate.h>
+#import "MGLMapCamera.h"
+#import "MGLPolygon.h"
+#import "MGLPolyline.h"
+#import "MGLAnnotationImage.h"
+#import "MGLMapViewDelegate.h"
#import <mbgl/mbgl.hpp>
#import <mbgl/annotation/point_annotation.hpp>
@@ -30,8 +30,8 @@
#import <map>
#import <unordered_set>
-#import "NSBundle+MGLAdditions.h"
-#import "NSProcessInfo+MGLAdditions.h"
+#import "../../darwin/src/NSBundle+MGLAdditions.h"
+#import "../../darwin/src/NSProcessInfo+MGLAdditions.h"
#import "../../darwin/src/NSException+MGLAdditions.h"
#import "../../darwin/src/NSString+MGLAdditions.h"
diff --git a/platform/osx/src/MGLMapView_Private.h b/platform/osx/src/MGLMapView_Private.h
index a162beca61..b9a112718e 100644
--- a/platform/osx/src/MGLMapView_Private.h
+++ b/platform/osx/src/MGLMapView_Private.h
@@ -1,4 +1,4 @@
-#import <MGLMapView.h>
+#import "MGLMapView.h"
void mgl_linkMapViewIBCategory();
diff --git a/platform/osx/src/NSBundle+MGLAdditions.h b/platform/osx/src/NSBundle+MGLAdditions.h
deleted file mode 100644
index 642fcf141b..0000000000
--- a/platform/osx/src/NSBundle+MGLAdditions.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#import <Foundation/Foundation.h>
-
-#import "MGLTypes.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-void mgl_linkBundleCategory();
-
-@interface NSBundle (MGLAdditions)
-
-/// Returns the Mapbox.framework bundle.
-+ (instancetype)mgl_frameworkBundle;
-
-@end
-
-NS_ASSUME_NONNULL_END
diff --git a/platform/osx/src/NSBundle+MGLAdditions.m b/platform/osx/src/NSBundle+MGLAdditions.m
deleted file mode 100644
index 658d515ebf..0000000000
--- a/platform/osx/src/NSBundle+MGLAdditions.m
+++ /dev/null
@@ -1,13 +0,0 @@
-#import "NSBundle+MGLAdditions.h"
-
-#import "MGLAccountManager.h"
-
-void mgl_linkBundleCategory() {}
-
-@implementation NSBundle (MGLAdditions)
-
-+ (instancetype)mgl_frameworkBundle {
- return [self bundleForClass:[MGLAccountManager class]];
-}
-
-@end
diff --git a/platform/osx/src/NSProcessInfo+MGLAdditions.h b/platform/osx/src/NSProcessInfo+MGLAdditions.h
deleted file mode 100644
index cd5ec148ec..0000000000
--- a/platform/osx/src/NSProcessInfo+MGLAdditions.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#import <Foundation/Foundation.h>
-
-void mgl_linkProcessInfoCategory();
-
-@interface NSProcessInfo (MGLAdditions)
-
-/// Returns YES if the current process is Interface Builder’s helper process for
-/// rendering designables.
-- (BOOL)mgl_isInterfaceBuilderDesignablesAgent;
-
-@end
diff --git a/platform/osx/src/NSProcessInfo+MGLAdditions.m b/platform/osx/src/NSProcessInfo+MGLAdditions.m
deleted file mode 100644
index 16f869703c..0000000000
--- a/platform/osx/src/NSProcessInfo+MGLAdditions.m
+++ /dev/null
@@ -1,11 +0,0 @@
-#import "NSProcessInfo+MGLAdditions.h"
-
-void mgl_linkProcessInfoCategory() {}
-
-@implementation NSProcessInfo (MGLAdditions)
-
-- (BOOL)mgl_isInterfaceBuilderDesignablesAgent {
- return [self.processName isEqualToString:@"IBDesignablesAgent"];
-}
-
-@end