From 67dce5ce0e7dfbb9dca356bc3072ba4fea25757c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 14 Nov 2023 12:28:36 -0800 Subject: [PATCH] update zig-objc --- build.zig.zon | 4 ++-- src/apprt/glfw.zig | 2 +- src/os/locale.zig | 2 +- src/os/macos_version.zig | 2 +- src/os/mouse.zig | 2 +- src/renderer/Metal.zig | 6 +++--- src/renderer/metal/image.zig | 2 +- src/renderer/metal/shaders.zig | 8 ++++---- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index ed9fec81b..1ba57e1b2 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -13,8 +13,8 @@ .hash = "12202da6b8e9024c653f5d67f55a8065b401c42b3c08b69333d95400fe85d6019a59", }, .zig_objc = .{ - .url = "https://github.com/mitchellh/zig-objc/archive/146a50bb018d8e1ac5b9a1454d9db9a5eba5361f.tar.gz", - .hash = "12209f62dae4fccae478f5bd5670725c55308d8d985506110ba122ee2fb5e73122e0", + .url = "https://github.com/mitchellh/zig-objc/archive/a38331cb6ee366b3f22d0068297810ef14c0c400.tar.gz", + .hash = "1220dcb34ec79a9b02c46372a41a446212f2366e7c69c8eba68e88f0f25b5ddf475d", }, .zig_js = .{ .url = "https://github.com/mitchellh/zig-js/archive/60ac42ab137461cdba2b38cc6c5e16376470aae6.tar.gz", diff --git a/src/apprt/glfw.zig b/src/apprt/glfw.zig index 53cd31c1d..c75e5a3ee 100644 --- a/src/apprt/glfw.zig +++ b/src/apprt/glfw.zig @@ -291,7 +291,7 @@ pub const App = struct { tabbing_id: *macos.foundation.String, pub fn init() !Darwin { - const NSWindow = objc.Class.getClass("NSWindow").?; + const NSWindow = objc.getClass("NSWindow").?; NSWindow.msgSend(void, objc.sel("setAllowsAutomaticWindowTabbing:"), .{true}); // Our tabbing ID allows all of our windows to group together diff --git a/src/os/locale.zig b/src/os/locale.zig index 3c3f35fcf..361f4fe62 100644 --- a/src/os/locale.zig +++ b/src/os/locale.zig @@ -70,7 +70,7 @@ fn setLangFromCocoa() void { defer pool.deinit(); // The classes we're going to need. - const NSLocale = objc.Class.getClass("NSLocale") orelse { + const NSLocale = objc.getClass("NSLocale") orelse { log.err("NSLocale class not found. Locale may be incorrect.", .{}); return; }; diff --git a/src/os/macos_version.zig b/src/os/macos_version.zig index 575dd2b72..e0b21560e 100644 --- a/src/os/macos_version.zig +++ b/src/os/macos_version.zig @@ -7,7 +7,7 @@ const objc = @import("objc"); pub fn macosVersionAtLeast(major: i64, minor: i64, patch: i64) bool { assert(builtin.target.isDarwin()); - const NSProcessInfo = objc.Class.getClass("NSProcessInfo").?; + const NSProcessInfo = objc.getClass("NSProcessInfo").?; const info = NSProcessInfo.msgSend(objc.Object, objc.sel("processInfo"), .{}); return info.msgSend(bool, objc.sel("isOperatingSystemAtLeastVersion:"), .{ NSOperatingSystemVersion{ .major = major, .minor = minor, .patch = patch }, diff --git a/src/os/mouse.zig b/src/os/mouse.zig index e8b6f0f10..1774399c9 100644 --- a/src/os/mouse.zig +++ b/src/os/mouse.zig @@ -9,7 +9,7 @@ const log = std.log.scoped(.os); pub fn clickInterval() ?u32 { // On macOS, we can ask the system. if (comptime builtin.target.isDarwin()) { - const NSEvent = objc.Class.getClass("NSEvent") orelse { + const NSEvent = objc.getClass("NSEvent") orelse { log.err("NSEvent class not found. Can't get click interval.", .{}); return null; }; diff --git a/src/renderer/Metal.zig b/src/renderer/Metal.zig index d3eb22a1f..370eb3494 100644 --- a/src/renderer/Metal.zig +++ b/src/renderer/Metal.zig @@ -203,7 +203,7 @@ pub fn init(alloc: Allocator, options: renderer.Options) !Metal { const device = objc.Object.fromId(mtl.MTLCreateSystemDefaultDevice()); const queue = device.msgSend(objc.Object, objc.sel("newCommandQueue"), .{}); const swapchain = swapchain: { - const CAMetalLayer = objc.Class.getClass("CAMetalLayer").?; + const CAMetalLayer = objc.getClass("CAMetalLayer").?; const swapchain = CAMetalLayer.msgSend(objc.Object, objc.sel("layer"), .{}); swapchain.setProperty("device", device.value); swapchain.setProperty("opaque", options.config.background_opacity >= 1); @@ -587,7 +587,7 @@ pub fn render( { // MTLRenderPassDescriptor const desc = desc: { - const MTLRenderPassDescriptor = objc.Class.getClass("MTLRenderPassDescriptor").?; + const MTLRenderPassDescriptor = objc.getClass("MTLRenderPassDescriptor").?; const desc = MTLRenderPassDescriptor.msgSend( objc.Object, objc.sel("renderPassDescriptor"), @@ -1625,7 +1625,7 @@ fn initAtlasTexture(device: objc.Object, atlas: *const font.Atlas) !objc.Object // Create our descriptor const desc = init: { - const Class = objc.Class.getClass("MTLTextureDescriptor").?; + const Class = objc.getClass("MTLTextureDescriptor").?; const id_alloc = Class.msgSend(objc.Object, objc.sel("alloc"), .{}); const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{}); break :init id_init; diff --git a/src/renderer/metal/image.zig b/src/renderer/metal/image.zig index 88de3d27a..154174697 100644 --- a/src/renderer/metal/image.zig +++ b/src/renderer/metal/image.zig @@ -218,7 +218,7 @@ pub const Image = union(enum) { fn initTexture(p: Pending, device: objc.Object) !objc.Object { // Create our descriptor const desc = init: { - const Class = objc.Class.getClass("MTLTextureDescriptor").?; + const Class = objc.getClass("MTLTextureDescriptor").?; const id_alloc = Class.msgSend(objc.Object, objc.sel("alloc"), .{}); const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{}); break :init id_init; diff --git a/src/renderer/metal/shaders.zig b/src/renderer/metal/shaders.zig index 9001ede8f..3338e48b4 100644 --- a/src/renderer/metal/shaders.zig +++ b/src/renderer/metal/shaders.zig @@ -137,7 +137,7 @@ fn initCellPipeline(device: objc.Object, library: objc.Object) !objc.Object { // Cell as input. const vertex_desc = vertex_desc: { const desc = init: { - const Class = objc.Class.getClass("MTLVertexDescriptor").?; + const Class = objc.getClass("MTLVertexDescriptor").?; const id_alloc = Class.msgSend(objc.Object, objc.sel("alloc"), .{}); const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{}); break :init id_init; @@ -242,7 +242,7 @@ fn initCellPipeline(device: objc.Object, library: objc.Object) !objc.Object { // Create our descriptor const desc = init: { - const Class = objc.Class.getClass("MTLRenderPipelineDescriptor").?; + const Class = objc.getClass("MTLRenderPipelineDescriptor").?; const id_alloc = Class.msgSend(objc.Object, objc.sel("alloc"), .{}); const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{}); break :init id_init; @@ -320,7 +320,7 @@ fn initImagePipeline(device: objc.Object, library: objc.Object) !objc.Object { // Image as input. const vertex_desc = vertex_desc: { const desc = init: { - const Class = objc.Class.getClass("MTLVertexDescriptor").?; + const Class = objc.getClass("MTLVertexDescriptor").?; const id_alloc = Class.msgSend(objc.Object, objc.sel("alloc"), .{}); const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{}); break :init id_init; @@ -392,7 +392,7 @@ fn initImagePipeline(device: objc.Object, library: objc.Object) !objc.Object { // Create our descriptor const desc = init: { - const Class = objc.Class.getClass("MTLRenderPipelineDescriptor").?; + const Class = objc.getClass("MTLRenderPipelineDescriptor").?; const id_alloc = Class.msgSend(objc.Object, objc.sel("alloc"), .{}); const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{}); break :init id_init;