Macでもモニタ名取得は容易ではなさそうなためオミット。
This commit is contained in:
Binary file not shown.
@@ -108,10 +108,6 @@ UNIWINC_EXPORT BOOL GetMonitorRectangle(SInt32 monitorIndex, Float32* x, Float32
|
||||
return [LibUniWinC getMonitorRectangleWithMonitorIndex:monitorIndex x:x y:y width:width height:height];
|
||||
}
|
||||
|
||||
UNIWINC_EXPORT BOOL GetMonitorName(SInt32 monitorIndex, void* nameString) {
|
||||
return [LibUniWinC getMonitorNameWithMonitorIndex: monitorIndex name: nameString];
|
||||
}
|
||||
|
||||
UNIWINC_EXPORT BOOL RegisterMonitorChangedCallback(IntCallback callback) {
|
||||
return [LibUniWinC registerMonitorChangedCallbackWithCallback: callback];
|
||||
}
|
||||
|
||||
@@ -639,20 +639,6 @@ public class LibUniWinC : NSObject {
|
||||
return true
|
||||
}
|
||||
|
||||
@objc public static func getMonitorName(monitorIndex: Int32, name: UnsafeMutableRawPointer) -> Bool {
|
||||
|
||||
|
||||
let screen = NSScreen.screens[monitorIndices[Int(monitorIndex)]]
|
||||
let utf16Name = screen.localizedName.utf16
|
||||
let buffer = UnsafeMutablePointer<uint16>.allocate(capacity: utf16Name.count + 1)
|
||||
|
||||
let result = _copyUTF16ToBuffer(text: utf16Name, buffer: buffer)
|
||||
buffer.deallocate()
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
@objc public static func registerMonitorChangedCallback(callback: @escaping intCallback) -> Bool {
|
||||
monitorChangedCallback = callback
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user