CGDirectDisplay.h
1 2 #import <CoreGraphics/CGError.h> 3 #import <CoreGraphics/CGGeometry.h> 4 #import <CoreGraphics/CoreGraphicsExport.h> 5 #import <mach/boolean.h> 6 7 typedef uint32_t CGDirectDisplayID; 8 typedef uint32_t CGOpenGLDisplayMask; 9 typedef double CGRefreshRate; 10 11 #define kCGDirectMainDisplay 69989856 12 #define kCGDisplayBitsPerPixel 8200 13 #define kCGDisplayBlendNormal 0 14 #define kCGDisplayBlendSolidColor 1 15 #define kCGDisplayRefreshRate 8200 16 #define kCGDisplayHeight 8200 17 #define kCGDisplayWidth 8200 18 #define kCGMaxDisplayReservationInterval 15 19 #define kCGNullDirectDisplay 0 20 21 typedef CFTypeRef CGDisplayModeRef; 22 23 COREGRAPHICS_EXPORT CGError CGCaptureAllDisplays(void); 24 COREGRAPHICS_EXPORT CGError CGReleaseAllDisplays(void); 25 26 COREGRAPHICS_EXPORT CGDirectDisplayID CGMainDisplayID(void); 27 28 COREGRAPHICS_EXPORT CGError 29 CGGetOnlineDisplayList(uint32_t maxDisplays, CGDirectDisplayID *onlineDisplays, 30 uint32_t *displayCount); 31 32 COREGRAPHICS_EXPORT CGError 33 CGGetActiveDisplayList(uint32_t maxDisplays, CGDirectDisplayID *activeDisplays, 34 uint32_t *displayCount); 35 36 COREGRAPHICS_EXPORT CGError CGGetDisplaysWithOpenGLDisplayMask( 37 CGOpenGLDisplayMask mask, uint32_t maxDisplays, 38 CGDirectDisplayID *displays, uint32_t *matchingDisplayCount); 39 40 COREGRAPHICS_EXPORT CGDirectDisplayID 41 CGOpenGLDisplayMaskToDisplayID(CGOpenGLDisplayMask mask); 42 43 COREGRAPHICS_EXPORT CGError CGGetDisplaysWithPoint( 44 CGPoint point, uint32_t maxDisplays, CGDirectDisplayID *displays, 45 uint32_t *matchingDisplayCount); 46 47 COREGRAPHICS_EXPORT CGError CGGetDisplaysWithRect( 48 CGRect rect, uint32_t maxDisplays, CGDirectDisplayID *displays, 49 uint32_t *matchingDisplayCount); 50 51 COREGRAPHICS_EXPORT size_t CGDisplayPixelsHigh(CGDirectDisplayID display); 52 COREGRAPHICS_EXPORT size_t CGDisplayPixelsWide(CGDirectDisplayID display); 53 54 COREGRAPHICS_EXPORT Boolean CGDisplayIsMain(CGDirectDisplayID display); 55 COREGRAPHICS_EXPORT CGDirectDisplayID 56 CGDisplayMirrorsDisplay(CGDirectDisplayID display); 57 58 COREGRAPHICS_EXPORT CFDictionaryRef 59 CGDisplayBestModeForParametersAndRefreshRate(CGDirectDisplayID display, 60 size_t bitsPerPixel, size_t width, 61 size_t height, 62 CGRefreshRate refreshRate, 63 boolean_t *exactMatch); 64 COREGRAPHICS_EXPORT CGDisplayModeRef 65 CGDisplayCopyDisplayMode(CGDirectDisplayID displayId); 66 COREGRAPHICS_EXPORT CFDictionaryRef 67 CGDisplayCurrentMode(CGDirectDisplayID display); 68 COREGRAPHICS_EXPORT void CGDisplayModeRelease(CGDisplayModeRef mode); 69 COREGRAPHICS_EXPORT CGDisplayModeRef CGDisplayModeRetain(CGDisplayModeRef mode); 70 COREGRAPHICS_EXPORT CGDisplayModeRef 71 CGDisplayCopyDisplayMode(CGDirectDisplayID displayId); 72 COREGRAPHICS_EXPORT boolean_t CGDisplayIsCaptured(CGDirectDisplayID display); 73 COREGRAPHICS_EXPORT double CGDisplayModeGetRefreshRate(CGDisplayModeRef mode); 74 COREGRAPHICS_EXPORT CGError CGDisplaySwitchToMode(CGDirectDisplayID display, 75 CFDictionaryRef mode); 76 COREGRAPHICS_EXPORT size_t CGDisplayModeGetPixelWidth(CGDisplayModeRef mode);