diff --git a/generator.zig b/generator.zig index 7b9f2d7..b1153ef 100644 --- a/generator.zig +++ b/generator.zig @@ -1911,6 +1911,12 @@ fn generateAppKit(generator: anytype) !void { [2][]const u8{ "NSWindow", "isVisible" }, [2][]const u8{ "NSWindow", "setIsVisible" }, [2][]const u8{ "NSWindow", "makeKeyAndOrderFront" }, + [2][]const u8{ "NSWindow", "title" }, + [2][]const u8{ "NSWindow", "setTitle" }, + [2][]const u8{ "NSWindow", "frame" }, + [2][]const u8{ "NSWindow", "setFrame" }, + [2][]const u8{ "NSWindow", "contentRectForFrameRect" }, + [2][]const u8{ "NSWindow", "frameRectForContentRect" }, [2][]const u8{ "NSView", "layer" }, [2][]const u8{ "NSView", "setLayer" }, @@ -1919,6 +1925,7 @@ fn generateAppKit(generator: anytype) !void { [2][]const u8{ "NSScreen", "screens" }, [2][]const u8{ "NSScreen", "mainScreen" }, + [2][]const u8{ "NSScreen", "frame" }, [2][]const u8{ "NSApplicationDelegate", "applicationDidFinishLaunching" }, diff --git a/src/app_kit.zig b/src/app_kit.zig index df75e57..1f0a632 100644 --- a/src/app_kit.zig +++ b/src/app_kit.zig @@ -116,15 +116,30 @@ pub const Window = opaque { pub const alloc = InternalInfo.alloc; pub const allocInit = InternalInfo.allocInit; + pub fn frameRectForContentRect(self_: *@This(), contentRect_: Rect) Rect { + return objc.msgSend(self_, "frameRectForContentRect:", Rect, .{contentRect_}); + } + pub fn contentRectForFrameRect(self_: *@This(), frameRect_: Rect) Rect { + return objc.msgSend(self_, "contentRectForFrameRect:", Rect, .{frameRect_}); + } pub fn initWithContentRect_styleMask_backing_defer_screen(self_: *@This(), contentRect_: Rect, style_: WindowStyleMask, backingStoreType_: BackingStoreType, flag_: bool, screen_: ?*Screen) *@This() { return objc.msgSend(self_, "initWithContentRect:styleMask:backing:defer:screen:", *@This(), .{ contentRect_, style_, backingStoreType_, flag_, screen_ }); } pub fn makeKeyAndOrderFront(self_: *@This(), sender_: ?*objc.Id) void { return objc.msgSend(self_, "makeKeyAndOrderFront:", void, .{sender_}); } + pub fn title(self_: *@This()) *String { + return objc.msgSend(self_, "title", *String, .{}); + } + pub fn setTitle(self_: *@This(), title_: *String) void { + return objc.msgSend(self_, "setTitle:", void, .{title_}); + } pub fn contentView(self_: *@This()) ?*View { return objc.msgSend(self_, "contentView", ?*View, .{}); } + pub fn frame(self_: *@This()) Rect { + return objc.msgSend(self_, "frame", Rect, .{}); + } pub fn isReleasedWhenClosed(self_: *@This()) bool { return objc.msgSend(self_, "isReleasedWhenClosed", bool, .{}); } @@ -206,6 +221,9 @@ pub const Screen = opaque { pub fn mainScreen() ?*Screen { return objc.msgSend(@This().InternalInfo.class(), "mainScreen", ?*Screen, .{}); } + pub fn frame(self_: *@This()) Rect { + return objc.msgSend(self_, "frame", Rect, .{}); + } }; pub const ApplicationDelegate = opaque {