From 6d316adfea636bb6ec0bb55da4d199acbe355179 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:44:05 -0400 Subject: [PATCH] Add comment from removed argument.jl --- res/wrap/README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/res/wrap/README.md b/res/wrap/README.md index c0053cf3..4cb006f0 100644 --- a/res/wrap/README.md +++ b/res/wrap/README.md @@ -5,3 +5,46 @@ This directory contains scripts to generate Julia wrappers for Metal and MetalPe Currently, only `enums` and `structs` are able to be generated. The scripts are meant to be run from this directory, and at the moment, [this Clang.jl branch](https://github.com/christiangnrd/Clang.jl/tree/objectiveC) must be used. + +#### + +Comment from removed file on `MTLDataType`. Parsing the headers does not reveal these hidden values. + +``` +#= + +Possible (undocumented) values for this enum can be iterated using the MTLTypeInternal type: + +\`\`\`julia +load_framework("Metal") + +@objcwrapper immutable=false MTLType <: NSObject + +@objcwrapper immutable=false MTLTypeInternal <: MTLType + +@objcproperties MTLTypeInternal begin + @autoproperty dataType::UInt64 + @autoproperty description::id{NSString} +end + +function MTLTypeInternal(dataType::Integer) + obj = MTLTypeInternal(@objc [MTLTypeInternal alloc]::id{MTLTypeInternal}) + finalizer(dealloc, obj) + @objc [obj::id{MTLTypeInternal} initWithDataType:dataType::UInt64]::id{MTLTypeInternal} + return obj +end + +dealloc(obj::MTLTypeInternal) = @objc [obj::id{MTLTypeInternal} dealloc]::Cvoid + +for i in 1:200 + typ = MTLTypeInternal(i) + name = string(typ.description) + if name != "Unknown" + println(" $name = $i") + end +end +\`\`\` + +=# + +```