summaryrefslogtreecommitdiffstats
path: root/osdep/macOS_swift_compat.swift
diff options
context:
space:
mode:
Diffstat (limited to 'osdep/macOS_swift_compat.swift')
-rw-r--r--osdep/macOS_swift_compat.swift14
1 files changed, 14 insertions, 0 deletions
diff --git a/osdep/macOS_swift_compat.swift b/osdep/macOS_swift_compat.swift
index 381398e1bf..c14aa08282 100644
--- a/osdep/macOS_swift_compat.swift
+++ b/osdep/macOS_swift_compat.swift
@@ -23,6 +23,13 @@ extension NSAppearance.Name {
static let accessibilityHighContrastVibrantLight: NSAppearance.Name = NSAppearance.Name(rawValue: "NSAppearanceNameAccessibilityVibrantLight")
static let accessibilityHighContrastVibrantDark: NSAppearance.Name = NSAppearance.Name(rawValue: "NSAppearanceNameAccessibilityVibrantDark")
}
+
+@available(OSX 10.12, *)
+extension String {
+ static let RGBA16Float: String = kCAContentsFormatRGBA16Float
+ static let RGBA8Uint: String = kCAContentsFormatRGBA8Uint
+ static let gray8Uint: String = kCAContentsFormatGray8Uint
+}
#endif
extension NSPasteboard.PasteboardType {
@@ -73,6 +80,13 @@ extension Array {
}
}
+extension Array where Element == [CGLPixelFormatAttribute] {
+
+ func contains(_ obj: [CGLPixelFormatAttribute]) -> Bool {
+ return self.contains(where:{ $0 == obj })
+ }
+}
+
extension NSWindow.Level {
static func +(left: NSWindow.Level, right: Int) -> NSWindow.Level {