mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-06-03 22:18:38 +03:00
update zig-objc
This commit is contained in:
@ -13,8 +13,8 @@
|
|||||||
.hash = "12202da6b8e9024c653f5d67f55a8065b401c42b3c08b69333d95400fe85d6019a59",
|
.hash = "12202da6b8e9024c653f5d67f55a8065b401c42b3c08b69333d95400fe85d6019a59",
|
||||||
},
|
},
|
||||||
.zig_objc = .{
|
.zig_objc = .{
|
||||||
.url = "https://github.com/mitchellh/zig-objc/archive/146a50bb018d8e1ac5b9a1454d9db9a5eba5361f.tar.gz",
|
.url = "https://github.com/mitchellh/zig-objc/archive/a38331cb6ee366b3f22d0068297810ef14c0c400.tar.gz",
|
||||||
.hash = "12209f62dae4fccae478f5bd5670725c55308d8d985506110ba122ee2fb5e73122e0",
|
.hash = "1220dcb34ec79a9b02c46372a41a446212f2366e7c69c8eba68e88f0f25b5ddf475d",
|
||||||
},
|
},
|
||||||
.zig_js = .{
|
.zig_js = .{
|
||||||
.url = "https://github.com/mitchellh/zig-js/archive/60ac42ab137461cdba2b38cc6c5e16376470aae6.tar.gz",
|
.url = "https://github.com/mitchellh/zig-js/archive/60ac42ab137461cdba2b38cc6c5e16376470aae6.tar.gz",
|
||||||
|
@ -291,7 +291,7 @@ pub const App = struct {
|
|||||||
tabbing_id: *macos.foundation.String,
|
tabbing_id: *macos.foundation.String,
|
||||||
|
|
||||||
pub fn init() !Darwin {
|
pub fn init() !Darwin {
|
||||||
const NSWindow = objc.Class.getClass("NSWindow").?;
|
const NSWindow = objc.getClass("NSWindow").?;
|
||||||
NSWindow.msgSend(void, objc.sel("setAllowsAutomaticWindowTabbing:"), .{true});
|
NSWindow.msgSend(void, objc.sel("setAllowsAutomaticWindowTabbing:"), .{true});
|
||||||
|
|
||||||
// Our tabbing ID allows all of our windows to group together
|
// Our tabbing ID allows all of our windows to group together
|
||||||
|
@ -70,7 +70,7 @@ fn setLangFromCocoa() void {
|
|||||||
defer pool.deinit();
|
defer pool.deinit();
|
||||||
|
|
||||||
// The classes we're going to need.
|
// 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.", .{});
|
log.err("NSLocale class not found. Locale may be incorrect.", .{});
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
@ -7,7 +7,7 @@ const objc = @import("objc");
|
|||||||
pub fn macosVersionAtLeast(major: i64, minor: i64, patch: i64) bool {
|
pub fn macosVersionAtLeast(major: i64, minor: i64, patch: i64) bool {
|
||||||
assert(builtin.target.isDarwin());
|
assert(builtin.target.isDarwin());
|
||||||
|
|
||||||
const NSProcessInfo = objc.Class.getClass("NSProcessInfo").?;
|
const NSProcessInfo = objc.getClass("NSProcessInfo").?;
|
||||||
const info = NSProcessInfo.msgSend(objc.Object, objc.sel("processInfo"), .{});
|
const info = NSProcessInfo.msgSend(objc.Object, objc.sel("processInfo"), .{});
|
||||||
return info.msgSend(bool, objc.sel("isOperatingSystemAtLeastVersion:"), .{
|
return info.msgSend(bool, objc.sel("isOperatingSystemAtLeastVersion:"), .{
|
||||||
NSOperatingSystemVersion{ .major = major, .minor = minor, .patch = patch },
|
NSOperatingSystemVersion{ .major = major, .minor = minor, .patch = patch },
|
||||||
|
@ -9,7 +9,7 @@ const log = std.log.scoped(.os);
|
|||||||
pub fn clickInterval() ?u32 {
|
pub fn clickInterval() ?u32 {
|
||||||
// On macOS, we can ask the system.
|
// On macOS, we can ask the system.
|
||||||
if (comptime builtin.target.isDarwin()) {
|
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.", .{});
|
log.err("NSEvent class not found. Can't get click interval.", .{});
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
@ -203,7 +203,7 @@ pub fn init(alloc: Allocator, options: renderer.Options) !Metal {
|
|||||||
const device = objc.Object.fromId(mtl.MTLCreateSystemDefaultDevice());
|
const device = objc.Object.fromId(mtl.MTLCreateSystemDefaultDevice());
|
||||||
const queue = device.msgSend(objc.Object, objc.sel("newCommandQueue"), .{});
|
const queue = device.msgSend(objc.Object, objc.sel("newCommandQueue"), .{});
|
||||||
const swapchain = swapchain: {
|
const swapchain = swapchain: {
|
||||||
const CAMetalLayer = objc.Class.getClass("CAMetalLayer").?;
|
const CAMetalLayer = objc.getClass("CAMetalLayer").?;
|
||||||
const swapchain = CAMetalLayer.msgSend(objc.Object, objc.sel("layer"), .{});
|
const swapchain = CAMetalLayer.msgSend(objc.Object, objc.sel("layer"), .{});
|
||||||
swapchain.setProperty("device", device.value);
|
swapchain.setProperty("device", device.value);
|
||||||
swapchain.setProperty("opaque", options.config.background_opacity >= 1);
|
swapchain.setProperty("opaque", options.config.background_opacity >= 1);
|
||||||
@ -587,7 +587,7 @@ pub fn render(
|
|||||||
{
|
{
|
||||||
// MTLRenderPassDescriptor
|
// MTLRenderPassDescriptor
|
||||||
const desc = desc: {
|
const desc = desc: {
|
||||||
const MTLRenderPassDescriptor = objc.Class.getClass("MTLRenderPassDescriptor").?;
|
const MTLRenderPassDescriptor = objc.getClass("MTLRenderPassDescriptor").?;
|
||||||
const desc = MTLRenderPassDescriptor.msgSend(
|
const desc = MTLRenderPassDescriptor.msgSend(
|
||||||
objc.Object,
|
objc.Object,
|
||||||
objc.sel("renderPassDescriptor"),
|
objc.sel("renderPassDescriptor"),
|
||||||
@ -1625,7 +1625,7 @@ fn initAtlasTexture(device: objc.Object, atlas: *const font.Atlas) !objc.Object
|
|||||||
|
|
||||||
// Create our descriptor
|
// Create our descriptor
|
||||||
const desc = init: {
|
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_alloc = Class.msgSend(objc.Object, objc.sel("alloc"), .{});
|
||||||
const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{});
|
const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{});
|
||||||
break :init id_init;
|
break :init id_init;
|
||||||
|
@ -218,7 +218,7 @@ pub const Image = union(enum) {
|
|||||||
fn initTexture(p: Pending, device: objc.Object) !objc.Object {
|
fn initTexture(p: Pending, device: objc.Object) !objc.Object {
|
||||||
// Create our descriptor
|
// Create our descriptor
|
||||||
const desc = init: {
|
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_alloc = Class.msgSend(objc.Object, objc.sel("alloc"), .{});
|
||||||
const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{});
|
const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{});
|
||||||
break :init id_init;
|
break :init id_init;
|
||||||
|
@ -137,7 +137,7 @@ fn initCellPipeline(device: objc.Object, library: objc.Object) !objc.Object {
|
|||||||
// Cell as input.
|
// Cell as input.
|
||||||
const vertex_desc = vertex_desc: {
|
const vertex_desc = vertex_desc: {
|
||||||
const desc = init: {
|
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_alloc = Class.msgSend(objc.Object, objc.sel("alloc"), .{});
|
||||||
const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{});
|
const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{});
|
||||||
break :init id_init;
|
break :init id_init;
|
||||||
@ -242,7 +242,7 @@ fn initCellPipeline(device: objc.Object, library: objc.Object) !objc.Object {
|
|||||||
|
|
||||||
// Create our descriptor
|
// Create our descriptor
|
||||||
const desc = init: {
|
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_alloc = Class.msgSend(objc.Object, objc.sel("alloc"), .{});
|
||||||
const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{});
|
const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{});
|
||||||
break :init id_init;
|
break :init id_init;
|
||||||
@ -320,7 +320,7 @@ fn initImagePipeline(device: objc.Object, library: objc.Object) !objc.Object {
|
|||||||
// Image as input.
|
// Image as input.
|
||||||
const vertex_desc = vertex_desc: {
|
const vertex_desc = vertex_desc: {
|
||||||
const desc = init: {
|
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_alloc = Class.msgSend(objc.Object, objc.sel("alloc"), .{});
|
||||||
const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{});
|
const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{});
|
||||||
break :init id_init;
|
break :init id_init;
|
||||||
@ -392,7 +392,7 @@ fn initImagePipeline(device: objc.Object, library: objc.Object) !objc.Object {
|
|||||||
|
|
||||||
// Create our descriptor
|
// Create our descriptor
|
||||||
const desc = init: {
|
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_alloc = Class.msgSend(objc.Object, objc.sel("alloc"), .{});
|
||||||
const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{});
|
const id_init = id_alloc.msgSend(objc.Object, objc.sel("init"), .{});
|
||||||
break :init id_init;
|
break :init id_init;
|
||||||
|
Reference in New Issue
Block a user