mac: remove now unnecessary objective-c forwarding

This commit is contained in:
der richter 2024-03-26 21:50:35 +01:00
parent 6debb22a0c
commit e71e340b77
5 changed files with 8 additions and 9 deletions

View File

@ -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))
}

View File

@ -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() }

View File

@ -17,7 +17,7 @@
import Cocoa
class LogHelper: NSObject {
class LogHelper {
var log: OpaquePointer?
init(_ log: OpaquePointer?) {

View File

@ -19,7 +19,7 @@ import Cocoa
typealias swift_wakeup_cb_fn = (@convention(c) (UnsafeMutableRawPointer?) -> Void)?
class OptionHelper: NSObject {
class OptionHelper {
var voCachePtr: UnsafeMutablePointer<m_config_cache>
var macCachePtr: UnsafeMutablePointer<m_config_cache>

View File

@ -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)