diff options
| author | Jacob Evelyn <jacobevelyn@gmail.com> | 2026-01-13 15:13:59 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-13 21:13:59 +0100 |
| commit | 11afefeedc3258f6bca822ef33e5908f3cf6592c (patch) | |
| tree | 145e8a9299d2488990c20133a1833cadcd2b5e9d | |
| parent | a4f958b738b2cfd9d50d07b1357645d6c4d7902f (diff) | |
Add NSWindow layout information method bindings to darwin/Foundation (#6040)
This commit adds bindings for `NSWindow`'s
["Getting Layout Information"](https://developer.apple.com/documentation/appkit/nswindow?language=objc#Getting-Layout-Information)
methods to the `core:sys/darwin/Foundation` package.
Co-authored-by: Jacob Evelyn <j@cob.land>
| -rw-r--r-- | core/sys/darwin/Foundation/NSWindow.odin | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/sys/darwin/Foundation/NSWindow.odin b/core/sys/darwin/Foundation/NSWindow.odin index f39faca0a..11f8b187e 100644 --- a/core/sys/darwin/Foundation/NSWindow.odin +++ b/core/sys/darwin/Foundation/NSWindow.odin @@ -968,3 +968,23 @@ Window_setTabbingMode :: proc "c" (self: ^Window, mode: WindowTabbingMode) { Window_toggleFullScreen :: proc "c" (self: ^Window, sender: id) { msgSend(nil, self, "toggleFullScreen:", sender) } +@(objc_type = Window, objc_name = "contentRectForFrameRect", objc_is_class_method=true) +Window_contentRectForFrameRectType :: proc "c" (frameRect: Rect, styleMask: WindowStyleMask) -> Rect { + return msgSend(Rect, Window, "contentRectForFrameRect:styleMask:", frameRect, styleMask) +} +@(objc_type = Window, objc_name = "frameRectForContentRect", objc_is_class_method=true) +Window_frameRectForContentRectType :: proc "c" (contentRect: Rect, styleMask: WindowStyleMask) -> Rect { + return msgSend(Rect, Window, "frameRectForContentRect:styleMask:", contentRect, styleMask) +} +@(objc_type = Window, objc_name = "minFrameWidthWithTitle", objc_is_class_method=true) +Window_minFrameWidthWithTitle :: proc "c" (title: ^String, styleMask: WindowStyleMask) -> Float { + return msgSend(Float, Window, "minFrameWidthWithTitle:styleMask:", title, styleMask) +} +@(objc_type = Window, objc_name = "contentRectForFrameRect") +Window_contentRectForFrameRectInstance :: proc "c" (self: ^Window, frameRect: Rect) -> Rect { + return msgSend(Rect, self, "contentRectForFrameRect:", frameRect) +} +@(objc_type = Window, objc_name = "frameRectForContentRect") +Window_frameRectForContentRectInstance :: proc "c" (self: ^Window, contentRect: Rect) -> Rect { + return msgSend(Rect, self, "frameRectForContentRect:", contentRect) +} |