From 62d72c7a155f73956aa715716fefd8be0e584a05 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Saenz Date: Wed, 28 May 2025 11:38:29 -0400 Subject: [PATCH 1/5] [RGen] Update the emitters to generate the trampoline static class. This is the initial implementation of the trampoline emitter. It just focuses on the delegate and the static class. A generic class has been added but more tests will come per framework, we simply want to make the diff manageable for the team, so we have not added all the tests in a single PR. --- .../BindingSyntaxFactory.KnownTypes.cs | 7 + .../Emitters/Documentation.cs | 3 + .../Emitters/TrampolineEmitter.cs | 171 ++++++++++- .../BaseGeneratorTestClass.cs | 2 +- .../Data/ExpectedTrampolinePropertyTests.cs | 276 +++++++++++++++++ ...ectedTrampolinePropertyTestsTrampolines.cs | 279 ++++++++++++++++++ .../Classes/Data/TrampolinePropertyTests.cs | 42 +++ .../Microsoft.Macios.Generator.Tests.csproj | 2 + 8 files changed, 775 insertions(+), 7 deletions(-) diff --git a/src/rgen/Microsoft.Macios.Generator/Emitters/BindingSyntaxFactory.KnownTypes.cs b/src/rgen/Microsoft.Macios.Generator/Emitters/BindingSyntaxFactory.KnownTypes.cs index 47c7b440f530..091a7fad7de3 100644 --- a/src/rgen/Microsoft.Macios.Generator/Emitters/BindingSyntaxFactory.KnownTypes.cs +++ b/src/rgen/Microsoft.Macios.Generator/Emitters/BindingSyntaxFactory.KnownTypes.cs @@ -68,6 +68,13 @@ static partial class BindingSyntaxFactory { @namespace: ["ObjCRuntime"], @class: "Runtime"); + /// + /// TypeSyntax for ObjCRuntime.BlockLiteral. + /// + public static readonly TypeSyntax BlockLiteral = StringExtensions.GetIdentifierName ( + @namespace: ["ObjCRuntime"], + @class: "BlockLiteral"); + // Foundation types /// diff --git a/src/rgen/Microsoft.Macios.Generator/Emitters/Documentation.cs b/src/rgen/Microsoft.Macios.Generator/Emitters/Documentation.cs index 9025697643e4..d2a1c6028bb7 100644 --- a/src/rgen/Microsoft.Macios.Generator/Emitters/Documentation.cs +++ b/src/rgen/Microsoft.Macios.Generator/Emitters/Documentation.cs @@ -135,5 +135,8 @@ public static string DefaultInitWithHandle (string name) => /// Developers should not invoke this method directly, instead they should call as it will prevent two instances of a managed object pointing to the same native object. /// /// "; + + public static string TrampolineStaticClass (string name) => +"/// This class bridges native block invocations that call into C#"; } } diff --git a/src/rgen/Microsoft.Macios.Generator/Emitters/TrampolineEmitter.cs b/src/rgen/Microsoft.Macios.Generator/Emitters/TrampolineEmitter.cs index 1f06e97b9be2..3bb693a8d9af 100644 --- a/src/rgen/Microsoft.Macios.Generator/Emitters/TrampolineEmitter.cs +++ b/src/rgen/Microsoft.Macios.Generator/Emitters/TrampolineEmitter.cs @@ -3,21 +3,164 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; +using System.IO; +using System.Linq; using Microsoft.CodeAnalysis; using Microsoft.Macios.Generator.Context; -using Microsoft.Macios.Generator.DataModel; +using Microsoft.Macios.Generator.Formatters; using Microsoft.Macios.Generator.IO; using TypeInfo = Microsoft.Macios.Generator.DataModel.TypeInfo; +using static Microsoft.Macios.Generator.Emitters.BindingSyntaxFactory; namespace Microsoft.Macios.Generator.Emitters; class TrampolineEmitter ( RootContext context, TabbedStringBuilder builder) { + /// + /// The nomenclator is used to generate the name of the static class that will contain the trampoline, needs to + /// be an instance class since we want to keep track of the already generated names. + /// + Nomenclator nomenclator = new (); public string SymbolNamespace => "ObjCRuntime"; public string SymbolName => "Trampolines"; + /// + /// Generate the static helper class for the trampoline uses to bridge the native block invocation. + /// + /// The type info of the trampoline to generate. + /// The trampoline name. + /// The tabbed string builder to use. + /// Ture if the code was generated, fals otherwise. + public bool TryEmitStaticClass (in TypeInfo typeInfo, string trampolineName, TabbedWriter classBuilder) + { + // create a new static class using the name from the nomenclator + var argumentSyntax = GetTrampolineInvokeArguments (trampolineName, typeInfo.Delegate!); + var delegateIdentifier = typeInfo.GetIdentifierSyntax (); + var className = Nomenclator.GetTrampolineClassName (trampolineName, Nomenclator.TrampolineClassType.StaticBridgeClass); + var invokeMethodName = Nomenclator.GetTrampolineInvokeMethodName (); + var trampolineVariableName = Nomenclator.GetTrampolineDelegatePointerVariableName (); + var delegateVariableName = Nomenclator.GetTrampolineDelegateVariableName (); + + classBuilder.WriteDocumentation (Documentation.Class.TrampolineStaticClass (className)); + using (var classBlock = classBuilder.CreateBlock ($"static internal class {className}", true)) { + // Invoke method + classBlock.WriteLine ("[Preserve (Conditional = true)]"); + classBlock.WriteLine ("[UnmanagedCallersOnly]"); + classBlock.WriteLine ($"[UserDelegateType (typeof ({delegateIdentifier}))]"); + using (var invokeMethod = classBlock.CreateBlock (GetTrampolineInvokeSignature (typeInfo).ToString (), true)) { + // initialized the parameters, this might be needed for the parameters that are out or ref + foreach (var argument in argumentSyntax) { + invokeMethod.Write (argument.Initializers); + } + + // get the delegate from the block literal to execute with the trampoline + invokeMethod.WriteLine ($"var {delegateVariableName} = {BlockLiteral}.GetTarget<{delegateIdentifier}> ({Nomenclator.GetTrampolineBlockParameterName (typeInfo.Delegate!.Parameters)});"); + + // if the deletate is null, we return default, otherwise we call the delegate + using (var ifBlock = invokeMethod.CreateBlock ($"if ({delegateVariableName} is not null)", true)) { + + // build any needed pre conversion operations before calling the delegate + foreach (var argument in argumentSyntax) { + ifBlock.Write (argument.PreDelegateCallConversion); + } + + ifBlock.WriteLine ($"{CallTrampolineDelegate (typeInfo.Delegate!, argumentSyntax)}"); + + // build any needed post conversion operations after calling the delegate + foreach (var argument in argumentSyntax) { + ifBlock.Write (argument.PostDelegateCallConversion); + } + + // perform any needed + if (typeInfo.Delegate.ReturnType.SpecialType != SpecialType.System_Void) + ifBlock.WriteLine($"return {GetTrampolineInvokeReturnType (typeInfo, Nomenclator.GetReturnVariableName ())};"); + } + if (typeInfo.Delegate.ReturnType.SpecialType != SpecialType.System_Void) + invokeMethod.WriteLine ("return default;"); + } + + // CreateNullableBlock + classBlock.WriteLine (); // empty line for readability + using (var createNullableBlock = classBlock.CreateBlock ( + $"internal static unsafe {BlockLiteral} CreateNullableBlock ({delegateIdentifier}? callback)", true)) { + createNullableBlock.WriteRaw ( +$@"if (callback is null) + return default ({BlockLiteral}); +return CreateBlock (callback); +" + ); + } + + // CreateBlock + classBlock.WriteLine (); // empty line for readability + classBlock.WriteLine ("[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]"); + using (var createBlock = classBlock.CreateBlock ( + $"internal static unsafe {BlockLiteral} CreateBlock ({delegateIdentifier} callback)", true)) { + createBlock.WriteLine (GetTrampolineDelegatePointer (typeInfo).ToFullString ()); + createBlock.WriteLine ( + $"return new {BlockLiteral} ({trampolineVariableName}, callback, typeof ({className}), nameof ({invokeMethodName}));"); + } + } + return true; + } + + /// + /// Emits the delegate declaration for the trampoline. + /// + /// The type of the trampoline to generate. + /// The current tabbed string builder to use. + /// A hash set with the delegates already added. + /// The delegate name. + /// True if the code was generated, false otherwise. + public bool TryEmitInternalDelegate (in TypeInfo typeInfo, TabbedWriter classBuilder, HashSet addedDelegates, + [NotNullWhen (true)] out string? delegateName) + { + delegateName = null; + if (typeInfo.Delegate is null) + return false; + + // generate the delegate and get its name, if we already emitted it, skip it + var delegateDeclaration = GetTrampolineDelegateDeclaration (typeInfo, out delegateName); + if (addedDelegates.Add (delegateName)) { + // print the attributes needed for the delegate and the delegate itself + classBuilder.WriteLine ("[UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]"); + classBuilder.WriteLine ($"[UserDelegateType (typeof ({typeInfo.GetIdentifierSyntax ()}))]"); + classBuilder.WriteLine (delegateDeclaration.ToString ()); + } + return true; + } + + /// + /// Write the using statements for the namespaces used by the trampolines. + /// + /// The trampolines to generate. + public void WriteUsedNamespaces (IReadOnlySet trampolines) + { + // create set with the default namespaces + var namespaces = new HashSet () { + "Foundation", + "ObjCBindings", + "ObjCRuntime", + "System", + }; + // loop through the trampolines and add the namespaces used by the delegates + foreach (var info in trampolines) + namespaces.Add (string.Join ('.', info.Namespace)); + + // sort the namespaces so that we can write them in a deterministic way + foreach (var ns in namespaces.OrderBy (x => x)) { + builder.WriteLine ($"using {ns};"); + } + } + + /// + /// Generate the trampolines for the given set of types. + /// + /// The trampolines type info to use for the code generation. + /// Possible diagnostic errors. + /// True if the code was generated, false otherwise. public bool TryEmit (IReadOnlySet trampolines, [NotNullWhen (false)] out ImmutableArray? diagnostics) { @@ -25,19 +168,35 @@ public bool TryEmit (IReadOnlySet trampolines, // and some comments with the trampolines to emit diagnostics = null; - builder.WriteLine ("using Foundation;"); - builder.WriteLine ("using ObjCBindings;"); - builder.WriteLine ("using ObjCRuntime;"); - builder.WriteLine ("using System;"); + // write the using statements + WriteUsedNamespaces (trampolines); builder.WriteLine (); - builder.WriteLine ($"namespace ObjCRuntime;"); + builder.WriteLine ("namespace ObjCRuntime;"); builder.WriteLine (); + // keep track of the already emitted delegates + var addedDelegates = new HashSet (); + using (var classBlock = builder.CreateBlock ($"static partial class {SymbolName}", true)) { classBlock.WriteLine ($"// Generate trampolines for compilation"); _ = context.CurrentPlatform; foreach (var info in trampolines) { + var trampolineName = nomenclator.GetTrampolineName (info); + // write the delegate declaration + if (!TryEmitInternalDelegate (info, classBlock, addedDelegates, out var delegateDeclaration)) { + diagnostics = []; + return false; + } + + classBlock.WriteLine (); // empty line for readability + + // generate the static class + if (!TryEmitStaticClass (info, trampolineName, classBlock)) { + diagnostics = []; + return false; + } + classBlock.WriteLine ($"// TODO: generate trampoline for {info.FullyQualifiedName}"); classBlock.WriteLine (); } diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/BaseGeneratorTestClass.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/BaseGeneratorTestClass.cs index 959b1f4fdfec..ddb73fcbd323 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/BaseGeneratorTestClass.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/BaseGeneratorTestClass.cs @@ -122,7 +122,7 @@ protected void CompareGeneratedCode (GenerationTestData testData) if (testData.ExpectedTrampolineText is not null) { // validate that Library.g.cs was created by the LibraryEmitter and matches the expectation - var generatedLibSyntax = runResult.GeneratedTrees.Single (t => t.FilePath.EndsWith ("Trampolines.g.cs")); + var generatedLibSyntax = runResult.GeneratedTrees.Single (t => t.FilePath.EndsWith ("ObjCRuntime/Trampolines.g.cs")); Assert.Equal (testData.ExpectedTrampolineText, generatedLibSyntax.GetText ().ToString ()); } } diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/ExpectedTrampolinePropertyTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/ExpectedTrampolinePropertyTests.cs index 34e68a976805..525223609d4b 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/ExpectedTrampolinePropertyTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/ExpectedTrampolinePropertyTests.cs @@ -2,7 +2,9 @@ #nullable enable +using AVFoundation; using CoreGraphics; +using CoreImage; using Foundation; using ObjCBindings; using ObjCRuntime; @@ -20,6 +22,14 @@ namespace Microsoft.Macios.Generator.Tests.Classes.Data.TestNamespace; [Register ("TrampolinePropertyTests", true)] public partial class TrampolinePropertyTests { + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selCreateObjectHandlerX = "createObjectHandler"; + static readonly global::ObjCRuntime.NativeHandle selCreateObjectHandlerXHandle = global::ObjCRuntime.Selector.GetHandle ("createObjectHandler"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetCreateObjectHandler_X = "setCreateObjectHandler:"; + static readonly global::ObjCRuntime.NativeHandle selSetCreateObjectHandler_XHandle = global::ObjCRuntime.Selector.GetHandle ("setCreateObjectHandler:"); + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] const string selCompletionHandlerX = "completionHandler"; static readonly global::ObjCRuntime.NativeHandle selCompletionHandlerXHandle = global::ObjCRuntime.Selector.GetHandle ("completionHandler"); @@ -28,6 +38,62 @@ public partial class TrampolinePropertyTests const string selSetCompletionHandler_X = "setCompletionHandler:"; static readonly global::ObjCRuntime.NativeHandle selSetCompletionHandler_XHandle = global::ObjCRuntime.Selector.GetHandle ("setCompletionHandler:"); + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selDuplicateCompletionHandlerX = "duplicateCompletionHandler"; + static readonly global::ObjCRuntime.NativeHandle selDuplicateCompletionHandlerXHandle = global::ObjCRuntime.Selector.GetHandle ("duplicateCompletionHandler"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetDuplicateCompletionHandler_X = "setDuplicateCompletionHandler:"; + static readonly global::ObjCRuntime.NativeHandle selSetDuplicateCompletionHandler_XHandle = global::ObjCRuntime.Selector.GetHandle ("setDuplicateCompletionHandler:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selImageGeneratorCompletionHandlerX = "imageGeneratorCompletionHandler"; + static readonly global::ObjCRuntime.NativeHandle selImageGeneratorCompletionHandlerXHandle = global::ObjCRuntime.Selector.GetHandle ("imageGeneratorCompletionHandler"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetImageGeneratorCompletionHandler_X = "setImageGeneratorCompletionHandler:"; + static readonly global::ObjCRuntime.NativeHandle selSetImageGeneratorCompletionHandler_XHandle = global::ObjCRuntime.Selector.GetHandle ("setImageGeneratorCompletionHandler:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selKernelRoiCallbackX = "kernelRoiCallback"; + static readonly global::ObjCRuntime.NativeHandle selKernelRoiCallbackXHandle = global::ObjCRuntime.Selector.GetHandle ("kernelRoiCallback"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetKernelRoiCallback_X = "setKernelRoiCallback:"; + static readonly global::ObjCRuntime.NativeHandle selSetKernelRoiCallback_XHandle = global::ObjCRuntime.Selector.GetHandle ("setKernelRoiCallback:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selStringActionHandlerX = "stringActionHandler"; + static readonly global::ObjCRuntime.NativeHandle selStringActionHandlerXHandle = global::ObjCRuntime.Selector.GetHandle ("stringActionHandler"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetStringActionHandler_X = "setStringActionHandler:"; + static readonly global::ObjCRuntime.NativeHandle selSetStringActionHandler_XHandle = global::ObjCRuntime.Selector.GetHandle ("setStringActionHandler:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selIntActionHandlerX = "intActionHandler"; + static readonly global::ObjCRuntime.NativeHandle selIntActionHandlerXHandle = global::ObjCRuntime.Selector.GetHandle ("intActionHandler"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetIntActionHandler_X = "setIntActionHandler:"; + static readonly global::ObjCRuntime.NativeHandle selSetIntActionHandler_XHandle = global::ObjCRuntime.Selector.GetHandle ("setIntActionHandler:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selBoolActionHandlerX = "boolActionHandler"; + static readonly global::ObjCRuntime.NativeHandle selBoolActionHandlerXHandle = global::ObjCRuntime.Selector.GetHandle ("boolActionHandler"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetBoolActionHandler_X = "setBoolActionHandler:"; + static readonly global::ObjCRuntime.NativeHandle selSetBoolActionHandler_XHandle = global::ObjCRuntime.Selector.GetHandle ("setBoolActionHandler:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selManualRenderingCallbackX = "manualRenderingCallback"; + static readonly global::ObjCRuntime.NativeHandle selManualRenderingCallbackXHandle = global::ObjCRuntime.Selector.GetHandle ("manualRenderingCallback"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetManualRenderingCallback_X = "setManualRenderingCallback:"; + static readonly global::ObjCRuntime.NativeHandle selSetManualRenderingCallback_XHandle = global::ObjCRuntime.Selector.GetHandle ("setManualRenderingCallback:"); + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] static readonly global::ObjCRuntime.NativeHandle class_ptr = global::ObjCRuntime.Class.GetHandle ("TrampolinePropertyTests"); @@ -113,6 +179,27 @@ protected TrampolinePropertyTests (global::Foundation.NSObjectFlag t) : base (t) [EditorBrowsable (EditorBrowsableState.Advanced)] protected internal TrampolinePropertyTests (global::ObjCRuntime.NativeHandle handle) : base (handle) {} + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::System.Action BoolActionHandler + { + get + { + global::System.Action ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("boolActionHandler")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("boolActionHandler")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] public partial global::System.Action CompletionHandler { @@ -133,5 +220,194 @@ protected internal TrampolinePropertyTests (global::ObjCRuntime.NativeHandle han throw new NotImplementedException(); } } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::Microsoft.Macios.Generator.Tests.Classes.Data.TestNamespace.TrampolinePropertyTests.CreateObject CreateObjectHandler + { + get + { + global::Microsoft.Macios.Generator.Tests.Classes.Data.TestNamespace.TrampolinePropertyTests.CreateObject ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("createObjectHandler")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("createObjectHandler")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::System.Action DuplicateCompletionHandler + { + get + { + global::System.Action ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("duplicateCompletionHandler")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("duplicateCompletionHandler")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVAssetImageGenerator.AsynchronouslyForTimeCompletionHandler ImageGeneratorCompletionHandler + { + get + { + global::AVFoundation.AVAssetImageGenerator.AsynchronouslyForTimeCompletionHandler ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging._objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("imageGeneratorCompletionHandler")); + } else { + ret = global::ObjCRuntime.Messaging._objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("imageGeneratorCompletionHandler")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler ImageGeneratorCompletionHandler + { + get + { + global::AVFoundation.AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("imageGeneratorCompletionHandler")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("imageGeneratorCompletionHandler")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::System.Action IntActionHandler + { + get + { + global::System.Action ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("intActionHandler")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("intActionHandler")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::CoreImage.CIKernelRoiCallback KernelRoiCallback + { + get + { + global::CoreImage.CIKernelRoiCallback ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("kernelRoiCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("kernelRoiCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::CoreImage.CIKernelRoiCallback KernelRoiCallback + { + get + { + global::CoreImage.CIKernelRoiCallback ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("kernelRoiCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("kernelRoiCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVAudioEngineManualRenderingBlock ManualRendering + { + get + { + global::AVFoundation.AVAudioEngineManualRenderingBlock ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("manualRenderingCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("manualRenderingCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::System.Action StringActionHandler + { + get + { + global::System.Action ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("stringActionHandler")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("stringActionHandler")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } // TODO: add binding code here } diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/ExpectedTrampolinePropertyTestsTrampolines.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/ExpectedTrampolinePropertyTestsTrampolines.cs index e6dbd4fde887..fa4919703a99 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/ExpectedTrampolinePropertyTestsTrampolines.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/ExpectedTrampolinePropertyTestsTrampolines.cs @@ -2,7 +2,10 @@ #nullable enable +using AVFoundation; +using CoreImage; using Foundation; +using Microsoft.Macios.Generator.Tests.Classes.Data.TestNamespace; using ObjCBindings; using ObjCRuntime; using System; @@ -12,6 +15,282 @@ namespace ObjCRuntime; static partial class Trampolines { // Generate trampolines for compilation + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::Microsoft.Macios.Generator.Tests.Classes.Data.TestNamespace.TrampolinePropertyTests.CreateObject))] + unsafe internal delegate global::ObjCRuntime.NativeHandle DTrampolinePropertyTests.CreateObject (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle obj); + + /// This class bridges native block invocations that call into C# + static internal class SDTrampolinePropertyTests.CreateObject + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::Microsoft.Macios.Generator.Tests.Classes.Data.TestNamespace.TrampolinePropertyTests.CreateObject))] + internal static unsafe global::ObjCRuntime.NativeHandle Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle obj) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + var ret = del (global::ObjCRuntime.Runtime.GetNSObject (obj)!); + return global::ObjCRuntime.Runtime.RetainAndAutoreleaseNSObject (ret); + } + return default; + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::Microsoft.Macios.Generator.Tests.Classes.Data.TestNamespace.TrampolinePropertyTests.CreateObject? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::Microsoft.Macios.Generator.Tests.Classes.Data.TestNamespace.TrampolinePropertyTests.CreateObject callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDTrampolinePropertyTests.CreateObject), nameof (Invoke)); + } + } + // TODO: generate trampoline for Microsoft.Macios.Generator.Tests.Classes.Data.TestNamespace.TrampolinePropertyTests.CreateObject + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::System.Action))] + unsafe internal delegate void DAction (global::System.IntPtr block_ptr); + + /// This class bridges native block invocations that call into C# + static internal class SDAction + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::System.Action))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::System.Action? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::System.Action callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAction), nameof (Invoke)); + } + } // TODO: generate trampoline for System.Action + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::CoreImage.CIKernelRoiCallback))] + unsafe internal delegate global::CoreGraphics.CGRect DCIKernelRoiCallback (global::System.IntPtr block_ptr, int index, global::CoreGraphics.CGRect rect); + + /// This class bridges native block invocations that call into C# + static internal class SDCIKernelRoiCallback + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::CoreImage.CIKernelRoiCallback))] + internal static unsafe global::CoreGraphics.CGRect Invoke (global::System.IntPtr block_ptr, int index, global::CoreGraphics.CGRect rect) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + var ret = del (index, rect); + return ret; + } + return default; + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::CoreImage.CIKernelRoiCallback? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::CoreImage.CIKernelRoiCallback callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDCIKernelRoiCallback), nameof (Invoke)); + } + } + // TODO: generate trampoline for CoreImage.CIKernelRoiCallback + + + /// This class bridges native block invocations that call into C# + static internal class SDActionArity1V0 + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::System.Action))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle obj) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget> (block_ptr); + if (del is not null) + { + del (global::CoreFoundation.CFString.FromHandle (obj)!); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::System.Action? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::System.Action callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDActionArity1V0), nameof (Invoke)); + } + } + // TODO: generate trampoline for System.Action + + + /// This class bridges native block invocations that call into C# + static internal class SDActionArity1V1 + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::System.Action))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, int obj) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget> (block_ptr); + if (del is not null) + { + del (obj); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::System.Action? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::System.Action callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDActionArity1V1), nameof (Invoke)); + } + } + // TODO: generate trampoline for System.Action + + + /// This class bridges native block invocations that call into C# + static internal class SDActionArity1V2 + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::System.Action))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, byte obj) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget> (block_ptr); + if (del is not null) + { + del (obj != 0); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::System.Action? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::System.Action callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDActionArity1V2), nameof (Invoke)); + } + } + // TODO: generate trampoline for System.Action + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler))] + unsafe internal delegate void DAVAssetImageGenerateAsynchronouslyForTimeCompletionHandler (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle imageRef, global::CoreMedia.CMTime actualTime, global::ObjCRuntime.NativeHandle error); + + /// This class bridges native block invocations that call into C# + static internal class SDAVAssetImageGenerateAsynchronouslyForTimeCompletionHandler + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle imageRef, global::CoreMedia.CMTime actualTime, global::ObjCRuntime.NativeHandle error) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (global::ObjCRuntime.Runtime.GetINativeObject (imageRef, false)!, actualTime, global::ObjCRuntime.Runtime.GetNSObject (error)!); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVAssetImageGenerateAsynchronouslyForTimeCompletionHandler), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVAudioEngineManualRenderingBlock))] + unsafe internal delegate global::System.IntPtr DAVAudioEngineManualRenderingBlock (global::System.IntPtr block_ptr, uint numberOfFrames, global::ObjCRuntime.NativeHandle outBuffer, int* outError); + + /// This class bridges native block invocations that call into C# + static internal class SDAVAudioEngineManualRenderingBlock + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVAudioEngineManualRenderingBlock))] + internal static unsafe global::System.IntPtr Invoke (global::System.IntPtr block_ptr, uint numberOfFrames, global::ObjCRuntime.NativeHandle outBuffer, int* outError) + { + *outError = default; + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + var ret = del (numberOfFrames, new global::AudioToolbox.AudioBuffers (outBuffer), ref global::System.Runtime.CompilerServices.Unsafe.AsRef (outError)); + return (IntPtr) (long) ret; + } + return default; + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVAudioEngineManualRenderingBlock? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVAudioEngineManualRenderingBlock callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVAudioEngineManualRenderingBlock), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVAudioEngineManualRenderingBlock + } diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/TrampolinePropertyTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/TrampolinePropertyTests.cs index 38701c21642c..fdeaf1f596c9 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/TrampolinePropertyTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/TrampolinePropertyTests.cs @@ -8,6 +8,8 @@ namespace Microsoft.Macios.Generator.Tests.Classes.Data; using System; using System.Runtime.Versioning; +using AVFoundation; +using CoreImage; using CoreGraphics; using Foundation; using ObjCBindings; @@ -17,7 +19,47 @@ namespace TestNamespace; [BindingType] public partial class TrampolinePropertyTests { + + public delegate NSObject CreateObject (NSObject obj); + + [Export ("createObjectHandler", ArgumentSemantic.Copy)] + public partial CreateObject CreateObjectHandler { get; set; } [Export ("completionHandler", ArgumentSemantic.Copy)] public partial Action CompletionHandler { get; set; } + + // Duplicate property using Action + [Export ("duplicateCompletionHandler", ArgumentSemantic.Copy)] + public partial Action DuplicateCompletionHandler { get; set; } + + [Export ("imageGeneratorCompletionHandler", ArgumentSemantic.Copy)] + public partial AVAssetImageGenerator.AsynchronouslyForTimeCompletionHandler ImageGeneratorCompletionHandler { get; set; } + + // Property using CIKernelRoiCallback + [Export ("kernelRoiCallback", ArgumentSemantic.Copy)] + public partial CIKernelRoiCallback KernelRoiCallback { get; set; }] + + // Property using Action + [Export ("stringActionHandler", ArgumentSemantic.Copy)] + public partial Action StringActionHandler { get; set; } + + // Property using Action + [Export ("intActionHandler", ArgumentSemantic.Copy)] + public partial Action IntActionHandler { get; set; } + + // Property using Action + [Export("boolActionHandler", ArgumentSemantic.Copy)] + public partial Action BoolActionHandler { get; set; } + + // Property using AVAssetImageGenerator.AsynchronouslyForTimeCompletionHandler + [Export ("imageGeneratorCompletionHandler", ArgumentSemantic.Copy)] + public partial AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler ImageGeneratorCompletionHandler { get; set; } + + // Property using CIKernelRoiCallback + [Export ("kernelRoiCallback", ArgumentSemantic.Copy)] + public partial CIKernelRoiCallback KernelRoiCallback { get; set; } + + // Property using AVAssetImageGenerator.AsynchronouslyForTimeCompletionHandler + [Export("manualRenderingCallback", ArgumentSemantic.Copy)] + public partial AVAudioEngineManualRenderingBlock ManualRendering { get; set; } } diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Microsoft.Macios.Generator.Tests.csproj b/tests/rgen/Microsoft.Macios.Generator.Tests/Microsoft.Macios.Generator.Tests.csproj index 974bac298d84..706ed2664fce 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Microsoft.Macios.Generator.Tests.csproj +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Microsoft.Macios.Generator.Tests.csproj @@ -61,9 +61,11 @@ + + From f2c89ab7f2ead32d45de32e1c4a0bd9285400ddb Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Wed, 28 May 2025 11:43:52 -0400 Subject: [PATCH 2/5] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../Microsoft.Macios.Generator/Emitters/TrampolineEmitter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgen/Microsoft.Macios.Generator/Emitters/TrampolineEmitter.cs b/src/rgen/Microsoft.Macios.Generator/Emitters/TrampolineEmitter.cs index 3bb693a8d9af..670bfe5168cc 100644 --- a/src/rgen/Microsoft.Macios.Generator/Emitters/TrampolineEmitter.cs +++ b/src/rgen/Microsoft.Macios.Generator/Emitters/TrampolineEmitter.cs @@ -32,7 +32,7 @@ class TrampolineEmitter ( /// The type info of the trampoline to generate. /// The trampoline name. /// The tabbed string builder to use. - /// Ture if the code was generated, fals otherwise. + /// True if the code was generated, false otherwise. public bool TryEmitStaticClass (in TypeInfo typeInfo, string trampolineName, TabbedWriter classBuilder) { // create a new static class using the name from the nomenclator From 587a8063e3f95ec8179a5f299aa8c075babc8077 Mon Sep 17 00:00:00 2001 From: GitHub Actions Autoformatter Date: Wed, 28 May 2025 15:43:50 +0000 Subject: [PATCH 3/5] Auto-format source code --- .../Emitters/TrampolineEmitter.cs | 18 +++++++++--------- .../Classes/Data/TrampolinePropertyTests.cs | 12 ++++++------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/rgen/Microsoft.Macios.Generator/Emitters/TrampolineEmitter.cs b/src/rgen/Microsoft.Macios.Generator/Emitters/TrampolineEmitter.cs index 670bfe5168cc..9479f5d08111 100644 --- a/src/rgen/Microsoft.Macios.Generator/Emitters/TrampolineEmitter.cs +++ b/src/rgen/Microsoft.Macios.Generator/Emitters/TrampolineEmitter.cs @@ -54,30 +54,30 @@ public bool TryEmitStaticClass (in TypeInfo typeInfo, string trampolineName, Tab foreach (var argument in argumentSyntax) { invokeMethod.Write (argument.Initializers); } - + // get the delegate from the block literal to execute with the trampoline invokeMethod.WriteLine ($"var {delegateVariableName} = {BlockLiteral}.GetTarget<{delegateIdentifier}> ({Nomenclator.GetTrampolineBlockParameterName (typeInfo.Delegate!.Parameters)});"); - + // if the deletate is null, we return default, otherwise we call the delegate using (var ifBlock = invokeMethod.CreateBlock ($"if ({delegateVariableName} is not null)", true)) { - + // build any needed pre conversion operations before calling the delegate foreach (var argument in argumentSyntax) { ifBlock.Write (argument.PreDelegateCallConversion); } - + ifBlock.WriteLine ($"{CallTrampolineDelegate (typeInfo.Delegate!, argumentSyntax)}"); - + // build any needed post conversion operations after calling the delegate foreach (var argument in argumentSyntax) { ifBlock.Write (argument.PostDelegateCallConversion); } - + // perform any needed - if (typeInfo.Delegate.ReturnType.SpecialType != SpecialType.System_Void) - ifBlock.WriteLine($"return {GetTrampolineInvokeReturnType (typeInfo, Nomenclator.GetReturnVariableName ())};"); + if (typeInfo.Delegate.ReturnType.SpecialType != SpecialType.System_Void) + ifBlock.WriteLine ($"return {GetTrampolineInvokeReturnType (typeInfo, Nomenclator.GetReturnVariableName ())};"); } - if (typeInfo.Delegate.ReturnType.SpecialType != SpecialType.System_Void) + if (typeInfo.Delegate.ReturnType.SpecialType != SpecialType.System_Void) invokeMethod.WriteLine ("return default;"); } diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/TrampolinePropertyTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/TrampolinePropertyTests.cs index fdeaf1f596c9..1cfb989abb26 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/TrampolinePropertyTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/TrampolinePropertyTests.cs @@ -19,9 +19,9 @@ namespace TestNamespace; [BindingType] public partial class TrampolinePropertyTests { - + public delegate NSObject CreateObject (NSObject obj); - + [Export ("createObjectHandler", ArgumentSemantic.Copy)] public partial CreateObject CreateObjectHandler { get; set; } @@ -46,9 +46,9 @@ public partial class TrampolinePropertyTests { // Property using Action [Export ("intActionHandler", ArgumentSemantic.Copy)] public partial Action IntActionHandler { get; set; } - + // Property using Action - [Export("boolActionHandler", ArgumentSemantic.Copy)] + [Export ("boolActionHandler", ArgumentSemantic.Copy)] public partial Action BoolActionHandler { get; set; } // Property using AVAssetImageGenerator.AsynchronouslyForTimeCompletionHandler @@ -58,8 +58,8 @@ public partial class TrampolinePropertyTests { // Property using CIKernelRoiCallback [Export ("kernelRoiCallback", ArgumentSemantic.Copy)] public partial CIKernelRoiCallback KernelRoiCallback { get; set; } - + // Property using AVAssetImageGenerator.AsynchronouslyForTimeCompletionHandler - [Export("manualRenderingCallback", ArgumentSemantic.Copy)] + [Export ("manualRenderingCallback", ArgumentSemantic.Copy)] public partial AVAudioEngineManualRenderingBlock ManualRendering { get; set; } } From c1441578211fd7bb2476877929fb324df2179668 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Saenz Date: Wed, 28 May 2025 12:17:15 -0400 Subject: [PATCH 4/5] [RGen] Add AVFoundation trampoline tests. Add tests for all the AVFoundation delegates that we know about. --- .../Classes/ClassGenerationTests.cs | 5 + .../Trampolines/AVFoundationTrampolines.cs | 129 ++ ...pectedAVFoundationTrampolinesProperties.cs | 1210 +++++++++++++++ ...ectedAVFoundationTrampolinesTrampolines.cs | 1369 +++++++++++++++++ 4 files changed, 2713 insertions(+) create mode 100644 tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/Trampolines/AVFoundationTrampolines.cs create mode 100644 tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/Trampolines/ExpectedAVFoundationTrampolinesProperties.cs create mode 100644 tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/Trampolines/ExpectedAVFoundationTrampolinesTrampolines.cs diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/ClassGenerationTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/ClassGenerationTests.cs index f56062e4641c..0d6387ba8982 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/ClassGenerationTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/ClassGenerationTests.cs @@ -47,6 +47,11 @@ public class TestDataGenerator : BaseTestDataGenerator, IEnumerable { (ApplePlatform.TVOS, "TrampolinePropertyTests", "TrampolinePropertyTests.cs", "ExpectedTrampolinePropertyTests.cs", null, "ExpectedTrampolinePropertyTestsTrampolines.cs"), (ApplePlatform.MacCatalyst, "TrampolinePropertyTests", "TrampolinePropertyTests.cs", "ExpectedTrampolinePropertyTests.cs", null, "ExpectedTrampolinePropertyTestsTrampolines.cs"), (ApplePlatform.MacOSX, "TrampolinePropertyTests", "TrampolinePropertyTests.cs", "ExpectedTrampolinePropertyTests.cs", null, "ExpectedTrampolinePropertyTestsTrampolines.cs"), + + // avfoundation trampoline tests, we are ignoring tvOS because is the same as iOS BUT with the AVCaptureCompletionHandler missing and we want to test that delgate + (ApplePlatform.iOS, "AVFoundationTrampolines", "Trampolines/AVFoundationTrampolines.cs", "Trampolines/ExpectedAVFoundationTrampolinesProperties.cs", null, "Trampolines/ExpectedAVFoundationTrampolinesTrampolines.cs"), + (ApplePlatform.MacCatalyst, "AVFoundationTrampolines", "Trampolines/AVFoundationTrampolines.cs", "Trampolines/ExpectedAVFoundationTrampolinesProperties.cs", null, "Trampolines/ExpectedAVFoundationTrampolinesTrampolines.cs"), + (ApplePlatform.MacOSX, "AVFoundationTrampolines", "Trampolines/AVFoundationTrampolines.cs", "Trampolines/ExpectedAVFoundationTrampolinesProperties.cs", null, "Trampolines/ExpectedAVFoundationTrampolinesTrampolines.cs"), }; public IEnumerator GetEnumerator () diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/Trampolines/AVFoundationTrampolines.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/Trampolines/AVFoundationTrampolines.cs new file mode 100644 index 000000000000..9b55c66061ea --- /dev/null +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/Trampolines/AVFoundationTrampolines.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using System; +using System.Runtime.Versioning; +using AVFoundation; +using Foundation; +using ObjCBindings; +using ObjCRuntime; + +namespace TestNamespace; + +[BindingType] +public class AVFoundationTrampolines { + + [Export ("avAssetImageGenerateAsynchronouslyForTimeCompletionHandler", ArgumentSemantic.Copy)] + public partial AVFoundation.AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler { get; set; } + + [Export ("avAssetImageGeneratorCompletionHandler", ArgumentSemantic.Copy)] + public partial AVFoundation.AVAssetImageGeneratorCompletionHandler AVAssetImageGeneratorCompletionHandler { get; set; } + + [Export ("avAssetImageGeneratorCompletionHandler2", ArgumentSemantic.Copy)] + public partial AVFoundation.AVAssetImageGeneratorCompletionHandler2 AVAssetImageGeneratorCompletionHandler2 { get; set; } + + [Export ("avAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler", ArgumentSemantic.Copy)] + public partial AVFoundation.AVAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler AVAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler { get; set; } + + [Export ("avAudioConverterInputHandler", ArgumentSemantic.Copy)] + public partial AVFoundation.AVAudioConverterInputHandler AVAudioConverterInputHandler { get; set; } + + [Export ("avAudioEngineManualRenderingBlock", ArgumentSemantic.Copy)] + public partial AVFoundation.AVAudioEngineManualRenderingBlock AVAudioEngineManualRenderingBlock { get; set; } + + [Export ("avAudioIONodeInputBlock", ArgumentSemantic.Copy)] + public partial AVFoundation.AVAudioIONodeInputBlock AVAudioIONodeInputBlock { get; set; } + + [Export ("avAudioInputNodeMutedSpeechEventListener", ArgumentSemantic.Copy)] + public partial AVFoundation.AVAudioInputNodeMutedSpeechEventListener AVAudioInputNodeMutedSpeechEventListener { get; set; } + + [Export ("avAudioNodeTapBlock", ArgumentSemantic.Copy)] + public partial AVFoundation.AVAudioNodeTapBlock AVAudioNodeTapBlock { get; set; } + + [Export ("avAudioSequencerUserCallback", ArgumentSemantic.Copy)] + public partial AVFoundation.AVAudioSequencerUserCallback AVAudioSequencerUserCallback { get; set; } + + [Export ("avAudioSinkNodeReceiverHandlerRaw", ArgumentSemantic.Copy)] + public partial AVFoundation.AVAudioSinkNodeReceiverHandlerRaw AVAudioSinkNodeReceiverHandlerRaw { get; set; } + + [Export ("avAudioSourceNodeRenderHandlerRaw", ArgumentSemantic.Copy)] + public partial AVFoundation.AVAudioSourceNodeRenderHandlerRaw AVAudioSourceNodeRenderHandlerRaw { get; set; } + + [Export ("avAudioUnitComponentFilter", ArgumentSemantic.Copy)] + public partial AVFoundation.AVAudioUnitComponentFilter AVAudioUnitComponentFilter { get; set; } + + [Export ("avCaptureCompletionHandler", ArgumentSemantic.Copy)] + public partial AVFoundation.AVCaptureCompletionHandler AVCaptureCompletionHandler { get; set; } + + [Export ("avCaptureIndexPickerCallback", ArgumentSemantic.Copy)] + public partial AVFoundation.AVCaptureIndexPickerCallback AVCaptureIndexPickerCallback { get; set; } + + [Export ("avCaptureIndexPickerTitleTransform", ArgumentSemantic.Copy)] + public partial AVFoundation.AVCaptureIndexPickerTitleTransform AVCaptureIndexPickerTitleTransform { get; set; } + + [Export ("avCaptureSliderCallback", ArgumentSemantic.Copy)] + public partial AVFoundation.AVCaptureSliderCallback AVCaptureSliderCallback { get; set; } + + [Export ("avCaptureSystemExposureBiasSliderCallback", ArgumentSemantic.Copy)] + public partial AVFoundation.AVCaptureSystemExposureBiasSliderCallback AVCaptureSystemExposureBiasSliderCallback { get; set; } + + [Export ("avCaptureSystemZoomSliderCallback", ArgumentSemantic.Copy)] + public partial AVFoundation.AVCaptureSystemZoomSliderCallback AVCaptureSystemZoomSliderCallback { get; set; } + + [Export ("avCompletion", ArgumentSemantic.Copy)] + public partial AVFoundation.AVCompletion AVCompletion { get; set; } + + [Export ("avExternalStorageDeviceRequestAccessCallback", ArgumentSemantic.Copy)] + public partial AVFoundation.AVExternalStorageDeviceRequestAccessCallback AVExternalStorageDeviceRequestAccessCallback { get; set; } + + [Export ("avMusicEventEnumerationBlock", ArgumentSemantic.Copy)] + public partial AVFoundation.AVMusicEventEnumerationBlock AVMusicEventEnumerationBlock { get; set; } + + [Export ("avMutableCompositionInsertHandler", ArgumentSemantic.Copy)] + public partial AVFoundation.AVMutableCompositionInsertHandler AVMutableCompositionInsertHandler { get; set; } + + [Export ("avMutableVideoCompositionCreateApplier", ArgumentSemantic.Copy)] + public partial AVFoundation.AVMutableVideoCompositionCreateApplier AVMutableVideoCompositionCreateApplier { get; set; } + + [Export ("avMutableVideoCompositionCreateCallback", ArgumentSemantic.Copy)] + public partial AVFoundation.AVMutableVideoCompositionCreateCallback AVMutableVideoCompositionCreateCallback { get; set; } + + [Export ("avPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback", ArgumentSemantic.Copy)] + public partial AVFoundation.AVPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback AVPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback { get; set; } + + [Export ("avPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback", ArgumentSemantic.Copy)] + public partial AVFoundation.AVPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback AVPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback { get; set; } + + [Export ("avPlayerItemIntegratedTimelineSeekCallback", ArgumentSemantic.Copy)] + public partial AVFoundation.AVPlayerItemIntegratedTimelineSeekCallback AVPlayerItemIntegratedTimelineSeekCallback { get; set; } + + [Export ("avRequestAccessStatus", ArgumentSemantic.Copy)] + public partial AVFoundation.AVRequestAccessStatus AVRequestAccessStatus { get; set; } + + [Export ("avSampleBufferGeneratorBatchMakeReadyCallback", ArgumentSemantic.Copy)] + public partial AVFoundation.AVSampleBufferGeneratorBatchMakeReadyCallback AVSampleBufferGeneratorBatchMakeReadyCallback { get; set; } + + [Export ("avSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback", ArgumentSemantic.Copy)] + public partial AVFoundation.AVSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback AVSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback { get; set; } + + [Export ("avSpeechSynthesisProviderOutputBlock", ArgumentSemantic.Copy)] + public partial AVFoundation.AVSpeechSynthesisProviderOutputBlock AVSpeechSynthesisProviderOutputBlock { get; set; } + + [Export ("avSpeechSynthesizerBufferCallback", ArgumentSemantic.Copy)] + public partial AVFoundation.AVSpeechSynthesizerBufferCallback AVSpeechSynthesizerBufferCallback { get; set; } + + [Export ("avSpeechSynthesizerMarkerCallback", ArgumentSemantic.Copy)] + public partial AVFoundation.AVSpeechSynthesizerMarkerCallback AVSpeechSynthesizerMarkerCallback { get; set; } + + [Export ("avSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback", ArgumentSemantic.Copy)] + public partial AVFoundation.AVSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback AVSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback { get; set; } + + [Export ("avVideoCompositionCreateApplier", ArgumentSemantic.Copy)] + public partial AVFoundation.AVVideoCompositionCreateApplier AVVideoCompositionCreateApplier { get; set; } + + [Export ("avVideoCompositionCreateCallback", ArgumentSemantic.Copy)] + public partial AVFoundation.AVVideoCompositionCreateCallback AVVideoCompositionCreateCallback { get; set; } + + [Export ("avVideoCompositionDetermineValidityCallback", ArgumentSemantic.Copy)] + public partial AVFoundation.AVVideoCompositionDetermineValidityCallback AVVideoCompositionDetermineValidityCallback { get; set; } +} diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/Trampolines/ExpectedAVFoundationTrampolinesProperties.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/Trampolines/ExpectedAVFoundationTrampolinesProperties.cs new file mode 100644 index 000000000000..7f49b0a57cf8 --- /dev/null +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/Trampolines/ExpectedAVFoundationTrampolinesProperties.cs @@ -0,0 +1,1210 @@ +// + +#nullable enable + +using AVFoundation; +using Foundation; +using ObjCBindings; +using ObjCRuntime; +using System; +using System.ComponentModel; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.Drawing; +using System.Runtime.InteropServices; +using System.Runtime.Versioning; +using System.Threading.Tasks; + +namespace TestNamespace; + +[Register ("AVFoundationTrampolines", true)] +public class AVFoundationTrampolines +{ + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvAssetImageGenerateAsynchronouslyForTimeCompletionHandlerX = "avAssetImageGenerateAsynchronouslyForTimeCompletionHandler"; + static readonly global::ObjCRuntime.NativeHandle selAvAssetImageGenerateAsynchronouslyForTimeCompletionHandlerXHandle = global::ObjCRuntime.Selector.GetHandle ("avAssetImageGenerateAsynchronouslyForTimeCompletionHandler"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvAssetImageGenerateAsynchronouslyForTimeCompletionHandler_X = "setAvAssetImageGenerateAsynchronouslyForTimeCompletionHandler:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvAssetImageGenerateAsynchronouslyForTimeCompletionHandler_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvAssetImageGenerateAsynchronouslyForTimeCompletionHandler:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvAssetImageGeneratorCompletionHandlerX = "avAssetImageGeneratorCompletionHandler"; + static readonly global::ObjCRuntime.NativeHandle selAvAssetImageGeneratorCompletionHandlerXHandle = global::ObjCRuntime.Selector.GetHandle ("avAssetImageGeneratorCompletionHandler"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvAssetImageGeneratorCompletionHandler_X = "setAvAssetImageGeneratorCompletionHandler:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvAssetImageGeneratorCompletionHandler_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvAssetImageGeneratorCompletionHandler:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvAssetImageGeneratorCompletionHandler2X = "avAssetImageGeneratorCompletionHandler2"; + static readonly global::ObjCRuntime.NativeHandle selAvAssetImageGeneratorCompletionHandler2XHandle = global::ObjCRuntime.Selector.GetHandle ("avAssetImageGeneratorCompletionHandler2"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvAssetImageGeneratorCompletionHandler2_X = "setAvAssetImageGeneratorCompletionHandler2:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvAssetImageGeneratorCompletionHandler2_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvAssetImageGeneratorCompletionHandler2:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandlerX = "avAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler"; + static readonly global::ObjCRuntime.NativeHandle selAvAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandlerXHandle = global::ObjCRuntime.Selector.GetHandle ("avAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler_X = "setAvAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvAudioConverterInputHandlerX = "avAudioConverterInputHandler"; + static readonly global::ObjCRuntime.NativeHandle selAvAudioConverterInputHandlerXHandle = global::ObjCRuntime.Selector.GetHandle ("avAudioConverterInputHandler"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvAudioConverterInputHandler_X = "setAvAudioConverterInputHandler:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvAudioConverterInputHandler_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvAudioConverterInputHandler:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvAudioEngineManualRenderingBlockX = "avAudioEngineManualRenderingBlock"; + static readonly global::ObjCRuntime.NativeHandle selAvAudioEngineManualRenderingBlockXHandle = global::ObjCRuntime.Selector.GetHandle ("avAudioEngineManualRenderingBlock"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvAudioEngineManualRenderingBlock_X = "setAvAudioEngineManualRenderingBlock:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvAudioEngineManualRenderingBlock_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvAudioEngineManualRenderingBlock:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvAudioIONodeInputBlockX = "avAudioIONodeInputBlock"; + static readonly global::ObjCRuntime.NativeHandle selAvAudioIONodeInputBlockXHandle = global::ObjCRuntime.Selector.GetHandle ("avAudioIONodeInputBlock"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvAudioIONodeInputBlock_X = "setAvAudioIONodeInputBlock:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvAudioIONodeInputBlock_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvAudioIONodeInputBlock:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvAudioInputNodeMutedSpeechEventListenerX = "avAudioInputNodeMutedSpeechEventListener"; + static readonly global::ObjCRuntime.NativeHandle selAvAudioInputNodeMutedSpeechEventListenerXHandle = global::ObjCRuntime.Selector.GetHandle ("avAudioInputNodeMutedSpeechEventListener"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvAudioInputNodeMutedSpeechEventListener_X = "setAvAudioInputNodeMutedSpeechEventListener:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvAudioInputNodeMutedSpeechEventListener_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvAudioInputNodeMutedSpeechEventListener:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvAudioNodeTapBlockX = "avAudioNodeTapBlock"; + static readonly global::ObjCRuntime.NativeHandle selAvAudioNodeTapBlockXHandle = global::ObjCRuntime.Selector.GetHandle ("avAudioNodeTapBlock"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvAudioNodeTapBlock_X = "setAvAudioNodeTapBlock:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvAudioNodeTapBlock_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvAudioNodeTapBlock:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvAudioSequencerUserCallbackX = "avAudioSequencerUserCallback"; + static readonly global::ObjCRuntime.NativeHandle selAvAudioSequencerUserCallbackXHandle = global::ObjCRuntime.Selector.GetHandle ("avAudioSequencerUserCallback"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvAudioSequencerUserCallback_X = "setAvAudioSequencerUserCallback:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvAudioSequencerUserCallback_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvAudioSequencerUserCallback:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvAudioSinkNodeReceiverHandlerRawX = "avAudioSinkNodeReceiverHandlerRaw"; + static readonly global::ObjCRuntime.NativeHandle selAvAudioSinkNodeReceiverHandlerRawXHandle = global::ObjCRuntime.Selector.GetHandle ("avAudioSinkNodeReceiverHandlerRaw"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvAudioSinkNodeReceiverHandlerRaw_X = "setAvAudioSinkNodeReceiverHandlerRaw:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvAudioSinkNodeReceiverHandlerRaw_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvAudioSinkNodeReceiverHandlerRaw:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvAudioSourceNodeRenderHandlerRawX = "avAudioSourceNodeRenderHandlerRaw"; + static readonly global::ObjCRuntime.NativeHandle selAvAudioSourceNodeRenderHandlerRawXHandle = global::ObjCRuntime.Selector.GetHandle ("avAudioSourceNodeRenderHandlerRaw"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvAudioSourceNodeRenderHandlerRaw_X = "setAvAudioSourceNodeRenderHandlerRaw:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvAudioSourceNodeRenderHandlerRaw_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvAudioSourceNodeRenderHandlerRaw:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvAudioUnitComponentFilterX = "avAudioUnitComponentFilter"; + static readonly global::ObjCRuntime.NativeHandle selAvAudioUnitComponentFilterXHandle = global::ObjCRuntime.Selector.GetHandle ("avAudioUnitComponentFilter"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvAudioUnitComponentFilter_X = "setAvAudioUnitComponentFilter:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvAudioUnitComponentFilter_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvAudioUnitComponentFilter:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvCaptureCompletionHandlerX = "avCaptureCompletionHandler"; + static readonly global::ObjCRuntime.NativeHandle selAvCaptureCompletionHandlerXHandle = global::ObjCRuntime.Selector.GetHandle ("avCaptureCompletionHandler"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvCaptureCompletionHandler_X = "setAvCaptureCompletionHandler:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvCaptureCompletionHandler_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvCaptureCompletionHandler:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvCaptureIndexPickerCallbackX = "avCaptureIndexPickerCallback"; + static readonly global::ObjCRuntime.NativeHandle selAvCaptureIndexPickerCallbackXHandle = global::ObjCRuntime.Selector.GetHandle ("avCaptureIndexPickerCallback"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvCaptureIndexPickerCallback_X = "setAvCaptureIndexPickerCallback:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvCaptureIndexPickerCallback_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvCaptureIndexPickerCallback:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvCaptureIndexPickerTitleTransformX = "avCaptureIndexPickerTitleTransform"; + static readonly global::ObjCRuntime.NativeHandle selAvCaptureIndexPickerTitleTransformXHandle = global::ObjCRuntime.Selector.GetHandle ("avCaptureIndexPickerTitleTransform"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvCaptureIndexPickerTitleTransform_X = "setAvCaptureIndexPickerTitleTransform:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvCaptureIndexPickerTitleTransform_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvCaptureIndexPickerTitleTransform:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvCaptureSliderCallbackX = "avCaptureSliderCallback"; + static readonly global::ObjCRuntime.NativeHandle selAvCaptureSliderCallbackXHandle = global::ObjCRuntime.Selector.GetHandle ("avCaptureSliderCallback"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvCaptureSliderCallback_X = "setAvCaptureSliderCallback:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvCaptureSliderCallback_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvCaptureSliderCallback:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvCaptureSystemExposureBiasSliderCallbackX = "avCaptureSystemExposureBiasSliderCallback"; + static readonly global::ObjCRuntime.NativeHandle selAvCaptureSystemExposureBiasSliderCallbackXHandle = global::ObjCRuntime.Selector.GetHandle ("avCaptureSystemExposureBiasSliderCallback"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvCaptureSystemExposureBiasSliderCallback_X = "setAvCaptureSystemExposureBiasSliderCallback:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvCaptureSystemExposureBiasSliderCallback_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvCaptureSystemExposureBiasSliderCallback:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvCaptureSystemZoomSliderCallbackX = "avCaptureSystemZoomSliderCallback"; + static readonly global::ObjCRuntime.NativeHandle selAvCaptureSystemZoomSliderCallbackXHandle = global::ObjCRuntime.Selector.GetHandle ("avCaptureSystemZoomSliderCallback"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvCaptureSystemZoomSliderCallback_X = "setAvCaptureSystemZoomSliderCallback:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvCaptureSystemZoomSliderCallback_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvCaptureSystemZoomSliderCallback:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvCompletionX = "avCompletion"; + static readonly global::ObjCRuntime.NativeHandle selAvCompletionXHandle = global::ObjCRuntime.Selector.GetHandle ("avCompletion"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvCompletion_X = "setAvCompletion:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvCompletion_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvCompletion:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvExternalStorageDeviceRequestAccessCallbackX = "avExternalStorageDeviceRequestAccessCallback"; + static readonly global::ObjCRuntime.NativeHandle selAvExternalStorageDeviceRequestAccessCallbackXHandle = global::ObjCRuntime.Selector.GetHandle ("avExternalStorageDeviceRequestAccessCallback"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvExternalStorageDeviceRequestAccessCallback_X = "setAvExternalStorageDeviceRequestAccessCallback:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvExternalStorageDeviceRequestAccessCallback_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvExternalStorageDeviceRequestAccessCallback:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvMusicEventEnumerationBlockX = "avMusicEventEnumerationBlock"; + static readonly global::ObjCRuntime.NativeHandle selAvMusicEventEnumerationBlockXHandle = global::ObjCRuntime.Selector.GetHandle ("avMusicEventEnumerationBlock"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvMusicEventEnumerationBlock_X = "setAvMusicEventEnumerationBlock:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvMusicEventEnumerationBlock_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvMusicEventEnumerationBlock:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvMutableCompositionInsertHandlerX = "avMutableCompositionInsertHandler"; + static readonly global::ObjCRuntime.NativeHandle selAvMutableCompositionInsertHandlerXHandle = global::ObjCRuntime.Selector.GetHandle ("avMutableCompositionInsertHandler"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvMutableCompositionInsertHandler_X = "setAvMutableCompositionInsertHandler:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvMutableCompositionInsertHandler_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvMutableCompositionInsertHandler:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvMutableVideoCompositionCreateApplierX = "avMutableVideoCompositionCreateApplier"; + static readonly global::ObjCRuntime.NativeHandle selAvMutableVideoCompositionCreateApplierXHandle = global::ObjCRuntime.Selector.GetHandle ("avMutableVideoCompositionCreateApplier"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvMutableVideoCompositionCreateApplier_X = "setAvMutableVideoCompositionCreateApplier:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvMutableVideoCompositionCreateApplier_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvMutableVideoCompositionCreateApplier:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvMutableVideoCompositionCreateCallbackX = "avMutableVideoCompositionCreateCallback"; + static readonly global::ObjCRuntime.NativeHandle selAvMutableVideoCompositionCreateCallbackXHandle = global::ObjCRuntime.Selector.GetHandle ("avMutableVideoCompositionCreateCallback"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvMutableVideoCompositionCreateCallback_X = "setAvMutableVideoCompositionCreateCallback:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvMutableVideoCompositionCreateCallback_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvMutableVideoCompositionCreateCallback:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallbackX = "avPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback"; + static readonly global::ObjCRuntime.NativeHandle selAvPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallbackXHandle = global::ObjCRuntime.Selector.GetHandle ("avPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback_X = "setAvPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallbackX = "avPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback"; + static readonly global::ObjCRuntime.NativeHandle selAvPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallbackXHandle = global::ObjCRuntime.Selector.GetHandle ("avPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback_X = "setAvPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvPlayerItemIntegratedTimelineSeekCallbackX = "avPlayerItemIntegratedTimelineSeekCallback"; + static readonly global::ObjCRuntime.NativeHandle selAvPlayerItemIntegratedTimelineSeekCallbackXHandle = global::ObjCRuntime.Selector.GetHandle ("avPlayerItemIntegratedTimelineSeekCallback"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvPlayerItemIntegratedTimelineSeekCallback_X = "setAvPlayerItemIntegratedTimelineSeekCallback:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvPlayerItemIntegratedTimelineSeekCallback_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvPlayerItemIntegratedTimelineSeekCallback:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvRequestAccessStatusX = "avRequestAccessStatus"; + static readonly global::ObjCRuntime.NativeHandle selAvRequestAccessStatusXHandle = global::ObjCRuntime.Selector.GetHandle ("avRequestAccessStatus"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvRequestAccessStatus_X = "setAvRequestAccessStatus:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvRequestAccessStatus_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvRequestAccessStatus:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvSampleBufferGeneratorBatchMakeReadyCallbackX = "avSampleBufferGeneratorBatchMakeReadyCallback"; + static readonly global::ObjCRuntime.NativeHandle selAvSampleBufferGeneratorBatchMakeReadyCallbackXHandle = global::ObjCRuntime.Selector.GetHandle ("avSampleBufferGeneratorBatchMakeReadyCallback"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvSampleBufferGeneratorBatchMakeReadyCallback_X = "setAvSampleBufferGeneratorBatchMakeReadyCallback:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvSampleBufferGeneratorBatchMakeReadyCallback_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvSampleBufferGeneratorBatchMakeReadyCallback:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvSampleBufferVideoRendererLoadVideoPerformanceMetricsCallbackX = "avSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback"; + static readonly global::ObjCRuntime.NativeHandle selAvSampleBufferVideoRendererLoadVideoPerformanceMetricsCallbackXHandle = global::ObjCRuntime.Selector.GetHandle ("avSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback_X = "setAvSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvSpeechSynthesisProviderOutputBlockX = "avSpeechSynthesisProviderOutputBlock"; + static readonly global::ObjCRuntime.NativeHandle selAvSpeechSynthesisProviderOutputBlockXHandle = global::ObjCRuntime.Selector.GetHandle ("avSpeechSynthesisProviderOutputBlock"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvSpeechSynthesisProviderOutputBlock_X = "setAvSpeechSynthesisProviderOutputBlock:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvSpeechSynthesisProviderOutputBlock_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvSpeechSynthesisProviderOutputBlock:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvSpeechSynthesizerBufferCallbackX = "avSpeechSynthesizerBufferCallback"; + static readonly global::ObjCRuntime.NativeHandle selAvSpeechSynthesizerBufferCallbackXHandle = global::ObjCRuntime.Selector.GetHandle ("avSpeechSynthesizerBufferCallback"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvSpeechSynthesizerBufferCallback_X = "setAvSpeechSynthesizerBufferCallback:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvSpeechSynthesizerBufferCallback_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvSpeechSynthesizerBufferCallback:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvSpeechSynthesizerMarkerCallbackX = "avSpeechSynthesizerMarkerCallback"; + static readonly global::ObjCRuntime.NativeHandle selAvSpeechSynthesizerMarkerCallbackXHandle = global::ObjCRuntime.Selector.GetHandle ("avSpeechSynthesizerMarkerCallback"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvSpeechSynthesizerMarkerCallback_X = "setAvSpeechSynthesizerMarkerCallback:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvSpeechSynthesizerMarkerCallback_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvSpeechSynthesizerMarkerCallback:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvSpeechSynthesizerRequestPersonalVoiceAuthorizationCallbackX = "avSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback"; + static readonly global::ObjCRuntime.NativeHandle selAvSpeechSynthesizerRequestPersonalVoiceAuthorizationCallbackXHandle = global::ObjCRuntime.Selector.GetHandle ("avSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback_X = "setAvSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvVideoCompositionCreateApplierX = "avVideoCompositionCreateApplier"; + static readonly global::ObjCRuntime.NativeHandle selAvVideoCompositionCreateApplierXHandle = global::ObjCRuntime.Selector.GetHandle ("avVideoCompositionCreateApplier"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvVideoCompositionCreateApplier_X = "setAvVideoCompositionCreateApplier:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvVideoCompositionCreateApplier_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvVideoCompositionCreateApplier:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvVideoCompositionCreateCallbackX = "avVideoCompositionCreateCallback"; + static readonly global::ObjCRuntime.NativeHandle selAvVideoCompositionCreateCallbackXHandle = global::ObjCRuntime.Selector.GetHandle ("avVideoCompositionCreateCallback"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvVideoCompositionCreateCallback_X = "setAvVideoCompositionCreateCallback:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvVideoCompositionCreateCallback_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvVideoCompositionCreateCallback:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selAvVideoCompositionDetermineValidityCallbackX = "avVideoCompositionDetermineValidityCallback"; + static readonly global::ObjCRuntime.NativeHandle selAvVideoCompositionDetermineValidityCallbackXHandle = global::ObjCRuntime.Selector.GetHandle ("avVideoCompositionDetermineValidityCallback"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + const string selSetAvVideoCompositionDetermineValidityCallback_X = "setAvVideoCompositionDetermineValidityCallback:"; + static readonly global::ObjCRuntime.NativeHandle selSetAvVideoCompositionDetermineValidityCallback_XHandle = global::ObjCRuntime.Selector.GetHandle ("setAvVideoCompositionDetermineValidityCallback:"); + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + static readonly global::ObjCRuntime.NativeHandle class_ptr = global::ObjCRuntime.Class.GetHandle ("AVFoundationTrampolines"); + + /// The Objective-C class handle for this class. + /// The pointer to the Objective-C class. + /// + /// Each managed class mirrors an unmanaged Objective-C class. + /// This value contains the pointer to the Objective-C class. + /// It is similar to calling the managed or the native objc_getClass method with the type name. + /// + public override global::ObjCRuntime.NativeHandle ClassHandle => class_ptr; + + /// Creates a new with default values. + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + [DesignatedInitializer] + [Export ("init")] + public AVFoundationTrampolines () : base (global::Foundation.NSObjectFlag.Empty) + { + if (IsDirectBinding) + InitializeHandle (global::ObjCRuntime.Messaging.IntPtr_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("init")), "init"); + else + InitializeHandle (global::ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper (this.SuperHandle, global::ObjCRuntime.Selector.GetHandle ("init")), "init"); + } + + /// Constructor to call on derived classes to skip initialization and merely allocate the object. + /// Unused sentinel value, pass NSObjectFlag.Empty. + /// + /// + /// This constructor should be called by derived classes when they completely construct the object in managed code and merely want the runtime to allocate and initialize the . + /// This is required to implement the two-step initialization process that Objective-C uses, the first step is to perform the object allocation, the second step is to initialize the object. + /// When developers invoke this constructor, they take advantage of a direct path that goes all the way up to to merely allocate the object's memory and bind the Objective-C and C# objects together. + /// The actual initialization of the object is up to the developer. + /// + /// + /// This constructor is typically used by the binding generator to allocate the object, but prevent the actual initialization to take place. + /// Once the allocation has taken place, the constructor has to initialize the object. + /// With constructors generated by the binding generator this means that it manually invokes one of the "init" methods to initialize the object. + /// + /// It is the developer's responsibility to completely initialize the object if they chain up using this constructor chain. + /// + /// In general, if the developer's constructor invokes the corresponding base implementation, then it should also call an Objective-C init method. + /// If this is not the case, developers should instead chain to the proper constructor in their class. + /// + /// + /// The argument value is ignored and merely ensures that the only code that is executed is the construction phase is the basic allocation and runtime type registration. + /// Typically the chaining would look like this: + /// + /// + /// + /// + /// + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + [EditorBrowsable (EditorBrowsableState.Advanced)] + protected AVFoundationTrampolines (global::Foundation.NSObjectFlag t) : base (t) {} + + /// A constructor used when creating managed representations of unmanaged objects. Called by the runtime. + /// Pointer (handle) to the unmanaged object. + /// + /// + /// This constructor is invoked by the runtime infrastructure () to create a new managed representation for a pointer to an unmanaged Objective-C object. + /// Developers should not invoke this method directly, instead they should call as it will prevent two instances of a managed object pointing to the same native object. + /// + /// + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + [EditorBrowsable (EditorBrowsableState.Advanced)] + protected internal AVFoundationTrampolines (global::ObjCRuntime.NativeHandle handle) : base (handle) {} + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler + { + get + { + global::AVFoundation.AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAssetImageGenerateAsynchronouslyForTimeCompletionHandler")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAssetImageGenerateAsynchronouslyForTimeCompletionHandler")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVAssetImageGeneratorCompletionHandler AVAssetImageGeneratorCompletionHandler + { + get + { + global::AVFoundation.AVAssetImageGeneratorCompletionHandler ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAssetImageGeneratorCompletionHandler")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAssetImageGeneratorCompletionHandler")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVAssetImageGeneratorCompletionHandler2 AVAssetImageGeneratorCompletionHandler2 + { + get + { + global::AVFoundation.AVAssetImageGeneratorCompletionHandler2 ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAssetImageGeneratorCompletionHandler2")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAssetImageGeneratorCompletionHandler2")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler AVAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler + { + get + { + global::AVFoundation.AVAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVAudioConverterInputHandler AVAudioConverterInputHandler + { + get + { + global::AVFoundation.AVAudioConverterInputHandler ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAudioConverterInputHandler")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAudioConverterInputHandler")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVAudioEngineManualRenderingBlock AVAudioEngineManualRenderingBlock + { + get + { + global::AVFoundation.AVAudioEngineManualRenderingBlock ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAudioEngineManualRenderingBlock")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAudioEngineManualRenderingBlock")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVAudioInputNodeMutedSpeechEventListener AVAudioInputNodeMutedSpeechEventListener + { + get + { + global::AVFoundation.AVAudioInputNodeMutedSpeechEventListener ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAudioInputNodeMutedSpeechEventListener")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAudioInputNodeMutedSpeechEventListener")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVAudioIONodeInputBlock AVAudioIONodeInputBlock + { + get + { + global::AVFoundation.AVAudioIONodeInputBlock ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAudioIONodeInputBlock")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAudioIONodeInputBlock")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVAudioNodeTapBlock AVAudioNodeTapBlock + { + get + { + global::AVFoundation.AVAudioNodeTapBlock ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAudioNodeTapBlock")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAudioNodeTapBlock")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVAudioSequencerUserCallback AVAudioSequencerUserCallback + { + get + { + global::AVFoundation.AVAudioSequencerUserCallback ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAudioSequencerUserCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAudioSequencerUserCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVAudioSinkNodeReceiverHandlerRaw AVAudioSinkNodeReceiverHandlerRaw + { + get + { + global::AVFoundation.AVAudioSinkNodeReceiverHandlerRaw ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAudioSinkNodeReceiverHandlerRaw")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAudioSinkNodeReceiverHandlerRaw")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVAudioSourceNodeRenderHandlerRaw AVAudioSourceNodeRenderHandlerRaw + { + get + { + global::AVFoundation.AVAudioSourceNodeRenderHandlerRaw ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAudioSourceNodeRenderHandlerRaw")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAudioSourceNodeRenderHandlerRaw")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVAudioUnitComponentFilter AVAudioUnitComponentFilter + { + get + { + global::AVFoundation.AVAudioUnitComponentFilter ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAudioUnitComponentFilter")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avAudioUnitComponentFilter")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVCaptureCompletionHandler AVCaptureCompletionHandler + { + get + { + global::AVFoundation.AVCaptureCompletionHandler ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avCaptureCompletionHandler")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avCaptureCompletionHandler")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVCaptureIndexPickerCallback AVCaptureIndexPickerCallback + { + get + { + global::AVFoundation.AVCaptureIndexPickerCallback ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avCaptureIndexPickerCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avCaptureIndexPickerCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVCaptureIndexPickerTitleTransform AVCaptureIndexPickerTitleTransform + { + get + { + global::AVFoundation.AVCaptureIndexPickerTitleTransform ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avCaptureIndexPickerTitleTransform")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avCaptureIndexPickerTitleTransform")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVCaptureSliderCallback AVCaptureSliderCallback + { + get + { + global::AVFoundation.AVCaptureSliderCallback ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avCaptureSliderCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avCaptureSliderCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVCaptureSystemExposureBiasSliderCallback AVCaptureSystemExposureBiasSliderCallback + { + get + { + global::AVFoundation.AVCaptureSystemExposureBiasSliderCallback ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avCaptureSystemExposureBiasSliderCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avCaptureSystemExposureBiasSliderCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVCaptureSystemZoomSliderCallback AVCaptureSystemZoomSliderCallback + { + get + { + global::AVFoundation.AVCaptureSystemZoomSliderCallback ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avCaptureSystemZoomSliderCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avCaptureSystemZoomSliderCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVCompletion AVCompletion + { + get + { + global::AVFoundation.AVCompletion ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avCompletion")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avCompletion")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVExternalStorageDeviceRequestAccessCallback AVExternalStorageDeviceRequestAccessCallback + { + get + { + global::AVFoundation.AVExternalStorageDeviceRequestAccessCallback ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avExternalStorageDeviceRequestAccessCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avExternalStorageDeviceRequestAccessCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVMusicEventEnumerationBlock AVMusicEventEnumerationBlock + { + get + { + global::AVFoundation.AVMusicEventEnumerationBlock ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avMusicEventEnumerationBlock")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avMusicEventEnumerationBlock")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVMutableCompositionInsertHandler AVMutableCompositionInsertHandler + { + get + { + global::AVFoundation.AVMutableCompositionInsertHandler ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avMutableCompositionInsertHandler")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avMutableCompositionInsertHandler")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVMutableVideoCompositionCreateApplier AVMutableVideoCompositionCreateApplier + { + get + { + global::AVFoundation.AVMutableVideoCompositionCreateApplier ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avMutableVideoCompositionCreateApplier")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avMutableVideoCompositionCreateApplier")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVMutableVideoCompositionCreateCallback AVMutableVideoCompositionCreateCallback + { + get + { + global::AVFoundation.AVMutableVideoCompositionCreateCallback ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avMutableVideoCompositionCreateCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avMutableVideoCompositionCreateCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback AVPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback + { + get + { + global::AVFoundation.AVPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback AVPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback + { + get + { + global::AVFoundation.AVPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVPlayerItemIntegratedTimelineSeekCallback AVPlayerItemIntegratedTimelineSeekCallback + { + get + { + global::AVFoundation.AVPlayerItemIntegratedTimelineSeekCallback ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avPlayerItemIntegratedTimelineSeekCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avPlayerItemIntegratedTimelineSeekCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVRequestAccessStatus AVRequestAccessStatus + { + get + { + global::AVFoundation.AVRequestAccessStatus ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avRequestAccessStatus")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avRequestAccessStatus")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVSampleBufferGeneratorBatchMakeReadyCallback AVSampleBufferGeneratorBatchMakeReadyCallback + { + get + { + global::AVFoundation.AVSampleBufferGeneratorBatchMakeReadyCallback ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avSampleBufferGeneratorBatchMakeReadyCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avSampleBufferGeneratorBatchMakeReadyCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback AVSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback + { + get + { + global::AVFoundation.AVSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVSpeechSynthesisProviderOutputBlock AVSpeechSynthesisProviderOutputBlock + { + get + { + global::AVFoundation.AVSpeechSynthesisProviderOutputBlock ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avSpeechSynthesisProviderOutputBlock")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avSpeechSynthesisProviderOutputBlock")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVSpeechSynthesizerBufferCallback AVSpeechSynthesizerBufferCallback + { + get + { + global::AVFoundation.AVSpeechSynthesizerBufferCallback ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avSpeechSynthesizerBufferCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avSpeechSynthesizerBufferCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVSpeechSynthesizerMarkerCallback AVSpeechSynthesizerMarkerCallback + { + get + { + global::AVFoundation.AVSpeechSynthesizerMarkerCallback ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avSpeechSynthesizerMarkerCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avSpeechSynthesizerMarkerCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback AVSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback + { + get + { + global::AVFoundation.AVSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVVideoCompositionCreateApplier AVVideoCompositionCreateApplier + { + get + { + global::AVFoundation.AVVideoCompositionCreateApplier ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avVideoCompositionCreateApplier")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avVideoCompositionCreateApplier")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVVideoCompositionCreateCallback AVVideoCompositionCreateCallback + { + get + { + global::AVFoundation.AVVideoCompositionCreateCallback ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avVideoCompositionCreateCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avVideoCompositionCreateCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + public partial global::AVFoundation.AVVideoCompositionDetermineValidityCallback AVVideoCompositionDetermineValidityCallback + { + get + { + global::AVFoundation.AVVideoCompositionDetermineValidityCallback ret; + if (IsDirectBinding) { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avVideoCompositionDetermineValidityCallback")); + } else { + ret = global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, global::ObjCRuntime.Selector.GetHandle ("avVideoCompositionDetermineValidityCallback")); + } + GC.KeepAlive (this); + return ret; + } + + set + { + throw new NotImplementedException(); + } + } + // TODO: add binding code here +} diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/Trampolines/ExpectedAVFoundationTrampolinesTrampolines.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/Trampolines/ExpectedAVFoundationTrampolinesTrampolines.cs new file mode 100644 index 000000000000..cc1a26df6913 --- /dev/null +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/Trampolines/ExpectedAVFoundationTrampolinesTrampolines.cs @@ -0,0 +1,1369 @@ +// + +#nullable enable + +using AVFoundation; +using Foundation; +using ObjCBindings; +using ObjCRuntime; +using System; + +namespace ObjCRuntime; + +static partial class Trampolines +{ + // Generate trampolines for compilation + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler))] + unsafe internal delegate void DAVAssetImageGenerateAsynchronouslyForTimeCompletionHandler (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle imageRef, global::CoreMedia.CMTime actualTime, global::ObjCRuntime.NativeHandle error); + + /// This class bridges native block invocations that call into C# + static internal class SDAVAssetImageGenerateAsynchronouslyForTimeCompletionHandler + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle imageRef, global::CoreMedia.CMTime actualTime, global::ObjCRuntime.NativeHandle error) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (global::ObjCRuntime.Runtime.GetINativeObject (imageRef, false)!, actualTime, global::ObjCRuntime.Runtime.GetNSObject (error)!); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVAssetImageGenerateAsynchronouslyForTimeCompletionHandler), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVAssetImageGeneratorCompletionHandler))] + unsafe internal delegate void DAVAssetImageGeneratorCompletionHandler (global::System.IntPtr block_ptr, global::CoreMedia.CMTime requestedTime, IntPtr imageRef, global::CoreMedia.CMTime actualTime, global::System.IntPtr result, global::ObjCRuntime.NativeHandle error); + + /// This class bridges native block invocations that call into C# + static internal class SDAVAssetImageGeneratorCompletionHandler + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVAssetImageGeneratorCompletionHandler))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::CoreMedia.CMTime requestedTime, IntPtr imageRef, global::CoreMedia.CMTime actualTime, global::System.IntPtr result, global::ObjCRuntime.NativeHandle error) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (requestedTime, imageRef, actualTime, (global::AVFoundation.AVAssetImageGeneratorResult) (long) result, global::ObjCRuntime.Runtime.GetNSObject (error)!); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVAssetImageGeneratorCompletionHandler? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVAssetImageGeneratorCompletionHandler callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVAssetImageGeneratorCompletionHandler), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVAssetImageGeneratorCompletionHandler + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVAssetImageGeneratorCompletionHandler2))] + unsafe internal delegate void DAVAssetImageGeneratorCompletionHandler2 (global::System.IntPtr block_ptr, global::CoreMedia.CMTime requestedTime, global::ObjCRuntime.NativeHandle imageRef, global::CoreMedia.CMTime actualTime, global::System.IntPtr result, global::ObjCRuntime.NativeHandle error); + + /// This class bridges native block invocations that call into C# + static internal class SDAVAssetImageGeneratorCompletionHandler2 + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVAssetImageGeneratorCompletionHandler2))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::CoreMedia.CMTime requestedTime, global::ObjCRuntime.NativeHandle imageRef, global::CoreMedia.CMTime actualTime, global::System.IntPtr result, global::ObjCRuntime.NativeHandle error) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (requestedTime, global::ObjCRuntime.Runtime.GetINativeObject (imageRef, false)!, actualTime, (global::AVFoundation.AVAssetImageGeneratorResult) (long) result, global::ObjCRuntime.Runtime.GetNSObject (error)!); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVAssetImageGeneratorCompletionHandler2? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVAssetImageGeneratorCompletionHandler2 callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVAssetImageGeneratorCompletionHandler2), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVAssetImageGeneratorCompletionHandler2 + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler))] + unsafe internal delegate void DAVAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle playbackConfigurationOptions); + + /// This class bridges native block invocations that call into C# + static internal class SDAVAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle playbackConfigurationOptions) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (global::CoreFoundation.CFArray.StringArrayFromHandle (playbackConfigurationOptions)!); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVAssetPlaybackAssistantLoadPlaybackConfigurationOptionsHandler + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVAudioConverterInputHandler))] + unsafe internal delegate global::ObjCRuntime.NativeHandle DAVAudioConverterInputHandler (global::System.IntPtr block_ptr, uint inNumberOfPackets, global::System.IntPtr* outStatus); + + /// This class bridges native block invocations that call into C# + static internal class SDAVAudioConverterInputHandler + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVAudioConverterInputHandler))] + internal static unsafe global::ObjCRuntime.NativeHandle Invoke (global::System.IntPtr block_ptr, uint inNumberOfPackets, global::System.IntPtr* outStatus) + { + *outStatus = default; + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + var ret = del (inNumberOfPackets, out global::System.Runtime.CompilerServices.Unsafe.AsRef (outStatus)); + return global::ObjCRuntime.Runtime.RetainAndAutoreleaseNSObject (ret); + } + return default; + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVAudioConverterInputHandler? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVAudioConverterInputHandler callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVAudioConverterInputHandler), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVAudioConverterInputHandler + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVAudioEngineManualRenderingBlock))] + unsafe internal delegate global::System.IntPtr DAVAudioEngineManualRenderingBlock (global::System.IntPtr block_ptr, uint numberOfFrames, global::ObjCRuntime.NativeHandle outBuffer, int* outError); + + /// This class bridges native block invocations that call into C# + static internal class SDAVAudioEngineManualRenderingBlock + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVAudioEngineManualRenderingBlock))] + internal static unsafe global::System.IntPtr Invoke (global::System.IntPtr block_ptr, uint numberOfFrames, global::ObjCRuntime.NativeHandle outBuffer, int* outError) + { + *outError = default; + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + var ret = del (numberOfFrames, new global::AudioToolbox.AudioBuffers (outBuffer), ref global::System.Runtime.CompilerServices.Unsafe.AsRef (outError)); + return (IntPtr) (long) ret; + } + return default; + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVAudioEngineManualRenderingBlock? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVAudioEngineManualRenderingBlock callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVAudioEngineManualRenderingBlock), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVAudioEngineManualRenderingBlock + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVAudioIONodeInputBlock))] + unsafe internal delegate global::ObjCRuntime.NativeHandle DAVAudioIONodeInputBlock (global::System.IntPtr block_ptr, uint frameCount); + + /// This class bridges native block invocations that call into C# + static internal class SDAVAudioIONodeInputBlock + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVAudioIONodeInputBlock))] + internal static unsafe global::ObjCRuntime.NativeHandle Invoke (global::System.IntPtr block_ptr, uint frameCount) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + var ret = del (frameCount); + return global::ObjCRuntime.Runtime.RetainAndAutoreleaseNativeObject (ret); + } + return default; + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVAudioIONodeInputBlock? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVAudioIONodeInputBlock callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVAudioIONodeInputBlock), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVAudioIONodeInputBlock + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVAudioInputNodeMutedSpeechEventListener))] + unsafe internal delegate void DAVAudioInputNodeMutedSpeechEventListener (global::System.IntPtr block_ptr, global::System.IntPtr event); + + /// This class bridges native block invocations that call into C# + static internal class SDAVAudioInputNodeMutedSpeechEventListener + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVAudioInputNodeMutedSpeechEventListener))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::System.IntPtr event) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del ((global::AVFoundation.AVAudioVoiceProcessingSpeechActivityEvent) (long) event); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVAudioInputNodeMutedSpeechEventListener? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVAudioInputNodeMutedSpeechEventListener callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVAudioInputNodeMutedSpeechEventListener), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVAudioInputNodeMutedSpeechEventListener + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVAudioNodeTapBlock))] + unsafe internal delegate void DAVAudioNodeTapBlock (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle buffer, global::ObjCRuntime.NativeHandle when); + + /// This class bridges native block invocations that call into C# + static internal class SDAVAudioNodeTapBlock + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVAudioNodeTapBlock))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle buffer, global::ObjCRuntime.NativeHandle when) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (global::ObjCRuntime.Runtime.GetNSObject (buffer)!, global::ObjCRuntime.Runtime.GetNSObject (when)!); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVAudioNodeTapBlock? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVAudioNodeTapBlock callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVAudioNodeTapBlock), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVAudioNodeTapBlock + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVAudioSequencerUserCallback))] + unsafe internal delegate void DAVAudioSequencerUserCallback (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle track, global::ObjCRuntime.NativeHandle userData, double timeStamp); + + /// This class bridges native block invocations that call into C# + static internal class SDAVAudioSequencerUserCallback + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVAudioSequencerUserCallback))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle track, global::ObjCRuntime.NativeHandle userData, double timeStamp) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (global::ObjCRuntime.Runtime.GetNSObject (track)!, global::ObjCRuntime.Runtime.GetNSObject (userData)!, timeStamp); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVAudioSequencerUserCallback? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVAudioSequencerUserCallback callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVAudioSequencerUserCallback), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVAudioSequencerUserCallback + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVAudioSinkNodeReceiverHandlerRaw))] + unsafe internal delegate int DAVAudioSinkNodeReceiverHandlerRaw (global::System.IntPtr block_ptr, IntPtr timestamp, uint frameCount, IntPtr inputData); + + /// This class bridges native block invocations that call into C# + static internal class SDAVAudioSinkNodeReceiverHandlerRaw + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVAudioSinkNodeReceiverHandlerRaw))] + internal static unsafe int Invoke (global::System.IntPtr block_ptr, IntPtr timestamp, uint frameCount, IntPtr inputData) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + var ret = del (timestamp, frameCount, inputData); + return ret; + } + return default; + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVAudioSinkNodeReceiverHandlerRaw? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVAudioSinkNodeReceiverHandlerRaw callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVAudioSinkNodeReceiverHandlerRaw), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVAudioSinkNodeReceiverHandlerRaw + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVAudioSourceNodeRenderHandlerRaw))] + unsafe internal delegate int DAVAudioSourceNodeRenderHandlerRaw (global::System.IntPtr block_ptr, IntPtr isSilence, IntPtr timestamp, uint frameCount, IntPtr outputData); + + /// This class bridges native block invocations that call into C# + static internal class SDAVAudioSourceNodeRenderHandlerRaw + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVAudioSourceNodeRenderHandlerRaw))] + internal static unsafe int Invoke (global::System.IntPtr block_ptr, IntPtr isSilence, IntPtr timestamp, uint frameCount, IntPtr outputData) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + var ret = del (isSilence, timestamp, frameCount, outputData); + return ret; + } + return default; + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVAudioSourceNodeRenderHandlerRaw? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVAudioSourceNodeRenderHandlerRaw callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVAudioSourceNodeRenderHandlerRaw), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVAudioSourceNodeRenderHandlerRaw + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVAudioUnitComponentFilter))] + unsafe internal delegate byte DAVAudioUnitComponentFilter (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle comp, byte* stop); + + /// This class bridges native block invocations that call into C# + static internal class SDAVAudioUnitComponentFilter + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVAudioUnitComponentFilter))] + internal static unsafe byte Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle comp, byte* stop) + { + *stop = default; + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + bool __xamarin_bool__1 = *stop != 0; + var ret = del (global::ObjCRuntime.Runtime.GetNSObject (comp)!, ref __xamarin_bool__1); + *stop = __xamarin_bool__1 ? (byte)1 : (byte)0; + return ret ? (byte) 1 : (byte) 0; + } + return default; + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVAudioUnitComponentFilter? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVAudioUnitComponentFilter callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVAudioUnitComponentFilter), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVAudioUnitComponentFilter + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVCaptureCompletionHandler))] + unsafe internal delegate void DAVCaptureCompletionHandler (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle imageDataSampleBuffer, global::ObjCRuntime.NativeHandle error); + + /// This class bridges native block invocations that call into C# + static internal class SDAVCaptureCompletionHandler + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVCaptureCompletionHandler))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle imageDataSampleBuffer, global::ObjCRuntime.NativeHandle error) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (imageDataSampleBuffer == IntPtr.Zero ? null! : new global::CoreMedia.CMSampleBuffer (imageDataSampleBuffer, false), global::ObjCRuntime.Runtime.GetNSObject (error)!); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVCaptureCompletionHandler? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVCaptureCompletionHandler callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVCaptureCompletionHandler), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVCaptureCompletionHandler + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVCaptureIndexPickerCallback))] + unsafe internal delegate void DAVCaptureIndexPickerCallback (global::System.IntPtr block_ptr, IntPtr newValue); + + /// This class bridges native block invocations that call into C# + static internal class SDAVCaptureIndexPickerCallback + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVCaptureIndexPickerCallback))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, IntPtr newValue) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (newValue); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVCaptureIndexPickerCallback? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVCaptureIndexPickerCallback callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVCaptureIndexPickerCallback), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVCaptureIndexPickerCallback + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVCaptureIndexPickerTitleTransform))] + unsafe internal delegate global::ObjCRuntime.NativeHandle DAVCaptureIndexPickerTitleTransform (global::System.IntPtr block_ptr, IntPtr index); + + /// This class bridges native block invocations that call into C# + static internal class SDAVCaptureIndexPickerTitleTransform + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVCaptureIndexPickerTitleTransform))] + internal static unsafe global::ObjCRuntime.NativeHandle Invoke (global::System.IntPtr block_ptr, IntPtr index) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + var ret = del (index); + return NFString.CreateNative (ret, true); + } + return default; + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVCaptureIndexPickerTitleTransform? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVCaptureIndexPickerTitleTransform callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVCaptureIndexPickerTitleTransform), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVCaptureIndexPickerTitleTransform + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVCaptureSliderCallback))] + unsafe internal delegate void DAVCaptureSliderCallback (global::System.IntPtr block_ptr, float newValue); + + /// This class bridges native block invocations that call into C# + static internal class SDAVCaptureSliderCallback + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVCaptureSliderCallback))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, float newValue) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (newValue); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVCaptureSliderCallback? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVCaptureSliderCallback callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVCaptureSliderCallback), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVCaptureSliderCallback + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVCaptureSystemExposureBiasSliderCallback))] + unsafe internal delegate void DAVCaptureSystemExposureBiasSliderCallback (global::System.IntPtr block_ptr, global::System.Runtime.InteropServices.NFloat exposureTargetBias); + + /// This class bridges native block invocations that call into C# + static internal class SDAVCaptureSystemExposureBiasSliderCallback + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVCaptureSystemExposureBiasSliderCallback))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::System.Runtime.InteropServices.NFloat exposureTargetBias) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (exposureTargetBias); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVCaptureSystemExposureBiasSliderCallback? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVCaptureSystemExposureBiasSliderCallback callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVCaptureSystemExposureBiasSliderCallback), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVCaptureSystemExposureBiasSliderCallback + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVCaptureSystemZoomSliderCallback))] + unsafe internal delegate void DAVCaptureSystemZoomSliderCallback (global::System.IntPtr block_ptr, global::System.Runtime.InteropServices.NFloat videoZoomFactor); + + /// This class bridges native block invocations that call into C# + static internal class SDAVCaptureSystemZoomSliderCallback + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVCaptureSystemZoomSliderCallback))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::System.Runtime.InteropServices.NFloat videoZoomFactor) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (videoZoomFactor); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVCaptureSystemZoomSliderCallback? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVCaptureSystemZoomSliderCallback callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVCaptureSystemZoomSliderCallback), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVCaptureSystemZoomSliderCallback + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVCompletion))] + unsafe internal delegate void DAVCompletion (global::System.IntPtr block_ptr, byte finished); + + /// This class bridges native block invocations that call into C# + static internal class SDAVCompletion + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVCompletion))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, byte finished) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (finished != 0); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVCompletion? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVCompletion callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVCompletion), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVCompletion + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVExternalStorageDeviceRequestAccessCallback))] + unsafe internal delegate void DAVExternalStorageDeviceRequestAccessCallback (global::System.IntPtr block_ptr, byte granted); + + /// This class bridges native block invocations that call into C# + static internal class SDAVExternalStorageDeviceRequestAccessCallback + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVExternalStorageDeviceRequestAccessCallback))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, byte granted) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (granted != 0); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVExternalStorageDeviceRequestAccessCallback? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVExternalStorageDeviceRequestAccessCallback callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVExternalStorageDeviceRequestAccessCallback), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVExternalStorageDeviceRequestAccessCallback + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVMusicEventEnumerationBlock))] + unsafe internal delegate void DAVMusicEventEnumerationBlock (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle event, double* timeStamp, byte* removeEvent); + + /// This class bridges native block invocations that call into C# + static internal class SDAVMusicEventEnumerationBlock + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVMusicEventEnumerationBlock))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle event, double* timeStamp, byte* removeEvent) + { + *timeStamp = default; + *removeEvent = default; + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + bool __xamarin_bool__2 = *removeEvent != 0; + del (global::ObjCRuntime.Runtime.GetNSObject (event)!, out global::System.Runtime.CompilerServices.Unsafe.AsRef (timeStamp), out __xamarin_bool__2); + *removeEvent = __xamarin_bool__2 ? (byte)1 : (byte)0; + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVMusicEventEnumerationBlock? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVMusicEventEnumerationBlock callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVMusicEventEnumerationBlock), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVMusicEventEnumerationBlock + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVMutableCompositionInsertHandler))] + unsafe internal delegate void DAVMutableCompositionInsertHandler (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle error); + + /// This class bridges native block invocations that call into C# + static internal class SDAVMutableCompositionInsertHandler + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVMutableCompositionInsertHandler))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle error) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (global::ObjCRuntime.Runtime.GetNSObject (error)!); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVMutableCompositionInsertHandler? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVMutableCompositionInsertHandler callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVMutableCompositionInsertHandler), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVMutableCompositionInsertHandler + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVMutableVideoCompositionCreateApplier))] + unsafe internal delegate void DAVMutableVideoCompositionCreateApplier (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle request); + + /// This class bridges native block invocations that call into C# + static internal class SDAVMutableVideoCompositionCreateApplier + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVMutableVideoCompositionCreateApplier))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle request) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (global::ObjCRuntime.Runtime.GetNSObject (request)!); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVMutableVideoCompositionCreateApplier? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVMutableVideoCompositionCreateApplier callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVMutableVideoCompositionCreateApplier), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVMutableVideoCompositionCreateApplier + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVMutableVideoCompositionCreateCallback))] + unsafe internal delegate void DAVMutableVideoCompositionCreateCallback (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle videoComposition, global::ObjCRuntime.NativeHandle error); + + /// This class bridges native block invocations that call into C# + static internal class SDAVMutableVideoCompositionCreateCallback + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVMutableVideoCompositionCreateCallback))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle videoComposition, global::ObjCRuntime.NativeHandle error) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (global::ObjCRuntime.Runtime.GetNSObject (videoComposition)!, global::ObjCRuntime.Runtime.GetNSObject (error)!); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVMutableVideoCompositionCreateCallback? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVMutableVideoCompositionCreateCallback callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVMutableVideoCompositionCreateCallback), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVMutableVideoCompositionCreateCallback + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback))] + unsafe internal delegate void DAVPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback (global::System.IntPtr block_ptr, byte success); + + /// This class bridges native block invocations that call into C# + static internal class SDAVPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, byte success) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (success != 0); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback))] + unsafe internal delegate void DAVPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback (global::System.IntPtr block_ptr, global::CoreMedia.CMTime time); + + /// This class bridges native block invocations that call into C# + static internal class SDAVPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::CoreMedia.CMTime time) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (time); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVPlayerItemIntegratedTimelineAddPeriodicTimeObserverCallback + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVPlayerItemIntegratedTimelineSeekCallback))] + unsafe internal delegate void DAVPlayerItemIntegratedTimelineSeekCallback (global::System.IntPtr block_ptr, byte success); + + /// This class bridges native block invocations that call into C# + static internal class SDAVPlayerItemIntegratedTimelineSeekCallback + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVPlayerItemIntegratedTimelineSeekCallback))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, byte success) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (success != 0); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVPlayerItemIntegratedTimelineSeekCallback? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVPlayerItemIntegratedTimelineSeekCallback callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVPlayerItemIntegratedTimelineSeekCallback), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVPlayerItemIntegratedTimelineSeekCallback + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVRequestAccessStatus))] + unsafe internal delegate void DAVRequestAccessStatus (global::System.IntPtr block_ptr, byte accessGranted); + + /// This class bridges native block invocations that call into C# + static internal class SDAVRequestAccessStatus + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVRequestAccessStatus))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, byte accessGranted) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (accessGranted != 0); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVRequestAccessStatus? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVRequestAccessStatus callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVRequestAccessStatus), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVRequestAccessStatus + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVSampleBufferGeneratorBatchMakeReadyCallback))] + unsafe internal delegate void DAVSampleBufferGeneratorBatchMakeReadyCallback (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle error); + + /// This class bridges native block invocations that call into C# + static internal class SDAVSampleBufferGeneratorBatchMakeReadyCallback + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVSampleBufferGeneratorBatchMakeReadyCallback))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle error) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (global::ObjCRuntime.Runtime.GetNSObject (error)!); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVSampleBufferGeneratorBatchMakeReadyCallback? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVSampleBufferGeneratorBatchMakeReadyCallback callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVSampleBufferGeneratorBatchMakeReadyCallback), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVSampleBufferGeneratorBatchMakeReadyCallback + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback))] + unsafe internal delegate void DAVSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle videoPerformanceMetrics); + + /// This class bridges native block invocations that call into C# + static internal class SDAVSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle videoPerformanceMetrics) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (global::ObjCRuntime.Runtime.GetNSObject (videoPerformanceMetrics)!); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVSampleBufferVideoRendererLoadVideoPerformanceMetricsCallback + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVSpeechSynthesisProviderOutputBlock))] + unsafe internal delegate void DAVSpeechSynthesisProviderOutputBlock (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle markers, global::ObjCRuntime.NativeHandle request); + + /// This class bridges native block invocations that call into C# + static internal class SDAVSpeechSynthesisProviderOutputBlock + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVSpeechSynthesisProviderOutputBlock))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle markers, global::ObjCRuntime.NativeHandle request) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (global::CoreFoundation.CFArray.ArrayFromHandle (markers)!, global::ObjCRuntime.Runtime.GetNSObject (request)!); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVSpeechSynthesisProviderOutputBlock? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVSpeechSynthesisProviderOutputBlock callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVSpeechSynthesisProviderOutputBlock), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVSpeechSynthesisProviderOutputBlock + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVSpeechSynthesizerBufferCallback))] + unsafe internal delegate void DAVSpeechSynthesizerBufferCallback (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle buffer); + + /// This class bridges native block invocations that call into C# + static internal class SDAVSpeechSynthesizerBufferCallback + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVSpeechSynthesizerBufferCallback))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle buffer) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (global::ObjCRuntime.Runtime.GetNSObject (buffer)!); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVSpeechSynthesizerBufferCallback? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVSpeechSynthesizerBufferCallback callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVSpeechSynthesizerBufferCallback), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVSpeechSynthesizerBufferCallback + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVSpeechSynthesizerMarkerCallback))] + unsafe internal delegate void DAVSpeechSynthesizerMarkerCallback (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle markers); + + /// This class bridges native block invocations that call into C# + static internal class SDAVSpeechSynthesizerMarkerCallback + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVSpeechSynthesizerMarkerCallback))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle markers) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (global::CoreFoundation.CFArray.ArrayFromHandle (markers)!); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVSpeechSynthesizerMarkerCallback? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVSpeechSynthesizerMarkerCallback callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVSpeechSynthesizerMarkerCallback), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVSpeechSynthesizerMarkerCallback + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback))] + unsafe internal delegate void DAVSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback (global::System.IntPtr block_ptr, global::System.UIntPtr status); + + /// This class bridges native block invocations that call into C# + static internal class SDAVSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::System.UIntPtr status) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del ((global::AVFoundation.AVSpeechSynthesisPersonalVoiceAuthorizationStatus) (ulong) status); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVSpeechSynthesizerRequestPersonalVoiceAuthorizationCallback + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVVideoCompositionCreateApplier))] + unsafe internal delegate void DAVVideoCompositionCreateApplier (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle applier); + + /// This class bridges native block invocations that call into C# + static internal class SDAVVideoCompositionCreateApplier + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVVideoCompositionCreateApplier))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle applier) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (global::ObjCRuntime.Runtime.GetNSObject (applier)!); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVVideoCompositionCreateApplier? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVVideoCompositionCreateApplier callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVVideoCompositionCreateApplier), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVVideoCompositionCreateApplier + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVVideoCompositionCreateCallback))] + unsafe internal delegate void DAVVideoCompositionCreateCallback (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle videoComposition, global::ObjCRuntime.NativeHandle error); + + /// This class bridges native block invocations that call into C# + static internal class SDAVVideoCompositionCreateCallback + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVVideoCompositionCreateCallback))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, global::ObjCRuntime.NativeHandle videoComposition, global::ObjCRuntime.NativeHandle error) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (global::ObjCRuntime.Runtime.GetNSObject (videoComposition)!, global::ObjCRuntime.Runtime.GetNSObject (error)!); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVVideoCompositionCreateCallback? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVVideoCompositionCreateCallback callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVVideoCompositionCreateCallback), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVVideoCompositionCreateCallback + + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] + [UserDelegateType (typeof (global::AVFoundation.AVVideoCompositionDetermineValidityCallback))] + unsafe internal delegate void DAVVideoCompositionDetermineValidityCallback (global::System.IntPtr block_ptr, byte isValid, global::ObjCRuntime.NativeHandle error); + + /// This class bridges native block invocations that call into C# + static internal class SDAVVideoCompositionDetermineValidityCallback + { + [Preserve (Conditional = true)] + [UnmanagedCallersOnly] + [UserDelegateType (typeof (global::AVFoundation.AVVideoCompositionDetermineValidityCallback))] + internal static unsafe void Invoke (global::System.IntPtr block_ptr, byte isValid, global::ObjCRuntime.NativeHandle error) + { + var del = global::ObjCRuntime.BlockLiteral.GetTarget (block_ptr); + if (del is not null) + { + del (isValid != 0, global::ObjCRuntime.Runtime.GetNSObject (error)!); + } + } + + internal static unsafe global::ObjCRuntime.BlockLiteral CreateNullableBlock (global::AVFoundation.AVVideoCompositionDetermineValidityCallback? callback) + { + if (callback is null) + return default (global::ObjCRuntime.BlockLiteral); + return CreateBlock (callback); + } + + [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] + internal static unsafe global::ObjCRuntime.BlockLiteral CreateBlock (global::AVFoundation.AVVideoCompositionDetermineValidityCallback callback) + { + delegate* unmanaged trampoline = &Invoke; + return new global::ObjCRuntime.BlockLiteral (trampoline, callback, typeof (SDAVVideoCompositionDetermineValidityCallback), nameof (Invoke)); + } + } + // TODO: generate trampoline for AVFoundation.AVVideoCompositionDetermineValidityCallback + +} From 5a32fc59f62ff96e036062bbc2c0ca6049f6fc94 Mon Sep 17 00:00:00 2001 From: GitHub Actions Autoformatter Date: Wed, 28 May 2025 16:22:03 +0000 Subject: [PATCH 5/5] Auto-format source code --- .../Classes/Data/Trampolines/AVFoundationTrampolines.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/Trampolines/AVFoundationTrampolines.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/Trampolines/AVFoundationTrampolines.cs index 9b55c66061ea..fd60de91d747 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/Trampolines/AVFoundationTrampolines.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/Trampolines/AVFoundationTrampolines.cs @@ -12,7 +12,7 @@ namespace TestNamespace; [BindingType] public class AVFoundationTrampolines { - + [Export ("avAssetImageGenerateAsynchronouslyForTimeCompletionHandler", ArgumentSemantic.Copy)] public partial AVFoundation.AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler AVAssetImageGenerateAsynchronouslyForTimeCompletionHandler { get; set; } @@ -87,7 +87,7 @@ public class AVFoundationTrampolines { [Export ("avMutableVideoCompositionCreateCallback", ArgumentSemantic.Copy)] public partial AVFoundation.AVMutableVideoCompositionCreateCallback AVMutableVideoCompositionCreateCallback { get; set; } - + [Export ("avPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback", ArgumentSemantic.Copy)] public partial AVFoundation.AVPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback AVPlayerItemIntegratedTimelineAddBoundaryTimeObserverCallback { get; set; }