summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
authorAkemi <der.richter@gmx.de>2018-09-30 11:36:14 +0200
committerJan Ekström <jeebjp@gmail.com>2019-02-10 22:39:25 +0200
commitace61c120f18733f3cfc88273fdbad6fb1db5bc6 (patch)
tree298b3299194ba5c8f7cd67db8e8828bcca366558 /osdep
parentf2e7e81bda653c1f2cb3b27cf867e9195d184ddc (diff)
downloadmpv-ace61c120f18733f3cfc88273fdbad6fb1db5bc6.tar.bz2
mpv-ace61c120f18733f3cfc88273fdbad6fb1db5bc6.tar.xz
cocoa-cb: use Swift Extensions for convenience
preparations for the following commit.
Diffstat (limited to 'osdep')
-rw-r--r--osdep/macOS_swift_extensions.swift28
1 files changed, 28 insertions, 0 deletions
diff --git a/osdep/macOS_swift_extensions.swift b/osdep/macOS_swift_extensions.swift
new file mode 100644
index 0000000000..61e61aaffd
--- /dev/null
+++ b/osdep/macOS_swift_extensions.swift
@@ -0,0 +1,28 @@
+/*
+ * This file is part of mpv.
+ *
+ * mpv is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * mpv is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with mpv. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import Cocoa
+
+extension NSScreen {
+
+ public var displayID: CGDirectDisplayID {
+ get {
+ return deviceDescription["NSScreenNumber"] as! CGDirectDisplayID
+ }
+ }
+
+}