2014-10-31 11:17:05 -07:00
|
|
|
// Copyright (c) 2013 GitHub, Inc.
|
2014-04-25 17:49:37 +08:00
|
|
|
// Use of this source code is governed by the MIT license that can be
|
2013-05-02 20:09:19 +08:00
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2018-02-05 16:13:35 +09:00
|
|
|
#include "base/callback.h"
|
|
|
|
#include "base/mac/scoped_nsobject.h"
|
2018-04-17 21:44:10 -04:00
|
|
|
#include "base/mac/scoped_sending_event.h"
|
2013-05-02 20:09:19 +08:00
|
|
|
|
2018-12-04 07:54:13 -08:00
|
|
|
#import <AVFoundation/AVFoundation.h>
|
2019-02-13 18:36:28 -08:00
|
|
|
#import <LocalAuthentication/LocalAuthentication.h>
|
2018-12-04 07:54:13 -08:00
|
|
|
|
|
|
|
// Forward Declare Appearance APIs
|
2019-07-26 14:11:37 +02:00
|
|
|
@interface NSApplication (MojaveSDK)
|
2018-09-28 01:33:31 +10:00
|
|
|
@property(copy, readonly)
|
|
|
|
NSAppearance* effectiveAppearance API_AVAILABLE(macosx(10.14));
|
|
|
|
@property(copy, readonly) NSAppearance* appearance API_AVAILABLE(macosx(10.14));
|
|
|
|
- (void)setAppearance:(NSAppearance*)appearance API_AVAILABLE(macosx(10.14));
|
|
|
|
@end
|
|
|
|
|
2018-12-04 07:54:13 -08:00
|
|
|
// forward declare Access APIs
|
|
|
|
typedef NSString* AVMediaType NS_EXTENSIBLE_STRING_ENUM;
|
|
|
|
|
|
|
|
AVF_EXPORT AVMediaType const AVMediaTypeVideo;
|
|
|
|
AVF_EXPORT AVMediaType const AVMediaTypeAudio;
|
|
|
|
|
|
|
|
typedef NS_ENUM(NSInteger, AVAuthorizationStatusMac) {
|
|
|
|
AVAuthorizationStatusNotDeterminedMac = 0,
|
|
|
|
AVAuthorizationStatusRestrictedMac = 1,
|
|
|
|
AVAuthorizationStatusDeniedMac = 2,
|
|
|
|
AVAuthorizationStatusAuthorizedMac = 3,
|
|
|
|
};
|
|
|
|
|
|
|
|
@interface AVCaptureDevice (MojaveSDK)
|
|
|
|
+ (void)requestAccessForMediaType:(AVMediaType)mediaType
|
|
|
|
completionHandler:(void (^)(BOOL granted))handler
|
|
|
|
API_AVAILABLE(macosx(10.14));
|
|
|
|
+ (AVAuthorizationStatusMac)authorizationStatusForMediaType:
|
|
|
|
(AVMediaType)mediaType API_AVAILABLE(macosx(10.14));
|
|
|
|
@end
|
|
|
|
|
2019-01-03 13:24:55 -08:00
|
|
|
@interface NSColor (MojaveSDK)
|
|
|
|
@property(class, strong, readonly)
|
|
|
|
NSColor* controlAccentColor API_AVAILABLE(macosx(10.14));
|
2019-01-03 14:30:38 -08:00
|
|
|
|
|
|
|
// macOS system colors
|
|
|
|
@property(class, strong, readonly)
|
|
|
|
NSColor* systemBlueColor API_AVAILABLE(macosx(10.10));
|
|
|
|
@property(class, strong, readonly)
|
|
|
|
NSColor* systemBrownColor API_AVAILABLE(macosx(10.10));
|
|
|
|
@property(class, strong, readonly)
|
|
|
|
NSColor* systemGrayColor API_AVAILABLE(macosx(10.10));
|
|
|
|
@property(class, strong, readonly)
|
|
|
|
NSColor* systemGreenColor API_AVAILABLE(macosx(10.10));
|
|
|
|
@property(class, strong, readonly)
|
|
|
|
NSColor* systemOrangeColor API_AVAILABLE(macosx(10.10));
|
|
|
|
@property(class, strong, readonly)
|
|
|
|
NSColor* systemPinkColor API_AVAILABLE(macosx(10.10));
|
|
|
|
@property(class, strong, readonly)
|
|
|
|
NSColor* systemPurpleColor API_AVAILABLE(macosx(10.10));
|
|
|
|
@property(class, strong, readonly)
|
|
|
|
NSColor* systemRedColor API_AVAILABLE(macosx(10.10));
|
|
|
|
@property(class, strong, readonly)
|
|
|
|
NSColor* systemYellowColor API_AVAILABLE(macosx(10.10));
|
2019-01-03 16:17:07 -08:00
|
|
|
|
|
|
|
// misc dynamic colors declarations
|
|
|
|
@property(class, strong, readonly)
|
|
|
|
NSColor* linkColor API_AVAILABLE(macosx(10.10));
|
|
|
|
@property(class, strong, readonly)
|
|
|
|
NSColor* placeholderTextColor API_AVAILABLE(macosx(10.10));
|
|
|
|
@property(class, strong, readonly)
|
|
|
|
NSColor* findHighlightColor API_AVAILABLE(macosx(10.13));
|
|
|
|
@property(class, strong, readonly)
|
|
|
|
NSColor* separatorColor API_AVAILABLE(macosx(10.14));
|
|
|
|
@property(class, strong, readonly)
|
|
|
|
NSColor* selectedContentBackgroundColor API_AVAILABLE(macosx(10.14));
|
|
|
|
@property(class, strong, readonly)
|
|
|
|
NSColor* unemphasizedSelectedContentBackgroundColor API_AVAILABLE(
|
|
|
|
macosx(10.14));
|
|
|
|
@property(class, strong, readonly)
|
|
|
|
NSColor* unemphasizedSelectedTextBackgroundColor API_AVAILABLE(macosx(10.14)
|
|
|
|
);
|
|
|
|
@property(class, strong, readonly)
|
|
|
|
NSColor* unemphasizedSelectedTextColor API_AVAILABLE(macosx(10.14));
|
2019-01-03 13:24:55 -08:00
|
|
|
@end
|
|
|
|
|
2018-04-17 21:44:10 -04:00
|
|
|
@interface AtomApplication : NSApplication <CrAppProtocol,
|
|
|
|
CrAppControlProtocol,
|
|
|
|
NSUserActivityDelegate> {
|
2013-05-02 20:09:19 +08:00
|
|
|
@private
|
|
|
|
BOOL handlingSendEvent_;
|
2019-02-25 18:21:57 +01:00
|
|
|
base::scoped_nsobject<NSUserActivity> currentActivity_;
|
2017-09-14 16:12:34 +09:00
|
|
|
NSCondition* handoffLock_;
|
2017-08-09 12:09:47 -03:00
|
|
|
BOOL updateReceived_;
|
2018-02-05 16:13:35 +09:00
|
|
|
base::Callback<bool()> shouldShutdown_;
|
2013-05-02 20:09:19 +08:00
|
|
|
}
|
|
|
|
|
2013-05-30 16:03:10 +08:00
|
|
|
+ (AtomApplication*)sharedApplication;
|
|
|
|
|
2018-02-05 16:13:35 +09:00
|
|
|
- (void)setShutdownHandler:(base::Callback<bool()>)handler;
|
|
|
|
|
2013-05-02 20:09:19 +08:00
|
|
|
// CrAppProtocol:
|
|
|
|
- (BOOL)isHandlingSendEvent;
|
|
|
|
|
|
|
|
// CrAppControlProtocol:
|
|
|
|
- (void)setHandlingSendEvent:(BOOL)handlingSendEvent;
|
|
|
|
|
2019-02-25 18:21:57 +01:00
|
|
|
- (NSUserActivity*)getCurrentActivity;
|
2016-05-23 11:49:46 -04:00
|
|
|
- (void)setCurrentActivity:(NSString*)type
|
|
|
|
withUserInfo:(NSDictionary*)userInfo
|
|
|
|
withWebpageURL:(NSURL*)webpageURL;
|
2017-06-26 16:14:44 -03:00
|
|
|
- (void)invalidateCurrentActivity;
|
2019-06-06 22:16:03 -07:00
|
|
|
- (void)resignCurrentActivity;
|
2017-09-14 16:12:34 +09:00
|
|
|
- (void)updateCurrentActivity:(NSString*)type
|
2017-06-26 16:14:44 -03:00
|
|
|
withUserInfo:(NSDictionary*)userInfo;
|
2016-05-03 14:57:16 -07:00
|
|
|
|
2013-05-02 20:09:19 +08:00
|
|
|
@end
|