Added GetClientSize()

This commit is contained in:
Kirurobo
2023-04-05 07:48:27 +09:00
parent 1116897e04
commit 042fba2a2c
4 changed files with 28 additions and 7 deletions

View File

@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>21F79</string>
<string>22E252</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
@@ -27,19 +27,19 @@
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>13F100</string>
<string></string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>12.3</string>
<string>13.3</string>
<key>DTSDKBuild</key>
<string>21E226</string>
<string>22E245</string>
<key>DTSDKName</key>
<string>macosx12.3</string>
<string>macosx13.3</string>
<key>DTXcode</key>
<string>1341</string>
<string>1430</string>
<key>DTXcodeBuild</key>
<string>13F100</string>
<string>14E222b</string>
<key>LSMinimumSystemVersion</key>
<string>10.13</string>
<key>NSHumanReadableCopyright</key>

View File

@@ -104,6 +104,10 @@ UNIWINC_EXPORT BOOL GetSize(Float32* width, Float32* height) {
return [LibUniWinC getSizeWithWidth:width height:height];
}
UNIWINC_EXPORT BOOL GetClientSize(Float32* width, Float32* height) {
return [LibUniWinC getSizeWithWidth:width height:height];
}
UNIWINC_EXPORT SInt32 GetCurrentMonitor() {
return [LibUniWinC getCurrentMonitor];
}

View File

@@ -809,6 +809,23 @@ public class LibUniWinC : NSObject {
height.pointee = Float32(currentSize.height)
return true
}
///
/// - Parameters:
/// - width:
/// - height:
/// - Returns: true
@objc public static func getClientSize(width: UnsafeMutablePointer<Float32>, height: UnsafeMutablePointer<Float32>) -> Bool {
if (targetWindow == nil) {
width.pointee = 0;
height.pointee = 0;
return false
}
let currentSize = targetWindow!.contentView!.frame.size
width.pointee = Float32(currentSize.width)
height.pointee = Float32(currentSize.height)
return true
}
@objc public static func registerWindowStyleChangedCallback(callback: @escaping intCallback) -> Bool {
windowStyleChangedCallback = callback