From 720676def85aee9e32b8db537acda1a0f4e60eb2 Mon Sep 17 00:00:00 2001 From: Patrick Doane Date: Tue, 19 Sep 2023 21:52:12 -0700 Subject: [PATCH] improved blocks and generics support --- README.md | 2 - mtl_manual.zig | 58 +--- src/foundation/ns.zig | 21 ++ src/metal/mtl.zig | 762 +++++++++++++++++++++++------------------- 4 files changed, 443 insertions(+), 400 deletions(-) diff --git a/README.md b/README.md index 7c35ba5e..b2727aa3 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,6 @@ See https://machengine.org/pkg/mach-objc Use `generate.sh` to regenerate the source files. Only `metal/mtl.zig` can be regenerated at this point, but other frameworks may be added later. -Methods using generic types (e.g. `ns.Array`) or inline block types are not being translated correctly and are currently commented out by hand. This will be updated soon in mach-objc-generator. - ## Issues Issues are tracked in the [main Mach repository](https://github.com/hexops/mach/issues?q=is%3Aissue+is%3Aopen+label%3Aobjc). diff --git a/mtl_manual.zig b/mtl_manual.zig index adf2686a..baa92379 100644 --- a/mtl_manual.zig +++ b/mtl_manual.zig @@ -9,77 +9,22 @@ pub const dispatch_data_t = *opaque {}; pub const dispatch_queue_t = *opaque {}; pub const IOSurfaceRef = *opaque {}; -// ------------------------------------------------------------------------------------------------ -// Blocks - +// TODO - can we use definition in ns extern const _NSConcreteStackBlock: *anyopaque; -extern fn _Block_copy(block: *const anyopaque) callconv(.C) *anyopaque; -extern fn _Block_release(block: *const anyopaque) callconv(.C) void; - -const BlockDescriptor = extern struct { - reserved: c_ulong, - size: c_ulong, -}; - -const BlockLiteral = extern struct { - isa: *anyopaque, - flags: c_int, - reserved: c_int, - invoke: *const fn () callconv(.C) void, - descriptor: *const BlockDescriptor, -}; - -const block_descriptor = BlockDescriptor{ .reserved = 0, .size = @sizeOf(BlockLiteral) }; - -// TODO - variable capture -pub fn Block(comptime FuncType: type) type { - return opaque { - const Self = @This(); - - pub fn init(comptime invoke: FuncType) *Self { - const block = BlockLiteral{ - .isa = _NSConcreteStackBlock, - .flags = 0, - .reserved = 0, - .invoke = @as(*const fn () callconv(.C) void, @ptrCast(invoke)), - .descriptor = &block_descriptor, - }; - return _Block_copy(&block); - } - }; -} // ------------------------------------------------------------------------------------------------ // Types -// MTLCommandBuffer.hpp -pub const CommandBufferHandler = *Block(*const fn (*anyopaque, *CommandBuffer) callconv(.C) void); - // MTLCounters.hpp pub const CommonCounter = *ns.String; pub const CommonCounterSet = *ns.String; // MTLDevice.hpp pub const DeviceNotificationName = *ns.String; -pub const DeviceNotificationHandlerBlock = *Block(fn (*anyopaque, *Device, DeviceNotificationName) callconv(.C) void); -pub const NewLibraryCompletionHandler = *Block(fn (*anyopaque, *Library, *ns.Error) callconv(.C) void); -pub const NewRenderPipelineStateCompletionHandler = *Block(fn (*anyopaque, *RenderPipelineState, *ns.Error) callconv(.C) void); -pub const NewRenderPipelineStateWithReflectionCompletionHandler = *Block(fn (*anyopaque, *RenderPipelineState, *RenderPipelineReflection, *ns.Error) callconv(.C) void); -pub const NewComputePipelineStateCompletionHandler = *Block(fn (*anyopaque, *ComputePipelineState, *ns.Error) callconv(.C) void); -pub const NewComputePipelineStateWithReflectionCompletionHandler = *Block(fn (*anyopaque, *ComputePipelineState, *ComputePipelineReflection, *ns.Error) callconv(.C) void); pub const AutoreleasedComputePipelineReflection = *ComputePipelineReflection; pub const AutoreleasedRenderPipelineReflection = *RenderPipelineReflection; pub const Timestamp = u64; -// MTLIOCommandBuffer.hpp -pub const IOCommandBufferHandler = *Block(fn (*anyopaque, *IOCommandBuffer) callconv(.C) void); - -// MTLDrawable.hpp -pub const DrawablePresentedHandler = *Block(fn (*anyopaque, *Drawable) callconv(.C) void); - -// MTLEvent.hpp -pub const SharedEventNotificationBlock = *Block(fn (*anyopaque, *SharedEvent, u64) callconv(.C) void); - // MTLLibrary.hpp pub const AutoreleasedArgument = *Argument; @@ -291,5 +236,4 @@ pub const SizeAndAlign = extern struct { size: ns.UInteger, @"align": ns.UInteger, }; - // ------------------------------------------------------------------------------------------------ diff --git a/src/foundation/ns.zig b/src/foundation/ns.zig index c79812d8..e21d4d85 100644 --- a/src/foundation/ns.zig +++ b/src/foundation/ns.zig @@ -11,6 +11,27 @@ pub const TimeInterval = f64; pub const UInteger = usize; pub const unichar = u16; +// ------------------------------------------------------------------------------------------------ +// Blocks + +extern const _NSConcreteStackBlock: *anyopaque; + +pub const BlockDescriptor = extern struct { + reserved: c_ulong, + size: c_ulong, +}; + +pub fn BlockLiteral(comptime Context: type) type { + return extern struct { + isa: *anyopaque, + flags: c_int, + reserved: c_int, + invoke: *const fn () callconv(.C) void, + descriptor: *const BlockDescriptor, + context: Context, + }; +} + // ------------------------------------------------------------------------------------------------ // Enumerations diff --git a/src/metal/mtl.zig b/src/metal/mtl.zig index 7e7e7009..d66a5a3a 100644 --- a/src/metal/mtl.zig +++ b/src/metal/mtl.zig @@ -9,77 +9,22 @@ pub const dispatch_data_t = *opaque {}; pub const dispatch_queue_t = *opaque {}; pub const IOSurfaceRef = *opaque {}; -// ------------------------------------------------------------------------------------------------ -// Blocks - +// TODO - can we use definition in ns extern const _NSConcreteStackBlock: *anyopaque; -extern fn _Block_copy(block: *const anyopaque) callconv(.C) *anyopaque; -extern fn _Block_release(block: *const anyopaque) callconv(.C) void; - -const BlockDescriptor = extern struct { - reserved: c_ulong, - size: c_ulong, -}; - -const BlockLiteral = extern struct { - isa: *anyopaque, - flags: c_int, - reserved: c_int, - invoke: *const fn () callconv(.C) void, - descriptor: *const BlockDescriptor, -}; - -const block_descriptor = BlockDescriptor{ .reserved = 0, .size = @sizeOf(BlockLiteral) }; - -// TODO - variable capture -pub fn Block(comptime FuncType: type) type { - return opaque { - const Self = @This(); - - pub fn init(comptime invoke: FuncType) *Self { - const block = BlockLiteral{ - .isa = _NSConcreteStackBlock, - .flags = 0, - .reserved = 0, - .invoke = @as(*const fn () callconv(.C) void, @ptrCast(invoke)), - .descriptor = &block_descriptor, - }; - return _Block_copy(&block); - } - }; -} // ------------------------------------------------------------------------------------------------ // Types -// MTLCommandBuffer.hpp -pub const CommandBufferHandler = *Block(*const fn (*anyopaque, *CommandBuffer) callconv(.C) void); - // MTLCounters.hpp pub const CommonCounter = *ns.String; pub const CommonCounterSet = *ns.String; // MTLDevice.hpp pub const DeviceNotificationName = *ns.String; -pub const DeviceNotificationHandlerBlock = *Block(fn (*anyopaque, *Device, DeviceNotificationName) callconv(.C) void); -pub const NewLibraryCompletionHandler = *Block(fn (*anyopaque, *Library, *ns.Error) callconv(.C) void); -pub const NewRenderPipelineStateCompletionHandler = *Block(fn (*anyopaque, *RenderPipelineState, *ns.Error) callconv(.C) void); -pub const NewRenderPipelineStateWithReflectionCompletionHandler = *Block(fn (*anyopaque, *RenderPipelineState, *RenderPipelineReflection, *ns.Error) callconv(.C) void); -pub const NewComputePipelineStateCompletionHandler = *Block(fn (*anyopaque, *ComputePipelineState, *ns.Error) callconv(.C) void); -pub const NewComputePipelineStateWithReflectionCompletionHandler = *Block(fn (*anyopaque, *ComputePipelineState, *ComputePipelineReflection, *ns.Error) callconv(.C) void); pub const AutoreleasedComputePipelineReflection = *ComputePipelineReflection; pub const AutoreleasedRenderPipelineReflection = *RenderPipelineReflection; pub const Timestamp = u64; -// MTLIOCommandBuffer.hpp -pub const IOCommandBufferHandler = *Block(fn (*anyopaque, *IOCommandBuffer) callconv(.C) void); - -// MTLDrawable.hpp -pub const DrawablePresentedHandler = *Block(fn (*anyopaque, *Drawable) callconv(.C) void); - -// MTLEvent.hpp -pub const SharedEventNotificationBlock = *Block(fn (*anyopaque, *SharedEvent, u64) callconv(.C) void); - // MTLLibrary.hpp pub const AutoreleasedArgument = *Argument; @@ -1323,12 +1268,12 @@ pub const PrimitiveAccelerationStructureDescriptor = opaque { pub fn descriptor() *T { return @as(*const fn (*c.objc_class, *c.objc_selector) callconv(.C) *T, @ptrCast(&c.objc_msgSend))(T.class(), sel_descriptor); } - // pub fn geometryDescriptors(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_geometryDescriptors); - // } - // pub fn setGeometryDescriptors(self_: *T, geometryDescriptors_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setGeometryDescriptors_, geometryDescriptors_); - // } + pub fn geometryDescriptors(self_: *T) ?*ns.Array(*AccelerationStructureGeometryDescriptor) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*AccelerationStructureGeometryDescriptor), @ptrCast(&c.objc_msgSend))(self_, sel_geometryDescriptors); + } + pub fn setGeometryDescriptors(self_: *T, geometryDescriptors_: ?*ns.Array(*AccelerationStructureGeometryDescriptor)) void { + return @as(*const fn (*T, *c.objc_selector, ?*ns.Array(*AccelerationStructureGeometryDescriptor)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setGeometryDescriptors_, geometryDescriptors_); + } pub fn motionStartBorderMode(self_: *T) MotionBorderMode { return @as(*const fn (*T, *c.objc_selector) callconv(.C) MotionBorderMode, @ptrCast(&c.objc_msgSend))(self_, sel_motionStartBorderMode); } @@ -1523,12 +1468,12 @@ pub const AccelerationStructureMotionTriangleGeometryDescriptor = opaque { pub fn descriptor() *T { return @as(*const fn (*c.objc_class, *c.objc_selector) callconv(.C) *T, @ptrCast(&c.objc_msgSend))(T.class(), sel_descriptor); } - // pub fn vertexBuffers(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_vertexBuffers); - // } - // pub fn setVertexBuffers(self_: *T, vertexBuffers_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setVertexBuffers_, vertexBuffers_); - // } + pub fn vertexBuffers(self_: *T) *ns.Array(*MotionKeyframeData) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*MotionKeyframeData), @ptrCast(&c.objc_msgSend))(self_, sel_vertexBuffers); + } + pub fn setVertexBuffers(self_: *T, vertexBuffers_: *ns.Array(*MotionKeyframeData)) void { + return @as(*const fn (*T, *c.objc_selector, *ns.Array(*MotionKeyframeData)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setVertexBuffers_, vertexBuffers_); + } pub fn vertexFormat(self_: *T) AttributeFormat { return @as(*const fn (*T, *c.objc_selector) callconv(.C) AttributeFormat, @ptrCast(&c.objc_msgSend))(self_, sel_vertexFormat); } @@ -1594,12 +1539,12 @@ pub const AccelerationStructureMotionBoundingBoxGeometryDescriptor = opaque { pub fn descriptor() *T { return @as(*const fn (*c.objc_class, *c.objc_selector) callconv(.C) *T, @ptrCast(&c.objc_msgSend))(T.class(), sel_descriptor); } - // pub fn boundingBoxBuffers(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_boundingBoxBuffers); - // } - // pub fn setBoundingBoxBuffers(self_: *T, boundingBoxBuffers_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setBoundingBoxBuffers_, boundingBoxBuffers_); - // } + pub fn boundingBoxBuffers(self_: *T) *ns.Array(*MotionKeyframeData) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*MotionKeyframeData), @ptrCast(&c.objc_msgSend))(self_, sel_boundingBoxBuffers); + } + pub fn setBoundingBoxBuffers(self_: *T, boundingBoxBuffers_: *ns.Array(*MotionKeyframeData)) void { + return @as(*const fn (*T, *c.objc_selector, *ns.Array(*MotionKeyframeData)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setBoundingBoxBuffers_, boundingBoxBuffers_); + } pub fn boundingBoxStride(self_: *T) ns.UInteger { return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.UInteger, @ptrCast(&c.objc_msgSend))(self_, sel_boundingBoxStride); } @@ -1653,12 +1598,12 @@ pub const InstanceAccelerationStructureDescriptor = opaque { pub fn setInstanceCount(self_: *T, instanceCount_: ns.UInteger) void { return @as(*const fn (*T, *c.objc_selector, ns.UInteger) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setInstanceCount_, instanceCount_); } - // pub fn instancedAccelerationStructures(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_instancedAccelerationStructures); - // } - // pub fn setInstancedAccelerationStructures(self_: *T, instancedAccelerationStructures_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setInstancedAccelerationStructures_, instancedAccelerationStructures_); - // } + pub fn instancedAccelerationStructures(self_: *T) ?*ns.Array(*AccelerationStructure) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*AccelerationStructure), @ptrCast(&c.objc_msgSend))(self_, sel_instancedAccelerationStructures); + } + pub fn setInstancedAccelerationStructures(self_: *T, instancedAccelerationStructures_: ?*ns.Array(*AccelerationStructure)) void { + return @as(*const fn (*T, *c.objc_selector, ?*ns.Array(*AccelerationStructure)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setInstancedAccelerationStructures_, instancedAccelerationStructures_); + } pub fn instanceDescriptorType(self_: *T) AccelerationStructureInstanceDescriptorType { return @as(*const fn (*T, *c.objc_selector) callconv(.C) AccelerationStructureInstanceDescriptorType, @ptrCast(&c.objc_msgSend))(self_, sel_instanceDescriptorType); } @@ -1899,9 +1844,9 @@ pub const StructType = opaque { pub fn memberByName(self_: *T, name_: *ns.String) ?*StructMember { return @as(*const fn (*T, *c.objc_selector, *ns.String) callconv(.C) ?*StructMember, @ptrCast(&c.objc_msgSend))(self_, sel_memberByName_, name_); } - // pub fn members(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_members); - // } + pub fn members(self_: *T) *ns.Array(*StructMember) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*StructMember), @ptrCast(&c.objc_msgSend))(self_, sel_members); + } }; } }; @@ -2568,9 +2513,6 @@ pub const CaptureManager = opaque { pub fn sharedCaptureManager() *CaptureManager { return @as(*const fn (*c.objc_class, *c.objc_selector) callconv(.C) *CaptureManager, @ptrCast(&c.objc_msgSend))(T.class(), sel_sharedCaptureManager); } - // pub fn init(self_: *T) *T { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) *T, @ptrCast(&c.objc_msgSend))(self_, sel_init); - // } pub fn newCaptureScopeWithDevice(self_: *T, device_: *Device) *CaptureScope { return @as(*const fn (*T, *c.objc_selector, *Device) callconv(.C) *CaptureScope, @ptrCast(&c.objc_msgSend))(self_, sel_newCaptureScopeWithDevice_, device_); } @@ -2674,9 +2616,9 @@ pub const CommandBufferEncoderInfo = opaque { pub fn label(self_: *T) *ns.String { return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.String, @ptrCast(&c.objc_msgSend))(self_, sel_label); } - // pub fn debugSignposts(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_debugSignposts); - // } + pub fn debugSignposts(self_: *T) *ns.Array(*ns.String) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*ns.String), @ptrCast(&c.objc_msgSend))(self_, sel_debugSignposts); + } pub fn errorState(self_: *T) CommandEncoderErrorState { return @as(*const fn (*T, *c.objc_selector) callconv(.C) CommandEncoderErrorState, @ptrCast(&c.objc_msgSend))(self_, sel_errorState); } @@ -2697,8 +2639,16 @@ pub const CommandBuffer = opaque { pub fn commit(self_: *T) void { return @as(*const fn (*T, *c.objc_selector) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_commit); } - pub fn addScheduledHandler(self_: *T, block_: CommandBufferHandler) void { - return @as(*const fn (*T, *c.objc_selector, CommandBufferHandler) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_addScheduledHandler_, block_); + pub fn addScheduledHandler(self_: *T, context: anytype, comptime block_: fn (ctx: @TypeOf(context), _: *CommandBuffer) void) void { + const Literal = ns.BlockLiteral(@TypeOf(context)); + const Helper = struct { + pub fn cCallback(literal: *Literal, a0: *CommandBuffer) callconv(.C) void { + block_(literal.context, a0); + } + }; + const descriptor = ns.BlockDescriptor{ .reserved = 0, .size = @sizeOf(Literal) }; + const block = Literal{ .isa = _NSConcreteStackBlock, .flags = 0, .reserved = 0, .invoke = @ptrCast(&Helper.cCallback), .descriptor = &descriptor, .context = context }; + return @as(*const fn (*T, *c.objc_selector, *const anyopaque) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_addScheduledHandler_, @ptrCast(&block)); } pub fn presentDrawable(self_: *T, drawable_: *Drawable) void { return @as(*const fn (*T, *c.objc_selector, *Drawable) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_presentDrawable_, drawable_); @@ -2712,8 +2662,16 @@ pub const CommandBuffer = opaque { pub fn waitUntilScheduled(self_: *T) void { return @as(*const fn (*T, *c.objc_selector) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_waitUntilScheduled); } - pub fn addCompletedHandler(self_: *T, block_: CommandBufferHandler) void { - return @as(*const fn (*T, *c.objc_selector, CommandBufferHandler) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_addCompletedHandler_, block_); + pub fn addCompletedHandler(self_: *T, context: anytype, comptime block_: fn (ctx: @TypeOf(context), _: *CommandBuffer) void) void { + const Literal = ns.BlockLiteral(@TypeOf(context)); + const Helper = struct { + pub fn cCallback(literal: *Literal, a0: *CommandBuffer) callconv(.C) void { + block_(literal.context, a0); + } + }; + const descriptor = ns.BlockDescriptor{ .reserved = 0, .size = @sizeOf(Literal) }; + const block = Literal{ .isa = _NSConcreteStackBlock, .flags = 0, .reserved = 0, .invoke = @ptrCast(&Helper.cCallback), .descriptor = &descriptor, .context = context }; + return @as(*const fn (*T, *c.objc_selector, *const anyopaque) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_addCompletedHandler_, @ptrCast(&block)); } pub fn waitUntilCompleted(self_: *T) void { return @as(*const fn (*T, *c.objc_selector) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_waitUntilCompleted); @@ -3076,12 +3034,12 @@ pub const ComputePipelineReflection = opaque { return struct { pub usingnamespace ns.ObjectInterface.Methods(T); - // pub fn bindings(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_bindings); - // } - // pub fn arguments(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_arguments); - // } + pub fn bindings(self_: *T) *ns.Array(*Binding) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*Binding), @ptrCast(&c.objc_msgSend))(self_, sel_bindings); + } + pub fn arguments(self_: *T) *ns.Array(*Argument) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*Argument), @ptrCast(&c.objc_msgSend))(self_, sel_arguments); + } }; } }; @@ -3139,24 +3097,24 @@ pub const ComputePipelineDescriptor = opaque { pub fn setSupportIndirectCommandBuffers(self_: *T, supportIndirectCommandBuffers_: bool) void { return @as(*const fn (*T, *c.objc_selector, bool) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setSupportIndirectCommandBuffers_, supportIndirectCommandBuffers_); } - // pub fn insertLibraries(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_insertLibraries); - // } - // pub fn setInsertLibraries(self_: *T, insertLibraries_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setInsertLibraries_, insertLibraries_); - // } - // pub fn preloadedLibraries(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_preloadedLibraries); - // } - // pub fn setPreloadedLibraries(self_: *T, preloadedLibraries_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setPreloadedLibraries_, preloadedLibraries_); - // } - // pub fn binaryArchives(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_binaryArchives); - // } - // pub fn setBinaryArchives(self_: *T, binaryArchives_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setBinaryArchives_, binaryArchives_); - // } + pub fn insertLibraries(self_: *T) ?*ns.Array(*DynamicLibrary) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*DynamicLibrary), @ptrCast(&c.objc_msgSend))(self_, sel_insertLibraries); + } + pub fn setInsertLibraries(self_: *T, insertLibraries_: ?*ns.Array(*DynamicLibrary)) void { + return @as(*const fn (*T, *c.objc_selector, ?*ns.Array(*DynamicLibrary)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setInsertLibraries_, insertLibraries_); + } + pub fn preloadedLibraries(self_: *T) *ns.Array(*DynamicLibrary) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*DynamicLibrary), @ptrCast(&c.objc_msgSend))(self_, sel_preloadedLibraries); + } + pub fn setPreloadedLibraries(self_: *T, preloadedLibraries_: *ns.Array(*DynamicLibrary)) void { + return @as(*const fn (*T, *c.objc_selector, *ns.Array(*DynamicLibrary)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setPreloadedLibraries_, preloadedLibraries_); + } + pub fn binaryArchives(self_: *T) ?*ns.Array(*BinaryArchive) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*BinaryArchive), @ptrCast(&c.objc_msgSend))(self_, sel_binaryArchives); + } + pub fn setBinaryArchives(self_: *T, binaryArchives_: ?*ns.Array(*BinaryArchive)) void { + return @as(*const fn (*T, *c.objc_selector, ?*ns.Array(*BinaryArchive)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setBinaryArchives_, binaryArchives_); + } pub fn linkedFunctions(self_: *T) ?*LinkedFunctions { return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*LinkedFunctions, @ptrCast(&c.objc_msgSend))(self_, sel_linkedFunctions); } @@ -3192,9 +3150,9 @@ pub const ComputePipelineState = opaque { pub fn functionHandleWithFunction(self_: *T, function_: *Function) ?*FunctionHandle { return @as(*const fn (*T, *c.objc_selector, *Function) callconv(.C) ?*FunctionHandle, @ptrCast(&c.objc_msgSend))(self_, sel_functionHandleWithFunction_, function_); } - // pub fn newComputePipelineStateWithAdditionalBinaryFunctions_error(self_: *T, functions_: ns.Array, error_: ?*?*ns.Error) ?*ComputePipelineState { - // return @as(*const fn (*T, *c.objc_selector, ns.Array, ?*?*ns.Error) callconv(.C) ?*ComputePipelineState, @ptrCast(&c.objc_msgSend))(self_, sel_newComputePipelineStateWithAdditionalBinaryFunctions_error_, functions_, error_); - // } + pub fn newComputePipelineStateWithAdditionalBinaryFunctions_error(self_: *T, functions_: *ns.Array(*Function), error_: ?*?*ns.Error) ?*ComputePipelineState { + return @as(*const fn (*T, *c.objc_selector, *ns.Array(*Function), ?*?*ns.Error) callconv(.C) ?*ComputePipelineState, @ptrCast(&c.objc_msgSend))(self_, sel_newComputePipelineStateWithAdditionalBinaryFunctions_error_, functions_, error_); + } pub fn newVisibleFunctionTableWithDescriptor(self_: *T, descriptor_: *VisibleFunctionTableDescriptor) ?*VisibleFunctionTable { return @as(*const fn (*T, *c.objc_selector, *VisibleFunctionTableDescriptor) callconv(.C) ?*VisibleFunctionTable, @ptrCast(&c.objc_msgSend))(self_, sel_newVisibleFunctionTableWithDescriptor_, descriptor_); } @@ -3250,9 +3208,9 @@ pub const CounterSet = opaque { pub fn name(self_: *T) *ns.String { return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.String, @ptrCast(&c.objc_msgSend))(self_, sel_name); } - // pub fn counters(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_counters); - // } + pub fn counters(self_: *T) *ns.Array(*Counter) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*Counter), @ptrCast(&c.objc_msgSend))(self_, sel_counters); + } }; } }; @@ -3514,9 +3472,17 @@ pub const Device = opaque { pub fn newBufferWithBytes_length_options(self_: *T, pointer_: *const anyopaque, length_: ns.UInteger, options_: ResourceOptions) ?*Buffer { return @as(*const fn (*T, *c.objc_selector, *const anyopaque, ns.UInteger, ResourceOptions) callconv(.C) ?*Buffer, @ptrCast(&c.objc_msgSend))(self_, sel_newBufferWithBytes_length_options_, pointer_, length_, options_); } - // pub fn newBufferWithBytesNoCopy_length_options_deallocator(self_: *T, pointer_: *anyopaque, length_: ns.UInteger, options_: ResourceOptions, deallocator_: void) ?*Buffer { - // return @as(*const fn (*T, *c.objc_selector, *anyopaque, ns.UInteger, ResourceOptions, void) callconv(.C) ?*Buffer, @ptrCast(&c.objc_msgSend))(self_, sel_newBufferWithBytesNoCopy_length_options_deallocator_, pointer_, length_, options_, deallocator_); - // } + pub fn newBufferWithBytesNoCopy_length_options_deallocator(self_: *T, pointer_: *anyopaque, length_: ns.UInteger, options_: ResourceOptions, context: anytype, comptime deallocator_: fn (ctx: @TypeOf(context), _: *anyopaque, _: ns.UInteger) void) ?*Buffer { + const Literal = ns.BlockLiteral(@TypeOf(context)); + const Helper = struct { + pub fn cCallback(literal: *Literal, a0: *anyopaque, a1: ns.UInteger) callconv(.C) void { + deallocator_(literal.context, a0, a1); + } + }; + const descriptor = ns.BlockDescriptor{ .reserved = 0, .size = @sizeOf(Literal) }; + const block = Literal{ .isa = _NSConcreteStackBlock, .flags = 0, .reserved = 0, .invoke = @ptrCast(&Helper.cCallback), .descriptor = &descriptor, .context = context }; + return @as(*const fn (*T, *c.objc_selector, *anyopaque, ns.UInteger, ResourceOptions, *const anyopaque) callconv(.C) ?*Buffer, @ptrCast(&c.objc_msgSend))(self_, sel_newBufferWithBytesNoCopy_length_options_deallocator_, pointer_, length_, options_, @ptrCast(&block)); + } pub fn newDepthStencilStateWithDescriptor(self_: *T, descriptor_: *DepthStencilDescriptor) ?*DepthStencilState { return @as(*const fn (*T, *c.objc_selector, *DepthStencilDescriptor) callconv(.C) ?*DepthStencilState, @ptrCast(&c.objc_msgSend))(self_, sel_newDepthStencilStateWithDescriptor_, descriptor_); } @@ -3553,14 +3519,30 @@ pub const Device = opaque { pub fn newLibraryWithSource_options_error(self_: *T, source_: *ns.String, options_: ?*CompileOptions, error_: ?*?*ns.Error) ?*Library { return @as(*const fn (*T, *c.objc_selector, *ns.String, ?*CompileOptions, ?*?*ns.Error) callconv(.C) ?*Library, @ptrCast(&c.objc_msgSend))(self_, sel_newLibraryWithSource_options_error_, source_, options_, error_); } - pub fn newLibraryWithSource_options_completionHandler(self_: *T, source_: *ns.String, options_: ?*CompileOptions, completionHandler_: NewLibraryCompletionHandler) void { - return @as(*const fn (*T, *c.objc_selector, *ns.String, ?*CompileOptions, NewLibraryCompletionHandler) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newLibraryWithSource_options_completionHandler_, source_, options_, completionHandler_); + pub fn newLibraryWithSource_options_completionHandler(self_: *T, source_: *ns.String, options_: ?*CompileOptions, context: anytype, comptime completionHandler_: fn (ctx: @TypeOf(context), _: ?*Library, _: ?*ns.Error) void) void { + const Literal = ns.BlockLiteral(@TypeOf(context)); + const Helper = struct { + pub fn cCallback(literal: *Literal, a0: ?*Library, a1: ?*ns.Error) callconv(.C) void { + completionHandler_(literal.context, a0, a1); + } + }; + const descriptor = ns.BlockDescriptor{ .reserved = 0, .size = @sizeOf(Literal) }; + const block = Literal{ .isa = _NSConcreteStackBlock, .flags = 0, .reserved = 0, .invoke = @ptrCast(&Helper.cCallback), .descriptor = &descriptor, .context = context }; + return @as(*const fn (*T, *c.objc_selector, *ns.String, ?*CompileOptions, *const anyopaque) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newLibraryWithSource_options_completionHandler_, source_, options_, @ptrCast(&block)); } pub fn newLibraryWithStitchedDescriptor_error(self_: *T, descriptor_: *StitchedLibraryDescriptor, error_: ?*?*ns.Error) ?*Library { return @as(*const fn (*T, *c.objc_selector, *StitchedLibraryDescriptor, ?*?*ns.Error) callconv(.C) ?*Library, @ptrCast(&c.objc_msgSend))(self_, sel_newLibraryWithStitchedDescriptor_error_, descriptor_, error_); } - pub fn newLibraryWithStitchedDescriptor_completionHandler(self_: *T, descriptor_: *StitchedLibraryDescriptor, completionHandler_: NewLibraryCompletionHandler) void { - return @as(*const fn (*T, *c.objc_selector, *StitchedLibraryDescriptor, NewLibraryCompletionHandler) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newLibraryWithStitchedDescriptor_completionHandler_, descriptor_, completionHandler_); + pub fn newLibraryWithStitchedDescriptor_completionHandler(self_: *T, descriptor_: *StitchedLibraryDescriptor, context: anytype, comptime completionHandler_: fn (ctx: @TypeOf(context), _: ?*Library, _: ?*ns.Error) void) void { + const Literal = ns.BlockLiteral(@TypeOf(context)); + const Helper = struct { + pub fn cCallback(literal: *Literal, a0: ?*Library, a1: ?*ns.Error) callconv(.C) void { + completionHandler_(literal.context, a0, a1); + } + }; + const descriptor = ns.BlockDescriptor{ .reserved = 0, .size = @sizeOf(Literal) }; + const block = Literal{ .isa = _NSConcreteStackBlock, .flags = 0, .reserved = 0, .invoke = @ptrCast(&Helper.cCallback), .descriptor = &descriptor, .context = context }; + return @as(*const fn (*T, *c.objc_selector, *StitchedLibraryDescriptor, *const anyopaque) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newLibraryWithStitchedDescriptor_completionHandler_, descriptor_, @ptrCast(&block)); } pub fn newRenderPipelineStateWithDescriptor_error(self_: *T, descriptor_: *RenderPipelineDescriptor, error_: ?*?*ns.Error) ?*RenderPipelineState { return @as(*const fn (*T, *c.objc_selector, *RenderPipelineDescriptor, ?*?*ns.Error) callconv(.C) ?*RenderPipelineState, @ptrCast(&c.objc_msgSend))(self_, sel_newRenderPipelineStateWithDescriptor_error_, descriptor_, error_); @@ -3568,11 +3550,27 @@ pub const Device = opaque { pub fn newRenderPipelineStateWithDescriptor_options_reflection_error(self_: *T, descriptor_: *RenderPipelineDescriptor, options_: PipelineOption, reflection_: ?*AutoreleasedRenderPipelineReflection, error_: ?*?*ns.Error) ?*RenderPipelineState { return @as(*const fn (*T, *c.objc_selector, *RenderPipelineDescriptor, PipelineOption, ?*AutoreleasedRenderPipelineReflection, ?*?*ns.Error) callconv(.C) ?*RenderPipelineState, @ptrCast(&c.objc_msgSend))(self_, sel_newRenderPipelineStateWithDescriptor_options_reflection_error_, descriptor_, options_, reflection_, error_); } - pub fn newRenderPipelineStateWithDescriptor_completionHandler(self_: *T, descriptor_: *RenderPipelineDescriptor, completionHandler_: NewRenderPipelineStateCompletionHandler) void { - return @as(*const fn (*T, *c.objc_selector, *RenderPipelineDescriptor, NewRenderPipelineStateCompletionHandler) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newRenderPipelineStateWithDescriptor_completionHandler_, descriptor_, completionHandler_); - } - pub fn newRenderPipelineStateWithDescriptor_options_completionHandler(self_: *T, descriptor_: *RenderPipelineDescriptor, options_: PipelineOption, completionHandler_: NewRenderPipelineStateWithReflectionCompletionHandler) void { - return @as(*const fn (*T, *c.objc_selector, *RenderPipelineDescriptor, PipelineOption, NewRenderPipelineStateWithReflectionCompletionHandler) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newRenderPipelineStateWithDescriptor_options_completionHandler_, descriptor_, options_, completionHandler_); + pub fn newRenderPipelineStateWithDescriptor_completionHandler(self_: *T, descriptor_: *RenderPipelineDescriptor, context: anytype, comptime completionHandler_: fn (ctx: @TypeOf(context), _: ?*RenderPipelineState, _: ?*ns.Error) void) void { + const Literal = ns.BlockLiteral(@TypeOf(context)); + const Helper = struct { + pub fn cCallback(literal: *Literal, a0: ?*RenderPipelineState, a1: ?*ns.Error) callconv(.C) void { + completionHandler_(literal.context, a0, a1); + } + }; + const descriptor = ns.BlockDescriptor{ .reserved = 0, .size = @sizeOf(Literal) }; + const block = Literal{ .isa = _NSConcreteStackBlock, .flags = 0, .reserved = 0, .invoke = @ptrCast(&Helper.cCallback), .descriptor = &descriptor, .context = context }; + return @as(*const fn (*T, *c.objc_selector, *RenderPipelineDescriptor, *const anyopaque) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newRenderPipelineStateWithDescriptor_completionHandler_, descriptor_, @ptrCast(&block)); + } + pub fn newRenderPipelineStateWithDescriptor_options_completionHandler(self_: *T, descriptor_: *RenderPipelineDescriptor, options_: PipelineOption, context: anytype, comptime completionHandler_: fn (ctx: @TypeOf(context), _: ?*RenderPipelineState, _: *RenderPipelineReflection, _: ?*ns.Error) void) void { + const Literal = ns.BlockLiteral(@TypeOf(context)); + const Helper = struct { + pub fn cCallback(literal: *Literal, a0: ?*RenderPipelineState, a1: *RenderPipelineReflection, a2: ?*ns.Error) callconv(.C) void { + completionHandler_(literal.context, a0, a1, a2); + } + }; + const descriptor = ns.BlockDescriptor{ .reserved = 0, .size = @sizeOf(Literal) }; + const block = Literal{ .isa = _NSConcreteStackBlock, .flags = 0, .reserved = 0, .invoke = @ptrCast(&Helper.cCallback), .descriptor = &descriptor, .context = context }; + return @as(*const fn (*T, *c.objc_selector, *RenderPipelineDescriptor, PipelineOption, *const anyopaque) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newRenderPipelineStateWithDescriptor_options_completionHandler_, descriptor_, options_, @ptrCast(&block)); } pub fn newComputePipelineStateWithFunction_error(self_: *T, computeFunction_: *Function, error_: ?*?*ns.Error) ?*ComputePipelineState { return @as(*const fn (*T, *c.objc_selector, *Function, ?*?*ns.Error) callconv(.C) ?*ComputePipelineState, @ptrCast(&c.objc_msgSend))(self_, sel_newComputePipelineStateWithFunction_error_, computeFunction_, error_); @@ -3580,17 +3578,41 @@ pub const Device = opaque { pub fn newComputePipelineStateWithFunction_options_reflection_error(self_: *T, computeFunction_: *Function, options_: PipelineOption, reflection_: ?*AutoreleasedComputePipelineReflection, error_: ?*?*ns.Error) ?*ComputePipelineState { return @as(*const fn (*T, *c.objc_selector, *Function, PipelineOption, ?*AutoreleasedComputePipelineReflection, ?*?*ns.Error) callconv(.C) ?*ComputePipelineState, @ptrCast(&c.objc_msgSend))(self_, sel_newComputePipelineStateWithFunction_options_reflection_error_, computeFunction_, options_, reflection_, error_); } - pub fn newComputePipelineStateWithFunction_completionHandler(self_: *T, computeFunction_: *Function, completionHandler_: NewComputePipelineStateCompletionHandler) void { - return @as(*const fn (*T, *c.objc_selector, *Function, NewComputePipelineStateCompletionHandler) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newComputePipelineStateWithFunction_completionHandler_, computeFunction_, completionHandler_); - } - pub fn newComputePipelineStateWithFunction_options_completionHandler(self_: *T, computeFunction_: *Function, options_: PipelineOption, completionHandler_: NewComputePipelineStateWithReflectionCompletionHandler) void { - return @as(*const fn (*T, *c.objc_selector, *Function, PipelineOption, NewComputePipelineStateWithReflectionCompletionHandler) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newComputePipelineStateWithFunction_options_completionHandler_, computeFunction_, options_, completionHandler_); + pub fn newComputePipelineStateWithFunction_completionHandler(self_: *T, computeFunction_: *Function, context: anytype, comptime completionHandler_: fn (ctx: @TypeOf(context), _: ?*ComputePipelineState, _: ?*ns.Error) void) void { + const Literal = ns.BlockLiteral(@TypeOf(context)); + const Helper = struct { + pub fn cCallback(literal: *Literal, a0: ?*ComputePipelineState, a1: ?*ns.Error) callconv(.C) void { + completionHandler_(literal.context, a0, a1); + } + }; + const descriptor = ns.BlockDescriptor{ .reserved = 0, .size = @sizeOf(Literal) }; + const block = Literal{ .isa = _NSConcreteStackBlock, .flags = 0, .reserved = 0, .invoke = @ptrCast(&Helper.cCallback), .descriptor = &descriptor, .context = context }; + return @as(*const fn (*T, *c.objc_selector, *Function, *const anyopaque) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newComputePipelineStateWithFunction_completionHandler_, computeFunction_, @ptrCast(&block)); + } + pub fn newComputePipelineStateWithFunction_options_completionHandler(self_: *T, computeFunction_: *Function, options_: PipelineOption, context: anytype, comptime completionHandler_: fn (ctx: @TypeOf(context), _: ?*ComputePipelineState, _: *ComputePipelineReflection, _: ?*ns.Error) void) void { + const Literal = ns.BlockLiteral(@TypeOf(context)); + const Helper = struct { + pub fn cCallback(literal: *Literal, a0: ?*ComputePipelineState, a1: *ComputePipelineReflection, a2: ?*ns.Error) callconv(.C) void { + completionHandler_(literal.context, a0, a1, a2); + } + }; + const descriptor = ns.BlockDescriptor{ .reserved = 0, .size = @sizeOf(Literal) }; + const block = Literal{ .isa = _NSConcreteStackBlock, .flags = 0, .reserved = 0, .invoke = @ptrCast(&Helper.cCallback), .descriptor = &descriptor, .context = context }; + return @as(*const fn (*T, *c.objc_selector, *Function, PipelineOption, *const anyopaque) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newComputePipelineStateWithFunction_options_completionHandler_, computeFunction_, options_, @ptrCast(&block)); } pub fn newComputePipelineStateWithDescriptor_options_reflection_error(self_: *T, descriptor_: *ComputePipelineDescriptor, options_: PipelineOption, reflection_: ?*AutoreleasedComputePipelineReflection, error_: ?*?*ns.Error) ?*ComputePipelineState { return @as(*const fn (*T, *c.objc_selector, *ComputePipelineDescriptor, PipelineOption, ?*AutoreleasedComputePipelineReflection, ?*?*ns.Error) callconv(.C) ?*ComputePipelineState, @ptrCast(&c.objc_msgSend))(self_, sel_newComputePipelineStateWithDescriptor_options_reflection_error_, descriptor_, options_, reflection_, error_); } - pub fn newComputePipelineStateWithDescriptor_options_completionHandler(self_: *T, descriptor_: *ComputePipelineDescriptor, options_: PipelineOption, completionHandler_: NewComputePipelineStateWithReflectionCompletionHandler) void { - return @as(*const fn (*T, *c.objc_selector, *ComputePipelineDescriptor, PipelineOption, NewComputePipelineStateWithReflectionCompletionHandler) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newComputePipelineStateWithDescriptor_options_completionHandler_, descriptor_, options_, completionHandler_); + pub fn newComputePipelineStateWithDescriptor_options_completionHandler(self_: *T, descriptor_: *ComputePipelineDescriptor, options_: PipelineOption, context: anytype, comptime completionHandler_: fn (ctx: @TypeOf(context), _: ?*ComputePipelineState, _: *ComputePipelineReflection, _: ?*ns.Error) void) void { + const Literal = ns.BlockLiteral(@TypeOf(context)); + const Helper = struct { + pub fn cCallback(literal: *Literal, a0: ?*ComputePipelineState, a1: *ComputePipelineReflection, a2: ?*ns.Error) callconv(.C) void { + completionHandler_(literal.context, a0, a1, a2); + } + }; + const descriptor = ns.BlockDescriptor{ .reserved = 0, .size = @sizeOf(Literal) }; + const block = Literal{ .isa = _NSConcreteStackBlock, .flags = 0, .reserved = 0, .invoke = @ptrCast(&Helper.cCallback), .descriptor = &descriptor, .context = context }; + return @as(*const fn (*T, *c.objc_selector, *ComputePipelineDescriptor, PipelineOption, *const anyopaque) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newComputePipelineStateWithDescriptor_options_completionHandler_, descriptor_, options_, @ptrCast(&block)); } pub fn newFence(self_: *T) ?*Fence { return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*Fence, @ptrCast(&c.objc_msgSend))(self_, sel_newFence); @@ -3613,21 +3635,37 @@ pub const Device = opaque { pub fn newRenderPipelineStateWithTileDescriptor_options_reflection_error(self_: *T, descriptor_: *TileRenderPipelineDescriptor, options_: PipelineOption, reflection_: ?*AutoreleasedRenderPipelineReflection, error_: ?*?*ns.Error) ?*RenderPipelineState { return @as(*const fn (*T, *c.objc_selector, *TileRenderPipelineDescriptor, PipelineOption, ?*AutoreleasedRenderPipelineReflection, ?*?*ns.Error) callconv(.C) ?*RenderPipelineState, @ptrCast(&c.objc_msgSend))(self_, sel_newRenderPipelineStateWithTileDescriptor_options_reflection_error_, descriptor_, options_, reflection_, error_); } - pub fn newRenderPipelineStateWithTileDescriptor_options_completionHandler(self_: *T, descriptor_: *TileRenderPipelineDescriptor, options_: PipelineOption, completionHandler_: NewRenderPipelineStateWithReflectionCompletionHandler) void { - return @as(*const fn (*T, *c.objc_selector, *TileRenderPipelineDescriptor, PipelineOption, NewRenderPipelineStateWithReflectionCompletionHandler) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newRenderPipelineStateWithTileDescriptor_options_completionHandler_, descriptor_, options_, completionHandler_); + pub fn newRenderPipelineStateWithTileDescriptor_options_completionHandler(self_: *T, descriptor_: *TileRenderPipelineDescriptor, options_: PipelineOption, context: anytype, comptime completionHandler_: fn (ctx: @TypeOf(context), _: ?*RenderPipelineState, _: *RenderPipelineReflection, _: ?*ns.Error) void) void { + const Literal = ns.BlockLiteral(@TypeOf(context)); + const Helper = struct { + pub fn cCallback(literal: *Literal, a0: ?*RenderPipelineState, a1: *RenderPipelineReflection, a2: ?*ns.Error) callconv(.C) void { + completionHandler_(literal.context, a0, a1, a2); + } + }; + const descriptor = ns.BlockDescriptor{ .reserved = 0, .size = @sizeOf(Literal) }; + const block = Literal{ .isa = _NSConcreteStackBlock, .flags = 0, .reserved = 0, .invoke = @ptrCast(&Helper.cCallback), .descriptor = &descriptor, .context = context }; + return @as(*const fn (*T, *c.objc_selector, *TileRenderPipelineDescriptor, PipelineOption, *const anyopaque) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newRenderPipelineStateWithTileDescriptor_options_completionHandler_, descriptor_, options_, @ptrCast(&block)); } pub fn newRenderPipelineStateWithMeshDescriptor_options_reflection_error(self_: *T, descriptor_: *MeshRenderPipelineDescriptor, options_: PipelineOption, reflection_: ?*AutoreleasedRenderPipelineReflection, error_: ?*?*ns.Error) ?*RenderPipelineState { return @as(*const fn (*T, *c.objc_selector, *MeshRenderPipelineDescriptor, PipelineOption, ?*AutoreleasedRenderPipelineReflection, ?*?*ns.Error) callconv(.C) ?*RenderPipelineState, @ptrCast(&c.objc_msgSend))(self_, sel_newRenderPipelineStateWithMeshDescriptor_options_reflection_error_, descriptor_, options_, reflection_, error_); } - pub fn newRenderPipelineStateWithMeshDescriptor_options_completionHandler(self_: *T, descriptor_: *MeshRenderPipelineDescriptor, options_: PipelineOption, completionHandler_: NewRenderPipelineStateWithReflectionCompletionHandler) void { - return @as(*const fn (*T, *c.objc_selector, *MeshRenderPipelineDescriptor, PipelineOption, NewRenderPipelineStateWithReflectionCompletionHandler) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newRenderPipelineStateWithMeshDescriptor_options_completionHandler_, descriptor_, options_, completionHandler_); + pub fn newRenderPipelineStateWithMeshDescriptor_options_completionHandler(self_: *T, descriptor_: *MeshRenderPipelineDescriptor, options_: PipelineOption, context: anytype, comptime completionHandler_: fn (ctx: @TypeOf(context), _: ?*RenderPipelineState, _: *RenderPipelineReflection, _: ?*ns.Error) void) void { + const Literal = ns.BlockLiteral(@TypeOf(context)); + const Helper = struct { + pub fn cCallback(literal: *Literal, a0: ?*RenderPipelineState, a1: *RenderPipelineReflection, a2: ?*ns.Error) callconv(.C) void { + completionHandler_(literal.context, a0, a1, a2); + } + }; + const descriptor = ns.BlockDescriptor{ .reserved = 0, .size = @sizeOf(Literal) }; + const block = Literal{ .isa = _NSConcreteStackBlock, .flags = 0, .reserved = 0, .invoke = @ptrCast(&Helper.cCallback), .descriptor = &descriptor, .context = context }; + return @as(*const fn (*T, *c.objc_selector, *MeshRenderPipelineDescriptor, PipelineOption, *const anyopaque) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newRenderPipelineStateWithMeshDescriptor_options_completionHandler_, descriptor_, options_, @ptrCast(&block)); } pub fn getDefaultSamplePositions_count(self_: *T, positions_: *SamplePosition, count_: ns.UInteger) void { return @as(*const fn (*T, *c.objc_selector, *SamplePosition, ns.UInteger) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_getDefaultSamplePositions_count_, positions_, count_); } - // pub fn newArgumentEncoderWithArguments(self_: *T, arguments_: ns.Array) ?*ArgumentEncoder { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) ?*ArgumentEncoder, @ptrCast(&c.objc_msgSend))(self_, sel_newArgumentEncoderWithArguments_, arguments_); - // } + pub fn newArgumentEncoderWithArguments(self_: *T, arguments_: *ns.Array(*ArgumentDescriptor)) ?*ArgumentEncoder { + return @as(*const fn (*T, *c.objc_selector, *ns.Array(*ArgumentDescriptor)) callconv(.C) ?*ArgumentEncoder, @ptrCast(&c.objc_msgSend))(self_, sel_newArgumentEncoderWithArguments_, arguments_); + } pub fn supportsRasterizationRateMapWithLayerCount(self_: *T, layerCount_: ns.UInteger) bool { return @as(*const fn (*T, *c.objc_selector, ns.UInteger) callconv(.C) bool, @ptrCast(&c.objc_msgSend))(self_, sel_supportsRasterizationRateMapWithLayerCount_, layerCount_); } @@ -3802,9 +3840,9 @@ pub const Device = opaque { pub fn maxBufferLength(self_: *T) ns.UInteger { return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.UInteger, @ptrCast(&c.objc_msgSend))(self_, sel_maxBufferLength); } - // pub fn counterSets(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_counterSets); - // } + pub fn counterSets(self_: *T) ?*ns.Array(*CounterSet) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*CounterSet), @ptrCast(&c.objc_msgSend))(self_, sel_counterSets); + } pub fn supportsDynamicLibraries(self_: *T) bool { return @as(*const fn (*T, *c.objc_selector) callconv(.C) bool, @ptrCast(&c.objc_msgSend))(self_, sel_supportsDynamicLibraries); } @@ -3855,8 +3893,16 @@ pub const Drawable = opaque { pub fn presentAfterMinimumDuration(self_: *T, duration_: cf.TimeInterval) void { return @as(*const fn (*T, *c.objc_selector, cf.TimeInterval) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_presentAfterMinimumDuration_, duration_); } - pub fn addPresentedHandler(self_: *T, block_: DrawablePresentedHandler) void { - return @as(*const fn (*T, *c.objc_selector, DrawablePresentedHandler) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_addPresentedHandler_, block_); + pub fn addPresentedHandler(self_: *T, context: anytype, comptime block_: fn (ctx: @TypeOf(context), _: *Drawable) void) void { + const Literal = ns.BlockLiteral(@TypeOf(context)); + const Helper = struct { + pub fn cCallback(literal: *Literal, a0: *Drawable) callconv(.C) void { + block_(literal.context, a0); + } + }; + const descriptor = ns.BlockDescriptor{ .reserved = 0, .size = @sizeOf(Literal) }; + const block = Literal{ .isa = _NSConcreteStackBlock, .flags = 0, .reserved = 0, .invoke = @ptrCast(&Helper.cCallback), .descriptor = &descriptor, .context = context }; + return @as(*const fn (*T, *c.objc_selector, *const anyopaque) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_addPresentedHandler_, @ptrCast(&block)); } pub fn presentedTime(self_: *T) cf.TimeInterval { return @as(*const fn (*T, *c.objc_selector) callconv(.C) cf.TimeInterval, @ptrCast(&c.objc_msgSend))(self_, sel_presentedTime); @@ -3924,9 +3970,6 @@ pub const SharedEventListener = opaque { return struct { pub usingnamespace ns.ObjectInterface.Methods(T); - // pub fn init(self_: *T) *T { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) *T, @ptrCast(&c.objc_msgSend))(self_, sel_init); - // } pub fn initWithDispatchQueue(self_: *T, dispatchQueue_: dispatch_queue_t) *T { return @as(*const fn (*T, *c.objc_selector, dispatch_queue_t) callconv(.C) *T, @ptrCast(&c.objc_msgSend))(self_, sel_initWithDispatchQueue_, dispatchQueue_); } @@ -3944,8 +3987,16 @@ pub const SharedEvent = opaque { return struct { pub usingnamespace Event.Methods(T); - pub fn notifyListener_atValue_block(self_: *T, listener_: *SharedEventListener, value_: u64, block_: SharedEventNotificationBlock) void { - return @as(*const fn (*T, *c.objc_selector, *SharedEventListener, u64, SharedEventNotificationBlock) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_notifyListener_atValue_block_, listener_, value_, block_); + pub fn notifyListener_atValue_block(self_: *T, listener_: *SharedEventListener, value_: u64, context: anytype, comptime block_: fn (ctx: @TypeOf(context), _: *SharedEvent, _: u64) void) void { + const Literal = ns.BlockLiteral(@TypeOf(context)); + const Helper = struct { + pub fn cCallback(literal: *Literal, a0: *SharedEvent, a1: u64) callconv(.C) void { + block_(literal.context, a0, a1); + } + }; + const descriptor = ns.BlockDescriptor{ .reserved = 0, .size = @sizeOf(Literal) }; + const block = Literal{ .isa = _NSConcreteStackBlock, .flags = 0, .reserved = 0, .invoke = @ptrCast(&Helper.cCallback), .descriptor = &descriptor, .context = context }; + return @as(*const fn (*T, *c.objc_selector, *SharedEventListener, u64, *const anyopaque) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_notifyListener_atValue_block_, listener_, value_, @ptrCast(&block)); } pub fn newSharedEventHandle(self_: *T) *SharedEventHandle { return @as(*const fn (*T, *c.objc_selector) callconv(.C) *SharedEventHandle, @ptrCast(&c.objc_msgSend))(self_, sel_newSharedEventHandle); @@ -4063,12 +4114,12 @@ pub const FunctionDescriptor = opaque { pub fn setOptions(self_: *T, options_: FunctionOptions) void { return @as(*const fn (*T, *c.objc_selector, FunctionOptions) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setOptions_, options_); } - // pub fn binaryArchives(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_binaryArchives); - // } - // pub fn setBinaryArchives(self_: *T, binaryArchives_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setBinaryArchives_, binaryArchives_); - // } + pub fn binaryArchives(self_: *T) ?*ns.Array(*BinaryArchive) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*BinaryArchive), @ptrCast(&c.objc_msgSend))(self_, sel_binaryArchives); + } + pub fn setBinaryArchives(self_: *T, binaryArchives_: ?*ns.Array(*BinaryArchive)) void { + return @as(*const fn (*T, *c.objc_selector, ?*ns.Array(*BinaryArchive)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setBinaryArchives_, binaryArchives_); + } }; } }; @@ -4233,27 +4284,27 @@ pub const FunctionStitchingFunctionNode = opaque { pub usingnamespace ns.ObjectInterface.Methods(T); pub usingnamespace FunctionStitchingNode.Methods(T); - // pub fn initWithName_arguments_controlDependencies(self_: *T, name_: *ns.String, arguments_: ns.Array, controlDependencies_: ns.Array) *T { - // return @as(*const fn (*T, *c.objc_selector, *ns.String, ns.Array, ns.Array) callconv(.C) *T, @ptrCast(&c.objc_msgSend))(self_, sel_initWithName_arguments_controlDependencies_, name_, arguments_, controlDependencies_); - // } + pub fn initWithName_arguments_controlDependencies(self_: *T, name_: *ns.String, arguments_: *ns.Array(*FunctionStitchingNode), controlDependencies_: *ns.Array(*FunctionStitchingFunctionNode)) *T { + return @as(*const fn (*T, *c.objc_selector, *ns.String, *ns.Array(*FunctionStitchingNode), *ns.Array(*FunctionStitchingFunctionNode)) callconv(.C) *T, @ptrCast(&c.objc_msgSend))(self_, sel_initWithName_arguments_controlDependencies_, name_, arguments_, controlDependencies_); + } pub fn name(self_: *T) *ns.String { return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.String, @ptrCast(&c.objc_msgSend))(self_, sel_name); } pub fn setName(self_: *T, name_: *ns.String) void { return @as(*const fn (*T, *c.objc_selector, *ns.String) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setName_, name_); } - // pub fn arguments(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_arguments); - // } - // pub fn setArguments(self_: *T, arguments_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setArguments_, arguments_); - // } - // pub fn controlDependencies(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_controlDependencies); - // } - // pub fn setControlDependencies(self_: *T, controlDependencies_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setControlDependencies_, controlDependencies_); - // } + pub fn arguments(self_: *T) *ns.Array(*FunctionStitchingNode) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*FunctionStitchingNode), @ptrCast(&c.objc_msgSend))(self_, sel_arguments); + } + pub fn setArguments(self_: *T, arguments_: *ns.Array(*FunctionStitchingNode)) void { + return @as(*const fn (*T, *c.objc_selector, *ns.Array(*FunctionStitchingNode)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setArguments_, arguments_); + } + pub fn controlDependencies(self_: *T) *ns.Array(*FunctionStitchingFunctionNode) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*FunctionStitchingFunctionNode), @ptrCast(&c.objc_msgSend))(self_, sel_controlDependencies); + } + pub fn setControlDependencies(self_: *T, controlDependencies_: *ns.Array(*FunctionStitchingFunctionNode)) void { + return @as(*const fn (*T, *c.objc_selector, *ns.Array(*FunctionStitchingFunctionNode)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setControlDependencies_, controlDependencies_); + } }; } }; @@ -4269,33 +4320,33 @@ pub const FunctionStitchingGraph = opaque { pub usingnamespace ns.ObjectInterface.Methods(T); pub usingnamespace ns.Copying.Methods(T); - // pub fn initWithFunctionName_nodes_outputNode_attributes(self_: *T, functionName_: *ns.String, nodes_: ns.Array, outputNode_: ?*FunctionStitchingFunctionNode, attributes_: ns.Array) *T { - // return @as(*const fn (*T, *c.objc_selector, *ns.String, ns.Array, ?*FunctionStitchingFunctionNode, ns.Array) callconv(.C) *T, @ptrCast(&c.objc_msgSend))(self_, sel_initWithFunctionName_nodes_outputNode_attributes_, functionName_, nodes_, outputNode_, attributes_); - // } + pub fn initWithFunctionName_nodes_outputNode_attributes(self_: *T, functionName_: *ns.String, nodes_: *ns.Array(*FunctionStitchingFunctionNode), outputNode_: ?*FunctionStitchingFunctionNode, attributes_: *ns.Array(*FunctionStitchingAttribute)) *T { + return @as(*const fn (*T, *c.objc_selector, *ns.String, *ns.Array(*FunctionStitchingFunctionNode), ?*FunctionStitchingFunctionNode, *ns.Array(*FunctionStitchingAttribute)) callconv(.C) *T, @ptrCast(&c.objc_msgSend))(self_, sel_initWithFunctionName_nodes_outputNode_attributes_, functionName_, nodes_, outputNode_, attributes_); + } pub fn functionName(self_: *T) *ns.String { return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.String, @ptrCast(&c.objc_msgSend))(self_, sel_functionName); } pub fn setFunctionName(self_: *T, functionName_: *ns.String) void { return @as(*const fn (*T, *c.objc_selector, *ns.String) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setFunctionName_, functionName_); } - // pub fn nodes(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_nodes); - // } - // pub fn setNodes(self_: *T, nodes_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setNodes_, nodes_); - // } + pub fn nodes(self_: *T) *ns.Array(*FunctionStitchingFunctionNode) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*FunctionStitchingFunctionNode), @ptrCast(&c.objc_msgSend))(self_, sel_nodes); + } + pub fn setNodes(self_: *T, nodes_: *ns.Array(*FunctionStitchingFunctionNode)) void { + return @as(*const fn (*T, *c.objc_selector, *ns.Array(*FunctionStitchingFunctionNode)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setNodes_, nodes_); + } pub fn outputNode(self_: *T) ?*FunctionStitchingFunctionNode { return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*FunctionStitchingFunctionNode, @ptrCast(&c.objc_msgSend))(self_, sel_outputNode); } pub fn setOutputNode(self_: *T, outputNode_: ?*FunctionStitchingFunctionNode) void { return @as(*const fn (*T, *c.objc_selector, ?*FunctionStitchingFunctionNode) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setOutputNode_, outputNode_); } - // pub fn attributes(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_attributes); - // } - // pub fn setAttributes(self_: *T, attributes_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setAttributes_, attributes_); - // } + pub fn attributes(self_: *T) *ns.Array(*FunctionStitchingAttribute) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*FunctionStitchingAttribute), @ptrCast(&c.objc_msgSend))(self_, sel_attributes); + } + pub fn setAttributes(self_: *T, attributes_: *ns.Array(*FunctionStitchingAttribute)) void { + return @as(*const fn (*T, *c.objc_selector, *ns.Array(*FunctionStitchingAttribute)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setAttributes_, attributes_); + } }; } }; @@ -4311,18 +4362,18 @@ pub const StitchedLibraryDescriptor = opaque { pub usingnamespace ns.ObjectInterface.Methods(T); pub usingnamespace ns.Copying.Methods(T); - // pub fn functionGraphs(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_functionGraphs); - // } - // pub fn setFunctionGraphs(self_: *T, functionGraphs_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setFunctionGraphs_, functionGraphs_); - // } - // pub fn functions(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_functions); - // } - // pub fn setFunctions(self_: *T, functions_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setFunctions_, functions_); - // } + pub fn functionGraphs(self_: *T) *ns.Array(*FunctionStitchingGraph) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*FunctionStitchingGraph), @ptrCast(&c.objc_msgSend))(self_, sel_functionGraphs); + } + pub fn setFunctionGraphs(self_: *T, functionGraphs_: *ns.Array(*FunctionStitchingGraph)) void { + return @as(*const fn (*T, *c.objc_selector, *ns.Array(*FunctionStitchingGraph)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setFunctionGraphs_, functionGraphs_); + } + pub fn functions(self_: *T) *ns.Array(*Function) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*Function), @ptrCast(&c.objc_msgSend))(self_, sel_functions); + } + pub fn setFunctions(self_: *T, functions_: *ns.Array(*Function)) void { + return @as(*const fn (*T, *c.objc_selector, *ns.Array(*Function)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setFunctions_, functions_); + } }; } }; @@ -4686,8 +4737,16 @@ pub const IOCommandBuffer = opaque { return struct { pub usingnamespace ns.ObjectProtocol.Methods(T); - pub fn addCompletedHandler(self_: *T, block_: IOCommandBufferHandler) void { - return @as(*const fn (*T, *c.objc_selector, IOCommandBufferHandler) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_addCompletedHandler_, block_); + pub fn addCompletedHandler(self_: *T, context: anytype, comptime block_: fn (ctx: @TypeOf(context), _: *IOCommandBuffer) void) void { + const Literal = ns.BlockLiteral(@TypeOf(context)); + const Helper = struct { + pub fn cCallback(literal: *Literal, a0: *IOCommandBuffer) callconv(.C) void { + block_(literal.context, a0); + } + }; + const descriptor = ns.BlockDescriptor{ .reserved = 0, .size = @sizeOf(Literal) }; + const block = Literal{ .isa = _NSConcreteStackBlock, .flags = 0, .reserved = 0, .invoke = @ptrCast(&Helper.cCallback), .descriptor = &descriptor, .context = context }; + return @as(*const fn (*T, *c.objc_selector, *const anyopaque) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_addCompletedHandler_, @ptrCast(&block)); } pub fn loadBytes_size_sourceHandle_sourceHandleOffset(self_: *T, pointer_: *anyopaque, size_: ns.UInteger, sourceHandle_: *IOFileHandle, sourceHandleOffset_: ns.UInteger) void { return @as(*const fn (*T, *c.objc_selector, *anyopaque, ns.UInteger, *IOFileHandle, ns.UInteger) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_loadBytes_size_sourceHandle_sourceHandleOffset_, pointer_, size_, sourceHandle_, sourceHandleOffset_); @@ -4981,18 +5040,18 @@ pub const Function = opaque { pub fn patchControlPointCount(self_: *T) ns.Integer { return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Integer, @ptrCast(&c.objc_msgSend))(self_, sel_patchControlPointCount); } - // pub fn vertexAttributes(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_vertexAttributes); - // } - // pub fn stageInputAttributes(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_stageInputAttributes); - // } + pub fn vertexAttributes(self_: *T) ?*ns.Array(*VertexAttribute) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*VertexAttribute), @ptrCast(&c.objc_msgSend))(self_, sel_vertexAttributes); + } + pub fn stageInputAttributes(self_: *T) ?*ns.Array(*Attribute) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*Attribute), @ptrCast(&c.objc_msgSend))(self_, sel_stageInputAttributes); + } pub fn name(self_: *T) *ns.String { return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.String, @ptrCast(&c.objc_msgSend))(self_, sel_name); } - // pub fn functionConstantsDictionary(self_: *T) ns.Dictionary { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Dictionary, @ptrCast(&c.objc_msgSend))(self_, sel_functionConstantsDictionary); - // } + pub fn functionConstantsDictionary(self_: *T) *ns.Dictionary(*ns.String, *FunctionConstant) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Dictionary(*ns.String, *FunctionConstant), @ptrCast(&c.objc_msgSend))(self_, sel_functionConstantsDictionary); + } pub fn options(self_: *T) FunctionOptions { return @as(*const fn (*T, *c.objc_selector) callconv(.C) FunctionOptions, @ptrCast(&c.objc_msgSend))(self_, sel_options); } @@ -5011,12 +5070,12 @@ pub const CompileOptions = opaque { pub usingnamespace ns.ObjectInterface.Methods(T); pub usingnamespace ns.Copying.Methods(T); - // pub fn preprocessorMacros(self_: *T) ns.Dictionary { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Dictionary, @ptrCast(&c.objc_msgSend))(self_, sel_preprocessorMacros); - // } - // pub fn setPreprocessorMacros(self_: *T, preprocessorMacros_: ns.Dictionary) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Dictionary) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setPreprocessorMacros_, preprocessorMacros_); - // } + pub fn preprocessorMacros(self_: *T) ?*ns.Dictionary(*ns.String, *ns.ObjectProtocol) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Dictionary(*ns.String, *ns.ObjectProtocol), @ptrCast(&c.objc_msgSend))(self_, sel_preprocessorMacros); + } + pub fn setPreprocessorMacros(self_: *T, preprocessorMacros_: ?*ns.Dictionary(*ns.String, *ns.ObjectProtocol)) void { + return @as(*const fn (*T, *c.objc_selector, ?*ns.Dictionary(*ns.String, *ns.ObjectProtocol)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setPreprocessorMacros_, preprocessorMacros_); + } pub fn fastMathEnabled(self_: *T) bool { return @as(*const fn (*T, *c.objc_selector) callconv(.C) bool, @ptrCast(&c.objc_msgSend))(self_, sel_fastMathEnabled); } @@ -5041,12 +5100,12 @@ pub const CompileOptions = opaque { pub fn setInstallName(self_: *T, installName_: ?*ns.String) void { return @as(*const fn (*T, *c.objc_selector, ?*ns.String) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setInstallName_, installName_); } - // pub fn libraries(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_libraries); - // } - // pub fn setLibraries(self_: *T, libraries_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setLibraries_, libraries_); - // } + pub fn libraries(self_: *T) ?*ns.Array(*DynamicLibrary) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*DynamicLibrary), @ptrCast(&c.objc_msgSend))(self_, sel_libraries); + } + pub fn setLibraries(self_: *T, libraries_: ?*ns.Array(*DynamicLibrary)) void { + return @as(*const fn (*T, *c.objc_selector, ?*ns.Array(*DynamicLibrary)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setLibraries_, libraries_); + } pub fn preserveInvariance(self_: *T) bool { return @as(*const fn (*T, *c.objc_selector) callconv(.C) bool, @ptrCast(&c.objc_msgSend))(self_, sel_preserveInvariance); } @@ -5094,18 +5153,42 @@ pub const Library = opaque { pub fn newFunctionWithName_constantValues_error(self_: *T, name_: *ns.String, constantValues_: *FunctionConstantValues, error_: ?*?*ns.Error) ?*Function { return @as(*const fn (*T, *c.objc_selector, *ns.String, *FunctionConstantValues, ?*?*ns.Error) callconv(.C) ?*Function, @ptrCast(&c.objc_msgSend))(self_, sel_newFunctionWithName_constantValues_error_, name_, constantValues_, error_); } - // pub fn newFunctionWithName_constantValues_completionHandler(self_: *T, name_: *ns.String, constantValues_: *FunctionConstantValues, completionHandler_: void) void { - // return @as(*const fn (*T, *c.objc_selector, *ns.String, *FunctionConstantValues, void) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newFunctionWithName_constantValues_completionHandler_, name_, constantValues_, completionHandler_); - // } - // pub fn newFunctionWithDescriptor_completionHandler(self_: *T, descriptor_: *FunctionDescriptor, completionHandler_: void) void { - // return @as(*const fn (*T, *c.objc_selector, *FunctionDescriptor, void) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newFunctionWithDescriptor_completionHandler_, descriptor_, completionHandler_); - // } + pub fn newFunctionWithName_constantValues_completionHandler(self_: *T, name_: *ns.String, constantValues_: *FunctionConstantValues, context: anytype, comptime completionHandler_: fn (ctx: @TypeOf(context), _: ?*Function, _: ?*ns.Error) void) void { + const Literal = ns.BlockLiteral(@TypeOf(context)); + const Helper = struct { + pub fn cCallback(literal: *Literal, a0: ?*Function, a1: ?*ns.Error) callconv(.C) void { + completionHandler_(literal.context, a0, a1); + } + }; + const descriptor = ns.BlockDescriptor{ .reserved = 0, .size = @sizeOf(Literal) }; + const block = Literal{ .isa = _NSConcreteStackBlock, .flags = 0, .reserved = 0, .invoke = @ptrCast(&Helper.cCallback), .descriptor = &descriptor, .context = context }; + return @as(*const fn (*T, *c.objc_selector, *ns.String, *FunctionConstantValues, *const anyopaque) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newFunctionWithName_constantValues_completionHandler_, name_, constantValues_, @ptrCast(&block)); + } + pub fn newFunctionWithDescriptor_completionHandler(self_: *T, descriptor_: *FunctionDescriptor, context: anytype, comptime completionHandler_: fn (ctx: @TypeOf(context), _: ?*Function, _: ?*ns.Error) void) void { + const Literal = ns.BlockLiteral(@TypeOf(context)); + const Helper = struct { + pub fn cCallback(literal: *Literal, a0: ?*Function, a1: ?*ns.Error) callconv(.C) void { + completionHandler_(literal.context, a0, a1); + } + }; + const descriptor = ns.BlockDescriptor{ .reserved = 0, .size = @sizeOf(Literal) }; + const block = Literal{ .isa = _NSConcreteStackBlock, .flags = 0, .reserved = 0, .invoke = @ptrCast(&Helper.cCallback), .descriptor = &descriptor, .context = context }; + return @as(*const fn (*T, *c.objc_selector, *FunctionDescriptor, *const anyopaque) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newFunctionWithDescriptor_completionHandler_, descriptor_, @ptrCast(&block)); + } pub fn newFunctionWithDescriptor_error(self_: *T, descriptor_: *FunctionDescriptor, error_: ?*?*ns.Error) ?*Function { return @as(*const fn (*T, *c.objc_selector, *FunctionDescriptor, ?*?*ns.Error) callconv(.C) ?*Function, @ptrCast(&c.objc_msgSend))(self_, sel_newFunctionWithDescriptor_error_, descriptor_, error_); } - // pub fn newIntersectionFunctionWithDescriptor_completionHandler(self_: *T, descriptor_: *IntersectionFunctionDescriptor, completionHandler_: void) void { - // return @as(*const fn (*T, *c.objc_selector, *IntersectionFunctionDescriptor, void) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newIntersectionFunctionWithDescriptor_completionHandler_, descriptor_, completionHandler_); - // } + pub fn newIntersectionFunctionWithDescriptor_completionHandler(self_: *T, descriptor_: *IntersectionFunctionDescriptor, context: anytype, comptime completionHandler_: fn (ctx: @TypeOf(context), _: ?*Function, _: ?*ns.Error) void) void { + const Literal = ns.BlockLiteral(@TypeOf(context)); + const Helper = struct { + pub fn cCallback(literal: *Literal, a0: ?*Function, a1: ?*ns.Error) callconv(.C) void { + completionHandler_(literal.context, a0, a1); + } + }; + const descriptor = ns.BlockDescriptor{ .reserved = 0, .size = @sizeOf(Literal) }; + const block = Literal{ .isa = _NSConcreteStackBlock, .flags = 0, .reserved = 0, .invoke = @ptrCast(&Helper.cCallback), .descriptor = &descriptor, .context = context }; + return @as(*const fn (*T, *c.objc_selector, *IntersectionFunctionDescriptor, *const anyopaque) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_newIntersectionFunctionWithDescriptor_completionHandler_, descriptor_, @ptrCast(&block)); + } pub fn newIntersectionFunctionWithDescriptor_error(self_: *T, descriptor_: *IntersectionFunctionDescriptor, error_: ?*?*ns.Error) ?*Function { return @as(*const fn (*T, *c.objc_selector, *IntersectionFunctionDescriptor, ?*?*ns.Error) callconv(.C) ?*Function, @ptrCast(&c.objc_msgSend))(self_, sel_newIntersectionFunctionWithDescriptor_error_, descriptor_, error_); } @@ -5118,9 +5201,9 @@ pub const Library = opaque { pub fn device(self_: *T) *Device { return @as(*const fn (*T, *c.objc_selector) callconv(.C) *Device, @ptrCast(&c.objc_msgSend))(self_, sel_device); } - // pub fn functionNames(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_functionNames); - // } + pub fn functionNames(self_: *T) *ns.Array(*ns.String) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*ns.String), @ptrCast(&c.objc_msgSend))(self_, sel_functionNames); + } pub fn @"type"(self_: *T) LibraryType { return @as(*const fn (*T, *c.objc_selector) callconv(.C) LibraryType, @ptrCast(&c.objc_msgSend))(self_, sel_type); } @@ -5145,30 +5228,30 @@ pub const LinkedFunctions = opaque { pub fn linkedFunctions() *LinkedFunctions { return @as(*const fn (*c.objc_class, *c.objc_selector) callconv(.C) *LinkedFunctions, @ptrCast(&c.objc_msgSend))(T.class(), sel_linkedFunctions); } - // pub fn functions(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_functions); - // } - // pub fn setFunctions(self_: *T, functions_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setFunctions_, functions_); - // } - // pub fn binaryFunctions(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_binaryFunctions); - // } - // pub fn setBinaryFunctions(self_: *T, binaryFunctions_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setBinaryFunctions_, binaryFunctions_); - // } - // pub fn groups(self_: *T) ns.Dictionary { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Dictionary, @ptrCast(&c.objc_msgSend))(self_, sel_groups); - // } - // pub fn setGroups(self_: *T, groups_: ns.Dictionary) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Dictionary) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setGroups_, groups_); - // } - // pub fn privateFunctions(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_privateFunctions); - // } - // pub fn setPrivateFunctions(self_: *T, privateFunctions_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setPrivateFunctions_, privateFunctions_); - // } + pub fn functions(self_: *T) ?*ns.Array(*Function) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*Function), @ptrCast(&c.objc_msgSend))(self_, sel_functions); + } + pub fn setFunctions(self_: *T, functions_: ?*ns.Array(*Function)) void { + return @as(*const fn (*T, *c.objc_selector, ?*ns.Array(*Function)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setFunctions_, functions_); + } + pub fn binaryFunctions(self_: *T) ?*ns.Array(*Function) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*Function), @ptrCast(&c.objc_msgSend))(self_, sel_binaryFunctions); + } + pub fn setBinaryFunctions(self_: *T, binaryFunctions_: ?*ns.Array(*Function)) void { + return @as(*const fn (*T, *c.objc_selector, ?*ns.Array(*Function)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setBinaryFunctions_, binaryFunctions_); + } + pub fn groups(self_: *T) ?*ns.Dictionary(*ns.String, *ns.Array(*Function)) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Dictionary(*ns.String, *ns.Array(*Function)), @ptrCast(&c.objc_msgSend))(self_, sel_groups); + } + pub fn setGroups(self_: *T, groups_: ?*ns.Dictionary(*ns.String, *ns.Array(*Function))) void { + return @as(*const fn (*T, *c.objc_selector, ?*ns.Dictionary(*ns.String, *ns.Array(*Function))) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setGroups_, groups_); + } + pub fn privateFunctions(self_: *T) ?*ns.Array(*Function) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*Function), @ptrCast(&c.objc_msgSend))(self_, sel_privateFunctions); + } + pub fn setPrivateFunctions(self_: *T, privateFunctions_: ?*ns.Array(*Function)) void { + return @as(*const fn (*T, *c.objc_selector, ?*ns.Array(*Function)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setPrivateFunctions_, privateFunctions_); + } }; } }; @@ -5276,9 +5359,6 @@ pub const RasterizationRateLayerDescriptor = opaque { return struct { pub usingnamespace ns.ObjectInterface.Methods(T); - // pub fn init(self_: *T) *T { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) *T, @ptrCast(&c.objc_msgSend))(self_, sel_init); - // } pub fn initWithSampleCount(self_: *T, sampleCount_: Size) *T { return @as(*const fn (*T, *c.objc_selector, Size) callconv(.C) *T, @ptrCast(&c.objc_msgSend))(self_, sel_initWithSampleCount_, sampleCount_); } @@ -6224,30 +6304,30 @@ pub const RenderPipelineReflection = opaque { return struct { pub usingnamespace ns.ObjectInterface.Methods(T); - // pub fn vertexBindings(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_vertexBindings); - // } - // pub fn fragmentBindings(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_fragmentBindings); - // } - // pub fn tileBindings(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_tileBindings); - // } - // pub fn objectBindings(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_objectBindings); - // } - // pub fn meshBindings(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_meshBindings); - // } - // pub fn vertexArguments(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_vertexArguments); - // } - // pub fn fragmentArguments(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_fragmentArguments); - // } - // pub fn tileArguments(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_tileArguments); - // } + pub fn vertexBindings(self_: *T) *ns.Array(*Binding) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*Binding), @ptrCast(&c.objc_msgSend))(self_, sel_vertexBindings); + } + pub fn fragmentBindings(self_: *T) *ns.Array(*Binding) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*Binding), @ptrCast(&c.objc_msgSend))(self_, sel_fragmentBindings); + } + pub fn tileBindings(self_: *T) *ns.Array(*Binding) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*Binding), @ptrCast(&c.objc_msgSend))(self_, sel_tileBindings); + } + pub fn objectBindings(self_: *T) *ns.Array(*Binding) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*Binding), @ptrCast(&c.objc_msgSend))(self_, sel_objectBindings); + } + pub fn meshBindings(self_: *T) *ns.Array(*Binding) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*Binding), @ptrCast(&c.objc_msgSend))(self_, sel_meshBindings); + } + pub fn vertexArguments(self_: *T) ?*ns.Array(*Argument) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*Argument), @ptrCast(&c.objc_msgSend))(self_, sel_vertexArguments); + } + pub fn fragmentArguments(self_: *T) ?*ns.Array(*Argument) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*Argument), @ptrCast(&c.objc_msgSend))(self_, sel_fragmentArguments); + } + pub fn tileArguments(self_: *T) ?*ns.Array(*Argument) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*Argument), @ptrCast(&c.objc_msgSend))(self_, sel_tileArguments); + } }; } }; @@ -6401,24 +6481,24 @@ pub const RenderPipelineDescriptor = opaque { pub fn setSupportIndirectCommandBuffers(self_: *T, supportIndirectCommandBuffers_: bool) void { return @as(*const fn (*T, *c.objc_selector, bool) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setSupportIndirectCommandBuffers_, supportIndirectCommandBuffers_); } - // pub fn binaryArchives(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_binaryArchives); - // } - // pub fn setBinaryArchives(self_: *T, binaryArchives_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setBinaryArchives_, binaryArchives_); - // } - // pub fn vertexPreloadedLibraries(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_vertexPreloadedLibraries); - // } - // pub fn setVertexPreloadedLibraries(self_: *T, vertexPreloadedLibraries_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setVertexPreloadedLibraries_, vertexPreloadedLibraries_); - // } - // pub fn fragmentPreloadedLibraries(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_fragmentPreloadedLibraries); - // } - // pub fn setFragmentPreloadedLibraries(self_: *T, fragmentPreloadedLibraries_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setFragmentPreloadedLibraries_, fragmentPreloadedLibraries_); - // } + pub fn binaryArchives(self_: *T) ?*ns.Array(*BinaryArchive) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*BinaryArchive), @ptrCast(&c.objc_msgSend))(self_, sel_binaryArchives); + } + pub fn setBinaryArchives(self_: *T, binaryArchives_: ?*ns.Array(*BinaryArchive)) void { + return @as(*const fn (*T, *c.objc_selector, ?*ns.Array(*BinaryArchive)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setBinaryArchives_, binaryArchives_); + } + pub fn vertexPreloadedLibraries(self_: *T) *ns.Array(*DynamicLibrary) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*DynamicLibrary), @ptrCast(&c.objc_msgSend))(self_, sel_vertexPreloadedLibraries); + } + pub fn setVertexPreloadedLibraries(self_: *T, vertexPreloadedLibraries_: *ns.Array(*DynamicLibrary)) void { + return @as(*const fn (*T, *c.objc_selector, *ns.Array(*DynamicLibrary)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setVertexPreloadedLibraries_, vertexPreloadedLibraries_); + } + pub fn fragmentPreloadedLibraries(self_: *T) *ns.Array(*DynamicLibrary) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*DynamicLibrary), @ptrCast(&c.objc_msgSend))(self_, sel_fragmentPreloadedLibraries); + } + pub fn setFragmentPreloadedLibraries(self_: *T, fragmentPreloadedLibraries_: *ns.Array(*DynamicLibrary)) void { + return @as(*const fn (*T, *c.objc_selector, *ns.Array(*DynamicLibrary)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setFragmentPreloadedLibraries_, fragmentPreloadedLibraries_); + } pub fn vertexLinkedFunctions(self_: *T) *LinkedFunctions { return @as(*const fn (*T, *c.objc_selector) callconv(.C) *LinkedFunctions, @ptrCast(&c.objc_msgSend))(self_, sel_vertexLinkedFunctions); } @@ -6470,24 +6550,24 @@ pub const RenderPipelineFunctionsDescriptor = opaque { pub usingnamespace ns.ObjectInterface.Methods(T); pub usingnamespace ns.Copying.Methods(T); - // pub fn vertexAdditionalBinaryFunctions(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_vertexAdditionalBinaryFunctions); - // } - // pub fn setVertexAdditionalBinaryFunctions(self_: *T, vertexAdditionalBinaryFunctions_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setVertexAdditionalBinaryFunctions_, vertexAdditionalBinaryFunctions_); - // } - // pub fn fragmentAdditionalBinaryFunctions(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_fragmentAdditionalBinaryFunctions); - // } - // pub fn setFragmentAdditionalBinaryFunctions(self_: *T, fragmentAdditionalBinaryFunctions_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setFragmentAdditionalBinaryFunctions_, fragmentAdditionalBinaryFunctions_); - // } - // pub fn tileAdditionalBinaryFunctions(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_tileAdditionalBinaryFunctions); - // } - // pub fn setTileAdditionalBinaryFunctions(self_: *T, tileAdditionalBinaryFunctions_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setTileAdditionalBinaryFunctions_, tileAdditionalBinaryFunctions_); - // } + pub fn vertexAdditionalBinaryFunctions(self_: *T) ?*ns.Array(*Function) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*Function), @ptrCast(&c.objc_msgSend))(self_, sel_vertexAdditionalBinaryFunctions); + } + pub fn setVertexAdditionalBinaryFunctions(self_: *T, vertexAdditionalBinaryFunctions_: ?*ns.Array(*Function)) void { + return @as(*const fn (*T, *c.objc_selector, ?*ns.Array(*Function)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setVertexAdditionalBinaryFunctions_, vertexAdditionalBinaryFunctions_); + } + pub fn fragmentAdditionalBinaryFunctions(self_: *T) ?*ns.Array(*Function) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*Function), @ptrCast(&c.objc_msgSend))(self_, sel_fragmentAdditionalBinaryFunctions); + } + pub fn setFragmentAdditionalBinaryFunctions(self_: *T, fragmentAdditionalBinaryFunctions_: ?*ns.Array(*Function)) void { + return @as(*const fn (*T, *c.objc_selector, ?*ns.Array(*Function)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setFragmentAdditionalBinaryFunctions_, fragmentAdditionalBinaryFunctions_); + } + pub fn tileAdditionalBinaryFunctions(self_: *T) ?*ns.Array(*Function) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*Function), @ptrCast(&c.objc_msgSend))(self_, sel_tileAdditionalBinaryFunctions); + } + pub fn setTileAdditionalBinaryFunctions(self_: *T, tileAdditionalBinaryFunctions_: ?*ns.Array(*Function)) void { + return @as(*const fn (*T, *c.objc_selector, ?*ns.Array(*Function)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setTileAdditionalBinaryFunctions_, tileAdditionalBinaryFunctions_); + } }; } }; @@ -6665,18 +6745,18 @@ pub const TileRenderPipelineDescriptor = opaque { pub fn setMaxTotalThreadsPerThreadgroup(self_: *T, maxTotalThreadsPerThreadgroup_: ns.UInteger) void { return @as(*const fn (*T, *c.objc_selector, ns.UInteger) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setMaxTotalThreadsPerThreadgroup_, maxTotalThreadsPerThreadgroup_); } - // pub fn binaryArchives(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_binaryArchives); - // } - // pub fn setBinaryArchives(self_: *T, binaryArchives_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setBinaryArchives_, binaryArchives_); - // } - // pub fn preloadedLibraries(self_: *T) ns.Array { - // return @as(*const fn (*T, *c.objc_selector) callconv(.C) ns.Array, @ptrCast(&c.objc_msgSend))(self_, sel_preloadedLibraries); - // } - // pub fn setPreloadedLibraries(self_: *T, preloadedLibraries_: ns.Array) void { - // return @as(*const fn (*T, *c.objc_selector, ns.Array) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setPreloadedLibraries_, preloadedLibraries_); - // } + pub fn binaryArchives(self_: *T) ?*ns.Array(*BinaryArchive) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) ?*ns.Array(*BinaryArchive), @ptrCast(&c.objc_msgSend))(self_, sel_binaryArchives); + } + pub fn setBinaryArchives(self_: *T, binaryArchives_: ?*ns.Array(*BinaryArchive)) void { + return @as(*const fn (*T, *c.objc_selector, ?*ns.Array(*BinaryArchive)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setBinaryArchives_, binaryArchives_); + } + pub fn preloadedLibraries(self_: *T) *ns.Array(*DynamicLibrary) { + return @as(*const fn (*T, *c.objc_selector) callconv(.C) *ns.Array(*DynamicLibrary), @ptrCast(&c.objc_msgSend))(self_, sel_preloadedLibraries); + } + pub fn setPreloadedLibraries(self_: *T, preloadedLibraries_: *ns.Array(*DynamicLibrary)) void { + return @as(*const fn (*T, *c.objc_selector, *ns.Array(*DynamicLibrary)) callconv(.C) void, @ptrCast(&c.objc_msgSend))(self_, sel_setPreloadedLibraries_, preloadedLibraries_); + } pub fn linkedFunctions(self_: *T) *LinkedFunctions { return @as(*const fn (*T, *c.objc_selector) callconv(.C) *LinkedFunctions, @ptrCast(&c.objc_msgSend))(self_, sel_linkedFunctions); }