MacMonitor CI/CD Pipeline / Build & Test (Intel x86_64) (push) Successful in 2m37s
43 lines
1.4 KiB
Objective-C
43 lines
1.4 KiB
Objective-C
#import <Foundation/Foundation.h>
|
|
#import <CoreGraphics/CoreGraphics.h>
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
@interface MMDisplayInfo : NSObject
|
|
|
|
@property (nonatomic, readonly) CGDirectDisplayID displayID;
|
|
@property (nonatomic, readonly, copy) NSString *name;
|
|
@property (nonatomic, readonly) BOOL isBuiltin;
|
|
@property (nonatomic, readonly) BOOL isMain;
|
|
@property (nonatomic, readonly) BOOL isOnline;
|
|
@property (nonatomic, readonly) uint32_t width;
|
|
@property (nonatomic, readonly) uint32_t height;
|
|
@property (nonatomic, readonly) double refreshRate;
|
|
@property (nonatomic, readonly) float brightness; // 0.0 to 1.0, or -1.0 if not supported
|
|
|
|
- (instancetype)initWithDisplayID:(CGDirectDisplayID)displayID
|
|
name:(NSString *)name
|
|
isBuiltin:(BOOL)isBuiltin
|
|
isMain:(BOOL)isMain
|
|
isOnline:(BOOL)isOnline
|
|
width:(uint32_t)width
|
|
height:(uint32_t)height
|
|
refreshRate:(double)refreshRate
|
|
brightness:(float)brightness NS_DESIGNATED_INITIALIZER;
|
|
|
|
- (instancetype)init NS_UNAVAILABLE;
|
|
|
|
@end
|
|
|
|
@interface MMDisplayManager : NSObject
|
|
|
|
+ (instancetype)sharedManager;
|
|
|
|
- (NSArray<MMDisplayInfo *> *)activeDisplays;
|
|
- (float)brightnessForDisplay:(CGDirectDisplayID)displayID;
|
|
- (BOOL)setBrightness:(float)brightness forDisplay:(CGDirectDisplayID)displayID;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|