diff --git a/osdep/mac/event_helper.swift b/osdep/mac/event_helper.swift index 003f04e766..fa2cd8e01e 100644 --- a/osdep/mac/event_helper.swift +++ b/osdep/mac/event_helper.swift @@ -57,12 +57,12 @@ extension EventHelper { } } -public class EventHelper: NSObject { +class EventHelper { unowned let appHub: AppHub var mpv: OpaquePointer? var events: [String:[Int:EventSubscriber]] = [:] - @objc init?(_ appHub: AppHub, _ mpvHandle: OpaquePointer) { + init?(_ appHub: AppHub, _ mpvHandle: OpaquePointer) { if !appHub.isApplication { mpv_destroy(mpvHandle) return nil @@ -70,7 +70,6 @@ public class EventHelper: NSObject { self.appHub = appHub self.mpv = mpvHandle - super.init() mpv_set_wakeup_callback(mpvHandle, wakeup, TypeHelper.bridge(obj: self)) } diff --git a/osdep/mac/input_helper.swift b/osdep/mac/input_helper.swift index 70099ce3ae..d53bfe779b 100644 --- a/osdep/mac/input_helper.swift +++ b/osdep/mac/input_helper.swift @@ -62,13 +62,13 @@ class InputHelper: NSObject { .init(0, 0) ] - @objc init(_ input: OpaquePointer? = nil, _ option: OptionHelper? = nil) { + init(_ input: OpaquePointer? = nil, _ option: OptionHelper? = nil) { super.init() self.input = input self.option = option } - @objc func put( + func put( key: Int32, modifiers: NSEvent.ModifierFlags = .init(rawValue: 0), type: NSEvent.EventType = .applicationDefined @@ -258,7 +258,7 @@ class InputHelper: NSObject { } } - @objc func signal(input: OpaquePointer? = nil) { + func signal(input: OpaquePointer? = nil) { lock.withLock { self.input = input if input != nil { lock.signal() } diff --git a/osdep/mac/log_helper.swift b/osdep/mac/log_helper.swift index 94640756bd..3fdb875491 100644 --- a/osdep/mac/log_helper.swift +++ b/osdep/mac/log_helper.swift @@ -17,7 +17,7 @@ import Cocoa -class LogHelper: NSObject { +class LogHelper { var log: OpaquePointer? init(_ log: OpaquePointer?) { diff --git a/osdep/mac/option_helper.swift b/osdep/mac/option_helper.swift index 8610c4ec46..c44f0907c8 100644 --- a/osdep/mac/option_helper.swift +++ b/osdep/mac/option_helper.swift @@ -19,7 +19,7 @@ import Cocoa typealias swift_wakeup_cb_fn = (@convention(c) (UnsafeMutableRawPointer?) -> Void)? -class OptionHelper: NSObject { +class OptionHelper { var voCachePtr: UnsafeMutablePointer var macCachePtr: UnsafeMutablePointer diff --git a/video/out/cocoa_cb_common.swift b/video/out/cocoa_cb_common.swift index 3426ca6cf8..36721391c8 100644 --- a/video/out/cocoa_cb_common.swift +++ b/video/out/cocoa_cb_common.swift @@ -31,7 +31,7 @@ class CocoaCB: Common, EventSubscriber { var backendState: State = .uninitialized - @objc init(_ mpvHandle: OpaquePointer) { + init(_ mpvHandle: OpaquePointer) { let newlog = mp_log_new(UnsafeMutablePointer(mpvHandle), mp_client_get_log(mpvHandle), "cocoacb") let option = OptionHelper(UnsafeMutablePointer(mpvHandle), mp_client_get_global(mpvHandle)) libmpv = LibmpvHelper(mpvHandle, newlog)