From e37549bc9052bff81d5c7da8a3b7992b47a08154 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Mon, 7 Oct 2019 21:53:04 -0400 Subject: [PATCH 001/100] [Networking] Bring the framework up to Xcode 11.1 (#7091) Add most of the new classes for Networking on Xcode11.1 --- src/Network/NWAdvertiseDescriptor.cs | 15 + src/Network/NWBrowseResult.cs | 90 ++++ src/Network/NWBrowser.cs | 184 +++++++ src/Network/NWBrowserDescriptor.cs | 62 +++ src/Network/NWConnection.cs | 37 ++ src/Network/NWDataTransferReport.cs | 170 +++++++ src/Network/NWEndpoint.cs | 22 + src/Network/NWEstablishmentReport.cs | 134 +++++ src/Network/NWFramer.cs | 468 ++++++++++++++++++ src/Network/NWListener.cs | 14 + src/Network/NWParameters.cs | 15 + src/Network/NWPath.cs | 41 ++ src/Network/NWProtocolDefinition.cs | 6 + src/Network/NWProtocolMetadata.cs | 14 + src/Network/NWProtocolOptions.cs | 16 + src/Network/NWProtocolStack.cs | 12 +- src/Network/NWTxtRecord.cs | 221 +++++++++ src/Network/NWWebSocketMetadata.cs | 122 +++++ src/Network/NWWebSocketOptions.cs | 129 +++++ src/Network/NWWebSocketRequest.cs | 84 ++++ src/Network/NWWebSocketResponse.cs | 83 ++++ src/frameworks.sources | 11 + tests/introspection/ApiCMAttachmentTest.cs | 11 + .../Network/NWBrowserDescriptorTest.cs | 69 +++ tests/monotouch-test/Network/NWBrowserTest.cs | 93 ++++ .../Network/NWEstablishmentReportTest.cs | 135 +++++ .../monotouch-test/Network/NWListenerTest.cs | 57 +++ .../Network/NWParametersTest.cs | 12 + tests/monotouch-test/Network/NWPathTest.cs | 20 + .../Network/NWProtocolDefinitionTest.cs | 68 +++ .../Network/NWProtocolOptionsTest.cs | 19 +- .../Network/NWProtocolStackTest.cs | 20 +- .../monotouch-test/Network/NWTxtRecordTest.cs | 173 +++++++ .../Network/NWWebSocketMetadataTest.cs | 68 +++ .../Network/NWWebSocketOptionsTest.cs | 104 ++++ tests/xtro-sharpie/common-Network.ignore | 10 + tests/xtro-sharpie/iOS-Network.todo | 107 +--- tests/xtro-sharpie/macOS-Network.todo | 107 +--- tests/xtro-sharpie/tvOS-Network.todo | 107 +--- tests/xtro-sharpie/watchOS-Network.todo | 105 +--- 40 files changed, 2808 insertions(+), 427 deletions(-) create mode 100644 src/Network/NWBrowseResult.cs create mode 100644 src/Network/NWBrowser.cs create mode 100644 src/Network/NWBrowserDescriptor.cs create mode 100644 src/Network/NWDataTransferReport.cs create mode 100644 src/Network/NWEstablishmentReport.cs create mode 100644 src/Network/NWFramer.cs create mode 100644 src/Network/NWTxtRecord.cs create mode 100644 src/Network/NWWebSocketMetadata.cs create mode 100644 src/Network/NWWebSocketOptions.cs create mode 100644 src/Network/NWWebSocketRequest.cs create mode 100644 src/Network/NWWebSocketResponse.cs create mode 100644 tests/monotouch-test/Network/NWBrowserDescriptorTest.cs create mode 100644 tests/monotouch-test/Network/NWBrowserTest.cs create mode 100644 tests/monotouch-test/Network/NWEstablishmentReportTest.cs create mode 100644 tests/monotouch-test/Network/NWListenerTest.cs create mode 100644 tests/monotouch-test/Network/NWProtocolDefinitionTest.cs create mode 100644 tests/monotouch-test/Network/NWTxtRecordTest.cs create mode 100644 tests/monotouch-test/Network/NWWebSocketMetadataTest.cs create mode 100644 tests/monotouch-test/Network/NWWebSocketOptionsTest.cs diff --git a/src/Network/NWAdvertiseDescriptor.cs b/src/Network/NWAdvertiseDescriptor.cs index 756bf4df7c..fe18137cea 100644 --- a/src/Network/NWAdvertiseDescriptor.cs +++ b/src/Network/NWAdvertiseDescriptor.cs @@ -14,6 +14,7 @@ using CoreFoundation; using nw_advertise_descriptor_t=System.IntPtr; using OS_nw_advertise_descriptor=System.IntPtr; +using OS_nw_txt_record=System.IntPtr; namespace Network { [TV (12,0), Mac (10,14), iOS (12,0)] @@ -61,5 +62,19 @@ namespace Network { set => nw_advertise_descriptor_set_no_auto_rename (GetCheckedHandle (), value); get => nw_advertise_descriptor_get_no_auto_rename (GetCheckedHandle ()); } + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_txt_record nw_advertise_descriptor_copy_txt_record_object (OS_nw_advertise_descriptor advertise_descriptor); + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + [DllImport (Constants.NetworkLibrary)] + static extern void nw_advertise_descriptor_set_txt_record_object (OS_nw_advertise_descriptor advertise_descriptor, OS_nw_txt_record txt_record); + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public NWTxtRecord TxtRecord { + get => new NWTxtRecord (nw_advertise_descriptor_copy_txt_record_object (GetCheckedHandle ()), owns: true); + set => nw_advertise_descriptor_set_txt_record_object (GetCheckedHandle (), value.GetHandle ()); + } } } diff --git a/src/Network/NWBrowseResult.cs b/src/Network/NWBrowseResult.cs new file mode 100644 index 0000000000..7045bcf3a0 --- /dev/null +++ b/src/Network/NWBrowseResult.cs @@ -0,0 +1,90 @@ +// +// NWBrowseResult.cs: Bindings the Network nw_browse_result_t API. +// +// Authors: +// Manuel de la Pena (mandel@microsoft.com) +// +// Copyright 2019 Microsoft Inc +// +using System; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using ObjCRuntime; +using Foundation; +using CoreFoundation; + +using OS_nw_browse_result=System.IntPtr; +using OS_nw_endpoint=System.IntPtr; +using OS_nw_txt_record=System.IntPtr; + +namespace Network { + + [Flags, TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public enum NWBrowseResultChange : ulong { + Invalid = 0x00, + Identical = 0x01, + ResultAdded = 0x02, + ResultRemoved = 0x04, + TxtRecordChanged = 0x20, + InterfaceAdded = 0x08, + InterfaceRemoved = 0x10, + } + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public class NWBrowseResult : NativeObject { + + internal NWBrowseResult (IntPtr handle, bool owns) : base (handle, owns) {} + + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_endpoint nw_browse_result_copy_endpoint (OS_nw_browse_result result); + + public NWEndpoint EndPoint => new NWEndpoint (nw_browse_result_copy_endpoint (GetCheckedHandle ()), owns: true); + + [DllImport (Constants.NetworkLibrary)] + static extern nuint nw_browse_result_get_interfaces_count (OS_nw_browse_result result); + + public nuint InterfacesCount => nw_browse_result_get_interfaces_count (GetCheckedHandle ()); + + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_txt_record nw_browse_result_copy_txt_record_object (OS_nw_browse_result result); + + public NWTxtRecord TxtRecord => new NWTxtRecord (nw_browse_result_copy_txt_record_object (GetCheckedHandle ()), owns: true); + + [DllImport (Constants.NetworkLibrary)] + static extern NWBrowseResultChange nw_browse_result_get_changes (OS_nw_browse_result old_result, OS_nw_browse_result new_result); + + public static NWBrowseResultChange GetChanges (NWBrowseResult oldResult, NWBrowseResult newResult) + => nw_browse_result_get_changes (oldResult.GetHandle (), newResult.GetHandle ()); + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_browse_result_enumerate_interfaces (OS_nw_browse_result result, ref BlockLiteral enumerator); + + delegate void nw_browse_result_enumerate_interfaces_t (IntPtr block, IntPtr nwInterface); + static nw_browse_result_enumerate_interfaces_t static_EnumerateInterfacesHandler = TrampolineEnumerateInterfacesHandler; + + [MonoPInvokeCallback (typeof (nw_browse_result_enumerate_interfaces_t))] + static void TrampolineEnumerateInterfacesHandler (IntPtr block, IntPtr inter) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + var nwInterface = new NWInterface (inter, owns: false); + del (nwInterface); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public void EnumerateInterfaces (Action handler) + { + if (handler == null) + throw new ArgumentNullException (nameof (handler)); + + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_EnumerateInterfacesHandler, handler); + try { + nw_browse_result_enumerate_interfaces (GetCheckedHandle (), ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } +} diff --git a/src/Network/NWBrowser.cs b/src/Network/NWBrowser.cs new file mode 100644 index 0000000000..abd550aeb8 --- /dev/null +++ b/src/Network/NWBrowser.cs @@ -0,0 +1,184 @@ +// +// NWBrowser.cs: Bindings the Network nw_browser_t API. +// +// Authors: +// Manuel de la Pena (mandel@microsoft.com) +// +// Copyrigh 2019 Microsoft Inc +// +using System; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using ObjCRuntime; +using Foundation; +using CoreFoundation; + +using OS_nw_browser=System.IntPtr; +using OS_nw_browse_descriptor=System.IntPtr; +using OS_nw_parameters=System.IntPtr; +using dispatch_queue_t =System.IntPtr; + +namespace Network { + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public enum NWBrowserState { + Invalid = 0, + Ready = 1, + Failed = 2, + Cancelled = 3, + } + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public class NWBrowser : NativeObject { + + bool started = false; + bool queueSet = false; + object startLock = new Object (); + + internal NWBrowser (IntPtr handle, bool owns) : base (handle, owns) {} + + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_browser nw_browser_create (OS_nw_browse_descriptor descriptor, OS_nw_parameters parameters); + + public NWBrowser (NWBrowserDescriptor descriptor, NWParameters parameters) + { + if (descriptor == null) + throw new ArgumentNullException (nameof (descriptor)); + + InitializeHandle (nw_browser_create (descriptor.Handle, parameters.GetHandle ())); + } + + public NWBrowser (NWBrowserDescriptor descriptor) : this (descriptor, null) {} + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_browser_set_queue (OS_nw_browser browser, dispatch_queue_t queue); + + public void SetDispatchQueue (DispatchQueue queue) + { + if (queue == null) + throw new ArgumentNullException (nameof (queue)); + lock (startLock) { + nw_browser_set_queue (GetCheckedHandle (), queue.Handle); + queueSet = true; + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_browser_start (OS_nw_browser browser); + + public void Start () + { + lock (startLock) { + if (!queueSet) { + throw new InvalidOperationException ("Cannot start the browser without a DispatchQueue."); + } + nw_browser_start (GetCheckedHandle ()); + started = true; + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_browser_cancel (OS_nw_browser browser); + + public void Cancel () + { + lock (startLock) { + try { + nw_browser_cancel (GetCheckedHandle ()); + } finally { + started = false; + } + } + } + + public bool IsActive { + get { + lock (startLock) + return started; + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_browse_descriptor nw_browser_copy_browse_descriptor (OS_nw_browser browser); + + public NWBrowserDescriptor Descriptor + => new NWBrowserDescriptor (nw_browser_copy_browse_descriptor (GetCheckedHandle ()), owns: true); + + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_parameters nw_browser_copy_parameters (OS_nw_browser browser); + + public NWParameters Parameters + => new NWParameters (nw_browser_copy_parameters (GetCheckedHandle ()), owns: true); + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern void nw_browser_set_browse_results_changed_handler (OS_nw_browser browser, void *handler); + + delegate void nw_browser_browse_results_changed_handler_t (IntPtr block, IntPtr oldResult, IntPtr newResult); + static nw_browser_browse_results_changed_handler_t static_ChangesHandler = TrampolineChangesHandler; + + [MonoPInvokeCallback (typeof (nw_browser_browse_results_changed_handler_t))] + static void TrampolineChangesHandler (IntPtr block, IntPtr oldResult, IntPtr newResult) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + using (var nwOldResult = new NWBrowseResult (oldResult, owns: false)) + using (var nwNewResult = new NWBrowseResult (newResult, owns: false)) + del (nwOldResult, nwNewResult); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public void SetChangesHandler (Action handler) + { + unsafe { + if (handler == null) { + nw_browser_set_browse_results_changed_handler (GetCheckedHandle (), null); + return; + } + BlockLiteral block_handler = new BlockLiteral (); + BlockLiteral *block_ptr_handler = &block_handler; + block_handler.SetupBlockUnsafe (static_ChangesHandler, handler); + try { + nw_browser_set_browse_results_changed_handler (GetCheckedHandle (), (void*) block_ptr_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern void nw_browser_set_state_changed_handler (OS_nw_browser browser, void *state_changed_handler); + + delegate void nw_browser_set_state_changed_handler_t (IntPtr block, NWBrowserState state, IntPtr error); + static nw_browser_set_state_changed_handler_t static_StateChangesHandler = TrampolineStateChangesHandler; + + [MonoPInvokeCallback (typeof (nw_browser_set_state_changed_handler_t))] + static void TrampolineStateChangesHandler (IntPtr block, NWBrowserState state, IntPtr error) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + var nwError = (error == IntPtr.Zero)? null : new NWError (error, owns: false); + del (state, nwError); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public void SetStateChangesHandler (Action handler) + { + unsafe { + if (handler == null) { + nw_browser_set_state_changed_handler (GetCheckedHandle (), null); + return; + } + BlockLiteral block_handler = new BlockLiteral (); + BlockLiteral *block_ptr_handler = &block_handler; + block_handler.SetupBlockUnsafe (static_StateChangesHandler, handler); + try { + nw_browser_set_state_changed_handler (GetCheckedHandle (), (void*) block_ptr_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } + } +} diff --git a/src/Network/NWBrowserDescriptor.cs b/src/Network/NWBrowserDescriptor.cs new file mode 100644 index 0000000000..7300cad8f5 --- /dev/null +++ b/src/Network/NWBrowserDescriptor.cs @@ -0,0 +1,62 @@ +// +// NWBrowseDescriptor.cs: Bindings the Network nw_browse_descriptor_t API. +// +// Authors: +// Manuel de la Pena (mandel@microsoft.com) +// +// Copyrigh 2019 Microsoft Inc +// +using System; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using ObjCRuntime; +using Foundation; +using CoreFoundation; + +using OS_nw_browse_descriptor=System.IntPtr; + +namespace Network { + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public class NWBrowserDescriptor: NativeObject { + + internal NWBrowserDescriptor (IntPtr handle, bool owns) : base (handle, owns) {} + + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_browse_descriptor nw_browse_descriptor_create_bonjour_service (string type, string domain); + + public static NWBrowserDescriptor CreateBonjourService (string type, string domain) + { + // domain can be null, type CANNOT + if (type == null) + throw new ArgumentNullException (nameof (type)); + + return new NWBrowserDescriptor (nw_browse_descriptor_create_bonjour_service (type, domain), owns: true); + } + + public static NWBrowserDescriptor CreateBonjourService (string type) => CreateBonjourService (type, null); + + [DllImport (Constants.NetworkLibrary)] + static extern bool nw_browse_descriptor_get_include_txt_record (OS_nw_browse_descriptor descriptor); + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_browse_descriptor_set_include_txt_record (OS_nw_browse_descriptor descriptor, bool include_txt_record); + + public bool IncludeTxtRecord { + get => nw_browse_descriptor_get_include_txt_record (GetCheckedHandle ()); + set => nw_browse_descriptor_set_include_txt_record (GetCheckedHandle (), value); + } + + [DllImport (Constants.NetworkLibrary, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + static extern IntPtr nw_browse_descriptor_get_bonjour_service_type (OS_nw_browse_descriptor descriptor); + + public string BonjourType + => Marshal.PtrToStringAnsi (nw_browse_descriptor_get_bonjour_service_type (GetCheckedHandle ())); + + [DllImport (Constants.NetworkLibrary, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + static extern IntPtr nw_browse_descriptor_get_bonjour_service_domain (OS_nw_browse_descriptor descriptor); + + public string BonjourDomain + => Marshal.PtrToStringAnsi (nw_browse_descriptor_get_bonjour_service_domain (GetCheckedHandle ())); + } +} \ No newline at end of file diff --git a/src/Network/NWConnection.cs b/src/Network/NWConnection.cs index 1a53d35469..6a6bfd2eed 100644 --- a/src/Network/NWConnection.cs +++ b/src/Network/NWConnection.cs @@ -14,6 +14,7 @@ using CoreFoundation; using nw_connection_t=System.IntPtr; using nw_endpoint_t=System.IntPtr; using nw_parameters_t=System.IntPtr; +using nw_establishment_report_t=System.IntPtr; namespace Network { [TV (12,0), Mac (10,14), iOS (12,0)] @@ -503,5 +504,41 @@ namespace Network { { BlockLiteral.SimpleCall (method, (arg)=> nw_connection_batch (GetCheckedHandle (), arg)); } + + [Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] + [DllImport (Constants.NetworkLibrary)] + unsafe static extern void nw_connection_access_establishment_report (IntPtr connection, IntPtr queue, ref BlockLiteral access_block); + + delegate void nw_establishment_report_access_block_t (IntPtr block, nw_establishment_report_t report); + static nw_establishment_report_access_block_t static_GetEstablishmentReportHandler = TrampolineGetEstablishmentReportHandler; + + [MonoPInvokeCallback (typeof (nw_establishment_report_access_block_t))] + static void TrampolineGetEstablishmentReportHandler (IntPtr block, nw_establishment_report_t report) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + // the ownerthip of the object is for the caller + var nwReport = new NWEstablishmentReport (report, owns: true); + del (nwReport); + } + } + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + [BindingImpl (BindingImplOptions.Optimizable)] + public void GetEstablishmentReport (DispatchQueue queue, Action handler) + { + if (queue == null) + throw new ArgumentNullException (nameof (queue)); + if (handler == null) + throw new ArgumentNullException (nameof (handler)); + + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_GetEstablishmentReportHandler, handler); + try { + nw_connection_access_establishment_report (GetCheckedHandle (), queue.Handle, ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } } } diff --git a/src/Network/NWDataTransferReport.cs b/src/Network/NWDataTransferReport.cs new file mode 100644 index 0000000000..1771953f22 --- /dev/null +++ b/src/Network/NWDataTransferReport.cs @@ -0,0 +1,170 @@ +// +// NWDataTransferReport.cs: Bindings the Network nw_data_transfer_report_t API. +// +// Authors: +// Manuel de la Pena (mandel@microsoft.com) +// +// Copyright 2019 Microsoft Inc +// +using System; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using ObjCRuntime; +using Foundation; +using CoreFoundation; + +using OS_nw_data_transfer_report=System.IntPtr; +using OS_nw_connection=System.IntPtr; +using OS_nw_interface=System.IntPtr; + +namespace Network { + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public enum NWDataTransferReportState { + Collecting = 1, + Collected = 2, + } + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public class NWDataTransferReport : NativeObject { + + internal NWDataTransferReport (IntPtr handle, bool owns) : base (handle, owns) {} + + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_data_transfer_report nw_connection_create_new_data_transfer_report (OS_nw_connection connection); + + public NWDataTransferReport (NWConnection connection) + { + if (connection == null) + throw new ArgumentNullException (nameof (connection)); + + InitializeHandle (nw_connection_create_new_data_transfer_report (connection.Handle)); + } + + [DllImport (Constants.NetworkLibrary)] + static extern uint nw_data_transfer_report_get_path_count (OS_nw_data_transfer_report report); + + public uint PathCount => nw_data_transfer_report_get_path_count (GetCheckedHandle ()); + + [DllImport (Constants.NetworkLibrary)] + static extern ulong nw_data_transfer_report_get_duration_milliseconds (OS_nw_data_transfer_report report); + + public TimeSpan Duration => TimeSpan.FromMilliseconds (nw_data_transfer_report_get_duration_milliseconds (GetCheckedHandle ())); + + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_interface nw_data_transfer_report_copy_path_interface (OS_nw_data_transfer_report report, uint path_index); + + public NWInterface GetInterface (uint pathIndex) + => new NWInterface (nw_data_transfer_report_copy_path_interface (GetCheckedHandle (), pathIndex), owns: true); + + [DllImport (Constants.NetworkLibrary)] + static extern ulong nw_data_transfer_report_get_received_application_byte_count (OS_nw_data_transfer_report report, uint path_index); + + public ulong GetApplicationReceivedByteCount (uint pathIndex) + => nw_data_transfer_report_get_received_application_byte_count (GetCheckedHandle (), pathIndex); + + [DllImport (Constants.NetworkLibrary)] + static extern ulong nw_data_transfer_report_get_sent_application_byte_count (OS_nw_data_transfer_report report, uint path_index); + + public ulong GetApplicationSentByteCount (uint pathIndex) + => nw_data_transfer_report_get_sent_application_byte_count (GetCheckedHandle (), pathIndex); + + [DllImport (Constants.NetworkLibrary)] + static extern ulong nw_data_transfer_report_get_received_transport_byte_count (OS_nw_data_transfer_report report, uint path_index); + + public ulong GetTransportReceivedByteCount (uint pathIndex) + => nw_data_transfer_report_get_received_transport_byte_count (GetCheckedHandle (), pathIndex); + + [DllImport (Constants.NetworkLibrary)] + static extern ulong nw_data_transfer_report_get_received_transport_duplicate_byte_count (OS_nw_data_transfer_report report, uint path_index); + + public ulong GetTransportReceivedDuplicateByteCount (uint pathIndex) + => nw_data_transfer_report_get_received_transport_duplicate_byte_count (GetCheckedHandle (), pathIndex); + + [DllImport (Constants.NetworkLibrary)] + static extern ulong nw_data_transfer_report_get_received_transport_out_of_order_byte_count (OS_nw_data_transfer_report report, uint path_index); + + public ulong GetTransportReceivedOutOfOrderByteCount (uint pathIndex) + => nw_data_transfer_report_get_received_transport_duplicate_byte_count (GetCheckedHandle (), pathIndex); + + [DllImport (Constants.NetworkLibrary)] + static extern ulong nw_data_transfer_report_get_sent_transport_byte_count (OS_nw_data_transfer_report report, uint path_index); + + public ulong GetTransportSentByteCount (uint pathIndex) + => nw_data_transfer_report_get_sent_transport_byte_count (GetCheckedHandle (), pathIndex); + + + [DllImport (Constants.NetworkLibrary)] + static extern ulong nw_data_transfer_report_get_sent_transport_retransmitted_byte_count (OS_nw_data_transfer_report report, uint path_index); + + public ulong GetTransportRetransmittedByteCount (uint pathIndex) + => nw_data_transfer_report_get_sent_transport_retransmitted_byte_count (GetCheckedHandle (), pathIndex); + + [DllImport (Constants.NetworkLibrary)] + static extern ulong nw_data_transfer_report_get_transport_smoothed_rtt_milliseconds (OS_nw_data_transfer_report report, uint path_index); + + public TimeSpan GetTransportSmoothedRoundTripTime (uint pathIndex) + => TimeSpan.FromMilliseconds (nw_data_transfer_report_get_transport_smoothed_rtt_milliseconds (GetCheckedHandle (), pathIndex)); + + [DllImport (Constants.NetworkLibrary)] + static extern ulong nw_data_transfer_report_get_transport_minimum_rtt_milliseconds (OS_nw_data_transfer_report report, uint path_index); + + public TimeSpan GetTransportMinimumRoundTripTime (uint pathIndex) + => TimeSpan.FromMilliseconds (nw_data_transfer_report_get_transport_minimum_rtt_milliseconds (GetCheckedHandle (), pathIndex)); + + [DllImport (Constants.NetworkLibrary)] + static extern ulong nw_data_transfer_report_get_transport_rtt_variance (OS_nw_data_transfer_report report, uint path_index); + + public ulong GetTransportRoundTripTimeVariance (uint pathIndex) + => nw_data_transfer_report_get_transport_rtt_variance (GetCheckedHandle (), pathIndex); + + [DllImport (Constants.NetworkLibrary)] + static extern ulong nw_data_transfer_report_get_received_ip_packet_count (OS_nw_data_transfer_report report, uint path_index); + + public ulong GetTransportReceivedIPPackageCount (uint pathIndex) + => nw_data_transfer_report_get_received_ip_packet_count (GetCheckedHandle (), pathIndex); + + [DllImport (Constants.NetworkLibrary)] + static extern ulong nw_data_transfer_report_get_sent_ip_packet_count (OS_nw_data_transfer_report report, uint path_index); + + public ulong GetTransportSentIPPackageCount (uint pathIndex) + => nw_data_transfer_report_get_sent_ip_packet_count (GetCheckedHandle (), pathIndex); + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern void nw_data_transfer_report_collect (OS_nw_data_transfer_report report, IntPtr queue, ref BlockLiteral collect_block); + + delegate void nw_data_transfer_report_collect_t (IntPtr block, IntPtr report); + static nw_data_transfer_report_collect_t static_CollectHandler = TrampolineCollectHandler; + + [MonoPInvokeCallback (typeof (nw_data_transfer_report_collect_t))] + static void TrampolineCollectHandler (IntPtr block, IntPtr report) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + using (var nwReport = new NWDataTransferReport (report, owns: false)) + del (nwReport); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public void Collect (DispatchQueue queue, Action handler) + { + if (queue == null) + throw new ArgumentNullException (nameof (queue)); + if (handler == null) + throw new ArgumentNullException (nameof (handler)); + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_CollectHandler, handler); + try { + nw_data_transfer_report_collect (GetCheckedHandle (), queue.Handle, ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern NWDataTransferReportState nw_data_transfer_report_get_state (OS_nw_data_transfer_report report); + + public NWDataTransferReportState State => nw_data_transfer_report_get_state (GetCheckedHandle ()); + } +} diff --git a/src/Network/NWEndpoint.cs b/src/Network/NWEndpoint.cs index 273407bb96..0354a892cf 100644 --- a/src/Network/NWEndpoint.cs +++ b/src/Network/NWEndpoint.cs @@ -112,5 +112,27 @@ namespace Network { static extern IntPtr nw_endpoint_get_bonjour_service_domain (OS_nw_endpoint endpoint); public string BonjourServiceDomain => Marshal.PtrToStringAnsi (nw_endpoint_get_bonjour_service_domain (GetCheckedHandle ())); + + [Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] + [DllImport (Constants.NetworkLibrary, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + static extern OS_nw_endpoint nw_endpoint_create_url (string url); + + [Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] + public static NWEndpoint Create (string url) + { + if (url == null) + throw new ArgumentNullException (nameof (url)); + var handle = nw_endpoint_create_url (url); + if (handle == IntPtr.Zero) + return null; + return new NWEndpoint (handle, owns: true); + } + + [Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] + [DllImport (Constants.NetworkLibrary, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + static extern IntPtr nw_endpoint_get_url (OS_nw_endpoint endpoint); + + [Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] + public string Url => Marshal.PtrToStringAnsi (nw_endpoint_get_url (GetCheckedHandle ())); } } diff --git a/src/Network/NWEstablishmentReport.cs b/src/Network/NWEstablishmentReport.cs new file mode 100644 index 0000000000..65cdf77aaa --- /dev/null +++ b/src/Network/NWEstablishmentReport.cs @@ -0,0 +1,134 @@ + +// +// NWDataTransferReport.cs: Bindings the Network nw_data_transfer_report_t API. +// +// Authors: +// Manuel de la Pena (mandel@microsoft.com) +// +// Copyright 2019 Microsoft Inc +// +using System; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using ObjCRuntime; +using Foundation; +using CoreFoundation; + +using OS_nw_establishment_report=System.IntPtr; +using nw_endpoint_t=System.IntPtr; +using nw_report_protocol_enumerator_t=System.IntPtr; +using nw_protocol_definition_t=System.IntPtr; + +namespace Network { + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public enum NWReportResolutionSource { + Query = 1, + Cache = 2, + ExpiredCache = 3, + } + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public class NWEstablishmentReport : NativeObject { + + internal NWEstablishmentReport (IntPtr handle, bool owns) : base (handle, owns) {} + + [DllImport (Constants.NetworkLibrary)] + static extern bool nw_establishment_report_get_used_proxy (OS_nw_establishment_report report); + + public bool UsedProxy => nw_establishment_report_get_used_proxy (GetCheckedHandle ()); + + [DllImport (Constants.NetworkLibrary)] + static extern bool nw_establishment_report_get_proxy_configured (OS_nw_establishment_report report); + + public bool ProxyConfigured => nw_establishment_report_get_proxy_configured (GetCheckedHandle ()); + + [DllImport (Constants.NetworkLibrary)] + static extern uint nw_establishment_report_get_previous_attempt_count (OS_nw_establishment_report report); + + public uint PreviousAttemptCount => nw_establishment_report_get_previous_attempt_count (GetCheckedHandle ()); + + [DllImport (Constants.NetworkLibrary)] + static extern ulong nw_establishment_report_get_duration_milliseconds (OS_nw_establishment_report report); + + public TimeSpan Duration => TimeSpan.FromMilliseconds (nw_establishment_report_get_duration_milliseconds (GetCheckedHandle ())); + + [DllImport (Constants.NetworkLibrary)] + static extern ulong nw_establishment_report_get_attempt_started_after_milliseconds (OS_nw_establishment_report report); + + public TimeSpan ConnectionSetupTime => TimeSpan.FromMilliseconds (nw_establishment_report_get_attempt_started_after_milliseconds (GetCheckedHandle ())); + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_establishment_report_enumerate_resolutions (OS_nw_establishment_report report, ref BlockLiteral enumerate_block); + + delegate void nw_report_resolution_enumerator_t (IntPtr block, NWReportResolutionSource source, nuint milliseconds, int endpoint_count, nw_endpoint_t successful_endpoint, nw_endpoint_t preferred_endpoint); + static nw_report_resolution_enumerator_t static_ResolutionEnumeratorHandler = TrampolineResolutionEnumeratorHandler; + + [MonoPInvokeCallback (typeof (nw_report_resolution_enumerator_t))] + static void TrampolineResolutionEnumeratorHandler (IntPtr block, NWReportResolutionSource source, nuint milliseconds, int endpoint_count, nw_endpoint_t successful_endpoint, nw_endpoint_t preferred_endpoint) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + using (var nwSuccesfulEndpoint = new NWEndpoint (successful_endpoint, owns: false)) + using (var nwPreferredEndpoint = new NWEndpoint (preferred_endpoint, owns: false)) + del (source,TimeSpan.FromMilliseconds (milliseconds), endpoint_count, nwSuccesfulEndpoint, nwPreferredEndpoint); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public void EnumerateResolutions (Action handler) + { + if (handler == null) + throw new ArgumentNullException (nameof (handler)); + + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_ResolutionEnumeratorHandler, handler); + try { + nw_establishment_report_enumerate_resolutions (GetCheckedHandle (), ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_establishment_report_enumerate_protocols (OS_nw_establishment_report report, ref BlockLiteral enumerate_block); + + delegate void nw_establishment_report_enumerate_protocols_t (IntPtr block, nw_protocol_definition_t protocol, nuint handshake_milliseconds, nuint handshake_rtt_milliseconds); + static nw_establishment_report_enumerate_protocols_t static_EnumerateProtocolsHandler = TrampolineEnumerateProtocolsHandler; + + [MonoPInvokeCallback (typeof (nw_establishment_report_enumerate_protocols_t))] + static void TrampolineEnumerateProtocolsHandler (IntPtr block, nw_protocol_definition_t protocol, nuint handshake_milliseconds, nuint handshake_rtt_milliseconds) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + using (var nwProtocolDefinition = new NWProtocolDefinition (protocol, owns: false)) + del (nwProtocolDefinition, TimeSpan.FromMilliseconds (handshake_milliseconds), TimeSpan.FromMilliseconds (handshake_rtt_milliseconds)); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public void EnumerateProtocols (Action handler) + { + if (handler == null) + throw new ArgumentNullException (nameof (handler)); + + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_EnumerateProtocolsHandler, handler); + try { + nw_establishment_report_enumerate_protocols (GetCheckedHandle (), ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern nw_endpoint_t nw_establishment_report_copy_proxy_endpoint (OS_nw_establishment_report report); + + public NWEndpoint ProxyEndpoint { + get { + var ptr = nw_establishment_report_copy_proxy_endpoint (GetCheckedHandle ()); + return (ptr == IntPtr.Zero) ? null : new NWEndpoint (ptr, owns:true); + } + } + } +} diff --git a/src/Network/NWFramer.cs b/src/Network/NWFramer.cs new file mode 100644 index 0000000000..43866fcdfd --- /dev/null +++ b/src/Network/NWFramer.cs @@ -0,0 +1,468 @@ +// +// NWFramer.cs: Bindings the Network nw_framer_t API. +// +// Authors: +// Manuel de la Pena (mandel@microsoft.com) +// +// Copyright 2019 Microsoft Inc +// +using System; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using ObjCRuntime; +using Foundation; +using CoreFoundation; + +using OS_nw_framer=System.IntPtr; +using OS_nw_protocol_metadata=System.IntPtr; +using OS_dispatch_data=System.IntPtr; +using OS_nw_protocol_definition=System.IntPtr; +using OS_nw_protocol_options=System.IntPtr; +using OS_nw_endpoint=System.IntPtr; +using OS_nw_parameters=System.IntPtr; + +namespace Network { + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public class NWFramer : NativeObject { + internal NWFramer (IntPtr handle, bool owns) : base (handle, owns) {} +/* + [DllImport (Constants.NetworkLibrary)] + static extern bool nw_framer_write_output_no_copy (OS_nw_framer framer, nuint output_length); + + public bool WriteOutput (nuint outputLength) => nw_framer_write_output_no_copy (GetCheckedHandle (), outputLength); + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_framer_write_output_data (OS_nw_framer framer, OS_dispatch_data output_data); + + public void WriteOutput (DispatchData data) + { + if (data == null) + throw new ArgumentNullException (nameof (data)); + nw_framer_write_output_data (GetCheckedHandle (), data.Handle); + } + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern void nw_framer_write_output (OS_nw_framer framer, byte *output_buffer, nuint output_length); + + public void WriteOutput (ReadOnlySpan data) + { + unsafe { + fixed (byte *mh = data) + nw_framer_write_output (GetCheckedHandle (), mh, (nuint) data.Length); + } + } + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern void nw_framer_set_wakeup_handler (OS_nw_framer framer, void *wakeup_handler); + + delegate void nw_framer_set_wakeup_handler_t (IntPtr block, OS_nw_framer framer); + static nw_framer_set_wakeup_handler_t static_WakeupHandler = TrampolineWakeupHandler; + + [MonoPInvokeCallback (typeof (nw_framer_set_wakeup_handler_t))] + static void TrampolineWakeupHandler (IntPtr block, OS_nw_framer framer) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + var nwFramer = new NWFramer (framer, owns: true); + del (nwFramer); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public Action WakeupHandler { + set { + unsafe { + if (value == null) { + nw_framer_set_wakeup_handler (GetCheckedHandle (), null); + return; + } + BlockLiteral block_handler = new BlockLiteral (); + BlockLiteral *block_ptr_handler = &block_handler; + block_handler.SetupBlockUnsafe (static_WakeupHandler, value); + try { + nw_framer_set_wakeup_handler (GetCheckedHandle (), (void*) block_ptr_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } + } + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern void nw_framer_set_stop_handler (OS_nw_framer framer, void *stop_handler); + + delegate void nw_framer_set_stop_handler_t (IntPtr block, OS_nw_framer framer); + static nw_framer_set_stop_handler_t static_StopHandler = TrampolineStopHandler; + + [MonoPInvokeCallback (typeof (nw_framer_set_stop_handler_t))] + static void TrampolineStopHandler (IntPtr block, OS_nw_framer framer) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + var nwFramer = new NWFramer (framer, owns: true); + del (nwFramer); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public Action StopHandler { + set { + unsafe { + if (value == null) { + nw_framer_set_stop_handler (GetCheckedHandle (), null); + return; + } + BlockLiteral block_handler = new BlockLiteral (); + BlockLiteral *block_ptr_handler = &block_handler; + block_handler.SetupBlockUnsafe (static_StopHandler, value); + try { + nw_framer_set_stop_handler (GetCheckedHandle (), (void*) block_ptr_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } + } + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern void nw_framer_set_output_handler (OS_nw_framer framer, void *output_handler); + + delegate void nw_framer_set_output_handler_t (IntPtr block, OS_nw_framer framer, OS_nw_protocol_metadata message, nuint message_length, bool is_complete); + static nw_framer_set_output_handler_t static_OutputHandler = TrampolineOutputHandler; + + [MonoPInvokeCallback (typeof (nw_framer_set_output_handler_t))] + static void TrampolineOutputHandler (IntPtr block, OS_nw_framer framer, OS_nw_protocol_metadata message, nuint message_length, bool is_complete) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + var nwFramer = new NWFramer (framer, owns: true); + var nwProtocolMetadata = new NWProtocolMetadata (message, owns: true); + del (nwFramer, nwProtocolMetadata, message_length, is_complete); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public Action OutputHandler { + set { + unsafe { + if (value == null) { + nw_framer_set_output_handler (GetCheckedHandle (), null); + return; + } + BlockLiteral block_handler = new BlockLiteral (); + BlockLiteral *block_ptr_handler = &block_handler; + block_handler.SetupBlockUnsafe (static_OutputHandler, value); + try { + nw_framer_set_output_handler (GetCheckedHandle (), (void*) block_ptr_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } + } + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern void nw_framer_set_input_handler (OS_nw_framer framer, void *input_handler); + + delegate void nw_framer_set_input_handler_t (IntPtr block, OS_nw_framer framer); + static nw_framer_set_input_handler_t static_InputHandler = TrampolineInputHandler; + + [MonoPInvokeCallback (typeof (nw_framer_set_input_handler_t))] + static void TrampolineInputHandler (IntPtr block, OS_nw_framer framer) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + var nwFramer = new NWFramer (framer, owns: true); + del (nwFramer); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public Action InputHandler { + set { + unsafe { + if (value == null) { + nw_framer_set_input_handler (GetCheckedHandle (), null); + return; + } + BlockLiteral block_handler = new BlockLiteral (); + BlockLiteral *block_ptr_handler = &block_handler; + block_handler.SetupBlockUnsafe (static_InputHandler, value); + try { + nw_framer_set_input_handler (GetCheckedHandle (), (void*) block_ptr_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } + } + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern void nw_framer_set_cleanup_handler (OS_nw_framer framer, void *cleanup_handler); + + delegate void nw_framer_set_cleanup_handler_t (IntPtr block, OS_nw_framer framer); + static nw_framer_set_input_handler_t static_CleanupHandler = TrampolineCleanupHandler; + + [MonoPInvokeCallback (typeof (nw_framer_set_input_handler_t))] + static void TrampolineCleanupHandler (IntPtr block, OS_nw_framer framer) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + var nwFramer = new NWFramer (framer, owns: true); + del (nwFramer); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public Action CleanupHandler { + set { + unsafe { + if (value == null) { + nw_framer_set_cleanup_handler (GetCheckedHandle (), null); + return; + } + BlockLiteral block_handler = new BlockLiteral (); + BlockLiteral *block_ptr_handler = &block_handler; + block_handler.SetupBlockUnsafe (static_InputHandler, value); + try { + nw_framer_set_cleanup_handler (GetCheckedHandle (), (void*) block_ptr_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_framer_schedule_wakeup (OS_nw_framer framer, ulong milliseconds); + + public void ScheduleWakeup (ulong milliseconds) => nw_framer_schedule_wakeup (GetCheckedHandle (), milliseconds); + + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_protocol_metadata nw_framer_protocol_create_message (OS_nw_protocol_definition definition); + + public static NWFramer CreateMessage (NWProtocolDefinition protocolDefinition) + { + if (protocolDefinition == null) + throw new ArgumentNullException (nameof (protocolDefinition)); + return new NWFramer (nw_framer_protocol_create_message (protocolDefinition.Handle), owns: true); + } + + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_protocol_metadata nw_framer_message_create (OS_nw_framer framer); + + public NWProtocolMetadata CreateMessage () + => new NWFramer (nw_framer_message_create (GetCheckedHandle ()), owns: true); + + [DllImport (Constants.NetworkLibrary)] + static extern bool nw_framer_prepend_application_protocol (OS_nw_framer framer, OS_nw_protocol_options protocol_options); + + public bool PrependApplicationProtocol (NWProtocolOptions options) + { + if (options == null) + throw new ArgumentNullException (nameof (options)); + return nw_framer_prepend_application_protocol (GetCheckedHandle (), options.Handle); + } + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_framer_pass_through_output (OS_nw_framer framer); + + public void PassThroughOutput () => nw_framer_pass_through_output (GetCheckedHandle ()); + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_framer_pass_through_input (OS_nw_framer framer); + + public void PassThroughInput () => nw_framer_pass_through_input (GetCheckedHandle ()); + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_framer_mark_ready (OS_nw_framer framer); + + public void MarkReady () => nw_framer_mark_ready (GetCheckedHandle ()); + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_framer_mark_failed_with_error (OS_nw_framer framer, int error_code); + + public void MarkFailedWithError (int errorCode) => nw_framer_mark_failed_with_error (GetCheckedHandle (), errorCode); + + [DllImport (Constants.NetworkLibrary)] + static extern bool nw_framer_deliver_input_no_copy (OS_nw_framer framer, nuint input_length, OS_nw_protocol_metadata message, bool is_complete); + + public bool DeliverInput (nuint length, NWProtocolMetadata message, bool isComplete) + { + if (message == null) + throw new ArgumentNullException (nameof (message)); + return nw_framer_deliver_input_no_copy (GetCheckedHandle (), length, message.Handle, isComplete); + } + + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_protocol_options nw_framer_create_options (OS_nw_protocol_definition framer_definition); + + public static NWProtocolOptions CreateOptions (NWProtocolDefinition protocolDefinition) + { + if (protocolDefinition == null) + throw new ArgumentNullException (nameof (protocolDefinition)); + return new NWProtocolOptions (nw_framer_create_options (protocolDefinition.Handle), owns: true); + } + + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_endpoint nw_framer_copy_remote_endpoint (OS_nw_framer framer); + + public NWEndpoint Endpoint => new NWEndpoint (nw_framer_copy_remote_endpoint (GetCheckedHandle ()), owns: true); + + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_parameters nw_framer_copy_parameters (OS_nw_framer framer); + + public NWParameters Parameters => new NWParameters (nw_framer_copy_parameters (GetCheckedHandle ()), owns: true); + + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_endpoint nw_framer_copy_local_endpoint (OS_nw_framer framer); + + public NWEndpoint LocalEndpoint => new NWEndpoint (nw_framer_copy_local_endpoint (GetCheckedHandle ()), owns: true); + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern void nw_framer_async (OS_nw_framer framer, void *async_block); + + delegate void nw_framer_async_t (IntPtr block); + static nw_framer_async_t static_ScheduleHandler = TrampolineScheduleHandler; + + [MonoPInvokeCallback (typeof (nw_framer_async_t))] + static void TrampolineScheduleHandler (IntPtr block) + { + var del = BlockLiteral.GetTarget (block); + if (del != null) { + del (); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public void ScheduleAsync (Action handler) + { + unsafe { + if (handler == null) { + nw_framer_async (GetCheckedHandle (), null); + return; + } + BlockLiteral block_handler = new BlockLiteral (); + BlockLiteral *block_ptr_handler = &block_handler; + block_handler.SetupBlockUnsafe (static_ScheduleHandler, handler); + try { + nw_framer_async (GetCheckedHandle (), (void*) block_ptr_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern unsafe bool nw_framer_parse_output (OS_nw_framer framer, nuint minimum_incomplete_length, nuint maximum_length, byte *temp_buffer, ref BlockLiteral parse); + + delegate void nw_framer_parse_output_t (IntPtr block, IntPtr buffer, nuint buffer_length, bool is_complete); + static nw_framer_parse_output_t static_ParseOutputHandler = TrampolineParseOutputHandler; + + [MonoPInvokeCallback (typeof (nw_framer_parse_output_t))] + static void TrampolineParseOutputHandler (IntPtr block, IntPtr buffer, nuint buffer_length, bool is_complete) + { + var del = BlockLiteral.GetTarget, bool>> (block); + if (del != null) { + var bBuffer = new byte[buffer_length]; + Marshal.Copy (buffer, bBuffer, 0, (int)buffer_length); + var mValue = new Memory(bBuffer); + del (mValue, is_complete); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public bool ParseOutput (nuint minimumIncompleteLength, nuint maximumLength, Memory tempBuffer, Action, bool> handler) + { + if (handler == null) + throw new ArgumentNullException (nameof (handler)); + unsafe { + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_ParseOutputHandler, handler); + try { + using (var mh = tempBuffer.Pin ()) + return nw_framer_parse_output (GetCheckedHandle (), minimumIncompleteLength, maximumLength, (byte*)mh.Pointer, ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern unsafe bool nw_framer_parse_input (OS_nw_framer framer, nuint minimum_incomplete_length, nuint maximum_length, byte *temp_buffer, ref BlockLiteral parse); + + delegate void nw_framer_parse_input_t (IntPtr block, IntPtr buffer, nuint buffer_length, bool is_complete); + static nw_framer_parse_input_t static_ParseInputHandler = TrampolineParseInputHandler; + + [MonoPInvokeCallback (typeof (nw_framer_parse_input_t))] + static void TrampolineParseInputHandler (IntPtr block, IntPtr buffer, nuint buffer_length, bool is_complete) + { + var del = BlockLiteral.GetTarget, bool>> (block); + if (del != null) { + var bBuffer = new byte[buffer_length]; + Marshal.Copy (buffer, bBuffer, 0, (int)buffer_length); + var mValue = new Memory(bBuffer); + del (mValue, is_complete); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public bool ParseInput (nuint minimumIncompleteLength, nuint maximumLength, Memory tempBuffer, Action, bool> handler) + { + if (handler == null) + throw new ArgumentNullException (nameof (handler)); + unsafe { + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_ParseInputHandler, handler); + try { + using (var mh = tempBuffer.Pin ()) + return nw_framer_parse_input (GetCheckedHandle (), minimumIncompleteLength, maximumLength, (byte*)mh.Pointer, ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern unsafe void nw_framer_message_set_value (OS_nw_protocol_metadata message, string key, byte *value, void *dispose_value); + + public void SetKey (string key, ReadOnlySpan value) + { + // the method takes a callback to cleanup the data, but we do not need that since we are managed + if (key == null) + throw new ArgumentNullException (nameof (key)); + + unsafe { + fixed (byte* mh = value) + nw_framer_message_set_value (GetCheckedHandle (), key, mh, null); + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_framer_message_set_object_value (OS_nw_protocol_metadata message, string key, IntPtr value); + + public void SetObject (string key, NSObject value) + => nw_framer_message_set_object_value (GetCheckedHandle (), key, value.GetHandle ()); + + [DllImport (Constants.NetworkLibrary)] + static extern IntPtr nw_framer_message_copy_object_value (OS_nw_protocol_metadata message, string key); + + public NSObject GetValue (string key) + => Runtime.GetNSObject (nw_framer_message_copy_object_value (GetCheckedHandle (), key)); + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern void nw_framer_deliver_input (OS_nw_framer framer, byte *input_buffer, nuint input_length, OS_nw_protocol_metadata message, bool is_complete); + + public void DeliverInput (ReadOnlySpan buffer, NWProtocolMetadata message, bool isComplete) + { + if (message == null) + throw new ArgumentNullException (nameof (message)); + unsafe { + fixed (byte *mh = buffer) + nw_framer_deliver_input (GetCheckedHandle (),mh, (nuint)buffer.Length, message.Handle, isComplete); + } + } + */ + } +} diff --git a/src/Network/NWListener.cs b/src/Network/NWListener.cs index 7df82ffab0..aed7e614b3 100644 --- a/src/Network/NWListener.cs +++ b/src/Network/NWListener.cs @@ -228,5 +228,19 @@ namespace Network { { nw_listener_set_advertise_descriptor (GetCheckedHandle (), descriptor.GetHandle ()); } + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + [DllImport (Constants.NetworkLibrary)] + static extern uint nw_listener_get_new_connection_limit (IntPtr listener); + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + [DllImport (Constants.NetworkLibrary)] + static extern void nw_listener_set_new_connection_limit (IntPtr listener, uint new_connection_limit); + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public uint ConnectionLimit { + get => nw_listener_get_new_connection_limit (GetCheckedHandle ()); + set => nw_listener_set_new_connection_limit (GetCheckedHandle (), value); + } } } diff --git a/src/Network/NWParameters.cs b/src/Network/NWParameters.cs index 742e85e263..faf16e41ff 100644 --- a/src/Network/NWParameters.cs +++ b/src/Network/NWParameters.cs @@ -435,6 +435,21 @@ namespace Network { get => nw_parameters_get_include_peer_to_peer (GetCheckedHandle ()); set => nw_parameters_set_include_peer_to_peer (GetCheckedHandle (), value); } + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + [DllImport (Constants.NetworkLibrary)] + [return: MarshalAs (UnmanagedType.I1)] + static extern bool nw_parameters_get_prohibit_constrained (IntPtr parameters); + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + [DllImport (Constants.NetworkLibrary)] + static extern void nw_parameters_set_prohibit_constrained (IntPtr parameters, bool prohibit_constrained); + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public bool ProhibitConstrained { + get => nw_parameters_get_prohibit_constrained (GetCheckedHandle ()); + set => nw_parameters_set_prohibit_constrained (GetCheckedHandle (), value); + } } [TV (12,0), Mac (10,14), iOS (12,0)] diff --git a/src/Network/NWPath.cs b/src/Network/NWPath.cs index 8d099d4cab..a3e1012f08 100644 --- a/src/Network/NWPath.cs +++ b/src/Network/NWPath.cs @@ -130,5 +130,46 @@ namespace Network { block_handler.CleanupBlock (); } } + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + [DllImport (Constants.NetworkLibrary)] + static extern bool nw_path_is_constrained (IntPtr path); + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public bool IsConstrained => nw_path_is_constrained (GetCheckedHandle ()); + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + [DllImport (Constants.NetworkLibrary)] + static extern void nw_path_enumerate_gateways (IntPtr path, ref BlockLiteral enumerate_block); + + delegate void nw_path_enumerate_gateways_t (IntPtr block, IntPtr endpoint); + static nw_path_enumerate_gateways_t static_EnumerateGatewaysHandler = TrampolineGatewaysHandler; + + [MonoPInvokeCallback (typeof (nw_path_enumerate_gateways_t))] + static void TrampolineGatewaysHandler (IntPtr block, IntPtr endpoint) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + var nwEndpoint = new NWEndpoint (endpoint, owns: false); + del (nwEndpoint); + } + } + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + [BindingImpl (BindingImplOptions.Optimizable)] + public void EnumerateGateways (Action callback) + { + if (callback == null) + throw new ArgumentNullException (nameof (callback)); + + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_Enumerator, callback); + + try { + nw_path_enumerate_gateways (GetCheckedHandle (), ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } } } diff --git a/src/Network/NWProtocolDefinition.cs b/src/Network/NWProtocolDefinition.cs index 2e7209f1b7..5863415d1f 100644 --- a/src/Network/NWProtocolDefinition.cs +++ b/src/Network/NWProtocolDefinition.cs @@ -61,5 +61,11 @@ namespace Network { public static NWProtocolDefinition TlsDefinition => new NWProtocolDefinition (nw_protocol_copy_tls_definition (), owns: true); + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_protocol_definition nw_protocol_copy_ws_definition (); + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public static NWProtocolDefinition WebSocketDefinition => new NWProtocolDefinition (nw_protocol_copy_ws_definition (), owns: true); } } diff --git a/src/Network/NWProtocolMetadata.cs b/src/Network/NWProtocolMetadata.cs index 07450a2106..e0e355a4f6 100644 --- a/src/Network/NWProtocolMetadata.cs +++ b/src/Network/NWProtocolMetadata.cs @@ -187,5 +187,19 @@ namespace Network { CheckIsTcp (); return nw_tcp_get_available_send_buffer (GetCheckedHandle ()); } + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + [DllImport (Constants.NetworkLibrary)] + static extern bool nw_protocol_metadata_is_framer_message (OS_nw_protocol_metadata metadata); + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public bool IsFramerMessage => nw_protocol_metadata_is_framer_message (GetCheckedHandle ()); + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + [DllImport (Constants.NetworkLibrary)] + static extern bool nw_protocol_metadata_is_ws (OS_nw_protocol_metadata metadata); + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public bool IsWebSocket => nw_protocol_metadata_is_ws (GetCheckedHandle ()); } } diff --git a/src/Network/NWProtocolOptions.cs b/src/Network/NWProtocolOptions.cs index 5c2c9e9b84..6209c35ac2 100644 --- a/src/Network/NWProtocolOptions.cs +++ b/src/Network/NWProtocolOptions.cs @@ -18,6 +18,13 @@ using IntPtr=System.IntPtr; namespace Network { + [Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] + public enum NWIPLocalAddressPreference { + Default = 0, + Temporary = 1, + Stable = 2, + } + [TV (12,0), Mac (10,14), iOS (12,0)] [Watch (6,0)] public class NWProtocolOptions : NativeObject { @@ -95,6 +102,15 @@ namespace Network { nw_ip_options_set_calculate_receive_time (GetCheckedHandle (), calculateReceiveTime); } + + [Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] + [DllImport (Constants.NetworkLibrary)] + static extern void nw_ip_options_set_local_address_preference (IntPtr options, NWIPLocalAddressPreference preference); + + [Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] + public NWIPLocalAddressPreference IPLocalAddressPreference { + set => nw_ip_options_set_local_address_preference (GetCheckedHandle (), value); + } // // TCP Options // diff --git a/src/Network/NWProtocolStack.cs b/src/Network/NWProtocolStack.cs index 52b2921262..8dcbef5651 100644 --- a/src/Network/NWProtocolStack.cs +++ b/src/Network/NWProtocolStack.cs @@ -80,13 +80,21 @@ namespace Network { extern static void nw_protocol_stack_set_transport_protocol (nw_protocol_stack_t stack, IntPtr value); public NWProtocolOptions TransportProtocol { - get => new NWProtocolOptions (nw_protocol_stack_copy_transport_protocol (GetCheckedHandle ()), owns: true); + get { + var pHandle = nw_protocol_stack_copy_transport_protocol (GetCheckedHandle ()); + return (pHandle == IntPtr.Zero)? null : new NWProtocolOptions (pHandle, owns: true); + } set => nw_protocol_stack_set_transport_protocol (GetCheckedHandle (), value.GetHandle ()); } [DllImport (Constants.NetworkLibrary)] extern static IntPtr nw_protocol_stack_copy_internet_protocol (nw_protocol_stack_t stack); - public NWProtocolOptions InternetProtocol => new NWProtocolOptions (nw_protocol_stack_copy_internet_protocol (GetCheckedHandle ()), owns: true); + public NWProtocolOptions InternetProtocol { + get { + var pHandle = nw_protocol_stack_copy_internet_protocol (GetCheckedHandle ()); + return (pHandle == IntPtr.Zero) ? null : new NWProtocolOptions (pHandle, owns: true); + } + } } } diff --git a/src/Network/NWTxtRecord.cs b/src/Network/NWTxtRecord.cs new file mode 100644 index 0000000000..35eab9aa36 --- /dev/null +++ b/src/Network/NWTxtRecord.cs @@ -0,0 +1,221 @@ +// +// NWTxtRecord.cs: Bindings the Network nw_txt_record_t API +// +// Authors: +// Miguel de Icaza (miguel@microsoft.com) +// +// Copyright 2019 Microsoft Inc +// +using System; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using System.Text; +using ObjCRuntime; +using Foundation; +using CoreFoundation; + +using nw_advertise_descriptor_t=System.IntPtr; +using OS_nw_advertise_descriptor=System.IntPtr; +using OS_nw_txt_record=System.IntPtr; + + +namespace Network { + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public enum NWTxtRecordFindKey { + Invalid = 0, + NotPresent = 1, + NoValue = 2, + EmptyValue = 3, + NonEmptyValue = 4, + } + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public class NWTxtRecord : NativeObject { + internal NWTxtRecord (IntPtr handle, bool owns) : base (handle, owns) { } + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern IntPtr nw_txt_record_create_with_bytes (byte *txtBytes, nuint len); + + public static NWTxtRecord FromBytes (ReadOnlySpan bytes) + { + unsafe { + fixed (byte* mh = bytes) { + var x = nw_txt_record_create_with_bytes (mh, (nuint) bytes.Length); + if (x == IntPtr.Zero) + return null; + return new NWTxtRecord (x, owns: true); + } + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern IntPtr nw_txt_record_create_dictionary (); + + public static NWTxtRecord CreateDictionary () + { + var x = nw_txt_record_create_dictionary (); + if (x == IntPtr.Zero) + return null; + return new NWTxtRecord (x, owns: true); + } + + [DllImport (Constants.NetworkLibrary)] + static extern IntPtr nw_txt_record_copy (IntPtr other); + + public NWTxtRecord Clone () => new NWTxtRecord (nw_txt_record_copy (GetCheckedHandle ()), owns: true); + + [DllImport (Constants.NetworkLibrary)] + static extern NWTxtRecordFindKey nw_txt_record_find_key (IntPtr handle, string key); + + public NWTxtRecordFindKey FindKey (string key) => nw_txt_record_find_key (GetCheckedHandle (), key); + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern byte nw_txt_record_set_key (IntPtr handle, string key, IntPtr value, nuint valueLen); + + public bool Add (string key, ReadOnlySpan value) + { + unsafe { + fixed (byte* mh = value) + return nw_txt_record_set_key (GetCheckedHandle (), key, (IntPtr)mh, (nuint) value.Length) != 0; + } + } + + public bool Add (string key) { + unsafe { + return nw_txt_record_set_key (GetCheckedHandle (), key, IntPtr.Zero, 0) != 0; + } + } + + public bool Add (string key, string value) + => Add (key, value == null ? null : Encoding.UTF8.GetBytes (value)); + + [DllImport (Constants.NetworkLibrary)] + static extern byte nw_txt_record_remove_key (IntPtr handle, string key); + + public bool Remove (string key) => nw_txt_record_remove_key (GetCheckedHandle (), key) != 0; + + [DllImport (Constants.NetworkLibrary)] + static extern long nw_txt_record_get_key_count (IntPtr handle); + + public long KeyCount => nw_txt_record_get_key_count (GetCheckedHandle ()); + + [DllImport (Constants.NetworkLibrary)] + static extern byte nw_txt_record_is_dictionary (IntPtr handle); + + public bool IsDictionary => nw_txt_record_is_dictionary (GetCheckedHandle ()) != 0; + + [DllImport (Constants.NetworkLibrary)] + static extern bool nw_txt_record_is_equal (OS_nw_txt_record left, OS_nw_txt_record right); + + public bool Equals (NWTxtRecord other) + { + if (other == null) + return false; + return nw_txt_record_is_equal (GetCheckedHandle (), other.GetCheckedHandle ()); + } + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern bool nw_txt_record_apply (OS_nw_txt_record txt_record, ref BlockLiteral applier); + + unsafe delegate void nw_txt_record_apply_t (IntPtr block, string key, NWTxtRecordFindKey found, IntPtr value, nuint valueLen); + unsafe static nw_txt_record_apply_t static_ApplyHandler = TrampolineApplyHandler; + + public delegate void NWTxtRecordApplyDelegate (string key, NWTxtRecordFindKey rersult, ReadOnlySpan value); + + [MonoPInvokeCallback (typeof (nw_txt_record_apply_t))] + unsafe static void TrampolineApplyHandler (IntPtr block, string key, NWTxtRecordFindKey found, IntPtr value, nuint valueLen) + { + var del = BlockLiteral.GetTarget (block); + if (del != null) { + var mValue = new ReadOnlySpan((void*)value, (int)valueLen); + del (key, found, mValue); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public bool Apply (NWTxtRecordApplyDelegate handler) + { + if (handler == null) + throw new ArgumentNullException (nameof (handler)); + + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_ApplyHandler, handler); + try { + return nw_txt_record_apply (GetCheckedHandle (), ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern unsafe bool nw_txt_record_access_key (OS_nw_txt_record txt_record, string key, ref BlockLiteral access_value); + + unsafe delegate void nw_txt_record_access_key_t (IntPtr block, string key, NWTxtRecordFindKey found, IntPtr value, nuint valueLen); + unsafe static nw_txt_record_access_key_t static_AccessKeyHandler = TrampolineAccessKeyHandler; + + public delegate void NWTxtRecordGetValueDelegete (string key, NWTxtRecordFindKey result, ReadOnlySpan value); + + [MonoPInvokeCallback (typeof (nw_txt_record_access_key_t))] + unsafe static void TrampolineAccessKeyHandler (IntPtr block, string key, NWTxtRecordFindKey found, IntPtr value, nuint valueLen) + { + var del = BlockLiteral.GetTarget (block); + if (del != null) { + ReadOnlySpan mValue; + if (found == NWTxtRecordFindKey.NonEmptyValue) + mValue = new ReadOnlySpan((void*)value, (int)valueLen); + else + mValue = Array.Empty (); + del (key, found, mValue); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public bool GetValue (string key, NWTxtRecordGetValueDelegete handler) + { + if (handler == null) + throw new ArgumentNullException (nameof (handler)); + + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_AccessKeyHandler, handler); + try { + return nw_txt_record_access_key (GetCheckedHandle (), key, ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern bool nw_txt_record_access_bytes (OS_nw_txt_record txt_record, ref BlockLiteral access_bytes); + + unsafe delegate void nw_txt_record_access_bytes_t (IntPtr block, IntPtr value, nuint valueLen); + unsafe static nw_txt_record_access_bytes_t static_RawBytesHandler = TrampolineRawBytesHandler; + + public delegate void NWTxtRecordGetRawByteDelegate (ReadOnlySpan value); + + [MonoPInvokeCallback (typeof (nw_txt_record_access_bytes_t))] + unsafe static void TrampolineRawBytesHandler (IntPtr block, IntPtr value, nuint valueLen) + { + var del = BlockLiteral.GetTarget (block); + if (del != null) { + var mValue = new ReadOnlySpan((void*)value, (int)valueLen); + del (mValue); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public bool GetRawBytes (NWTxtRecordGetRawByteDelegate handler) + { + if (handler == null) + throw new ArgumentNullException (nameof (handler)); + + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_RawBytesHandler, handler); + try { + return nw_txt_record_access_bytes (GetCheckedHandle (), ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } +} diff --git a/src/Network/NWWebSocketMetadata.cs b/src/Network/NWWebSocketMetadata.cs new file mode 100644 index 0000000000..520d3547d9 --- /dev/null +++ b/src/Network/NWWebSocketMetadata.cs @@ -0,0 +1,122 @@ +// +// NWWebSocketMetadata.cs: Bindings the Network nw_browser_t API. +// +// Authors: +// Manuel de la Pena (mandel@microsoft.com) +// +// Copyrigh 2019 Microsoft Inc +// +using System; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using ObjCRuntime; +using Foundation; +using CoreFoundation; + +using OS_nw_protocol_metadata=System.IntPtr; +using OS_nw_ws_response=System.IntPtr; +using dispatch_queue_t =System.IntPtr; + +namespace Network { + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public enum NWWebSocketOpCode : int { + Cont = 0x0, + Text = 0x1, + Binary = 0x2, + Close = 0x8, + Ping = 0x9, + Pong = 0xA, + Invalid = -1, + } + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public enum NWWebSocketCloseCode : int { + NormalClosure = 1000, + GoingAway = 1001, + ProtocolError = 1002, + UnsupportedData = 1003, + NoStatusReceived = 1005, + AbnormalClosure = 1006, + InvalidFramePayloadData = 1007, + PolicyViolation = 1008, + MessageTooBig = 1009, + MandatoryExtension = 1010, + InternalServerError = 1011, + TlsHandshake = 1015, + } + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public class NWWebSocketMetadata : NativeObject { + + internal NWWebSocketMetadata (IntPtr handle, bool owns) : base (handle, owns) {} + + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_protocol_metadata nw_ws_create_metadata (NWWebSocketOpCode opcode); + + public NWWebSocketMetadata (NWWebSocketOpCode opcode) + => InitializeHandle (nw_ws_create_metadata (opcode)); + + [DllImport (Constants.NetworkLibrary)] + static extern NWWebSocketCloseCode nw_ws_metadata_get_close_code (OS_nw_protocol_metadata metadata); + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_ws_metadata_set_close_code (OS_nw_protocol_metadata metadata, NWWebSocketCloseCode close_code); + + public NWWebSocketCloseCode CloseCode { + get => nw_ws_metadata_get_close_code (GetCheckedHandle ()); + set => nw_ws_metadata_set_close_code (GetCheckedHandle (), value); + } + + [DllImport (Constants.NetworkLibrary)] + static extern NWWebSocketOpCode nw_ws_metadata_get_opcode (OS_nw_protocol_metadata metadata); + + public NWWebSocketOpCode OpCode => nw_ws_metadata_get_opcode (GetCheckedHandle ()); + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_ws_metadata_set_pong_handler (OS_nw_protocol_metadata metadata, dispatch_queue_t client_queue, ref BlockLiteral pong_handler); + + delegate void nw_ws_metadata_set_pong_handler_t (IntPtr block, IntPtr error); + static nw_ws_metadata_set_pong_handler_t static_PongHandler = TrampolinePongHandler; + + [MonoPInvokeCallback (typeof (nw_ws_metadata_set_pong_handler_t))] + static void TrampolinePongHandler (IntPtr block, IntPtr error) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + var nwError = (error == IntPtr.Zero)? null : new NWError (error, owns: false); + del (nwError); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public void SetPongHandler (DispatchQueue queue, Action handler) + { + if (queue == null) + throw new ArgumentNullException (nameof (queue)); + + if (handler == null) + throw new ArgumentNullException (nameof (handler)); + + unsafe { + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_PongHandler, handler); + try { + nw_ws_metadata_set_pong_handler (GetCheckedHandle (), queue.Handle, ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_ws_response nw_ws_metadata_copy_server_response (OS_nw_protocol_metadata metadata); + + public NWWebSocketResponse ServerResponse { + get { + var reponsePtr = nw_ws_metadata_copy_server_response (GetCheckedHandle ()); + return (reponsePtr == IntPtr.Zero) ? null : new NWWebSocketResponse (reponsePtr, owns: true); + } + } + } +} \ No newline at end of file diff --git a/src/Network/NWWebSocketOptions.cs b/src/Network/NWWebSocketOptions.cs new file mode 100644 index 0000000000..44be7838bd --- /dev/null +++ b/src/Network/NWWebSocketOptions.cs @@ -0,0 +1,129 @@ +// +// NWWebSocketOptions.cs: Bindings the Network nw_browser_t API. +// +// Authors: +// Manuel de la Pena (mandel@microsoft.com) +// +// Copyrigh 2019 Microsoft Inc +// + +using System; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using ObjCRuntime; +using Foundation; +using CoreFoundation; + +using OS_nw_protocol_options=System.IntPtr; +using nw_ws_request_t=System.IntPtr; + +namespace Network { + + // this maps to `nw_ws_version_t` in Network.framework/Headers/ws_options.h (and not the enum from NetworkExtension) + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public enum NWWebSocketVersion { + Invalid = 0, + Version13 = 1, + } + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public class NWWebSocketOptions : NWProtocolOptions { + bool autoReplyPing = false; + bool skipHandShake = false; + nuint maximumMessageSize = (nuint) 0; + + internal NWWebSocketOptions (IntPtr handle, bool owns) : base (handle, owns) {} + + [DllImport (Constants.NetworkLibrary)] + extern static IntPtr nw_ws_create_options (NWWebSocketVersion version); + + public NWWebSocketOptions (NWWebSocketVersion version) : base (nw_ws_create_options (version), true) { } + + [DllImport (Constants.NetworkLibrary, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + static extern void nw_ws_options_add_additional_header (OS_nw_protocol_options options, string name, string value); + + public void SetHeader (string header, string value) + { + if (header == null) + throw new ArgumentNullException (header); + nw_ws_options_add_additional_header (GetCheckedHandle(), header, value); + } + + [DllImport (Constants.NetworkLibrary, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + static extern void nw_ws_options_add_subprotocol (OS_nw_protocol_options options, string subprotocol); + + public void AddSubprotocol (string subprotocol) + { + if (subprotocol == null) + throw new ArgumentNullException (nameof (subprotocol)); + nw_ws_options_add_subprotocol (GetCheckedHandle (), subprotocol); + } + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_ws_options_set_auto_reply_ping (OS_nw_protocol_options options, bool auto_reply_ping); + + public bool AutoReplyPing { + get { return autoReplyPing;} + set { + autoReplyPing = value; + nw_ws_options_set_auto_reply_ping (GetCheckedHandle (), value); + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_ws_options_set_maximum_message_size (OS_nw_protocol_options options, nuint maximum_message_size); + + public nuint MaximumMessageSize { + get { return maximumMessageSize; } + set { + maximumMessageSize = value; + nw_ws_options_set_maximum_message_size (GetCheckedHandle(), value); + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_ws_options_set_skip_handshake (OS_nw_protocol_options options, bool skip_handshake); + + public bool SkipHandShake { + get { return skipHandShake; } + set { + skipHandShake = value; + nw_ws_options_set_skip_handshake (GetCheckedHandle (), value); + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_ws_options_set_client_request_handler (OS_nw_protocol_options options, IntPtr client_queue, ref BlockLiteral handler); + + delegate void nw_ws_options_set_client_request_handler_t (IntPtr block, nw_ws_request_t request); + static nw_ws_options_set_client_request_handler_t static_ClientRequestHandler = TrampolineClientRequestHandler; + + [MonoPInvokeCallback (typeof (nw_ws_options_set_client_request_handler_t))] + static void TrampolineClientRequestHandler (IntPtr block, nw_ws_request_t request) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + var nwRequest = new NWWebSocketRequest (request, owns: true); + del (nwRequest); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public void SetClientRequestHandler (DispatchQueue queue, Action handler) + { + if (queue == null) + throw new ArgumentNullException (nameof (handler)); + if (handler == null) + throw new ArgumentNullException (nameof (handler)); + unsafe { + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_ClientRequestHandler, handler); + try { + nw_ws_options_set_client_request_handler (GetCheckedHandle (), queue.Handle, ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } + } +} \ No newline at end of file diff --git a/src/Network/NWWebSocketRequest.cs b/src/Network/NWWebSocketRequest.cs new file mode 100644 index 0000000000..bd2ed83d21 --- /dev/null +++ b/src/Network/NWWebSocketRequest.cs @@ -0,0 +1,84 @@ +// +// NWWebSocketRequest.cs: Bindings the Network nw_ws_request_t API. +// +// Authors: +// Manuel de la Pena (mandel@microsoft.com) +// +// Copyrigh 2019 Microsoft Inc +// +using System; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using ObjCRuntime; +using Foundation; +using CoreFoundation; + +using OS_nw_ws_request=System.IntPtr; + +namespace Network { + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public class NWWebSocketRequest : NativeObject { + internal NWWebSocketRequest (IntPtr handle, bool owns) : base (handle, owns) {} + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern bool nw_ws_request_enumerate_additional_headers (OS_nw_ws_request request, ref BlockLiteral enumerator); + + delegate void nw_ws_request_enumerate_additional_headers_t (IntPtr block, string header, string value); + static nw_ws_request_enumerate_additional_headers_t static_EnumerateHeaderHandler = TrampolineEnumerateHeaderHandler; + + [MonoPInvokeCallback (typeof (nw_ws_request_enumerate_additional_headers_t))] + static void TrampolineEnumerateHeaderHandler (IntPtr block, string header, string value) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + del (header, value); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public void EnumerateAdditionalHeaders (Action handler) + { + if (handler == null) + throw new ArgumentNullException (nameof (handler)); + + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_EnumerateHeaderHandler, handler); + try { + nw_ws_request_enumerate_additional_headers (GetCheckedHandle (), ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern bool nw_ws_request_enumerate_subprotocols (OS_nw_ws_request request, ref BlockLiteral enumerator); + + delegate void nw_ws_request_enumerate_subprotocols_t (IntPtr block, string subprotocol); + static nw_ws_request_enumerate_subprotocols_t static_EnumerateSubprotocolHandler = TrampolineEnumerateSubprotocolHandler; + + [MonoPInvokeCallback (typeof (nw_ws_request_enumerate_subprotocols_t))] + static void TrampolineEnumerateSubprotocolHandler (IntPtr block, string subprotocol) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + del (subprotocol); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public void EnumerateSubprotocols (Action handler) + { + if (handler == null) + throw new ArgumentNullException (nameof (handler)); + + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_EnumerateSubprotocolHandler, handler); + try { + nw_ws_request_enumerate_subprotocols (GetCheckedHandle (), ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } +} \ No newline at end of file diff --git a/src/Network/NWWebSocketResponse.cs b/src/Network/NWWebSocketResponse.cs new file mode 100644 index 0000000000..279c4191d5 --- /dev/null +++ b/src/Network/NWWebSocketResponse.cs @@ -0,0 +1,83 @@ +// +// NWWebSocketResponse.cs: Bindings the Network nw_browser_t API. +// +// Authors: +// Manuel de la Pena (mandel@microsoft.com) +// +// Copyrigh 2019 Microsoft Inc +// +using System; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using ObjCRuntime; +using Foundation; +using CoreFoundation; + +using OS_nw_ws_response=System.IntPtr; + +namespace Network { + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public enum NWWebSocketResponseStatus { + Invalid = 0, + Accept = 1, + Reject = 2, + } + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public class NWWebSocketResponse : NativeObject { + + internal NWWebSocketResponse (IntPtr handle, bool owns) : base (handle, owns) {} + + [DllImport (Constants.NetworkLibrary, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + static extern unsafe OS_nw_ws_response nw_ws_response_create (NWWebSocketResponseStatus status, string selected_subprotocol); + + public NWWebSocketResponse (NWWebSocketResponseStatus status, string subprotocol) + => InitializeHandle (nw_ws_response_create (status, subprotocol)); + + [DllImport (Constants.NetworkLibrary, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + static extern string nw_ws_response_get_selected_subprotocol (OS_nw_ws_response response); + + public string SelectedSubprotocol => nw_ws_response_get_selected_subprotocol (GetCheckedHandle ()); + + [DllImport (Constants.NetworkLibrary)] + static extern NWWebSocketResponseStatus nw_ws_response_get_status (OS_nw_ws_response response); + + public NWWebSocketResponseStatus Status => nw_ws_response_get_status (GetCheckedHandle ()); + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern bool nw_ws_response_enumerate_additional_headers (OS_nw_ws_response response, ref BlockLiteral enumerator); + + delegate void nw_ws_response_enumerate_additional_headers_t (IntPtr block, string header, string value); + static nw_ws_response_enumerate_additional_headers_t static_EnumerateHeadersHandler = TrampolineEnumerateHeadersHandler; + + [MonoPInvokeCallback (typeof (nw_ws_response_enumerate_additional_headers_t))] + static void TrampolineEnumerateHeadersHandler (IntPtr block, string header, string value) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + del (header, value); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public bool EnumerateAdditionalHeaders (Action handler) + { + if (handler == null) + throw new ArgumentNullException (nameof (handler)); + + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_EnumerateHeadersHandler, handler); + try { + return nw_ws_response_enumerate_additional_headers (GetCheckedHandle (), ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + + [DllImport (Constants.NetworkLibrary, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + static extern void nw_ws_response_add_additional_header (OS_nw_ws_response response, string name, string value); + + public void SetHeader (string header, string value) => nw_ws_response_add_additional_header (GetCheckedHandle (), header, value); + } +} diff --git a/src/frameworks.sources b/src/frameworks.sources index cebd121235..4ef3632057 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -1163,10 +1163,16 @@ NATURALLANGUAGE_SOURCES = \ NETWORK_SOURCES = \ Network/NWAdvertiseDescriptor.cs \ + Network/NWBrowserDescriptor.cs \ + Network/NWBrowseResult.cs \ + Network/NWBrowser.cs \ Network/NWConnection.cs \ Network/NWContentContext.cs \ + Network/NWDataTransferReport.cs \ + Network/NWEstablishmentReport.cs \ Network/NWEndpoint.cs \ Network/NWError.cs \ + Network/NWFramer.cs \ Network/NWInterface.cs \ Network/NWListener.cs \ Network/NWParameters.cs \ @@ -1176,6 +1182,11 @@ NETWORK_SOURCES = \ Network/NWProtocolMetadata.cs \ Network/NWProtocolOptions.cs \ Network/NWProtocolStack.cs \ + Network/NWTxtRecord.cs \ + Network/NWWebSocketMetadata.cs \ + Network/NWWebSocketOptions.cs \ + Network/NWWebSocketRequest.cs \ + Network/NWWebSocketResponse.cs \ # NetworkExtension diff --git a/tests/introspection/ApiCMAttachmentTest.cs b/tests/introspection/ApiCMAttachmentTest.cs index be53952342..3c18fbdac8 100644 --- a/tests/introspection/ApiCMAttachmentTest.cs +++ b/tests/introspection/ApiCMAttachmentTest.cs @@ -234,9 +234,20 @@ namespace Introspection { case "NWPath": // Only ever surfaced, not created from usercode case "NWProtocolStack": // Only ever surfaced, not created from usercode case "NWProtocolMetadata": // While technically it can be created and the header files claim the methods exists, the library is missing the methods (radar: 42443077) + case "NWBrowseResult": // API to be consumed, create a new instance requires a network connection, which is not ideal for this tests. Aslo, the class does not support the API. + case "NWBrowser": // same as above + case "NWDataTransferReport": // same as above + case "NWEstablishmentReport": // same as above + case "NWFramer": // same as above + case "NWTxtRecord": // same as above + case "NWWebSocketMetadata": // same as above + case "NWWebSocketOptions": // same as above + case "NWWebSocketRequest": // same as above + case "NWWebSocketResponse": // same as above case "ABSource": // not skipped when running on iOS 6.1 // type was removed in iOS 10 (and replaced) and never consumed by other API case "CGColorConverter": + case "NWBrowserDescriptor": return true; default: return false; diff --git a/tests/monotouch-test/Network/NWBrowserDescriptorTest.cs b/tests/monotouch-test/Network/NWBrowserDescriptorTest.cs new file mode 100644 index 0000000000..7c2a8a69c9 --- /dev/null +++ b/tests/monotouch-test/Network/NWBrowserDescriptorTest.cs @@ -0,0 +1,69 @@ +#if !__WATCHOS__ +using System; +using System.Collections.Generic; +using System.Threading; +#if XAMCORE_2_0 +using CoreFoundation; +using Foundation; +using Network; +using ObjCRuntime; +using Security; +#else +using MonoTouch.CoreFoundation; +using MonoTouch.Foundation; +using MonoTouch.Network; +using MonoTouch.Security; +#endif + +using NUnit.Framework; + +namespace MonoTouchFixtures.Network { + [TestFixture] + [Preserve (AllMembers = true)] + public class NWBrowserDescriptorTest { + + NWBrowserDescriptor descriptor; + string type = "_ftp._tcp"; + string domain = "MonoTouchFixtures.Network"; + + [TestFixtureSetUp] + public void Init () => TestRuntime.AssertXcodeVersion (11, 0); + + [SetUp] + public void SetUp () + { + descriptor = NWBrowserDescriptor.CreateBonjourService (type, domain); + } + + [TearDown] + public void TearDown () + { + descriptor.Dispose (); + } + + [Test] + public void TestIncludeTxtRecordProperty () + { + Assert.IsFalse (descriptor.IncludeTxtRecord, "Get default value."); + descriptor.IncludeTxtRecord = true; + Assert.IsTrue (descriptor.IncludeTxtRecord, "Get new value."); + } + + [Test] + public void TestCreateNullDomain () + { + using (var newDescriptor = NWBrowserDescriptor.CreateBonjourService (type)) + { + Assert.AreEqual (type, descriptor.BonjourType, "service type"); + Assert.IsNull (newDescriptor.BonjourDomain); + } + } + + [Test] + public void TestBonjourTypeProperty () => Assert.AreEqual (type, descriptor.BonjourType); + + [Test] + public void TestBonjourDomainProperty () => Assert.AreEqual (domain, descriptor.BonjourDomain); + } +} +#endif diff --git a/tests/monotouch-test/Network/NWBrowserTest.cs b/tests/monotouch-test/Network/NWBrowserTest.cs new file mode 100644 index 0000000000..c314e2b7d9 --- /dev/null +++ b/tests/monotouch-test/Network/NWBrowserTest.cs @@ -0,0 +1,93 @@ +#if !__WATCHOS__ +using System; +using System.Collections.Generic; +using System.Threading; +#if XAMCORE_2_0 +using CoreFoundation; +using Foundation; +using Network; +using ObjCRuntime; +using Security; +#else +using MonoTouch.CoreFoundation; +using MonoTouch.Foundation; +using MonoTouch.Network; +using MonoTouch.Security; +#endif + +using NUnit.Framework; + +namespace MonoTouchFixtures.Network { + + [TestFixture] + [Preserve (AllMembers = true)] + public class NWBrowserTest { + + NWBrowserDescriptor descriptor; + NWBrowser browser; + string type = "_ssh._tcp."; + string domain = "local."; + + [TestFixtureSetUp] + public void Init () => TestRuntime.AssertXcodeVersion (11, 0); + + [SetUp] + public void SetUp () + { + descriptor = NWBrowserDescriptor.CreateBonjourService (type, domain); + browser = new NWBrowser (descriptor); + browser.SetDispatchQueue (DispatchQueue.DefaultGlobalQueue); + } + + [TearDown] + public void TearDown () + { + descriptor.Dispose (); + browser.Dispose (); + } + + [Test] + public void TestConstructorNullParameters () + { + using (var otherBrowser = new NWBrowser (descriptor)) { + Assert.IsNotNull (otherBrowser.Descriptor, "Descriptor"); + // we expect the default parameters + Assert.IsNotNull (otherBrowser.Parameters, "Parameters"); + } + } + + [Test] + public void TestDispatchQueuPropertyNull () => Assert.Throws (() => { browser.SetDispatchQueue (null); }); + + [Test] + public void TestStart () + { + Assert.IsFalse (browser.IsActive, "Idle"); + browser.Start (); + Assert.IsTrue (browser.IsActive, "Active"); + browser.Cancel (); + Assert.IsFalse (browser.IsActive, "Cancel"); + } + + [Test] + public void TestStartNoQ () { + using (var newBrowser = new NWBrowser (descriptor)) + Assert.Throws (() => newBrowser.Start ()); + } + + [Test] + public void TestStateChangesHandler () + { + var e = new AutoResetEvent (false); + browser.SetStateChangesHandler ((st, er) => { + Assert.IsNotNull (st, "State"); + Assert.IsNull (er, "Error"); + e.Set (); + }); + browser.Start (); + e.WaitOne (); + browser.Cancel (); + } + } +} +#endif \ No newline at end of file diff --git a/tests/monotouch-test/Network/NWEstablishmentReportTest.cs b/tests/monotouch-test/Network/NWEstablishmentReportTest.cs new file mode 100644 index 0000000000..826aa9df2c --- /dev/null +++ b/tests/monotouch-test/Network/NWEstablishmentReportTest.cs @@ -0,0 +1,135 @@ + +#if !__WATCHOS__ +using System; +using System.Collections.Generic; +using System.Threading; +#if XAMCORE_2_0 +using CoreFoundation; +using Foundation; +using Network; +using ObjCRuntime; +using Security; +#else +using MonoTouch.CoreFoundation; +using MonoTouch.Foundation; +using MonoTouch.Network; +using MonoTouch.Security; +#endif + +using NUnit.Framework; + +namespace MonoTouchFixtures.Network { + + [TestFixture] + [Preserve (AllMembers = true)] + public class NWEstablishmentReportTest { + + AutoResetEvent connectedEvent; // used to let us know when the connection was established so that we can access the Report + AutoResetEvent reportEvent; // used to let us know when the connection was established and we got the report + string host; + NWConnection connection; + NWEstablishmentReport report; + + void ConnectionStateHandler (NWConnectionState state, NWError error) + { + Console.WriteLine ($"State is {state} and error {error}"); + switch (state){ + case NWConnectionState.Ready: + connectedEvent.Set (); + break; + case NWConnectionState.Cancelled: + connection?.Dispose (); + connection = null; + break; + case NWConnectionState.Invalid: + case NWConnectionState.Failed: + Assert.Inconclusive ("Network connection could not be performed."); + break; + } + } + + [TestFixtureSetUp] + public void Init () + { + TestRuntime.AssertXcodeVersion (11, 0); + // connect so that we can later when the report and test with it + connectedEvent = new AutoResetEvent(false); + reportEvent = new AutoResetEvent (false); + host = "www.google.com"; + // we create a connection which we are going to use to get the availabe + // interfaces, that way we can later test protperties of the NWParameters class. + using (var parameters = NWParameters.CreateUdp ()) + using (var endpoint = NWEndpoint.Create (host, "80")) + { + using (var protocolStack = parameters.ProtocolStack) { + var ipOptions = protocolStack.InternetProtocol; + ipOptions.IPSetVersion (NWIPVersion.Version4); + } + connection = new NWConnection (endpoint, parameters); + connection.SetQueue (DispatchQueue.DefaultGlobalQueue); // important, else we will get blocked + connection.SetStateChangeHandler (ConnectionStateHandler); + connection.Start (); + Assert.True (connectedEvent.WaitOne (20000), "Connection timed out."); + connection.GetEstablishmentReport (DispatchQueue.DefaultGlobalQueue, (r) => { + Console.WriteLine ("Got report"); + report = r; + reportEvent.Set (); + }); + Assert.True (reportEvent.WaitOne (20000), "Connection timed out."); + } + } + + [TestFixtureTearDown] + public void Dispose() + { + connection?.Cancel (); + report.Dispose (); + } + + [Test] + public void TestUsedProxy () + { + TestRuntime.IgnoreInCI ("CI bots might have proxies setup and will mean that the test will fail."); + Assert.IsFalse (report.UsedProxy, "Used proxy"); + } + + [Test] + public void TestProxyConfigured () + { + TestRuntime.IgnoreInCI ("CI bots might have proxies setup and will mean that the test will fail."); + Assert.IsFalse (report.ProxyConfigured, "Proxy configured."); + } + + [Test] + public void TestPreviousAttemptCount () => Assert.AreNotEqual (-1, report.PreviousAttemptCount); + + [Test] + public void TestDuration () => Assert.IsTrue (report.Duration > TimeSpan.MinValue); + + [Test] + public void TestConnectionSetupTime () => Assert.IsTrue (report.ConnectionSetupTime > TimeSpan.MinValue); + + [Test] + public void TestEnumerateResolutions () + { + var e = new AutoResetEvent (false); + report.EnumerateResolutions ((source, duration, count, endpoint, preferred) => { + Assert.IsTrue (duration > TimeSpan.MinValue, "Durantion"); + Assert.AreNotEqual (0, count, "Count"); + Assert.IsNotNull (endpoint, "endpoint"); + Assert.IsNotNull (preferred, "preferred"); + e.Set (); + }); + e.WaitOne (); + } + + [Test] + public void TestProxyEnpoint () + { + TestRuntime.IgnoreInCI ("CI bots might have proxies setup and will mean that the test will fail."); + Assert.IsNull (report.ProxyEndpoint); + + } + } +} +#endif \ No newline at end of file diff --git a/tests/monotouch-test/Network/NWListenerTest.cs b/tests/monotouch-test/Network/NWListenerTest.cs new file mode 100644 index 0000000000..ba0550e349 --- /dev/null +++ b/tests/monotouch-test/Network/NWListenerTest.cs @@ -0,0 +1,57 @@ +#if !__WATCHOS__ +using System; +using System.Collections.Generic; +using System.Threading; +#if XAMCORE_2_0 +using CoreFoundation; +using Foundation; +using Network; +using ObjCRuntime; +using Security; +#else +using MonoTouch.CoreFoundation; +using MonoTouch.Foundation; +using MonoTouch.Network; +using MonoTouch.Security; +#endif + +using NUnit.Framework; + +namespace MonoTouchFixtures.Network { + [TestFixture] + [Preserve (AllMembers = true)] + public class NWListenerTest { + + NWListener listener; + NWParameters parameters; + + [TestFixtureSetUp] + public void Init () => TestRuntime.AssertXcodeVersion (11, 0); + + [SetUp] + public void SetUp () + { + parameters = new NWParameters (); + listener = NWListener.Create (parameters); + } + + [TearDown] + public void TearDown () + { + listener?.Dispose (); + parameters?.Dispose (); + } + + [Test] + public void TestConnectionLimit () + { + TestRuntime.AssertXcodeVersion (11, 0); + + var defaultValue = 4294967295; // got it from running the code, if changes we will have an error. + Assert.AreEqual (defaultValue, listener.ConnectionLimit); + listener.ConnectionLimit = 10; + Assert.AreEqual (10, listener.ConnectionLimit, "New value was not stored."); + } + } +} +#endif \ No newline at end of file diff --git a/tests/monotouch-test/Network/NWParametersTest.cs b/tests/monotouch-test/Network/NWParametersTest.cs index c973bd30f1..68ca4bf44c 100644 --- a/tests/monotouch-test/Network/NWParametersTest.cs +++ b/tests/monotouch-test/Network/NWParametersTest.cs @@ -396,6 +396,18 @@ namespace MonoTouchFixtures.Network { Assert.True (parameters.IncludePeerToPeer, "New value was not stored."); } } + + [Test] + public void TestProhibitConstrained () + { + TestRuntime.AssertXcodeVersion (11, 0); + using (var parameters = new NWParameters ()) { + var defaultValue = false; + Assert.False (defaultValue, "Default value changed."); + parameters.ProhibitConstrained = true; + Assert.True (parameters.ProhibitConstrained, "New value was not stored."); + } + } } } #endif \ No newline at end of file diff --git a/tests/monotouch-test/Network/NWPathTest.cs b/tests/monotouch-test/Network/NWPathTest.cs index aafd18e866..9f1d08921e 100644 --- a/tests/monotouch-test/Network/NWPathTest.cs +++ b/tests/monotouch-test/Network/NWPathTest.cs @@ -159,6 +159,26 @@ namespace MonoTouchFixtures.Network { path.EnumerateInterfaces (EnumerateInterfacesHandler); Assert.That (interfaces.Count, Is.GreaterThan (0), "interfaces.Count"); } + + [Test] + public void EnumerateGatewayNullCallbackTest () + { + TestRuntime.AssertXcodeVersion (11, 0); + + Assert.Throws (() => { path.EnumerateGateways (null); }); + } + + [Test] + public void EnumerateGatewayTest () + { + TestRuntime.AssertXcodeVersion (11, 0); + var e = new AutoResetEvent (false); + path.EnumerateGateways ((endPoint) => { + Assert.IsNotNull (endPoint); + e.Set (); + }); + e.WaitOne (10000); + } } } diff --git a/tests/monotouch-test/Network/NWProtocolDefinitionTest.cs b/tests/monotouch-test/Network/NWProtocolDefinitionTest.cs new file mode 100644 index 0000000000..a43e310927 --- /dev/null +++ b/tests/monotouch-test/Network/NWProtocolDefinitionTest.cs @@ -0,0 +1,68 @@ +#if !__WATCHOS__ +using System; +using System.Collections.Generic; +using System.Threading; +#if XAMCORE_2_0 +using CoreFoundation; +using Foundation; +using Network; +using ObjCRuntime; +using Security; +#else +using MonoTouch.CoreFoundation; +using MonoTouch.Foundation; +using MonoTouch.Network; +using MonoTouch.Security; +#endif + +using NUnit.Framework; + +namespace MonoTouchFixtures.Network { + + [TestFixture] + [Preserve (AllMembers = true)] + public class NWProtocolDefinitionTest { + + [TestFixtureSetUp] + public void Init () => TestRuntime.AssertXcodeVersion (10, 0); + + + + [Test] + public void IPDefinitionTest () + { + using (var definition = NWProtocolDefinition.IPDefinition) + Assert.NotNull (definition); + } + + [Test] + public void TcpDefinitionTest () + { + using (var definition = NWProtocolDefinition.TcpDefinition) + Assert.NotNull (definition); + } + + [Test] + public void TlsDefinitionTest () + { + using (var definition = NWProtocolDefinition.TlsDefinition) + Assert.NotNull (definition); + } + + [Test] + public void UdpDefinitionTest () + { + using (var definition = NWProtocolDefinition.UdpDefinition) + Assert.NotNull (definition); + } + + [Test] + public void WebSocketDefinitionTest () + { + TestRuntime.AssertXcodeVersion (11, 0); + using (var definition = NWProtocolDefinition.WebSocketDefinition) + Assert.NotNull (definition); + } + } +} +#endif diff --git a/tests/monotouch-test/Network/NWProtocolOptionsTest.cs b/tests/monotouch-test/Network/NWProtocolOptionsTest.cs index 41eb20c307..043aed6688 100644 --- a/tests/monotouch-test/Network/NWProtocolOptionsTest.cs +++ b/tests/monotouch-test/Network/NWProtocolOptionsTest.cs @@ -1,4 +1,4 @@ -#if !__WATCHOS__ +#if !__WATCHOS__ using System; #if XAMCORE_2_0 using Foundation; @@ -50,6 +50,21 @@ namespace MonoTouchFixtures.Network { Assert.AreNotEqual (IntPtr.Zero, options.Handle); } } + + [Test] + public void SetIPLocalAddressPreference () + { + TestRuntime.AssertXcodeVersion (11, 0); + + foreach (var ipOption in new [] { NWIPLocalAddressPreference.Default, NWIPLocalAddressPreference.Stable, NWIPLocalAddressPreference.Temporary}) { + using (var options = NWProtocolOptions.CreateTls ()) + Assert.DoesNotThrow (() => options.IPLocalAddressPreference = ipOption, "Tls"); + using (var options = NWProtocolOptions.CreateTcp ()) + Assert.DoesNotThrow (() => options.IPLocalAddressPreference = ipOption, "Tcp"); + using (var options = NWProtocolOptions.CreateUdp ()) + Assert.DoesNotThrow (() => options.IPLocalAddressPreference = ipOption, "Udp"); + } + } } } -#endif \ No newline at end of file +#endif diff --git a/tests/monotouch-test/Network/NWProtocolStackTest.cs b/tests/monotouch-test/Network/NWProtocolStackTest.cs index 0dbec72be1..b36bb6a1bc 100644 --- a/tests/monotouch-test/Network/NWProtocolStackTest.cs +++ b/tests/monotouch-test/Network/NWProtocolStackTest.cs @@ -36,7 +36,7 @@ namespace MonoTouchFixtures.Network { // we want to use a single connection, since it is expensive connectedEvent = new AutoResetEvent(false); host = "www.google.com"; - using (var parameters = NWParameters.CreateUdp ()) + using (var parameters = NWParameters.CreateTcp ()) using (var endpoint = NWEndpoint.Create (host, "80")) { connection = new NWConnection (endpoint, parameters); connection.SetQueue (DispatchQueue.DefaultGlobalQueue); // important, else we will get blocked @@ -45,8 +45,10 @@ namespace MonoTouchFixtures.Network { Assert.True (connectedEvent.WaitOne (20000), "Connection timed out."); stack = parameters.ProtocolStack; using (var ipOptions = stack.InternetProtocol) { - ipOptions.IPSetVersion (NWIPVersion.Version4); - stack.PrependApplicationProtocol (ipOptions); + if (ipOptions != null) { + ipOptions.IPSetVersion (NWIPVersion.Version4); + stack.PrependApplicationProtocol (ipOptions); + } } } } @@ -54,7 +56,7 @@ namespace MonoTouchFixtures.Network { [TestFixtureTearDown] public void Dispose() { - connection?.Cancel (); + connection.Cancel (); } [SetUp] @@ -111,7 +113,7 @@ namespace MonoTouchFixtures.Network { stack.IterateProtocols (InterateProtocolsHandler); Assert.AreEqual (0, options.Count, "Cleared options"); } - + /* [Test] public void TransportProtocolPropertyTest () { @@ -124,7 +126,7 @@ namespace MonoTouchFixtures.Network { stack.TransportProtocol = options; using (var copyOptions = stack.TransportProtocol) { - copyOptions.IPSetUseMinimumMtu (true); // should not crash + copyOptions?.IPSetUseMinimumMtu (true); // should not crash } } } @@ -134,10 +136,12 @@ namespace MonoTouchFixtures.Network { { using (var o = stack.InternetProtocol) { - o.IPSetUseMinimumMtu (true); // should not crash + if (o != null) + o.IPSetUseMinimumMtu (true); // should not crash + Assert.Inconclusive ("stack does not have an IP protocol."); } } - + */ } } diff --git a/tests/monotouch-test/Network/NWTxtRecordTest.cs b/tests/monotouch-test/Network/NWTxtRecordTest.cs new file mode 100644 index 0000000000..9e80d142bf --- /dev/null +++ b/tests/monotouch-test/Network/NWTxtRecordTest.cs @@ -0,0 +1,173 @@ +#if !__WATCHOS__ +using System; +using System.Collections.Generic; +using System.Threading; +#if XAMCORE_2_0 +using CoreFoundation; +using Foundation; +using Network; +using ObjCRuntime; +using Security; +#else +using MonoTouch.CoreFoundation; +using MonoTouch.Foundation; +using MonoTouch.Network; +using MonoTouch.Security; +#endif + +using NUnit.Framework; + +namespace MonoTouchFixtures.Network +{ + [TestFixture] + [Preserve(AllMembers = true)] + public class NWTxtRecordTest + { + NWTxtRecord record; + string randomKey = "MyData"; + + [TestFixtureSetUp] + public void Init () => TestRuntime.AssertXcodeVersion (11, 0); + + + [SetUp] + public void SetUp () + { + record = NWTxtRecord.CreateDictionary (); + record.Add (randomKey, new byte[3] { 0, 0, 0 }); + } + + [Test] + public void TestFromBytes () + { + // get the raw data from the dictionary create txt record, and recreate a new one + var e = new AutoResetEvent (false); + record.GetRawBytes ( + (d) => { + Assert.AreNotEqual (0, d.Length, "Raw data length."); + e.Set (); + } + ); + e.WaitOne (); + } + + [TearDown] + public void TearDown () + { + record.Dispose (); + } + + [Test] + public void TestMissingKey () => Assert.AreEqual (NWTxtRecordFindKey.NotPresent, record.FindKey ("foo")); + + [Test] + public void TestPresentKey () => Assert.AreEqual (NWTxtRecordFindKey.NonEmptyValue, record.FindKey (randomKey)); + + [Test] + public void TestAddByteValue () + { + var data = new byte [] {10, 20, 30, 40}; + var mySecondKey = "secondKey"; + Assert.True (record.Add (mySecondKey, data), "Add"); + Assert.AreEqual (NWTxtRecordFindKey.NonEmptyValue, record.FindKey (mySecondKey)); + } + + [Test] + public void TestAddNoValue () + { + var mySecondKey = "secondLKey"; + Assert.True (record.Add (mySecondKey), "Add"); + Assert.AreEqual (NWTxtRecordFindKey.NoValue, record.FindKey (mySecondKey)); + } + + [Test] + public void TestAddStringValue () + { + var data = "hello"; + var mySecondKey = "secondLKey"; + Assert.True (record.Add (mySecondKey, data), "Add"); + Assert.AreEqual (NWTxtRecordFindKey.NonEmptyValue, record.FindKey (mySecondKey)); + } + + [Test] + public void TestAddNullStringValue () + { + string data = null; + var mySecondKey = "secondLKey"; + Assert.True (record.Add (mySecondKey, data), "Add"); + Assert.AreEqual (NWTxtRecordFindKey.NoValue, record.FindKey (mySecondKey)); + } + + [Test] + public void TestRemoveMissingKey () => Assert.IsFalse (record.Remove ("NotPresentKey")); + + [Test] + public void TestRemovePresentKey () + { + Assert.True (record.Remove (randomKey), "Remove"); + Assert.AreEqual (NWTxtRecordFindKey.NotPresent, record.FindKey (randomKey), "FindKey"); + } + + [Test] + public void TestKeyCount () => Assert.AreEqual (1, record.KeyCount); + + [Test] + public void TestIsDictionary () => Assert.IsTrue (record.IsDictionary); + + [Test] + public void TestNotNullEquals () => Assert.IsFalse (record.Equals (null)); + + [Test] + public void TestApply () + { + // fill the txt with several keys to be iterated + var keys = new List {"first", "second", "third", randomKey}; + foreach (var key in keys) { + record.Add (key, key); + } + // apply and ensure that we do get all the keys + var keyCount = 0; + record.Apply ((k, r, v) => { + keyCount++; + Assert.IsTrue (keys.Contains (k), k); + }); + Assert.AreEqual (keys.Count, keyCount, "keycount"); + } + + [Test] + public void TestGetValueMissing () + { + var missing = "missingKey"; + record.GetValue (missing, (k, r, value) => { + Assert.AreEqual (missing, k, "key"); + Assert.AreEqual (NWTxtRecordFindKey.NotPresent, r, "result"); + Assert.AreEqual (0, value.Length, "value"); + }); + } + + [Test] + public void TestGetValuePresent () + { + record.GetValue (randomKey, (k, r, value) => { + Assert.AreEqual (randomKey, k, "key"); + Assert.AreEqual (NWTxtRecordFindKey.NonEmptyValue, r, "result"); + Assert.AreNotEqual (0, value.Length, "value"); + }); + } + + [Test] + public void TestGetRaw () + { + var e = new AutoResetEvent (false); + record.GetRawBytes ( + (d) => { + Assert.AreNotEqual (0, d.Length); + e.Set (); + } + ); + e.WaitOne (); + + } + } +} +#endif diff --git a/tests/monotouch-test/Network/NWWebSocketMetadataTest.cs b/tests/monotouch-test/Network/NWWebSocketMetadataTest.cs new file mode 100644 index 0000000000..c0254b02db --- /dev/null +++ b/tests/monotouch-test/Network/NWWebSocketMetadataTest.cs @@ -0,0 +1,68 @@ +#if !__WATCHOS__ +using System; +using System.Collections.Generic; +using System.Threading; +#if XAMCORE_2_0 +using CoreFoundation; +using Foundation; +using Network; +using ObjCRuntime; +using Security; +#else +using MonoTouch.CoreFoundation; +using MonoTouch.Foundation; +using MonoTouch.Network; +using MonoTouch.Security; +#endif + +using NUnit.Framework; + +namespace MonoTouchFixtures.Network { + + [TestFixture] + [Preserve (AllMembers = true)] + public class NWWebSocketMetadataTest { + + NWWebSocketMetadata metadata; + + [TestFixtureSetUp] + public void Init () => TestRuntime.AssertXcodeVersion (11, 0); + + [SetUp] + public void SetUp () + { + metadata = new NWWebSocketMetadata (NWWebSocketOpCode.Text); + } + + [TearDown] + public void TearDown () + { + metadata.Dispose (); + } + + [Test] + public void TestConstructor () + { + foreach (var opCode in new [] { NWWebSocketOpCode.Binary, NWWebSocketOpCode.Close, NWWebSocketOpCode.Cont, NWWebSocketOpCode.Invalid, NWWebSocketOpCode.Ping, NWWebSocketOpCode.Pong, NWWebSocketOpCode.Text }) { + Assert.DoesNotThrow (() => { + var newMetadata = new NWWebSocketMetadata (opCode); + newMetadata.Dispose (); + }); + } + } + + [Test] + public void TestPongHandlerNullQ () => Assert.Throws (() => metadata.SetPongHandler (null, (e) => { })); + + [Test] + public void TestPongHandlerNullCallaback () => Assert.Throws (() => metadata.SetPongHandler (DispatchQueue.CurrentQueue, null)); + + [Test] + public void TestServerResponse () + { + var resposne = metadata.ServerResponse; + Assert.IsNull (resposne); // did not make a request, null is expected + } + } +} +#endif diff --git a/tests/monotouch-test/Network/NWWebSocketOptionsTest.cs b/tests/monotouch-test/Network/NWWebSocketOptionsTest.cs new file mode 100644 index 0000000000..3b95a4be4d --- /dev/null +++ b/tests/monotouch-test/Network/NWWebSocketOptionsTest.cs @@ -0,0 +1,104 @@ +#if !__WATCHOS__ +using System; +using System.Collections.Generic; +using System.Threading; +#if XAMCORE_2_0 +using CoreFoundation; +using Foundation; +using Network; +using ObjCRuntime; +using Security; +#else +using MonoTouch.CoreFoundation; +using MonoTouch.Foundation; +using MonoTouch.Network; +using MonoTouch.Security; +#endif + +using NUnit.Framework; + +namespace MonoTouchFixtures.Network { + + [TestFixture] + [Preserve (AllMembers = true)] + public class NWWebSocketOptionsTest { + + NWWebSocketOptions options; + + [TestFixtureSetUp] + public void Init () => TestRuntime.AssertXcodeVersion (11, 0); + + [SetUp] + public void SetUp () + { + options = new NWWebSocketOptions (NWWebSocketVersion.Version13); + } + + [TearDown] + public void TearDown () + { + options.Dispose (); + } + + [Test] + public void TestConstructorInvalidVersion () + { + Assert.DoesNotThrow (() => { + using (var otherOptions = new NWWebSocketOptions (NWWebSocketVersion.Invalid)) + Assert.AreNotEqual (IntPtr.Zero, otherOptions.Handle); + }); + } + + [Test] + public void TestSetHeader () => Assert.DoesNotThrow (() => options.SetHeader ("CustomHeader", "hola")); + + [Test] + public void TestSetHeaderNullName () => Assert.Throws (() => options.SetHeader (null, "hola")); + + + [Test] + public void TestSetHeaderNullValue () => Assert.DoesNotThrow (() => options.SetHeader ("CustomHeader", null)); + + [Test] + public void TestAddSubprotocol () => Assert.DoesNotThrow (() => options.AddSubprotocol ("Protobuf")); + + [Test] + public void TestAddSubprotocolNullValue () => Assert.Throws (() => options.AddSubprotocol (null)); + + [Test] + public void TestAutoReplyPing () + { + var defaultValue = options.AutoReplyPing; + Assert.IsFalse (defaultValue, "defaultValue"); + options.AutoReplyPing = true; + Assert.IsTrue (options.AutoReplyPing, "new value"); + } + + [Test] + public void TestMaxMessageSize () + { + var defaultValue = options.MaximumMessageSize; + Assert.AreEqual (defaultValue, 0, "defaultValue"); + nuint newValue = 40; + options.MaximumMessageSize = newValue; + Assert.AreEqual (newValue, options.MaximumMessageSize, "new value"); + } + + [Test] + public void TestSkipHandShake () + { + Assert.IsFalse (options.SkipHandShake, "defaultValue"); + options.SkipHandShake = true; + Assert.IsTrue (options.SkipHandShake, "new value"); + } + + [Test] + public void TestClientRequenHandlerNullQ () => Assert.Throws (() => options.SetClientRequestHandler (null, (r) => { })); + + [Test] + public void TestClientRequestHandlerNullCallback () => Assert.Throws (() => options.SetClientRequestHandler (DispatchQueue.CurrentQueue, null)); + + + } +} +#endif diff --git a/tests/xtro-sharpie/common-Network.ignore b/tests/xtro-sharpie/common-Network.ignore index 5fc793e27f..52def1405c 100644 --- a/tests/xtro-sharpie/common-Network.ignore +++ b/tests/xtro-sharpie/common-Network.ignore @@ -15,6 +15,16 @@ !missing-protocol! OS_nw_protocol_options not bound !missing-protocol! OS_nw_protocol_stack not bound !missing-protocol! OS_nw_object not bound +!missing-protocol! OS_nw_browse_descriptor not bound +!missing-protocol! OS_nw_browse_result not bound +!missing-protocol! OS_nw_browser not bound +!missing-protocol! OS_nw_data_transfer_report not bound +!missing-protocol! OS_nw_establishment_report not bound +!missing-protocol! OS_nw_ethernet_channel not bound +!missing-protocol! OS_nw_framer not bound +!missing-protocol! OS_nw_txt_record not bound +!missing-protocol! OS_nw_ws_request not bound +!missing-protocol! OS_nw_ws_response not bound # no need, please see comment: https://github.com/xamarin/xamarin-macios/pull/4251#issuecomment-410815837 !missing-pinvoke! nw_release is not bound diff --git a/tests/xtro-sharpie/iOS-Network.todo b/tests/xtro-sharpie/iOS-Network.todo index 63d56b32e3..ca5c91cc1f 100644 --- a/tests/xtro-sharpie/iOS-Network.todo +++ b/tests/xtro-sharpie/iOS-Network.todo @@ -1,64 +1,15 @@ !missing-field! _nw_data_transfer_report_all_paths not bound -!missing-pinvoke! nw_advertise_descriptor_copy_txt_record_object is not bound -!missing-pinvoke! nw_advertise_descriptor_set_txt_record_object is not bound -!missing-pinvoke! nw_browse_descriptor_create_bonjour_service is not bound -!missing-pinvoke! nw_browse_descriptor_get_bonjour_service_domain is not bound -!missing-pinvoke! nw_browse_descriptor_get_bonjour_service_type is not bound -!missing-pinvoke! nw_browse_descriptor_get_include_txt_record is not bound -!missing-pinvoke! nw_browse_descriptor_set_include_txt_record is not bound -!missing-pinvoke! nw_browse_result_copy_endpoint is not bound -!missing-pinvoke! nw_browse_result_copy_txt_record_object is not bound -!missing-pinvoke! nw_browse_result_enumerate_interfaces is not bound -!missing-pinvoke! nw_browse_result_get_changes is not bound -!missing-pinvoke! nw_browse_result_get_interfaces_count is not bound -!missing-pinvoke! nw_browser_cancel is not bound -!missing-pinvoke! nw_browser_copy_browse_descriptor is not bound -!missing-pinvoke! nw_browser_copy_parameters is not bound -!missing-pinvoke! nw_browser_create is not bound -!missing-pinvoke! nw_browser_set_browse_results_changed_handler is not bound -!missing-pinvoke! nw_browser_set_queue is not bound -!missing-pinvoke! nw_browser_set_state_changed_handler is not bound -!missing-pinvoke! nw_browser_start is not bound -!missing-pinvoke! nw_connection_access_establishment_report is not bound -!missing-pinvoke! nw_connection_create_new_data_transfer_report is not bound -!missing-pinvoke! nw_data_transfer_report_collect is not bound -!missing-pinvoke! nw_data_transfer_report_copy_path_interface is not bound -!missing-pinvoke! nw_data_transfer_report_get_duration_milliseconds is not bound -!missing-pinvoke! nw_data_transfer_report_get_path_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_application_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_ip_packet_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_transport_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_transport_duplicate_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_transport_out_of_order_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_sent_application_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_sent_ip_packet_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_sent_transport_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_sent_transport_retransmitted_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_state is not bound -!missing-pinvoke! nw_data_transfer_report_get_transport_minimum_rtt_milliseconds is not bound -!missing-pinvoke! nw_data_transfer_report_get_transport_rtt_variance is not bound -!missing-pinvoke! nw_data_transfer_report_get_transport_smoothed_rtt_milliseconds is not bound -!missing-pinvoke! nw_endpoint_create_url is not bound -!missing-pinvoke! nw_endpoint_get_url is not bound -!missing-pinvoke! nw_establishment_report_copy_proxy_endpoint is not bound -!missing-pinvoke! nw_establishment_report_enumerate_protocols is not bound -!missing-pinvoke! nw_establishment_report_enumerate_resolutions is not bound -!missing-pinvoke! nw_establishment_report_get_attempt_started_after_milliseconds is not bound -!missing-pinvoke! nw_establishment_report_get_duration_milliseconds is not bound -!missing-pinvoke! nw_establishment_report_get_previous_attempt_count is not bound -!missing-pinvoke! nw_establishment_report_get_proxy_configured is not bound -!missing-pinvoke! nw_establishment_report_get_used_proxy is not bound +!missing-pinvoke! nw_framer_create_definition is not bound +!missing-pinvoke! nw_framer_message_access_value is not bound !missing-pinvoke! nw_framer_async is not bound !missing-pinvoke! nw_framer_copy_local_endpoint is not bound !missing-pinvoke! nw_framer_copy_parameters is not bound !missing-pinvoke! nw_framer_copy_remote_endpoint is not bound -!missing-pinvoke! nw_framer_create_definition is not bound !missing-pinvoke! nw_framer_create_options is not bound !missing-pinvoke! nw_framer_deliver_input is not bound !missing-pinvoke! nw_framer_deliver_input_no_copy is not bound !missing-pinvoke! nw_framer_mark_failed_with_error is not bound !missing-pinvoke! nw_framer_mark_ready is not bound -!missing-pinvoke! nw_framer_message_access_value is not bound !missing-pinvoke! nw_framer_message_copy_object_value is not bound !missing-pinvoke! nw_framer_message_create is not bound !missing-pinvoke! nw_framer_message_set_object_value is not bound @@ -77,56 +28,4 @@ !missing-pinvoke! nw_framer_set_wakeup_handler is not bound !missing-pinvoke! nw_framer_write_output is not bound !missing-pinvoke! nw_framer_write_output_data is not bound -!missing-pinvoke! nw_framer_write_output_no_copy is not bound -!missing-pinvoke! nw_ip_options_set_local_address_preference is not bound -!missing-pinvoke! nw_listener_get_new_connection_limit is not bound -!missing-pinvoke! nw_listener_set_new_connection_limit is not bound -!missing-pinvoke! nw_parameters_get_prohibit_constrained is not bound -!missing-pinvoke! nw_parameters_set_prohibit_constrained is not bound -!missing-pinvoke! nw_path_enumerate_gateways is not bound -!missing-pinvoke! nw_path_is_constrained is not bound -!missing-pinvoke! nw_protocol_copy_ws_definition is not bound -!missing-pinvoke! nw_protocol_metadata_is_framer_message is not bound -!missing-pinvoke! nw_protocol_metadata_is_ws is not bound -!missing-pinvoke! nw_txt_record_access_bytes is not bound -!missing-pinvoke! nw_txt_record_access_key is not bound -!missing-pinvoke! nw_txt_record_apply is not bound -!missing-pinvoke! nw_txt_record_copy is not bound -!missing-pinvoke! nw_txt_record_create_dictionary is not bound -!missing-pinvoke! nw_txt_record_create_with_bytes is not bound -!missing-pinvoke! nw_txt_record_find_key is not bound -!missing-pinvoke! nw_txt_record_get_key_count is not bound -!missing-pinvoke! nw_txt_record_is_dictionary is not bound -!missing-pinvoke! nw_txt_record_is_equal is not bound -!missing-pinvoke! nw_txt_record_remove_key is not bound -!missing-pinvoke! nw_txt_record_set_key is not bound -!missing-pinvoke! nw_ws_create_metadata is not bound -!missing-pinvoke! nw_ws_create_options is not bound -!missing-pinvoke! nw_ws_metadata_copy_server_response is not bound -!missing-pinvoke! nw_ws_metadata_get_close_code is not bound -!missing-pinvoke! nw_ws_metadata_get_opcode is not bound -!missing-pinvoke! nw_ws_metadata_set_close_code is not bound -!missing-pinvoke! nw_ws_metadata_set_pong_handler is not bound -!missing-pinvoke! nw_ws_options_add_additional_header is not bound -!missing-pinvoke! nw_ws_options_add_subprotocol is not bound -!missing-pinvoke! nw_ws_options_set_auto_reply_ping is not bound -!missing-pinvoke! nw_ws_options_set_client_request_handler is not bound -!missing-pinvoke! nw_ws_options_set_maximum_message_size is not bound -!missing-pinvoke! nw_ws_options_set_skip_handshake is not bound -!missing-pinvoke! nw_ws_request_enumerate_additional_headers is not bound -!missing-pinvoke! nw_ws_request_enumerate_subprotocols is not bound -!missing-pinvoke! nw_ws_response_add_additional_header is not bound -!missing-pinvoke! nw_ws_response_create is not bound -!missing-pinvoke! nw_ws_response_enumerate_additional_headers is not bound -!missing-pinvoke! nw_ws_response_get_selected_subprotocol is not bound -!missing-pinvoke! nw_ws_response_get_status is not bound -!missing-protocol! OS_nw_browse_descriptor not bound -!missing-protocol! OS_nw_browse_result not bound -!missing-protocol! OS_nw_browser not bound -!missing-protocol! OS_nw_data_transfer_report not bound -!missing-protocol! OS_nw_establishment_report not bound -!missing-protocol! OS_nw_ethernet_channel not bound -!missing-protocol! OS_nw_framer not bound -!missing-protocol! OS_nw_txt_record not bound -!missing-protocol! OS_nw_ws_request not bound -!missing-protocol! OS_nw_ws_response not bound +!missing-pinvoke! nw_framer_write_output_no_copy is not bound \ No newline at end of file diff --git a/tests/xtro-sharpie/macOS-Network.todo b/tests/xtro-sharpie/macOS-Network.todo index 3eb75490b4..c666480620 100644 --- a/tests/xtro-sharpie/macOS-Network.todo +++ b/tests/xtro-sharpie/macOS-Network.todo @@ -1,53 +1,4 @@ !missing-field! _nw_data_transfer_report_all_paths not bound -!missing-pinvoke! nw_advertise_descriptor_copy_txt_record_object is not bound -!missing-pinvoke! nw_advertise_descriptor_set_txt_record_object is not bound -!missing-pinvoke! nw_browse_descriptor_create_bonjour_service is not bound -!missing-pinvoke! nw_browse_descriptor_get_bonjour_service_domain is not bound -!missing-pinvoke! nw_browse_descriptor_get_bonjour_service_type is not bound -!missing-pinvoke! nw_browse_descriptor_get_include_txt_record is not bound -!missing-pinvoke! nw_browse_descriptor_set_include_txt_record is not bound -!missing-pinvoke! nw_browse_result_copy_endpoint is not bound -!missing-pinvoke! nw_browse_result_copy_txt_record_object is not bound -!missing-pinvoke! nw_browse_result_enumerate_interfaces is not bound -!missing-pinvoke! nw_browse_result_get_changes is not bound -!missing-pinvoke! nw_browse_result_get_interfaces_count is not bound -!missing-pinvoke! nw_browser_cancel is not bound -!missing-pinvoke! nw_browser_copy_browse_descriptor is not bound -!missing-pinvoke! nw_browser_copy_parameters is not bound -!missing-pinvoke! nw_browser_create is not bound -!missing-pinvoke! nw_browser_set_browse_results_changed_handler is not bound -!missing-pinvoke! nw_browser_set_queue is not bound -!missing-pinvoke! nw_browser_set_state_changed_handler is not bound -!missing-pinvoke! nw_browser_start is not bound -!missing-pinvoke! nw_connection_access_establishment_report is not bound -!missing-pinvoke! nw_connection_create_new_data_transfer_report is not bound -!missing-pinvoke! nw_data_transfer_report_collect is not bound -!missing-pinvoke! nw_data_transfer_report_copy_path_interface is not bound -!missing-pinvoke! nw_data_transfer_report_get_duration_milliseconds is not bound -!missing-pinvoke! nw_data_transfer_report_get_path_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_application_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_ip_packet_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_transport_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_transport_duplicate_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_transport_out_of_order_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_sent_application_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_sent_ip_packet_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_sent_transport_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_sent_transport_retransmitted_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_state is not bound -!missing-pinvoke! nw_data_transfer_report_get_transport_minimum_rtt_milliseconds is not bound -!missing-pinvoke! nw_data_transfer_report_get_transport_rtt_variance is not bound -!missing-pinvoke! nw_data_transfer_report_get_transport_smoothed_rtt_milliseconds is not bound -!missing-pinvoke! nw_endpoint_create_url is not bound -!missing-pinvoke! nw_endpoint_get_url is not bound -!missing-pinvoke! nw_establishment_report_copy_proxy_endpoint is not bound -!missing-pinvoke! nw_establishment_report_enumerate_protocols is not bound -!missing-pinvoke! nw_establishment_report_enumerate_resolutions is not bound -!missing-pinvoke! nw_establishment_report_get_attempt_started_after_milliseconds is not bound -!missing-pinvoke! nw_establishment_report_get_duration_milliseconds is not bound -!missing-pinvoke! nw_establishment_report_get_previous_attempt_count is not bound -!missing-pinvoke! nw_establishment_report_get_proxy_configured is not bound -!missing-pinvoke! nw_establishment_report_get_used_proxy is not bound !missing-pinvoke! nw_ethernet_channel_cancel is not bound !missing-pinvoke! nw_ethernet_channel_create is not bound !missing-pinvoke! nw_ethernet_channel_send is not bound @@ -55,17 +6,18 @@ !missing-pinvoke! nw_ethernet_channel_set_receive_handler is not bound !missing-pinvoke! nw_ethernet_channel_set_state_changed_handler is not bound !missing-pinvoke! nw_ethernet_channel_start is not bound +!missing-pinvoke! nw_framer_create_definition is not bound +!missing-pinvoke! nw_framer_message_access_value is not bound +!missing-pinvoke! nw_parameters_create_custom_ip is not bound !missing-pinvoke! nw_framer_async is not bound !missing-pinvoke! nw_framer_copy_local_endpoint is not bound !missing-pinvoke! nw_framer_copy_parameters is not bound !missing-pinvoke! nw_framer_copy_remote_endpoint is not bound -!missing-pinvoke! nw_framer_create_definition is not bound !missing-pinvoke! nw_framer_create_options is not bound !missing-pinvoke! nw_framer_deliver_input is not bound !missing-pinvoke! nw_framer_deliver_input_no_copy is not bound !missing-pinvoke! nw_framer_mark_failed_with_error is not bound !missing-pinvoke! nw_framer_mark_ready is not bound -!missing-pinvoke! nw_framer_message_access_value is not bound !missing-pinvoke! nw_framer_message_copy_object_value is not bound !missing-pinvoke! nw_framer_message_create is not bound !missing-pinvoke! nw_framer_message_set_object_value is not bound @@ -85,56 +37,3 @@ !missing-pinvoke! nw_framer_write_output is not bound !missing-pinvoke! nw_framer_write_output_data is not bound !missing-pinvoke! nw_framer_write_output_no_copy is not bound -!missing-pinvoke! nw_ip_options_set_local_address_preference is not bound -!missing-pinvoke! nw_listener_get_new_connection_limit is not bound -!missing-pinvoke! nw_listener_set_new_connection_limit is not bound -!missing-pinvoke! nw_parameters_create_custom_ip is not bound -!missing-pinvoke! nw_parameters_get_prohibit_constrained is not bound -!missing-pinvoke! nw_parameters_set_prohibit_constrained is not bound -!missing-pinvoke! nw_path_enumerate_gateways is not bound -!missing-pinvoke! nw_path_is_constrained is not bound -!missing-pinvoke! nw_protocol_copy_ws_definition is not bound -!missing-pinvoke! nw_protocol_metadata_is_framer_message is not bound -!missing-pinvoke! nw_protocol_metadata_is_ws is not bound -!missing-pinvoke! nw_txt_record_access_bytes is not bound -!missing-pinvoke! nw_txt_record_access_key is not bound -!missing-pinvoke! nw_txt_record_apply is not bound -!missing-pinvoke! nw_txt_record_copy is not bound -!missing-pinvoke! nw_txt_record_create_dictionary is not bound -!missing-pinvoke! nw_txt_record_create_with_bytes is not bound -!missing-pinvoke! nw_txt_record_find_key is not bound -!missing-pinvoke! nw_txt_record_get_key_count is not bound -!missing-pinvoke! nw_txt_record_is_dictionary is not bound -!missing-pinvoke! nw_txt_record_is_equal is not bound -!missing-pinvoke! nw_txt_record_remove_key is not bound -!missing-pinvoke! nw_txt_record_set_key is not bound -!missing-pinvoke! nw_ws_create_metadata is not bound -!missing-pinvoke! nw_ws_create_options is not bound -!missing-pinvoke! nw_ws_metadata_copy_server_response is not bound -!missing-pinvoke! nw_ws_metadata_get_close_code is not bound -!missing-pinvoke! nw_ws_metadata_get_opcode is not bound -!missing-pinvoke! nw_ws_metadata_set_close_code is not bound -!missing-pinvoke! nw_ws_metadata_set_pong_handler is not bound -!missing-pinvoke! nw_ws_options_add_additional_header is not bound -!missing-pinvoke! nw_ws_options_add_subprotocol is not bound -!missing-pinvoke! nw_ws_options_set_auto_reply_ping is not bound -!missing-pinvoke! nw_ws_options_set_client_request_handler is not bound -!missing-pinvoke! nw_ws_options_set_maximum_message_size is not bound -!missing-pinvoke! nw_ws_options_set_skip_handshake is not bound -!missing-pinvoke! nw_ws_request_enumerate_additional_headers is not bound -!missing-pinvoke! nw_ws_request_enumerate_subprotocols is not bound -!missing-pinvoke! nw_ws_response_add_additional_header is not bound -!missing-pinvoke! nw_ws_response_create is not bound -!missing-pinvoke! nw_ws_response_enumerate_additional_headers is not bound -!missing-pinvoke! nw_ws_response_get_selected_subprotocol is not bound -!missing-pinvoke! nw_ws_response_get_status is not bound -!missing-protocol! OS_nw_browse_descriptor not bound -!missing-protocol! OS_nw_browse_result not bound -!missing-protocol! OS_nw_browser not bound -!missing-protocol! OS_nw_data_transfer_report not bound -!missing-protocol! OS_nw_establishment_report not bound -!missing-protocol! OS_nw_ethernet_channel not bound -!missing-protocol! OS_nw_framer not bound -!missing-protocol! OS_nw_txt_record not bound -!missing-protocol! OS_nw_ws_request not bound -!missing-protocol! OS_nw_ws_response not bound diff --git a/tests/xtro-sharpie/tvOS-Network.todo b/tests/xtro-sharpie/tvOS-Network.todo index 63d56b32e3..ca5c91cc1f 100644 --- a/tests/xtro-sharpie/tvOS-Network.todo +++ b/tests/xtro-sharpie/tvOS-Network.todo @@ -1,64 +1,15 @@ !missing-field! _nw_data_transfer_report_all_paths not bound -!missing-pinvoke! nw_advertise_descriptor_copy_txt_record_object is not bound -!missing-pinvoke! nw_advertise_descriptor_set_txt_record_object is not bound -!missing-pinvoke! nw_browse_descriptor_create_bonjour_service is not bound -!missing-pinvoke! nw_browse_descriptor_get_bonjour_service_domain is not bound -!missing-pinvoke! nw_browse_descriptor_get_bonjour_service_type is not bound -!missing-pinvoke! nw_browse_descriptor_get_include_txt_record is not bound -!missing-pinvoke! nw_browse_descriptor_set_include_txt_record is not bound -!missing-pinvoke! nw_browse_result_copy_endpoint is not bound -!missing-pinvoke! nw_browse_result_copy_txt_record_object is not bound -!missing-pinvoke! nw_browse_result_enumerate_interfaces is not bound -!missing-pinvoke! nw_browse_result_get_changes is not bound -!missing-pinvoke! nw_browse_result_get_interfaces_count is not bound -!missing-pinvoke! nw_browser_cancel is not bound -!missing-pinvoke! nw_browser_copy_browse_descriptor is not bound -!missing-pinvoke! nw_browser_copy_parameters is not bound -!missing-pinvoke! nw_browser_create is not bound -!missing-pinvoke! nw_browser_set_browse_results_changed_handler is not bound -!missing-pinvoke! nw_browser_set_queue is not bound -!missing-pinvoke! nw_browser_set_state_changed_handler is not bound -!missing-pinvoke! nw_browser_start is not bound -!missing-pinvoke! nw_connection_access_establishment_report is not bound -!missing-pinvoke! nw_connection_create_new_data_transfer_report is not bound -!missing-pinvoke! nw_data_transfer_report_collect is not bound -!missing-pinvoke! nw_data_transfer_report_copy_path_interface is not bound -!missing-pinvoke! nw_data_transfer_report_get_duration_milliseconds is not bound -!missing-pinvoke! nw_data_transfer_report_get_path_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_application_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_ip_packet_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_transport_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_transport_duplicate_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_transport_out_of_order_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_sent_application_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_sent_ip_packet_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_sent_transport_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_sent_transport_retransmitted_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_state is not bound -!missing-pinvoke! nw_data_transfer_report_get_transport_minimum_rtt_milliseconds is not bound -!missing-pinvoke! nw_data_transfer_report_get_transport_rtt_variance is not bound -!missing-pinvoke! nw_data_transfer_report_get_transport_smoothed_rtt_milliseconds is not bound -!missing-pinvoke! nw_endpoint_create_url is not bound -!missing-pinvoke! nw_endpoint_get_url is not bound -!missing-pinvoke! nw_establishment_report_copy_proxy_endpoint is not bound -!missing-pinvoke! nw_establishment_report_enumerate_protocols is not bound -!missing-pinvoke! nw_establishment_report_enumerate_resolutions is not bound -!missing-pinvoke! nw_establishment_report_get_attempt_started_after_milliseconds is not bound -!missing-pinvoke! nw_establishment_report_get_duration_milliseconds is not bound -!missing-pinvoke! nw_establishment_report_get_previous_attempt_count is not bound -!missing-pinvoke! nw_establishment_report_get_proxy_configured is not bound -!missing-pinvoke! nw_establishment_report_get_used_proxy is not bound +!missing-pinvoke! nw_framer_create_definition is not bound +!missing-pinvoke! nw_framer_message_access_value is not bound !missing-pinvoke! nw_framer_async is not bound !missing-pinvoke! nw_framer_copy_local_endpoint is not bound !missing-pinvoke! nw_framer_copy_parameters is not bound !missing-pinvoke! nw_framer_copy_remote_endpoint is not bound -!missing-pinvoke! nw_framer_create_definition is not bound !missing-pinvoke! nw_framer_create_options is not bound !missing-pinvoke! nw_framer_deliver_input is not bound !missing-pinvoke! nw_framer_deliver_input_no_copy is not bound !missing-pinvoke! nw_framer_mark_failed_with_error is not bound !missing-pinvoke! nw_framer_mark_ready is not bound -!missing-pinvoke! nw_framer_message_access_value is not bound !missing-pinvoke! nw_framer_message_copy_object_value is not bound !missing-pinvoke! nw_framer_message_create is not bound !missing-pinvoke! nw_framer_message_set_object_value is not bound @@ -77,56 +28,4 @@ !missing-pinvoke! nw_framer_set_wakeup_handler is not bound !missing-pinvoke! nw_framer_write_output is not bound !missing-pinvoke! nw_framer_write_output_data is not bound -!missing-pinvoke! nw_framer_write_output_no_copy is not bound -!missing-pinvoke! nw_ip_options_set_local_address_preference is not bound -!missing-pinvoke! nw_listener_get_new_connection_limit is not bound -!missing-pinvoke! nw_listener_set_new_connection_limit is not bound -!missing-pinvoke! nw_parameters_get_prohibit_constrained is not bound -!missing-pinvoke! nw_parameters_set_prohibit_constrained is not bound -!missing-pinvoke! nw_path_enumerate_gateways is not bound -!missing-pinvoke! nw_path_is_constrained is not bound -!missing-pinvoke! nw_protocol_copy_ws_definition is not bound -!missing-pinvoke! nw_protocol_metadata_is_framer_message is not bound -!missing-pinvoke! nw_protocol_metadata_is_ws is not bound -!missing-pinvoke! nw_txt_record_access_bytes is not bound -!missing-pinvoke! nw_txt_record_access_key is not bound -!missing-pinvoke! nw_txt_record_apply is not bound -!missing-pinvoke! nw_txt_record_copy is not bound -!missing-pinvoke! nw_txt_record_create_dictionary is not bound -!missing-pinvoke! nw_txt_record_create_with_bytes is not bound -!missing-pinvoke! nw_txt_record_find_key is not bound -!missing-pinvoke! nw_txt_record_get_key_count is not bound -!missing-pinvoke! nw_txt_record_is_dictionary is not bound -!missing-pinvoke! nw_txt_record_is_equal is not bound -!missing-pinvoke! nw_txt_record_remove_key is not bound -!missing-pinvoke! nw_txt_record_set_key is not bound -!missing-pinvoke! nw_ws_create_metadata is not bound -!missing-pinvoke! nw_ws_create_options is not bound -!missing-pinvoke! nw_ws_metadata_copy_server_response is not bound -!missing-pinvoke! nw_ws_metadata_get_close_code is not bound -!missing-pinvoke! nw_ws_metadata_get_opcode is not bound -!missing-pinvoke! nw_ws_metadata_set_close_code is not bound -!missing-pinvoke! nw_ws_metadata_set_pong_handler is not bound -!missing-pinvoke! nw_ws_options_add_additional_header is not bound -!missing-pinvoke! nw_ws_options_add_subprotocol is not bound -!missing-pinvoke! nw_ws_options_set_auto_reply_ping is not bound -!missing-pinvoke! nw_ws_options_set_client_request_handler is not bound -!missing-pinvoke! nw_ws_options_set_maximum_message_size is not bound -!missing-pinvoke! nw_ws_options_set_skip_handshake is not bound -!missing-pinvoke! nw_ws_request_enumerate_additional_headers is not bound -!missing-pinvoke! nw_ws_request_enumerate_subprotocols is not bound -!missing-pinvoke! nw_ws_response_add_additional_header is not bound -!missing-pinvoke! nw_ws_response_create is not bound -!missing-pinvoke! nw_ws_response_enumerate_additional_headers is not bound -!missing-pinvoke! nw_ws_response_get_selected_subprotocol is not bound -!missing-pinvoke! nw_ws_response_get_status is not bound -!missing-protocol! OS_nw_browse_descriptor not bound -!missing-protocol! OS_nw_browse_result not bound -!missing-protocol! OS_nw_browser not bound -!missing-protocol! OS_nw_data_transfer_report not bound -!missing-protocol! OS_nw_establishment_report not bound -!missing-protocol! OS_nw_ethernet_channel not bound -!missing-protocol! OS_nw_framer not bound -!missing-protocol! OS_nw_txt_record not bound -!missing-protocol! OS_nw_ws_request not bound -!missing-protocol! OS_nw_ws_response not bound +!missing-pinvoke! nw_framer_write_output_no_copy is not bound \ No newline at end of file diff --git a/tests/xtro-sharpie/watchOS-Network.todo b/tests/xtro-sharpie/watchOS-Network.todo index 63d56b32e3..87ad149f6f 100644 --- a/tests/xtro-sharpie/watchOS-Network.todo +++ b/tests/xtro-sharpie/watchOS-Network.todo @@ -1,64 +1,15 @@ !missing-field! _nw_data_transfer_report_all_paths not bound -!missing-pinvoke! nw_advertise_descriptor_copy_txt_record_object is not bound -!missing-pinvoke! nw_advertise_descriptor_set_txt_record_object is not bound -!missing-pinvoke! nw_browse_descriptor_create_bonjour_service is not bound -!missing-pinvoke! nw_browse_descriptor_get_bonjour_service_domain is not bound -!missing-pinvoke! nw_browse_descriptor_get_bonjour_service_type is not bound -!missing-pinvoke! nw_browse_descriptor_get_include_txt_record is not bound -!missing-pinvoke! nw_browse_descriptor_set_include_txt_record is not bound -!missing-pinvoke! nw_browse_result_copy_endpoint is not bound -!missing-pinvoke! nw_browse_result_copy_txt_record_object is not bound -!missing-pinvoke! nw_browse_result_enumerate_interfaces is not bound -!missing-pinvoke! nw_browse_result_get_changes is not bound -!missing-pinvoke! nw_browse_result_get_interfaces_count is not bound -!missing-pinvoke! nw_browser_cancel is not bound -!missing-pinvoke! nw_browser_copy_browse_descriptor is not bound -!missing-pinvoke! nw_browser_copy_parameters is not bound -!missing-pinvoke! nw_browser_create is not bound -!missing-pinvoke! nw_browser_set_browse_results_changed_handler is not bound -!missing-pinvoke! nw_browser_set_queue is not bound -!missing-pinvoke! nw_browser_set_state_changed_handler is not bound -!missing-pinvoke! nw_browser_start is not bound -!missing-pinvoke! nw_connection_access_establishment_report is not bound -!missing-pinvoke! nw_connection_create_new_data_transfer_report is not bound -!missing-pinvoke! nw_data_transfer_report_collect is not bound -!missing-pinvoke! nw_data_transfer_report_copy_path_interface is not bound -!missing-pinvoke! nw_data_transfer_report_get_duration_milliseconds is not bound -!missing-pinvoke! nw_data_transfer_report_get_path_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_application_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_ip_packet_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_transport_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_transport_duplicate_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_received_transport_out_of_order_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_sent_application_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_sent_ip_packet_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_sent_transport_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_sent_transport_retransmitted_byte_count is not bound -!missing-pinvoke! nw_data_transfer_report_get_state is not bound -!missing-pinvoke! nw_data_transfer_report_get_transport_minimum_rtt_milliseconds is not bound -!missing-pinvoke! nw_data_transfer_report_get_transport_rtt_variance is not bound -!missing-pinvoke! nw_data_transfer_report_get_transport_smoothed_rtt_milliseconds is not bound -!missing-pinvoke! nw_endpoint_create_url is not bound -!missing-pinvoke! nw_endpoint_get_url is not bound -!missing-pinvoke! nw_establishment_report_copy_proxy_endpoint is not bound -!missing-pinvoke! nw_establishment_report_enumerate_protocols is not bound -!missing-pinvoke! nw_establishment_report_enumerate_resolutions is not bound -!missing-pinvoke! nw_establishment_report_get_attempt_started_after_milliseconds is not bound -!missing-pinvoke! nw_establishment_report_get_duration_milliseconds is not bound -!missing-pinvoke! nw_establishment_report_get_previous_attempt_count is not bound -!missing-pinvoke! nw_establishment_report_get_proxy_configured is not bound -!missing-pinvoke! nw_establishment_report_get_used_proxy is not bound +!missing-pinvoke! nw_framer_create_definition is not bound +!missing-pinvoke! nw_framer_message_access_value is not bound !missing-pinvoke! nw_framer_async is not bound !missing-pinvoke! nw_framer_copy_local_endpoint is not bound !missing-pinvoke! nw_framer_copy_parameters is not bound !missing-pinvoke! nw_framer_copy_remote_endpoint is not bound -!missing-pinvoke! nw_framer_create_definition is not bound !missing-pinvoke! nw_framer_create_options is not bound !missing-pinvoke! nw_framer_deliver_input is not bound !missing-pinvoke! nw_framer_deliver_input_no_copy is not bound !missing-pinvoke! nw_framer_mark_failed_with_error is not bound !missing-pinvoke! nw_framer_mark_ready is not bound -!missing-pinvoke! nw_framer_message_access_value is not bound !missing-pinvoke! nw_framer_message_copy_object_value is not bound !missing-pinvoke! nw_framer_message_create is not bound !missing-pinvoke! nw_framer_message_set_object_value is not bound @@ -78,55 +29,3 @@ !missing-pinvoke! nw_framer_write_output is not bound !missing-pinvoke! nw_framer_write_output_data is not bound !missing-pinvoke! nw_framer_write_output_no_copy is not bound -!missing-pinvoke! nw_ip_options_set_local_address_preference is not bound -!missing-pinvoke! nw_listener_get_new_connection_limit is not bound -!missing-pinvoke! nw_listener_set_new_connection_limit is not bound -!missing-pinvoke! nw_parameters_get_prohibit_constrained is not bound -!missing-pinvoke! nw_parameters_set_prohibit_constrained is not bound -!missing-pinvoke! nw_path_enumerate_gateways is not bound -!missing-pinvoke! nw_path_is_constrained is not bound -!missing-pinvoke! nw_protocol_copy_ws_definition is not bound -!missing-pinvoke! nw_protocol_metadata_is_framer_message is not bound -!missing-pinvoke! nw_protocol_metadata_is_ws is not bound -!missing-pinvoke! nw_txt_record_access_bytes is not bound -!missing-pinvoke! nw_txt_record_access_key is not bound -!missing-pinvoke! nw_txt_record_apply is not bound -!missing-pinvoke! nw_txt_record_copy is not bound -!missing-pinvoke! nw_txt_record_create_dictionary is not bound -!missing-pinvoke! nw_txt_record_create_with_bytes is not bound -!missing-pinvoke! nw_txt_record_find_key is not bound -!missing-pinvoke! nw_txt_record_get_key_count is not bound -!missing-pinvoke! nw_txt_record_is_dictionary is not bound -!missing-pinvoke! nw_txt_record_is_equal is not bound -!missing-pinvoke! nw_txt_record_remove_key is not bound -!missing-pinvoke! nw_txt_record_set_key is not bound -!missing-pinvoke! nw_ws_create_metadata is not bound -!missing-pinvoke! nw_ws_create_options is not bound -!missing-pinvoke! nw_ws_metadata_copy_server_response is not bound -!missing-pinvoke! nw_ws_metadata_get_close_code is not bound -!missing-pinvoke! nw_ws_metadata_get_opcode is not bound -!missing-pinvoke! nw_ws_metadata_set_close_code is not bound -!missing-pinvoke! nw_ws_metadata_set_pong_handler is not bound -!missing-pinvoke! nw_ws_options_add_additional_header is not bound -!missing-pinvoke! nw_ws_options_add_subprotocol is not bound -!missing-pinvoke! nw_ws_options_set_auto_reply_ping is not bound -!missing-pinvoke! nw_ws_options_set_client_request_handler is not bound -!missing-pinvoke! nw_ws_options_set_maximum_message_size is not bound -!missing-pinvoke! nw_ws_options_set_skip_handshake is not bound -!missing-pinvoke! nw_ws_request_enumerate_additional_headers is not bound -!missing-pinvoke! nw_ws_request_enumerate_subprotocols is not bound -!missing-pinvoke! nw_ws_response_add_additional_header is not bound -!missing-pinvoke! nw_ws_response_create is not bound -!missing-pinvoke! nw_ws_response_enumerate_additional_headers is not bound -!missing-pinvoke! nw_ws_response_get_selected_subprotocol is not bound -!missing-pinvoke! nw_ws_response_get_status is not bound -!missing-protocol! OS_nw_browse_descriptor not bound -!missing-protocol! OS_nw_browse_result not bound -!missing-protocol! OS_nw_browser not bound -!missing-protocol! OS_nw_data_transfer_report not bound -!missing-protocol! OS_nw_establishment_report not bound -!missing-protocol! OS_nw_ethernet_channel not bound -!missing-protocol! OS_nw_framer not bound -!missing-protocol! OS_nw_txt_record not bound -!missing-protocol! OS_nw_ws_request not bound -!missing-protocol! OS_nw_ws_response not bound From 07e9dd0b06cf08c8b39528292e3c919d84874556 Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Tue, 8 Oct 2019 23:57:41 -0400 Subject: [PATCH 002/100] Bump for Xcode 11.2 beta 1 (#7195) --- Make.config | 14 +++++++------- Make.versions | 4 ++-- Versions-ios.plist.in | 3 +++ tests/xtro-sharpie/iOS-HomeKit.todo | 2 ++ tests/xtro-sharpie/iOS-ImageCaptureCore.todo | 3 --- tests/xtro-sharpie/iOS-ImageIO.todo | 6 ++++++ tests/xtro-sharpie/iOS-Intents.todo | 3 +++ tests/xtro-sharpie/iOS-NetworkExtension.todo | 1 + tests/xtro-sharpie/iOS-StoreKit.todo | 4 ++++ tests/xtro-sharpie/iOS-UIKit.ignore | 5 ----- tests/xtro-sharpie/tvOS-HomeKit.todo | 2 ++ tests/xtro-sharpie/tvOS-ImageIO.todo | 6 ++++++ tests/xtro-sharpie/tvOS-StoreKit.todo | 4 ++++ tests/xtro-sharpie/watchOS-Foundation.todo | 3 +++ tests/xtro-sharpie/watchOS-HomeKit.todo | 2 ++ tests/xtro-sharpie/watchOS-ImageIO.todo | 6 ++++++ tests/xtro-sharpie/watchOS-Intents.todo | 3 +++ tests/xtro-sharpie/watchOS-WatchKit.todo | 10 ++++++++++ 18 files changed, 64 insertions(+), 17 deletions(-) create mode 100644 tests/xtro-sharpie/iOS-HomeKit.todo create mode 100644 tests/xtro-sharpie/iOS-ImageIO.todo create mode 100644 tests/xtro-sharpie/iOS-NetworkExtension.todo create mode 100644 tests/xtro-sharpie/iOS-StoreKit.todo create mode 100644 tests/xtro-sharpie/tvOS-HomeKit.todo create mode 100644 tests/xtro-sharpie/tvOS-ImageIO.todo create mode 100644 tests/xtro-sharpie/tvOS-StoreKit.todo create mode 100644 tests/xtro-sharpie/watchOS-HomeKit.todo create mode 100644 tests/xtro-sharpie/watchOS-ImageIO.todo create mode 100644 tests/xtro-sharpie/watchOS-WatchKit.todo diff --git a/Make.config b/Make.config index 77ae47296f..2d5e8d44a5 100644 --- a/Make.config +++ b/Make.config @@ -31,7 +31,7 @@ $(TOP)/Make.config.inc: $(TOP)/Make.config include $(TOP)/Make.versions -APIDIFF_REFERENCES=https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/d16-3/d532e90de664caf46baea6226d742b9f68b3173a/44/package/bundle.zip +APIDIFF_REFERENCES=https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/xcode11.1/e37549bc9052bff81d5c7da8a3b7992b47a08154/29/package/bundle.zip PACKAGE_HEAD_REV=$(shell git rev-parse HEAD) @@ -59,9 +59,9 @@ IOS_PACKAGE_VERSION_BUILD=$(IOS_COMMIT_DISTANCE) IOS_PACKAGE_UPDATE_ID=$(shell printf "2%02d%02d%02d%03d" $(IOS_PACKAGE_VERSION_MAJOR) $(IOS_PACKAGE_VERSION_MINOR) $(IOS_PACKAGE_VERSION_REV) $(IOS_PACKAGE_VERSION_BUILD)) # Xcode version should have both a major and a minor version (even if the minor version is 0) -XCODE_VERSION=11.1 -XCODE_URL=http://xamarin-storage/bot-provisioning/xcodes/Xcode_11.1.xip -XCODE_DEVELOPER_ROOT=/Applications/Xcode111.app/Contents/Developer +XCODE_VERSION=11.2 +XCODE_URL=http://xamarin-storage/bot-provisioning/xcodes/Xcode_11.2_beta.xip +XCODE_DEVELOPER_ROOT=/Applications/Xcode112-beta1.app/Contents/Developer # Mono version embedded in XI/XM (NEEDED_MONO_VERSION/BRANCH) are specified in mk/mono.mk include $(TOP)/mk/mono.mk @@ -96,11 +96,11 @@ MIN_OSX_BUILD_VERSION=10.14 MIN_OSX_VERSION_FOR_IOS=10.11 MIN_OSX_VERSION_FOR_MAC=10.11 -IOS_SDK_VERSION=13.1 +IOS_SDK_VERSION=13.2 # When bumping OSX_SDK_VERSION also update the macOS version where we execute on bots in jenkins/Jenkinsfile (in the 'node' element) OSX_SDK_VERSION=10.15 -WATCH_SDK_VERSION=6.0 -TVOS_SDK_VERSION=13.0 +WATCH_SDK_VERSION=6.1 +TVOS_SDK_VERSION=13.2 # If the max OS version does not match the SDK version (for instance the iOS # 12.2 SDK supported both iOS 12.3 and iOS 12.4), then these variables can be diff --git a/Make.versions b/Make.versions index 396c3c02e5..69fe268b04 100644 --- a/Make.versions +++ b/Make.versions @@ -43,5 +43,5 @@ # line changed in git). # -IOS_PACKAGE_VERSION=13.4.0.$(IOS_COMMIT_DISTANCE) -MAC_PACKAGE_VERSION=6.4.0.$(MAC_COMMIT_DISTANCE) +IOS_PACKAGE_VERSION=13.5.0.$(IOS_COMMIT_DISTANCE) +MAC_PACKAGE_VERSION=6.5.0.$(MAC_COMMIT_DISTANCE) diff --git a/Versions-ios.plist.in b/Versions-ios.plist.in index ef52126330..b0f084d071 100644 --- a/Versions-ios.plist.in +++ b/Versions-ios.plist.in @@ -35,6 +35,7 @@ 12.4 13.0 13.1 + 13.2 tvOS @@ -55,6 +56,7 @@ 12.3 12.4 13.0 + 13.2 watchOS @@ -74,6 +76,7 @@ 5.2 5.3 6.0 + 6.1 RecommendedXcodeVersion diff --git a/tests/xtro-sharpie/iOS-HomeKit.todo b/tests/xtro-sharpie/iOS-HomeKit.todo new file mode 100644 index 0000000000..20a46fd1a3 --- /dev/null +++ b/tests/xtro-sharpie/iOS-HomeKit.todo @@ -0,0 +1,2 @@ +!missing-protocol-member! HMHomeDelegate::homeDidUpdateSupportedFeatures: not found +!missing-selector! HMHome::supportsAddingNetworkRouter not bound diff --git a/tests/xtro-sharpie/iOS-ImageCaptureCore.todo b/tests/xtro-sharpie/iOS-ImageCaptureCore.todo index eb44799b87..fe4212d31f 100644 --- a/tests/xtro-sharpie/iOS-ImageCaptureCore.todo +++ b/tests/xtro-sharpie/iOS-ImageCaptureCore.todo @@ -51,11 +51,9 @@ !missing-selector! ICCameraDevice::isEjectable not bound !missing-selector! ICCameraDevice::isLocked not bound !missing-selector! ICCameraDevice::mediaFiles not bound -!missing-selector! ICCameraDevice::mountPoint not bound !missing-selector! ICCameraDevice::requestDeleteFiles: not bound !missing-selector! ICCameraDevice::requestDeleteFiles:deleteFailed:completion: not bound !missing-selector! ICCameraDevice::requestDownloadFile:options:downloadDelegate:didDownloadSelector:contextInfo: not bound -!missing-selector! ICCameraDevice::requestSyncClock not bound !missing-selector! ICCameraDevice::tetheredCaptureEnabled not bound !missing-selector! ICCameraDevice::timeOffset not bound !missing-selector! ICCameraFile::burstFavorite not bound @@ -88,7 +86,6 @@ !missing-selector! ICCameraFolder::contents not bound !missing-selector! ICCameraItem::creationDate not bound !missing-selector! ICCameraItem::device not bound -!missing-selector! ICCameraItem::fileSystemPath not bound !missing-selector! ICCameraItem::flushMetadataCache not bound !missing-selector! ICCameraItem::flushThumbnailCache not bound !missing-selector! ICCameraItem::isInTemporaryStore not bound diff --git a/tests/xtro-sharpie/iOS-ImageIO.todo b/tests/xtro-sharpie/iOS-ImageIO.todo new file mode 100644 index 0000000000..60513c8046 --- /dev/null +++ b/tests/xtro-sharpie/iOS-ImageIO.todo @@ -0,0 +1,6 @@ +!missing-enum! CGImageAnimationStatus not bound +!missing-field! kCGImageAnimationDelayTime not bound +!missing-field! kCGImageAnimationLoopCount not bound +!missing-field! kCGImageAnimationStartIndex not bound +!missing-pinvoke! CGAnimateImageAtURLWithBlock is not bound +!missing-pinvoke! CGAnimateImageDataWithBlock is not bound diff --git a/tests/xtro-sharpie/iOS-Intents.todo b/tests/xtro-sharpie/iOS-Intents.todo index c3eae4bf85..5539ab4a72 100644 --- a/tests/xtro-sharpie/iOS-Intents.todo +++ b/tests/xtro-sharpie/iOS-Intents.todo @@ -394,3 +394,6 @@ !missing-type! INUserContext not bound !missing-type! INVolumeResolutionResult not bound !missing-selector! INMediaSearch::initWithMediaType:sortOrder:mediaName:artistName:albumName:genreNames:moodNames:releaseDate:reference:mediaIdentifier: not bound +## appended from unclassified file +!missing-selector! INMessage::initWithIdentifier:conversationIdentifier:content:dateSent:sender:recipients:groupName:messageType:serviceName: not bound +!missing-selector! INMessage::serviceName not bound diff --git a/tests/xtro-sharpie/iOS-NetworkExtension.todo b/tests/xtro-sharpie/iOS-NetworkExtension.todo new file mode 100644 index 0000000000..77f85773e8 --- /dev/null +++ b/tests/xtro-sharpie/iOS-NetworkExtension.todo @@ -0,0 +1 @@ +!missing-selector! NEFilterFlow::identifier not bound diff --git a/tests/xtro-sharpie/iOS-StoreKit.todo b/tests/xtro-sharpie/iOS-StoreKit.todo new file mode 100644 index 0000000000..6f2e76a102 --- /dev/null +++ b/tests/xtro-sharpie/iOS-StoreKit.todo @@ -0,0 +1,4 @@ +!missing-selector! +SKArcadeService::arcadeSubscriptionStatusWithNonce:resultHandler: not bound +!missing-selector! +SKArcadeService::registerArcadeAppWithRandomFromLib:randomFromLibLength:resultHandler: not bound +!missing-selector! +SKArcadeService::repairArcadeApp not bound +!missing-type! SKArcadeService not bound diff --git a/tests/xtro-sharpie/iOS-UIKit.ignore b/tests/xtro-sharpie/iOS-UIKit.ignore index 448117de8f..617d6915d5 100644 --- a/tests/xtro-sharpie/iOS-UIKit.ignore +++ b/tests/xtro-sharpie/iOS-UIKit.ignore @@ -76,11 +76,6 @@ !missing-enum! UIDirectionalRectEdge not bound !missing-selector! UIGestureRecognizer::initWithCoder: not bound !missing-selector! UIKeyCommand::action not bound -!missing-protocol-member! UICollectionViewDelegate::collectionView:willCommitMenuWithAnimator: not found -!missing-protocol-member! UIContextMenuInteractionDelegate::contextMenuInteraction:willCommitWithAnimator: not found -!missing-protocol-member! UIContextMenuInteractionDelegate::contextMenuInteractionDidEnd: not found -!missing-protocol-member! UIContextMenuInteractionDelegate::contextMenuInteractionWillPresent: not found -!missing-protocol-member! UITableViewDelegate::tableView:willCommitMenuWithAnimator: not found ## Introduced in Xcode 11 b5 but unlikely to be there at the end of beta, these usualy get replaced by NSCopying protocol !missing-selector! UIBarAppearance::copy not bound diff --git a/tests/xtro-sharpie/tvOS-HomeKit.todo b/tests/xtro-sharpie/tvOS-HomeKit.todo new file mode 100644 index 0000000000..20a46fd1a3 --- /dev/null +++ b/tests/xtro-sharpie/tvOS-HomeKit.todo @@ -0,0 +1,2 @@ +!missing-protocol-member! HMHomeDelegate::homeDidUpdateSupportedFeatures: not found +!missing-selector! HMHome::supportsAddingNetworkRouter not bound diff --git a/tests/xtro-sharpie/tvOS-ImageIO.todo b/tests/xtro-sharpie/tvOS-ImageIO.todo new file mode 100644 index 0000000000..60513c8046 --- /dev/null +++ b/tests/xtro-sharpie/tvOS-ImageIO.todo @@ -0,0 +1,6 @@ +!missing-enum! CGImageAnimationStatus not bound +!missing-field! kCGImageAnimationDelayTime not bound +!missing-field! kCGImageAnimationLoopCount not bound +!missing-field! kCGImageAnimationStartIndex not bound +!missing-pinvoke! CGAnimateImageAtURLWithBlock is not bound +!missing-pinvoke! CGAnimateImageDataWithBlock is not bound diff --git a/tests/xtro-sharpie/tvOS-StoreKit.todo b/tests/xtro-sharpie/tvOS-StoreKit.todo new file mode 100644 index 0000000000..6f2e76a102 --- /dev/null +++ b/tests/xtro-sharpie/tvOS-StoreKit.todo @@ -0,0 +1,4 @@ +!missing-selector! +SKArcadeService::arcadeSubscriptionStatusWithNonce:resultHandler: not bound +!missing-selector! +SKArcadeService::registerArcadeAppWithRandomFromLib:randomFromLibLength:resultHandler: not bound +!missing-selector! +SKArcadeService::repairArcadeApp not bound +!missing-type! SKArcadeService not bound diff --git a/tests/xtro-sharpie/watchOS-Foundation.todo b/tests/xtro-sharpie/watchOS-Foundation.todo index 3348f73b0b..67be84aec0 100644 --- a/tests/xtro-sharpie/watchOS-Foundation.todo +++ b/tests/xtro-sharpie/watchOS-Foundation.todo @@ -28,3 +28,6 @@ !missing-selector! NSOrderedSet::orderedSetByApplyingDifference: not bound !missing-type! NSOrderedCollectionChange not bound !missing-type! NSOrderedCollectionDifference not bound +## appended from unclassified file +!missing-selector! NSUserActivity::setTargetContentIdentifier: not bound +!missing-selector! NSUserActivity::targetContentIdentifier not bound diff --git a/tests/xtro-sharpie/watchOS-HomeKit.todo b/tests/xtro-sharpie/watchOS-HomeKit.todo new file mode 100644 index 0000000000..20a46fd1a3 --- /dev/null +++ b/tests/xtro-sharpie/watchOS-HomeKit.todo @@ -0,0 +1,2 @@ +!missing-protocol-member! HMHomeDelegate::homeDidUpdateSupportedFeatures: not found +!missing-selector! HMHome::supportsAddingNetworkRouter not bound diff --git a/tests/xtro-sharpie/watchOS-ImageIO.todo b/tests/xtro-sharpie/watchOS-ImageIO.todo new file mode 100644 index 0000000000..60513c8046 --- /dev/null +++ b/tests/xtro-sharpie/watchOS-ImageIO.todo @@ -0,0 +1,6 @@ +!missing-enum! CGImageAnimationStatus not bound +!missing-field! kCGImageAnimationDelayTime not bound +!missing-field! kCGImageAnimationLoopCount not bound +!missing-field! kCGImageAnimationStartIndex not bound +!missing-pinvoke! CGAnimateImageAtURLWithBlock is not bound +!missing-pinvoke! CGAnimateImageDataWithBlock is not bound diff --git a/tests/xtro-sharpie/watchOS-Intents.todo b/tests/xtro-sharpie/watchOS-Intents.todo index 8eed2bec98..db17800e23 100644 --- a/tests/xtro-sharpie/watchOS-Intents.todo +++ b/tests/xtro-sharpie/watchOS-Intents.todo @@ -401,3 +401,6 @@ !missing-type! INVolumeResolutionResult not bound !unknown-type! INParameter bound !missing-selector! INMediaSearch::initWithMediaType:sortOrder:mediaName:artistName:albumName:genreNames:moodNames:releaseDate:reference:mediaIdentifier: not bound +## appended from unclassified file +!missing-selector! INMessage::initWithIdentifier:conversationIdentifier:content:dateSent:sender:recipients:groupName:messageType:serviceName: not bound +!missing-selector! INMessage::serviceName not bound diff --git a/tests/xtro-sharpie/watchOS-WatchKit.todo b/tests/xtro-sharpie/watchOS-WatchKit.todo new file mode 100644 index 0000000000..15c96112bc --- /dev/null +++ b/tests/xtro-sharpie/watchOS-WatchKit.todo @@ -0,0 +1,10 @@ +!deprecated-attribute-missing! WKExtension::enableWaterLock missing a [Deprecated] attribute +!deprecated-attribute-missing! WKInterfaceAuthorizationAppleIDButton::initWithTarget:action: missing a [Deprecated] attribute +!missing-enum! WKInterfaceAuthorizationAppleIDButtonStyle not bound +!missing-enum! WKInterfaceMapUserTrackingMode not bound +!missing-selector! WKInterfaceAuthorizationAppleIDButton::initWithStyle:target:action: not bound +!missing-selector! WKInterfaceDevice::enableWaterLock not bound +!missing-selector! WKInterfaceDevice::isWaterLockEnabled not bound +!missing-selector! WKInterfaceMap::setShowsUserHeading: not bound +!missing-selector! WKInterfaceMap::setShowsUserLocation: not bound +!missing-selector! WKInterfaceMap::setUserTrackingMode:animated: not bound From b3d566db3b54fc352302921240fb0c35f038ab78 Mon Sep 17 00:00:00 2001 From: Waleed Chaudhry <54864665+wachaudh@users.noreply.github.com> Date: Fri, 11 Oct 2019 11:00:31 -0400 Subject: [PATCH 003/100] [WatchKit] Add WatchKit bindings for Xcode 11.2 (#7202) * [WatchKit] Add WatchKit bindings for Xcode 11.2 --- src/watchkit.cs | 41 +++++++++++++++++++++++- tests/xtro-sharpie/watchOS-WatchKit.todo | 10 ------ 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/src/watchkit.cs b/src/watchkit.cs index 3f9c8ffe9d..b9845cd2d7 100644 --- a/src/watchkit.cs +++ b/src/watchkit.cs @@ -515,6 +515,14 @@ namespace WatchKit { [Watch (6,0)][NoiOS] [Export ("supportsAudioStreaming")] bool SupportsAudioStreaming { get; } + + [Watch (6,1)][NoiOS] + [Export ("enableWaterLock")] + void EnableWaterLock (); + + [Watch (6,1)][NoiOS] + [Export ("isWaterLockEnabled")] + bool IsWaterLockEnabled { get; } } [iOS (8,2)] @@ -704,6 +712,18 @@ namespace WatchKit { [Export ("removeAllAnnotations")] void RemoveAllAnnotations (); + + [Watch (6,1)] + [Export ("setShowsUserHeading:")] + void SetShowsUserHeading (bool showsUserHeading); + + [Watch (6,1)] + [Export ("setShowsUserLocation:")] + void SetShowsUserLocation (bool showsUserLocation); + + [Watch (6,1)] + [Export ("setUserTrackingMode:animated:")] + void SetUserTrackingMode (WKInterfaceMapUserTrackingMode mode, bool animated); } [iOS (8,2)] @@ -983,6 +1003,7 @@ namespace WatchKit { [Watch (4,0)] [Export ("enableWaterLock")] + [Deprecated (PlatformName.WatchOS, 6,1, message: "Use WKInterfaceDevice.EnableWaterLock ()")] void EnableWaterLock (); [Watch (6,0)] @@ -1576,6 +1597,20 @@ namespace WatchKit { Companion, } + [Watch (6,1), NoiOS] + [Native] + enum WKInterfaceAuthorizationAppleIdButtonStyle: long { + Default, + White, + } + + [Watch (6,1), NoiOS] + [Native] + enum WKInterfaceMapUserTrackingMode: long { + None, + Follow, + } + interface IWKExtendedRuntimeSessionDelegate {} [Watch (6,0), NoiOS] @@ -1637,9 +1672,13 @@ namespace WatchKit { [BaseType (typeof (WKInterfaceObject), Name = "WKInterfaceAuthorizationAppleIDButton")] [DisableDefaultCtor] // Handle is `nil` interface WKInterfaceAuthorizationAppleIdButton { - [Export ("initWithTarget:action:")] + [Deprecated (PlatformName.WatchOS, 6,1, message: "Use 'new WKInterfaceAuthorizationAppleIdButton (WKInterfaceVolumeControlOrigin,NSObject,Selector)' instead.")] IntPtr Constructor ([NullAllowed] NSObject target, Selector action); + + [Watch (6,1)] + [Export ("initWithStyle:target:action:")] + IntPtr Constructor (WKInterfaceAuthorizationAppleIdButtonStyle style, [NullAllowed] NSObject target, Selector action); } [Watch (6,0), NoiOS] diff --git a/tests/xtro-sharpie/watchOS-WatchKit.todo b/tests/xtro-sharpie/watchOS-WatchKit.todo index 15c96112bc..e69de29bb2 100644 --- a/tests/xtro-sharpie/watchOS-WatchKit.todo +++ b/tests/xtro-sharpie/watchOS-WatchKit.todo @@ -1,10 +0,0 @@ -!deprecated-attribute-missing! WKExtension::enableWaterLock missing a [Deprecated] attribute -!deprecated-attribute-missing! WKInterfaceAuthorizationAppleIDButton::initWithTarget:action: missing a [Deprecated] attribute -!missing-enum! WKInterfaceAuthorizationAppleIDButtonStyle not bound -!missing-enum! WKInterfaceMapUserTrackingMode not bound -!missing-selector! WKInterfaceAuthorizationAppleIDButton::initWithStyle:target:action: not bound -!missing-selector! WKInterfaceDevice::enableWaterLock not bound -!missing-selector! WKInterfaceDevice::isWaterLockEnabled not bound -!missing-selector! WKInterfaceMap::setShowsUserHeading: not bound -!missing-selector! WKInterfaceMap::setShowsUserLocation: not bound -!missing-selector! WKInterfaceMap::setUserTrackingMode:animated: not bound From 5c102d920f46ab0723ea7448bc5a41bf33a2bd07 Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Tue, 15 Oct 2019 11:18:29 -0400 Subject: [PATCH 004/100] Bump for Xcode 11.2 beta 2 (#7223) --- Make.config | 4 ++-- tests/common/TestRuntime.cs | 18 +++++++++++++++--- tests/introspection/iOS/iOSApiCtorInitTest.cs | 2 ++ tests/xtro-sharpie/iOS-CoreMedia.todo | 1 + tests/xtro-sharpie/iOS-ImageIO.todo | 4 ++++ tests/xtro-sharpie/iOS-MapKit.todo | 2 ++ tests/xtro-sharpie/iOS-UIKit.todo | 5 +++++ tests/xtro-sharpie/macOS-CoreMedia.todo | 1 + tests/xtro-sharpie/macOS-CoreTelephony.ignore | 2 -- tests/xtro-sharpie/macOS-ImageIO.todo | 9 +++++++++ tests/xtro-sharpie/macOS-NetworkExtension.todo | 1 + tests/xtro-sharpie/macOS-Photos.todo | 1 + tests/xtro-sharpie/macOS-Security.ignore | 6 ------ tests/xtro-sharpie/tvOS-CoreMedia.todo | 1 + tests/xtro-sharpie/tvOS-ImageIO.todo | 4 ++++ tests/xtro-sharpie/tvOS-UIKit.todo | 5 +++++ tests/xtro-sharpie/watchOS-CoreMedia.todo | 1 + tests/xtro-sharpie/watchOS-ImageIO.todo | 4 ++++ 18 files changed, 58 insertions(+), 13 deletions(-) create mode 100644 tests/xtro-sharpie/iOS-CoreMedia.todo create mode 100644 tests/xtro-sharpie/iOS-MapKit.todo create mode 100644 tests/xtro-sharpie/macOS-CoreMedia.todo delete mode 100644 tests/xtro-sharpie/macOS-CoreTelephony.ignore create mode 100644 tests/xtro-sharpie/macOS-ImageIO.todo create mode 100644 tests/xtro-sharpie/macOS-NetworkExtension.todo create mode 100644 tests/xtro-sharpie/macOS-Photos.todo create mode 100644 tests/xtro-sharpie/tvOS-CoreMedia.todo create mode 100644 tests/xtro-sharpie/watchOS-CoreMedia.todo diff --git a/Make.config b/Make.config index 2d5e8d44a5..ab773049ec 100644 --- a/Make.config +++ b/Make.config @@ -60,8 +60,8 @@ IOS_PACKAGE_UPDATE_ID=$(shell printf "2%02d%02d%02d%03d" $(IOS_PACKAGE_VERSION_M # Xcode version should have both a major and a minor version (even if the minor version is 0) XCODE_VERSION=11.2 -XCODE_URL=http://xamarin-storage/bot-provisioning/xcodes/Xcode_11.2_beta.xip -XCODE_DEVELOPER_ROOT=/Applications/Xcode112-beta1.app/Contents/Developer +XCODE_URL=http://xamarin-storage/bot-provisioning/xcodes/Xcode_11.2_beta_2.xip +XCODE_DEVELOPER_ROOT=/Applications/Xcode112-beta2.app/Contents/Developer # Mono version embedded in XI/XM (NEEDED_MONO_VERSION/BRANCH) are specified in mk/mono.mk include $(TOP)/mk/mono.mk diff --git a/tests/common/TestRuntime.cs b/tests/common/TestRuntime.cs index 691fe1ae93..b98e522f0b 100644 --- a/tests/common/TestRuntime.cs +++ b/tests/common/TestRuntime.cs @@ -234,13 +234,25 @@ partial class TestRuntime #else throw new NotImplementedException (); #endif - case 1: // This is guesswork until Apple actually releases an Xcode 11.1. + case 1: +#if __WATCHOS__ + return CheckWatchOSSystemVersion (6, 0); +#elif __TVOS__ + return ChecktvOSSystemVersion (13, 0); +#elif __IOS__ + return CheckiOSSystemVersion (13, 1); +#elif MONOMAC + return CheckMacSystemVersion (10, 15, 0); +#else + throw new NotImplementedException (); +#endif + case 2: #if __WATCHOS__ return CheckWatchOSSystemVersion (6, 1); #elif __TVOS__ - return ChecktvOSSystemVersion (13, 1); + return ChecktvOSSystemVersion (13, 2); #elif __IOS__ - return CheckiOSSystemVersion (13, 1); + return CheckiOSSystemVersion (13, 2); #elif MONOMAC return CheckMacSystemVersion (10, 15, 1); #else diff --git a/tests/introspection/iOS/iOSApiCtorInitTest.cs b/tests/introspection/iOS/iOSApiCtorInitTest.cs index 58aa749035..5a5e0f7a71 100644 --- a/tests/introspection/iOS/iOSApiCtorInitTest.cs +++ b/tests/introspection/iOS/iOSApiCtorInitTest.cs @@ -237,6 +237,8 @@ namespace Introspection { return Runtime.Arch == Arch.SIMULATOR; case "VNDocumentCameraViewController": // Name: NSGenericException Reason: Document camera is not available on simulator return Runtime.Arch == Arch.SIMULATOR; + case "AVAudioRecorder": // Stopped working with Xcode 11.2 beta 2 + return TestRuntime.CheckXcodeVersion (11, 2); default: return base.Skip (type); } diff --git a/tests/xtro-sharpie/iOS-CoreMedia.todo b/tests/xtro-sharpie/iOS-CoreMedia.todo new file mode 100644 index 0000000000..3364a0fdc5 --- /dev/null +++ b/tests/xtro-sharpie/iOS-CoreMedia.todo @@ -0,0 +1 @@ +!missing-field! kCMMetadataIdentifier_QuickTimeMetadataLivePhotoStillImageTransformReferenceDimensions not bound diff --git a/tests/xtro-sharpie/iOS-ImageIO.todo b/tests/xtro-sharpie/iOS-ImageIO.todo index 60513c8046..3cbcbaf7ba 100644 --- a/tests/xtro-sharpie/iOS-ImageIO.todo +++ b/tests/xtro-sharpie/iOS-ImageIO.todo @@ -4,3 +4,7 @@ !missing-field! kCGImageAnimationStartIndex not bound !missing-pinvoke! CGAnimateImageAtURLWithBlock is not bound !missing-pinvoke! CGAnimateImageDataWithBlock is not bound +## appended from unclassified file +!missing-field! kCGImagePropertyExifCompositeImage not bound +!missing-field! kCGImagePropertyExifSourceExposureTimesOfCompositeImage not bound +!missing-field! kCGImagePropertyExifSourceImageNumberOfCompositeImage not bound diff --git a/tests/xtro-sharpie/iOS-MapKit.todo b/tests/xtro-sharpie/iOS-MapKit.todo new file mode 100644 index 0000000000..6f4e7fcc6a --- /dev/null +++ b/tests/xtro-sharpie/iOS-MapKit.todo @@ -0,0 +1,2 @@ +!missing-selector! +MKMapItem::openMapsWithItems:launchOptions:fromScene:completionHandler: not bound +!missing-selector! MKMapItem::openInMapsWithLaunchOptions:fromScene:completionHandler: not bound diff --git a/tests/xtro-sharpie/iOS-UIKit.todo b/tests/xtro-sharpie/iOS-UIKit.todo index e69de29bb2..94e1a4e455 100644 --- a/tests/xtro-sharpie/iOS-UIKit.todo +++ b/tests/xtro-sharpie/iOS-UIKit.todo @@ -0,0 +1,5 @@ +## appended from unclassified file +!deprecated-attribute-missing! UIApplicationDelegate::application:shouldRestoreApplicationState: missing a [Deprecated] attribute +!deprecated-attribute-missing! UIApplicationDelegate::application:shouldSaveApplicationState: missing a [Deprecated] attribute +!missing-protocol-member! UIApplicationDelegate::application:shouldRestoreSecureApplicationState: not found +!missing-protocol-member! UIApplicationDelegate::application:shouldSaveSecureApplicationState: not found diff --git a/tests/xtro-sharpie/macOS-CoreMedia.todo b/tests/xtro-sharpie/macOS-CoreMedia.todo new file mode 100644 index 0000000000..3364a0fdc5 --- /dev/null +++ b/tests/xtro-sharpie/macOS-CoreMedia.todo @@ -0,0 +1 @@ +!missing-field! kCMMetadataIdentifier_QuickTimeMetadataLivePhotoStillImageTransformReferenceDimensions not bound diff --git a/tests/xtro-sharpie/macOS-CoreTelephony.ignore b/tests/xtro-sharpie/macOS-CoreTelephony.ignore deleted file mode 100644 index 8f838b5f63..0000000000 --- a/tests/xtro-sharpie/macOS-CoreTelephony.ignore +++ /dev/null @@ -1,2 +0,0 @@ -# Probably a mistake by Apple, see radar -> https://trello.com/c/WKIRTcLk -!missing-protocol! CTSubscriberDelegate not bound \ No newline at end of file diff --git a/tests/xtro-sharpie/macOS-ImageIO.todo b/tests/xtro-sharpie/macOS-ImageIO.todo new file mode 100644 index 0000000000..2a0d5b4045 --- /dev/null +++ b/tests/xtro-sharpie/macOS-ImageIO.todo @@ -0,0 +1,9 @@ +!missing-enum! CGImageAnimationStatus not bound +!missing-field! kCGImageAnimationDelayTime not bound +!missing-field! kCGImageAnimationLoopCount not bound +!missing-field! kCGImageAnimationStartIndex not bound +!missing-field! kCGImagePropertyExifCompositeImage not bound +!missing-field! kCGImagePropertyExifSourceExposureTimesOfCompositeImage not bound +!missing-field! kCGImagePropertyExifSourceImageNumberOfCompositeImage not bound +!missing-pinvoke! CGAnimateImageAtURLWithBlock is not bound +!missing-pinvoke! CGAnimateImageDataWithBlock is not bound diff --git a/tests/xtro-sharpie/macOS-NetworkExtension.todo b/tests/xtro-sharpie/macOS-NetworkExtension.todo new file mode 100644 index 0000000000..77f85773e8 --- /dev/null +++ b/tests/xtro-sharpie/macOS-NetworkExtension.todo @@ -0,0 +1 @@ +!missing-selector! NEFilterFlow::identifier not bound diff --git a/tests/xtro-sharpie/macOS-Photos.todo b/tests/xtro-sharpie/macOS-Photos.todo new file mode 100644 index 0000000000..a2d90cf9fd --- /dev/null +++ b/tests/xtro-sharpie/macOS-Photos.todo @@ -0,0 +1 @@ +!deprecated-attribute-missing! PHAsset::isSyncFailureHidden missing a [Deprecated] attribute diff --git a/tests/xtro-sharpie/macOS-Security.ignore b/tests/xtro-sharpie/macOS-Security.ignore index 1db81854e2..85086df7a5 100644 --- a/tests/xtro-sharpie/macOS-Security.ignore +++ b/tests/xtro-sharpie/macOS-Security.ignore @@ -1271,12 +1271,6 @@ !missing-pinvoke! SecEncryptTransformCreate is not bound !missing-pinvoke! SecEncryptTransformGetTypeID is not bound !missing-pinvoke! SecGroupTransformGetTypeID is not bound -!missing-pinvoke! SecHostCreateGuest is not bound -!missing-pinvoke! SecHostRemoveGuest is not bound -!missing-pinvoke! SecHostSelectedGuest is not bound -!missing-pinvoke! SecHostSelectGuest is not bound -!missing-pinvoke! SecHostSetGuestStatus is not bound -!missing-pinvoke! SecHostSetHostingPort is not bound !missing-pinvoke! SecIdentityCopyPreference is not bound !missing-pinvoke! SecIdentityCopyPreferred is not bound !missing-pinvoke! SecIdentityCopySystemIdentity is not bound diff --git a/tests/xtro-sharpie/tvOS-CoreMedia.todo b/tests/xtro-sharpie/tvOS-CoreMedia.todo new file mode 100644 index 0000000000..3364a0fdc5 --- /dev/null +++ b/tests/xtro-sharpie/tvOS-CoreMedia.todo @@ -0,0 +1 @@ +!missing-field! kCMMetadataIdentifier_QuickTimeMetadataLivePhotoStillImageTransformReferenceDimensions not bound diff --git a/tests/xtro-sharpie/tvOS-ImageIO.todo b/tests/xtro-sharpie/tvOS-ImageIO.todo index 60513c8046..3cbcbaf7ba 100644 --- a/tests/xtro-sharpie/tvOS-ImageIO.todo +++ b/tests/xtro-sharpie/tvOS-ImageIO.todo @@ -4,3 +4,7 @@ !missing-field! kCGImageAnimationStartIndex not bound !missing-pinvoke! CGAnimateImageAtURLWithBlock is not bound !missing-pinvoke! CGAnimateImageDataWithBlock is not bound +## appended from unclassified file +!missing-field! kCGImagePropertyExifCompositeImage not bound +!missing-field! kCGImagePropertyExifSourceExposureTimesOfCompositeImage not bound +!missing-field! kCGImagePropertyExifSourceImageNumberOfCompositeImage not bound diff --git a/tests/xtro-sharpie/tvOS-UIKit.todo b/tests/xtro-sharpie/tvOS-UIKit.todo index e69de29bb2..94e1a4e455 100644 --- a/tests/xtro-sharpie/tvOS-UIKit.todo +++ b/tests/xtro-sharpie/tvOS-UIKit.todo @@ -0,0 +1,5 @@ +## appended from unclassified file +!deprecated-attribute-missing! UIApplicationDelegate::application:shouldRestoreApplicationState: missing a [Deprecated] attribute +!deprecated-attribute-missing! UIApplicationDelegate::application:shouldSaveApplicationState: missing a [Deprecated] attribute +!missing-protocol-member! UIApplicationDelegate::application:shouldRestoreSecureApplicationState: not found +!missing-protocol-member! UIApplicationDelegate::application:shouldSaveSecureApplicationState: not found diff --git a/tests/xtro-sharpie/watchOS-CoreMedia.todo b/tests/xtro-sharpie/watchOS-CoreMedia.todo new file mode 100644 index 0000000000..3364a0fdc5 --- /dev/null +++ b/tests/xtro-sharpie/watchOS-CoreMedia.todo @@ -0,0 +1 @@ +!missing-field! kCMMetadataIdentifier_QuickTimeMetadataLivePhotoStillImageTransformReferenceDimensions not bound diff --git a/tests/xtro-sharpie/watchOS-ImageIO.todo b/tests/xtro-sharpie/watchOS-ImageIO.todo index 60513c8046..3cbcbaf7ba 100644 --- a/tests/xtro-sharpie/watchOS-ImageIO.todo +++ b/tests/xtro-sharpie/watchOS-ImageIO.todo @@ -4,3 +4,7 @@ !missing-field! kCGImageAnimationStartIndex not bound !missing-pinvoke! CGAnimateImageAtURLWithBlock is not bound !missing-pinvoke! CGAnimateImageDataWithBlock is not bound +## appended from unclassified file +!missing-field! kCGImagePropertyExifCompositeImage not bound +!missing-field! kCGImagePropertyExifSourceExposureTimesOfCompositeImage not bound +!missing-field! kCGImagePropertyExifSourceImageNumberOfCompositeImage not bound From 4cff2bc4e340c54edc27a0d887fe74e904036e48 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Tue, 15 Oct 2019 14:31:31 -0400 Subject: [PATCH 005/100] [Networking] Improve the NWBrowser API. (#7214) Kept the API as it was but added a new handler that will be called when all the changes from the browser have been done. The old Set* method could be deleted in a future release and just expose the property. --- src/Network/NWBrowser.cs | 75 ++++++++++++++-- src/Network/NWListener.cs | 38 +++++--- tests/monotouch-test/Entitlements.plist | 4 + tests/monotouch-test/Network/NWBrowserTest.cs | 86 ++++++++++++++++--- 4 files changed, 172 insertions(+), 31 deletions(-) diff --git a/src/Network/NWBrowser.cs b/src/Network/NWBrowser.cs index abd550aeb8..d6862a64dc 100644 --- a/src/Network/NWBrowser.cs +++ b/src/Network/NWBrowser.cs @@ -7,6 +7,7 @@ // Copyrigh 2019 Microsoft Inc // using System; +using System.Collections.Generic; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using ObjCRuntime; @@ -28,6 +29,10 @@ namespace Network { Cancelled = 3, } + public delegate void NWBrowserChangesDelegate (NWBrowseResult oldResult, NWBrowseResult newResult, bool completed); + + public delegate void NWBrowserCompleteChangesDelegate (List<(NWBrowseResult result, NWBrowseResultChange change)> changes); + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] public class NWBrowser : NativeObject { @@ -35,7 +40,10 @@ namespace Network { bool queueSet = false; object startLock = new Object (); - internal NWBrowser (IntPtr handle, bool owns) : base (handle, owns) {} + internal NWBrowser (IntPtr handle, bool owns) : base (handle, owns) + { + SetChangesHandler (InternalChangesHandler); + } [DllImport (Constants.NetworkLibrary)] static extern OS_nw_browser nw_browser_create (OS_nw_browse_descriptor descriptor, OS_nw_parameters parameters); @@ -46,6 +54,7 @@ namespace Network { throw new ArgumentNullException (nameof (descriptor)); InitializeHandle (nw_browser_create (descriptor.Handle, parameters.GetHandle ())); + SetChangesHandler (InternalChangesHandler); } public NWBrowser (NWBrowserDescriptor descriptor) : this (descriptor, null) {} @@ -113,22 +122,66 @@ namespace Network { [DllImport (Constants.NetworkLibrary)] unsafe static extern void nw_browser_set_browse_results_changed_handler (OS_nw_browser browser, void *handler); - delegate void nw_browser_browse_results_changed_handler_t (IntPtr block, IntPtr oldResult, IntPtr newResult); + delegate void nw_browser_browse_results_changed_handler_t (IntPtr block, IntPtr oldResult, IntPtr newResult, bool completed); static nw_browser_browse_results_changed_handler_t static_ChangesHandler = TrampolineChangesHandler; [MonoPInvokeCallback (typeof (nw_browser_browse_results_changed_handler_t))] - static void TrampolineChangesHandler (IntPtr block, IntPtr oldResult, IntPtr newResult) + static void TrampolineChangesHandler (IntPtr block, IntPtr oldResult, IntPtr newResult, bool completed) { - var del = BlockLiteral.GetTarget> (block); + var del = BlockLiteral.GetTarget (block); if (del != null) { - using (var nwOldResult = new NWBrowseResult (oldResult, owns: false)) - using (var nwNewResult = new NWBrowseResult (newResult, owns: false)) - del (nwOldResult, nwNewResult); + // we do the cleanup of the objs in the internal handlers + NWBrowseResult nwOldResult = (oldResult == IntPtr.Zero) ? null : new NWBrowseResult (oldResult, owns: false); + NWBrowseResult nwNewResult = (newResult == IntPtr.Zero) ? null : new NWBrowseResult (newResult, owns: false); + del (nwOldResult, nwNewResult, completed); + } + } + + public Action IndividualChangesDelegate { get; set; } + + // syntactic sugar for the user, nicer to get all the changes at once + public NWBrowserCompleteChangesDelegate CompleteChangesDelegate { get; set; } + object changesLock = new object (); + List<(NWBrowseResult result, NWBrowseResultChange change)> changes = new List<(NWBrowseResult result, NWBrowseResultChange change)> (); + + void InternalChangesHandler (NWBrowseResult oldResult, NWBrowseResult newResult, bool completed) + { + // we allow the user to listen to both, individual changes AND complete ones, individual is simple, just + // call the cb, completed, we need to get a collection and call the cb when completed + var individualCb = IndividualChangesDelegate; + individualCb?.Invoke (oldResult, newResult); + var completeCb = CompleteChangesDelegate; + if (completeCb == null) { + // we do not want to keep a list of the new results if the user does not care, dispose and move on + // results can be null, since we could have a not old one + oldResult?.Dispose (); + newResult?.Dispose (); + return; + } + // get the change, add it to the list + var change = NWBrowseResult.GetChanges (oldResult, newResult); + var result = (result: newResult, change: change); + // at this point, we do not longer need the old result + // results can be null + oldResult?.Dispose (); + List<(NWBrowseResult result, NWBrowseResultChange change)> tmp_changes = null; + lock (changesLock) { + changes.Add (result); + // only call when we know we are done + if (completed) { + tmp_changes = changes; + changes = new List<(NWBrowseResult result, NWBrowseResultChange change)> (); + } + } + if (completed) { + completeCb.Invoke (tmp_changes); + foreach (var c in tmp_changes) + c.result?.Dispose (); } } [BindingImpl (BindingImplOptions.Optimizable)] - public void SetChangesHandler (Action handler) + void SetChangesHandler (NWBrowserChangesDelegate handler) { unsafe { if (handler == null) { @@ -146,6 +199,12 @@ namespace Network { } } + // let to not change the API, but would be nice to remove it in the following releases. +#if !XAMCORE_4_0 + [Obsolete ("Uset the 'IndividualChangesDelegate' instead.")] + public void SetChangesHandler (Action handler) => IndividualChangesDelegate = handler; +#endif + [DllImport (Constants.NetworkLibrary)] unsafe static extern void nw_browser_set_state_changed_handler (OS_nw_browser browser, void *state_changed_handler); diff --git a/src/Network/NWListener.cs b/src/Network/NWListener.cs index aed7e614b3..2f404f2c3f 100644 --- a/src/Network/NWListener.cs +++ b/src/Network/NWListener.cs @@ -26,6 +26,8 @@ namespace Network { [TV (12,0), Mac (10,14), iOS (12,0)] [Watch (6,0)] public class NWListener : NativeObject { + bool connectionHandlerWasSet = false; + object connectionHandlerLock = new object (); public NWListener (IntPtr handle, bool owns) : base (handle, owns) { } @@ -99,7 +101,14 @@ namespace Network { [DllImport (Constants.NetworkLibrary)] extern static void nw_listener_start (IntPtr handle); - public void Start () => nw_listener_start (GetCheckedHandle ()); + public void Start () { + lock (connectionHandlerLock) { + // we will get a sigabort if the handler is not set, lets be nicer. + if (!connectionHandlerWasSet) + throw new InvalidOperationException ("A connection handler should be set before starting a NWListener."); + nw_listener_start (GetCheckedHandle ()); + } + } [DllImport (Constants.NetworkLibrary)] extern static void nw_listener_cancel (IntPtr handle); @@ -163,20 +172,23 @@ namespace Network { [BindingImpl (BindingImplOptions.Optimizable)] public void SetNewConnectionHandler (Action callback) { - unsafe { - if (callback == null){ - nw_listener_set_new_connection_handler (GetCheckedHandle (), null); - return; - } + lock (connectionHandlerLock) { + unsafe { + if (callback == null) { + nw_listener_set_new_connection_handler (GetCheckedHandle (), null); + return; + } - BlockLiteral block_handler = new BlockLiteral (); - BlockLiteral *block_ptr_handler = &block_handler; - block_handler.SetupBlockUnsafe (static_NewConnection, callback); + BlockLiteral block_handler = new BlockLiteral (); + BlockLiteral *block_ptr_handler = &block_handler; + block_handler.SetupBlockUnsafe (static_NewConnection, callback); - try { - nw_listener_set_new_connection_handler (GetCheckedHandle (), (void*) block_ptr_handler); - } finally { - block_handler.CleanupBlock (); + try { + nw_listener_set_new_connection_handler (GetCheckedHandle (), (void*) block_ptr_handler); + connectionHandlerWasSet = true; + } finally { + block_handler.CleanupBlock (); + } } } } diff --git a/tests/monotouch-test/Entitlements.plist b/tests/monotouch-test/Entitlements.plist index 3745ea4f51..9a4e835c5a 100644 --- a/tests/monotouch-test/Entitlements.plist +++ b/tests/monotouch-test/Entitlements.plist @@ -12,5 +12,9 @@ A93A5CM278.tests/monotouch-test/Entitlements.plist + com.apple.security.network.client + + com.apple.security.network.server + diff --git a/tests/monotouch-test/Network/NWBrowserTest.cs b/tests/monotouch-test/Network/NWBrowserTest.cs index c314e2b7d9..36fae3c588 100644 --- a/tests/monotouch-test/Network/NWBrowserTest.cs +++ b/tests/monotouch-test/Network/NWBrowserTest.cs @@ -25,7 +25,8 @@ namespace MonoTouchFixtures.Network { NWBrowserDescriptor descriptor; NWBrowser browser; - string type = "_ssh._tcp."; + + string type = "_tictactoe._tcp"; string domain = "local."; [TestFixtureSetUp] @@ -35,7 +36,8 @@ namespace MonoTouchFixtures.Network { public void SetUp () { descriptor = NWBrowserDescriptor.CreateBonjourService (type, domain); - browser = new NWBrowser (descriptor); + using (var parameters = new NWParameters { IncludePeerToPeer = true}) + browser = new NWBrowser (descriptor); browser.SetDispatchQueue (DispatchQueue.DefaultGlobalQueue); } @@ -78,14 +80,78 @@ namespace MonoTouchFixtures.Network { [Test] public void TestStateChangesHandler () { - var e = new AutoResetEvent (false); - browser.SetStateChangesHandler ((st, er) => { - Assert.IsNotNull (st, "State"); - Assert.IsNull (er, "Error"); - e.Set (); - }); - browser.Start (); - e.WaitOne (); + // In the test we are doing the following: + // + // 1. Start a browser. At this point, we have no listeners (unless someone is exposing it in the lab) + // and therefore the browser cannot find any services/listeners. + // 2. Start a listener that is using the same type/domain pair that the browser expects. + // 3. Browser picks up the new listener, and sends an event (service found). + // 4. Listener stops, and the service disappears. + // 5. The browser is not yet canceled, so it picks up that the service/listener is not longer then and returns it. + // + // The test will block until the different events are set by the callbacks that are executed in a diff thread. + + bool firstRun = true; + bool eventsDone = false; + bool listeningDone = false; + var changesEvent = new AutoResetEvent (false); + var browserReady = new AutoResetEvent (false); + var finalEvent = new AutoResetEvent (false); + TestRuntime.RunAsync (DateTime.Now.AddSeconds (30), async () => { + // start the browser, before the listener + browser.SetStateChangesHandler ((st, er) => { + Assert.IsNotNull (st, "State"); + Assert.IsNull (er, "Error"); + if (st == NWBrowserState.Ready) + browserReady.Set (); + }); + browser.SetChangesHandler ((oldResult, newResult) => { + // first time, listener appears, so we do not have an old result, second time + // listener goes, so we do not have a new result + if (firstRun) { + Assert.IsNull (oldResult, "oldResult first run."); + Assert.IsNotNull (newResult, "newResult first run"); + firstRun = false; + } else { + Assert.IsNotNull (oldResult, "oldResult first run."); + Assert.IsNull (newResult, "newResult first run"); + } + changesEvent.Set (); + eventsDone = true; + + }); + browser.Start (); + browserReady.WaitOne (30000); + using (var advertiser = NWAdvertiseDescriptor.CreateBonjourService ("MonoTouchFixtures.Network", type)) + using (var tcpOptions = NWProtocolOptions.CreateTcp ()) + using (var tlsOptions = NWProtocolOptions.CreateTls ()) + using (var paramenters = NWParameters.CreateTcp ()) { + paramenters.ProtocolStack.PrependApplicationProtocol (tlsOptions); + paramenters.ProtocolStack.PrependApplicationProtocol (tcpOptions); + paramenters.IncludePeerToPeer = true; + using (var listener = NWListener.Create ("1234", paramenters)) { + listener.SetQueue (DispatchQueue.CurrentQueue); + listener.SetAdvertiseDescriptor (advertiser); + // we need the connection handler, else we will get an exception + listener.SetNewConnectionHandler ((c) => { }); + listener.SetStateChangedHandler ((s, e) => { + if (e != null) { + Console.WriteLine ($"Got error {e.ErrorCode} {e.ErrorDomain} '{e.CFError.FailureReason}' {e.ToString ()}"); + } + }); + listener.Start (); + changesEvent.WaitOne (30000); + listener.Cancel (); + listeningDone = true; + finalEvent.Set (); + } + } + + }, () => eventsDone); + + finalEvent.WaitOne (30000); + Assert.IsTrue (eventsDone); + Assert.IsTrue (listeningDone); browser.Cancel (); } } From 6cee62c10c411fa459e63c2baa13a0cdb605f099 Mon Sep 17 00:00:00 2001 From: Pramit Mallick Date: Tue, 15 Oct 2019 17:41:56 -0400 Subject: [PATCH 006/100] [AppKit] Bindings - part 1 (#7187) * Added NSButtonTouchBarItem interface * Added NSTextScalingType * name changes * Text Scaling options * Deprecated KeyEquivalentFont * Deprecated CopiesOnScroll * Added missing enums first * Added some deprecated attributes * some more deprecations * Strong typed TextScaling * apple docs to correct deprecations * Changed deprecated messages * strong typing NSTouchBarItemIdentifier identifier * internal attr * Making TextScalingDocumentOption simple Fields following UIKit * smart enum for identifier --- src/appkit.cs | 168 ++++++++++++++++++++++++++- tests/xtro-sharpie/macOS-AppKit.todo | 50 -------- 2 files changed, 167 insertions(+), 51 deletions(-) diff --git a/src/appkit.cs b/src/appkit.cs index 340d97aa3b..c5329da345 100644 --- a/src/appkit.cs +++ b/src/appkit.cs @@ -2109,10 +2109,12 @@ namespace AppKit { [Export ("keyEquivalentModifierMask")] NSEventModifierMask KeyEquivalentModifierMask { get; set; } - [Export ("keyEquivalentFont", ArgumentSemantic.Retain)] + [NullAllowed, Export ("keyEquivalentFont", ArgumentSemantic.Strong)] + [Deprecated (PlatformName.MacOSX, 10, 15, message: "It always returns the NSButtonCell's font.")] NSFont KeyEquivalentFont { get; set; } [Export ("setKeyEquivalentFont:size:")] + [Deprecated (PlatformName.MacOSX, 10, 15)] void SetKeyEquivalentFont (string fontName, nfloat fontSize); [Export ("performClick:")] @@ -2717,6 +2719,7 @@ namespace AppKit { void ViewBoundsChanged (NSNotification notification); [Export ("copiesOnScroll")] + [Deprecated (PlatformName.MacOSX, 10, 15, message: "'NSClipView' minimizes area of the document view that is invalidated. Use the 'SetNeedsDisplayInRect' method to force invalidation.")] bool CopiesOnScroll { get; set; } [Export ("autoscroll:")] @@ -3062,6 +3065,7 @@ namespace AppKit { bool CanDragItems (NSCollectionView collectionView, NSIndexSet indexes, NSEvent evt); [Export ("collectionView:writeItemsAtIndexes:toPasteboard:")] + [Deprecated (PlatformName.MacOSX, 10, 15, message: "Use the 'GetPasteboardWriter' method instead")] bool WriteItems (NSCollectionView collectionView, NSIndexSet indexes, NSPasteboard toPasteboard); [Deprecated (PlatformName.MacOSX, 10, 13, message: "Use 'NSFilePromiseReceiver' objects instead.")] @@ -3087,6 +3091,7 @@ namespace AppKit { [Mac (10,11)] [Export ("collectionView:writeItemsAtIndexPaths:toPasteboard:")] + [Deprecated (PlatformName.MacOSX, 10, 15, message: "Use the 'GetPasteboardWriter' method instead")] bool WriteItems (NSCollectionView collectionView, NSSet indexPaths, NSPasteboard pasteboard); [Mac (10,11)] @@ -9039,6 +9044,7 @@ namespace AppKit { void SortDescriptorsChanged (NSOutlineView outlineView, NSSortDescriptor [] oldDescriptors); [Export ("outlineView:writeItems:toPasteboard:")] + [Deprecated (PlatformName.MacOSX, 10, 15)] bool OutlineViewwriteItemstoPasteboard (NSOutlineView outlineView, NSArray items, NSPasteboard pboard); [Export ("outlineView:validateDrop:proposedItem:proposedChildIndex:")] @@ -14538,6 +14544,7 @@ namespace AppKit { // 'new' since it's inlined from NSSplitViewDelegate as this instance needs [RequiresSuper] [RequiresSuper] [Export ("splitView:shouldCollapseSubview:forDoubleClickOnDividerAtIndex:")] + [Deprecated (PlatformName.MacOSX, 10, 15, message: "This delegate method is never called, and NSSplitViewController's implementation always returns false.")] new bool ShouldCollapseForDoubleClick (NSSplitView splitView, NSView subview, nint doubleClickAtDividerIndex); } @@ -14605,6 +14612,7 @@ namespace AppKit { bool CanCollapse (NSSplitView splitView, NSView subview); [Export ("splitView:shouldCollapseSubview:forDoubleClickOnDividerAtIndex:")] [DefaultValue (true)] + [Deprecated (PlatformName.MacOSX, 10, 15, message: "This delegate method is never called.")] bool ShouldCollapseForDoubleClick (NSSplitView splitView, NSView subview, nint doubleClickAtDividerIndex); [Export ("splitView:constrainMinCoordinate:ofSubviewAt:")] @@ -15065,6 +15073,14 @@ namespace AppKit { [Mac (10,11)] [Internal, Field ("NSDefaultAttributesDocumentAttribute")] NSString NSDefaultAttributesDocumentAttribute { get; } + + [Mac (10, 15)] + [Internal, Field ("NSTargetTextScalingDocumentOption")] + NSString TargetTextScalingDocumentOption { get; } + + [Mac (10, 15)] + [Internal, Field ("NSSourceTextScalingDocumentOption")] + NSString SourceTextScalingDocumentOption { get; } } [Mac (10,10)] @@ -17182,6 +17198,7 @@ namespace AppKit { void SortDescriptorsChanged (NSTableView tableView, NSSortDescriptor [] oldDescriptors); [Export ("tableView:writeRowsWithIndexes:toPasteboard:")] + [Deprecated (PlatformName.MacOSX, 10, 15, message: "Use the 'GetPasteboardWriterForRow' method instead")] bool WriteRows (NSTableView tableView, NSIndexSet rowIndexes, NSPasteboard pboard ); [Export ("tableView:validateDrop:proposedRow:proposedDropOperation:")] @@ -21275,12 +21292,15 @@ namespace AppKit { NSNotificationCenter NotificationCenter { get; } [Export ("openFile:"), ThreadSafe] + [Deprecated (PlatformName.MacOSX, 10, 15, message: "Use the 'OpenUrl' method instead.")] bool OpenFile (string fullPath); [Export ("openFile:withApplication:"), ThreadSafe] + [Deprecated (PlatformName.MacOSX, 10, 15)] bool OpenFile (string fullPath, [NullAllowed] string appName); [Export ("openFile:withApplication:andDeactivate:"), ThreadSafe] + [Deprecated (PlatformName.MacOSX, 10, 15)] bool OpenFile (string fullPath, [NullAllowed] string appName, bool deactivate); [Deprecated (PlatformName.MacOSX, 10, 11, message: "Use 'NSWorkspace.OpenUrl' instead.")] @@ -21291,15 +21311,20 @@ namespace AppKit { bool OpenUrl (NSUrl url); [Export ("launchApplication:"), ThreadSafe] + [Deprecated (PlatformName.MacOSX, 10, 15)] bool LaunchApplication (string appName); [Export ("launchApplicationAtURL:options:configuration:error:"), ThreadSafe] + [Deprecated (PlatformName.MacOSX, 10, 15)] NSRunningApplication LaunchApplication (NSUrl url, NSWorkspaceLaunchOptions options, NSDictionary configuration, out NSError error); [Export ("launchApplication:showIcon:autolaunch:"), ThreadSafe] + [Deprecated (PlatformName.MacOSX, 10, 15)] bool LaunchApplication (string appName, bool showIcon, bool autolaunch); [Export ("fullPathForApplication:"), ThreadSafe] + [Deprecated (PlatformName.MacOSX, 10, 15, message: "Use the 'UrlForApplication' method instead.")] + [return: NullAllowed] string FullPathForApplication (string appName); [Export ("selectFile:inFileViewerRootedAtPath:"), ThreadSafe] @@ -21378,9 +21403,12 @@ namespace AppKit { NSUrl UrlForApplication (NSUrl url ); [Export ("absolutePathForAppBundleWithIdentifier:"), ThreadSafe] + [Deprecated (PlatformName.MacOSX, 10, 15, message: "Use the 'UrlForApplication' method instead.")] + [return: NullAllowed] string AbsolutePathForAppBundle (string bundleIdentifier); [Export ("launchAppWithBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifier:"), ThreadSafe] + [Deprecated (PlatformName.MacOSX, 10, 15)] bool LaunchApp (string bundleIdentifier, NSWorkspaceLaunchOptions options, NSAppleEventDescriptor descriptor, IntPtr identifier); [Internal] @@ -21549,10 +21577,14 @@ namespace AppKit { [Mac (10,10)] [Export ("openURL:options:configuration:error:")] + [Deprecated (PlatformName.MacOSX, 10, 15)] + [return: NullAllowed] NSRunningApplication OpenURL (NSUrl url, NSWorkspaceLaunchOptions options, NSDictionary configuration, out NSError error); [Mac (10,10)] [Export ("openURLs:withApplicationAtURL:options:configuration:error:")] + [Deprecated (PlatformName.MacOSX, 10, 15)] + [return: NullAllowed] NSRunningApplication OpenURLs (NSUrl [] urls, NSUrl applicationURL, NSWorkspaceLaunchOptions options, NSDictionary configuration, out NSError error); [Mac (10, 10)] @@ -26692,4 +26724,138 @@ namespace AppKit { [Export ("removeWindow:")] void Remove (NSWindow window); } + + [Mac (10,15)] + [Native] + public enum NSTextScalingType : long + { + Standard = 0, + iOS, + } + + [Mac (10,15)] + [BaseType (typeof(NSTouchBarItem))] + [DisableDefaultCtor] + interface NSButtonTouchBarItem + { + [Export ("initWithIdentifier:")] + [DesignatedInitializer] + IntPtr Constructor (string identifier); + + [Static] + [Export ("buttonTouchBarItemWithIdentifier:title:target:action:")] + NSButtonTouchBarItem Create ([BindAs (typeof (NSTouchBarItemIdentifier))] NSString identifier, string title, [NullAllowed] NSObject target, [NullAllowed] Selector action); + + [Static] + [Export ("buttonTouchBarItemWithIdentifier:image:target:action:")] + NSButtonTouchBarItem Create ([BindAs (typeof (NSTouchBarItemIdentifier))] NSString identifier, NSImage image, [NullAllowed] NSObject target, [NullAllowed] Selector action); + + [Static] + [Export ("buttonTouchBarItemWithIdentifier:title:image:target:action:")] + NSButtonTouchBarItem Create ([BindAs (typeof (NSTouchBarItemIdentifier))] NSString identifier, string title, NSImage image, [NullAllowed] NSObject target, [NullAllowed] Selector action); + + [Export ("title")] + string Title { get; set; } + + [NullAllowed, Export ("image", ArgumentSemantic.Strong)] + NSImage Image { get; set; } + + [NullAllowed, Export ("bezelColor", ArgumentSemantic.Copy)] + NSColor BezelColor { get; set; } + + [NullAllowed, Export ("target", ArgumentSemantic.Weak)] + NSObject Target { get; set; } + + [NullAllowed, Export ("action", ArgumentSemantic.Assign)] + Selector Action { get; set; } + + [Export ("enabled")] + bool Enabled { [Bind ("isEnabled")] get; set; } + + [Export ("customizationLabel")] + string CustomizationLabel { get; set; } + } + + [Mac (10,15)] + [Native] + public enum NSCollectionLayoutSectionOrthogonalScrollingBehavior : long + { + None, + Continuous, + ContinuousGroupLeadingBoundary, + Paging, + GroupPaging, + GroupPagingCentered, + } + + [Flags, Mac (10,15)] + [Native] + public enum NSDirectionalRectEdge : ulong + { + None = 0x0, + Top = 1uL << 0, + Leading = 1uL << 1, + Bottom = 1uL << 2, + Trailing = 1uL << 3, + All = Top | Leading | Bottom | Trailing, + } + + [Mac (10,15)] + [Native] + public enum NSPickerTouchBarItemControlRepresentation : long + { + Automatic = 0, + Expanded = 1, + Collapsed = 2, + } + + [Mac (10,15)] + [Native] + public enum NSPickerTouchBarItemSelectionMode : long + { + SelectOne = 0, + SelectAny = 1, + Momentary = 2, + } + + [Mac (10,15)] + [Native] + public enum NSRectAlignment : long + { + None = 0, + Top, + TopLeading, + Leading, + BottomLeading, + Bottom, + BottomTrailing, + Trailing, + TopTrailing, + } + + [Native] + public enum NSTextInputTraitType : long + { + Default, + No, + Yes, + } + + [Mac (10,15)] + [Native] + public enum NSToolbarItemGroupControlRepresentation : long + { + Automatic, + Expanded, + Collapsed, + } + + [Mac (10,15), iOS (13,0)] + [Native] + public enum NSToolbarItemGroupSelectionMode : long + { + SelectOne = 0, + SelectAny = 1, + Momentary = 2, + } } diff --git a/tests/xtro-sharpie/macOS-AppKit.todo b/tests/xtro-sharpie/macOS-AppKit.todo index 8803758731..07b536fab2 100644 --- a/tests/xtro-sharpie/macOS-AppKit.todo +++ b/tests/xtro-sharpie/macOS-AppKit.todo @@ -1,36 +1,8 @@ -!deprecated-attribute-missing! NSButtonCell::keyEquivalentFont missing a [Deprecated] attribute -!deprecated-attribute-missing! NSButtonCell::setKeyEquivalentFont: missing a [Deprecated] attribute -!deprecated-attribute-missing! NSButtonCell::setKeyEquivalentFont:size: missing a [Deprecated] attribute -!deprecated-attribute-missing! NSClipView::copiesOnScroll missing a [Deprecated] attribute -!deprecated-attribute-missing! NSClipView::setCopiesOnScroll: missing a [Deprecated] attribute -!deprecated-attribute-missing! NSSplitViewDelegate::splitView:shouldCollapseSubview:forDoubleClickOnDividerAtIndex: missing a [Deprecated] attribute -!deprecated-attribute-missing! NSWorkspace::absolutePathForAppBundleWithIdentifier: missing a [Deprecated] attribute -!deprecated-attribute-missing! NSWorkspace::fullPathForApplication: missing a [Deprecated] attribute -!deprecated-attribute-missing! NSWorkspace::launchApplication: missing a [Deprecated] attribute -!deprecated-attribute-missing! NSWorkspace::launchApplication:showIcon:autolaunch: missing a [Deprecated] attribute -!deprecated-attribute-missing! NSWorkspace::launchApplicationAtURL:options:configuration:error: missing a [Deprecated] attribute -!deprecated-attribute-missing! NSWorkspace::launchAppWithBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifier: missing a [Deprecated] attribute -!deprecated-attribute-missing! NSWorkspace::openFile: missing a [Deprecated] attribute -!deprecated-attribute-missing! NSWorkspace::openFile:withApplication: missing a [Deprecated] attribute -!deprecated-attribute-missing! NSWorkspace::openFile:withApplication:andDeactivate: missing a [Deprecated] attribute -!deprecated-attribute-missing! NSWorkspace::openURL:options:configuration:error: missing a [Deprecated] attribute -!deprecated-attribute-missing! NSWorkspace::openURLs:withApplicationAtURL:options:configuration:error: missing a [Deprecated] attribute -!missing-enum! NSCollectionLayoutSectionOrthogonalScrollingBehavior not bound -!missing-enum! NSDirectionalRectEdge not bound -!missing-enum! NSPickerTouchBarItemControlRepresentation not bound -!missing-enum! NSPickerTouchBarItemSelectionMode not bound -!missing-enum! NSRectAlignment not bound -!missing-enum! NSTextInputTraitType not bound -!missing-enum! NSTextScalingType not bound -!missing-enum! NSToolbarItemGroupControlRepresentation not bound -!missing-enum! NSToolbarItemGroupSelectionMode not bound !missing-field! NSDirectionalEdgeInsetsZero not bound !missing-field! NSFontDescriptorSystemDesignDefault not bound !missing-field! NSFontDescriptorSystemDesignMonospaced not bound !missing-field! NSFontDescriptorSystemDesignRounded not bound !missing-field! NSFontDescriptorSystemDesignSerif not bound -!missing-field! NSSourceTextScalingDocumentOption not bound -!missing-field! NSTargetTextScalingDocumentOption not bound !missing-protocol! NSCollectionLayoutContainer not bound !missing-protocol! NSCollectionLayoutEnvironment not bound !missing-protocol! NSCollectionLayoutVisibleItem not bound @@ -42,9 +14,6 @@ !missing-protocol-conformance! NSTextList should conform to NSSecureCoding !missing-selector! +NSBindingSelectionMarker::defaultPlaceholderForMarker:onClass:withBinding: not bound !missing-selector! +NSBindingSelectionMarker::setDefaultPlaceholder:forMarker:onClass:withBinding: not bound -!missing-selector! +NSButtonTouchBarItem::buttonTouchBarItemWithIdentifier:image:target:action: not bound -!missing-selector! +NSButtonTouchBarItem::buttonTouchBarItemWithIdentifier:title:image:target:action: not bound -!missing-selector! +NSButtonTouchBarItem::buttonTouchBarItemWithIdentifier:title:target:action: not bound !missing-selector! +NSCollectionLayoutAnchor::layoutAnchorWithEdges: not bound !missing-selector! +NSCollectionLayoutAnchor::layoutAnchorWithEdges:absoluteOffset: not bound !missing-selector! +NSCollectionLayoutAnchor::layoutAnchorWithEdges:fractionalOffset: not bound @@ -84,20 +53,6 @@ !missing-selector! +NSTouchBar::isAutomaticCustomizeTouchBarMenuItemEnabled not bound !missing-selector! +NSTouchBar::setAutomaticCustomizeTouchBarMenuItemEnabled: not bound !missing-selector! +NSWorkspaceOpenConfiguration::configuration not bound -!missing-selector! NSButtonTouchBarItem::action not bound -!missing-selector! NSButtonTouchBarItem::bezelColor not bound -!missing-selector! NSButtonTouchBarItem::customizationLabel not bound -!missing-selector! NSButtonTouchBarItem::image not bound -!missing-selector! NSButtonTouchBarItem::isEnabled not bound -!missing-selector! NSButtonTouchBarItem::setAction: not bound -!missing-selector! NSButtonTouchBarItem::setBezelColor: not bound -!missing-selector! NSButtonTouchBarItem::setCustomizationLabel: not bound -!missing-selector! NSButtonTouchBarItem::setEnabled: not bound -!missing-selector! NSButtonTouchBarItem::setImage: not bound -!missing-selector! NSButtonTouchBarItem::setTarget: not bound -!missing-selector! NSButtonTouchBarItem::setTitle: not bound -!missing-selector! NSButtonTouchBarItem::target not bound -!missing-selector! NSButtonTouchBarItem::title not bound !missing-selector! NSCollectionLayoutAnchor::edges not bound !missing-selector! NSCollectionLayoutAnchor::isAbsoluteOffset not bound !missing-selector! NSCollectionLayoutAnchor::isFractionalOffset not bound @@ -348,7 +303,6 @@ !missing-selector! NSWorkspaceOpenConfiguration::setHidesOthers: not bound !missing-selector! NSWorkspaceOpenConfiguration::setPromptsUserIfNeeded: not bound !missing-selector! NSWorkspaceOpenConfiguration::setRequiresUniversalLinks: not bound -!missing-type! NSButtonTouchBarItem not bound !missing-type! NSCollectionLayoutAnchor not bound !missing-type! NSCollectionLayoutBoundarySupplementaryItem not bound !missing-type! NSCollectionLayoutDecorationItem not bound @@ -372,10 +326,6 @@ !missing-type! NSSwitch not bound !missing-type! NSTextCheckingController not bound !missing-type! NSWorkspaceOpenConfiguration not bound -!deprecated-attribute-missing! NSCollectionViewDelegate::collectionView:writeItemsAtIndexes:toPasteboard: missing a [Deprecated] attribute -!deprecated-attribute-missing! NSCollectionViewDelegate::collectionView:writeItemsAtIndexPaths:toPasteboard: missing a [Deprecated] attribute -!deprecated-attribute-missing! NSOutlineViewDataSource::outlineView:writeItems:toPasteboard: missing a [Deprecated] attribute -!deprecated-attribute-missing! NSTableViewDataSource::tableView:writeRowsWithIndexes:toPasteboard: missing a [Deprecated] attribute !missing-protocol! NSSharingServicePickerToolbarItemDelegate not bound !missing-selector! NSSharingServicePickerToolbarItem::delegate not bound !missing-selector! NSSharingServicePickerToolbarItem::setDelegate: not bound From b16f41abd0a04163e8da49a7cf7a87f9c36de37e Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 15 Oct 2019 23:50:42 +0200 Subject: [PATCH 007/100] [linker] Ensure we can remove NSUrlSessionHandler if unused (#7164) Moving `NSUrlSessionHandler` into the platform assemblies (e.g. Xamarin.iOS.dll) instead of System.Net.Http.dll was not optimal as it prevented the linker to remove it when the application did not use it. This shows a lot in an "helloworld" type of application (see below) but in real life most of the removed code gets used by something else (and is included. ``` Directories / Files helloworld-d16-4.app helloworld-fixed.app diff % ./ AppIcon60x60@2x.png 2,632 2,632 0 0.00 % AppIcon76x76@2x~ipad.png 3,125 3,125 0 0.00 % archived-expanded-entitlements.xcent 181 181 0 0.00 % Assets.car 75,688 75,688 0 0.00 % embedded.mobileprovision 8,456 8,456 0 0.00 % helloworld 4,700,256 3,915,936 -784,320 -16.69 % helloworld.aotdata.arm64 1,448 1,432 -16 -1.10 % helloworld.exe 6,144 6,144 0 0.00 % Info.plist 1,712 1,712 0 0.00 % mscorlib.aotdata.arm64 406,080 364,104 -41,976 -10.34 % mscorlib.dll 561,664 501,760 -59,904 -10.67 % NOTICE 159 159 0 0.00 % PkgInfo 8 8 0 0.00 % System.aotdata.arm64 17,008 936 -16,072 -94.50 % System.Core.aotdata.arm64 2,432 0 -2,432 -100.00 % System.Core.dll 4,608 0 -4,608 -100.00 % System.dll 32,768 5,120 -27,648 -84.38 % System.Net.Http.aotdata.arm64 31,648 0 -31,648 -100.00 % System.Net.Http.dll 29,184 0 -29,184 -100.00 % Xamarin.iOS.aotdata.arm64 62,544 33,464 -29,080 -46.50 % Xamarin.iOS.dll 92,672 53,248 -39,424 -42.54 % ./_CodeSignature CodeResources 7,575 6,655 -920 -12.15 % ./LaunchScreen.storyboardc 01J-lp-oVM-view-Ze5-6b-2t3.nib 1,831 1,835 4 0.22 % Info.plist 258 258 0 0.00 % UIViewController-01J-lp-oVM.nib 896 896 0 0.00 % ./Main.storyboardc BYZ-38-t0r-view-8bC-Xf-vdC.nib 1,836 1,832 -4 -0.22 % Info.plist 258 258 0 0.00 % UIViewController-BYZ-38-t0r.nib 916 916 0 0.00 % Statistics Native subtotal 4,700,256 3,915,936 -784,320 -16.69 % Executable 4,700,256 3,915,936 -784,320 -16.69 % AOT data *.aotdata 0 0 0 - Managed *.dll/exe 727,040 566,272 -160,768 -22.11 % TOTAL 6,053,987 4,986,755 -1,067,232 -17.63 % ``` --- src/Foundation/NSUrlSessionHandler.cs | 16 ++++++---------- src/ObjCRuntime/RuntimeOptions.cs | 1 - tools/linker/MarkNSObjects.cs | 4 +--- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/Foundation/NSUrlSessionHandler.cs b/src/Foundation/NSUrlSessionHandler.cs index b559c2f8fa..20bb46b6f5 100644 --- a/src/Foundation/NSUrlSessionHandler.cs +++ b/src/Foundation/NSUrlSessionHandler.cs @@ -459,8 +459,6 @@ namespace Foundation { return await tcs.Task.ConfigureAwait (false); } - // Needed since we strip during linking since we're inside a product assembly. - [Preserve (AllMembers = true)] partial class NSUrlSessionHandlerDelegate : NSUrlSessionDataDelegate { readonly NSUrlSessionHandler sessionHandler; @@ -487,6 +485,7 @@ namespace Foundation { return null; } + [Preserve (Conditional = true)] public override void DidReceiveResponse (NSUrlSession session, NSUrlSessionDataTask dataTask, NSUrlResponse response, Action completionHandler) { var inflight = GetInflightData (dataTask); @@ -549,6 +548,7 @@ namespace Foundation { completionHandler (NSUrlSessionResponseDisposition.Allow); } + [Preserve (Conditional = true)] public override void DidReceiveData (NSUrlSession session, NSUrlSessionDataTask dataTask, NSData data) { var inflight = GetInflightData (dataTask); @@ -560,6 +560,7 @@ namespace Foundation { SetResponse (inflight); } + [Preserve (Conditional = true)] public override void DidCompleteWithError (NSUrlSession session, NSUrlSessionTask task, NSError error) { var inflight = GetInflightData (task); @@ -608,16 +609,19 @@ namespace Foundation { } } + [Preserve (Conditional = true)] public override void WillCacheResponse (NSUrlSession session, NSUrlSessionDataTask dataTask, NSCachedUrlResponse proposedResponse, Action completionHandler) { completionHandler (sessionHandler.DisableCaching ? null : proposedResponse); } + [Preserve (Conditional = true)] public override void WillPerformHttpRedirection (NSUrlSession session, NSUrlSessionTask task, NSHttpUrlResponse response, NSUrlRequest newRequest, Action completionHandler) { completionHandler (sessionHandler.AllowAutoRedirect ? newRequest : null); } + [Preserve (Conditional = true)] public override void DidReceiveChallenge (NSUrlSession session, NSUrlSessionTask task, NSUrlAuthenticationChallenge challenge, Action completionHandler) { var inflight = GetInflightData (task); @@ -705,8 +709,6 @@ namespace Foundation { } } - // Needed since we strip during linking since we're inside a product assembly. - [Preserve (AllMembers = true)] class InflightData : IDisposable { public readonly object Lock = new object (); @@ -745,8 +747,6 @@ namespace Foundation { } - // Needed since we strip during linking since we're inside a product assembly. - [Preserve (AllMembers = true)] class NSUrlSessionDataTaskStreamContent : MonoStreamContent { Action disposed; @@ -857,8 +857,6 @@ namespace Foundation { } } - // Needed since we strip during linking since we're inside a product assembly. - [Preserve (AllMembers = true)] class NSUrlSessionDataTaskStream : Stream { readonly Queue data; @@ -1004,8 +1002,6 @@ namespace Foundation { } } - // Needed since we strip during linking since we're inside a product assembly. - [Preserve (AllMembers = true)] class WrappedNSInputStream : NSInputStream { NSStreamStatus status; diff --git a/src/ObjCRuntime/RuntimeOptions.cs b/src/ObjCRuntime/RuntimeOptions.cs index 0be4980ca7..bbcbaecb8d 100644 --- a/src/ObjCRuntime/RuntimeOptions.cs +++ b/src/ObjCRuntime/RuntimeOptions.cs @@ -150,7 +150,6 @@ namespace ObjCRuntime { } } - [Preserve] // always present but re-written by the linker internal static HttpMessageHandler GetHttpMessageHandler () { var options = RuntimeOptions.Read (); diff --git a/tools/linker/MarkNSObjects.cs b/tools/linker/MarkNSObjects.cs index eca84e849f..af4c10942f 100644 --- a/tools/linker/MarkNSObjects.cs +++ b/tools/linker/MarkNSObjects.cs @@ -29,7 +29,6 @@ // using System; -using System.Collections.Generic; using Mono.Cecil; using Mono.Linker; @@ -154,8 +153,7 @@ namespace Xamarin.Linker.Steps { static bool IsProductType (TypeDefinition type) { - var name = type.Module.Assembly.Name.Name; - return name == ProductAssembly || name == "System.Net.Http"; + return type.Module.Assembly.Name.Name == ProductAssembly; } } } From 08acbf3dccfad1d7e751ea747f5a16d06608ae47 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 15 Oct 2019 23:50:59 +0200 Subject: [PATCH 008/100] Fix version numbers in FrameworkList.xml files (#7162) The existing test only checked that an assembly was mentioned in the file, but not that its version etc matches. Updated the test and fixed the differences. --- .../Xamarin.Mac-Full-FrameworkList.xml.in | 2 +- .../Xamarin.Mac-Mobile-FrameworkList.xml.in | 4 ++-- .../Xamarin.TVOS-FrameworkList.xml.in | 2 +- .../Xamarin.WatchOS-FrameworkList.xml.in | 2 +- .../Xamarin.iOS-FrameworkList.xml.in | 2 +- .../tests/Xamarin.iOS.Tasks.Tests/FrameworkListTest.cs | 10 ++++++++++ 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac-Full-FrameworkList.xml.in b/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac-Full-FrameworkList.xml.in index 17b1b2189a..a97f464247 100644 --- a/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac-Full-FrameworkList.xml.in +++ b/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac-Full-FrameworkList.xml.in @@ -187,5 +187,5 @@ - + \ No newline at end of file diff --git a/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac-Mobile-FrameworkList.xml.in b/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac-Mobile-FrameworkList.xml.in index a874bd7167..47ddc8075a 100644 --- a/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac-Mobile-FrameworkList.xml.in +++ b/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac-Mobile-FrameworkList.xml.in @@ -17,7 +17,7 @@ - + @@ -186,5 +186,5 @@ - + \ No newline at end of file diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.TVOS-FrameworkList.xml.in b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.TVOS-FrameworkList.xml.in index 11d2f85801..8d36f0df4c 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.TVOS-FrameworkList.xml.in +++ b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.TVOS-FrameworkList.xml.in @@ -187,5 +187,5 @@ - + diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.WatchOS-FrameworkList.xml.in b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.WatchOS-FrameworkList.xml.in index 9f312e1cbe..70834044bd 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.WatchOS-FrameworkList.xml.in +++ b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.WatchOS-FrameworkList.xml.in @@ -183,5 +183,5 @@ - + diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS-FrameworkList.xml.in b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS-FrameworkList.xml.in index aacc7ed8cd..dc6926755d 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS-FrameworkList.xml.in +++ b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS-FrameworkList.xml.in @@ -187,5 +187,5 @@ - + diff --git a/msbuild/tests/Xamarin.iOS.Tasks.Tests/FrameworkListTest.cs b/msbuild/tests/Xamarin.iOS.Tasks.Tests/FrameworkListTest.cs index 3f796f6b6e..c1ff5f2dc1 100644 --- a/msbuild/tests/Xamarin.iOS.Tasks.Tests/FrameworkListTest.cs +++ b/msbuild/tests/Xamarin.iOS.Tasks.Tests/FrameworkListTest.cs @@ -35,6 +35,8 @@ namespace Xamarin.iOS.Tasks foreach (var assembly in installedAssemblies) { if (!frameworkListAssemblies.Any (a => a.Name == assembly.Name)) ReportAssemblies (assembly, $"One or more assemblies in the the SDK root folder are not listed in '{frameworkListFile}'. Update the list if an assembly was intentionally added."); + else if (!frameworkListAssemblies.Single (a => a.Name == assembly.Name).Equals (assembly)) + ReportAssemblies (assembly, $"One or more assemblies in the the SDK root folder do not match the entry in '{frameworkListFile}'. Update the list if an assembly was intentionally modified."); } } @@ -158,5 +160,13 @@ namespace Xamarin.iOS.Tasks if (j == -1) j = fn.Length; PublicKeyToken = fn.Substring (i, j - i); } + + public bool Equals (AssemblyInfo other) { + // ignore Culture and InGac for equality since those are not mentioned in the FrameworkList.xml + return other.Name == this.Name && + other.Version == this.Version && + other.PublicKeyToken == this.PublicKeyToken && + other.ProcessorArchitecture == this.ProcessorArchitecture; + } } } From 1d88f13be62e9a4da3ae327f17a6e13b7432ebf9 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 16 Oct 2019 08:01:55 +0200 Subject: [PATCH 009/100] Fix a few introspection issues on Catalina. (#7212) * [SceneKit] Adjust deprecation message. Fixes this introspection failure: [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Type: SCNLayer [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: get_OpenGLContext, Type: SCNView [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: set_OpenGLContext, Type: SCNView [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: get_PixelFormat, Type: SCNView [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: set_PixelFormat, Type: SCNView * [tests] Fix introspection and xammac tests on Catalina. (#7200) * [tests] Adjust NaturalLanguage.EmbeddingTest to cope with non-existent embeddings. Fixes xamarin/maccore#2011. Fixes https://github.com/xamarin/maccore/issues/2011. * [tests] Fix typo test on macOS 10.15. Fixes #7116. Fixes https://github.com/xamarin/xamarin-macios/issues/7116. * [introspection] Ignore MTLCounterSampleBufferDescriptor's selectors. They're implemented using a different/internal type: $ nm /System/Library/Frameworks/Metal.framework/Metal | grep MTLCounterSampleBuffer 00000000000458ab t +[MTLCounterSampleBufferDescriptor allocWithZone:] 0000000000045897 t +[MTLCounterSampleBufferDescriptor alloc] 000000000004591e t -[MTLCounterSampleBufferDescriptor copyWithZone:] 000000000004598e t -[MTLCounterSampleBufferDescriptorInternal copyWithZone:] 0000000000045c0f t -[MTLCounterSampleBufferDescriptorInternal counterSet] 0000000000045936 t -[MTLCounterSampleBufferDescriptorInternal dealloc] 0000000000045b65 t -[MTLCounterSampleBufferDescriptorInternal hash] 0000000000045a31 t -[MTLCounterSampleBufferDescriptorInternal isEqual:] 0000000000045c58 t -[MTLCounterSampleBufferDescriptorInternal label] 0000000000045c7f t -[MTLCounterSampleBufferDescriptorInternal sampleCount] 0000000000045c25 t -[MTLCounterSampleBufferDescriptorInternal setCounterSet:] 0000000000045c6e t -[MTLCounterSampleBufferDescriptorInternal setLabel:] 0000000000045c90 t -[MTLCounterSampleBufferDescriptorInternal setSampleCount:] 0000000000045c47 t -[MTLCounterSampleBufferDescriptorInternal setStorageMode:] 0000000000045c36 t -[MTLCounterSampleBufferDescriptorInternal storageMode] 000000000010b0b8 S _OBJC_CLASS_$_MTLCounterSampleBufferDescriptor 000000000010b0e0 S _OBJC_CLASS_$_MTLCounterSampleBufferDescriptorInternal 0000000000107070 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._counterSet 0000000000107078 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._label 0000000000107088 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._sampleCount 0000000000107080 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._storageMode 000000000010b108 S _OBJC_METACLASS_$_MTLCounterSampleBufferDescriptor 000000000010b130 S _OBJC_METACLASS_$_MTLCounterSampleBufferDescriptorInternal Fixes these test failures: 1) ApiSelectorTest.InstanceMethods (Introspection.MacApiSelectorTest.ApiSelectorTest.InstanceMethods) 8 errors found in 26658 instance selector validated: Selector not found for Metal.MTLCounterSampleBufferDescriptor : counterSet Selector not found for Metal.MTLCounterSampleBufferDescriptor : setCounterSet: Selector not found for Metal.MTLCounterSampleBufferDescriptor : label Selector not found for Metal.MTLCounterSampleBufferDescriptor : setLabel: Selector not found for Metal.MTLCounterSampleBufferDescriptor : sampleCount Selector not found for Metal.MTLCounterSampleBufferDescriptor : setSampleCount: Selector not found for Metal.MTLCounterSampleBufferDescriptor : storageMode Selector not found for Metal.MTLCounterSampleBufferDescriptor : setStorageMode: * [introspection] Ignore some API we've bound incorrectly. Fixes #7116. There are also a few API fixes, those will be submitted in a different PR. Fixes https://github.com/xamarin/xamarin-macios/issues/7116. --- src/AppKit/Enums.cs | 4 ++++ src/scenekit.cs | 10 +++++----- tests/introspection/ApiProtocolTest.cs | 6 ++++++ tests/introspection/ApiTypoTest.cs | 4 ++++ tests/introspection/Mac/MacApiSelectorTest.cs | 8 ++++++++ .../NaturalLanguage/EmbeddingTest.cs | 17 ++++++++++++----- 6 files changed, 39 insertions(+), 10 deletions(-) diff --git a/src/AppKit/Enums.cs b/src/AppKit/Enums.cs index b82778ba90..16013bf99e 100644 --- a/src/AppKit/Enums.cs +++ b/src/AppKit/Enums.cs @@ -2198,7 +2198,11 @@ namespace AppKit { GenericPreferencesIcon = 0x70726566, //'pref' GenericQueryDocumentIcon = 0x71657279, //'qery' GenericRamDiskIcon = 0x72616D64, //'ramd' +#if !XAMCORE_4_0 + [Obsolete ("Use 'GenericSharedLibraryIcon' instead.")] GenericSharedLibaryIcon = 0x73686C62, //'shlb' +#endif + GenericSharedLibraryIcon = 0x73686C62, //'shlb' GenericStationeryIcon = 0x73646F63, //'sdoc' GenericSuitcaseIcon = 0x73756974, //'suit' GenericUrlIcon = 0x6775726C, //'gurl' diff --git a/src/scenekit.cs b/src/scenekit.cs index 5378eb9ded..b9c4d4538b 100644 --- a/src/scenekit.cs +++ b/src/scenekit.cs @@ -1213,7 +1213,7 @@ namespace SceneKit { #if MONOMAC [iOS (8,0)] - [Deprecated (PlatformName.MacOSX, 10, 14, message: "OpenGL API deprecated, please use Metal instead.")] + [Deprecated (PlatformName.MacOSX, 10, 14, message: "Please use Metal instead of OpenGL API.")] [Unavailable (PlatformName.MacCatalyst)][Advice ("This API is not available when using UIKit on macOS.")] [BaseType (typeof (CAOpenGLLayer))] interface SCNLayer : SCNSceneRenderer, SCNTechniqueSupport { @@ -3507,16 +3507,16 @@ namespace SceneKit { bool AllowsCameraControl { get; set; } #if MONOMAC - [Deprecated (PlatformName.MacOSX, 10, 14, message: "OpenGL API deprecated, please use Metal instead.")] + [Deprecated (PlatformName.MacOSX, 10, 14, message: "Please use Metal instead of OpenGL API.")] [Export ("openGLContext", ArgumentSemantic.Retain)] NSOpenGLContext OpenGLContext { get; set; } - [Deprecated (PlatformName.MacOSX, 10, 14, message: "OpenGL API deprecated, please use Metal instead.")] + [Deprecated (PlatformName.MacOSX, 10, 14, message: "Please use Metal instead of OpenGL API.")] [Export ("pixelFormat", ArgumentSemantic.Retain)] NSOpenGLPixelFormat PixelFormat { get; set; } #elif !WATCH - [Deprecated (PlatformName.iOS, 12, 0, message: "OpenGL API deprecated, please use Metal instead.")] - [Deprecated (PlatformName.TvOS, 12, 0, message: "OpenGL API deprecated, please use Metal instead.")] + [Deprecated (PlatformName.iOS, 12, 0, message: "Please use Metal instead of OpenGL API.")] + [Deprecated (PlatformName.TvOS, 12, 0, message: "Please use Metal instead of OpenGL API.")] [Export ("eaglContext", ArgumentSemantic.Retain)] #if XAMCORE_2_0 EAGLContext EAGLContext { get; set; } diff --git a/tests/introspection/ApiProtocolTest.cs b/tests/introspection/ApiProtocolTest.cs index 19ccc112d5..c0a4217b14 100644 --- a/tests/introspection/ApiProtocolTest.cs +++ b/tests/introspection/ApiProtocolTest.cs @@ -299,6 +299,12 @@ namespace Introspection { break; } break; +#if !XAMCORE_4_0 + case "MTLCounter": + case "MTLCounterSampleBuffer": + case "MTLCounterSet": + return true; // Incorrectly bound, will be fixed for XAMCORE_4_0. +#endif } return false; } diff --git a/tests/introspection/ApiTypoTest.cs b/tests/introspection/ApiTypoTest.cs index aad09889cd..16cb357aab 100644 --- a/tests/introspection/ApiTypoTest.cs +++ b/tests/introspection/ApiTypoTest.cs @@ -145,6 +145,7 @@ namespace Introspection "Cartes", // french "Cavlc", "Cda", // acronym: Clinical Document Architecture + "Cdrom", "Cfa", // acronym: Color Filter Array "Celp", // MPEG4ObjectID "Characterteristic", @@ -386,6 +387,7 @@ namespace Introspection "nint", "Nntps", "Ntlm", + "Nsl", // InternetLocationNslNeighborhoodIcon "Ntsc", "nuint", "Ndef", @@ -436,6 +438,7 @@ namespace Introspection "Prerolls", "Preseti", "Prev", + "Privs", // SharingPrivsNotApplicableIcon "Propogate", "Psec", "Psm", // Protocol/Service Multiplexer @@ -864,6 +867,7 @@ namespace Introspection "Attributest", "Failwith", "Imageimage", + "Libary", "Musthold", "Olus", // Typo, should be 'Bolus', fixed in 'HKInsulinDeliveryReason' "Ostprandial", // Typo, should be 'Postprandial', fixed in 'HKBloodGlucoseMealTime' diff --git a/tests/introspection/Mac/MacApiSelectorTest.cs b/tests/introspection/Mac/MacApiSelectorTest.cs index 9a6663d692..76601a62f3 100644 --- a/tests/introspection/Mac/MacApiSelectorTest.cs +++ b/tests/introspection/Mac/MacApiSelectorTest.cs @@ -694,6 +694,14 @@ namespace Introspection { break; } break; + case "Metal": + switch (type.Name) { + case "MTLCounterSampleBufferDescriptor": + // This whole type is implemented using a different (internal) type, + // and it's the internal type who knows how to respond to the selectors. + return true; + } + break; } return base.Skip (type, selectorName); } diff --git a/tests/monotouch-test/NaturalLanguage/EmbeddingTest.cs b/tests/monotouch-test/NaturalLanguage/EmbeddingTest.cs index b24eb902da..465e10a82f 100644 --- a/tests/monotouch-test/NaturalLanguage/EmbeddingTest.cs +++ b/tests/monotouch-test/NaturalLanguage/EmbeddingTest.cs @@ -22,11 +22,18 @@ namespace MonoTouchFixtures.NaturalLanguage { { TestRuntime.AssertXcodeVersion (11, 0); - using (var e = NLEmbedding.GetWordEmbedding (NLLanguage.English)) { - Assert.NotNull (e, "GetWordEmbedding"); - Assert.Null (e.GetVector ("Xamarin"), "GetVector"); - Assert.False (e.TryGetVector ("Xamarin", out var vector), "TryGetVector"); - Assert.Null (vector, "vector"); + foreach (NLLanguage v in Enum.GetValues (typeof (NLLanguage))) { + if (v == NLLanguage.Unevaluated) + continue; // this is not a value provided by Apple. + + NLEmbedding e = null; + Assert.DoesNotThrow (() => e = NLEmbedding.GetWordEmbedding (v), $"Throws: {v}"); + if (e != null) { + Assert.NotNull (e, "GetWordEmbedding"); + Assert.Null (e.GetVector ("Xamarin"), "GetVector"); + Assert.False (e.TryGetVector ("Xamarin", out var vector), "TryGetVector"); + Assert.Null (vector, "vector"); + } } } #endif From a50c753117962a3dcaaed2c1ead4076f65056b10 Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Wed, 16 Oct 2019 09:16:32 -0400 Subject: [PATCH 010/100] [coreimage] Update for Xcode 11[.2] (#7216) Apple decided to expose most (but not all) `CIFilter` using protocols (instead of weakly named dictionaries). Most of this maps well with our strong bindings but there are cases where we: * missing some properties (easy, there were added); or * used a different types [1] and that requires new members / obsoletion A few other API were also added in Xcode 11 (nothing in 11.1 or 11.2) and included in this PR. New introspection tests were also added to minimize the risk that the API and generator changes produced incorrect code. This lead to the finding of some missing API (in particular `Output*` properties) that were added. [1] Often ours are better (using `float` for a `bool` value is not optimal) but we do not have `[BindAs]` for protocols :( to _fix_ them Note: this replace draft PR https://github.com/xamarin/xamarin-macios/pull/7120 but it's has quite a bit of changes in filter generation (inlining protocols) and that affected bindings too. --- docs/website/generator-errors.md | 29 + src/CoreImage/CIContext.cs | 10 + src/CoreImage/CIFilter.cs | 99 +- src/ImageIO/CGImageSource.cs | 11 +- src/coreimage.cs | 4506 ++++++++++++++--- src/frameworks.sources | 4 +- src/generator-filters.cs | 137 +- src/generator-typemanager.cs | 2 + src/generator.cs | 13 +- .../introspection/ApiCoreImageFiltersTest.cs | 308 ++ tests/introspection/ApiTypoTest.cs | 1 + tests/xtro-sharpie/common-CoreImage.ignore | 185 + tests/xtro-sharpie/iOS-CoreImage.todo | 358 -- tests/xtro-sharpie/macOS-CoreImage.todo | 360 -- tests/xtro-sharpie/tvOS-CoreImage.todo | 358 -- tools/common/StaticRegistrar.cs | 7 +- 16 files changed, 4408 insertions(+), 1980 deletions(-) delete mode 100644 tests/xtro-sharpie/iOS-CoreImage.todo delete mode 100644 tests/xtro-sharpie/macOS-CoreImage.todo delete mode 100644 tests/xtro-sharpie/tvOS-CoreImage.todo diff --git a/docs/website/generator-errors.md b/docs/website/generator-errors.md index 3349efe205..28e5ba6d41 100644 --- a/docs/website/generator-errors.md +++ b/docs/website/generator-errors.md @@ -212,6 +212,35 @@ This usually indicates a bug in Xamarin.iOS/Xamarin.Mac; please [file a bug repo ### BI1070: The type '{type}' is trying to inline the property '{property}' from the protocols '{protocol1}' and '{protocol2}', but the inlined properties are of different types ('{property1}' is int, while '{property2}' is int). + + +### BI1072: Missing [CoreImageFilterProperty] attribute on {type} property {name} + +This error happens when a binding type, decorated with `[CoreImageFilter]` attribute, has properties that are not decorated with a `[CoreImageFilterProperty]` attribute. E.g. + +```csharp +[CoreImageFilter] +[BaseType (typeof (CIFilter))] +interface CICustomFilter { + + CGAffineTransform Transform { get; } +} +``` + +To solve this error you need to tell the `CIFilter` key that you want to map to the property, e.g. + +```csharp +[CoreImageFilter] +[BaseType (typeof (CIFilter))] +interface CICustomFilter { + + [CoreImageFilterProperty ("inputTransform")] + CGAffineTransform Transform { get; } +} +``` + +If the property is inlined from a protocol then the `[Export]` value, prefixed with `input`, will be used by default. You can override this with by adding the `[CoreImageFilterProperty]` attribute (e.g. for `output*` keys). + # BI11xx: warnings diff --git a/src/CoreImage/CIContext.cs b/src/CoreImage/CIContext.cs index 38db2e4ecf..789ebd7400 100644 --- a/src/CoreImage/CIContext.cs +++ b/src/CoreImage/CIContext.cs @@ -119,6 +119,16 @@ namespace CoreImage { SetBooleanValue (CIContext.CacheIntermediates, value); } } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + public bool? AllowLowPower { + get { + return GetBoolValue (CIContext.AllowLowPower); + } + set { + SetBooleanValue (CIContext.AllowLowPower, value); + } + } } public partial class CIContext { diff --git a/src/CoreImage/CIFilter.cs b/src/CoreImage/CIFilter.cs index a8694c644c..255ee556db 100644 --- a/src/CoreImage/CIFilter.cs +++ b/src/CoreImage/CIFilter.cs @@ -173,40 +173,59 @@ namespace CoreImage { SetValueForKey (new NSNumber (value), nskey); } + internal void SetNInt (string key, nint value) + { + using (var nskey = new NSString (key)) + SetValueForKey (new NSNumber (value), nskey); + } + internal void SetBool (string key, bool value) { using (var nskey = new NSString (key)) SetValueForKey (new NSNumber (value ? 1 : 0), nskey); } + internal void SetValue (string key, CGPoint value) + { + using (var nskey = new NSString (key)) + using (var nsv = new CIVector (value.X, value.Y)) { + SetValueForKey (nsv, nskey); + } + } + + internal void SetValue (string key, CGRect value) + { + using (var nskey = new NSString (key)) + using (var nsv = new CIVector (value.X, value.Y, value.Width, value.Height)) { + SetValueForKey (nsv, nskey); + } + } + + internal T Get (string key) where T : class + { + using (var nskey = new NSString (key)) { + return ValueForKey (nskey) as T; + } + } + internal float GetFloat (string key) { - using (var nskey = new NSString (key)){ - var v = ValueForKey (nskey); - if (v is NSNumber) - return (v as NSNumber).FloatValue; - return 0; - } + return Get (key)?.FloatValue ?? default (float); } internal int GetInt (string key) { - using (var nskey = new NSString (key)){ - var v = ValueForKey (nskey); - if (v is NSNumber) - return (v as NSNumber).Int32Value; - return 0; - } + return Get (key)?.Int32Value ?? default (int); + } + + internal nint GetNInt (string key) + { + return Get (key)?.NIntValue ?? default (nint); } internal bool GetBool (string key) { - using (var nskey = new NSString (key)){ - var v = ValueForKey (nskey); - if (v is NSNumber) - return (v as NSNumber).BoolValue; - return false; - } + return Get (key)?.BoolValue ?? default (bool); } internal void SetHandle (string key, IntPtr handle) @@ -237,31 +256,16 @@ namespace CoreImage { return ret; } - - internal CIVector GetVector (string key) + internal CGPoint GetPoint (string key) { - return ValueForKey (key) as CIVector; + var v = Get (key); + return v != null ? new CGPoint (v.X, v.Y) : default (CGPoint); } - internal CIColor GetColor (string key) + internal CGRect GetRect (string key) { - return ValueForKey (key) as CIColor; - } - - internal CIImage GetInputImage () - { - return ValueForKey (CIFilterInputKey.Image) as CIImage; - } - - internal void SetInputImage (CIImage value) - { - SetValueForKey (value, CIFilterInputKey.Image); - } - - internal CIImage GetImage (string key) - { - using (var nsstr = new NSString (key)) - return ValueForKey (nsstr) as CIImage; + var v = Get (key); + return v != null ? new CGRect (v.X, v.Y, v.Z, v.W) : default (CGRect); } #if MONOMAC @@ -673,29 +677,32 @@ namespace CoreImage { } } +#if !XAMCORE_4_0 // not every CIFilter supports inputImage, i.e. // NSUnknownKeyException [ valueForUndefinedKey:]: this class is not key value coding-compliant for the key inputImage. // and those will crash (on devices) if the property is called - and that includes displaying it in the debugger + [Obsolete ("Use 'InputImage' instead. If not available then the filter does not support it.")] public CIImage Image { get { - return SupportsInputImage ? GetInputImage () : null; + return SupportsInputImage ? ValueForKey (CIFilterInputKey.Image) as CIImage : null; } set { if (!SupportsInputImage) throw new ArgumentException ("inputImage is not supported by this filter"); - SetInputImage (value); + SetValueForKey (value, CIFilterInputKey.Image); } } + bool? supportsInputImage; + bool SupportsInputImage { get { - foreach (var key in InputKeys) { - if (key == "inputImage") - return true; - } - return false; + if (!supportsInputImage.HasValue) + supportsInputImage = Array.IndexOf (InputKeys, "inputImage") >= 0; + return supportsInputImage.Value; } } +#endif } #if MONOMAC && !XAMCORE_3_0 diff --git a/src/ImageIO/CGImageSource.cs b/src/ImageIO/CGImageSource.cs index eb3cda6fe7..a97d9a00fc 100644 --- a/src/ImageIO/CGImageSource.cs +++ b/src/ImageIO/CGImageSource.cs @@ -37,6 +37,7 @@ using CoreGraphics; namespace ImageIO { +#if !COREBUILD // untyped enum -> CGImageSource.h public enum CGImageSourceStatus { Complete = 0, @@ -109,9 +110,11 @@ namespace ImageIO { return dict; } } - +#endif + public partial class CGImageSource : INativeObject, IDisposable { +#if !COREBUILD [DllImport (Constants.ImageIOLibrary, EntryPoint="CGImageSourceGetTypeID")] public extern static nint GetTypeID (); @@ -126,7 +129,7 @@ namespace ImageIO { return array; } } - +#endif internal IntPtr handle; // invoked by marshallers @@ -165,7 +168,8 @@ namespace ImageIO { handle = IntPtr.Zero; } } - + +#if !COREBUILD [DllImport (Constants.ImageIOLibrary)] extern static /* CGImageSourceRef __nullable */ IntPtr CGImageSourceCreateWithURL ( /* CFURLRef __nonnull */ IntPtr url, /* CFDictionaryRef __nullable */ IntPtr options); @@ -403,5 +407,6 @@ namespace ImageIO { { return CGImageSourceGetPrimaryImageIndex (handle); } +#endif } } diff --git a/src/coreimage.cs b/src/coreimage.cs index d5597a5c01..f828bc6e80 100644 --- a/src/coreimage.cs +++ b/src/coreimage.cs @@ -353,6 +353,11 @@ namespace CoreImage { [Field ("kCIContextHighQualityDownsample", "+CoreImage")] NSString HighQualityDownsample { get; } + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Internal] + [Field ("kCIContextAllowLowPower")] + NSString AllowLowPower { get; } + #if MONOMAC [Mac(10,11)] @@ -386,6 +391,16 @@ namespace CoreImage { [Internal] [Field ("kCIContextCacheIntermediates", "+CoreImage")] NSString CacheIntermediates { get; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Static] + [Export ("contextWithMTLCommandQueue:")] + CIContext Create (IMTLCommandQueue commandQueue); + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Static] + [Export ("contextWithMTLCommandQueue:options:")] + CIContext Create (IMTLCommandQueue commandQueue, [NullAllowed] NSDictionary options); } [Category] @@ -487,6 +502,11 @@ namespace CoreImage { [Export ("depthBlurEffectFilterForImage:disparityImage:portraitEffectsMatte:orientation:options:")] [return: NullAllowed] CIFilter GetDepthBlurEffectFilter (CIImage image, CIImage disparityImage, [NullAllowed] CIImage portraitEffectsMatte, CGImagePropertyOrientation orientation, [NullAllowed] NSDictionary options); + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Export ("depthBlurEffectFilterForImage:disparityImage:portraitEffectsMatte:hairSemanticSegmentation:orientation:options:")] + [return: NullAllowed] + CIFilter GetDepthBlurEffectFilter (CIImage image, CIImage disparityImage, [NullAllowed] CIImage portraitEffectsMatte, [NullAllowed] CIImage hairSemanticSegmentation, CGImagePropertyOrientation orientation, [NullAllowed] NSDictionary options); } [BaseType (typeof (NSObject))] @@ -736,6 +756,10 @@ namespace CoreImage { [Field ("kCIInputLinearSpaceFilter")] NSString LinearSpaceFilterKey { get; } + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Field ("kCIInputEnableEDRModeKey")] + NSString EnableEdrModeKey { get; } + [iOS (10,0)] [Field ("kCIOutputNativeSizeKey")] NSString OutputNativeSizeKey { get; } @@ -1141,13 +1165,10 @@ namespace CoreImage { NSString FilterGenerator { get; } } - interface ICIFilterConstructor {} - [iOS (9,0)] [Protocol] interface CIFilterConstructor { - // @required -(CIFilter * __nullable)filterWithName:(NSString * __nonnull)name; [Abstract] [Export ("filterWithName:")] [return: NullAllowed] @@ -1297,7 +1318,16 @@ namespace CoreImage { bool AuxiliaryDisparity { get; set; } [TV (12, 0), iOS (12, 0), Mac (10, 14)] - bool AuxiliaryPortraitEffectsMatte { get; } + bool AuxiliaryPortraitEffectsMatte { get; set; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + bool AuxiliarySemanticSegmentationSkinMatte { get; set; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + bool AuxiliarySemanticSegmentationHairMatte { get; set; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + bool AuxiliarySemanticSegmentationTeethMatte { get; set; } } [Internal] @@ -1328,6 +1358,18 @@ namespace CoreImage { [TV (12, 0), iOS (12, 0), Mac (10, 14)] [Field ("kCIImageAuxiliaryPortraitEffectsMatte")] NSString AuxiliaryPortraitEffectsMatteKey { get; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Field ("kCIImageAuxiliarySemanticSegmentationSkinMatte")] + NSString AuxiliarySemanticSegmentationSkinMatteKey { get; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Field ("kCIImageAuxiliarySemanticSegmentationHairMatte")] + NSString AuxiliarySemanticSegmentationHairMatteKey { get; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Field ("kCIImageAuxiliarySemanticSegmentationTeethMatte")] + NSString AuxiliarySemanticSegmentationTeethMatteKey { get; } } [BaseType (typeof (NSObject))] @@ -1343,9 +1385,20 @@ namespace CoreImage { CIImage FromCGImage (CGImage image, [NullAllowed] NSDictionary d); [Static] - [Wrap ("FromCGImage (image, options == null ? null : options.Dictionary)")] + [Wrap ("FromCGImage (image, options?.Dictionary)")] CIImage FromCGImage (CGImage image, [NullAllowed] CIImageInitializationOptionsWithMetadata options); + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [EditorBrowsable (EditorBrowsableState.Advanced)] + [Static] + [Export ("imageWithCGImageSource:index:options:")] + CIImage FromCGImageSource (CGImageSource source, nuint index, [NullAllowed] NSDictionary options); + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Static] + [Wrap ("FromCGImageSource (source, index, options?.Dictionary)")] + CIImage FromCGImageSource (CGImageSource source, nuint index, [NullAllowed] CIImageInitializationOptionsWithMetadata options); + #if MONOMAC [Deprecated (PlatformName.MacOSX, 10, 11)] [Static] @@ -1383,7 +1436,7 @@ namespace CoreImage { CIImage FromUrl (NSUrl url, [NullAllowed] NSDictionary d); [Static] - [Wrap ("FromUrl (url, options == null ? null : options.Dictionary)")] + [Wrap ("FromUrl (url, options?.Dictionary)")] CIImage FromUrl (NSUrl url, [NullAllowed] CIImageInitializationOptions options); [Static] @@ -1396,7 +1449,7 @@ namespace CoreImage { CIImage FromData (NSData data, [NullAllowed] NSDictionary d); [Static] - [Wrap ("FromData (data, options == null ? null : options.Dictionary)")] + [Wrap ("FromData (data, options?.Dictionary)")] CIImage FromData (NSData data, [NullAllowed] CIImageInitializationOptionsWithMetadata options); [Static] @@ -1426,7 +1479,7 @@ namespace CoreImage { #endif [Static][iOS(9,0)] - [Wrap ("FromImageBuffer (imageBuffer, options == null ? null : options.Dictionary)")] + [Wrap ("FromImageBuffer (imageBuffer, options?.Dictionary)")] CIImage FromImageBuffer (CVImageBuffer imageBuffer, CIImageInitializationOptions options); #if !MONOMAC @@ -1440,7 +1493,7 @@ namespace CoreImage { CIImage FromImageBuffer (CVPixelBuffer buffer, [NullAllowed] NSDictionary dict); [Static] - [Wrap ("FromImageBuffer (buffer, options == null ? null : options.Dictionary)")] + [Wrap ("FromImageBuffer (buffer, options?.Dictionary)")] CIImage FromImageBuffer (CVPixelBuffer buffer, [NullAllowed] CIImageInitializationOptions options); #endif [iOS (11,0)] @@ -1462,7 +1515,7 @@ namespace CoreImage { [TV (11,0)] [Mac (10,13)] [Static] - [Wrap ("FromSurface (surface, options == null ? null : options.Dictionary)")] + [Wrap ("FromSurface (surface, options?.Dictionary)")] CIImage FromSurface (IOSurface.IOSurface surface, CIImageInitializationOptions options); [Static] @@ -1480,9 +1533,18 @@ namespace CoreImage { [Export ("initWithCGImage:options:")] IntPtr Constructor (CGImage image, [NullAllowed] NSDictionary d); - [Wrap ("this (image, options == null ? null : options.Dictionary)")] + [Wrap ("this (image, options?.Dictionary)")] IntPtr Constructor (CGImage image, [NullAllowed] CIImageInitializationOptionsWithMetadata options); + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [EditorBrowsable (EditorBrowsableState.Advanced)] + [Export ("initWithCGImageSource:index:options:")] + IntPtr Constructor (CGImageSource source, nuint index, [NullAllowed] NSDictionary options); + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Wrap ("this (source, index, options?.Dictionary)")] + IntPtr Constructor (CGImageSource source, nuint index, CIImageInitializationOptionsWithMetadata options); + #if MONOMAC [Deprecated (PlatformName.MacOSX, 10, 11, message: "Use 'CIImage (CGImage)' instead.")] [Export ("initWithCGLayer:")] @@ -1493,7 +1555,7 @@ namespace CoreImage { [Export ("initWithCGLayer:options:")] IntPtr Constructor (CGLayer layer, [NullAllowed] NSDictionary d); - [Wrap ("this (layer, options == null ? null : options.Dictionary)")] + [Wrap ("this (layer, options?.Dictionary)")] IntPtr Constructor (CGLayer layer, [NullAllowed] CIImageInitializationOptions options); #endif @@ -1503,7 +1565,7 @@ namespace CoreImage { [Export ("initWithData:options:")] IntPtr Constructor (NSData data, [NullAllowed] NSDictionary d); - [Wrap ("this (data, options == null ? null : options.Dictionary)")] + [Wrap ("this (data, options?.Dictionary)")] IntPtr Constructor (NSData data, [NullAllowed] CIImageInitializationOptionsWithMetadata options); [Export ("initWithBitmapData:bytesPerRow:size:format:colorSpace:")] @@ -1520,7 +1582,7 @@ namespace CoreImage { [Export ("initWithContentsOfURL:options:")] IntPtr Constructor (NSUrl url, [NullAllowed] NSDictionary d); - [Wrap ("this (url, options == null ? null : options.Dictionary)")] + [Wrap ("this (url, options?.Dictionary)")] IntPtr Constructor (NSUrl url, [NullAllowed] CIImageInitializationOptions options); [iOS (11,0)] // IOSurface was not exposed before Xcode 9 @@ -1538,7 +1600,7 @@ namespace CoreImage { [iOS (11,0)] // IOSurface was not exposed before Xcode 9 [TV (11,0)] [Mac (10,13)] - [Wrap ("this (surface, options == null ? null : options.Dictionary)")] + [Wrap ("this (surface, options?.Dictionary)")] IntPtr Constructor (IOSurface.IOSurface surface, [NullAllowed] CIImageInitializationOptions options); [iOS(9,0)] @@ -1563,7 +1625,7 @@ namespace CoreImage { #endif [iOS(9,0)] - [Wrap ("this (imageBuffer, options == null ? null : options.Dictionary)")] + [Wrap ("this (imageBuffer, options?.Dictionary)")] IntPtr Constructor (CVImageBuffer imageBuffer, [NullAllowed] CIImageInitializationOptions options); [Mac (10,11)] @@ -1575,7 +1637,7 @@ namespace CoreImage { IntPtr Constructor (CVPixelBuffer buffer, [NullAllowed] NSDictionary dict); [Mac (10,11)] - [Wrap ("this (buffer, options == null ? null : options.Dictionary)")] + [Wrap ("this (buffer, options?.Dictionary)")] IntPtr Constructor (CVPixelBuffer buffer, [NullAllowed] CIImageInitializationOptions options); [Export ("initWithColor:")] @@ -1601,6 +1663,10 @@ namespace CoreImage { [Export ("imageByApplyingTransform:")] CIImage ImageByApplyingTransform (CGAffineTransform matrix); + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Export ("imageByApplyingTransform:highQualityDownsample:")] + CIImage ImageByApplyingTransform (CGAffineTransform matrix, bool highQualityDownsample); + [Export ("imageByCroppingToRect:")] CIImage ImageByCroppingToRect (CGRect r); @@ -1729,7 +1795,7 @@ namespace CoreImage { [Export ("initWithImage:options:")] IntPtr Constructor (UIImage image, [NullAllowed] NSDictionary options); - [Wrap ("this (image, options == null ? null : options.Dictionary)")] + [Wrap ("this (image, options?.Dictionary)")] IntPtr Constructor (UIImage image, [NullAllowed] CIImageInitializationOptions options); #endif @@ -1927,6 +1993,32 @@ namespace CoreImage { [return: NullAllowed] CIImage FromPortraitEffectsMatte (AVPortraitEffectsMatte matte); + // CIImage_AVSemanticSegmentationMatte + + [TV (13,0), iOS (13,0), Mac (10,15)] + [NullAllowed, Export ("semanticSegmentationMatte")] + AVSemanticSegmentationMatte SemanticSegmentationMatte { get; } + + [TV (13,0), iOS (13,0), Mac (10,15)] + [Export ("initWithSemanticSegmentationMatte:options:")] + IntPtr Constructor (AVSemanticSegmentationMatte matte, [NullAllowed] NSDictionary options); + + [TV (13,0), iOS (13,0), Mac (10,15)] + [Export ("initWithSemanticSegmentationMatte:")] + IntPtr Constructor (AVSemanticSegmentationMatte matte); + + [TV (13,0), iOS (13,0), Mac (10,15)] + [Static] + [Export ("imageWithSemanticSegmentationMatte:options:")] + [return: NullAllowed] + CIImage FromSemanticSegmentationMatte (AVSemanticSegmentationMatte matte, [NullAllowed] NSDictionary options); + + [TV (13,0), iOS (13,0), Mac (10,15)] + [Static] + [Export ("imageWithSemanticSegmentationMatte:")] + [return: NullAllowed] + CIImage FromSemanticSegmentationMatte (AVSemanticSegmentationMatte matte); + // CIImage_AVDepthData category [TV (11, 0), iOS (11, 0), Mac (10,13)] @@ -1948,6 +2040,58 @@ namespace CoreImage { [Export ("imageWithDepthData:")] [return: NullAllowed] CIImage FromDepthData (AVDepthData data); + + // colors + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Static] + [Export ("blackImage", ArgumentSemantic.Strong)] + CIImage BlackImage { get; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Static] + [Export ("whiteImage", ArgumentSemantic.Strong)] + CIImage WhiteImage { get; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Static] + [Export ("grayImage", ArgumentSemantic.Strong)] + CIImage GrayImage { get; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Static] + [Export ("redImage", ArgumentSemantic.Strong)] + CIImage RedImage { get; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Static] + [Export ("greenImage", ArgumentSemantic.Strong)] + CIImage GreenImage { get; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Static] + [Export ("blueImage", ArgumentSemantic.Strong)] + CIImage BlueImage { get; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Static] + [Export ("cyanImage", ArgumentSemantic.Strong)] + CIImage CyanImage { get; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Static] + [Export ("magentaImage", ArgumentSemantic.Strong)] + CIImage MagentaImage { get; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Static] + [Export ("yellowImage", ArgumentSemantic.Strong)] + CIImage YellowImage { get; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Static] + [Export ("clearImage", ArgumentSemantic.Strong)] + CIImage ClearImage { get; } } interface ICIImageProcessorInput {} @@ -2205,6 +2349,7 @@ namespace CoreImage { #if MONOMAC [BaseType (typeof (NSObject))] interface CIPlugIn { + [Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'LoadNonExecutablePlugIns' for non-executable plugins instead.")] [Static] [Export ("loadAllPlugIns")] void LoadAllPlugIns (); @@ -2213,6 +2358,11 @@ namespace CoreImage { [Export ("loadNonExecutablePlugIns")] void LoadNonExecutablePlugIns (); + [Mac (10,15)] + [Static] + [Export ("loadNonExecutablePlugIn:")] + void LoadNonExecutablePlugIn (NSUrl url); + [Deprecated (PlatformName.MacOSX, 10, 7)] [Static] [Export ("loadPlugIn:allowNonExecutable:")] @@ -2645,22 +2795,13 @@ namespace CoreImage { [iOS (8,0)] [Mac (10,10)] [BaseType (typeof (CIFilter))] - interface CIAccordionFoldTransition { + interface CIAccordionFoldTransition : CIAccordionFoldTransitionProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'FoldCount' instead.")] [CoreImageFilterProperty ("inputNumberOfFolds")] int NumberOfFolds { get; set; } - - [CoreImageFilterProperty ("inputTime")] - float Time { get; set; } - - [CoreImageFilterProperty ("inputFoldShadowAmount")] - float FoldShadowAmount { get; set; } - - [CoreImageFilterProperty ("inputBottomHeight")] - float BottomHeight { get; set; } - - [CoreImageFilterProperty ("inputTargetImage")] - CIImage TargetImage { get; set; } +#endif } [CoreImageFilter (IntPtrCtorVisibility = MethodAttributes.Family)] // was already protected in classic @@ -2668,6 +2809,9 @@ namespace CoreImage { [BaseType (typeof (CIFilter))] interface CICompositingFilter { + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputBackgroundImage")] CIImage BackgroundImage { get; set; } } @@ -2680,32 +2824,49 @@ namespace CoreImage { [CoreImageFilter (IntPtrCtorVisibility = MethodAttributes.Family)] // was already protected in classic [Abstract] [BaseType (typeof (CIFilter))] - interface CIAffineFilter { + interface CIAffineFilter : CIFilterProtocol { +#if !XAMCORE_4_0 [NoMac] + [Obsolete ("Not every subclass expose this property.")] [CoreImageFilterProperty ("inputTransform")] CGAffineTransform Transform { get; set; } +#endif } [CoreImageFilter] [BaseType (typeof (CIAffineFilter))] - interface CIAffineClamp { + interface CIAffineClamp : CIAffineClampProtocol { } [CoreImageFilter] [BaseType (typeof (CIAffineFilter))] - interface CIAffineTile { + interface CIAffineTile : CIAffineTileProtocol { } [CoreImageFilter] [BaseType (typeof (CIAffineFilter))] interface CIAffineTransform { + + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + + [CoreImageFilterProperty ("inputTransform")] + CGAffineTransform Transform { get; set; } } [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIReductionFilter))] interface CIAreaAverage { + + [CoreImageFilterProperty ("outputImageNonMPS")] + CIImage OutputImageNonMps { get; } + +#if MONOMAC + [CoreImageFilterProperty ("outputImageMPS")] + CIImage OutputImageMps { get; } +#endif } [CoreImageFilter] @@ -2713,6 +2874,9 @@ namespace CoreImage { [BaseType (typeof (CIFilter))] interface CIAreaHistogram { + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputCount")] float Count { get; set; } @@ -2721,6 +2885,17 @@ namespace CoreImage { [CoreImageFilterProperty ("inputExtent")] CIVector Extent { get; set; } + + [CoreImageFilterProperty ("outputImageNonMPS")] + CIImage OutputImageNonMps { get; } + +#if MONOMAC + [CoreImageFilterProperty ("outputImageMPS")] + CIImage OutputImageMps { get; } +#endif + + [CoreImageFilterProperty ("outputData")] + NSData OutputData { get; } } [CoreImageFilter] @@ -2728,6 +2903,10 @@ namespace CoreImage { [iOS (9,0)] [BaseType (typeof (CIFilter))] interface CIReductionFilter { + + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputExtent")] CIVector Extent { get; set; } } @@ -2768,28 +2947,26 @@ namespace CoreImage { [iOS (8,0)] [Mac (10,10)] [BaseType (typeof (CICodeGenerator))] - interface CIAztecCodeGenerator { + interface CIAztecCodeGenerator : CIAztecCodeGeneratorProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputCompactStyle' instead.")] [CoreImageFilterProperty ("inputCompactStyle")] bool CompactStyle { get; set; } + [Obsolete ("Use 'InputLayers' instead.")] [CoreImageFilterProperty ("inputLayers")] int Layers { get; set; } +#endif - [CoreImageFilterProperty ("inputCorrectionLevel")] - float CorrectionLevel { get; set; } + [CoreImageFilterProperty ("outputCGImage")] + CGImage OutputCGImage { get; } } [CoreImageFilter (IntPtrCtorVisibility = MethodAttributes.Family)] // was already protected in classic [Abstract] [BaseType (typeof (CIFilter))] - interface CITransitionFilter { - - [CoreImageFilterProperty ("inputTime")] - float Time { get; set; } - - [CoreImageFilterProperty ("inputTargetImage")] - CIImage TargetImage { get; set; } + interface CITransitionFilter : CITransitionFilterProtocol { } [CoreImageFilter] @@ -2815,31 +2992,25 @@ namespace CoreImage { [CoreImageFilter (DefaultCtorVisibility = MethodAttributes.Public, StringCtorVisibility = MethodAttributes.Public)] [BaseType (typeof (CIBlendFilter))] - interface CIBlendWithMask { + interface CIBlendWithMask : CIBlendWithMaskProtocol { +#if !XAMCORE_4_0 // renamed for API compatibility + [Obsolete ("Use 'MaskImage' instead.")] [CoreImageFilterProperty ("inputMaskImage")] CIImage Mask { get; set; } +#endif } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIBloom { - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } - - [CoreImageFilterProperty ("inputIntensity")] - float Intensity { get; set; } + interface CIBloom : CIBloomProtocol { } [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CIBoxBlur { - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } + interface CIBoxBlur : CIBoxBlurProtocol { } [CoreImageFilter (IntPtrCtorVisibility = MethodAttributes.Family)] // was already protected in classic @@ -2847,6 +3018,9 @@ namespace CoreImage { [BaseType (typeof (CIFilter))] interface CIDistortionFilter { + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputRadius")] float Radius { get; set; } @@ -2875,22 +3049,13 @@ namespace CoreImage { [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CICheckerboardGenerator { - - [CoreImageFilterProperty ("inputWidth")] - float Width { get; set; } - - [CoreImageFilterProperty ("inputSharpness")] - float Sharpness { get; set; } + interface CICheckerboardGenerator : CICheckerboardGeneratorProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputCenter' instead.")] [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } - - [CoreImageFilterProperty ("inputColor1")] - CIColor Color1 { get; set; } - - [CoreImageFilterProperty ("inputColor0")] - CIColor Color0 { get; set; } +#endif } [CoreImageFilter] @@ -2906,8 +3071,14 @@ namespace CoreImage { [CoreImageFilterProperty ("inputSharpness")] float Sharpness { get; set; } +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputCenter' instead.")] [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } +#endif + + [CoreImageFilterProperty ("inputCenter")] + CGPoint InputCenter { get; set; } [CoreImageFilterProperty ("inputWidth")] float Width { get; set; } @@ -2915,7 +3086,7 @@ namespace CoreImage { [CoreImageFilter] [BaseType (typeof (CIScreenFilter))] - interface CICircularScreen { + interface CICircularScreen : CICircularScreenProtocol { } [CoreImageFilter] @@ -2923,6 +3094,9 @@ namespace CoreImage { [BaseType (typeof (CIFilter))] interface CICircularWrap { + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputRadius")] float Radius { get; set; } @@ -2936,37 +3110,28 @@ namespace CoreImage { [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter), Name="CICMYKHalftone")] - interface CICmykHalftone { - [CoreImageFilterProperty ("inputWidth")] - float Width { get; set; } - - // renamed for API compatibility - [CoreImageFilterProperty ("inputUCR")] - float UnderColorRemoval { get; set; } - - // renamed for API compatibility - [CoreImageFilterProperty ("inputGCR")] - float GrayComponentReplacement { get; set; } + interface CICmykHalftone : CICmykHalftoneProtocol { +#if !XAMCORE_4_0 // renamed for API compatibility + [Obsolete ("Use 'Sharpness' instead.")] [CoreImageFilterProperty ("inputSharpness")] float InputSharpness { get; set; } - [CoreImageFilterProperty ("inputAngle")] - float Angle { get; set; } - + [Obsolete ("Use 'InputCenter' instead.")] [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } +#endif } [CoreImageFilter] [iOS (8,0)] [Mac (10,10)] [BaseType (typeof (CICodeGenerator))] - interface CICode128BarcodeGenerator { + interface CICode128BarcodeGenerator : CICode128BarcodeGeneratorProtocol { - [CoreImageFilterProperty ("inputQuietSpace")] - float QuietSpace { get; set; } + [CoreImageFilterProperty ("outputCGImage")] + CIImage OutputCGImage { get; } } [CoreImageFilter (IntPtrCtorVisibility = MethodAttributes.Family)] // was already protected in classic @@ -2974,6 +3139,9 @@ namespace CoreImage { [BaseType (typeof (CIFilter))] interface CIBlendFilter { + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputBackgroundImage")] CIImage BackgroundImage { get; set; } } @@ -2992,66 +3160,43 @@ namespace CoreImage { [iOS (7,0)] [Mac (10,9)] [BaseType (typeof (CIFilter))] - interface CIColorClamp { + interface CIColorClamp : CIColorClampProtocol { +#if !XAMCORE_4_0 // here the prefix was not removed, edited to keep API compatibility + [Obsolete ("Use 'MinComponents' instead.")] [CoreImageFilterProperty ("inputMinComponents")] CIVector InputMinComponents { get; set; } // here the prefix was not removed, edited to keep API compatibility + [Obsolete ("Use 'MaxComponents' instead.")] [CoreImageFilterProperty ("inputMaxComponents")] CIVector InputMaxComponents { get; set; } +#endif } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIColorControls { - - [CoreImageFilterProperty ("inputContrast")] - float Contrast { get; set; } - - [CoreImageFilterProperty ("inputBrightness")] - float Brightness { get; set; } - - [CoreImageFilterProperty ("inputSaturation")] - float Saturation { get; set; } + interface CIColorControls : CIColorControlsProtocol { } [CoreImageFilter (DefaultCtorVisibility = MethodAttributes.Public, StringCtorVisibility = MethodAttributes.Public)] [iOS (7,0)] // not part of the attributes dictionary -> [NoiOS] is generated [Mac (10,9)] // not part of the attributes dictionary -> [NoMac] is generated [BaseType (typeof (CIFilter))] - interface CIColorCrossPolynomial { - - [CoreImageFilterProperty ("inputRedCoefficients")] - CIVector RedCoefficients { get; set; } - - [CoreImageFilterProperty ("inputBlueCoefficients")] - CIVector BlueCoefficients { get; set; } - - [CoreImageFilterProperty ("inputGreenCoefficients")] - CIVector GreenCoefficients { get; set; } + interface CIColorCrossPolynomial : CIColorCrossPolynomialProtocol { } [CoreImageFilter (DefaultCtorVisibility = MethodAttributes.Public, StringCtorVisibility = MethodAttributes.Public)] [BaseType (typeof (CIFilter))] - interface CIColorCube { - - [CoreImageFilterProperty ("inputCubeDimension")] - float CubeDimension { get; set; } - - [CoreImageFilterProperty ("inputCubeData")] - NSData CubeData { get; set; } + interface CIColorCube : CIColorCubeProtocol { } [CoreImageFilter] [iOS (7,0)] [Mac (10,9)] [BaseType (typeof (CIColorCube))] - interface CIColorCubeWithColorSpace { - - [CoreImageFilterProperty ("inputColorSpace")] - CGColorSpace ColorSpace { get; set; } + interface CIColorCubeWithColorSpace : CIColorCubeWithColorSpaceProtocol { } [CoreImageFilter] @@ -3061,64 +3206,34 @@ namespace CoreImage { [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIColorInvert { + interface CIColorInvert : CIColorInvertProtocol { } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIColorMap { - - [CoreImageFilterProperty ("inputGradientImage")] - CIImage GradientImage { get; set; } + interface CIColorMap : CIColorMapProtocol { } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIColorMatrix { - - [CoreImageFilterProperty ("inputAVector")] - CIVector AVector { get; set; } - - [CoreImageFilterProperty ("inputBiasVector")] - CIVector BiasVector { get; set; } - - [CoreImageFilterProperty ("inputBVector")] - CIVector BVector { get; set; } - - [CoreImageFilterProperty ("inputGVector")] - CIVector GVector { get; set; } - - [CoreImageFilterProperty ("inputRVector")] - CIVector RVector { get; set; } + interface CIColorMatrix : CIColorMatrixProtocol { } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIColorMonochrome { - - [CoreImageFilterProperty ("inputColor")] - CIColor Color { get; set; } - - [CoreImageFilterProperty ("inputIntensity")] - float Intensity { get; set; } + interface CIColorMonochrome : CIColorMonochromeProtocol { } [CoreImageFilter] [iOS (7,0)] [Mac (10,9)] [BaseType (typeof (CIColorCrossPolynomial))] - interface CIColorPolynomial { - - [CoreImageFilterProperty ("inputAlphaCoefficients")] - CIVector AlphaCoefficients { get; set; } + interface CIColorPolynomial : CIColorPolynomialProtocol { } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIColorPosterize { - - [CoreImageFilterProperty ("inputLevels")] - float Levels { get; set; } + interface CIColorPosterize : CIColorPosterizeProtocol { } [CoreImageFilter] @@ -3131,7 +3246,7 @@ namespace CoreImage { [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CIComicEffect { + interface CIComicEffect : CIComicEffectProtocol { } [CoreImageFilter] @@ -3147,6 +3262,9 @@ namespace CoreImage { [BaseType (typeof (CIFilter))] interface CIConvolutionCore { + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputWeights")] CIVector Weights { get; set; } @@ -3213,6 +3331,9 @@ namespace CoreImage { [BaseType (typeof (CIFilter))] interface CICrop { + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputRectangle")] CIVector Rectangle { get; set; } } @@ -3220,13 +3341,13 @@ namespace CoreImage { [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CICrystallize { - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } + interface CICrystallize : CICrystallizeProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputCenter' instead.")] [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } +#endif } [CoreImageFilter] @@ -3242,28 +3363,22 @@ namespace CoreImage { [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CIDiscBlur { - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } + interface CIDiscBlur : CIDiscBlurProtocol { } [CoreImageFilter] [BaseType (typeof (CITransitionFilter))] - interface CIDisintegrateWithMaskTransition { + interface CIDisintegrateWithMaskTransition : CIDisintegrateWithMaskTransitionProtocol { - [CoreImageFilterProperty ("inputShadowDensity")] - float ShadowDensity { get; set; } - - // renamed for API compatibility +#if !XAMCORE_4_0 + [Obsolete ("Use 'MaskImage' instead.")] [CoreImageFilterProperty ("inputMaskImage")] CIImage Mask { get; set; } - [CoreImageFilterProperty ("inputShadowRadius")] - float ShadowRadius { get; set; } - + [Obsolete ("Use 'InputShadowOffset' instead.")] [CoreImageFilterProperty ("inputShadowOffset")] CIVector ShadowOffset { get; set; } +#endif } [CoreImageFilter] @@ -3271,6 +3386,9 @@ namespace CoreImage { [BaseType (typeof (CIFilter))] interface CIDisplacementDistortion { + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputDisplacementImage")] CIImage DisplacementImage { get; set; } @@ -3292,9 +3410,7 @@ namespace CoreImage { [CoreImageFilter] [BaseType (typeof (CIScreenFilter))] - interface CIDotScreen { - [CoreImageFilterProperty ("inputAngle")] - float Angle { get; set; } + interface CIDotScreen : CIDotScreenProtocol { } [CoreImageFilter] @@ -3302,6 +3418,9 @@ namespace CoreImage { [BaseType (typeof (CIFilter))] interface CIDroste { + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputStrands")] float Strands { get; set; } @@ -3324,19 +3443,13 @@ namespace CoreImage { [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CIEdges { - - [CoreImageFilterProperty ("inputIntensity")] - float Intensity { get; set; } + interface CIEdges : CIEdgesProtocol { } [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CIEdgeWork { - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } + interface CIEdgeWork : CIEdgeWorkProtocol { } [CoreImageFilter (IntPtrCtorVisibility = MethodAttributes.Family)] // was already protected in classic @@ -3347,8 +3460,14 @@ namespace CoreImage { [CoreImageFilterProperty ("inputAngle")] float Angle { get; set; } +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputCenter' instead.")] [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } +#endif + + [CoreImageFilterProperty ("inputCenter")] + CGPoint InputCenter { get; set; } [CoreImageFilterProperty ("inputWidth")] float Width { get; set; } @@ -3356,7 +3475,7 @@ namespace CoreImage { [CoreImageFilter] [BaseType (typeof (CITileFilter))] - interface CIEightfoldReflectedTile { + interface CIEightfoldReflectedTile : CIEightfoldReflectedTileProtocol { } [CoreImageFilter] @@ -3366,103 +3485,73 @@ namespace CoreImage { [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIExposureAdjust { - - [CoreImageFilterProperty ("inputEV")] - float EV { get; set; } + interface CIExposureAdjust : CIExposureAdjustProtocol { } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIFalseColor { - - [CoreImageFilterProperty ("inputColor1")] - CIColor Color1 { get; set; } - - [CoreImageFilterProperty ("inputColor0")] - CIColor Color0 { get; set; } + interface CIFalseColor : CIFalseColorProtocol { } [CoreImageFilter] [BaseType (typeof (CITransitionFilter))] - interface CIFlashTransition { + interface CIFlashTransition : CIFlashTransitionProtocol { +#if !XAMCORE_4_0 // for some reason we prefixed all Striation* with Max - API compatibility + [Obsolete ("Use 'StriationContrast' instead.")] [CoreImageFilterProperty ("inputStriationContrast")] float MaxStriationContrast { get; set; } - [CoreImageFilterProperty ("inputColor")] - CIColor Color { get; set; } - - [CoreImageFilterProperty ("inputFadeThreshold")] - float FadeThreshold { get; set; } - - [CoreImageFilterProperty ("inputMaxStriationRadius")] - float MaxStriationRadius { get; set; } - + [Obsolete ("Use 'InputExtent' instead.")] [CoreImageFilterProperty ("inputExtent")] CIVector Extent { get; set; } + [Obsolete ("Use 'InputCenter' instead.")] [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } // for some reason we prefixed all Striation* with Max - API compatibility + [Obsolete ("Use 'StriationStrength' instead.")] [CoreImageFilterProperty ("inputStriationStrength")] float MaxStriationStrength { get; set; } +#endif } [CoreImageFilter] [BaseType (typeof (CITileFilter))] - interface CIFourfoldReflectedTile { - - [CoreImageFilterProperty ("inputAcuteAngle")] - float AcuteAngle { get; set; } + interface CIFourfoldReflectedTile : CIFourfoldReflectedTileProtocol { } [CoreImageFilter] [BaseType (typeof (CITileFilter))] - interface CIFourfoldRotatedTile { + interface CIFourfoldRotatedTile : CIFourfoldRotatedTileProtocol { } [CoreImageFilter] [BaseType (typeof (CITileFilter))] - interface CIFourfoldTranslatedTile { - - [CoreImageFilterProperty ("inputAcuteAngle")] - float AcuteAngle { get; set; } + interface CIFourfoldTranslatedTile : CIFourfoldTranslatedTileProtocol { } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIGammaAdjust { - - [CoreImageFilterProperty ("inputPower")] - float Power { get; set; } + interface CIGammaAdjust : CIGammaAdjustProtocol { } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIGaussianBlur { - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } + interface CIGaussianBlur : CIGaussianBlurProtocol { } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIGaussianGradient { - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } + interface CIGaussianGradient : CIGaussianGradientProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputCenter' instead.")] [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } - - [CoreImageFilterProperty ("inputColor1")] - CIColor Color1 { get; set; } - - [CoreImageFilterProperty ("inputColor0")] - CIColor Color0 { get; set; } +#endif } [CoreImageFilter] @@ -3470,6 +3559,9 @@ namespace CoreImage { [BaseType (typeof (CIFilter))] interface CIGlassDistortion { + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } @@ -3485,6 +3577,9 @@ namespace CoreImage { [BaseType (typeof (CIFilter))] interface CIGlassLozenge { + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputPoint1")] CIVector Point1 { get; set; } @@ -3500,18 +3595,12 @@ namespace CoreImage { [CoreImageFilter] [BaseType (typeof (CITileFilter))] - interface CIGlideReflectedTile { + interface CIGlideReflectedTile : CIGlideReflectedTileProtocol { } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIGloom { - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } - - [CoreImageFilterProperty ("inputIntensity")] - float Intensity { get; set; } + interface CIGloom : CIGloomProtocol { } [CoreImageFilter] @@ -3521,44 +3610,30 @@ namespace CoreImage { [CoreImageFilter] [BaseType (typeof (CIScreenFilter))] - interface CIHatchedScreen { - [CoreImageFilterProperty ("inputAngle")] - float Angle { get; set; } + interface CIHatchedScreen : CIHatchedScreenProtocol { } [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CIHeightFieldFromMask { - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } + interface CIHeightFieldFromMask : CIHeightFieldFromMaskProtocol { } [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CIHexagonalPixellate { + interface CIHexagonalPixellate : CIHexagonalPixellateProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputCenter' instead.")] [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } - - [CoreImageFilterProperty ("inputScale")] - float Scale { get; set; } +#endif } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIHighlightShadowAdjust { - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } - - [CoreImageFilterProperty ("inputHighlightAmount")] - float HighlightAmount { get; set; } - - [CoreImageFilterProperty ("inputShadowAmount")] - float ShadowAmount { get; set; } + interface CIHighlightShadowAdjust : CIHighlightShadowAdjustProtocol { } [CoreImageFilter] @@ -3567,6 +3642,9 @@ namespace CoreImage { [BaseType (typeof (CIFilter))] interface CIHistogramDisplayFilter { + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputHeight")] float Height { get; set; } @@ -3584,10 +3662,7 @@ namespace CoreImage { [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIHueAdjust { - - [CoreImageFilterProperty ("inputAngle")] - float Angle { get; set; } + interface CIHueAdjust : CIHueAdjustProtocol { } [CoreImageFilter] @@ -3598,57 +3673,34 @@ namespace CoreImage { [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CIKaleidoscope { - - [CoreImageFilterProperty ("inputAngle")] - float Angle { get; set; } + interface CIKaleidoscope : CIKaleidoscopeProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputCount' instead.")] [CoreImageFilterProperty ("inputCount")] float Count { get; set; } + [Obsolete ("Use 'InputCenter' instead.")] [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } +#endif } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CILanczosScaleTransform { - - [CoreImageFilterProperty ("inputScale")] - float Scale { get; set; } - - [CoreImageFilterProperty ("inputAspectRatio")] - float AspectRatio { get; set; } + interface CILanczosScaleTransform : CILanczosScaleTransformProtocol { } [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CILenticularHaloGenerator { - - [CoreImageFilterProperty ("inputStriationContrast")] - float StriationContrast { get; set; } - - [CoreImageFilterProperty ("inputColor")] - CIColor Color { get; set; } - - [CoreImageFilterProperty ("inputTime")] - float Time { get; set; } - - [CoreImageFilterProperty ("inputHaloRadius")] - float HaloRadius { get; set; } + interface CILenticularHaloGenerator : CILenticularHaloGeneratorProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputCenter' instead.")] [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } - - [CoreImageFilterProperty ("inputHaloOverlap")] - float HaloOverlap { get; set; } - - [CoreImageFilterProperty ("inputStriationStrength")] - float StriationStrength { get; set; } - - [CoreImageFilterProperty ("inputHaloWidth")] - float HaloWidth { get; set; } +#endif } [CoreImageFilter] @@ -3661,6 +3713,9 @@ namespace CoreImage { [BaseType (typeof (CIFilter))] interface CILightTunnel { + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputRotation")] float Rotation { get; set; } @@ -3687,54 +3742,35 @@ namespace CoreImage { [CoreImageFilter (DefaultCtorVisibility = MethodAttributes.Public, StringCtorVisibility = MethodAttributes.Public)] [BaseType (typeof (CIFilter))] - interface CILinearGradient { + interface CILinearGradient : CILinearGradientProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputPoint1' instead.")] [CoreImageFilterProperty ("inputPoint1")] CIVector Point1 { get; set; } + [Obsolete ("Use 'InputPoint0' instead.")] [CoreImageFilterProperty ("inputPoint0")] CIVector Point0 { get; set; } - - [CoreImageFilterProperty ("inputColor1")] - CIColor Color1 { get; set; } - - [CoreImageFilterProperty ("inputColor0")] - CIColor Color0 { get; set; } +#endif } [CoreImageFilter] [iOS (7,0)] [Mac (10,10)] [BaseType (typeof (CIFilter))] - interface CILinearToSRGBToneCurve { + interface CILinearToSRGBToneCurve : CILinearToSrgbToneCurveProtocol { } [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CILineOverlay { - - [CoreImageFilterProperty ("inputNRNoiseLevel")] - float NRNoiseLevel { get; set; } - - [CoreImageFilterProperty ("inputNRSharpness")] - float NRSharpness { get; set; } - - [CoreImageFilterProperty ("inputEdgeIntensity")] - float EdgeIntensity { get; set; } - - [CoreImageFilterProperty ("inputContrast")] - float Contrast { get; set; } - - [CoreImageFilterProperty ("inputThreshold")] - float Threshold { get; set; } + interface CILineOverlay : CILineOverlayProtocol { } [CoreImageFilter] [BaseType (typeof (CIScreenFilter))] - interface CILineScreen { - [CoreImageFilterProperty ("inputAngle")] - float Angle { get; set; } + interface CILineScreen : CILineScreenProtocol { } [CoreImageFilter] @@ -3744,12 +3780,12 @@ namespace CoreImage { [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIMaskToAlpha { + interface CIMaskToAlpha : CIMaskToAlphaProtocol { } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIMaximumComponent { + interface CIMaximumComponent : CIMaximumComponentProtocol { } [CoreImageFilter] @@ -3760,12 +3796,12 @@ namespace CoreImage { [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CIMedianFilter { + interface CIMedianFilter : CIMedianProtocol { } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIMinimumComponent { + interface CIMinimumComponent : CIMinimumComponentProtocol { } [CoreImageFilter] @@ -3775,28 +3811,18 @@ namespace CoreImage { [CoreImageFilter] [BaseType (typeof (CITransitionFilter))] - interface CIModTransition { - - [CoreImageFilterProperty ("inputCompression")] - float Compression { get; set; } - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } - - [CoreImageFilterProperty ("inputAngle")] - float Angle { get; set; } + interface CIModTransition : CIModTransitionProtocol { +#if !XAMCORE_4_0 [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } +#endif } [CoreImageFilter] [iOS (8,3)] [BaseType (typeof (CILinearBlur))] - interface CIMotionBlur { - - [CoreImageFilterProperty ("inputAngle")] - float Angle { get; set; } + interface CIMotionBlur : CIMotionBlurProtocol { } [CoreImageFilter] @@ -3812,22 +3838,13 @@ namespace CoreImage { [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CINoiseReduction { - - [CoreImageFilterProperty ("inputSharpness")] - float Sharpness { get; set; } - - [CoreImageFilterProperty ("inputNoiseLevel")] - float NoiseLevel { get; set; } + interface CINoiseReduction : CINoiseReductionProtocol { } [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CITileFilter))] - interface CIOpTile { - - [CoreImageFilterProperty ("inputScale")] - float Scale { get; set; } + interface CIOpTile : CIOpTileProtocol { } [CoreImageFilter] @@ -3838,155 +3855,139 @@ namespace CoreImage { [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CITransitionFilter))] - interface CIPageCurlTransition { - - [CoreImageFilterProperty ("inputShadingImage")] - CIImage ShadingImage { get; set; } - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } - - [CoreImageFilterProperty ("inputAngle")] - float Angle { get; set; } + interface CIPageCurlTransition : CIPageCurlTransitionProtocol { +#if !XAMCORE_4_0 [CoreImageFilterProperty ("inputExtent")] CIVector Extent { get; set; } - - [CoreImageFilterProperty ("inputBacksideImage")] - CIImage BacksideImage { get; set; } +#endif } [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CIPageCurlWithShadowTransition { - - [CoreImageFilterProperty ("inputShadowSize")] - float ShadowSize { get; set; } + interface CIPageCurlWithShadowTransition : CIPageCurlWithShadowTransitionProtocol { +#if !XAMCORE_4_0 // prefixed for API compatibility + [Obsolete ("Use 'Time' instead.")] [CoreImageFilterProperty ("inputTime")] float InputTime { get; set; } - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } - + [Obsolete ("Use 'InputShadowExtent' instead.")] [CoreImageFilterProperty ("inputShadowExtent")] CIVector ShadowExtent { get; set; } - [CoreImageFilterProperty ("inputShadowAmount")] - float ShadowAmount { get; set; } - - [CoreImageFilterProperty ("inputAngle")] - float Angle { get; set; } - + [Obsolete ("Use 'InputExtent' instead.")] [CoreImageFilterProperty ("inputExtent")] CIVector Extent { get; set; } - - [CoreImageFilterProperty ("inputTargetImage")] - CIImage TargetImage { get; set; } - - [CoreImageFilterProperty ("inputBacksideImage")] - CIImage BacksideImage { get; set; } +#endif } [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CITileFilter))] - interface CIParallelogramTile { - - [CoreImageFilterProperty ("inputAcuteAngle")] - float AcuteAngle { get; set; } + interface CIParallelogramTile : CIParallelogramTileProtocol { } [CoreImageFilter] [iOS (9,0)] [Mac (10,11)] [BaseType (typeof (CICodeGenerator), Name="CIPDF417BarcodeGenerator")] - interface CIPdf417BarcodeGenerator { - + interface CIPdf417BarcodeGenerator : CIPdf417BarcodeGeneratorProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputCorrectionLevel' instead.")] [CoreImageFilterProperty ("inputCorrectionLevel")] int CorrectionLevel { get; set; } - [CoreImageFilterProperty ("inputMinHeight")] - float MinHeight { get; set; } - + [Obsolete ("Use 'InputAlwaysSpecifyCompaction' instead.")] [CoreImageFilterProperty ("inputAlwaysSpecifyCompaction")] bool AlwaysSpecifyCompaction { get; set; } - [CoreImageFilterProperty ("inputPreferredAspectRatio")] - float PreferredAspectRatio { get; set; } - + [Obsolete ("Use 'InputCompactStyle' instead.")] [CoreImageFilterProperty ("inputCompactStyle")] bool CompactStyle { get; set; } - [CoreImageFilterProperty ("inputMaxWidth")] - float MaxWidth { get; set; } - + [Obsolete ("Use 'InputCompactStyle' instead.")] [CoreImageFilterProperty ("inputDataColumns")] int DataColumns { get; set; } + [Obsolete ("Use 'InputCompactionMode' instead.")] [CoreImageFilterProperty ("inputCompactionMode")] int CompactionMode { get; set; } - [CoreImageFilterProperty ("inputMinWidth")] - float MinWidth { get; set; } - - [CoreImageFilterProperty ("inputMaxHeight")] - float MaxHeight { get; set; } - + [Obsolete ("Use 'InputRows' instead.")] [CoreImageFilterProperty ("inputRows")] int Rows { get; set; } +#endif + + [CoreImageFilterProperty ("outputCGImage")] + CGImage OutputCGImage { get; } } [CoreImageFilter] [iOS (8,0)] [Mac (10,10)] [BaseType (typeof (CIPerspectiveTransform))] - interface CIPerspectiveCorrection { + interface CIPerspectiveCorrection : CIPerspectiveCorrectionProtocol { } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIPerspectiveTile { - + interface CIPerspectiveTile : CIPerspectiveTileProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputBottomLeft' instead.")] [CoreImageFilterProperty ("inputBottomLeft")] CIVector BottomLeft { get; set; } + [Obsolete ("Use 'InputTopRight' instead.")] [CoreImageFilterProperty ("inputTopRight")] CIVector TopRight { get; set; } + [Obsolete ("Use 'InputTopLeft' instead.")] [CoreImageFilterProperty ("inputTopLeft")] CIVector TopLeft { get; set; } + [Obsolete ("Use 'InputBottomRight' instead.")] [CoreImageFilterProperty ("inputBottomRight")] CIVector BottomRight { get; set; } +#endif } [CoreImageFilter (DefaultCtorVisibility = MethodAttributes.Public, StringCtorVisibility = MethodAttributes.Public)] [BaseType (typeof (CIFilter))] - interface CIPerspectiveTransform { - + interface CIPerspectiveTransform : CIPerspectiveTransformProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputBottomLeft' instead.")] [CoreImageFilterProperty ("inputBottomLeft")] CIVector BottomLeft { get; set; } + [Obsolete ("Use 'InputTopRight' instead.")] [CoreImageFilterProperty ("inputTopRight")] CIVector TopRight { get; set; } + [Obsolete ("Use 'InputTopLeft' instead.")] [CoreImageFilterProperty ("inputTopLeft")] CIVector TopLeft { get; set; } + [Obsolete ("Use 'InputBottomRight' instead.")] [CoreImageFilterProperty ("inputBottomRight")] CIVector BottomRight { get; set; } +#endif + + [CoreImageFilterProperty ("outputTransform")] + CGAffineTransform OutputTransform { get; } } [CoreImageFilter] [Mac (10,11)] [BaseType (typeof (CIPerspectiveTransform))] - interface CIPerspectiveTransformWithExtent { - + interface CIPerspectiveTransformWithExtent : CIPerspectiveTransformWithExtentProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputExtent' instead.")] [CoreImageFilterProperty ("inputExtent")] CIVector Extent { get; set; } +#endif } [CoreImageFilter (StringCtorVisibility = MethodAttributes.Public)] @@ -3994,7 +3995,7 @@ namespace CoreImage { [Mac (10,9)] [Abstract] [BaseType (typeof (CIFilter))] - interface CIPhotoEffect { + interface CIPhotoEffect : CIPhotoEffectProtocol { } [CoreImageFilter] @@ -4070,81 +4071,64 @@ namespace CoreImage { [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIPixellate { - + interface CIPixellate : CIPixellateProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputCenter' instead.")] [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } - - [CoreImageFilterProperty ("inputScale")] - float Scale { get; set; } +#endif } [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CIPointillize { - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } - + interface CIPointillize : CIPointillizeProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputCenter' instead.")] [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } +#endif } [CoreImageFilter] [iOS (7,0)] [Mac (10,9)] [BaseType (typeof (CICodeGenerator))] - interface CIQRCodeGenerator { + interface CIQRCodeGenerator : CIQRCodeGeneratorProtocol { - [CoreImageFilterProperty ("inputCorrectionLevel")] - string CorrectionLevel { get; set; } + [CoreImageFilterProperty ("outputCGImage")] + CGImage OutputCGImage { get; } } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIRadialGradient { - - [CoreImageFilterProperty ("inputRadius0")] - float Radius0 { get; set; } - - [CoreImageFilterProperty ("inputRadius1")] - float Radius1 { get; set; } + interface CIRadialGradient : CIRadialGradientProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputCenter' instead.")] [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } - - [CoreImageFilterProperty ("inputColor1")] - CIColor Color1 { get; set; } - - [CoreImageFilterProperty ("inputColor0")] - CIColor Color0 { get; set; } +#endif } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIRandomGenerator { + interface CIRandomGenerator : CIRandomGeneratorProtocol { } [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CITransitionFilter))] - interface CIRippleTransition { - - [CoreImageFilterProperty ("inputWidth")] - float Width { get; set; } - - [CoreImageFilterProperty ("inputShadingImage")] - CIImage ShadingImage { get; set; } - + interface CIRippleTransition : CIRippleTransitionProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputExtent' instead.")] [CoreImageFilterProperty ("inputExtent")] CIVector Extent { get; set; } + [Obsolete ("Use 'InputCenter' instead.")] [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } - - [CoreImageFilterProperty ("inputScale")] - float Scale { get; set; } +#endif } [CoreImageFilter] @@ -4152,6 +4136,9 @@ namespace CoreImage { [BaseType (typeof (CIFilter))] interface CIRowAverage { + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputExtent")] CIVector Extent { get; set; } } @@ -4168,58 +4155,43 @@ namespace CoreImage { [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CISepiaTone { - - [CoreImageFilterProperty ("inputIntensity")] - float Intensity { get; set; } + interface CISepiaTone : CISepiaToneProtocol { } [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CIShadedMaterial { - - [CoreImageFilterProperty ("inputShadingImage")] - CIImage ShadingImage { get; set; } - - [CoreImageFilterProperty ("inputScale")] - float Scale { get; set; } + interface CIShadedMaterial : CIShadedMaterialProtocol { } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CISharpenLuminance { - - [CoreImageFilterProperty ("inputSharpness")] - float Sharpness { get; set; } + interface CISharpenLuminance : CISharpenLuminanceProtocol { } [CoreImageFilter] [BaseType (typeof (CITileFilter))] - interface CISixfoldReflectedTile { + interface CISixfoldReflectedTile : CISixfoldReflectedTileProtocol { } [CoreImageFilter] [BaseType (typeof (CITileFilter))] - interface CISixfoldRotatedTile { + interface CISixfoldRotatedTile : CISixfoldRotatedTileProtocol { } [CoreImageFilter] [Mac (10,11)] [BaseType (typeof (CILinearGradient))] - interface CISmoothLinearGradient { - + interface CISmoothLinearGradient : CISmoothLinearGradientProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputPoint1' instead.")] [CoreImageFilterProperty ("inputPoint1")] CIVector Point1 { get; set; } + [Obsolete ("Use 'InputPoint0' instead.")] [CoreImageFilterProperty ("inputPoint0")] CIVector Point0 { get; set; } - - [CoreImageFilterProperty ("inputColor1")] - CIColor Color1 { get; set; } - - [CoreImageFilterProperty ("inputColor0")] - CIColor Color0 { get; set; } +#endif } [CoreImageFilter] @@ -4250,108 +4222,35 @@ namespace CoreImage { [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CISpotColor { - - [CoreImageFilterProperty ("inputReplacementColor3")] - CIColor ReplacementColor3 { get; set; } - - [CoreImageFilterProperty ("inputCloseness2")] - float Closeness2 { get; set; } - - [CoreImageFilterProperty ("inputCloseness3")] - float Closeness3 { get; set; } - - [CoreImageFilterProperty ("inputContrast1")] - float Contrast1 { get; set; } - - [CoreImageFilterProperty ("inputContrast3")] - float Contrast3 { get; set; } - - [CoreImageFilterProperty ("inputCloseness1")] - float Closeness1 { get; set; } - - [CoreImageFilterProperty ("inputContrast2")] - float Contrast2 { get; set; } - - [CoreImageFilterProperty ("inputCenterColor3")] - CIColor CenterColor3 { get; set; } - - [CoreImageFilterProperty ("inputReplacementColor1")] - CIColor ReplacementColor1 { get; set; } - - [CoreImageFilterProperty ("inputCenterColor2")] - CIColor CenterColor2 { get; set; } - - [CoreImageFilterProperty ("inputReplacementColor2")] - CIColor ReplacementColor2 { get; set; } - - [CoreImageFilterProperty ("inputCenterColor1")] - CIColor CenterColor1 { get; set; } + interface CISpotColor : CISpotColorProtocol { } [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CISpotLight { - - [CoreImageFilterProperty ("inputBrightness")] - float Brightness { get; set; } - - [CoreImageFilterProperty ("inputColor")] - CIColor Color { get; set; } - - [CoreImageFilterProperty ("inputLightPosition")] - CIVector LightPosition { get; set; } - - [CoreImageFilterProperty ("inputConcentration")] - float Concentration { get; set; } - - [CoreImageFilterProperty ("inputLightPointsAt")] - CIVector LightPointsAt { get; set; } + interface CISpotLight : CISpotLightProtocol { } [CoreImageFilter] [iOS (7,0)] [Mac (10,10)] [BaseType (typeof (CIFilter))] - interface CISRGBToneCurveToLinear { + interface CISRGBToneCurveToLinear : CISrgbToneCurveToLinearProtocol { } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIStarShineGenerator { - - [CoreImageFilterProperty ("inputCrossScale")] - float CrossScale { get; set; } - - [CoreImageFilterProperty ("inputCrossAngle")] - float CrossAngle { get; set; } - - [CoreImageFilterProperty ("inputColor")] - CIColor Color { get; set; } - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } - - [CoreImageFilterProperty ("inputCrossOpacity")] - float CrossOpacity { get; set; } - - [CoreImageFilterProperty ("inputCrossWidth")] - float CrossWidth { get; set; } - + interface CIStarShineGenerator : CIStarShineGeneratorProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputCenter' instead.")] [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } - - [CoreImageFilterProperty ("inputEpsilon")] - float Epsilon { get; set; } +#endif } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIStraightenFilter { - - [CoreImageFilterProperty ("inputAngle")] - float Angle { get; set; } + interface CIStraightenFilter : CIStraightenProtocol { } [CoreImageFilter] @@ -4359,6 +4258,9 @@ namespace CoreImage { [BaseType (typeof (CIFilter))] interface CIStretchCrop { + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputCropAmount")] float CropAmount { get; set; } @@ -4371,22 +4273,12 @@ namespace CoreImage { [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIStripesGenerator { - - [CoreImageFilterProperty ("inputWidth")] - float Width { get; set; } - - [CoreImageFilterProperty ("inputSharpness")] - float Sharpness { get; set; } - + interface CIStripesGenerator : CIStripesGeneratorProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputCenter' instead.")] [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } - - [CoreImageFilterProperty ("inputColor1")] - CIColor Color1 { get; set; } - - [CoreImageFilterProperty ("inputColor0")] - CIColor Color0 { get; set; } +#endif } [CoreImageFilter] @@ -4418,33 +4310,33 @@ namespace CoreImage { [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CITemperatureAndTint { - - [CoreImageFilterProperty ("inputTargetNeutral")] - CIVector TargetNeutral { get; set; } - - [CoreImageFilterProperty ("inputNeutral")] - CIVector Neutral { get; set; } + interface CITemperatureAndTint : CITemperatureAndTintProtocol { } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIToneCurve { - + interface CIToneCurve : CIToneCurveProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputPoint0' instead.")] [CoreImageFilterProperty ("inputPoint0")] CIVector Point0 { get; set; } + [Obsolete ("Use 'InputPoint1' instead.")] [CoreImageFilterProperty ("inputPoint1")] CIVector Point1 { get; set; } + [Obsolete ("Use 'InputPoint2' instead.")] [CoreImageFilterProperty ("inputPoint2")] CIVector Point2 { get; set; } + [Obsolete ("Use 'InputPoint3' instead.")] [CoreImageFilterProperty ("inputPoint3")] CIVector Point3 { get; set; } + [Obsolete ("Use 'InputPoint4' instead.")] [CoreImageFilterProperty ("inputPoint4")] CIVector Point4 { get; set; } +#endif } [CoreImageFilter] @@ -4452,6 +4344,9 @@ namespace CoreImage { [BaseType (typeof (CIFilter))] interface CITorusLensDistortion { + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputRefraction")] float Refraction { get; set; } @@ -4468,30 +4363,23 @@ namespace CoreImage { [CoreImageFilter] [Mac (10,11)] [BaseType (typeof (CIFilter))] - interface CITriangleKaleidoscope { - - [CoreImageFilterProperty ("inputRotation")] - float Rotation { get; set; } - - [CoreImageFilterProperty ("inputSize")] - float Size { get; set; } - + interface CITriangleKaleidoscope : CITriangleKaleidoscopeProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputPoint' instead.")] [CoreImageFilterProperty ("inputPoint")] CIVector Point { get; set; } - - [CoreImageFilterProperty ("inputDecay")] - float Decay { get; set; } +#endif } [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CITileFilter))] - interface CITriangleTile { + interface CITriangleTile : CITriangleTileProtocol { } [CoreImageFilter] [BaseType (typeof (CITileFilter))] - interface CITwelvefoldReflectedTile { + interface CITwelvefoldReflectedTile : CITwelvefoldReflectedTileProtocol { } [CoreImageFilter] @@ -4504,52 +4392,31 @@ namespace CoreImage { [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIUnsharpMask { - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } - - [CoreImageFilterProperty ("inputIntensity")] - float Intensity { get; set; } + interface CIUnsharpMask : CIUnsharpMaskProtocol { } [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIVibrance { - - [CoreImageFilterProperty ("inputAmount")] - float Amount { get; set; } + interface CIVibrance : CIVibranceProtocol { } [CoreImageFilter] [Mac (10,9)] [BaseType (typeof (CIFilter))] - interface CIVignette { - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } - - [CoreImageFilterProperty ("inputIntensity")] - float Intensity { get; set; } + interface CIVignette : CIVignetteProtocol { } [CoreImageFilter] [iOS (7,0)] [Mac (10,9)] [BaseType (typeof (CIFilter))] - interface CIVignetteEffect { - - [CoreImageFilterProperty ("inputFalloff")] - float Falloff { get; set; } - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } + interface CIVignetteEffect : CIVignetteEffectProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputCenter' instead.")] [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } - - [CoreImageFilterProperty ("inputIntensity")] - float Intensity { get; set; } +#endif } [CoreImageFilter] @@ -4562,75 +4429,47 @@ namespace CoreImage { [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIWhitePointAdjust { - - [CoreImageFilterProperty ("inputColor")] - CIColor Color { get; set; } + interface CIWhitePointAdjust : CIWhitePointAdjustProtocol { } [CoreImageFilter] [iOS (8,3)] [BaseType (typeof (CIFilter))] - interface CIZoomBlur { - - [CoreImageFilterProperty ("inputAmount")] - float Amount { get; set; } - + interface CIZoomBlur : CIZoomBlurProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputCenter' instead.")] [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } +#endif } [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CIDepthOfField { - - [CoreImageFilterProperty ("inputUnsharpMaskIntensity")] - float UnsharpMaskIntensity { get; set; } - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } + interface CIDepthOfField : CIDepthOfFieldProtocol { +#if !XAMCORE_4_0 // renamed 1 vs 0 for API compatibility + [Obsolete ("Use 'InputPoint0' instead.")] [CoreImageFilterProperty ("inputPoint0")] CIVector Point1 { get; set; } // renamed 2 vs 1 for API compatibility + [Obsolete ("Use 'InputPoint1' instead.")] [CoreImageFilterProperty ("inputPoint1")] CIVector Point2 { get; set; } - - [CoreImageFilterProperty ("inputUnsharpMaskRadius")] - float UnsharpMaskRadius { get; set; } - - [CoreImageFilterProperty ("inputSaturation")] - float Saturation { get; set; } +#endif } [CoreImageFilter] [iOS (9,0)] [BaseType (typeof (CIFilter))] - interface CISunbeamsGenerator { - - [CoreImageFilterProperty ("inputStriationContrast")] - float StriationContrast { get; set; } - - [CoreImageFilterProperty ("inputColor")] - CIColor Color { get; set; } - - [CoreImageFilterProperty ("inputTime")] - float Time { get; set; } - - [CoreImageFilterProperty ("inputMaxStriationRadius")] - float MaxStriationRadius { get; set; } - + interface CISunbeamsGenerator : CISunbeamsGeneratorProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputCenter' instead.")] [CoreImageFilterProperty ("inputCenter")] CIVector Center { get; set; } - - [CoreImageFilterProperty ("inputSunRadius")] - float SunRadius { get; set; } - - [CoreImageFilterProperty ("inputStriationStrength")] - float StriationStrength { get; set; } +#endif #if !XAMCORE_3_0 // binding mistake - it should never been added @@ -4646,13 +4485,9 @@ namespace CoreImage { [iOS (9,3)] [TV (9,2)] - [Availability (Introduced = Platform.Mac_10_10, Obsoleted = Platform.Mac_10_11)] // FIXME: Is htis actually deprecated? Seems to be missing in El Capitan [CoreImageFilter] [BaseType (typeof (CIFilter))] - interface CIMaskedVariableBlur { - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } + interface CIMaskedVariableBlur : CIMaskedVariableBlurProtocol { } [CoreImageFilter] @@ -4662,6 +4497,9 @@ namespace CoreImage { [BaseType (typeof (CIFilter))] interface CIClamp { + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputExtent")] CIVector Extent { get; set; } } @@ -4671,22 +4509,7 @@ namespace CoreImage { [Mac (10,12)] [TV (10,0)] [BaseType (typeof (CIFilter))] - interface CIHueSaturationValueGradient { - - [CoreImageFilterProperty ("inputColorSpace")] - CGColorSpace ColorSpace { get; set; } - - [CoreImageFilterProperty ("inputDither")] - float Dither { get; set; } - - [CoreImageFilterProperty ("inputValue")] - float Value { get; set; } - - [CoreImageFilterProperty ("inputRadius")] - float Radius { get; set; } - - [CoreImageFilterProperty ("inputSoftness")] - float Softness { get; set; } + interface CIHueSaturationValueGradient : CIHueSaturationValueGradientProtocol { } [CoreImageFilter] @@ -4696,6 +4519,9 @@ namespace CoreImage { [BaseType (typeof (CIFilter))] interface CINinePartStretched { + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputGrowAmount")] CIVector GrowAmount { get; set; } @@ -4713,6 +4539,9 @@ namespace CoreImage { [BaseType (typeof (CIFilter))] interface CINinePartTiled { + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputGrowAmount")] CIVector GrowAmount { get; set; } @@ -4731,7 +4560,7 @@ namespace CoreImage { [Mac (10,12)] // filter says 10.11 but it fails when I run it on El Capitan [TV (10,0)] [BaseType (typeof (CIFilter))] - interface CIThermal { + interface CIThermal : CIThermalProtocol { } [CoreImageFilter] @@ -4739,7 +4568,7 @@ namespace CoreImage { [Mac (10,12)] // filter says 10.11 but it fails when I run it on El Capitan [TV (10,0)] [BaseType (typeof (CIFilter))] - interface CIXRay { + interface CIXRay : CIXRayProtocol { } [CoreImageFilter] @@ -4768,9 +4597,7 @@ namespace CoreImage { [Mac (10,13)] [TV (11,0)] [BaseType (typeof (CIImageGenerator))] - interface CIAttributedTextImageGenerator { - [CoreImageFilterProperty ("inputText")] - NSAttributedString Text { get; set; } + interface CIAttributedTextImageGenerator : CIAttributedTextImageGeneratorProtocol { } [CoreImageFilter] @@ -4778,9 +4605,22 @@ namespace CoreImage { [Mac (10,13)] [TV (11,0)] [BaseType (typeof (CIFilter))] - interface CIBarcodeGenerator { - [CoreImageFilterProperty ("inputBarcodeDescriptor")] - CIBarcodeDescriptor BarcodeDescriptor { get; set; } + interface CIBarcodeGenerator : CIBarcodeGeneratorProtocol { + + [CoreImageFilterProperty ("outputCGImageForQRCodeDescriptor")] + CGImage OutputCGImageForQRCodeDescriptor { get; } + + [CoreImageFilterProperty ("outputCGImageForPDF417CodeDescriptor")] + CGImage OutputCGImageForPdf417CodeDescriptor { get; } + + [CoreImageFilterProperty ("outputCGImageForDataMatrixCodeDescriptor")] + CGImage OutputCGImageForDataMatrixCodeDescriptor { get; } + + [CoreImageFilterProperty ("outputCGImageForAztecCodeDescriptor")] + CGImage OutputCGImageForAztecCodeDescriptor { get; } + + [CoreImageFilterProperty ("outputCGImage")] + CGImage OutputCGImage { get; } } [CoreImageFilter] @@ -4790,18 +4630,17 @@ namespace CoreImage { // Maybe 'typeof (CIScaleTransform)' (shared 'Scale' and 'AspectRatio' property). // It's possible to add ours but it can bite us back in the future if Apple introduce the same with different properties. [BaseType (typeof (CIFilter))] - interface CIBicubicScaleTransform { + interface CIBicubicScaleTransform : CIBicubicScaleTransformProtocol { + +#if !XAMCORE_4_0 + [Obsolete ("Use 'ParameterB' instead.")] [CoreImageFilterProperty ("inputB")] float B { get; set; } + [Obsolete ("Use 'ParameterC' instead.")] [CoreImageFilterProperty ("inputC")] float C { get; set; } - - [CoreImageFilterProperty ("inputScale")] - float Scale { get; set; } - - [CoreImageFilterProperty ("inputAspectRatio")] - float AspectRatio { get; set; } +#endif } [CoreImageFilter] @@ -4817,15 +4656,7 @@ namespace CoreImage { [Mac (10,13)] [TV (11,0)] [BaseType (typeof (CILinearBlur))] - interface CIBokehBlur { - [CoreImageFilterProperty ("inputSoftness")] - float Softness { get; set; } - - [CoreImageFilterProperty ("inputRingSize")] - float RingSize { get; set; } - - [CoreImageFilterProperty ("inputRingAmount")] - float RingAmount { get; set; } + interface CIBokehBlur : CIBokehBlurProtocol { } [CoreImageFilter] @@ -4833,21 +4664,7 @@ namespace CoreImage { [Mac (10,13)] [TV (11,0)] [BaseType (typeof (CIFilter))] // Could almost be typeof 'CIColorCube' but property is 'inputCube0Data' not 'inputCubeData' - interface CIColorCubesMixedWithMask { - [CoreImageFilterProperty ("inputCubeDimension")] - float CubeDimension { get; set; } - - [CoreImageFilterProperty ("inputMaskImage")] - CIImage MaskImage { get; set; } - - [CoreImageFilterProperty ("inputCube0Data")] - NSData Cube0Data { get; set; } - - [CoreImageFilterProperty ("inputCube1Data")] - NSData Cube1Data { get; set; } - - [CoreImageFilterProperty ("inputColorSpace")] - CGColorSpace ColorSpace { get; set; } + interface CIColorCubesMixedWithMask : CIColorCubesMixedWithMaskProtocol { } [CoreImageFilter] @@ -4855,15 +4672,7 @@ namespace CoreImage { [Mac (10,13)] [TV (11,0)] [BaseType (typeof (CIFilter))] - interface CIColorCurves { - [CoreImageFilterProperty ("inputColorSpace")] - CGColorSpace ColorSpace { get; set; } - - [CoreImageFilterProperty ("inputCurvesDomain")] - CIVector CurvesDomain { get; set; } - - [CoreImageFilterProperty ("inputCurvesData")] - NSData CurvesData { get; set; } + interface CIColorCurves : CIColorCurvesProtocol { } [CoreImageFilter] @@ -4872,6 +4681,10 @@ namespace CoreImage { [TV (11,0)] [BaseType (typeof (CIFilter))] interface CIDepthBlurEffect { + + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputAperture")] float Aperture { get; set; } @@ -4906,6 +4719,18 @@ namespace CoreImage { [CoreImageFilterProperty ("inputFocusRect")] CIVector FocusRect { get; set; } + + [CoreImageFilterProperty ("inputMatteImage")] + CIImage MatteImage { get; set; } + + [CoreImageFilterProperty ("inputHairImage")] + CIImage HairImage { get; set; } + + [CoreImageFilterProperty ("inputShape")] + string Shape { get; set; } + + [CoreImageFilterProperty ("inputAuxDataMetadata")] + CGImageMetadata AuxDataMetadata { get; set; } } [CoreImageFilter] @@ -4921,29 +4746,15 @@ namespace CoreImage { [Mac (10,13)] [TV (11,0)] [BaseType (typeof (CIDepthDisparityConverter))] - interface CIDepthToDisparity {} + interface CIDepthToDisparity : CIDepthToDisparityProtocol { + } [CoreImageFilter] [iOS (11,0)] [Mac (10,13)] [TV (11,0)] [BaseType (typeof (CIDepthDisparityConverter))] - interface CIDisparityToDepth {} - - [CoreImageFilter] - [iOS (11,0)] - [Mac (10,13)] - [TV (11,0)] - [BaseType (typeof (CIFilter))] - interface CIEdgePreserveUpsampleFilter { - [CoreImageFilterProperty ("inputLumaSigma")] - float LumaSigma { get; set; } - - [CoreImageFilterProperty ("inputSmallImage")] - CIImage SmallImage { get; set; } - - [CoreImageFilterProperty ("inputSpatialSigma")] - float SpatialSigma { get; set; } + interface CIDisparityToDepth : CIDisparityToDepthProtocol { } [CoreImageFilter] @@ -4951,9 +4762,15 @@ namespace CoreImage { [Mac (10,13)] [TV (11,0)] [BaseType (typeof (CIFilter))] - interface CILabDeltaE { - [CoreImageFilterProperty ("inputImage2")] - CIImage Image2 { get; set; } + interface CIEdgePreserveUpsampleFilter : CIEdgePreserveUpsampleProtocol { + } + + [CoreImageFilter] + [iOS (11,0)] + [Mac (10,13)] + [TV (11,0)] + [BaseType (typeof (CIFilter))] + interface CILabDeltaE : CILabDeltaEProtocol { } [CoreImageFilter] @@ -4961,15 +4778,7 @@ namespace CoreImage { [Mac (10,13)] [TV (11,0)] [BaseType (typeof (CIImageGenerator))] - interface CITextImageGenerator { - [CoreImageFilterProperty ("inputText")] - string Text { get; set; } - - [CoreImageFilterProperty ("inputFontName")] - string FontName { get; set; } - - [CoreImageFilterProperty ("inputFontSize")] - float FontSize { get; set; } + interface CITextImageGenerator : CITextImageGeneratorProtocol { } [CoreImageFilter] @@ -4988,21 +4797,24 @@ namespace CoreImage { [Mac (10,13)] [TV (11,0)] [BaseType (typeof (CIMorphology))] - interface CIMorphologyGradient {} + interface CIMorphologyGradient : CIMorphologyGradientProtocol { + } [CoreImageFilter] [iOS (11,0)] [Mac (10,13)] [TV (11,0)] [BaseType (typeof (CIMorphology))] - interface CIMorphologyMaximum {} + interface CIMorphologyMaximum : CIMorphologyMaximumProtocol { + } [CoreImageFilter] [iOS (11,0)] [Mac (10,13)] [TV (11,0)] [BaseType (typeof (CIMorphology))] - interface CIMorphologyMinimum {} + interface CIMorphologyMinimum : CIMorphologyMinimumProtocol { + } [CoreImageFilter] [iOS (11,0)] @@ -5153,6 +4965,11 @@ namespace CoreImage { [return: NullAllowed] CIImage Apply (CIImage foreground, CIImage background); + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Export ("applyWithForeground:background:colorSpace:")] + [return: NullAllowed] + CIImage Apply (CIImage foreground, CIImage background, CGColorSpace colorSpace); + // @interface BuiltIn (CIBlendKernel) [Static] @@ -5452,6 +5269,22 @@ namespace CoreImage { [TV (12, 0), iOS (12, 0), Mac (10, 14)] [Field ("kCIImageRepresentationPortraitEffectsMatteImage")] NSString PortraitEffectsMatteImageKey { get; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Field ("kCIImageRepresentationAVSemanticSegmentationMattes")] + NSString SemanticSegmentationMattesKey { get; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Field ("kCIImageRepresentationSemanticSegmentationSkinMatteImage")] + NSString SemanticSegmentationSkinMatteImageKey { get; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Field ("kCIImageRepresentationSemanticSegmentationHairMatteImage")] + NSString SemanticSegmentationHairMatteImageKey { get; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + [Field ("kCIImageRepresentationSemanticSegmentationTeethMatteImage")] + NSString SemanticSegmentationTeethMatteImageKey { get; } } [iOS (11,0)] @@ -5462,17 +5295,29 @@ namespace CoreImage { float LossyCompressionQuality { get; set; } -#if false // keys lack documentation (or sample) to expose properly - https://bugzilla.xamarin.com/show_bug.cgi?id=59296 - bool AVDepthData { get; set; } + AVDepthData AVDepthData { get; set; } - bool DepthImage { get; set; } + CIImage DepthImage { get; set; } - bool DisparityImage { get; set; } + CIImage DisparityImage { get; set; } + + [TV (12, 0), iOS (12, 0), Mac (10, 14)] + CIImage PortraitEffectsMatteImage { get; set; } - bool PortraitEffectsMatteImage { get; set; } -#endif [TV (12, 0), iOS (12, 0), Mac (10, 14)] AVPortraitEffectsMatte AVPortraitEffectsMatte { get; set; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + AVSemanticSegmentationMatte[] SemanticSegmentationMattes { get; set; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + CIImage SemanticSegmentationSkinMatteImage { get; set; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + CIImage SemanticSegmentationHairMatteImage { get; set; } + + [iOS (13,0)][TV (13,0)][Mac (10,15)] + CIImage SemanticSegmentationTeethMatteImage { get; set; } } [CoreImageFilter] @@ -5481,6 +5326,14 @@ namespace CoreImage { [Mac (10,14)] [BaseType (typeof (CIReductionFilter))] interface CIAreaMinMax { + + [CoreImageFilterProperty ("outputImageNonMPS")] + CIImage OutputImageNonMps { get; } + +#if MONOMAC + [CoreImageFilterProperty ("outputImageMPS")] + CIImage OutputImageMps { get; } +#endif } [CoreImageFilter] @@ -5488,9 +5341,7 @@ namespace CoreImage { [TV (12,0)] [Mac (10,14)] [BaseType (typeof (CIFilter))] - interface CIDither { - [CoreImageFilterProperty ("inputIntensity")] - float Intensity { get; set; } + interface CIDither : CIDitherProtocol { } [CoreImageFilter] @@ -5499,10 +5350,16 @@ namespace CoreImage { [Mac (10,14)] [BaseType (typeof (CIFilter))] interface CIGuidedFilter { + + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputGuideImage")] CIImage GuideImage { get; set; } + [CoreImageFilterProperty ("inputEpsilon")] float Epsilon { get; set; } + [CoreImageFilterProperty ("inputRadius")] float Radius { get; set; } } @@ -5512,13 +5369,7 @@ namespace CoreImage { [TV (12,0)] [Mac (10,14)] [BaseType (typeof (CIFilter))] - interface CIMeshGenerator { - [CoreImageFilterProperty ("inputMesh")] - CIVector [] Mesh { get; set; } - [CoreImageFilterProperty ("inputWidth")] - float Width { get; set; } - [CoreImageFilterProperty ("inputColor")] - CIColor Color { get; set; } + interface CIMeshGenerator : CIMeshGeneratorProtocol { } [CoreImageFilter] @@ -5526,11 +5377,7 @@ namespace CoreImage { [TV (12,0)] [Mac (10,14)] [BaseType (typeof (CIFilter))] - interface CIMix { - [CoreImageFilterProperty ("inputBackgroundImage")] - CIImage BackgroundImage { get; set; } - [CoreImageFilterProperty ("inputAmount")] - float Amount { get; set; } + interface CIMix : CIMixProtocol { } [CoreImageFilter] @@ -5539,6 +5386,9 @@ namespace CoreImage { [Mac (10,14)] [BaseType (typeof (CIFilter))] interface CISampleNearest { + + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } } [CoreImageFilter] @@ -5547,6 +5397,10 @@ namespace CoreImage { [Mac (10,14)] [BaseType (typeof (CIFilter))] interface CICameraCalibrationLensCorrection { + + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputAVCameraCalibrationData")] AVCameraCalibrationData AVCameraCalibrationData { get; set; } @@ -5560,8 +5414,18 @@ namespace CoreImage { [Mac (10,14)] [BaseType (typeof (CIFilter))] interface CICoreMLModelFilter { + + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + [CoreImageFilterProperty ("inputModel")] MLModel Model { get; set; } + + [CoreImageFilterProperty ("inputHeadIndex")] + int HeadIndex { get; set; } + + [CoreImageFilterProperty ("inputSoftmaxNormalization")] + bool SoftmaxNormalization { get; set; } } [CoreImageFilter] @@ -5569,7 +5433,7 @@ namespace CoreImage { [TV (12,0)] [Mac (10,14)] [BaseType (typeof (CIFilter))] - interface CISaliencyMapFilter { + interface CISaliencyMapFilter : CISaliencyMapProtocol { } [CoreImageFilter] @@ -5577,10 +5441,7 @@ namespace CoreImage { [TV (13,0)] [Mac (10,15)] [BaseType (typeof (CIFilter))] - interface CIDocumentEnhancer { - - [CoreImageFilterProperty ("inputAmount")] - float Amount { get; set; } + interface CIDocumentEnhancer : CIDocumentEnhancerProtocol { } [CoreImageFilter] @@ -5611,11 +5472,21 @@ namespace CoreImage { [Abstract] interface CIMorphologyRectangle { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputHeight' instead.")] [CoreImageFilterProperty ("inputHeight")] int Height { get; set; } + [Obsolete ("Use 'InputWidth' instead.")] [CoreImageFilterProperty ("inputWidth")] int Width { get; set; } +#endif + + [CoreImageFilterProperty ("inputHeight")] + float InputHeight { get; set; } + + [CoreImageFilterProperty ("inputWidth")] + float InputWidth { get; set; } } [CoreImageFilter] @@ -5623,7 +5494,7 @@ namespace CoreImage { [TV (13,0)] [Mac (10,15)] [BaseType (typeof (CIMorphologyRectangle))] - interface CIMorphologyRectangleMaximum { + interface CIMorphologyRectangleMaximum : CIMorphologyRectangleMaximumProtocol { } [CoreImageFilter] @@ -5631,7 +5502,7 @@ namespace CoreImage { [TV (13,0)] [Mac (10,15)] [BaseType (typeof (CIMorphologyRectangle))] - interface CIMorphologyRectangleMinimum { + interface CIMorphologyRectangleMinimum : CIMorphologyRectangleMinimumProtocol { } [CoreImageFilter] @@ -5639,13 +5510,7 @@ namespace CoreImage { [TV (13,0)] [Mac (10,15)] [BaseType (typeof (CIFilter))] - interface CIPaletteCentroid { - - [CoreImageFilterProperty ("inputPaletteImage")] - CIImage PaletteImage { get; set; } - - [CoreImageFilterProperty ("inputPerceptual")] - bool Perceptual { get; set; } + interface CIPaletteCentroid : CIPaletteCentroidProtocol { } [CoreImageFilter] @@ -5653,13 +5518,7 @@ namespace CoreImage { [TV (13,0)] [Mac (10,15)] [BaseType (typeof (CIFilter))] - interface CIPalettize { - - [CoreImageFilterProperty ("inputPaletteImage")] - CIImage PaletteImage { get; set; } - - [CoreImageFilterProperty ("inputPerceptual")] - bool Perceptual { get; set; } + interface CIPalettize : CIPalettizeProtocol { } [CoreImageFilter] @@ -5673,17 +5532,35 @@ namespace CoreImage { [CoreImageFilterProperty ("inputFocalLength")] float FocalLength { get; set; } +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputTopRight' instead.")] [CoreImageFilterProperty ("inputTopRight")] CIVector TopRight { get; set; } + [Obsolete ("Use 'InputBottomRight' instead.")] [CoreImageFilterProperty ("inputBottomRight")] CIVector BottomRight { get; set; } + [Obsolete ("Use 'InputTopLeft' instead.")] [CoreImageFilterProperty ("inputTopLeft")] CIVector TopLeft { get; set; } + [Obsolete ("Use 'InputBottomLeft' instead.")] [CoreImageFilterProperty ("inputBottomLeft")] CIVector BottomLeft { get; set; } +#endif + + [CoreImageFilterProperty ("inputTopRight")] + CGPoint InputTopRight { get; set; } + + [CoreImageFilterProperty ("inputBottomRight")] + CGPoint InputBottomRight { get; set; } + + [CoreImageFilterProperty ("inputTopLeft")] + CGPoint InputTopLeft { get; set; } + + [CoreImageFilterProperty ("inputBottomLeft")] + CGPoint InputBottomLeft { get; set; } } [CoreImageFilter] @@ -5691,7 +5568,10 @@ namespace CoreImage { [TV (13,0)] [Mac (10,15)] [BaseType (typeof (CIKeystoneCorrection))] - interface CIKeystoneCorrectionCombined { + interface CIKeystoneCorrectionCombined : CIKeystoneCorrectionCombinedProtocol { + + [CoreImageFilterProperty ("outputTransform")] + CGAffineTransform OutputTransform { get; } } [CoreImageFilter] @@ -5699,7 +5579,15 @@ namespace CoreImage { [TV (13,0)] [Mac (10,15)] [BaseType (typeof (CIKeystoneCorrection))] - interface CIKeystoneCorrectionHorizontal { + interface CIKeystoneCorrectionHorizontal : CIKeystoneCorrectionHorizontalProtocol { + +#if false // no documentation about the type + [CoreImageFilterProperty ("outputRotationFilter")] + NSObject OutputRotationFilter { get; } +#endif + + [CoreImageFilterProperty ("outputTransform")] + CGAffineTransform OutputTransform { get; } } [CoreImageFilter] @@ -5707,7 +5595,15 @@ namespace CoreImage { [TV (13,0)] [Mac (10,15)] [BaseType (typeof (CIKeystoneCorrection))] - interface CIKeystoneCorrectionVertical { + interface CIKeystoneCorrectionVertical : CIKeystoneCorrectionVerticalProtocol { + +#if false // no documentation about the type + [CoreImageFilterProperty ("outputRotationFilter")] + CGAffineTransform OutputRotationFilter { get; } +#endif + + [CoreImageFilterProperty ("outputTransform")] + CGAffineTransform OutputTransform { get; } } [CoreImageFilter] @@ -5715,19 +5611,10 @@ namespace CoreImage { [TV (13,0)] [Mac (10,15)] [BaseType (typeof (CIFilter))] - interface CIPerspectiveRotate { + interface CIPerspectiveRotate : CIPerspectiveRotateProtocol { - [CoreImageFilterProperty ("inputFocalLength")] - float FocalLength { get; set; } - - [CoreImageFilterProperty ("inputRoll")] - float Roll { get; set; } - - [CoreImageFilterProperty ("inputPitch")] - float Pitch { get; set; } - - [CoreImageFilterProperty ("inputYaw")] - float Yaw { get; set; } + [CoreImageFilterProperty ("outputTransform")] + CGAffineTransform OutputTransform { get; } } [CoreImageFilter] @@ -5735,7 +5622,7 @@ namespace CoreImage { [TV (13,0)] [Mac (10,15)] [BaseType (typeof (CIFilter))] - interface CIGaborGradients { + interface CIGaborGradients : CIGaborGradientsProtocol { } [CoreImageFilter] @@ -5743,15 +5630,2980 @@ namespace CoreImage { [TV (13,0)] [Mac (10,15)] [BaseType (typeof (CIFilter))] - interface CIRoundedRectangleGenerator { + interface CIRoundedRectangleGenerator : CIRoundedRectangleGeneratorProtocol { +#if !XAMCORE_4_0 + [Obsolete ("Use 'InputExtent' instead.")] [CoreImageFilterProperty ("inputExtent")] CIVector Extent { get; set; } +#endif + } - [CoreImageFilterProperty ("inputRadius")] +#region Protocols + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIFilter")] + // CIFilter already exists so we're using the Swift name + interface CIFilterProtocol { + + [Abstract] + [CoreImageFilterProperty ("outputImage")] + [NullAllowed, Export ("outputImage")] + CIImage OutputImage { get; } + + [Static] + [NullAllowed, Export ("customAttributes")] + NSDictionary CustomAttributes { get; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CITransitionFilter")] + interface CITransitionFilterProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [NullAllowed, Export ("targetImage", ArgumentSemantic.Retain)] + CIImage TargetImage { get; set; } + + [Abstract] + [Export ("time")] + float Time { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIAccordionFoldTransition")] + interface CIAccordionFoldTransitionProtocol : CITransitionFilterProtocol { + + [Abstract] + [Export ("bottomHeight")] + float BottomHeight { get; set; } + + [Abstract] + [Export ("numberOfFolds")] + // renamed for compatibility (originally bound as an integer) + float FoldCount { get; set; } + + [Abstract] + [Export ("foldShadowAmount")] + float FoldShadowAmount { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIAffineClamp")] + interface CIAffineClampProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("transform", ArgumentSemantic.Assign)] + CGAffineTransform Transform { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIAffineTile")] + interface CIAffineTileProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("transform", ArgumentSemantic.Assign)] + CGAffineTransform Transform { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIAttributedTextImageGenerator")] + interface CIAttributedTextImageGeneratorProtocol : CIFilterProtocol { + + [Abstract] + [Export ("text", ArgumentSemantic.Retain)] + NSAttributedString Text { get; set; } + + [Abstract] + [Export ("scaleFactor")] + float ScaleFactor { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIAztecCodeGenerator")] + interface CIAztecCodeGeneratorProtocol : CIFilterProtocol { + + [Abstract] + [Export ("message", ArgumentSemantic.Retain)] + NSData Message { get; set; } + + [Abstract] + [Export ("correctionLevel")] + float CorrectionLevel { get; set; } + + [Abstract] + [Export ("layers")] + float InputLayers { get; set; } + + [Abstract] + [Export ("compactStyle")] + float InputCompactStyle { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIBarcodeGenerator")] + interface CIBarcodeGeneratorProtocol : CIFilterProtocol { + + [Abstract] + [Export ("barcodeDescriptor", ArgumentSemantic.Retain)] + CIBarcodeDescriptor BarcodeDescriptor { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIBarsSwipeTransition")] + interface CIBarsSwipeTransitionProtocol : CITransitionFilterProtocol { + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + + [Abstract] + [Export ("barOffset")] + float BarOffset { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIBicubicScaleTransform")] + interface CIBicubicScaleTransformProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("scale")] + float Scale { get; set; } + + [Abstract] + [Export ("aspectRatio")] + float AspectRatio { get; set; } + + [Abstract] + [CoreImageFilterProperty ("inputB")] // name differs from the export + [Export ("parameterB")] + float ParameterB { get; set; } + + [Abstract] + [CoreImageFilterProperty ("inputC")] // name differs from the export + [Export ("parameterC")] + float ParameterC { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIBlendWithMask")] + interface CIBlendWithMaskProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [NullAllowed, Export ("backgroundImage", ArgumentSemantic.Retain)] + CIImage BackgroundImage { get; set; } + + [Abstract] + [NullAllowed, Export ("maskImage", ArgumentSemantic.Retain)] + CIImage MaskImage { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIBloom")] + interface CIBloomProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("radius")] float Radius { get; set; } - [CoreImageFilterProperty ("inputColor")] + [Abstract] + [Export ("intensity")] + float Intensity { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIBokehBlur")] + interface CIBokehBlurProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + + [Abstract] + [Export ("ringAmount")] + float RingAmount { get; set; } + + [Abstract] + [Export ("ringSize")] + float RingSize { get; set; } + + [Abstract] + [Export ("softness")] + float Softness { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIBoxBlur")] + interface CIBoxBlurProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CICheckerboardGenerator")] + interface CICheckerboardGeneratorProtocol : CIFilterProtocol { + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("color0", ArgumentSemantic.Retain)] + CIColor Color0 { get; set; } + + [Abstract] + [Export ("color1", ArgumentSemantic.Retain)] + CIColor Color1 { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + + [Abstract] + [Export ("sharpness")] + float Sharpness { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CICircularScreen")] + interface CICircularScreenProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + + [Abstract] + [Export ("sharpness")] + float Sharpness { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CICMYKHalftone")] + interface CICmykHalftoneProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("sharpness")] + float Sharpness { get; set; } + + [Abstract] + [CoreImageFilterProperty ("inputGCR")] + [Export ("grayComponentReplacement")] + float GrayComponentReplacement { get; set; } + + [Abstract] + [CoreImageFilterProperty ("inputUCR")] + [Export ("underColorRemoval")] + float UnderColorRemoval { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CICode128BarcodeGenerator")] + interface CICode128BarcodeGeneratorProtocol : CIFilterProtocol { + + [Abstract] + [Export ("message", ArgumentSemantic.Retain)] + NSData Message { get; set; } + + [Abstract] + [Export ("quietSpace")] + float QuietSpace { get; set; } + + [Abstract] + [Export ("barcodeHeight")] + float BarcodeHeight { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIColorClamp")] + interface CIColorClampProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("minComponents", ArgumentSemantic.Retain)] + CIVector MinComponents { get; set; } + + [Abstract] + [Export ("maxComponents", ArgumentSemantic.Retain)] + CIVector MaxComponents { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIColorControls")] + interface CIColorControlsProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("saturation")] + float Saturation { get; set; } + + [Abstract] + [Export ("brightness")] + float Brightness { get; set; } + + [Abstract] + [Export ("contrast")] + float Contrast { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIColorCrossPolynomial")] + interface CIColorCrossPolynomialProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("redCoefficients", ArgumentSemantic.Retain)] + CIVector RedCoefficients { get; set; } + + [Abstract] + [Export ("greenCoefficients", ArgumentSemantic.Retain)] + CIVector GreenCoefficients { get; set; } + + [Abstract] + [Export ("blueCoefficients", ArgumentSemantic.Retain)] + CIVector BlueCoefficients { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIColorCube")] + interface CIColorCubeProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("cubeDimension")] + float CubeDimension { get; set; } + + [Abstract] + [Export ("cubeData", ArgumentSemantic.Retain)] + NSData CubeData { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIColorCubesMixedWithMask")] + interface CIColorCubesMixedWithMaskProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [NullAllowed, Export ("maskImage", ArgumentSemantic.Retain)] + CIImage MaskImage { get; set; } + + [Abstract] + [Export ("cubeDimension")] + float CubeDimension { get; set; } + + [Abstract] + [Export ("cube0Data", ArgumentSemantic.Retain)] + NSData Cube0Data { get; set; } + + [Abstract] + [Export ("cube1Data", ArgumentSemantic.Retain)] + NSData Cube1Data { get; set; } + + [Abstract] + [NullAllowed, Export ("colorSpace", ArgumentSemantic.Assign)] + CGColorSpace ColorSpace { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIColorCubeWithColorSpace")] + interface CIColorCubeWithColorSpaceProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("cubeDimension")] + float CubeDimension { get; set; } + + [Abstract] + [Export ("cubeData", ArgumentSemantic.Retain)] + NSData CubeData { get; set; } + + [Abstract] + [NullAllowed, Export ("colorSpace", ArgumentSemantic.Assign)] + CGColorSpace ColorSpace { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIColorCurves")] + interface CIColorCurvesProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("curvesData", ArgumentSemantic.Retain)] + NSData CurvesData { get; set; } + + [Abstract] + [Export ("curvesDomain", ArgumentSemantic.Retain)] + CIVector CurvesDomain { get; set; } + + [Abstract] + [NullAllowed, Export ("colorSpace", ArgumentSemantic.Assign)] + CGColorSpace ColorSpace { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIColorInvert")] + interface CIColorInvertProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIColorMap")] + interface CIColorMapProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [NullAllowed, Export ("gradientImage", ArgumentSemantic.Retain)] + CIImage GradientImage { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIColorMatrix")] + interface CIColorMatrixProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("RVector", ArgumentSemantic.Retain)] + CIVector RVector { get; set; } + + [Abstract] + [Export ("GVector", ArgumentSemantic.Retain)] + CIVector GVector { get; set; } + + [Abstract] + [Export ("BVector", ArgumentSemantic.Retain)] + CIVector BVector { get; set; } + + [Abstract] + [Export ("AVector", ArgumentSemantic.Retain)] + CIVector AVector { get; set; } + + [Abstract] + [Export ("biasVector", ArgumentSemantic.Retain)] + CIVector BiasVector { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIColorMonochrome")] + interface CIColorMonochromeProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("color", ArgumentSemantic.Retain)] + CIColor Color { get; set; } + + [Abstract] + [Export ("intensity")] + float Intensity { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIColorPolynomial")] + interface CIColorPolynomialProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("redCoefficients", ArgumentSemantic.Retain)] + CIVector RedCoefficients { get; set; } + + [Abstract] + [Export ("greenCoefficients", ArgumentSemantic.Retain)] + CIVector GreenCoefficients { get; set; } + + [Abstract] + [Export ("blueCoefficients", ArgumentSemantic.Retain)] + CIVector BlueCoefficients { get; set; } + + [Abstract] + [Export ("alphaCoefficients", ArgumentSemantic.Retain)] + CIVector AlphaCoefficients { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIColorPosterize")] + interface CIColorPosterizeProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("levels")] + float Levels { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIComicEffect")] + interface CIComicEffectProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CICompositeOperation")] + interface CICompositeOperationProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [NullAllowed, Export ("backgroundImage", ArgumentSemantic.Retain)] + CIImage BackgroundImage { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIConvolution")] + interface CIConvolutionProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("weights", ArgumentSemantic.Retain)] + CIVector Weights { get; set; } + + [Abstract] + [Export ("bias")] + float Bias { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CICopyMachineTransition")] + interface CICopyMachineTransitionProtocol : CIFilterProtocol { + + [Abstract] + [Export ("extent", ArgumentSemantic.Assign)] + CGRect Extent { get; set; } + + [Abstract] + [Export ("color", ArgumentSemantic.Retain)] + CIColor Color { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + + [Abstract] + [Export ("opacity")] + float Opacity { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CICoreMLModel")] + interface CICoreMLModelProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("model", ArgumentSemantic.Retain)] + MLModel Model { get; set; } + + [Abstract] + [Export ("headIndex")] + float HeadIndex { get; set; } + + [Abstract] + [Export ("softmaxNormalization")] + bool SoftmaxNormalization { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CICrystallize")] + interface CICrystallizeProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIDepthOfField")] + interface CIDepthOfFieldProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("point0", ArgumentSemantic.Assign)] + CGPoint InputPoint0 { get; set; } + + [Abstract] + [Export ("point1", ArgumentSemantic.Assign)] + CGPoint InputPoint1 { get; set; } + + [Abstract] + [Export ("saturation")] + float Saturation { get; set; } + + [Abstract] + [Export ("unsharpMaskRadius")] + float UnsharpMaskRadius { get; set; } + + [Abstract] + [Export ("unsharpMaskIntensity")] + float UnsharpMaskIntensity { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIDepthToDisparity")] + interface CIDepthToDisparityProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIDiscBlur")] + interface CIDiscBlurProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIDisintegrateWithMaskTransition")] + interface CIDisintegrateWithMaskTransitionProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("maskImage", ArgumentSemantic.Retain)] + CIImage MaskImage { get; set; } + + [Abstract] + [Export ("shadowRadius")] + float ShadowRadius { get; set; } + + [Abstract] + [Export ("shadowDensity")] + float ShadowDensity { get; set; } + + [Abstract] + [Export ("shadowOffset", ArgumentSemantic.Assign)] + CGPoint InputShadowOffset { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIDisparityToDepth")] + interface CIDisparityToDepthProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIDissolveTransition")] + interface CIDissolveTransitionProtocol : CIFilterProtocol { + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIDither")] + interface CIDitherProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("intensity")] + float Intensity { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIDocumentEnhancer")] + interface CIDocumentEnhancerProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("amount")] + float Amount { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIDotScreen")] + interface CIDotScreenProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + + [Abstract] + [Export ("sharpness")] + float Sharpness { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIEdgePreserveUpsample")] + interface CIEdgePreserveUpsampleProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [NullAllowed, Export ("smallImage", ArgumentSemantic.Retain)] + CIImage SmallImage { get; set; } + + [Abstract] + [Export ("spatialSigma")] + float SpatialSigma { get; set; } + + [Abstract] + [Export ("lumaSigma")] + float LumaSigma { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIEdges")] + interface CIEdgesProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("intensity")] + float Intensity { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIEdgeWork")] + interface CIEdgeWorkProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIEightfoldReflectedTile")] + interface CIEightfoldReflectedTileProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIExposureAdjust")] + interface CIExposureAdjustProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("EV")] + float EV { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIFalseColor")] + interface CIFalseColorProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("color0", ArgumentSemantic.Retain)] + CIColor Color0 { get; set; } + + [Abstract] + [Export ("color1", ArgumentSemantic.Retain)] + CIColor Color1 { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIFlashTransition")] + interface CIFlashTransitionProtocol : CITransitionFilterProtocol { + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("extent", ArgumentSemantic.Assign)] + CGRect InputExtent { get; set; } + + [Abstract] + [Export ("color", ArgumentSemantic.Retain)] + CIColor Color { get; set; } + + [Abstract] + [Export ("maxStriationRadius")] + float MaxStriationRadius { get; set; } + + [Abstract] + [Export ("striationStrength")] + float StriationStrength { get; set; } + + [Abstract] + [Export ("striationContrast")] + float StriationContrast { get; set; } + + [Abstract] + [Export ("fadeThreshold")] + float FadeThreshold { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIFourCoordinateGeometryFilter")] + interface CIFourCoordinateGeometryFilterProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("topLeft", ArgumentSemantic.Assign)] + CGPoint InputTopLeft { get; set; } + + [Abstract] + [Export ("topRight", ArgumentSemantic.Assign)] + CGPoint InputTopRight { get; set; } + + [Abstract] + [Export ("bottomRight", ArgumentSemantic.Assign)] + CGPoint InputBottomRight { get; set; } + + [Abstract] + [Export ("bottomLeft", ArgumentSemantic.Assign)] + CGPoint InputBottomLeft { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIFourfoldReflectedTile")] + interface CIFourfoldReflectedTileProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + + [Abstract] + [Export ("acuteAngle")] + float AcuteAngle { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIFourfoldRotatedTile")] + interface CIFourfoldRotatedTileProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIFourfoldTranslatedTile")] + interface CIFourfoldTranslatedTileProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + + [Abstract] + [Export ("acuteAngle")] + float AcuteAngle { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIGaborGradients")] + interface CIGaborGradientsProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIGammaAdjust")] + interface CIGammaAdjustProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("power")] + float Power { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIGaussianBlur")] + interface CIGaussianBlurProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIGaussianGradient")] + interface CIGaussianGradientProtocol : CIFilterProtocol { + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("color0", ArgumentSemantic.Retain)] + CIColor Color0 { get; set; } + + [Abstract] + [Export ("color1", ArgumentSemantic.Retain)] + CIColor Color1 { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIGlideReflectedTile")] + interface CIGlideReflectedTileProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIGloom")] + interface CIGloomProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + + [Abstract] + [Export ("intensity")] + float Intensity { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIHatchedScreen")] + interface CIHatchedScreenProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + + [Abstract] + [Export ("sharpness")] + float Sharpness { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIHeightFieldFromMask")] + interface CIHeightFieldFromMaskProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIHexagonalPixellate")] + interface CIHexagonalPixellateProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("scale")] + float Scale { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIHighlightShadowAdjust")] + interface CIHighlightShadowAdjustProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + + [Abstract] + [Export ("shadowAmount")] + float ShadowAmount { get; set; } + + [Abstract] + [Export ("highlightAmount")] + float HighlightAmount { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIHueAdjust")] + interface CIHueAdjustProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIHueSaturationValueGradient")] + interface CIHueSaturationValueGradientProtocol : CIFilterProtocol { + + [Abstract] + [Export ("value")] + float Value { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + + [Abstract] + [Export ("softness")] + float Softness { get; set; } + + [Abstract] + [Export ("dither")] + float Dither { get; set; } + + [Abstract] + [NullAllowed, Export ("colorSpace", ArgumentSemantic.Assign)] + CGColorSpace ColorSpace { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIKaleidoscope")] + interface CIKaleidoscopeProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("count")] + nint InputCount { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIKeystoneCorrectionCombined")] + interface CIKeystoneCorrectionCombinedProtocol : CIFourCoordinateGeometryFilterProtocol { + + [Abstract] + [Export ("focalLength")] + float FocalLength { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIKeystoneCorrectionHorizontal")] + interface CIKeystoneCorrectionHorizontalProtocol : CIFourCoordinateGeometryFilterProtocol { + + [Abstract] + [Export ("focalLength")] + float FocalLength { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIKeystoneCorrectionVertical")] + interface CIKeystoneCorrectionVerticalProtocol : CIFourCoordinateGeometryFilterProtocol { + + [Abstract] + [Export ("focalLength")] + float FocalLength { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CILabDeltaE")] + interface CILabDeltaEProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [NullAllowed, Export ("image2", ArgumentSemantic.Retain)] + CIImage Image2 { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CILanczosScaleTransform")] + interface CILanczosScaleTransformProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("scale")] + float Scale { get; set; } + + [Abstract] + [Export ("aspectRatio")] + float AspectRatio { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CILenticularHaloGenerator")] + interface CILenticularHaloGeneratorProtocol : CIFilterProtocol { + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("color", ArgumentSemantic.Retain)] + CIColor Color { get; set; } + + [Abstract] + [Export ("haloRadius")] + float HaloRadius { get; set; } + + [Abstract] + [Export ("haloWidth")] + float HaloWidth { get; set; } + + [Abstract] + [Export ("haloOverlap")] + float HaloOverlap { get; set; } + + [Abstract] + [Export ("striationStrength")] + float StriationStrength { get; set; } + + [Abstract] + [Export ("striationContrast")] + float StriationContrast { get; set; } + + [Abstract] + [Export ("time")] + float Time { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CILinearGradient")] + interface CILinearGradientProtocol : CIFilterProtocol { + + [Abstract] + [Export ("point0", ArgumentSemantic.Assign)] + CGPoint InputPoint0 { get; set; } + + [Abstract] + [Export ("point1", ArgumentSemantic.Assign)] + CGPoint InputPoint1 { get; set; } + + [Abstract] + [Export ("color0", ArgumentSemantic.Retain)] + CIColor Color0 { get; set; } + + [Abstract] + [Export ("color1", ArgumentSemantic.Retain)] + CIColor Color1 { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CILinearToSRGBToneCurve")] + interface CILinearToSrgbToneCurveProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CILineOverlay")] + interface CILineOverlayProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("NRNoiseLevel")] + float NRNoiseLevel { get; set; } + + [Abstract] + [Export ("NRSharpness")] + float NRSharpness { get; set; } + + [Abstract] + [Export ("edgeIntensity")] + float EdgeIntensity { get; set; } + + [Abstract] + [Export ("threshold")] + float Threshold { get; set; } + + [Abstract] + [Export ("contrast")] + float Contrast { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CILineScreen")] + interface CILineScreenProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + + [Abstract] + [Export ("sharpness")] + float Sharpness { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIMaskedVariableBlur")] + interface CIMaskedVariableBlurProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [NullAllowed, Export ("mask", ArgumentSemantic.Retain)] + CIImage Mask { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIMaskToAlpha")] + interface CIMaskToAlphaProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIMaximumComponent")] + interface CIMaximumComponentProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIMedian")] + interface CIMedianProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIMeshGenerator")] + interface CIMeshGeneratorProtocol : CIFilterProtocol { + + [Abstract] + [Export ("width")] + float Width { get; set; } + + [Abstract] + [Export ("color", ArgumentSemantic.Retain)] + CIColor Color { get; set; } + + [Abstract] + [Export ("mesh", ArgumentSemantic.Retain)] + CIVector[] Mesh { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIMinimumComponent")] + interface CIMinimumComponentProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIMix")] + interface CIMixProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [NullAllowed, Export ("backgroundImage", ArgumentSemantic.Retain)] + CIImage BackgroundImage { get; set; } + + [Abstract] + [Export ("amount")] + float Amount { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIModTransition")] + interface CIModTransitionProtocol : CITransitionFilterProtocol { + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + + [Abstract] + [Export ("compression")] + float Compression { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIMorphologyGradient")] + interface CIMorphologyGradientProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIMorphologyMaximum")] + interface CIMorphologyMaximumProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIMorphologyMinimum")] + interface CIMorphologyMinimumProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIMorphologyRectangleMaximum")] + interface CIMorphologyRectangleMaximumProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("width")] + float InputWidth { get; set; } + + [Abstract] + [Export ("height")] + float InputHeight { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIMorphologyRectangleMinimum")] + interface CIMorphologyRectangleMinimumProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("width")] + float InputWidth { get; set; } + + [Abstract] + [Export ("height")] + float InputHeight { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIMotionBlur")] + interface CIMotionBlurProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CINoiseReduction")] + interface CINoiseReductionProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("noiseLevel")] + float NoiseLevel { get; set; } + + [Abstract] + [Export ("sharpness")] + float Sharpness { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIOpTile")] + interface CIOpTileProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("scale")] + float Scale { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIPageCurlTransition")] + interface CIPageCurlTransitionProtocol : CITransitionFilterProtocol { + + [Abstract] + [NullAllowed, Export ("backsideImage", ArgumentSemantic.Retain)] + CIImage BacksideImage { get; set; } + + [Abstract] + [NullAllowed, Export ("shadingImage", ArgumentSemantic.Retain)] + CIImage ShadingImage { get; set; } + + [Abstract] + [Export ("extent", ArgumentSemantic.Assign)] + CGRect InputExtent { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIPageCurlWithShadowTransition")] + interface CIPageCurlWithShadowTransitionProtocol : CITransitionFilterProtocol { + + [Abstract] + [NullAllowed, Export ("backsideImage", ArgumentSemantic.Retain)] + CIImage BacksideImage { get; set; } + + [Abstract] + [Export ("extent", ArgumentSemantic.Assign)] + CGRect InputExtent { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + + [Abstract] + [Export ("shadowSize")] + float ShadowSize { get; set; } + + [Abstract] + [Export ("shadowAmount")] + float ShadowAmount { get; set; } + + [Abstract] + [Export ("shadowExtent", ArgumentSemantic.Assign)] + CGRect InputShadowExtent { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIPaletteCentroid")] + interface CIPaletteCentroidProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [NullAllowed, Export ("paletteImage", ArgumentSemantic.Retain)] + CIImage PaletteImage { get; set; } + + [Abstract] + [Export ("perceptual")] + bool Perceptual { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIPalettize")] + interface CIPalettizeProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [NullAllowed, Export ("paletteImage", ArgumentSemantic.Retain)] + CIImage PaletteImage { get; set; } + + [Abstract] + [Export ("perceptual")] + bool Perceptual { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIParallelogramTile")] + interface CIParallelogramTileProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("acuteAngle")] + float AcuteAngle { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIPDF417BarcodeGenerator")] + interface CIPdf417BarcodeGeneratorProtocol : CIFilterProtocol { + + [Abstract] + [Export ("message", ArgumentSemantic.Retain)] + NSData Message { get; set; } + + [Abstract] + [Export ("minWidth")] + float MinWidth { get; set; } + + [Abstract] + [Export ("maxWidth")] + float MaxWidth { get; set; } + + [Abstract] + [Export ("minHeight")] + float MinHeight { get; set; } + + [Abstract] + [Export ("maxHeight")] + float MaxHeight { get; set; } + + [Abstract] + [Export ("dataColumns")] + float InputDataColumns { get; set; } + + [Abstract] + [Export ("rows")] + float InputRows { get; set; } + + [Abstract] + [Export ("preferredAspectRatio")] + float PreferredAspectRatio { get; set; } + + [Abstract] + [Export ("compactionMode")] + float InputCompactionMode { get; set; } + + [Abstract] + [Export ("compactStyle")] + float InputCompactStyle { get; set; } + + [Abstract] + [Export ("correctionLevel")] + float InputCorrectionLevel { get; set; } + + [Abstract] + [Export ("alwaysSpecifyCompaction")] + float InputAlwaysSpecifyCompaction { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIPerspectiveCorrection")] + interface CIPerspectiveCorrectionProtocol : CIFourCoordinateGeometryFilterProtocol { + + [Abstract] + [Export ("crop")] + [iOS (13,0)][TV (13,0)][Mac (10,15)] // repeated so it's inlined (new property in existing filter) + bool Crop { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIPerspectiveRotate")] + interface CIPerspectiveRotateProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("focalLength")] + float FocalLength { get; set; } + + [Abstract] + [Export ("pitch")] + float Pitch { get; set; } + + [Abstract] + [Export ("yaw")] + float Yaw { get; set; } + + [Abstract] + [Export ("roll")] + float Roll { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIPerspectiveTile")] + interface CIPerspectiveTileProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("topLeft", ArgumentSemantic.Assign)] + CGPoint InputTopLeft { get; set; } + + [Abstract] + [Export ("topRight", ArgumentSemantic.Assign)] + CGPoint InputTopRight { get; set; } + + [Abstract] + [Export ("bottomRight", ArgumentSemantic.Assign)] + CGPoint InputBottomRight { get; set; } + + [Abstract] + [Export ("bottomLeft", ArgumentSemantic.Assign)] + CGPoint InputBottomLeft { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIPerspectiveTransform")] + interface CIPerspectiveTransformProtocol : CIFourCoordinateGeometryFilterProtocol { + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIPerspectiveTransformWithExtent")] + interface CIPerspectiveTransformWithExtentProtocol : CIFourCoordinateGeometryFilterProtocol { + + [Abstract] + [Export ("extent", ArgumentSemantic.Assign)] + CGRect InputExtent { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIPhotoEffect")] + interface CIPhotoEffectProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIPixellate")] + interface CIPixellateProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("scale")] + float Scale { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIPointillize")] + interface CIPointillizeProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIQRCodeGenerator")] + interface CIQRCodeGeneratorProtocol : CIFilterProtocol { + + [Abstract] + [Export ("message", ArgumentSemantic.Retain)] + NSData Message { get; set; } + + [Abstract] + [Export ("correctionLevel", ArgumentSemantic.Retain)] + string CorrectionLevel { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIRadialGradient")] + interface CIRadialGradientProtocol : CIFilterProtocol { + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("radius0")] + float Radius0 { get; set; } + + [Abstract] + [Export ("radius1")] + float Radius1 { get; set; } + + [Abstract] + [Export ("color0", ArgumentSemantic.Retain)] + CIColor Color0 { get; set; } + + [Abstract] + [Export ("color1", ArgumentSemantic.Retain)] + CIColor Color1 { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIRandomGenerator")] + interface CIRandomGeneratorProtocol : CIFilterProtocol { + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIRippleTransition")] + interface CIRippleTransitionProtocol : CITransitionFilterProtocol { + + [Abstract] + [NullAllowed, Export ("shadingImage", ArgumentSemantic.Retain)] + CIImage ShadingImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("extent", ArgumentSemantic.Assign)] + CGRect InputExtent { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + + [Abstract] + [Export ("scale")] + float Scale { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIRoundedRectangleGenerator")] + interface CIRoundedRectangleGeneratorProtocol : CIFilterProtocol { + + [Abstract] + [Export ("extent", ArgumentSemantic.Assign)] + CGRect InputExtent { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + + [Abstract] + [Export ("color", ArgumentSemantic.Retain)] CIColor Color { get; set; } } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CISaliencyMap")] + interface CISaliencyMapProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + [CoreImageFilterProperty ("inputImage")] + CIImage InputImage { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CISepiaTone")] + interface CISepiaToneProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("intensity")] + float Intensity { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIShadedMaterial")] + interface CIShadedMaterialProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [NullAllowed, Export ("shadingImage", ArgumentSemantic.Retain)] + CIImage ShadingImage { get; set; } + + [Abstract] + [Export ("scale")] + float Scale { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CISharpenLuminance")] + interface CISharpenLuminanceProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("sharpness")] + float Sharpness { get; set; } + + [Abstract] + [Export ("radius")] + [iOS (13,0)][TV (13,0)][Mac (10,15)] // repeated so it's inlined (new property in existing filter) + float Radius { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CISixfoldReflectedTile")] + interface CISixfoldReflectedTileProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CISixfoldRotatedTile")] + interface CISixfoldRotatedTileProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CISmoothLinearGradient")] + interface CISmoothLinearGradientProtocol : CIFilterProtocol { + [Abstract] + [Export ("point0", ArgumentSemantic.Assign)] + CGPoint InputPoint0 { get; set; } + + [Abstract] + [Export ("point1", ArgumentSemantic.Assign)] + CGPoint InputPoint1 { get; set; } + + [Abstract] + [Export ("color0", ArgumentSemantic.Retain)] + CIColor Color0 { get; set; } + + [Abstract] + [Export ("color1", ArgumentSemantic.Retain)] + CIColor Color1 { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CISpotColor")] + interface CISpotColorProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("centerColor1", ArgumentSemantic.Retain)] + CIColor CenterColor1 { get; set; } + + [Abstract] + [Export ("replacementColor1", ArgumentSemantic.Retain)] + CIColor ReplacementColor1 { get; set; } + + [Abstract] + [Export ("closeness1")] + float Closeness1 { get; set; } + + [Abstract] + [Export ("contrast1")] + float Contrast1 { get; set; } + + [Abstract] + [Export ("centerColor2", ArgumentSemantic.Retain)] + CIColor CenterColor2 { get; set; } + + [Abstract] + [Export ("replacementColor2", ArgumentSemantic.Retain)] + CIColor ReplacementColor2 { get; set; } + + [Abstract] + [Export ("closeness2")] + float Closeness2 { get; set; } + + [Abstract] + [Export ("contrast2")] + float Contrast2 { get; set; } + + [Abstract] + [Export ("centerColor3", ArgumentSemantic.Retain)] + CIColor CenterColor3 { get; set; } + + [Abstract] + [Export ("replacementColor3", ArgumentSemantic.Retain)] + CIColor ReplacementColor3 { get; set; } + + [Abstract] + [Export ("closeness3")] + float Closeness3 { get; set; } + + [Abstract] + [Export ("contrast3")] + float Contrast3 { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CISpotLight")] + interface CISpotLightProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("lightPosition", ArgumentSemantic.Retain)] + CIVector LightPosition { get; set; } + + [Abstract] + [Export ("lightPointsAt", ArgumentSemantic.Retain)] + CIVector LightPointsAt { get; set; } + + [Abstract] + [Export ("brightness")] + float Brightness { get; set; } + + [Abstract] + [Export ("concentration")] + float Concentration { get; set; } + + [Abstract] + [Export ("color", ArgumentSemantic.Retain)] + CIColor Color { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CISRGBToneCurveToLinear")] + interface CISrgbToneCurveToLinearProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIStarShineGenerator")] + interface CIStarShineGeneratorProtocol : CIFilterProtocol { + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("color", ArgumentSemantic.Retain)] + CIColor Color { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + + [Abstract] + [Export ("crossScale")] + float CrossScale { get; set; } + + [Abstract] + [Export ("crossAngle")] + float CrossAngle { get; set; } + + [Abstract] + [Export ("crossOpacity")] + float CrossOpacity { get; set; } + + [Abstract] + [Export ("crossWidth")] + float CrossWidth { get; set; } + + [Abstract] + [Export ("epsilon")] + float Epsilon { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIStraighten")] + interface CIStraightenProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIStripesGenerator")] + interface CIStripesGeneratorProtocol : CIFilterProtocol { + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("color0", ArgumentSemantic.Retain)] + CIColor Color0 { get; set; } + + [Abstract] + [Export ("color1", ArgumentSemantic.Retain)] + CIColor Color1 { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + + [Abstract] + [Export ("sharpness")] + float Sharpness { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CISunbeamsGenerator")] + interface CISunbeamsGeneratorProtocol : CIFilterProtocol { + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("color", ArgumentSemantic.Retain)] + CIColor Color { get; set; } + + [Abstract] + [Export ("sunRadius")] + float SunRadius { get; set; } + + [Abstract] + [Export ("maxStriationRadius")] + float MaxStriationRadius { get; set; } + + [Abstract] + [Export ("striationStrength")] + float StriationStrength { get; set; } + + [Abstract] + [Export ("striationContrast")] + float StriationContrast { get; set; } + + [Abstract] + [Export ("time")] + float Time { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CISwipeTransition")] + interface CISwipeTransitionProtocol : CITransitionFilterProtocol { + + [Abstract] + [Export ("extent", ArgumentSemantic.Assign)] + CGRect InputExtent { get; set; } + + [Abstract] + [Export ("color", ArgumentSemantic.Retain)] + CIColor Color { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + + [Abstract] + [Export ("opacity")] + float Opacity { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CITemperatureAndTint")] + interface CITemperatureAndTintProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("neutral", ArgumentSemantic.Retain)] + CIVector Neutral { get; set; } + + [Abstract] + [Export ("targetNeutral", ArgumentSemantic.Retain)] + CIVector TargetNeutral { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CITextImageGenerator")] + interface CITextImageGeneratorProtocol : CIFilterProtocol { + + [Abstract] + [Export ("text", ArgumentSemantic.Retain)] + string Text { get; set; } + + [Abstract] + [Export ("fontName", ArgumentSemantic.Retain)] + string FontName { get; set; } + + [Abstract] + [Export ("fontSize")] + float FontSize { get; set; } + + [Abstract] + [Export ("scaleFactor")] + float ScaleFactor { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIThermal")] + interface CIThermalProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIToneCurve")] + interface CIToneCurveProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("point0", ArgumentSemantic.Assign)] + CGPoint InputPoint0 { get; set; } + + [Abstract] + [Export ("point1", ArgumentSemantic.Assign)] + CGPoint InputPoint1 { get; set; } + + [Abstract] + [Export ("point2", ArgumentSemantic.Assign)] + CGPoint InputPoint2 { get; set; } + + [Abstract] + [Export ("point3", ArgumentSemantic.Assign)] + CGPoint InputPoint3 { get; set; } + + [Abstract] + [Export ("point4", ArgumentSemantic.Assign)] + CGPoint InputPoint4 { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CITriangleKaleidoscope")] + interface CITriangleKaleidoscopeProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("point", ArgumentSemantic.Assign)] + CGPoint InputPoint { get; set; } + + [Abstract] + [Export ("size")] + float Size { get; set; } + + [Abstract] + [Export ("rotation")] + float Rotation { get; set; } + + [Abstract] + [Export ("decay")] + float Decay { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CITriangleTile")] + interface CITriangleTileProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CITwelvefoldReflectedTile")] + interface CITwelvefoldReflectedTileProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("angle")] + float Angle { get; set; } + + [Abstract] + [Export ("width")] + float Width { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIUnsharpMask")] + interface CIUnsharpMaskProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + + [Abstract] + [Export ("intensity")] + float Intensity { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIVibrance")] + interface CIVibranceProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("amount")] + float Amount { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIVignette")] + interface CIVignetteProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("intensity")] + float Intensity { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIVignetteEffect")] + interface CIVignetteEffectProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("radius")] + float Radius { get; set; } + + [Abstract] + [Export ("intensity")] + float Intensity { get; set; } + + [Abstract] + [Export ("falloff")] + float Falloff { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIWhitePointAdjust")] + interface CIWhitePointAdjustProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("color", ArgumentSemantic.Retain)] + CIColor Color { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIXRay")] + interface CIXRayProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + } + + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] + [Protocol (Name = "CIZoomBlur")] + interface CIZoomBlurProtocol : CIFilterProtocol { + + [Abstract] + [NullAllowed, Export ("inputImage", ArgumentSemantic.Retain)] + CIImage InputImage { get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint InputCenter { get; set; } + + [Abstract] + [Export ("amount")] + float Amount { get; set; } + } +#endregion } diff --git a/src/frameworks.sources b/src/frameworks.sources index 4ef3632057..3dfa1bacd1 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -916,11 +916,13 @@ IMAGECAPTURECORE_API_SOURCES = \ IMAGEIO_API_SOURCES = \ ImageIO/Enums.cs \ +IMAGEIO_CORE_SOURCES = \ + ImageIO/CGImageSource.cs \ + IMAGEIO_SOURCES = \ ImageIO/CGImageDestination.cs \ ImageIO/CGImageMetadata.cs \ ImageIO/CGImageMetadataTag.cs \ - ImageIO/CGImageSource.cs \ ImageIO/CGImageSource.iOS.cs \ ImageIO/CGMutableImageMetadata.cs \ diff --git a/src/generator-filters.cs b/src/generator-filters.cs index c2338c7104..bf9898e122 100644 --- a/src/generator-filters.cs +++ b/src/generator-filters.cs @@ -1,10 +1,12 @@ // Copyright 2015 Xamarin Inc. All rights reserved. +// Copyright Microsoft Corp. using System; using System.Collections.Generic; using IKVM.Reflection; using Type = IKVM.Reflection.Type; using Foundation; +using ObjCRuntime; public partial class Generator { @@ -33,10 +35,16 @@ public partial class Generator { // internal static CIFilter FromName (string filterName, IntPtr handle) filters.Add (type_name); + // filters are now exposed as protocols so we need to conform to them + var interfaces = String.Empty; + foreach (var i in type.GetInterfaces ()) { + interfaces += $", I{i.Name}"; + } + // type declaration - print ("public{0} partial class {1} : {2} {{", + print ("public{0} partial class {1} : {2}{3} {{", is_abstract ? " abstract" : String.Empty, - type_name, base_name); + type_name, base_name, interfaces); print (""); indent++; @@ -105,12 +113,54 @@ public partial class Generator { } // properties + GenerateProperties (type); + + // protocols + GenerateProtocolProperties (type, new HashSet ()); + + indent--; + print ("}"); + + // namespace closing (it's optional to use namespaces even if it's a bad practice, ref #35283) + if (indent > 0) { + indent--; + print ("}"); + } + } + + void GenerateProtocolProperties (Type type, HashSet processed) + { + foreach (var i in type.GetInterfaces ()) { + if (!IsProtocolInterface (i, false, out var protocol)) + continue; + + // the same protocol can be included more than once (interfaces) - but we must generate only once + var pname = i.Name; + if (processed.Contains (pname)) + continue; + processed.Add (pname); + + print (""); + print ($"// {pname} protocol members "); + GenerateProperties (i); + + // also include base interfaces/protocols + GenerateProtocolProperties (i, processed); + } + } + + void GenerateProperties (Type type) + { foreach (var p in type.GetProperties (BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)) { if (p.IsUnavailable (this)) continue; + if (AttributeManager.HasAttribute (p)) + continue; print (""); + PrintPropertyAttributes (p); print_generated_code (); + var ptype = p.PropertyType.Name; // keep C# names as they are reserved keywords (e.g. Boolean also exists in OpenGL for Mac) switch (ptype) { @@ -126,28 +176,57 @@ public partial class Generator { case "String": ptype = "string"; break; + // adding `using ImageIO;` would lead to `error CS0104: 'CGImageProperties' is an ambiguous reference between 'CoreGraphics.CGImageProperties' and 'ImageIO.CGImageProperties'` + case "CGImageMetadata": + ptype = "ImageIO.CGImageMetadata"; + break; } print ("public {0} {1} {{", ptype, p.Name); indent++; + // an export will be present (only) if it's defined in a protocol + var export = AttributeManager.GetCustomAttribute (p); + var name = AttributeManager.GetCustomAttribute (p)?.Name; - if (p.GetGetMethod () != null) + // we can skip the name when it's identical to a protocol selector + if (name == null) { + if (export == null) + throw new BindingException (1072, true, $"Missing [CoreImageFilterProperty] attribute on {0} property {1}", type.Name, p.Name); + + var sel = export.Selector; + if (sel.StartsWith ("input", StringComparison.Ordinal)) + name = sel; + else + name = "input" + Capitalize (sel); + } + + if (p.GetGetMethod () != null) { + PrintFilterExport (p, export, setter: false); GenerateFilterGetter (ptype, name); - if (p.GetSetMethod () != null) + } + if (p.GetSetMethod () != null) { + PrintFilterExport (p, export, setter: true); GenerateFilterSetter (ptype, name); + } indent--; print ("}"); } + } - indent--; - print ("}"); + void PrintFilterExport (PropertyInfo p, ExportAttribute export, bool setter) + { + if (export == null) + return; - // namespace closing (it's optional to use namespaces even if it's a bad practice, ref #35283) - if (indent > 0) { - indent--; - print ("}"); - } + var selector = export.Selector; + if (setter) + selector = "set" + Capitalize (selector) + ":"; + + if (export.ArgumentSemantic != ArgumentSemantic.None && !p.PropertyType.IsPrimitive) + print ($"[Export (\"{selector}\", ArgumentSemantic.{export.ArgumentSemantic})]"); + else + print ($"[Export (\"{selector}\")]"); } void GenerateFilterGetter (string propertyType, string propertyName) @@ -166,22 +245,30 @@ public partial class Generator { indent++; print ("return nsv.CGAffineTransformValue;"); indent--; - print ("return new CGAffineTransform (1, 0, 0, 1, 0, 0);"); + print ("return CGAffineTransform.MakeIdentity ();"); break; // NSObject should not be added + // NSNumber should not be added - it should be bound as a float (common), int32 or bool case "AVCameraCalibrationData": case "CGColorSpace": + case "CGImage": + case "ImageIO.CGImageMetadata": case "CIBarcodeDescriptor": + case "MLModel": + case "NSAttributedString": + case "NSData": print ("return Runtime.GetINativeObject <{0}> (GetHandle (\"{1}\"), false);", propertyType, propertyName); break; case "CIColor": - print ("return GetColor (\"{0}\");", propertyName); - break; case "CIImage": - print ("return GetImage (\"{0}\");", propertyName); - break; case "CIVector": - print ("return GetVector (\"{0}\");", propertyName); + print ($"return ValueForKey (\"{propertyName}\") as {propertyType};"); + break; + case "CGPoint": + print ("return GetPoint (\"{0}\");", propertyName); + break; + case "CGRect": + print ("return GetRect (\"{0}\");", propertyName); break; case "float": print ("return GetFloat (\"{0}\");", propertyName); @@ -189,11 +276,8 @@ public partial class Generator { case "int": print ("return GetInt (\"{0}\");", propertyName); break; - case "MLModel": - case "NSAttributedString": - case "NSData": - // NSNumber should not be added - it should be bound as a float (common), int32 or bool - print ("return ValueForKey (\"{0}\") as {1};", propertyName, propertyType); + case "nint": + print ("return GetNInt (\"{0}\");", propertyName); break; case "string": // NSString should not be added - it should be bound as a string @@ -229,12 +313,19 @@ public partial class Generator { case "int": print ("SetInt (\"{0}\", value);", propertyName); break; + case "nint": + print ("SetNInt (\"{0}\", value);", propertyName); + break; // NSObject should not be added case "AVCameraCalibrationData": case "CGColorSpace": case "CIBarcodeDescriptor": - print ("SetHandle (\"{0}\", value == null ? IntPtr.Zero : value.Handle);", propertyName); + case "CGImage": + case "ImageIO.CGImageMetadata": + print ($"SetHandle (\"{propertyName}\", value.GetHandle ());"); break; + case "CGPoint": + case "CGRect": case "CIColor": case "CIImage": case "CIVector": diff --git a/src/generator-typemanager.cs b/src/generator-typemanager.cs index 57f693d589..f98cdd245c 100644 --- a/src/generator-typemanager.cs +++ b/src/generator-typemanager.cs @@ -64,6 +64,7 @@ public class TypeManager { public Type CGPDFPage; public Type CGGradient; public Type CGImage; + public Type CGImageSource; public Type CGLayer; public Type CGLContext; public Type CGLPixelFormat; @@ -256,6 +257,7 @@ public class TypeManager { CGPDFPage = Lookup (platform_assembly, "CoreGraphics", "CGPDFPage"); CGGradient = Lookup (platform_assembly, "CoreGraphics", "CGGradient"); CGImage = Lookup (platform_assembly, "CoreGraphics", "CGImage"); + CGImageSource = Lookup (platform_assembly, "ImageIO", "CGImageSource"); CGLayer = Lookup (platform_assembly, "CoreGraphics", "CGLayer"); if (Frameworks.HaveOpenGL) { CGLContext = Lookup (platform_assembly, "OpenGL", "CGLContext"); diff --git a/src/generator.cs b/src/generator.cs index 1956ce62ca..dfcf3eef16 100644 --- a/src/generator.cs +++ b/src/generator.cs @@ -1214,14 +1214,21 @@ public partial class Generator : IMemberGatherer { bool IsProtocolInterface (Type type, bool checkPrefix = true) { + return IsProtocolInterface (type, checkPrefix, out var _); + } + + bool IsProtocolInterface (Type type, bool checkPrefix, out Type protocol) + { + protocol = null; // for subclassing the type (from the binding files) is not yet prefixed by an `I` if (checkPrefix && type.Name [0] != 'I') return false; + protocol = type; if (AttributeManager.HasAttribute (type)) return true; - var protocol = type.Assembly.GetType (type.Namespace + "." + type.Name.Substring (1), false); + protocol = type.Assembly.GetType (type.Namespace + "." + type.Name.Substring (1), false); if (protocol == null) return false; @@ -2200,6 +2207,7 @@ public partial class Generator : IMemberGatherer { marshal_types.Add (TypeManager.Class); marshal_types.Add (TypeManager.CFRunLoop); marshal_types.Add (TypeManager.CGColorSpace); + marshal_types.Add (TypeManager.CGImageSource); marshal_types.Add (TypeManager.DispatchData); marshal_types.Add (TypeManager.DispatchQueue); marshal_types.Add (TypeManager.Protocol); @@ -2885,6 +2893,9 @@ public partial class Generator : IMemberGatherer { } else if (pi.PropertyType.Name == "CGColorSpace") { getter = "GetNativeValue<" + pi.PropertyType +"> ({0})"; setter = "SetNativeValue ({0}, value)"; + } else if (pi.PropertyType.Name == "CGImageSource") { + getter = "GetNativeValue<" + pi.PropertyType +"> ({0})"; + setter = "SetNativeValue ({0}, value)"; } else { throw new BindingException (1031, true, "Limitation: can not automatically create strongly typed dictionary for " + diff --git a/tests/introspection/ApiCoreImageFiltersTest.cs b/tests/introspection/ApiCoreImageFiltersTest.cs index 26f5cbdb3d..d243613a60 100644 --- a/tests/introspection/ApiCoreImageFiltersTest.cs +++ b/tests/introspection/ApiCoreImageFiltersTest.cs @@ -25,6 +25,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Reflection; +using System.Text; using NUnit.Framework; @@ -215,6 +216,313 @@ namespace Introspection { writer.WriteLine (); writer.Flush (); } + + [Test] + public void Protocols () + { + var to_confirm_manually = new StringBuilder (); + ContinueOnFailure = true; + var nspace = CIFilterType.Namespace; + var types = CIFilterType.Assembly.GetTypes (); + foreach (Type t in types) { + if (t.Namespace != nspace) + continue; + + // e.g. FooProtocolWrapper + if (!t.IsPublic) + continue; + + switch (t.Name) { + // we are interested in subclasses (real) filters + case "CIFilter": + continue; + // no protocol has been added (yet?) you can confirm with `grep` that it does not report anything in the terminal + case "CIAdditionCompositing": + case "CIAreaAverage": + case "CIAreaHistogram": + case "CIAreaMaximum": + case "CIAreaMaximumAlpha": + case "CIAreaMinimum": + case "CIAreaMinimumAlpha": + case "CIAreaMinMax": + case "CIAreaMinMaxRed": + case "CIBlendFilter": + case "CIBumpDistortion": + case "CIBumpDistortionLinear": + case "CICameraCalibrationLensCorrection": + case "CICircleSplashDistortion": + case "CICircularWrap": + case "CIClamp": + case "CICodeGenerator": + case "CIColorBlendMode": + case "CIColorBurnBlendMode": + case "CIColorDodgeBlendMode": + case "CIColumnAverage": + case "CICompositingFilter": + case "CIConstantColorGenerator": + case "CIConvolution3X3": + case "CIConvolution5X5": + case "CIConvolution7X7": + case "CIConvolution9Horizontal": + case "CIConvolution9Vertical": + case "CIConvolutionCore": + case "CICoreMLModelFilter": + case "CICrop": + case "CIDarkenBlendMode": + case "CIDepthBlurEffect": + case "CIDepthDisparityConverter": + case "CIDifferenceBlendMode": + case "CIDisplacementDistortion": + case "CIDistortionFilter": + case "CIDivideBlendMode": + case "CIDroste": + case "CIExclusionBlendMode": + case "CIFaceBalance": + case "CIGlassDistortion": + case "CIGlassLozenge": + case "CIGuidedFilter": + case "CIHardLightBlendMode": + case "CIHistogramDisplayFilter": + case "CIHoleDistortion": + case "CIHueBlendMode": + case "CIImageGenerator": + case "CIKeystoneCorrection": + case "CIKMeans": + case "CILightenBlendMode": + case "CILightTunnel": + case "CILinearBlur": + case "CILinearBurnBlendMode": + case "CILinearDodgeBlendMode": + case "CILuminosityBlendMode": + case "CIMaximumCompositing": + case "CIMinimumCompositing": + case "CIMorphology": + case "CIMorphologyRectangle": + case "CIMultiplyBlendMode": + case "CIMultiplyCompositing": + case "CINinePartStretched": + case "CINinePartTiled": + case "CIOverlayBlendMode": + case "CIPinchDistortion": + case "CIPinLightBlendMode": + case "CIReductionFilter": + case "CIRowAverage": + case "CISampleNearest": + case "CISaturationBlendMode": + case "CIScreenBlendMode": + case "CIScreenFilter": + case "CISoftLightBlendMode": + case "CISourceAtopCompositing": + case "CISourceInCompositing": + case "CISourceOutCompositing": + case "CISourceOverCompositing": + case "CIStretchCrop": + case "CISubtractBlendMode": + case "CITileFilter": + case "CITorusLensDistortion": + case "CITwirlDistortion": + case "CIVortexDistortion": + // this list is likely to change with newer Xcode - uncomment if you want to the script to check the list + //to_confirm_manually.AppendLine ($"grep {t.Name} `xcode-select -p`/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreImage.framework/Headers/*.h"); + // since xtro will report the missing protocols this is a 2nd layer of safety :) + continue; + } + + bool assign = typeof (ICIFilterProtocol).IsAssignableFrom (t); + bool suffix = t.Name.EndsWith ("Protocol", StringComparison.Ordinal); + + if (t.IsInterface) { + if (assign) { + // check that `IFooProtocol` has a [Protocol (Name = "Foo")] attribute + var ca = t.GetCustomAttribute (false); + if (ca == null) { + ReportError ($"Managed {t.Name} should have a '[Protocol (Name=\"{t.Name.Replace ("Protocol", "")}\")]' attribute"); + } + // check that the managed name ends with Protocol, so we can have the _normal_ name to be a concrete type (like our historic, strongly typed filters) + if (!suffix) { + ReportError ($"Managed {t.Name} should have a 'Protocol' suffix"); + } + } else if (suffix) { + ReportError ($"Managed {t.Name} should implement 'ICIFilterProtocol' interface."); + } + } else if (suffix) { + ReportError ($"Managed {t.Name} should be an interface since it represent a protocol"); + } else if (assign) { + // all CIFilter should map to a `ICI*Protocol` interface / protocol + bool found = false; + foreach (var inft in t.GetInterfaces ()) { + if (inft.Namespace == nspace && inft.Name.EndsWith ("Protocol", StringComparison.Ordinal)) { + found = true; + break; + } + } + if (!found) + ReportError ($"Managed CIFilter '{t.Name}' does not conform to any CoreImage filter protocol."); + } else if (CIFilterType.IsAssignableFrom (t)) { + // missing ICIFilterProtocol + to_confirm_manually.AppendLine ($"grep \"protocol {t.Name} \" `xcode-select -p`/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreImage.framework/Headers/*.h"); + ReportError ($"Managed CIFilter '{t.Name}' does not conform to 'ICIFilterProtocol' protocol. Confirm with generated `grep` script on console."); + } + } + if (to_confirm_manually.Length > 0) { + Console.WriteLine (to_confirm_manually); + } + Assert.AreEqual (0, Errors, "{0} potential errors found{1}", Errors, Errors == 0 ? string.Empty : ":\n" + ErrorData.ToString () + "\n"); + } + + [Test] + public void Keys () + { + ContinueOnFailure = true; + var nspace = CIFilterType.Namespace; + var types = CIFilterType.Assembly.GetTypes (); + foreach (Type t in types) { + if (t.Namespace != nspace) + continue; + + if (t.IsAbstract || !CIFilterType.IsAssignableFrom (t)) + continue; + + // we need to skip the filters that are not supported by the executing version of iOS + if (Skip (t)) + continue; + + var ctor = t.GetConstructor (Type.EmptyTypes); + if ((ctor == null) || ctor.IsAbstract) + continue; + + CIFilter f = ctor.Invoke (null) as CIFilter; + + // first check that every property can be mapped to an input key - except if it starts with "Output" + foreach (var p in t.GetProperties (BindingFlags.Public | BindingFlags.Instance)) { + var pt = p.DeclaringType; + if (!CIFilterType.IsAssignableFrom (pt) || (pt == CIFilterType)) + continue; + + if (SkipDueToAttribute (p)) + continue; + + var getter = p.GetGetMethod (); + var ea = getter.GetCustomAttribute (false); + // only properties coming (inlined) from protocols have an [Export] attribute + if (ea == null) + continue; + var key = ea.Selector; + // 'output' is always explicit + if (key.StartsWith ("output", StringComparison.Ordinal)) { + if (Array.IndexOf (f.OutputKeys, key) < 0) { + ReportError ($"{t.Name}: Property `{p.Name}` mapped to key `{key}` is not part of `OutputKeys`."); + //GenerateBinding (f, Console.Out); + } + } else { + // special cases (protocol names are better) + switch (t.Name) { + case "CIBicubicScaleTransform": + switch (key) { + case "parameterB": + key = "inputB"; + break; + case "parameterC": + key = "inputC"; + break; + } + break; + case "CICmykHalftone": + switch (key) { + case "grayComponentReplacement": + key = "inputGCR"; + break; + case "underColorRemoval": + key = "inputUCR"; + break; + } + break; + } + // 'input' is implied (generally) and explicit (in a few cases) + if (!key.StartsWith ("input", StringComparison.Ordinal)) + key = "input" + Char.ToUpperInvariant (key [0]) + key.Substring (1); + + if (Array.IndexOf (f.InputKeys, key) < 0) { + ReportError ($"{t.Name}: Property `{p.Name}` mapped to key `{key}` is not part of `InputKeys`."); + //GenerateBinding (f, Console.Out); + } + } + } + + // second check that every input key is mapped to an property + foreach (var key in f.InputKeys) { + string cap = Char.ToUpperInvariant (key [0]) + key.Substring (1); + // special cases (protocol names are better) + switch (t.Name) { + case "CICmykHalftone": + switch (key) { + case "inputGCR": + cap = "GrayComponentReplacement"; + break; + case "inputUCR": + cap = "UnderColorRemoval"; + break; + } + break; + } + // IgnoreCase because there are acronyms (more than 2 letters) that naming convention force us to change + var pi = t.GetProperty (cap, BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance | BindingFlags.FlattenHierarchy); + if (pi == null) { + // 2nd chance: some, but not all, property are prefixed by `Input` + if (key.StartsWith ("input", StringComparison.Ordinal)) { + cap = Char.ToUpperInvariant (key [5]) + key.Substring (6); + pi = t.GetProperty (cap, BindingFlags.Public | BindingFlags.Instance | BindingFlags.FlattenHierarchy); + } + } + if (pi == null) { + ReportError ($"{t.Name}: Input Key `{key}` is NOT mapped to a `{cap}` property."); + //GenerateBinding (f, Console.Out); + } else if (pi.GetSetMethod () == null) + ReportError ($"{t.Name}: Property `{pi.Name}` MUST have a setter."); + } + + // third check that every output key is mapped to an property + foreach (var key in f.OutputKeys) { + // special cases + switch (t.Name) { + case "CIKeystoneCorrectionCombined": + case "CIKeystoneCorrectionHorizontal": + case "CIKeystoneCorrectionVertical": + switch (key) { + case "outputRotationFilter": + continue; // lack of documentation about the returned type + } + break; + case "CILanczosScaleTransform": + switch (key) { + // ref: https://github.com/xamarin/xamarin-macios/issues/7209 + case "outputImageNewScaleX:scaleY:": + case "outputImageOldScaleX:scaleY:": + continue; + } + break; + case "CIDiscBlur": + switch (key) { + // existed in iOS 10.3 but not in iOS 13 - we're not adding them + case "outputImageOriginal": + case "outputImageEnhanced": + continue; + } + break; + } + + var cap = Char.ToUpperInvariant (key [0]) + key.Substring (1); + // IgnoreCase because there are acronyms (more than 2 letters) that naming convention force us to change + var po = t.GetProperty (cap, BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance | BindingFlags.FlattenHierarchy); + if (po == null) { + ReportError ($"{t.Name}: Output Key `{key}` is NOT mapped to a `{cap}` property."); + //GenerateBinding (f, Console.Out); + } else if (po.GetSetMethod () != null) + ReportError ($"{t.Name}: Property `{po.Name}` should NOT have a setter."); + } + } + Assert.AreEqual (0, Errors, "{0} potential errors found{1}", Errors, Errors == 0 ? string.Empty : ":\n" + ErrorData.ToString () + "\n"); + } } } diff --git a/tests/introspection/ApiTypoTest.cs b/tests/introspection/ApiTypoTest.cs index aad09889cd..ed37f401be 100644 --- a/tests/introspection/ApiTypoTest.cs +++ b/tests/introspection/ApiTypoTest.cs @@ -489,6 +489,7 @@ namespace Introspection "Snapshotter", "Snorm", "Sobel", + "Softmax", // get_SoftmaxNormalization "Spacei", "Sqrt", "Srgb", diff --git a/tests/xtro-sharpie/common-CoreImage.ignore b/tests/xtro-sharpie/common-CoreImage.ignore index 098187f919..f67e10b63b 100644 --- a/tests/xtro-sharpie/common-CoreImage.ignore +++ b/tests/xtro-sharpie/common-CoreImage.ignore @@ -15,3 +15,188 @@ ## at some point in time (iOS11/macOS 10.11) this API was removed/deprecated and we added a compatibility ## stub using 'autoAdjustmentFiltersWithOptions:'. Now it's back (in headers but can be ignored) !missing-selector! CIImage::autoAdjustmentFilters not bound + +## we already provide alternative API to create the filters +!missing-selector! +CIFilter::accordionFoldTransitionFilter not bound +!missing-selector! +CIFilter::additionCompositingFilter not bound +!missing-selector! +CIFilter::affineClampFilter not bound +!missing-selector! +CIFilter::affineTileFilter not bound +!missing-selector! +CIFilter::attributedTextImageGeneratorFilter not bound +!missing-selector! +CIFilter::aztecCodeGeneratorFilter not bound +!missing-selector! +CIFilter::barcodeGeneratorFilter not bound +!missing-selector! +CIFilter::barsSwipeTransitionFilter not bound +!missing-selector! +CIFilter::bicubicScaleTransformFilter not bound +!missing-selector! +CIFilter::blendWithAlphaMaskFilter not bound +!missing-selector! +CIFilter::blendWithBlueMaskFilter not bound +!missing-selector! +CIFilter::blendWithMaskFilter not bound +!missing-selector! +CIFilter::blendWithRedMaskFilter not bound +!missing-selector! +CIFilter::bloomFilter not bound +!missing-selector! +CIFilter::bokehBlurFilter not bound +!missing-selector! +CIFilter::boxBlurFilter not bound +!missing-selector! +CIFilter::checkerboardGeneratorFilter not bound +!missing-selector! +CIFilter::circularScreenFilter not bound +!missing-selector! +CIFilter::CMYKHalftone not bound +!missing-selector! +CIFilter::code128BarcodeGeneratorFilter not bound +!missing-selector! +CIFilter::colorBlendModeFilter not bound +!missing-selector! +CIFilter::colorBurnBlendModeFilter not bound +!missing-selector! +CIFilter::colorClampFilter not bound +!missing-selector! +CIFilter::colorControlsFilter not bound +!missing-selector! +CIFilter::colorCrossPolynomialFilter not bound +!missing-selector! +CIFilter::colorCubeFilter not bound +!missing-selector! +CIFilter::colorCubesMixedWithMaskFilter not bound +!missing-selector! +CIFilter::colorCubeWithColorSpaceFilter not bound +!missing-selector! +CIFilter::colorCurvesFilter not bound +!missing-selector! +CIFilter::colorDodgeBlendModeFilter not bound +!missing-selector! +CIFilter::colorInvertFilter not bound +!missing-selector! +CIFilter::colorMapFilter not bound +!missing-selector! +CIFilter::colorMatrixFilter not bound +!missing-selector! +CIFilter::colorMonochromeFilter not bound +!missing-selector! +CIFilter::colorPolynomialFilter not bound +!missing-selector! +CIFilter::colorPosterizeFilter not bound +!missing-selector! +CIFilter::comicEffectFilter not bound +!missing-selector! +CIFilter::convolution3X3Filter not bound +!missing-selector! +CIFilter::convolution5X5Filter not bound +!missing-selector! +CIFilter::convolution7X7Filter not bound +!missing-selector! +CIFilter::convolution9HorizontalFilter not bound +!missing-selector! +CIFilter::convolution9VerticalFilter not bound +!missing-selector! +CIFilter::copyMachineTransitionFilter not bound +!missing-selector! +CIFilter::coreMLModelFilter not bound +!missing-selector! +CIFilter::crystallizeFilter not bound +!missing-selector! +CIFilter::darkenBlendModeFilter not bound +!missing-selector! +CIFilter::depthOfFieldFilter not bound +!missing-selector! +CIFilter::depthToDisparityFilter not bound +!missing-selector! +CIFilter::differenceBlendModeFilter not bound +!missing-selector! +CIFilter::discBlurFilter not bound +!missing-selector! +CIFilter::disintegrateWithMaskTransitionFilter not bound +!missing-selector! +CIFilter::disparityToDepthFilter not bound +!missing-selector! +CIFilter::dissolveTransitionFilter not bound +!missing-selector! +CIFilter::ditherFilter not bound +!missing-selector! +CIFilter::divideBlendModeFilter not bound +!missing-selector! +CIFilter::documentEnhancerFilter not bound +!missing-selector! +CIFilter::dotScreenFilter not bound +!missing-selector! +CIFilter::edgePreserveUpsampleFilter not bound +!missing-selector! +CIFilter::edgesFilter not bound +!missing-selector! +CIFilter::edgeWorkFilter not bound +!missing-selector! +CIFilter::eightfoldReflectedTileFilter not bound +!missing-selector! +CIFilter::exclusionBlendModeFilter not bound +!missing-selector! +CIFilter::exposureAdjustFilter not bound +!missing-selector! +CIFilter::falseColorFilter not bound +!missing-selector! +CIFilter::flashTransitionFilter not bound +!missing-selector! +CIFilter::fourfoldReflectedTileFilter not bound +!missing-selector! +CIFilter::fourfoldRotatedTileFilter not bound +!missing-selector! +CIFilter::fourfoldTranslatedTileFilter not bound +!missing-selector! +CIFilter::gaborGradientsFilter not bound +!missing-selector! +CIFilter::gammaAdjustFilter not bound +!missing-selector! +CIFilter::gaussianBlurFilter not bound +!missing-selector! +CIFilter::gaussianGradientFilter not bound +!missing-selector! +CIFilter::glideReflectedTileFilter not bound +!missing-selector! +CIFilter::gloomFilter not bound +!missing-selector! +CIFilter::hardLightBlendModeFilter not bound +!missing-selector! +CIFilter::hatchedScreenFilter not bound +!missing-selector! +CIFilter::heightFieldFromMaskFilter not bound +!missing-selector! +CIFilter::hexagonalPixellateFilter not bound +!missing-selector! +CIFilter::highlightShadowAdjustFilter not bound +!missing-selector! +CIFilter::hueAdjustFilter not bound +!missing-selector! +CIFilter::hueBlendModeFilter not bound +!missing-selector! +CIFilter::hueSaturationValueGradientFilter not bound +!missing-selector! +CIFilter::kaleidoscopeFilter not bound +!missing-selector! +CIFilter::keystoneCorrectionCombinedFilter not bound +!missing-selector! +CIFilter::keystoneCorrectionHorizontalFilter not bound +!missing-selector! +CIFilter::keystoneCorrectionVerticalFilter not bound +!missing-selector! +CIFilter::LabDeltaE not bound +!missing-selector! +CIFilter::lanczosScaleTransformFilter not bound +!missing-selector! +CIFilter::lenticularHaloGeneratorFilter not bound +!missing-selector! +CIFilter::lightenBlendModeFilter not bound +!missing-selector! +CIFilter::linearBurnBlendModeFilter not bound +!missing-selector! +CIFilter::linearDodgeBlendModeFilter not bound +!missing-selector! +CIFilter::linearGradientFilter not bound +!missing-selector! +CIFilter::linearToSRGBToneCurveFilter not bound +!missing-selector! +CIFilter::lineOverlayFilter not bound +!missing-selector! +CIFilter::lineScreenFilter not bound +!missing-selector! +CIFilter::luminosityBlendModeFilter not bound +!missing-selector! +CIFilter::maskedVariableBlurFilter not bound +!missing-selector! +CIFilter::maskToAlphaFilter not bound +!missing-selector! +CIFilter::maximumComponentFilter not bound +!missing-selector! +CIFilter::maximumCompositingFilter not bound +!missing-selector! +CIFilter::medianFilter not bound +!missing-selector! +CIFilter::meshGeneratorFilter not bound +!missing-selector! +CIFilter::minimumComponentFilter not bound +!missing-selector! +CIFilter::minimumCompositingFilter not bound +!missing-selector! +CIFilter::mixFilter not bound +!missing-selector! +CIFilter::modTransitionFilter not bound +!missing-selector! +CIFilter::morphologyGradientFilter not bound +!missing-selector! +CIFilter::morphologyMaximumFilter not bound +!missing-selector! +CIFilter::morphologyMinimumFilter not bound +!missing-selector! +CIFilter::morphologyRectangleMaximumFilter not bound +!missing-selector! +CIFilter::morphologyRectangleMinimumFilter not bound +!missing-selector! +CIFilter::motionBlurFilter not bound +!missing-selector! +CIFilter::multiplyBlendModeFilter not bound +!missing-selector! +CIFilter::multiplyCompositingFilter not bound +!missing-selector! +CIFilter::noiseReductionFilter not bound +!missing-selector! +CIFilter::opTileFilter not bound +!missing-selector! +CIFilter::overlayBlendModeFilter not bound +!missing-selector! +CIFilter::pageCurlTransitionFilter not bound +!missing-selector! +CIFilter::pageCurlWithShadowTransitionFilter not bound +!missing-selector! +CIFilter::paletteCentroidFilter not bound +!missing-selector! +CIFilter::palettizeFilter not bound +!missing-selector! +CIFilter::parallelogramTileFilter not bound +!missing-selector! +CIFilter::PDF417BarcodeGenerator not bound +!missing-selector! +CIFilter::perspectiveCorrectionFilter not bound +!missing-selector! +CIFilter::perspectiveRotateFilter not bound +!missing-selector! +CIFilter::perspectiveTileFilter not bound +!missing-selector! +CIFilter::perspectiveTransformFilter not bound +!missing-selector! +CIFilter::perspectiveTransformWithExtentFilter not bound +!missing-selector! +CIFilter::photoEffectChromeFilter not bound +!missing-selector! +CIFilter::photoEffectFadeFilter not bound +!missing-selector! +CIFilter::photoEffectInstantFilter not bound +!missing-selector! +CIFilter::photoEffectMonoFilter not bound +!missing-selector! +CIFilter::photoEffectNoirFilter not bound +!missing-selector! +CIFilter::photoEffectProcessFilter not bound +!missing-selector! +CIFilter::photoEffectTonalFilter not bound +!missing-selector! +CIFilter::photoEffectTransferFilter not bound +!missing-selector! +CIFilter::pinLightBlendModeFilter not bound +!missing-selector! +CIFilter::pixellateFilter not bound +!missing-selector! +CIFilter::pointillizeFilter not bound +!missing-selector! +CIFilter::QRCodeGenerator not bound +!missing-selector! +CIFilter::radialGradientFilter not bound +!missing-selector! +CIFilter::randomGeneratorFilter not bound +!missing-selector! +CIFilter::rippleTransitionFilter not bound +!missing-selector! +CIFilter::roundedRectangleGeneratorFilter not bound +!missing-selector! +CIFilter::saliencyMapFilter not bound +!missing-selector! +CIFilter::saturationBlendModeFilter not bound +!missing-selector! +CIFilter::screenBlendModeFilter not bound +!missing-selector! +CIFilter::sepiaToneFilter not bound +!missing-selector! +CIFilter::shadedMaterialFilter not bound +!missing-selector! +CIFilter::sharpenLuminanceFilter not bound +!missing-selector! +CIFilter::sixfoldReflectedTileFilter not bound +!missing-selector! +CIFilter::sixfoldRotatedTileFilter not bound +!missing-selector! +CIFilter::smoothLinearGradientFilter not bound +!missing-selector! +CIFilter::softLightBlendModeFilter not bound +!missing-selector! +CIFilter::sourceAtopCompositingFilter not bound +!missing-selector! +CIFilter::sourceInCompositingFilter not bound +!missing-selector! +CIFilter::sourceOutCompositingFilter not bound +!missing-selector! +CIFilter::sourceOverCompositingFilter not bound +!missing-selector! +CIFilter::spotColorFilter not bound +!missing-selector! +CIFilter::spotLightFilter not bound +!missing-selector! +CIFilter::sRGBToneCurveToLinearFilter not bound +!missing-selector! +CIFilter::starShineGeneratorFilter not bound +!missing-selector! +CIFilter::straightenFilter not bound +!missing-selector! +CIFilter::stripesGeneratorFilter not bound +!missing-selector! +CIFilter::subtractBlendModeFilter not bound +!missing-selector! +CIFilter::sunbeamsGeneratorFilter not bound +!missing-selector! +CIFilter::supportedRawCameraModels not bound +!missing-selector! +CIFilter::swipeTransitionFilter not bound +!missing-selector! +CIFilter::temperatureAndTintFilter not bound +!missing-selector! +CIFilter::textImageGeneratorFilter not bound +!missing-selector! +CIFilter::thermalFilter not bound +!missing-selector! +CIFilter::toneCurveFilter not bound +!missing-selector! +CIFilter::triangleKaleidoscopeFilter not bound +!missing-selector! +CIFilter::triangleTileFilter not bound +!missing-selector! +CIFilter::twelvefoldReflectedTileFilter not bound +!missing-selector! +CIFilter::unsharpMaskFilter not bound +!missing-selector! +CIFilter::vibranceFilter not bound +!missing-selector! +CIFilter::vignetteEffectFilter not bound +!missing-selector! +CIFilter::vignetteFilter not bound +!missing-selector! +CIFilter::whitePointAdjustFilter not bound +!missing-selector! +CIFilter::xRayFilter not bound +!missing-selector! +CIFilter::zoomBlurFilter not bound diff --git a/tests/xtro-sharpie/iOS-CoreImage.todo b/tests/xtro-sharpie/iOS-CoreImage.todo deleted file mode 100644 index 009771440a..0000000000 --- a/tests/xtro-sharpie/iOS-CoreImage.todo +++ /dev/null @@ -1,358 +0,0 @@ -!missing-field! kCIContextAllowLowPower not bound -!missing-field! kCIImageAuxiliarySemanticSegmentationHairMatte not bound -!missing-field! kCIImageAuxiliarySemanticSegmentationSkinMatte not bound -!missing-field! kCIImageAuxiliarySemanticSegmentationTeethMatte not bound -!missing-field! kCIImageRepresentationAVSemanticSegmentationMattes not bound -!missing-field! kCIImageRepresentationSemanticSegmentationHairMatteImage not bound -!missing-field! kCIImageRepresentationSemanticSegmentationSkinMatteImage not bound -!missing-field! kCIImageRepresentationSemanticSegmentationTeethMatteImage not bound -!missing-field! kCIInputEnableEDRModeKey not bound -!missing-protocol! CIAccordionFoldTransition not bound -!missing-protocol! CIAffineClamp not bound -!missing-protocol! CIAffineTile not bound -!missing-protocol! CIAttributedTextImageGenerator not bound -!missing-protocol! CIAztecCodeGenerator not bound -!missing-protocol! CIBarcodeGenerator not bound -!missing-protocol! CIBarsSwipeTransition not bound -!missing-protocol! CIBicubicScaleTransform not bound -!missing-protocol! CIBlendWithMask not bound -!missing-protocol! CIBloom not bound -!missing-protocol! CIBokehBlur not bound -!missing-protocol! CIBoxBlur not bound -!missing-protocol! CICheckerboardGenerator not bound -!missing-protocol! CICircularScreen not bound -!missing-protocol! CICMYKHalftone not bound -!missing-protocol! CICode128BarcodeGenerator not bound -!missing-protocol! CIColorClamp not bound -!missing-protocol! CIColorControls not bound -!missing-protocol! CIColorCrossPolynomial not bound -!missing-protocol! CIColorCube not bound -!missing-protocol! CIColorCubesMixedWithMask not bound -!missing-protocol! CIColorCubeWithColorSpace not bound -!missing-protocol! CIColorCurves not bound -!missing-protocol! CIColorInvert not bound -!missing-protocol! CIColorMap not bound -!missing-protocol! CIColorMatrix not bound -!missing-protocol! CIColorMonochrome not bound -!missing-protocol! CIColorPolynomial not bound -!missing-protocol! CIColorPosterize not bound -!missing-protocol! CIComicEffect not bound -!missing-protocol! CICompositeOperation not bound -!missing-protocol! CIConvolution not bound -!missing-protocol! CICopyMachineTransition not bound -!missing-protocol! CICoreMLModel not bound -!missing-protocol! CICrystallize not bound -!missing-protocol! CIDepthOfField not bound -!missing-protocol! CIDepthToDisparity not bound -!missing-protocol! CIDiscBlur not bound -!missing-protocol! CIDisintegrateWithMaskTransition not bound -!missing-protocol! CIDisparityToDepth not bound -!missing-protocol! CIDissolveTransition not bound -!missing-protocol! CIDither not bound -!missing-protocol! CIDocumentEnhancer not bound -!missing-protocol! CIDotScreen not bound -!missing-protocol! CIEdgePreserveUpsample not bound -!missing-protocol! CIEdges not bound -!missing-protocol! CIEdgeWork not bound -!missing-protocol! CIEightfoldReflectedTile not bound -!missing-protocol! CIExposureAdjust not bound -!missing-protocol! CIFalseColor not bound -!missing-protocol! CIFilter not bound -!missing-protocol! CIFlashTransition not bound -!missing-protocol! CIFourCoordinateGeometryFilter not bound -!missing-protocol! CIFourfoldReflectedTile not bound -!missing-protocol! CIFourfoldRotatedTile not bound -!missing-protocol! CIFourfoldTranslatedTile not bound -!missing-protocol! CIGaborGradients not bound -!missing-protocol! CIGammaAdjust not bound -!missing-protocol! CIGaussianBlur not bound -!missing-protocol! CIGaussianGradient not bound -!missing-protocol! CIGlideReflectedTile not bound -!missing-protocol! CIGloom not bound -!missing-protocol! CIHatchedScreen not bound -!missing-protocol! CIHeightFieldFromMask not bound -!missing-protocol! CIHexagonalPixellate not bound -!missing-protocol! CIHighlightShadowAdjust not bound -!missing-protocol! CIHueAdjust not bound -!missing-protocol! CIHueSaturationValueGradient not bound -!missing-protocol! CIKaleidoscope not bound -!missing-protocol! CIKeystoneCorrectionCombined not bound -!missing-protocol! CIKeystoneCorrectionHorizontal not bound -!missing-protocol! CIKeystoneCorrectionVertical not bound -!missing-protocol! CILabDeltaE not bound -!missing-protocol! CILanczosScaleTransform not bound -!missing-protocol! CILenticularHaloGenerator not bound -!missing-protocol! CILinearGradient not bound -!missing-protocol! CILinearToSRGBToneCurve not bound -!missing-protocol! CILineOverlay not bound -!missing-protocol! CILineScreen not bound -!missing-protocol! CIMaskedVariableBlur not bound -!missing-protocol! CIMaskToAlpha not bound -!missing-protocol! CIMaximumComponent not bound -!missing-protocol! CIMedian not bound -!missing-protocol! CIMeshGenerator not bound -!missing-protocol! CIMinimumComponent not bound -!missing-protocol! CIMix not bound -!missing-protocol! CIModTransition not bound -!missing-protocol! CIMorphologyGradient not bound -!missing-protocol! CIMorphologyMaximum not bound -!missing-protocol! CIMorphologyMinimum not bound -!missing-protocol! CIMorphologyRectangleMaximum not bound -!missing-protocol! CIMorphologyRectangleMinimum not bound -!missing-protocol! CIMotionBlur not bound -!missing-protocol! CINoiseReduction not bound -!missing-protocol! CIOpTile not bound -!missing-protocol! CIPageCurlTransition not bound -!missing-protocol! CIPageCurlWithShadowTransition not bound -!missing-protocol! CIPaletteCentroid not bound -!missing-protocol! CIPalettize not bound -!missing-protocol! CIParallelogramTile not bound -!missing-protocol! CIPDF417BarcodeGenerator not bound -!missing-protocol! CIPerspectiveCorrection not bound -!missing-protocol! CIPerspectiveRotate not bound -!missing-protocol! CIPerspectiveTile not bound -!missing-protocol! CIPerspectiveTransform not bound -!missing-protocol! CIPerspectiveTransformWithExtent not bound -!missing-protocol! CIPhotoEffect not bound -!missing-protocol! CIPixellate not bound -!missing-protocol! CIPointillize not bound -!missing-protocol! CIQRCodeGenerator not bound -!missing-protocol! CIRadialGradient not bound -!missing-protocol! CIRandomGenerator not bound -!missing-protocol! CIRippleTransition not bound -!missing-protocol! CIRoundedRectangleGenerator not bound -!missing-protocol! CISaliencyMap not bound -!missing-protocol! CISepiaTone not bound -!missing-protocol! CIShadedMaterial not bound -!missing-protocol! CISharpenLuminance not bound -!missing-protocol! CISixfoldReflectedTile not bound -!missing-protocol! CISixfoldRotatedTile not bound -!missing-protocol! CISmoothLinearGradient not bound -!missing-protocol! CISpotColor not bound -!missing-protocol! CISpotLight not bound -!missing-protocol! CISRGBToneCurveToLinear not bound -!missing-protocol! CIStarShineGenerator not bound -!missing-protocol! CIStraighten not bound -!missing-protocol! CIStripesGenerator not bound -!missing-protocol! CISunbeamsGenerator not bound -!missing-protocol! CISwipeTransition not bound -!missing-protocol! CITemperatureAndTint not bound -!missing-protocol! CITextImageGenerator not bound -!missing-protocol! CIThermal not bound -!missing-protocol! CIToneCurve not bound -!missing-protocol! CITransitionFilter not bound -!missing-protocol! CITriangleKaleidoscope not bound -!missing-protocol! CITriangleTile not bound -!missing-protocol! CITwelvefoldReflectedTile not bound -!missing-protocol! CIUnsharpMask not bound -!missing-protocol! CIVibrance not bound -!missing-protocol! CIVignette not bound -!missing-protocol! CIVignetteEffect not bound -!missing-protocol! CIWhitePointAdjust not bound -!missing-protocol! CIXRay not bound -!missing-protocol! CIZoomBlur not bound -!missing-selector! +CIFilter::accordionFoldTransitionFilter not bound -!missing-selector! +CIFilter::additionCompositingFilter not bound -!missing-selector! +CIFilter::affineClampFilter not bound -!missing-selector! +CIFilter::affineTileFilter not bound -!missing-selector! +CIFilter::attributedTextImageGeneratorFilter not bound -!missing-selector! +CIFilter::aztecCodeGeneratorFilter not bound -!missing-selector! +CIFilter::barcodeGeneratorFilter not bound -!missing-selector! +CIFilter::barsSwipeTransitionFilter not bound -!missing-selector! +CIFilter::bicubicScaleTransformFilter not bound -!missing-selector! +CIFilter::blendWithAlphaMaskFilter not bound -!missing-selector! +CIFilter::blendWithBlueMaskFilter not bound -!missing-selector! +CIFilter::blendWithMaskFilter not bound -!missing-selector! +CIFilter::blendWithRedMaskFilter not bound -!missing-selector! +CIFilter::bloomFilter not bound -!missing-selector! +CIFilter::bokehBlurFilter not bound -!missing-selector! +CIFilter::boxBlurFilter not bound -!missing-selector! +CIFilter::checkerboardGeneratorFilter not bound -!missing-selector! +CIFilter::circularScreenFilter not bound -!missing-selector! +CIFilter::CMYKHalftone not bound -!missing-selector! +CIFilter::code128BarcodeGeneratorFilter not bound -!missing-selector! +CIFilter::colorBlendModeFilter not bound -!missing-selector! +CIFilter::colorBurnBlendModeFilter not bound -!missing-selector! +CIFilter::colorClampFilter not bound -!missing-selector! +CIFilter::colorControlsFilter not bound -!missing-selector! +CIFilter::colorCrossPolynomialFilter not bound -!missing-selector! +CIFilter::colorCubeFilter not bound -!missing-selector! +CIFilter::colorCubesMixedWithMaskFilter not bound -!missing-selector! +CIFilter::colorCubeWithColorSpaceFilter not bound -!missing-selector! +CIFilter::colorCurvesFilter not bound -!missing-selector! +CIFilter::colorDodgeBlendModeFilter not bound -!missing-selector! +CIFilter::colorInvertFilter not bound -!missing-selector! +CIFilter::colorMapFilter not bound -!missing-selector! +CIFilter::colorMatrixFilter not bound -!missing-selector! +CIFilter::colorMonochromeFilter not bound -!missing-selector! +CIFilter::colorPolynomialFilter not bound -!missing-selector! +CIFilter::colorPosterizeFilter not bound -!missing-selector! +CIFilter::comicEffectFilter not bound -!missing-selector! +CIFilter::convolution3X3Filter not bound -!missing-selector! +CIFilter::convolution5X5Filter not bound -!missing-selector! +CIFilter::convolution7X7Filter not bound -!missing-selector! +CIFilter::convolution9HorizontalFilter not bound -!missing-selector! +CIFilter::convolution9VerticalFilter not bound -!missing-selector! +CIFilter::copyMachineTransitionFilter not bound -!missing-selector! +CIFilter::coreMLModelFilter not bound -!missing-selector! +CIFilter::crystallizeFilter not bound -!missing-selector! +CIFilter::darkenBlendModeFilter not bound -!missing-selector! +CIFilter::depthOfFieldFilter not bound -!missing-selector! +CIFilter::depthToDisparityFilter not bound -!missing-selector! +CIFilter::differenceBlendModeFilter not bound -!missing-selector! +CIFilter::discBlurFilter not bound -!missing-selector! +CIFilter::disintegrateWithMaskTransitionFilter not bound -!missing-selector! +CIFilter::disparityToDepthFilter not bound -!missing-selector! +CIFilter::dissolveTransitionFilter not bound -!missing-selector! +CIFilter::ditherFilter not bound -!missing-selector! +CIFilter::divideBlendModeFilter not bound -!missing-selector! +CIFilter::documentEnhancerFilter not bound -!missing-selector! +CIFilter::dotScreenFilter not bound -!missing-selector! +CIFilter::edgePreserveUpsampleFilter not bound -!missing-selector! +CIFilter::edgesFilter not bound -!missing-selector! +CIFilter::edgeWorkFilter not bound -!missing-selector! +CIFilter::eightfoldReflectedTileFilter not bound -!missing-selector! +CIFilter::exclusionBlendModeFilter not bound -!missing-selector! +CIFilter::exposureAdjustFilter not bound -!missing-selector! +CIFilter::falseColorFilter not bound -!missing-selector! +CIFilter::flashTransitionFilter not bound -!missing-selector! +CIFilter::fourfoldReflectedTileFilter not bound -!missing-selector! +CIFilter::fourfoldRotatedTileFilter not bound -!missing-selector! +CIFilter::fourfoldTranslatedTileFilter not bound -!missing-selector! +CIFilter::gaborGradientsFilter not bound -!missing-selector! +CIFilter::gammaAdjustFilter not bound -!missing-selector! +CIFilter::gaussianBlurFilter not bound -!missing-selector! +CIFilter::gaussianGradientFilter not bound -!missing-selector! +CIFilter::glideReflectedTileFilter not bound -!missing-selector! +CIFilter::gloomFilter not bound -!missing-selector! +CIFilter::hardLightBlendModeFilter not bound -!missing-selector! +CIFilter::hatchedScreenFilter not bound -!missing-selector! +CIFilter::heightFieldFromMaskFilter not bound -!missing-selector! +CIFilter::hexagonalPixellateFilter not bound -!missing-selector! +CIFilter::highlightShadowAdjustFilter not bound -!missing-selector! +CIFilter::hueAdjustFilter not bound -!missing-selector! +CIFilter::hueBlendModeFilter not bound -!missing-selector! +CIFilter::hueSaturationValueGradientFilter not bound -!missing-selector! +CIFilter::kaleidoscopeFilter not bound -!missing-selector! +CIFilter::keystoneCorrectionCombinedFilter not bound -!missing-selector! +CIFilter::keystoneCorrectionHorizontalFilter not bound -!missing-selector! +CIFilter::keystoneCorrectionVerticalFilter not bound -!missing-selector! +CIFilter::LabDeltaE not bound -!missing-selector! +CIFilter::lanczosScaleTransformFilter not bound -!missing-selector! +CIFilter::lenticularHaloGeneratorFilter not bound -!missing-selector! +CIFilter::lightenBlendModeFilter not bound -!missing-selector! +CIFilter::linearBurnBlendModeFilter not bound -!missing-selector! +CIFilter::linearDodgeBlendModeFilter not bound -!missing-selector! +CIFilter::linearGradientFilter not bound -!missing-selector! +CIFilter::linearToSRGBToneCurveFilter not bound -!missing-selector! +CIFilter::lineOverlayFilter not bound -!missing-selector! +CIFilter::lineScreenFilter not bound -!missing-selector! +CIFilter::luminosityBlendModeFilter not bound -!missing-selector! +CIFilter::maskedVariableBlurFilter not bound -!missing-selector! +CIFilter::maskToAlphaFilter not bound -!missing-selector! +CIFilter::maximumComponentFilter not bound -!missing-selector! +CIFilter::maximumCompositingFilter not bound -!missing-selector! +CIFilter::medianFilter not bound -!missing-selector! +CIFilter::meshGeneratorFilter not bound -!missing-selector! +CIFilter::minimumComponentFilter not bound -!missing-selector! +CIFilter::minimumCompositingFilter not bound -!missing-selector! +CIFilter::mixFilter not bound -!missing-selector! +CIFilter::modTransitionFilter not bound -!missing-selector! +CIFilter::morphologyGradientFilter not bound -!missing-selector! +CIFilter::morphologyMaximumFilter not bound -!missing-selector! +CIFilter::morphologyMinimumFilter not bound -!missing-selector! +CIFilter::morphologyRectangleMaximumFilter not bound -!missing-selector! +CIFilter::morphologyRectangleMinimumFilter not bound -!missing-selector! +CIFilter::motionBlurFilter not bound -!missing-selector! +CIFilter::multiplyBlendModeFilter not bound -!missing-selector! +CIFilter::multiplyCompositingFilter not bound -!missing-selector! +CIFilter::noiseReductionFilter not bound -!missing-selector! +CIFilter::opTileFilter not bound -!missing-selector! +CIFilter::overlayBlendModeFilter not bound -!missing-selector! +CIFilter::pageCurlTransitionFilter not bound -!missing-selector! +CIFilter::pageCurlWithShadowTransitionFilter not bound -!missing-selector! +CIFilter::paletteCentroidFilter not bound -!missing-selector! +CIFilter::palettizeFilter not bound -!missing-selector! +CIFilter::parallelogramTileFilter not bound -!missing-selector! +CIFilter::PDF417BarcodeGenerator not bound -!missing-selector! +CIFilter::perspectiveCorrectionFilter not bound -!missing-selector! +CIFilter::perspectiveRotateFilter not bound -!missing-selector! +CIFilter::perspectiveTileFilter not bound -!missing-selector! +CIFilter::perspectiveTransformFilter not bound -!missing-selector! +CIFilter::perspectiveTransformWithExtentFilter not bound -!missing-selector! +CIFilter::photoEffectChromeFilter not bound -!missing-selector! +CIFilter::photoEffectFadeFilter not bound -!missing-selector! +CIFilter::photoEffectInstantFilter not bound -!missing-selector! +CIFilter::photoEffectMonoFilter not bound -!missing-selector! +CIFilter::photoEffectNoirFilter not bound -!missing-selector! +CIFilter::photoEffectProcessFilter not bound -!missing-selector! +CIFilter::photoEffectTonalFilter not bound -!missing-selector! +CIFilter::photoEffectTransferFilter not bound -!missing-selector! +CIFilter::pinLightBlendModeFilter not bound -!missing-selector! +CIFilter::pixellateFilter not bound -!missing-selector! +CIFilter::pointillizeFilter not bound -!missing-selector! +CIFilter::QRCodeGenerator not bound -!missing-selector! +CIFilter::radialGradientFilter not bound -!missing-selector! +CIFilter::randomGeneratorFilter not bound -!missing-selector! +CIFilter::rippleTransitionFilter not bound -!missing-selector! +CIFilter::roundedRectangleGeneratorFilter not bound -!missing-selector! +CIFilter::saliencyMapFilter not bound -!missing-selector! +CIFilter::saturationBlendModeFilter not bound -!missing-selector! +CIFilter::screenBlendModeFilter not bound -!missing-selector! +CIFilter::sepiaToneFilter not bound -!missing-selector! +CIFilter::shadedMaterialFilter not bound -!missing-selector! +CIFilter::sharpenLuminanceFilter not bound -!missing-selector! +CIFilter::sixfoldReflectedTileFilter not bound -!missing-selector! +CIFilter::sixfoldRotatedTileFilter not bound -!missing-selector! +CIFilter::smoothLinearGradientFilter not bound -!missing-selector! +CIFilter::softLightBlendModeFilter not bound -!missing-selector! +CIFilter::sourceAtopCompositingFilter not bound -!missing-selector! +CIFilter::sourceInCompositingFilter not bound -!missing-selector! +CIFilter::sourceOutCompositingFilter not bound -!missing-selector! +CIFilter::sourceOverCompositingFilter not bound -!missing-selector! +CIFilter::spotColorFilter not bound -!missing-selector! +CIFilter::spotLightFilter not bound -!missing-selector! +CIFilter::sRGBToneCurveToLinearFilter not bound -!missing-selector! +CIFilter::starShineGeneratorFilter not bound -!missing-selector! +CIFilter::straightenFilter not bound -!missing-selector! +CIFilter::stripesGeneratorFilter not bound -!missing-selector! +CIFilter::subtractBlendModeFilter not bound -!missing-selector! +CIFilter::sunbeamsGeneratorFilter not bound -!missing-selector! +CIFilter::supportedRawCameraModels not bound -!missing-selector! +CIFilter::swipeTransitionFilter not bound -!missing-selector! +CIFilter::temperatureAndTintFilter not bound -!missing-selector! +CIFilter::textImageGeneratorFilter not bound -!missing-selector! +CIFilter::thermalFilter not bound -!missing-selector! +CIFilter::toneCurveFilter not bound -!missing-selector! +CIFilter::triangleKaleidoscopeFilter not bound -!missing-selector! +CIFilter::triangleTileFilter not bound -!missing-selector! +CIFilter::twelvefoldReflectedTileFilter not bound -!missing-selector! +CIFilter::unsharpMaskFilter not bound -!missing-selector! +CIFilter::vibranceFilter not bound -!missing-selector! +CIFilter::vignetteEffectFilter not bound -!missing-selector! +CIFilter::vignetteFilter not bound -!missing-selector! +CIFilter::whitePointAdjustFilter not bound -!missing-selector! +CIFilter::xRayFilter not bound -!missing-selector! +CIFilter::zoomBlurFilter not bound -!missing-selector! +CIImage::blackImage not bound -!missing-selector! +CIImage::blueImage not bound -!missing-selector! +CIImage::clearImage not bound -!missing-selector! +CIImage::cyanImage not bound -!missing-selector! +CIImage::grayImage not bound -!missing-selector! +CIImage::greenImage not bound -!missing-selector! +CIImage::imageWithCGImageSource:index:options: not bound -!missing-selector! +CIImage::imageWithSemanticSegmentationMatte: not bound -!missing-selector! +CIImage::imageWithSemanticSegmentationMatte:options: not bound -!missing-selector! +CIImage::magentaImage not bound -!missing-selector! +CIImage::redImage not bound -!missing-selector! +CIImage::whiteImage not bound -!missing-selector! +CIImage::yellowImage not bound -!missing-selector! CIBlendKernel::applyWithForeground:background:colorSpace: not bound -!missing-selector! CIContext::depthBlurEffectFilterForImage:disparityImage:portraitEffectsMatte:hairSemanticSegmentation:orientation:options: not bound -!missing-selector! CIImage::imageByApplyingTransform:highQualityDownsample: not bound -!missing-selector! CIImage::initWithCGImageSource:index:options: not bound -!missing-selector! CIImage::initWithSemanticSegmentationMatte: not bound -!missing-selector! CIImage::initWithSemanticSegmentationMatte:options: not bound -!missing-selector! CIImage::semanticSegmentationMatte not bound -!missing-selector! +CIContext::contextWithMTLCommandQueue: not bound -!missing-selector! +CIContext::contextWithMTLCommandQueue:options: not bound diff --git a/tests/xtro-sharpie/macOS-CoreImage.todo b/tests/xtro-sharpie/macOS-CoreImage.todo deleted file mode 100644 index 95a2645580..0000000000 --- a/tests/xtro-sharpie/macOS-CoreImage.todo +++ /dev/null @@ -1,360 +0,0 @@ -!deprecated-attribute-missing! CIPlugIn::loadAllPlugIns missing a [Deprecated] attribute -!missing-field! kCIContextAllowLowPower not bound -!missing-field! kCIImageAuxiliarySemanticSegmentationHairMatte not bound -!missing-field! kCIImageAuxiliarySemanticSegmentationSkinMatte not bound -!missing-field! kCIImageAuxiliarySemanticSegmentationTeethMatte not bound -!missing-field! kCIImageRepresentationAVSemanticSegmentationMattes not bound -!missing-field! kCIImageRepresentationSemanticSegmentationHairMatteImage not bound -!missing-field! kCIImageRepresentationSemanticSegmentationSkinMatteImage not bound -!missing-field! kCIImageRepresentationSemanticSegmentationTeethMatteImage not bound -!missing-field! kCIInputEnableEDRModeKey not bound -!missing-protocol! CIAccordionFoldTransition not bound -!missing-protocol! CIAffineClamp not bound -!missing-protocol! CIAffineTile not bound -!missing-protocol! CIAttributedTextImageGenerator not bound -!missing-protocol! CIAztecCodeGenerator not bound -!missing-protocol! CIBarcodeGenerator not bound -!missing-protocol! CIBarsSwipeTransition not bound -!missing-protocol! CIBicubicScaleTransform not bound -!missing-protocol! CIBlendWithMask not bound -!missing-protocol! CIBloom not bound -!missing-protocol! CIBokehBlur not bound -!missing-protocol! CIBoxBlur not bound -!missing-protocol! CICheckerboardGenerator not bound -!missing-protocol! CICircularScreen not bound -!missing-protocol! CICMYKHalftone not bound -!missing-protocol! CICode128BarcodeGenerator not bound -!missing-protocol! CIColorClamp not bound -!missing-protocol! CIColorControls not bound -!missing-protocol! CIColorCrossPolynomial not bound -!missing-protocol! CIColorCube not bound -!missing-protocol! CIColorCubesMixedWithMask not bound -!missing-protocol! CIColorCubeWithColorSpace not bound -!missing-protocol! CIColorCurves not bound -!missing-protocol! CIColorInvert not bound -!missing-protocol! CIColorMap not bound -!missing-protocol! CIColorMatrix not bound -!missing-protocol! CIColorMonochrome not bound -!missing-protocol! CIColorPolynomial not bound -!missing-protocol! CIColorPosterize not bound -!missing-protocol! CIComicEffect not bound -!missing-protocol! CICompositeOperation not bound -!missing-protocol! CIConvolution not bound -!missing-protocol! CICopyMachineTransition not bound -!missing-protocol! CICoreMLModel not bound -!missing-protocol! CICrystallize not bound -!missing-protocol! CIDepthOfField not bound -!missing-protocol! CIDepthToDisparity not bound -!missing-protocol! CIDiscBlur not bound -!missing-protocol! CIDisintegrateWithMaskTransition not bound -!missing-protocol! CIDisparityToDepth not bound -!missing-protocol! CIDissolveTransition not bound -!missing-protocol! CIDither not bound -!missing-protocol! CIDocumentEnhancer not bound -!missing-protocol! CIDotScreen not bound -!missing-protocol! CIEdgePreserveUpsample not bound -!missing-protocol! CIEdges not bound -!missing-protocol! CIEdgeWork not bound -!missing-protocol! CIEightfoldReflectedTile not bound -!missing-protocol! CIExposureAdjust not bound -!missing-protocol! CIFalseColor not bound -!missing-protocol! CIFilter not bound -!missing-protocol! CIFlashTransition not bound -!missing-protocol! CIFourCoordinateGeometryFilter not bound -!missing-protocol! CIFourfoldReflectedTile not bound -!missing-protocol! CIFourfoldRotatedTile not bound -!missing-protocol! CIFourfoldTranslatedTile not bound -!missing-protocol! CIGaborGradients not bound -!missing-protocol! CIGammaAdjust not bound -!missing-protocol! CIGaussianBlur not bound -!missing-protocol! CIGaussianGradient not bound -!missing-protocol! CIGlideReflectedTile not bound -!missing-protocol! CIGloom not bound -!missing-protocol! CIHatchedScreen not bound -!missing-protocol! CIHeightFieldFromMask not bound -!missing-protocol! CIHexagonalPixellate not bound -!missing-protocol! CIHighlightShadowAdjust not bound -!missing-protocol! CIHueAdjust not bound -!missing-protocol! CIHueSaturationValueGradient not bound -!missing-protocol! CIKaleidoscope not bound -!missing-protocol! CIKeystoneCorrectionCombined not bound -!missing-protocol! CIKeystoneCorrectionHorizontal not bound -!missing-protocol! CIKeystoneCorrectionVertical not bound -!missing-protocol! CILabDeltaE not bound -!missing-protocol! CILanczosScaleTransform not bound -!missing-protocol! CILenticularHaloGenerator not bound -!missing-protocol! CILinearGradient not bound -!missing-protocol! CILinearToSRGBToneCurve not bound -!missing-protocol! CILineOverlay not bound -!missing-protocol! CILineScreen not bound -!missing-protocol! CIMaskedVariableBlur not bound -!missing-protocol! CIMaskToAlpha not bound -!missing-protocol! CIMaximumComponent not bound -!missing-protocol! CIMedian not bound -!missing-protocol! CIMeshGenerator not bound -!missing-protocol! CIMinimumComponent not bound -!missing-protocol! CIMix not bound -!missing-protocol! CIModTransition not bound -!missing-protocol! CIMorphologyGradient not bound -!missing-protocol! CIMorphologyMaximum not bound -!missing-protocol! CIMorphologyMinimum not bound -!missing-protocol! CIMorphologyRectangleMaximum not bound -!missing-protocol! CIMorphologyRectangleMinimum not bound -!missing-protocol! CIMotionBlur not bound -!missing-protocol! CINoiseReduction not bound -!missing-protocol! CIOpTile not bound -!missing-protocol! CIPageCurlTransition not bound -!missing-protocol! CIPageCurlWithShadowTransition not bound -!missing-protocol! CIPaletteCentroid not bound -!missing-protocol! CIPalettize not bound -!missing-protocol! CIParallelogramTile not bound -!missing-protocol! CIPDF417BarcodeGenerator not bound -!missing-protocol! CIPerspectiveCorrection not bound -!missing-protocol! CIPerspectiveRotate not bound -!missing-protocol! CIPerspectiveTile not bound -!missing-protocol! CIPerspectiveTransform not bound -!missing-protocol! CIPerspectiveTransformWithExtent not bound -!missing-protocol! CIPhotoEffect not bound -!missing-protocol! CIPixellate not bound -!missing-protocol! CIPointillize not bound -!missing-protocol! CIQRCodeGenerator not bound -!missing-protocol! CIRadialGradient not bound -!missing-protocol! CIRandomGenerator not bound -!missing-protocol! CIRippleTransition not bound -!missing-protocol! CIRoundedRectangleGenerator not bound -!missing-protocol! CISaliencyMap not bound -!missing-protocol! CISepiaTone not bound -!missing-protocol! CIShadedMaterial not bound -!missing-protocol! CISharpenLuminance not bound -!missing-protocol! CISixfoldReflectedTile not bound -!missing-protocol! CISixfoldRotatedTile not bound -!missing-protocol! CISmoothLinearGradient not bound -!missing-protocol! CISpotColor not bound -!missing-protocol! CISpotLight not bound -!missing-protocol! CISRGBToneCurveToLinear not bound -!missing-protocol! CIStarShineGenerator not bound -!missing-protocol! CIStraighten not bound -!missing-protocol! CIStripesGenerator not bound -!missing-protocol! CISunbeamsGenerator not bound -!missing-protocol! CISwipeTransition not bound -!missing-protocol! CITemperatureAndTint not bound -!missing-protocol! CITextImageGenerator not bound -!missing-protocol! CIThermal not bound -!missing-protocol! CIToneCurve not bound -!missing-protocol! CITransitionFilter not bound -!missing-protocol! CITriangleKaleidoscope not bound -!missing-protocol! CITriangleTile not bound -!missing-protocol! CITwelvefoldReflectedTile not bound -!missing-protocol! CIUnsharpMask not bound -!missing-protocol! CIVibrance not bound -!missing-protocol! CIVignette not bound -!missing-protocol! CIVignetteEffect not bound -!missing-protocol! CIWhitePointAdjust not bound -!missing-protocol! CIXRay not bound -!missing-protocol! CIZoomBlur not bound -!missing-selector! +CIFilter::accordionFoldTransitionFilter not bound -!missing-selector! +CIFilter::additionCompositingFilter not bound -!missing-selector! +CIFilter::affineClampFilter not bound -!missing-selector! +CIFilter::affineTileFilter not bound -!missing-selector! +CIFilter::attributedTextImageGeneratorFilter not bound -!missing-selector! +CIFilter::aztecCodeGeneratorFilter not bound -!missing-selector! +CIFilter::barcodeGeneratorFilter not bound -!missing-selector! +CIFilter::barsSwipeTransitionFilter not bound -!missing-selector! +CIFilter::bicubicScaleTransformFilter not bound -!missing-selector! +CIFilter::blendWithAlphaMaskFilter not bound -!missing-selector! +CIFilter::blendWithBlueMaskFilter not bound -!missing-selector! +CIFilter::blendWithMaskFilter not bound -!missing-selector! +CIFilter::blendWithRedMaskFilter not bound -!missing-selector! +CIFilter::bloomFilter not bound -!missing-selector! +CIFilter::bokehBlurFilter not bound -!missing-selector! +CIFilter::boxBlurFilter not bound -!missing-selector! +CIFilter::checkerboardGeneratorFilter not bound -!missing-selector! +CIFilter::circularScreenFilter not bound -!missing-selector! +CIFilter::CMYKHalftone not bound -!missing-selector! +CIFilter::code128BarcodeGeneratorFilter not bound -!missing-selector! +CIFilter::colorBlendModeFilter not bound -!missing-selector! +CIFilter::colorBurnBlendModeFilter not bound -!missing-selector! +CIFilter::colorClampFilter not bound -!missing-selector! +CIFilter::colorControlsFilter not bound -!missing-selector! +CIFilter::colorCrossPolynomialFilter not bound -!missing-selector! +CIFilter::colorCubeFilter not bound -!missing-selector! +CIFilter::colorCubesMixedWithMaskFilter not bound -!missing-selector! +CIFilter::colorCubeWithColorSpaceFilter not bound -!missing-selector! +CIFilter::colorCurvesFilter not bound -!missing-selector! +CIFilter::colorDodgeBlendModeFilter not bound -!missing-selector! +CIFilter::colorInvertFilter not bound -!missing-selector! +CIFilter::colorMapFilter not bound -!missing-selector! +CIFilter::colorMatrixFilter not bound -!missing-selector! +CIFilter::colorMonochromeFilter not bound -!missing-selector! +CIFilter::colorPolynomialFilter not bound -!missing-selector! +CIFilter::colorPosterizeFilter not bound -!missing-selector! +CIFilter::comicEffectFilter not bound -!missing-selector! +CIFilter::convolution3X3Filter not bound -!missing-selector! +CIFilter::convolution5X5Filter not bound -!missing-selector! +CIFilter::convolution7X7Filter not bound -!missing-selector! +CIFilter::convolution9HorizontalFilter not bound -!missing-selector! +CIFilter::convolution9VerticalFilter not bound -!missing-selector! +CIFilter::copyMachineTransitionFilter not bound -!missing-selector! +CIFilter::coreMLModelFilter not bound -!missing-selector! +CIFilter::crystallizeFilter not bound -!missing-selector! +CIFilter::darkenBlendModeFilter not bound -!missing-selector! +CIFilter::depthOfFieldFilter not bound -!missing-selector! +CIFilter::depthToDisparityFilter not bound -!missing-selector! +CIFilter::differenceBlendModeFilter not bound -!missing-selector! +CIFilter::discBlurFilter not bound -!missing-selector! +CIFilter::disintegrateWithMaskTransitionFilter not bound -!missing-selector! +CIFilter::disparityToDepthFilter not bound -!missing-selector! +CIFilter::dissolveTransitionFilter not bound -!missing-selector! +CIFilter::ditherFilter not bound -!missing-selector! +CIFilter::divideBlendModeFilter not bound -!missing-selector! +CIFilter::documentEnhancerFilter not bound -!missing-selector! +CIFilter::dotScreenFilter not bound -!missing-selector! +CIFilter::edgePreserveUpsampleFilter not bound -!missing-selector! +CIFilter::edgesFilter not bound -!missing-selector! +CIFilter::edgeWorkFilter not bound -!missing-selector! +CIFilter::eightfoldReflectedTileFilter not bound -!missing-selector! +CIFilter::exclusionBlendModeFilter not bound -!missing-selector! +CIFilter::exposureAdjustFilter not bound -!missing-selector! +CIFilter::falseColorFilter not bound -!missing-selector! +CIFilter::flashTransitionFilter not bound -!missing-selector! +CIFilter::fourfoldReflectedTileFilter not bound -!missing-selector! +CIFilter::fourfoldRotatedTileFilter not bound -!missing-selector! +CIFilter::fourfoldTranslatedTileFilter not bound -!missing-selector! +CIFilter::gaborGradientsFilter not bound -!missing-selector! +CIFilter::gammaAdjustFilter not bound -!missing-selector! +CIFilter::gaussianBlurFilter not bound -!missing-selector! +CIFilter::gaussianGradientFilter not bound -!missing-selector! +CIFilter::glideReflectedTileFilter not bound -!missing-selector! +CIFilter::gloomFilter not bound -!missing-selector! +CIFilter::hardLightBlendModeFilter not bound -!missing-selector! +CIFilter::hatchedScreenFilter not bound -!missing-selector! +CIFilter::heightFieldFromMaskFilter not bound -!missing-selector! +CIFilter::hexagonalPixellateFilter not bound -!missing-selector! +CIFilter::highlightShadowAdjustFilter not bound -!missing-selector! +CIFilter::hueAdjustFilter not bound -!missing-selector! +CIFilter::hueBlendModeFilter not bound -!missing-selector! +CIFilter::hueSaturationValueGradientFilter not bound -!missing-selector! +CIFilter::kaleidoscopeFilter not bound -!missing-selector! +CIFilter::keystoneCorrectionCombinedFilter not bound -!missing-selector! +CIFilter::keystoneCorrectionHorizontalFilter not bound -!missing-selector! +CIFilter::keystoneCorrectionVerticalFilter not bound -!missing-selector! +CIFilter::LabDeltaE not bound -!missing-selector! +CIFilter::lanczosScaleTransformFilter not bound -!missing-selector! +CIFilter::lenticularHaloGeneratorFilter not bound -!missing-selector! +CIFilter::lightenBlendModeFilter not bound -!missing-selector! +CIFilter::linearBurnBlendModeFilter not bound -!missing-selector! +CIFilter::linearDodgeBlendModeFilter not bound -!missing-selector! +CIFilter::linearGradientFilter not bound -!missing-selector! +CIFilter::linearToSRGBToneCurveFilter not bound -!missing-selector! +CIFilter::lineOverlayFilter not bound -!missing-selector! +CIFilter::lineScreenFilter not bound -!missing-selector! +CIFilter::luminosityBlendModeFilter not bound -!missing-selector! +CIFilter::maskedVariableBlurFilter not bound -!missing-selector! +CIFilter::maskToAlphaFilter not bound -!missing-selector! +CIFilter::maximumComponentFilter not bound -!missing-selector! +CIFilter::maximumCompositingFilter not bound -!missing-selector! +CIFilter::medianFilter not bound -!missing-selector! +CIFilter::meshGeneratorFilter not bound -!missing-selector! +CIFilter::minimumComponentFilter not bound -!missing-selector! +CIFilter::minimumCompositingFilter not bound -!missing-selector! +CIFilter::mixFilter not bound -!missing-selector! +CIFilter::modTransitionFilter not bound -!missing-selector! +CIFilter::morphologyGradientFilter not bound -!missing-selector! +CIFilter::morphologyMaximumFilter not bound -!missing-selector! +CIFilter::morphologyMinimumFilter not bound -!missing-selector! +CIFilter::morphologyRectangleMaximumFilter not bound -!missing-selector! +CIFilter::morphologyRectangleMinimumFilter not bound -!missing-selector! +CIFilter::motionBlurFilter not bound -!missing-selector! +CIFilter::multiplyBlendModeFilter not bound -!missing-selector! +CIFilter::multiplyCompositingFilter not bound -!missing-selector! +CIFilter::noiseReductionFilter not bound -!missing-selector! +CIFilter::opTileFilter not bound -!missing-selector! +CIFilter::overlayBlendModeFilter not bound -!missing-selector! +CIFilter::pageCurlTransitionFilter not bound -!missing-selector! +CIFilter::pageCurlWithShadowTransitionFilter not bound -!missing-selector! +CIFilter::paletteCentroidFilter not bound -!missing-selector! +CIFilter::palettizeFilter not bound -!missing-selector! +CIFilter::parallelogramTileFilter not bound -!missing-selector! +CIFilter::PDF417BarcodeGenerator not bound -!missing-selector! +CIFilter::perspectiveCorrectionFilter not bound -!missing-selector! +CIFilter::perspectiveRotateFilter not bound -!missing-selector! +CIFilter::perspectiveTileFilter not bound -!missing-selector! +CIFilter::perspectiveTransformFilter not bound -!missing-selector! +CIFilter::perspectiveTransformWithExtentFilter not bound -!missing-selector! +CIFilter::photoEffectChromeFilter not bound -!missing-selector! +CIFilter::photoEffectFadeFilter not bound -!missing-selector! +CIFilter::photoEffectInstantFilter not bound -!missing-selector! +CIFilter::photoEffectMonoFilter not bound -!missing-selector! +CIFilter::photoEffectNoirFilter not bound -!missing-selector! +CIFilter::photoEffectProcessFilter not bound -!missing-selector! +CIFilter::photoEffectTonalFilter not bound -!missing-selector! +CIFilter::photoEffectTransferFilter not bound -!missing-selector! +CIFilter::pinLightBlendModeFilter not bound -!missing-selector! +CIFilter::pixellateFilter not bound -!missing-selector! +CIFilter::pointillizeFilter not bound -!missing-selector! +CIFilter::QRCodeGenerator not bound -!missing-selector! +CIFilter::radialGradientFilter not bound -!missing-selector! +CIFilter::randomGeneratorFilter not bound -!missing-selector! +CIFilter::rippleTransitionFilter not bound -!missing-selector! +CIFilter::roundedRectangleGeneratorFilter not bound -!missing-selector! +CIFilter::saliencyMapFilter not bound -!missing-selector! +CIFilter::saturationBlendModeFilter not bound -!missing-selector! +CIFilter::screenBlendModeFilter not bound -!missing-selector! +CIFilter::sepiaToneFilter not bound -!missing-selector! +CIFilter::shadedMaterialFilter not bound -!missing-selector! +CIFilter::sharpenLuminanceFilter not bound -!missing-selector! +CIFilter::sixfoldReflectedTileFilter not bound -!missing-selector! +CIFilter::sixfoldRotatedTileFilter not bound -!missing-selector! +CIFilter::smoothLinearGradientFilter not bound -!missing-selector! +CIFilter::softLightBlendModeFilter not bound -!missing-selector! +CIFilter::sourceAtopCompositingFilter not bound -!missing-selector! +CIFilter::sourceInCompositingFilter not bound -!missing-selector! +CIFilter::sourceOutCompositingFilter not bound -!missing-selector! +CIFilter::sourceOverCompositingFilter not bound -!missing-selector! +CIFilter::spotColorFilter not bound -!missing-selector! +CIFilter::spotLightFilter not bound -!missing-selector! +CIFilter::sRGBToneCurveToLinearFilter not bound -!missing-selector! +CIFilter::starShineGeneratorFilter not bound -!missing-selector! +CIFilter::straightenFilter not bound -!missing-selector! +CIFilter::stripesGeneratorFilter not bound -!missing-selector! +CIFilter::subtractBlendModeFilter not bound -!missing-selector! +CIFilter::sunbeamsGeneratorFilter not bound -!missing-selector! +CIFilter::supportedRawCameraModels not bound -!missing-selector! +CIFilter::swipeTransitionFilter not bound -!missing-selector! +CIFilter::temperatureAndTintFilter not bound -!missing-selector! +CIFilter::textImageGeneratorFilter not bound -!missing-selector! +CIFilter::thermalFilter not bound -!missing-selector! +CIFilter::toneCurveFilter not bound -!missing-selector! +CIFilter::triangleKaleidoscopeFilter not bound -!missing-selector! +CIFilter::triangleTileFilter not bound -!missing-selector! +CIFilter::twelvefoldReflectedTileFilter not bound -!missing-selector! +CIFilter::unsharpMaskFilter not bound -!missing-selector! +CIFilter::vibranceFilter not bound -!missing-selector! +CIFilter::vignetteEffectFilter not bound -!missing-selector! +CIFilter::vignetteFilter not bound -!missing-selector! +CIFilter::whitePointAdjustFilter not bound -!missing-selector! +CIFilter::xRayFilter not bound -!missing-selector! +CIFilter::zoomBlurFilter not bound -!missing-selector! +CIImage::blackImage not bound -!missing-selector! +CIImage::blueImage not bound -!missing-selector! +CIImage::clearImage not bound -!missing-selector! +CIImage::cyanImage not bound -!missing-selector! +CIImage::grayImage not bound -!missing-selector! +CIImage::greenImage not bound -!missing-selector! +CIImage::imageWithCGImageSource:index:options: not bound -!missing-selector! +CIImage::imageWithSemanticSegmentationMatte: not bound -!missing-selector! +CIImage::imageWithSemanticSegmentationMatte:options: not bound -!missing-selector! +CIImage::magentaImage not bound -!missing-selector! +CIImage::redImage not bound -!missing-selector! +CIImage::whiteImage not bound -!missing-selector! +CIImage::yellowImage not bound -!missing-selector! +CIPlugIn::loadNonExecutablePlugIn: not bound -!missing-selector! CIBlendKernel::applyWithForeground:background:colorSpace: not bound -!missing-selector! CIContext::depthBlurEffectFilterForImage:disparityImage:portraitEffectsMatte:hairSemanticSegmentation:orientation:options: not bound -!missing-selector! CIImage::imageByApplyingTransform:highQualityDownsample: not bound -!missing-selector! CIImage::initWithCGImageSource:index:options: not bound -!missing-selector! CIImage::initWithSemanticSegmentationMatte: not bound -!missing-selector! CIImage::initWithSemanticSegmentationMatte:options: not bound -!missing-selector! CIImage::semanticSegmentationMatte not bound -!missing-selector! +CIContext::contextWithMTLCommandQueue: not bound -!missing-selector! +CIContext::contextWithMTLCommandQueue:options: not bound diff --git a/tests/xtro-sharpie/tvOS-CoreImage.todo b/tests/xtro-sharpie/tvOS-CoreImage.todo deleted file mode 100644 index 009771440a..0000000000 --- a/tests/xtro-sharpie/tvOS-CoreImage.todo +++ /dev/null @@ -1,358 +0,0 @@ -!missing-field! kCIContextAllowLowPower not bound -!missing-field! kCIImageAuxiliarySemanticSegmentationHairMatte not bound -!missing-field! kCIImageAuxiliarySemanticSegmentationSkinMatte not bound -!missing-field! kCIImageAuxiliarySemanticSegmentationTeethMatte not bound -!missing-field! kCIImageRepresentationAVSemanticSegmentationMattes not bound -!missing-field! kCIImageRepresentationSemanticSegmentationHairMatteImage not bound -!missing-field! kCIImageRepresentationSemanticSegmentationSkinMatteImage not bound -!missing-field! kCIImageRepresentationSemanticSegmentationTeethMatteImage not bound -!missing-field! kCIInputEnableEDRModeKey not bound -!missing-protocol! CIAccordionFoldTransition not bound -!missing-protocol! CIAffineClamp not bound -!missing-protocol! CIAffineTile not bound -!missing-protocol! CIAttributedTextImageGenerator not bound -!missing-protocol! CIAztecCodeGenerator not bound -!missing-protocol! CIBarcodeGenerator not bound -!missing-protocol! CIBarsSwipeTransition not bound -!missing-protocol! CIBicubicScaleTransform not bound -!missing-protocol! CIBlendWithMask not bound -!missing-protocol! CIBloom not bound -!missing-protocol! CIBokehBlur not bound -!missing-protocol! CIBoxBlur not bound -!missing-protocol! CICheckerboardGenerator not bound -!missing-protocol! CICircularScreen not bound -!missing-protocol! CICMYKHalftone not bound -!missing-protocol! CICode128BarcodeGenerator not bound -!missing-protocol! CIColorClamp not bound -!missing-protocol! CIColorControls not bound -!missing-protocol! CIColorCrossPolynomial not bound -!missing-protocol! CIColorCube not bound -!missing-protocol! CIColorCubesMixedWithMask not bound -!missing-protocol! CIColorCubeWithColorSpace not bound -!missing-protocol! CIColorCurves not bound -!missing-protocol! CIColorInvert not bound -!missing-protocol! CIColorMap not bound -!missing-protocol! CIColorMatrix not bound -!missing-protocol! CIColorMonochrome not bound -!missing-protocol! CIColorPolynomial not bound -!missing-protocol! CIColorPosterize not bound -!missing-protocol! CIComicEffect not bound -!missing-protocol! CICompositeOperation not bound -!missing-protocol! CIConvolution not bound -!missing-protocol! CICopyMachineTransition not bound -!missing-protocol! CICoreMLModel not bound -!missing-protocol! CICrystallize not bound -!missing-protocol! CIDepthOfField not bound -!missing-protocol! CIDepthToDisparity not bound -!missing-protocol! CIDiscBlur not bound -!missing-protocol! CIDisintegrateWithMaskTransition not bound -!missing-protocol! CIDisparityToDepth not bound -!missing-protocol! CIDissolveTransition not bound -!missing-protocol! CIDither not bound -!missing-protocol! CIDocumentEnhancer not bound -!missing-protocol! CIDotScreen not bound -!missing-protocol! CIEdgePreserveUpsample not bound -!missing-protocol! CIEdges not bound -!missing-protocol! CIEdgeWork not bound -!missing-protocol! CIEightfoldReflectedTile not bound -!missing-protocol! CIExposureAdjust not bound -!missing-protocol! CIFalseColor not bound -!missing-protocol! CIFilter not bound -!missing-protocol! CIFlashTransition not bound -!missing-protocol! CIFourCoordinateGeometryFilter not bound -!missing-protocol! CIFourfoldReflectedTile not bound -!missing-protocol! CIFourfoldRotatedTile not bound -!missing-protocol! CIFourfoldTranslatedTile not bound -!missing-protocol! CIGaborGradients not bound -!missing-protocol! CIGammaAdjust not bound -!missing-protocol! CIGaussianBlur not bound -!missing-protocol! CIGaussianGradient not bound -!missing-protocol! CIGlideReflectedTile not bound -!missing-protocol! CIGloom not bound -!missing-protocol! CIHatchedScreen not bound -!missing-protocol! CIHeightFieldFromMask not bound -!missing-protocol! CIHexagonalPixellate not bound -!missing-protocol! CIHighlightShadowAdjust not bound -!missing-protocol! CIHueAdjust not bound -!missing-protocol! CIHueSaturationValueGradient not bound -!missing-protocol! CIKaleidoscope not bound -!missing-protocol! CIKeystoneCorrectionCombined not bound -!missing-protocol! CIKeystoneCorrectionHorizontal not bound -!missing-protocol! CIKeystoneCorrectionVertical not bound -!missing-protocol! CILabDeltaE not bound -!missing-protocol! CILanczosScaleTransform not bound -!missing-protocol! CILenticularHaloGenerator not bound -!missing-protocol! CILinearGradient not bound -!missing-protocol! CILinearToSRGBToneCurve not bound -!missing-protocol! CILineOverlay not bound -!missing-protocol! CILineScreen not bound -!missing-protocol! CIMaskedVariableBlur not bound -!missing-protocol! CIMaskToAlpha not bound -!missing-protocol! CIMaximumComponent not bound -!missing-protocol! CIMedian not bound -!missing-protocol! CIMeshGenerator not bound -!missing-protocol! CIMinimumComponent not bound -!missing-protocol! CIMix not bound -!missing-protocol! CIModTransition not bound -!missing-protocol! CIMorphologyGradient not bound -!missing-protocol! CIMorphologyMaximum not bound -!missing-protocol! CIMorphologyMinimum not bound -!missing-protocol! CIMorphologyRectangleMaximum not bound -!missing-protocol! CIMorphologyRectangleMinimum not bound -!missing-protocol! CIMotionBlur not bound -!missing-protocol! CINoiseReduction not bound -!missing-protocol! CIOpTile not bound -!missing-protocol! CIPageCurlTransition not bound -!missing-protocol! CIPageCurlWithShadowTransition not bound -!missing-protocol! CIPaletteCentroid not bound -!missing-protocol! CIPalettize not bound -!missing-protocol! CIParallelogramTile not bound -!missing-protocol! CIPDF417BarcodeGenerator not bound -!missing-protocol! CIPerspectiveCorrection not bound -!missing-protocol! CIPerspectiveRotate not bound -!missing-protocol! CIPerspectiveTile not bound -!missing-protocol! CIPerspectiveTransform not bound -!missing-protocol! CIPerspectiveTransformWithExtent not bound -!missing-protocol! CIPhotoEffect not bound -!missing-protocol! CIPixellate not bound -!missing-protocol! CIPointillize not bound -!missing-protocol! CIQRCodeGenerator not bound -!missing-protocol! CIRadialGradient not bound -!missing-protocol! CIRandomGenerator not bound -!missing-protocol! CIRippleTransition not bound -!missing-protocol! CIRoundedRectangleGenerator not bound -!missing-protocol! CISaliencyMap not bound -!missing-protocol! CISepiaTone not bound -!missing-protocol! CIShadedMaterial not bound -!missing-protocol! CISharpenLuminance not bound -!missing-protocol! CISixfoldReflectedTile not bound -!missing-protocol! CISixfoldRotatedTile not bound -!missing-protocol! CISmoothLinearGradient not bound -!missing-protocol! CISpotColor not bound -!missing-protocol! CISpotLight not bound -!missing-protocol! CISRGBToneCurveToLinear not bound -!missing-protocol! CIStarShineGenerator not bound -!missing-protocol! CIStraighten not bound -!missing-protocol! CIStripesGenerator not bound -!missing-protocol! CISunbeamsGenerator not bound -!missing-protocol! CISwipeTransition not bound -!missing-protocol! CITemperatureAndTint not bound -!missing-protocol! CITextImageGenerator not bound -!missing-protocol! CIThermal not bound -!missing-protocol! CIToneCurve not bound -!missing-protocol! CITransitionFilter not bound -!missing-protocol! CITriangleKaleidoscope not bound -!missing-protocol! CITriangleTile not bound -!missing-protocol! CITwelvefoldReflectedTile not bound -!missing-protocol! CIUnsharpMask not bound -!missing-protocol! CIVibrance not bound -!missing-protocol! CIVignette not bound -!missing-protocol! CIVignetteEffect not bound -!missing-protocol! CIWhitePointAdjust not bound -!missing-protocol! CIXRay not bound -!missing-protocol! CIZoomBlur not bound -!missing-selector! +CIFilter::accordionFoldTransitionFilter not bound -!missing-selector! +CIFilter::additionCompositingFilter not bound -!missing-selector! +CIFilter::affineClampFilter not bound -!missing-selector! +CIFilter::affineTileFilter not bound -!missing-selector! +CIFilter::attributedTextImageGeneratorFilter not bound -!missing-selector! +CIFilter::aztecCodeGeneratorFilter not bound -!missing-selector! +CIFilter::barcodeGeneratorFilter not bound -!missing-selector! +CIFilter::barsSwipeTransitionFilter not bound -!missing-selector! +CIFilter::bicubicScaleTransformFilter not bound -!missing-selector! +CIFilter::blendWithAlphaMaskFilter not bound -!missing-selector! +CIFilter::blendWithBlueMaskFilter not bound -!missing-selector! +CIFilter::blendWithMaskFilter not bound -!missing-selector! +CIFilter::blendWithRedMaskFilter not bound -!missing-selector! +CIFilter::bloomFilter not bound -!missing-selector! +CIFilter::bokehBlurFilter not bound -!missing-selector! +CIFilter::boxBlurFilter not bound -!missing-selector! +CIFilter::checkerboardGeneratorFilter not bound -!missing-selector! +CIFilter::circularScreenFilter not bound -!missing-selector! +CIFilter::CMYKHalftone not bound -!missing-selector! +CIFilter::code128BarcodeGeneratorFilter not bound -!missing-selector! +CIFilter::colorBlendModeFilter not bound -!missing-selector! +CIFilter::colorBurnBlendModeFilter not bound -!missing-selector! +CIFilter::colorClampFilter not bound -!missing-selector! +CIFilter::colorControlsFilter not bound -!missing-selector! +CIFilter::colorCrossPolynomialFilter not bound -!missing-selector! +CIFilter::colorCubeFilter not bound -!missing-selector! +CIFilter::colorCubesMixedWithMaskFilter not bound -!missing-selector! +CIFilter::colorCubeWithColorSpaceFilter not bound -!missing-selector! +CIFilter::colorCurvesFilter not bound -!missing-selector! +CIFilter::colorDodgeBlendModeFilter not bound -!missing-selector! +CIFilter::colorInvertFilter not bound -!missing-selector! +CIFilter::colorMapFilter not bound -!missing-selector! +CIFilter::colorMatrixFilter not bound -!missing-selector! +CIFilter::colorMonochromeFilter not bound -!missing-selector! +CIFilter::colorPolynomialFilter not bound -!missing-selector! +CIFilter::colorPosterizeFilter not bound -!missing-selector! +CIFilter::comicEffectFilter not bound -!missing-selector! +CIFilter::convolution3X3Filter not bound -!missing-selector! +CIFilter::convolution5X5Filter not bound -!missing-selector! +CIFilter::convolution7X7Filter not bound -!missing-selector! +CIFilter::convolution9HorizontalFilter not bound -!missing-selector! +CIFilter::convolution9VerticalFilter not bound -!missing-selector! +CIFilter::copyMachineTransitionFilter not bound -!missing-selector! +CIFilter::coreMLModelFilter not bound -!missing-selector! +CIFilter::crystallizeFilter not bound -!missing-selector! +CIFilter::darkenBlendModeFilter not bound -!missing-selector! +CIFilter::depthOfFieldFilter not bound -!missing-selector! +CIFilter::depthToDisparityFilter not bound -!missing-selector! +CIFilter::differenceBlendModeFilter not bound -!missing-selector! +CIFilter::discBlurFilter not bound -!missing-selector! +CIFilter::disintegrateWithMaskTransitionFilter not bound -!missing-selector! +CIFilter::disparityToDepthFilter not bound -!missing-selector! +CIFilter::dissolveTransitionFilter not bound -!missing-selector! +CIFilter::ditherFilter not bound -!missing-selector! +CIFilter::divideBlendModeFilter not bound -!missing-selector! +CIFilter::documentEnhancerFilter not bound -!missing-selector! +CIFilter::dotScreenFilter not bound -!missing-selector! +CIFilter::edgePreserveUpsampleFilter not bound -!missing-selector! +CIFilter::edgesFilter not bound -!missing-selector! +CIFilter::edgeWorkFilter not bound -!missing-selector! +CIFilter::eightfoldReflectedTileFilter not bound -!missing-selector! +CIFilter::exclusionBlendModeFilter not bound -!missing-selector! +CIFilter::exposureAdjustFilter not bound -!missing-selector! +CIFilter::falseColorFilter not bound -!missing-selector! +CIFilter::flashTransitionFilter not bound -!missing-selector! +CIFilter::fourfoldReflectedTileFilter not bound -!missing-selector! +CIFilter::fourfoldRotatedTileFilter not bound -!missing-selector! +CIFilter::fourfoldTranslatedTileFilter not bound -!missing-selector! +CIFilter::gaborGradientsFilter not bound -!missing-selector! +CIFilter::gammaAdjustFilter not bound -!missing-selector! +CIFilter::gaussianBlurFilter not bound -!missing-selector! +CIFilter::gaussianGradientFilter not bound -!missing-selector! +CIFilter::glideReflectedTileFilter not bound -!missing-selector! +CIFilter::gloomFilter not bound -!missing-selector! +CIFilter::hardLightBlendModeFilter not bound -!missing-selector! +CIFilter::hatchedScreenFilter not bound -!missing-selector! +CIFilter::heightFieldFromMaskFilter not bound -!missing-selector! +CIFilter::hexagonalPixellateFilter not bound -!missing-selector! +CIFilter::highlightShadowAdjustFilter not bound -!missing-selector! +CIFilter::hueAdjustFilter not bound -!missing-selector! +CIFilter::hueBlendModeFilter not bound -!missing-selector! +CIFilter::hueSaturationValueGradientFilter not bound -!missing-selector! +CIFilter::kaleidoscopeFilter not bound -!missing-selector! +CIFilter::keystoneCorrectionCombinedFilter not bound -!missing-selector! +CIFilter::keystoneCorrectionHorizontalFilter not bound -!missing-selector! +CIFilter::keystoneCorrectionVerticalFilter not bound -!missing-selector! +CIFilter::LabDeltaE not bound -!missing-selector! +CIFilter::lanczosScaleTransformFilter not bound -!missing-selector! +CIFilter::lenticularHaloGeneratorFilter not bound -!missing-selector! +CIFilter::lightenBlendModeFilter not bound -!missing-selector! +CIFilter::linearBurnBlendModeFilter not bound -!missing-selector! +CIFilter::linearDodgeBlendModeFilter not bound -!missing-selector! +CIFilter::linearGradientFilter not bound -!missing-selector! +CIFilter::linearToSRGBToneCurveFilter not bound -!missing-selector! +CIFilter::lineOverlayFilter not bound -!missing-selector! +CIFilter::lineScreenFilter not bound -!missing-selector! +CIFilter::luminosityBlendModeFilter not bound -!missing-selector! +CIFilter::maskedVariableBlurFilter not bound -!missing-selector! +CIFilter::maskToAlphaFilter not bound -!missing-selector! +CIFilter::maximumComponentFilter not bound -!missing-selector! +CIFilter::maximumCompositingFilter not bound -!missing-selector! +CIFilter::medianFilter not bound -!missing-selector! +CIFilter::meshGeneratorFilter not bound -!missing-selector! +CIFilter::minimumComponentFilter not bound -!missing-selector! +CIFilter::minimumCompositingFilter not bound -!missing-selector! +CIFilter::mixFilter not bound -!missing-selector! +CIFilter::modTransitionFilter not bound -!missing-selector! +CIFilter::morphologyGradientFilter not bound -!missing-selector! +CIFilter::morphologyMaximumFilter not bound -!missing-selector! +CIFilter::morphologyMinimumFilter not bound -!missing-selector! +CIFilter::morphologyRectangleMaximumFilter not bound -!missing-selector! +CIFilter::morphologyRectangleMinimumFilter not bound -!missing-selector! +CIFilter::motionBlurFilter not bound -!missing-selector! +CIFilter::multiplyBlendModeFilter not bound -!missing-selector! +CIFilter::multiplyCompositingFilter not bound -!missing-selector! +CIFilter::noiseReductionFilter not bound -!missing-selector! +CIFilter::opTileFilter not bound -!missing-selector! +CIFilter::overlayBlendModeFilter not bound -!missing-selector! +CIFilter::pageCurlTransitionFilter not bound -!missing-selector! +CIFilter::pageCurlWithShadowTransitionFilter not bound -!missing-selector! +CIFilter::paletteCentroidFilter not bound -!missing-selector! +CIFilter::palettizeFilter not bound -!missing-selector! +CIFilter::parallelogramTileFilter not bound -!missing-selector! +CIFilter::PDF417BarcodeGenerator not bound -!missing-selector! +CIFilter::perspectiveCorrectionFilter not bound -!missing-selector! +CIFilter::perspectiveRotateFilter not bound -!missing-selector! +CIFilter::perspectiveTileFilter not bound -!missing-selector! +CIFilter::perspectiveTransformFilter not bound -!missing-selector! +CIFilter::perspectiveTransformWithExtentFilter not bound -!missing-selector! +CIFilter::photoEffectChromeFilter not bound -!missing-selector! +CIFilter::photoEffectFadeFilter not bound -!missing-selector! +CIFilter::photoEffectInstantFilter not bound -!missing-selector! +CIFilter::photoEffectMonoFilter not bound -!missing-selector! +CIFilter::photoEffectNoirFilter not bound -!missing-selector! +CIFilter::photoEffectProcessFilter not bound -!missing-selector! +CIFilter::photoEffectTonalFilter not bound -!missing-selector! +CIFilter::photoEffectTransferFilter not bound -!missing-selector! +CIFilter::pinLightBlendModeFilter not bound -!missing-selector! +CIFilter::pixellateFilter not bound -!missing-selector! +CIFilter::pointillizeFilter not bound -!missing-selector! +CIFilter::QRCodeGenerator not bound -!missing-selector! +CIFilter::radialGradientFilter not bound -!missing-selector! +CIFilter::randomGeneratorFilter not bound -!missing-selector! +CIFilter::rippleTransitionFilter not bound -!missing-selector! +CIFilter::roundedRectangleGeneratorFilter not bound -!missing-selector! +CIFilter::saliencyMapFilter not bound -!missing-selector! +CIFilter::saturationBlendModeFilter not bound -!missing-selector! +CIFilter::screenBlendModeFilter not bound -!missing-selector! +CIFilter::sepiaToneFilter not bound -!missing-selector! +CIFilter::shadedMaterialFilter not bound -!missing-selector! +CIFilter::sharpenLuminanceFilter not bound -!missing-selector! +CIFilter::sixfoldReflectedTileFilter not bound -!missing-selector! +CIFilter::sixfoldRotatedTileFilter not bound -!missing-selector! +CIFilter::smoothLinearGradientFilter not bound -!missing-selector! +CIFilter::softLightBlendModeFilter not bound -!missing-selector! +CIFilter::sourceAtopCompositingFilter not bound -!missing-selector! +CIFilter::sourceInCompositingFilter not bound -!missing-selector! +CIFilter::sourceOutCompositingFilter not bound -!missing-selector! +CIFilter::sourceOverCompositingFilter not bound -!missing-selector! +CIFilter::spotColorFilter not bound -!missing-selector! +CIFilter::spotLightFilter not bound -!missing-selector! +CIFilter::sRGBToneCurveToLinearFilter not bound -!missing-selector! +CIFilter::starShineGeneratorFilter not bound -!missing-selector! +CIFilter::straightenFilter not bound -!missing-selector! +CIFilter::stripesGeneratorFilter not bound -!missing-selector! +CIFilter::subtractBlendModeFilter not bound -!missing-selector! +CIFilter::sunbeamsGeneratorFilter not bound -!missing-selector! +CIFilter::supportedRawCameraModels not bound -!missing-selector! +CIFilter::swipeTransitionFilter not bound -!missing-selector! +CIFilter::temperatureAndTintFilter not bound -!missing-selector! +CIFilter::textImageGeneratorFilter not bound -!missing-selector! +CIFilter::thermalFilter not bound -!missing-selector! +CIFilter::toneCurveFilter not bound -!missing-selector! +CIFilter::triangleKaleidoscopeFilter not bound -!missing-selector! +CIFilter::triangleTileFilter not bound -!missing-selector! +CIFilter::twelvefoldReflectedTileFilter not bound -!missing-selector! +CIFilter::unsharpMaskFilter not bound -!missing-selector! +CIFilter::vibranceFilter not bound -!missing-selector! +CIFilter::vignetteEffectFilter not bound -!missing-selector! +CIFilter::vignetteFilter not bound -!missing-selector! +CIFilter::whitePointAdjustFilter not bound -!missing-selector! +CIFilter::xRayFilter not bound -!missing-selector! +CIFilter::zoomBlurFilter not bound -!missing-selector! +CIImage::blackImage not bound -!missing-selector! +CIImage::blueImage not bound -!missing-selector! +CIImage::clearImage not bound -!missing-selector! +CIImage::cyanImage not bound -!missing-selector! +CIImage::grayImage not bound -!missing-selector! +CIImage::greenImage not bound -!missing-selector! +CIImage::imageWithCGImageSource:index:options: not bound -!missing-selector! +CIImage::imageWithSemanticSegmentationMatte: not bound -!missing-selector! +CIImage::imageWithSemanticSegmentationMatte:options: not bound -!missing-selector! +CIImage::magentaImage not bound -!missing-selector! +CIImage::redImage not bound -!missing-selector! +CIImage::whiteImage not bound -!missing-selector! +CIImage::yellowImage not bound -!missing-selector! CIBlendKernel::applyWithForeground:background:colorSpace: not bound -!missing-selector! CIContext::depthBlurEffectFilterForImage:disparityImage:portraitEffectsMatte:hairSemanticSegmentation:orientation:options: not bound -!missing-selector! CIImage::imageByApplyingTransform:highQualityDownsample: not bound -!missing-selector! CIImage::initWithCGImageSource:index:options: not bound -!missing-selector! CIImage::initWithSemanticSegmentationMatte: not bound -!missing-selector! CIImage::initWithSemanticSegmentationMatte:options: not bound -!missing-selector! CIImage::semanticSegmentationMatte not bound -!missing-selector! +CIContext::contextWithMTLCommandQueue: not bound -!missing-selector! +CIContext::contextWithMTLCommandQueue:options: not bound diff --git a/tools/common/StaticRegistrar.cs b/tools/common/StaticRegistrar.cs index e52cff0847..5d02eccaeb 100644 --- a/tools/common/StaticRegistrar.cs +++ b/tools/common/StaticRegistrar.cs @@ -2129,9 +2129,6 @@ namespace Registrar { header.WriteLine ("#import "); header.WriteLine ("#import "); return; - case "CoreImage": - h = ""; - break; case "PdfKit": case "ImageKit": case "QuartzComposer": @@ -2192,6 +2189,10 @@ namespace Registrar { case "IOSurface": // There is no IOSurface.h h = ""; break; + case "CoreImage": + header.WriteLine ("#import "); + header.WriteLine ("#import "); + return; default: h = string.Format ("<{0}/{0}.h>", ns); break; From 9bd50b7990d122e9767972052502c361667c50e0 Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Fri, 11 Oct 2019 14:04:18 -0400 Subject: [PATCH 011/100] [d16-4] Bump mono 2019-08@3eb5f34f MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New commits in mono/mono: * mono/mono@3eb5f34f541 [GTK] Bump bockbuild for GtkViewport autoscrolling patch. (#17321) * mono/mono@b601371d5f0 Update MERP event type to MonoAppCrash * mono/mono@6184ff007b2 [2019-08][ci] Use Xcode11.1 and 11.2beta2 for XI/XM Mono SDK builds (#17324) * mono/mono@8969f2cc99b [2019-08] [merp] Include any managed methods in the 'unmanaged_frames' portion … (#17316) * mono/mono@30094401081 [2019-08][merp] Don't install SIGTERM handler in EnableMicrosoftTelemetry (#17308) * mono/mono@df5e13f95df [tests] Bump corefx to get Azure testhost change (#17275) * mono/mono@11e1499c227 [2019-08] [merp] Print missing status marker file for stage 1 (setup) (#17220) * mono/mono@7dbad3c3618 [arm] Fix fetching of method addresses (#17253) * mono/mono@9a88a36789e [sgen] Fix invalid value passed to write barrier (#17247) * mono/mono@0f241c975ce [2019-08] Add drawing type converters to mobile profiles (#17240) * mono/mono@7ebe1a1763c Update Roslyn to 3.4.0-beta2-19477-01 * mono/mono@b759449ba8d Bump msbuild to track mono-2019-08 * mono/mono@617f399efca [IO] Remove read-only logic in mono_w32_get_disk_free_space (#17211) * mono/mono@77258ea1122 [2019-08] [debugger][exception] Debugger breaks on handled exceptions (#17202) * mono/mono@f83c321f88f Bump msbuild to track mono-2019-08 (#17193) * mono/mono@1ecd094b44c [2019-08] [Mono.Debugger.Soft] Fix VirtualMachine detaching (#17077) * mono/mono@54a33be9dee [merp] Put thread into async context before running summarizer (#17197) * mono/mono@72128bb00d3 Bump libgdiplus to 6.0.4 * mono/mono@65a972c0333 Always do copy_stack_data on entering GC safe/unsafe mode. (#17184) * mono/mono@9e6def1553b [merp] exit_status is 0 if we ran the uploader successfully (#17187) * mono/mono@8a707cc0124 [2019-08] [reflection] Only duplicate MonoMarshalSpec strings for custom types (#17189) * mono/mono@bd72952cf82 [2019-08] [merp] Don't overrun buffer in copy_summary_string_safe … (#17178) * mono/mono@b6efc0cc906 Bump msbuild to track xplat-master (#17132) * mono/mono@2869cd5f67e Bump ikvm to get https://github.com/mono/ikvm-fork/pull/13 (#17170) * mono/mono@a64a25695d6 [2019-08] [merp] Use macOS version not Darwin version in MERP reports (#17147) * mono/mono@57f068438d4 [2019-08] [merp] Add API method that whitelists all native libraries (#17128) Diff: https://github.com/mono/mono/compare/528103728fc2aedb7b6062e11255d39a0ed3f31c..3eb5f34f5412edfcb6932050b6c5c66fe1db2830 --- mk/mono.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/mono.mk b/mk/mono.mk index 8a90e82594..a4919fdb52 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,4 +1,4 @@ -NEEDED_MONO_VERSION := 528103728fc2aedb7b6062e11255d39a0ed3f31c +NEEDED_MONO_VERSION := 3eb5f34f5412edfcb6932050b6c5c66fe1db2830 NEEDED_MONO_BRANCH := 2019-08 MONO_DIRECTORY := mono From 307dc86f6ffe1205a0ca3bdd96001f827a2ec7da Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Wed, 16 Oct 2019 19:02:27 -0400 Subject: [PATCH 012/100] [tests] Ignore mscorlib test that runs out of memory See mono issue: https://github.com/mono/mono/issues/17375 ``` [PASS] System.Reflection.Tests.RuntimeReflectionExtensionsTests.GetMethodInfo Test name: System.Reflection.Tests.RuntimeReflectionExtensionsTests.GetRuntimeMethod Exception messages: System.OutOfMemoryException : Out of memory Handler for event TestFailedEvent failed with exception System.Reflection.Tests.RuntimeReflectionExtensionsTests 0 ms ``` --- .../common-monotouch_corlib_xunit-test.dll.ignore | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/bcl-test/common-monotouch_corlib_xunit-test.dll.ignore b/tests/bcl-test/common-monotouch_corlib_xunit-test.dll.ignore index b9ef3636ed..819559b22c 100644 --- a/tests/bcl-test/common-monotouch_corlib_xunit-test.dll.ignore +++ b/tests/bcl-test/common-monotouch_corlib_xunit-test.dll.ignore @@ -414,4 +414,10 @@ System.SpanTests.ReadOnlySpanTests.BinarySearch_Double System.Reflection.Tests.MethodBaseTests.Test_GetCurrentMethod_Inlineable # device issues, it was reported here: https://github.com/mono/mono/issues/14761 -System.Text.Tests.StringBuilderTests.Append_CharPointer_Null_ThrowsNullReferenceException \ No newline at end of file +System.Text.Tests.StringBuilderTests.Append_CharPointer_Null_ThrowsNullReferenceException + +# device failures, reported at: https://github.com/mono/mono/issues/17375 +Platform32:System.Reflection.Tests.RuntimeReflectionExtensionsTests.GetRuntimeMethod +Platform32:System.Reflection.Tests.RuntimeReflectionExtensionsTests.GetRuntimeField +Platform32:System.Reflection.Tests.RuntimeReflectionExtensionsTests.GetRuntimeEvent +Platform32:System.Reflection.Tests.RuntimeReflectionExtensionsTests.GetRuntimeProperty \ No newline at end of file From 9f385f77942ed789c20fab884e327ba264191e21 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Thu, 17 Oct 2019 17:04:42 +0200 Subject: [PATCH 013/100] [Networking] Add a generic method to get the metadata from the context. (#7244) * [Networking] Add a generic method to get the metadata from the context. There are different types of NWProtocolMetadata, being one of them (to be added later) the NWFramerMessage that exposes extra methods. With the current API we can only do: ``` var metadata = context.GetProtocolMetadata (protocol.ProtocolDefinition); ``` Which just returns the generic object, and if the protocol definition is from a NWFramer, we want to be able to get the correct metadata object. With the provided method you can do: ``` var metadata = context.GetProtocolMetadata (protocol.ProtocolDefinition); ``` Which allows the user to specify the expected metadata type from a given protocol definition. --- src/Network/NWContentContext.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Network/NWContentContext.cs b/src/Network/NWContentContext.cs index 17893e044b..a16682f73f 100644 --- a/src/Network/NWContentContext.cs +++ b/src/Network/NWContentContext.cs @@ -126,6 +126,14 @@ namespace Network { return new NWProtocolMetadata (x, owns: true); } + public T GetProtocolMetadata (NWProtocolDefinition protocolDefinition) where T : NWProtocolMetadata + { + if (protocolDefinition == null) + throw new ArgumentNullException (nameof (protocolDefinition)); + var x = nw_content_context_copy_protocol_metadata (GetCheckedHandle (), protocolDefinition.Handle); + return Runtime.GetINativeObject (x, owns: true); + } + [DllImport (Constants.NetworkLibrary)] extern static void nw_content_context_set_metadata_for_protocol (IntPtr handle, IntPtr protocolMetadata); From 39c56d853b0a41a1ea9a998a3c76e9d2d649379f Mon Sep 17 00:00:00 2001 From: monojenkins Date: Thu, 17 Oct 2019 17:25:37 +0200 Subject: [PATCH 014/100] Bump system mono to get fix for mono/mono#17151. (#7246) mono/mono#17151 prevents xharness from running tests on Catalina, because xharness thinks the root drive has no more space. --- Make.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Make.config b/Make.config index cb3a38cf27..b54732c463 100644 --- a/Make.config +++ b/Make.config @@ -69,9 +69,9 @@ include $(TOP)/mk/mono.mk MONO_HASH := $(NEEDED_MONO_VERSION) # Minimum Mono version for building XI/XM -MIN_MONO_VERSION=6.6.0.48 +MIN_MONO_VERSION=6.6.0.117 MAX_MONO_VERSION=6.6.99 -MIN_MONO_URL=https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/2019-08/51/23cc371009da14640980f98ad7b8b83818568f73/MonoFramework-MDK-6.6.0.48.macos10.xamarin.universal.pkg +MIN_MONO_URL=https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/2019-08/117/617f399efca133f357cb8207bc7f58b1120f12f1/MonoFramework-MDK-6.6.0.117.macos10.xamarin.universal.pkg # Minimum Mono version for Xamarin.Mac apps using the system mono MIN_XM_MONO_VERSION=6.4.0.94 From 316abefa715b8c6a6c519620dee2ba284783f4cd Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 17 Oct 2019 17:41:52 +0200 Subject: [PATCH 015/100] Bump system mono to get fix for mono/mono#17151. (#7220) (#7247) mono/mono#17151 prevents xharness from running tests on Catalina, because xharness thinks the root drive has no more space. --- Make.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Make.config b/Make.config index ab773049ec..e2965cc30e 100644 --- a/Make.config +++ b/Make.config @@ -68,9 +68,9 @@ include $(TOP)/mk/mono.mk MONO_HASH := $(NEEDED_MONO_VERSION) # Minimum Mono version for building XI/XM -MIN_MONO_VERSION=6.4.0.197 +MIN_MONO_VERSION=6.4.0.214 MAX_MONO_VERSION=6.4.99 -MIN_MONO_URL=https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/2019-06/179/7293597b905514a4c84cf36fe41e91625d657366/MonoFramework-MDK-6.4.0.197.macos10.xamarin.universal.pkg +MIN_MONO_URL=https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/2019-06/197/476d72b9e32ea58a7a8bda53af8cc8f5b7ffe6bb/MonoFramework-MDK-6.4.0.214.macos10.xamarin.universal.pkg # Minimum Mono version for Xamarin.Mac apps using the system mono MIN_XM_MONO_VERSION=6.4.0.94 From ab60a11f14be170734810aa62ea1e6b65d5172e9 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 17 Oct 2019 17:44:37 +0200 Subject: [PATCH 016/100] [mmp] Add deployment target to the -fobjc-runtime clang argument. Fixes #7204. (#7227) (#7231) This is required when also passing the -fobjc-arc argument. Fixes https://github.com/xamarin/xamarin-macios/issues/7204. This is a backport of #7227. --- tests/mmptest/src/MMPTest.cs | 13 +++++++++++++ tools/mmp/driver.cs | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/mmptest/src/MMPTest.cs b/tests/mmptest/src/MMPTest.cs index 537c1afef4..7ee30c153f 100644 --- a/tests/mmptest/src/MMPTest.cs +++ b/tests/mmptest/src/MMPTest.cs @@ -737,5 +737,18 @@ namespace Xamarin.MMP.Tests // TODO: Add something to validate the archive is loadable by Xcode } + + [Test] + public void BuildWithObjcArcFlag () + { + RunMMPTest (tmpDir => { + TI.UnifiedTestConfig test = new TI.UnifiedTestConfig (tmpDir) { + CSProjConfig = "-link_flags=-fobjc-arc" + }; + TI.TestUnifiedExecutable (test); + var output = TI.BuildProject (Path.Combine (tmpDir, "UnifiedExample.csproj")); + }); + + } } } diff --git a/tools/mmp/driver.cs b/tools/mmp/driver.cs index fb0661e129..3a1023128e 100644 --- a/tools/mmp/driver.cs +++ b/tools/mmp/driver.cs @@ -1179,7 +1179,7 @@ namespace Xamarin.Bundler { args.Append ("-mmacosx-version-min=").Append (App.DeploymentTarget.ToString ()).Append (' '); args.Append ("-arch ").Append (arch).Append (' '); if (arch == "x86_64") - args.Append ("-fobjc-runtime=macosx "); + args.Append ($"-fobjc-runtime=macosx-{App.DeploymentTarget.ToString ()} "); if (!embed_mono) args.Append ("-DDYNAMIC_MONO_RUNTIME "); From ca7eab8f1cb04333ab4d4349b9efd5c2d127ed51 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 17 Oct 2019 17:46:02 +0200 Subject: [PATCH 017/100] [Metal] Fix a few issues with the latest Metal API additions. Fixes #7116. (#7213) We weren't using protocol types when we should, and we were using [BaseType] when we shouldn't. --- src/Metal/MTLCompat.cs | 44 +++++++++++++++++++++++++++++++++++++++++- src/metal.cs | 21 ++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/src/Metal/MTLCompat.cs b/src/Metal/MTLCompat.cs index 5295b58341..559956386c 100644 --- a/src/Metal/MTLCompat.cs +++ b/src/Metal/MTLCompat.cs @@ -1,4 +1,7 @@ +#if !XAMCORE_4_0 using System; + +using Foundation; using ObjCRuntime; namespace Metal { @@ -9,4 +12,43 @@ namespace Metal { public MTLSharedTextureHandle () {} } -} \ No newline at end of file +#if MONOMAC + public static partial class MTLDevice_Extensions { + [BindingImpl (BindingImplOptions.Optimizable)] + public static IMTLCounterSet[] GetIMTLCounterSets (this IMTLDevice This) + { + return NSArray.ArrayFromHandle(global::ObjCRuntime.Messaging.IntPtr_objc_msgSend (This.Handle, Selector.GetHandle ("counterSets"))); + } + + [Unavailable (PlatformName.iOS, PlatformArchitecture.All)] + [Unavailable (PlatformName.TvOS, PlatformArchitecture.All)] + [Introduced (PlatformName.MacOSX, 10,15, PlatformArchitecture.All)] + [BindingImpl (BindingImplOptions.Optimizable)] + public static IMTLCounterSampleBuffer CreateIMTLCounterSampleBuffer (this IMTLDevice This, MTLCounterSampleBufferDescriptor descriptor, out NSError error) + { + if (descriptor == null) + throw new ArgumentNullException ("descriptor"); + IntPtr errorValue = IntPtr.Zero; + + var ret = Runtime.GetINativeObject (global::ObjCRuntime.Messaging.IntPtr_objc_msgSend_IntPtr_ref_IntPtr (This.Handle, Selector.GetHandle ("newCounterSampleBufferWithDescriptor:error:"), descriptor.Handle, ref errorValue), owns: false); + error = Runtime.GetNSObject (errorValue); + + return ret; + } + } + + public static partial class MTLComputeCommandEncoder_Extensions { + [Unavailable (PlatformName.iOS, PlatformArchitecture.All)] + [Unavailable (PlatformName.TvOS, PlatformArchitecture.All)] + [Introduced (PlatformName.MacOSX, 10,15, PlatformArchitecture.All)] + [BindingImpl (BindingImplOptions.Optimizable)] + public static void SampleCounters (this IMTLComputeCommandEncoder This, IMTLCounterSampleBuffer sampleBuffer, nuint sampleIndex, bool barrier) + { + if (sampleBuffer == null) + throw new ArgumentNullException ("sampleBuffer"); + global::ObjCRuntime.Messaging.void_objc_msgSend_IntPtr_nuint_bool (This.Handle, Selector.GetHandle ("sampleCountersInBuffer:atSampleIndex:withBarrier:"), sampleBuffer.Handle, sampleIndex, barrier); + } + } +#endif // MONOMAC +} +#endif // !XAMCORE_4_0 diff --git a/src/metal.cs b/src/metal.cs index 30dc375548..1b65db798a 100644 --- a/src/metal.cs +++ b/src/metal.cs @@ -597,7 +597,12 @@ namespace Metal { #endif [NoiOS, NoTV, Mac (10,15)] [Export ("sampleCountersInBuffer:atSampleIndex:withBarrier:")] +#if XAMCORE_4_0 + void SampleCounters (IMTLCounterSampleBuffer sampleBuffer, nuint sampleIndex, bool barrier); +#else + [Obsolete ("Use the overload that takes an IMTLCounterSampleBuffer instead.")] void SampleCounters (MTLCounterSampleBuffer sampleBuffer, nuint sampleIndex, bool barrier); +#endif } [iOS (8,0)][Mac (10,11)] @@ -1363,7 +1368,12 @@ namespace Metal { #endif [NoiOS, NoTV, Mac (10, 15)] [NullAllowed, Export ("counterSets")] +#if XAMCORE_4_0 + IMTLCounterSet[] CounterSets { get; } +#else + [Obsolete ("Use 'GetIMTLCounterSets' instead.")] MTLCounterSet[] CounterSets { get; } +#endif #if XAMCORE_4_0 [Abstract] @@ -1371,7 +1381,12 @@ namespace Metal { [NoiOS, NoTV, Mac (10,15)] [Export ("newCounterSampleBufferWithDescriptor:error:")] [return: NullAllowed] +#if XAMCORE_4_0 + IMTLCounterSampleBuffer CreateCounterSampleBuffer (MTLCounterSampleBufferDescriptor descriptor, [NullAllowed] out NSError error); +#else + [Obsolete ("Use 'CreateIMTLCounterSampleBuffer' instead.")] MTLCounterSampleBuffer CreateCounterSampleBuffer (MTLCounterSampleBufferDescriptor descriptor, [NullAllowed] out NSError error); +#endif #if XAMCORE_4_0 [Abstract] @@ -4148,7 +4163,9 @@ namespace Metal { [NoiOS, NoTV, Mac (10,15)] [Protocol] +#if !XAMCORE_4_0 [BaseType (typeof(NSObject))] +#endif interface MTLCounter { [Abstract] [Export ("name")] @@ -4159,7 +4176,9 @@ namespace Metal { [NoiOS, NoTV, Mac (10,15)] [Protocol] +#if !XAMCORE_4_0 [BaseType (typeof(NSObject))] +#endif interface MTLCounterSet { [Abstract] [Export ("name")] @@ -4174,7 +4193,9 @@ namespace Metal { [NoiOS, NoTV, Mac (10,15)] [Protocol] +#if !XAMCORE_4_0 [BaseType (typeof(NSObject))] +#endif interface MTLCounterSampleBuffer { [Abstract] [Export ("device")] From a50ec24e4a7efd425cb5917c11244ca6446550e9 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Fri, 18 Oct 2019 04:04:41 +0200 Subject: [PATCH 018/100] [Network] Clean up the protocol options class. (#7196) Add classes for each of the protocol types. Deprecated the old methods. --- src/Network/NWParameters.cs | 22 +++- src/Network/NWProtocolDefinition.cs | 6 - src/Network/NWProtocolIPOptions.cs | 58 +++++++++ src/Network/NWProtocolOptions.cs | 100 ++++++++++------ src/Network/NWProtocolStack.cs | 48 +++++++- src/Network/NWProtocolTcpOptions.cs | 65 ++++++++++ src/Network/NWProtocolTlsOptions.cs | 29 +++++ src/Network/NWProtocolUdpOptions.cs | 25 ++++ src/frameworks.sources | 4 + tests/introspection/ApiCMAttachmentTest.cs | 1 + .../Network/NWProtocolIPOptionsTest.cs | 111 ++++++++++++++++++ .../Network/NWProtocolTcpOptionsTest.cs | 85 ++++++++++++++ .../Network/NWProtocolTlsOptionsTest.cs | 40 +++++++ .../Network/NWProtocolUdpOptionsTest.cs | 45 +++++++ 14 files changed, 587 insertions(+), 52 deletions(-) create mode 100644 src/Network/NWProtocolIPOptions.cs create mode 100644 src/Network/NWProtocolTcpOptions.cs create mode 100644 src/Network/NWProtocolTlsOptions.cs create mode 100644 src/Network/NWProtocolUdpOptions.cs create mode 100644 tests/monotouch-test/Network/NWProtocolIPOptionsTest.cs create mode 100644 tests/monotouch-test/Network/NWProtocolTcpOptionsTest.cs create mode 100644 tests/monotouch-test/Network/NWProtocolTlsOptionsTest.cs create mode 100644 tests/monotouch-test/Network/NWProtocolUdpOptionsTest.cs diff --git a/src/Network/NWParameters.cs b/src/Network/NWParameters.cs index faf16e41ff..675647032e 100644 --- a/src/Network/NWParameters.cs +++ b/src/Network/NWParameters.cs @@ -42,9 +42,25 @@ namespace Network { { var del = BlockLiteral.GetTarget> (block); if (del != null) { - var x = new NWProtocolOptions (iface, owns: false); - del (x); - x.Dispose (); + using (var tempOptions = new NWProtocolOptions (iface, owns: false)) + using (var definition = tempOptions.ProtocolDefinition) { + NWProtocolOptions castedOptions = null; + + if (definition.Equals (NWProtocolDefinition.TcpDefinition)) { + castedOptions = new NWProtocolTcpOptions (iface, owns: false); + } else if (definition.Equals (NWProtocolDefinition.UdpDefinition)) { + castedOptions = new NWProtocolUdpOptions (iface, owns: false); + } else if (definition.Equals (NWProtocolDefinition.TlsDefinition)) { + castedOptions = new NWProtocolTlsOptions (iface, owns: false); + } else if (definition.Equals (NWProtocolDefinition.IPDefinition)) { + castedOptions = new NWProtocolIPOptions (iface, owns: false); + } else if (definition.Equals (NWProtocolDefinition.WebSocketDefinition)) { + castedOptions = new NWWebSocketOptions (iface, owns: false); + } + + del (castedOptions ?? tempOptions); + castedOptions?.Dispose (); + } } } diff --git a/src/Network/NWProtocolDefinition.cs b/src/Network/NWProtocolDefinition.cs index 5863415d1f..b71ed77e53 100644 --- a/src/Network/NWProtocolDefinition.cs +++ b/src/Network/NWProtocolDefinition.cs @@ -17,12 +17,6 @@ using OS_nw_protocol_definition=System.IntPtr; namespace Network { - public enum NWIPVersion { - Any = 0, - Version4 = 1, - Version6 = 2, - } - [TV (12,0), Mac (10,14), iOS (12,0)] [Watch (6,0)] public class NWProtocolDefinition : NativeObject { diff --git a/src/Network/NWProtocolIPOptions.cs b/src/Network/NWProtocolIPOptions.cs new file mode 100644 index 0000000000..18b26ed7ef --- /dev/null +++ b/src/Network/NWProtocolIPOptions.cs @@ -0,0 +1,58 @@ +// +// NWProtocolTls: Bindings the Netowrk nw_protocol_options API focus on TLS options. +// +// Authors: +// Manuel de la Pena +// +// Copyrigh 2019 Microsoft Inc +// +using System; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using ObjCRuntime; +using Foundation; +using CoreFoundation; +using Security; +using OS_nw_protocol_definition=System.IntPtr; +using IntPtr=System.IntPtr; + +namespace Network { + + [Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] + public enum NWIPLocalAddressPreference { + Default = 0, + Temporary = 1, + Stable = 2, + } + + [Watch (6,0), TV (12,0), Mac (10,14), iOS (12,0)] + public enum NWIPVersion { + Any = 0, + Version4 = 1, + Version6 = 2, + } + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public class NWProtocolIPOptions : NWProtocolOptions { + internal NWProtocolIPOptions (IntPtr handle, bool owns) : base (handle, owns) {} + + public void SetVersion (NWIPVersion version) + => nw_ip_options_set_version (GetCheckedHandle (), version); + + public void SetHopLimit (nuint hopLimit) + => nw_ip_options_set_hop_limit (GetCheckedHandle (), (byte) hopLimit); + + public void SetUseMinimumMtu (bool useMinimumMtu) + => nw_ip_options_set_use_minimum_mtu (GetCheckedHandle (), useMinimumMtu); + + public void SetDisableFragmentation (bool disableFragmentation) + => nw_ip_options_set_disable_fragmentation (GetCheckedHandle (), disableFragmentation); + + public void SetCalculateReceiveTime (bool shouldCalculateReceiveTime) + => nw_ip_options_set_calculate_receive_time (GetCheckedHandle (), shouldCalculateReceiveTime); + + [TV (13,0), Mac (10,15), iOS (13,0)] + public void SetIPLocalAddressPreference (NWIPLocalAddressPreference localAddressPreference) + => nw_ip_options_set_local_address_preference (GetCheckedHandle (), localAddressPreference); + } +} \ No newline at end of file diff --git a/src/Network/NWProtocolOptions.cs b/src/Network/NWProtocolOptions.cs index 6209c35ac2..daf8529d0b 100644 --- a/src/Network/NWProtocolOptions.cs +++ b/src/Network/NWProtocolOptions.cs @@ -18,85 +18,86 @@ using IntPtr=System.IntPtr; namespace Network { - [Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] - public enum NWIPLocalAddressPreference { - Default = 0, - Temporary = 1, - Stable = 2, - } - [TV (12,0), Mac (10,14), iOS (12,0)] [Watch (6,0)] public class NWProtocolOptions : NativeObject { public NWProtocolOptions (IntPtr handle, bool owns) : base (handle, owns) {} [DllImport (Constants.NetworkLibrary)] - static extern OS_nw_protocol_definition nw_protocol_options_copy_definition (IntPtr options); + internal static extern OS_nw_protocol_definition nw_protocol_options_copy_definition (IntPtr options); public NWProtocolDefinition ProtocolDefinition => new NWProtocolDefinition (nw_protocol_options_copy_definition (GetCheckedHandle ()), owns: true); [DllImport (Constants.NetworkLibrary)] - static extern IntPtr nw_tls_create_options (); + internal static extern IntPtr nw_tls_create_options (); + [Obsolete ("Use the 'NWProtocolTlsOptions' class methods and constructors instead.")] public static NWProtocolOptions CreateTls () { - return new NWProtocolOptions (nw_tls_create_options (), owns: true); + return new NWProtocolTlsOptions (nw_tls_create_options (), owns: true); } [DllImport (Constants.NetworkLibrary)] - static extern IntPtr nw_tcp_create_options (); + internal static extern IntPtr nw_tcp_create_options (); + [Obsolete ("Use the 'NWProtocolTcpOptions' class methods and constructors instead.")] public static NWProtocolOptions CreateTcp () { - return new NWProtocolOptions (nw_tcp_create_options (), owns: true); + return new NWProtocolTcpOptions (nw_tcp_create_options (), owns: true); } [DllImport (Constants.NetworkLibrary)] - static extern IntPtr nw_udp_create_options (); + internal static extern IntPtr nw_udp_create_options (); + [Obsolete ("Use the 'NWProtocolUdpOptions' class methods and constructors instead.")] public static NWProtocolOptions CreateUdp () { - return new NWProtocolOptions (nw_udp_create_options (), owns: true); + return new NWProtocolUdpOptions (nw_udp_create_options (), owns: true); } // // IP Options // [DllImport (Constants.NetworkLibrary)] - static extern void nw_ip_options_set_version (IntPtr options, NWIPVersion version); + internal static extern void nw_ip_options_set_version (IntPtr options, NWIPVersion version); + [Obsolete ("Use the 'NWProtocolIPOptions' class instead.")] public void IPSetVersion (NWIPVersion version) { nw_ip_options_set_version (GetCheckedHandle (), version); } [DllImport (Constants.NetworkLibrary)] - static extern void nw_ip_options_set_hop_limit (IntPtr options, byte hop_limit); + internal static extern void nw_ip_options_set_hop_limit (IntPtr options, byte hop_limit); + [Obsolete ("Use the 'NWProtocolIPOptions' class instead.")] public void IPSetHopLimit (byte hopLimit) { nw_ip_options_set_hop_limit (GetCheckedHandle (), hopLimit); } [DllImport (Constants.NetworkLibrary)] - static extern void nw_ip_options_set_use_minimum_mtu (IntPtr options, [MarshalAs (UnmanagedType.I1)] bool use_minimum_mtu); + internal static extern void nw_ip_options_set_use_minimum_mtu (IntPtr options, [MarshalAs (UnmanagedType.I1)] bool use_minimum_mtu); + [Obsolete ("Use the 'NWProtocolIPOptions' class instead.")] public void IPSetUseMinimumMtu (bool useMinimumMtu) { nw_ip_options_set_use_minimum_mtu (GetCheckedHandle (), useMinimumMtu); } [DllImport (Constants.NetworkLibrary)] - static extern void nw_ip_options_set_disable_fragmentation (IntPtr options, [MarshalAs (UnmanagedType.I1)] bool disable_fragmentation); + internal static extern void nw_ip_options_set_disable_fragmentation (IntPtr options, [MarshalAs (UnmanagedType.I1)] bool disable_fragmentation); + [Obsolete ("Use the 'NWProtocolIPOptions' class instead.")] public void IPSetDisableFragmentation (bool disableFragmentation) { nw_ip_options_set_disable_fragmentation (GetCheckedHandle (), disableFragmentation); } [DllImport (Constants.NetworkLibrary)] - static extern void nw_ip_options_set_calculate_receive_time (IntPtr options, bool calculateReceiveTime); + internal static extern void nw_ip_options_set_calculate_receive_time (IntPtr options, bool calculateReceiveTime); + [Obsolete ("Use the 'NWProtocolIPOptions' class instead.")] public void IPSetCalculateReceiveTime (bool calculateReceiveTime) { nw_ip_options_set_calculate_receive_time (GetCheckedHandle (), calculateReceiveTime); @@ -105,8 +106,9 @@ namespace Network { [Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] [DllImport (Constants.NetworkLibrary)] - static extern void nw_ip_options_set_local_address_preference (IntPtr options, NWIPLocalAddressPreference preference); + internal static extern void nw_ip_options_set_local_address_preference (IntPtr options, NWIPLocalAddressPreference preference); + [Obsolete ("Use the 'NWProtocolIPOptions' class instead.")] [Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] public NWIPLocalAddressPreference IPLocalAddressPreference { set => nw_ip_options_set_local_address_preference (GetCheckedHandle (), value); @@ -114,83 +116,104 @@ namespace Network { // // TCP Options // - [DllImport (Constants.NetworkLibrary)] - extern static void nw_tcp_options_set_no_delay (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool noDelay); + [DllImport (Constants.NetworkLibrary)] + internal extern static void nw_tcp_options_set_no_delay (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool noDelay); + + [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] public void TcpSetNoDelay (bool noDelay) => nw_tcp_options_set_no_delay (GetCheckedHandle (), noDelay); [DllImport (Constants.NetworkLibrary)] - extern static void nw_tcp_options_set_no_push (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool noPush); + internal extern static void nw_tcp_options_set_no_push (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool noPush); + [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] public void TcpSetNoPush (bool noPush) => nw_tcp_options_set_no_push (GetCheckedHandle (), noPush); [DllImport (Constants.NetworkLibrary)] - extern static void nw_tcp_options_set_no_options (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool noOptions); + internal extern static void nw_tcp_options_set_no_options (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool noOptions); + [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] public void TcpSetNoOptions (bool noOptions) => nw_tcp_options_set_no_options (GetCheckedHandle (), noOptions); [DllImport (Constants.NetworkLibrary)] - extern static void nw_tcp_options_set_enable_keepalive (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool enableKeepAlive); + internal extern static void nw_tcp_options_set_enable_keepalive (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool enableKeepAlive); + [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] public void TcpSetEnableKeepAlive (bool enableKeepAlive) => nw_tcp_options_set_enable_keepalive (GetCheckedHandle (), enableKeepAlive); [DllImport (Constants.NetworkLibrary)] - extern static void nw_tcp_options_set_keepalive_count (IntPtr handle, uint keepaliveCount); + internal extern static void nw_tcp_options_set_keepalive_count (IntPtr handle, uint keepaliveCount); + [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] public void TcpSetKeepAliveCount (uint keepaliveCount) => nw_tcp_options_set_keepalive_count (GetCheckedHandle (), keepaliveCount); [DllImport (Constants.NetworkLibrary)] - extern static void nw_tcp_options_set_keepalive_idle_time (IntPtr handle, uint keepaliveIdleTime); + internal extern static void nw_tcp_options_set_keepalive_idle_time (IntPtr handle, uint keepaliveIdleTime); + [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] public void TcpSetKeepAliveIdleTime (uint keepaliveIdleTime) => nw_tcp_options_set_keepalive_idle_time (GetCheckedHandle (), keepaliveIdleTime); [DllImport (Constants.NetworkLibrary)] - extern static void nw_tcp_options_set_keepalive_interval (IntPtr handle, uint keepaliveInterval); + internal extern static void nw_tcp_options_set_keepalive_interval (IntPtr handle, uint keepaliveInterval); + [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] public void TcpSetKeepAliveInterval (uint keepaliveInterval) => nw_tcp_options_set_keepalive_interval (GetCheckedHandle (), keepaliveInterval); [DllImport (Constants.NetworkLibrary)] - extern static void nw_tcp_options_set_maximum_segment_size (IntPtr handle, uint maximumSegmentSize); + internal extern static void nw_tcp_options_set_maximum_segment_size (IntPtr handle, uint maximumSegmentSize); + + [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] public void TcpSetMaximumSegmentSize (uint maximumSegmentSize) => nw_tcp_options_set_maximum_segment_size (GetCheckedHandle (), maximumSegmentSize); [DllImport (Constants.NetworkLibrary)] - extern static void nw_tcp_options_set_connection_timeout (IntPtr handle, uint connectionTimeout); + internal extern static void nw_tcp_options_set_connection_timeout (IntPtr handle, uint connectionTimeout); + [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] public void TcpSetConnectionTimeout (uint connectionTimeout) => nw_tcp_options_set_connection_timeout (GetCheckedHandle (), connectionTimeout); [DllImport (Constants.NetworkLibrary)] - extern static void nw_tcp_options_set_persist_timeout (IntPtr handle, uint persistTimeout); + internal extern static void nw_tcp_options_set_persist_timeout (IntPtr handle, uint persistTimeout); + [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] public void TcpSetPersistTimeout (uint persistTimeout) => nw_tcp_options_set_persist_timeout (GetCheckedHandle (), persistTimeout); [DllImport (Constants.NetworkLibrary)] - extern static void nw_tcp_options_set_retransmit_connection_drop_time (IntPtr handle, uint retransmitConnectionDropTime); + internal extern static void nw_tcp_options_set_retransmit_connection_drop_time (IntPtr handle, uint retransmitConnectionDropTime); + [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] public void TcpSetRetransmitConnectionDropTime (uint retransmitConnectionDropTime) => nw_tcp_options_set_retransmit_connection_drop_time (GetCheckedHandle (), retransmitConnectionDropTime); [DllImport (Constants.NetworkLibrary)] - extern static void nw_tcp_options_set_retransmit_fin_drop (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool retransmitFinDrop); + internal extern static void nw_tcp_options_set_retransmit_fin_drop (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool retransmitFinDrop); + [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] public void TcpSetRetransmitFinDrop (bool retransmitFinDrop) => nw_tcp_options_set_retransmit_fin_drop (GetCheckedHandle (), retransmitFinDrop); [DllImport (Constants.NetworkLibrary)] - extern static void nw_tcp_options_set_disable_ack_stretching (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool disableAckStretching); + internal extern static void nw_tcp_options_set_disable_ack_stretching (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool disableAckStretching); + + [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] public void TcpSetDisableAckStretching (bool disableAckStretching) => nw_tcp_options_set_disable_ack_stretching (GetCheckedHandle (), disableAckStretching); [DllImport (Constants.NetworkLibrary)] - extern static void nw_tcp_options_set_enable_fast_open (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool enableFastOpen); + internal extern static void nw_tcp_options_set_enable_fast_open (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool enableFastOpen); + + [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] public void TcpSetEnableFastOpen (bool enableFastOpen) => nw_tcp_options_set_enable_fast_open (GetCheckedHandle (), enableFastOpen); [DllImport (Constants.NetworkLibrary)] - extern static void nw_tcp_options_set_disable_ecn (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool disableEcn); + internal extern static void nw_tcp_options_set_disable_ecn (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool disableEcn); + + [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] public void TcpSetDisableEcn (bool disableEcn) => nw_tcp_options_set_disable_ecn (GetCheckedHandle (), disableEcn); // // UDP Options // [DllImport (Constants.NetworkLibrary)] - extern static void nw_udp_options_set_prefer_no_checksum (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool preferNoChecksums); + internal extern static void nw_udp_options_set_prefer_no_checksum (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool preferNoChecksums); + [Obsolete ("Use the 'NWProtocolUdpOptions' class instead.")] public void UdpSetPreferNoChecksum (bool preferNoChecksums) => nw_udp_options_set_prefer_no_checksum (GetCheckedHandle (), preferNoChecksums); // @@ -198,8 +221,9 @@ namespace Network { // [DllImport (Constants.NetworkLibrary)] - extern static IntPtr nw_tls_copy_sec_protocol_options (IntPtr options); + internal extern static IntPtr nw_tls_copy_sec_protocol_options (IntPtr options); + [Obsolete ("Use the 'NWProtocolTlsOptions' class instead.")] public SecProtocolOptions TlsProtocolOptions => new SecProtocolOptions (nw_tls_copy_sec_protocol_options (GetCheckedHandle ()), owns: true); } } diff --git a/src/Network/NWProtocolStack.cs b/src/Network/NWProtocolStack.cs index 8dcbef5651..76305c9944 100644 --- a/src/Network/NWProtocolStack.cs +++ b/src/Network/NWProtocolStack.cs @@ -51,9 +51,25 @@ namespace Network { { var del = BlockLiteral.GetTarget> (block); if (del != null) { - var x = new NWProtocolOptions (options, owns: false); - del (x); - x.Dispose (); + using (var tempOptions = new NWProtocolOptions (options, owns: false)) + using (var definition = tempOptions.ProtocolDefinition) { + NWProtocolOptions castedOptions = null; + + if (definition.Equals (NWProtocolDefinition.TcpDefinition)) { + castedOptions = new NWProtocolTcpOptions (options, owns: false); + } else if (definition.Equals (NWProtocolDefinition.UdpDefinition)) { + castedOptions = new NWProtocolUdpOptions (options, owns: false); + } else if (definition.Equals (NWProtocolDefinition.TlsDefinition)) { + castedOptions = new NWProtocolTlsOptions (options, owns: false); + } else if (definition.Equals (NWProtocolDefinition.IPDefinition)) { + castedOptions = new NWProtocolIPOptions (options, owns: false); + } else if (definition.Equals (NWProtocolDefinition.WebSocketDefinition)) { + castedOptions = new NWWebSocketOptions (options, owns: false); + } + + del (castedOptions ?? tempOptions); + castedOptions?.Dispose (); + } } } @@ -82,7 +98,25 @@ namespace Network { public NWProtocolOptions TransportProtocol { get { var pHandle = nw_protocol_stack_copy_transport_protocol (GetCheckedHandle ()); - return (pHandle == IntPtr.Zero)? null : new NWProtocolOptions (pHandle, owns: true); + if (pHandle == IntPtr.Zero) + return null; + var tempOptions = new NWProtocolOptions (pHandle, owns: true); + + using (var definition = tempOptions.ProtocolDefinition) { + NWProtocolOptions castedOptions = null; + if (definition.Equals (NWProtocolDefinition.TcpDefinition)) { + castedOptions = new NWProtocolTcpOptions (pHandle, owns: true); + } + if (definition.Equals (NWProtocolDefinition.UdpDefinition)) { + castedOptions = new NWProtocolUdpOptions (pHandle, owns: true); + } + if (castedOptions == null) { + return tempOptions; + } else { + tempOptions.Dispose (); + return castedOptions; + } + } } set => nw_protocol_stack_set_transport_protocol (GetCheckedHandle (), value.GetHandle ()); } @@ -90,10 +124,14 @@ namespace Network { [DllImport (Constants.NetworkLibrary)] extern static IntPtr nw_protocol_stack_copy_internet_protocol (nw_protocol_stack_t stack); +#if XAMCORE_4_0 + public NWProtocolIPOptions InternetProtocol { +#else public NWProtocolOptions InternetProtocol { +#endif get { var pHandle = nw_protocol_stack_copy_internet_protocol (GetCheckedHandle ()); - return (pHandle == IntPtr.Zero) ? null : new NWProtocolOptions (pHandle, owns: true); + return (pHandle == IntPtr.Zero) ? null : new NWProtocolIPOptions (pHandle, owns: true); } } } diff --git a/src/Network/NWProtocolTcpOptions.cs b/src/Network/NWProtocolTcpOptions.cs new file mode 100644 index 0000000000..95e8d42c8a --- /dev/null +++ b/src/Network/NWProtocolTcpOptions.cs @@ -0,0 +1,65 @@ +// +// NWProtocolTcp: Bindings the Netowrk nw_protocol_options API focus on Tcp options. +// +// Authors: +// Manuel de la Pena +// +// Copyrigh 2019 Microsoft Inc +// +using System; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using ObjCRuntime; +using Foundation; +using CoreFoundation; +using Security; +using OS_nw_protocol_definition=System.IntPtr; +using IntPtr=System.IntPtr; + +namespace Network { + + [TV (12,0), Mac (10,14), iOS (12,0), Watch (6,0)] + public class NWProtocolTcpOptions : NWProtocolOptions { + + internal NWProtocolTcpOptions (IntPtr handle, bool owns) : base (handle, owns) {} + + public NWProtocolTcpOptions () : this (nw_tcp_create_options (), owns: true) {} + + public void SetNoDelay (bool noDelay) => nw_tcp_options_set_no_delay (GetCheckedHandle (), noDelay); + + public void SetNoPush (bool noPush) => nw_tcp_options_set_no_push (GetCheckedHandle (), noPush); + + public void SetNoOptions (bool noOptions) => nw_tcp_options_set_no_options (GetCheckedHandle (), noOptions); + + public void SetEnableKeepAlive (bool enableKeepAlive) => nw_tcp_options_set_enable_keepalive (GetCheckedHandle (), enableKeepAlive); + + public void SetKeepAliveCount (uint keepAliveCount) => nw_tcp_options_set_keepalive_count (GetCheckedHandle (), keepAliveCount); + + public void SetKeepAliveIdleTime (TimeSpan keepAliveIdleTime) + => nw_tcp_options_set_keepalive_idle_time (GetCheckedHandle (), (uint) keepAliveIdleTime.Seconds); + + public void SetKeepAliveInterval (TimeSpan keepAliveInterval) + => nw_tcp_options_set_keepalive_interval (GetCheckedHandle (), (uint) keepAliveInterval.Seconds); + + public void SetMaximumSegmentSize (uint maximumSegmentSize) + => nw_tcp_options_set_maximum_segment_size (GetCheckedHandle (), maximumSegmentSize); + + public void SetConnectionTimeout (TimeSpan connectionTimeout) + => nw_tcp_options_set_connection_timeout (GetCheckedHandle (), (uint) connectionTimeout.Seconds); + + public void SetPersistTimeout (TimeSpan persistTimeout) + => nw_tcp_options_set_persist_timeout (GetCheckedHandle (), (uint) persistTimeout.Seconds); + + public void SetRetransmitConnectionDropTime (TimeSpan connectionDropTime) + => nw_tcp_options_set_retransmit_connection_drop_time (GetCheckedHandle (), (uint) connectionDropTime.Seconds); + + public void SetRetransmitFinDrop (bool retransmitFinDrop) => nw_tcp_options_set_retransmit_fin_drop (GetCheckedHandle (), retransmitFinDrop); + + public void SetDisableAckStretching (bool disableAckStretching) + => nw_tcp_options_set_disable_ack_stretching (GetCheckedHandle (), disableAckStretching); + + public void SetEnableFastOpen (bool enableFastOpen) => nw_tcp_options_set_enable_fast_open (GetCheckedHandle (), enableFastOpen); + + public void SetDisableEcn (bool disableEcn) => nw_tcp_options_set_disable_ecn (GetCheckedHandle (), disableEcn); + } +} diff --git a/src/Network/NWProtocolTlsOptions.cs b/src/Network/NWProtocolTlsOptions.cs new file mode 100644 index 0000000000..b5ebaed021 --- /dev/null +++ b/src/Network/NWProtocolTlsOptions.cs @@ -0,0 +1,29 @@ +// +// NWProtocolTls: Bindings the Netowrk nw_protocol_options API focus on Tls options. +// +// Authors: +// Manuel de la Pena +// +// Copyrigh 2019 Microsoft Inc +// +using System; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using ObjCRuntime; +using Foundation; +using CoreFoundation; +using Security; +using OS_nw_protocol_definition=System.IntPtr; +using IntPtr=System.IntPtr; + +namespace Network { + + [TV (12,0), Mac (10,14), iOS (12,0), Watch (6,0)] + public class NWProtocolTlsOptions : NWProtocolOptions { + internal NWProtocolTlsOptions (IntPtr handle, bool owns) : base (handle, owns) {} + + public NWProtocolTlsOptions () : this (nw_tls_create_options (), owns: true) {} + + public SecProtocolOptions ProtocolOptions => new SecProtocolOptions (nw_tls_copy_sec_protocol_options (GetCheckedHandle ()), owns: true); + } +} diff --git a/src/Network/NWProtocolUdpOptions.cs b/src/Network/NWProtocolUdpOptions.cs new file mode 100644 index 0000000000..ed9b759299 --- /dev/null +++ b/src/Network/NWProtocolUdpOptions.cs @@ -0,0 +1,25 @@ +// +// NWProtocolTls: Bindings the Netowrk nw_protocol_options API focus on Udp options. +// +// Authors: +// Manuel de la Pena +// +// Copyrigh 2019 Microsoft Inc +// +using System; +using ObjCRuntime; +using Foundation; +using CoreFoundation; +using Security; + +namespace Network { + + [TV (12,0), Mac (10,14), iOS (12,0), Watch (6,0)] + public class NWProtocolUdpOptions : NWProtocolOptions { + internal NWProtocolUdpOptions (IntPtr handle, bool owns) : base (handle, owns) {} + + public NWProtocolUdpOptions () : this (nw_udp_create_options (), owns: true) {} + + public void SetPreferNoChecksum (bool preferNoChecksum) => nw_udp_options_set_prefer_no_checksum (GetCheckedHandle (), preferNoChecksum); + } +} diff --git a/src/frameworks.sources b/src/frameworks.sources index 3dfa1bacd1..0c98c7ae1c 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -1177,6 +1177,7 @@ NETWORK_SOURCES = \ Network/NWFramer.cs \ Network/NWInterface.cs \ Network/NWListener.cs \ + Network/NWProtocolIPOptions.cs \ Network/NWParameters.cs \ Network/NWPath.cs \ Network/NWPathMonitor.cs \ @@ -1185,6 +1186,9 @@ NETWORK_SOURCES = \ Network/NWProtocolOptions.cs \ Network/NWProtocolStack.cs \ Network/NWTxtRecord.cs \ + Network/NWProtocolTcpOptions.cs \ + Network/NWProtocolTlsOptions.cs \ + Network/NWProtocolUdpOptions.cs \ Network/NWWebSocketMetadata.cs \ Network/NWWebSocketOptions.cs \ Network/NWWebSocketRequest.cs \ diff --git a/tests/introspection/ApiCMAttachmentTest.cs b/tests/introspection/ApiCMAttachmentTest.cs index 3c18fbdac8..c08d8dbea6 100644 --- a/tests/introspection/ApiCMAttachmentTest.cs +++ b/tests/introspection/ApiCMAttachmentTest.cs @@ -244,6 +244,7 @@ namespace Introspection { case "NWWebSocketOptions": // same as above case "NWWebSocketRequest": // same as above case "NWWebSocketResponse": // same as above + case "NWProtocolIPOptions": // same as above case "ABSource": // not skipped when running on iOS 6.1 // type was removed in iOS 10 (and replaced) and never consumed by other API case "CGColorConverter": diff --git a/tests/monotouch-test/Network/NWProtocolIPOptionsTest.cs b/tests/monotouch-test/Network/NWProtocolIPOptionsTest.cs new file mode 100644 index 0000000000..3ab58fa541 --- /dev/null +++ b/tests/monotouch-test/Network/NWProtocolIPOptionsTest.cs @@ -0,0 +1,111 @@ +#if !__WATCHOS__ +using System; +using System.Threading; +#if XAMCORE_2_0 +using Foundation; +using Network; +using ObjCRuntime; +using CoreFoundation; +#else +using MonoTouch.Foundation; +using MonoTouch.Network; +using MonoTouch.CoreFoundation; +#endif + +using NUnit.Framework; + +namespace MonoTouchFixtures.Network { + + [TestFixture] + [Preserve (AllMembers = true)] + public class NWProtocolIPOptionsTest { + + AutoResetEvent connectedEvent; // used to let us know when the connection was established so that we can access the NWPath + string host; + NWConnection connection; + NWProtocolStack stack; + NWProtocolIPOptions options; + + void ConnectionStateHandler (NWConnectionState state, NWError error) + { + switch (state){ + case NWConnectionState.Ready: + connectedEvent.Set (); + break; + case NWConnectionState.Cancelled: + connection?.Dispose (); + connection = null; + stack?.Dispose (); + stack = null; + break; + case NWConnectionState.Invalid: + case NWConnectionState.Failed: + Assert.Inconclusive ("Network connection could not be performed."); + break; + } + } + + [TestFixtureSetUp] + public void Init () + { + TestRuntime.AssertXcodeVersion (11, 0); + // we want to use a single connection, since it is expensive + connectedEvent = new AutoResetEvent(false); + host = "www.google.com"; + using (var parameters = NWParameters.CreateTcp ()) + using (var endpoint = NWEndpoint.Create (host, "80")) { + connection = new NWConnection (endpoint, parameters); + connection.SetQueue (DispatchQueue.DefaultGlobalQueue); // important, else we will get blocked + connection.SetStateChangeHandler (ConnectionStateHandler); + connection.Start (); + Assert.True (connectedEvent.WaitOne (20000), "Connection timed out."); + stack = parameters.ProtocolStack; + using (var ipOptions = stack.InternetProtocol) { + if (ipOptions != null) { + ipOptions.IPSetVersion (NWIPVersion.Version4); + stack.PrependApplicationProtocol (ipOptions); + } + } + } + } + + [TestFixtureTearDown] + public void Dispose() + { + connection.Cancel (); + } + + [SetUp] + public void SetUp () + { + options = stack.InternetProtocol as NWProtocolIPOptions; + Assert.NotNull (options, "options"); + } + + // we cannot assert that the C code those the right thing, BUT we do know + // that if we call the property with the wrong pointer we will get an exception + // from the runtime because the C lib does check the pointer that is used for the call + + [Test] + public void SetIPVersionTest () => Assert.DoesNotThrow (() => options.SetVersion (NWIPVersion.Version6)); + + [Test] + public void SetHopLimitTest () => Assert.DoesNotThrow (() => options.SetHopLimit (1)); + + + [Test] + public void SetUseMinimumMtu () => Assert.DoesNotThrow (() => options.SetUseMinimumMtu (true)); + + + [Test] + public void SetDisableFragmentation () => Assert.DoesNotThrow (() => options.SetDisableFragmentation (true)); + + + [Test] + public void SetCaculateReceiveTimeTest () => Assert.DoesNotThrow (() => options.SetCalculateReceiveTime (true)); + + [Test] + public void SetIPLocalAddressPreference () => Assert.DoesNotThrow (() => options.SetIPLocalAddressPreference (NWIPLocalAddressPreference.Temporary)); + } +} +#endif diff --git a/tests/monotouch-test/Network/NWProtocolTcpOptionsTest.cs b/tests/monotouch-test/Network/NWProtocolTcpOptionsTest.cs new file mode 100644 index 0000000000..09f8845c10 --- /dev/null +++ b/tests/monotouch-test/Network/NWProtocolTcpOptionsTest.cs @@ -0,0 +1,85 @@ +#if !__WATCHOS__ +using System; +using System.Threading; +#if XAMCORE_2_0 +using Foundation; +using Network; +using ObjCRuntime; +using CoreFoundation; +#else +using MonoTouch.Foundation; +using MonoTouch.Network; +using MonoTouch.CoreFoundation; +#endif + +using NUnit.Framework; + +namespace MonoTouchFixtures.Network { + + [TestFixture] + [Preserve (AllMembers = true)] + public class NWProtocolTcpOptionsTest { + NWProtocolTcpOptions options; + + [TestFixtureSetUp] + public void Init () => TestRuntime.AssertXcodeVersion (11, 0); + + [SetUp] + public void SetUp () + { + options = new NWProtocolTcpOptions (); + } + + [TearDown] + public void TearDown () => options.Dispose (); + + // properties do not have getters, but we know that if we call + // the setter with the wrong pointer we do have a exception + // thrown + + [Test] + public void NoDelayTest () => Assert.DoesNotThrow (() => options.SetNoDelay (true)); + + [Test] + public void NoPushTest () => Assert.DoesNotThrow (() => options.SetNoPush (true)); + + [Test] + public void NoOptionsTest ()=> Assert.DoesNotThrow (() => options.SetNoOptions (true)); + + [Test] + public void EnableKeepAliveTest () => Assert.DoesNotThrow (() => options.SetEnableKeepAlive (true)); + + [Test] + public void KeepAliveCountTest () => Assert.DoesNotThrow (() => options.SetKeepAliveCount (10)); + + [Test] + public void KeepAliveIdleTimeTest () => Assert.DoesNotThrow (() => options.SetKeepAliveIdleTime (TimeSpan.FromSeconds (10))); + + [Test] + public void MaximumSegmentSizeTest () => Assert.DoesNotThrow (() => options.SetMaximumSegmentSize (10)); + + [Test] + public void ConnectionTimeoutTest () => Assert.DoesNotThrow (() => options.SetConnectionTimeout (TimeSpan.FromSeconds (10))); + + [Test] + public void PersistTimeoutTest () => Assert.DoesNotThrow (() => options.SetPersistTimeout (TimeSpan.FromSeconds (10))); + + [Test] + public void RetransmitConnectionDropTimeTest () + => Assert.DoesNotThrow (() => options.SetRetransmitConnectionDropTime (TimeSpan.FromSeconds (10))); + + [Test] + public void RetransmitFinDropTest () => Assert.DoesNotThrow (() => options.SetRetransmitFinDrop (true)); + + [Test] + public void DisableAckStretchingTest () => Assert.DoesNotThrow (() => options.SetDisableAckStretching (true)); + + [Test] + public void EnableFastOpenTest () => Assert.DoesNotThrow (() => options.SetEnableFastOpen (true)); + + [Test] + public void DisableEcnTest () => Assert.DoesNotThrow (() => options.SetDisableEcn (true)); + + } +} +#endif diff --git a/tests/monotouch-test/Network/NWProtocolTlsOptionsTest.cs b/tests/monotouch-test/Network/NWProtocolTlsOptionsTest.cs new file mode 100644 index 0000000000..5afcab469c --- /dev/null +++ b/tests/monotouch-test/Network/NWProtocolTlsOptionsTest.cs @@ -0,0 +1,40 @@ +#if !__WATCHOS__ +using System; +using System.Threading; +#if XAMCORE_2_0 +using Foundation; +using Network; +using ObjCRuntime; +using CoreFoundation; +#else +using MonoTouch.Foundation; +using MonoTouch.Network; +using MonoTouch.CoreFoundation; +#endif + +using NUnit.Framework; + +namespace MonoTouchFixtures.Network { + + [TestFixture] + [Preserve (AllMembers = true)] + public class NWProtocolTlsOptionsTest { + NWProtocolTlsOptions options; + + [TestFixtureSetUp] + public void Init () => TestRuntime.AssertXcodeVersion (11, 0); + + [SetUp] + public void SetUp () + { + options = new NWProtocolTlsOptions (); + } + + [TearDown] + public void TearDown () => options.Dispose (); + + [Test] + public void ProtocolOptionsTest () => Assert.NotNull (options.TlsProtocolOptions); + } +} +#endif \ No newline at end of file diff --git a/tests/monotouch-test/Network/NWProtocolUdpOptionsTest.cs b/tests/monotouch-test/Network/NWProtocolUdpOptionsTest.cs new file mode 100644 index 0000000000..b86fab7180 --- /dev/null +++ b/tests/monotouch-test/Network/NWProtocolUdpOptionsTest.cs @@ -0,0 +1,45 @@ +#if !__WATCHOS__ +using System; +using System.Threading; +#if XAMCORE_2_0 +using Foundation; +using Network; +using ObjCRuntime; +using CoreFoundation; +#else +using MonoTouch.Foundation; +using MonoTouch.Network; +using MonoTouch.CoreFoundation; +#endif + +using NUnit.Framework; + +namespace MonoTouchFixtures.Network { + + [TestFixture] + [Preserve (AllMembers = true)] + public class NWProtocolUdpOptionsTest { + NWProtocolUdpOptions options; + + [TestFixtureSetUp] + public void Init () => TestRuntime.AssertXcodeVersion (11, 0); + + [SetUp] + public void SetUp () + { + options = new NWProtocolUdpOptions (); + } + + [TearDown] + public void TearDown () => options.Dispose (); + + // properties do not have getters, but we know that if we call + // the setter with the wrong pointer we do have a exception + // thrown + + [Test] + public void PreferNoChecksumTest () => Assert.DoesNotThrow (() => options.SetPreferNoChecksum (true)); + + } +} +#endif \ No newline at end of file From e452a36cfe3a9c53ce05503c9170f8d979129040 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Fri, 18 Oct 2019 04:18:18 +0200 Subject: [PATCH 019/100] Update APIDIFF_REFERENCES to track current stable (13.4/6.4) (#7254) --- Make.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Make.config b/Make.config index b54732c463..1295bc1464 100644 --- a/Make.config +++ b/Make.config @@ -31,7 +31,7 @@ $(TOP)/Make.config.inc: $(TOP)/Make.config include $(TOP)/Make.versions -APIDIFF_REFERENCES=https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/d16-3/d532e90de664caf46baea6226d742b9f68b3173a/44/package/bundle.zip +APIDIFF_REFERENCES=https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/xcode11.1/e37549bc9052bff81d5c7da8a3b7992b47a08154/29/package/bundle.zip PACKAGE_HEAD_REV=$(shell git rev-parse HEAD) From dc72d592cf50b3f0465dcaf1c4ff33d0a0e1c668 Mon Sep 17 00:00:00 2001 From: Pramit Mallick Date: Fri, 18 Oct 2019 15:45:34 -0400 Subject: [PATCH 020/100] [Appkit] Bindings - part 2 (#7215) * Added NSButtonTouchBarItem interface * Added NSTextScalingType * name changes * Text Scaling options * Deprecated KeyEquivalentFont * Deprecated CopiesOnScroll * Added missing enums first * Added some deprecated attributes * some more deprecations * Strong typed TextScaling * apple docs to correct deprecations * Changed deprecated messages * strong typing NSTouchBarItemIdentifier identifier * internal attr * Making TextScalingDocumentOption simple Fields following UIKit * Moved NSDirectionalEdgeInsets * Added NSCollectionLayoutAnchor * removed extra methods for mac from xkit/types * removed todos * added automaticCustomizeTouchBarMenuItemEnabled * added NSCollectionLayoutDimension * added NSPickerTouchBarItem * added NSCollectionLayoutSize * added NSCollectionLayoutSpacing * added NSCollectionLayoutEdgeSpacing * added DesignatedInitializer * addressed reviews * naming + alignment * adding test case for NSPickerTouchBarItem .ctor * added comment * removed deprecated selectors to ignore * updated copyright info in Xkit/Types header --- src/AppKit/NSCollectionLayoutAnchor.cs | 24 +++ src/UIKit/UITypes.cs | 77 --------- src/XKit/Types.cs | 116 ++++++++++++++ src/appkit.cs | 211 ++++++++++++++++++++++++- src/frameworks.sources | 3 + tests/introspection/ApiCtorInitTest.cs | 5 + tests/xtro-sharpie/macOS-AppKit.ignore | 20 ++- tests/xtro-sharpie/macOS-AppKit.todo | 84 ---------- 8 files changed, 373 insertions(+), 167 deletions(-) create mode 100644 src/AppKit/NSCollectionLayoutAnchor.cs create mode 100644 src/XKit/Types.cs diff --git a/src/AppKit/NSCollectionLayoutAnchor.cs b/src/AppKit/NSCollectionLayoutAnchor.cs new file mode 100644 index 0000000000..afd1644742 --- /dev/null +++ b/src/AppKit/NSCollectionLayoutAnchor.cs @@ -0,0 +1,24 @@ +using System; +using System.Runtime.InteropServices; +using CoreFoundation; +using Foundation; +using ObjCRuntime; +using CoreGraphics; + +namespace AppKit { + + [Mac (10, 15)] + public enum NSCollectionLayoutAnchorOffsetType { + Absolute, + Fractional, + } + + public partial class NSCollectionLayoutAnchor { + public static NSCollectionLayoutAnchor Create (NSDirectionalRectEdge edges, NSCollectionLayoutAnchorOffsetType offsetType, CGPoint offset) => + offsetType switch + { + NSCollectionLayoutAnchorOffsetType.Absolute => _LayoutAnchorWithEdgesAbsoluteOffset (edges, offset), + NSCollectionLayoutAnchorOffsetType.Fractional => _LayoutAnchorWithEdgesFractionalOffset (edges, offset), + }; + } +} \ No newline at end of file diff --git a/src/UIKit/UITypes.cs b/src/UIKit/UITypes.cs index 35110004e6..1442938f12 100644 --- a/src/UIKit/UITypes.cs +++ b/src/UIKit/UITypes.cs @@ -102,83 +102,6 @@ namespace UIKit { #endif } - [Watch (4,0), TV (11,0), iOS (11,0)] - [StructLayout (LayoutKind.Sequential)] - public struct NSDirectionalEdgeInsets { - - // API match for NSDirectionalEdgeInsetsZero field/constant - [Field ("NSDirectionalEdgeInsetsZero")] // fake (but helps testing and could also help documentation) - public static readonly NSDirectionalEdgeInsets Zero; - - public nfloat Top, Leading, Bottom, Trailing; - -#if !COREBUILD - public NSDirectionalEdgeInsets (nfloat top, nfloat leading, nfloat bottom, nfloat trailing) - { - Top = top; - Leading = leading; - Bottom = bottom; - Trailing = trailing; - } - - // note: NSDirectionalEdgeInsetsEqualToDirectionalEdgeInsets (UIGeometry.h) is a macro - public bool Equals (NSDirectionalEdgeInsets other) - { - if (Leading != other.Leading) - return false; - if (Trailing != other.Trailing) - return false; - if (Top != other.Top) - return false; - return (Bottom == other.Bottom); - } - - public override bool Equals (object obj) - { - if (obj is NSDirectionalEdgeInsets) - return Equals ((NSDirectionalEdgeInsets) obj); - return false; - } - - public static bool operator == (NSDirectionalEdgeInsets insets1, NSDirectionalEdgeInsets insets2) - { - return insets1.Equals (insets2); - } - - public static bool operator != (NSDirectionalEdgeInsets insets1, NSDirectionalEdgeInsets insets2) - { - return !insets1.Equals (insets2); - } - - public override int GetHashCode () - { - return Top.GetHashCode () ^ Leading.GetHashCode () ^ Trailing.GetHashCode () ^ Bottom.GetHashCode (); - } - - [DllImport (Constants.UIKitLibrary)] - extern static NSDirectionalEdgeInsets NSDirectionalEdgeInsetsFromString (IntPtr /* NSString */ s); - - static public NSDirectionalEdgeInsets FromString (string s) - { - // note: null is allowed - var ptr = NSString.CreateNative (s); - var value = NSDirectionalEdgeInsetsFromString (ptr); - NSString.ReleaseNative (ptr); - return value; - } - - [DllImport (Constants.UIKitLibrary)] - extern static IntPtr /* NSString */ NSStringFromDirectionalEdgeInsets (NSDirectionalEdgeInsets insets); - - // note: ensure we can roundtrip ToString into FromString - public override string ToString () - { - using (var ns = new NSString (NSStringFromDirectionalEdgeInsets (this))) - return ns.ToString (); - } -#endif - } - #if !WATCH [iOS (9,0)] [StructLayout (LayoutKind.Sequential)] diff --git a/src/XKit/Types.cs b/src/XKit/Types.cs new file mode 100644 index 0000000000..6a0211b1a0 --- /dev/null +++ b/src/XKit/Types.cs @@ -0,0 +1,116 @@ +// +// Copyright 2019 Microsoft Inc +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +using System; +using System.Runtime.InteropServices; + +using ObjCRuntime; +using Foundation; +using CoreGraphics; + +#if MONOMAC +namespace AppKit { +#else +namespace UIKit { +#endif + + [Watch (4,0), TV (11,0), iOS (11,0)] + [StructLayout (LayoutKind.Sequential)] + public struct NSDirectionalEdgeInsets { + + // API match for NSDirectionalEdgeInsetsZero field/constant + [Field ("NSDirectionalEdgeInsetsZero")] // fake (but helps testing and could also help documentation) + public static readonly NSDirectionalEdgeInsets Zero; + + public nfloat Top, Leading, Bottom, Trailing; + +#if !COREBUILD + public NSDirectionalEdgeInsets (nfloat top, nfloat leading, nfloat bottom, nfloat trailing) + { + Top = top; + Leading = leading; + Bottom = bottom; + Trailing = trailing; + } + + // note: NSDirectionalEdgeInsetsEqualToDirectionalEdgeInsets (UIGeometry.h) is a macro + public bool Equals (NSDirectionalEdgeInsets other) + { + if (Leading != other.Leading) + return false; + if (Trailing != other.Trailing) + return false; + if (Top != other.Top) + return false; + return (Bottom == other.Bottom); + } + + public override bool Equals (object obj) + { + if (obj is NSDirectionalEdgeInsets) + return Equals ((NSDirectionalEdgeInsets) obj); + return false; + } + + public static bool operator == (NSDirectionalEdgeInsets insets1, NSDirectionalEdgeInsets insets2) + { + return insets1.Equals (insets2); + } + + public static bool operator != (NSDirectionalEdgeInsets insets1, NSDirectionalEdgeInsets insets2) + { + return !insets1.Equals (insets2); + } + + public override int GetHashCode () + { + return Top.GetHashCode () ^ Leading.GetHashCode () ^ Trailing.GetHashCode () ^ Bottom.GetHashCode (); + } + +#if !MONOMAC + [DllImport (Constants.UIKitLibrary)] + extern static NSDirectionalEdgeInsets NSDirectionalEdgeInsetsFromString (IntPtr /* NSString */ s); + + static public NSDirectionalEdgeInsets FromString (string s) + { + // note: null is allowed + var ptr = NSString.CreateNative (s); + var value = NSDirectionalEdgeInsetsFromString (ptr); + NSString.ReleaseNative (ptr); + return value; + } +#endif + +#if !MONOMAC + [DllImport (Constants.UIKitLibrary)] + extern static IntPtr /* NSString */ NSStringFromDirectionalEdgeInsets (NSDirectionalEdgeInsets insets); + + // note: ensure we can roundtrip ToString into FromString + public override string ToString () + { + using (var ns = new NSString (NSStringFromDirectionalEdgeInsets (this))) + return ns.ToString (); + } +#endif +#endif + } +} \ No newline at end of file diff --git a/src/appkit.cs b/src/appkit.cs index c5329da345..5a3525938c 100644 --- a/src/appkit.cs +++ b/src/appkit.cs @@ -3065,7 +3065,7 @@ namespace AppKit { bool CanDragItems (NSCollectionView collectionView, NSIndexSet indexes, NSEvent evt); [Export ("collectionView:writeItemsAtIndexes:toPasteboard:")] - [Deprecated (PlatformName.MacOSX, 10, 15, message: "Use the 'GetPasteboardWriter' method instead")] + [Deprecated (PlatformName.MacOSX, 10, 15, message: "Use the 'GetPasteboardWriter' method instead.")] bool WriteItems (NSCollectionView collectionView, NSIndexSet indexes, NSPasteboard toPasteboard); [Deprecated (PlatformName.MacOSX, 10, 13, message: "Use 'NSFilePromiseReceiver' objects instead.")] @@ -3091,7 +3091,7 @@ namespace AppKit { [Mac (10,11)] [Export ("collectionView:writeItemsAtIndexPaths:toPasteboard:")] - [Deprecated (PlatformName.MacOSX, 10, 15, message: "Use the 'GetPasteboardWriter' method instead")] + [Deprecated (PlatformName.MacOSX, 10, 15, message: "Use the 'GetPasteboardWriter' method instead.")] bool WriteItems (NSCollectionView collectionView, NSSet indexPaths, NSPasteboard pasteboard); [Mac (10,11)] @@ -17198,7 +17198,7 @@ namespace AppKit { void SortDescriptorsChanged (NSTableView tableView, NSSortDescriptor [] oldDescriptors); [Export ("tableView:writeRowsWithIndexes:toPasteboard:")] - [Deprecated (PlatformName.MacOSX, 10, 15, message: "Use the 'GetPasteboardWriterForRow' method instead")] + [Deprecated (PlatformName.MacOSX, 10, 15, message: "Use the 'GetPasteboardWriterForRow' method instead.")] bool WriteRows (NSTableView tableView, NSIndexSet rowIndexes, NSPasteboard pboard ); [Export ("tableView:validateDrop:proposedRow:proposedDropOperation:")] @@ -19800,6 +19800,11 @@ namespace AppKit { [NullAllowed, Export ("escapeKeyReplacementItemIdentifier")] string EscapeKeyReplacementItemIdentifier { get; set; } + + [Mac (10, 15)] + [Static] + [Export ("automaticCustomizeTouchBarMenuItemEnabled")] + bool AutomaticCustomizeTouchBarMenuItemEnabled { [Bind ("isAutomaticCustomizeTouchBarMenuItemEnabled")] get; set; } } interface INSTouchBarDelegate { } @@ -26833,6 +26838,7 @@ namespace AppKit { TopTrailing, } + [Mac (10,15)] [Native] public enum NSTextInputTraitType : long { @@ -26850,12 +26856,207 @@ namespace AppKit { Collapsed, } - [Mac (10,15), iOS (13,0)] + [Mac (10,15)] [Native] public enum NSToolbarItemGroupSelectionMode : long { SelectOne = 0, SelectAny = 1, Momentary = 2, - } + } + + [Mac (10,15)] + [BaseType (typeof(NSObject))] + [DisableDefaultCtor] + interface NSCollectionLayoutAnchor : NSCopying, INSCopying + { + [Static] + [Export ("layoutAnchorWithEdges:")] + NSCollectionLayoutAnchor Create (NSDirectionalRectEdge edges); + + [Static] + [Export ("layoutAnchorWithEdges:absoluteOffset:"), Internal] + NSCollectionLayoutAnchor _LayoutAnchorWithEdgesAbsoluteOffset (NSDirectionalRectEdge edges, CGPoint absoluteOffset); + + [Static] + [Export ("layoutAnchorWithEdges:fractionalOffset:"), Internal] + NSCollectionLayoutAnchor _LayoutAnchorWithEdgesFractionalOffset (NSDirectionalRectEdge edges, CGPoint fractionalOffset); + + [Export ("edges")] + NSDirectionalRectEdge Edges { get; } + + [Export ("offset")] + CGPoint Offset { get; } + + [Export ("isAbsoluteOffset")] + bool IsAbsoluteOffset { get; } + + [Export ("isFractionalOffset")] + bool IsFractionalOffset { get; } + } + + [Mac (10,15)] + [BaseType (typeof(NSObject))] + [DisableDefaultCtor] + interface NSCollectionLayoutDimension : NSCopying, INSCopying + { + [Static] + [Export ("fractionalWidthDimension:")] + NSCollectionLayoutDimension CreateFractionalWidthDimension (nfloat fractionalWidth); + + [Static] + [Export ("fractionalHeightDimension:")] + NSCollectionLayoutDimension CreateFractionalHeightDimension (nfloat fractionalHeight); + + [Static] + [Export ("absoluteDimension:")] + NSCollectionLayoutDimension CreateAbsoluteDimension (nfloat absoluteDimension); + + [Static] + [Export ("estimatedDimension:")] + NSCollectionLayoutDimension CreateEstimatedDimension (nfloat estimatedDimension); + + [Export ("isFractionalWidth")] + bool IsFractionalWidth { get; } + + [Export ("isFractionalHeight")] + bool IsFractionalHeight { get; } + + [Export ("isAbsolute")] + bool IsAbsolute { get; } + + [Export ("isEstimated")] + bool IsEstimated { get; } + + [Export ("dimension")] + nfloat Dimension { get; } + } + + [Mac (10,15)] + [BaseType (typeof(NSTouchBarItem))] + [DisableDefaultCtor] + interface NSPickerTouchBarItem + { + [Static] + [Export ("pickerTouchBarItemWithIdentifier:labels:selectionMode:target:action:")] + NSPickerTouchBarItem Create (NSTouchBarItemIdentifier identifier, string[] labels, NSPickerTouchBarItemSelectionMode selectionMode, [NullAllowed] NSObject target, [NullAllowed] Selector action); + + [Static] + [Export ("pickerTouchBarItemWithIdentifier:images:selectionMode:target:action:")] + NSPickerTouchBarItem Create (NSTouchBarItemIdentifier identifier, NSImage[] images, NSPickerTouchBarItemSelectionMode selectionMode, [NullAllowed] NSObject target, [NullAllowed] Selector action); + + [Export ("controlRepresentation", ArgumentSemantic.Assign)] + NSPickerTouchBarItemControlRepresentation ControlRepresentation { get; set; } + + [Export ("collapsedRepresentationLabel")] + string CollapsedRepresentationLabel { get; set; } + + [NullAllowed, Export ("collapsedRepresentationImage", ArgumentSemantic.Strong)] + NSImage CollapsedRepresentationImage { get; set; } + + [Export ("selectedIndex")] + nint SelectedIndex { get; set; } + + [NullAllowed, Export ("selectionColor", ArgumentSemantic.Copy)] + NSColor SelectionColor { get; set; } + + [Export ("selectionMode", ArgumentSemantic.Assign)] + NSPickerTouchBarItemSelectionMode SelectionMode { get; set; } + + [Export ("numberOfOptions")] + nint NumberOfOptions { get; set; } + + [Export ("setImage:atIndex:")] + void SetImage ([NullAllowed] NSImage image, nint index); + + [Export ("imageAtIndex:")] + [return: NullAllowed] + NSImage GetImage (nint index); + + [Export ("setLabel:atIndex:")] + void SetLabel (string label, nint index); + + [Export ("labelAtIndex:")] + [return: NullAllowed] + string GetLabel (nint index); + + [NullAllowed, Export ("target", ArgumentSemantic.Weak)] + NSObject Target { get; set; } + + [NullAllowed, Export ("action", ArgumentSemantic.Assign)] + Selector Action { get; set; } + + [Export ("enabled")] + bool Enabled { [Bind ("isEnabled")] get; set; } + + [Export ("setEnabled:atIndex:")] + void SetEnabled (bool enabled, nint index); + + [Export ("isEnabledAtIndex:")] + bool GetEnabled (nint index); + + [Export ("customizationLabel", ArgumentSemantic.Copy)] + string CustomizationLabel { get; set; } + } + + [Mac (10,15)] + [BaseType (typeof(NSObject))] + [DisableDefaultCtor] + interface NSCollectionLayoutSize : NSCopying, INSCopying + { + [Static] + [Export ("sizeWithWidthDimension:heightDimension:")] + NSCollectionLayoutSize Create (NSCollectionLayoutDimension width, NSCollectionLayoutDimension height); + + [Export ("widthDimension")] + NSCollectionLayoutDimension WidthDimension { get; } + + [Export ("heightDimension")] + NSCollectionLayoutDimension HeightDimension { get; } + } + + [Mac (10,15)] + [BaseType (typeof(NSObject))] + [DisableDefaultCtor] + interface NSCollectionLayoutSpacing : NSCopying, INSCopying + { + [Static] + [Export ("flexibleSpacing:")] + NSCollectionLayoutSpacing CreateFlexibleSpacing (nfloat flexibleSpacing); + + [Static] + [Export ("fixedSpacing:")] + NSCollectionLayoutSpacing CreateFixedSpacing (nfloat fixedSpacing); + + [Export ("spacing")] + nfloat Spacing { get; } + + [Export ("isFlexibleSpacing")] + bool IsFlexibleSpacing { get; } + + [Export ("isFixedSpacing")] + bool IsFixedSpacing { get; } + } + + [Mac (10,15)] + [BaseType (typeof(NSObject))] + [DisableDefaultCtor] + interface NSCollectionLayoutEdgeSpacing : NSCopying, INSCopying + { + [Static] + [Export ("spacingForLeading:top:trailing:bottom:")] + NSCollectionLayoutEdgeSpacing CreateSpacing ([NullAllowed] NSCollectionLayoutSpacing leading, [NullAllowed] NSCollectionLayoutSpacing top, [NullAllowed] NSCollectionLayoutSpacing trailing, [NullAllowed] NSCollectionLayoutSpacing bottom); + + [NullAllowed, Export ("leading")] + NSCollectionLayoutSpacing Leading { get; } + + [NullAllowed, Export ("top")] + NSCollectionLayoutSpacing Top { get; } + + [NullAllowed, Export ("trailing")] + NSCollectionLayoutSpacing Trailing { get; } + + [NullAllowed, Export ("bottom")] + NSCollectionLayoutSpacing Bottom { get; } + } } diff --git a/src/frameworks.sources b/src/frameworks.sources index 0c98c7ae1c..ff8df1a72a 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -70,6 +70,7 @@ APPKIT_CORE_SOURCES = \ AppKit/Enums.cs \ AppKit/XEnums.cs \ AppKit/NSAccessibility.cs \ + XKit/Types.cs \ APPKIT_SOURCES = \ AppKit/ActionDispatcher.cs \ @@ -147,6 +148,7 @@ APPKIT_SOURCES = \ AppKit/NSColorPickerTouchBarItem.cs \ AppKit/NSSliderTouchBarItem.cs \ AppKit/NSView.cs \ + AppKit/NSCollectionLayoutAnchor.cs \ # ARKit @@ -1516,6 +1518,7 @@ UIKIT_CORE_SOURCES = \ UIKit/UIPrintInteractionController.cs \ UIKit/UIStringAttributes.cs \ UIKit/UITypes.cs \ + XKit/Types.cs \ UIKIT_SOURCES = \ UIKit/Compat.cs \ diff --git a/tests/introspection/ApiCtorInitTest.cs b/tests/introspection/ApiCtorInitTest.cs index 6e2d468858..e40576959f 100644 --- a/tests/introspection/ApiCtorInitTest.cs +++ b/tests/introspection/ApiCtorInitTest.cs @@ -477,6 +477,11 @@ namespace Introspection { case "UICollectionViewCompositionalLayout": // Explicitly disabled ctors - (instancetype)init NS_UNAVAILABLE; return true; + case "NSPickerTouchBarItem": // You are meant to use the static factory methods + if (ctor.ToString () == $"Void .ctor(System.String)") + return true; + break; + } var ep = ctor.GetParameters (); diff --git a/tests/xtro-sharpie/macOS-AppKit.ignore b/tests/xtro-sharpie/macOS-AppKit.ignore index 78a10a360d..cc627c9348 100644 --- a/tests/xtro-sharpie/macOS-AppKit.ignore +++ b/tests/xtro-sharpie/macOS-AppKit.ignore @@ -1189,4 +1189,22 @@ !missing-selector! NSOpenGLView::wantsExtendedDynamicRangeOpenGLSurface not bound !missing-release-attribute-on-return-value! AppKit.NSDictionaryControllerKeyValuePair AppKit.NSDictionaryController::get_NewObject()'s selector's ('newObject') Objective-C method family ('new') indicates that the native method returns a retained object, and as such a '[return: Release]' attribute is required. -!missing-release-attribute-on-return-value! Foundation.NSObject AppKit.NSObjectController::get_NewObject()'s selector's ('newObject') Objective-C method family ('new') indicates that the native method returns a retained object, and as such a '[return: Release]' attribute is required. \ No newline at end of file +!missing-release-attribute-on-return-value! Foundation.NSObject AppKit.NSObjectController::get_NewObject()'s selector's ('newObject') Objective-C method family ('new') indicates that the native method returns a retained object, and as such a '[return: Release]' attribute is required. + +## Deprecated in Xcode 11 +!missing-selector! NSImageNSImage::cacheDepthMatchesImageDepth not bound +!missing-selector! NSImageNSImage::compositeToPoint:fromRect:operation: not bound +!missing-selector! NSImageNSImage::compositeToPoint:fromRect:operation:fraction: not bound +!missing-selector! NSImageNSImage::compositeToPoint:operation: not bound +!missing-selector! NSImageNSImage::compositeToPoint:operation:fraction: not bound +!missing-selector! NSImageNSImage::dissolveToPoint:fraction: not bound +!missing-selector! NSImageNSImage::dissolveToPoint:fromRect:fraction: not bound +!missing-selector! NSImageNSImage::initWithIconRef: not bound +!missing-selector! NSImageNSImage::isCachedSeparately not bound +!missing-selector! NSImageNSImage::isDataRetained not bound +!missing-selector! NSImageNSImage::lockFocusOnRepresentation: not bound +!missing-selector! NSImageNSImage::scalesWhenResized not bound +!missing-selector! NSImageNSImage::setCacheDepthMatchesImageDepth: not bound +!missing-selector! NSImageNSImage::setCachedSeparately: not bound +!missing-selector! NSImageNSImage::setDataRetained: not bound +!missing-selector! NSImageNSImage::setScalesWhenResized: not bound diff --git a/tests/xtro-sharpie/macOS-AppKit.todo b/tests/xtro-sharpie/macOS-AppKit.todo index 07b536fab2..dfb54ff2ef 100644 --- a/tests/xtro-sharpie/macOS-AppKit.todo +++ b/tests/xtro-sharpie/macOS-AppKit.todo @@ -1,4 +1,3 @@ -!missing-field! NSDirectionalEdgeInsetsZero not bound !missing-field! NSFontDescriptorSystemDesignDefault not bound !missing-field! NSFontDescriptorSystemDesignMonospaced not bound !missing-field! NSFontDescriptorSystemDesignRounded not bound @@ -14,17 +13,9 @@ !missing-protocol-conformance! NSTextList should conform to NSSecureCoding !missing-selector! +NSBindingSelectionMarker::defaultPlaceholderForMarker:onClass:withBinding: not bound !missing-selector! +NSBindingSelectionMarker::setDefaultPlaceholder:forMarker:onClass:withBinding: not bound -!missing-selector! +NSCollectionLayoutAnchor::layoutAnchorWithEdges: not bound -!missing-selector! +NSCollectionLayoutAnchor::layoutAnchorWithEdges:absoluteOffset: not bound -!missing-selector! +NSCollectionLayoutAnchor::layoutAnchorWithEdges:fractionalOffset: not bound !missing-selector! +NSCollectionLayoutBoundarySupplementaryItem::boundarySupplementaryItemWithLayoutSize:elementKind:alignment: not bound !missing-selector! +NSCollectionLayoutBoundarySupplementaryItem::boundarySupplementaryItemWithLayoutSize:elementKind:alignment:absoluteOffset: not bound !missing-selector! +NSCollectionLayoutDecorationItem::backgroundDecorationItemWithElementKind: not bound -!missing-selector! +NSCollectionLayoutDimension::absoluteDimension: not bound -!missing-selector! +NSCollectionLayoutDimension::estimatedDimension: not bound -!missing-selector! +NSCollectionLayoutDimension::fractionalHeightDimension: not bound -!missing-selector! +NSCollectionLayoutDimension::fractionalWidthDimension: not bound -!missing-selector! +NSCollectionLayoutEdgeSpacing::spacingForLeading:top:trailing:bottom: not bound !missing-selector! +NSCollectionLayoutGroup::customGroupWithLayoutSize:itemProvider: not bound !missing-selector! +NSCollectionLayoutGroup::horizontalGroupWithLayoutSize:subitem:count: not bound !missing-selector! +NSCollectionLayoutGroup::horizontalGroupWithLayoutSize:subitems: not bound @@ -35,28 +26,17 @@ !missing-selector! +NSCollectionLayoutItem::itemWithLayoutSize: not bound !missing-selector! +NSCollectionLayoutItem::itemWithLayoutSize:supplementaryItems: not bound !missing-selector! +NSCollectionLayoutSection::sectionWithGroup: not bound -!missing-selector! +NSCollectionLayoutSize::sizeWithWidthDimension:heightDimension: not bound -!missing-selector! +NSCollectionLayoutSpacing::fixedSpacing: not bound -!missing-selector! +NSCollectionLayoutSpacing::flexibleSpacing: not bound !missing-selector! +NSCollectionLayoutSupplementaryItem::supplementaryItemWithLayoutSize:elementKind:containerAnchor: not bound !missing-selector! +NSCollectionLayoutSupplementaryItem::supplementaryItemWithLayoutSize:elementKind:containerAnchor:itemAnchor: not bound !missing-selector! +NSColor::colorWithName:dynamicProvider: not bound !missing-selector! +NSColor::systemIndigoColor not bound !missing-selector! +NSColor::systemTealColor not bound !missing-selector! +NSFont::monospacedSystemFontOfSize:weight: not bound -!missing-selector! +NSPickerTouchBarItem::pickerTouchBarItemWithIdentifier:images:selectionMode:target:action: not bound -!missing-selector! +NSPickerTouchBarItem::pickerTouchBarItemWithIdentifier:labels:selectionMode:target:action: not bound !missing-selector! +NSStepperTouchBarItem::stepperTouchBarItemWithIdentifier:drawingHandler: not bound !missing-selector! +NSStepperTouchBarItem::stepperTouchBarItemWithIdentifier:formatter: not bound !missing-selector! +NSToolbarItemGroup::groupWithItemIdentifier:images:selectionMode:labels:target:action: not bound !missing-selector! +NSToolbarItemGroup::groupWithItemIdentifier:titles:selectionMode:labels:target:action: not bound -!missing-selector! +NSTouchBar::isAutomaticCustomizeTouchBarMenuItemEnabled not bound -!missing-selector! +NSTouchBar::setAutomaticCustomizeTouchBarMenuItemEnabled: not bound !missing-selector! +NSWorkspaceOpenConfiguration::configuration not bound -!missing-selector! NSCollectionLayoutAnchor::edges not bound -!missing-selector! NSCollectionLayoutAnchor::isAbsoluteOffset not bound -!missing-selector! NSCollectionLayoutAnchor::isFractionalOffset not bound -!missing-selector! NSCollectionLayoutAnchor::offset not bound !missing-selector! NSCollectionLayoutBoundarySupplementaryItem::alignment not bound !missing-selector! NSCollectionLayoutBoundarySupplementaryItem::extendsBoundary not bound !missing-selector! NSCollectionLayoutBoundarySupplementaryItem::offset not bound @@ -66,15 +46,6 @@ !missing-selector! NSCollectionLayoutDecorationItem::elementKind not bound !missing-selector! NSCollectionLayoutDecorationItem::setZIndex: not bound !missing-selector! NSCollectionLayoutDecorationItem::zIndex not bound -!missing-selector! NSCollectionLayoutDimension::dimension not bound -!missing-selector! NSCollectionLayoutDimension::isAbsolute not bound -!missing-selector! NSCollectionLayoutDimension::isEstimated not bound -!missing-selector! NSCollectionLayoutDimension::isFractionalHeight not bound -!missing-selector! NSCollectionLayoutDimension::isFractionalWidth not bound -!missing-selector! NSCollectionLayoutEdgeSpacing::bottom not bound -!missing-selector! NSCollectionLayoutEdgeSpacing::leading not bound -!missing-selector! NSCollectionLayoutEdgeSpacing::top not bound -!missing-selector! NSCollectionLayoutEdgeSpacing::trailing not bound !missing-selector! NSCollectionLayoutGroup::interItemSpacing not bound !missing-selector! NSCollectionLayoutGroup::setInterItemSpacing: not bound !missing-selector! NSCollectionLayoutGroup::setSupplementaryItems: not bound @@ -103,11 +74,6 @@ !missing-selector! NSCollectionLayoutSection::setVisibleItemsInvalidationHandler: not bound !missing-selector! NSCollectionLayoutSection::supplementariesFollowContentInsets not bound !missing-selector! NSCollectionLayoutSection::visibleItemsInvalidationHandler not bound -!missing-selector! NSCollectionLayoutSize::heightDimension not bound -!missing-selector! NSCollectionLayoutSize::widthDimension not bound -!missing-selector! NSCollectionLayoutSpacing::isFixedSpacing not bound -!missing-selector! NSCollectionLayoutSpacing::isFlexibleSpacing not bound -!missing-selector! NSCollectionLayoutSpacing::spacing not bound !missing-selector! NSCollectionLayoutSupplementaryItem::containerAnchor not bound !missing-selector! NSCollectionLayoutSupplementaryItem::elementKind not bound !missing-selector! NSCollectionLayoutSupplementaryItem::itemAnchor not bound @@ -160,56 +126,12 @@ !missing-selector! NSDiffableDataSourceSnapshot::sectionIdentifiers not bound !missing-selector! NSEvent::charactersByApplyingModifiers: not bound !missing-selector! NSFontDescriptor::fontDescriptorWithDesign: not bound -!missing-selector! NSImageNSImage::cacheDepthMatchesImageDepth not bound -!missing-selector! NSImageNSImage::compositeToPoint:fromRect:operation: not bound -!missing-selector! NSImageNSImage::compositeToPoint:fromRect:operation:fraction: not bound -!missing-selector! NSImageNSImage::compositeToPoint:operation: not bound -!missing-selector! NSImageNSImage::compositeToPoint:operation:fraction: not bound -!missing-selector! NSImageNSImage::dissolveToPoint:fraction: not bound -!missing-selector! NSImageNSImage::dissolveToPoint:fromRect:fraction: not bound -!missing-selector! NSImageNSImage::initWithIconRef: not bound -!missing-selector! NSImageNSImage::isCachedSeparately not bound -!missing-selector! NSImageNSImage::isDataRetained not bound -!missing-selector! NSImageNSImage::lockFocusOnRepresentation: not bound -!missing-selector! NSImageNSImage::scalesWhenResized not bound -!missing-selector! NSImageNSImage::setCacheDepthMatchesImageDepth: not bound -!missing-selector! NSImageNSImage::setCachedSeparately: not bound -!missing-selector! NSImageNSImage::setDataRetained: not bound -!missing-selector! NSImageNSImage::setScalesWhenResized: not bound !missing-selector! NSMenuToolbarItem::menu not bound !missing-selector! NSMenuToolbarItem::setMenu: not bound !missing-selector! NSMenuToolbarItem::setShowsIndicator: not bound !missing-selector! NSMenuToolbarItem::showsIndicator not bound !missing-selector! NSMovie::init not bound !missing-selector! NSMovie::initWithCoder: not bound -!missing-selector! NSPickerTouchBarItem::action not bound -!missing-selector! NSPickerTouchBarItem::collapsedRepresentationImage not bound -!missing-selector! NSPickerTouchBarItem::collapsedRepresentationLabel not bound -!missing-selector! NSPickerTouchBarItem::controlRepresentation not bound -!missing-selector! NSPickerTouchBarItem::customizationLabel not bound -!missing-selector! NSPickerTouchBarItem::imageAtIndex: not bound -!missing-selector! NSPickerTouchBarItem::isEnabled not bound -!missing-selector! NSPickerTouchBarItem::isEnabledAtIndex: not bound -!missing-selector! NSPickerTouchBarItem::labelAtIndex: not bound -!missing-selector! NSPickerTouchBarItem::numberOfOptions not bound -!missing-selector! NSPickerTouchBarItem::selectedIndex not bound -!missing-selector! NSPickerTouchBarItem::selectionColor not bound -!missing-selector! NSPickerTouchBarItem::selectionMode not bound -!missing-selector! NSPickerTouchBarItem::setAction: not bound -!missing-selector! NSPickerTouchBarItem::setCollapsedRepresentationImage: not bound -!missing-selector! NSPickerTouchBarItem::setCollapsedRepresentationLabel: not bound -!missing-selector! NSPickerTouchBarItem::setControlRepresentation: not bound -!missing-selector! NSPickerTouchBarItem::setCustomizationLabel: not bound -!missing-selector! NSPickerTouchBarItem::setEnabled: not bound -!missing-selector! NSPickerTouchBarItem::setEnabled:atIndex: not bound -!missing-selector! NSPickerTouchBarItem::setImage:atIndex: not bound -!missing-selector! NSPickerTouchBarItem::setLabel:atIndex: not bound -!missing-selector! NSPickerTouchBarItem::setNumberOfOptions: not bound -!missing-selector! NSPickerTouchBarItem::setSelectedIndex: not bound -!missing-selector! NSPickerTouchBarItem::setSelectionColor: not bound -!missing-selector! NSPickerTouchBarItem::setSelectionMode: not bound -!missing-selector! NSPickerTouchBarItem::setTarget: not bound -!missing-selector! NSPickerTouchBarItem::target not bound !missing-selector! NSResponder::changeModeWithEvent: not bound !missing-selector! NSScreen::localizedName not bound !missing-selector! NSScreenNSScreen::maximumPotentialExtendedDynamicRangeColorComponentValue not bound @@ -303,17 +225,12 @@ !missing-selector! NSWorkspaceOpenConfiguration::setHidesOthers: not bound !missing-selector! NSWorkspaceOpenConfiguration::setPromptsUserIfNeeded: not bound !missing-selector! NSWorkspaceOpenConfiguration::setRequiresUniversalLinks: not bound -!missing-type! NSCollectionLayoutAnchor not bound !missing-type! NSCollectionLayoutBoundarySupplementaryItem not bound !missing-type! NSCollectionLayoutDecorationItem not bound -!missing-type! NSCollectionLayoutDimension not bound -!missing-type! NSCollectionLayoutEdgeSpacing not bound !missing-type! NSCollectionLayoutGroup not bound !missing-type! NSCollectionLayoutGroupCustomItem not bound !missing-type! NSCollectionLayoutItem not bound !missing-type! NSCollectionLayoutSection not bound -!missing-type! NSCollectionLayoutSize not bound -!missing-type! NSCollectionLayoutSpacing not bound !missing-type! NSCollectionLayoutSupplementaryItem not bound !missing-type! NSCollectionViewCompositionalLayout not bound !missing-type! NSCollectionViewCompositionalLayoutConfiguration not bound @@ -321,7 +238,6 @@ !missing-type! NSColorSampler not bound !missing-type! NSDiffableDataSourceSnapshot not bound !missing-type! NSMenuToolbarItem not bound -!missing-type! NSPickerTouchBarItem not bound !missing-type! NSStepperTouchBarItem not bound !missing-type! NSSwitch not bound !missing-type! NSTextCheckingController not bound From 8411955e2f15ce99af44bcdbb50230cb7c57cfe1 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 18 Oct 2019 22:42:12 +0200 Subject: [PATCH 021/100] [CoreImage] Fix a couple of test/availability issues. (#7259) Fixes this on macOS 10.9: 1) ApiCtorInitTest.DefaultCtorAllowed (Introspection.MacApiCtorInitTest.ApiCtorInitTest.DefaultCtorAllowed) 1 potential errors found in 860 default ctor validated: CoreImage.CIMaskedVariableBlur : Handle Expected: 0 But was: 1 at Introspection.ApiCtorInitTest.DefaultCtorAllowed () [0x0019b] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/introspection/ApiCtorInitTest.cs:295 at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&) at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395 2) ApiCoreImageFiltersTest.Keys (Introspection.MacCoreImageFiltersTest.ApiCoreImageFiltersTest.Keys) System.ArgumentNullException : Value cannot be null. Parameter name: array at System.Array.IndexOf[T] (T[] array, T value) [0x0000e] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/corert/src/System.Private.CoreLib/src/System/Array.cs:666 at Introspection.ApiCoreImageFiltersTest.Keys () [0x002b7] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/introspection/ApiCoreImageFiltersTest.cs:445 at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&) at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395 3) ApiCoreImageFiltersTest.Protocols (Introspection.MacCoreImageFiltersTest.ApiCoreImageFiltersTest.Protocols) 1 potential errors found: Managed CIMaskedVariableBlur was not part of the native filter list Expected: 0 But was: 1 at Introspection.ApiCoreImageFiltersTest.Protocols () [0x0104e] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/introspection/ApiCoreImageFiltersTest.cs:370 at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&) at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395 And this on macOS 10.10: 1) ApiCoreImageFiltersTest.Keys (Introspection.MacCoreImageFiltersTest.ApiCoreImageFiltersTest.Keys) 1 potential errors found: CICode128BarcodeGenerator: Property `BarcodeHeight` mapped to key `inputBarcodeHeight` is not part of `InputKeys`. Expected: 0 But was: 1 at Introspection.ApiCoreImageFiltersTest.Keys () [0x006b1] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/introspection/ApiCoreImageFiltersTest.cs:524 at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&) at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395 2) ApiCoreImageFiltersTest.Protocols (Introspection.MacCoreImageFiltersTest.ApiCoreImageFiltersTest.Protocols) 1 potential errors found: CICode128BarcodeGenerator: Property `BarcodeHeight` mapped to key `inputBarcodeHeight` is not part of `InputKeys`. Expected: 0 But was: 1 at Introspection.ApiCoreImageFiltersTest.Protocols () [0x0104e] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/introspection/ApiCoreImageFiltersTest.cs:370 at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&) at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395 And this on macOS 11.11: 1) ApiCoreImageFiltersTest.Keys (Introspection.MacCoreImageFiltersTest.ApiCoreImageFiltersTest.Keys) 2 potential errors found: CICode128BarcodeGenerator: Property `BarcodeHeight` mapped to key `inputBarcodeHeight` is not part of `InputKeys`. CIGaussianBlur: Output Key `outputImageV1` is NOT mapped to a `OutputImageV1` property. Expected: 0 But was: 2 at Introspection.ApiCoreImageFiltersTest.Keys () [0x006b1] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/introspection/ApiCoreImageFiltersTest.cs:524 at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&) at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395 2) ApiCoreImageFiltersTest.Protocols (Introspection.MacCoreImageFiltersTest.ApiCoreImageFiltersTest.Protocols) 2 potential errors found: CICode128BarcodeGenerator: Property `BarcodeHeight` mapped to key `inputBarcodeHeight` is not part of `InputKeys`. CIGaussianBlur: Output Key `outputImageV1` is NOT mapped to a `OutputImageV1` property. Expected: 0 But was: 2 at Introspection.ApiCoreImageFiltersTest.Protocols () [0x0104e] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/introspection/ApiCoreImageFiltersTest.cs:370 at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&) at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395 --- src/coreimage.cs | 7 +++++++ tests/introspection/ApiCoreImageFiltersTest.cs | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/coreimage.cs b/src/coreimage.cs index f828bc6e80..89a8582b3e 100644 --- a/src/coreimage.cs +++ b/src/coreimage.cs @@ -4485,6 +4485,7 @@ namespace CoreImage { [iOS (9,3)] [TV (9,2)] + [Mac (10,10)] [CoreImageFilter] [BaseType (typeof (CIFilter))] interface CIMaskedVariableBlur : CIMaskedVariableBlurProtocol { @@ -6005,6 +6006,12 @@ namespace CoreImage { [Export ("quietSpace")] float QuietSpace { get; set; } + // The availability attributes here look redundant because they're already on the type, + // but it makes a difference when this member is inlined into another type, in which case + // these attributes are copied as well (while the type's attributes aren't). + [iOS (13,0)] + [TV (13,0)] + [Mac (10,15)] [Abstract] [Export ("barcodeHeight")] float BarcodeHeight { get; set; } diff --git a/tests/introspection/ApiCoreImageFiltersTest.cs b/tests/introspection/ApiCoreImageFiltersTest.cs index d243613a60..3fd82563f0 100644 --- a/tests/introspection/ApiCoreImageFiltersTest.cs +++ b/tests/introspection/ApiCoreImageFiltersTest.cs @@ -509,6 +509,13 @@ namespace Introspection { continue; } break; + case "CIGaussianBlur": + switch (key) { + case "outputImageV1": + // existed briefly in macOS 10.11, but neither before nor after. + continue; + } + break; } var cap = Char.ToUpperInvariant (key [0]) + key.Substring (1); From ca1d26c2b199d600ce9d85931578bac7b5d8f530 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Sun, 20 Oct 2019 22:12:30 +0200 Subject: [PATCH 022/100] [Network] NWWebsocketMetadata is a NWProtocolMetadata. (#7257) --- src/Network/NWWebSocketMetadata.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Network/NWWebSocketMetadata.cs b/src/Network/NWWebSocketMetadata.cs index 520d3547d9..d31d6a18c5 100644 --- a/src/Network/NWWebSocketMetadata.cs +++ b/src/Network/NWWebSocketMetadata.cs @@ -47,15 +47,14 @@ namespace Network { } [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] - public class NWWebSocketMetadata : NativeObject { + public class NWWebSocketMetadata : NWProtocolMetadata { internal NWWebSocketMetadata (IntPtr handle, bool owns) : base (handle, owns) {} [DllImport (Constants.NetworkLibrary)] static extern OS_nw_protocol_metadata nw_ws_create_metadata (NWWebSocketOpCode opcode); - public NWWebSocketMetadata (NWWebSocketOpCode opcode) - => InitializeHandle (nw_ws_create_metadata (opcode)); + public NWWebSocketMetadata (NWWebSocketOpCode opcode) : this (nw_ws_create_metadata (opcode), owns: true) {} [DllImport (Constants.NetworkLibrary)] static extern NWWebSocketCloseCode nw_ws_metadata_get_close_code (OS_nw_protocol_metadata metadata); From 89516b94e59ba9cee5a79b6ac484ec29d817b5d3 Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Mon, 21 Oct 2019 02:06:34 -0400 Subject: [PATCH 023/100] [xcode11.2] Bump mono 2019-06@476d72b (#7260) New commits in mono/mono: * mono/mono@476d72b9e32 [IO] Remove read-only logic in mono_w32_get_disk_free_space * mono/mono@bdc557612ba [2019-06][merp] Don't install SIGTERM handler in EnableMicrosoftTelemetry (#17296) * mono/mono@1e2d850ec4b [tests] Bump corefx to get Azure testhost change (#17275) * mono/mono@703e9a2fad2 [2019-06] Add drawing type converters to mobile profiles (#17241) * mono/mono@4ec605fc9b6 If there is a perform_wait_callback in the stack there will be another catch generated by the method called in the owner thread, so we don't need to throw as unhandled exception, we can continue and find the next catch. * mono/mono@061c2256212 [merp] exit_status is 0 if we ran the uploader successfully (#17186) * mono/mono@07c23f2ca43 [crashing] Remove Mono signal handlers when starting to handle a crash Diff: https://github.com/mono/mono/compare/5608fe0abb3e501c461b2979a913c0bed3fe2a6d..476d72b9e32ea58a7a8bda53af8cc8f5b7ffe6bb --- mk/mono.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/mono.mk b/mk/mono.mk index de8ea30c24..82cdac6e71 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,4 +1,4 @@ -NEEDED_MONO_VERSION := 5608fe0abb3e501c461b2979a913c0bed3fe2a6d +NEEDED_MONO_VERSION := 476d72b9e32ea58a7a8bda53af8cc8f5b7ffe6bb NEEDED_MONO_BRANCH := 2019-06 MONO_DIRECTORY := mono From 900437e861cd44c6a2c921c0d7a336f6c3fe337b Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Mon, 21 Oct 2019 09:24:35 -0400 Subject: [PATCH 024/100] [d16-4] Bump mono 2019-08@01dbbb74 (#7251) New commits in mono/mono: * mono/mono@01dbbb746f4 [2019-08] Enable GSS on Linux (#17410) * mono/mono@51a3dc37dab Fix SafeHandle marshalling in ref/in/out parameters (#17330) Diff: https://github.com/mono/mono/compare/3eb5f34f5412edfcb6932050b6c5c66fe1db2830..01dbbb746f4174130ef1226e4a9683f2f9a70f9d --- mk/mono.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/mono.mk b/mk/mono.mk index a4919fdb52..1a34044820 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,4 +1,4 @@ -NEEDED_MONO_VERSION := 3eb5f34f5412edfcb6932050b6c5c66fe1db2830 +NEEDED_MONO_VERSION := 01dbbb746f4174130ef1226e4a9683f2f9a70f9d NEEDED_MONO_BRANCH := 2019-08 MONO_DIRECTORY := mono From 5aade5e00af51219a6729d513717e452dc2b005f Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 21 Oct 2019 22:00:31 +0200 Subject: [PATCH 025/100] Bump prebuilt-apps, ios-samples and xamarin-form-samples for SampleTester. (#7265) --- tests/sampletester/Samples.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/sampletester/Samples.cs b/tests/sampletester/Samples.cs index e28006c45d..6ec6781726 100644 --- a/tests/sampletester/Samples.cs +++ b/tests/sampletester/Samples.cs @@ -8,7 +8,7 @@ namespace Samples { const string ORG = "xamarin"; const string REPO = "ios-samples"; // monotouch-samples redirects to ios-samples const string CATEGORY = "iossamples"; // categories can't contain dashes - const string HASH = "1d0f3270c394e9c15c014813e804972b17ce3e48"; + const string HASH = "bffa511ecb8f74b2d4a42418a130d0c83c9723cf"; static Dictionary test_data = new Dictionary { // Build solution instead of csproj @@ -124,7 +124,7 @@ namespace Samples { const string ORG = "xamarin"; const string REPO = "prebuilt-apps"; const string CATEGORY = "prebuiltapps"; // categories can't contain dashes - const string HASH = "40da1283722df96e81efb5c62364d05e5bd3dd76"; + const string HASH = "f111672bc6915ceb402abb47dedfe3480e111720"; static Dictionary test_data = new Dictionary { // Known failures @@ -142,7 +142,7 @@ namespace Samples { const string ORG = "xamarin"; const string REPO = "xamarin-forms-samples"; const string CATEGORY = "xamarinformssamples"; // categories can't contain dashes - const string HASH = "206f4c3a2be1e988eda2ad9130a37019c60f1c7e"; + const string HASH = "d196d3f7ba418d06ef799074eb4f6120e26a9cf4"; static Dictionary test_data = new Dictionary { // Build solution instead of csproj. From 6c75de0a6ab7f4496d6c2be46a91db0815c76931 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Tue, 22 Oct 2019 00:36:33 +0200 Subject: [PATCH 026/100] [Network] Add more convinient callbacks. (#7252) Providing callbacks with DispatchData and Int + length is not nice for the non advance users. Added set of methods that will use callbacks that will provide the users with ReadOnlySpan, which is nicer and makes it work with the API easier. Also, the change allows users to avoid unsafe code. --- src/Network/NWConnection.cs | 68 +++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/src/Network/NWConnection.cs b/src/Network/NWConnection.cs index 6a6bfd2eed..6da39b3744 100644 --- a/src/Network/NWConnection.cs +++ b/src/Network/NWConnection.cs @@ -43,6 +43,12 @@ namespace Network { // public delegate void NWConnectionReceiveDispatchDataCompletion (DispatchData data, NWContentContext context, bool isComplete, NWError error); + // + // Signature for a method invoked on data received, same as NWConnectionReceiveCompletion, + // but they receive ReadOnlySpan rather than a data + dataSize + // + public delegate void NWConnectionReceiveReadOnlySpanCompletion (ReadOnlySpan data, NWContentContext context, bool isComplete, NWError error); + [TV (12,0), Mac (10,14), iOS (12,0)] [Watch (6,0)] public class NWConnection : NativeObject { @@ -252,6 +258,7 @@ namespace Network { static nw_connection_receive_completion_t static_ReceiveCompletion = TrampolineReceiveCompletion; static nw_connection_receive_completion_t static_ReceiveCompletionDispatchData = TrampolineReceiveCompletionData; + static nw_connection_receive_completion_t static_ReceiveCompletionDispatchReadnOnlyData = TrampolineReceiveCompletionReadOnlyData; [MonoPInvokeCallback (typeof (nw_connection_receive_completion_t))] static void TrampolineReceiveCompletion (IntPtr block, IntPtr dispatchDataPtr, IntPtr contentContext, bool isComplete, IntPtr error) @@ -301,6 +308,35 @@ namespace Network { } } + [MonoPInvokeCallback (typeof (nw_connection_receive_completion_t))] + static void TrampolineReceiveCompletionReadOnlyData (IntPtr block, IntPtr dispatchDataPtr, IntPtr contentContext, bool isComplete, IntPtr error) + { + var del = BlockLiteral.GetTarget (block); + if (del != null) { + DispatchData dispatchData = null, dataCopy = null; + IntPtr bufferAddress = IntPtr.Zero; + nuint bufferSize = 0; + + if (dispatchDataPtr != IntPtr.Zero) { + dispatchData = new DispatchData (dispatchDataPtr, owns: false); + dataCopy = dispatchData.CreateMap (out bufferAddress, out bufferSize); + } + + unsafe { + var spanData = new ReadOnlySpan ((void*)bufferAddress, (int)bufferSize); + del (spanData, + contentContext == IntPtr.Zero ? null : new NWContentContext (contentContext, owns: false), + isComplete, + error == IntPtr.Zero ? null : new NWError (error, owns: false)); + } + + if (dispatchData != null) { + dataCopy.Dispose (); + dispatchData.Dispose (); + } + } + } + [DllImport (Constants.NetworkLibrary)] static extern void nw_connection_receive (IntPtr handle, /* uint32_t */ uint minimumIncompleteLength, /* uint32_t */ uint maximumLength, ref BlockLiteral callback); @@ -335,6 +371,22 @@ namespace Network { } } + [BindingImpl (BindingImplOptions.Optimizable)] + public void ReceiveReadOnlyData (uint minimumIncompleteLength, uint maximumLength, NWConnectionReceiveReadOnlySpanCompletion callback) + { + if (callback == null) + throw new ArgumentNullException (nameof (callback)); + + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_ReceiveCompletionDispatchReadnOnlyData, callback); + + try { + nw_connection_receive (GetCheckedHandle (), minimumIncompleteLength, maximumLength, ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + [DllImport (Constants.NetworkLibrary)] static extern void nw_connection_receive_message (IntPtr handle, ref BlockLiteral callback); @@ -370,6 +422,22 @@ namespace Network { } } + [BindingImpl (BindingImplOptions.Optimizable)] + public void ReceiveMessageReadOnlyData (NWConnectionReceiveReadOnlySpanCompletion callback) + { + if (callback == null) + throw new ArgumentNullException (nameof (callback)); + + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_ReceiveCompletionDispatchReadnOnlyData, callback); + + try { + nw_connection_receive_message (GetCheckedHandle (), ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + delegate void nw_connection_send_completion_t (IntPtr block, IntPtr error); static nw_connection_send_completion_t static_SendCompletion = TrampolineSendCompletion; From 9b13690a2d96fd485f05fa896a346cd68a5745fc Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 22 Oct 2019 07:13:14 +0200 Subject: [PATCH 027/100] [d16-4] [tests] Fix tests on Catalina. (#7262) * [tests] Remove 32-bit slice from macOS test libraries. Fixes xamarin/maccore#2031. The 32-bit slice is causing a build failure on the bots: Task "Exec" (TaskId:35) Task Parameter:Command=make bin/SimpleClassDylib.dylib bin/SimpleClassStatic.a bin/Mobile-static/MobileBinding.dll (TaskId:35) Task Parameter:WorkingDirectory=/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/mmptest//../mac-binding-project/ (TaskId:35) make bin/SimpleClassDylib.dylib bin/SimpleClassStatic.a bin/Mobile-static/MobileBinding.dll (TaskId:35) In file included from ../common/mac/SimpleClass.m:1: (TaskId:35) In file included from ../common/mac/SimpleClass.h:1: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:27: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSCollectionView.h:9: (TaskId:35) /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSViewController.h(247,39): error GF2D19E48: unknown type name 'NSExtensionContext'; did you mean 'NSAnimationContext'? [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj] @property (nullable, readonly,retain) NSExtensionContext *extensionContext API_AVAILABLE(macos(10.10)); (TaskId:35) ^ (TaskId:35) /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSAnimationContext.h:18:12: note: 'NSAnimationContext' declared here (TaskId:35) @interface NSAnimationContext : NSObject (TaskId:35) ^ (TaskId:35) In file included from ../common/mac/SimpleClass.m:1: (TaskId:35) In file included from ../common/mac/SimpleClass.h:1: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:99: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingServicePickerTouchBarItem.h:9: (TaskId:35) /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingService.h(181,119): error GC04982C4: expected a type [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj] - (NSCloudKitSharingServiceOptions)optionsForSharingService:(NSSharingService *)cloudKitSharingService shareProvider:(NSItemProvider *)provider; (TaskId:35) ^ (TaskId:35) /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingService.h(196,12): error G93352991: cannot find interface declaration for 'NSItemProvider' [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj] @interface NSItemProvider (NSCloudKitSharing) (TaskId:35) ^ (TaskId:35) In file included from ../common/mac/SimpleClass.m:1: (TaskId:35) In file included from ../common/mac/SimpleClass.h:1: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:250: (TaskId:35) /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSItemProvider.h(16,12): error G93352991: cannot find interface declaration for 'NSItemProvider' [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj] @interface NSItemProvider (NSItemSourceInfo) (TaskId:35) ^ (TaskId:35) 4 errors generated. (TaskId:35) make[1]: *** [bin/SimpleClass.i386.a] Error 1 (TaskId:35) and since we don't need the 32-bit slice anymore, just remove it. Fixes https://github.com/xamarin/maccore/issues/2031. * [monotouch-test] Percent-escape some local file paths. Fixes xamarin/maccore#2032. Fixes this xammac test failure when the csproj has paths in its path: 1) GetCaption (MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest.GetCaption) System.Exception : Could not initialize an instance of the type 'Foundation.NSUrl': the native 'initWithString:' method returned nil. It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false. at Foundation.NSObject.InitializeHandle (System.IntPtr handle, System.String initSelector) [0x000ab] in :0 at Foundation.NSUrl..ctor (System.String urlString) [0x00044] in :0 at MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest.GetCaption () [0x00076] in <7a733573c3684923854270073138d4be>:0 at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&) at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <9c0bd541400747ef85267f70e32bd8e4>:0 Fixes https://github.com/xamarin/maccore/issues/2032. * [tests] Exclude MPS tests in the simulator on macOS 10.15+. Fixes xamarin/maccore#2030. The simulator crashes when the app tests if MPS is supported... Fixes https://github.com/xamarin/maccore/issues/2030. * [tests] Exclude MPS tests in the simulator on macOS 10.15+. Fixes xamarin/maccore#2030. The simulator crashes when the app tests if MPS is supported... Fixes https://github.com/xamarin/maccore/issues/2030. * Fix whitespace. --- tests/mac-binding-project/Makefile | 8 ++++---- .../MediaAccessibility/ImageCaptioningTest.cs | 5 ++++- .../MetalPerformanceShaders/ImageScaleTest.cs | 6 ++++++ .../monotouch-test/MetalPerformanceShaders/KernelTest.cs | 4 ++++ .../MPSImageHistogramEqualizationTest.cs | 4 ++++ .../MPSImageHistogramSpecificationTest.cs | 4 ++++ .../MetalPerformanceShaders/MPSImageHistogramTest.cs | 4 ++++ 7 files changed, 30 insertions(+), 5 deletions(-) diff --git a/tests/mac-binding-project/Makefile b/tests/mac-binding-project/Makefile index fdc78fab49..1deb35a75f 100644 --- a/tests/mac-binding-project/Makefile +++ b/tests/mac-binding-project/Makefile @@ -14,17 +14,17 @@ bin: $(Q) mkdir -p bin bin/SimpleClassDylib.dylib: bin - $(Q) xcrun clang -shared ../common/mac/SimpleClass.m -o bin/SimpleClassDylib.dylib -std=gnu99 -mmacosx-version-min=10.9 -framework Cocoa -lSystem + $(Q) xcrun clang -shared ../common/mac/SimpleClass.m -o bin/SimpleClassDylib.dylib -std=gnu99 -mmacosx-version-min=$(MIN_OSX_SDK_VERSION) -framework Cocoa -lSystem bin/SimpleClass\ Dylib.dylib: bin/SimpleClassDylib.dylib $(Q) cp bin/SimpleClassDylib.dylib bin/SimpleClass\ Dylib.dylib bin/SimpleClass.%.a: ../common/mac/SimpleClass.m bin - $(Q) clang -c $< -o bin/SimpleClass.$*.o -std=gnu99 -mmacosx-version-min=10.9 -arch $* + $(Q) clang -c $< -o bin/SimpleClass.$*.o -std=gnu99 -mmacosx-version-min=$(MIN_OSX_SDK_VERSION) -arch $* $(Q) xcrun ar -rcs $@ bin/SimpleClass.$*.o -bin/SimpleClassStatic.a: bin bin/SimpleClass.i386.a bin/SimpleClass.x86_64.a - $(Q) lipo -create bin/SimpleClass.i386.a bin/SimpleClass.x86_64.a -output $@ +bin/SimpleClassStatic.a: bin/SimpleClass.x86_64.a | bin + $(Q) $(CP) $< $@ bin/Mobile-dynamic/MobileBinding.dll: bin/SimpleClassDylib.dylib $(Q) $(SYSTEM_XIBUILD) -- $(XBUILD_VERBOSITY) MobileBinding/MobileBinding_dynamic.csproj diff --git a/tests/monotouch-test/MediaAccessibility/ImageCaptioningTest.cs b/tests/monotouch-test/MediaAccessibility/ImageCaptioningTest.cs index f6831c7dc9..61f9ddac84 100644 --- a/tests/monotouch-test/MediaAccessibility/ImageCaptioningTest.cs +++ b/tests/monotouch-test/MediaAccessibility/ImageCaptioningTest.cs @@ -34,12 +34,15 @@ namespace MonoTouchFixtures.MediaAccessibility { Assert.Null (e, "remote / no error"); // weird should be an "image on disk" } string file = Path.Combine (NSBundle.MainBundle.ResourcePath, "basn3p08.png"); + file = file.Replace (" ", "%20"); using (NSUrl url = new NSUrl (file)) { var s = MAImageCaptioning.GetCaption (url, out var e); Assert.Null (s, "local / return value"); Assert.NotNull (e, "local / error"); // does not like the URL (invalid) } - using (NSUrl url = new NSUrl (NSBundle.MainBundle.ResourceUrl.AbsoluteString + "basn3p08.png")) { + file = NSBundle.MainBundle.ResourceUrl.AbsoluteString + "basn3p08.png"; + file = file.Replace (" ", "%20"); + using (NSUrl url = new NSUrl (file)) { var s = MAImageCaptioning.GetCaption (url, out var e); Assert.Null (s, "local / return value"); Assert.Null (e, "local / no error"); diff --git a/tests/monotouch-test/MetalPerformanceShaders/ImageScaleTest.cs b/tests/monotouch-test/MetalPerformanceShaders/ImageScaleTest.cs index c4fad8a579..6d2633470e 100644 --- a/tests/monotouch-test/MetalPerformanceShaders/ImageScaleTest.cs +++ b/tests/monotouch-test/MetalPerformanceShaders/ImageScaleTest.cs @@ -2,6 +2,7 @@ using System; using Foundation; +using ObjCRuntime; #if XAMCORE_2_0 using Metal; @@ -25,6 +26,11 @@ namespace MonoTouchFixtures.MetalPerformanceShaders { { TestRuntime.AssertXcodeVersion (9,0); +#if !MONOMAC + if (Runtime.Arch == Arch.SIMULATOR && Environment.OSVersion.Version.Major >= 15) + Assert.Inconclusive ("Metal is not supported in the simulator on macOS 10.15"); +#endif + device = MTLDevice.SystemDefault; // some older hardware won't have a default if (device == null || !MPSKernel.Supports (device)) diff --git a/tests/monotouch-test/MetalPerformanceShaders/KernelTest.cs b/tests/monotouch-test/MetalPerformanceShaders/KernelTest.cs index 448b2717e6..ea3b9bf343 100644 --- a/tests/monotouch-test/MetalPerformanceShaders/KernelTest.cs +++ b/tests/monotouch-test/MetalPerformanceShaders/KernelTest.cs @@ -4,6 +4,7 @@ using System; using Foundation; +using ObjCRuntime; #if XAMCORE_2_0 using Metal; @@ -27,6 +28,9 @@ namespace MonoTouchFixtures.MetalPerformanceShaders { { #if !MONOMAC TestRuntime.AssertXcodeVersion (7, 0); + + if (Runtime.Arch == Arch.SIMULATOR && Environment.OSVersion.Version.Major >= 15) + Assert.Inconclusive ("Metal is not supported in the simulator on macOS 10.15"); #else TestRuntime.AssertXcodeVersion (9, 0); #endif diff --git a/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramEqualizationTest.cs b/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramEqualizationTest.cs index b963d5cbe6..4140664bfa 100644 --- a/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramEqualizationTest.cs +++ b/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramEqualizationTest.cs @@ -3,6 +3,7 @@ #if !__WATCHOS__ using System; +using ObjCRuntime; #if XAMCORE_2_0 using Metal; @@ -27,6 +28,9 @@ namespace MonoTouchFixtures.MetalPerformanceShaders { #if !MONOMAC TestRuntime.AssertXcodeVersion (7, 0); + + if (Runtime.Arch == Arch.SIMULATOR && Environment.OSVersion.Version.Major >= 15) + Assert.Inconclusive ("Metal is not supported in the simulator on macOS 10.15"); #else TestRuntime.AssertXcodeVersion (9, 0); #endif diff --git a/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramSpecificationTest.cs b/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramSpecificationTest.cs index be9ac2f88d..2b34be9f33 100644 --- a/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramSpecificationTest.cs +++ b/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramSpecificationTest.cs @@ -3,6 +3,7 @@ #if !__WATCHOS__ using System; +using ObjCRuntime; #if XAMCORE_2_0 using Metal; @@ -27,6 +28,9 @@ namespace MonoTouchFixtures.MetalPerformanceShaders { #if !MONOMAC TestRuntime.AssertXcodeVersion (7, 0); + + if (Runtime.Arch == Arch.SIMULATOR && Environment.OSVersion.Version.Major >= 15) + Assert.Inconclusive ("Metal is not supported in the simulator on macOS 10.15"); #else TestRuntime.AssertXcodeVersion (9, 0); #endif diff --git a/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramTest.cs b/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramTest.cs index 4f0f6482d9..5178d2448d 100644 --- a/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramTest.cs +++ b/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramTest.cs @@ -3,6 +3,7 @@ #if !__WATCHOS__ using System; +using ObjCRuntime; #if XAMCORE_2_0 using Metal; @@ -27,6 +28,9 @@ namespace MonoTouchFixtures.MetalPerformanceShaders { #if !MONOMAC TestRuntime.AssertXcodeVersion (7, 0); + + if (Runtime.Arch == Arch.SIMULATOR && Environment.OSVersion.Version.Major >= 15) + Assert.Inconclusive ("Metal is not supported in the simulator on macOS 10.15"); #else TestRuntime.AssertXcodeVersion (9, 0); #endif From 4b3a6a79fae5f48cffaf067eab6bc6f173ca6673 Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Tue, 22 Oct 2019 04:59:47 -0400 Subject: [PATCH 028/100] [d16-4] Bump mono 2019-08@ef75d4be (#7269) New commits in mono/mono: * mono/mono@ef75d4bef75 [2019-08] BeginConnect complete to early when not using callback. (#17416) Diff: https://github.com/mono/mono/compare/01dbbb746f4174130ef1226e4a9683f2f9a70f9d..ef75d4bef7509b23103fffa2acca039e9acbb157 --- mk/mono.mk | 2 +- tests/bcl-test/iOS-monotouch_corlib_xunit-test.dll.ignore | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mk/mono.mk b/mk/mono.mk index 1a34044820..0f309d365c 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,4 +1,4 @@ -NEEDED_MONO_VERSION := 01dbbb746f4174130ef1226e4a9683f2f9a70f9d +NEEDED_MONO_VERSION := ef75d4bef7509b23103fffa2acca039e9acbb157 NEEDED_MONO_BRANCH := 2019-08 MONO_DIRECTORY := mono diff --git a/tests/bcl-test/iOS-monotouch_corlib_xunit-test.dll.ignore b/tests/bcl-test/iOS-monotouch_corlib_xunit-test.dll.ignore index a3ca266927..9a563ec502 100644 --- a/tests/bcl-test/iOS-monotouch_corlib_xunit-test.dll.ignore +++ b/tests/bcl-test/iOS-monotouch_corlib_xunit-test.dll.ignore @@ -54,3 +54,8 @@ Platform32:Test.TaskContinueWhenAnyTests.RunContinueWhenAnyTests # Test running out of memory Platform32:System.Collections.Tests.BitArray_OperatorsTests.Xor_Operator(l: [False, True, False, True, False, ...], r: [True, True, True, True, True, ...], expected: [True, False, True, False, True, ...]) +# out of memory, filled in mono as https://github.com/mono/mono/issues/17480 +Platform32:System.Memory.Tests.ReadOnlySequenceTestsCommonChar.HelloWorldAcrossTwoBlocks + +# fails on 32b for an unknown reason, passed on 64 +Platform32:System.Collections.Concurrent.Tests.ConcurrentDictionary_NonGeneric_Tests.ICollection_NonGeneric_CopyTo_TwoDimensionArray_ThrowsException(count: 75) From e3c9fb0a995230b0d24f22af400b1ed2ea39647d Mon Sep 17 00:00:00 2001 From: Pramit Mallick Date: Tue, 22 Oct 2019 09:45:58 -0400 Subject: [PATCH 029/100] Xcode11.2 HomeKit bindings (#7268) --- src/homekit.cs | 8 ++++++++ tests/xtro-sharpie/iOS-HomeKit.todo | 2 -- tests/xtro-sharpie/tvOS-HomeKit.todo | 2 -- tests/xtro-sharpie/watchOS-HomeKit.todo | 2 -- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/homekit.cs b/src/homekit.cs index 5e3f4e05b6..d4daec20c1 100644 --- a/src/homekit.cs +++ b/src/homekit.cs @@ -750,6 +750,10 @@ namespace HomeKit { [Field ("HMUserFailedAccessoriesKey")] NSString UserFailedAccessoriesKey { get; } + + [Watch (6, 1), TV (13, 2), iOS (13, 2)] + [Export ("supportsAddingNetworkRouter")] + bool SupportsAddingNetworkRouter { get; } } [TV (10,0)] @@ -852,6 +856,10 @@ namespace HomeKit { [Watch (4,0), TV (11,0), iOS (11,0)] [Export ("home:didUpdateHomeHubState:"), EventArgs ("HMHomeHubState")] void DidUpdateHomeHubState (HMHome home, HMHomeHubState homeHubState); + + [Watch (6,1), TV (13,2), iOS (13,2)] + [Export ("homeDidUpdateSupportedFeatures:")] + void DidUpdateSupportedFeatures (HMHome home); } [TV (10,0)] diff --git a/tests/xtro-sharpie/iOS-HomeKit.todo b/tests/xtro-sharpie/iOS-HomeKit.todo index 20a46fd1a3..e69de29bb2 100644 --- a/tests/xtro-sharpie/iOS-HomeKit.todo +++ b/tests/xtro-sharpie/iOS-HomeKit.todo @@ -1,2 +0,0 @@ -!missing-protocol-member! HMHomeDelegate::homeDidUpdateSupportedFeatures: not found -!missing-selector! HMHome::supportsAddingNetworkRouter not bound diff --git a/tests/xtro-sharpie/tvOS-HomeKit.todo b/tests/xtro-sharpie/tvOS-HomeKit.todo index 20a46fd1a3..e69de29bb2 100644 --- a/tests/xtro-sharpie/tvOS-HomeKit.todo +++ b/tests/xtro-sharpie/tvOS-HomeKit.todo @@ -1,2 +0,0 @@ -!missing-protocol-member! HMHomeDelegate::homeDidUpdateSupportedFeatures: not found -!missing-selector! HMHome::supportsAddingNetworkRouter not bound diff --git a/tests/xtro-sharpie/watchOS-HomeKit.todo b/tests/xtro-sharpie/watchOS-HomeKit.todo index 20a46fd1a3..e69de29bb2 100644 --- a/tests/xtro-sharpie/watchOS-HomeKit.todo +++ b/tests/xtro-sharpie/watchOS-HomeKit.todo @@ -1,2 +0,0 @@ -!missing-protocol-member! HMHomeDelegate::homeDidUpdateSupportedFeatures: not found -!missing-selector! HMHome::supportsAddingNetworkRouter not bound From 56328b8866b18057a26a7f4506d4d7f55864a8d2 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 22 Oct 2019 22:30:19 +0200 Subject: [PATCH 030/100] Fix a few introspection issues on Catalina. (#7212) (#7243) * [SceneKit] Adjust deprecation message. Fixes this introspection failure: [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Type: SCNLayer [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: get_OpenGLContext, Type: SCNView [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: set_OpenGLContext, Type: SCNView [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: get_PixelFormat, Type: SCNView [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: set_PixelFormat, Type: SCNView * [AppKit] Adjust deprecation messages. * [tests] Fix introspection and xammac tests on Catalina. (#7200) * [tests] Adjust NaturalLanguage.EmbeddingTest to cope with non-existent embeddings. Fixes xamarin/maccore#2011. Fixes https://github.com/xamarin/maccore/issues/2011. * [tests] Fix typo test on macOS 10.15. Fixes #7116. Fixes https://github.com/xamarin/xamarin-macios/issues/7116. * [introspection] Ignore MTLCounterSampleBufferDescriptor's selectors. They're implemented using a different/internal type: $ nm /System/Library/Frameworks/Metal.framework/Metal | grep MTLCounterSampleBuffer 00000000000458ab t +[MTLCounterSampleBufferDescriptor allocWithZone:] 0000000000045897 t +[MTLCounterSampleBufferDescriptor alloc] 000000000004591e t -[MTLCounterSampleBufferDescriptor copyWithZone:] 000000000004598e t -[MTLCounterSampleBufferDescriptorInternal copyWithZone:] 0000000000045c0f t -[MTLCounterSampleBufferDescriptorInternal counterSet] 0000000000045936 t -[MTLCounterSampleBufferDescriptorInternal dealloc] 0000000000045b65 t -[MTLCounterSampleBufferDescriptorInternal hash] 0000000000045a31 t -[MTLCounterSampleBufferDescriptorInternal isEqual:] 0000000000045c58 t -[MTLCounterSampleBufferDescriptorInternal label] 0000000000045c7f t -[MTLCounterSampleBufferDescriptorInternal sampleCount] 0000000000045c25 t -[MTLCounterSampleBufferDescriptorInternal setCounterSet:] 0000000000045c6e t -[MTLCounterSampleBufferDescriptorInternal setLabel:] 0000000000045c90 t -[MTLCounterSampleBufferDescriptorInternal setSampleCount:] 0000000000045c47 t -[MTLCounterSampleBufferDescriptorInternal setStorageMode:] 0000000000045c36 t -[MTLCounterSampleBufferDescriptorInternal storageMode] 000000000010b0b8 S _OBJC_CLASS_$_MTLCounterSampleBufferDescriptor 000000000010b0e0 S _OBJC_CLASS_$_MTLCounterSampleBufferDescriptorInternal 0000000000107070 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._counterSet 0000000000107078 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._label 0000000000107088 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._sampleCount 0000000000107080 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._storageMode 000000000010b108 S _OBJC_METACLASS_$_MTLCounterSampleBufferDescriptor 000000000010b130 S _OBJC_METACLASS_$_MTLCounterSampleBufferDescriptorInternal Fixes these test failures: 1) ApiSelectorTest.InstanceMethods (Introspection.MacApiSelectorTest.ApiSelectorTest.InstanceMethods) 8 errors found in 26658 instance selector validated: Selector not found for Metal.MTLCounterSampleBufferDescriptor : counterSet Selector not found for Metal.MTLCounterSampleBufferDescriptor : setCounterSet: Selector not found for Metal.MTLCounterSampleBufferDescriptor : label Selector not found for Metal.MTLCounterSampleBufferDescriptor : setLabel: Selector not found for Metal.MTLCounterSampleBufferDescriptor : sampleCount Selector not found for Metal.MTLCounterSampleBufferDescriptor : setSampleCount: Selector not found for Metal.MTLCounterSampleBufferDescriptor : storageMode Selector not found for Metal.MTLCounterSampleBufferDescriptor : setStorageMode: * [introspection] Ignore some API we've bound incorrectly. Fixes #7116. There are also a few API fixes, those will be submitted in a different PR. Fixes https://github.com/xamarin/xamarin-macios/issues/7116. --- src/scenekit.cs | 10 +++++----- tests/introspection/ApiProtocolTest.cs | 6 ++++++ tests/introspection/ApiTypoTest.cs | 4 ++++ tests/introspection/Mac/MacApiSelectorTest.cs | 8 ++++++++ .../NaturalLanguage/EmbeddingTest.cs | 17 ++++++++++++----- 5 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/scenekit.cs b/src/scenekit.cs index 5378eb9ded..b9c4d4538b 100644 --- a/src/scenekit.cs +++ b/src/scenekit.cs @@ -1213,7 +1213,7 @@ namespace SceneKit { #if MONOMAC [iOS (8,0)] - [Deprecated (PlatformName.MacOSX, 10, 14, message: "OpenGL API deprecated, please use Metal instead.")] + [Deprecated (PlatformName.MacOSX, 10, 14, message: "Please use Metal instead of OpenGL API.")] [Unavailable (PlatformName.MacCatalyst)][Advice ("This API is not available when using UIKit on macOS.")] [BaseType (typeof (CAOpenGLLayer))] interface SCNLayer : SCNSceneRenderer, SCNTechniqueSupport { @@ -3507,16 +3507,16 @@ namespace SceneKit { bool AllowsCameraControl { get; set; } #if MONOMAC - [Deprecated (PlatformName.MacOSX, 10, 14, message: "OpenGL API deprecated, please use Metal instead.")] + [Deprecated (PlatformName.MacOSX, 10, 14, message: "Please use Metal instead of OpenGL API.")] [Export ("openGLContext", ArgumentSemantic.Retain)] NSOpenGLContext OpenGLContext { get; set; } - [Deprecated (PlatformName.MacOSX, 10, 14, message: "OpenGL API deprecated, please use Metal instead.")] + [Deprecated (PlatformName.MacOSX, 10, 14, message: "Please use Metal instead of OpenGL API.")] [Export ("pixelFormat", ArgumentSemantic.Retain)] NSOpenGLPixelFormat PixelFormat { get; set; } #elif !WATCH - [Deprecated (PlatformName.iOS, 12, 0, message: "OpenGL API deprecated, please use Metal instead.")] - [Deprecated (PlatformName.TvOS, 12, 0, message: "OpenGL API deprecated, please use Metal instead.")] + [Deprecated (PlatformName.iOS, 12, 0, message: "Please use Metal instead of OpenGL API.")] + [Deprecated (PlatformName.TvOS, 12, 0, message: "Please use Metal instead of OpenGL API.")] [Export ("eaglContext", ArgumentSemantic.Retain)] #if XAMCORE_2_0 EAGLContext EAGLContext { get; set; } diff --git a/tests/introspection/ApiProtocolTest.cs b/tests/introspection/ApiProtocolTest.cs index 19ccc112d5..c0a4217b14 100644 --- a/tests/introspection/ApiProtocolTest.cs +++ b/tests/introspection/ApiProtocolTest.cs @@ -299,6 +299,12 @@ namespace Introspection { break; } break; +#if !XAMCORE_4_0 + case "MTLCounter": + case "MTLCounterSampleBuffer": + case "MTLCounterSet": + return true; // Incorrectly bound, will be fixed for XAMCORE_4_0. +#endif } return false; } diff --git a/tests/introspection/ApiTypoTest.cs b/tests/introspection/ApiTypoTest.cs index ed37f401be..3fb48c6285 100644 --- a/tests/introspection/ApiTypoTest.cs +++ b/tests/introspection/ApiTypoTest.cs @@ -145,6 +145,7 @@ namespace Introspection "Cartes", // french "Cavlc", "Cda", // acronym: Clinical Document Architecture + "Cdrom", "Cfa", // acronym: Color Filter Array "Celp", // MPEG4ObjectID "Characterteristic", @@ -386,6 +387,7 @@ namespace Introspection "nint", "Nntps", "Ntlm", + "Nsl", // InternetLocationNslNeighborhoodIcon "Ntsc", "nuint", "Ndef", @@ -436,6 +438,7 @@ namespace Introspection "Prerolls", "Preseti", "Prev", + "Privs", // SharingPrivsNotApplicableIcon "Propogate", "Psec", "Psm", // Protocol/Service Multiplexer @@ -865,6 +868,7 @@ namespace Introspection "Attributest", "Failwith", "Imageimage", + "Libary", "Musthold", "Olus", // Typo, should be 'Bolus', fixed in 'HKInsulinDeliveryReason' "Ostprandial", // Typo, should be 'Postprandial', fixed in 'HKBloodGlucoseMealTime' diff --git a/tests/introspection/Mac/MacApiSelectorTest.cs b/tests/introspection/Mac/MacApiSelectorTest.cs index 9a6663d692..76601a62f3 100644 --- a/tests/introspection/Mac/MacApiSelectorTest.cs +++ b/tests/introspection/Mac/MacApiSelectorTest.cs @@ -694,6 +694,14 @@ namespace Introspection { break; } break; + case "Metal": + switch (type.Name) { + case "MTLCounterSampleBufferDescriptor": + // This whole type is implemented using a different (internal) type, + // and it's the internal type who knows how to respond to the selectors. + return true; + } + break; } return base.Skip (type, selectorName); } diff --git a/tests/monotouch-test/NaturalLanguage/EmbeddingTest.cs b/tests/monotouch-test/NaturalLanguage/EmbeddingTest.cs index b24eb902da..465e10a82f 100644 --- a/tests/monotouch-test/NaturalLanguage/EmbeddingTest.cs +++ b/tests/monotouch-test/NaturalLanguage/EmbeddingTest.cs @@ -22,11 +22,18 @@ namespace MonoTouchFixtures.NaturalLanguage { { TestRuntime.AssertXcodeVersion (11, 0); - using (var e = NLEmbedding.GetWordEmbedding (NLLanguage.English)) { - Assert.NotNull (e, "GetWordEmbedding"); - Assert.Null (e.GetVector ("Xamarin"), "GetVector"); - Assert.False (e.TryGetVector ("Xamarin", out var vector), "TryGetVector"); - Assert.Null (vector, "vector"); + foreach (NLLanguage v in Enum.GetValues (typeof (NLLanguage))) { + if (v == NLLanguage.Unevaluated) + continue; // this is not a value provided by Apple. + + NLEmbedding e = null; + Assert.DoesNotThrow (() => e = NLEmbedding.GetWordEmbedding (v), $"Throws: {v}"); + if (e != null) { + Assert.NotNull (e, "GetWordEmbedding"); + Assert.Null (e.GetVector ("Xamarin"), "GetVector"); + Assert.False (e.TryGetVector ("Xamarin", out var vector), "TryGetVector"); + Assert.Null (vector, "vector"); + } } } #endif From 4f1beb3c8c3cf0294a48a9f4d2a4aa1ccf26ab57 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 22 Oct 2019 22:30:35 +0200 Subject: [PATCH 031/100] [xcode11.2] [tests] Fix tests on Catalina. (#7263) * [tests] Remove 32-bit slice from macOS test libraries. Fixes xamarin/maccore#2031. The 32-bit slice is causing a build failure on the bots: Task "Exec" (TaskId:35) Task Parameter:Command=make bin/SimpleClassDylib.dylib bin/SimpleClassStatic.a bin/Mobile-static/MobileBinding.dll (TaskId:35) Task Parameter:WorkingDirectory=/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/mmptest//../mac-binding-project/ (TaskId:35) make bin/SimpleClassDylib.dylib bin/SimpleClassStatic.a bin/Mobile-static/MobileBinding.dll (TaskId:35) In file included from ../common/mac/SimpleClass.m:1: (TaskId:35) In file included from ../common/mac/SimpleClass.h:1: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:27: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSCollectionView.h:9: (TaskId:35) /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSViewController.h(247,39): error GF2D19E48: unknown type name 'NSExtensionContext'; did you mean 'NSAnimationContext'? [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj] @property (nullable, readonly,retain) NSExtensionContext *extensionContext API_AVAILABLE(macos(10.10)); (TaskId:35) ^ (TaskId:35) /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSAnimationContext.h:18:12: note: 'NSAnimationContext' declared here (TaskId:35) @interface NSAnimationContext : NSObject (TaskId:35) ^ (TaskId:35) In file included from ../common/mac/SimpleClass.m:1: (TaskId:35) In file included from ../common/mac/SimpleClass.h:1: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:99: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingServicePickerTouchBarItem.h:9: (TaskId:35) /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingService.h(181,119): error GC04982C4: expected a type [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj] - (NSCloudKitSharingServiceOptions)optionsForSharingService:(NSSharingService *)cloudKitSharingService shareProvider:(NSItemProvider *)provider; (TaskId:35) ^ (TaskId:35) /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingService.h(196,12): error G93352991: cannot find interface declaration for 'NSItemProvider' [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj] @interface NSItemProvider (NSCloudKitSharing) (TaskId:35) ^ (TaskId:35) In file included from ../common/mac/SimpleClass.m:1: (TaskId:35) In file included from ../common/mac/SimpleClass.h:1: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:250: (TaskId:35) /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSItemProvider.h(16,12): error G93352991: cannot find interface declaration for 'NSItemProvider' [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj] @interface NSItemProvider (NSItemSourceInfo) (TaskId:35) ^ (TaskId:35) 4 errors generated. (TaskId:35) make[1]: *** [bin/SimpleClass.i386.a] Error 1 (TaskId:35) and since we don't need the 32-bit slice anymore, just remove it. Fixes https://github.com/xamarin/maccore/issues/2031. * [monotouch-test] Percent-escape some local file paths. Fixes xamarin/maccore#2032. Fixes this xammac test failure when the csproj has paths in its path: 1) GetCaption (MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest.GetCaption) System.Exception : Could not initialize an instance of the type 'Foundation.NSUrl': the native 'initWithString:' method returned nil. It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false. at Foundation.NSObject.InitializeHandle (System.IntPtr handle, System.String initSelector) [0x000ab] in :0 at Foundation.NSUrl..ctor (System.String urlString) [0x00044] in :0 at MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest.GetCaption () [0x00076] in <7a733573c3684923854270073138d4be>:0 at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&) at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <9c0bd541400747ef85267f70e32bd8e4>:0 Fixes https://github.com/xamarin/maccore/issues/2032. * [tests] Exclude MPS tests in the simulator on macOS 10.15+. Fixes xamarin/maccore#2030. The simulator crashes when the app tests if MPS is supported... Fixes https://github.com/xamarin/maccore/issues/2030. * [tests] Exclude MPS tests in the simulator on macOS 10.15+. Fixes xamarin/maccore#2030. The simulator crashes when the app tests if MPS is supported... Fixes https://github.com/xamarin/maccore/issues/2030. * Fix whitespace. --- tests/mac-binding-project/Makefile | 8 ++++---- .../MediaAccessibility/ImageCaptioningTest.cs | 5 ++++- .../MetalPerformanceShaders/ImageScaleTest.cs | 6 ++++++ .../monotouch-test/MetalPerformanceShaders/KernelTest.cs | 4 ++++ .../MPSImageHistogramEqualizationTest.cs | 4 ++++ .../MPSImageHistogramSpecificationTest.cs | 4 ++++ .../MetalPerformanceShaders/MPSImageHistogramTest.cs | 4 ++++ 7 files changed, 30 insertions(+), 5 deletions(-) diff --git a/tests/mac-binding-project/Makefile b/tests/mac-binding-project/Makefile index fdc78fab49..1deb35a75f 100644 --- a/tests/mac-binding-project/Makefile +++ b/tests/mac-binding-project/Makefile @@ -14,17 +14,17 @@ bin: $(Q) mkdir -p bin bin/SimpleClassDylib.dylib: bin - $(Q) xcrun clang -shared ../common/mac/SimpleClass.m -o bin/SimpleClassDylib.dylib -std=gnu99 -mmacosx-version-min=10.9 -framework Cocoa -lSystem + $(Q) xcrun clang -shared ../common/mac/SimpleClass.m -o bin/SimpleClassDylib.dylib -std=gnu99 -mmacosx-version-min=$(MIN_OSX_SDK_VERSION) -framework Cocoa -lSystem bin/SimpleClass\ Dylib.dylib: bin/SimpleClassDylib.dylib $(Q) cp bin/SimpleClassDylib.dylib bin/SimpleClass\ Dylib.dylib bin/SimpleClass.%.a: ../common/mac/SimpleClass.m bin - $(Q) clang -c $< -o bin/SimpleClass.$*.o -std=gnu99 -mmacosx-version-min=10.9 -arch $* + $(Q) clang -c $< -o bin/SimpleClass.$*.o -std=gnu99 -mmacosx-version-min=$(MIN_OSX_SDK_VERSION) -arch $* $(Q) xcrun ar -rcs $@ bin/SimpleClass.$*.o -bin/SimpleClassStatic.a: bin bin/SimpleClass.i386.a bin/SimpleClass.x86_64.a - $(Q) lipo -create bin/SimpleClass.i386.a bin/SimpleClass.x86_64.a -output $@ +bin/SimpleClassStatic.a: bin/SimpleClass.x86_64.a | bin + $(Q) $(CP) $< $@ bin/Mobile-dynamic/MobileBinding.dll: bin/SimpleClassDylib.dylib $(Q) $(SYSTEM_XIBUILD) -- $(XBUILD_VERBOSITY) MobileBinding/MobileBinding_dynamic.csproj diff --git a/tests/monotouch-test/MediaAccessibility/ImageCaptioningTest.cs b/tests/monotouch-test/MediaAccessibility/ImageCaptioningTest.cs index f6831c7dc9..61f9ddac84 100644 --- a/tests/monotouch-test/MediaAccessibility/ImageCaptioningTest.cs +++ b/tests/monotouch-test/MediaAccessibility/ImageCaptioningTest.cs @@ -34,12 +34,15 @@ namespace MonoTouchFixtures.MediaAccessibility { Assert.Null (e, "remote / no error"); // weird should be an "image on disk" } string file = Path.Combine (NSBundle.MainBundle.ResourcePath, "basn3p08.png"); + file = file.Replace (" ", "%20"); using (NSUrl url = new NSUrl (file)) { var s = MAImageCaptioning.GetCaption (url, out var e); Assert.Null (s, "local / return value"); Assert.NotNull (e, "local / error"); // does not like the URL (invalid) } - using (NSUrl url = new NSUrl (NSBundle.MainBundle.ResourceUrl.AbsoluteString + "basn3p08.png")) { + file = NSBundle.MainBundle.ResourceUrl.AbsoluteString + "basn3p08.png"; + file = file.Replace (" ", "%20"); + using (NSUrl url = new NSUrl (file)) { var s = MAImageCaptioning.GetCaption (url, out var e); Assert.Null (s, "local / return value"); Assert.Null (e, "local / no error"); diff --git a/tests/monotouch-test/MetalPerformanceShaders/ImageScaleTest.cs b/tests/monotouch-test/MetalPerformanceShaders/ImageScaleTest.cs index c4fad8a579..6d2633470e 100644 --- a/tests/monotouch-test/MetalPerformanceShaders/ImageScaleTest.cs +++ b/tests/monotouch-test/MetalPerformanceShaders/ImageScaleTest.cs @@ -2,6 +2,7 @@ using System; using Foundation; +using ObjCRuntime; #if XAMCORE_2_0 using Metal; @@ -25,6 +26,11 @@ namespace MonoTouchFixtures.MetalPerformanceShaders { { TestRuntime.AssertXcodeVersion (9,0); +#if !MONOMAC + if (Runtime.Arch == Arch.SIMULATOR && Environment.OSVersion.Version.Major >= 15) + Assert.Inconclusive ("Metal is not supported in the simulator on macOS 10.15"); +#endif + device = MTLDevice.SystemDefault; // some older hardware won't have a default if (device == null || !MPSKernel.Supports (device)) diff --git a/tests/monotouch-test/MetalPerformanceShaders/KernelTest.cs b/tests/monotouch-test/MetalPerformanceShaders/KernelTest.cs index 448b2717e6..ea3b9bf343 100644 --- a/tests/monotouch-test/MetalPerformanceShaders/KernelTest.cs +++ b/tests/monotouch-test/MetalPerformanceShaders/KernelTest.cs @@ -4,6 +4,7 @@ using System; using Foundation; +using ObjCRuntime; #if XAMCORE_2_0 using Metal; @@ -27,6 +28,9 @@ namespace MonoTouchFixtures.MetalPerformanceShaders { { #if !MONOMAC TestRuntime.AssertXcodeVersion (7, 0); + + if (Runtime.Arch == Arch.SIMULATOR && Environment.OSVersion.Version.Major >= 15) + Assert.Inconclusive ("Metal is not supported in the simulator on macOS 10.15"); #else TestRuntime.AssertXcodeVersion (9, 0); #endif diff --git a/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramEqualizationTest.cs b/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramEqualizationTest.cs index b963d5cbe6..4140664bfa 100644 --- a/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramEqualizationTest.cs +++ b/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramEqualizationTest.cs @@ -3,6 +3,7 @@ #if !__WATCHOS__ using System; +using ObjCRuntime; #if XAMCORE_2_0 using Metal; @@ -27,6 +28,9 @@ namespace MonoTouchFixtures.MetalPerformanceShaders { #if !MONOMAC TestRuntime.AssertXcodeVersion (7, 0); + + if (Runtime.Arch == Arch.SIMULATOR && Environment.OSVersion.Version.Major >= 15) + Assert.Inconclusive ("Metal is not supported in the simulator on macOS 10.15"); #else TestRuntime.AssertXcodeVersion (9, 0); #endif diff --git a/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramSpecificationTest.cs b/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramSpecificationTest.cs index be9ac2f88d..2b34be9f33 100644 --- a/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramSpecificationTest.cs +++ b/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramSpecificationTest.cs @@ -3,6 +3,7 @@ #if !__WATCHOS__ using System; +using ObjCRuntime; #if XAMCORE_2_0 using Metal; @@ -27,6 +28,9 @@ namespace MonoTouchFixtures.MetalPerformanceShaders { #if !MONOMAC TestRuntime.AssertXcodeVersion (7, 0); + + if (Runtime.Arch == Arch.SIMULATOR && Environment.OSVersion.Version.Major >= 15) + Assert.Inconclusive ("Metal is not supported in the simulator on macOS 10.15"); #else TestRuntime.AssertXcodeVersion (9, 0); #endif diff --git a/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramTest.cs b/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramTest.cs index 4f0f6482d9..5178d2448d 100644 --- a/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramTest.cs +++ b/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramTest.cs @@ -3,6 +3,7 @@ #if !__WATCHOS__ using System; +using ObjCRuntime; #if XAMCORE_2_0 using Metal; @@ -27,6 +28,9 @@ namespace MonoTouchFixtures.MetalPerformanceShaders { #if !MONOMAC TestRuntime.AssertXcodeVersion (7, 0); + + if (Runtime.Arch == Arch.SIMULATOR && Environment.OSVersion.Version.Major >= 15) + Assert.Inconclusive ("Metal is not supported in the simulator on macOS 10.15"); #else TestRuntime.AssertXcodeVersion (9, 0); #endif From 38c59c9077272c0be53bec02cc661162d993348f Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 22 Oct 2019 22:31:57 +0200 Subject: [PATCH 032/100] [Photos] Update to Xcode 11.2 beta 2. (#7274) * [Photos] Update to Xcode 11.2 beta 2. Ref: https://github.com/xamarin/maccore/issues/1797 * Fix xtro. --- src/photos.cs | 1 + tests/xtro-sharpie/macOS-Photos.todo | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 tests/xtro-sharpie/macOS-Photos.todo diff --git a/src/photos.cs b/src/photos.cs index fe82eed95d..77182cbbfe 100644 --- a/src/photos.cs +++ b/src/photos.cs @@ -73,6 +73,7 @@ namespace Photos [Export ("hidden")] bool Hidden { [Bind ("isHidden")] get; } + [Deprecated (PlatformName.MacOSX, 10, 15, message: "No longer supported.")] [NoTV][NoiOS] [Export ("syncFailureHidden")] bool SyncFailureHidden { [Bind ("isSyncFailureHidden")] get; } diff --git a/tests/xtro-sharpie/macOS-Photos.todo b/tests/xtro-sharpie/macOS-Photos.todo deleted file mode 100644 index a2d90cf9fd..0000000000 --- a/tests/xtro-sharpie/macOS-Photos.todo +++ /dev/null @@ -1 +0,0 @@ -!deprecated-attribute-missing! PHAsset::isSyncFailureHidden missing a [Deprecated] attribute From 09363654ad4809d63f4e617577668c13f73e1415 Mon Sep 17 00:00:00 2001 From: Pramit Mallick Date: Tue, 22 Oct 2019 17:02:15 -0400 Subject: [PATCH 033/100] [AppKit] Fix new warnings (#7278) * throw argument exception for exhaustive case * Update src/AppKit/NSCollectionLayoutAnchor.cs - style change Co-Authored-By: Rolf Bjarne Kvinge --- src/AppKit/NSCollectionLayoutAnchor.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/AppKit/NSCollectionLayoutAnchor.cs b/src/AppKit/NSCollectionLayoutAnchor.cs index afd1644742..1ce7ea6142 100644 --- a/src/AppKit/NSCollectionLayoutAnchor.cs +++ b/src/AppKit/NSCollectionLayoutAnchor.cs @@ -17,8 +17,9 @@ namespace AppKit { public static NSCollectionLayoutAnchor Create (NSDirectionalRectEdge edges, NSCollectionLayoutAnchorOffsetType offsetType, CGPoint offset) => offsetType switch { - NSCollectionLayoutAnchorOffsetType.Absolute => _LayoutAnchorWithEdgesAbsoluteOffset (edges, offset), + NSCollectionLayoutAnchorOffsetType.Absolute => _LayoutAnchorWithEdgesAbsoluteOffset (edges, offset), NSCollectionLayoutAnchorOffsetType.Fractional => _LayoutAnchorWithEdgesFractionalOffset (edges, offset), + _ => throw new ArgumentException (message: "Invalid enum value", paramName: nameof (offsetType)), }; } -} \ No newline at end of file +} From 20df742564413872a76048f6d2d57709d78aea27 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Tue, 22 Oct 2019 23:49:51 +0200 Subject: [PATCH 034/100] [Network] Cleanup the NWProtocolMetadata. (#7270) Co-Authored-By: Rolf Bjarne Kvinge --- src/Network/NWConnection.cs | 9 +++ src/Network/NWIPMetadata.cs | 42 +++++++++++++ src/Network/NWProtocolMetadata.cs | 63 ++++++++++++------- src/Network/NWTcpMetadata.cs | 25 ++++++++ src/Network/NWTlsMetadata.cs | 26 ++++++++ src/Network/NWUdpMetadata.cs | 25 ++++++++ src/frameworks.sources | 4 ++ .../Network/NWIPProtocolMetadataTest.cs | 62 ++++++++++++++++++ 8 files changed, 235 insertions(+), 21 deletions(-) create mode 100644 src/Network/NWIPMetadata.cs create mode 100644 src/Network/NWTcpMetadata.cs create mode 100644 src/Network/NWTlsMetadata.cs create mode 100644 src/Network/NWUdpMetadata.cs create mode 100644 tests/monotouch-test/Network/NWIPProtocolMetadataTest.cs diff --git a/src/Network/NWConnection.cs b/src/Network/NWConnection.cs index 6da39b3744..0d543681b2 100644 --- a/src/Network/NWConnection.cs +++ b/src/Network/NWConnection.cs @@ -560,6 +560,15 @@ namespace Network { return new NWProtocolMetadata (x, owns: true); } + public T GetProtocolMetadata (NWProtocolDefinition definition) where T : NWProtocolMetadata + { + if (definition == null) + throw new ArgumentNullException (nameof (definition)); + + var x = nw_connection_copy_protocol_metadata (GetCheckedHandle (), definition.Handle); + return Runtime.GetINativeObject (x, owns: true); + } + [DllImport (Constants.NetworkLibrary)] extern static /* uint32_t */ uint nw_connection_get_maximum_datagram_size (IntPtr handle); diff --git a/src/Network/NWIPMetadata.cs b/src/Network/NWIPMetadata.cs new file mode 100644 index 0000000000..97ac25de18 --- /dev/null +++ b/src/Network/NWIPMetadata.cs @@ -0,0 +1,42 @@ +// +// NWIPMetadata.cs: Bindings the Netowrk nw_protocol_metadata_t API that is an IP. +// +// Authors: +// Manuel de la Pena +// +// Copyrigh 2019 Microsoft +// +using System; +using ObjCRuntime; +using Foundation; +using CoreFoundation; + +namespace Network { + + [TV (12,0), Mac (10,14), iOS (12,0), Watch (6,0)] + public class NWIPMetadata : NWProtocolMetadata { + + internal NWIPMetadata (IntPtr handle, bool owns) : base (handle, owns) {} + + public NWIPMetadata () : this (nw_ip_create_metadata (), owns: true) {} + + public NWIPEcnFlag EcnFlag { + get => nw_ip_metadata_get_ecn_flag (GetCheckedHandle ()); + set => nw_ip_metadata_set_ecn_flag (GetCheckedHandle (), value); + } + + // A single tick represents one hundred nanoseconds, API returns: the time at which a packet was received, in nanoseconds + // so we get nanoseconds, divide by 100 and use from ticks + public TimeSpan ReceiveTime { + get { + var time = nw_ip_metadata_get_receive_time (GetCheckedHandle ()); + return TimeSpan.FromTicks ((long) time / 100); + } + } + + public NWServiceClass ServiceClass { + get => nw_ip_metadata_get_service_class (GetCheckedHandle ()); + set => nw_ip_metadata_set_service_class (GetCheckedHandle (), value); + } + } +} diff --git a/src/Network/NWProtocolMetadata.cs b/src/Network/NWProtocolMetadata.cs index e0e355a4f6..fe6df9fd57 100644 --- a/src/Network/NWProtocolMetadata.cs +++ b/src/Network/NWProtocolMetadata.cs @@ -40,53 +40,60 @@ namespace Network { public class NWProtocolMetadata : NativeObject { [DllImport (Constants.NetworkLibrary)] - static extern OS_nw_protocol_metadata nw_ip_create_metadata (); + internal static extern OS_nw_protocol_metadata nw_ip_create_metadata (); +#if !XAMCORE_4_0 + [Obsolete ("Use the 'NWIPMetadata' class and methods instead.")] public static NWProtocolMetadata CreateIPMetadata () { return new NWProtocolMetadata (nw_ip_create_metadata (), owns: true); } +#endif [DllImport (Constants.NetworkLibrary)] - static extern OS_nw_protocol_metadata nw_udp_create_metadata (); + internal static extern OS_nw_protocol_metadata nw_udp_create_metadata (); + +#if !XAMCORE_4_0 + [Obsolete ("Use the 'NSUdpMetadata' class and methods instead.")] public static NWProtocolMetadata CreateUdpMetadata () { return new NWProtocolMetadata (nw_udp_create_metadata (), owns: true); } +#endif public NWProtocolMetadata (IntPtr handle, bool owns) : base (handle, owns) {} [DllImport (Constants.NetworkLibrary)] - static extern OS_nw_protocol_definition nw_protocol_metadata_copy_definition (OS_nw_protocol_metadata metadata); + internal static extern OS_nw_protocol_definition nw_protocol_metadata_copy_definition (OS_nw_protocol_metadata metadata); public NWProtocolDefinition ProtocolDefinition => new NWProtocolDefinition (nw_protocol_metadata_copy_definition (GetCheckedHandle ()), owns: true); [DllImport (Constants.NetworkLibrary)] [return: MarshalAs (UnmanagedType.I1)] - static extern bool nw_protocol_metadata_is_ip (OS_nw_protocol_metadata metadata); + internal static extern bool nw_protocol_metadata_is_ip (OS_nw_protocol_metadata metadata); public bool IsIP => nw_protocol_metadata_is_ip (GetCheckedHandle ()); [DllImport (Constants.NetworkLibrary)] [return: MarshalAs (UnmanagedType.I1)] - static extern bool nw_protocol_metadata_is_udp (OS_nw_protocol_metadata metadata); + internal static extern bool nw_protocol_metadata_is_udp (OS_nw_protocol_metadata metadata); public bool IsUdp => nw_protocol_metadata_is_udp (GetCheckedHandle ()); [DllImport (Constants.NetworkLibrary)] [return: MarshalAs (UnmanagedType.I1)] - static extern bool nw_protocol_metadata_is_tls (OS_nw_protocol_metadata metadata); + internal static extern bool nw_protocol_metadata_is_tls (OS_nw_protocol_metadata metadata); public bool IsTls => nw_protocol_metadata_is_tls (GetCheckedHandle ()); [DllImport (Constants.NetworkLibrary)] [return: MarshalAs (UnmanagedType.I1)] - static extern bool nw_protocol_metadata_is_tcp (OS_nw_protocol_metadata metadata); + internal static extern bool nw_protocol_metadata_is_tcp (OS_nw_protocol_metadata metadata); public bool IsTcp => nw_protocol_metadata_is_tcp (GetCheckedHandle ()); [DllImport (Constants.NetworkLibrary)] - static extern IntPtr nw_tls_copy_sec_protocol_metadata (IntPtr handle); + internal static extern IntPtr nw_tls_copy_sec_protocol_metadata (IntPtr handle); void CheckIsIP () { @@ -107,23 +114,26 @@ namespace Network { } #if !XAMCORE_4_0 - [Obsolete ("Use 'TlsSecProtocolMetadata' instead.")] + [Obsolete ("Use the 'NWTlsMetadata' class and methods instead.")] public SecProtocolMetadata SecProtocolMetadata => TlsSecProtocolMetadata; -#endif + [Obsolete ("Use the 'NWTlsMetadata' class and methods instead.")] public SecProtocolMetadata TlsSecProtocolMetadata { get { CheckIsTls (); return new SecProtocolMetadata (nw_tls_copy_sec_protocol_metadata (GetCheckedHandle ()), owns: true); } } +#endif [DllImport (Constants.NetworkLibrary)] - static extern void nw_ip_metadata_set_ecn_flag (OS_nw_protocol_metadata metadata, NWIPEcnFlag ecn_flag); + internal static extern void nw_ip_metadata_set_ecn_flag (OS_nw_protocol_metadata metadata, NWIPEcnFlag ecn_flag); [DllImport (Constants.NetworkLibrary)] - static extern NWIPEcnFlag nw_ip_metadata_get_ecn_flag (OS_nw_protocol_metadata metadata); + internal static extern NWIPEcnFlag nw_ip_metadata_get_ecn_flag (OS_nw_protocol_metadata metadata); +#if !XAMCORE_4_0 + [Obsolete ("Use the 'NWIPMetadata' class and methods instead.")] public NWIPEcnFlag IPMetadataEcnFlag { get { CheckIsIP (); @@ -134,31 +144,35 @@ namespace Network { nw_ip_metadata_set_ecn_flag (GetCheckedHandle (), value); } } +#endif [DllImport (Constants.NetworkLibrary)] - static extern /* uint64_t */ ulong nw_ip_metadata_get_receive_time (OS_nw_protocol_metadata metadata); + internal static extern /* uint64_t */ ulong nw_ip_metadata_get_receive_time (OS_nw_protocol_metadata metadata); +#if !XAMCORE_4_0 + [Obsolete ("Use the 'NWIPMetadata' class and methods instead.")] public ulong IPMetadataReceiveTime { get { CheckIsIP (); return nw_ip_metadata_get_receive_time (GetCheckedHandle ()); } } +#endif [DllImport (Constants.NetworkLibrary)] - static extern void nw_ip_metadata_set_service_class (OS_nw_protocol_metadata metadata, NWServiceClass service_class); + internal static extern void nw_ip_metadata_set_service_class (OS_nw_protocol_metadata metadata, NWServiceClass service_class); [DllImport (Constants.NetworkLibrary)] - static extern NWServiceClass nw_ip_metadata_get_service_class (OS_nw_protocol_metadata metadata); + internal static extern NWServiceClass nw_ip_metadata_get_service_class (OS_nw_protocol_metadata metadata); #if !XAMCORE_4_0 - [Obsolete ("Use 'IPServiceClass' instead.")] + [Obsolete ("Use the 'NWIPMetadata' class and methods instead.")] public NWServiceClass ServiceClass { get => IPServiceClass; set => IPServiceClass = value; } -#endif + [Obsolete ("Use the 'NWIPMetadata' class and methods instead.")] public NWServiceClass IPServiceClass { get { CheckIsIP (); @@ -169,35 +183,42 @@ namespace Network { nw_ip_metadata_set_service_class (GetCheckedHandle (), value); } } +#endif [DllImport (Constants.NetworkLibrary)] - extern static /* uint32_t */ uint nw_tcp_get_available_receive_buffer (IntPtr handle); + internal extern static /* uint32_t */ uint nw_tcp_get_available_receive_buffer (IntPtr handle); +#if !XAMCORE_4_0 + [Obsolete ("Use the 'NWTcpMetadata' class and methods instead.")] public uint TcpGetAvailableReceiveBuffer () { CheckIsTcp (); return nw_tcp_get_available_receive_buffer (GetCheckedHandle ()); } +#endif [DllImport (Constants.NetworkLibrary)] - extern static /* uint32_t */ uint nw_tcp_get_available_send_buffer (IntPtr handle); + internal extern static /* uint32_t */ uint nw_tcp_get_available_send_buffer (IntPtr handle); +#if !XAMCORE_4_0 + [Obsolete ("Use the 'NWTcpMetadata' class and methods instead.")] public uint TcpGetAvailableSendBuffer () { CheckIsTcp (); return nw_tcp_get_available_send_buffer (GetCheckedHandle ()); } +#endif [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] [DllImport (Constants.NetworkLibrary)] - static extern bool nw_protocol_metadata_is_framer_message (OS_nw_protocol_metadata metadata); + internal static extern bool nw_protocol_metadata_is_framer_message (OS_nw_protocol_metadata metadata); [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] public bool IsFramerMessage => nw_protocol_metadata_is_framer_message (GetCheckedHandle ()); [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] [DllImport (Constants.NetworkLibrary)] - static extern bool nw_protocol_metadata_is_ws (OS_nw_protocol_metadata metadata); + internal static extern bool nw_protocol_metadata_is_ws (OS_nw_protocol_metadata metadata); [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] public bool IsWebSocket => nw_protocol_metadata_is_ws (GetCheckedHandle ()); diff --git a/src/Network/NWTcpMetadata.cs b/src/Network/NWTcpMetadata.cs new file mode 100644 index 0000000000..564e53b169 --- /dev/null +++ b/src/Network/NWTcpMetadata.cs @@ -0,0 +1,25 @@ +// +// NWTcpMetadata.cs: Bindings the Netowrk nw_protocol_metadata_t API that is an Tcp. +// +// Authors: +// Manuel de la Pena +// +// Copyrigh 2019 Microsoft +// +using System; +using ObjCRuntime; +using Foundation; +using CoreFoundation; + +namespace Network { + + [TV (12,0), Mac (10,14), iOS (12,0), Watch (6,0)] + public class NWTcpMetadata : NWProtocolMetadata { + + internal NWTcpMetadata (IntPtr handle, bool owns) : base (handle, owns) {} + + public uint AvailableReceiveBuffer => nw_tcp_get_available_receive_buffer (GetCheckedHandle ()); + + public uint AvailableSendBuffer => nw_tcp_get_available_send_buffer (GetCheckedHandle ()); + } +} diff --git a/src/Network/NWTlsMetadata.cs b/src/Network/NWTlsMetadata.cs new file mode 100644 index 0000000000..05ab1dee4a --- /dev/null +++ b/src/Network/NWTlsMetadata.cs @@ -0,0 +1,26 @@ +// +// NWTlsMetadata.cs: Bindings the Netowrk nw_protocol_metadata_t API that is an Tls. +// +// Authors: +// Manuel de la Pena +// +// Copyrigh 2019 Microsoft +// +using System; +using ObjCRuntime; +using Foundation; +using Security; +using CoreFoundation; + +namespace Network { + + [TV (12,0), Mac (10,14), iOS (12,0), Watch (6,0)] + public class NWTlsMetadata : NWProtocolMetadata { + + internal NWTlsMetadata (IntPtr handle, bool owns) : base (handle, owns) {} + + public SecProtocolMetadata SecProtocolMetadata + => new SecProtocolMetadata (nw_tls_copy_sec_protocol_metadata (GetCheckedHandle ()), owns: true); + + } +} diff --git a/src/Network/NWUdpMetadata.cs b/src/Network/NWUdpMetadata.cs new file mode 100644 index 0000000000..e94ac06e80 --- /dev/null +++ b/src/Network/NWUdpMetadata.cs @@ -0,0 +1,25 @@ +// +// NWUdpMetadata.cs: Bindings the Netowrk nw_protocol_metadata_t API that is an Udp. +// +// Authors: +// Manuel de la Pena +// +// Copyrigh 2019 Microsoft +// +using System; +using ObjCRuntime; +using Foundation; +using Security; +using CoreFoundation; + +namespace Network { + + [TV (12,0), Mac (10,14), iOS (12,0), Watch (6,0)] + public class NWUdpMetadata : NWProtocolMetadata { + + internal NWUdpMetadata (IntPtr handle, bool owns) : base (handle, owns) {} + + public NWUdpMetadata () : this (nw_udp_create_metadata (), owns: true) {} + } +} + diff --git a/src/frameworks.sources b/src/frameworks.sources index ff8df1a72a..c643c6fa8e 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -1178,6 +1178,7 @@ NETWORK_SOURCES = \ Network/NWError.cs \ Network/NWFramer.cs \ Network/NWInterface.cs \ + Network/NWIPMetadata.cs \ Network/NWListener.cs \ Network/NWProtocolIPOptions.cs \ Network/NWParameters.cs \ @@ -1187,10 +1188,13 @@ NETWORK_SOURCES = \ Network/NWProtocolMetadata.cs \ Network/NWProtocolOptions.cs \ Network/NWProtocolStack.cs \ + Network/NWTcpMetadata.cs \ + Network/NWTlsMetadata.cs \ Network/NWTxtRecord.cs \ Network/NWProtocolTcpOptions.cs \ Network/NWProtocolTlsOptions.cs \ Network/NWProtocolUdpOptions.cs \ + Network/NWUdpMetadata.cs \ Network/NWWebSocketMetadata.cs \ Network/NWWebSocketOptions.cs \ Network/NWWebSocketRequest.cs \ diff --git a/tests/monotouch-test/Network/NWIPProtocolMetadataTest.cs b/tests/monotouch-test/Network/NWIPProtocolMetadataTest.cs new file mode 100644 index 0000000000..92f4008674 --- /dev/null +++ b/tests/monotouch-test/Network/NWIPProtocolMetadataTest.cs @@ -0,0 +1,62 @@ +#if !__WATCHOS__ +using System; +using Foundation; +using Network; +using ObjCRuntime; + +using NUnit.Framework; + +namespace MonoTouchFixtures.Network { + + [TestFixture] + [Preserve (AllMembers = true)] + public class NWIPProtocolMetadataTest { + NWIPMetadata metadata; + + [TestFixtureSetUp] + public void Init () => TestRuntime.AssertXcodeVersion (10, 0); + + [SetUp] + public void SetUp () + { + metadata = new NWIPMetadata (); + } + + [TearDown] + public void TearDown () + { + metadata.Dispose (); + } + + [Test] + public void TestEcnFlagProperty () + { + Assert.That (metadata.EcnFlag, Is.EqualTo (NWIPEcnFlag.NonEct), "default value"); + metadata.EcnFlag = NWIPEcnFlag.Ect1; + Assert.That (metadata.EcnFlag, Is.EqualTo (NWIPEcnFlag.Ect1), "new value"); + } + + [Test] + public void TestServiceClassProperty () + { + Assert.That (metadata.ServiceClass, Is.EqualTo (NWServiceClass.BestEffort), "default value"); + metadata.ServiceClass = NWServiceClass.InteractiveVideo; + Assert.That (metadata.ServiceClass, Is.EqualTo (NWServiceClass.InteractiveVideo), "new value"); + } + + [Test] + public void TestReceiveTimeProperty () + { + Assert.That (metadata.ReceiveTime, Is.EqualTo (TimeSpan.Zero), "default value"); + } + + [Test] + public void TestMetadataType () + { + Assert.True (metadata.IsIP, "IsIP"); + Assert.False (metadata.IsTcp, "IsTcp"); + Assert.False (metadata.IsUdp, "IsUdp"); + } + } +} +#endif From fbf33357abd11f6c4274c1dd5465526a9029e3e3 Mon Sep 17 00:00:00 2001 From: Pramit Mallick Date: Wed, 23 Oct 2019 10:15:33 -0400 Subject: [PATCH 035/100] [Appkit] Bindings - part 3 (#7261) * added NSCollectionLayoutSupplementaryItem + NSCollectionLayoutItem * added NSCollectionLayoutBoundarySupplementaryItem + NSCollectionLayoutDecorationItem * added NSCollectionLayoutGroupCustomItem + NSCollectionViewCompositionalLayoutConfiguration * added NSColorSampler + NSSwitch * added NSCollectionLayoutGroup * merge conflict resolve in todo * merge * merge * merge * added NSCollectionViewCompositionalLayout * added NSStepperTouchBarItem * removed DesignatedInitializer and added cases to ApiCtorInitTest * ready for PR * addressed reviews * added [DisableDefaultCtor] --- src/appkit.cs | 368 +++++++++++++++++++++++++ tests/introspection/ApiCtorInitTest.cs | 9 +- tests/xtro-sharpie/macOS-AppKit.todo | 108 -------- 3 files changed, 376 insertions(+), 109 deletions(-) diff --git a/src/appkit.cs b/src/appkit.cs index 5a3525938c..946e279ee0 100644 --- a/src/appkit.cs +++ b/src/appkit.cs @@ -27059,4 +27059,372 @@ namespace AppKit { [NullAllowed, Export ("bottom")] NSCollectionLayoutSpacing Bottom { get; } } + + [Mac (10,15)] + [BaseType (typeof (NSCollectionLayoutItem))] + [DisableDefaultCtor] + interface NSCollectionLayoutSupplementaryItem : NSCopying + { + [Static] + [Export ("supplementaryItemWithLayoutSize:elementKind:containerAnchor:")] + NSCollectionLayoutSupplementaryItem Create (NSCollectionLayoutSize layoutSize, string elementKind, NSCollectionLayoutAnchor containerAnchor); + + [Static] + [Export ("supplementaryItemWithLayoutSize:elementKind:containerAnchor:itemAnchor:")] + NSCollectionLayoutSupplementaryItem Create (NSCollectionLayoutSize layoutSize, string elementKind, NSCollectionLayoutAnchor containerAnchor, NSCollectionLayoutAnchor itemAnchor); + + [Export ("zIndex")] + nint ZIndex { get; set; } + + [Export ("elementKind")] + string ElementKind { get; } + + [Export ("containerAnchor")] + NSCollectionLayoutAnchor ContainerAnchor { get; } + + [NullAllowed, Export ("itemAnchor")] + NSCollectionLayoutAnchor ItemAnchor { get; } + } + + [Mac (10,15)] + [BaseType (typeof (NSObject))] + [DisableDefaultCtor] + interface NSCollectionLayoutItem : NSCopying + { + [Static] + [Export ("itemWithLayoutSize:")] + NSCollectionLayoutItem Create (NSCollectionLayoutSize layoutSize); + + [Static] + [Export ("itemWithLayoutSize:supplementaryItems:")] + NSCollectionLayoutItem Create (NSCollectionLayoutSize layoutSize, NSCollectionLayoutSupplementaryItem[] supplementaryItems); + + [Export ("contentInsets", ArgumentSemantic.Assign)] + NSDirectionalEdgeInsets ContentInsets { get; set; } + + [NullAllowed, Export ("edgeSpacing", ArgumentSemantic.Copy)] + NSCollectionLayoutEdgeSpacing EdgeSpacing { get; set; } + + [Export ("layoutSize")] + NSCollectionLayoutSize LayoutSize { get; } + + [Export ("supplementaryItems")] + NSCollectionLayoutSupplementaryItem[] SupplementaryItems { get; } + } + + [Mac (10,15)] + [BaseType (typeof (NSCollectionLayoutSupplementaryItem))] + [DisableDefaultCtor] + interface NSCollectionLayoutBoundarySupplementaryItem : NSCopying + { + [Static] + [Export ("boundarySupplementaryItemWithLayoutSize:elementKind:alignment:")] + NSCollectionLayoutBoundarySupplementaryItem Create (NSCollectionLayoutSize layoutSize, string elementKind, NSRectAlignment alignment); + + [Static] + [Export ("boundarySupplementaryItemWithLayoutSize:elementKind:alignment:absoluteOffset:")] + NSCollectionLayoutBoundarySupplementaryItem Create (NSCollectionLayoutSize layoutSize, string elementKind, NSRectAlignment alignment, CGPoint absoluteOffset); + + [Export ("extendsBoundary")] + bool ExtendsBoundary { get; set; } + + [Export ("pinToVisibleBounds")] + bool PinToVisibleBounds { get; set; } + + [Export ("alignment")] + NSRectAlignment Alignment { get; } + + [Export ("offset")] + CGPoint Offset { get; } + } + + [Mac (10,15)] + [BaseType (typeof (NSCollectionLayoutItem))] + [DisableDefaultCtor] + interface NSCollectionLayoutDecorationItem : NSCopying + { + [Static] + [Export ("backgroundDecorationItemWithElementKind:")] + NSCollectionLayoutDecorationItem Create (string elementKind); + + [Export ("zIndex")] + nint ZIndex { get; set; } + + [Export ("elementKind")] + string ElementKind { get; } + } + + [Mac (10,15)] + [BaseType (typeof (NSObject))] + [DisableDefaultCtor] + interface NSCollectionLayoutGroupCustomItem : NSCopying + { + [Static] + [Export ("customItemWithFrame:")] + NSCollectionLayoutGroupCustomItem Create (CGRect frame); + + [Static] + [Export ("customItemWithFrame:zIndex:")] + NSCollectionLayoutGroupCustomItem Create (CGRect frame, nint zIndex); + + [Export ("frame")] + CGRect Frame { get; } + + [Export ("zIndex")] + nint ZIndex { get; } + } + + [Mac (10,15)] + [BaseType (typeof (NSObject))] + interface NSCollectionViewCompositionalLayoutConfiguration : NSCopying + { + [Export ("scrollDirection", ArgumentSemantic.Assign)] + NSCollectionViewScrollDirection ScrollDirection { get; set; } + + [Export ("interSectionSpacing")] + nfloat InterSectionSpacing { get; set; } + + [Export ("boundarySupplementaryItems", ArgumentSemantic.Copy)] + NSCollectionLayoutBoundarySupplementaryItem[] BoundarySupplementaryItems { get; set; } + } + + [Mac (10,15)] + [BaseType (typeof (NSObject))] + interface NSColorSampler + { + [Export ("showSamplerWithSelectionHandler:")] + void ShowSampler (Action selectionHandler); + } + + [Mac (10,15)] + [BaseType (typeof (NSControl))] + [DesignatedDefaultCtor] + interface NSSwitch : NSAccessibilitySwitch + { + [Export ("state")] + nint State { get; set; } + } + + interface INSCollectionLayoutContainer { } + + [Mac (10,15)] + [Protocol] + interface NSCollectionLayoutContainer + { + [Abstract] + [Export ("contentSize")] + CGSize ContentSize { get; } + + [Abstract] + [Export ("effectiveContentSize")] + CGSize EffectiveContentSize { get; } + + [Abstract] + [Export ("contentInsets")] + NSDirectionalEdgeInsets ContentInsets { get; } + + [Abstract] + [Export ("effectiveContentInsets")] + NSDirectionalEdgeInsets EffectiveContentInsets { get; } + } + + [Mac (10,15)] + [Protocol] + interface NSCollectionLayoutEnvironment + { + [Abstract] + [Export ("container")] + INSCollectionLayoutContainer Container { get; } + } + + interface INSCollectionLayoutEnvironment { } + + delegate NSCollectionLayoutGroupCustomItem[] NSCollectionLayoutGroupCustomItemProvider (INSCollectionLayoutEnvironment layout); + + [Mac (10,15)] + [BaseType (typeof (NSCollectionLayoutItem))] + [DisableDefaultCtor] + interface NSCollectionLayoutGroup : NSCopying + { + [Static] + [Export ("horizontalGroupWithLayoutSize:subitem:count:")] + NSCollectionLayoutGroup CreateHorizontalGroup (NSCollectionLayoutSize layoutSize, NSCollectionLayoutItem subitem, nint count); + + [Static] + [Export ("horizontalGroupWithLayoutSize:subitems:")] + NSCollectionLayoutGroup CreateHorizontalGroup (NSCollectionLayoutSize layoutSize, NSCollectionLayoutItem[] subitems); + + [Static] + [Export ("verticalGroupWithLayoutSize:subitem:count:")] + NSCollectionLayoutGroup CreateVerticalGroup (NSCollectionLayoutSize layoutSize, NSCollectionLayoutItem subitem, nint count); + + [Static] + [Export ("verticalGroupWithLayoutSize:subitems:")] + NSCollectionLayoutGroup CreateVerticalGroup (NSCollectionLayoutSize layoutSize, NSCollectionLayoutItem[] subitems); + + [Static] + [Export ("customGroupWithLayoutSize:itemProvider:")] + NSCollectionLayoutGroup CreateCustomGroup (NSCollectionLayoutSize layoutSize, NSCollectionLayoutGroupCustomItemProvider itemProvider); + + [Export ("supplementaryItems", ArgumentSemantic.Copy)] + NSCollectionLayoutSupplementaryItem[] SupplementaryItems { get; set; } + + [NullAllowed, Export ("interItemSpacing", ArgumentSemantic.Copy)] + NSCollectionLayoutSpacing InterItemSpacing { get; set; } + + [Export ("subitems")] + NSCollectionLayoutItem[] Subitems { get; } + + [Export ("visualDescription")] + string VisualDescription { get; } + } + + [Mac (10,15)] + [BaseType (typeof (NSToolbarItem))] + interface NSMenuToolbarItem + { + [Export ("menu", ArgumentSemantic.Strong)] + NSMenu Menu { get; set; } + + [Export ("showsIndicator")] + bool ShowsIndicator { get; set; } + } + + [Mac (10,15)] + [Protocol] + interface NSCollectionLayoutVisibleItem + { + [Abstract] + [Export ("alpha")] + nfloat Alpha { get; set; } + + [Abstract] + [Export ("zIndex")] + nint ZIndex { get; set; } + + [Abstract] + [Export ("hidden")] + bool Hidden { [Bind ("isHidden")] get; set; } + + [Abstract] + [Export ("center", ArgumentSemantic.Assign)] + CGPoint Center { get; set; } + + [Abstract] + [Export ("name")] + string Name { get; } + + [Abstract] + [Export ("indexPath")] + NSIndexPath IndexPath { get; } + + [Abstract] + [Export ("frame")] + CGRect Frame { get; } + + [Abstract] + [Export ("bounds")] + CGRect Bounds { get; } + + [Abstract] + [Export ("representedElementCategory")] + NSCollectionElementCategory RepresentedElementCategory { get; } + + [Abstract] + [NullAllowed, Export ("representedElementKind")] + string RepresentedElementKind { get; } + } + + interface INSCollectionLayoutVisibleItem { } + + delegate void NSCollectionLayoutSectionVisibleItemsInvalidationHandler (INSCollectionLayoutVisibleItem[] items, CGPoint point, INSCollectionLayoutEnvironment layout); + + [Mac (10,15)] + [BaseType (typeof (NSObject))] + [DisableDefaultCtor] + interface NSCollectionLayoutSection : NSCopying + { + [Static] + [Export ("sectionWithGroup:")] + NSCollectionLayoutSection Create (NSCollectionLayoutGroup group); + + [Export ("contentInsets", ArgumentSemantic.Assign)] + NSDirectionalEdgeInsets ContentInsets { get; set; } + + [Export ("interGroupSpacing")] + nfloat InterGroupSpacing { get; set; } + + [Export ("orthogonalScrollingBehavior", ArgumentSemantic.Assign)] + NSCollectionLayoutSectionOrthogonalScrollingBehavior OrthogonalScrollingBehavior { get; set; } + + [Export ("boundarySupplementaryItems", ArgumentSemantic.Copy)] + NSCollectionLayoutBoundarySupplementaryItem[] BoundarySupplementaryItems { get; set; } + + [Export ("supplementariesFollowContentInsets")] + bool SupplementariesFollowContentInsets { get; set; } + + [NullAllowed, Export ("visibleItemsInvalidationHandler", ArgumentSemantic.Copy)] + NSCollectionLayoutSectionVisibleItemsInvalidationHandler VisibleItemsInvalidationHandler { get; set; } + + [Export ("decorationItems", ArgumentSemantic.Copy)] + NSCollectionLayoutDecorationItem[] DecorationItems { get; set; } + } + + delegate NSCollectionLayoutSection NSCollectionViewCompositionalLayoutSectionProvider (nint section, INSCollectionLayoutEnvironment layout); + + [Mac (10,15)] + [BaseType (typeof (NSCollectionViewLayout))] + [DisableDefaultCtor] + interface NSCollectionViewCompositionalLayout + { + [Export ("initWithSection:")] + IntPtr Constructor (NSCollectionLayoutSection section); + + [Export ("initWithSection:configuration:")] + IntPtr Constructor (NSCollectionLayoutSection section, NSCollectionViewCompositionalLayoutConfiguration configuration); + + [Export ("initWithSectionProvider:")] + IntPtr Constructor (NSCollectionViewCompositionalLayoutSectionProvider sectionProvider); + + [Export ("initWithSectionProvider:configuration:")] + IntPtr Constructor (NSCollectionViewCompositionalLayoutSectionProvider sectionProvider, NSCollectionViewCompositionalLayoutConfiguration configuration); + + [Export ("configuration", ArgumentSemantic.Copy)] + NSCollectionViewCompositionalLayoutConfiguration Configuration { get; set; } + } + + [Mac (10,15)] + [BaseType (typeof (NSTouchBarItem))] + [DisableDefaultCtor] + interface NSStepperTouchBarItem + { + [Static] + [Export ("stepperTouchBarItemWithIdentifier:formatter:")] + NSStepperTouchBarItem Create (NSTouchBarItemIdentifier identifier, NSFormatter formatter); + + [Static] + [Export ("stepperTouchBarItemWithIdentifier:drawingHandler:")] + NSStepperTouchBarItem Create (NSTouchBarItemIdentifier identifier, Action drawingHandler); + + [Export ("maxValue")] + double MaxValue { get; set; } + + [Export ("minValue")] + double MinValue { get; set; } + + [Export ("increment")] + double Increment { get; set; } + + [Export ("value")] + double Value { get; set; } + + [NullAllowed, Export ("target", ArgumentSemantic.Weak)] + NSObject Target { get; set; } + + [NullAllowed, Export ("action", ArgumentSemantic.Assign)] + Selector Action { get; set; } + + [Export ("customizationLabel")] + string CustomizationLabel { get; set; } + } } diff --git a/tests/introspection/ApiCtorInitTest.cs b/tests/introspection/ApiCtorInitTest.cs index e40576959f..306581cd22 100644 --- a/tests/introspection/ApiCtorInitTest.cs +++ b/tests/introspection/ApiCtorInitTest.cs @@ -481,7 +481,14 @@ namespace Introspection { if (ctor.ToString () == $"Void .ctor(System.String)") return true; break; - + case "NSMenuToolbarItem": // No ctor specified + if (ctor.ToString () == $"Void .ctor(System.String)") + return true; + break; + case "NSStepperTouchBarItem": // You are meant to use the static factory methods + if (ctor.ToString () == $"Void .ctor(System.String)") + return true; + break; } var ep = ctor.GetParameters (); diff --git a/tests/xtro-sharpie/macOS-AppKit.todo b/tests/xtro-sharpie/macOS-AppKit.todo index dfb54ff2ef..d76a107c93 100644 --- a/tests/xtro-sharpie/macOS-AppKit.todo +++ b/tests/xtro-sharpie/macOS-AppKit.todo @@ -2,9 +2,6 @@ !missing-field! NSFontDescriptorSystemDesignMonospaced not bound !missing-field! NSFontDescriptorSystemDesignRounded not bound !missing-field! NSFontDescriptorSystemDesignSerif not bound -!missing-protocol! NSCollectionLayoutContainer not bound -!missing-protocol! NSCollectionLayoutEnvironment not bound -!missing-protocol! NSCollectionLayoutVisibleItem not bound !missing-protocol! NSTextCheckingClient not bound !missing-protocol! NSTextInputTraits not bound !missing-protocol-conformance! NSTextAlternatives should conform to NSSecureCoding @@ -13,84 +10,13 @@ !missing-protocol-conformance! NSTextList should conform to NSSecureCoding !missing-selector! +NSBindingSelectionMarker::defaultPlaceholderForMarker:onClass:withBinding: not bound !missing-selector! +NSBindingSelectionMarker::setDefaultPlaceholder:forMarker:onClass:withBinding: not bound -!missing-selector! +NSCollectionLayoutBoundarySupplementaryItem::boundarySupplementaryItemWithLayoutSize:elementKind:alignment: not bound -!missing-selector! +NSCollectionLayoutBoundarySupplementaryItem::boundarySupplementaryItemWithLayoutSize:elementKind:alignment:absoluteOffset: not bound -!missing-selector! +NSCollectionLayoutDecorationItem::backgroundDecorationItemWithElementKind: not bound -!missing-selector! +NSCollectionLayoutGroup::customGroupWithLayoutSize:itemProvider: not bound -!missing-selector! +NSCollectionLayoutGroup::horizontalGroupWithLayoutSize:subitem:count: not bound -!missing-selector! +NSCollectionLayoutGroup::horizontalGroupWithLayoutSize:subitems: not bound -!missing-selector! +NSCollectionLayoutGroup::verticalGroupWithLayoutSize:subitem:count: not bound -!missing-selector! +NSCollectionLayoutGroup::verticalGroupWithLayoutSize:subitems: not bound -!missing-selector! +NSCollectionLayoutGroupCustomItem::customItemWithFrame: not bound -!missing-selector! +NSCollectionLayoutGroupCustomItem::customItemWithFrame:zIndex: not bound -!missing-selector! +NSCollectionLayoutItem::itemWithLayoutSize: not bound -!missing-selector! +NSCollectionLayoutItem::itemWithLayoutSize:supplementaryItems: not bound -!missing-selector! +NSCollectionLayoutSection::sectionWithGroup: not bound -!missing-selector! +NSCollectionLayoutSupplementaryItem::supplementaryItemWithLayoutSize:elementKind:containerAnchor: not bound -!missing-selector! +NSCollectionLayoutSupplementaryItem::supplementaryItemWithLayoutSize:elementKind:containerAnchor:itemAnchor: not bound !missing-selector! +NSColor::colorWithName:dynamicProvider: not bound !missing-selector! +NSColor::systemIndigoColor not bound !missing-selector! +NSColor::systemTealColor not bound !missing-selector! +NSFont::monospacedSystemFontOfSize:weight: not bound -!missing-selector! +NSStepperTouchBarItem::stepperTouchBarItemWithIdentifier:drawingHandler: not bound -!missing-selector! +NSStepperTouchBarItem::stepperTouchBarItemWithIdentifier:formatter: not bound !missing-selector! +NSToolbarItemGroup::groupWithItemIdentifier:images:selectionMode:labels:target:action: not bound !missing-selector! +NSToolbarItemGroup::groupWithItemIdentifier:titles:selectionMode:labels:target:action: not bound !missing-selector! +NSWorkspaceOpenConfiguration::configuration not bound -!missing-selector! NSCollectionLayoutBoundarySupplementaryItem::alignment not bound -!missing-selector! NSCollectionLayoutBoundarySupplementaryItem::extendsBoundary not bound -!missing-selector! NSCollectionLayoutBoundarySupplementaryItem::offset not bound -!missing-selector! NSCollectionLayoutBoundarySupplementaryItem::pinToVisibleBounds not bound -!missing-selector! NSCollectionLayoutBoundarySupplementaryItem::setExtendsBoundary: not bound -!missing-selector! NSCollectionLayoutBoundarySupplementaryItem::setPinToVisibleBounds: not bound -!missing-selector! NSCollectionLayoutDecorationItem::elementKind not bound -!missing-selector! NSCollectionLayoutDecorationItem::setZIndex: not bound -!missing-selector! NSCollectionLayoutDecorationItem::zIndex not bound -!missing-selector! NSCollectionLayoutGroup::interItemSpacing not bound -!missing-selector! NSCollectionLayoutGroup::setInterItemSpacing: not bound -!missing-selector! NSCollectionLayoutGroup::setSupplementaryItems: not bound -!missing-selector! NSCollectionLayoutGroup::subitems not bound -!missing-selector! NSCollectionLayoutGroup::supplementaryItems not bound -!missing-selector! NSCollectionLayoutGroup::visualDescription not bound -!missing-selector! NSCollectionLayoutGroupCustomItem::frame not bound -!missing-selector! NSCollectionLayoutGroupCustomItem::zIndex not bound -!missing-selector! NSCollectionLayoutItem::contentInsets not bound -!missing-selector! NSCollectionLayoutItem::edgeSpacing not bound -!missing-selector! NSCollectionLayoutItem::layoutSize not bound -!missing-selector! NSCollectionLayoutItem::setContentInsets: not bound -!missing-selector! NSCollectionLayoutItem::setEdgeSpacing: not bound -!missing-selector! NSCollectionLayoutItem::supplementaryItems not bound -!missing-selector! NSCollectionLayoutSection::boundarySupplementaryItems not bound -!missing-selector! NSCollectionLayoutSection::contentInsets not bound -!missing-selector! NSCollectionLayoutSection::decorationItems not bound -!missing-selector! NSCollectionLayoutSection::interGroupSpacing not bound -!missing-selector! NSCollectionLayoutSection::orthogonalScrollingBehavior not bound -!missing-selector! NSCollectionLayoutSection::setBoundarySupplementaryItems: not bound -!missing-selector! NSCollectionLayoutSection::setContentInsets: not bound -!missing-selector! NSCollectionLayoutSection::setDecorationItems: not bound -!missing-selector! NSCollectionLayoutSection::setInterGroupSpacing: not bound -!missing-selector! NSCollectionLayoutSection::setOrthogonalScrollingBehavior: not bound -!missing-selector! NSCollectionLayoutSection::setSupplementariesFollowContentInsets: not bound -!missing-selector! NSCollectionLayoutSection::setVisibleItemsInvalidationHandler: not bound -!missing-selector! NSCollectionLayoutSection::supplementariesFollowContentInsets not bound -!missing-selector! NSCollectionLayoutSection::visibleItemsInvalidationHandler not bound -!missing-selector! NSCollectionLayoutSupplementaryItem::containerAnchor not bound -!missing-selector! NSCollectionLayoutSupplementaryItem::elementKind not bound -!missing-selector! NSCollectionLayoutSupplementaryItem::itemAnchor not bound -!missing-selector! NSCollectionLayoutSupplementaryItem::setZIndex: not bound -!missing-selector! NSCollectionLayoutSupplementaryItem::zIndex not bound -!missing-selector! NSCollectionViewCompositionalLayout::configuration not bound -!missing-selector! NSCollectionViewCompositionalLayout::initWithSection: not bound -!missing-selector! NSCollectionViewCompositionalLayout::initWithSection:configuration: not bound -!missing-selector! NSCollectionViewCompositionalLayout::initWithSectionProvider: not bound -!missing-selector! NSCollectionViewCompositionalLayout::initWithSectionProvider:configuration: not bound -!missing-selector! NSCollectionViewCompositionalLayout::setConfiguration: not bound -!missing-selector! NSCollectionViewCompositionalLayoutConfiguration::boundarySupplementaryItems not bound -!missing-selector! NSCollectionViewCompositionalLayoutConfiguration::interSectionSpacing not bound -!missing-selector! NSCollectionViewCompositionalLayoutConfiguration::scrollDirection not bound -!missing-selector! NSCollectionViewCompositionalLayoutConfiguration::setBoundarySupplementaryItems: not bound -!missing-selector! NSCollectionViewCompositionalLayoutConfiguration::setInterSectionSpacing: not bound -!missing-selector! NSCollectionViewCompositionalLayoutConfiguration::setScrollDirection: not bound !missing-selector! NSCollectionViewDiffableDataSource::applySnapshot:animatingDifferences: not bound !missing-selector! NSCollectionViewDiffableDataSource::indexPathForItemIdentifier: not bound !missing-selector! NSCollectionViewDiffableDataSource::initWithCollectionView:itemProvider: not bound @@ -98,7 +24,6 @@ !missing-selector! NSCollectionViewDiffableDataSource::setSupplementaryViewProvider: not bound !missing-selector! NSCollectionViewDiffableDataSource::snapshot not bound !missing-selector! NSCollectionViewDiffableDataSource::supplementaryViewProvider not bound -!missing-selector! NSColorSampler::showSamplerWithSelectionHandler: not bound !missing-selector! NSDiffableDataSourceSnapshot::appendItemsWithIdentifiers: not bound !missing-selector! NSDiffableDataSourceSnapshot::appendItemsWithIdentifiers:intoSectionWithIdentifier: not bound !missing-selector! NSDiffableDataSourceSnapshot::appendSectionsWithIdentifiers: not bound @@ -126,10 +51,6 @@ !missing-selector! NSDiffableDataSourceSnapshot::sectionIdentifiers not bound !missing-selector! NSEvent::charactersByApplyingModifiers: not bound !missing-selector! NSFontDescriptor::fontDescriptorWithDesign: not bound -!missing-selector! NSMenuToolbarItem::menu not bound -!missing-selector! NSMenuToolbarItem::setMenu: not bound -!missing-selector! NSMenuToolbarItem::setShowsIndicator: not bound -!missing-selector! NSMenuToolbarItem::showsIndicator not bound !missing-selector! NSMovie::init not bound !missing-selector! NSMovie::initWithCoder: not bound !missing-selector! NSResponder::changeModeWithEvent: not bound @@ -142,24 +63,8 @@ !missing-selector! NSSliderTouchBarItem::setDoubleValue: not bound !missing-selector! NSSliderTouchBarItem::setMaximumSliderWidth: not bound !missing-selector! NSSliderTouchBarItem::setMinimumSliderWidth: not bound -!missing-selector! NSStepperTouchBarItem::action not bound -!missing-selector! NSStepperTouchBarItem::customizationLabel not bound -!missing-selector! NSStepperTouchBarItem::increment not bound -!missing-selector! NSStepperTouchBarItem::maxValue not bound -!missing-selector! NSStepperTouchBarItem::minValue not bound -!missing-selector! NSStepperTouchBarItem::setAction: not bound -!missing-selector! NSStepperTouchBarItem::setCustomizationLabel: not bound -!missing-selector! NSStepperTouchBarItem::setIncrement: not bound -!missing-selector! NSStepperTouchBarItem::setMaxValue: not bound -!missing-selector! NSStepperTouchBarItem::setMinValue: not bound -!missing-selector! NSStepperTouchBarItem::setTarget: not bound -!missing-selector! NSStepperTouchBarItem::setValue: not bound -!missing-selector! NSStepperTouchBarItem::target not bound -!missing-selector! NSStepperTouchBarItem::value not bound !missing-selector! NSStoryboard::instantiateControllerWithIdentifier:creator: not bound !missing-selector! NSStoryboard::instantiateInitialControllerWithCreator: not bound -!missing-selector! NSSwitch::setState: not bound -!missing-selector! NSSwitch::state not bound !missing-selector! NSTextCheckingController::changeSpelling: not bound !missing-selector! NSTextCheckingController::checkSpelling: not bound !missing-selector! NSTextCheckingController::checkTextInDocument: not bound @@ -225,21 +130,8 @@ !missing-selector! NSWorkspaceOpenConfiguration::setHidesOthers: not bound !missing-selector! NSWorkspaceOpenConfiguration::setPromptsUserIfNeeded: not bound !missing-selector! NSWorkspaceOpenConfiguration::setRequiresUniversalLinks: not bound -!missing-type! NSCollectionLayoutBoundarySupplementaryItem not bound -!missing-type! NSCollectionLayoutDecorationItem not bound -!missing-type! NSCollectionLayoutGroup not bound -!missing-type! NSCollectionLayoutGroupCustomItem not bound -!missing-type! NSCollectionLayoutItem not bound -!missing-type! NSCollectionLayoutSection not bound -!missing-type! NSCollectionLayoutSupplementaryItem not bound -!missing-type! NSCollectionViewCompositionalLayout not bound -!missing-type! NSCollectionViewCompositionalLayoutConfiguration not bound !missing-type! NSCollectionViewDiffableDataSource not bound -!missing-type! NSColorSampler not bound !missing-type! NSDiffableDataSourceSnapshot not bound -!missing-type! NSMenuToolbarItem not bound -!missing-type! NSStepperTouchBarItem not bound -!missing-type! NSSwitch not bound !missing-type! NSTextCheckingController not bound !missing-type! NSWorkspaceOpenConfiguration not bound !missing-protocol! NSSharingServicePickerToolbarItemDelegate not bound From c52a59358f681dcad0b738a44e731033617a539d Mon Sep 17 00:00:00 2001 From: Waleed Chaudhry <54864665+wachaudh@users.noreply.github.com> Date: Wed, 23 Oct 2019 15:12:19 -0400 Subject: [PATCH 036/100] [UIKit] Add UIKit bindings for xcode11.2b2 (#7290) --- src/uikit.cs | 14 ++++++++++++++ tests/xtro-sharpie/iOS-UIKit.todo | 5 ----- tests/xtro-sharpie/tvOS-UIKit.todo | 5 ----- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/uikit.cs b/src/uikit.cs index 09051e99d6..4949349f58 100644 --- a/src/uikit.cs +++ b/src/uikit.cs @@ -3437,12 +3437,26 @@ namespace UIKit { [Export ("application:viewControllerWithRestorationIdentifierPath:coder:")] UIViewController GetViewController (UIApplication application, string [] restorationIdentifierComponents, NSCoder coder); + [Deprecated (PlatformName.iOS, 13, 2, message: "Use 'ShouldSaveSecureApplicationState' instead.")] + [Deprecated (PlatformName.TvOS, 13, 2, message: "Use 'ShouldSaveSecureApplicationState' instead.")] [Export ("application:shouldSaveApplicationState:")] bool ShouldSaveApplicationState (UIApplication application, NSCoder coder); + [iOS (13,2)] + [TV (13,2)] + [Export ("application:shouldSaveSecureApplicationState:")] + bool ShouldSaveSecureApplicationState (UIApplication application, NSCoder coder); + + [Deprecated (PlatformName.iOS, 13, 2, message: "Use 'ShouldRestoreSecureApplicationState' instead.")] + [Deprecated (PlatformName.TvOS, 13, 2, message: "Use 'ShouldRestoreSecureApplicationState' instead.")] [Export ("application:shouldRestoreApplicationState:")] bool ShouldRestoreApplicationState (UIApplication application, NSCoder coder); + [iOS (13,2)] + [TV (13,2)] + [Export ("application:shouldRestoreSecureApplicationState:")] + bool ShouldRestoreSecureApplicationState (UIApplication application, NSCoder coder); + [Export ("application:willEncodeRestorableStateWithCoder:")] void WillEncodeRestorableState (UIApplication application, NSCoder coder); diff --git a/tests/xtro-sharpie/iOS-UIKit.todo b/tests/xtro-sharpie/iOS-UIKit.todo index 94e1a4e455..e69de29bb2 100644 --- a/tests/xtro-sharpie/iOS-UIKit.todo +++ b/tests/xtro-sharpie/iOS-UIKit.todo @@ -1,5 +0,0 @@ -## appended from unclassified file -!deprecated-attribute-missing! UIApplicationDelegate::application:shouldRestoreApplicationState: missing a [Deprecated] attribute -!deprecated-attribute-missing! UIApplicationDelegate::application:shouldSaveApplicationState: missing a [Deprecated] attribute -!missing-protocol-member! UIApplicationDelegate::application:shouldRestoreSecureApplicationState: not found -!missing-protocol-member! UIApplicationDelegate::application:shouldSaveSecureApplicationState: not found diff --git a/tests/xtro-sharpie/tvOS-UIKit.todo b/tests/xtro-sharpie/tvOS-UIKit.todo index 94e1a4e455..e69de29bb2 100644 --- a/tests/xtro-sharpie/tvOS-UIKit.todo +++ b/tests/xtro-sharpie/tvOS-UIKit.todo @@ -1,5 +0,0 @@ -## appended from unclassified file -!deprecated-attribute-missing! UIApplicationDelegate::application:shouldRestoreApplicationState: missing a [Deprecated] attribute -!deprecated-attribute-missing! UIApplicationDelegate::application:shouldSaveApplicationState: missing a [Deprecated] attribute -!missing-protocol-member! UIApplicationDelegate::application:shouldRestoreSecureApplicationState: not found -!missing-protocol-member! UIApplicationDelegate::application:shouldSaveSecureApplicationState: not found From e537e52386f8193b196fcfa83c02d41167b6a45f Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Wed, 23 Oct 2019 16:03:02 -0400 Subject: [PATCH 037/100] [Tests] Allow to ignore the CMattachment tests in certain namespaces. (#7286) There are a number of namespaces that do not support the API and can be completly skipped. Also some of the classes in those namspaces are expensive to create and the test is not providing any useful information. Fixes: https://github.com/xamarin/maccore/issues/2038 --- tests/introspection/ApiCMAttachmentTest.cs | 48 +++++----------------- 1 file changed, 10 insertions(+), 38 deletions(-) diff --git a/tests/introspection/ApiCMAttachmentTest.cs b/tests/introspection/ApiCMAttachmentTest.cs index c08d8dbea6..4224299fe9 100644 --- a/tests/introspection/ApiCMAttachmentTest.cs +++ b/tests/introspection/ApiCMAttachmentTest.cs @@ -162,9 +162,18 @@ namespace Introspection { protected virtual bool Skip (Type type) { - return Skip (type.Name) || SkipDueToAttribute (type); + return SkipNameSpace (type.Namespace) || Skip (type.Name) || SkipDueToAttribute (type); } + protected virtual bool SkipNameSpace (string nameSpace) + { + switch (nameSpace) { + case "Network": // none of the classes support it and they require a lot of setup to confirm it + return true; + default: + return false; + } + } protected virtual bool Skip (string nativeName) { if (nativeName.Contains ("`")) { @@ -229,26 +238,9 @@ namespace Introspection { case "ABMutableMultiValue": case "SecProtocolMetadata": // Read-only object that is surfaced during TLS negotiation callbacks, can not be created from user code. case "SecProtocolOptions": // Read-only object that is surfaced during TLS negotiation callbacks, can not be created from user code. - case "NWError": // Only ever surfaced, not created from usercode - case "NWInterface": // Only ever surfaced, not created from usercode - case "NWPath": // Only ever surfaced, not created from usercode - case "NWProtocolStack": // Only ever surfaced, not created from usercode - case "NWProtocolMetadata": // While technically it can be created and the header files claim the methods exists, the library is missing the methods (radar: 42443077) - case "NWBrowseResult": // API to be consumed, create a new instance requires a network connection, which is not ideal for this tests. Aslo, the class does not support the API. - case "NWBrowser": // same as above - case "NWDataTransferReport": // same as above - case "NWEstablishmentReport": // same as above - case "NWFramer": // same as above - case "NWTxtRecord": // same as above - case "NWWebSocketMetadata": // same as above - case "NWWebSocketOptions": // same as above - case "NWWebSocketRequest": // same as above - case "NWWebSocketResponse": // same as above - case "NWProtocolIPOptions": // same as above case "ABSource": // not skipped when running on iOS 6.1 // type was removed in iOS 10 (and replaced) and never consumed by other API case "CGColorConverter": - case "NWBrowserDescriptor": return true; default: return false; @@ -448,26 +440,6 @@ namespace Introspection { new CVPixelBufferPoolSettings (), new CVPixelBufferAttributes (CVPixelFormatType.CV24RGB, 100, 50) ); - case "NWAdvertiseDescriptor": - return NWAdvertiseDescriptor.CreateBonjourService ("sampleName" + DateTime.Now, "_nfs._tcp"); - case "NWConnection": { - var endpoint = NWEndpoint.Create ("www.microsoft.com", "https"); - var parameters = NWParameters.CreateTcp (configureTcp: null); - return new NWConnection (endpoint, parameters); - } - case "NWContentContext": - return new NWContentContext ("contentContext" + DateTime.Now); - case "NWEndpoint": - return NWEndpoint.Create ("www.microsoft.com", "https"); - case "NWListener": - return NWListener.Create (NWParameters.CreateTcp (configureTcp: null)); - case "NWParameters": - return NWParameters.CreateTcp (configureTcp: null); - case "NWProtocolDefinition": - // Makes a new instance every time - return NWProtocolDefinition.TcpDefinition; - case "NWProtocolOptions": - return NWProtocolOptions.CreateTcp (); case "SecCertificate": using (var cdata = NSData.FromArray (mail_google_com)) return new SecCertificate (cdata); From bad61b8f5e8127e27e742cc91b2add7e1e4e0e12 Mon Sep 17 00:00:00 2001 From: Waleed Chaudhry <54864665+wachaudh@users.noreply.github.com> Date: Wed, 23 Oct 2019 16:29:35 -0400 Subject: [PATCH 038/100] [StoreKit] Add StoreKit bindings for xcode11.2b2 (#7294) --- src/storekit.cs | 3 ++- tests/xtro-sharpie/iOS-StoreKit.todo | 4 ---- tests/xtro-sharpie/tvOS-StoreKit.todo | 4 ---- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/storekit.cs b/src/storekit.cs index 78162a6a07..b740af4699 100644 --- a/src/storekit.cs +++ b/src/storekit.cs @@ -873,8 +873,9 @@ namespace StoreKit { [Mac (10,15)] delegate void SKArcadeServiceSubscriptionHandler (NSData subscriptionStatus, uint /* uint32_t */ subscriptionStatusLength, NSData cmacOfNonce, uint /* uint32_t */ cmacOfNonceLength, NSError error); - [NoiOS][NoTV] [Mac (10,15)] + [iOS (13,0)] + [TV (13,0)] [BaseType (typeof (NSObject))] [DisableDefaultCtor] // all static members so far interface SKArcadeService { diff --git a/tests/xtro-sharpie/iOS-StoreKit.todo b/tests/xtro-sharpie/iOS-StoreKit.todo index 6f2e76a102..e69de29bb2 100644 --- a/tests/xtro-sharpie/iOS-StoreKit.todo +++ b/tests/xtro-sharpie/iOS-StoreKit.todo @@ -1,4 +0,0 @@ -!missing-selector! +SKArcadeService::arcadeSubscriptionStatusWithNonce:resultHandler: not bound -!missing-selector! +SKArcadeService::registerArcadeAppWithRandomFromLib:randomFromLibLength:resultHandler: not bound -!missing-selector! +SKArcadeService::repairArcadeApp not bound -!missing-type! SKArcadeService not bound diff --git a/tests/xtro-sharpie/tvOS-StoreKit.todo b/tests/xtro-sharpie/tvOS-StoreKit.todo index 6f2e76a102..e69de29bb2 100644 --- a/tests/xtro-sharpie/tvOS-StoreKit.todo +++ b/tests/xtro-sharpie/tvOS-StoreKit.todo @@ -1,4 +0,0 @@ -!missing-selector! +SKArcadeService::arcadeSubscriptionStatusWithNonce:resultHandler: not bound -!missing-selector! +SKArcadeService::registerArcadeAppWithRandomFromLib:randomFromLibLength:resultHandler: not bound -!missing-selector! +SKArcadeService::repairArcadeApp not bound -!missing-type! SKArcadeService not bound From 4d8ec5d5314593db6f3a78c9fd6a0db875c252db Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 23 Oct 2019 23:25:27 +0200 Subject: [PATCH 039/100] [Network] Fix NWTxtRecord.Apply. Fixes xamarin/maccore#2036. (#7281) The block/delegate passed to NWTxtRecord.Apply is supposed to return a bool. Not returning anything ends up with random behavior, which causes a test failure on Catalina: 3) TestApply (MonoTouchFixtures.Network.NWTxtRecordTest.TestApply) keycount Expected: 4 But was: 1 at MonoTouchFixtures.Network.NWTxtRecordTest.TestApply () [0x000a3] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/monotouch-test/Network/NWTxtRecordTest.cs:134 at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&) at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395 I've fixed the existing API to return 'true' always in the block callback, to get consistent behavior, and in addition I've added a new overload that takes a delegate that returns a bool, which allows the consumer of the API to decide what to return. Fixes https://github.com/xamarin/maccore/issues/2036. --- src/Network/NWTxtRecord.cs | 53 ++++++++++++++++--- .../monotouch-test/Network/NWTxtRecordTest.cs | 7 +++ 2 files changed, 54 insertions(+), 6 deletions(-) diff --git a/src/Network/NWTxtRecord.cs b/src/Network/NWTxtRecord.cs index 35eab9aa36..01aa617f6f 100644 --- a/src/Network/NWTxtRecord.cs +++ b/src/Network/NWTxtRecord.cs @@ -118,21 +118,45 @@ namespace Network { [DllImport (Constants.NetworkLibrary)] unsafe static extern bool nw_txt_record_apply (OS_nw_txt_record txt_record, ref BlockLiteral applier); - unsafe delegate void nw_txt_record_apply_t (IntPtr block, string key, NWTxtRecordFindKey found, IntPtr value, nuint valueLen); + delegate bool nw_txt_record_apply_t (IntPtr block, string key, NWTxtRecordFindKey found, IntPtr value, nuint valueLen); unsafe static nw_txt_record_apply_t static_ApplyHandler = TrampolineApplyHandler; +#if XAMCORE_4_0 + public delegate bool NWTxtRecordApplyDelegate (string key, NWTxtRecordFindKey result, ReadOnlySpan value); +#else public delegate void NWTxtRecordApplyDelegate (string key, NWTxtRecordFindKey rersult, ReadOnlySpan value); + public delegate bool NWTxtRecordApplyDelegate2 (string key, NWTxtRecordFindKey result, ReadOnlySpan value); +#endif [MonoPInvokeCallback (typeof (nw_txt_record_apply_t))] - unsafe static void TrampolineApplyHandler (IntPtr block, string key, NWTxtRecordFindKey found, IntPtr value, nuint valueLen) + unsafe static bool TrampolineApplyHandler (IntPtr block, string key, NWTxtRecordFindKey found, IntPtr value, nuint valueLen) { +#if XAMCORE_4_0 var del = BlockLiteral.GetTarget (block); - if (del != null) { - var mValue = new ReadOnlySpan((void*)value, (int)valueLen); - del (key, found, mValue); +#else + var del = BlockLiteral.GetTarget (block); +#endif + if (del == null) + return false; + + var mValue = new ReadOnlySpan ((void*)value, (int)valueLen); +#if XAMCORE_4_0 + return del (key, found, mValue); +#else + if (del is NWTxtRecordApplyDelegate apply) { + apply (key, found, mValue); + return true; } + if (del is NWTxtRecordApplyDelegate2 apply2) + return apply2 (key, found, mValue); + + return false; +#endif } - + +#if !XAMCORE_4_0 + [Obsolete ("Use the overload that takes an NWTxtRecordApplyDelegate2 instead.")] +#endif [BindingImpl (BindingImplOptions.Optimizable)] public bool Apply (NWTxtRecordApplyDelegate handler) { @@ -148,6 +172,23 @@ namespace Network { } } +#if !XAMCORE_4_0 + [BindingImpl (BindingImplOptions.Optimizable)] + public bool Apply (NWTxtRecordApplyDelegate2 handler) + { + if (handler == null) + throw new ArgumentNullException (nameof (handler)); + + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_ApplyHandler, handler); + try { + return nw_txt_record_apply (GetCheckedHandle (), ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } +#endif + [DllImport (Constants.NetworkLibrary)] static extern unsafe bool nw_txt_record_access_key (OS_nw_txt_record txt_record, string key, ref BlockLiteral access_value); diff --git a/tests/monotouch-test/Network/NWTxtRecordTest.cs b/tests/monotouch-test/Network/NWTxtRecordTest.cs index 9e80d142bf..ed67b85ad8 100644 --- a/tests/monotouch-test/Network/NWTxtRecordTest.cs +++ b/tests/monotouch-test/Network/NWTxtRecordTest.cs @@ -131,7 +131,14 @@ namespace MonoTouchFixtures.Network keyCount++; Assert.IsTrue (keys.Contains (k), k); }); + var keyCount2 = 0; + record.Apply ((k, r, v) => { + keyCount2++; + Assert.IsTrue (keys.Contains (k), k); + return true; + }); Assert.AreEqual (keys.Count, keyCount, "keycount"); + Assert.AreEqual (keys.Count, keyCount2, "keycount2"); } [Test] From a95fe82a6887d0d75ccc3ad913752a320b96013b Mon Sep 17 00:00:00 2001 From: Pramit Mallick Date: Wed, 23 Oct 2019 17:33:30 -0400 Subject: [PATCH 040/100] [NetworkExtension] Bindings for xcode11.2 - Added missing selector 'identifier' --- src/networkextension.cs | 4 ++++ tests/xtro-sharpie/iOS-NetworkExtension.todo | 1 - tests/xtro-sharpie/macOS-NetworkExtension.todo | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/networkextension.cs b/src/networkextension.cs index 8ce8533c1d..617e9d7dcc 100644 --- a/src/networkextension.cs +++ b/src/networkextension.cs @@ -421,6 +421,10 @@ namespace NetworkExtension { [NoiOS] [NullAllowed, Export ("sourceAppAuditToken")] NSData SourceAppAuditToken { get; } + + [Mac (10, 15), iOS (13, 1)] + [Export ("identifier")] + NSUuid Identifier { get; } } // according to Xcode7 SDK this was available (in parts) in iOS8 diff --git a/tests/xtro-sharpie/iOS-NetworkExtension.todo b/tests/xtro-sharpie/iOS-NetworkExtension.todo index 77f85773e8..e69de29bb2 100644 --- a/tests/xtro-sharpie/iOS-NetworkExtension.todo +++ b/tests/xtro-sharpie/iOS-NetworkExtension.todo @@ -1 +0,0 @@ -!missing-selector! NEFilterFlow::identifier not bound diff --git a/tests/xtro-sharpie/macOS-NetworkExtension.todo b/tests/xtro-sharpie/macOS-NetworkExtension.todo index 77f85773e8..e69de29bb2 100644 --- a/tests/xtro-sharpie/macOS-NetworkExtension.todo +++ b/tests/xtro-sharpie/macOS-NetworkExtension.todo @@ -1 +0,0 @@ -!missing-selector! NEFilterFlow::identifier not bound From e1c12bba11a6c2933c242f6f1ed2f18232afe87d Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Thu, 24 Oct 2019 10:40:54 -0400 Subject: [PATCH 041/100] [Network] Add NWFramerMessage implementation. (#7256) Add a missing object for the type. Co-Authored-By: Rolf Bjarne Kvinge --- src/Network/NWFramer.cs | 31 ++-- src/Network/NWFramerMessage.cs | 140 ++++++++++++++++++ src/Network/NWProtocolDefinition.cs | 57 +++++++ src/frameworks.sources | 1 + .../Network/NWFramerMessageTest.cs | 98 ++++++++++++ tests/xtro-sharpie/iOS-Network.todo | 7 - tests/xtro-sharpie/macOS-Network.todo | 7 - tests/xtro-sharpie/tvOS-Network.todo | 7 - tests/xtro-sharpie/watchOS-Network.todo | 7 - 9 files changed, 315 insertions(+), 40 deletions(-) create mode 100644 src/Network/NWFramerMessage.cs create mode 100644 tests/monotouch-test/Network/NWFramerMessageTest.cs diff --git a/src/Network/NWFramer.cs b/src/Network/NWFramer.cs index 43866fcdfd..9dbf4acef4 100644 --- a/src/Network/NWFramer.cs +++ b/src/Network/NWFramer.cs @@ -23,6 +23,21 @@ using OS_nw_parameters=System.IntPtr; namespace Network { + // from System/Library/Frameworks/Network.framework/Headers/framer_options.h: + [Flags] + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public enum NWFramerCreateFlags : uint { + Default = 0x00, + } + + // from System/Library/Frameworks/Network.framework/Headers/framer_options.h: + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public enum NWFramerStartResult { + Unknown = 0, + Ready = 1, + WillMarkReady = 2, + } + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] public class NWFramer : NativeObject { internal NWFramer (IntPtr handle, bool owns) : base (handle, owns) {} @@ -238,23 +253,15 @@ namespace Network { static extern void nw_framer_schedule_wakeup (OS_nw_framer framer, ulong milliseconds); public void ScheduleWakeup (ulong milliseconds) => nw_framer_schedule_wakeup (GetCheckedHandle (), milliseconds); - - [DllImport (Constants.NetworkLibrary)] - static extern OS_nw_protocol_metadata nw_framer_protocol_create_message (OS_nw_protocol_definition definition); - - public static NWFramer CreateMessage (NWProtocolDefinition protocolDefinition) - { - if (protocolDefinition == null) - throw new ArgumentNullException (nameof (protocolDefinition)); - return new NWFramer (nw_framer_protocol_create_message (protocolDefinition.Handle), owns: true); - } + */ [DllImport (Constants.NetworkLibrary)] static extern OS_nw_protocol_metadata nw_framer_message_create (OS_nw_framer framer); - public NWProtocolMetadata CreateMessage () - => new NWFramer (nw_framer_message_create (GetCheckedHandle ()), owns: true); + public NWFramerMessage CreateMessage () + => new NWFramerMessage (nw_framer_message_create (GetCheckedHandle ()), owns: true); + /* [DllImport (Constants.NetworkLibrary)] static extern bool nw_framer_prepend_application_protocol (OS_nw_framer framer, OS_nw_protocol_options protocol_options); diff --git a/src/Network/NWFramerMessage.cs b/src/Network/NWFramerMessage.cs new file mode 100644 index 0000000000..8538998979 --- /dev/null +++ b/src/Network/NWFramerMessage.cs @@ -0,0 +1,140 @@ +// +// NWFramer.cs: Bindings the Network nw_framer_t API. +// +// Authors: +// Manuel de la Pena (mandel@microsoft.com) +// +// Copyright 2019 Microsoft +// +using System; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using ObjCRuntime; +using Foundation; +using CoreFoundation; + +using OS_nw_framer=System.IntPtr; +using OS_nw_protocol_metadata=System.IntPtr; +using OS_dispatch_data=System.IntPtr; +using OS_nw_protocol_definition=System.IntPtr; +using OS_nw_protocol_options=System.IntPtr; +using OS_nw_endpoint=System.IntPtr; +using OS_nw_parameters=System.IntPtr; + +namespace Network { + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public class NWFramerMessage : NWProtocolMetadata { + internal NWFramerMessage (IntPtr handle, bool owns) : base (handle, owns) {} + + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_protocol_metadata nw_framer_protocol_create_message (OS_nw_protocol_definition definition); + + // nw_framer_protocol can be condisered to be a nw_framer which is a protocol and is mapped to NWFramer, for a + // detailed explanation of the reasoning behind the naming please read the following discussion: + // https://github.com/xamarin/xamarin-macios/pull/7256#discussion_r337066971 + public static NWFramerMessage Create (NWProtocolDefinition protocolDefinition) + { + if (protocolDefinition == null) + throw new ArgumentNullException (nameof (protocolDefinition)); + return new NWFramerMessage (nw_framer_protocol_create_message (protocolDefinition.Handle), owns: true); + } + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_framer_message_set_value (OS_nw_protocol_metadata message, string key, IntPtr value, ref BlockLiteral dispose_value); + delegate void nw_framer_message_set_value_t (IntPtr block, IntPtr data); + static nw_framer_message_set_value_t static_SetDataHandler = TrampolineSetDataHandler; + + [MonoPInvokeCallback (typeof (nw_framer_message_access_value_t))] + static void TrampolineSetDataHandler (IntPtr block, IntPtr data) + { + // get and call, this is internal and we are trying to do all the magic in the call + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + del (data); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public void SetData (string key, byte[] value) + { + // the method takes a callback to cleanup the data, but we do not need that since we are managed + if (key == null) + throw new ArgumentNullException (nameof (key)); + + // pin the handle so that is not collected, let our callback release it + var pinned = GCHandle.Alloc (value, GCHandleType.Pinned); + Action callback = (_) => { + pinned.Free (); + }; + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_SetDataHandler, callback); + try { + nw_framer_message_set_value (GetCheckedHandle (), key, pinned.AddrOfPinnedObject (), ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern bool nw_framer_message_access_value (OS_nw_protocol_metadata message, string key, ref BlockLiteral access_value); + delegate bool nw_framer_message_access_value_t (IntPtr block, IntPtr data); + static nw_framer_message_access_value_t static_AccessValueHandler = TrampolineAccessValueHandler; + + + [MonoPInvokeCallback (typeof (nw_framer_message_access_value_t))] + static bool TrampolineAccessValueHandler (IntPtr block, IntPtr data) + { + // get and call, this is internal and we are trying to do all the magic in the call + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + return del (data); + } + return false; + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public bool GetData (string key, int dataLength, out ReadOnlySpan outData) { + IntPtr outPointer = IntPtr.Zero; + // create a function that will get the data, and the data length passed and will set the out param returning the value + Func callback = (inData) => { + if (inData != IntPtr.Zero) { + outPointer = inData; + return true; + } else { + return false; + } + }; + + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_AccessValueHandler, callback); + try { + // the callback is inlined!!! + var found = nw_framer_message_access_value (GetCheckedHandle (), key, ref block_handler); + if (found) { + unsafe { + outData = new ReadOnlySpan((void*) outPointer, dataLength); + } + } else { + outData = ReadOnlySpan.Empty; + } + return found; + } finally { + block_handler.CleanupBlock (); + } + } + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_framer_message_set_object_value (OS_nw_protocol_metadata message, string key, IntPtr value); + + public void SetObject (string key, NSObject value) + => nw_framer_message_set_object_value (GetCheckedHandle (), key, value.GetHandle ()); + + [DllImport (Constants.NetworkLibrary)] + static extern IntPtr nw_framer_message_copy_object_value (OS_nw_protocol_metadata message, string key); + + public T GetObject (string key) where T : NSObject + => Runtime.GetNSObject (nw_framer_message_copy_object_value (GetCheckedHandle (), key), owns: true); + } + +} diff --git a/src/Network/NWProtocolDefinition.cs b/src/Network/NWProtocolDefinition.cs index b71ed77e53..c1a0fb19bb 100644 --- a/src/Network/NWProtocolDefinition.cs +++ b/src/Network/NWProtocolDefinition.cs @@ -38,28 +38,85 @@ namespace Network { [DllImport (Constants.NetworkLibrary)] static extern OS_nw_protocol_definition nw_protocol_copy_ip_definition (); +#if !XAMCORE_4_0 + [Obsolete ("Use 'CreateIPDefinition' method instead.")] public static NWProtocolDefinition IPDefinition => new NWProtocolDefinition (nw_protocol_copy_ip_definition (), owns: true); +#endif + + public static NWProtocolDefinition CreateIPDefinition () => new NWProtocolDefinition (nw_protocol_copy_ip_definition (), owns: true); [DllImport (Constants.NetworkLibrary)] static extern OS_nw_protocol_definition nw_protocol_copy_tcp_definition (); +#if !XAMCORE_4_0 + [Obsolete ("Use 'CreateTcpDefinition' method instead.")] public static NWProtocolDefinition TcpDefinition => new NWProtocolDefinition (nw_protocol_copy_tcp_definition (), owns: true); +#endif + + public static NWProtocolDefinition CreateTcpDefinition () => new NWProtocolDefinition (nw_protocol_copy_tcp_definition (), owns: true); [DllImport (Constants.NetworkLibrary)] static extern OS_nw_protocol_definition nw_protocol_copy_udp_definition (); +#if !XAMCORE_4_0 + [Obsolete ("Use 'CreateUdpDefinition' method instead.")] public static NWProtocolDefinition UdpDefinition => new NWProtocolDefinition (nw_protocol_copy_udp_definition (), owns: true); +#endif + + public static NWProtocolDefinition CreateUdpDefinition () => new NWProtocolDefinition (nw_protocol_copy_udp_definition (), owns: true); [DllImport (Constants.NetworkLibrary)] static extern OS_nw_protocol_definition nw_protocol_copy_tls_definition (); +#if !XAMCORE_4_0 + [Obsolete ("Use 'CreateTlsDefinition' method instead.")] public static NWProtocolDefinition TlsDefinition => new NWProtocolDefinition (nw_protocol_copy_tls_definition (), owns: true); +#endif + + public static NWProtocolDefinition CreateTlsDefinition () => new NWProtocolDefinition (nw_protocol_copy_tls_definition (), owns: true); [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] [DllImport (Constants.NetworkLibrary)] static extern OS_nw_protocol_definition nw_protocol_copy_ws_definition (); +#if !XAMCORE_4_0 + [Obsolete ("Use 'CreateWebSocketDefinition' method instead.")] [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] public static NWProtocolDefinition WebSocketDefinition => new NWProtocolDefinition (nw_protocol_copy_ws_definition (), owns: true); +#endif + + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] + public static NWProtocolDefinition CreateWebSocketDefinition () => new NWProtocolDefinition (nw_protocol_copy_ws_definition (), owns: true); + + [Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] + [DllImport (Constants.NetworkLibrary)] + static extern unsafe OS_nw_protocol_definition nw_framer_create_definition (string identifier, NWFramerCreateFlags flags, ref BlockLiteral start_handler); + delegate NWFramerStartResult nw_framer_create_definition_t (IntPtr block, IntPtr framer); + static nw_framer_create_definition_t static_CreateFramerHandler = TrampolineCreateFramerHandler; + + [MonoPInvokeCallback (typeof (nw_framer_create_definition_t))] + static NWFramerStartResult TrampolineCreateFramerHandler (IntPtr block, IntPtr framer) + { + // get and call, this is internal and we are trying to do all the magic in the call + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + var nwFramer = new NWFramer (framer, owns: true); + return del (nwFramer); + } + return NWFramerStartResult.Unknown; + } + + [Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] + [BindingImpl (BindingImplOptions.Optimizable)] + public static NWProtocolDefinition CreateFramerDefinition (string identifier, NWFramerCreateFlags flags, Func startCallback) + { + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_CreateFramerHandler, startCallback); + try { + return new NWProtocolDefinition (nw_framer_create_definition (identifier, flags, ref block_handler), owns: true); + } finally { + block_handler.CleanupBlock (); + } + } } } diff --git a/src/frameworks.sources b/src/frameworks.sources index c643c6fa8e..d57a9b3a11 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -1177,6 +1177,7 @@ NETWORK_SOURCES = \ Network/NWEndpoint.cs \ Network/NWError.cs \ Network/NWFramer.cs \ + Network/NWFramerMessage.cs \ Network/NWInterface.cs \ Network/NWIPMetadata.cs \ Network/NWListener.cs \ diff --git a/tests/monotouch-test/Network/NWFramerMessageTest.cs b/tests/monotouch-test/Network/NWFramerMessageTest.cs new file mode 100644 index 0000000000..71bbc7f3b8 --- /dev/null +++ b/tests/monotouch-test/Network/NWFramerMessageTest.cs @@ -0,0 +1,98 @@ +#if !__WATCHOS__ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Text; +#if XAMCORE_2_0 +using CoreFoundation; +using Foundation; +using Network; +using ObjCRuntime; +using Security; +#else +using MonoTouch.CoreFoundation; +using MonoTouch.Foundation; +using MonoTouch.Network; +using MonoTouch.Security; +#endif + +using NUnit.Framework; + +namespace MonoTouchFixtures.Network { + + [TestFixture] + [Preserve (AllMembers = true)] + public class NWFramerMessageTest { + NWFramerMessage message; + NWFramer framer; + + string identifier = "TestFramer"; + + [TestFixtureSetUp] + public void Init () => TestRuntime.AssertXcodeVersion (11, 0); + + NWFramerStartResult StartCallback (NWFramer nWFramer) + { + framer = nWFramer; + return NWFramerStartResult.Ready; + } + + [SetUp] + public void SetUp () + { + using (var definition = NWProtocolDefinition.CreateFramerDefinition (identifier, NWFramerCreateFlags.Default, StartCallback)) { + message = NWFramerMessage.Create (definition); + } + } + + [TearDown] + public void TearDown () + { + message.Dispose (); + } + + [Test] + public void TestGetObject () + { + // store an NSObject + var storedValue = new NSNumber (30); + message.SetObject ("test", storedValue); + + var result = message.GetObject ("test"); + Assert.IsNotNull (result, "Null"); + Assert.AreEqual (storedValue, result, "Equal"); + } + + [Test] + public void TestGetObjectMissingKey () + { + var result = message.GetObject ("test"); + Assert.IsNull (result, "Null"); + } + + [Test] + public void TestGetData () + { + var dataString = "My super string."; + var data = Encoding.UTF8.GetBytes (dataString); + message.SetData ("test", data); + + ReadOnlySpan outData; + var found = message.GetData ("test", data.Length, out outData); + + Assert.IsTrue (found, "Found"); + Assert.AreEqual (data.Length, outData.Length, "Legth"); + Assert.AreEqual (dataString, Encoding.UTF8.GetString (outData), "Equal"); + } + + [Test] + public void TestGetDataMissingKey () + { + ReadOnlySpan outData; + var found = message.GetData ("test", 23, out outData); + Assert.IsFalse (found, "Found"); + Assert.AreEqual (0, outData.Length, "Length"); + } + } +} +#endif \ No newline at end of file diff --git a/tests/xtro-sharpie/iOS-Network.todo b/tests/xtro-sharpie/iOS-Network.todo index ca5c91cc1f..dc046d6a62 100644 --- a/tests/xtro-sharpie/iOS-Network.todo +++ b/tests/xtro-sharpie/iOS-Network.todo @@ -1,6 +1,4 @@ !missing-field! _nw_data_transfer_report_all_paths not bound -!missing-pinvoke! nw_framer_create_definition is not bound -!missing-pinvoke! nw_framer_message_access_value is not bound !missing-pinvoke! nw_framer_async is not bound !missing-pinvoke! nw_framer_copy_local_endpoint is not bound !missing-pinvoke! nw_framer_copy_parameters is not bound @@ -10,16 +8,11 @@ !missing-pinvoke! nw_framer_deliver_input_no_copy is not bound !missing-pinvoke! nw_framer_mark_failed_with_error is not bound !missing-pinvoke! nw_framer_mark_ready is not bound -!missing-pinvoke! nw_framer_message_copy_object_value is not bound -!missing-pinvoke! nw_framer_message_create is not bound -!missing-pinvoke! nw_framer_message_set_object_value is not bound -!missing-pinvoke! nw_framer_message_set_value is not bound !missing-pinvoke! nw_framer_parse_input is not bound !missing-pinvoke! nw_framer_parse_output is not bound !missing-pinvoke! nw_framer_pass_through_input is not bound !missing-pinvoke! nw_framer_pass_through_output is not bound !missing-pinvoke! nw_framer_prepend_application_protocol is not bound -!missing-pinvoke! nw_framer_protocol_create_message is not bound !missing-pinvoke! nw_framer_schedule_wakeup is not bound !missing-pinvoke! nw_framer_set_cleanup_handler is not bound !missing-pinvoke! nw_framer_set_input_handler is not bound diff --git a/tests/xtro-sharpie/macOS-Network.todo b/tests/xtro-sharpie/macOS-Network.todo index c666480620..89d3dc9700 100644 --- a/tests/xtro-sharpie/macOS-Network.todo +++ b/tests/xtro-sharpie/macOS-Network.todo @@ -6,8 +6,6 @@ !missing-pinvoke! nw_ethernet_channel_set_receive_handler is not bound !missing-pinvoke! nw_ethernet_channel_set_state_changed_handler is not bound !missing-pinvoke! nw_ethernet_channel_start is not bound -!missing-pinvoke! nw_framer_create_definition is not bound -!missing-pinvoke! nw_framer_message_access_value is not bound !missing-pinvoke! nw_parameters_create_custom_ip is not bound !missing-pinvoke! nw_framer_async is not bound !missing-pinvoke! nw_framer_copy_local_endpoint is not bound @@ -18,16 +16,11 @@ !missing-pinvoke! nw_framer_deliver_input_no_copy is not bound !missing-pinvoke! nw_framer_mark_failed_with_error is not bound !missing-pinvoke! nw_framer_mark_ready is not bound -!missing-pinvoke! nw_framer_message_copy_object_value is not bound -!missing-pinvoke! nw_framer_message_create is not bound -!missing-pinvoke! nw_framer_message_set_object_value is not bound -!missing-pinvoke! nw_framer_message_set_value is not bound !missing-pinvoke! nw_framer_parse_input is not bound !missing-pinvoke! nw_framer_parse_output is not bound !missing-pinvoke! nw_framer_pass_through_input is not bound !missing-pinvoke! nw_framer_pass_through_output is not bound !missing-pinvoke! nw_framer_prepend_application_protocol is not bound -!missing-pinvoke! nw_framer_protocol_create_message is not bound !missing-pinvoke! nw_framer_schedule_wakeup is not bound !missing-pinvoke! nw_framer_set_cleanup_handler is not bound !missing-pinvoke! nw_framer_set_input_handler is not bound diff --git a/tests/xtro-sharpie/tvOS-Network.todo b/tests/xtro-sharpie/tvOS-Network.todo index ca5c91cc1f..dc046d6a62 100644 --- a/tests/xtro-sharpie/tvOS-Network.todo +++ b/tests/xtro-sharpie/tvOS-Network.todo @@ -1,6 +1,4 @@ !missing-field! _nw_data_transfer_report_all_paths not bound -!missing-pinvoke! nw_framer_create_definition is not bound -!missing-pinvoke! nw_framer_message_access_value is not bound !missing-pinvoke! nw_framer_async is not bound !missing-pinvoke! nw_framer_copy_local_endpoint is not bound !missing-pinvoke! nw_framer_copy_parameters is not bound @@ -10,16 +8,11 @@ !missing-pinvoke! nw_framer_deliver_input_no_copy is not bound !missing-pinvoke! nw_framer_mark_failed_with_error is not bound !missing-pinvoke! nw_framer_mark_ready is not bound -!missing-pinvoke! nw_framer_message_copy_object_value is not bound -!missing-pinvoke! nw_framer_message_create is not bound -!missing-pinvoke! nw_framer_message_set_object_value is not bound -!missing-pinvoke! nw_framer_message_set_value is not bound !missing-pinvoke! nw_framer_parse_input is not bound !missing-pinvoke! nw_framer_parse_output is not bound !missing-pinvoke! nw_framer_pass_through_input is not bound !missing-pinvoke! nw_framer_pass_through_output is not bound !missing-pinvoke! nw_framer_prepend_application_protocol is not bound -!missing-pinvoke! nw_framer_protocol_create_message is not bound !missing-pinvoke! nw_framer_schedule_wakeup is not bound !missing-pinvoke! nw_framer_set_cleanup_handler is not bound !missing-pinvoke! nw_framer_set_input_handler is not bound diff --git a/tests/xtro-sharpie/watchOS-Network.todo b/tests/xtro-sharpie/watchOS-Network.todo index 87ad149f6f..04c1d79f24 100644 --- a/tests/xtro-sharpie/watchOS-Network.todo +++ b/tests/xtro-sharpie/watchOS-Network.todo @@ -1,6 +1,4 @@ !missing-field! _nw_data_transfer_report_all_paths not bound -!missing-pinvoke! nw_framer_create_definition is not bound -!missing-pinvoke! nw_framer_message_access_value is not bound !missing-pinvoke! nw_framer_async is not bound !missing-pinvoke! nw_framer_copy_local_endpoint is not bound !missing-pinvoke! nw_framer_copy_parameters is not bound @@ -10,16 +8,11 @@ !missing-pinvoke! nw_framer_deliver_input_no_copy is not bound !missing-pinvoke! nw_framer_mark_failed_with_error is not bound !missing-pinvoke! nw_framer_mark_ready is not bound -!missing-pinvoke! nw_framer_message_copy_object_value is not bound -!missing-pinvoke! nw_framer_message_create is not bound -!missing-pinvoke! nw_framer_message_set_object_value is not bound -!missing-pinvoke! nw_framer_message_set_value is not bound !missing-pinvoke! nw_framer_parse_input is not bound !missing-pinvoke! nw_framer_parse_output is not bound !missing-pinvoke! nw_framer_pass_through_input is not bound !missing-pinvoke! nw_framer_pass_through_output is not bound !missing-pinvoke! nw_framer_prepend_application_protocol is not bound -!missing-pinvoke! nw_framer_protocol_create_message is not bound !missing-pinvoke! nw_framer_schedule_wakeup is not bound !missing-pinvoke! nw_framer_set_cleanup_handler is not bound !missing-pinvoke! nw_framer_set_input_handler is not bound From 34f02ff0a0c1ca85083bdd1c6c4668d9d51dabb7 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 25 Oct 2019 22:13:20 +0200 Subject: [PATCH 042/100] Bump mono to a hash with archives and use them. (#7299) * Bump mono to a hash with archives and use them. New commits in mono/mono: * mono/mono@6af4ae76351 [2019-06][ci] Add Xcode 11.2beta2 for XI/XM Mono SDK builds Diff: https://github.com/mono/mono/compare/476d72b9e32ea58a7a8bda53af8cc8f5b7ffe6bb..6af4ae76351398d767f76cc06c66625267ae8690 * Bump mono to get min iOS version fix. New commits in mono/mono: * mono/mono@3775d5ac0ad [sdks] Bump min iOS version to 7.0. Diff: https://github.com/mono/mono/compare/6af4ae76351398d767f76cc06c66625267ae8690..3775d5ac0adcbd3c40ecc65286e1c4a1ad1b5965 * [xharness] Bump mtouch tests timeout to 3h, we have a couple of new PR bots which are old and slow. The new PR bots are late 2012 mac minis, so quite slow. --- Make.config | 8 +++++--- mk/mono.mk | 4 ++-- tests/xharness/Jenkins.cs | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Make.config b/Make.config index e2965cc30e..7003f26093 100644 --- a/Make.config +++ b/Make.config @@ -3,7 +3,7 @@ include $(TOP)/mk/subdirs.mk # calculate commit distance and store it in a file so that we don't have to re-calculate it every time make is executed. -include $(TOP)/Make.config.inc -$(TOP)/Make.config.inc: $(TOP)/Make.config +$(TOP)/Make.config.inc: $(TOP)/Make.config $(TOP)/mk/mono.mk @rm -f $@ @printf "IOS_COMMIT_DISTANCE:=$(shell LANG=C; export LANG && git --git-dir $(TOP)/.git log `git --git-dir $(TOP)/.git blame -- ./Make.versions HEAD | grep IOS_PACKAGE_VERSION= | sed 's/ .*//' `..HEAD --oneline | wc -l | sed 's/ //g')\n" >> $@ @printf "MAC_COMMIT_DISTANCE:=$(shell LANG=C; export LANG && git --git-dir $(TOP)/.git log `git --git-dir $(TOP)/.git blame -- ./Make.versions HEAD | grep MAC_PACKAGE_VERSION= | sed 's/ .*//' `..HEAD --oneline | wc -l | sed 's/ //g')\n" >> $@ @@ -62,6 +62,7 @@ IOS_PACKAGE_UPDATE_ID=$(shell printf "2%02d%02d%02d%03d" $(IOS_PACKAGE_VERSION_M XCODE_VERSION=11.2 XCODE_URL=http://xamarin-storage/bot-provisioning/xcodes/Xcode_11.2_beta_2.xip XCODE_DEVELOPER_ROOT=/Applications/Xcode112-beta2.app/Contents/Developer +XCODE_PRODUCT_BUILD_VERSION:=$(shell /usr/libexec/PlistBuddy -c 'Print :ProductBuildVersion' $(XCODE_DEVELOPER_ROOT)/../version.plist) # Mono version embedded in XI/XM (NEEDED_MONO_VERSION/BRANCH) are specified in mk/mono.mk include $(TOP)/mk/mono.mk @@ -352,10 +353,11 @@ JENKINS_RESULTS_DIRECTORY ?= $(abspath $(TOP)/jenkins-results) # Clone files instead of copying them on APFS file systems. Much faster. CP:=$(shell df -t apfs / >/dev/null 2>&1 && echo "cp -c" || echo "cp") +XCODE_ARCHIVE_VERSION=xcode-$(XCODE_PRODUCT_BUILD_VERSION) MONO_IOS_FILENAME:=ios-release-Darwin-$(MONO_HASH).7z -MONO_IOS_URL:=https://xamjenkinsartifact.azureedge.net/mono-sdks/$(MONO_IOS_FILENAME) +MONO_IOS_URL:=https://xamjenkinsartifact.azureedge.net/mono-sdks/$(XCODE_ARCHIVE_VERSION)/$(MONO_IOS_FILENAME) MONO_MAC_FILENAME:=mac-release-Darwin-$(MONO_HASH).7z -MONO_MAC_URL:=https://xamjenkinsartifact.azureedge.net/mono-sdks/$(MONO_MAC_FILENAME) +MONO_MAC_URL:=https://xamjenkinsartifact.azureedge.net/mono-sdks/$(XCODE_ARCHIVE_VERSION)/$(MONO_MAC_FILENAME) # Setup various variables depending on whether mono is downloaded or built from source ifeq ($(MONO_BUILD_FROM_SOURCE),) diff --git a/mk/mono.mk b/mk/mono.mk index 82cdac6e71..1a2035f4fd 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,5 +1,5 @@ -NEEDED_MONO_VERSION := 476d72b9e32ea58a7a8bda53af8cc8f5b7ffe6bb -NEEDED_MONO_BRANCH := 2019-06 +NEEDED_MONO_VERSION := 3775d5ac0adcbd3c40ecc65286e1c4a1ad1b5965 +NEEDED_MONO_BRANCH := 2019-06-xcode11.2 MONO_DIRECTORY := mono MONO_MODULE := https://github.com/mono/mono diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index 1cb5131404..5133de267a 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -1007,7 +1007,7 @@ namespace xharness TestProject = new TestProject (Path.GetFullPath (Path.Combine (Harness.RootDirectory, "mtouch", "mtouch.csproj"))), Platform = TestPlatform.iOS, TestName = "MTouch tests", - Timeout = TimeSpan.FromMinutes (120), + Timeout = TimeSpan.FromMinutes (180), Ignored = !IncludeMtouch, InProcess = true, }; From 5670872dc6cdcece361b4601e8e2621e1b9a7558 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Fri, 25 Oct 2019 20:06:00 -0400 Subject: [PATCH 043/100] [Generator] Allow 1 level nester classes. Fixes: #7304 (#7309) We have only encountered a case in which we had to add a nested class/enum as the return type of a property. This fix ensures that we can work with 1 level nested classes. A more general situation with nested/nested/nested/.. classes is not taken into account because: 1. Would complicate too much the code. 2. Is fixing problems we do not have AFAIK. So I'm keeping the fix simple, as I said, we have never faced anything deeper than one level. --- src/generator.cs | 10 ++++++++-- tests/generator/BGenTests.cs | 3 +++ tests/generator/ghissue7304.cs | 23 +++++++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 tests/generator/ghissue7304.cs diff --git a/src/generator.cs b/src/generator.cs index dfcf3eef16..589060ae0a 100644 --- a/src/generator.cs +++ b/src/generator.cs @@ -3364,12 +3364,18 @@ public partial class Generator : IMemberGatherer { var interfaceTag = protocolized == true ? "I" : ""; string tname; + // we are adding the usage of ReflectedType just for those cases in which we have nested enums/classes, this soluction does not + // work with nested/nested/nested classes. But we are not writing a general solution because: + // 1. We have only encountered nested classes. + // 2. We are not going to complicate the code more than needed if we have never ever faced a situation with a crazy nested hierarchy, + // so we only solve the problem we have, no more. + var parentClass = (type.ReflectedType == null) ? String.Empty : type.ReflectedType.Name + "."; if (types_that_must_always_be_globally_named.Contains (type.Name)) - tname = $"global::{type.Namespace}.{interfaceTag}{type.Name}"; + tname = $"global::{type.Namespace}.{parentClass}{interfaceTag}{type.Name}"; else if ((usedInNamespace != null && type.Namespace == usedInNamespace) || ns.StandardNamespaces.Contains (type.Namespace) || string.IsNullOrEmpty (type.FullName)) tname = interfaceTag + type.Name; else - tname = $"global::{type.Namespace}.{interfaceTag}{type.Name}"; + tname = $"global::{type.Namespace}.{parentClass}{interfaceTag}{type.Name}"; var targs = type.GetGenericArguments (); if (targs.Length > 0) { diff --git a/tests/generator/BGenTests.cs b/tests/generator/BGenTests.cs index 908abc9597..a308fa489b 100644 --- a/tests/generator/BGenTests.cs +++ b/tests/generator/BGenTests.cs @@ -580,6 +580,9 @@ namespace GeneratorTests [Test] public void GHIssue5692 () => BuildFile (Profile.iOS, "ghissue5692.cs"); + [Test] + public void GHIssue7304 () => BuildFile (Profile.macOSFull, "ghissue7304.cs"); + [Test] public void RefOutParameters () { diff --git a/tests/generator/ghissue7304.cs b/tests/generator/ghissue7304.cs new file mode 100644 index 0000000000..09b4e578fc --- /dev/null +++ b/tests/generator/ghissue7304.cs @@ -0,0 +1,23 @@ +using Foundation; +using ObjCRuntime; +using AppKit; +using CoreFoundation; + +namespace GHIssue7304 { + + [BaseType (typeof (NSObject))] + interface FooClass { + + [Internal] + [Export ("architecture")] + int _Arch { get; set; } + + CFBundle.Architecture Arch { + [Wrap ("(CFBundle.Architecture) _Arch")] + get; + [Wrap ("_Arch = (int)value")] + set; + } + } + +} \ No newline at end of file From 4a9c6b994fdcfe90620c9eeb1e20382b40ef3e02 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Fri, 25 Oct 2019 20:06:23 -0400 Subject: [PATCH 044/100] [Networking] Use the correct signature on SetData. Fixes #2042 (#7310) Use the correct signature or the app will crash. Tested on a device. Fixes: https://github.com/xamarin/maccore/issues/2042 --- src/Network/NWFramerMessage.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Network/NWFramerMessage.cs b/src/Network/NWFramerMessage.cs index 8538998979..d193aa7fef 100644 --- a/src/Network/NWFramerMessage.cs +++ b/src/Network/NWFramerMessage.cs @@ -45,7 +45,7 @@ namespace Network { delegate void nw_framer_message_set_value_t (IntPtr block, IntPtr data); static nw_framer_message_set_value_t static_SetDataHandler = TrampolineSetDataHandler; - [MonoPInvokeCallback (typeof (nw_framer_message_access_value_t))] + [MonoPInvokeCallback (typeof (nw_framer_message_set_value_t))] static void TrampolineSetDataHandler (IntPtr block, IntPtr data) { // get and call, this is internal and we are trying to do all the magic in the call From 84ee21569f76d86b59bf63178cc6851f4169e6f7 Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Mon, 28 Oct 2019 10:38:53 -0400 Subject: [PATCH 045/100] [d16-4] Bump mono 2019-08@8946e49a (#7311) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New commits in mono/mono: * mono/mono@8946e49a974 Added SR.missing from original backport * mono/mono@5c784c9747b Bump to mono/corefx@fb41040 * mono/mono@fdb704901e4 Revert "[2019-08] rollback msbuild/roslyn updates for a preview" (#17543) * mono/mono@92a177923cb [2019-08] [debugger] Changing how debugger handles exception w… (#17524) * mono/mono@1b2e536b223 [2019-08] rollback msbuild/roslyn updates for a preview * mono/mono@ec4ef9bc344 Bump roslyn-binaries to get roslyn 3.4.0-beta3-19521-01 * mono/mono@cc8deca901c Bump msbuild to pick up sdks+roslyn updates * mono/mono@335f0109c52 Bump msbuild to track mono-2019-08 * mono/mono@90d6e496e47 Fix checks so stack overflows work again. * mono/mono@4b60e7f930f [jit] Avoid running mono_handle_native_crash () on the altstack, it can't produce a backtrace. AMD64 only for now. * mono/mono@989333d6aec Bump Bockbuild to pick-up gtk# binding change (#17486) * mono/mono@baa12e5d240 [profiler] Fix coverage profiler on macos (#17422) Diff: https://github.com/mono/mono/compare/ef75d4bef7509b23103fffa2acca039e9acbb157..8946e49a974ea8b75fe5b8b7e93ffd4571521a85 --- mk/mono.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/mono.mk b/mk/mono.mk index 0f309d365c..0419183c42 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,4 +1,4 @@ -NEEDED_MONO_VERSION := ef75d4bef7509b23103fffa2acca039e9acbb157 +NEEDED_MONO_VERSION := 8946e49a974ea8b75fe5b8b7e93ffd4571521a85 NEEDED_MONO_BRANCH := 2019-08 MONO_DIRECTORY := mono From 610cefaf1eafab935fd32d204242c1508789e311 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Mon, 28 Oct 2019 14:50:44 -0400 Subject: [PATCH 046/100] [Tests] Fix the Network tests. (#7293) * [Tests] Fix the Network tests. The pattern used to Cancel then Dispose the connection is wrong and ended up crashing the tests sometimes. It is a race condition and is very rare, but makes the tests flaky. The changes ensures that we Dispose the connection, which internally closes it. Tests have been added for the NWConnection Close calls. Also cleaned some on the CWL that were not needed. --- .../Network/NWConnectionTest.cs | 122 ++++++++++++++++++ .../Network/NWEstablishmentReportTest.cs | 9 +- .../monotouch-test/Network/NWListenerTest.cs | 12 +- .../Network/NWParametersTest.cs | 14 +- .../Network/NWProtocolIPOptionsTest.cs | 9 +- .../Network/NWProtocolStackTest.cs | 13 +- 6 files changed, 140 insertions(+), 39 deletions(-) create mode 100644 tests/monotouch-test/Network/NWConnectionTest.cs diff --git a/tests/monotouch-test/Network/NWConnectionTest.cs b/tests/monotouch-test/Network/NWConnectionTest.cs new file mode 100644 index 0000000000..f099cd1e1e --- /dev/null +++ b/tests/monotouch-test/Network/NWConnectionTest.cs @@ -0,0 +1,122 @@ +#if !__WATCHOS__ +using System; +using System.Collections.Generic; +using System.Threading; +#if XAMCORE_2_0 +using CoreFoundation; +using Foundation; +using Network; +using ObjCRuntime; +using Security; +#else +using MonoTouch.CoreFoundation; +using MonoTouch.Foundation; +using MonoTouch.Network; +using MonoTouch.Security; +#endif + +using NUnit.Framework; + +namespace MonoTouchFixtures.Network { + + [TestFixture] + [Preserve (AllMembers = true)] + public class NWConnectionTest { + + AutoResetEvent connectedEvent; // used to let us know when the connection was established so that we can access the Report + string host; + NWConnection connection; + + void ConnectionStateHandler (NWConnectionState state, NWError error) + { + switch (state){ + case NWConnectionState.Ready: + connectedEvent.Set (); + break; + case NWConnectionState.Invalid: + case NWConnectionState.Failed: + Assert.Inconclusive ("Network connection could not be performed."); + break; + } + } + + [TestFixtureSetUp] + public void Init () => TestRuntime.AssertXcodeVersion (10, 0); + + [SetUp] + public void SetUp () + { + // connect and once the connection is done, deal with the diff tests + connectedEvent = new AutoResetEvent(false); + host = "www.google.com"; + // we create a connection which we are going to use to get the availabe + // interfaces, that way we can later test protperties of the NWParameters class. + using (var parameters = NWParameters.CreateUdp ()) + using (var endpoint = NWEndpoint.Create (host, "80")) + { + using (var protocolStack = parameters.ProtocolStack) { + var ipOptions = protocolStack.InternetProtocol; + ipOptions.IPSetVersion (NWIPVersion.Version4); + } + connection = new NWConnection (endpoint, parameters); + connection.SetQueue (DispatchQueue.DefaultGlobalQueue); // important, else we will get blocked + connection.SetStateChangeHandler (ConnectionStateHandler); + connection.Start (); + Assert.True (connectedEvent.WaitOne (20000), "Connection timed out."); + } + + } + + [TearDown] + public void TearDown () => connection.Dispose (); + + [Test] + public void TestEndpointProperty () => Assert.IsNotNull (connection.Endpoint); + + [Test] + public void TestParametersProperty () => Assert.IsNotNull (connection.Parameters); + + [Test] + public void TestSetQPropertyNull () => Assert.Throws (() => connection.SetQueue (null)); + + [Test] + public void TestCancel () + { + // call cancel, several times, we should not crash + AutoResetEvent cancelled = new AutoResetEvent (false); + connection.SetStateChangeHandler ((s, e) => { + switch (s) { + case NWConnectionState.Cancelled: + cancelled.Set (); + break; + } + }); + connection.Cancel (); + Assert.IsTrue (cancelled.WaitOne (3000), "Cancelled"); + connection.Cancel (); + // lib should ignore the second call + Assert.IsFalse (cancelled.WaitOne (3000)); + } + + [Test] + public void TestForceCancel () + { + // same as cancel, call it several times should be ok + // call cancel, several times, we should not crash + AutoResetEvent cancelled = new AutoResetEvent (false); + connection.SetStateChangeHandler ((s, e) => { + switch (s) { + case NWConnectionState.Cancelled: + cancelled.Set (); + break; + } + }); + connection.ForceCancel (); + Assert.IsTrue (cancelled.WaitOne (3000), "Cancelled"); + connection.ForceCancel (); + // lib should ignore the second call + Assert.IsFalse (cancelled.WaitOne (3000)); + } + } +} +#endif \ No newline at end of file diff --git a/tests/monotouch-test/Network/NWEstablishmentReportTest.cs b/tests/monotouch-test/Network/NWEstablishmentReportTest.cs index 826aa9df2c..eaf28329c1 100644 --- a/tests/monotouch-test/Network/NWEstablishmentReportTest.cs +++ b/tests/monotouch-test/Network/NWEstablishmentReportTest.cs @@ -1,4 +1,3 @@ - #if !__WATCHOS__ using System; using System.Collections.Generic; @@ -32,15 +31,10 @@ namespace MonoTouchFixtures.Network { void ConnectionStateHandler (NWConnectionState state, NWError error) { - Console.WriteLine ($"State is {state} and error {error}"); switch (state){ case NWConnectionState.Ready: connectedEvent.Set (); break; - case NWConnectionState.Cancelled: - connection?.Dispose (); - connection = null; - break; case NWConnectionState.Invalid: case NWConnectionState.Failed: Assert.Inconclusive ("Network connection could not be performed."); @@ -71,7 +65,6 @@ namespace MonoTouchFixtures.Network { connection.Start (); Assert.True (connectedEvent.WaitOne (20000), "Connection timed out."); connection.GetEstablishmentReport (DispatchQueue.DefaultGlobalQueue, (r) => { - Console.WriteLine ("Got report"); report = r; reportEvent.Set (); }); @@ -82,8 +75,8 @@ namespace MonoTouchFixtures.Network { [TestFixtureTearDown] public void Dispose() { - connection?.Cancel (); report.Dispose (); + connection.Dispose (); } [Test] diff --git a/tests/monotouch-test/Network/NWListenerTest.cs b/tests/monotouch-test/Network/NWListenerTest.cs index ba0550e349..c3e1690af9 100644 --- a/tests/monotouch-test/Network/NWListenerTest.cs +++ b/tests/monotouch-test/Network/NWListenerTest.cs @@ -23,7 +23,6 @@ namespace MonoTouchFixtures.Network { public class NWListenerTest { NWListener listener; - NWParameters parameters; [TestFixtureSetUp] public void Init () => TestRuntime.AssertXcodeVersion (11, 0); @@ -31,15 +30,20 @@ namespace MonoTouchFixtures.Network { [SetUp] public void SetUp () { - parameters = new NWParameters (); - listener = NWListener.Create (parameters); + using (var tcpOptions = NWProtocolOptions.CreateTcp ()) + using (var tlsOptions = NWProtocolOptions.CreateTls ()) + using (var parameters = NWParameters.CreateTcp ()) { + parameters.ProtocolStack.PrependApplicationProtocol (tlsOptions); + parameters.ProtocolStack.PrependApplicationProtocol (tcpOptions); + parameters.IncludePeerToPeer = true; + listener = NWListener.Create ("1234", parameters); + } } [TearDown] public void TearDown () { listener?.Dispose (); - parameters?.Dispose (); } [Test] diff --git a/tests/monotouch-test/Network/NWParametersTest.cs b/tests/monotouch-test/Network/NWParametersTest.cs index 68ca4bf44c..3beacde750 100644 --- a/tests/monotouch-test/Network/NWParametersTest.cs +++ b/tests/monotouch-test/Network/NWParametersTest.cs @@ -58,7 +58,9 @@ namespace MonoTouchFixtures.Network { [TestFixtureTearDown] public void Dispose() { - connection?.Cancel (); + connection.Dispose (); + foreach (var i in interfaces) + i.Dispose (); } [SetUp] @@ -77,10 +79,6 @@ namespace MonoTouchFixtures.Network { connectedEvent.Set (); break; case NWConnectionState.Cancelled: - connection?.Dispose (); - connection = null; - foreach (var i in interfaces) - i.Dispose (); break; case NWConnectionState.Invalid: case NWConnectionState.Failed: @@ -131,7 +129,6 @@ namespace MonoTouchFixtures.Network { connection.Start (); secureEvent.WaitOne (); configureEvent.WaitOne (); - connection.Cancel (); Assert.True (secureConnectionWasSet, "Configure TLS handler was not called."); Assert.True (protocolConfigured, "Protocol configure handler was not called."); } @@ -148,7 +145,6 @@ namespace MonoTouchFixtures.Network { connection.SetQueue (DispatchQueue.MainQueue); connection.Start (); secureEvent.WaitOne (); - connection.Cancel (); Assert.True (secureConnectionWasSet, "Configure TLS handler was not called."); Assert.False (protocolConfigured, "Protocol configure handler was called."); } @@ -165,7 +161,6 @@ namespace MonoTouchFixtures.Network { connection.SetQueue (DispatchQueue.MainQueue); connection.Start (); configureEvent.WaitOne (); - connection.Cancel (); Assert.False (secureConnectionWasSet, "Configure TLS handler was not called."); Assert.True (protocolConfigured, "Protocol configure handler was not called."); } @@ -184,7 +179,6 @@ namespace MonoTouchFixtures.Network { connection.Start (); secureEvent.WaitOne (); configureEvent.WaitOne (); - connection.Cancel (); Assert.True (secureConnectionWasSet, "Configure TLS handler was not called."); Assert.True (protocolConfigured, "Protocol configure handler was not called."); } @@ -202,7 +196,6 @@ namespace MonoTouchFixtures.Network { connection.SetQueue (DispatchQueue.MainQueue); connection.Start (); secureEvent.WaitOne (); - connection.Cancel (); Assert.True (secureConnectionWasSet, "Configure TLS handler was not called."); Assert.False (protocolConfigured, "Protocol configure handler was called."); } @@ -219,7 +212,6 @@ namespace MonoTouchFixtures.Network { connection.SetQueue (DispatchQueue.MainQueue); connection.Start (); configureEvent.WaitOne (); - connection.Cancel (); Assert.False (secureConnectionWasSet, "Configure TLS handler was called."); Assert.True (protocolConfigured, "Protocol configure handler was not called."); } diff --git a/tests/monotouch-test/Network/NWProtocolIPOptionsTest.cs b/tests/monotouch-test/Network/NWProtocolIPOptionsTest.cs index 3ab58fa541..23be8e9e47 100644 --- a/tests/monotouch-test/Network/NWProtocolIPOptionsTest.cs +++ b/tests/monotouch-test/Network/NWProtocolIPOptionsTest.cs @@ -32,12 +32,6 @@ namespace MonoTouchFixtures.Network { case NWConnectionState.Ready: connectedEvent.Set (); break; - case NWConnectionState.Cancelled: - connection?.Dispose (); - connection = null; - stack?.Dispose (); - stack = null; - break; case NWConnectionState.Invalid: case NWConnectionState.Failed: Assert.Inconclusive ("Network connection could not be performed."); @@ -72,7 +66,8 @@ namespace MonoTouchFixtures.Network { [TestFixtureTearDown] public void Dispose() { - connection.Cancel (); + connection.Dispose (); + stack.Dispose (); } [SetUp] diff --git a/tests/monotouch-test/Network/NWProtocolStackTest.cs b/tests/monotouch-test/Network/NWProtocolStackTest.cs index b36bb6a1bc..f7f7fa2b4a 100644 --- a/tests/monotouch-test/Network/NWProtocolStackTest.cs +++ b/tests/monotouch-test/Network/NWProtocolStackTest.cs @@ -56,7 +56,10 @@ namespace MonoTouchFixtures.Network { [TestFixtureTearDown] public void Dispose() { - connection.Cancel (); + connection.Dispose (); + stack.Dispose (); + foreach (var o in options) + o.Dispose (); } [SetUp] @@ -71,14 +74,6 @@ namespace MonoTouchFixtures.Network { case NWConnectionState.Ready: connectedEvent.Set (); break; - case NWConnectionState.Cancelled: - connection?.Dispose (); - connection = null; - stack?.Dispose (); - stack = null; - foreach (var o in options) - o.Dispose (); - break; case NWConnectionState.Invalid: case NWConnectionState.Failed: Assert.Inconclusive ("Network connection could not be performed."); From f35569a715c2777d28241610dff4712aaff552bc Mon Sep 17 00:00:00 2001 From: Pramit Mallick Date: Mon, 28 Oct 2019 15:38:34 -0400 Subject: [PATCH 047/100] [Appkit] Bindings part 4 (#7295) Complete the AppKit bindings up to Xcode 11.2 --- src/AppKit/NSFont.cs | 7 + src/CoreFoundation/Architecture.cs | 27 ++ src/CoreFoundation/CFBundle.cs | 19 +- src/appkit.cs | 434 ++++++++++++++++++++++++- src/foundation.cs | 11 + src/frameworks.sources | 1 + src/uikit.cs | 83 ----- src/xkit.cs | 83 +++++ tests/introspection/ApiCtorInitTest.cs | 4 + tests/xtro-sharpie/macOS-AppKit.ignore | 3 +- tests/xtro-sharpie/macOS-AppKit.todo | 143 -------- 11 files changed, 566 insertions(+), 249 deletions(-) create mode 100644 src/CoreFoundation/Architecture.cs diff --git a/src/AppKit/NSFont.cs b/src/AppKit/NSFont.cs index a08b99c8b9..bae09ce188 100644 --- a/src/AppKit/NSFont.cs +++ b/src/AppKit/NSFont.cs @@ -185,5 +185,12 @@ namespace AppKit { var ptr = _MonospacedDigitSystemFontOfSize (fontSize, weight); return ptr == IntPtr.Zero ? null : new NSFont (ptr); } + + [Mac (10,15)] + public static NSFont MonospacedSystemFont (nfloat fontSize, nfloat weight) + { + var ptr = _MonospacedSystemFont (fontSize, weight); + return ptr == IntPtr.Zero ? null : new NSFont (ptr); + } } } diff --git a/src/CoreFoundation/Architecture.cs b/src/CoreFoundation/Architecture.cs new file mode 100644 index 0000000000..693be8b76e --- /dev/null +++ b/src/CoreFoundation/Architecture.cs @@ -0,0 +1,27 @@ +using System; +using System.Runtime.InteropServices; +using ObjCRuntime; +using Foundation; +using CoreFoundation; + +namespace CoreFoundation { + public partial class CFBundle { + + // from machine.h + // #define CPU_ARCH_ABI64 0x01000000 + // #define CPU_TYPE_X86 ((cpu_type_t) 7) + // #define CPU_TYPE_X86_64 (CPU_TYPE_X86 | CPU_ARCH_ABI64) + // #define CPU_TYPE_ARM ((cpu_type_t) 12) + // #define CPU_TYPE_ARM64 (CPU_TYPE_ARM | CPU_ARCH_ABI64) + // #define CPU_TYPE_POWERPC ((cpu_type_t) 18) + // #define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64) + public enum Architecture { + I386 = 0x00000007, + X86_64 = 0x01000007, + ARM = 0x00000012, + ARM64 = 0x01000012, + PPC = 0x00000018, + PPC64 = 0x01000018, + } + } +} \ No newline at end of file diff --git a/src/CoreFoundation/CFBundle.cs b/src/CoreFoundation/CFBundle.cs index ca0bf0f915..c4ac2db5ea 100644 --- a/src/CoreFoundation/CFBundle.cs +++ b/src/CoreFoundation/CFBundle.cs @@ -10,7 +10,7 @@ using Foundation; namespace CoreFoundation { - public class CFBundle : INativeObject, IDisposable { + public partial class CFBundle : INativeObject, IDisposable { public enum PackageType { Application, @@ -18,23 +18,6 @@ namespace CoreFoundation { Bundle } - // from machine.h - // #define CPU_ARCH_ABI64 0x01000000 - // #define CPU_TYPE_X86 ((cpu_type_t) 7) - // #define CPU_TYPE_X86_64 (CPU_TYPE_X86 | CPU_ARCH_ABI64) - // #define CPU_TYPE_ARM ((cpu_type_t) 12) - // #define CPU_TYPE_ARM64 (CPU_TYPE_ARM | CPU_ARCH_ABI64) - // #define CPU_TYPE_POWERPC ((cpu_type_t) 18) - // #define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64) - public enum Architecture { - I386 = 0x00000007, - X86_64 = 0x01000007, - ARM = 0x00000012, - ARM64 = 0x01000012, - PPC = 0x00000018, - PPC64 = 0x01000018, - } - public struct PackageInfo { public PackageInfo (CFBundle.PackageType type, string creator) { diff --git a/src/appkit.cs b/src/appkit.cs index 946e279ee0..c2016399c9 100644 --- a/src/appkit.cs +++ b/src/appkit.cs @@ -35,6 +35,7 @@ using System.ComponentModel; using Foundation; using ObjCRuntime; using CoreGraphics; +using CoreFoundation; using CoreImage; using CoreAnimation; using CoreData; @@ -4098,6 +4099,16 @@ namespace AppKit { [Export ("systemGrayColor", ArgumentSemantic.Strong)] NSColor SystemGrayColor { get; } + [Mac (10, 15)] + [Static] + [Export ("systemIndigoColor", ArgumentSemantic.Strong)] + NSColor SystemIndigoColor { get; } + + [Mac (10, 12)] + [Static] + [Export ("systemTealColor", ArgumentSemantic.Strong)] + NSColor SystemTealColor { get; } + [Mac (10, 14)] [Static] [Export ("separatorColor", ArgumentSemantic.Strong)] @@ -4146,6 +4157,11 @@ namespace AppKit { [Static] [Export ("placeholderTextColor", ArgumentSemantic.Strong)] NSColor PlaceholderTextColor { get; } + + [Mac (10,15)] + [Static] + [Export ("colorWithName:dynamicProvider:")] + NSColor GetColor ([NullAllowed] string colorName, Func dynamicProvider); } [BaseType (typeof (NSObject))] @@ -6523,6 +6539,12 @@ namespace AppKit { [Internal] [Export ("getAdvancements:forCGGlyphs:count:")] void _GetAdvancements (IntPtr advancements, IntPtr glyphs, nuint glyphCount); + + [Mac (10,15)] + [Static] + [Export ("monospacedSystemFontOfSize:weight:")] + [Internal] + IntPtr _MonospacedSystemFont (nfloat fontSize, nfloat weight); } interface NSFontCollectionChangedEventArgs { @@ -6745,6 +6767,11 @@ namespace AppKit { [Mac (10, 13)] [Export ("requiresFontAssetRequest")] bool RequiresFontAssetRequest { get; } + + [Mac (10,15)] + [Export ("fontDescriptorWithDesign:")] + [return: NullAllowed] + NSFontDescriptor Create (NSFontDescriptorSystemDesign design); } [BaseType (typeof (NSObject))] @@ -7750,6 +7777,27 @@ namespace AppKit { [Mac (10,12,2)] [Export ("coalescedTouchesForTouch:")] NSTouch[] GetCoalescedTouches (NSTouch touch); + + [Mac (10,15)] + [Export ("charactersByApplyingModifiers:")] + [return: NullAllowed] + string GetCharacters (NSEventModifierFlags modifiers); + } + + [Flags] + [Native] + [Mac (10,10)] + public enum NSEventModifierFlags : ulong + { + CapsLock = 1uL << 16, + Shift = 1uL << 17, + Control = 1uL << 18, + Option = 1uL << 19, + Command = 1uL << 20, + NumericPad = 1uL << 21, + Help = 1uL << 22, + Function = 1uL << 23, + DeviceIndependentFlagsMask = 0xffff0000L, } [Mac (10,10)] @@ -13153,6 +13201,18 @@ namespace AppKit { [Mac (10,11)] [Export ("maximumExtendedDynamicRangeColorComponentValue")] nfloat MaximumExtendedDynamicRangeColorComponentValue { get; } + + [Mac (10, 15)] + [Export ("maximumPotentialExtendedDynamicRangeColorComponentValue")] + nfloat MaximumPotentialExtendedDynamicRangeColorComponentValue { get; } + + [Mac (10, 15)] + [Export ("maximumReferenceExtendedDynamicRangeColorComponentValue")] + nfloat MaximumReferenceExtendedDynamicRangeColorComponentValue { get; } + + [Mac (10, 15)] + [Export ("localizedName", ArgumentSemantic.Copy)] + string LocalizedName { get; } } [BaseType (typeof (NSControl))] @@ -13983,6 +14043,18 @@ namespace AppKit { [Mac (10,13)] [Export ("view")] INSUserInterfaceCompression View { get; } + + [Mac (10, 15)] + [Export ("doubleValue")] + double DoubleValue { get; set; } + + [Mac (10, 15)] + [Export ("minimumSliderWidth")] + nfloat MinimumSliderWidth { get; set; } + + [Mac (10, 15)] + [Export ("maximumSliderWidth")] + nfloat MaximumSliderWidth { get; set; } } [BaseType (typeof (NSObject))] @@ -15083,6 +15155,8 @@ namespace AppKit { NSString SourceTextScalingDocumentOption { get; } } + delegate NSObject NSStoryboardControllerCreator (NSCoder coder); + [Mac (10,10)] [BaseType (typeof (NSObject))] interface NSStoryboard { @@ -15099,6 +15173,15 @@ namespace AppKit { [Static] [NullAllowed, Export ("mainStoryboard", ArgumentSemantic.Strong)] NSStoryboard MainStoryboard { get; } + + [Mac (10,15)] + [Export ("instantiateInitialControllerWithCreator:")] + [return: NullAllowed] + NSViewController InstantiateInitialController ([NullAllowed] NSStoryboardControllerCreator handler); + + [Mac (10,15)] + [Export ("instantiateControllerWithIdentifier:creator:")] + NSViewController InstantiateController (string identifier, [NullAllowed] NSStoryboardControllerCreator handler); } [Mac (10,10)] @@ -16232,6 +16315,14 @@ namespace AppKit { [Internal] [Export ("sortSubviewsUsingFunction:context:")] void SortSubviews (IntPtr function_pointer, IntPtr context); + + [Mac (10, 15)] + [Export ("horizontalContentSizeConstraintActive")] + bool HorizontalContentSizeConstraintActive { [Bind ("isHorizontalContentSizeConstraintActive")] get; set; } + + [Mac (10, 15)] + [Export ("verticalContentSizeConstraintActive")] + bool VerticalContentSizeConstraintActive { [Bind ("isVerticalContentSizeConstraintActive")] get; set; } } [BaseType (typeof (NSAnimation))] @@ -17906,7 +17997,7 @@ namespace AppKit { } [BaseType (typeof (NSObject))] - interface NSTextAttachment : NSCoding { + interface NSTextAttachment : NSCoding, NSSecureCoding { [Export ("initWithFileWrapper:")] IntPtr Constructor (NSFileWrapper fileWrapper); @@ -17956,7 +18047,7 @@ namespace AppKit { [DesignatedDefaultCtor] [BaseType (typeof (NSObject))] - interface NSTextBlock : NSCoding, NSCopying { + interface NSTextBlock : NSCoding, NSCopying, NSSecureCoding { [Export ("setValue:type:forDimension:")] void SetValue (nfloat val, NSTextBlockValueType type, NSTextBlockDimension dimension); @@ -18375,7 +18466,7 @@ namespace AppKit { } [BaseType (typeof (NSObject))] - interface NSTextList : NSCoding, NSCopying { + interface NSTextList : NSCoding, NSCopying, NSSecureCoding { [Export ("initWithMarkerFormat:options:")] IntPtr Constructor ( #if XAMCORE_4_0 @@ -19716,6 +19807,14 @@ namespace AppKit { [Export ("autovalidates")] bool Autovalidates { get; set; } + + [Mac (10, 15)] + [Export ("title")] + string Title { get; set; } + + [Mac (10, 15)] + [Export ("bordered")] + bool Bordered { [Bind ("isBordered")] get; set; } } [BaseType (typeof (NSToolbarItem))] @@ -19727,6 +19826,36 @@ namespace AppKit { [Export ("subitems", ArgumentSemantic.Copy)] NSToolbarItem[] Subitems { get; set; } + + [Mac (10,15)] + [Static] + [Export ("groupWithItemIdentifier:titles:selectionMode:labels:target:action:")] + NSToolbarItemGroup Create (string itemIdentifier, string[] titles, NSToolbarItemGroupSelectionMode selectionMode, [NullAllowed] string[] labels, [NullAllowed] NSObject target, [NullAllowed] Selector action); + + [Mac (10,15)] + [Static] + [Export ("groupWithItemIdentifier:images:selectionMode:labels:target:action:")] + NSToolbarItemGroup Create (string itemIdentifier, NSImage[] images, NSToolbarItemGroupSelectionMode selectionMode, [NullAllowed] string[] labels, [NullAllowed] NSObject target, [NullAllowed] Selector action); + + [Mac (10, 15)] + [Export ("controlRepresentation", ArgumentSemantic.Assign)] + NSToolbarItemGroupControlRepresentation ControlRepresentation { get; set; } + + [Mac (10, 15)] + [Export ("selectionMode", ArgumentSemantic.Assign)] + NSToolbarItemGroupSelectionMode SelectionMode { get; set; } + + [Mac (10, 15)] + [Export ("selectedIndex")] + nint SelectedIndex { get; set; } + + [Mac (10,15)] + [Export ("setSelected:atIndex:")] + void SetSelected (bool selected, nint index); + + [Mac (10,15)] + [Export ("isSelectedAtIndex:")] + bool GetSelected (nint index); } [DisableDefaultCtor] @@ -21600,6 +21729,21 @@ namespace AppKit { [Mac (10,14)] [Export ("requestAuthorizationOfType:completionHandler:")] void RequestAuthorization (NSWorkspaceAuthorizationType type, Action completionHandler); + + [Mac (10,15)] + [Async] + [Export ("openApplicationAtURL:configuration:completionHandler:")] + void OpenApplication (NSUrl applicationUrl, NSWorkspaceOpenConfiguration configuration, [NullAllowed] Action completionHandler); + + [Mac (10,15)] + [Async] + [Export ("openURL:configuration:completionHandler:")] + void OpenUrl (NSUrl url, NSWorkspaceOpenConfiguration configuration, [NullAllowed] Action completionHandler); + + [Mac (10,15)] + [Async] + [Export ("openURLs:withApplicationAtURL:configuration:completionHandler:")] + void OpenUrls (NSUrl[] urls, NSUrl applicationUrl, NSWorkspaceOpenConfiguration configuration, [NullAllowed] Action completionHandler); } [Mac (10,14)] @@ -22780,6 +22924,10 @@ namespace AppKit { // From NSControlEditingSupport category. Needs to be here to make the API easier to be used. issue 4837 [Export ("validateProposedFirstResponder:forEvent:")] bool ValidateProposedFirstResponder (NSResponder responder, [NullAllowed] NSEvent forEvent); + + [Mac (10,15)] + [Export ("changeModeWithEvent:")] + void ChangeMode (NSEvent withEvent); } [Category, BaseType (typeof (NSResponder))] @@ -22932,6 +23080,10 @@ namespace AppKit { [Notification, Field ("NSTextViewDidChangeTypingAttributesNotification")] NSString DidChangeTypingAttributesNotification { get; } + + [Mac (10, 14)] + [Export ("usesAdaptiveColorMappingForDarkAppearance")] + bool UsesAdaptiveColorMappingForDarkAppearance { get; set; } } partial interface NSView { @@ -23211,7 +23363,7 @@ namespace AppKit { } [BaseType (typeof (NSObject))] - partial interface NSTextAlternatives { + partial interface NSTextAlternatives : NSSecureCoding { [Export ("initWithPrimaryString:alternativeStrings:")] IntPtr Constructor (string primaryString, NSArray alternativeStrings); @@ -27427,4 +27579,278 @@ namespace AppKit { [Export ("customizationLabel")] string CustomizationLabel { get; set; } } + + [Protocol] + [Mac (10,15)] + interface NSTextInputTraits + { + [Export ("autocorrectionType", ArgumentSemantic.Assign)] + NSTextInputTraitType AutocorrectionType { get; set; } + + [Export ("spellCheckingType", ArgumentSemantic.Assign)] + NSTextInputTraitType SpellCheckingType { get; set; } + + [Export ("grammarCheckingType", ArgumentSemantic.Assign)] + NSTextInputTraitType GrammarCheckingType { get; set; } + + [Export ("smartQuotesType", ArgumentSemantic.Assign)] + NSTextInputTraitType SmartQuotesType { get; set; } + + [Export ("smartDashesType", ArgumentSemantic.Assign)] + NSTextInputTraitType SmartDashesType { get; set; } + + [Export ("smartInsertDeleteType", ArgumentSemantic.Assign)] + NSTextInputTraitType SmartInsertDeleteType { get; set; } + + [Export ("textReplacementType", ArgumentSemantic.Assign)] + NSTextInputTraitType TextReplacementType { get; set; } + + [Export ("dataDetectionType", ArgumentSemantic.Assign)] + NSTextInputTraitType DataDetectionType { get; set; } + + [Export ("linkDetectionType", ArgumentSemantic.Assign)] + NSTextInputTraitType LinkDetectionType { get; set; } + + [Export ("textCompletionType", ArgumentSemantic.Assign)] + NSTextInputTraitType TextCompletionType { get; set; } + } + + interface INSTextCheckingClient { } + + [Protocol] + [Mac (10,15)] + interface NSTextCheckingClient : NSTextInputTraits, NSTextInputClient + { + [Abstract] + [Export ("annotatedSubstringForProposedRange:actualRange:")] + [return: NullAllowed] + NSAttributedString GetAnnotatedSubstring (NSRange range, [NullAllowed] ref NSRange actualRange); + + [Abstract] + [Export ("setAnnotations:range:")] + void SetAnnotations (NSDictionary annotations, NSRange range); + + [Abstract] + [Export ("addAnnotations:range:")] + void AddAnnotations (NSDictionary annotations, NSRange range); + + [Abstract] + [Export ("removeAnnotation:range:")] + void RemoveAnnotation (string annotationName, NSRange range); + + [Abstract] + [Export ("replaceCharactersInRange:withAnnotatedString:")] + void ReplaceCharacters (NSRange range, NSAttributedString annotatedString); + + [Abstract] + [Export ("selectAndShowRange:")] + void SelectAndShow (NSRange range); + + [Abstract] + [Export ("viewForRange:firstRect:actualRange:")] + [return: NullAllowed] + NSView GetView (NSRange range, [NullAllowed] ref CGRect firstRect, [NullAllowed] ref NSRange actualRange); + + [Abstract] + [NullAllowed, Export ("candidateListTouchBarItem")] + NSCandidateListTouchBarItem CandidateListTouchBarItem { get; } + } + + [Mac (10,15)] + [BaseType (typeof (NSObject))] + [DisableDefaultCtor] + interface NSWorkspaceOpenConfiguration : NSCopying + { + [Static] + [Export ("configuration")] + NSWorkspaceOpenConfiguration Create (); + + [Export ("promptsUserIfNeeded")] + bool PromptsUserIfNeeded { get; set; } + + [Export ("addsToRecentItems")] + bool AddsToRecentItems { get; set; } + + [Export ("activates")] + bool Activates { get; set; } + + [Export ("hides")] + bool Hides { get; set; } + + [Export ("hidesOthers")] + bool HidesOthers { get; set; } + + [Export ("forPrinting")] + bool ForPrinting { [Bind ("isForPrinting")] get; set; } + + [Export ("createsNewApplicationInstance")] + bool CreatesNewApplicationInstance { get; set; } + + [Export ("allowsRunningApplicationSubstitution")] + bool AllowsRunningApplicationSubstitution { get; set; } + + [Export ("arguments", ArgumentSemantic.Copy)] + string[] Arguments { get; set; } + + [Export ("environment", ArgumentSemantic.Copy)] + NSDictionary Environment { get; set; } + + [NullAllowed, Export ("appleEvent", ArgumentSemantic.Strong)] + NSAppleEventDescriptor AppleEvent { get; set; } + + [Internal] + [Export ("architecture")] + int _LaunchArchitecture { get; set; } + + CFBundle.Architecture LaunchArchitecture { + [Wrap ("(CFBundle.Architecture) this._LaunchArchitecture")] + get; + [Wrap ("this._LaunchArchitecture = (int) value")] + set; + } + + [Export ("requiresUniversalLinks")] + bool RequiresUniversalLinks { get; set; } + } + + [Mac (10,15)] + [BaseType (typeof (NSObject))] + [DisableDefaultCtor] + interface NSTextCheckingController + { + [Export ("initWithClient:")] + [DesignatedInitializer] + IntPtr Constructor (INSTextCheckingClient client); + + [Export ("client")] + INSTextCheckingClient Client { get; } + + [Export ("invalidate")] + void Invalidate (); + + [Export ("didChangeTextInRange:")] + void DidChangeText (NSRange range); + + [Export ("insertedTextInRange:")] + void InsertedText (NSRange range); + + [Export ("didChangeSelectedRange")] + void DidChangeSelectedRange (); + + [Export ("considerTextCheckingForRange:")] + void ConsiderTextChecking (NSRange range); + + [Export ("checkTextInRange:types:options:")] + [EditorBrowsable (EditorBrowsableState.Advanced)] + void CheckText (NSRange range, NSTextCheckingTypes checkingTypes, NSDictionary options); + + [Wrap ("CheckText (range, checkingTypes, options?.Dictionary)")] + void CheckText (NSRange range, NSTextCheckingTypes checkingTypes, NSTextCheckingOptions options); + + [Export ("checkTextInSelection:")] + void CheckTextInSelection ([NullAllowed] NSObject sender); + + [Export ("checkTextInDocument:")] + void CheckTextInDocument ([NullAllowed] NSObject sender); + + [Export ("orderFrontSubstitutionsPanel:")] + void OrderFrontSubstitutionsPanel ([NullAllowed] NSObject sender); + + [Export ("checkSpelling:")] + void CheckSpelling ([NullAllowed] NSObject sender); + + [Export ("showGuessPanel:")] + void ShowGuessPanel ([NullAllowed] NSObject sender); + + [Export ("changeSpelling:")] + void ChangeSpelling ([NullAllowed] NSObject sender); + + [Export ("ignoreSpelling:")] + void IgnoreSpelling ([NullAllowed] NSObject sender); + + [Export ("updateCandidates")] + void UpdateCandidates (); + + [Export ("validAnnotations")] + string[] ValidAnnotations { get; } + + [Export ("menuAtIndex:clickedOnSelection:effectiveRange:")] + [return: NullAllowed] + NSMenu GetMenu (nuint location, bool clickedOnSelection, ref NSRange effectiveRange); + + [Export ("spellCheckerDocumentTag")] + nint SpellCheckerDocumentTag { get; set; } + } + + delegate NSCollectionViewItem NSCollectionViewDiffableDataSourceItemProvider (NSCollectionView collectionView, NSIndexPath indexPath, NSObject itemIdentifierType); + + delegate NSView NSCollectionViewDiffableDataSourceSupplementaryViewProvider (NSCollectionView collectionView, string str, NSIndexPath indexPath); + + [Mac (10,15)] + [BaseType (typeof (NSObject))] + [DisableDefaultCtor] + interface NSCollectionViewDiffableDataSource : NSCollectionViewDataSource + where SectionIdentifierType : NSObject + where ItemIdentifierType : NSObject { + + [Export ("initWithCollectionView:itemProvider:")] + IntPtr Constructor (NSCollectionView collectionView, NSCollectionViewDiffableDataSourceItemProvider itemProvider); + + [Export ("snapshot")] + NSDiffableDataSourceSnapshot Snapshot { get; } + + [Export ("applySnapshot:animatingDifferences:")] + void Apply (NSDiffableDataSourceSnapshot snapshot, bool animatingDifferences); + + [Export ("itemIdentifierForIndexPath:")] + [return: NullAllowed] + ItemIdentifierType GetItemIdentifier (NSIndexPath indexPath); + + [Export ("indexPathForItemIdentifier:")] + [return: NullAllowed] + NSIndexPath GetIndexPath (ItemIdentifierType identifier); + + [NullAllowed, Export ("supplementaryViewProvider", ArgumentSemantic.Copy)] + NSCollectionViewDiffableDataSourceSupplementaryViewProvider SupplementaryViewProvider { get; set; } + } + + [Mac (10, 15)] + public enum NSFontDescriptorSystemDesign + { + [Field ("NSFontDescriptorSystemDesignDefault")] + Default, + + [Field ("NSFontDescriptorSystemDesignSerif")] + Serif, + + [Field ("NSFontDescriptorSystemDesignMonospaced")] + Monospaced, + + [Field ("NSFontDescriptorSystemDesignRounded")] + Rounded, + } + + [Mac (10,15), iOS (10,13)] + [BaseType (typeof (NSToolbarItem))] + interface NSSharingServicePickerToolbarItem + { + [Wrap ("WeakDelegate")] + [NullAllowed] + INSSharingServicePickerToolbarItemDelegate Delegate { get; set; } + + [NullAllowed, Export ("delegate", ArgumentSemantic.Weak)] + NSObject WeakDelegate { get; set; } + } + + public interface INSSharingServicePickerToolbarItemDelegate { } + + [Mac (10,15)] + [Protocol, Model (AutoGeneratedName = true)] + [BaseType (typeof (NSSharingServicePickerDelegate))] + interface NSSharingServicePickerToolbarItemDelegate + { + [Abstract] + [Export ("itemsForSharingServicePickerToolbarItem:")] + NSObject[] GetItems (NSSharingServicePickerToolbarItem pickerToolbarItem); + } } diff --git a/src/foundation.cs b/src/foundation.cs index b6105a57d2..a470def735 100644 --- a/src/foundation.cs +++ b/src/foundation.cs @@ -9000,6 +9000,17 @@ namespace Foundation [Static] [Export ("notApplicableSelectionMarker", ArgumentSemantic.Strong)] NSBindingSelectionMarker NotApplicableSelectionMarker { get; } + + [Mac (10,15)] + [Static] + [Export ("setDefaultPlaceholder:forMarker:onClass:withBinding:")] + void SetDefaultPlaceholder ([NullAllowed] NSObject placeholder, [NullAllowed] NSBindingSelectionMarker marker, Class objectClass, string binding); + + [Mac (10,15)] + [Static] + [Export ("defaultPlaceholderForMarker:onClass:withBinding:")] + [return: NullAllowed] + NSObject GetDefaultPlaceholder ([NullAllowed] NSBindingSelectionMarker marker, Class objectClass, string binding); } [Protocol (Name = "NSObject")] // exists both as a type and a protocol in ObjC, Swift uses NSObjectProtocol diff --git a/src/frameworks.sources b/src/frameworks.sources index d57a9b3a11..7e2a15ae64 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -420,6 +420,7 @@ COREFOUNDATION_CORE_SOURCES = \ CoreFoundation/Dispatch.cs \ CoreFoundation/DispatchData.cs \ CoreFoundation/NativeObject.cs \ + CoreFoundation/Architecture.cs \ COREFOUNDATION_SOURCES = \ CoreFoundation/CFAllocator.cs \ diff --git a/src/uikit.cs b/src/uikit.cs index 4949349f58..58bfa72ed2 100644 --- a/src/uikit.cs +++ b/src/uikit.cs @@ -20852,89 +20852,6 @@ namespace UIKit { UITabBarItemStateAppearance Focused { get; } } - [NoWatch, TV (13,0), iOS (13,0)] - [BaseType (typeof (NSObject))] - interface NSDiffableDataSourceSnapshot : NSCopying - where SectionIdentifierType : NSObject - where ItemIdentifierType : NSObject { - - [Export ("numberOfItems")] - nint NumberOfItems { get; } - - [Export ("numberOfSections")] - nint NumberOfSections { get; } - - [Export ("sectionIdentifiers")] - SectionIdentifierType [] SectionIdentifiers { get; } - - [Export ("itemIdentifiers")] - ItemIdentifierType [] ItemIdentifiers { get; } - - [Export ("numberOfItemsInSection:")] - nint GetNumberOfItems (SectionIdentifierType sectionIdentifier); - - [Export ("itemIdentifiersInSectionWithIdentifier:")] - ItemIdentifierType [] GetItemIdentifiersInSection (SectionIdentifierType sectionIdentifier); - - [Export ("sectionIdentifierForSectionContainingItemIdentifier:")] - [return: NullAllowed] - SectionIdentifierType GetSectionIdentifierForSection (ItemIdentifierType itemIdentifier); - - [Export ("indexOfItemIdentifier:")] - nint GetIndex (ItemIdentifierType itemIdentifier); - - [Export ("indexOfSectionIdentifier:")] - nint GetIndex (SectionIdentifierType sectionIdentifier); - - [Export ("appendItemsWithIdentifiers:")] - void AppendItems (ItemIdentifierType [] identifiers); - - [Export ("appendItemsWithIdentifiers:intoSectionWithIdentifier:")] - void AppendItems (ItemIdentifierType [] identifiers, SectionIdentifierType sectionIdentifier); - - [Export ("insertItemsWithIdentifiers:beforeItemWithIdentifier:")] - void InsertItemsBefore (ItemIdentifierType [] identifiers, ItemIdentifierType itemIdentifier); - - [Export ("insertItemsWithIdentifiers:afterItemWithIdentifier:")] - void InsertItemsAfter (ItemIdentifierType [] identifiers, ItemIdentifierType itemIdentifier); - - [Export ("deleteItemsWithIdentifiers:")] - void DeleteItems (ItemIdentifierType [] identifiers); - - [Export ("deleteAllItems")] - void DeleteAllItems (); - - [Export ("moveItemWithIdentifier:beforeItemWithIdentifier:")] - void MoveItemBefore (ItemIdentifierType fromIdentifier, ItemIdentifierType toIdentifier); - - [Export ("moveItemWithIdentifier:afterItemWithIdentifier:")] - void MoveItemAfter (ItemIdentifierType fromIdentifier, ItemIdentifierType toIdentifier); - - [Export ("reloadItemsWithIdentifiers:")] - void ReloadItems (ItemIdentifierType [] identifiers); - - [Export ("appendSectionsWithIdentifiers:")] - void AppendSections (SectionIdentifierType [] sectionIdentifiers); - - [Export ("insertSectionsWithIdentifiers:beforeSectionWithIdentifier:")] - void InsertSectionsBefore (SectionIdentifierType [] sectionIdentifiers, SectionIdentifierType toSectionIdentifier); - - [Export ("insertSectionsWithIdentifiers:afterSectionWithIdentifier:")] - void InsertSectionsAfter (SectionIdentifierType [] sectionIdentifiers, SectionIdentifierType toSectionIdentifier); - - [Export ("deleteSectionsWithIdentifiers:")] - void DeleteSections (SectionIdentifierType [] sectionIdentifiers); - - [Export ("moveSectionWithIdentifier:beforeSectionWithIdentifier:")] - void MoveSectionBefore (SectionIdentifierType fromSectionIdentifier, SectionIdentifierType toSectionIdentifier); - - [Export ("moveSectionWithIdentifier:afterSectionWithIdentifier:")] - void MoveSectionAfter (SectionIdentifierType fromSectionIdentifier, SectionIdentifierType toSectionIdentifier); - - [Export ("reloadSectionsWithIdentifiers:")] - void ReloadSections (SectionIdentifierType [] sectionIdentifiers); - } - [NoWatch, TV (13,0), iOS (13,0)] delegate UICollectionViewCell UICollectionViewDiffableDataSourceCellProvider (UICollectionView collectionView, NSIndexPath indexPath, NSObject obj); diff --git a/src/xkit.cs b/src/xkit.cs index 040923ba24..ac6758ab0c 100644 --- a/src/xkit.cs +++ b/src/xkit.cs @@ -1190,4 +1190,87 @@ namespace UIKit { [Export ("layoutManager:shouldSetLineFragmentRect:lineFragmentUsedRect:baselineOffset:inTextContainer:forGlyphRange:")] bool ShouldSetLineFragmentRect (NSLayoutManager layoutManager, ref CGRect lineFragmentRect, ref CGRect lineFragmentUsedRect, ref nfloat baselineOffset, NSTextContainer textContainer, NSRange glyphRange); } + + [NoWatch, TV (13,0), Mac (10,15), iOS (13,0)] + [BaseType (typeof (NSObject))] + interface NSDiffableDataSourceSnapshot : NSCopying + where SectionIdentifierType : NSObject + where ItemIdentifierType : NSObject { + + [Export ("numberOfItems")] + nint NumberOfItems { get; } + + [Export ("numberOfSections")] + nint NumberOfSections { get; } + + [Export ("sectionIdentifiers")] + SectionIdentifierType [] SectionIdentifiers { get; } + + [Export ("itemIdentifiers")] + ItemIdentifierType [] ItemIdentifiers { get; } + + [Export ("numberOfItemsInSection:")] + nint GetNumberOfItems (SectionIdentifierType sectionIdentifier); + + [Export ("itemIdentifiersInSectionWithIdentifier:")] + ItemIdentifierType [] GetItemIdentifiersInSection (SectionIdentifierType sectionIdentifier); + + [Export ("sectionIdentifierForSectionContainingItemIdentifier:")] + [return: NullAllowed] + SectionIdentifierType GetSectionIdentifierForSection (ItemIdentifierType itemIdentifier); + + [Export ("indexOfItemIdentifier:")] + nint GetIndex (ItemIdentifierType itemIdentifier); + + [Export ("indexOfSectionIdentifier:")] + nint GetIndex (SectionIdentifierType sectionIdentifier); + + [Export ("appendItemsWithIdentifiers:")] + void AppendItems (ItemIdentifierType [] identifiers); + + [Export ("appendItemsWithIdentifiers:intoSectionWithIdentifier:")] + void AppendItems (ItemIdentifierType [] identifiers, SectionIdentifierType sectionIdentifier); + + [Export ("insertItemsWithIdentifiers:beforeItemWithIdentifier:")] + void InsertItemsBefore (ItemIdentifierType [] identifiers, ItemIdentifierType itemIdentifier); + + [Export ("insertItemsWithIdentifiers:afterItemWithIdentifier:")] + void InsertItemsAfter (ItemIdentifierType [] identifiers, ItemIdentifierType itemIdentifier); + + [Export ("deleteItemsWithIdentifiers:")] + void DeleteItems (ItemIdentifierType [] identifiers); + + [Export ("deleteAllItems")] + void DeleteAllItems (); + + [Export ("moveItemWithIdentifier:beforeItemWithIdentifier:")] + void MoveItemBefore (ItemIdentifierType fromIdentifier, ItemIdentifierType toIdentifier); + + [Export ("moveItemWithIdentifier:afterItemWithIdentifier:")] + void MoveItemAfter (ItemIdentifierType fromIdentifier, ItemIdentifierType toIdentifier); + + [Export ("reloadItemsWithIdentifiers:")] + void ReloadItems (ItemIdentifierType [] identifiers); + + [Export ("appendSectionsWithIdentifiers:")] + void AppendSections (SectionIdentifierType [] sectionIdentifiers); + + [Export ("insertSectionsWithIdentifiers:beforeSectionWithIdentifier:")] + void InsertSectionsBefore (SectionIdentifierType [] sectionIdentifiers, SectionIdentifierType toSectionIdentifier); + + [Export ("insertSectionsWithIdentifiers:afterSectionWithIdentifier:")] + void InsertSectionsAfter (SectionIdentifierType [] sectionIdentifiers, SectionIdentifierType toSectionIdentifier); + + [Export ("deleteSectionsWithIdentifiers:")] + void DeleteSections (SectionIdentifierType [] sectionIdentifiers); + + [Export ("moveSectionWithIdentifier:beforeSectionWithIdentifier:")] + void MoveSectionBefore (SectionIdentifierType fromSectionIdentifier, SectionIdentifierType toSectionIdentifier); + + [Export ("moveSectionWithIdentifier:afterSectionWithIdentifier:")] + void MoveSectionAfter (SectionIdentifierType fromSectionIdentifier, SectionIdentifierType toSectionIdentifier); + + [Export ("reloadSectionsWithIdentifiers:")] + void ReloadSections (SectionIdentifierType [] sectionIdentifiers); + } } diff --git a/tests/introspection/ApiCtorInitTest.cs b/tests/introspection/ApiCtorInitTest.cs index 306581cd22..8573d640db 100644 --- a/tests/introspection/ApiCtorInitTest.cs +++ b/tests/introspection/ApiCtorInitTest.cs @@ -489,6 +489,10 @@ namespace Introspection { if (ctor.ToString () == $"Void .ctor(System.String)") return true; break; + case "NSSharingServicePickerToolbarItem": // This type doesn't have .ctors + if (ctor.ToString () == $"Void .ctor(System.String)") + return true; + break; } var ep = ctor.GetParameters (); diff --git a/tests/xtro-sharpie/macOS-AppKit.ignore b/tests/xtro-sharpie/macOS-AppKit.ignore index cc627c9348..d64d387866 100644 --- a/tests/xtro-sharpie/macOS-AppKit.ignore +++ b/tests/xtro-sharpie/macOS-AppKit.ignore @@ -156,7 +156,6 @@ !missing-enum! NSBackingStoreType not bound !missing-enum! NSCellHitResult not bound !missing-enum! NSColorPanelOptions not bound -!missing-enum! NSEventModifierFlags not bound !missing-enum! NSFindPanelAction not bound !missing-enum! NSFindPanelSubstringMatchType not bound !missing-enum! NSFontAction not bound @@ -1208,3 +1207,5 @@ !missing-selector! NSImageNSImage::setCachedSeparately: not bound !missing-selector! NSImageNSImage::setDataRetained: not bound !missing-selector! NSImageNSImage::setScalesWhenResized: not bound +!missing-selector! NSMovie::init not bound +!missing-selector! NSMovie::initWithCoder: not bound diff --git a/tests/xtro-sharpie/macOS-AppKit.todo b/tests/xtro-sharpie/macOS-AppKit.todo index d76a107c93..e69de29bb2 100644 --- a/tests/xtro-sharpie/macOS-AppKit.todo +++ b/tests/xtro-sharpie/macOS-AppKit.todo @@ -1,143 +0,0 @@ -!missing-field! NSFontDescriptorSystemDesignDefault not bound -!missing-field! NSFontDescriptorSystemDesignMonospaced not bound -!missing-field! NSFontDescriptorSystemDesignRounded not bound -!missing-field! NSFontDescriptorSystemDesignSerif not bound -!missing-protocol! NSTextCheckingClient not bound -!missing-protocol! NSTextInputTraits not bound -!missing-protocol-conformance! NSTextAlternatives should conform to NSSecureCoding -!missing-protocol-conformance! NSTextAttachment should conform to NSSecureCoding -!missing-protocol-conformance! NSTextBlock should conform to NSSecureCoding -!missing-protocol-conformance! NSTextList should conform to NSSecureCoding -!missing-selector! +NSBindingSelectionMarker::defaultPlaceholderForMarker:onClass:withBinding: not bound -!missing-selector! +NSBindingSelectionMarker::setDefaultPlaceholder:forMarker:onClass:withBinding: not bound -!missing-selector! +NSColor::colorWithName:dynamicProvider: not bound -!missing-selector! +NSColor::systemIndigoColor not bound -!missing-selector! +NSColor::systemTealColor not bound -!missing-selector! +NSFont::monospacedSystemFontOfSize:weight: not bound -!missing-selector! +NSToolbarItemGroup::groupWithItemIdentifier:images:selectionMode:labels:target:action: not bound -!missing-selector! +NSToolbarItemGroup::groupWithItemIdentifier:titles:selectionMode:labels:target:action: not bound -!missing-selector! +NSWorkspaceOpenConfiguration::configuration not bound -!missing-selector! NSCollectionViewDiffableDataSource::applySnapshot:animatingDifferences: not bound -!missing-selector! NSCollectionViewDiffableDataSource::indexPathForItemIdentifier: not bound -!missing-selector! NSCollectionViewDiffableDataSource::initWithCollectionView:itemProvider: not bound -!missing-selector! NSCollectionViewDiffableDataSource::itemIdentifierForIndexPath: not bound -!missing-selector! NSCollectionViewDiffableDataSource::setSupplementaryViewProvider: not bound -!missing-selector! NSCollectionViewDiffableDataSource::snapshot not bound -!missing-selector! NSCollectionViewDiffableDataSource::supplementaryViewProvider not bound -!missing-selector! NSDiffableDataSourceSnapshot::appendItemsWithIdentifiers: not bound -!missing-selector! NSDiffableDataSourceSnapshot::appendItemsWithIdentifiers:intoSectionWithIdentifier: not bound -!missing-selector! NSDiffableDataSourceSnapshot::appendSectionsWithIdentifiers: not bound -!missing-selector! NSDiffableDataSourceSnapshot::deleteAllItems not bound -!missing-selector! NSDiffableDataSourceSnapshot::deleteItemsWithIdentifiers: not bound -!missing-selector! NSDiffableDataSourceSnapshot::deleteSectionsWithIdentifiers: not bound -!missing-selector! NSDiffableDataSourceSnapshot::indexOfItemIdentifier: not bound -!missing-selector! NSDiffableDataSourceSnapshot::indexOfSectionIdentifier: not bound -!missing-selector! NSDiffableDataSourceSnapshot::insertItemsWithIdentifiers:afterItemWithIdentifier: not bound -!missing-selector! NSDiffableDataSourceSnapshot::insertItemsWithIdentifiers:beforeItemWithIdentifier: not bound -!missing-selector! NSDiffableDataSourceSnapshot::insertSectionsWithIdentifiers:afterSectionWithIdentifier: not bound -!missing-selector! NSDiffableDataSourceSnapshot::insertSectionsWithIdentifiers:beforeSectionWithIdentifier: not bound -!missing-selector! NSDiffableDataSourceSnapshot::itemIdentifiers not bound -!missing-selector! NSDiffableDataSourceSnapshot::itemIdentifiersInSectionWithIdentifier: not bound -!missing-selector! NSDiffableDataSourceSnapshot::moveItemWithIdentifier:afterItemWithIdentifier: not bound -!missing-selector! NSDiffableDataSourceSnapshot::moveItemWithIdentifier:beforeItemWithIdentifier: not bound -!missing-selector! NSDiffableDataSourceSnapshot::moveSectionWithIdentifier:afterSectionWithIdentifier: not bound -!missing-selector! NSDiffableDataSourceSnapshot::moveSectionWithIdentifier:beforeSectionWithIdentifier: not bound -!missing-selector! NSDiffableDataSourceSnapshot::numberOfItems not bound -!missing-selector! NSDiffableDataSourceSnapshot::numberOfItemsInSection: not bound -!missing-selector! NSDiffableDataSourceSnapshot::numberOfSections not bound -!missing-selector! NSDiffableDataSourceSnapshot::reloadItemsWithIdentifiers: not bound -!missing-selector! NSDiffableDataSourceSnapshot::reloadSectionsWithIdentifiers: not bound -!missing-selector! NSDiffableDataSourceSnapshot::sectionIdentifierForSectionContainingItemIdentifier: not bound -!missing-selector! NSDiffableDataSourceSnapshot::sectionIdentifiers not bound -!missing-selector! NSEvent::charactersByApplyingModifiers: not bound -!missing-selector! NSFontDescriptor::fontDescriptorWithDesign: not bound -!missing-selector! NSMovie::init not bound -!missing-selector! NSMovie::initWithCoder: not bound -!missing-selector! NSResponder::changeModeWithEvent: not bound -!missing-selector! NSScreen::localizedName not bound -!missing-selector! NSScreenNSScreen::maximumPotentialExtendedDynamicRangeColorComponentValue not bound -!missing-selector! NSScreenNSScreen::maximumReferenceExtendedDynamicRangeColorComponentValue not bound -!missing-selector! NSSliderTouchBarItem::doubleValue not bound -!missing-selector! NSSliderTouchBarItem::maximumSliderWidth not bound -!missing-selector! NSSliderTouchBarItem::minimumSliderWidth not bound -!missing-selector! NSSliderTouchBarItem::setDoubleValue: not bound -!missing-selector! NSSliderTouchBarItem::setMaximumSliderWidth: not bound -!missing-selector! NSSliderTouchBarItem::setMinimumSliderWidth: not bound -!missing-selector! NSStoryboard::instantiateControllerWithIdentifier:creator: not bound -!missing-selector! NSStoryboard::instantiateInitialControllerWithCreator: not bound -!missing-selector! NSTextCheckingController::changeSpelling: not bound -!missing-selector! NSTextCheckingController::checkSpelling: not bound -!missing-selector! NSTextCheckingController::checkTextInDocument: not bound -!missing-selector! NSTextCheckingController::checkTextInRange:types:options: not bound -!missing-selector! NSTextCheckingController::checkTextInSelection: not bound -!missing-selector! NSTextCheckingController::client not bound -!missing-selector! NSTextCheckingController::considerTextCheckingForRange: not bound -!missing-selector! NSTextCheckingController::didChangeSelectedRange not bound -!missing-selector! NSTextCheckingController::didChangeTextInRange: not bound -!missing-selector! NSTextCheckingController::ignoreSpelling: not bound -!missing-selector! NSTextCheckingController::initWithClient: not bound -!missing-selector! NSTextCheckingController::insertedTextInRange: not bound -!missing-selector! NSTextCheckingController::invalidate not bound -!missing-selector! NSTextCheckingController::menuAtIndex:clickedOnSelection:effectiveRange: not bound -!missing-selector! NSTextCheckingController::orderFrontSubstitutionsPanel: not bound -!missing-selector! NSTextCheckingController::setSpellCheckerDocumentTag: not bound -!missing-selector! NSTextCheckingController::showGuessPanel: not bound -!missing-selector! NSTextCheckingController::spellCheckerDocumentTag not bound -!missing-selector! NSTextCheckingController::updateCandidates not bound -!missing-selector! NSTextCheckingController::validAnnotations not bound -!missing-selector! NSTextView::setUsesAdaptiveColorMappingForDarkAppearance: not bound -!missing-selector! NSTextView::usesAdaptiveColorMappingForDarkAppearance not bound -!missing-selector! NSToolbarItem::isBordered not bound -!missing-selector! NSToolbarItem::setBordered: not bound -!missing-selector! NSToolbarItem::setTitle: not bound -!missing-selector! NSToolbarItem::title not bound -!missing-selector! NSToolbarItemGroup::controlRepresentation not bound -!missing-selector! NSToolbarItemGroup::isSelectedAtIndex: not bound -!missing-selector! NSToolbarItemGroup::selectedIndex not bound -!missing-selector! NSToolbarItemGroup::selectionMode not bound -!missing-selector! NSToolbarItemGroup::setControlRepresentation: not bound -!missing-selector! NSToolbarItemGroup::setSelected:atIndex: not bound -!missing-selector! NSToolbarItemGroup::setSelectedIndex: not bound -!missing-selector! NSToolbarItemGroup::setSelectionMode: not bound -!missing-selector! NSView::isHorizontalContentSizeConstraintActive not bound -!missing-selector! NSView::isVerticalContentSizeConstraintActive not bound -!missing-selector! NSView::setHorizontalContentSizeConstraintActive: not bound -!missing-selector! NSView::setVerticalContentSizeConstraintActive: not bound -!missing-selector! NSWorkspace::openApplicationAtURL:configuration:completionHandler: not bound -!missing-selector! NSWorkspace::openURL:configuration:completionHandler: not bound -!missing-selector! NSWorkspace::openURLs:withApplicationAtURL:configuration:completionHandler: not bound -!missing-selector! NSWorkspaceOpenConfiguration::activates not bound -!missing-selector! NSWorkspaceOpenConfiguration::addsToRecentItems not bound -!missing-selector! NSWorkspaceOpenConfiguration::appleEvent not bound -!missing-selector! NSWorkspaceOpenConfiguration::architecture not bound -!missing-selector! NSWorkspaceOpenConfiguration::arguments not bound -!missing-selector! NSWorkspaceOpenConfiguration::createsNewApplicationInstance not bound -!missing-selector! NSWorkspaceOpenConfiguration::environment not bound -!missing-selector! NSWorkspaceOpenConfiguration::hides not bound -!missing-selector! NSWorkspaceOpenConfiguration::hidesOthers not bound -!missing-selector! NSWorkspaceOpenConfiguration::isForPrinting not bound -!missing-selector! NSWorkspaceOpenConfiguration::promptsUserIfNeeded not bound -!missing-selector! NSWorkspaceOpenConfiguration::requiresUniversalLinks not bound -!missing-selector! NSWorkspaceOpenConfiguration::setActivates: not bound -!missing-selector! NSWorkspaceOpenConfiguration::setAddsToRecentItems: not bound -!missing-selector! NSWorkspaceOpenConfiguration::setAppleEvent: not bound -!missing-selector! NSWorkspaceOpenConfiguration::setArchitecture: not bound -!missing-selector! NSWorkspaceOpenConfiguration::setArguments: not bound -!missing-selector! NSWorkspaceOpenConfiguration::setCreatesNewApplicationInstance: not bound -!missing-selector! NSWorkspaceOpenConfiguration::setEnvironment: not bound -!missing-selector! NSWorkspaceOpenConfiguration::setForPrinting: not bound -!missing-selector! NSWorkspaceOpenConfiguration::setHides: not bound -!missing-selector! NSWorkspaceOpenConfiguration::setHidesOthers: not bound -!missing-selector! NSWorkspaceOpenConfiguration::setPromptsUserIfNeeded: not bound -!missing-selector! NSWorkspaceOpenConfiguration::setRequiresUniversalLinks: not bound -!missing-type! NSCollectionViewDiffableDataSource not bound -!missing-type! NSDiffableDataSourceSnapshot not bound -!missing-type! NSTextCheckingController not bound -!missing-type! NSWorkspaceOpenConfiguration not bound -!missing-protocol! NSSharingServicePickerToolbarItemDelegate not bound -!missing-selector! NSSharingServicePickerToolbarItem::delegate not bound -!missing-selector! NSSharingServicePickerToolbarItem::setDelegate: not bound -!missing-type! NSSharingServicePickerToolbarItem not bound -## appended from unclassified file -!missing-selector! NSWorkspaceOpenConfiguration::allowsRunningApplicationSubstitution not bound -!missing-selector! NSWorkspaceOpenConfiguration::setAllowsRunningApplicationSubstitution: not bound From 346dc174475319636e002c7fb8ecb42638f1dce5 Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Tue, 29 Oct 2019 10:18:38 -0400 Subject: [PATCH 048/100] Update Xcode11.2 package version to stable (.6) (#7320) In anticipation of Xcode 11.2 release to stable which should be any time soon now that iOS 13.2 and tvOS 13.2 are out. --- Make.versions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Make.versions b/Make.versions index 69fe268b04..9ad3356d82 100644 --- a/Make.versions +++ b/Make.versions @@ -43,5 +43,5 @@ # line changed in git). # -IOS_PACKAGE_VERSION=13.5.0.$(IOS_COMMIT_DISTANCE) -MAC_PACKAGE_VERSION=6.5.0.$(MAC_COMMIT_DISTANCE) +IOS_PACKAGE_VERSION=13.6.0.$(IOS_COMMIT_DISTANCE) +MAC_PACKAGE_VERSION=6.6.0.$(MAC_COMMIT_DISTANCE) From 25da8b43a241f4f5bea84f5a41881f86f18f486e Mon Sep 17 00:00:00 2001 From: Waleed Chaudhry <54864665+wachaudh@users.noreply.github.com> Date: Tue, 29 Oct 2019 10:52:03 -0400 Subject: [PATCH 049/100] [AuthenticationServices] Add AuthenticationServices bindings for xcode11.2 (#7315) --- src/authenticationservices.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/authenticationservices.cs b/src/authenticationservices.cs index fbb8362481..c2b9a464b5 100644 --- a/src/authenticationservices.cs +++ b/src/authenticationservices.cs @@ -608,6 +608,8 @@ namespace AuthenticationServices { enum ASAuthorizationAppleIdButtonType : long { SignIn, Continue, + [TV (13,2), Mac (10,15,1), iOS (13,2)] + SignUp, Default = SignIn, } From 04d2436587d6206a58772b2b72deb69f1ab38f20 Mon Sep 17 00:00:00 2001 From: Whitney Schmidt <51677938+whitneyschmidt@users.noreply.github.com> Date: Tue, 29 Oct 2019 11:42:32 -0400 Subject: [PATCH 050/100] [Xcode 11.2] Callkit updates (#7322) * callkit updates for 11.2 * remove availability attributes for error enum --- src/callkit.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/callkit.cs b/src/callkit.cs index a926ed3f8f..ef76cc2527 100644 --- a/src/callkit.cs +++ b/src/callkit.cs @@ -30,7 +30,9 @@ namespace CallKit { [ErrorDomain ("CXErrorDomain")] [Native] public enum CXErrorCode : long { - Unknown = 0 + Unknown = 0, + Unentitled = 1, + InvalidArgument = 2, } [iOS (10, 0)] From 54572a9f7b9724a40b899a41a72cac156272f069 Mon Sep 17 00:00:00 2001 From: Whitney Schmidt <51677938+whitneyschmidt@users.noreply.github.com> Date: Tue, 29 Oct 2019 11:42:55 -0400 Subject: [PATCH 051/100] add avmetadata updates (#7316) --- src/AVFoundation/AVMetadataObject.cs | 8 ++++++++ src/AVFoundation/Enums.cs | 12 ++++++++++++ src/avfoundation.cs | 8 ++++---- tests/xtro-sharpie/macOS-AVFoundation.ignore | 4 ---- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/AVFoundation/AVMetadataObject.cs b/src/AVFoundation/AVMetadataObject.cs index ffaf72fb59..7b1b73a1c7 100644 --- a/src/AVFoundation/AVMetadataObject.cs +++ b/src/AVFoundation/AVMetadataObject.cs @@ -105,6 +105,14 @@ namespace AVFoundation { return AVMetadataObjectType.ITF14Code; else if (obj == AVMetadataObject.TypeDataMatrixCode) return AVMetadataObjectType.DataMatrixCode; + else if (obj == AVMetadataObject.TypeCatBody) + return AVMetadataObjectType.CatBody; + else if (obj == AVMetadataObject.TypeDogBody) + return AVMetadataObjectType.DogBody; + else if (obj == AVMetadataObject.TypeHumanBody) + return AVMetadataObjectType.HumanBody; + else if (obj == AVMetadataObject.TypeSalientObject) + return AVMetadataObjectType.SalientObject; else throw new ArgumentOutOfRangeException (string.Format ("Unexpected AVMetadataObjectType: {0}", obj)); } diff --git a/src/AVFoundation/Enums.cs b/src/AVFoundation/Enums.cs index 90d011b293..2c43ff6fd6 100644 --- a/src/AVFoundation/Enums.cs +++ b/src/AVFoundation/Enums.cs @@ -630,6 +630,18 @@ namespace AVFoundation { [iOS (8,0)] DataMatrixCode = 1 << 13, + + [iOS (13,0)] + CatBody = 1 << 14, + + [iOS (13,0)] + DogBody = 1 << 15, + + [iOS (13,0)] + HumanBody = 1 << 16, + + [iOS (13,0)] + SalientObject = 1 << 17, } #if !MONOMAC diff --git a/src/avfoundation.cs b/src/avfoundation.cs index 8be7dbbe5a..da307d3d1a 100644 --- a/src/avfoundation.cs +++ b/src/avfoundation.cs @@ -6672,19 +6672,19 @@ namespace AVFoundation { [Field ("AVMetadataObjectTypeDataMatrixCode")] NSString TypeDataMatrixCode { get; } - [NoWatch, NoTV, NoMac, iOS (13, 0)] + [NoWatch, NoTV, iOS (13, 0), Mac (10, 15)] [Field ("AVMetadataObjectTypeCatBody")] NSString TypeCatBody { get; } - [NoWatch, NoTV, NoMac, iOS (13, 0)] + [NoWatch, NoTV, iOS (13, 0), Mac (10, 15)] [Field ("AVMetadataObjectTypeDogBody")] NSString TypeDogBody { get; } - [NoWatch, NoTV, NoMac, iOS (13, 0)] + [NoWatch, NoTV, iOS (13, 0), Mac (10, 15)] [Field ("AVMetadataObjectTypeHumanBody")] NSString TypeHumanBody { get; } - [NoWatch, NoTV, NoMac, iOS (13, 0)] + [NoWatch, NoTV, iOS (13, 0), Mac (10, 15)] [Field ("AVMetadataObjectTypeSalientObject")] NSString TypeSalientObject { get; } } diff --git a/tests/xtro-sharpie/macOS-AVFoundation.ignore b/tests/xtro-sharpie/macOS-AVFoundation.ignore index b6af45b024..19507878f0 100644 --- a/tests/xtro-sharpie/macOS-AVFoundation.ignore +++ b/tests/xtro-sharpie/macOS-AVFoundation.ignore @@ -39,7 +39,3 @@ !missing-field! AVMetadataIdentifierQuickTimeMetadataLivePhotoVitalityScoringVersion not bound !missing-field! AVMetadataIdentifierQuickTimeMetadataSpatialOverCaptureQualityScore not bound !missing-field! AVMetadataIdentifierQuickTimeMetadataSpatialOverCaptureQualityScoringVersion not bound -!missing-field! AVMetadataObjectTypeCatBody not bound -!missing-field! AVMetadataObjectTypeDogBody not bound -!missing-field! AVMetadataObjectTypeHumanBody not bound -!missing-field! AVMetadataObjectTypeSalientObject not bound From 90982b64b4ec18f196566586e9600b43a31a58e6 Mon Sep 17 00:00:00 2001 From: Waleed Chaudhry <54864665+wachaudh@users.noreply.github.com> Date: Tue, 29 Oct 2019 14:06:02 -0400 Subject: [PATCH 052/100] [CoreGraphics] Add CoreGraphics bindings for xcode11.2b2 (#7327) --- src/CoreGraphics/CGEventTypes.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/CoreGraphics/CGEventTypes.cs b/src/CoreGraphics/CGEventTypes.cs index a71581821a..f317e0d5ca 100644 --- a/src/CoreGraphics/CGEventTypes.cs +++ b/src/CoreGraphics/CGEventTypes.cs @@ -140,7 +140,11 @@ namespace CoreGraphics { EventSourceUserID = 43, EventSourceGroupID = 44, EventSourceStateID = 45, - ScrollWheelEventIsContinuous = 88 + ScrollWheelEventIsContinuous = 88, + EventWindowUnderMousePointer = 91, + EventWindowUnderMousePointerThatCanHandleThisEvent = 92, + EventUnacceleratedPointerMovementX = 170, + EventUnacceleratedPointerMovementY = 171, } // CGEventTypes.h:typedef uint32_t CGEventType; From b71fc30f4991a1708c0bb610d0a0de58f1f81d28 Mon Sep 17 00:00:00 2001 From: Whitney Schmidt <51677938+whitneyschmidt@users.noreply.github.com> Date: Tue, 29 Oct 2019 17:05:23 -0400 Subject: [PATCH 053/100] CoreMedia 11.2 updates (#7329) --- tests/xtro-sharpie/common-CoreMedia.ignore | 1 + tests/xtro-sharpie/iOS-CoreMedia.todo | 1 - tests/xtro-sharpie/macOS-CoreMedia.todo | 1 - tests/xtro-sharpie/tvOS-CoreMedia.todo | 1 - tests/xtro-sharpie/watchOS-CoreMedia.todo | 1 - 5 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 tests/xtro-sharpie/iOS-CoreMedia.todo delete mode 100644 tests/xtro-sharpie/macOS-CoreMedia.todo delete mode 100644 tests/xtro-sharpie/tvOS-CoreMedia.todo delete mode 100644 tests/xtro-sharpie/watchOS-CoreMedia.todo diff --git a/tests/xtro-sharpie/common-CoreMedia.ignore b/tests/xtro-sharpie/common-CoreMedia.ignore index 36067f8ffa..fadd545dca 100644 --- a/tests/xtro-sharpie/common-CoreMedia.ignore +++ b/tests/xtro-sharpie/common-CoreMedia.ignore @@ -126,6 +126,7 @@ !missing-field! kCMMetadataIdentifier_QuickTimeMetadataPreferredAffineTransform not bound !missing-field! kCMMetadataIdentifier_QuickTimeMetadataVideoOrientation not bound !missing-field! kCMMetadataIdentifier_QuickTimeMetadataLivePhotoStillImageTransform not bound +!missing-field! kCMMetadataIdentifier_QuickTimeMetadataLivePhotoStillImageTransformReferenceDimensions not bound !missing-field! kCMMetadataKeySpace_HLSDateRange not bound !missing-field! kCMMetadataKeySpace_Icy not bound !missing-field! kCMMetadataKeySpace_ID3 not bound diff --git a/tests/xtro-sharpie/iOS-CoreMedia.todo b/tests/xtro-sharpie/iOS-CoreMedia.todo deleted file mode 100644 index 3364a0fdc5..0000000000 --- a/tests/xtro-sharpie/iOS-CoreMedia.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-field! kCMMetadataIdentifier_QuickTimeMetadataLivePhotoStillImageTransformReferenceDimensions not bound diff --git a/tests/xtro-sharpie/macOS-CoreMedia.todo b/tests/xtro-sharpie/macOS-CoreMedia.todo deleted file mode 100644 index 3364a0fdc5..0000000000 --- a/tests/xtro-sharpie/macOS-CoreMedia.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-field! kCMMetadataIdentifier_QuickTimeMetadataLivePhotoStillImageTransformReferenceDimensions not bound diff --git a/tests/xtro-sharpie/tvOS-CoreMedia.todo b/tests/xtro-sharpie/tvOS-CoreMedia.todo deleted file mode 100644 index 3364a0fdc5..0000000000 --- a/tests/xtro-sharpie/tvOS-CoreMedia.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-field! kCMMetadataIdentifier_QuickTimeMetadataLivePhotoStillImageTransformReferenceDimensions not bound diff --git a/tests/xtro-sharpie/watchOS-CoreMedia.todo b/tests/xtro-sharpie/watchOS-CoreMedia.todo deleted file mode 100644 index 3364a0fdc5..0000000000 --- a/tests/xtro-sharpie/watchOS-CoreMedia.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-field! kCMMetadataIdentifier_QuickTimeMetadataLivePhotoStillImageTransformReferenceDimensions not bound From 4a9c10a85b5f3f3197dcfa95d1e0d10ffed2c8a0 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Wed, 30 Oct 2019 01:47:41 -0400 Subject: [PATCH 054/100] [Introspection] Add Mac OS X 15.15.1 on availability tests. (#7328) --- tests/introspection/ApiAvailabilityTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/introspection/ApiAvailabilityTest.cs b/tests/introspection/ApiAvailabilityTest.cs index f2b3c9cd32..b3610f0e57 100644 --- a/tests/introspection/ApiAvailabilityTest.cs +++ b/tests/introspection/ApiAvailabilityTest.cs @@ -56,7 +56,7 @@ namespace Introspection { Minimum = new Version (10,9); // Need to special case macOS 'Maximum' version for OS minor subversions (can't change Constants.SdkVersion) // Please comment the code below if needed - Maximum = new Version (10,15,0); + Maximum = new Version (10,15,1); Filter = (AvailabilityBaseAttribute arg) => { return (arg.AvailabilityKind != AvailabilityKind.Introduced) || (arg.Platform != PlatformName.MacOSX); }; From ecefbde776ad2c8f22bb1e7a13c0c73f43b07b84 Mon Sep 17 00:00:00 2001 From: Pramit Mallick Date: Wed, 30 Oct 2019 11:04:48 -0400 Subject: [PATCH 055/100] [ARKit] Xcode11.2 Binding (#7324) * [ARKit] Add enum for xcode11.2 * address reviews * Added Obsolete attribute --- src/arkit.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/arkit.cs b/src/arkit.cs index 732f02ef2a..3a0d2ceb64 100644 --- a/src/arkit.cs +++ b/src/arkit.cs @@ -67,7 +67,11 @@ namespace ARKit { InvalidReferenceObject = 301, InvalidWorldMap = 302, InvalidConfiguration = 303, - CollaborationDataUnavailable = 304, + #if !XAMCORE_4_0 + [Obsolete ("Please use the 'InvalidCollaborationData' value instead.")] + CollaborationDataUnavailable = InvalidCollaborationData, + #endif + InvalidCollaborationData = 304, InsufficientFeatures = 400, ObjectMergeFailed = 401, FileIOFailed = 500, From 3cf957442e41693d9cf7a6db78e7362b1e9852ac Mon Sep 17 00:00:00 2001 From: Pramit Mallick Date: Wed, 30 Oct 2019 14:53:55 -0400 Subject: [PATCH 056/100] [Foundation] Add 'targetContentIdentifier' to macOS and watchOS --- src/foundation.cs | 2 +- tests/xtro-sharpie/macOS-Foundation.todo | 3 --- tests/xtro-sharpie/watchOS-Foundation.todo | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/foundation.cs b/src/foundation.cs index a470def735..ca6f67dc07 100644 --- a/src/foundation.cs +++ b/src/foundation.cs @@ -5473,7 +5473,7 @@ namespace Foundation // Inlined from NSUserActivity (UISceneActivationConditions) - [iOS (13,0), TV (13,0), NoMac, NoWatch] + [iOS (13,0), TV (13,0), Mac (10,15), Watch (6,0)] [NullAllowed, Export ("targetContentIdentifier")] string TargetContentIdentifier { get; set; } } diff --git a/tests/xtro-sharpie/macOS-Foundation.todo b/tests/xtro-sharpie/macOS-Foundation.todo index 67be84aec0..3348f73b0b 100644 --- a/tests/xtro-sharpie/macOS-Foundation.todo +++ b/tests/xtro-sharpie/macOS-Foundation.todo @@ -28,6 +28,3 @@ !missing-selector! NSOrderedSet::orderedSetByApplyingDifference: not bound !missing-type! NSOrderedCollectionChange not bound !missing-type! NSOrderedCollectionDifference not bound -## appended from unclassified file -!missing-selector! NSUserActivity::setTargetContentIdentifier: not bound -!missing-selector! NSUserActivity::targetContentIdentifier not bound diff --git a/tests/xtro-sharpie/watchOS-Foundation.todo b/tests/xtro-sharpie/watchOS-Foundation.todo index 67be84aec0..3348f73b0b 100644 --- a/tests/xtro-sharpie/watchOS-Foundation.todo +++ b/tests/xtro-sharpie/watchOS-Foundation.todo @@ -28,6 +28,3 @@ !missing-selector! NSOrderedSet::orderedSetByApplyingDifference: not bound !missing-type! NSOrderedCollectionChange not bound !missing-type! NSOrderedCollectionDifference not bound -## appended from unclassified file -!missing-selector! NSUserActivity::setTargetContentIdentifier: not bound -!missing-selector! NSUserActivity::targetContentIdentifier not bound From 957572720e73d9d3fe98670bfb9cd4e49816a77d Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Wed, 30 Oct 2019 15:07:28 -0400 Subject: [PATCH 057/100] [Tests] Fix some network tests that were leaving the connection in a bad (#7337) state. Some of the tests were creating connections when not needed, this 'apparetly' was leaving the internal state of the Networking API in a bad state in which it would throw a SIGSEGV and will make the connection of other tests fail. In this case, the Tls tests that use the Network API. Cleaning the tests and removing those badly managed connections ensured that the SIGSEGV would not be thrown and got all the other tests to work. This is a blackbox, test now passes without problems. Fixes: https://github.com/xamarin/maccore/issues/2048 --- .../Network/NWParametersTest.cs | 36 +++++-------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/tests/monotouch-test/Network/NWParametersTest.cs b/tests/monotouch-test/Network/NWParametersTest.cs index 3beacde750..1cdc251c04 100644 --- a/tests/monotouch-test/Network/NWParametersTest.cs +++ b/tests/monotouch-test/Network/NWParametersTest.cs @@ -1,4 +1,4 @@ -#if !__WATCHOS__ +#if !__WATCHOS__ using System; using System.Collections.Generic; using System.Threading; @@ -94,7 +94,7 @@ namespace MonoTouchFixtures.Network { secureConnectionWasSet = false; protocolConfigured = false; } - + void EnumerateInterfacesHandler (NWInterface nwInterface) { interfaces.Add (nwInterface); @@ -123,10 +123,7 @@ namespace MonoTouchFixtures.Network { var setUpProtocol = CreateConfigureProtocolHandler (); using (var parameters = NWParameters.CreateSecureUdp (configureTls: setUpTls, configureUdp: setUpProtocol)) - using (var endpoint = NWEndpoint.Create ("wwww.google.com", "80")) - using (var connection = new NWConnection (endpoint, parameters)) { - connection.SetQueue (DispatchQueue.MainQueue); - connection.Start (); + using (var endpoint = NWEndpoint.Create ("wwww.google.com", "80")) { secureEvent.WaitOne (); configureEvent.WaitOne (); Assert.True (secureConnectionWasSet, "Configure TLS handler was not called."); @@ -140,10 +137,7 @@ namespace MonoTouchFixtures.Network { var setUpTls = CreateTlsHandler (); using (var parameters = NWParameters.CreateSecureUdp (configureTls: setUpTls)) - using (var endpoint = NWEndpoint.Create ("wwww.google.com", "80")) - using (var connection = new NWConnection (endpoint, parameters)) { - connection.SetQueue (DispatchQueue.MainQueue); - connection.Start (); + using (var endpoint = NWEndpoint.Create ("wwww.google.com", "80")) { secureEvent.WaitOne (); Assert.True (secureConnectionWasSet, "Configure TLS handler was not called."); Assert.False (protocolConfigured, "Protocol configure handler was called."); @@ -156,10 +150,7 @@ namespace MonoTouchFixtures.Network { var setUpProtocol = CreateConfigureProtocolHandler (); using (var parameters = NWParameters.CreateSecureUdp (configureTls: null, configureUdp: setUpProtocol)) - using (var endpoint = NWEndpoint.Create ("wwww.google.com", "80")) - using (var connection = new NWConnection (endpoint, parameters)) { - connection.SetQueue (DispatchQueue.MainQueue); - connection.Start (); + using (var endpoint = NWEndpoint.Create ("wwww.google.com", "80")) { configureEvent.WaitOne (); Assert.False (secureConnectionWasSet, "Configure TLS handler was not called."); Assert.True (protocolConfigured, "Protocol configure handler was not called."); @@ -173,10 +164,7 @@ namespace MonoTouchFixtures.Network { var setUpProtocol = CreateConfigureProtocolHandler (); using (var parameters = NWParameters.CreateSecureTcp (configureTls: setUpTls, configureTcp: setUpProtocol)) - using (var endpoint = NWEndpoint.Create ("wwww.google.com", "80")) - using (var connection = new NWConnection (endpoint, parameters)) { - connection.SetQueue (DispatchQueue.MainQueue); - connection.Start (); + using (var endpoint = NWEndpoint.Create ("wwww.google.com", "80")) { secureEvent.WaitOne (); configureEvent.WaitOne (); Assert.True (secureConnectionWasSet, "Configure TLS handler was not called."); @@ -191,10 +179,7 @@ namespace MonoTouchFixtures.Network { var setUpProtocol = CreateConfigureProtocolHandler (); using (var parameters = NWParameters.CreateSecureTcp (configureTls: setUpTls)) - using (var endpoint = NWEndpoint.Create ("wwww.google.com", "80")) - using (var connection = new NWConnection (endpoint, parameters)) { - connection.SetQueue (DispatchQueue.MainQueue); - connection.Start (); + using (var endpoint = NWEndpoint.Create ("wwww.google.com", "80")) { secureEvent.WaitOne (); Assert.True (secureConnectionWasSet, "Configure TLS handler was not called."); Assert.False (protocolConfigured, "Protocol configure handler was called."); @@ -207,10 +192,7 @@ namespace MonoTouchFixtures.Network { var setUpProtocol = CreateConfigureProtocolHandler (); using (var parameters = NWParameters.CreateSecureTcp (configureTls: null, configureTcp: setUpProtocol)) - using (var endpoint = NWEndpoint.Create ("wwww.google.com", "80")) - using (var connection = new NWConnection (endpoint, parameters)) { - connection.SetQueue (DispatchQueue.MainQueue); - connection.Start (); + using (var endpoint = NWEndpoint.Create ("wwww.google.com", "80")) { configureEvent.WaitOne (); Assert.False (secureConnectionWasSet, "Configure TLS handler was called."); Assert.True (protocolConfigured, "Protocol configure handler was not called."); @@ -402,4 +384,4 @@ namespace MonoTouchFixtures.Network { } } } -#endif \ No newline at end of file +#endif From c4f28a1888dee1a871126635768f5308dfb7dcac Mon Sep 17 00:00:00 2001 From: Pramit Mallick Date: Thu, 31 Oct 2019 10:02:53 -0400 Subject: [PATCH 058/100] [MPSCore] Xcode11.1 GM Binding (#7330) --- src/metalperformanceshaders.cs | 8 ++++++++ tests/xtro-sharpie/iOS-MetalPerformanceShaders.todo | 3 --- tests/xtro-sharpie/macOS-MetalPerformanceShaders.todo | 3 --- tests/xtro-sharpie/tvOS-MetalPerformanceShaders.todo | 3 --- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/metalperformanceshaders.cs b/src/metalperformanceshaders.cs index c9f0da8d4b..cb9cce4249 100644 --- a/src/metalperformanceshaders.cs +++ b/src/metalperformanceshaders.cs @@ -1899,6 +1899,10 @@ namespace MetalPerformanceShaders { [TV (11, 0), iOS (11, 0)] [Export ("matrixBytes")] nuint MatrixBytes { get; } + + [TV (13, 0), Mac (10, 15), iOS (13, 1)] + [Export ("offset")] + nuint Offset { get; } } // MPSMatrixMultiplication.h @@ -2089,6 +2093,10 @@ namespace MetalPerformanceShaders { [TV (11,3), Mac (10,13,4), iOS (11,3)] [Export ("resourceSize")] nuint ResourceSize { get; } + + [TV (13, 0), Mac (10, 15), iOS (13, 1)] + [Export ("offset")] + nuint Offset { get; } } [TV (11,0), Mac (10, 13), iOS (11,0)] diff --git a/tests/xtro-sharpie/iOS-MetalPerformanceShaders.todo b/tests/xtro-sharpie/iOS-MetalPerformanceShaders.todo index e78c59e367..4d7551537a 100644 --- a/tests/xtro-sharpie/iOS-MetalPerformanceShaders.todo +++ b/tests/xtro-sharpie/iOS-MetalPerformanceShaders.todo @@ -595,6 +595,3 @@ !missing-type! MPSTemporaryNDArray not bound !unknown-simd-type-mapping! The Simd type vector_uchar16 does not have a mapping to a managed type. Please add one in SimdCheck.cs !wrong-base-type! MPSTriangleAccelerationStructure expected MPSPolygonAccelerationStructure actual MPSAccelerationStructure -## appended from unclassified file -!missing-selector! MPSMatrix::offset not bound -!missing-selector! MPSVector::offset not bound diff --git a/tests/xtro-sharpie/macOS-MetalPerformanceShaders.todo b/tests/xtro-sharpie/macOS-MetalPerformanceShaders.todo index e78c59e367..4d7551537a 100644 --- a/tests/xtro-sharpie/macOS-MetalPerformanceShaders.todo +++ b/tests/xtro-sharpie/macOS-MetalPerformanceShaders.todo @@ -595,6 +595,3 @@ !missing-type! MPSTemporaryNDArray not bound !unknown-simd-type-mapping! The Simd type vector_uchar16 does not have a mapping to a managed type. Please add one in SimdCheck.cs !wrong-base-type! MPSTriangleAccelerationStructure expected MPSPolygonAccelerationStructure actual MPSAccelerationStructure -## appended from unclassified file -!missing-selector! MPSMatrix::offset not bound -!missing-selector! MPSVector::offset not bound diff --git a/tests/xtro-sharpie/tvOS-MetalPerformanceShaders.todo b/tests/xtro-sharpie/tvOS-MetalPerformanceShaders.todo index e78c59e367..4d7551537a 100644 --- a/tests/xtro-sharpie/tvOS-MetalPerformanceShaders.todo +++ b/tests/xtro-sharpie/tvOS-MetalPerformanceShaders.todo @@ -595,6 +595,3 @@ !missing-type! MPSTemporaryNDArray not bound !unknown-simd-type-mapping! The Simd type vector_uchar16 does not have a mapping to a managed type. Please add one in SimdCheck.cs !wrong-base-type! MPSTriangleAccelerationStructure expected MPSPolygonAccelerationStructure actual MPSAccelerationStructure -## appended from unclassified file -!missing-selector! MPSMatrix::offset not bound -!missing-selector! MPSVector::offset not bound From d90223a316612c52b20a3f456976a8de618013e6 Mon Sep 17 00:00:00 2001 From: Whitney Schmidt <51677938+whitneyschmidt@users.noreply.github.com> Date: Thu, 31 Oct 2019 11:11:41 -0400 Subject: [PATCH 059/100] [MapKit] Xcode 11.2 update (#7331) * mapkit 11.2 * make methods public * add async attribute * style fixes, using pattern --- src/mapkit.cs | 16 +++++++++++++++- tests/xtro-sharpie/iOS-MapKit.todo | 2 -- 2 files changed, 15 insertions(+), 3 deletions(-) delete mode 100644 tests/xtro-sharpie/iOS-MapKit.todo diff --git a/src/mapkit.cs b/src/mapkit.cs index d19844ef12..5513183386 100644 --- a/src/mapkit.cs +++ b/src/mapkit.cs @@ -32,6 +32,7 @@ using UIImage=AppKit.NSImage; using UIView=AppKit.NSView; using UIEdgeInsets=AppKit.NSEdgeInsets; using UIColor=AppKit.NSColor; +using UIScene=AppKit.NSColor; #endif #if WATCH // helper for [NoWatch] @@ -320,13 +321,26 @@ namespace MapKit { [NoTV] [Export ("openInMapsWithLaunchOptions:"), Internal] - bool _OpenInMaps ([NullAllowed] NSDictionary launchOptions); + bool _OpenInMaps ([NullAllowed] NSDictionary launchOptions); [NoTV] [Static] [Export ("openMapsWithItems:launchOptions:"), Internal] bool _OpenMaps ([NullAllowed] MKMapItem [] mapItems, [NullAllowed] NSDictionary launchOptions); + [iOS (13, 2), NoMac, NoTV, NoWatch] + [Introduced (PlatformName.UIKitForMac, 13, 2)] + [Async] + [Export ("openInMapsWithLaunchOptions:fromScene:completionHandler:")] + void OpenInMaps ([NullAllowed] NSDictionary launchOptions, [NullAllowed] UIScene fromScene, Action completionHandler); + + [iOS (13, 2), NoMac, NoTV, NoWatch] + [Introduced (PlatformName.UIKitForMac, 13, 2)] + [Static] + [Async] + [Export ("openMapsWithItems:launchOptions:fromScene:completionHandler:")] + void OpenMaps ([NullAllowed] MKMapItem [] mapItems, [NullAllowed] NSDictionary launchOptions, [NullAllowed] UIScene fromScene, Action completionHandler); + [NoTV] [Field ("MKLaunchOptionsDirectionsModeKey"), Internal] NSString MKLaunchOptionsDirectionsModeKey { get; } diff --git a/tests/xtro-sharpie/iOS-MapKit.todo b/tests/xtro-sharpie/iOS-MapKit.todo deleted file mode 100644 index 6f4e7fcc6a..0000000000 --- a/tests/xtro-sharpie/iOS-MapKit.todo +++ /dev/null @@ -1,2 +0,0 @@ -!missing-selector! +MKMapItem::openMapsWithItems:launchOptions:fromScene:completionHandler: not bound -!missing-selector! MKMapItem::openInMapsWithLaunchOptions:fromScene:completionHandler: not bound From e3c2b406de425d7b757dfb57b852ef4ad39598e3 Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Thu, 31 Oct 2019 23:25:04 -0400 Subject: [PATCH 060/100] Bump to Xcode 11.2 final (#7347) * Bump to Xcode 11.2 final * Fix xtro --- Make.config | 4 ++-- tests/xtro-sharpie/iOS-ImageCaptureCore.todo | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Make.config b/Make.config index 7003f26093..75ab273d49 100644 --- a/Make.config +++ b/Make.config @@ -60,8 +60,8 @@ IOS_PACKAGE_UPDATE_ID=$(shell printf "2%02d%02d%02d%03d" $(IOS_PACKAGE_VERSION_M # Xcode version should have both a major and a minor version (even if the minor version is 0) XCODE_VERSION=11.2 -XCODE_URL=http://xamarin-storage/bot-provisioning/xcodes/Xcode_11.2_beta_2.xip -XCODE_DEVELOPER_ROOT=/Applications/Xcode112-beta2.app/Contents/Developer +XCODE_URL=http://xamarin-storage/bot-provisioning/xcodes/Xcode_11.2.xip +XCODE_DEVELOPER_ROOT=/Applications/Xcode112.app/Contents/Developer XCODE_PRODUCT_BUILD_VERSION:=$(shell /usr/libexec/PlistBuddy -c 'Print :ProductBuildVersion' $(XCODE_DEVELOPER_ROOT)/../version.plist) # Mono version embedded in XI/XM (NEEDED_MONO_VERSION/BRANCH) are specified in mk/mono.mk diff --git a/tests/xtro-sharpie/iOS-ImageCaptureCore.todo b/tests/xtro-sharpie/iOS-ImageCaptureCore.todo index fe4212d31f..9087ebb748 100644 --- a/tests/xtro-sharpie/iOS-ImageCaptureCore.todo +++ b/tests/xtro-sharpie/iOS-ImageCaptureCore.todo @@ -42,7 +42,6 @@ !missing-protocol! ICDeviceDelegate not bound !missing-selector! ICCameraDevice::batteryLevel not bound !missing-selector! ICCameraDevice::batteryLevelAvailable not bound -!missing-selector! ICCameraDevice::cancelDownload not bound !missing-selector! ICCameraDevice::contentCatalogPercentCompleted not bound !missing-selector! ICCameraDevice::contents not bound !missing-selector! ICCameraDevice::filesOfType: not bound From 898ea3cdbf8d0ca1fe8c5e8272bd6dec901c5f3e Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Mon, 4 Nov 2019 02:38:19 -0500 Subject: [PATCH 061/100] [d16-4] Bump mono 2019-08@e1ef7743 (#7356) New commits in mono/mono: * mono/mono@e1ef774391d [2019-08] Bump CoreFX to pickup corefx PR #367 to fix #17133. (#17622) * mono/mono@6d1f88e0ad2 Bump msbuild to get SDK updates from https://github.com/mono/msbuild/pull/150 * mono/mono@a3f3bfc4c3d Bump nuget to the latest suggested version * mono/mono@9bd3079f1ca [2019-08] bump msbuild with more p2 packages * mono/mono@6ac1ff75a27 [dim][regression] Explicit interface override (#17583) (#17627) * mono/mono@a119807a015 [acceptance-tests] Bump mono/roslyn to get build fix * mono/mono@d234d34b700 [2019-08][merp] Install sigterm handler in EnableMicrosoftTelemetry * mono/mono@444a9a3fc48 [2019-08] [merp] Introduce a new 'dump mode' that allows different signal behavior when dumping (#17568) Diff: https://github.com/mono/mono/compare/8946e49a974ea8b75fe5b8b7e93ffd4571521a85..e1ef774391da2b84d003431e8871b0bacbd25cb3 --- mk/mono.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/mono.mk b/mk/mono.mk index 0419183c42..7fb9d24857 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,4 +1,4 @@ -NEEDED_MONO_VERSION := 8946e49a974ea8b75fe5b8b7e93ffd4571521a85 +NEEDED_MONO_VERSION := e1ef774391da2b84d003431e8871b0bacbd25cb3 NEEDED_MONO_BRANCH := 2019-08 MONO_DIRECTORY := mono From ef1ccbd3f02af46cfe90288182a72e00b554f391 Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Tue, 5 Nov 2019 11:07:50 -0500 Subject: [PATCH 062/100] Update xcode11.3 version to 13.9/6.9 (#7362) (.9) was previously used by master builds but this was not released to the public so we should be fine. xcode11.3 will eventually become (.10) --- Make.versions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Make.versions b/Make.versions index 64a3fd2b88..e3e852e1e2 100644 --- a/Make.versions +++ b/Make.versions @@ -43,5 +43,5 @@ # line changed in git). # -IOS_PACKAGE_VERSION=13.8.2.$(IOS_COMMIT_DISTANCE) -MAC_PACKAGE_VERSION=6.8.2.$(MAC_COMMIT_DISTANCE) +IOS_PACKAGE_VERSION=13.9.0.$(IOS_COMMIT_DISTANCE) +MAC_PACKAGE_VERSION=6.9.0.$(MAC_COMMIT_DISTANCE) From 746fd47638446aa9772345051910333e74e0fc3e Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Tue, 5 Nov 2019 15:32:17 -0500 Subject: [PATCH 063/100] [Networking] Add the NWFramer implementation. (#7338) Uncommented the sources and update some mistakes after following the sample provided by Apple. Initially tests were going to be added but they resulted to be to flacky and would make the CI red too often to be adding value. Porting the sample will ensure that it works are the bindings are not broken. --- src/Network/NWFramer.cs | 76 +++++++++---------------- tests/xtro-sharpie/iOS-Network.todo | 25 +------- tests/xtro-sharpie/macOS-Network.todo | 23 -------- tests/xtro-sharpie/tvOS-Network.todo | 25 +------- tests/xtro-sharpie/watchOS-Network.todo | 23 -------- 5 files changed, 28 insertions(+), 144 deletions(-) diff --git a/src/Network/NWFramer.cs b/src/Network/NWFramer.cs index 9dbf4acef4..fecf6c8504 100644 --- a/src/Network/NWFramer.cs +++ b/src/Network/NWFramer.cs @@ -38,14 +38,17 @@ namespace Network { WillMarkReady = 2, } + public delegate nuint NWFramerParseCompletionDelegate (Memory buffer, bool isCompleted); + public delegate nuint NWFramerInputDelegate (NWFramer framer); + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] public class NWFramer : NativeObject { internal NWFramer (IntPtr handle, bool owns) : base (handle, owns) {} -/* + [DllImport (Constants.NetworkLibrary)] static extern bool nw_framer_write_output_no_copy (OS_nw_framer framer, nuint output_length); - public bool WriteOutput (nuint outputLength) => nw_framer_write_output_no_copy (GetCheckedHandle (), outputLength); + public bool WriteOutputNoCopy (nuint outputLength) => nw_framer_write_output_no_copy (GetCheckedHandle (), outputLength); [DllImport (Constants.NetworkLibrary)] static extern void nw_framer_write_output_data (OS_nw_framer framer, OS_dispatch_data output_data); @@ -152,13 +155,13 @@ namespace Network { var del = BlockLiteral.GetTarget> (block); if (del != null) { var nwFramer = new NWFramer (framer, owns: true); - var nwProtocolMetadata = new NWProtocolMetadata (message, owns: true); + var nwProtocolMetadata = new NWFramerMessage (message, owns: true); del (nwFramer, nwProtocolMetadata, message_length, is_complete); } } [BindingImpl (BindingImplOptions.Optimizable)] - public Action OutputHandler { + public Action OutputHandler { set { unsafe { if (value == null) { @@ -180,21 +183,22 @@ namespace Network { [DllImport (Constants.NetworkLibrary)] unsafe static extern void nw_framer_set_input_handler (OS_nw_framer framer, void *input_handler); - delegate void nw_framer_set_input_handler_t (IntPtr block, OS_nw_framer framer); + delegate nuint nw_framer_set_input_handler_t (IntPtr block, OS_nw_framer framer); static nw_framer_set_input_handler_t static_InputHandler = TrampolineInputHandler; [MonoPInvokeCallback (typeof (nw_framer_set_input_handler_t))] - static void TrampolineInputHandler (IntPtr block, OS_nw_framer framer) + static nuint TrampolineInputHandler (IntPtr block, OS_nw_framer framer) { - var del = BlockLiteral.GetTarget> (block); + var del = BlockLiteral.GetTarget (block); if (del != null) { var nwFramer = new NWFramer (framer, owns: true); - del (nwFramer); + return del (nwFramer); } + return 0; } [BindingImpl (BindingImplOptions.Optimizable)] - public Action InputHandler { + public NWFramerInputDelegate InputHandler { set { unsafe { if (value == null) { @@ -217,9 +221,9 @@ namespace Network { unsafe static extern void nw_framer_set_cleanup_handler (OS_nw_framer framer, void *cleanup_handler); delegate void nw_framer_set_cleanup_handler_t (IntPtr block, OS_nw_framer framer); - static nw_framer_set_input_handler_t static_CleanupHandler = TrampolineCleanupHandler; + static nw_framer_set_cleanup_handler_t static_CleanupHandler = TrampolineCleanupHandler; - [MonoPInvokeCallback (typeof (nw_framer_set_input_handler_t))] + [MonoPInvokeCallback (typeof (nw_framer_set_cleanup_handler_t))] static void TrampolineCleanupHandler (IntPtr block, OS_nw_framer framer) { var del = BlockLiteral.GetTarget> (block); @@ -253,7 +257,6 @@ namespace Network { static extern void nw_framer_schedule_wakeup (OS_nw_framer framer, ulong milliseconds); public void ScheduleWakeup (ulong milliseconds) => nw_framer_schedule_wakeup (GetCheckedHandle (), milliseconds); - */ [DllImport (Constants.NetworkLibrary)] static extern OS_nw_protocol_metadata nw_framer_message_create (OS_nw_framer framer); @@ -261,7 +264,6 @@ namespace Network { public NWFramerMessage CreateMessage () => new NWFramerMessage (nw_framer_message_create (GetCheckedHandle ()), owns: true); - /* [DllImport (Constants.NetworkLibrary)] static extern bool nw_framer_prepend_application_protocol (OS_nw_framer framer, OS_nw_protocol_options protocol_options); @@ -295,7 +297,7 @@ namespace Network { [DllImport (Constants.NetworkLibrary)] static extern bool nw_framer_deliver_input_no_copy (OS_nw_framer framer, nuint input_length, OS_nw_protocol_metadata message, bool is_complete); - public bool DeliverInput (nuint length, NWProtocolMetadata message, bool isComplete) + public bool DeliverInputNoCopy (nuint length, NWFramerMessage message, bool isComplete) { if (message == null) throw new ArgumentNullException (nameof (message)); @@ -305,11 +307,12 @@ namespace Network { [DllImport (Constants.NetworkLibrary)] static extern OS_nw_protocol_options nw_framer_create_options (OS_nw_protocol_definition framer_definition); - public static NWProtocolOptions CreateOptions (NWProtocolDefinition protocolDefinition) + public static T CreateOptions (NWProtocolDefinition protocolDefinition) where T: NWProtocolOptions { if (protocolDefinition == null) throw new ArgumentNullException (nameof (protocolDefinition)); - return new NWProtocolOptions (nw_framer_create_options (protocolDefinition.Handle), owns: true); + var x = nw_framer_create_options (protocolDefinition.Handle); + return Runtime.GetINativeObject (x, owns: true); } [DllImport (Constants.NetworkLibrary)] @@ -399,23 +402,24 @@ namespace Network { [DllImport (Constants.NetworkLibrary)] static extern unsafe bool nw_framer_parse_input (OS_nw_framer framer, nuint minimum_incomplete_length, nuint maximum_length, byte *temp_buffer, ref BlockLiteral parse); - delegate void nw_framer_parse_input_t (IntPtr block, IntPtr buffer, nuint buffer_length, bool is_complete); + delegate nuint nw_framer_parse_input_t (IntPtr block, IntPtr buffer, nuint buffer_length, bool is_complete); static nw_framer_parse_input_t static_ParseInputHandler = TrampolineParseInputHandler; [MonoPInvokeCallback (typeof (nw_framer_parse_input_t))] - static void TrampolineParseInputHandler (IntPtr block, IntPtr buffer, nuint buffer_length, bool is_complete) + static nuint TrampolineParseInputHandler (IntPtr block, IntPtr buffer, nuint buffer_length, bool is_complete) { - var del = BlockLiteral.GetTarget, bool>> (block); + var del = BlockLiteral.GetTarget (block); if (del != null) { var bBuffer = new byte[buffer_length]; Marshal.Copy (buffer, bBuffer, 0, (int)buffer_length); var mValue = new Memory(bBuffer); - del (mValue, is_complete); + return del (mValue, is_complete); } + return 0; } [BindingImpl (BindingImplOptions.Optimizable)] - public bool ParseInput (nuint minimumIncompleteLength, nuint maximumLength, Memory tempBuffer, Action, bool> handler) + public bool ParseInput (nuint minimumIncompleteLength, nuint maximumLength, Memory tempBuffer, NWFramerParseCompletionDelegate handler) { if (handler == null) throw new ArgumentNullException (nameof (handler)); @@ -431,37 +435,10 @@ namespace Network { } } - [DllImport (Constants.NetworkLibrary)] - static extern unsafe void nw_framer_message_set_value (OS_nw_protocol_metadata message, string key, byte *value, void *dispose_value); - - public void SetKey (string key, ReadOnlySpan value) - { - // the method takes a callback to cleanup the data, but we do not need that since we are managed - if (key == null) - throw new ArgumentNullException (nameof (key)); - - unsafe { - fixed (byte* mh = value) - nw_framer_message_set_value (GetCheckedHandle (), key, mh, null); - } - } - - [DllImport (Constants.NetworkLibrary)] - static extern void nw_framer_message_set_object_value (OS_nw_protocol_metadata message, string key, IntPtr value); - - public void SetObject (string key, NSObject value) - => nw_framer_message_set_object_value (GetCheckedHandle (), key, value.GetHandle ()); - - [DllImport (Constants.NetworkLibrary)] - static extern IntPtr nw_framer_message_copy_object_value (OS_nw_protocol_metadata message, string key); - - public NSObject GetValue (string key) - => Runtime.GetNSObject (nw_framer_message_copy_object_value (GetCheckedHandle (), key)); - [DllImport (Constants.NetworkLibrary)] unsafe static extern void nw_framer_deliver_input (OS_nw_framer framer, byte *input_buffer, nuint input_length, OS_nw_protocol_metadata message, bool is_complete); - public void DeliverInput (ReadOnlySpan buffer, NWProtocolMetadata message, bool isComplete) + public void DeliverInput (ReadOnlySpan buffer, NWFramerMessage message, bool isComplete) { if (message == null) throw new ArgumentNullException (nameof (message)); @@ -470,6 +447,5 @@ namespace Network { nw_framer_deliver_input (GetCheckedHandle (),mh, (nuint)buffer.Length, message.Handle, isComplete); } } - */ } } diff --git a/tests/xtro-sharpie/iOS-Network.todo b/tests/xtro-sharpie/iOS-Network.todo index dc046d6a62..dcad7c13cc 100644 --- a/tests/xtro-sharpie/iOS-Network.todo +++ b/tests/xtro-sharpie/iOS-Network.todo @@ -1,24 +1 @@ -!missing-field! _nw_data_transfer_report_all_paths not bound -!missing-pinvoke! nw_framer_async is not bound -!missing-pinvoke! nw_framer_copy_local_endpoint is not bound -!missing-pinvoke! nw_framer_copy_parameters is not bound -!missing-pinvoke! nw_framer_copy_remote_endpoint is not bound -!missing-pinvoke! nw_framer_create_options is not bound -!missing-pinvoke! nw_framer_deliver_input is not bound -!missing-pinvoke! nw_framer_deliver_input_no_copy is not bound -!missing-pinvoke! nw_framer_mark_failed_with_error is not bound -!missing-pinvoke! nw_framer_mark_ready is not bound -!missing-pinvoke! nw_framer_parse_input is not bound -!missing-pinvoke! nw_framer_parse_output is not bound -!missing-pinvoke! nw_framer_pass_through_input is not bound -!missing-pinvoke! nw_framer_pass_through_output is not bound -!missing-pinvoke! nw_framer_prepend_application_protocol is not bound -!missing-pinvoke! nw_framer_schedule_wakeup is not bound -!missing-pinvoke! nw_framer_set_cleanup_handler is not bound -!missing-pinvoke! nw_framer_set_input_handler is not bound -!missing-pinvoke! nw_framer_set_output_handler is not bound -!missing-pinvoke! nw_framer_set_stop_handler is not bound -!missing-pinvoke! nw_framer_set_wakeup_handler is not bound -!missing-pinvoke! nw_framer_write_output is not bound -!missing-pinvoke! nw_framer_write_output_data is not bound -!missing-pinvoke! nw_framer_write_output_no_copy is not bound \ No newline at end of file +!missing-field! _nw_data_transfer_report_all_paths not bound \ No newline at end of file diff --git a/tests/xtro-sharpie/macOS-Network.todo b/tests/xtro-sharpie/macOS-Network.todo index 89d3dc9700..b40d73ad49 100644 --- a/tests/xtro-sharpie/macOS-Network.todo +++ b/tests/xtro-sharpie/macOS-Network.todo @@ -7,26 +7,3 @@ !missing-pinvoke! nw_ethernet_channel_set_state_changed_handler is not bound !missing-pinvoke! nw_ethernet_channel_start is not bound !missing-pinvoke! nw_parameters_create_custom_ip is not bound -!missing-pinvoke! nw_framer_async is not bound -!missing-pinvoke! nw_framer_copy_local_endpoint is not bound -!missing-pinvoke! nw_framer_copy_parameters is not bound -!missing-pinvoke! nw_framer_copy_remote_endpoint is not bound -!missing-pinvoke! nw_framer_create_options is not bound -!missing-pinvoke! nw_framer_deliver_input is not bound -!missing-pinvoke! nw_framer_deliver_input_no_copy is not bound -!missing-pinvoke! nw_framer_mark_failed_with_error is not bound -!missing-pinvoke! nw_framer_mark_ready is not bound -!missing-pinvoke! nw_framer_parse_input is not bound -!missing-pinvoke! nw_framer_parse_output is not bound -!missing-pinvoke! nw_framer_pass_through_input is not bound -!missing-pinvoke! nw_framer_pass_through_output is not bound -!missing-pinvoke! nw_framer_prepend_application_protocol is not bound -!missing-pinvoke! nw_framer_schedule_wakeup is not bound -!missing-pinvoke! nw_framer_set_cleanup_handler is not bound -!missing-pinvoke! nw_framer_set_input_handler is not bound -!missing-pinvoke! nw_framer_set_output_handler is not bound -!missing-pinvoke! nw_framer_set_stop_handler is not bound -!missing-pinvoke! nw_framer_set_wakeup_handler is not bound -!missing-pinvoke! nw_framer_write_output is not bound -!missing-pinvoke! nw_framer_write_output_data is not bound -!missing-pinvoke! nw_framer_write_output_no_copy is not bound diff --git a/tests/xtro-sharpie/tvOS-Network.todo b/tests/xtro-sharpie/tvOS-Network.todo index dc046d6a62..dcad7c13cc 100644 --- a/tests/xtro-sharpie/tvOS-Network.todo +++ b/tests/xtro-sharpie/tvOS-Network.todo @@ -1,24 +1 @@ -!missing-field! _nw_data_transfer_report_all_paths not bound -!missing-pinvoke! nw_framer_async is not bound -!missing-pinvoke! nw_framer_copy_local_endpoint is not bound -!missing-pinvoke! nw_framer_copy_parameters is not bound -!missing-pinvoke! nw_framer_copy_remote_endpoint is not bound -!missing-pinvoke! nw_framer_create_options is not bound -!missing-pinvoke! nw_framer_deliver_input is not bound -!missing-pinvoke! nw_framer_deliver_input_no_copy is not bound -!missing-pinvoke! nw_framer_mark_failed_with_error is not bound -!missing-pinvoke! nw_framer_mark_ready is not bound -!missing-pinvoke! nw_framer_parse_input is not bound -!missing-pinvoke! nw_framer_parse_output is not bound -!missing-pinvoke! nw_framer_pass_through_input is not bound -!missing-pinvoke! nw_framer_pass_through_output is not bound -!missing-pinvoke! nw_framer_prepend_application_protocol is not bound -!missing-pinvoke! nw_framer_schedule_wakeup is not bound -!missing-pinvoke! nw_framer_set_cleanup_handler is not bound -!missing-pinvoke! nw_framer_set_input_handler is not bound -!missing-pinvoke! nw_framer_set_output_handler is not bound -!missing-pinvoke! nw_framer_set_stop_handler is not bound -!missing-pinvoke! nw_framer_set_wakeup_handler is not bound -!missing-pinvoke! nw_framer_write_output is not bound -!missing-pinvoke! nw_framer_write_output_data is not bound -!missing-pinvoke! nw_framer_write_output_no_copy is not bound \ No newline at end of file +!missing-field! _nw_data_transfer_report_all_paths not bound \ No newline at end of file diff --git a/tests/xtro-sharpie/watchOS-Network.todo b/tests/xtro-sharpie/watchOS-Network.todo index 04c1d79f24..f5e825a6d9 100644 --- a/tests/xtro-sharpie/watchOS-Network.todo +++ b/tests/xtro-sharpie/watchOS-Network.todo @@ -1,24 +1 @@ !missing-field! _nw_data_transfer_report_all_paths not bound -!missing-pinvoke! nw_framer_async is not bound -!missing-pinvoke! nw_framer_copy_local_endpoint is not bound -!missing-pinvoke! nw_framer_copy_parameters is not bound -!missing-pinvoke! nw_framer_copy_remote_endpoint is not bound -!missing-pinvoke! nw_framer_create_options is not bound -!missing-pinvoke! nw_framer_deliver_input is not bound -!missing-pinvoke! nw_framer_deliver_input_no_copy is not bound -!missing-pinvoke! nw_framer_mark_failed_with_error is not bound -!missing-pinvoke! nw_framer_mark_ready is not bound -!missing-pinvoke! nw_framer_parse_input is not bound -!missing-pinvoke! nw_framer_parse_output is not bound -!missing-pinvoke! nw_framer_pass_through_input is not bound -!missing-pinvoke! nw_framer_pass_through_output is not bound -!missing-pinvoke! nw_framer_prepend_application_protocol is not bound -!missing-pinvoke! nw_framer_schedule_wakeup is not bound -!missing-pinvoke! nw_framer_set_cleanup_handler is not bound -!missing-pinvoke! nw_framer_set_input_handler is not bound -!missing-pinvoke! nw_framer_set_output_handler is not bound -!missing-pinvoke! nw_framer_set_stop_handler is not bound -!missing-pinvoke! nw_framer_set_wakeup_handler is not bound -!missing-pinvoke! nw_framer_write_output is not bound -!missing-pinvoke! nw_framer_write_output_data is not bound -!missing-pinvoke! nw_framer_write_output_no_copy is not bound From 954c01b54e3c1ba4bf4070e37c02caed37f8878b Mon Sep 17 00:00:00 2001 From: monojenkins Date: Wed, 6 Nov 2019 07:26:18 +0100 Subject: [PATCH 064/100] Bump mono to get mono archives. (#7367) New commits in mono/mono: * mono/mono@062f0ab8cae [sdks] Use Xcode 11.2 stable version for iOS/Mac SDKs Diff: https://github.com/mono/mono/compare/e1ef774391da2b84d003431e8871b0bacbd25cb3..062f0ab8cae60d1d347e4d722884c065c9f34484 --- mk/mono.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/mono.mk b/mk/mono.mk index 7fb9d24857..b6818f60c5 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,4 +1,4 @@ -NEEDED_MONO_VERSION := e1ef774391da2b84d003431e8871b0bacbd25cb3 +NEEDED_MONO_VERSION := 062f0ab8cae60d1d347e4d722884c065c9f34484 NEEDED_MONO_BRANCH := 2019-08 MONO_DIRECTORY := mono From 2b570fafba69f3c507ad655363820d273121e94b Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 6 Nov 2019 07:40:35 +0100 Subject: [PATCH 065/100] Bump mono to get mono archives. (#7365) New commits in mono/mono: * mono/mono@062f0ab8cae [sdks] Use Xcode 11.2 stable version for iOS/Mac SDKs Diff: https://github.com/mono/mono/compare/e1ef774391da2b84d003431e8871b0bacbd25cb3..062f0ab8cae60d1d347e4d722884c065c9f34484 --- mk/mono.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/mono.mk b/mk/mono.mk index 7fb9d24857..b6818f60c5 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,4 +1,4 @@ -NEEDED_MONO_VERSION := e1ef774391da2b84d003431e8871b0bacbd25cb3 +NEEDED_MONO_VERSION := 062f0ab8cae60d1d347e4d722884c065c9f34484 NEEDED_MONO_BRANCH := 2019-08 MONO_DIRECTORY := mono From 374fe91721bca771237c96fead98c9a7990f01ff Mon Sep 17 00:00:00 2001 From: monojenkins Date: Wed, 6 Nov 2019 16:45:04 +0100 Subject: [PATCH 066/100] [Tests] Fix introspection failing due to a typo. (#7370) Fixes: https://github.com/xamarin/maccore/issues/2052 --- tests/introspection/ApiTypoTest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/introspection/ApiTypoTest.cs b/tests/introspection/ApiTypoTest.cs index 3fb48c6285..3381892cac 100644 --- a/tests/introspection/ApiTypoTest.cs +++ b/tests/introspection/ApiTypoTest.cs @@ -180,6 +180,7 @@ namespace Introspection "Descendents", "Descrete", "Dhe", // Diffie–Hellman key exchange + "Diffable", // that you can diff it.. made up word from apple "Differental", "Diffie", "Directionfor", From 8536ba69757274c4e5f29057d534169fce829d39 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Wed, 6 Nov 2019 21:21:24 +0100 Subject: [PATCH 067/100] [Tests] Fix introspection failing due to a typo. (#7377) Fixes: https://github.com/xamarin/maccore/issues/2052 --- tests/introspection/ApiTypoTest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/introspection/ApiTypoTest.cs b/tests/introspection/ApiTypoTest.cs index 3fb48c6285..3381892cac 100644 --- a/tests/introspection/ApiTypoTest.cs +++ b/tests/introspection/ApiTypoTest.cs @@ -180,6 +180,7 @@ namespace Introspection "Descendents", "Descrete", "Dhe", // Diffie–Hellman key exchange + "Diffable", // that you can diff it.. made up word from apple "Differental", "Diffie", "Directionfor", From 011aaf7ccb6f28c2e3d8c8cd6b8a7369d851a56c Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Wed, 6 Nov 2019 17:06:38 -0500 Subject: [PATCH 068/100] Update APIDIFF_REFERENCES to current stable (#7372) --- Make.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Make.config b/Make.config index db22780bde..572b57085b 100644 --- a/Make.config +++ b/Make.config @@ -31,7 +31,7 @@ $(TOP)/Make.config.inc: $(TOP)/Make.config $(TOP)/mk/mono.mk include $(TOP)/Make.versions -APIDIFF_REFERENCES=https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/xcode11.1/e37549bc9052bff81d5c7da8a3b7992b47a08154/29/package/bundle.zip +APIDIFF_REFERENCES=https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/xcode11.2/a82239687c7c498844137779ee529154f260cb6f/48/package/bundle.zip PACKAGE_HEAD_REV=$(shell git rev-parse HEAD) From 0641e079e0c7418ea488a2f191cb7d6f9826cdab Mon Sep 17 00:00:00 2001 From: monojenkins Date: Wed, 6 Nov 2019 23:09:49 +0100 Subject: [PATCH 069/100] Update APIDIFF_REFERENCES to current stable (#7375) --- Make.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Make.config b/Make.config index db22780bde..572b57085b 100644 --- a/Make.config +++ b/Make.config @@ -31,7 +31,7 @@ $(TOP)/Make.config.inc: $(TOP)/Make.config $(TOP)/mk/mono.mk include $(TOP)/Make.versions -APIDIFF_REFERENCES=https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/xcode11.1/e37549bc9052bff81d5c7da8a3b7992b47a08154/29/package/bundle.zip +APIDIFF_REFERENCES=https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/xcode11.2/a82239687c7c498844137779ee529154f260cb6f/48/package/bundle.zip PACKAGE_HEAD_REV=$(shell git rev-parse HEAD) From 2db10bda07a9d5a01426dc9b25de0bad3be8168a Mon Sep 17 00:00:00 2001 From: monojenkins Date: Thu, 7 Nov 2019 19:25:25 +0100 Subject: [PATCH 070/100] [Install] Do not crash when the directory is not found. (#7380) This is NOT a fix for https://github.com/xamarin/maccore/issues/2053 but a nice thing to have to make sure that when the file cannot be copied we have a useful debugging message. Fixing https://github.com/xamarin/maccore/issues/2053 should be done in the path mangler that is doing something wrong with the paths. --- tools/install-source/Program.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/install-source/Program.cs b/tools/install-source/Program.cs index 66b1d7ca52..d092f69238 100644 --- a/tools/install-source/Program.cs +++ b/tools/install-source/Program.cs @@ -275,12 +275,18 @@ public class ListSourceFiles { } try { File.Copy (fixedSource, target); - } catch (FileNotFoundException e) { + } catch (FileNotFoundException e) { Console.WriteLine ("The file {0} could not be copied to {1} because the file does not exists: {2}", fixedSource, target, e); Console.WriteLine ("Debugging info:"); Console.WriteLine ("\tSource is {0}", src); Console.WriteLine ("\tFixed source is {0}", fixedSource); - Console.WriteLine ("\tPath mangler type is {0}", mangler.GetType().Name); + Console.WriteLine ("\tPath mangler type is {0}", mangler.GetType ().Name); + } catch (DirectoryNotFoundException e) { + Console.WriteLine ("The file {0} could not be copied to {1} because the dir does not exists: {2}", fixedSource, target, e); + Console.WriteLine ("Debugging info:"); + Console.WriteLine ("\tSource is {0}", src); + Console.WriteLine ("\tFixed source is {0}", fixedSource); + Console.WriteLine ("\tPath mangler type is {0}", mangler.GetType ().Name); } catch (PathTooLongException e) { Console.WriteLine ("The file {0} could not be copied to {1} because the file path is too long: {2}", fixedSource, target, e); return 1; From 5fa3d8abbb563783721a137fa65385459bf8549d Mon Sep 17 00:00:00 2001 From: monojenkins Date: Thu, 7 Nov 2019 19:25:41 +0100 Subject: [PATCH 071/100] [Install] Do not crash when the directory is not found. (#7382) This is NOT a fix for https://github.com/xamarin/maccore/issues/2053 but a nice thing to have to make sure that when the file cannot be copied we have a useful debugging message. Fixing https://github.com/xamarin/maccore/issues/2053 should be done in the path mangler that is doing something wrong with the paths. --- tools/install-source/Program.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/install-source/Program.cs b/tools/install-source/Program.cs index 66b1d7ca52..d092f69238 100644 --- a/tools/install-source/Program.cs +++ b/tools/install-source/Program.cs @@ -275,12 +275,18 @@ public class ListSourceFiles { } try { File.Copy (fixedSource, target); - } catch (FileNotFoundException e) { + } catch (FileNotFoundException e) { Console.WriteLine ("The file {0} could not be copied to {1} because the file does not exists: {2}", fixedSource, target, e); Console.WriteLine ("Debugging info:"); Console.WriteLine ("\tSource is {0}", src); Console.WriteLine ("\tFixed source is {0}", fixedSource); - Console.WriteLine ("\tPath mangler type is {0}", mangler.GetType().Name); + Console.WriteLine ("\tPath mangler type is {0}", mangler.GetType ().Name); + } catch (DirectoryNotFoundException e) { + Console.WriteLine ("The file {0} could not be copied to {1} because the dir does not exists: {2}", fixedSource, target, e); + Console.WriteLine ("Debugging info:"); + Console.WriteLine ("\tSource is {0}", src); + Console.WriteLine ("\tFixed source is {0}", fixedSource); + Console.WriteLine ("\tPath mangler type is {0}", mangler.GetType ().Name); } catch (PathTooLongException e) { Console.WriteLine ("The file {0} could not be copied to {1} because the file path is too long: {2}", fixedSource, target, e); return 1; From a1b670cd6399fda42506f360f968b0450f371fa4 Mon Sep 17 00:00:00 2001 From: Waleed Chaudhry <54864665+wachaudh@users.noreply.github.com> Date: Thu, 7 Nov 2019 14:42:47 -0500 Subject: [PATCH 072/100] [FileProvider] Add FileProvider binding xcode11.2b1 (#7384) --- src/fileprovider.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/fileprovider.cs b/src/fileprovider.cs index 029d736284..13e71ca0ce 100644 --- a/src/fileprovider.cs +++ b/src/fileprovider.cs @@ -56,7 +56,6 @@ namespace FileProvider { NSUrl DocumentStorageUrl { get; } [NoMac] - [Deprecated (PlatformName.iOS, 13, 0)] // Undocumented replacement [Export ("URLForItemWithPersistentIdentifier:")] NSUrl GetUrlForItem (string persistentIdentifier); From 9297672d22e8132807b465c48f07041ff884e129 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Fri, 8 Nov 2019 22:07:47 +0100 Subject: [PATCH 073/100] [Install] Ensure that sources from mono are included when building from source. (#7390) The PathManglerFactory was getting confused when building mono from source again and since it did not find the sources in the download directory it considered that the path to modify was part of Xamarin. Now the factory tests first if we are getting a path from the mono external submodule, if that is the case we know is a mono path and do the right thing. Fixes https://github.com/xamarin/maccore/issues/2053 --- tools/install-source/PathManglerFactory.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/install-source/PathManglerFactory.cs b/tools/install-source/PathManglerFactory.cs index c0cc5f2004..698daff0fb 100644 --- a/tools/install-source/PathManglerFactory.cs +++ b/tools/install-source/PathManglerFactory.cs @@ -82,6 +82,10 @@ namespace InstallSources Console.WriteLine($"Mono path is {monoPath}"); return File.Exists(monoPath); } + // check if the path is the xamarin source path + the mono external submodule + var monoSubmodule = Path.Combine (XamarinSourcePath.Replace ("src/", ""), "external", "mono"); + if (path.StartsWith (monoSubmodule, StringComparison.Ordinal)) + return true; if (path.StartsWith (XamarinSourcePath, StringComparison.Ordinal)) return false; var xamarinRuntimePath = XamarinSourcePath.Replace($"/{srcSubPath}/", $"/{runtimeSubPath}/"); From 6d13a3902772ae0ff42a333329efc98a75e5f3c0 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Fri, 8 Nov 2019 22:08:30 +0100 Subject: [PATCH 074/100] [Install] Ensure that sources from mono are included when building from source. (#7389) The PathManglerFactory was getting confused when building mono from source again and since it did not find the sources in the download directory it considered that the path to modify was part of Xamarin. Now the factory tests first if we are getting a path from the mono external submodule, if that is the case we know is a mono path and do the right thing. Fixes https://github.com/xamarin/maccore/issues/2053 --- tools/install-source/PathManglerFactory.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/install-source/PathManglerFactory.cs b/tools/install-source/PathManglerFactory.cs index c0cc5f2004..698daff0fb 100644 --- a/tools/install-source/PathManglerFactory.cs +++ b/tools/install-source/PathManglerFactory.cs @@ -82,6 +82,10 @@ namespace InstallSources Console.WriteLine($"Mono path is {monoPath}"); return File.Exists(monoPath); } + // check if the path is the xamarin source path + the mono external submodule + var monoSubmodule = Path.Combine (XamarinSourcePath.Replace ("src/", ""), "external", "mono"); + if (path.StartsWith (monoSubmodule, StringComparison.Ordinal)) + return true; if (path.StartsWith (XamarinSourcePath, StringComparison.Ordinal)) return false; var xamarinRuntimePath = XamarinSourcePath.Replace($"/{srcSubPath}/", $"/{runtimeSubPath}/"); From 31be34a306b512a69fb95dfed95f535a2663345f Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 12 Nov 2019 15:05:35 +0100 Subject: [PATCH 075/100] [xcode11.3] [Packaging] Ensure that when we build from source, the srcs go to the correct place. (#7407) * [Packaging] Ensure that when we build from source, the srcs go to the correct plance. When building from source, the install-sources command was not moving the files correctly. This change makes sure that, if we build from source, we do add the mono sources in the correct location. Fixes: https://github.com/xamarin/xamarin-macios/issues/7393 --- .../MonoPathManglerTest.cs | 3 ++- tools/install-source/MonoPathMangler.cs | 22 ++++++++++++++++++- tools/install-source/PathManglerFactory.cs | 3 ++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/tools/install-source/InstallSourcesTests/MonoPathManglerTest.cs b/tools/install-source/InstallSourcesTests/MonoPathManglerTest.cs index 8a178222ef..83cb3cc5cc 100644 --- a/tools/install-source/InstallSourcesTests/MonoPathManglerTest.cs +++ b/tools/install-source/InstallSourcesTests/MonoPathManglerTest.cs @@ -19,10 +19,11 @@ namespace InstallSourcesTests monoPath = "/Users/test/xamarin-macios/external/mono/"; installDir = "/Users/test/xamarin-macios/_ios-build//Library/Frameworks/Xamarin.iOS.framework/Versions/git"; destinationDir = "/Users/test/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git"; - mangler = new MonoPathMangler { + mangler = new MonoPathMangler { InstallDir = installDir, MonoSourcePath = monoPath, DestinationDir = destinationDir, + XamarinSourcePath = "/Users/test/xamarin-macios/src", }; } diff --git a/tools/install-source/MonoPathMangler.cs b/tools/install-source/MonoPathMangler.cs index d22f4a5601..262df31e0e 100644 --- a/tools/install-source/MonoPathMangler.cs +++ b/tools/install-source/MonoPathMangler.cs @@ -7,6 +7,9 @@ namespace InstallSources { public static readonly string iOSFramework = "/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/"; public static readonly string MacFramework = "/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/src/Xamarin.Mac/"; + string monoSubmodulePath; + string xamarinSourcePath; + /// /// Gets and sets the location of the mono sources. /// @@ -19,12 +22,29 @@ namespace InstallSources /// The frame work dir. public string DestinationDir { get; set; } + /// + /// Gets and sets the path to the xamarin source. + /// + /// The xamarin source path. + public string XamarinSourcePath { + get { + return xamarinSourcePath; + } + set { + xamarinSourcePath = value; + monoSubmodulePath = Path.Combine (value.Replace ("src/", ""), "external", "mono") + "/"; + } + } + /// /// Gets or sets the install dir. /// /// The install dir. public string InstallDir { get; set; } + bool IsCheckout (string path) + => path.StartsWith (monoSubmodulePath, StringComparison.Ordinal); + public string GetSourcePath (string path) { // we are dealing with a Mono archive assembly @@ -40,7 +60,7 @@ namespace InstallSources public string GetTargetPath (string path) { - var relativePath = path.Substring (MonoSourcePath.Length); + var relativePath = path.Substring (IsCheckout (path) ? monoSubmodulePath.Length : MonoSourcePath.Length); if (relativePath.StartsWith ("/", StringComparison.Ordinal)) relativePath = relativePath.Remove (0, 1); var target = Path.Combine (DestinationDir, "src", (InstallDir.Contains("Xamarin.iOS")?"Xamarin.iOS":"Xamarin.Mac"), relativePath); diff --git a/tools/install-source/PathManglerFactory.cs b/tools/install-source/PathManglerFactory.cs index 698daff0fb..17299cae0a 100644 --- a/tools/install-source/PathManglerFactory.cs +++ b/tools/install-source/PathManglerFactory.cs @@ -28,7 +28,8 @@ namespace InstallSources monoMangler = new MonoPathMangler { InstallDir = InstallDir, DestinationDir = DestinationDir, - MonoSourcePath = MonoSourcePath + MonoSourcePath = MonoSourcePath, + XamarinSourcePath = XamarinSourcePath, }; return monoMangler; } From 83fd5162f28694720118bef5a6aeb879b62c085a Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 12 Nov 2019 21:08:18 +0100 Subject: [PATCH 076/100] [xcode11.3] [Tests] If we have server errors. Mark test as inconclusive. (#7415) If we are getting errors (500,401..) do not mark a link all test as a failure, but as inconclusive. Fixes: https://github.com/xamarin/maccore/issues/2056 --- tests/linker/mac/LinkAnyTest.cs | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/tests/linker/mac/LinkAnyTest.cs b/tests/linker/mac/LinkAnyTest.cs index 3d3750cb14..ed75a48bc6 100644 --- a/tests/linker/mac/LinkAnyTest.cs +++ b/tests/linker/mac/LinkAnyTest.cs @@ -21,15 +21,27 @@ namespace LinkAnyTest { } static bool waited; + static bool requestError; + static HttpStatusCode statusCode; + + // http://blogs.msdn.com/b/csharpfaq/archive/2012/06/26/understanding-a-simple-async-program.aspx // ref: https://bugzilla.xamarin.com/show_bug.cgi?id=7114 static async Task GetWebPageAsync () { - Task getWebPageTask = new HttpClient ().GetStringAsync ("http://msdn.microsoft.com"); - string content = await getWebPageTask; - waited = true; - bool success = !String.IsNullOrEmpty (content); - Assert.IsTrue (success, $"received {content.Length} bytes"); + // do not use GetStringAsync, we are going to miss useful data, such as the resul code + using (var client = new HttpClient ()) { + HttpResponseMessage response = await client.GetAsync ("http://example.com"); + if(!response.IsSuccessStatusCode) { + requestError = true; + statusCode = response.StatusCode; + } else { + string content = await response.Content.ReadAsStringAsync (); + waited = true; + bool success = !String.IsNullOrEmpty (content); + Assert.IsTrue (success, $"received {content.Length} bytes"); + } + } } [Test] @@ -40,7 +52,11 @@ namespace LinkAnyTest { // we do not want the async code to get back to the AppKit thread, hanging the process SynchronizationContext.SetSynchronizationContext (null); GetWebPageAsync ().Wait (); - Assert.IsTrue (waited, "async/await worked"); + if (requestError) { + Assert.Inconclusive ($"Test cannot be trusted. Issues performing the request. Status code '{statusCode}'"); + } else { + Assert.IsTrue (waited, "async/await worked"); + } } finally { SynchronizationContext.SetSynchronizationContext (current_sc); } From b69e72ba5ccb5f69fb752927569fc7bd021fcff8 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 12 Nov 2019 21:45:06 +0100 Subject: [PATCH 077/100] [d16-4] [Tests] If we have server errors. Mark test as inconclusive. (#7417) If we are getting errors (500,401..) do not mark a link all test as a failure, but as inconclusive. Fixes: https://github.com/xamarin/maccore/issues/2056 --- tests/linker/mac/LinkAnyTest.cs | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/tests/linker/mac/LinkAnyTest.cs b/tests/linker/mac/LinkAnyTest.cs index 3d3750cb14..ed75a48bc6 100644 --- a/tests/linker/mac/LinkAnyTest.cs +++ b/tests/linker/mac/LinkAnyTest.cs @@ -21,15 +21,27 @@ namespace LinkAnyTest { } static bool waited; + static bool requestError; + static HttpStatusCode statusCode; + + // http://blogs.msdn.com/b/csharpfaq/archive/2012/06/26/understanding-a-simple-async-program.aspx // ref: https://bugzilla.xamarin.com/show_bug.cgi?id=7114 static async Task GetWebPageAsync () { - Task getWebPageTask = new HttpClient ().GetStringAsync ("http://msdn.microsoft.com"); - string content = await getWebPageTask; - waited = true; - bool success = !String.IsNullOrEmpty (content); - Assert.IsTrue (success, $"received {content.Length} bytes"); + // do not use GetStringAsync, we are going to miss useful data, such as the resul code + using (var client = new HttpClient ()) { + HttpResponseMessage response = await client.GetAsync ("http://example.com"); + if(!response.IsSuccessStatusCode) { + requestError = true; + statusCode = response.StatusCode; + } else { + string content = await response.Content.ReadAsStringAsync (); + waited = true; + bool success = !String.IsNullOrEmpty (content); + Assert.IsTrue (success, $"received {content.Length} bytes"); + } + } } [Test] @@ -40,7 +52,11 @@ namespace LinkAnyTest { // we do not want the async code to get back to the AppKit thread, hanging the process SynchronizationContext.SetSynchronizationContext (null); GetWebPageAsync ().Wait (); - Assert.IsTrue (waited, "async/await worked"); + if (requestError) { + Assert.Inconclusive ($"Test cannot be trusted. Issues performing the request. Status code '{statusCode}'"); + } else { + Assert.IsTrue (waited, "async/await worked"); + } } finally { SynchronizationContext.SetSynchronizationContext (current_sc); } From d99e3b24f91834b06e77ea6b211ca573afbf5ae2 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Wed, 13 Nov 2019 06:06:23 -0500 Subject: [PATCH 078/100] [CoreFoundation] Add Clone method for CFArray. (#7403) When working on https://github.com/xamarin/maccore/issues/940 we noticed that clone the array would be a better approach. The CFArrayCreateCopy add some nice things: * The pointer values from theArray are copied into the new array. * The values are also retained by the new array. * The count of the new array is the same as theArray * The new array uses the same callbacks as theArray. [IMPORTANT] Whith this in, we can have a better fix for https://github.com/xamarin/maccore/issues/940 --- src/CoreFoundation/CFArray.cs | 7 +++++++ tests/xtro-sharpie/common-CoreFoundation.ignore | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/CoreFoundation/CFArray.cs b/src/CoreFoundation/CFArray.cs index 7f5df0e795..d3b9dd5f08 100644 --- a/src/CoreFoundation/CFArray.cs +++ b/src/CoreFoundation/CFArray.cs @@ -35,6 +35,8 @@ using Foundation; using ObjCRuntime; using CFIndex = System.nint; +using CFArrayRef = System.IntPtr; +using CFAllocatorRef = System.IntPtr; namespace CoreFoundation { @@ -149,6 +151,11 @@ namespace CoreFoundation { { return CFArrayGetCount (array); } + + [DllImport (Constants.CoreFoundationLibrary)] + extern static CFArrayRef CFArrayCreateCopy (CFAllocatorRef allocator, CFArrayRef theArray); + + public CFArray Clone () => new CFArray (CFArrayCreateCopy (IntPtr.Zero, this.Handle), true); } } diff --git a/tests/xtro-sharpie/common-CoreFoundation.ignore b/tests/xtro-sharpie/common-CoreFoundation.ignore index 3db8cadbd8..ee1d3a96ee 100644 --- a/tests/xtro-sharpie/common-CoreFoundation.ignore +++ b/tests/xtro-sharpie/common-CoreFoundation.ignore @@ -334,7 +334,6 @@ !missing-pinvoke! CFArrayApplyFunction is not bound !missing-pinvoke! CFArrayBSearchValues is not bound !missing-pinvoke! CFArrayContainsValue is not bound -!missing-pinvoke! CFArrayCreateCopy is not bound !missing-pinvoke! CFArrayCreateMutable is not bound !missing-pinvoke! CFArrayCreateMutableCopy is not bound !missing-pinvoke! CFArrayExchangeValuesAtIndices is not bound From cd7c5171a981bf3d44360111bacad7fb7a9153df Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Wed, 13 Nov 2019 17:19:16 -0500 Subject: [PATCH 079/100] [CoreFoundation] CFBundle.GetAll better thread safe. (#7425) The initial solution fixed the rance condition in which the index changed, but that did not guarantee that we would get the correct bundles. We now clone the CFArray (which also clones the callbacks set to the array) and iterate over it to make sure Apple does not do evil tings while we are iteraing. Better Fixes: https://github.com/xamarin/maccore/issues/940 --- src/CoreFoundation/CFBundle.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/CoreFoundation/CFBundle.cs b/src/CoreFoundation/CFBundle.cs index c4ac2db5ea..581e73112a 100644 --- a/src/CoreFoundation/CFBundle.cs +++ b/src/CoreFoundation/CFBundle.cs @@ -103,11 +103,22 @@ namespace CoreFoundation { public static CFBundle[] GetAll () { - using (var cfBundles = new CFArray (CFBundleGetAllBundles ())) { - var managedBundles = new CFBundle [cfBundles.Count]; - for (int index = 0; index < cfBundles.Count; index++) { + // as per apple documentation: + // CFBundleGetAllBundles + // + // 'This function is potentially expensive and not thread-safe' + // + // This means, that we should not trust the size of the array, since is a get and + // might be modified by a diff thread. We are going to clone the array and make sure + // that Apple does not modify the array while we work with it. That avoids changes + // in the index or in the bundles returned. + using (var cfBundles = new CFArray (CFBundleGetAllBundles ())) + using (var cfBundlesCopy = cfBundles.Clone () ) { + var bundleCount = cfBundlesCopy.Count; // the property is a C call, calling everytime we loop is not needed + var managedBundles = new CFBundle [bundleCount]; + for (int index = 0; index < bundleCount; index++) { // follow the get rule, we do not own the object - managedBundles [index] = new CFBundle (cfBundles.GetValue (index), false); + managedBundles [index] = new CFBundle (cfBundlesCopy.GetValue (index), false); } return managedBundles; } From 5e52f30c0545ccf8aee448dffb96ce3e88463987 Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Thu, 14 Nov 2019 08:32:26 -0500 Subject: [PATCH 080/100] Bump for Xcode 11.3 beta 1 (#7431) * Bump for Xcode 11.3 beta 1 * [system-dependencies] Make it clearer what failed on the bots. Locally we use colors to distinguish between warnings and failures, but colors don't show up on the bots, so use text instead. * Verbose provisioning. * [system-dependencies] Improve simulator checks a bit. * Non-verbose provisioning. --- Make.config | 10 +++++----- Versions-ios.plist.in | 2 ++ system-dependencies.sh | 19 +++++++++++++------ tools/siminstaller/Program.cs | 7 +------ 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/Make.config b/Make.config index 572b57085b..4df0124126 100644 --- a/Make.config +++ b/Make.config @@ -59,9 +59,9 @@ IOS_PACKAGE_VERSION_BUILD=$(IOS_COMMIT_DISTANCE) IOS_PACKAGE_UPDATE_ID=$(shell printf "2%02d%02d%02d%03d" $(IOS_PACKAGE_VERSION_MAJOR) $(IOS_PACKAGE_VERSION_MINOR) $(IOS_PACKAGE_VERSION_REV) $(IOS_PACKAGE_VERSION_BUILD)) # Xcode version should have both a major and a minor version (even if the minor version is 0) -XCODE_VERSION=11.2 -XCODE_URL=http://xamarin-storage/bot-provisioning/xcodes/Xcode_11.2.xip -XCODE_DEVELOPER_ROOT=/Applications/Xcode112.app/Contents/Developer +XCODE_VERSION=11.3 +XCODE_URL=http://xamarin-storage/bot-provisioning/xcodes/Xcode_11.3_beta.xip +XCODE_DEVELOPER_ROOT=/Applications/Xcode113-beta1.app/Contents/Developer XCODE_PRODUCT_BUILD_VERSION:=$(shell /usr/libexec/PlistBuddy -c 'Print :ProductBuildVersion' $(XCODE_DEVELOPER_ROOT)/../version.plist) # Mono version embedded in XI/XM (NEEDED_MONO_VERSION/BRANCH) are specified in mk/mono.mk @@ -106,9 +106,9 @@ TVOS_SDK_VERSION=13.2 # If the max OS version does not match the SDK version (for instance the iOS # 12.2 SDK supported both iOS 12.3 and iOS 12.4), then these variables can be # set to something other than the corresponding SDK versions. -MAX_IOS_VERSION=$(IOS_SDK_VERSION) +MAX_IOS_VERSION=13.3 MAX_WATCH_VERSION=$(WATCH_SDK_VERSION) -MAX_TVOS_VERSION=$(TVOS_SDK_VERSION) +MAX_TVOS_VERSION=13.3 # Minimum OS versions for running XI/XM apps. MIN_IOS_SDK_VERSION=7.0 diff --git a/Versions-ios.plist.in b/Versions-ios.plist.in index b0f084d071..b4e9cebd8b 100644 --- a/Versions-ios.plist.in +++ b/Versions-ios.plist.in @@ -36,6 +36,7 @@ 13.0 13.1 13.2 + 13.3 tvOS @@ -57,6 +58,7 @@ 12.4 13.0 13.2 + 13.3 watchOS diff --git a/system-dependencies.sh b/system-dependencies.sh index 1ee4626a65..6d796f4caa 100755 --- a/system-dependencies.sh +++ b/system-dependencies.sh @@ -179,8 +179,11 @@ COLOR_MAGENTA=$(tput setaf 5 2>/dev/null || true) COLOR_BLUE=$(tput setaf 6 2>/dev/null || true) COLOR_CLEAR=$(tput sgr0 2>/dev/null || true) COLOR_RESET=uniquesearchablestring +FAILURE_PREFIX= +if test -z "$COLOR_RED"; then FAILURE_PREFIX="** failure ** "; fi + function fail () { - echo " ${COLOR_RED}${1//${COLOR_RESET}/${COLOR_RED}}${COLOR_CLEAR}" + echo " $FAILURE_PREFIX${COLOR_RED}${1//${COLOR_RESET}/${COLOR_RED}}${COLOR_CLEAR}" FAIL=1 } @@ -950,7 +953,7 @@ function check_simulators () local XCODE EXTRA_SIMULATORS=$(grep ^EXTRA_SIMULATORS= Make.config | sed 's/.*=//') - XCODE=$(grep ^XCODE_DEVELOPER_ROOT= Make.config | sed 's/.*=//')/../.. + XCODE=$(dirname "$(dirname "$(grep ^XCODE_DEVELOPER_ROOT= Make.config | sed 's/.*=//')")") if ! make -C tools/siminstaller >/dev/null; then warn "Can't check if simulators are available, because siminstaller failed to build." @@ -976,13 +979,17 @@ function check_simulators () fi if [[ "$FAILED_SIMULATORS" =~ "Unknown simulators:" ]]; then $action "${FAILED_SIMULATORS}" - $action " If you just updated the Xcode version, it's likely Apple stopped shipping these simulators with the new version of Xcode." - $action " If that's the case, you can list the available simulators with ${COLOR_MAGENTA}make -C tools/siminstaller print-simulators${COLOR_RESET}," + $action " If you just updated the Xcode version, it's possible Apple stopped shipping these simulators with the new version of Xcode." + $action " If that's the case, you can list the available simulators with ${COLOR_MAGENTA}make -C tools/siminstaller print-simulators --xcode $XCODE${COLOR_RESET}," $action " and then update the ${COLOR_MAGENTA}MIN__SIMULATOR_VERSION${COLOR_RESET} and ${COLOR_MAGENTA}EXTRA_SIMULATORS${COLOR_RESET} variables in Make.config to the earliest available simulators." + $action " Another possibility is that Apple is not shipping any simulators (yet?) for the new version of Xcode (if the previous list shows no simulators)." else if ! test -z $PROVISION_SIMULATORS; then - mono --debug tools/siminstaller/bin/Debug/siminstaller.exe -q --xcode "$XCODE" "${SIMS[@]}" - ok "Extra simulators installed successfully: '${FAILED_SIMULATORS//$'\n'/', '}'" + if ! mono --debug tools/siminstaller/bin/Debug/siminstaller.exe -q --xcode "$XCODE" "${SIMS[@]}"; then + $action "Failed to install extra simulators." + else + ok "Extra simulators installed successfully: '${FAILED_SIMULATORS//$'\n'/', '}'" + fi else $action "The simulators '${FAILED_SIMULATORS//$'\n'/', '}' are not installed or need to be upgraded." fi diff --git a/tools/siminstaller/Program.cs b/tools/siminstaller/Program.cs index 555d85f880..d20beffaea 100644 --- a/tools/siminstaller/Program.cs +++ b/tools/siminstaller/Program.cs @@ -260,12 +260,7 @@ namespace xsiminstaller { } if (install.Count > 0) { - if (only_check) { - foreach (var sim in install) - Console.WriteLine ($"{sim} (unknown)"); - } else { - Console.WriteLine ("Unknown simulators: {0}", string.Join (", ", install)); - } + Console.WriteLine ("Unknown simulators: {0}", string.Join (", ", install)); return 1; } From e31e6773d1a9650e5837f992f27cf284795324a7 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 15 Nov 2019 08:48:22 +0100 Subject: [PATCH 081/100] Bump mono to get archive built with Xcode 11.3 b1. (#7444) New commits in mono/mono: * mono/mono@3e882ed1a20 [2019-08][ci] Add Xcode 11.3beta1 for XI/XM Mono SDK builds * mono/mono@e59c3fbb688 Bump msbuild packages to 1e1d0f2caad3731357cca18b298536e514f5519b (#17724) Diff: https://github.com/mono/mono/compare/062f0ab8cae60d1d347e4d722884c065c9f34484..3e882ed1a2013f756bdbe104c23e8ff54d5fa49c --- mk/mono.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mk/mono.mk b/mk/mono.mk index b6818f60c5..5e116b50a6 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,5 +1,5 @@ -NEEDED_MONO_VERSION := 062f0ab8cae60d1d347e4d722884c065c9f34484 -NEEDED_MONO_BRANCH := 2019-08 +NEEDED_MONO_VERSION := 3e882ed1a2013f756bdbe104c23e8ff54d5fa49c +NEEDED_MONO_BRANCH := 2019-08-xcode11.3 MONO_DIRECTORY := mono MONO_MODULE := https://github.com/mono/mono From 0e394f7e80445899ecb150d41a5557022315d581 Mon Sep 17 00:00:00 2001 From: Pramit Mallick Date: Fri, 15 Nov 2019 21:16:40 +0530 Subject: [PATCH 082/100] CoreFoundation update - adding to ignore (#7448) --- tests/xtro-sharpie/macOS-CoreFoundation.ignore | 2 ++ tests/xtro-sharpie/macOS-CoreFoundation.todo | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/xtro-sharpie/macOS-CoreFoundation.ignore b/tests/xtro-sharpie/macOS-CoreFoundation.ignore index 4b7472403d..23e7fe2a1c 100644 --- a/tests/xtro-sharpie/macOS-CoreFoundation.ignore +++ b/tests/xtro-sharpie/macOS-CoreFoundation.ignore @@ -74,3 +74,5 @@ !missing-pinvoke! CFXMLTreeCreateXMLData is not bound !missing-pinvoke! CFXMLTreeGetNode is not bound !unknown-pinvoke! _NSGetExecutablePath bound +!missing-field! kCFUserNotificationAlertTopMostKey not bound +!missing-field! kCFUserNotificationKeyboardTypesKey not bound diff --git a/tests/xtro-sharpie/macOS-CoreFoundation.todo b/tests/xtro-sharpie/macOS-CoreFoundation.todo index 0fa3678642..e69de29bb2 100644 --- a/tests/xtro-sharpie/macOS-CoreFoundation.todo +++ b/tests/xtro-sharpie/macOS-CoreFoundation.todo @@ -1,2 +0,0 @@ -!missing-field! kCFUserNotificationAlertTopMostKey not bound -!missing-field! kCFUserNotificationKeyboardTypesKey not bound From 806404fa51886aa1c066a7271a5493e4ef08c97e Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 15 Nov 2019 17:21:10 +0100 Subject: [PATCH 083/100] Keep track of SDK versions and OS versions separately. Fixes xamarin/maccore#2066. (#7454) The latest SDK version and the latest OS version does not necessarily have to match (for instance the iOS 13.2 SDK can support both iOS 13.2 and iOS 13.3), so keep track of them separately. Also use the latest OS version to determine which simulator to run, instead of the latest SDK version (Xcode 11.3 ships with the iOS 13.2 SDK but only has an iOS 13.3 simulator, not an iOS 13.2 simulator). Fixes https://github.com/xamarin/maccore/issues/2066. --- tests/xharness/Simulators.cs | 10 +++++----- tools/common/Make.common | 4 ++++ tools/common/SdkVersions.cs.in | 12 +++++++++++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/tests/xharness/Simulators.cs b/tests/xharness/Simulators.cs index 2a41e9c3b7..5112e853a2 100644 --- a/tests/xharness/Simulators.cs +++ b/tests/xharness/Simulators.cs @@ -253,21 +253,21 @@ namespace xharness break; case AppRunnerTarget.Simulator_iOS64: simulator_devicetype = "com.apple.CoreSimulator.SimDeviceType." + (min_version ? "iPhone-6" : "iPhone-X"); - simulator_runtime = "com.apple.CoreSimulator.SimRuntime.iOS-" + (min_version ? Xamarin.SdkVersions.MiniOSSimulator : Xamarin.SdkVersions.iOS).Replace ('.', '-'); + simulator_runtime = "com.apple.CoreSimulator.SimRuntime.iOS-" + (min_version ? Xamarin.SdkVersions.MiniOSSimulator : Xamarin.SdkVersions.MaxiOSSimulator).Replace ('.', '-'); break; case AppRunnerTarget.Simulator_iOS: simulator_devicetype = "com.apple.CoreSimulator.SimDeviceType.iPhone-5"; - simulator_runtime = "com.apple.CoreSimulator.SimRuntime.iOS-" + (min_version ? Xamarin.SdkVersions.MiniOSSimulator : Xamarin.SdkVersions.iOS).Replace ('.', '-'); + simulator_runtime = "com.apple.CoreSimulator.SimRuntime.iOS-" + (min_version ? Xamarin.SdkVersions.MiniOSSimulator : Xamarin.SdkVersions.MaxiOSSimulator).Replace ('.', '-'); break; case AppRunnerTarget.Simulator_tvOS: simulator_devicetype = "com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p"; - simulator_runtime = "com.apple.CoreSimulator.SimRuntime.tvOS-" + (min_version ? Xamarin.SdkVersions.MinTVOSSimulator : Xamarin.SdkVersions.TVOS).Replace ('.', '-'); + simulator_runtime = "com.apple.CoreSimulator.SimRuntime.tvOS-" + (min_version ? Xamarin.SdkVersions.MinTVOSSimulator : Xamarin.SdkVersions.MaxTVOSSimulator).Replace ('.', '-'); break; case AppRunnerTarget.Simulator_watchOS: simulator_devicetype = "com.apple.CoreSimulator.SimDeviceType." + (min_version ? "Apple-Watch-38mm" : "Apple-Watch-Series-3-38mm"); - simulator_runtime = "com.apple.CoreSimulator.SimRuntime.watchOS-" + (min_version ? Xamarin.SdkVersions.MinWatchOSSimulator : Xamarin.SdkVersions.WatchOS).Replace ('.', '-'); + simulator_runtime = "com.apple.CoreSimulator.SimRuntime.watchOS-" + (min_version ? Xamarin.SdkVersions.MinWatchOSSimulator : Xamarin.SdkVersions.MaxWatchOSSimulator).Replace ('.', '-'); companion_devicetype = "com.apple.CoreSimulator.SimDeviceType." + (min_version ? "iPhone-6" : "iPhone-X"); - companion_runtime = "com.apple.CoreSimulator.SimRuntime.iOS-" + (min_version ? Xamarin.SdkVersions.MinWatchOSCompanionSimulator : Xamarin.SdkVersions.iOS).Replace ('.', '-'); + companion_runtime = "com.apple.CoreSimulator.SimRuntime.iOS-" + (min_version ? Xamarin.SdkVersions.MinWatchOSCompanionSimulator : Xamarin.SdkVersions.MaxWatchOSCompanionSimulator).Replace ('.', '-'); break; default: throw new Exception (string.Format ("Unknown simulator target: {0}", target)); diff --git a/tools/common/Make.common b/tools/common/Make.common index fefe3d3536..b039ee4b18 100644 --- a/tools/common/Make.common +++ b/tools/common/Make.common @@ -8,6 +8,10 @@ SdkVersions.cs: ../common/SdkVersions.cs.in Makefile $(TOP)/Make.config -e 's/@MIN_WATCHOS_SIMULATOR_VERSION@/$(MIN_WATCHOS_SIMULATOR_VERSION)/' \ -e 's/@MIN_WATCHOS_COMPANION_SIMULATOR_VERSION@/$(MIN_WATCHOS_COMPANION_SIMULATOR_VERSION)/' \ -e 's/@MIN_TVOS_SIMULATOR_VERSION@/$(MIN_TVOS_SIMULATOR_VERSION)/' \ + -e "s/@MAX_IOS_VERSION@/$(MAX_IOS_VERSION)/g" \ + -e "s/@MAX_MACOS_VERSION@/$(MAX_MACOS_VERSION)/g" \ + -e "s/@MAX_WATCH_VERSION@/$(MAX_WATCH_VERSION)/g" \ + -e "s/@MAX_TVOS_VERSION@/$(MAX_TVOS_VERSION)/g" \ $< > $@ diff --git a/tools/common/SdkVersions.cs.in b/tools/common/SdkVersions.cs.in index 910f7665b9..83663190b0 100644 --- a/tools/common/SdkVersions.cs.in +++ b/tools/common/SdkVersions.cs.in @@ -27,6 +27,11 @@ namespace Xamarin { public const string MinWatchOSCompanionSimulator = "@MIN_WATCHOS_COMPANION_SIMULATOR_VERSION@"; public const string MinTVOSSimulator = "@MIN_TVOS_SIMULATOR_VERSION@"; + public const string MaxiOSSimulator = "@MAX_IOS_VERSION@"; + public const string MaxWatchOSSimulator = "@MAX_WATCH_VERSION@"; + public const string MaxWatchOSCompanionSimulator = "@MAX_IOS_VERSION@"; + public const string MaxTVOSSimulator = "@MAX_TVOS_VERSION@"; + public static Version OSXVersion { get { return new Version (OSX); }} public static Version iOSVersion { get { return new Version (iOS); }} public static Version WatchOSVersion { get { return new Version (WatchOS); }} @@ -39,9 +44,14 @@ namespace Xamarin { public static Version MiniOSSimulatorVersion { get { return new Version (MiniOSSimulator); }} public static Version MinWatchOSSimulatorVersion { get { return new Version (MinWatchOSSimulator); }} - public static Version MinWatchOSCompanionSimulatorVersion { get { return new Version (MinWatchOSSimulator); }} + public static Version MinWatchOSCompanionSimulatorVersion { get { return new Version (MinWatchOSCompanionSimulator); }} public static Version MinTVOSSimulatorVersion { get { return new Version (MinTVOSSimulator); }} + public static Version MaxiOSSimulatorVersion { get { return new Version (MaxiOSSimulator); }} + public static Version MaxWatchOSSimulatorVersion { get { return new Version (MaxWatchOSSimulator); }} + public static Version MaxWatchOSCompanionSimulatorVersion { get { return new Version (MaxWatchOSCompanionSimulator); }} + public static Version MaxTVOSSimulatorVersion { get { return new Version (MaxTVOSSimulator); }} + public static Version XcodeVersion { get { return new Version (Xcode); }} #if MTOUCH || MMP From f7212e7dc5cd66dd3b99cd701d42d977e80b3984 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 20 Nov 2019 13:45:01 -0500 Subject: [PATCH 084/100] [introspection] UIMenuController's default ctor stopped working in iOS 13.3. Fixes xamarin/maccore#2067. (#7458) * [introspection] UIMenuController's default ctor stopped working in iOS 13.3. Fixes xamarin/maccore#2067. Fixes https://github.com/xamarin/maccore/issues/2067. * [tests] Add support for comparing 3-part system version strings to watchOS. --- src/ObjCRuntime/Runtime.cs | 24 +++++++++++++++- src/WatchKit/WKInterfaceDevice.cs | 5 ++++ tests/common/TestRuntime.cs | 28 +++++++++++++++++++ tests/introspection/iOS/iOSApiCtorInitTest.cs | 2 ++ 4 files changed, 58 insertions(+), 1 deletion(-) diff --git a/src/ObjCRuntime/Runtime.cs b/src/ObjCRuntime/Runtime.cs index 363149ffff..17fdd4fa3f 100644 --- a/src/ObjCRuntime/Runtime.cs +++ b/src/ObjCRuntime/Runtime.cs @@ -1595,8 +1595,14 @@ namespace ObjCRuntime { static int MajorVersion = -1; static int MinorVersion = -1; + static int BuildVersion = -1; internal static bool CheckSystemVersion (int major, int minor, string systemVersion) + { + return CheckSystemVersion (major, minor, 0, systemVersion); + } + + internal static bool CheckSystemVersion (int major, int minor, int build, string systemVersion) { if (MajorVersion == -1) { string[] version = systemVersion.Split (new char[] { '.' }); @@ -1606,9 +1612,25 @@ namespace ObjCRuntime { if (version.Length < 2 || !int.TryParse (version[1], NumberStyles.Integer, CultureInfo.InvariantCulture, out MinorVersion)) MinorVersion = 0; + + if (version.Length < 3 || !int.TryParse (version[2], NumberStyles.Integer, CultureInfo.InvariantCulture, out BuildVersion)) + BuildVersion = 0; } - return MajorVersion > major || (MajorVersion == major && MinorVersion >= minor); + if (MajorVersion > major) + return true; + else if (MajorVersion < major) + return false; + + if (MinorVersion > minor) + return true; + else if (MinorVersion < minor) + return false; + + if (BuildVersion < build) + return false; + + return true; } internal static IntPtr CloneMemory (IntPtr source, nint length) diff --git a/src/WatchKit/WKInterfaceDevice.cs b/src/WatchKit/WKInterfaceDevice.cs index 4b3a92a6dd..a153781fdd 100644 --- a/src/WatchKit/WKInterfaceDevice.cs +++ b/src/WatchKit/WKInterfaceDevice.cs @@ -31,6 +31,11 @@ namespace WatchKit { { return Runtime.CheckSystemVersion (major, minor, SystemVersion); } + + public bool CheckSystemVersion (int major, int minor, int build) + { + return Runtime.CheckSystemVersion (major, minor, build, SystemVersion); + } } } diff --git a/tests/common/TestRuntime.cs b/tests/common/TestRuntime.cs index dba5f01ba9..460891a402 100644 --- a/tests/common/TestRuntime.cs +++ b/tests/common/TestRuntime.cs @@ -259,6 +259,18 @@ partial class TestRuntime return CheckMacSystemVersion (10, 15, 1); #else throw new NotImplementedException (); +#endif + case 3: +#if __WATCHOS__ + return CheckWatchOSSystemVersion (6, 1, 1); +#elif __TVOS__ + return ChecktvOSSystemVersion (13, 3); +#elif __IOS__ + return CheckiOSSystemVersion (13, 3); +#elif MONOMAC + return CheckMacSystemVersion (10, 15, 2); +#else + throw new NotImplementedException (); #endif default: throw new NotImplementedException (); @@ -644,6 +656,22 @@ partial class TestRuntime #endif } + // This method returns true if: + // system version >= specified version + // AND + // sdk version >= specified version + static bool CheckWatchOSSystemVersion (int major, int minor, int build, bool throwIfOtherPlatform = true) + { +#if __WATCHOS__ + return WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (major, minor, build); +#else + if (throwIfOtherPlatform) + throw new Exception ("Can't get watchOS System version on iOS/tvOS."); + // This is both iOS and tvOS + return true; +#endif + } + static void AssertWatchOSSystemVersion (int major, int minor, bool throwIfOtherPlatform = true) { if (CheckWatchOSSystemVersion (major, minor, throwIfOtherPlatform)) diff --git a/tests/introspection/iOS/iOSApiCtorInitTest.cs b/tests/introspection/iOS/iOSApiCtorInitTest.cs index 5a5e0f7a71..5a6f1aed4e 100644 --- a/tests/introspection/iOS/iOSApiCtorInitTest.cs +++ b/tests/introspection/iOS/iOSApiCtorInitTest.cs @@ -239,6 +239,8 @@ namespace Introspection { return Runtime.Arch == Arch.SIMULATOR; case "AVAudioRecorder": // Stopped working with Xcode 11.2 beta 2 return TestRuntime.CheckXcodeVersion (11, 2); + case "UIMenuController": // Stopped working with Xcode 11.3 beta 1 + return TestRuntime.CheckXcodeVersion (11, 3); default: return base.Skip (type); } From 88dc8642f0061710ca9001adbe4ca5fad8c7efd9 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Fri, 22 Nov 2019 16:34:30 +0100 Subject: [PATCH 085/100] [xcode11.3] [Tests] Update tests.sln to include all the BCL tests. (#7482) Update the UUIDs of the projects to ensure that they are all present in the sln for developers to use. Fixes: https://github.com/xamarin/xamarin-macios/issues/7475 FIxes: https://github.com/xamarin/xamarin-macios/issues/7476 --- tests/tests.sln | 214 ++++++++++++++++++++++++++---------------------- 1 file changed, 115 insertions(+), 99 deletions(-) diff --git a/tests/tests.sln b/tests/tests.sln index 432cd1b00c..9c9981a2a1 100644 --- a/tests/tests.sln +++ b/tests/tests.sln @@ -17,18 +17,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bindings-framework-test", " EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "fsharplibrary", "fsharplibrary\fsharplibrary.fsproj", "{C7212169-BA46-413B-91CD-A32C52AD5E0D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mscorlib", "bcl-test\mscorlib\mscorlib.csproj", "{34CB1751-E445-4E32-BFA7-03E6831C11EE}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data", "bcl-test\System.Data\System.Data.csproj", "{BEF0140A-A6A6-4074-B55F-03856A6B5862}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Net.Http", "bcl-test\System.Net.Http\System.Net.Http.csproj", "{D7212E3D-CD1B-4E58-A11D-C7B7898168AA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Services", "bcl-test\System.Web.Services\System.Web.Services.csproj", "{DA061019-04C3-4221-AF04-63F2BFB5DA42}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Xml", "bcl-test\System.Xml\System.Xml.csproj", "{93268FFB-571C-4402-8899-027A7778D2C0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Data.Sqlite", "bcl-test\Mono.Data.Sqlite\Mono.Data.Sqlite.csproj", "{1ADF4F27-7610-4501-A62E-1157273AED7E}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "introspection-ios", "introspection\iOS\introspection-ios.csproj", "{208744BD-504E-47D7-9A98-1CF02454A6DA}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dont link", "linker\ios\dont link\dont link.csproj", "{839212D5-C25B-4284-AA96-59C3872B8184}" @@ -41,83 +29,21 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoTouch.NUnitLite", "..\s EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mtouch", "mtouch\mtouch.csproj", "{9A1177F5-16E6-45DE-AA69-DC9924EC39B8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mscorlib-0", "bcl-test\mscorlib\mscorlib-0.csproj", "{6F47C092-2F85-43D6-1111-E687426F6BF3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mscorlib-1", "bcl-test\mscorlib\mscorlib-1.csproj", "{6F47C092-2F85-43D6-2222-E687426F6BF3}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "testgenerator", "test-libraries\testgenerator.csproj", "{CD430449-8E59-4ECD-ADD9-ACF79E9E660B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemXunit", "bcl-test\BCLTests\SystemXunit.csproj", "{3A835432-B054-32FD-07CB-F9A8FFCFB44D}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sampletester", "sampletester\sampletester.csproj", "{7340A1C6-61A5-42D2-9DBC-6688D2E70F62}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemXmlXunit", "bcl-test\BCLTests\SystemXmlXunit.csproj", "{E5B0BF8F-128E-8C1F-5A10-99D26AA71E76}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mscorlib", "bcl-test\mscorlib.csproj", "{8DE7D61C-03C1-AF93-F83A-30F620EB2229}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemXmlTests", "bcl-test\BCLTests\SystemXmlTests.csproj", "{387EAD7C-3E00-6BEC-8914-586A0BE31907}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BCL tests group 1", "bcl-test\BCL tests group 1.csproj", "{3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemXmlLinqTests", "bcl-test\BCLTests\SystemXmlLinqTests.csproj", "{274328F1-9A35-ED63-A95C-D995076011DA}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BCL tests group 2", "bcl-test\BCL tests group 2.csproj", "{CB005E01-C7E1-7045-FCEF-C82DC9A35A49}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemWebServicesTests", "bcl-test\BCLTests\SystemWebServicesTests.csproj", "{36263A92-DACE-4BB0-063E-CD7107CF788A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BCL tests group 3", "bcl-test\BCL tests group 3.csproj", "{03953BD6-975D-9196-D46E-402AED4663EC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemTransactionsTests", "bcl-test\BCLTests\SystemTransactionsTests.csproj", "{F8CFE6AE-81B3-C1D5-B6E3-881EFB19D8B6}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BCL tests group 4", "bcl-test\BCL tests group 4.csproj", "{96EB9D05-2635-0FB3-43F9-9B74640CFE18}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemTests", "bcl-test\BCLTests\SystemTests.csproj", "{022B4AF2-F62F-8EF3-9375-7CCE2820C54C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemServiceModelWebTests", "bcl-test\BCLTests\SystemServiceModelWebTests.csproj", "{ECFE62D9-1BC5-C44F-4D47-9BBA5B2C7F36}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemServiceModelTests", "bcl-test\BCLTests\SystemServiceModelTests.csproj", "{569FFC00-3699-63C0-E0B7-9C2DA8F015D9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemSecurityXunit", "bcl-test\BCLTests\SystemSecurityXunit.csproj", "{7017DF4C-80ED-A7C3-7D44-F3A9CA5B4DF4}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemSecurityTests", "bcl-test\BCLTests\SystemSecurityTests.csproj", "{ABACCDE0-14CC-8C9F-7044-CE101CA9D818}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemRuntimeSerializationXunit", "bcl-test\BCLTests\SystemRuntimeSerializationXunit.csproj", "{E44B6A87-C5AF-DF76-B514-841F9DF59CDF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemRuntimeSerializationTests", "bcl-test\BCLTests\SystemRuntimeSerializationTests.csproj", "{E76564D2-12A8-219F-F69C-6FE35B8BCDFC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemRuntimeCompilerServicesUnsafeXunit", "bcl-test\BCLTests\SystemRuntimeCompilerServicesUnsafeXunit.csproj", "{3D2B8C63-52B0-C706-B745-95453F8B90D3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemNumericsXunit", "bcl-test\BCLTests\SystemNumericsXunit.csproj", "{0477B067-9914-2C4F-14C4-CBDFDC0653CF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemNumericsTests", "bcl-test\BCLTests\SystemNumericsTests.csproj", "{44F02498-1AF8-CB2B-5F52-83C74B4F8F9F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemNetHttpTests", "bcl-test\BCLTests\SystemNetHttpTests.csproj", "{0D2AC6C4-5EC1-0927-876B-0658DEC4FF94}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemLinqXunit", "bcl-test\BCLTests\SystemLinqXunit.csproj", "{C63F3DD4-EC06-1CE5-BA87-1D038C5A0BBD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemJsonXunit", "bcl-test\BCLTests\SystemJsonXunit.csproj", "{797B6029-DEFB-CEA8-B5D3-BDA6E5EC7B35}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemJsonTests", "bcl-test\BCLTests\SystemJsonTests.csproj", "{5A2B9BB6-B845-92E1-B036-677BECEABD46}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemIOCompressionTests", "bcl-test\BCLTests\SystemIOCompressionTests.csproj", "{ADF8645F-3737-8342-704B-006A887760CF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemIOCompressionFileSystemTests", "bcl-test\BCLTests\SystemIOCompressionFileSystemTests.csproj", "{CDD9B9BA-6E8C-CE0F-DF98-F198484EDAC6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemDataXunit", "bcl-test\BCLTests\SystemDataXunit.csproj", "{0E046C2E-0261-F92B-20AB-8E27CDC8F859}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemDataTests", "bcl-test\BCLTests\SystemDataTests.csproj", "{CB000449-11E5-37D7-C757-4180FA74275D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemCoreXunit", "bcl-test\BCLTests\SystemCoreXunit.csproj", "{FB0374D9-4A15-4F14-BC79-A88406FC4966}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemCoreTests", "bcl-test\BCLTests\SystemCoreTests.csproj", "{D348AA85-B644-2187-C237-34DA88BFCA77}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemComponentModelDataAnnotationsTests", "bcl-test\BCLTests\SystemComponentModelDataAnnotationsTests.csproj", "{2FD12269-09D5-AD2C-9E59-6A18FCB2241F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemComponentModelCompositionXunit", "bcl-test\BCLTests\SystemComponentModelCompositionXunit.csproj", "{D4AF3416-BC36-1522-41E9-43C85DB18D84}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoSecurityTests", "bcl-test\BCLTests\MonoSecurityTests.csproj", "{BA08B246-1AE4-F419-926F-2EA9ED5DAF90}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDataTdsTests", "bcl-test\BCLTests\MonoDataTdsTests.csproj", "{EA3885C2-6A88-1007-BE44-29E6997B9856}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDataSqliteTests", "bcl-test\BCLTests\MonoDataSqliteTests.csproj", "{C761790B-0C12-72AA-D4E3-671F2AA1719E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoCSharpTests", "bcl-test\BCLTests\MonoCSharpTests.csproj", "{01D5D6F0-C210-0165-D4AC-85B038CCC1D8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MicrosoftCSharpXunit", "bcl-test\BCLTests\MicrosoftCSharpXunit.csproj", "{89B53407-2C05-975F-A09F-F131D5312DAA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CorlibXunit", "bcl-test\BCLTests\CorlibXunit.csproj", "{A823F088-0836-20BB-D955-8B26BD9057BC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CorlibTests", "bcl-test\BCLTests\CorlibTests.csproj", "{3D440BA8-29F8-EB17-6858-209114E79FD3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sampletester", "sampletester\sampletester.csproj", "{7340A1C6-61A5-42D2-9DBC-6688D2E70F62}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BCL tests group 6", "bcl-test\BCL tests group 6.csproj", "{A47E9448-F269-CE74-8539-EF920B6F0836}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -328,24 +254,114 @@ Global {C7212169-BA46-413B-91CD-A32C52AD5E0D}.Release32|iPhone.Build.0 = Release|Any CPU {C7212169-BA46-413B-91CD-A32C52AD5E0D}.Release64|iPhone.ActiveCfg = Release|Any CPU {C7212169-BA46-413B-91CD-A32C52AD5E0D}.Release64|iPhone.Build.0 = Release|Any CPU - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Debug|iPhone.ActiveCfg = Debug|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Debug|iPhone.Build.0 = Debug|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release|iPhone.ActiveCfg = Release|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release|iPhone.Build.0 = Release|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release-bitcode|iPhone.ActiveCfg = Release-bitcode|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release-bitcode|iPhone.Build.0 = Release-bitcode|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Debug32|iPhone.ActiveCfg = Debug32|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Debug64|iPhone.ActiveCfg = Debug64|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Debug32|iPhone.Build.0 = Debug32|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Debug64|iPhone.Build.0 = Debug64|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release32|iPhone.ActiveCfg = Release32|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release32|iPhone.Build.0 = Release32|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release64|iPhone.ActiveCfg = Release64|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release64|iPhone.Build.0 = Release64|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Debug|iPhone.ActiveCfg = Debug|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Debug|iPhone.Build.0 = Debug|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release|iPhone.ActiveCfg = Release|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release|iPhone.Build.0 = Release|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release-bitcode|iPhone.ActiveCfg = Release-bitcode|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release-bitcode|iPhone.Build.0 = Release-bitcode|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Debug32|iPhone.ActiveCfg = Debug32|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Debug64|iPhone.ActiveCfg = Debug64|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Debug32|iPhone.Build.0 = Debug32|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Debug64|iPhone.Build.0 = Debug64|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release32|iPhone.ActiveCfg = Release32|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release32|iPhone.Build.0 = Release32|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release64|iPhone.ActiveCfg = Release64|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release64|iPhone.Build.0 = Release64|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Debug|iPhone.ActiveCfg = Debug|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Debug|iPhone.Build.0 = Debug|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release|iPhone.ActiveCfg = Release|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release|iPhone.Build.0 = Release|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release-bitcode|iPhone.ActiveCfg = Release-bitcode|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release-bitcode|iPhone.Build.0 = Release-bitcode|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Debug32|iPhone.ActiveCfg = Debug32|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Debug64|iPhone.ActiveCfg = Debug64|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Debug32|iPhone.Build.0 = Debug32|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Debug64|iPhone.Build.0 = Debug64|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release32|iPhone.ActiveCfg = Release32|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release32|iPhone.Build.0 = Release32|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release64|iPhone.ActiveCfg = Release64|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release64|iPhone.Build.0 = Release64|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Debug|iPhone.ActiveCfg = Debug|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Debug|iPhone.Build.0 = Debug|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {03953BD6-975D-9196-D46E-402AED4663EC}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {03953BD6-975D-9196-D46E-402AED4663EC}.Release|iPhone.ActiveCfg = Release|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Release|iPhone.Build.0 = Release|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {03953BD6-975D-9196-D46E-402AED4663EC}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {03953BD6-975D-9196-D46E-402AED4663EC}.Release-bitcode|iPhone.ActiveCfg = Release-bitcode|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Release-bitcode|iPhone.Build.0 = Release-bitcode|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Debug32|iPhone.ActiveCfg = Debug32|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Debug64|iPhone.ActiveCfg = Debug64|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Debug32|iPhone.Build.0 = Debug32|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Debug64|iPhone.Build.0 = Debug64|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Release32|iPhone.ActiveCfg = Release32|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Release32|iPhone.Build.0 = Release32|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Release64|iPhone.ActiveCfg = Release64|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Release64|iPhone.Build.0 = Release64|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Debug|iPhone.ActiveCfg = Debug|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Debug|iPhone.Build.0 = Debug|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release|iPhone.ActiveCfg = Release|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release|iPhone.Build.0 = Release|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release-bitcode|iPhone.ActiveCfg = Release-bitcode|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release-bitcode|iPhone.Build.0 = Release-bitcode|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Debug32|iPhone.ActiveCfg = Debug32|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Debug64|iPhone.ActiveCfg = Debug64|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Debug32|iPhone.Build.0 = Debug32|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Debug64|iPhone.Build.0 = Debug64|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release32|iPhone.ActiveCfg = Release32|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release32|iPhone.Build.0 = Release32|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release64|iPhone.ActiveCfg = Release64|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release64|iPhone.Build.0 = Release64|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Debug|iPhone.ActiveCfg = Debug|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Debug|iPhone.Build.0 = Debug|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {A47E9448-F269-CE74-8539-EF920B6F0836}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release|iPhone.ActiveCfg = Release|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release|iPhone.Build.0 = Release|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release-bitcode|iPhone.ActiveCfg = Release-bitcode|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release-bitcode|iPhone.Build.0 = Release-bitcode|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Debug32|iPhone.ActiveCfg = Debug32|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Debug64|iPhone.ActiveCfg = Debug64|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Debug32|iPhone.Build.0 = Debug32|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Debug64|iPhone.Build.0 = Debug64|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release32|iPhone.ActiveCfg = Release32|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release32|iPhone.Build.0 = Release32|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release64|iPhone.ActiveCfg = Release64|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release64|iPhone.Build.0 = Release64|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Debug|iPhone.ActiveCfg = Debug|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Debug|iPhone.Build.0 = Debug|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release|iPhone.ActiveCfg = Release|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release|iPhone.Build.0 = Release|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release-bitcode|iPhone.ActiveCfg = Release-bitcode|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release-bitcode|iPhone.Build.0 = Release-bitcode|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Debug32|iPhone.ActiveCfg = Debug32|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Debug64|iPhone.ActiveCfg = Debug64|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Debug32|iPhone.Build.0 = Debug32|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Debug64|iPhone.Build.0 = Debug64|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release32|iPhone.ActiveCfg = Release32|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release32|iPhone.Build.0 = Release32|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release64|iPhone.ActiveCfg = Release64|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release64|iPhone.Build.0 = Release64|iPhone {BEF0140A-A6A6-4074-B55F-03856A6B5862}.Debug|iPhone.ActiveCfg = Debug|iPhone {BEF0140A-A6A6-4074-B55F-03856A6B5862}.Debug|iPhone.Build.0 = Debug|iPhone {BEF0140A-A6A6-4074-B55F-03856A6B5862}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator From dadf69e97e7c24da8b9a4d217cd44952d35f4063 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Fri, 22 Nov 2019 15:21:39 -0500 Subject: [PATCH 086/100] [Networking] Add missing Mac OS X APIs. (#7426) Add missing APIs and complete the bindings for Xcode 11. --- src/Network/NWEthernetChannel.cs | 193 +++++++++++++++++++++++ src/Network/NWParameters.cs | 25 +++ src/frameworks.sources | 1 + tests/xtro-sharpie/common-Network.ignore | 3 + tests/xtro-sharpie/iOS-Network.todo | 1 - tests/xtro-sharpie/macOS-Network.todo | 9 -- tests/xtro-sharpie/tvOS-Network.todo | 1 - tests/xtro-sharpie/watchOS-Network.todo | 1 - 8 files changed, 222 insertions(+), 12 deletions(-) create mode 100644 src/Network/NWEthernetChannel.cs delete mode 100644 tests/xtro-sharpie/iOS-Network.todo delete mode 100644 tests/xtro-sharpie/macOS-Network.todo delete mode 100644 tests/xtro-sharpie/tvOS-Network.todo delete mode 100644 tests/xtro-sharpie/watchOS-Network.todo diff --git a/src/Network/NWEthernetChannel.cs b/src/Network/NWEthernetChannel.cs new file mode 100644 index 0000000000..9d954e6dbe --- /dev/null +++ b/src/Network/NWEthernetChannel.cs @@ -0,0 +1,193 @@ +// +// NWEthernetChannel.cs: Bindings the Network nw_ethernet_channel_t API. +// +// Authors: +// Manuel de la Pena (mandel@microsoft.com) +// +// Copyright 2019 Microsoft +// +#if MONOMAC +using System; +using System.Text; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using ObjCRuntime; +using Foundation; +using CoreFoundation; + +using OS_nw_ethernet_channel=System.IntPtr; +using OS_nw_interface=System.IntPtr; +using OS_dispatch_data=System.IntPtr; + +namespace Network { + + [NoWatch, NoTV, NoiOS, Mac (10,15)] + public delegate void NWEthernetChannelReceiveDelegate (DispatchData content, ushort vlanTag, string localAddress, string remoteAddress); + + [NoWatch, NoTV, NoiOS, Mac (10,15)] + public enum NWEthernetChannelState + { + Invalid = 0, + Waiting = 1, + Preparing = 2, + Ready = 3, + Failed = 4, + Cancelled = 5, + } + + [NoWatch, NoTV, NoiOS, Mac (10,15)] + public class NWEthernetChannel : NativeObject { + + internal NWEthernetChannel (IntPtr handle, bool owns) : base (handle, owns) {} + + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_ethernet_channel nw_ethernet_channel_create (ushort ether_type, OS_nw_interface networkInterface); + + // we cannot pass an enum! As per docs in the headers: + // The custom EtherType to be used for all Ethernet frames in this channel. The + // EtherType is the two-octet field in an Ethernet frame, indicating the protocol + // encapsulated in the payload of the frame. This parameter is in little-endian + // byte order. Only custom EtherType values are supported. This parameter cannot + // be an EtherType already handled by the system, such as IPv4, IPv6, ARP, VLAN Tag, + // or 802.1x. + // + // Calling processes must hold the "com.apple.developer.networking.custom-protocol" + // entitlement. + public NWEthernetChannel (ushort ethernetType, NWInterface networkInterface) + { + if (networkInterface == null) + throw new ArgumentNullException (nameof (networkInterface)); + + InitializeHandle (nw_ethernet_channel_create (ethernetType, networkInterface.Handle)); + } + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_ethernet_channel_start (OS_nw_ethernet_channel ethernet_channel); + + public void Start () => nw_ethernet_channel_start (GetCheckedHandle ()); + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_ethernet_channel_cancel (OS_nw_ethernet_channel ethernet_channel); + + public void Cancel () => nw_ethernet_channel_cancel (GetCheckedHandle ()); + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_ethernet_channel_set_queue (OS_nw_ethernet_channel ethernet_channel, IntPtr queue); + + public void SetQueue (DispatchQueue queue) + { + if (queue == null) + throw new ArgumentNullException (nameof (queue)); + nw_ethernet_channel_set_queue (GetCheckedHandle (), queue.Handle); + } + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_ethernet_channel_send (OS_nw_ethernet_channel ethernet_channel, OS_dispatch_data content, ushort vlan_tag, string remote_address, ref BlockLiteral completion); + + delegate void nw_ethernet_channel_send_completion_t (IntPtr block, IntPtr error); + static nw_ethernet_channel_send_completion_t static_SendCompletion = TrampolineSendCompletion; + + [MonoPInvokeCallback (typeof (nw_ethernet_channel_send_completion_t))] + static void TrampolineSendCompletion (IntPtr block, IntPtr error) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + var err = error == IntPtr.Zero ? null : new NWError (error, owns: false); + del (err); + err?.Dispose (); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public void Send (ReadOnlySpan content, ushort vlanTag, string remoteAddress, Action callback) + { + if (callback == null) + throw new ArgumentNullException (nameof (callback)); + + using (var dispatchData = DispatchData.FromByteBuffer (content.ToArray (), 0, content.Length)) { + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_SendCompletion, callback); + + try { + nw_ethernet_channel_send (GetCheckedHandle (), dispatchData.GetHandle (), vlanTag, remoteAddress, ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern void nw_ethernet_channel_set_receive_handler (OS_nw_ethernet_channel ethernet_channel, /* [NullAllowed] */ BlockLiteral *handler); + + delegate void nw_ethernet_channel_receive_handler_t (IntPtr block, OS_dispatch_data content, ushort vlan_tag, byte[] local_address, byte[] remote_address); + static nw_ethernet_channel_receive_handler_t static_ReceiveHandler = TrampolineReceiveHandler; + + [MonoPInvokeCallback (typeof (nw_ethernet_channel_receive_handler_t))] + static void TrampolineReceiveHandler (IntPtr block, OS_dispatch_data content, ushort vlanTag, byte[] localAddress, byte[] remoteAddress) + { + var del = BlockLiteral.GetTarget (block); + if (del != null) { + + var dispatchData = (content == IntPtr.Zero) ? null : new DispatchData (content, owns: false); + var local = (localAddress == null) ? null : Encoding.UTF8.GetString (localAddress); + var remote = (remoteAddress == null) ? null : Encoding.UTF8.GetString (remoteAddress); + + del (dispatchData, vlanTag, local, remote); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public void SetReceiveHandler (NWEthernetChannelReceiveDelegate handler) + { + unsafe { + if (handler == null) { + nw_ethernet_channel_set_receive_handler (GetCheckedHandle (), null); + return; + } + + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_ReceiveHandler, handler); + try { + nw_ethernet_channel_set_receive_handler (GetCheckedHandle (), &block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern void nw_ethernet_channel_set_state_changed_handler (OS_nw_ethernet_channel ethernet_channel, /* [NullAllowed] */ BlockLiteral *handler); + + delegate void nw_ethernet_channel_state_changed_handler_t (IntPtr block, NWEthernetChannelState state, IntPtr error); + static nw_ethernet_channel_state_changed_handler_t static_StateChangesHandler = TrampolineStateChangesHandler; + + [MonoPInvokeCallback (typeof (nw_ethernet_channel_state_changed_handler_t))] + static void TrampolineStateChangesHandler (IntPtr block, NWEthernetChannelState state, IntPtr error) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + var nwError = (error == IntPtr.Zero) ? null : new NWError (error, owns: false); + del (state, nwError); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public void SetStateChangesHandler (Action handler) + { + unsafe { + if (handler == null) { + nw_ethernet_channel_set_state_changed_handler (GetCheckedHandle (), null); + return; + } + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_StateChangesHandler, handler); + try { + nw_ethernet_channel_set_state_changed_handler (GetCheckedHandle (), &block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } + } +} +#endif diff --git a/src/Network/NWParameters.cs b/src/Network/NWParameters.cs index 675647032e..9fd04278b8 100644 --- a/src/Network/NWParameters.cs +++ b/src/Network/NWParameters.cs @@ -177,6 +177,31 @@ namespace Network { return new NWParameters (ptr, owns: true); } +#if MONOMAC + [NoWatch, NoTV, NoiOS, Mac (10,15)] + [DllImport (Constants.NetworkLibrary)] + unsafe static extern IntPtr nw_parameters_create_custom_ip (byte custom_ip_protocol_number, BlockLiteral *configure_ip); + + [NoWatch, NoTV, NoiOS, Mac (10,15)] + public unsafe static NWParameters CreateCustomIP (byte protocolNumber, Action configureCustomIP = null) + { + var ipHandler = new BlockLiteral (); + + var ipPtr = &ipHandler; + if (configureCustomIP == null) + ipPtr = DEFAULT_CONFIGURATION (); + else + ipHandler.SetupBlockUnsafe (static_ConfigureHandler, configureCustomIP); + + var ptr = nw_parameters_create_custom_ip (protocolNumber, ipPtr); + + if (configureCustomIP != null) + ipPtr->CleanupBlock (); + + return new NWParameters (ptr, owns: true); + } +#endif + [DllImport (Constants.NetworkLibrary)] static extern nw_parameters_t nw_parameters_create (); diff --git a/src/frameworks.sources b/src/frameworks.sources index 74b95c1bc1..eb6a668279 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -1173,6 +1173,7 @@ NETWORK_SOURCES = \ Network/NWConnection.cs \ Network/NWContentContext.cs \ Network/NWDataTransferReport.cs \ + Network/NWEthernetChannel.cs \ Network/NWEstablishmentReport.cs \ Network/NWEndpoint.cs \ Network/NWError.cs \ diff --git a/tests/xtro-sharpie/common-Network.ignore b/tests/xtro-sharpie/common-Network.ignore index 52def1405c..80bef65664 100644 --- a/tests/xtro-sharpie/common-Network.ignore +++ b/tests/xtro-sharpie/common-Network.ignore @@ -32,3 +32,6 @@ ## xcode 10.0 backlog !missing-pinvoke! nw_endpoint_get_address is not bound + +## no documentation from apple. So we do nothing, specially with the _ prefix. Leak? +!missing-field! _nw_data_transfer_report_all_paths not bound diff --git a/tests/xtro-sharpie/iOS-Network.todo b/tests/xtro-sharpie/iOS-Network.todo deleted file mode 100644 index dcad7c13cc..0000000000 --- a/tests/xtro-sharpie/iOS-Network.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-field! _nw_data_transfer_report_all_paths not bound \ No newline at end of file diff --git a/tests/xtro-sharpie/macOS-Network.todo b/tests/xtro-sharpie/macOS-Network.todo deleted file mode 100644 index b40d73ad49..0000000000 --- a/tests/xtro-sharpie/macOS-Network.todo +++ /dev/null @@ -1,9 +0,0 @@ -!missing-field! _nw_data_transfer_report_all_paths not bound -!missing-pinvoke! nw_ethernet_channel_cancel is not bound -!missing-pinvoke! nw_ethernet_channel_create is not bound -!missing-pinvoke! nw_ethernet_channel_send is not bound -!missing-pinvoke! nw_ethernet_channel_set_queue is not bound -!missing-pinvoke! nw_ethernet_channel_set_receive_handler is not bound -!missing-pinvoke! nw_ethernet_channel_set_state_changed_handler is not bound -!missing-pinvoke! nw_ethernet_channel_start is not bound -!missing-pinvoke! nw_parameters_create_custom_ip is not bound diff --git a/tests/xtro-sharpie/tvOS-Network.todo b/tests/xtro-sharpie/tvOS-Network.todo deleted file mode 100644 index dcad7c13cc..0000000000 --- a/tests/xtro-sharpie/tvOS-Network.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-field! _nw_data_transfer_report_all_paths not bound \ No newline at end of file diff --git a/tests/xtro-sharpie/watchOS-Network.todo b/tests/xtro-sharpie/watchOS-Network.todo deleted file mode 100644 index f5e825a6d9..0000000000 --- a/tests/xtro-sharpie/watchOS-Network.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-field! _nw_data_transfer_report_all_paths not bound From fd7a5360a52b1a59dba588b3610c2fd927dd6213 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 26 Nov 2019 14:32:02 +0100 Subject: [PATCH 087/100] [xcode11.3] [linker] Do not mark NSObject subclasses from Xamarin.Forms.Platform.iOS.dll assembly (#7483) Turn older #7165 prototype into an experimental feature. It can be enabled by adding `--optimize=experimental-xforms-product-type` to the **Additional mtouch arguments** of the project. ref: https://github.com/xamarin/xamarin-macios/pull/7165 --- docs/website/optimizations.md | 14 ++++++++++++++ tests/mmptest/src/MMPTest.cs | 2 +- tests/mtouch/MTouch.cs | 5 +++-- tools/common/Optimizations.cs | 7 +++++++ tools/linker/MarkNSObjects.cs | 11 +++++++++-- 5 files changed, 34 insertions(+), 5 deletions(-) diff --git a/docs/website/optimizations.md b/docs/website/optimizations.md index 18bf371fac..07baa6bf1a 100644 --- a/docs/website/optimizations.md +++ b/docs/website/optimizations.md @@ -755,3 +755,17 @@ disabling the managed linker. The default behavior can be overridden by passing `--optimize=[+|-]custom-attributes-removal` to `mtouch` or `mmp`. + +## Experimental Xamarin.Forms.Platform.iOS ProductType inclusion + +This optimization requires the linker to be enabled and is only applied +on `Xamarin.Forms.Platform.iOS.dll`. + +This is **experimental** and might be removed or replaced in future +versions of Xamarin.iOS. + +This optimization consider the assembly `Xamarin.Forms.Platform.iOS` as +a product assembly and does not automagically mark all `NSObject` +subclasses. This allows additional removes and optimizations to be +applied to the assembly, including the ability to remove `UIWebView` if +nothing else in the application requires it. diff --git a/tests/mmptest/src/MMPTest.cs b/tests/mmptest/src/MMPTest.cs index 7ee30c153f..e6a4489351 100644 --- a/tests/mmptest/src/MMPTest.cs +++ b/tests/mmptest/src/MMPTest.cs @@ -623,7 +623,7 @@ namespace Xamarin.MMP.Tests "Full", }; var rv = TI.TestUnifiedExecutable (test, shouldFail: false); - rv.Messages.AssertWarning (132, $"Unknown optimization: '{opt}'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock, register-protocols, inline-dynamic-registration-supported, static-block-to-delegate-lookup, trim-architectures, inline-is-arm64-calling-convention, cctor-beforefieldinit, custom-attributes-removal."); + rv.Messages.AssertWarning (132, $"Unknown optimization: '{opt}'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock, register-protocols, inline-dynamic-registration-supported, static-block-to-delegate-lookup, trim-architectures, inline-is-arm64-calling-convention, cctor-beforefieldinit, custom-attributes-removal, experimental-xforms-product-type."); rv.Messages.AssertErrorCount (0); }); } diff --git a/tests/mtouch/MTouch.cs b/tests/mtouch/MTouch.cs index 4d5e7e04cc..232d2d79d8 100644 --- a/tests/mtouch/MTouch.cs +++ b/tests/mtouch/MTouch.cs @@ -1752,7 +1752,7 @@ public class TestApp { mtouch.Linker = MTouchLinker.LinkSdk; mtouch.Optimize = new string [] { "foo" }; mtouch.AssertExecute (MTouchAction.BuildSim, "build"); - mtouch.AssertWarning (132, "Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, inline-runtime-arch, blockliteral-setupblock, register-protocols, inline-dynamic-registration-supported, static-block-to-delegate-lookup, remove-dynamic-registrar, remove-unsupported-il-for-bitcode, inline-is-arm64-calling-convention, seal-and-devirtualize, cctor-beforefieldinit, custom-attributes-removal."); + mtouch.AssertWarning (132, "Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, inline-runtime-arch, blockliteral-setupblock, register-protocols, inline-dynamic-registration-supported, static-block-to-delegate-lookup, remove-dynamic-registrar, remove-unsupported-il-for-bitcode, inline-is-arm64-calling-convention, seal-and-devirtualize, cctor-beforefieldinit, custom-attributes-removal, experimental-xforms-product-type."); } } @@ -3646,7 +3646,8 @@ public partial class NotificationService : UNNotificationServiceExtension mtouch.AssertWarning (2003, "Option '--optimize=seal-and-devirtualize' will be ignored since linking is disabled"); mtouch.AssertWarning (2003, "Option '--optimize=cctor-beforefieldinit' will be ignored since linking is disabled"); mtouch.AssertWarning (2003, "Option '--optimize=custom-attributes-removal' will be ignored since linking is disabled"); - mtouch.AssertWarningCount (14); + mtouch.AssertWarning (2003, "Option '--optimize=experimental-xforms-product-type' will be ignored since linking is disabled"); + mtouch.AssertWarningCount (15); } using (var mtouch = new MTouchTool ()) { diff --git a/tools/common/Optimizations.cs b/tools/common/Optimizations.cs index b1d724f4c9..d600fd250a 100644 --- a/tools/common/Optimizations.cs +++ b/tools/common/Optimizations.cs @@ -42,6 +42,7 @@ namespace Xamarin.Bundler #endif "cctor-beforefieldinit", "custom-attributes-removal", + "experimental-xforms-product-type", }; enum Opt @@ -62,6 +63,7 @@ namespace Xamarin.Bundler SealAndDevirtualize, StaticConstructorBeforeFieldInit, CustomAttributesRemoval, + ExperimentalFormsProductType, } bool? all; @@ -145,6 +147,11 @@ namespace Xamarin.Bundler set { values [(int) Opt.CustomAttributesRemoval] = value; } } + public bool? ExperimentalFormsProductType { + get { return values [(int) Opt.ExperimentalFormsProductType]; } + set { values [(int) Opt.ExperimentalFormsProductType] = value; } + } + public Optimizations () { values = new bool? [opt_names.Length]; diff --git a/tools/linker/MarkNSObjects.cs b/tools/linker/MarkNSObjects.cs index af4c10942f..0ab2fcfe82 100644 --- a/tools/linker/MarkNSObjects.cs +++ b/tools/linker/MarkNSObjects.cs @@ -33,6 +33,7 @@ using System; using Mono.Cecil; using Mono.Linker; using Mono.Tuner; +using Xamarin.Bundler; namespace Xamarin.Linker.Steps { @@ -151,9 +152,15 @@ namespace Xamarin.Linker.Steps { return (method.DeclaringType.Module.Assembly.Name.Name == ProductAssembly); } - static bool IsProductType (TypeDefinition type) + bool IsProductType (TypeDefinition type) { - return type.Module.Assembly.Name.Name == ProductAssembly; + var name = type.Module.Assembly.Name.Name; + switch (name) { + case "Xamarin.Forms.Platform.iOS": + return LinkContext.App.Optimizations.ExperimentalFormsProductType == true; + default: + return name == ProductAssembly; + } } } } From bcf3899893c0ee1a0bbcd814164a08423f0d543a Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 26 Nov 2019 19:38:58 +0100 Subject: [PATCH 088/100] [generator] If forcing a managed type, we must do so even if there's another managed instance of an incompatible type. Fixes #7441. (#7460) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If forcing a managed type for a particular native handle, we must ensure we're always successful. This means creating another managed instance even if there already is an existing instance for the native handle. This is not optimal, but the alternative is worse: some functionality can be completely broken otherwise (such as NSSavePanel⁄NSOpenPanel may stop working). If creating multiple managed instances for the same native handle ends up being too problematic, we'll probably have to add full support for this scenario (see #7442). Fixes https://github.com/xamarin/xamarin-macios/issues/7441. --- src/ObjCRuntime/Runtime.cs | 12 ++++++++++-- src/generator.cs | 6 +++--- .../monotouch-test/ObjCRuntime/RuntimeTest.cs | 19 +++++++++++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/ObjCRuntime/Runtime.cs b/src/ObjCRuntime/Runtime.cs index 17fdd4fa3f..8bd0ab9110 100644 --- a/src/ObjCRuntime/Runtime.cs +++ b/src/ObjCRuntime/Runtime.cs @@ -1422,6 +1422,11 @@ namespace ObjCRuntime { // this method is identical in behavior to the non-generic one. public static T GetINativeObject (IntPtr ptr, bool owns) where T : class, INativeObject + { + return GetINativeObject (ptr, false, owns); + } + + public static T GetINativeObject (IntPtr ptr, bool forced_type, bool owns) where T : class, INativeObject { if (ptr == IntPtr.Zero) return null; @@ -1433,7 +1438,10 @@ namespace ObjCRuntime { return t; } - if (o != null) { + // If forced type is true, we ignore any existing instances if the managed type of the existing instance isn't compatible with T. + // This may end up creating multiple managed wrapper instances for the same native handle, + // which is not optimal, but sometimes the alternative can be worse :/ + if (o != null && !forced_type) { // found an existing object, but with an incompatible type. if (!typeof (T).IsInterface && typeof(NSObject).IsAssignableFrom (typeof (T))) { // if the target type is another NSObject subclass, there's nothing we can do. @@ -1445,7 +1453,7 @@ namespace ObjCRuntime { var implementation = LookupINativeObjectImplementation (ptr, typeof (T)); if (implementation.IsSubclassOf (typeof (NSObject))) { - if (o != null) { + if (o != null && !forced_type) { // We already have an instance of an NSObject-subclass for this ptr. // Creating another will break the one-to-one assumption we have between // native objects and NSObject instances. diff --git a/src/generator.cs b/src/generator.cs index c665781dce..9b8eed3e1b 100644 --- a/src/generator.cs +++ b/src/generator.cs @@ -1649,7 +1649,7 @@ public partial class Generator : IMemberGatherer { if (IsProtocolInterface (pi.ParameterType)) { invoke.AppendFormat (" Runtime.GetINativeObject<{1}> ({0}, false)", pi.Name.GetSafeParamName (), pi.ParameterType); } else if (isForced) { - invoke.AppendFormat (" Runtime.GetINativeObject<{1}> ({0}, {2})", pi.Name.GetSafeParamName (), RenderType (pi.ParameterType), isForcedOwns); + invoke.AppendFormat (" Runtime.GetINativeObject<{1}> ({0}, true, {2})", pi.Name.GetSafeParamName (), RenderType (pi.ParameterType), isForcedOwns); } else { invoke.AppendFormat (" Runtime.GetNSObject<{1}> ({0})", pi.Name.GetSafeParamName (), RenderType (pi.ParameterType)); } @@ -3611,7 +3611,7 @@ public partial class Generator : IMemberGatherer { cast_b = ", false)"; } else if (minfo != null && minfo.is_forced) { cast_a = " Runtime.GetINativeObject<" + FormatType (declaringType, GetCorrectGenericType (mi.ReturnType)) + "> ("; - cast_b = $", {minfo.is_forced_owns})"; + cast_b = $", true, {minfo.is_forced_owns})"; } else if (minfo != null && minfo.is_bindAs) { var bindAs = GetBindAsAttribute (minfo.mi); var nullableBindAsType = TypeManager.GetUnderlyingNullableType (bindAs.Type); @@ -4138,7 +4138,7 @@ public partial class Generator : IMemberGatherer { } else if (isINativeObjectSubclass) { if (!pi.IsOut) by_ref_processing.AppendFormat ("if ({0}Value != ({0} == null ? IntPtr.Zero : {0}.Handle))\n\t", pi.Name.GetSafeParamName ()); - by_ref_processing.AppendFormat ("{0} = Runtime.GetINativeObject<{1}> ({0}Value, {2});\n", pi.Name.GetSafeParamName (), RenderType (elementType), isForcedType ? isForcedOwns : "false"); + by_ref_processing.AppendFormat ("{0} = Runtime.GetINativeObject<{1}> ({0}Value, {2}, {3});\n", pi.Name.GetSafeParamName (), RenderType (elementType), isForcedType ? "true" : "false", isForcedType ? isForcedOwns : "false"); } else { throw ErrorHelper.CreateError (99, $"Internal error: don't know how to create ref/out (output) code for {mai.Type} in {mi}. Please file a bug report with a test case (https://github.com/xamarin/xamarin-macios/issues/new)."); } diff --git a/tests/monotouch-test/ObjCRuntime/RuntimeTest.cs b/tests/monotouch-test/ObjCRuntime/RuntimeTest.cs index 124a938693..d6193148bd 100644 --- a/tests/monotouch-test/ObjCRuntime/RuntimeTest.cs +++ b/tests/monotouch-test/ObjCRuntime/RuntimeTest.cs @@ -699,5 +699,24 @@ Additional information: } #endif } + + [Test] + public void GetINativeObject_ForcedType () + { + using (var str = new NSString ("hello world")) { + NSDate date; + + Assert.Throws (() => Runtime.GetINativeObject (str.Handle, false), "EX1"); // + Assert.Throws (() => Runtime.GetINativeObject (str.Handle, false, false), "EX2"); // + + // Making a string quack like a date. + // This is a big hack, but hopefully it works well enough for this particular test case. + // Just don't inspect the date variable in a debugger (it will most likely crash the app). + date = Runtime.GetINativeObject (str.Handle, true, false); + Assert.AreEqual (date.Handle, str.Handle, "Same native pointer"); + date.Dispose (); + date = null; + } + } } } From 44d411b8de183a370d4b5e723b4dfe2bee65b068 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Mon, 2 Dec 2019 21:48:22 +0100 Subject: [PATCH 089/100] [xharness] Add a timeout to the periodic command. (#7504) This will hopefully prevent the periodic command from keeping xharness alive longer than it should. --- tests/xharness/Jenkins.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index c09bd12cc9..3ea5431199 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -1120,14 +1120,13 @@ namespace xharness async Task ExecutePeriodicCommandAsync (Log periodic_loc) { - //await Task.Delay (Harness.UploadInterval); periodic_loc.WriteLine ($"Starting periodic task with interval {Harness.PeriodicCommandInterval.TotalMinutes} minutes."); while (true) { var watch = Stopwatch.StartNew (); using (var process = new Process ()) { process.StartInfo.FileName = Harness.PeriodicCommand; process.StartInfo.Arguments = Harness.PeriodicCommandArguments; - var rv = await process.RunAsync (periodic_loc, null); + var rv = await process.RunAsync (periodic_loc, timeout: Harness.PeriodicCommandInterval); if (!rv.Succeeded) periodic_loc.WriteLine ($"Periodic command failed with exit code {rv.ExitCode} (Timed out: {rv.TimedOut})"); } From e808ad48aa22400f93293a13845cfd980ebaff34 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 2 Dec 2019 21:54:07 +0100 Subject: [PATCH 090/100] [xharness] Make sure to always stop log and system capture. (#7506) This will hopefully stop the runaway mlaunch processes we've seen on the bots. Ref: https://github.com/xamarin/maccore/issues/1965. --- tests/xharness/AppRunner.cs | 66 +++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/tests/xharness/AppRunner.cs b/tests/xharness/AppRunner.cs index 60efb9f497..5978ab088a 100644 --- a/tests/xharness/AppRunner.cs +++ b/tests/xharness/AppRunner.cs @@ -837,45 +837,47 @@ namespace xharness }; logdev.StartCapture (); - await crash_reports.StartCaptureAsync (); + try { + await crash_reports.StartCaptureAsync (); - main_log.WriteLine ("Starting test run"); + main_log.WriteLine ("Starting test run"); - bool waitedForExit = true; - // We need to check for MT1111 (which means that mlaunch won't wait for the app to exit). - var callbackLog = new CallbackLog ((line) => { - // MT1111: Application launched successfully, but it's not possible to wait for the app to exit as requested because it's not possible to detect app termination when launching using gdbserver - waitedForExit &= line?.Contains ("MT1111: ") != true; - if (line?.Contains ("error MT1007") == true) - launch_failure = true; - }); - var runLog = Log.CreateAggregatedLog (callbackLog, main_log); - var timeoutWatch = Stopwatch.StartNew (); - var result = await ProcessHelper.ExecuteCommandAsync (Harness.MlaunchPath, args.ToString (), runLog, timeout, cancellation_token: cancellation_source.Token); + bool waitedForExit = true; + // We need to check for MT1111 (which means that mlaunch won't wait for the app to exit). + var callbackLog = new CallbackLog ((line) => { + // MT1111: Application launched successfully, but it's not possible to wait for the app to exit as requested because it's not possible to detect app termination when launching using gdbserver + waitedForExit &= line?.Contains ("MT1111: ") != true; + if (line?.Contains ("error MT1007") == true) + launch_failure = true; + }); + var runLog = Log.CreateAggregatedLog (callbackLog, main_log); + var timeoutWatch = Stopwatch.StartNew (); + var result = await ProcessHelper.ExecuteCommandAsync (Harness.MlaunchPath, args.ToString (), runLog, timeout, cancellation_token: cancellation_source.Token); - if (!waitedForExit && !result.TimedOut) { - // mlaunch couldn't wait for exit for some reason. Let's assume the app exits when the test listener completes. - main_log.WriteLine ("Waiting for listener to complete, since mlaunch won't tell."); - if (!await listener.CompletionTask.TimeoutAfter (timeout - timeoutWatch.Elapsed)) { - result.TimedOut = true; + if (!waitedForExit && !result.TimedOut) { + // mlaunch couldn't wait for exit for some reason. Let's assume the app exits when the test listener completes. + main_log.WriteLine ("Waiting for listener to complete, since mlaunch won't tell."); + if (!await listener.CompletionTask.TimeoutAfter (timeout - timeoutWatch.Elapsed)) { + result.TimedOut = true; + } } - } - if (result.TimedOut) { - timed_out = true; - success = false; - main_log.WriteLine ("Test run timed out after {0} minute(s).", timeout.TotalMinutes); - } else if (result.Succeeded) { - main_log.WriteLine ("Test run completed"); - success = true; - } else { - main_log.WriteLine ("Test run failed"); - success = false; + if (result.TimedOut) { + timed_out = true; + success = false; + main_log.WriteLine ("Test run timed out after {0} minute(s).", timeout.TotalMinutes); + } else if (result.Succeeded) { + main_log.WriteLine ("Test run completed"); + success = true; + } else { + main_log.WriteLine ("Test run failed"); + success = false; + } + } finally { + logdev.StopCapture (); + device_system_log.Dispose (); } - logdev.StopCapture (); - device_system_log.Dispose (); - // Upload the system log if (File.Exists (device_system_log.FullPath)) { main_log.WriteLine ("A capture of the device log is: {0}", device_system_log.FullPath); From 2c02cf7a038bb1f584847b540ee22056eae48533 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Mon, 2 Dec 2019 21:54:26 +0100 Subject: [PATCH 091/100] [xcode11.3] Bump macios-binaries to get fix for xamarin/maccore#2068. (#7512) * Bump macios-binaries to get fix for xamarin/maccore#2068. New commits in xamarin/macios-binaries: * xamarin/macios-binaries@eb6980e Bump mlaunch to xamarin/maccore@92433b7757 (#28) Diff: https://github.com/xamarin/macios-binaries/compare/6f488dd1322706a319c674ac35a4988c3f6ea89e..eb6980e8b6ee7bcd6edfd514e606b664bd93f33d * Update submodule branch for macios-binaries. --- .gitmodules | 2 +- external/macios-binaries | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index ffa97de533..656f6c196e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,7 +4,7 @@ [submodule "external/macios-binaries"] path = external/macios-binaries url = ../../xamarin/macios-binaries - branch = d16-4 + branch = xcode11.3 [submodule "external/opentk"] path = external/opentk url = ../../mono/opentk.git diff --git a/external/macios-binaries b/external/macios-binaries index 6f488dd132..eb6980e8b6 160000 --- a/external/macios-binaries +++ b/external/macios-binaries @@ -1 +1 @@ -Subproject commit 6f488dd1322706a319c674ac35a4988c3f6ea89e +Subproject commit eb6980e8b6ee7bcd6edfd514e606b664bd93f33d From 74a94c35d101a803540fb1518ccc20ee17b19aee Mon Sep 17 00:00:00 2001 From: monojenkins Date: Mon, 2 Dec 2019 21:54:33 +0100 Subject: [PATCH 092/100] [monotouch-test] Make NetworkReachabilityTest.CtorIPAddressPair a bit more permissive. Fixes xamarin/maccore#2047. (#7521) Try to fix https://github.com/xamarin/maccore/issues/2047 by making the test accept NetworkReachabilityFlags.Reachable for the loopback address on device. Fixes https://github.com/xamarin/maccore/issues/2047. --- .../SystemConfiguration/NetworkReachabilityTest.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/monotouch-test/SystemConfiguration/NetworkReachabilityTest.cs b/tests/monotouch-test/SystemConfiguration/NetworkReachabilityTest.cs index 0bbeaf1ce3..19dee2b289 100644 --- a/tests/monotouch-test/SystemConfiguration/NetworkReachabilityTest.cs +++ b/tests/monotouch-test/SystemConfiguration/NetworkReachabilityTest.cs @@ -101,9 +101,10 @@ namespace MonoTouchFixtures.SystemConfiguration { Assert.IsTrue (nr.TryGetFlags (out flags), "#1"); // using Loopback iOS 10 / tvOS 10 returns no flags (0) on devices + // but only sometimes... so check for Reachable as well (as a flag). #if !MONOMAC if ((Runtime.Arch == Arch.DEVICE) && TestRuntime.CheckXcodeVersion (8, 0)) - Assert.That ((int)flags, Is.EqualTo (0), "#1 Reachable"); + Assert.That ((flags == (NetworkReachabilityFlags) 0) || ((flags & NetworkReachabilityFlags.Reachable) == NetworkReachabilityFlags.Reachable) , $"#1 Reachable: {flags.ToString ()}"); else #endif Assert.That (flags, Is.EqualTo (NetworkReachabilityFlags.Reachable), "#1 Reachable"); From 917041448ecb1387068c6db0e7fea9f0ff3088fd Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Wed, 4 Dec 2019 10:38:01 -0500 Subject: [PATCH 093/100] Bump mono to HEAD of 2019-08 (#7538) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New commits in mono/mono: * mono/mono@bef1e633581 [interp] track valuetype stack for CEE_RET too (#17998) * mono/mono@56325f4097f [arm] if mtriple is provided, do not set -march * mono/mono@c4a1b40fbda [2019-08] [runtime] Treat calling a non-virtual method through… (#17961) * mono/mono@0c9250280da [2019-08] bump msbuild+roslyn to track mono-2019-08 (#17954) * mono/mono@14aac0c541c Bump msbuild to track mono-2019-08 (#17854) * mono/mono@a77128ca793 [merp] Remove extraneous waitpid invocation (#17762) * mono/mono@296a9afdb24 [MacSDK] Bump xamarin-gtk-theme.py to latest revision from private bockbuild (#17786) * mono/mono@e59c3fbb688 Bump msbuild packages to 1e1d0f2caad3731357cca18b298536e514f5519b (#17724) Diff: https://github.com/mono/mono/compare/062f0ab8cae60d1d347e4d722884c065c9f34484..bef1e6335812d32f8eab648c0228fc624b9f8357 --- mk/mono.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/mono.mk b/mk/mono.mk index b6818f60c5..fa8330f7d5 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,4 +1,4 @@ -NEEDED_MONO_VERSION := 062f0ab8cae60d1d347e4d722884c065c9f34484 +NEEDED_MONO_VERSION := bef1e6335812d32f8eab648c0228fc624b9f8357 NEEDED_MONO_BRANCH := 2019-08 MONO_DIRECTORY := mono From 8abcd9c60c4c3ba702f5f8f31b3ba5ec9a2b9ec8 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Wed, 4 Dec 2019 11:41:29 -0500 Subject: [PATCH 094/100] [Network] Add missing BindingImplAttr. (#7530) Fixes: https://github.com/xamarin/xamarin-macios/issues/7513 --- src/Network/NWParameters.cs | 1 + tests/monotouch-test/Network/NWParametersTest.cs | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/Network/NWParameters.cs b/src/Network/NWParameters.cs index 9fd04278b8..bd8b3d8f05 100644 --- a/src/Network/NWParameters.cs +++ b/src/Network/NWParameters.cs @@ -183,6 +183,7 @@ namespace Network { unsafe static extern IntPtr nw_parameters_create_custom_ip (byte custom_ip_protocol_number, BlockLiteral *configure_ip); [NoWatch, NoTV, NoiOS, Mac (10,15)] + [BindingImpl (BindingImplOptions.Optimizable)] public unsafe static NWParameters CreateCustomIP (byte protocolNumber, Action configureCustomIP = null) { var ipHandler = new BlockLiteral (); diff --git a/tests/monotouch-test/Network/NWParametersTest.cs b/tests/monotouch-test/Network/NWParametersTest.cs index 1cdc251c04..aeb1246bc8 100644 --- a/tests/monotouch-test/Network/NWParametersTest.cs +++ b/tests/monotouch-test/Network/NWParametersTest.cs @@ -199,6 +199,21 @@ namespace MonoTouchFixtures.Network { } } +#if MONOMAC + [Test] + public void CreateCustomIP () + { + TestRuntime.AssertXcodeVersion (11, 0); + byte ipVersion = 10; + var setUpProtocol = CreateConfigureProtocolHandler (); + using (var parameters = NWParameters.CreateCustomIP (ipVersion, setUpProtocol)) + using (var endpoint = NWEndpoint.Create ("wwww.google.com", "80")) { + configureEvent.WaitOne (); + Assert.True (protocolConfigured, "Protocol configure handler was not called."); + } + } +#endif + [Test] public void MultiPathServicePropertyTest () { From 0d8fe219c727fc68d495c26823070b510a4aa474 Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Wed, 4 Dec 2019 12:59:57 -0500 Subject: [PATCH 095/100] Bump version number for d16.4 service release 1 (#7543) --- Make.versions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Make.versions b/Make.versions index 64a3fd2b88..07daee226b 100644 --- a/Make.versions +++ b/Make.versions @@ -43,5 +43,5 @@ # line changed in git). # -IOS_PACKAGE_VERSION=13.8.2.$(IOS_COMMIT_DISTANCE) -MAC_PACKAGE_VERSION=6.8.2.$(MAC_COMMIT_DISTANCE) +IOS_PACKAGE_VERSION=13.8.3.$(IOS_COMMIT_DISTANCE) +MAC_PACKAGE_VERSION=6.8.3.$(MAC_COMMIT_DISTANCE) From 889705c2ee10f668ff00492ca14e40ad338f6d5a Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Wed, 11 Dec 2019 03:11:17 -0500 Subject: [PATCH 096/100] Bump for Xcode 11.3 final (#7568) --- Make.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Make.config b/Make.config index 4df0124126..a4720b3fa7 100644 --- a/Make.config +++ b/Make.config @@ -60,8 +60,8 @@ IOS_PACKAGE_UPDATE_ID=$(shell printf "2%02d%02d%02d%03d" $(IOS_PACKAGE_VERSION_M # Xcode version should have both a major and a minor version (even if the minor version is 0) XCODE_VERSION=11.3 -XCODE_URL=http://xamarin-storage/bot-provisioning/xcodes/Xcode_11.3_beta.xip -XCODE_DEVELOPER_ROOT=/Applications/Xcode113-beta1.app/Contents/Developer +XCODE_URL=http://xamarin-storage/bot-provisioning/xcodes/Xcode_11.3.xip +XCODE_DEVELOPER_ROOT=/Applications/Xcode113.app/Contents/Developer XCODE_PRODUCT_BUILD_VERSION:=$(shell /usr/libexec/PlistBuddy -c 'Print :ProductBuildVersion' $(XCODE_DEVELOPER_ROOT)/../version.plist) # Mono version embedded in XI/XM (NEEDED_MONO_VERSION/BRANCH) are specified in mk/mono.mk From fc51536ced1be955a019a3dd698499fcf6aae5fe Mon Sep 17 00:00:00 2001 From: Alex Soto Date: Wed, 11 Dec 2019 12:31:55 -0500 Subject: [PATCH 097/100] [xcode11.3] Bump version number now that Xcode 11.3 is out (#7573) --- Make.versions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Make.versions b/Make.versions index e3e852e1e2..bb1921e826 100644 --- a/Make.versions +++ b/Make.versions @@ -43,5 +43,5 @@ # line changed in git). # -IOS_PACKAGE_VERSION=13.9.0.$(IOS_COMMIT_DISTANCE) -MAC_PACKAGE_VERSION=6.9.0.$(MAC_COMMIT_DISTANCE) +IOS_PACKAGE_VERSION=13.10.0.$(IOS_COMMIT_DISTANCE) +MAC_PACKAGE_VERSION=6.10.0.$(MAC_COMMIT_DISTANCE) From b0f99834b94cb8d9323e6fe81eacf2d010f8c66b Mon Sep 17 00:00:00 2001 From: monojenkins Date: Thu, 12 Dec 2019 22:31:59 +0100 Subject: [PATCH 098/100] [runtime] Don't zero-terminate after the string buffer. Fixes #7564. (#7585) Fixes https://github.com/xamarin/xamarin-macios/issues/7564. --- runtime/trampolines.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runtime/trampolines.m b/runtime/trampolines.m index cc3ffc8795..043589b88e 100644 --- a/runtime/trampolines.m +++ b/runtime/trampolines.m @@ -440,6 +440,12 @@ xamarin_collapse_struct_name (const char *type, char struct_name[], int max_char type++; } + if (c == max_char) { + LOGZ (" xamarin_collapse_struct_name (%s, %i) => failed (too long)!\n", input, max_char); + struct_name [0] = 0; // return an empty string + return false; + } + struct_name [c] = 0; // Zero-terminate. LOGZ (" xamarin_collapse_struct_name (%s, %i) => %s (succeeded)\n", input, max_char, struct_name); return true; From 380ad56e4d46ab82c2df47b0cd6c73e830cce85a Mon Sep 17 00:00:00 2001 From: monojenkins Date: Fri, 13 Dec 2019 16:22:16 +0100 Subject: [PATCH 099/100] [introspection] Update according to changes that seem to have occurred in macOS 10.15.2. (#7592) --- tests/introspection/Mac/MacApiCtorInitTest.cs | 3 +++ tests/introspection/Mac/MacApiProtocolTest.cs | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/tests/introspection/Mac/MacApiCtorInitTest.cs b/tests/introspection/Mac/MacApiCtorInitTest.cs index 0984a6801f..55b781d633 100644 --- a/tests/introspection/Mac/MacApiCtorInitTest.cs +++ b/tests/introspection/Mac/MacApiCtorInitTest.cs @@ -206,6 +206,9 @@ namespace Introspection { due to a privacy violation (even if the required entry is present in the Info.plist). */ return true; + case "AVFoundation.AVAudioRecorder": // Stopped working in macOS 10.15.2 + return TestRuntime.CheckXcodeVersion (11, 2); + } switch (type.Namespace) { diff --git a/tests/introspection/Mac/MacApiProtocolTest.cs b/tests/introspection/Mac/MacApiProtocolTest.cs index 1341f9fb61..3d7acbea4b 100644 --- a/tests/introspection/Mac/MacApiProtocolTest.cs +++ b/tests/introspection/Mac/MacApiProtocolTest.cs @@ -86,6 +86,10 @@ namespace Introspection { case "NSFileProviderDomain": // Conformance not in headers case "FPUIActionExtensionContext": // Conformance not in headers return true; + // macOS 10.15.2 + case "NSPrintInfo": // Conformance not in headers + case "NSPrinter": // Conformance not in headers + return true; #if !UNIFIED // existing classic/old binary is not updated case "NSAppearance": From a6c714fa8406aa753caa79fe7a8166da53479663 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 17 Dec 2019 22:07:22 +0100 Subject: [PATCH 100/100] [xcode11.3] [monotouch-test] Simplify NetworkReachabilityTest.CtorIPAddressPair test. (#7613) * [monotouch-test] Improve reachability test. Tested on: * All macOS versions we support (10.9 -> 10.15). * tvOS device: 13.2 * iOS devices: 8.2, 9.3.5, 10.3.3, 11.4.1, 12.4.1, 13.3 * iOS simulators: 10.3, 11.0, 12.0, 13.2. * tvOS simulators: 10.2, 13.2 * Yay Apple! * Give up. * Revert unneeded change. --- .../NetworkReachabilityTest.cs | 40 +++++++------------ 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/tests/monotouch-test/SystemConfiguration/NetworkReachabilityTest.cs b/tests/monotouch-test/SystemConfiguration/NetworkReachabilityTest.cs index 19dee2b289..3815982e8c 100644 --- a/tests/monotouch-test/SystemConfiguration/NetworkReachabilityTest.cs +++ b/tests/monotouch-test/SystemConfiguration/NetworkReachabilityTest.cs @@ -100,14 +100,7 @@ namespace MonoTouchFixtures.SystemConfiguration { NetworkReachabilityFlags flags; Assert.IsTrue (nr.TryGetFlags (out flags), "#1"); - // using Loopback iOS 10 / tvOS 10 returns no flags (0) on devices - // but only sometimes... so check for Reachable as well (as a flag). -#if !MONOMAC - if ((Runtime.Arch == Arch.DEVICE) && TestRuntime.CheckXcodeVersion (8, 0)) - Assert.That ((flags == (NetworkReachabilityFlags) 0) || ((flags & NetworkReachabilityFlags.Reachable) == NetworkReachabilityFlags.Reachable) , $"#1 Reachable: {flags.ToString ()}"); - else -#endif - Assert.That (flags, Is.EqualTo (NetworkReachabilityFlags.Reachable), "#1 Reachable"); + CheckLoopbackFlags (flags, "1", true); } using (var nr = new NetworkReachability (null, address)) @@ -123,27 +116,22 @@ namespace MonoTouchFixtures.SystemConfiguration { NetworkReachabilityFlags flags; Assert.IsTrue (nr.TryGetFlags (out flags), "#3"); - // using Loopback iOS 10 / tvOS 10 / macOS 10.12 returns no flags (0) on devices - var expected = (NetworkReachabilityFlags) 0; -#if MONOMAC - if (!TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 12)) { - expected = NetworkReachabilityFlags.Reachable; - if (!TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 11)) - expected |= NetworkReachabilityFlags.IsLocalAddress; - } -#else - if ((Runtime.Arch == Arch.DEVICE) && TestRuntime.CheckXcodeVersion (8, 0)) { - // - } else { - expected = NetworkReachabilityFlags.Reachable; - if (!TestRuntime.CheckXcodeVersion (7, 0)) - expected |= NetworkReachabilityFlags.IsLocalAddress; - } -#endif - Assert.That (flags, Is.EqualTo (expected), "#3 Reachable"); + CheckLoopbackFlags (flags, "3", false); } } + void CheckLoopbackFlags (NetworkReachabilityFlags flags, string number, bool has_address) + { + var noFlags = (NetworkReachabilityFlags) 0; + var otherFlags = (flags & ~(NetworkReachabilityFlags.Reachable | NetworkReachabilityFlags.IsLocalAddress | NetworkReachabilityFlags.IsDirect)); + + // Different versions of OSes report different flags. Trying to + // figure out which OS versions have which flags set turned out to + // be a never-ending game of whack-a-mole, so just don't assert + // that any specific flags are set. + Assert.AreEqual (noFlags, otherFlags, $"#{number} No other flags: {flags.ToString ()}"); + } + [Test] public void Ctor_Invalid () {