This commit is contained in:
Rolf Bjarne Kvinge 2022-11-17 13:14:10 +01:00
Родитель f5af0837ad 3585c66844
Коммит a88d7e6745
441 изменённых файлов: 10036 добавлений и 9898 удалений

Просмотреть файл

@ -10,10 +10,12 @@
<clear /> <clear />
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.--> <!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
<!-- Begin: Package sources from dotnet-emsdk --> <!-- Begin: Package sources from dotnet-emsdk -->
<add key="darc-pub-dotnet-emsdk-3a6c724" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-3a6c724f/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-emsdk --> <!-- End: Package sources from dotnet-emsdk -->
<!-- Begin: Package sources from dotnet-aspnetcore --> <!-- Begin: Package sources from dotnet-aspnetcore -->
<!-- End: Package sources from dotnet-aspnetcore --> <!-- End: Package sources from dotnet-aspnetcore -->
<!-- Begin: Package sources from dotnet-runtime --> <!-- Begin: Package sources from dotnet-runtime -->
<add key="darc-pub-dotnet-runtime-12b1873" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-12b1873d/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-runtime --> <!-- End: Package sources from dotnet-runtime -->
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.--> <!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" protocolVersion="3" /> <add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" protocolVersion="3" />

Просмотреть файл

@ -75,6 +75,7 @@ DIRECTORIES += \
$(TMP_PKG_DIR) \ $(TMP_PKG_DIR) \
$(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Windows.Sdk/Sdk) \ $(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Windows.Sdk/Sdk) \
$(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Windows.Sdk/targets) \ $(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Windows.Sdk/targets) \
$(foreach platform,$(DOTNET_PLATFORMS),Workloads/Microsoft.NET.Sdk.$(platform)) \
$(DIRECTORIES): $(DIRECTORIES):
$(Q) mkdir -p $@ $(Q) mkdir -p $@
@ -169,13 +170,12 @@ endef
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call SharedAfterTargetsTemplate,$(platform),$(NET6_$(platform)_NUGET_VERSION_NO_METADATA),$(NET7_$(platform)_NUGET_VERSION_NO_METADATA)))) $(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call SharedAfterTargetsTemplate,$(platform),$(NET6_$(platform)_NUGET_VERSION_NO_METADATA),$(NET7_$(platform)_NUGET_VERSION_NO_METADATA))))
define WorkloadTargets define WorkloadTargets
Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.json: Makefile $(TOP)/Make.config.inc $(TOP)/.git/HEAD $(TOP)/.git/index Makefile generate-workloadmanifest-json.csharp Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.json: Makefile $(TOP)/Make.config.inc $(TOP)/.git/HEAD $(TOP)/.git/index Makefile generate-workloadmanifest-json.csharp | Workloads/Microsoft.NET.Sdk.$(1)
$$(Q) mkdir -p Workloads/Microsoft.NET.Sdk.$(1)/
$$(Q) rm -f $$@.tmp $$(Q) rm -f $$@.tmp
$$(Q_GEN) ./generate-workloadmanifest-json.csharp "$(1)" "$(3)" "$(4)" "$(6)" "$$(DOTNET_$(5)_RUNTIME_IDENTIFIERS)" "$$@.tmp" "$$(DOTNET_WINDOWS_PLATFORMS)" $$(Q_GEN) ./generate-workloadmanifest-json.csharp "$(1)" "$(3)" "$(4)" "$(6)" "$$(DOTNET_$(5)_RUNTIME_IDENTIFIERS)" "$$@.tmp" "$$(DOTNET_WINDOWS_PLATFORMS)"
$$(Q) mv $$@.tmp $$@ $$(Q) mv $$@.tmp $$@
Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.targets: Workloads/WorkloadManifest.$(1).template.targets Makefile $(TOP)/Make.config.inc $(TOP)/.git/HEAD $(TOP)/.git/index Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.targets: Workloads/WorkloadManifest.$(1).template.targets Makefile $(TOP)/Make.config.inc $(TOP)/.git/HEAD $(TOP)/.git/index | Workloads/Microsoft.NET.Sdk.$(1)
$$(Q_GEN) sed \ $$(Q_GEN) sed \
-e "s/@NUGET_VERSION_NO_METADATA@/$3/g" \ -e "s/@NUGET_VERSION_NO_METADATA@/$3/g" \
$$< > $$@.tmp $$< > $$@.tmp

Просмотреть файл

@ -120,6 +120,7 @@ namespace Xamarin.iOS.Tasks {
{ {
var name = Path.GetFileNameWithoutExtension (path); var name = Path.GetFileNameWithoutExtension (path);
var info = Path.Combine (path, "Info.plist"); var info = Path.Combine (path, "Info.plist");
var isSingleProject = false;
if (!File.Exists (info)) { if (!File.Exists (info)) {
Log.LogError (7014, path, MSBStrings.E7014, name); Log.LogError (7014, path, MSBStrings.E7014, name);
return; return;
@ -162,26 +163,32 @@ namespace Xamarin.iOS.Tasks {
Log.LogError (7019, info, MSBStrings.E7019, name, wkCompanionAppBundleIdentifier, mainBundleIdentifier); Log.LogError (7019, info, MSBStrings.E7019, name, wkCompanionAppBundleIdentifier, mainBundleIdentifier);
PBoolean watchKitApp; PBoolean watchKitApp;
if (!plist.TryGetValue ("WKWatchKitApp", out watchKitApp) || !watchKitApp.Value) if (plist.TryGetValue ("WKWatchKitApp", out watchKitApp)) {
Log.LogError (7020, info, MSBStrings.E7020, name); if (!watchKitApp.Value)
Log.LogError (7020, info, MSBStrings.E7020, name);
} else {
isSingleProject = true;
}
if (plist.ContainsKey ("LSRequiresIPhoneOS")) if (plist.ContainsKey ("LSRequiresIPhoneOS"))
Log.LogError (7021, info, MSBStrings.E7021, name); Log.LogError (7021, info, MSBStrings.E7021, name);
var pluginsDir = Path.Combine (path, "PlugIns"); var pluginsDir = Path.Combine (path, "PlugIns");
if (!Directory.Exists (pluginsDir)) { if (!Directory.Exists (pluginsDir) && !isSingleProject) {
Log.LogError (7022, path, MSBStrings.E7022, name); Log.LogError (7022, path, MSBStrings.E7022, name);
return; return;
} }
int count = 0; if (!isSingleProject) {
foreach (var plugin in Directory.EnumerateDirectories (pluginsDir, "*.appex")) { int count = 0;
ValidateWatchExtension (plugin, bundleIdentifier, shortVersionString, version); foreach (var plugin in Directory.EnumerateDirectories (pluginsDir, "*.appex")) {
count++; ValidateWatchExtension (plugin, bundleIdentifier, shortVersionString, version);
} count++;
}
if (count == 0) if (count == 0)
Log.LogError (7022, pluginsDir, MSBStrings.E7022_A, name); Log.LogError (7022, pluginsDir, MSBStrings.E7022_A, name);
}
} }
void ValidateWatchExtension (string path, string watchAppBundleIdentifier, string mainShortVersionString, string mainVersion) void ValidateWatchExtension (string path, string watchAppBundleIdentifier, string mainShortVersionString, string mainVersion)

Просмотреть файл

@ -255,6 +255,7 @@
"MonoProfileThreadFunc", "end" "MonoProfileThreadFunc", "end"
) { ) {
XamarinRuntime = RuntimeMode.MonoVM, XamarinRuntime = RuntimeMode.MonoVM,
Mode = DotNetMode.OnlyLegacy,
}, },
new Export ("void", "mono_profiler_install_gc", new Export ("void", "mono_profiler_install_gc",

Просмотреть файл

@ -235,6 +235,7 @@ xamarin_get_runtime_class ()
* and create a pool that spans the thread's entire lifetime. * and create a pool that spans the thread's entire lifetime.
*/ */
#if !DOTNET
static CFMutableDictionaryRef xamarin_thread_hash = NULL; static CFMutableDictionaryRef xamarin_thread_hash = NULL;
static pthread_mutex_t thread_hash_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t thread_hash_lock = PTHREAD_MUTEX_INITIALIZER;
@ -296,14 +297,18 @@ thread_end (MonoProfiler *prof, uintptr_t tid)
// COOP: no managed memory access: any mode. // COOP: no managed memory access: any mode.
xamarin_thread_finish (NULL); xamarin_thread_finish (NULL);
} }
#endif // !DOTNET
void void
xamarin_install_nsautoreleasepool_hooks () xamarin_install_nsautoreleasepool_hooks ()
{ {
// No need to do anything here for CoreCLR.
#if !DOTNET
// COOP: executed at startup (and no managed memory access): any mode. // COOP: executed at startup (and no managed memory access): any mode.
xamarin_thread_hash = CFDictionaryCreateMutable (kCFAllocatorDefault, 0, NULL, NULL); xamarin_thread_hash = CFDictionaryCreateMutable (kCFAllocatorDefault, 0, NULL, NULL);
mono_profiler_install_thread (thread_start, thread_end); mono_profiler_install_thread (thread_start, thread_end);
#endif // !DOTNET
} }
void void

Просмотреть файл

@ -51,9 +51,14 @@ namespace CoreFoundation {
data = CFData.FromData ((IntPtr) ptr, buffer.Length); data = CFData.FromData ((IntPtr) ptr, buffer.Length);
} }
public CFDataBuffer (IntPtr ptr) public CFDataBuffer (IntPtr ptr) : this (ptr, false)
{ {
data = new CFData (ptr, false); }
public CFDataBuffer (IntPtr ptr, bool owns)
{
data = new CFData (ptr, owns);
buffer = data.GetBuffer (); buffer = data.GetBuffer ();
} }

Просмотреть файл

@ -34,6 +34,7 @@ using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Runtime.Versioning; using System.Runtime.Versioning;
using System.Threading;
using CoreFoundation; using CoreFoundation;
using Foundation; using Foundation;
@ -184,9 +185,12 @@ namespace CoreFoundation {
{ {
} }
internal static IPEndPoint EndPointFromAddressPtr (IntPtr address) internal static IPEndPoint? EndPointFromAddressPtr (IntPtr address, bool owns)
{ {
using (var buffer = new CFDataBuffer (address)) { if (address == IntPtr.Zero)
return null;
using (var buffer = new CFDataBuffer (address, owns)) {
if (buffer [1] == 30) { // AF_INET6 if (buffer [1] == 30) { // AF_INET6
int port = (buffer [2] << 8) + buffer [3]; int port = (buffer [2] << 8) + buffer [3];
var bytes = new byte [16]; var bytes = new byte [16];
@ -230,6 +234,69 @@ namespace CoreFoundation {
} }
} }
[StructLayout (LayoutKind.Sequential)]
struct CFSocketContext {
nint Version; // CFIndex
public /* void*/ IntPtr Info;
#if NET
unsafe delegate* unmanaged<IntPtr, IntPtr> Retain;
unsafe delegate* unmanaged<IntPtr, void> Release;
#else
IntPtr Retain;
IntPtr Release;
#endif
IntPtr CopyDescription;
public CFSocketContext (IntPtr info) : this ()
{
Info = info;
#if NET
unsafe {
Retain = &OnContextRetain;
Release = &OnContextRelease;
}
#else
Retain = Marshal.GetFunctionPointerForDelegate (retainCallback);
Release = Marshal.GetFunctionPointerForDelegate (releaseCallback);
#endif
}
#if !NET
delegate IntPtr RetainCallback (IntPtr ptr);
static readonly RetainCallback retainCallback = OnContextRetain;
#endif
#if NET
[UnmanagedCallersOnly]
#else
[MonoPInvokeCallback (typeof (RetainCallback))]
#endif
static IntPtr OnContextRetain (IntPtr ptr)
{
var gch = GCHandle.FromIntPtr (ptr);
var socket = (CFSocket?) gch.Target;
socket?.RetainContext ();
return ptr;
}
#if !NET
delegate void ReleaseCallback (IntPtr ptr);
static readonly ReleaseCallback releaseCallback = OnContextRelease;
#endif
#if NET
[UnmanagedCallersOnly]
#else
[MonoPInvokeCallback (typeof (ReleaseCallback))]
#endif
static void OnContextRelease (IntPtr ptr)
{
var gch = GCHandle.FromIntPtr (ptr);
var socket = (CFSocket?) gch.Target;
socket?.ReleaseContext (gch);
}
}
#if NET #if NET
[SupportedOSPlatform ("ios")] [SupportedOSPlatform ("ios")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
@ -237,14 +304,25 @@ namespace CoreFoundation {
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#endif #endif
public class CFSocket : CFType { public class CFSocket : CFType {
GCHandle gch; int contextRetainCount;
internal void RetainContext ()
{
Interlocked.Increment (ref contextRetainCount);
}
unsafe internal void ReleaseContext (GCHandle gch)
{
var postRC = Interlocked.Decrement (ref contextRetainCount);
if (postRC == 0 && gch.IsAllocated) {
gch.Free ();
}
}
protected override void Dispose (bool disposing) protected override void Dispose (bool disposing)
{ {
if (disposing) { if (Handle != NativeHandle.Zero)
if (gch.IsAllocated) CFSocketInvalidate (Handle);
gch.Free ();
}
base.Dispose (disposing); base.Dispose (disposing);
} }
@ -258,11 +336,11 @@ namespace CoreFoundation {
return; return;
CFSocketCallBackType cbType = (CFSocketCallBackType) (ulong) type; CFSocketCallBackType cbType = (CFSocketCallBackType) (ulong) type;
if (cbType == CFSocketCallBackType.AcceptCallBack) { if (cbType == CFSocketCallBackType.AcceptCallBack && socket.AcceptEvent is not null) {
var ep = CFSocketAddress.EndPointFromAddressPtr (address); var ep = CFSocketAddress.EndPointFromAddressPtr (address, false)!;
var handle = new CFSocketNativeHandle (Marshal.ReadInt32 (data)); var handle = new CFSocketNativeHandle (Marshal.ReadInt32 (data));
socket.OnAccepted (new CFSocketAcceptEventArgs (handle, ep)); socket.OnAccepted (new CFSocketAcceptEventArgs (handle, ep));
} else if (cbType == CFSocketCallBackType.ConnectCallBack) { } else if (cbType == CFSocketCallBackType.ConnectCallBack && socket.ConnectEvent is not null) {
CFSocketError result; CFSocketError result;
if (data == IntPtr.Zero) if (data == IntPtr.Zero)
result = CFSocketError.Success; result = CFSocketError.Success;
@ -272,28 +350,31 @@ namespace CoreFoundation {
result = (CFSocketError) Marshal.ReadInt32 (data); result = (CFSocketError) Marshal.ReadInt32 (data);
} }
socket.OnConnect (new CFSocketConnectEventArgs (result)); socket.OnConnect (new CFSocketConnectEventArgs (result));
} else if (cbType == CFSocketCallBackType.DataCallBack) { } else if (cbType == CFSocketCallBackType.DataCallBack && socket.DataEvent is not null) {
var ep = CFSocketAddress.EndPointFromAddressPtr (address); using (var cfdata = new CFData (data, false)) {
using (var cfdata = new CFData (data, false)) if (cfdata.Length > 0) {
socket.OnData (new CFSocketDataEventArgs (ep, cfdata.GetBuffer ())); var ep = CFSocketAddress.EndPointFromAddressPtr (address, false)!;
socket.OnData (new CFSocketDataEventArgs (ep, cfdata.GetBuffer ()));
}
}
} else if (cbType == CFSocketCallBackType.NoCallBack) { } else if (cbType == CFSocketCallBackType.NoCallBack) {
// nothing to do // nothing to do
} else if (cbType == CFSocketCallBackType.ReadCallBack) { } else if (cbType == CFSocketCallBackType.ReadCallBack && socket.ReadEvent is not null) {
socket.OnRead (new CFSocketReadEventArgs ()); socket.OnRead (new CFSocketReadEventArgs ());
} else if (cbType == CFSocketCallBackType.WriteCallBack) { } else if (cbType == CFSocketCallBackType.WriteCallBack && socket.WriteEvent is not null) {
socket.OnWrite (new CFSocketWriteEventArgs ()); socket.OnWrite (new CFSocketWriteEventArgs ());
} }
} }
[DllImport (Constants.CoreFoundationLibrary)] [DllImport (Constants.CoreFoundationLibrary)]
extern static IntPtr CFSocketCreate (IntPtr allocator, int /*SInt32*/ family, int /*SInt32*/ type, int /*SInt32*/ proto, unsafe extern static IntPtr CFSocketCreate (IntPtr allocator, int /*SInt32*/ family, int /*SInt32*/ type, int /*SInt32*/ proto,
nuint /*CFOptionFlags*/ callBackTypes, nuint /*CFOptionFlags*/ callBackTypes,
CFSocketCallBack callout, ref CFStreamClientContext ctx); CFSocketCallBack callout, CFSocketContext* ctx);
[DllImport (Constants.CoreFoundationLibrary)] [DllImport (Constants.CoreFoundationLibrary)]
extern static IntPtr CFSocketCreateWithNative (IntPtr allocator, CFSocketNativeHandle sock, unsafe extern static IntPtr CFSocketCreateWithNative (IntPtr allocator, CFSocketNativeHandle sock,
nuint /*CFOptionFlags*/ callBackTypes, nuint /*CFOptionFlags*/ callBackTypes,
CFSocketCallBack callout, ref CFStreamClientContext ctx); CFSocketCallBack callout, CFSocketContext* ctx);
[DllImport (Constants.CoreFoundationLibrary)] [DllImport (Constants.CoreFoundationLibrary)]
extern static IntPtr CFSocketCreateRunLoopSource (IntPtr allocator, IntPtr socket, nint order); extern static IntPtr CFSocketCreateRunLoopSource (IntPtr allocator, IntPtr socket, nint order);
@ -310,62 +391,62 @@ namespace CoreFoundation {
public CFSocket (AddressFamily family, SocketType type, ProtocolType proto, CFRunLoop loop) public CFSocket (AddressFamily family, SocketType type, ProtocolType proto, CFRunLoop loop)
: this (CFSocketSignature.AddressFamilyToInt (family), : this (CFSocketSignature.AddressFamilyToInt (family),
CFSocketSignature.SocketTypeToInt (type), CFSocketSignature.SocketTypeToInt (type),
CFSocketSignature.ProtocolToInt (proto), loop) CFSocketSignature.ProtocolToInt (proto), loop)
{ {
} }
unsafe delegate IntPtr CreateSocket (CFSocketContext* ctx);
const CFSocketCallBackType defaultCallbackTypes = CFSocketCallBackType.DataCallBack | CFSocketCallBackType.ConnectCallBack;
CFSocket (int family, int type, int proto, CFRunLoop loop) CFSocket (int family, int type, int proto, CFRunLoop loop)
{ {
var cbTypes = CFSocketCallBackType.DataCallBack | CFSocketCallBackType.ConnectCallBack; unsafe {
Initialize (
gch = GCHandle.Alloc (this); loop,
try { (CFSocketContext* ctx) => CFSocketCreate (IntPtr.Zero, family, type, proto, (nuint) (ulong) defaultCallbackTypes, OnCallback, ctx)
var ctx = new CFStreamClientContext (); );
ctx.Info = GCHandle.ToIntPtr (gch);
var handle = CFSocketCreate (IntPtr.Zero, family, type, proto, (nuint) (ulong) cbTypes, OnCallback, ref ctx);
InitializeHandle (handle);
var source = new CFRunLoopSource (CFSocketCreateRunLoopSource (IntPtr.Zero, handle, 0), true);
loop.AddSource (source, CFRunLoop.ModeDefault);
} catch {
gch.Free ();
throw;
} }
} }
CFSocket (CFSocketNativeHandle sock) CFSocket (CFSocketNativeHandle sock)
{ {
var cbTypes = CFSocketCallBackType.DataCallBack | CFSocketCallBackType.WriteCallBack; unsafe {
Initialize (
gch = GCHandle.Alloc (this); CFRunLoop.Current,
try { (CFSocketContext* ctx) => CFSocketCreateWithNative (IntPtr.Zero, sock, (nuint) (ulong) defaultCallbackTypes, OnCallback, ctx)
var ctx = new CFStreamClientContext (); );
ctx.Info = GCHandle.ToIntPtr (gch);
var handle = CFSocketCreateWithNative (IntPtr.Zero, sock, (nuint) (ulong) cbTypes, OnCallback, ref ctx);
InitializeHandle (handle);
var source = new CFRunLoopSource (CFSocketCreateRunLoopSource (IntPtr.Zero, handle, 0), true);
var loop = CFRunLoop.Current;
loop.AddSource (source, CFRunLoop.ModeDefault);
} catch {
gch.Free ();
throw;
} }
} }
[Preserve (Conditional = true)] internal CFSocket (CFSocketSignature sig, double timeout)
CFSocket (NativeHandle handle, bool owns)
: base (handle, owns)
{ {
gch = GCHandle.Alloc (this); unsafe {
Initialize (
CFRunLoop.Current,
(CFSocketContext* ctx) => CFSocketCreateConnectedToSocketSignature (IntPtr.Zero, ref sig, (nuint) (ulong) defaultCallbackTypes, OnCallback, ctx, timeout)
);
}
}
void Initialize (CFRunLoop runLoop, CreateSocket createSocket)
{
var gch = GCHandle.Alloc (this);
try { try {
var source = new CFRunLoopSource (CFSocketCreateRunLoopSource (IntPtr.Zero, handle, 0), true); var ctx = new CFSocketContext ((IntPtr) gch);
var loop = CFRunLoop.Current; IntPtr handle;
loop.AddSource (source, CFRunLoop.ModeDefault); unsafe {
CFSocketContext* pctx = &ctx;
handle = createSocket (pctx);
}
if (handle == IntPtr.Zero)
throw new CFSocketException (CFSocketError.Error);
using (var source = new CFRunLoopSource (CFSocketCreateRunLoopSource (IntPtr.Zero, handle, 0), true)) {
runLoop.AddSource (source, CFRunLoop.ModeDefault);
}
this.Handle = handle;
} catch { } catch {
gch.Free (); gch.Free ();
throw; throw;
@ -373,24 +454,18 @@ namespace CoreFoundation {
} }
[DllImport (Constants.CoreFoundationLibrary)] [DllImport (Constants.CoreFoundationLibrary)]
extern static IntPtr CFSocketCreateConnectedToSocketSignature (IntPtr allocator, ref CFSocketSignature signature, unsafe extern static IntPtr CFSocketCreateConnectedToSocketSignature (IntPtr allocator, ref CFSocketSignature signature,
nuint /*CFOptionFlags*/ callBackTypes, nuint /*CFOptionFlags*/ callBackTypes,
CFSocketCallBack callout, CFSocketCallBack callout,
IntPtr context, double timeout); CFSocketContext* context, double timeout);
public static CFSocket CreateConnectedToSocketSignature (AddressFamily family, SocketType type, public static CFSocket CreateConnectedToSocketSignature (AddressFamily family, SocketType type,
ProtocolType proto, IPEndPoint endpoint, ProtocolType proto, IPEndPoint endpoint,
double timeout) double timeout)
{ {
var cbTypes = CFSocketCallBackType.ConnectCallBack | CFSocketCallBackType.DataCallBack;
using (var address = new CFSocketAddress (endpoint)) { using (var address = new CFSocketAddress (endpoint)) {
var sig = new CFSocketSignature (family, type, proto, address); var sig = new CFSocketSignature (family, type, proto, address);
var handle = CFSocketCreateConnectedToSocketSignature ( return new CFSocket (sig, timeout);
IntPtr.Zero, ref sig, (nuint) (ulong) cbTypes, OnCallback, IntPtr.Zero, timeout);
if (handle == IntPtr.Zero)
throw new CFSocketException (CFSocketError.Error);
return new CFSocket (handle, true);
} }
} }
@ -413,6 +488,7 @@ namespace CoreFoundation {
public void SetAddress (IPEndPoint endpoint) public void SetAddress (IPEndPoint endpoint)
{ {
EnableCallBacks (CFSocketCallBackType.AcceptCallBack); EnableCallBacks (CFSocketCallBackType.AcceptCallBack);
var flags = GetSocketFlags (); var flags = GetSocketFlags ();
flags |= CFSocketFlags.AutomaticallyReenableAcceptCallBack; flags |= CFSocketFlags.AutomaticallyReenableAcceptCallBack;
SetSocketFlags (flags); SetSocketFlags (flags);
@ -423,6 +499,26 @@ namespace CoreFoundation {
} }
} }
[DllImport (Constants.CoreFoundationLibrary)]
static extern IntPtr CFSocketCopyAddress (IntPtr socket);
public IPEndPoint? Address {
get {
var data = CFSocketCopyAddress (Handle);
return CFSocketAddress.EndPointFromAddressPtr (data, true);
}
}
[DllImport (Constants.CoreFoundationLibrary)]
static extern IntPtr CFSocketCopyPeerAddress (IntPtr socket);
public IPEndPoint? RemoteAddress {
get {
var data = CFSocketCopyPeerAddress (Handle);
return CFSocketAddress.EndPointFromAddressPtr (data, true);
}
}
[DllImport (Constants.CoreFoundationLibrary)] [DllImport (Constants.CoreFoundationLibrary)]
extern static CFSocketFlags CFSocketGetSocketFlags (IntPtr handle); extern static CFSocketFlags CFSocketGetSocketFlags (IntPtr handle);
@ -620,5 +716,13 @@ namespace CoreFoundation {
throw new CFSocketException (error); throw new CFSocketException (error);
} }
} }
[DllImport (Constants.CoreFoundationLibrary)]
extern static void CFSocketInvalidate (IntPtr handle);
public void Invalidate ()
{
Dispose ();
}
} }
} }

Просмотреть файл

@ -25,6 +25,8 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// //
#nullable enable
using System; using System;
using CoreFoundation; using CoreFoundation;
using CoreText; using CoreText;
@ -36,13 +38,13 @@ using UIKit;
namespace Foundation { namespace Foundation {
public partial class NSAttributedString { public partial class NSAttributedString {
public string Value { public string? Value {
get { get {
return CFString.FromHandle (LowLevelValue); return CFString.FromHandle (LowLevelValue);
} }
} }
public NSDictionary GetAttributes (nint location, out NSRange effectiveRange) public NSDictionary? GetAttributes (nint location, out NSRange effectiveRange)
{ {
return Runtime.GetNSObject<NSDictionary> (LowLevelGetAttributes (location, out effectiveRange)); return Runtime.GetNSObject<NSDictionary> (LowLevelGetAttributes (location, out effectiveRange));
} }
@ -58,21 +60,21 @@ namespace Foundation {
} }
#endif #endif
public NSAttributedString (string str, CTStringAttributes attributes) public NSAttributedString (string str, CTStringAttributes? attributes)
: this (str, attributes != null ? attributes.Dictionary : null) : this (str, attributes?.Dictionary)
{ {
} }
public CTStringAttributes GetCoreTextAttributes (nint location, out NSRange effectiveRange) public CTStringAttributes? GetCoreTextAttributes (nint location, out NSRange effectiveRange)
{ {
var attr = GetAttributes (location, out effectiveRange); var attr = GetAttributes (location, out effectiveRange);
return attr == null ? null : new CTStringAttributes (attr); return attr is null ? null : new CTStringAttributes (attr);
} }
public CTStringAttributes GetCoreTextAttributes (nint location, out NSRange longestEffectiveRange, NSRange rangeLimit) public CTStringAttributes? GetCoreTextAttributes (nint location, out NSRange longestEffectiveRange, NSRange rangeLimit)
{ {
var attr = GetAttributes (location, out longestEffectiveRange, rangeLimit); var attr = GetAttributes (location, out longestEffectiveRange, rangeLimit);
return attr == null ? null : new CTStringAttributes (attr); return attr is null ? null : new CTStringAttributes (attr);
} }
public NSAttributedString Substring (nint start, nint len) public NSAttributedString Substring (nint start, nint len)
@ -81,52 +83,52 @@ namespace Foundation {
} }
#if !MONOMAC #if !MONOMAC
public NSAttributedString (string str, UIStringAttributes attributes) public NSAttributedString (string str, UIStringAttributes? attributes)
: this (str, attributes != null ? attributes.Dictionary : null) : this (str, attributes?.Dictionary)
{ {
} }
public UIStringAttributes GetUIKitAttributes (nint location, out NSRange effectiveRange) public UIStringAttributes? GetUIKitAttributes (nint location, out NSRange effectiveRange)
{ {
var attr = GetAttributes (location, out effectiveRange); var attr = GetAttributes (location, out effectiveRange);
return attr == null ? null : new UIStringAttributes (attr); return attr is null ? null : new UIStringAttributes (attr);
} }
public UIStringAttributes GetUIKitAttributes (nint location, out NSRange longestEffectiveRange, NSRange rangeLimit) public UIStringAttributes? GetUIKitAttributes (nint location, out NSRange longestEffectiveRange, NSRange rangeLimit)
{ {
var attr = GetAttributes (location, out longestEffectiveRange, rangeLimit); var attr = GetAttributes (location, out longestEffectiveRange, rangeLimit);
return attr == null ? null : new UIStringAttributes (attr); return attr is null ? null : new UIStringAttributes (attr);
} }
static internal NSDictionary ToDictionary ( static internal NSDictionary? ToDictionary (
UIFont font, UIFont? font,
UIColor foregroundColor, UIColor? foregroundColor,
UIColor backgroundColor, UIColor? backgroundColor,
UIColor strokeColor, UIColor? strokeColor,
NSParagraphStyle paragraphStyle, NSParagraphStyle? paragraphStyle,
NSLigatureType ligature, NSLigatureType ligature,
float kerning, float kerning,
NSUnderlineStyle underlineStyle, NSUnderlineStyle underlineStyle,
#if !WATCH #if !WATCH
NSShadow shadow, NSShadow? shadow,
#endif #endif
float strokeWidth, float strokeWidth,
NSUnderlineStyle strikethroughStyle) NSUnderlineStyle strikethroughStyle)
{ {
var attr = new UIStringAttributes (); var attr = new UIStringAttributes ();
if (font != null) { if (font is not null) {
attr.Font = font; attr.Font = font;
} }
if (foregroundColor != null) { if (foregroundColor is not null) {
attr.ForegroundColor = foregroundColor; attr.ForegroundColor = foregroundColor;
} }
if (backgroundColor != null) { if (backgroundColor is not null) {
attr.BackgroundColor = backgroundColor; attr.BackgroundColor = backgroundColor;
} }
if (strokeColor != null) { if (strokeColor is not null) {
attr.StrokeColor = strokeColor; attr.StrokeColor = strokeColor;
} }
if (paragraphStyle != null) { if (paragraphStyle is not null) {
attr.ParagraphStyle = paragraphStyle; attr.ParagraphStyle = paragraphStyle;
} }
if (ligature != NSLigatureType.Default) { if (ligature != NSLigatureType.Default) {
@ -139,7 +141,7 @@ namespace Foundation {
attr.UnderlineStyle = underlineStyle; attr.UnderlineStyle = underlineStyle;
} }
#if !WATCH #if !WATCH
if (shadow != null) { if (shadow is not null) {
attr.Shadow = shadow; attr.Shadow = shadow;
} }
#endif #endif
@ -154,16 +156,16 @@ namespace Foundation {
} }
public NSAttributedString (string str, public NSAttributedString (string str,
UIFont font = null, UIFont? font = null,
UIColor foregroundColor = null, UIColor? foregroundColor = null,
UIColor backgroundColor = null, UIColor? backgroundColor = null,
UIColor strokeColor = null, UIColor? strokeColor = null,
NSParagraphStyle paragraphStyle = null, NSParagraphStyle? paragraphStyle = null,
NSLigatureType ligatures = NSLigatureType.Default, NSLigatureType ligatures = NSLigatureType.Default,
float kerning = 0, float kerning = 0,
NSUnderlineStyle underlineStyle = NSUnderlineStyle.None, NSUnderlineStyle underlineStyle = NSUnderlineStyle.None,
#if !WATCH #if !WATCH
NSShadow shadow = null, NSShadow? shadow = null,
#endif #endif
float strokeWidth = 0, float strokeWidth = 0,
NSUnderlineStyle strikethroughStyle = NSUnderlineStyle.None) NSUnderlineStyle strikethroughStyle = NSUnderlineStyle.None)
@ -183,7 +185,7 @@ namespace Foundation {
// note: we cannot reuse the same method name - as it would break compilation of existing apps // note: we cannot reuse the same method name - as it would break compilation of existing apps
public static NSAttributedString CreateFrom (NSTextAttachment attachment) public static NSAttributedString CreateFrom (NSTextAttachment attachment)
{ {
return (null as NSAttributedString).FromTextAttachment (attachment); return (null as NSAttributedString)!.FromTextAttachment (attachment);
} }
#endif #endif
#endif #endif

Просмотреть файл

@ -25,6 +25,8 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// //
#nullable enable
using System; using System;
using ObjCRuntime; using ObjCRuntime;
@ -39,7 +41,7 @@ namespace Foundation {
#if !MONOMAC && !COREBUILD #if !MONOMAC && !COREBUILD
public partial class NSAttributedString { public partial class NSAttributedString {
static NSDictionary ignore; static NSDictionary? ignore;
public NSAttributedString (NSUrl url, NSAttributedStringDocumentAttributes documentAttributes, ref NSError error) public NSAttributedString (NSUrl url, NSAttributedStringDocumentAttributes documentAttributes, ref NSError error)
: this (url, documentAttributes, out ignore, ref error) { } : this (url, documentAttributes, out ignore, ref error) { }
@ -48,14 +50,14 @@ namespace Foundation {
: this (data, documentAttributes, out ignore, ref error) { } : this (data, documentAttributes, out ignore, ref error) { }
public NSAttributedString (NSUrl url, ref NSError error) public NSAttributedString (NSUrl url, ref NSError error)
: this (url, (NSDictionary) null, out ignore, ref error) { } : this (url, new NSDictionary (), out ignore, ref error) { }
public NSAttributedString (NSData data, ref NSError error) public NSAttributedString (NSData data, ref NSError error)
: this (data, (NSDictionary) null, out ignore, ref error) { } : this (data, new NSDictionary (), out ignore, ref error) { }
#if IOS // not TVOS or WATCH #if IOS // not TVOS or WATCH
// use the best selector based on the OS version // use the best selector based on the OS version
public NSAttributedString (NSUrl url, NSDictionary options, out NSDictionary resultDocumentAttributes, ref NSError error) public NSAttributedString (NSUrl url, NSDictionary? options, out NSDictionary resultDocumentAttributes, ref NSError error)
{ {
if (SystemVersion.CheckiOS (9,0)) if (SystemVersion.CheckiOS (9,0))
Handle = InitWithURL (url, options, out resultDocumentAttributes, ref error); Handle = InitWithURL (url, options, out resultDocumentAttributes, ref error);
@ -73,12 +75,12 @@ namespace Foundation {
public partial class NSAttributedStringDocumentAttributes : DictionaryContainer { public partial class NSAttributedStringDocumentAttributes : DictionaryContainer {
#if !MONOMAC && !COREBUILD #if !MONOMAC && !COREBUILD
public NSAttributedStringDocumentAttributes () : base (new NSMutableDictionary ()) { } public NSAttributedStringDocumentAttributes () : base (new NSMutableDictionary ()) { }
public NSAttributedStringDocumentAttributes (NSDictionary dictionary) : base (dictionary) { } public NSAttributedStringDocumentAttributes (NSDictionary? dictionary) : base (dictionary) { }
public NSStringEncoding? StringEncoding { public NSStringEncoding? StringEncoding {
get { get {
var value = GetInt32Value (UIStringAttributeKey.NSCharacterEncodingDocumentAttribute); var value = GetInt32Value (UIStringAttributeKey.NSCharacterEncodingDocumentAttribute);
if (value == null) if (value is null)
return null; return null;
else else
return (NSStringEncoding) value.Value; return (NSStringEncoding) value.Value;
@ -88,7 +90,7 @@ namespace Foundation {
} }
} }
public NSString WeakDocumentType { public NSString? WeakDocumentType {
get { get {
return GetNSStringValue (UIStringAttributeKey.NSDocumentTypeDocumentAttribute); return GetNSStringValue (UIStringAttributeKey.NSDocumentTypeDocumentAttribute);
} }
@ -139,7 +141,7 @@ namespace Foundation {
return null; return null;
} }
set { set {
if (value == null) if (value is null)
RemoveValue (UIStringAttributeKey.NSPaperSizeDocumentAttribute); RemoveValue (UIStringAttributeKey.NSPaperSizeDocumentAttribute);
else else
Dictionary [UIStringAttributeKey.NSPaperSizeDocumentAttribute] = NSValue.FromCGSize (value.Value); Dictionary [UIStringAttributeKey.NSPaperSizeDocumentAttribute] = NSValue.FromCGSize (value.Value);
@ -156,7 +158,7 @@ namespace Foundation {
return null; return null;
} }
set { set {
if (value == null) if (value is null)
RemoveValue (UIStringAttributeKey.NSPaperMarginDocumentAttribute); RemoveValue (UIStringAttributeKey.NSPaperMarginDocumentAttribute);
else else
Dictionary [UIStringAttributeKey.NSPaperMarginDocumentAttribute] = NSValue.FromUIEdgeInsets (value.Value); Dictionary [UIStringAttributeKey.NSPaperMarginDocumentAttribute] = NSValue.FromUIEdgeInsets (value.Value);
@ -173,7 +175,7 @@ namespace Foundation {
return null; return null;
} }
set { set {
if (value == null) if (value is null)
RemoveValue (UIStringAttributeKey.NSViewSizeDocumentAttribute); RemoveValue (UIStringAttributeKey.NSViewSizeDocumentAttribute);
else else
Dictionary [UIStringAttributeKey.NSViewSizeDocumentAttribute] = NSValue.FromCGSize (value.Value); Dictionary [UIStringAttributeKey.NSViewSizeDocumentAttribute] = NSValue.FromCGSize (value.Value);
@ -185,7 +187,7 @@ namespace Foundation {
return GetFloatValue (UIStringAttributeKey.NSViewZoomDocumentAttribute); return GetFloatValue (UIStringAttributeKey.NSViewZoomDocumentAttribute);
} }
set { set {
if (value == null) if (value is null)
RemoveValue (UIStringAttributeKey.NSViewZoomDocumentAttribute); RemoveValue (UIStringAttributeKey.NSViewZoomDocumentAttribute);
else else
SetNumberValue (UIStringAttributeKey.NSViewZoomDocumentAttribute, value); SetNumberValue (UIStringAttributeKey.NSViewZoomDocumentAttribute, value);
@ -195,13 +197,13 @@ namespace Foundation {
public NSDocumentViewMode? ViewMode { public NSDocumentViewMode? ViewMode {
get { get {
var value = GetInt32Value (UIStringAttributeKey.NSViewModeDocumentAttribute); var value = GetInt32Value (UIStringAttributeKey.NSViewModeDocumentAttribute);
if (value == null) if (value is null)
return null; return null;
else else
return (NSDocumentViewMode) value.Value; return (NSDocumentViewMode) value.Value;
} }
set { set {
if (value == null) if (value is null)
RemoveValue (UIStringAttributeKey.NSViewModeDocumentAttribute); RemoveValue (UIStringAttributeKey.NSViewModeDocumentAttribute);
else else
SetNumberValue (UIStringAttributeKey.NSViewModeDocumentAttribute, (int) value.Value); SetNumberValue (UIStringAttributeKey.NSViewModeDocumentAttribute, (int) value.Value);
@ -211,7 +213,7 @@ namespace Foundation {
public bool ReadOnly { public bool ReadOnly {
get { get {
var value = GetInt32Value (UIStringAttributeKey.NSReadOnlyDocumentAttribute); var value = GetInt32Value (UIStringAttributeKey.NSReadOnlyDocumentAttribute);
if (value == null || value.Value <= 0) if (value is null || value.Value <= 0)
return false; return false;
return true; return true;
} }
@ -220,14 +222,14 @@ namespace Foundation {
} }
} }
public UIColor BackgroundColor { public UIColor? BackgroundColor {
get { get {
NSObject value; NSObject? value;
Dictionary.TryGetValue (UIStringAttributeKey.NSBackgroundColorDocumentAttribute, out value); Dictionary.TryGetValue (UIStringAttributeKey.NSBackgroundColorDocumentAttribute, out value);
return value as UIColor; return value as UIColor;
} }
set { set {
if (value == null) if (value is null)
RemoveValue (UIStringAttributeKey.NSBackgroundColorDocumentAttribute); RemoveValue (UIStringAttributeKey.NSBackgroundColorDocumentAttribute);
else else
Dictionary [UIStringAttributeKey.NSBackgroundColorDocumentAttribute] = value; Dictionary [UIStringAttributeKey.NSBackgroundColorDocumentAttribute] = value;
@ -239,7 +241,7 @@ namespace Foundation {
return GetFloatValue (UIStringAttributeKey.NSReadOnlyDocumentAttribute); return GetFloatValue (UIStringAttributeKey.NSReadOnlyDocumentAttribute);
} }
set { set {
if (value == null) if (value is null)
RemoveValue (UIStringAttributeKey.NSReadOnlyDocumentAttribute); RemoveValue (UIStringAttributeKey.NSReadOnlyDocumentAttribute);
else { else {
if (value < 0 || value > 1.0f) if (value < 0 || value > 1.0f)
@ -254,7 +256,7 @@ namespace Foundation {
return GetFloatValue (UIStringAttributeKey.NSDefaultTabIntervalDocumentAttribute); return GetFloatValue (UIStringAttributeKey.NSDefaultTabIntervalDocumentAttribute);
} }
set { set {
if (value == null) if (value is null)
RemoveValue (UIStringAttributeKey.NSDefaultTabIntervalDocumentAttribute); RemoveValue (UIStringAttributeKey.NSDefaultTabIntervalDocumentAttribute);
else { else {
if (value < 0 || value > 1.0f) if (value < 0 || value > 1.0f)
@ -264,14 +266,14 @@ namespace Foundation {
} }
} }
public NSDictionary WeakDefaultAttributes { public NSDictionary? WeakDefaultAttributes {
get { get {
NSObject value; NSObject? value;
Dictionary.TryGetValue (UIStringAttributeKey.NSDefaultAttributesDocumentAttribute, out value); Dictionary.TryGetValue (UIStringAttributeKey.NSDefaultAttributesDocumentAttribute, out value);
return value as NSDictionary; return value as NSDictionary;
} }
set { set {
if (value == null) if (value is null)
RemoveValue (UIStringAttributeKey.NSDefaultAttributesDocumentAttribute); RemoveValue (UIStringAttributeKey.NSDefaultAttributesDocumentAttribute);
else else
Dictionary [UIStringAttributeKey.NSDefaultAttributesDocumentAttribute] = value; Dictionary [UIStringAttributeKey.NSDefaultAttributesDocumentAttribute] = value;
@ -290,13 +292,13 @@ namespace Foundation {
[Mac (10, 15)] [Mac (10, 15)]
[iOS (13, 0)] [iOS (13, 0)]
#endif #endif
public NSUrl ReadAccessUrl { public NSUrl? ReadAccessUrl {
get { get {
Dictionary.TryGetValue (NSAttributedStringDocumentReadingOptionKeys.ReadAccessUrlKey, out var value); Dictionary.TryGetValue (NSAttributedStringDocumentReadingOptionKeys.ReadAccessUrlKey, out var value);
return value as NSUrl; return value as NSUrl;
} }
set { set {
if (value == null) if (value is null)
RemoveValue (NSAttributedStringDocumentReadingOptionKeys.ReadAccessUrlKey); RemoveValue (NSAttributedStringDocumentReadingOptionKeys.ReadAccessUrlKey);
else else
Dictionary [NSAttributedStringDocumentReadingOptionKeys.ReadAccessUrlKey] = value; Dictionary [NSAttributedStringDocumentReadingOptionKeys.ReadAccessUrlKey] = value;

Просмотреть файл

@ -6,6 +6,8 @@
// //
// Copyright 2013 Xamarin Inc // Copyright 2013 Xamarin Inc
#nullable enable
#if MONOMAC #if MONOMAC
using System; using System;
@ -18,39 +20,39 @@ namespace Foundation
{ {
public partial class NSAttributedString public partial class NSAttributedString
{ {
public NSAttributedString (string str, NSStringAttributes attributes) public NSAttributedString (string str, NSStringAttributes? attributes)
: this (str, attributes != null ? attributes.Dictionary : null) : this (str, attributes?.Dictionary)
{ {
} }
public NSAttributedString (string str, public NSAttributedString (string str,
NSFont font = null, NSFont? font = null,
NSColor foregroundColor = null, NSColor? foregroundColor = null,
NSColor backgroundColor = null, NSColor? backgroundColor = null,
NSColor strokeColor = null, NSColor? strokeColor = null,
NSColor underlineColor = null, NSColor? underlineColor = null,
NSColor strikethroughColor = null, NSColor? strikethroughColor = null,
NSUnderlineStyle underlineStyle = NSUnderlineStyle.None, NSUnderlineStyle underlineStyle = NSUnderlineStyle.None,
NSUnderlineStyle strikethroughStyle = NSUnderlineStyle.None, NSUnderlineStyle strikethroughStyle = NSUnderlineStyle.None,
NSParagraphStyle paragraphStyle = null, NSParagraphStyle? paragraphStyle = null,
float strokeWidth = 0, float strokeWidth = 0,
NSShadow shadow = null, NSShadow? shadow = null,
NSUrl link = null, NSUrl? link = null,
bool superscript = false, bool superscript = false,
NSTextAttachment attachment = null, NSTextAttachment? attachment = null,
NSLigatureType ligature = NSLigatureType.Default, NSLigatureType ligature = NSLigatureType.Default,
float baselineOffset = 0, float baselineOffset = 0,
float kerningAdjustment = 0, float kerningAdjustment = 0,
float obliqueness = 0, float obliqueness = 0,
float expansion = 0, float expansion = 0,
NSCursor cursor = null, NSCursor? cursor = null,
string toolTip = null, string? toolTip = null,
int characterShape = 0, int characterShape = 0,
NSGlyphInfo glyphInfo = null, NSGlyphInfo? glyphInfo = null,
NSArray writingDirection = null, NSArray? writingDirection = null,
bool markedClauseSegment = false, bool markedClauseSegment = false,
NSTextLayoutOrientation verticalGlyphForm = NSTextLayoutOrientation.Horizontal, NSTextLayoutOrientation verticalGlyphForm = NSTextLayoutOrientation.Horizontal,
NSTextAlternatives textAlternatives = null, NSTextAlternatives? textAlternatives = null,
NSSpellingState spellingState = NSSpellingState.None) : this (str, NSStringAttributes.ToDictionary ( NSSpellingState spellingState = NSSpellingState.None) : this (str, NSStringAttributes.ToDictionary (
font: font, font: font,
foregroundColor: foregroundColor, foregroundColor: foregroundColor,
@ -127,16 +129,16 @@ namespace Foundation
return new NSAttributedString (wordDocFormat, NSAttributedStringDataType.DocFormat, out docAttributes); return new NSAttributedString (wordDocFormat, NSAttributedStringDataType.DocFormat, out docAttributes);
} }
public NSStringAttributes GetAppKitAttributes (nint location, out NSRange effectiveRange) public NSStringAttributes? GetAppKitAttributes (nint location, out NSRange effectiveRange)
{ {
var attr = GetAttributes (location, out effectiveRange); var attr = GetAttributes (location, out effectiveRange);
return attr == null ? null : new NSStringAttributes (attr); return attr is null ? null : new NSStringAttributes (attr);
} }
public NSStringAttributes GetAppKitAttributes (nint location, out NSRange longestEffectiveRange, NSRange rangeLimit) public NSStringAttributes? GetAppKitAttributes (nint location, out NSRange longestEffectiveRange, NSRange rangeLimit)
{ {
var attr = GetAttributes (location, out longestEffectiveRange, rangeLimit); var attr = GetAttributes (location, out longestEffectiveRange, rangeLimit);
return attr == null ? null : new NSStringAttributes (attr); return attr is null ? null : new NSStringAttributes (attr);
} }
} }
@ -144,27 +146,27 @@ namespace Foundation
public NSAttributedStringDocumentAttributes () : base (new NSMutableDictionary ()) {} public NSAttributedStringDocumentAttributes () : base (new NSMutableDictionary ()) {}
public NSAttributedStringDocumentAttributes (NSDictionary dictionary) : base (dictionary) {} public NSAttributedStringDocumentAttributes (NSDictionary dictionary) : base (dictionary) {}
public WebPreferences WebPreferences { public WebPreferences? WebPreferences {
get { get {
NSObject value; NSObject value;
Dictionary.TryGetValue (NSStringAttributeKey.NSWebPreferencesDocumentOption, out value); Dictionary.TryGetValue (NSStringAttributeKey.NSWebPreferencesDocumentOption, out value);
return value as WebPreferences; return value as WebPreferences;
} }
set { set {
if (value == null) if (value is null)
RemoveValue (NSStringAttributeKey.NSWebPreferencesDocumentOption); RemoveValue (NSStringAttributeKey.NSWebPreferencesDocumentOption);
else else
Dictionary [NSStringAttributeKey.NSWebPreferencesDocumentOption] = value; Dictionary [NSStringAttributeKey.NSWebPreferencesDocumentOption] = value;
} }
} }
public NSObject WebResourceLoadDelegate { public NSObject? WebResourceLoadDelegate {
get { get {
NSObject value; NSObject value;
Dictionary.TryGetValue (NSStringAttributeKey.NSWebResourceLoadDelegateDocumentOption, out value); Dictionary.TryGetValue (NSStringAttributeKey.NSWebResourceLoadDelegateDocumentOption, out value);
return value; return value;
} }
set { set {
if (value == null) if (value is null)
RemoveValue (NSStringAttributeKey.NSWebResourceLoadDelegateDocumentOption); RemoveValue (NSStringAttributeKey.NSWebResourceLoadDelegateDocumentOption);
else else
Dictionary [NSStringAttributeKey.NSWebResourceLoadDelegateDocumentOption] = value; Dictionary [NSStringAttributeKey.NSWebResourceLoadDelegateDocumentOption] = value;
@ -174,7 +176,7 @@ namespace Foundation
public NSStringEncoding? StringEncoding { public NSStringEncoding? StringEncoding {
get { get {
var value = GetInt32Value (NSStringAttributeKey.NSCharacterEncodingDocumentOption); var value = GetInt32Value (NSStringAttributeKey.NSCharacterEncodingDocumentOption);
if (value == null) if (value is null)
return null; return null;
else else
return (NSStringEncoding) value.Value; return (NSStringEncoding) value.Value;
@ -184,7 +186,7 @@ namespace Foundation
} }
} }
public NSString WeakDocumentType { public NSString? WeakDocumentType {
get { get {
return GetNSStringValue (NSStringAttributeKey.NSDocumentTypeDocumentOption); return GetNSStringValue (NSStringAttributeKey.NSDocumentTypeDocumentOption);
} }
@ -256,21 +258,21 @@ namespace Foundation
} }
} }
public NSDictionary WeakDefaultAttributes { public NSDictionary? WeakDefaultAttributes {
get { get {
NSObject value; NSObject value;
Dictionary.TryGetValue (NSStringAttributeKey.NSDefaultAttributesDocumentOption, out value); Dictionary.TryGetValue (NSStringAttributeKey.NSDefaultAttributesDocumentOption, out value);
return value as NSDictionary; return value as NSDictionary;
} }
set { set {
if (value == null) if (value is null)
RemoveValue (NSStringAttributeKey.NSDefaultAttributesDocumentOption); RemoveValue (NSStringAttributeKey.NSDefaultAttributesDocumentOption);
else else
Dictionary [NSStringAttributeKey.NSDefaultAttributesDocumentOption] = value; Dictionary [NSStringAttributeKey.NSDefaultAttributesDocumentOption] = value;
} }
} }
public NSUrl BaseUrl { public NSUrl? BaseUrl {
get { get {
return GetNativeValue <NSUrl> (NSStringAttributeKey.NSBaseURLDocumentOption); return GetNativeValue <NSUrl> (NSStringAttributeKey.NSBaseURLDocumentOption);
} }
@ -279,7 +281,7 @@ namespace Foundation
} }
} }
public string TextEncodingName { public string? TextEncodingName {
get { get {
return (string)GetNSStringValue (NSStringAttributeKey.NSTextEncodingNameDocumentOption); return (string)GetNSStringValue (NSStringAttributeKey.NSTextEncodingNameDocumentOption);
} }

Просмотреть файл

@ -40,7 +40,7 @@ namespace GLKit {
public enum GLKVertexAttrib { public enum GLKVertexAttrib {
Position, Normal, Color, TexCoord0, TexCoord1 Position, Normal, Color, TexCoord0, TexCoord1
} }
// GLint (32 bits on 64 bit hardware) -> GLKEffectPropertyLight.h // GLint (32 bits on 64 bit hardware) -> GLKEffectPropertyLight.h
public enum GLKLightingType { public enum GLKLightingType {
PerVertex, PerVertex,
@ -87,7 +87,7 @@ namespace GLKit {
public enum GLKViewDrawableMultisample { public enum GLKViewDrawableMultisample {
None, Sample4x None, Sample4x
} }
// GLint (32 bits on 64 bit hardware) -> GLKTextureLoader.h // GLint (32 bits on 64 bit hardware) -> GLKTextureLoader.h
public enum GLKTextureInfoAlphaState { public enum GLKTextureInfoAlphaState {
None, NonPremultiplied, Premultiplied None, NonPremultiplied, Premultiplied
@ -137,11 +137,11 @@ namespace GLKit {
[ObsoletedOSPlatform ("macos10.14", "Use 'Metal' instead.")] [ObsoletedOSPlatform ("macos10.14", "Use 'Metal' instead.")]
[ObsoletedOSPlatform ("ios12.0", "Use 'Metal' instead.")] [ObsoletedOSPlatform ("ios12.0", "Use 'Metal' instead.")]
#else #else
[Deprecated (PlatformName.iOS, 12,0, message: "Use 'Metal' instead.")] [Deprecated (PlatformName.iOS, 12, 0, message: "Use 'Metal' instead.")]
[Deprecated (PlatformName.TvOS, 12,0, message: "Use 'Metal' instead.")] [Deprecated (PlatformName.TvOS, 12, 0, message: "Use 'Metal' instead.")]
[Deprecated (PlatformName.MacOSX, 10,14, message: "Use 'Metal' instead.")] [Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'Metal' instead.")]
[iOS (9,0)] [iOS (9, 0)]
[Mac (10,11)] [Mac (10, 11)]
#endif #endif
[StructLayout (LayoutKind.Sequential)] [StructLayout (LayoutKind.Sequential)]
public struct GLKVertexAttributeParameters { public struct GLKVertexAttributeParameters {

Просмотреть файл

@ -95,7 +95,7 @@ namespace GLKit {
using (var array = NSArray.FromNSObjects (urls)) using (var array = NSArray.FromNSObjects (urls))
return CubeMapFromFiles (array, textureOperations?.Dictionary, out error); return CubeMapFromFiles (array, textureOperations?.Dictionary, out error);
} }
public static GLKTextureInfo? CubeMapFromFile (string path, GLKTextureOperations? textureOperations, out NSError error) public static GLKTextureInfo? CubeMapFromFile (string path, GLKTextureOperations? textureOperations, out NSError error)
{ {
return CubeMapFromFile (path, textureOperations?.Dictionary, out error); return CubeMapFromFile (path, textureOperations?.Dictionary, out error);
@ -147,7 +147,7 @@ namespace GLKit {
{ {
BeginLoadCubeMap (filePath, textureOperations?.Dictionary, queue, onComplete); BeginLoadCubeMap (filePath, textureOperations?.Dictionary, queue, onComplete);
} }
} }
#if NET #if NET
@ -162,14 +162,14 @@ namespace GLKit {
[ObsoletedOSPlatform ("macos10.14", "Use 'Metal' instead.")] [ObsoletedOSPlatform ("macos10.14", "Use 'Metal' instead.")]
[ObsoletedOSPlatform ("ios12.0", "Use 'Metal' instead.")] [ObsoletedOSPlatform ("ios12.0", "Use 'Metal' instead.")]
#else #else
[Deprecated (PlatformName.iOS, 12,0, message: "Use 'Metal' instead.")] [Deprecated (PlatformName.iOS, 12, 0, message: "Use 'Metal' instead.")]
[Deprecated (PlatformName.TvOS, 12,0, message: "Use 'Metal' instead.")] [Deprecated (PlatformName.TvOS, 12, 0, message: "Use 'Metal' instead.")]
[Deprecated (PlatformName.MacOSX, 10,14, message: "Use 'Metal' instead.")] [Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'Metal' instead.")]
#endif #endif
public class GLKTextureOperations : DictionaryContainer { public class GLKTextureOperations : DictionaryContainer {
public GLKTextureOperations () : base (new NSMutableDictionary ()) {} public GLKTextureOperations () : base (new NSMutableDictionary ()) { }
public GLKTextureOperations (NSDictionary options) : base (options) {} public GLKTextureOperations (NSDictionary options) : base (options) { }
public bool? ApplyPremultiplication { public bool? ApplyPremultiplication {
get { get {
@ -219,7 +219,7 @@ namespace GLKit {
[ObsoletedOSPlatform ("macos10.14", "Use 'Metal' instead.")] [ObsoletedOSPlatform ("macos10.14", "Use 'Metal' instead.")]
[ObsoletedOSPlatform ("ios12.0", "Use 'Metal' instead.")] [ObsoletedOSPlatform ("ios12.0", "Use 'Metal' instead.")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
public bool? SRGB { public bool? SRGB {
get { get {

Просмотреть файл

@ -17,47 +17,43 @@ namespace GameController {
[Deprecated (PlatformName.iOS, 13, 0, message: "Use 'GCController.GetMicroGamepadController()' instead.")] [Deprecated (PlatformName.iOS, 13, 0, message: "Use 'GCController.GetMicroGamepadController()' instead.")]
[Deprecated (PlatformName.TvOS, 13, 0, message: "Use 'GCController.GetMicroGamepadController()' instead.")] [Deprecated (PlatformName.TvOS, 13, 0, message: "Use 'GCController.GetMicroGamepadController()' instead.")]
[Native] [Native]
public enum GCExtendedGamepadSnapshotDataVersion : long public enum GCExtendedGamepadSnapshotDataVersion : long {
{
Version1 = 0x0100, Version1 = 0x0100,
Version2 = 0x0101, Version2 = 0x0101,
} }
[Native] [Native]
public enum GCMicroGamepadSnapshotDataVersion : long public enum GCMicroGamepadSnapshotDataVersion : long {
{
Version1 = 0x0100, Version1 = 0x0100,
} }
[TV (14,0), Mac (11,0), iOS (14,0)] [TV (14, 0), Mac (11, 0), iOS (14, 0)]
[Native] [Native]
public enum GCTouchState : long public enum GCTouchState : long {
{
Up, Up,
Down, Down,
Moving, Moving,
} }
[TV (14,0), Mac (11,0), iOS (14,0)] [TV (14, 0), Mac (11, 0), iOS (14, 0)]
[Native] [Native]
public enum GCDeviceBatteryState : long public enum GCDeviceBatteryState : long {
{
Unknown = -1, Unknown = -1,
Discharging, Discharging,
Charging, Charging,
Full, Full,
} }
[TV (14,0), Mac (11,0), iOS (14,0)] [TV (14, 0), Mac (11, 0), iOS (14, 0)]
[Native] [Native]
public enum GCSystemGestureState : long public enum GCSystemGestureState : long {
{
Enabled = 0, Enabled = 0,
AlwaysReceive, AlwaysReceive,
Disabled, Disabled,
} }
[iOS (9,0)][Mac (10,11)] [iOS (9, 0)]
[Mac (10, 11)]
[Native] [Native]
public enum GCControllerPlayerIndex : long { public enum GCControllerPlayerIndex : long {
Unset = -1, Unset = -1,
@ -67,10 +63,9 @@ namespace GameController {
Index4, Index4,
} }
[iOS (16,0), Mac (13,0), NoWatch, TV (16,0), MacCatalyst (16,0)] [iOS (16, 0), Mac (13, 0), NoWatch, TV (16, 0), MacCatalyst (16, 0)]
[Native] [Native]
public enum GCDevicePhysicalInputElementChange : long public enum GCDevicePhysicalInputElementChange : long {
{
UnknownChange = -1, UnknownChange = -1,
NoChange = 0, NoChange = 0,
Changed = 1, Changed = 1,

Просмотреть файл

@ -30,8 +30,8 @@ namespace GameController {
[ObsoletedOSPlatform ("tvos12.2", "Use 'GCExtendedGamepadSnapshotData' instead.")] [ObsoletedOSPlatform ("tvos12.2", "Use 'GCExtendedGamepadSnapshotData' instead.")]
[ObsoletedOSPlatform ("ios12.2", "Use 'GCExtendedGamepadSnapshotData' instead.")] [ObsoletedOSPlatform ("ios12.2", "Use 'GCExtendedGamepadSnapshotData' instead.")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
[Mac (10,9)] [Mac (10, 9)]
[Deprecated (PlatformName.iOS, 12, 2, message: "Use 'GCExtendedGamepadSnapshotData' instead.")] [Deprecated (PlatformName.iOS, 12, 2, message: "Use 'GCExtendedGamepadSnapshotData' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 14, 4, message: "Use 'GCExtendedGamepadSnapshotData' instead.")] [Deprecated (PlatformName.MacOSX, 10, 14, 4, message: "Use 'GCExtendedGamepadSnapshotData' instead.")]
[Deprecated (PlatformName.TvOS, 12, 2, message: "Use 'GCExtendedGamepadSnapshotData' instead.")] [Deprecated (PlatformName.TvOS, 12, 2, message: "Use 'GCExtendedGamepadSnapshotData' instead.")]
@ -99,7 +99,7 @@ namespace GameController {
return p == IntPtr.Zero ? null : new NSData (p); return p == IntPtr.Zero ? null : new NSData (p);
} }
} }
#if NET #if NET
[UnsupportedOSPlatform ("macos10.15")] [UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")] [UnsupportedOSPlatform ("tvos13.0")]
@ -181,7 +181,7 @@ namespace GameController {
#endif #endif
[MarshalAs (UnmanagedType.I1)] [MarshalAs (UnmanagedType.I1)]
bool LeftThumbstickButton; bool LeftThumbstickButton;
#if NET #if NET
[SupportedOSPlatform ("tvos12.2")] [SupportedOSPlatform ("tvos12.2")]
[SupportedOSPlatform ("macos10.14.4")] [SupportedOSPlatform ("macos10.14.4")]
@ -245,14 +245,14 @@ namespace GameController {
} }
public partial class GCExtendedGamepadSnapshot { public partial class GCExtendedGamepadSnapshot {
// GCExtendedGamepadSnapshot.h // GCExtendedGamepadSnapshot.h
[DllImport (Constants.GameControllerLibrary)] [DllImport (Constants.GameControllerLibrary)]
[return: MarshalAs (UnmanagedType.I1)] [return: MarshalAs (UnmanagedType.I1)]
static extern bool GCExtendedGamepadSnapShotDataV100FromNSData ( static extern bool GCExtendedGamepadSnapShotDataV100FromNSData (
/* GCExtendedGamepadSnapShotDataV100 * __nullable */ out GCExtendedGamepadSnapShotDataV100 snapshotData, /* GCExtendedGamepadSnapShotDataV100 * __nullable */ out GCExtendedGamepadSnapShotDataV100 snapshotData,
/* NSData * __nullable */ IntPtr data); /* NSData * __nullable */ IntPtr data);
#if NET #if NET
[SupportedOSPlatform ("tvos12.2")] [SupportedOSPlatform ("tvos12.2")]
[SupportedOSPlatform ("macos10.14.4")] [SupportedOSPlatform ("macos10.14.4")]
@ -272,14 +272,14 @@ namespace GameController {
[DllImport (Constants.GameControllerLibrary)] [DllImport (Constants.GameControllerLibrary)]
[return: MarshalAs (UnmanagedType.I1)] [return: MarshalAs (UnmanagedType.I1)]
static extern bool GCExtendedGamepadSnapshotDataFromNSData ( static extern bool GCExtendedGamepadSnapshotDataFromNSData (
/* GCExtendedGamepadSnapshotData * __nullable */ out GCExtendedGamepadSnapshotData snapshotData, /* GCExtendedGamepadSnapshotData * __nullable */ out GCExtendedGamepadSnapshotData snapshotData,
/* NSData * __nullable */ IntPtr data); /* NSData * __nullable */ IntPtr data);
public static bool TryGetSnapShotData (NSData? data, out GCExtendedGamepadSnapShotDataV100 snapshotData) public static bool TryGetSnapShotData (NSData? data, out GCExtendedGamepadSnapShotDataV100 snapshotData)
{ {
return GCExtendedGamepadSnapShotDataV100FromNSData (out snapshotData, data.GetHandle ()); return GCExtendedGamepadSnapShotDataV100FromNSData (out snapshotData, data.GetHandle ());
} }
#if NET #if NET
[SupportedOSPlatform ("tvos12.2")] [SupportedOSPlatform ("tvos12.2")]
[SupportedOSPlatform ("macos10.14.4")] [SupportedOSPlatform ("macos10.14.4")]

Просмотреть файл

@ -32,8 +32,8 @@ namespace GameController {
[Deprecated (PlatformName.MacOSX, 10, 15, message: "Use 'GCExtendedGamepad' instead.")] [Deprecated (PlatformName.MacOSX, 10, 15, message: "Use 'GCExtendedGamepad' instead.")]
[Deprecated (PlatformName.iOS, 13, 0, message: "Use 'GCExtendedGamepad' instead.")] [Deprecated (PlatformName.iOS, 13, 0, message: "Use 'GCExtendedGamepad' instead.")]
[Deprecated (PlatformName.TvOS, 13, 0, message: "Use 'GCExtendedGamepad' instead.")] [Deprecated (PlatformName.TvOS, 13, 0, message: "Use 'GCExtendedGamepad' instead.")]
[iOS (7,0)] [iOS (7, 0)]
[Mac (10,9)] [Mac (10, 9)]
#endif #endif
[StructLayout (LayoutKind.Sequential, Pack = 1)] [StructLayout (LayoutKind.Sequential, Pack = 1)]
public struct GCGamepadSnapShotDataV100 { public struct GCGamepadSnapShotDataV100 {
@ -67,7 +67,7 @@ namespace GameController {
} }
public partial class GCGamepadSnapshot { public partial class GCGamepadSnapshot {
// GCGamepadSnapshot.h // GCGamepadSnapshot.h
[DllImport (Constants.GameControllerLibrary)] [DllImport (Constants.GameControllerLibrary)]
[return: MarshalAs (UnmanagedType.I1)] [return: MarshalAs (UnmanagedType.I1)]

Просмотреть файл

@ -26,8 +26,8 @@ namespace GameController {
[ObsoletedOSPlatform ("tvos12.2", "Use 'GCController.GetMicroGamepadController()' instead.")] [ObsoletedOSPlatform ("tvos12.2", "Use 'GCController.GetMicroGamepadController()' instead.")]
[ObsoletedOSPlatform ("ios12.2", "Use 'GCController.GetMicroGamepadController()' instead.")] [ObsoletedOSPlatform ("ios12.2", "Use 'GCController.GetMicroGamepadController()' instead.")]
#else #else
[iOS (10,0)] [iOS (10, 0)]
[Mac (10,12)] [Mac (10, 12)]
[Deprecated (PlatformName.iOS, 12, 2, message: "Use 'GCController.GetMicroGamepadController()' instead.")] [Deprecated (PlatformName.iOS, 12, 2, message: "Use 'GCController.GetMicroGamepadController()' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 14, 4, message: "Use 'GCController.GetMicroGamepadController()' instead.")] [Deprecated (PlatformName.MacOSX, 10, 14, 4, message: "Use 'GCController.GetMicroGamepadController()' instead.")]
[Deprecated (PlatformName.TvOS, 12, 2, message: "Use 'GCController.GetMicroGamepadController()' instead.")] [Deprecated (PlatformName.TvOS, 12, 2, message: "Use 'GCController.GetMicroGamepadController()' instead.")]
@ -195,7 +195,7 @@ namespace GameController {
{ {
return GCMicroGamepadSnapShotDataV100FromNSData (out snapshotData, data.GetHandle ()); return GCMicroGamepadSnapShotDataV100FromNSData (out snapshotData, data.GetHandle ());
} }
#if NET #if NET
[SupportedOSPlatform ("tvos12.2")] [SupportedOSPlatform ("tvos12.2")]
[SupportedOSPlatform ("macos10.14.4")] [SupportedOSPlatform ("macos10.14.4")]
@ -243,4 +243,4 @@ namespace GameController {
} }
} }
#endif #endif

Просмотреть файл

@ -14,9 +14,9 @@ namespace GameKit {
#if !XAMCORE_3_0 #if !XAMCORE_3_0
public partial class GKMatchRequest { public partial class GKMatchRequest {
#if !NET #if !NET
[iOS (8,0), Mac (10,10)] [iOS (8, 0), Mac (10, 10)]
[Obsolete ("Use 'RecipientResponseHandler' property.")] [Obsolete ("Use 'RecipientResponseHandler' property.")]
#else #else
[Obsolete ("Use 'RecipientResponseHandler' property.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] [Obsolete ("Use 'RecipientResponseHandler' property.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
@ -28,7 +28,7 @@ namespace GameKit {
} }
public partial class GKMatchmaker { public partial class GKMatchmaker {
[Obsolete ("Use 'InviteHandler' property.")] [Obsolete ("Use 'InviteHandler' property.")]
public virtual void SetInviteHandler (GKInviteHandler handler) public virtual void SetInviteHandler (GKInviteHandler handler)
{ {
@ -50,22 +50,22 @@ namespace GameKit {
public partial class GKGameSession { public partial class GKGameSession {
[Obsolete ("Empty stub (GKGameSessionEventListenerPrivate category members are not public API).")] [Obsolete ("Empty stub (GKGameSessionEventListenerPrivate category members are not public API).")]
public static void DidAddPlayer (GKGameSession session, GKCloudPlayer player) {} public static void DidAddPlayer (GKGameSession session, GKCloudPlayer player) { }
[Obsolete ("Empty stub (GKGameSessionEventListenerPrivate category members are not public API).")] [Obsolete ("Empty stub (GKGameSessionEventListenerPrivate category members are not public API).")]
public static void DidChangeConnectionState (GKGameSession session, GKCloudPlayer player, GKConnectionState newState) {} public static void DidChangeConnectionState (GKGameSession session, GKCloudPlayer player, GKConnectionState newState) { }
[Obsolete ("Empty stub (GKGameSessionEventListenerPrivate category members are not public API).")] [Obsolete ("Empty stub (GKGameSessionEventListenerPrivate category members are not public API).")]
public static void DidReceiveData (GKGameSession session, Foundation.NSData data, GKCloudPlayer player) {} public static void DidReceiveData (GKGameSession session, Foundation.NSData data, GKCloudPlayer player) { }
[Obsolete ("Empty stub (GKGameSessionEventListenerPrivate category members are not public API).")] [Obsolete ("Empty stub (GKGameSessionEventListenerPrivate category members are not public API).")]
public static void DidReceiveMessage (GKGameSession session, string message, Foundation.NSData data, GKCloudPlayer player) {} public static void DidReceiveMessage (GKGameSession session, string message, Foundation.NSData data, GKCloudPlayer player) { }
[Obsolete ("Empty stub (GKGameSessionEventListenerPrivate category members are not public API).")] [Obsolete ("Empty stub (GKGameSessionEventListenerPrivate category members are not public API).")]
public static void DidRemovePlayer (GKGameSession session, GKCloudPlayer player) {} public static void DidRemovePlayer (GKGameSession session, GKCloudPlayer player) { }
[Obsolete ("Empty stub (GKGameSessionEventListenerPrivate category members are not public API).")] [Obsolete ("Empty stub (GKGameSessionEventListenerPrivate category members are not public API).")]
public static void DidSaveData (GKGameSession session, GKCloudPlayer player, Foundation.NSData data) {} public static void DidSaveData (GKGameSession session, GKCloudPlayer player, Foundation.NSData data) { }
} }
#endif #endif

Просмотреть файл

@ -11,7 +11,7 @@ namespace GameKit {
// GKInviteEventListener and GKTurnBasedEventListener both export same selector // GKInviteEventListener and GKTurnBasedEventListener both export same selector
// but generator changes now catch this. Stub it out to prevent API break // but generator changes now catch this. Stub it out to prevent API break
[Obsolete ("Use 'DidRequestMatch (GKPlayer player, GKPlayer[] recipientPlayers)' instead.")] [Obsolete ("Use 'DidRequestMatch (GKPlayer player, GKPlayer[] recipientPlayers)' instead.")]
public virtual void DidRequestMatchWithPlayers (GKPlayer player, string[] playerIDsToInvite) public virtual void DidRequestMatchWithPlayers (GKPlayer player, string [] playerIDsToInvite)
{ {
} }
} }

Просмотреть файл

@ -36,7 +36,7 @@ namespace GameKit {
[Deprecated (PlatformName.iOS, 7, 0)] [Deprecated (PlatformName.iOS, 7, 0)]
[ErrorDomain ("GKVoiceChatServiceErrorDomain")] [ErrorDomain ("GKVoiceChatServiceErrorDomain")]
public enum GKVoiceChatServiceError { public enum GKVoiceChatServiceError {
Internal = 32000, Internal = 32000,
NoRemotePackets = 32001, NoRemotePackets = 32001,
UnableToConnect = 32002, UnableToConnect = 32002,
RemoteParticipantHangup = 32003, RemoteParticipantHangup = 32003,
@ -61,15 +61,15 @@ namespace GameKit {
public enum GKSendDataMode { public enum GKSendDataMode {
Reliable, Reliable,
Unreliable, Unreliable,
} }
// untyped enum -> GKPublicConstants.h // untyped enum -> GKPublicConstants.h
[Deprecated (PlatformName.iOS, 7, 0)] [Deprecated (PlatformName.iOS, 7, 0)]
[Deprecated (PlatformName.MacOSX, 10, 10)] [Deprecated (PlatformName.MacOSX, 10, 10)]
public enum GKSessionMode { public enum GKSessionMode {
Server, Server,
Client, Client,
Peer, Peer,
} }
// untyped enum -> GKPublicConstants.h // untyped enum -> GKPublicConstants.h
@ -78,7 +78,7 @@ namespace GameKit {
public enum GKPeerConnectionState { public enum GKPeerConnectionState {
Available, Available,
Unavailable, Unavailable,
Connected, Connected,
Disconnected, Disconnected,
Connecting, Connecting,
ConnectedRelay = 5, ConnectedRelay = 5,
@ -146,27 +146,27 @@ namespace GameKit {
FriendRequestNotAvailable = 103, FriendRequestNotAvailable = 103,
} }
[iOS (10,0)] [iOS (10, 0)]
[Mac (10,12)] [Mac (10, 12)]
[TV (10,0)] [TV (10, 0)]
[Native] [Native]
public enum GKConnectionState : long { public enum GKConnectionState : long {
NotConnected, NotConnected,
Connected, Connected,
} }
[iOS (10,0)] [iOS (10, 0)]
[Mac (10,12)] [Mac (10, 12)]
[TV (10,0)] [TV (10, 0)]
[Native] [Native]
public enum GKTransportType : long { public enum GKTransportType : long {
Unreliable, Unreliable,
Reliable, Reliable,
} }
[Deprecated (PlatformName.MacOSX, 10,14)] [Deprecated (PlatformName.MacOSX, 10, 14)]
[Deprecated (PlatformName.TvOS, 12,0)] [Deprecated (PlatformName.TvOS, 12, 0)]
[Deprecated (PlatformName.iOS, 12,0)] [Deprecated (PlatformName.iOS, 12, 0)]
[Native] [Native]
#if WATCH #if WATCH
// removed in Xcode 10 but a breaking change (for us) to remove // removed in Xcode 10 but a breaking change (for us) to remove
@ -244,9 +244,9 @@ namespace GameKit {
} }
// NSInteger -> GKChallenge.h // NSInteger -> GKChallenge.h
[Mac (10,9)] [Mac (10, 9)]
[Native] [Native]
public enum GKChallengeState : long { public enum GKChallengeState : long {
Invalid = 0, Invalid = 0,
Pending, Pending,
Completed, Completed,
@ -258,48 +258,45 @@ namespace GameKit {
[Native] [Native]
public enum GKGameCenterViewControllerState : long { public enum GKGameCenterViewControllerState : long {
Default = -1, Default = -1,
Leaderboards , Leaderboards,
Achievements, Achievements,
Challenges, Challenges,
[iOS (14,0)] [iOS (14, 0)]
[TV (14,0)] [TV (14, 0)]
LocalPlayerProfile = 3, LocalPlayerProfile = 3,
[iOS (14,0)] [iOS (14, 0)]
[TV (14,0)] [TV (14, 0)]
Dashboard = 4, Dashboard = 4,
[iOS (15,0)] [iOS (15, 0)]
[Mac (12,0)] [Mac (12, 0)]
[MacCatalyst (15,0)] [MacCatalyst (15, 0)]
[TV (15,0)] [TV (15, 0)]
[NoWatch] [NoWatch]
LocalPlayerFriendsList = 5, LocalPlayerFriendsList = 5,
} }
// NSInteger -> GKMatchmaker.h // NSInteger -> GKMatchmaker.h
[Native] [Native]
public enum GKInviteeResponse : long public enum GKInviteeResponse : long {
{ Accepted = 0,
Accepted = 0, Declined = 1,
Declined = 1, Failed = 2,
Failed = 2, Incompatible = 3,
Incompatible = 3, UnableToConnect = 4,
UnableToConnect = 4, NoAnswer = 5,
NoAnswer = 5,
} }
// NSUInteger -> GKMatchmaker.h // NSUInteger -> GKMatchmaker.h
[Native] [Native]
public enum GKMatchType : ulong public enum GKMatchType : ulong {
{
PeerToPeer, PeerToPeer,
Hosted, Hosted,
TurnBased TurnBased
} }
// uint8_t -> GKTurnBasedMatch.h // uint8_t -> GKTurnBasedMatch.h
[iOS (7,0)] [iOS (7, 0)]
public enum GKTurnBasedExchangeStatus : sbyte public enum GKTurnBasedExchangeStatus : sbyte {
{
Unknown, Unknown,
Active, Active,
Complete, Complete,
@ -318,9 +315,12 @@ namespace GameKit {
} }
#if !NET #if !NET
[iOS (11,3)][Deprecated (PlatformName.iOS, 14,0, message: "Do not use; this API was removed.")] [iOS (11, 3)]
[Mac (10,13,4)][Deprecated (PlatformName.MacOSX, 11,0, message: "Do not use; this API was removed.")] [Deprecated (PlatformName.iOS, 14, 0, message: "Do not use; this API was removed.")]
[TV (11,3)][Deprecated (PlatformName.TvOS, 14,0, message: "Do not use; this API was removed.")] [Mac (10, 13, 4)]
[Deprecated (PlatformName.MacOSX, 11, 0, message: "Do not use; this API was removed.")]
[TV (11, 3)]
[Deprecated (PlatformName.TvOS, 14, 0, message: "Do not use; this API was removed.")]
[Native] [Native]
public enum GKAuthenticationType : ulong { public enum GKAuthenticationType : ulong {
WithoutUI = 0, WithoutUI = 0,
@ -329,51 +329,48 @@ namespace GameKit {
} }
#endif #endif
[TV (14,0)] [TV (14, 0)]
[Mac (11,0)] [Mac (11, 0)]
[iOS (14,0)] [iOS (14, 0)]
[NoWatch] [NoWatch]
[Native] [Native]
public enum GKAccessPointLocation : long public enum GKAccessPointLocation : long {
{
TopLeading, TopLeading,
TopTrailing, TopTrailing,
BottomLeading, BottomLeading,
BottomTrailing, BottomTrailing,
} }
[TV (14,0)] [TV (14, 0)]
[Mac (11,0)] [Mac (11, 0)]
[iOS (14,0)] [iOS (14, 0)]
[Watch (7,0)] [Watch (7, 0)]
[Native] [Native]
public enum GKLeaderboardType : long public enum GKLeaderboardType : long {
{
Classic, Classic,
Recurring, Recurring,
} }
[TV (14,0)] [TV (14, 0)]
[Mac (11,0)] [Mac (11, 0)]
[iOS (14,0)] [iOS (14, 0)]
[NoWatch] [NoWatch]
[Native] [Native]
public enum GKMatchmakingMode : long public enum GKMatchmakingMode : long {
{
Default = 0, Default = 0,
NearbyOnly = 1, NearbyOnly = 1,
AutomatchOnly = 2, AutomatchOnly = 2,
[TV (15,0)] [TV (15, 0)]
[Mac (12,0)] [Mac (12, 0)]
[iOS (15,0)] [iOS (15, 0)]
[MacCatalyst (15,0)] [MacCatalyst (15, 0)]
InviteOnly = 3, InviteOnly = 3,
} }
[Watch (7,4)] [Watch (7, 4)]
[TV (14,5)] [TV (14, 5)]
[Mac (11,3)] [Mac (11, 3)]
[iOS (14,5)] [iOS (14, 5)]
[Native] [Native]
public enum GKFriendsAuthorizationStatus : long { public enum GKFriendsAuthorizationStatus : long {
NotDetermined = 0, NotDetermined = 0,

Просмотреть файл

@ -47,7 +47,7 @@ namespace GameKit {
if (receiver is not null) if (receiver is not null)
receiver (session, new GKDataReceivedEventArgs (data, peer, session)); receiver (session, new GKDataReceivedEventArgs (data, peer, session));
} }
} }
// //
@ -55,14 +55,14 @@ namespace GameKit {
ReceiverObject? receiver; ReceiverObject? receiver;
public event EventHandler<GKDataReceivedEventArgs>? ReceiveData { public event EventHandler<GKDataReceivedEventArgs>? ReceiveData {
add { add {
if (receiver is null){ if (receiver is null) {
receiver = new ReceiverObject (); receiver = new ReceiverObject ();
_SetDataReceiveHandler (receiver, IntPtr.Zero); _SetDataReceiveHandler (receiver, IntPtr.Zero);
MarkDirty (); MarkDirty ();
} }
receiver.receiver += value; receiver.receiver += value;
} }
remove { remove {
if (receiver is null) if (receiver is null)
return; return;
@ -82,9 +82,9 @@ namespace GameKit {
Mono_GKSessionDelegate EnsureDelegate () Mono_GKSessionDelegate EnsureDelegate ()
{ {
var del = WeakDelegate; var del = WeakDelegate;
if (del is null || (!(del is Mono_GKSessionDelegate))){ if (del is null || (!(del is Mono_GKSessionDelegate))) {
del = new Mono_GKSessionDelegate (); del = new Mono_GKSessionDelegate ();
WeakDelegate = del; WeakDelegate = del;
} }
return (Mono_GKSessionDelegate) del; return (Mono_GKSessionDelegate) del;
} }
@ -98,7 +98,7 @@ namespace GameKit {
EnsureDelegate ().cbPeerChanged -= value; EnsureDelegate ().cbPeerChanged -= value;
} }
} }
public event EventHandler<GKPeerConnectionEventArgs> ConnectionRequest { public event EventHandler<GKPeerConnectionEventArgs> ConnectionRequest {
add { add {
EnsureDelegate ().cbConnectionRequest += value; EnsureDelegate ().cbConnectionRequest += value;
@ -144,14 +144,14 @@ namespace GameKit {
if (cbPeerChanged is not null) if (cbPeerChanged is not null)
cbPeerChanged (session, new GKPeerChangedStateEventArgs (session, peerID, state)); cbPeerChanged (session, new GKPeerChangedStateEventArgs (session, peerID, state));
} }
[Preserve (Conditional = true)] [Preserve (Conditional = true)]
public override void PeerConnectionRequest (GKSession session, string peerID) public override void PeerConnectionRequest (GKSession session, string peerID)
{ {
if (cbConnectionRequest is not null) if (cbConnectionRequest is not null)
cbConnectionRequest (session, new GKPeerConnectionEventArgs (session, peerID, null)); cbConnectionRequest (session, new GKPeerConnectionEventArgs (session, peerID, null));
} }
[Preserve (Conditional = true)] [Preserve (Conditional = true)]
public override void PeerConnectionFailed (GKSession session, string peerID, NSError error) public override void PeerConnectionFailed (GKSession session, string peerID, NSError error)
{ {
@ -159,7 +159,7 @@ namespace GameKit {
cbConnectionFailed (session, new GKPeerConnectionEventArgs (session, peerID, error)); cbConnectionFailed (session, new GKPeerConnectionEventArgs (session, peerID, error));
} }
[Preserve (Conditional = true)] [Preserve (Conditional = true)]
public override void FailedWithError (GKSession session, NSError error) public override void FailedWithError (GKSession session, NSError error)
{ {

Просмотреть файл

@ -20,8 +20,8 @@ namespace GameplayKit {
return new GKQuadTree (min, max, minCellSize); return new GKQuadTree (min, max, minCellSize);
} }
[Deprecated (PlatformName.iOS, 10,0, message: "Empty stub (always return 'false') as this API is now rejected).")] [Deprecated (PlatformName.iOS, 10, 0, message: "Empty stub (always return 'false') as this API is now rejected).")]
[Deprecated (PlatformName.TvOS, 10,0, message: "Empty stub (always return 'false') as this API is now rejected).")] [Deprecated (PlatformName.TvOS, 10, 0, message: "Empty stub (always return 'false') as this API is now rejected).")]
public virtual bool RemoveData (NSObject data) public virtual bool RemoveData (NSObject data)
{ {
return false; return false;

Просмотреть файл

@ -15,13 +15,13 @@ using ObjCRuntime;
namespace GameplayKit { namespace GameplayKit {
public partial class GKComponentSystem<TComponent> { public partial class GKComponentSystem<TComponent> {
public GKComponentSystem () public GKComponentSystem ()
: this (GKState.GetClass (typeof (TComponent), "componentType")) : this (GKState.GetClass (typeof (TComponent), "componentType"))
{ {
} }
public Type? ComponentType { public Type? ComponentType {
get { return Class.Lookup (ComponentClass); } get { return Class.Lookup (ComponentClass); }
} }

Просмотреть файл

@ -19,7 +19,7 @@ using Vector2i = global::OpenTK.Vector2i;
namespace GameplayKit { namespace GameplayKit {
public partial class GKGridGraph { public partial class GKGridGraph {
#if !NET #if !NET
public virtual GKGridGraphNode? GetNodeAt (Vector2i position) public virtual GKGridGraphNode? GetNodeAt (Vector2i position)
{ {

Просмотреть файл

@ -36,9 +36,9 @@ namespace GameplayKit {
[SupportedOSPlatform ("macos10.12")] [SupportedOSPlatform ("macos10.12")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[iOS (10,0)] [iOS (10, 0)]
[TV (10,0)] [TV (10, 0)]
[Mac (10,12)] [Mac (10, 12)]
#endif #endif
[Register ("GKObstacleGraph", SkipRegistration = true)] [Register ("GKObstacleGraph", SkipRegistration = true)]
public partial class GKObstacleGraph<NodeType> : GKObstacleGraph where NodeType : GKGraphNode2D { public partial class GKObstacleGraph<NodeType> : GKObstacleGraph where NodeType : GKGraphNode2D {
@ -58,7 +58,7 @@ namespace GameplayKit {
public static new GKObstacleGraph<NodeType>? FromObstacles (GKPolygonObstacle [] obstacles, float bufferRadius) public static new GKObstacleGraph<NodeType>? FromObstacles (GKPolygonObstacle [] obstacles, float bufferRadius)
{ {
return Runtime.GetNSObject <GKObstacleGraph<NodeType>> (GraphWithObstacles (obstacles, bufferRadius, new Class (typeof (NodeType)))); return Runtime.GetNSObject<GKObstacleGraph<NodeType>> (GraphWithObstacles (obstacles, bufferRadius, new Class (typeof (NodeType))));
} }
public new NodeType [] GetNodes (GKPolygonObstacle obstacle) public new NodeType [] GetNodes (GKPolygonObstacle obstacle)

Просмотреть файл

@ -25,7 +25,7 @@ using System.Runtime.InteropServices;
namespace GameplayKit { namespace GameplayKit {
public partial class GKPath { public partial class GKPath {
public static GKPath FromPoints (Vector2[] points, float radius, bool cyclical) public static GKPath FromPoints (Vector2 [] points, float radius, bool cyclical)
{ {
if (points is null) if (points is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (points)); ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (points));
@ -34,7 +34,7 @@ namespace GameplayKit {
try { try {
PrepareBuffer (out buffer, ref points); PrepareBuffer (out buffer, ref points);
return FromPoints (buffer, (nuint)points.Length, radius, cyclical); return FromPoints (buffer, (nuint) points.Length, radius, cyclical);
} finally { } finally {
if (buffer != IntPtr.Zero) if (buffer != IntPtr.Zero)
Marshal.FreeHGlobal (buffer); Marshal.FreeHGlobal (buffer);
@ -46,12 +46,12 @@ namespace GameplayKit {
{ {
if (points is null) if (points is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (points)); ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (points));
var buffer = IntPtr.Zero; var buffer = IntPtr.Zero;
try { try {
PrepareBuffer (out buffer, ref points); PrepareBuffer (out buffer, ref points);
Handle = InitWithPoints (buffer, (nuint)points.Length, radius, cyclical); Handle = InitWithPoints (buffer, (nuint) points.Length, radius, cyclical);
} finally { } finally {
if (buffer != IntPtr.Zero) if (buffer != IntPtr.Zero)
Marshal.FreeHGlobal (buffer); Marshal.FreeHGlobal (buffer);
@ -64,9 +64,9 @@ namespace GameplayKit {
[SupportedOSPlatform ("macos10.12")] [SupportedOSPlatform ("macos10.12")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[iOS (10,0)] [iOS (10, 0)]
[TV (10,0)] [TV (10, 0)]
[Mac (10,12)] [Mac (10, 12)]
#endif #endif
public static GKPath FromPoints (Vector3 [] points, float radius, bool cyclical) public static GKPath FromPoints (Vector3 [] points, float radius, bool cyclical)
{ {
@ -78,8 +78,7 @@ namespace GameplayKit {
PrepareBuffer (out buffer, ref points); PrepareBuffer (out buffer, ref points);
return FromFloat3Points (buffer, (nuint) points.Length, radius, cyclical); return FromFloat3Points (buffer, (nuint) points.Length, radius, cyclical);
} } finally {
finally {
if (buffer != IntPtr.Zero) if (buffer != IntPtr.Zero)
Marshal.FreeHGlobal (buffer); Marshal.FreeHGlobal (buffer);
} }
@ -91,9 +90,9 @@ namespace GameplayKit {
[SupportedOSPlatform ("macos10.12")] [SupportedOSPlatform ("macos10.12")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[iOS (10,0)] [iOS (10, 0)]
[TV (10,0)] [TV (10, 0)]
[Mac (10,12)] [Mac (10, 12)]
#endif #endif
public GKPath (Vector3 [] points, float radius, bool cyclical) public GKPath (Vector3 [] points, float radius, bool cyclical)
{ {
@ -105,14 +104,13 @@ namespace GameplayKit {
PrepareBuffer (out buffer, ref points); PrepareBuffer (out buffer, ref points);
Handle = InitWithFloat3Points (buffer, (nuint) points.Length, radius, cyclical); Handle = InitWithFloat3Points (buffer, (nuint) points.Length, radius, cyclical);
} } finally {
finally {
if (buffer != IntPtr.Zero) if (buffer != IntPtr.Zero)
Marshal.FreeHGlobal (buffer); Marshal.FreeHGlobal (buffer);
} }
} }
static void PrepareBuffer<T> (out IntPtr buffer, ref T[] points) where T : struct static void PrepareBuffer<T> (out IntPtr buffer, ref T [] points) where T : struct
{ {
var type = typeof (T); var type = typeof (T);
// Vector3 is 12 bytes but vector_float3 is 16 // Vector3 is 12 bytes but vector_float3 is 16

Просмотреть файл

@ -26,16 +26,16 @@ namespace GameplayKit {
{ {
if (points is null) if (points is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (points)); ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (points));
var size = Marshal.SizeOf (typeof (Vector2)); var size = Marshal.SizeOf (typeof (Vector2));
var length = points.Length * size; var length = points.Length * size;
var buffer = Marshal.AllocHGlobal (length); var buffer = Marshal.AllocHGlobal (length);
try { try {
for (int i = 0; i < points.Length; i++) for (int i = 0; i < points.Length; i++)
Marshal.StructureToPtr (points[i], IntPtr.Add (buffer, i * size), false); Marshal.StructureToPtr (points [i], IntPtr.Add (buffer, i * size), false);
return FromPoints (buffer, (nuint)points.Length); return FromPoints (buffer, (nuint) points.Length);
} finally { } finally {
if (buffer != IntPtr.Zero) if (buffer != IntPtr.Zero)
Marshal.FreeHGlobal (buffer); Marshal.FreeHGlobal (buffer);
@ -45,7 +45,7 @@ namespace GameplayKit {
[ThreadStatic] [ThreadStatic]
static IntPtr ctor_pointer; static IntPtr ctor_pointer;
static unsafe IntPtr GetPointer (Vector2[] points) static unsafe IntPtr GetPointer (Vector2 [] points)
{ {
if (points is null) if (points is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (points)); ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (points));
@ -61,7 +61,7 @@ namespace GameplayKit {
var buffer = Marshal.AllocHGlobal (length); var buffer = Marshal.AllocHGlobal (length);
for (int i = 0; i < points.Length; i++) for (int i = 0; i < points.Length; i++)
Marshal.StructureToPtr (points[i], IntPtr.Add (buffer, i * size), false); Marshal.StructureToPtr (points [i], IntPtr.Add (buffer, i * size), false);
ctor_pointer = buffer; ctor_pointer = buffer;
return ctor_pointer = buffer; return ctor_pointer = buffer;

Просмотреть файл

@ -29,9 +29,9 @@ namespace GameplayKit {
[SupportedOSPlatform ("macos10.12")] [SupportedOSPlatform ("macos10.12")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[iOS (10,0)] [iOS (10, 0)]
[TV (10,0)] [TV (10, 0)]
[Mac (10,12)] [Mac (10, 12)]
#endif #endif
[StructLayout (LayoutKind.Sequential)] [StructLayout (LayoutKind.Sequential)]
public struct GKBox { public struct GKBox {
@ -45,9 +45,9 @@ namespace GameplayKit {
[SupportedOSPlatform ("macos10.12")] [SupportedOSPlatform ("macos10.12")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[iOS (10,0)] [iOS (10, 0)]
[TV (10,0)] [TV (10, 0)]
[Mac (10,12)] [Mac (10, 12)]
#endif #endif
[StructLayout (LayoutKind.Sequential)] [StructLayout (LayoutKind.Sequential)]
public struct GKQuad { public struct GKQuad {
@ -61,9 +61,9 @@ namespace GameplayKit {
[SupportedOSPlatform ("macos10.12")] [SupportedOSPlatform ("macos10.12")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[iOS (10,0)] [iOS (10, 0)]
[TV (10,0)] [TV (10, 0)]
[Mac (10,12)] [Mac (10, 12)]
#endif #endif
[StructLayout (LayoutKind.Sequential)] [StructLayout (LayoutKind.Sequential)]
public struct GKTriangle { public struct GKTriangle {

Просмотреть файл

@ -33,11 +33,11 @@ namespace GameplayKit {
{ {
if (instance is null) if (instance is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (parameterName)); ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (parameterName));
var klass = instance.Class; var klass = instance.Class;
if ((klass is null) || (klass.Handle == IntPtr.Zero)) if ((klass is null) || (klass.Handle == IntPtr.Zero))
throw new ArgumentException ("Not an type exposed to ObjC", parameterName); throw new ArgumentException ("Not an type exposed to ObjC", parameterName);
return klass; return klass;
} }

Просмотреть файл

@ -15,7 +15,7 @@ using ObjCRuntime;
namespace GameplayKit { namespace GameplayKit {
public partial class GKStateMachine : NSObject { public partial class GKStateMachine : NSObject {
public GKState? GetState (Type stateType) public GKState? GetState (Type stateType)
{ {
return GetState (GKState.GetClass (stateType, "stateType")); return GetState (GKState.GetClass (stateType, "stateType"));

Просмотреть файл

@ -21,9 +21,9 @@ namespace GameplayKit {
[SupportedOSPlatform ("macos10.12")] [SupportedOSPlatform ("macos10.12")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[iOS (10,0)] [iOS (10, 0)]
[TV (10,0)] [TV (10, 0)]
[Mac (10,12)] [Mac (10, 12)]
#endif #endif
public static class NSArray_GameplayKit { public static class NSArray_GameplayKit {

Просмотреть файл

@ -3,12 +3,11 @@ using ObjCRuntime;
using Foundation; using Foundation;
using System; using System;
namespace HealthKit namespace HealthKit {
{
// NSInteger -> HKDefines.h // NSInteger -> HKDefines.h
[Watch (2,0)] [Watch (2, 0)]
[iOS (8,0)] [iOS (8, 0)]
[Mac (13,0)] [Mac (13, 0)]
[Native] [Native]
public enum HKUpdateFrequency : long { public enum HKUpdateFrequency : long {
Immediate = 1, Immediate = 1,
@ -18,9 +17,9 @@ namespace HealthKit
} }
// NSInteger -> HKDefines.h // NSInteger -> HKDefines.h
[Watch (2,0)] [Watch (2, 0)]
[iOS (8,0)] [iOS (8, 0)]
[Mac (13,0)] [Mac (13, 0)]
[Native] [Native]
public enum HKAuthorizationStatus : long { public enum HKAuthorizationStatus : long {
NotDetermined = 0, NotDetermined = 0,
@ -29,22 +28,22 @@ namespace HealthKit
} }
// NSInteger -> HKDefines.h // NSInteger -> HKDefines.h
[Watch (2,0)] [Watch (2, 0)]
[iOS (8,0)] [iOS (8, 0)]
[Mac (13,0)] [Mac (13, 0)]
[Native] [Native]
public enum HKBiologicalSex : long { public enum HKBiologicalSex : long {
NotSet = 0, NotSet = 0,
Female, Female,
Male, Male,
[iOS (8,2)] [iOS (8, 2)]
Other Other
} }
// NSInteger -> HKDefines.h // NSInteger -> HKDefines.h
[Watch (2,0)] [Watch (2, 0)]
[iOS (8,0)] [iOS (8, 0)]
[Mac (13,0)] [Mac (13, 0)]
[Native] [Native]
public enum HKBloodType : long { public enum HKBloodType : long {
NotSet = 0, NotSet = 0,
@ -59,9 +58,9 @@ namespace HealthKit
} }
// NSInteger -> HKMetadata.h // NSInteger -> HKMetadata.h
[Watch (2,0)] [Watch (2, 0)]
[iOS (8,0)] [iOS (8, 0)]
[Mac (13,0)] [Mac (13, 0)]
[Native] [Native]
public enum HKBodyTemperatureSensorLocation : long { public enum HKBodyTemperatureSensorLocation : long {
Other = 0, Other = 0,
@ -79,9 +78,9 @@ namespace HealthKit
} }
// NSInteger -> HKMetadata.h // NSInteger -> HKMetadata.h
[Watch (2,0)] [Watch (2, 0)]
[iOS (8,0)] [iOS (8, 0)]
[Mac (13,0)] [Mac (13, 0)]
[Native] [Native]
public enum HKHeartRateSensorLocation : long { public enum HKHeartRateSensorLocation : long {
Other = 0, Other = 0,
@ -94,9 +93,9 @@ namespace HealthKit
} }
// NSInteger -> HKObjectType.h // NSInteger -> HKObjectType.h
[Watch (2,0)] [Watch (2, 0)]
[iOS (8,0)] [iOS (8, 0)]
[Mac (13,0)] [Mac (13, 0)]
[Native] [Native]
public enum HKQuantityAggregationStyle : long { public enum HKQuantityAggregationStyle : long {
Cumulative = 0, Cumulative = 0,
@ -112,58 +111,58 @@ namespace HealthKit
} }
// NSInteger -> HKObjectType.h // NSInteger -> HKObjectType.h
[Watch (2,0)] [Watch (2, 0)]
[iOS (8,0)] [iOS (8, 0)]
[Mac (13,0)] [Mac (13, 0)]
[Native] [Native]
public enum HKCategoryValueSleepAnalysis : long { public enum HKCategoryValueSleepAnalysis : long {
InBed, InBed,
Asleep, Asleep,
[Watch (3,0), iOS (10,0)] [Watch (3, 0), iOS (10, 0)]
Awake, Awake,
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV] [Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
AsleepCore = 3, AsleepCore = 3,
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV] [Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
AsleepDeep = 4, AsleepDeep = 4,
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV] [Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
AsleepREM = 5, AsleepREM = 5,
} }
// NSUInteger -> HKQuery.h // NSUInteger -> HKQuery.h
[Watch (2,0)] [Watch (2, 0)]
[iOS (8,0)] [iOS (8, 0)]
[Mac (13,0)] [Mac (13, 0)]
[Native] [Native]
[Flags] [Flags]
public enum HKQueryOptions : ulong { public enum HKQueryOptions : ulong {
None = 0, None = 0,
StrictStartDate = 1 << 0, StrictStartDate = 1 << 0,
StrictEndDate = 1 << 1 StrictEndDate = 1 << 1
} }
// NSUInteger -> HKStatistics.h // NSUInteger -> HKStatistics.h
[Watch (2,0)] [Watch (2, 0)]
[iOS (8,0)] [iOS (8, 0)]
[Mac (13,0)] [Mac (13, 0)]
[Native] [Native]
[Flags] [Flags]
public enum HKStatisticsOptions : ulong { public enum HKStatisticsOptions : ulong {
None = 0, None = 0,
SeparateBySource = 1 << 0, SeparateBySource = 1 << 0,
DiscreteAverage = 1 << 1, DiscreteAverage = 1 << 1,
DiscreteMin = 1 << 2, DiscreteMin = 1 << 2,
DiscreteMax = 1 << 3, DiscreteMax = 1 << 3,
CumulativeSum = 1 << 4, CumulativeSum = 1 << 4,
[iOS (13, 0), Watch (6, 0)] [iOS (13, 0), Watch (6, 0)]
MostRecent = 1 << 5, MostRecent = 1 << 5,
[iOS (13, 0), Watch (6, 0)] [iOS (13, 0), Watch (6, 0)]
Duration = 1 << 6, Duration = 1 << 6,
} }
// NSInteger -> HKUnit.h // NSInteger -> HKUnit.h
[Watch (2,0)] [Watch (2, 0)]
[iOS (8,0)] [iOS (8, 0)]
[Mac (13,0)] [Mac (13, 0)]
[Native] [Native]
public enum HKMetricPrefix : long { public enum HKMetricPrefix : long {
None = 0, None = 0,
@ -184,9 +183,9 @@ namespace HealthKit
} }
[Native] [Native]
[Watch (2,0)] [Watch (2, 0)]
[iOS (8,0)] [iOS (8, 0)]
[Mac (13,0)] [Mac (13, 0)]
public enum HKWorkoutActivityType : ulong { public enum HKWorkoutActivityType : ulong {
AmericanFootball = 1, AmericanFootball = 1,
Archery, Archery,
@ -249,35 +248,35 @@ namespace HealthKit
WaterSports, WaterSports,
Wrestling, Wrestling,
Yoga, Yoga,
[iOS (10,0), Watch (3,0)] [iOS (10, 0), Watch (3, 0)]
Barre, Barre,
[iOS (10,0), Watch (3,0)] [iOS (10, 0), Watch (3, 0)]
CoreTraining, CoreTraining,
[iOS (10,0), Watch (3,0)] [iOS (10, 0), Watch (3, 0)]
CrossCountrySkiing, CrossCountrySkiing,
[iOS (10,0), Watch (3,0)] [iOS (10, 0), Watch (3, 0)]
DownhillSkiing, DownhillSkiing,
[iOS (10,0), Watch (3,0)] [iOS (10, 0), Watch (3, 0)]
Flexibility, Flexibility,
[iOS (10,0), Watch (3,0)] [iOS (10, 0), Watch (3, 0)]
HighIntensityIntervalTraining, HighIntensityIntervalTraining,
[iOS (10,0), Watch (3,0)] [iOS (10, 0), Watch (3, 0)]
JumpRope, JumpRope,
[iOS (10,0), Watch (3,0)] [iOS (10, 0), Watch (3, 0)]
Kickboxing, Kickboxing,
[iOS (10,0), Watch (3,0)] [iOS (10, 0), Watch (3, 0)]
Pilates, Pilates,
[iOS (10,0), Watch (3,0)] [iOS (10, 0), Watch (3, 0)]
Snowboarding, Snowboarding,
[iOS (10,0), Watch (3,0)] [iOS (10, 0), Watch (3, 0)]
Stairs, Stairs,
[iOS (10,0), Watch (3,0)] [iOS (10, 0), Watch (3, 0)]
StepTraining, StepTraining,
[iOS (10,0), Watch (3,0)] [iOS (10, 0), Watch (3, 0)]
WheelchairWalkPace, WheelchairWalkPace,
[iOS (10,0), Watch (3,0)] [iOS (10, 0), Watch (3, 0)]
WheelchairRunPace, WheelchairRunPace,
[iOS (11,0), Watch (4,0)] [iOS (11, 0), Watch (4, 0)]
TaiChi, TaiChi,
[iOS (11, 0), Watch (4, 0)] [iOS (11, 0), Watch (4, 0)]
MixedCardio, MixedCardio,
@ -287,36 +286,40 @@ namespace HealthKit
DiscSports, DiscSports,
[iOS (13, 0), Watch (6, 0)] [iOS (13, 0), Watch (6, 0)]
FitnessGaming, FitnessGaming,
[iOS (14,0)][Watch (7,0)] [iOS (14, 0)]
[Watch (7, 0)]
CardioDance = 77, CardioDance = 77,
[iOS (14,0)][Watch (7,0)] [iOS (14, 0)]
[Watch (7, 0)]
SocialDance = 78, SocialDance = 78,
[iOS (14,0)][Watch (7,0)] [iOS (14, 0)]
[Watch (7, 0)]
Pickleball = 79, Pickleball = 79,
[iOS (14,0)][Watch (7,0)] [iOS (14, 0)]
[Watch (7, 0)]
Cooldown = 80, Cooldown = 80,
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV] [Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
SwimBikeRun = 82, SwimBikeRun = 82,
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV] [Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
Transition = 83, Transition = 83,
[iOS (8,2)] [iOS (8, 2)]
Other = 3000 Other = 3000
} }
[Native] [Native]
[Watch (2,0)] [Watch (2, 0)]
[iOS (8,0)] [iOS (8, 0)]
[Mac (13,0)] [Mac (13, 0)]
public enum HKWorkoutEventType : long { public enum HKWorkoutEventType : long {
Pause = 1, Pause = 1,
Resume, Resume,
[iOS (10,0), Watch (3,0)] [iOS (10, 0), Watch (3, 0)]
Lap, Lap,
[iOS (10,0), Watch (3,0)] [iOS (10, 0), Watch (3, 0)]
Marker, Marker,
[iOS (10,0), Watch (3,0)] [iOS (10, 0), Watch (3, 0)]
MotionPaused, MotionPaused,
[iOS (10,0), Watch (3,0)] [iOS (10, 0), Watch (3, 0)]
MotionResumed, MotionResumed,
[iOS (11, 0), Watch (4, 0)] [iOS (11, 0), Watch (4, 0)]
Segment, Segment,
@ -324,17 +327,17 @@ namespace HealthKit
PauseOrResumeRequest, PauseOrResumeRequest,
} }
[Watch (2,0)] [Watch (2, 0)]
[iOS (9,0)] [iOS (9, 0)]
[Mac (13,0)] [Mac (13, 0)]
[Native] [Native]
public enum HKCategoryValue : long { public enum HKCategoryValue : long {
NotApplicable = 0 NotApplicable = 0
} }
[Watch (2,0)] [Watch (2, 0)]
[iOS (9,0)] [iOS (9, 0)]
[Mac (13,0)] [Mac (13, 0)]
[Native] [Native]
public enum HKCategoryValueCervicalMucusQuality : long { public enum HKCategoryValueCervicalMucusQuality : long {
NotApplicable = 0, NotApplicable = 0,
@ -345,9 +348,9 @@ namespace HealthKit
EggWhite EggWhite
} }
[Watch (2,0)] [Watch (2, 0)]
[iOS (9,0)] [iOS (9, 0)]
[Mac (13,0)] [Mac (13, 0)]
[Native] [Native]
public enum HKCategoryValueMenstrualFlow : long { public enum HKCategoryValueMenstrualFlow : long {
NotApplicable = 0, NotApplicable = 0,
@ -355,13 +358,14 @@ namespace HealthKit
Light, Light,
Medium, Medium,
Heavy, Heavy,
[iOS (12,0)][Watch (5,0)] [iOS (12, 0)]
[Watch (5, 0)]
None, None,
} }
[Watch (2,0)] [Watch (2, 0)]
[iOS (9,0)] [iOS (9, 0)]
[Mac (13,0)] [Mac (13, 0)]
[Native] [Native]
public enum HKCategoryValueOvulationTestResult : long { public enum HKCategoryValueOvulationTestResult : long {
NotApplicable = 0, NotApplicable = 0,
@ -376,26 +380,26 @@ namespace HealthKit
EstrogenSurge = 4, EstrogenSurge = 4,
} }
[Watch (2,0)] [Watch (2, 0)]
[iOS (9,0)] [iOS (9, 0)]
[Mac (13,0)] [Mac (13, 0)]
[Native] [Native]
public enum HKCategoryValueAppleStandHour : long { public enum HKCategoryValueAppleStandHour : long {
Stood = 0, Stood = 0,
Idle Idle
} }
[iOS (13,0)] [iOS (13, 0)]
[Watch (6,0)] [Watch (6, 0)]
[Mac (13,0)] [Mac (13, 0)]
[Native] [Native]
public enum HKCategoryValueAudioExposureEvent : long { public enum HKCategoryValueAudioExposureEvent : long {
LoudEnvironment = 1, LoudEnvironment = 1,
} }
[Watch (2,0)] [Watch (2, 0)]
[iOS (9,0)] [iOS (9, 0)]
[Mac (13,0)] [Mac (13, 0)]
[Native] [Native]
public enum HKFitzpatrickSkinType : long { public enum HKFitzpatrickSkinType : long {
NotSet = 0, NotSet = 0,
@ -407,7 +411,7 @@ namespace HealthKit
VI VI
} }
[Watch (3,0), iOS (10,0), Mac (13,0)] [Watch (3, 0), iOS (10, 0), Mac (13, 0)]
[Native] [Native]
public enum HKWheelchairUse : long { public enum HKWheelchairUse : long {
NotSet = 0, NotSet = 0,
@ -415,7 +419,7 @@ namespace HealthKit
Yes, Yes,
} }
[Watch (3,0), iOS (10,0), Mac (13,0)] [Watch (3, 0), iOS (10, 0), Mac (13, 0)]
[Native] [Native]
public enum HKWeatherCondition : long { public enum HKWeatherCondition : long {
None = 0, None = 0,
@ -448,7 +452,7 @@ namespace HealthKit
Tornado, Tornado,
} }
[Watch (3,0), iOS (10,0), Mac (13,0)] [Watch (3, 0), iOS (10, 0), Mac (13, 0)]
[Native] [Native]
public enum HKWorkoutSwimmingLocationType : long { public enum HKWorkoutSwimmingLocationType : long {
Unknown = 0, Unknown = 0,
@ -456,7 +460,7 @@ namespace HealthKit
OpenWater, OpenWater,
} }
[Watch (3,0), iOS (10,0), Mac (13,0)] [Watch (3, 0), iOS (10, 0), Mac (13, 0)]
[Native] [Native]
public enum HKSwimmingStrokeStyle : long { public enum HKSwimmingStrokeStyle : long {
Unknown = 0, Unknown = 0,
@ -465,7 +469,7 @@ namespace HealthKit
Backstroke, Backstroke,
Breaststroke, Breaststroke,
Butterfly, Butterfly,
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV] [Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
Kickboard = 6, Kickboard = 6,
} }
@ -502,8 +506,8 @@ namespace HealthKit
PredictionSubMaxExercise, PredictionSubMaxExercise,
PredictionNonExercise, PredictionNonExercise,
} }
[NoWatch, iOS (12, 0), Mac (13,0)] [NoWatch, iOS (12, 0), Mac (13, 0)]
public enum HKFhirResourceType { public enum HKFhirResourceType {
[Field ("HKFHIRResourceTypeAllergyIntolerance")] [Field ("HKFHIRResourceTypeAllergyIntolerance")]
AllergyIntolerance, AllergyIntolerance,
@ -551,16 +555,15 @@ namespace HealthKit
CoverageRecord, CoverageRecord,
} }
[Watch (5,0), iOS (12,0), Mac (13,0)] [Watch (5, 0), iOS (12, 0), Mac (13, 0)]
[Native] [Native]
public enum HKAuthorizationRequestStatus : long public enum HKAuthorizationRequestStatus : long {
{
Unknown = 0, Unknown = 0,
ShouldRequest, ShouldRequest,
Unnecessary, Unnecessary,
} }
[Watch (7,0), iOS (13,6), Mac (13,0)] [Watch (7, 0), iOS (13, 6), Mac (13, 0)]
[Native] [Native]
public enum HKCategoryValueAppetiteChanges : long { public enum HKCategoryValueAppetiteChanges : long {
Unspecified = 0, Unspecified = 0,
@ -569,27 +572,27 @@ namespace HealthKit
Increased, Increased,
} }
[Watch (7,0), iOS (14,0), Mac (13,0)] [Watch (7, 0), iOS (14, 0), Mac (13, 0)]
[Native] [Native]
public enum HKAppleEcgAlgorithmVersion : long { public enum HKAppleEcgAlgorithmVersion : long {
Version1 = 1, Version1 = 1,
Version2 = 2, Version2 = 2,
} }
[Watch (7,0), iOS (14,0), Mac (13,0)] [Watch (7, 0), iOS (14, 0), Mac (13, 0)]
[Native] [Native]
public enum HKCategoryValueEnvironmentalAudioExposureEvent : long { public enum HKCategoryValueEnvironmentalAudioExposureEvent : long {
MomentaryLimit = 1, MomentaryLimit = 1,
} }
[Watch (7,0), iOS (13,6), Mac (13,0)] [Watch (7, 0), iOS (13, 6), Mac (13, 0)]
[Native] [Native]
public enum HKCategoryValuePresence : long { public enum HKCategoryValuePresence : long {
Present = 0, Present = 0,
NotPresent, NotPresent,
} }
[Watch (7,0), iOS (13,6), Mac (13,0)] [Watch (7, 0), iOS (13, 6), Mac (13, 0)]
[Native] [Native]
public enum HKCategoryValueSeverity : long { public enum HKCategoryValueSeverity : long {
Unspecified = 0, Unspecified = 0,
@ -599,7 +602,7 @@ namespace HealthKit
Severe, Severe,
} }
[Watch (7,0), iOS (14,0), Mac (13,0)] [Watch (7, 0), iOS (14, 0), Mac (13, 0)]
[Native] [Native]
public enum HKDevicePlacementSide : long { public enum HKDevicePlacementSide : long {
Unknown = 0, Unknown = 0,
@ -608,7 +611,7 @@ namespace HealthKit
Central, Central,
} }
[Watch (7,0), iOS (14,0), Mac (13,0)] [Watch (7, 0), iOS (14, 0), Mac (13, 0)]
[Native] [Native]
public enum HKElectrocardiogramClassification : long { public enum HKElectrocardiogramClassification : long {
NotSet = 0, NotSet = 0,
@ -621,13 +624,13 @@ namespace HealthKit
Unrecognized = 100, Unrecognized = 100,
} }
[Watch (7,0), iOS (14,0), Mac (13,0)] [Watch (7, 0), iOS (14, 0), Mac (13, 0)]
[Native] [Native]
public enum HKElectrocardiogramLead : long { public enum HKElectrocardiogramLead : long {
AppleWatchSimilarToLeadI = 1, AppleWatchSimilarToLeadI = 1,
} }
[Watch (7,0), iOS (14,0), Mac (13,0)] [Watch (7, 0), iOS (14, 0), Mac (13, 0)]
[Native] [Native]
public enum HKElectrocardiogramSymptomsStatus : long { public enum HKElectrocardiogramSymptomsStatus : long {
NotSet = 0, NotSet = 0,
@ -645,19 +648,17 @@ namespace HealthKit
Unknown, Unknown,
} }
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV] [Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
[Native] [Native]
public enum HKHeartRateRecoveryTestType : long public enum HKHeartRateRecoveryTestType : long {
{
MaxExercise = 1, MaxExercise = 1,
PredictionSubMaxExercise, PredictionSubMaxExercise,
PredictionNonExercise, PredictionNonExercise,
} }
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV] [Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
[Native] [Native]
public enum HKPrismBase : long public enum HKPrismBase : long {
{
None = 0, None = 0,
Up, Up,
Down, Down,
@ -665,27 +666,24 @@ namespace HealthKit
Out, Out,
} }
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV] [Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
[Native] [Native]
public enum HKUserMotionContext : long public enum HKUserMotionContext : long {
{
NotSet = 0, NotSet = 0,
Stationary, Stationary,
Active, Active,
} }
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV] [Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
[Native] [Native]
public enum HKVisionEye : long public enum HKVisionEye : long {
{
Left = 1, Left = 1,
Right, Right,
} }
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV] [Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
[Native] [Native]
public enum HKVisionPrescriptionType : ulong public enum HKVisionPrescriptionType : ulong {
{
Glasses = 1, Glasses = 1,
Contacts, Contacts,
} }

Просмотреть файл

@ -14,12 +14,11 @@ namespace HealthKit {
[SupportedOSPlatform ("maccatalyst15.0")] [SupportedOSPlatform ("maccatalyst15.0")]
[SupportedOSPlatform ("macos13.0")] [SupportedOSPlatform ("macos13.0")]
#else #else
[Watch (8,0)] [Watch (8, 0)]
[iOS (15,0)] [iOS (15, 0)]
[Mac (13,0)] [Mac (13, 0)]
#endif #endif
public static class HKAppleWalkingSteadiness public static class HKAppleWalkingSteadiness {
{
[DllImport (Constants.HealthKitLibrary)] [DllImport (Constants.HealthKitLibrary)]
[return: MarshalAs (UnmanagedType.I1)] [return: MarshalAs (UnmanagedType.I1)]
@ -33,10 +32,10 @@ namespace HealthKit {
error = null; error = null;
if (HKAppleWalkingSteadinessClassificationForQuantity (value.GetHandle (), out var classificationOut, out var errorPtr)) { if (HKAppleWalkingSteadinessClassificationForQuantity (value.GetHandle (), out var classificationOut, out var errorPtr)) {
classification = (HKAppleWalkingSteadinessClassification) (long) classificationOut; classification = (HKAppleWalkingSteadinessClassification) (long) classificationOut;
error = Runtime.GetNSObject<NSError> (errorPtr, false); error = Runtime.GetNSObject<NSError> (errorPtr, false);
return true; return true;
} }
return false; return false;
} }
@ -44,13 +43,13 @@ namespace HealthKit {
static extern HKQuantityRef HKAppleWalkingSteadinessMinimumQuantityForClassification (nint classification); static extern HKQuantityRef HKAppleWalkingSteadinessMinimumQuantityForClassification (nint classification);
public static HKQuantity? GetMinimumQuantity (HKAppleWalkingSteadinessClassification classification) public static HKQuantity? GetMinimumQuantity (HKAppleWalkingSteadinessClassification classification)
=> Runtime.GetNSObject<HKQuantity> (HKAppleWalkingSteadinessMinimumQuantityForClassification ((nint) (long) classification), false); => Runtime.GetNSObject<HKQuantity> (HKAppleWalkingSteadinessMinimumQuantityForClassification ((nint) (long) classification), false);
[DllImport (Constants.HealthKitLibrary)] [DllImport (Constants.HealthKitLibrary)]
static extern HKQuantityRef HKAppleWalkingSteadinessMaximumQuantityForClassification (nint classification); static extern HKQuantityRef HKAppleWalkingSteadinessMaximumQuantityForClassification (nint classification);
public static HKQuantity? GetMaximumQuantity (HKAppleWalkingSteadinessClassification classification) public static HKQuantity? GetMaximumQuantity (HKAppleWalkingSteadinessClassification classification)
=> Runtime.GetNSObject<HKQuantity> (HKAppleWalkingSteadinessMaximumQuantityForClassification ((nint) (long) classification), false); => Runtime.GetNSObject<HKQuantity> (HKAppleWalkingSteadinessMaximumQuantityForClassification ((nint) (long) classification), false);
} }
} }

Просмотреть файл

@ -23,8 +23,7 @@ using System.Collections.Generic;
using NativeHandle = System.IntPtr; using NativeHandle = System.IntPtr;
#endif #endif
namespace HealthKit namespace HealthKit {
{
public partial class HKCategoryValueSleepAnalysisAsleep { public partial class HKCategoryValueSleepAnalysisAsleep {
#if NET #if NET
@ -33,7 +32,7 @@ namespace HealthKit
[SupportedOSPlatform ("maccatalyst16.0")] [SupportedOSPlatform ("maccatalyst16.0")]
[UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("tvos")]
#else #else
[iOS (16,0), Mac (13,0), Watch (9,0), NoTV, MacCatalyst (16,0)] [iOS (16, 0), Mac (13, 0), Watch (9, 0), NoTV, MacCatalyst (16, 0)]
#endif // NET #endif // NET
[DllImport (Constants.HealthKitLibrary)] [DllImport (Constants.HealthKitLibrary)]
static extern NativeHandle HKCategoryValueSleepAnalysisAsleepValues (); static extern NativeHandle HKCategoryValueSleepAnalysisAsleepValues ();
@ -44,14 +43,14 @@ namespace HealthKit
[SupportedOSPlatform ("maccatalyst16.0")] [SupportedOSPlatform ("maccatalyst16.0")]
[UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("tvos")]
#else #else
[iOS (16,0), Mac (13,0), Watch (9,0), NoTV, MacCatalyst (16,0)] [iOS (16, 0), Mac (13, 0), Watch (9, 0), NoTV, MacCatalyst (16, 0)]
#endif // NET #endif // NET
public static HashSet<HKCategoryValueSleepAnalysis> GetAsleepValues () public static HashSet<HKCategoryValueSleepAnalysis> GetAsleepValues ()
{ {
using var values = Runtime.GetNSObject<NSSet<NSNumber>> (HKCategoryValueSleepAnalysisAsleepValues ())!; using var values = Runtime.GetNSObject<NSSet<NSNumber>> (HKCategoryValueSleepAnalysisAsleepValues ())!;
var hashSet = new HashSet<HKCategoryValueSleepAnalysis> (); var hashSet = new HashSet<HKCategoryValueSleepAnalysis> ();
foreach (NSNumber value in values) { foreach (NSNumber value in values) {
hashSet.Add ((HKCategoryValueSleepAnalysis) (int)value); hashSet.Add ((HKCategoryValueSleepAnalysis) (int) value);
} }
return hashSet; return hashSet;
} }

Просмотреть файл

@ -14,8 +14,7 @@
using System; using System;
using Foundation; using Foundation;
namespace HealthKit namespace HealthKit {
{
#pragma warning disable CS0618 // Type or member is obsolete #pragma warning disable CS0618 // Type or member is obsolete
public partial class HKQuantityType { public partial class HKQuantityType {
public static HKQuantityType? Create (HKQuantityTypeIdentifier kind) public static HKQuantityType? Create (HKQuantityTypeIdentifier kind)

Просмотреть файл

@ -6,7 +6,7 @@ namespace HealthKit {
#if !XAMCORE_3_0 #if !XAMCORE_3_0
public partial class HKStatisticsCollectionQuery { public partial class HKStatisticsCollectionQuery {
[Obsolete ("Use 'InitialResultsHandler'.")] [Obsolete ("Use 'InitialResultsHandler'.")]
public virtual void SetInitialResultsHandler (HKStatisticsCollectionQueryInitialResultsHandler handler) public virtual void SetInitialResultsHandler (HKStatisticsCollectionQueryInitialResultsHandler handler)
{ {

Просмотреть файл

@ -2,10 +2,8 @@
using System; using System;
namespace HealthKit namespace HealthKit {
{ public partial class HKUnit {
public partial class HKUnit
{
public const double MolarMassBloodGlucose = 180.15588000005408; public const double MolarMassBloodGlucose = 180.15588000005408;
} }
} }

Просмотреть файл

@ -13,7 +13,7 @@ namespace HomeKit {
[SupportedOSPlatform ("tvos10.0")] [SupportedOSPlatform ("tvos10.0")]
[SupportedOSPlatform ("maccatalyst14.0")] [SupportedOSPlatform ("maccatalyst14.0")]
#else #else
[iOS (9,0)] [iOS (9, 0)]
#endif #endif
public HMActionSetType ActionSetType { public HMActionSetType ActionSetType {
get { get {

Просмотреть файл

@ -6,21 +6,20 @@ using Foundation;
namespace HomeKit { namespace HomeKit {
partial class HMCharacteristic partial class HMCharacteristic {
{
public bool SupportsEventNotification { public bool SupportsEventNotification {
get { get {
foreach (var p in Properties){ foreach (var p in Properties) {
if (p == HMCharacteristicPropertyInternal.SupportsEventNotification) if (p == HMCharacteristicPropertyInternal.SupportsEventNotification)
return true; return true;
} }
return false; return false;
} }
} }
public bool Readable { public bool Readable {
get { get {
foreach (var p in Properties){ foreach (var p in Properties) {
if (p == HMCharacteristicPropertyInternal.Readable) if (p == HMCharacteristicPropertyInternal.Readable)
return true; return true;
} }
@ -30,7 +29,7 @@ namespace HomeKit {
public bool Writable { public bool Writable {
get { get {
foreach (var p in Properties){ foreach (var p in Properties) {
if (p == HMCharacteristicPropertyInternal.Writable) if (p == HMCharacteristicPropertyInternal.Writable)
return true; return true;
} }
@ -43,8 +42,8 @@ namespace HomeKit {
[SupportedOSPlatform ("tvos10.0")] [SupportedOSPlatform ("tvos10.0")]
[SupportedOSPlatform ("maccatalyst14.0")] [SupportedOSPlatform ("maccatalyst14.0")]
#else #else
[iOS (9,3)] [iOS (9, 3)]
[Watch (2,2)] [Watch (2, 2)]
#endif #endif
public bool Hidden { public bool Hidden {
get { get {

Просмотреть файл

@ -7,8 +7,7 @@ using Foundation;
namespace HomeKit { namespace HomeKit {
public partial class HMCharacteristicMetadata public partial class HMCharacteristicMetadata {
{
public HMCharacteristicMetadataUnits Units { public HMCharacteristicMetadataUnits Units {
get { get {
var u = _Units; var u = _Units;

Просмотреть файл

@ -12,8 +12,8 @@ namespace HomeKit {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos10.0")] [SupportedOSPlatform ("tvos10.0")]
#else #else
[iOS (8,0)] [iOS (8, 0)]
[TV (10,0)] [TV (10, 0)]
#endif #endif
public class HMCharacteristicProperties { public class HMCharacteristicProperties {

Просмотреть файл

@ -56,16 +56,16 @@ namespace HomeKit {
protected HMChipServiceTopology (IntPtr handle) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); protected HMChipServiceTopology (IntPtr handle) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public HMChipServiceTopology (NSCoder coder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public HMChipServiceTopology (NSCoder coder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
protected HMChipServiceTopology (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); protected HMChipServiceTopology (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public HMChipServiceTopology (HMChipServiceHome[] homes) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public HMChipServiceTopology (HMChipServiceHome [] homes) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual HMChipServiceHome[] Homes => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public virtual HMChipServiceHome [] Homes => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
} /* class HMChipServiceTopology */ } /* class HMChipServiceTopology */
[Obsolete ("This class is removed, use 'HMMatterRoom' instead.")] [Obsolete ("This class is removed, use 'HMMatterRoom' instead.")]
[Register("HMCHIPServiceRoom", SkipRegistration = true)] [Register ("HMCHIPServiceRoom", SkipRegistration = true)]
public class HMChipServiceRoom : NSObject, INSCoding, INSCopying, INSSecureCoding { public class HMChipServiceRoom : NSObject, INSCoding, INSCopying, INSSecureCoding {
public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
@ -75,7 +75,7 @@ namespace HomeKit {
protected HMChipServiceRoom (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); protected HMChipServiceRoom (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public HMChipServiceRoom (NSUuid uuid, string name) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public HMChipServiceRoom (NSUuid uuid, string name) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual NSObject Copy (NSZone? zone)=> throw new InvalidOperationException (Constants.RemovedFromHomeKit); public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual string Name => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public virtual string Name => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual NSUuid Uuid => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public virtual NSUuid Uuid => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
@ -83,7 +83,7 @@ namespace HomeKit {
} /* class HMChipServiceRoom */ } /* class HMChipServiceRoom */
[Obsolete ("This class is removed.")] [Obsolete ("This class is removed.")]
[Register("HMCHIPServiceHome", SkipRegistration = true)] [Register ("HMCHIPServiceHome", SkipRegistration = true)]
public partial class HMChipServiceHome : NSObject, INSCoding, INSCopying, INSSecureCoding { public partial class HMChipServiceHome : NSObject, INSCoding, INSCopying, INSSecureCoding {
public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
@ -112,7 +112,7 @@ namespace HomeKit {
[Obsolete (Constants.RemovedFromHomeKit)] [Obsolete (Constants.RemovedFromHomeKit)]
public virtual Task AddAndSetUpAccessoriesAsync (HMChipServiceTopology topology) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public virtual Task AddAndSetUpAccessoriesAsync (HMChipServiceTopology topology) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
#pragma warning restore CS0618 // HMChipServiceTopology and HMErrorHandler is obsolete #pragma warning restore CS0618 // HMChipServiceTopology and HMErrorHandler is obsolete
} }
#endif // !NET #endif // !NET
#if !XAMCORE_5_0 #if !XAMCORE_5_0
@ -157,7 +157,7 @@ namespace HomeKit {
public virtual string Name => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public virtual string Name => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual NSUuid Uuid => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public virtual NSUuid Uuid => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual NSObject Copy (NSZone? zone)=> throw new InvalidOperationException (Constants.RemovedFromHomeKit); public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
} }
@ -170,7 +170,7 @@ namespace HomeKit {
[UnsupportedOSPlatform ("maccatalyst16.1")] [UnsupportedOSPlatform ("maccatalyst16.1")]
[UnsupportedOSPlatform ("macos13.0")] [UnsupportedOSPlatform ("macos13.0")]
#endif #endif
[Register("HMMatterHome", SkipRegistration = true)] [Register ("HMMatterHome", SkipRegistration = true)]
public partial class HMMatterHome : NSObject, INSCoding, INSCopying, INSSecureCoding { public partial class HMMatterHome : NSObject, INSCoding, INSCopying, INSSecureCoding {
public override NativeHandle ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public override NativeHandle ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
@ -196,7 +196,7 @@ namespace HomeKit {
[UnsupportedOSPlatform ("maccatalyst16.1")] [UnsupportedOSPlatform ("maccatalyst16.1")]
[UnsupportedOSPlatform ("macos13.0")] [UnsupportedOSPlatform ("macos13.0")]
#endif #endif
[Register("HMMatterTopology", SkipRegistration = true)] [Register ("HMMatterTopology", SkipRegistration = true)]
public partial class HMMatterTopology : NSObject, INSCoding, INSCopying, INSSecureCoding { public partial class HMMatterTopology : NSObject, INSCoding, INSCopying, INSSecureCoding {
public override NativeHandle ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public override NativeHandle ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
@ -208,11 +208,11 @@ namespace HomeKit {
public HMMatterTopology (HMMatterHome [] homes) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public HMMatterTopology (HMMatterHome [] homes) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual HMMatterHome [] Homes => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public virtual HMMatterHome [] Homes => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual NSObject Copy (NSZone? zone)=> throw new InvalidOperationException (Constants.RemovedFromHomeKit); public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
} }
public delegate void HMFetchRoomHandler (HMMatterRoom [] rooms, NSError error); public delegate void HMFetchRoomHandler (HMMatterRoom [] rooms, NSError error);
#if !NET #if !NET
[Obsolete ("This class is removed.")] [Obsolete ("This class is removed.")]
@ -222,7 +222,7 @@ namespace HomeKit {
[UnsupportedOSPlatform ("maccatalyst16.1")] [UnsupportedOSPlatform ("maccatalyst16.1")]
[UnsupportedOSPlatform ("macos13.0")] [UnsupportedOSPlatform ("macos13.0")]
#endif #endif
[Register("HMMatterRequestHandler", SkipRegistration = true)] [Register ("HMMatterRequestHandler", SkipRegistration = true)]
public partial class HMMatterRequestHandler : NSObject, INSExtensionRequestHandling { public partial class HMMatterRequestHandler : NSObject, INSExtensionRequestHandling {
public override NativeHandle ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public override NativeHandle ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
@ -231,7 +231,7 @@ namespace HomeKit {
protected HMMatterRequestHandler (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); protected HMMatterRequestHandler (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void FetchRooms (HMMatterHome home, HMFetchRoomHandler completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public virtual void FetchRooms (HMMatterHome home, HMFetchRoomHandler completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual Task<HMMatterRoom[]> FetchRoomsAsync (HMMatterHome home) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public virtual Task<HMMatterRoom []> FetchRoomsAsync (HMMatterHome home) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void PairAccessory (HMMatterHome home, string onboardingPayload, Action<NSError> completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public virtual void PairAccessory (HMMatterHome home, string onboardingPayload, Action<NSError> completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual Task PairAccessoryAsync (HMMatterHome home, string onboardingPayload) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); public virtual Task PairAccessoryAsync (HMMatterHome home, string onboardingPayload) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -8,29 +8,28 @@ using Foundation;
namespace HomeKit { namespace HomeKit {
public partial class HMHome public partial class HMHome {
{
public HMService []? GetServices (HMServiceType serviceTypes) public HMService []? GetServices (HMServiceType serviceTypes)
{ {
var arr = new ServiceTypeList<NSString> (); var arr = new ServiceTypeList<NSString> ();
if ((serviceTypes & HMServiceType.LightBulb) == HMServiceType.LightBulb) if ((serviceTypes & HMServiceType.LightBulb) == HMServiceType.LightBulb)
arr.Add (HMServiceType.LightBulb.GetConstant ()); arr.Add (HMServiceType.LightBulb.GetConstant ());
if ((serviceTypes & HMServiceType.Switch) == HMServiceType.Switch) if ((serviceTypes & HMServiceType.Switch) == HMServiceType.Switch)
arr.Add (HMServiceType.Switch.GetConstant ()); arr.Add (HMServiceType.Switch.GetConstant ());
if ((serviceTypes & HMServiceType.Thermostat) == HMServiceType.Thermostat) if ((serviceTypes & HMServiceType.Thermostat) == HMServiceType.Thermostat)
arr.Add (HMServiceType.Thermostat.GetConstant ()); arr.Add (HMServiceType.Thermostat.GetConstant ());
if ((serviceTypes & HMServiceType.GarageDoorOpener) == HMServiceType.GarageDoorOpener) if ((serviceTypes & HMServiceType.GarageDoorOpener) == HMServiceType.GarageDoorOpener)
arr.Add (HMServiceType.GarageDoorOpener.GetConstant ()); arr.Add (HMServiceType.GarageDoorOpener.GetConstant ());
if ((serviceTypes & HMServiceType.AccessoryInformation) == HMServiceType.AccessoryInformation) if ((serviceTypes & HMServiceType.AccessoryInformation) == HMServiceType.AccessoryInformation)
arr.Add (HMServiceType.AccessoryInformation.GetConstant ()); arr.Add (HMServiceType.AccessoryInformation.GetConstant ());
if ((serviceTypes & HMServiceType.Fan) == HMServiceType.Fan) if ((serviceTypes & HMServiceType.Fan) == HMServiceType.Fan)
arr.Add (HMServiceType.Fan.GetConstant ()); arr.Add (HMServiceType.Fan.GetConstant ());
if ((serviceTypes & HMServiceType.Outlet) == HMServiceType.Outlet) if ((serviceTypes & HMServiceType.Outlet) == HMServiceType.Outlet)
arr.Add (HMServiceType.Outlet.GetConstant ()); arr.Add (HMServiceType.Outlet.GetConstant ());
if ((serviceTypes & HMServiceType.LockMechanism) == HMServiceType.LockMechanism) if ((serviceTypes & HMServiceType.LockMechanism) == HMServiceType.LockMechanism)
arr.Add (HMServiceType.LockMechanism.GetConstant ()); arr.Add (HMServiceType.LockMechanism.GetConstant ());
if ((serviceTypes & HMServiceType.LockManagement) == HMServiceType.LockManagement) if ((serviceTypes & HMServiceType.LockManagement) == HMServiceType.LockManagement)
arr.Add (HMServiceType.LockManagement.GetConstant ()); arr.Add (HMServiceType.LockManagement.GetConstant ());
// iOS 9 // iOS 9
if ((serviceTypes & HMServiceType.AirQualitySensor) == HMServiceType.AirQualitySensor) if ((serviceTypes & HMServiceType.AirQualitySensor) == HMServiceType.AirQualitySensor)
@ -96,8 +95,9 @@ namespace HomeKit {
#if (WATCH || TVOS) #if (WATCH || TVOS)
[Obsolete ("This API is not available on this platform.")] [Obsolete ("This API is not available on this platform.")]
#endif // WATCH || TVOS #endif // WATCH || TVOS
[Obsoleted (PlatformName.iOS, 9,0, PlatformArchitecture.All, message: "This API in now prohibited on iOS. Use 'ManageUsers' instead.")] [Obsoleted (PlatformName.iOS, 9, 0, PlatformArchitecture.All, message: "This API in now prohibited on iOS. Use 'ManageUsers' instead.")]
public virtual void RemoveUser (HMUser user, Action<NSError> completion) { public virtual void RemoveUser (HMUser user, Action<NSError> completion)
{
throw new NotSupportedException (); throw new NotSupportedException ();
} }
@ -106,8 +106,9 @@ namespace HomeKit {
#if (WATCH || TVOS) #if (WATCH || TVOS)
[Obsolete ("This API is not available on this platform.")] [Obsolete ("This API is not available on this platform.")]
#endif // WATCH || TVOS #endif // WATCH || TVOS
[Obsoleted (PlatformName.iOS, 9,0, PlatformArchitecture.All, message: "This API in now prohibited on iOS. Use 'ManageUsers' instead.")] [Obsoleted (PlatformName.iOS, 9, 0, PlatformArchitecture.All, message: "This API in now prohibited on iOS. Use 'ManageUsers' instead.")]
public virtual Task RemoveUserAsync (HMUser user) { public virtual Task RemoveUserAsync (HMUser user)
{
throw new NotSupportedException (); throw new NotSupportedException ();
} }
#endif #endif

Просмотреть файл

@ -36,5 +36,5 @@ namespace IOSurface {
CopybackInnerCache = 5 << 8, CopybackInnerCache = 5 << 8,
}; };
} }

Просмотреть файл

@ -38,7 +38,7 @@ namespace IOSurface {
public int Lock (IOSurfaceLockOptions options, ref int seed) public int Lock (IOSurfaceLockOptions options, ref int seed)
{ {
unsafe { unsafe {
fixed (int *p = &seed){ fixed (int* p = &seed) {
return _Lock (options, (IntPtr) p); return _Lock (options, (IntPtr) p);
} }
} }
@ -50,13 +50,13 @@ namespace IOSurface {
{ {
return _Lock (options, IntPtr.Zero); return _Lock (options, IntPtr.Zero);
} }
// kern_return_t // kern_return_t
// See bug #59201 [iOS (10,0)] // See bug #59201 [iOS (10,0)]
public int Unlock (IOSurfaceLockOptions options, ref int seed) public int Unlock (IOSurfaceLockOptions options, ref int seed)
{ {
unsafe { unsafe {
fixed (int *p = &seed){ fixed (int* p = &seed) {
return _Unlock (options, (IntPtr) p); return _Unlock (options, (IntPtr) p);
} }
} }
@ -74,7 +74,7 @@ namespace IOSurface {
public int SetPurgeable (IOSurfacePurgeabilityState newState, ref IOSurfacePurgeabilityState oldState) public int SetPurgeable (IOSurfacePurgeabilityState newState, ref IOSurfacePurgeabilityState oldState)
{ {
unsafe { unsafe {
fixed (IOSurfacePurgeabilityState *p = &oldState){ fixed (IOSurfacePurgeabilityState* p = &oldState) {
return _SetPurgeable (newState, (IntPtr) p); return _SetPurgeable (newState, (IntPtr) p);
} }
} }

Просмотреть файл

@ -40,7 +40,7 @@ namespace IOSurface {
#elif TVOS || IOS #elif TVOS || IOS
return SystemVersion.CheckiOS (12, 0); return SystemVersion.CheckiOS (12, 0);
#else #else
#error Unknown platform #error Unknown platform
#endif #endif
} }

Просмотреть файл

@ -275,15 +275,15 @@ namespace ImageCaptureCore {
} }
enum ICTransportType { enum ICTransportType {
[Field ("ICTransportTypeUSB")] [Field ("ICTransportTypeUSB")]
Usb, Usb,
[Field ("ICTransportTypeFireWire")] [Field ("ICTransportTypeFireWire")]
FireWire, FireWire,
[Field ("ICTransportTypeBluetooth")] [Field ("ICTransportTypeBluetooth")]
Bluetooth, Bluetooth,
[Field ("ICTransportTypeTCPIP")] [Field ("ICTransportTypeTCPIP")]
TcpIp, TcpIp,
[Field ("ICTransportTypeMassStorage")] [Field ("ICTransportTypeMassStorage")]
MassStorage, MassStorage,
} }
} }

Просмотреть файл

@ -16,8 +16,7 @@ using CoreGraphics;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
namespace ImageIO namespace ImageIO {
{
#if NET #if NET
[SupportedOSPlatform ("ios")] [SupportedOSPlatform ("ios")]
@ -25,10 +24,9 @@ namespace ImageIO
[SupportedOSPlatform ("macos")] [SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#endif #endif
public static class CGImageAnimation public static class CGImageAnimation {
{
public delegate void CGImageSourceAnimationHandler (nint index, CGImage image, out bool stop); public delegate void CGImageSourceAnimationHandler (nint index, CGImage image, out bool stop);
#if NET #if NET
[SupportedOSPlatform ("macos10.15")] [SupportedOSPlatform ("macos10.15")]
@ -36,13 +34,13 @@ namespace ImageIO
[SupportedOSPlatform ("tvos13.0")] [SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[Introduced (PlatformName.MacOSX, 10, 15, PlatformArchitecture.All)] [Introduced (PlatformName.MacOSX, 10, 15, PlatformArchitecture.All)]
[Introduced (PlatformName.iOS, 13, 0, PlatformArchitecture.All)] [Introduced (PlatformName.iOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.TvOS, 13, 0, PlatformArchitecture.All)] [Introduced (PlatformName.TvOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.WatchOS, 6, 0, PlatformArchitecture.All)] [Introduced (PlatformName.WatchOS, 6, 0, PlatformArchitecture.All)]
#endif #endif
[DllImport (Constants.ImageIOLibrary)] [DllImport (Constants.ImageIOLibrary)]
static extern /* OSStatus */ CGImageAnimationStatus CGAnimateImageAtURLWithBlock ( /* CFURLRef */ IntPtr url, /* CFDictionaryRef _iio_Nullable */ IntPtr options, /* CGImageSourceAnimationHandler */ ref BlockLiteral block); static extern /* OSStatus */ CGImageAnimationStatus CGAnimateImageAtURLWithBlock ( /* CFURLRef */ IntPtr url, /* CFDictionaryRef _iio_Nullable */ IntPtr options, /* CGImageSourceAnimationHandler */ ref BlockLiteral block);
#if NET #if NET
[SupportedOSPlatform ("macos10.15")] [SupportedOSPlatform ("macos10.15")]
@ -50,13 +48,13 @@ namespace ImageIO
[SupportedOSPlatform ("tvos13.0")] [SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[Introduced (PlatformName.MacOSX, 10, 15, PlatformArchitecture.All)] [Introduced (PlatformName.MacOSX, 10, 15, PlatformArchitecture.All)]
[Introduced (PlatformName.iOS, 13, 0, PlatformArchitecture.All)] [Introduced (PlatformName.iOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.TvOS, 13, 0, PlatformArchitecture.All)] [Introduced (PlatformName.TvOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.WatchOS, 6, 0, PlatformArchitecture.All)] [Introduced (PlatformName.WatchOS, 6, 0, PlatformArchitecture.All)]
#endif #endif
[DllImport (Constants.ImageIOLibrary)] [DllImport (Constants.ImageIOLibrary)]
static extern /* OSStatus */ CGImageAnimationStatus CGAnimateImageDataWithBlock ( /* CFDataRef _Nonnull */ IntPtr data, /* CFDictionaryRef _Nullable */ IntPtr options, /* CGImageSourceAnimationHandler _Nonnull */ ref BlockLiteral block); static extern /* OSStatus */ CGImageAnimationStatus CGAnimateImageDataWithBlock ( /* CFDataRef _Nonnull */ IntPtr data, /* CFDictionaryRef _Nullable */ IntPtr options, /* CGImageSourceAnimationHandler _Nonnull */ ref BlockLiteral block);
#if NET #if NET
[SupportedOSPlatform ("macos10.15")] [SupportedOSPlatform ("macos10.15")]
@ -64,32 +62,32 @@ namespace ImageIO
[SupportedOSPlatform ("tvos13.0")] [SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[Introduced (PlatformName.MacOSX, 10, 15, PlatformArchitecture.All)] [Introduced (PlatformName.MacOSX, 10, 15, PlatformArchitecture.All)]
[Introduced (PlatformName.iOS, 13, 0, PlatformArchitecture.All)] [Introduced (PlatformName.iOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.TvOS, 13, 0, PlatformArchitecture.All)] [Introduced (PlatformName.TvOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.WatchOS, 6, 0, PlatformArchitecture.All)] [Introduced (PlatformName.WatchOS, 6, 0, PlatformArchitecture.All)]
#endif #endif
[BindingImpl (BindingImplOptions.Optimizable)] [BindingImpl (BindingImplOptions.Optimizable)]
public static CGImageAnimationStatus AnimateImage (NSUrl url, CGImageAnimationOptions options, [BlockProxy (typeof (NIDCGImageSourceAnimationBlock))] CGImageSourceAnimationHandler handler) public static CGImageAnimationStatus AnimateImage (NSUrl url, CGImageAnimationOptions options, [BlockProxy (typeof (NIDCGImageSourceAnimationBlock))] CGImageSourceAnimationHandler handler)
{ {
#if IOS && ARCH_32 #if IOS && ARCH_32
throw new PlatformNotSupportedException ("This API is not supported on this version of iOS"); throw new PlatformNotSupportedException ("This API is not supported on this version of iOS");
#else #else
if (url is null) if (url is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (url)); ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (url));
if (handler is null) if (handler is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (handler)); ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (handler));
var block = new BlockLiteral (); var block = new BlockLiteral ();
block.SetupBlockUnsafe (SDCGImageSourceAnimationBlock.Handler, handler); block.SetupBlockUnsafe (SDCGImageSourceAnimationBlock.Handler, handler);
try { try {
return CGAnimateImageAtURLWithBlock (url.Handle, options.GetHandle (), ref block); return CGAnimateImageAtURLWithBlock (url.Handle, options.GetHandle (), ref block);
} finally { } finally {
block.CleanupBlock (); block.CleanupBlock ();
} }
#endif #endif
} }
#if NET #if NET
[SupportedOSPlatform ("macos10.15")] [SupportedOSPlatform ("macos10.15")]
@ -97,81 +95,79 @@ namespace ImageIO
[SupportedOSPlatform ("tvos13.0")] [SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[Introduced (PlatformName.MacOSX, 10, 15, PlatformArchitecture.All)] [Introduced (PlatformName.MacOSX, 10, 15, PlatformArchitecture.All)]
[Introduced (PlatformName.iOS, 13, 0, PlatformArchitecture.All)] [Introduced (PlatformName.iOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.TvOS, 13, 0, PlatformArchitecture.All)] [Introduced (PlatformName.TvOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.WatchOS, 6, 0, PlatformArchitecture.All)] [Introduced (PlatformName.WatchOS, 6, 0, PlatformArchitecture.All)]
#endif #endif
[BindingImpl (BindingImplOptions.Optimizable)] [BindingImpl (BindingImplOptions.Optimizable)]
public static CGImageAnimationStatus AnimateImage (NSData data, CGImageAnimationOptions options, [BlockProxy (typeof (NIDCGImageSourceAnimationBlock))] CGImageSourceAnimationHandler handler) public static CGImageAnimationStatus AnimateImage (NSData data, CGImageAnimationOptions options, [BlockProxy (typeof (NIDCGImageSourceAnimationBlock))] CGImageSourceAnimationHandler handler)
{ {
#if IOS && ARCH_32 #if IOS && ARCH_32
throw new PlatformNotSupportedException ("This API is not supported on this version of iOS"); throw new PlatformNotSupportedException ("This API is not supported on this version of iOS");
#else #else
if (data is null) if (data is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (data)); ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (data));
if (handler is null) if (handler is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (handler)); ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (handler));
var block = new BlockLiteral (); var block = new BlockLiteral ();
block.SetupBlockUnsafe (SDCGImageSourceAnimationBlock.Handler, handler); block.SetupBlockUnsafe (SDCGImageSourceAnimationBlock.Handler, handler);
try { try {
return CGAnimateImageDataWithBlock (data.Handle, options.GetHandle (), ref block); return CGAnimateImageDataWithBlock (data.Handle, options.GetHandle (), ref block);
} finally { } finally {
block.CleanupBlock (); block.CleanupBlock ();
} }
#endif #endif
} }
// //
// This class bridges native block invocations that call into C# // This class bridges native block invocations that call into C#
// //
static internal class SDCGImageSourceAnimationBlock static internal class SDCGImageSourceAnimationBlock {
{ static internal readonly DCGImageSourceAnimationBlock Handler = Invoke;
static internal readonly DCGImageSourceAnimationBlock Handler = Invoke;
[MonoPInvokeCallback (typeof (DCGImageSourceAnimationBlock))] [MonoPInvokeCallback (typeof (DCGImageSourceAnimationBlock))]
static void Invoke (IntPtr block, nint index, IntPtr image, [MarshalAs (UnmanagedType.I1)] out bool stop) static void Invoke (IntPtr block, nint index, IntPtr image, [MarshalAs (UnmanagedType.I1)] out bool stop)
{ {
var del = BlockLiteral.GetTarget<CGImageSourceAnimationHandler> (block); var del = BlockLiteral.GetTarget<CGImageSourceAnimationHandler> (block);
if (del is not null) if (del is not null)
del (index, new CoreGraphics.CGImage (image, false), out stop); del (index, new CoreGraphics.CGImage (image, false), out stop);
else else
stop = false; stop = false;
} }
} /* class SDCGImageSourceAnimationBlock */ } /* class SDCGImageSourceAnimationBlock */
internal sealed class NIDCGImageSourceAnimationBlock : TrampolineBlockBase internal sealed class NIDCGImageSourceAnimationBlock : TrampolineBlockBase {
{ DCGImageSourceAnimationBlock invoker;
DCGImageSourceAnimationBlock invoker;
[BindingImpl (BindingImplOptions.Optimizable)] [BindingImpl (BindingImplOptions.Optimizable)]
public unsafe NIDCGImageSourceAnimationBlock (BlockLiteral * block) : base (block) public unsafe NIDCGImageSourceAnimationBlock (BlockLiteral* block) : base (block)
{ {
invoker = block->GetDelegateForBlock<DCGImageSourceAnimationBlock> (); invoker = block->GetDelegateForBlock<DCGImageSourceAnimationBlock> ();
} }
[Preserve (Conditional = true)] [Preserve (Conditional = true)]
[BindingImpl (BindingImplOptions.Optimizable)] [BindingImpl (BindingImplOptions.Optimizable)]
public unsafe static CGImageSourceAnimationHandler? Create (IntPtr block) public unsafe static CGImageSourceAnimationHandler? Create (IntPtr block)
{ {
if (block == IntPtr.Zero) if (block == IntPtr.Zero)
return null; return null;
var del = (CGImageSourceAnimationHandler) GetExistingManagedDelegate (block); var del = (CGImageSourceAnimationHandler) GetExistingManagedDelegate (block);
return del ?? new NIDCGImageSourceAnimationBlock ( (BlockLiteral *) block).Invoke; return del ?? new NIDCGImageSourceAnimationBlock ((BlockLiteral*) block).Invoke;
} }
[BindingImpl (BindingImplOptions.Optimizable)] [BindingImpl (BindingImplOptions.Optimizable)]
void Invoke (nint index, CGImage image, out bool stop) void Invoke (nint index, CGImage image, out bool stop)
{ {
invoker (BlockPointer, index, image.GetHandle (), out stop); invoker (BlockPointer, index, image.GetHandle (), out stop);
} }
} /* class NIDCGImageSourceAnimationBlock */ } /* class NIDCGImageSourceAnimationBlock */
[UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)] [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
[UserDelegateType (typeof (CGImageSourceAnimationHandler))] [UserDelegateType (typeof (CGImageSourceAnimationHandler))]
internal delegate void DCGImageSourceAnimationBlock (IntPtr block, nint index, IntPtr imageHandle, [MarshalAs (UnmanagedType.I1)] out bool stop); internal delegate void DCGImageSourceAnimationBlock (IntPtr block, nint index, IntPtr imageHandle, [MarshalAs (UnmanagedType.I1)] out bool stop);
} }
} }

Просмотреть файл

@ -41,8 +41,7 @@ using NativeHandle = System.IntPtr;
namespace ImageIO { namespace ImageIO {
public partial class CGImageDestinationOptions public partial class CGImageDestinationOptions {
{
CGColor? destinationBackgroundColor; CGColor? destinationBackgroundColor;
public CGColor? DestinationBackgroundColor { public CGColor? DestinationBackgroundColor {
get { return destinationBackgroundColor; } get { return destinationBackgroundColor; }
@ -58,15 +57,14 @@ namespace ImageIO {
} }
} }
public partial class CGCopyImageSourceOptions public partial class CGCopyImageSourceOptions {
{
#if NET #if NET
[SupportedOSPlatform ("ios7.0")] [SupportedOSPlatform ("ios7.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("macos")] [SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
public CGImageMetadata? Metadata { get; set; } public CGImageMetadata? Metadata { get; set; }
@ -76,7 +74,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")] [SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
public bool MergeMetadata { get; set; } public bool MergeMetadata { get; set; }
@ -86,7 +84,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")] [SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
public bool ShouldExcludeXMP { get; set; } public bool ShouldExcludeXMP { get; set; }
@ -107,7 +105,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")] [SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
public DateTime? DateTime { get; set; } public DateTime? DateTime { get; set; }
@ -117,7 +115,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")] [SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
public int? Orientation { get; set; } public int? Orientation { get; set; }
@ -147,7 +145,7 @@ namespace ImageIO {
using (var n = new NSNumber (Orientation.Value)) using (var n = new NSNumber (Orientation.Value))
dict.LowlevelSetObject (n.Handle, kOrientation); dict.LowlevelSetObject (n.Handle, kOrientation);
} }
return dict; return dict;
} }
} }
@ -178,15 +176,15 @@ namespace ImageIO {
} }
#endif #endif
[Preserve (Conditional=true)] [Preserve (Conditional = true)]
internal CGImageDestination (NativeHandle handle, bool owns) internal CGImageDestination (NativeHandle handle, bool owns)
: base (handle, owns) : base (handle, owns)
{ {
} }
[DllImport (Constants.ImageIOLibrary, EntryPoint="CGImageDestinationGetTypeID")] [DllImport (Constants.ImageIOLibrary, EntryPoint = "CGImageDestinationGetTypeID")]
public extern static /* CFTypeID */ nint GetTypeID (); public extern static /* CFTypeID */ nint GetTypeID ();
[DllImport (Constants.ImageIOLibrary)] [DllImport (Constants.ImageIOLibrary)]
extern static /* CFArrayRef __nonnull */ IntPtr CGImageDestinationCopyTypeIdentifiers (); extern static /* CFArrayRef __nonnull */ IntPtr CGImageDestinationCopyTypeIdentifiers ();
@ -221,7 +219,7 @@ namespace ImageIO {
[DllImport (Constants.ImageIOLibrary)] [DllImport (Constants.ImageIOLibrary)]
extern static /* CGImageDestinationRef __nullable */ IntPtr CGImageDestinationCreateWithData ( extern static /* CGImageDestinationRef __nullable */ IntPtr CGImageDestinationCreateWithData (
/* CFMutableDataRef __nonnull */ IntPtr data, /* CFStringRef __nonnull */ IntPtr stringType, /* CFMutableDataRef __nonnull */ IntPtr data, /* CFStringRef __nonnull */ IntPtr stringType,
/* size_t */ nint count, /* CFDictionaryRef __nullable */ IntPtr options); /* size_t */ nint count, /* CFDictionaryRef __nullable */ IntPtr options);
public static CGImageDestination? Create (NSMutableData data, string typeIdentifier, int imageCount, CGImageDestinationOptions? options = null) public static CGImageDestination? Create (NSMutableData data, string typeIdentifier, int imageCount, CGImageDestinationOptions? options = null)
@ -289,13 +287,13 @@ namespace ImageIO {
{ {
if (image is null) if (image is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (image)); ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (image));
CGImageDestinationAddImage (Handle, image.Handle, properties.GetHandle ()); CGImageDestinationAddImage (Handle, image.Handle, properties.GetHandle ());
} }
[DllImport (Constants.ImageIOLibrary)] [DllImport (Constants.ImageIOLibrary)]
extern static void CGImageDestinationAddImageFromSource (/* CGImageDestinationRef __nonnull */ IntPtr idst, extern static void CGImageDestinationAddImageFromSource (/* CGImageDestinationRef __nonnull */ IntPtr idst,
/* CGImageSourceRef __nonnull */ IntPtr sourceHandle, /* size_t */ nint index, /* CGImageSourceRef __nonnull */ IntPtr sourceHandle, /* size_t */ nint index,
/* CFDictionaryRef __nullable */ IntPtr properties); /* CFDictionaryRef __nullable */ IntPtr properties);
public void AddImage (CGImageSource source, int index, CGImageDestinationOptions? options = null) public void AddImage (CGImageSource source, int index, CGImageDestinationOptions? options = null)
@ -311,7 +309,7 @@ namespace ImageIO {
{ {
if (source is null) if (source is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (source)); ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (source));
CGImageDestinationAddImageFromSource (Handle, source.Handle, index, properties.GetHandle ()); CGImageDestinationAddImageFromSource (Handle, source.Handle, index, properties.GetHandle ());
} }
@ -332,7 +330,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")] [SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
[DllImport (Constants.ImageIOLibrary)] [DllImport (Constants.ImageIOLibrary)]
extern static void CGImageDestinationAddImageAndMetadata (/* CGImageDestinationRef __nonnull */ IntPtr idst, extern static void CGImageDestinationAddImageAndMetadata (/* CGImageDestinationRef __nonnull */ IntPtr idst,
@ -345,7 +343,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")] [SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
[EditorBrowsable (EditorBrowsableState.Advanced)] [EditorBrowsable (EditorBrowsableState.Advanced)]
public void AddImageAndMetadata (CGImage image, CGImageMetadata meta, NSDictionary? options) public void AddImageAndMetadata (CGImage image, CGImageMetadata meta, NSDictionary? options)
@ -361,7 +359,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")] [SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
public void AddImageAndMetadata (CGImage image, CGImageMetadata meta, CGImageDestinationOptions? options) public void AddImageAndMetadata (CGImage image, CGImageMetadata meta, CGImageDestinationOptions? options)
{ {
@ -375,7 +373,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")] [SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
[DllImport (Constants.ImageIOLibrary)] [DllImport (Constants.ImageIOLibrary)]
[return: MarshalAs (UnmanagedType.I1)] [return: MarshalAs (UnmanagedType.I1)]
@ -389,7 +387,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")] [SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
[EditorBrowsable (EditorBrowsableState.Advanced)] [EditorBrowsable (EditorBrowsableState.Advanced)]
public bool CopyImageSource (CGImageSource image, NSDictionary? options, out NSError? error) public bool CopyImageSource (CGImageSource image, NSDictionary? options, out NSError? error)
@ -407,7 +405,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")] [SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
public bool CopyImageSource (CGImageSource image, CGCopyImageSourceOptions? options, out NSError? error) public bool CopyImageSource (CGImageSource image, CGCopyImageSourceOptions? options, out NSError? error)
{ {

Просмотреть файл

@ -28,7 +28,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")] [SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
public partial class CGImageMetadataEnumerateOptions { public partial class CGImageMetadataEnumerateOptions {
@ -55,7 +55,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")] [SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
public partial class CGImageMetadata : NativeObject { public partial class CGImageMetadata : NativeObject {
#if !NET #if !NET
@ -80,7 +80,7 @@ namespace ImageIO {
{ {
} }
[DllImport (Constants.ImageIOLibrary, EntryPoint="CGImageMetadataGetTypeID")] [DllImport (Constants.ImageIOLibrary, EntryPoint = "CGImageMetadataGetTypeID")]
public extern static /* CFTypeID */ nint GetTypeID (); public extern static /* CFTypeID */ nint GetTypeID ();

Просмотреть файл

@ -29,7 +29,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")] [SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
public class CGImageMetadataTag : NativeObject { public class CGImageMetadataTag : NativeObject {
@ -46,7 +46,7 @@ namespace ImageIO {
} }
#endif #endif
[Preserve (Conditional=true)] [Preserve (Conditional = true)]
internal CGImageMetadataTag (NativeHandle handle, bool owns) internal CGImageMetadataTag (NativeHandle handle, bool owns)
: base (handle, owns) : base (handle, owns)
{ {
@ -83,7 +83,7 @@ namespace ImageIO {
InitializeHandle (CGImageMetadataTagCreate (xmlns.Handle, prefix.GetHandle (), name.Handle, type, value)); InitializeHandle (CGImageMetadataTagCreate (xmlns.Handle, prefix.GetHandle (), name.Handle, type, value));
} }
[DllImport (Constants.ImageIOLibrary, EntryPoint="CGImageMetadataTagGetTypeID")] [DllImport (Constants.ImageIOLibrary, EntryPoint = "CGImageMetadataTagGetTypeID")]
public extern static nint GetTypeID (); public extern static nint GetTypeID ();
@ -141,7 +141,7 @@ namespace ImageIO {
extern static /* CFArrayRef __nullable */ IntPtr CGImageMetadataTagCopyQualifiers ( extern static /* CFArrayRef __nullable */ IntPtr CGImageMetadataTagCopyQualifiers (
/* CGImageMetadataTagRef __nonnull */ IntPtr tag); /* CGImageMetadataTagRef __nonnull */ IntPtr tag);
public CGImageMetadataTag?[]? GetQualifiers () public CGImageMetadataTag? []? GetQualifiers ()
{ {
IntPtr result = CGImageMetadataTagCopyQualifiers (Handle); IntPtr result = CGImageMetadataTagCopyQualifiers (Handle);
return CFArray.ArrayFromHandle<CGImageMetadataTag> (result, true); return CFArray.ArrayFromHandle<CGImageMetadataTag> (result, true);

Просмотреть файл

@ -46,21 +46,21 @@ namespace ImageIO {
#if !COREBUILD #if !COREBUILD
// untyped enum -> CGImageSource.h // untyped enum -> CGImageSource.h
public enum CGImageSourceStatus { public enum CGImageSourceStatus {
Complete = 0, Complete = 0,
Incomplete = -1, Incomplete = -1,
ReadingHeader = -2, ReadingHeader = -2,
UnknownType = -3, UnknownType = -3,
InvalidData = -4, InvalidData = -4,
UnexpectedEOF = -5, UnexpectedEOF = -5,
} }
public partial class CGImageOptions { public partial class CGImageOptions {
public CGImageOptions () public CGImageOptions ()
{ {
ShouldCache = true; ShouldCache = true;
} }
public string? BestGuessTypeIdentifier { get; set; } public string? BestGuessTypeIdentifier { get; set; }
public bool ShouldCache { get; set; } public bool ShouldCache { get; set; }
@ -71,17 +71,17 @@ namespace ImageIO {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
[Mac (10,9)] [Mac (10, 9)]
#endif #endif
public bool ShouldCacheImmediately { get; set; } public bool ShouldCacheImmediately { get; set; }
public bool ShouldAllowFloat { get; set; } public bool ShouldAllowFloat { get; set; }
internal virtual NSMutableDictionary ToDictionary () internal virtual NSMutableDictionary ToDictionary ()
{ {
var dict = new NSMutableDictionary (); var dict = new NSMutableDictionary ();
if (BestGuessTypeIdentifier is not null) if (BestGuessTypeIdentifier is not null)
dict.LowlevelSetObject (BestGuessTypeIdentifier, kTypeIdentifierHint); dict.LowlevelSetObject (BestGuessTypeIdentifier, kTypeIdentifierHint);
if (!ShouldCache) if (!ShouldCache)
@ -108,8 +108,8 @@ namespace ImageIO {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (9,0)] [iOS (9, 0)]
[Mac (10,11)] [Mac (10, 11)]
#endif #endif
public int? SubsampleFactor { get; set; } public int? SubsampleFactor { get; set; }
@ -128,16 +128,15 @@ namespace ImageIO {
dict.LowlevelSetObject (thandle, kCreateThumbnailWithTransform); dict.LowlevelSetObject (thandle, kCreateThumbnailWithTransform);
if (SubsampleFactor.HasValue) if (SubsampleFactor.HasValue)
dict.LowlevelSetObject (new NSNumber (SubsampleFactor.Value), kCGImageSourceSubsampleFactor); dict.LowlevelSetObject (new NSNumber (SubsampleFactor.Value), kCGImageSourceSubsampleFactor);
return dict; return dict;
} }
} }
#endif #endif
public partial class CGImageSource : NativeObject public partial class CGImageSource : NativeObject {
{
#if !COREBUILD #if !COREBUILD
[DllImport (Constants.ImageIOLibrary, EntryPoint="CGImageSourceGetTypeID")] [DllImport (Constants.ImageIOLibrary, EntryPoint = "CGImageSourceGetTypeID")]
public extern static nint GetTypeID (); public extern static nint GetTypeID ();
[DllImport (Constants.ImageIOLibrary)] [DllImport (Constants.ImageIOLibrary)]
@ -150,7 +149,7 @@ namespace ImageIO {
} }
} }
#endif #endif
[Preserve (Conditional=true)] [Preserve (Conditional = true)]
internal CGImageSource (NativeHandle handle, bool owns) internal CGImageSource (NativeHandle handle, bool owns)
: base (handle, owns) : base (handle, owns)
{ {
@ -165,7 +164,7 @@ namespace ImageIO {
{ {
return FromUrl (url, null); return FromUrl (url, null);
} }
public static CGImageSource? FromUrl (NSUrl url, CGImageOptions? options) public static CGImageSource? FromUrl (NSUrl url, CGImageOptions? options)
{ {
if (url is null) if (url is null)
@ -185,7 +184,7 @@ namespace ImageIO {
{ {
return FromDataProvider (provider, null); return FromDataProvider (provider, null);
} }
public static CGImageSource? FromDataProvider (CGDataProvider provider, CGImageOptions? options) public static CGImageSource? FromDataProvider (CGDataProvider provider, CGImageOptions? options)
{ {
if (provider is null) if (provider is null)
@ -205,7 +204,7 @@ namespace ImageIO {
{ {
return FromData (data, null); return FromData (data, null);
} }
public static CGImageSource? FromData (NSData data, CGImageOptions? options) public static CGImageSource? FromData (NSData data, CGImageOptions? options)
{ {
if (data is null) if (data is null)
@ -220,7 +219,7 @@ namespace ImageIO {
[DllImport (Constants.ImageIOLibrary)] [DllImport (Constants.ImageIOLibrary)]
extern static /* CFStringRef __nullable */ IntPtr CGImageSourceGetType ( extern static /* CFStringRef __nullable */ IntPtr CGImageSourceGetType (
/* CGImageSourceRef __nonnull */ IntPtr handle); /* CGImageSourceRef __nonnull */ IntPtr handle);
public string? TypeIdentifier { public string? TypeIdentifier {
get { get {
return CFString.FromHandle (CGImageSourceGetType (Handle)); return CFString.FromHandle (CGImageSourceGetType (Handle));
@ -229,7 +228,7 @@ namespace ImageIO {
[DllImport (Constants.ImageIOLibrary)] [DllImport (Constants.ImageIOLibrary)]
extern static /* size_t */ nint CGImageSourceGetCount (/* CGImageSourceRef __nonnull */ IntPtr handle); extern static /* size_t */ nint CGImageSourceGetCount (/* CGImageSourceRef __nonnull */ IntPtr handle);
public nint ImageCount { public nint ImageCount {
get { get {
return CGImageSourceGetCount (Handle); return CGImageSourceGetCount (Handle);
@ -330,7 +329,7 @@ namespace ImageIO {
[DllImport (Constants.ImageIOLibrary)] [DllImport (Constants.ImageIOLibrary)]
extern static void CGImageSourceUpdateData (/* CGImageSourceRef __nonnull */ IntPtr isrc, extern static void CGImageSourceUpdateData (/* CGImageSourceRef __nonnull */ IntPtr isrc,
/* CFDataRef __nonnull */ IntPtr data, [MarshalAs (UnmanagedType.I1)] bool final); /* CFDataRef __nonnull */ IntPtr data, [MarshalAs (UnmanagedType.I1)] bool final);
public void UpdateData (NSData data, bool final) public void UpdateData (NSData data, bool final)
{ {
if (data is null) if (data is null)
@ -353,7 +352,7 @@ namespace ImageIO {
// note: CGImageSourceStatus is always an int (4 bytes) so it's ok to use in the pinvoke declaration // note: CGImageSourceStatus is always an int (4 bytes) so it's ok to use in the pinvoke declaration
[DllImport (Constants.ImageIOLibrary)] [DllImport (Constants.ImageIOLibrary)]
extern static CGImageSourceStatus CGImageSourceGetStatus (/* CGImageSourceRef __nonnull */ IntPtr isrc); extern static CGImageSourceStatus CGImageSourceGetStatus (/* CGImageSourceRef __nonnull */ IntPtr isrc);
public CGImageSourceStatus GetStatus () public CGImageSourceStatus GetStatus ()
{ {
return CGImageSourceGetStatus (Handle); return CGImageSourceGetStatus (Handle);
@ -362,7 +361,7 @@ namespace ImageIO {
// note: CGImageSourceStatus is always an int (4 bytes) so it's ok to use in the pinvoke declaration // note: CGImageSourceStatus is always an int (4 bytes) so it's ok to use in the pinvoke declaration
[DllImport (Constants.ImageIOLibrary)] [DllImport (Constants.ImageIOLibrary)]
extern static CGImageSourceStatus CGImageSourceGetStatusAtIndex ( extern static CGImageSourceStatus CGImageSourceGetStatusAtIndex (
/* CGImageSourceRef __nonnull */ IntPtr handle, /* size_t */ nint idx); /* CGImageSourceRef __nonnull */ IntPtr handle, /* size_t */ nint idx);
public CGImageSourceStatus GetStatus (int index) public CGImageSourceStatus GetStatus (int index)
{ {
@ -410,10 +409,10 @@ namespace ImageIO {
[SupportedOSPlatform ("tvos12.0")] [SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[Mac (10,14)] [Mac (10, 14)]
[iOS (12,0)] [iOS (12, 0)]
[TV (12,0)] [TV (12, 0)]
[Watch (5,0)] [Watch (5, 0)]
#endif #endif
[DllImport (Constants.ImageIOLibrary)] [DllImport (Constants.ImageIOLibrary)]
extern static nuint CGImageSourceGetPrimaryImageIndex (IntPtr /* CGImageSource */ src); extern static nuint CGImageSourceGetPrimaryImageIndex (IntPtr /* CGImageSource */ src);
@ -424,10 +423,10 @@ namespace ImageIO {
[SupportedOSPlatform ("tvos12.0")] [SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[Mac (10,14)] [Mac (10, 14)]
[iOS (12,0)] [iOS (12, 0)]
[TV (12,0)] [TV (12, 0)]
[Watch (5,0)] [Watch (5, 0)]
#endif #endif
public nuint GetPrimaryImageIndex () public nuint GetPrimaryImageIndex ()
{ {

Просмотреть файл

@ -17,7 +17,7 @@ using ObjCRuntime;
using Foundation; using Foundation;
namespace ImageIO { namespace ImageIO {
public partial class CGImageSource { public partial class CGImageSource {
// CGImageSource.h // CGImageSource.h
@ -32,7 +32,7 @@ namespace ImageIO {
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
[UnsupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("macos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
[EditorBrowsable (EditorBrowsableState.Advanced)] [EditorBrowsable (EditorBrowsableState.Advanced)]
public CGImageMetadata? CopyMetadata (nint index, NSDictionary? options) public CGImageMetadata? CopyMetadata (nint index, NSDictionary? options)
@ -47,7 +47,7 @@ namespace ImageIO {
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
[UnsupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("macos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
public CGImageMetadata? CopyMetadata (nint index, CGImageOptions? options) public CGImageMetadata? CopyMetadata (nint index, CGImageOptions? options)
{ {
@ -62,7 +62,7 @@ namespace ImageIO {
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
[UnsupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("macos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
[DllImport (Constants.ImageIOLibrary)] [DllImport (Constants.ImageIOLibrary)]
extern static void CGImageSourceRemoveCacheAtIndex (/* CGImageSourceRef __nonnull */ IntPtr isrc, extern static void CGImageSourceRemoveCacheAtIndex (/* CGImageSourceRef __nonnull */ IntPtr isrc,
@ -74,7 +74,7 @@ namespace ImageIO {
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
[UnsupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("macos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
public void RemoveCache (nint index) public void RemoveCache (nint index)
{ {

Просмотреть файл

@ -24,7 +24,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")] [SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
public class CGMutableImageMetadata : CGImageMetadata { public class CGMutableImageMetadata : CGImageMetadata {

Просмотреть файл

@ -15,7 +15,7 @@ namespace ImageIO {
// untyped enum -> CGImageMetadata.h // untyped enum -> CGImageMetadata.h
// note: not used in any API // note: not used in any API
[iOS (7,0)] [iOS (7, 0)]
[ErrorDomain ("kCFErrorDomainCGImageMetadata")] [ErrorDomain ("kCFErrorDomainCGImageMetadata")]
public enum CGImageMetadataErrors { public enum CGImageMetadataErrors {
Unknown = 0, Unknown = 0,
@ -26,7 +26,7 @@ namespace ImageIO {
} }
// untyped enum -> CGImageMetadata.h // untyped enum -> CGImageMetadata.h
[iOS (7,0)] [iOS (7, 0)]
public enum CGImageMetadataType { public enum CGImageMetadataType {
Invalid = -1, Invalid = -1,
Default = 0, Default = 0,
@ -51,7 +51,8 @@ namespace ImageIO {
// untyped enum / #defines // untyped enum / #defines
// used with kCGImagePropertyPNGCompressionFilter // used with kCGImagePropertyPNGCompressionFilter
[iOS (9,0)][Mac (10,11)] [iOS (9, 0)]
[Mac (10, 11)]
[Flags] [Flags]
public enum CGImagePropertyPngFilters { public enum CGImagePropertyPngFilters {
No = 0, No = 0,
@ -63,8 +64,7 @@ namespace ImageIO {
} }
[Mac (10, 15), iOS (13, 0), TV (13, 0), Watch (6, 0)] [Mac (10, 15), iOS (13, 0), TV (13, 0), Watch (6, 0)]
public enum CGImageAnimationStatus public enum CGImageAnimationStatus {
{
Ok = 0, Ok = 0,
ParameterError = -22140, ParameterError = -22140,
CorruptInputImage = -22141, CorruptInputImage = -22141,
@ -74,7 +74,7 @@ namespace ImageIO {
} }
// Yes, no [Native] here // Yes, no [Native] here
[Mac (11,0), iOS (14,1), TV (14,2), Watch (7,1)] [Mac (11, 0), iOS (14, 1), TV (14, 2), Watch (7, 1)]
public enum CGImagePropertyTgaCompression : uint { public enum CGImagePropertyTgaCompression : uint {
None = 0, None = 0,
Rle, Rle,

Просмотреть файл

@ -39,68 +39,68 @@ namespace ImageKit {
public enum IKCameraDeviceViewDisplayMode : long { public enum IKCameraDeviceViewDisplayMode : long {
None = -1, None = -1,
Table = 0, Table = 0,
Icon = 1 Icon = 1
}; };
[Native] [Native]
public enum IKCameraDeviceViewTransferMode : long { public enum IKCameraDeviceViewTransferMode : long {
File = 0, File = 0,
Memory = 1 Memory = 1
}; };
[Native] [Native]
public enum IKDeviceBrowserViewDisplayMode : long { public enum IKDeviceBrowserViewDisplayMode : long {
Table = 0, Table = 0,
Outline = 1, Outline = 1,
Icon = 2 Icon = 2
}; };
// Untyped enum in ObjC // Untyped enum in ObjC
public enum IKImageBrowserCellState : int { public enum IKImageBrowserCellState : int {
NoImage = 0, NoImage = 0,
Invalid = 1, Invalid = 1,
Ready = 2 Ready = 2
}; };
[Flags] [Flags]
[Native] [Native]
public enum IKCellsStyle : ulong { public enum IKCellsStyle : ulong {
None = 0, None = 0,
Shadowed = 1 << 0, Shadowed = 1 << 0,
Outlined = 1 << 1, Outlined = 1 << 1,
Titled = 1 << 2, Titled = 1 << 2,
Subtitled = 1 << 3 Subtitled = 1 << 3
}; };
//used as a value for the IKImageBrowserGroupStyleKey in the NSDictionary that defines a group in IKImageBrowserView //used as a value for the IKImageBrowserGroupStyleKey in the NSDictionary that defines a group in IKImageBrowserView
[Native] [Native]
public enum IKGroupStyle : long { public enum IKGroupStyle : long {
Bezel = 0, Bezel = 0,
Disclosure = 1 Disclosure = 1
}; };
// Untyped enum in ObjC // Untyped enum in ObjC
public enum IKImageBrowserDropOperation : int { public enum IKImageBrowserDropOperation : int {
On = 0, On = 0,
Before = 1 Before = 1
}; };
[Native] [Native]
public enum IKScannerDeviceViewTransferMode : long { public enum IKScannerDeviceViewTransferMode : long {
File = 0, File = 0,
Memory = 1 Memory = 1
}; };
[Native] [Native]
public enum IKScannerDeviceViewDisplayMode : long { public enum IKScannerDeviceViewDisplayMode : long {
None = -1, None = -1,
Simple = 0, Simple = 0,
Advanced = 1 Advanced = 1
}; };
[Flags] [Flags]
public enum IKFilterBrowserPanelStyleMask : uint { public enum IKFilterBrowserPanelStyleMask : uint {
Normal = 0, Normal = 0,
Textured = 1 << 8 Textured = 1 << 8
// Other NSWindow Style Mask bit settings do not apply to this panel // Other NSWindow Style Mask bit settings do not apply to this panel
} }

Просмотреть файл

@ -22,7 +22,7 @@ namespace Intents {
#elif WATCH #elif WATCH
if (SystemVersion.CheckwatchOS (4, 0)) if (SystemVersion.CheckwatchOS (4, 0))
#endif #endif
return SuccessWithResolvedBillType (resolvedValue); return SuccessWithResolvedBillType (resolvedValue);
else else
return SuccessWithResolvedValue (resolvedValue); return SuccessWithResolvedValue (resolvedValue);
} }
@ -34,7 +34,7 @@ namespace Intents {
#elif WATCH #elif WATCH
if (SystemVersion.CheckwatchOS (4, 0)) if (SystemVersion.CheckwatchOS (4, 0))
#endif #endif
return ConfirmationRequiredWithBillTypeToConfirm (valueToConfirm); return ConfirmationRequiredWithBillTypeToConfirm (valueToConfirm);
else else
return ConfirmationRequiredWithValueToConfirm (valueToConfirm); return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
} }

Просмотреть файл

@ -24,7 +24,7 @@ namespace Intents {
#elif MONOMAC #elif MONOMAC
if (SystemVersion.CheckmacOS (10, 13)) if (SystemVersion.CheckmacOS (10, 13))
#endif #endif
return SuccessWithResolvedCallRecordType (resolvedValue); return SuccessWithResolvedCallRecordType (resolvedValue);
else else
return SuccessWithResolvedValue (resolvedValue); return SuccessWithResolvedValue (resolvedValue);
} }
@ -38,7 +38,7 @@ namespace Intents {
#elif MONOMAC #elif MONOMAC
if (SystemVersion.CheckmacOS (10, 13)) if (SystemVersion.CheckmacOS (10, 13))
#endif #endif
return ConfirmationRequiredWithCallRecordTypeToConfirm (valueToConfirm); return ConfirmationRequiredWithCallRecordTypeToConfirm (valueToConfirm);
else else
return ConfirmationRequiredWithValueToConfirm (valueToConfirm); return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
} }

Просмотреть файл

@ -22,7 +22,7 @@ namespace Intents {
#elif WATCH #elif WATCH
if (SystemVersion.CheckwatchOS (4, 0)) if (SystemVersion.CheckwatchOS (4, 0))
#endif #endif
return SuccessWithResolvedCarSignalOptions (resolvedValue); return SuccessWithResolvedCarSignalOptions (resolvedValue);
else else
return SuccessWithResolvedValue (resolvedValue); return SuccessWithResolvedValue (resolvedValue);
} }
@ -34,7 +34,7 @@ namespace Intents {
#elif WATCH #elif WATCH
if (SystemVersion.CheckwatchOS (4, 0)) if (SystemVersion.CheckwatchOS (4, 0))
#endif #endif
return ConfirmationRequiredWithCarSignalOptionsToConfirm (valueToConfirm); return ConfirmationRequiredWithCarSignalOptionsToConfirm (valueToConfirm);
else else
return ConfirmationRequiredWithValueToConfirm (valueToConfirm); return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
} }

Просмотреть файл

@ -26,12 +26,11 @@ namespace Intents {
[iOS (10, 0)] [iOS (10, 0)]
[Mac (10, 12, 0, PlatformArchitecture.Arch64)] [Mac (10, 12, 0, PlatformArchitecture.Arch64)]
[Watch (3, 2)] [Watch (3, 2)]
[TV (14,0)] [TV (14, 0)]
#endif #endif
[Register ("INIntentResolutionResult", SkipRegistration = true)] [Register ("INIntentResolutionResult", SkipRegistration = true)]
public sealed partial class INIntentResolutionResult<ObjectType> : INIntentResolutionResult public sealed partial class INIntentResolutionResult<ObjectType> : INIntentResolutionResult
where ObjectType : class, INativeObject where ObjectType : class, INativeObject {
{
internal INIntentResolutionResult (NativeHandle handle) : base (handle) internal INIntentResolutionResult (NativeHandle handle) : base (handle)
{ {
} }
@ -63,9 +62,9 @@ namespace Intents {
[SupportedOSPlatform ("tvos14.0")] [SupportedOSPlatform ("tvos14.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[Watch (6,0)] [Watch (6, 0)]
[iOS (13,0)] [iOS (13, 0)]
[Mac (11,0)] [Mac (11, 0)]
#endif #endif
public static INIntentResolutionResult GetUnsupported (nint reason) => throw new NotImplementedException ("All subclasses of INIntentResolutionResult must re-implement this method"); public static INIntentResolutionResult GetUnsupported (nint reason) => throw new NotImplementedException ("All subclasses of INIntentResolutionResult must re-implement this method");
@ -75,9 +74,9 @@ namespace Intents {
[SupportedOSPlatform ("tvos14.0")] [SupportedOSPlatform ("tvos14.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[Watch (6,0)] [Watch (6, 0)]
[iOS (13,0)] [iOS (13, 0)]
[Mac (11,0)] [Mac (11, 0)]
#endif #endif
public static INIntentResolutionResult GetConfirmationRequired (NSObject itemToConfirm, nint reason) => throw new NotImplementedException ("All subclasses of INIntentResolutionResult must re-implement this method"); public static INIntentResolutionResult GetConfirmationRequired (NSObject itemToConfirm, nint reason) => throw new NotImplementedException ("All subclasses of INIntentResolutionResult must re-implement this method");

Просмотреть файл

@ -25,7 +25,7 @@ namespace Intents {
#elif MONOMAC #elif MONOMAC
if (SystemVersion.CheckmacOS (10, 13)) if (SystemVersion.CheckmacOS (10, 13))
#endif #endif
return SuccessWithResolvedMessageAttributeOptions (resolvedValue); return SuccessWithResolvedMessageAttributeOptions (resolvedValue);
else else
return SuccessWithResolvedValue (resolvedValue); return SuccessWithResolvedValue (resolvedValue);
} }
@ -39,7 +39,7 @@ namespace Intents {
#elif MONOMAC #elif MONOMAC
if (SystemVersion.CheckmacOS (10, 13)) if (SystemVersion.CheckmacOS (10, 13))
#endif #endif
return ConfirmationRequiredWithMessageAttributeOptionsToConfirm (valueToConfirm); return ConfirmationRequiredWithMessageAttributeOptionsToConfirm (valueToConfirm);
else else
return ConfirmationRequiredWithValueToConfirm (valueToConfirm); return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
} }

Просмотреть файл

@ -25,7 +25,7 @@ namespace Intents {
#elif MONOMAC #elif MONOMAC
if (SystemVersion.CheckmacOS (10, 13)) if (SystemVersion.CheckmacOS (10, 13))
#endif #endif
return SuccessWithResolvedMessageAttribute (resolvedValue); return SuccessWithResolvedMessageAttribute (resolvedValue);
else else
return SuccessWithResolvedValue (resolvedValue); return SuccessWithResolvedValue (resolvedValue);
} }
@ -39,7 +39,7 @@ namespace Intents {
#elif MONOMAC #elif MONOMAC
if (SystemVersion.CheckmacOS (10, 13)) if (SystemVersion.CheckmacOS (10, 13))
#endif #endif
return ConfirmationRequiredWithMessageAttributeToConfirm (valueToConfirm); return ConfirmationRequiredWithMessageAttributeToConfirm (valueToConfirm);
else else
return ConfirmationRequiredWithValueToConfirm (valueToConfirm); return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
} }

Просмотреть файл

@ -22,7 +22,7 @@ namespace Intents {
#elif WATCH #elif WATCH
if (SystemVersion.CheckwatchOS (4, 0)) if (SystemVersion.CheckwatchOS (4, 0))
#endif #endif
return SuccessWithResolvedPaymentStatus (resolvedValue); return SuccessWithResolvedPaymentStatus (resolvedValue);
else else
return SuccessWithResolvedValue (resolvedValue); return SuccessWithResolvedValue (resolvedValue);
} }
@ -34,7 +34,7 @@ namespace Intents {
#elif WATCH #elif WATCH
if (SystemVersion.CheckwatchOS (4, 0)) if (SystemVersion.CheckwatchOS (4, 0))
#endif #endif
return ConfirmationRequiredWithPaymentStatusToConfirm (valueToConfirm); return ConfirmationRequiredWithPaymentStatusToConfirm (valueToConfirm);
else else
return ConfirmationRequiredWithValueToConfirm (valueToConfirm); return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
} }

Просмотреть файл

@ -5,12 +5,10 @@ using ObjCRuntime;
#nullable enable #nullable enable
namespace Intents namespace Intents {
{
#if !TVOS #if !TVOS
public partial class INPerson public partial class INPerson {
{
#if NET #if NET
[SupportedOSPlatform ("ios15.0")] [SupportedOSPlatform ("ios15.0")]
@ -18,12 +16,12 @@ namespace Intents
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("tvos")]
#else #else
[Introduced (PlatformName.iOS, 15,0)] [Introduced (PlatformName.iOS, 15, 0)]
[Introduced (PlatformName.MacOSX, 12,0)] [Introduced (PlatformName.MacOSX, 12, 0)]
[Introduced (PlatformName.WatchOS, 8,0)] [Introduced (PlatformName.WatchOS, 8, 0)]
#endif #endif
public enum INPersonType { public enum INPersonType {
Me = 0, Me = 0,
ContactSuggestion = 1, ContactSuggestion = 1,
} }
@ -33,9 +31,9 @@ namespace Intents
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("tvos")]
#else #else
[Introduced (PlatformName.iOS, 15,0)] [Introduced (PlatformName.iOS, 15, 0)]
[Introduced (PlatformName.MacOSX, 12,0)] [Introduced (PlatformName.MacOSX, 12, 0)]
[Introduced (PlatformName.WatchOS, 8,0)] [Introduced (PlatformName.WatchOS, 8, 0)]
#endif #endif
public INPerson (INPersonHandle personHandle, NSPersonNameComponents? nameComponents, string? displayName, INImage? image, string? contactIdentifier, string? customIdentifier, bool isMe, INPersonSuggestionType suggestionType) : public INPerson (INPersonHandle personHandle, NSPersonNameComponents? nameComponents, string? displayName, INImage? image, string? contactIdentifier, string? customIdentifier, bool isMe, INPersonSuggestionType suggestionType) :
this (personHandle, nameComponents, displayName, image, contactIdentifier, customIdentifier, isMe, suggestionType, INPersonType.Me) this (personHandle, nameComponents, displayName, image, contactIdentifier, customIdentifier, isMe, suggestionType, INPersonType.Me)
@ -48,9 +46,9 @@ namespace Intents
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("tvos")]
#else #else
[Introduced (PlatformName.iOS, 15,0)] [Introduced (PlatformName.iOS, 15, 0)]
[Introduced (PlatformName.MacOSX, 12,0)] [Introduced (PlatformName.MacOSX, 12, 0)]
[Introduced (PlatformName.WatchOS, 8,0)] [Introduced (PlatformName.WatchOS, 8, 0)]
#endif #endif
public INPerson (INPersonHandle personHandle, NSPersonNameComponents? nameComponents, string? displayName, INImage? image, string? contactIdentifier, string? customIdentifier, bool isMe, INPersonSuggestionType suggestionType, INPersonType personType) : base (NSObjectFlag.Empty) public INPerson (INPersonHandle personHandle, NSPersonNameComponents? nameComponents, string? displayName, INImage? image, string? contactIdentifier, string? customIdentifier, bool isMe, INPersonSuggestionType suggestionType, INPersonType personType) : base (NSObjectFlag.Empty)
{ {

Просмотреть файл

@ -23,7 +23,7 @@ namespace Intents {
#elif MONOMAC #elif MONOMAC
if (SystemVersion.CheckmacOS (10, 13)) if (SystemVersion.CheckmacOS (10, 13))
#endif #endif
InitializeHandle (InitWithVocabularyIdentifier (identifier, spokenPhrase, pronunciationHint)); InitializeHandle (InitWithVocabularyIdentifier (identifier, spokenPhrase, pronunciationHint));
#if !TVOS #if !TVOS
else else
InitializeHandle (InitWithIdentifier (identifier, spokenPhrase, pronunciationHint)); InitializeHandle (InitWithIdentifier (identifier, spokenPhrase, pronunciationHint));

Просмотреть файл

@ -22,7 +22,7 @@ namespace Intents {
#elif WATCH #elif WATCH
if (SystemVersion.CheckwatchOS (4, 0)) if (SystemVersion.CheckwatchOS (4, 0))
#endif #endif
return SuccessWithResolvedWorkoutGoalUnitType (resolvedValue); return SuccessWithResolvedWorkoutGoalUnitType (resolvedValue);
else else
return SuccessWithResolvedValue (resolvedValue); return SuccessWithResolvedValue (resolvedValue);
} }
@ -34,7 +34,7 @@ namespace Intents {
#elif WATCH #elif WATCH
if (SystemVersion.CheckwatchOS (4, 0)) if (SystemVersion.CheckwatchOS (4, 0))
#endif #endif
return ConfirmationRequiredWithWorkoutGoalUnitTypeToConfirm (valueToConfirm); return ConfirmationRequiredWithWorkoutGoalUnitTypeToConfirm (valueToConfirm);
else else
return ConfirmationRequiredWithValueToConfirm (valueToConfirm); return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
} }

Просмотреть файл

@ -22,7 +22,7 @@ namespace Intents {
#elif WATCH #elif WATCH
if (SystemVersion.CheckwatchOS (4, 0)) if (SystemVersion.CheckwatchOS (4, 0))
#endif #endif
return SuccessWithResolvedWorkoutLocationType (resolvedValue); return SuccessWithResolvedWorkoutLocationType (resolvedValue);
else else
return SuccessWithResolvedValue (resolvedValue); return SuccessWithResolvedValue (resolvedValue);
} }
@ -34,7 +34,7 @@ namespace Intents {
#elif WATCH #elif WATCH
if (SystemVersion.CheckwatchOS (4, 0)) if (SystemVersion.CheckwatchOS (4, 0))
#endif #endif
return ConfirmationRequiredWithWorkoutLocationTypeToConfirm (valueToConfirm); return ConfirmationRequiredWithWorkoutLocationTypeToConfirm (valueToConfirm);
else else
return ConfirmationRequiredWithValueToConfirm (valueToConfirm); return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
} }

Просмотреть файл

@ -19,7 +19,8 @@ namespace JavaScriptCore {
Number, Number,
String, String,
Object, Object,
[iOS (13,0)][Mac (10,15)] [iOS (13, 0)]
[Mac (10, 15)]
Symbol, Symbol,
} }

Просмотреть файл

@ -14,8 +14,8 @@ using Foundation;
namespace JavaScriptCore { namespace JavaScriptCore {
public partial class JSContext { public partial class JSContext {
public JSValue this[NSObject key] { public JSValue this [NSObject key] {
get { return _GetObject (key); } get { return _GetObject (key); }
set { _SetObject (value, key); } set { _SetObject (value, key); }
} }
@ -31,16 +31,16 @@ namespace JavaScriptCore {
static public JSValue From (string value, JSContext context) static public JSValue From (string value, JSContext context)
{ {
using (var str = new NSString (value)) { using (var str = new NSString (value)) {
return From ((NSObject)str, context); return From ((NSObject) str, context);
} }
} }
public JSValue this[nuint index] { public JSValue this [nuint index] {
get { return _ObjectAtIndexedSubscript (index); } get { return _ObjectAtIndexedSubscript (index); }
set { _SetObject (value, index); } set { _SetObject (value, index); }
} }
public JSValue this[NSObject key] { public JSValue this [NSObject key] {
get { return _ObjectForKeyedSubscript (key); } get { return _ObjectForKeyedSubscript (key); }
set { _SetObject (value, key); } set { _SetObject (value, key); }
} }

Просмотреть файл

@ -4,26 +4,32 @@ using Foundation;
namespace LocalAuthentication { namespace LocalAuthentication {
[iOS (8,0)] [iOS (8, 0)]
[Mac (10, 10)] [Mac (10, 10)]
[NoTV] [NoTV]
[Native] [Native]
public enum LAPolicy : long { public enum LAPolicy : long {
[Mac (10,12,2), NoWatch] [Mac (10, 12, 2), NoWatch]
DeviceOwnerAuthenticationWithBiometrics = 1, DeviceOwnerAuthenticationWithBiometrics = 1,
DeviceOwnerAuthentication = 2, DeviceOwnerAuthentication = 2,
[NoiOS][Mac (10,15)][NoWatch] [NoiOS]
[Mac (10, 15)]
[NoWatch]
DeviceOwnerAuthenticationWithWatch = 3, DeviceOwnerAuthenticationWithWatch = 3,
[NoiOS][Mac (10,15)][NoWatch] [NoiOS]
[Mac (10, 15)]
[NoWatch]
DeviceOwnerAuthenticationWithBiometricsOrWatch = 4, DeviceOwnerAuthenticationWithBiometricsOrWatch = 4,
[Obsolete ("Use DeviceOwnerAuthenticationWithBiometricsOrWatch enum value instead.")] [Obsolete ("Use DeviceOwnerAuthenticationWithBiometricsOrWatch enum value instead.")]
[NoiOS][Mac (10,15)][NoWatch] [NoiOS]
[Mac (10, 15)]
[NoWatch]
OwnerAuthenticationWithBiometricsOrWatch = DeviceOwnerAuthenticationWithBiometricsOrWatch, OwnerAuthenticationWithBiometricsOrWatch = DeviceOwnerAuthenticationWithBiometricsOrWatch,
[NoMac, NoiOS, NoMacCatalyst, Watch (9,0)] [NoMac, NoiOS, NoMacCatalyst, Watch (9, 0)]
DeviceOwnerAuthenticationWithWristDetection = 5, DeviceOwnerAuthenticationWithWristDetection = 5,
} }
[iOS (8,0)] [iOS (8, 0)]
[Mac (10, 10)] [Mac (10, 10)]
[NoTV] [NoTV]
[Native ("LAError")] [Native ("LAError")]
@ -33,58 +39,58 @@ namespace LocalAuthentication {
/// Authentication was not successful, because user failed to provide valid credentials. /// Authentication was not successful, because user failed to provide valid credentials.
AuthenticationFailed = -1, AuthenticationFailed = -1,
/// Authentication was canceled by user (e.g. tapped Cancel button). /// Authentication was canceled by user (e.g. tapped Cancel button).
UserCancel = -2, UserCancel = -2,
/// Authentication was canceled, because the user tapped the fallback button (Enter Password). /// Authentication was canceled, because the user tapped the fallback button (Enter Password).
UserFallback = -3, UserFallback = -3,
/// Authentication was canceled by system (e.g. another application went to foreground). /// Authentication was canceled by system (e.g. another application went to foreground).
SystemCancel = -4, SystemCancel = -4,
/// Authentication could not start, because passcode is not set on the device. /// Authentication could not start, because passcode is not set on the device.
PasscodeNotSet = -5, PasscodeNotSet = -5,
#if !NET #if !NET
/// Authentication could not start, because Touch ID is not available on the device. /// Authentication could not start, because Touch ID is not available on the device.
[Deprecated (PlatformName.iOS, 11,0, message: "Use 'BiometryNotAvailable' instead.")] [Deprecated (PlatformName.iOS, 11, 0, message: "Use 'BiometryNotAvailable' instead.")]
[Deprecated (PlatformName.MacOSX, 10,13, message: "Use 'BiometryNotAvailable' instead.")] [Deprecated (PlatformName.MacOSX, 10, 13, message: "Use 'BiometryNotAvailable' instead.")]
TouchIDNotAvailable = BiometryNotAvailable, TouchIDNotAvailable = BiometryNotAvailable,
/// Authentication could not start, because Touch ID has no enrolled fingers. /// Authentication could not start, because Touch ID has no enrolled fingers.
[Deprecated (PlatformName.iOS, 11,0, message: "Use 'BiometryNotEnrolled' instead.")] [Deprecated (PlatformName.iOS, 11, 0, message: "Use 'BiometryNotEnrolled' instead.")]
[Deprecated (PlatformName.MacOSX, 10,13, message: "Use 'BiometryNotEnrolled' instead.")] [Deprecated (PlatformName.MacOSX, 10, 13, message: "Use 'BiometryNotEnrolled' instead.")]
TouchIDNotEnrolled = BiometryNotEnrolled, TouchIDNotEnrolled = BiometryNotEnrolled,
[Deprecated (PlatformName.iOS, 11,0, message: "Use 'BiometryLockout' instead.")] [Deprecated (PlatformName.iOS, 11, 0, message: "Use 'BiometryLockout' instead.")]
[Deprecated (PlatformName.MacOSX, 10,13, message: "Use 'BiometryLockout' instead.")] [Deprecated (PlatformName.MacOSX, 10, 13, message: "Use 'BiometryLockout' instead.")]
TouchIDLockout = BiometryLockout, TouchIDLockout = BiometryLockout,
#endif #endif
AppCancel = -9, AppCancel = -9,
InvalidContext = -10, InvalidContext = -10,
[NoiOS, NoWatch, NoMacCatalyst] [NoiOS, NoWatch, NoMacCatalyst]
WatchNotAvailable = -11, WatchNotAvailable = -11,
[NoiOS, NoWatch, NoMacCatalyst] [NoiOS, NoWatch, NoMacCatalyst]
BiometryNotPaired = -12, BiometryNotPaired = -12,
[NoiOS, NoWatch, NoMacCatalyst] [NoiOS, NoWatch, NoMacCatalyst]
BiometryDisconnected = -13, BiometryDisconnected = -13,
[NoiOS, NoWatch, NoMacCatalyst] [NoiOS, NoWatch, NoMacCatalyst]
InvalidDimension = -14, InvalidDimension = -14,
[NoWatch] [NoWatch]
BiometryNotAvailable = -6, BiometryNotAvailable = -6,
[NoWatch] [NoWatch]
BiometryNotEnrolled = -7, BiometryNotEnrolled = -7,
[NoWatch] [NoWatch]
BiometryLockout = -8, BiometryLockout = -8,
NotInteractive = -1004, NotInteractive = -1004,
} }
[iOS (9,0), Mac (10,11), Watch (3,0), NoTV] [iOS (9, 0), Mac (10, 11), Watch (3, 0), NoTV]
[Native] [Native]
public enum LACredentialType : long { public enum LACredentialType : long {
ApplicationPassword = 0, ApplicationPassword = 0,
[iOS (13,4), Mac (10,15,4), NoWatch, NoTV] [iOS (13, 4), Mac (10, 15, 4), NoWatch, NoTV]
SmartCardPin = -3, SmartCardPin = -3,
} }
[iOS (9,0)] [iOS (9, 0)]
[Mac (10,11)] [Mac (10, 11)]
[NoTV] [NoTV]
[Native] [Native]
public enum LAAccessControlOperation : long { public enum LAAccessControlOperation : long {
@ -92,16 +98,17 @@ namespace LocalAuthentication {
UseItem, UseItem,
CreateKey, CreateKey,
UseKeySign, UseKeySign,
[iOS (10,0)][Mac (10,12)] [iOS (10, 0)]
[Mac (10, 12)]
UseKeyDecrypt, UseKeyDecrypt,
[iOS (10,0)][Mac (10,12)] [iOS (10, 0)]
[Mac (10, 12)]
UseKeyKeyExchange, UseKeyKeyExchange,
} }
[Mac (13,0), iOS (16,0), MacCatalyst (16,0), NoWatch, NoTV] [Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0), NoWatch, NoTV]
[Native] [Native]
public enum LARightState : long public enum LARightState : long {
{
Unknown = 0, Unknown = 0,
Authorizing = 1, Authorizing = 1,
Authorized = 2, Authorized = 2,

Просмотреть файл

@ -15,9 +15,9 @@ namespace MLCompute {
[SupportedOSPlatform ("macos11.0")] [SupportedOSPlatform ("macos11.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[iOS (14,0)] [iOS (14, 0)]
[TV (14,0)] [TV (14, 0)]
[Mac (11,0)] [Mac (11, 0)]
[NoWatch] [NoWatch]
#endif #endif
public static class MLCActivationTypeExtensions { public static class MLCActivationTypeExtensions {
@ -37,9 +37,9 @@ namespace MLCompute {
[SupportedOSPlatform ("macos11.0")] [SupportedOSPlatform ("macos11.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[iOS (14,0)] [iOS (14, 0)]
[TV (14,0)] [TV (14, 0)]
[Mac (11,0)] [Mac (11, 0)]
[NoWatch] [NoWatch]
#endif #endif
public static class MLCArithmeticOperationExtensions { public static class MLCArithmeticOperationExtensions {
@ -59,9 +59,9 @@ namespace MLCompute {
[SupportedOSPlatform ("macos11.0")] [SupportedOSPlatform ("macos11.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[iOS (14,0)] [iOS (14, 0)]
[TV (14,0)] [TV (14, 0)]
[Mac (11,0)] [Mac (11, 0)]
[NoWatch] [NoWatch]
#endif #endif
public static class MLCPaddingPolicyExtensions { public static class MLCPaddingPolicyExtensions {
@ -81,9 +81,9 @@ namespace MLCompute {
[SupportedOSPlatform ("macos11.0")] [SupportedOSPlatform ("macos11.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[iOS (14,0)] [iOS (14, 0)]
[TV (14,0)] [TV (14, 0)]
[Mac (11,0)] [Mac (11, 0)]
[NoWatch] [NoWatch]
#endif #endif
public static class MLCLossTypeExtensions { public static class MLCLossTypeExtensions {
@ -103,9 +103,9 @@ namespace MLCompute {
[SupportedOSPlatform ("macos11.0")] [SupportedOSPlatform ("macos11.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[iOS (14,0)] [iOS (14, 0)]
[TV (14,0)] [TV (14, 0)]
[Mac (11,0)] [Mac (11, 0)]
[NoWatch] [NoWatch]
#endif #endif
public static class MLCReductionTypeExtensions { public static class MLCReductionTypeExtensions {
@ -125,9 +125,9 @@ namespace MLCompute {
[SupportedOSPlatform ("macos11.0")] [SupportedOSPlatform ("macos11.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[iOS (14,0)] [iOS (14, 0)]
[TV (14,0)] [TV (14, 0)]
[Mac (11,0)] [Mac (11, 0)]
[NoWatch] [NoWatch]
#endif #endif
public static class MLCPaddingTypeExtensions { public static class MLCPaddingTypeExtensions {
@ -147,9 +147,9 @@ namespace MLCompute {
[SupportedOSPlatform ("macos11.0")] [SupportedOSPlatform ("macos11.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[iOS (14,0)] [iOS (14, 0)]
[TV (14,0)] [TV (14, 0)]
[Mac (11,0)] [Mac (11, 0)]
[NoWatch] [NoWatch]
#endif #endif
public static class MLCConvolutionTypeExtensions { public static class MLCConvolutionTypeExtensions {
@ -169,9 +169,9 @@ namespace MLCompute {
[SupportedOSPlatform ("macos11.0")] [SupportedOSPlatform ("macos11.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[iOS (14,0)] [iOS (14, 0)]
[TV (14,0)] [TV (14, 0)]
[Mac (11,0)] [Mac (11, 0)]
[NoWatch] [NoWatch]
#endif #endif
public static class MLCPoolingTypeExtensions { public static class MLCPoolingTypeExtensions {
@ -191,9 +191,9 @@ namespace MLCompute {
[SupportedOSPlatform ("macos11.0")] [SupportedOSPlatform ("macos11.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[iOS (14,0)] [iOS (14, 0)]
[TV (14,0)] [TV (14, 0)]
[Mac (11,0)] [Mac (11, 0)]
[NoWatch] [NoWatch]
#endif #endif
public static class MLCSoftmaxOperationExtensions { public static class MLCSoftmaxOperationExtensions {
@ -213,9 +213,9 @@ namespace MLCompute {
[SupportedOSPlatform ("macos11.0")] [SupportedOSPlatform ("macos11.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[iOS (14,0)] [iOS (14, 0)]
[TV (14,0)] [TV (14, 0)]
[Mac (11,0)] [Mac (11, 0)]
[NoWatch] [NoWatch]
#endif #endif
public static class MLCSampleModeExtensions { public static class MLCSampleModeExtensions {
@ -235,9 +235,9 @@ namespace MLCompute {
[SupportedOSPlatform ("macos11.0")] [SupportedOSPlatform ("macos11.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[iOS (14,0)] [iOS (14, 0)]
[TV (14,0)] [TV (14, 0)]
[Mac (11,0)] [Mac (11, 0)]
[NoWatch] [NoWatch]
#endif #endif
public static class MLCLstmResultModeExtensions { public static class MLCLstmResultModeExtensions {
@ -257,9 +257,9 @@ namespace MLCompute {
[SupportedOSPlatform ("ios14.5")] [SupportedOSPlatform ("ios14.5")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[TV (14,5)] [TV (14, 5)]
[Mac (11,3)] [Mac (11, 3)]
[iOS (14,5)] [iOS (14, 5)]
[NoWatch] [NoWatch]
#endif #endif
public static class MLCComparisonOperationExtensions { public static class MLCComparisonOperationExtensions {
@ -280,10 +280,10 @@ namespace MLCompute {
[SupportedOSPlatform ("maccatalyst15.0")] [SupportedOSPlatform ("maccatalyst15.0")]
#else #else
[NoWatch] [NoWatch]
[TV (15,0)] [TV (15, 0)]
[Mac (12,0)] [Mac (12, 0)]
[iOS (15,0)] [iOS (15, 0)]
[MacCatalyst (15,0)] [MacCatalyst (15, 0)]
#endif #endif
public static class MLCGradientClippingTypeExtensions { public static class MLCGradientClippingTypeExtensions {

Просмотреть файл

@ -22,17 +22,17 @@ namespace MapKit {
// NSUInteger -> MKDirectionsTypes.h // NSUInteger -> MKDirectionsTypes.h
[NoWatch] [NoWatch]
[Native] [Native]
[TV (9,2)] [TV (9, 2)]
[iOS (7,0)] [iOS (7, 0)]
public enum MKDirectionsTransportType : ulong { public enum MKDirectionsTransportType : ulong {
Automobile = 1 << 0, Automobile = 1 << 0,
Walking = 1 << 1, Walking = 1 << 1,
Transit = 1 << 2, Transit = 1 << 2,
Any = 0x0FFFFFFF, Any = 0x0FFFFFFF,
} }
// NSUInteger -> MKTypes.h // NSUInteger -> MKTypes.h
[TV (9,2)] [TV (9, 2)]
[NoWatch] [NoWatch]
[Native] [Native]
public enum MKMapType : ulong { public enum MKMapType : ulong {
@ -41,14 +41,16 @@ namespace MapKit {
Hybrid, Hybrid,
SatelliteFlyover, SatelliteFlyover,
HybridFlyover, HybridFlyover,
[iOS (11,0)][TV (11,0)][Mac (10,13)] [iOS (11, 0)]
[TV (11, 0)]
[Mac (10, 13)]
MutedStandard, MutedStandard,
} }
// NSUInteger -> MKDistanceFormatter.h // NSUInteger -> MKDistanceFormatter.h
[Native] [Native]
[TV (9,2)] [TV (9, 2)]
[iOS (7,0)] [iOS (7, 0)]
public enum MKDistanceFormatterUnits : ulong { public enum MKDistanceFormatterUnits : ulong {
Default, Default,
Metric, Metric,
@ -58,8 +60,8 @@ namespace MapKit {
// NSUInteger -> MKDistanceFormatter.h // NSUInteger -> MKDistanceFormatter.h
[Native] [Native]
[TV (9,2)] [TV (9, 2)]
[iOS (7,0)] [iOS (7, 0)]
public enum MKDistanceFormatterUnitStyle : ulong { public enum MKDistanceFormatterUnitStyle : ulong {
Default = 0, Default = 0,
Abbreviated, Abbreviated,
@ -67,17 +69,17 @@ namespace MapKit {
} }
// NSInteger -> MKMapView.h // NSInteger -> MKMapView.h
[TV (9,2)] [TV (9, 2)]
[NoWatch] [NoWatch]
[Native] [Native]
[iOS (7,0)] [iOS (7, 0)]
public enum MKOverlayLevel : long { public enum MKOverlayLevel : long {
AboveRoads = 0, AboveRoads = 0,
AboveLabels, AboveLabels,
} }
// NSUInteger -> MKTypes.h // NSUInteger -> MKTypes.h
[TV (9,2)] [TV (9, 2)]
[NoWatch] [NoWatch]
[Native] [Native]
[ErrorDomain ("MKErrorDomain")] [ErrorDomain ("MKErrorDomain")]
@ -97,23 +99,23 @@ namespace MapKit {
public enum MKAnnotationViewDragState : ulong { public enum MKAnnotationViewDragState : ulong {
None, Starting, Dragging, Canceling, Ending None, Starting, Dragging, Canceling, Ending
} }
// NSUInteger -> MKTypes.h // NSUInteger -> MKTypes.h
[NoTV] [NoTV]
[NoWatch] [NoWatch]
[Native] [Native]
[Deprecated (PlatformName.iOS, 9, 0, message : "Use 'MKPinAnnotationView.PinTintColor' instead.")] [Deprecated (PlatformName.iOS, 9, 0, message: "Use 'MKPinAnnotationView.PinTintColor' instead.")]
public enum MKPinAnnotationColor : ulong { public enum MKPinAnnotationColor : ulong {
Red, Green, Purple Red, Green, Purple
} }
// NSUInteger -> MKTypes.h // NSUInteger -> MKTypes.h
[TV (9,2)] [TV (9, 2)]
[NoWatch] [NoWatch]
[Native] [Native]
public enum MKUserTrackingMode : ulong { public enum MKUserTrackingMode : ulong {
None, None,
Follow, Follow,
#if !XAMCORE_5_0 && !(IOS || MACCATALYST) #if !XAMCORE_5_0 && !(IOS || MACCATALYST)
[Obsolete ("This is only available on iOS and MacCatalyst.")] [Obsolete ("This is only available on iOS and MacCatalyst.")]
FollowWithHeading, FollowWithHeading,
@ -122,7 +124,9 @@ namespace MapKit {
#endif #endif
} }
[TV (9,2)][NoWatch][iOS (9,3)] [TV (9, 2)]
[NoWatch]
[iOS (9, 3)]
[Native] [Native]
[Deprecated (PlatformName.iOS, 13, 0, message: "Use 'MKLocalSearchCompleterResultType' instead.")] [Deprecated (PlatformName.iOS, 13, 0, message: "Use 'MKLocalSearchCompleterResultType' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 15, message: "Use 'MKLocalSearchCompleterResultType' instead.")] [Deprecated (PlatformName.MacOSX, 10, 15, message: "Use 'MKLocalSearchCompleterResultType' instead.")]
@ -132,23 +136,34 @@ namespace MapKit {
Only Only
} }
[TV (11,0)][NoWatch][iOS (11,0)][Mac (10,13)] [TV (11, 0)]
[NoWatch]
[iOS (11, 0)]
[Mac (10, 13)]
[Native] [Native]
public enum MKAnnotationViewCollisionMode : long { public enum MKAnnotationViewCollisionMode : long {
Rectangle, Rectangle,
Circle, Circle,
[TV (14,0)][iOS (14,0)][Mac (11,0)] [TV (14, 0)]
[iOS (14, 0)]
[Mac (11, 0)]
None, None,
} }
[TV (11,0)][NoWatch][iOS (11,0)][NoMac] [TV (11, 0)]
[NoWatch]
[iOS (11, 0)]
[NoMac]
[Native] [Native]
public enum MKScaleViewAlignment : long { public enum MKScaleViewAlignment : long {
Leading, Leading,
Trailing, Trailing,
} }
[TV (11,0)][NoWatch][iOS (11,0)][Mac (10,13)] [TV (11, 0)]
[NoWatch]
[iOS (11, 0)]
[Mac (10, 13)]
[Native] [Native]
public enum MKFeatureVisibility : long { public enum MKFeatureVisibility : long {
Adaptive, Adaptive,
@ -157,72 +172,64 @@ namespace MapKit {
} }
[Flags] [Flags]
[TV (13,0), NoWatch, Mac (10,15), iOS (13,0)] [TV (13, 0), NoWatch, Mac (10, 15), iOS (13, 0)]
[Native] [Native]
public enum MKLocalSearchCompleterResultType : ulong public enum MKLocalSearchCompleterResultType : ulong {
{
Address = 1 << 0, Address = 1 << 0,
PointOfInterest = 1 << 1, PointOfInterest = 1 << 1,
Query = 1 << 2, Query = 1 << 2,
} }
[Flags] [Flags]
[TV (13,0), NoWatch, Mac (10,15), iOS (13,0)] [TV (13, 0), NoWatch, Mac (10, 15), iOS (13, 0)]
[Native] [Native]
public enum MKLocalSearchResultType : ulong public enum MKLocalSearchResultType : ulong {
{
Address = 1 << 0, Address = 1 << 0,
PointOfInterest = 1 << 1, PointOfInterest = 1 << 1,
} }
[Mac (13,0), iOS (16,0), MacCatalyst (16,0), NoWatch, TV (16,0)] [Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0), NoWatch, TV (16, 0)]
[Native] [Native]
public enum MKDirectionsRoutePreference : long public enum MKDirectionsRoutePreference : long {
{
Any = 0, Any = 0,
Avoid, Avoid,
} }
[Flags] [Flags]
[NoMac, iOS (16,0), MacCatalyst (16,0), NoWatch, NoTV] [NoMac, iOS (16, 0), MacCatalyst (16, 0), NoWatch, NoTV]
[Native] [Native]
public enum MKMapFeatureOptions : long public enum MKMapFeatureOptions : long {
{ PointsOfInterest = 1 << (int) MKMapFeatureType.PointOfInterest,
PointsOfInterest = 1 << (int)MKMapFeatureType.PointOfInterest, Territories = 1 << (int) MKMapFeatureType.Territory,
Territories = 1 << (int)MKMapFeatureType.Territory, PhysicalFeatures = 1 << (int) MKMapFeatureType.PhysicalFeature,
PhysicalFeatures = 1 << (int)MKMapFeatureType.PhysicalFeature,
} }
[Mac (13,0), iOS (16,0), MacCatalyst (16,0), NoWatch, NoTV] [Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0), NoWatch, NoTV]
[Native] [Native]
public enum MKLookAroundBadgePosition : long public enum MKLookAroundBadgePosition : long {
{
TopLeading = 0, TopLeading = 0,
TopTrailing, TopTrailing,
BottomTrailing, BottomTrailing,
} }
[Mac (13,0), iOS (16,0), MacCatalyst (16,0), NoWatch, TV (16,0)] [Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0), NoWatch, TV (16, 0)]
[Native] [Native]
public enum MKMapElevationStyle : long public enum MKMapElevationStyle : long {
{
Flat = 0, Flat = 0,
Realistic, Realistic,
} }
[NoMac, iOS (16,0), MacCatalyst (16,0), NoWatch, NoTV] [NoMac, iOS (16, 0), MacCatalyst (16, 0), NoWatch, NoTV]
[Native] [Native]
public enum MKMapFeatureType : long public enum MKMapFeatureType : long {
{
PointOfInterest = 0, PointOfInterest = 0,
Territory, Territory,
PhysicalFeature, PhysicalFeature,
} }
[Mac (13,0), iOS (16,0), MacCatalyst (16,0), NoWatch, TV (16,0)] [Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0), NoWatch, TV (16, 0)]
[Native] [Native]
public enum MKStandardMapEmphasisStyle : long public enum MKStandardMapEmphasisStyle : long {
{
Default = 0, Default = 0,
Muted, Muted,
} }

Просмотреть файл

@ -13,10 +13,10 @@ namespace MapKit {
[SupportedOSPlatform ("macos10.13")] [SupportedOSPlatform ("macos10.13")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[TV (11,0)] [TV (11, 0)]
[NoWatch] [NoWatch]
[iOS (11,0)] [iOS (11, 0)]
[Mac (10,13)] [Mac (10, 13)]
#endif #endif
#if WATCH && !NET #if WATCH && !NET
[Obsolete ("This API is not available on this platform.")] [Obsolete ("This API is not available on this platform.")]

Просмотреть файл

@ -44,7 +44,7 @@ namespace MapKit {
if (points.Length == 0) if (points.Length == 0)
return PolylineWithPoints (IntPtr.Zero, 0); return PolylineWithPoints (IntPtr.Zero, 0);
fixed (MKMapPoint *first = &points [0]){ fixed (MKMapPoint* first = &points [0]) {
return PolylineWithPoints ((IntPtr) first, points.Length); return PolylineWithPoints ((IntPtr) first, points.Length);
} }
} }
@ -56,7 +56,7 @@ namespace MapKit {
if (coords.Length == 0) if (coords.Length == 0)
return PolylineWithCoordinates (IntPtr.Zero, 0); return PolylineWithCoordinates (IntPtr.Zero, 0);
fixed (CLLocationCoordinate2D *first = &coords [0]){ fixed (CLLocationCoordinate2D* first = &coords [0]) {
return PolylineWithCoordinates ((IntPtr) first, coords.Length); return PolylineWithCoordinates ((IntPtr) first, coords.Length);
} }
} }

Просмотреть файл

@ -45,13 +45,13 @@ namespace MapKit {
tcs.SetCanceled (); tcs.SetCanceled ();
} else { } else {
var tcr = token.Register (() => { this.Cancel (); tcs.TrySetCanceled (); }); var tcr = token.Register (() => { this.Cancel (); tcs.TrySetCanceled (); });
Start((response, error) => { Start ((response, error) => {
tcr.Dispose (); tcr.Dispose ();
if (token.IsCancellationRequested) { if (token.IsCancellationRequested) {
tcs.TrySetCanceled (); tcs.TrySetCanceled ();
} else { } else {
if (error is not null) if (error is not null)
tcs.SetException (new NSErrorException(error)); tcs.SetException (new NSErrorException (error));
else else
tcs.SetResult (response); tcs.SetResult (response);
} }

Просмотреть файл

@ -26,10 +26,10 @@ namespace MapKit {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("tvos")]
#else #else
[iOS (10,0)] [iOS (10, 0)]
[NoTV] [NoTV]
[Watch (3,0)] [Watch (3, 0)]
[Mac (10,12)] [Mac (10, 12)]
#endif #endif
Default Default
} }
@ -39,8 +39,7 @@ namespace MapKit {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("macos")] [SupportedOSPlatform ("macos")]
#endif #endif
public class MKLaunchOptions public class MKLaunchOptions {
{
public MKDirectionsMode? DirectionsMode { get; set; } public MKDirectionsMode? DirectionsMode { get; set; }
#if !WATCH // MapType: __WATCHOS_PROHIBITED #if !WATCH // MapType: __WATCHOS_PROHIBITED
public MKMapType? MapType { get; set; } public MKMapType? MapType { get; set; }
@ -58,7 +57,7 @@ namespace MapKit {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("macos")] [SupportedOSPlatform ("macos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
#endif #endif
public MKMapCamera? Camera { get; set; } public MKMapCamera? Camera { get; set; }
#endif #endif
@ -78,14 +77,14 @@ namespace MapKit {
#endif #endif
if (n == 0) if (n == 0)
return null; return null;
var keys = new NSObject [n]; var keys = new NSObject [n];
var values = new NSObject [n]; var values = new NSObject [n];
int i = 0; int i = 0;
if (DirectionsMode.HasValue){ if (DirectionsMode.HasValue) {
keys [i] = MKMapItem.MKLaunchOptionsDirectionsModeKey; keys [i] = MKMapItem.MKLaunchOptionsDirectionsModeKey;
NSString v = MKMapItem.MKLaunchOptionsDirectionsModeDriving; NSString v = MKMapItem.MKLaunchOptionsDirectionsModeDriving;
switch (DirectionsMode.Value){ switch (DirectionsMode.Value) {
case MKDirectionsMode.Driving: case MKDirectionsMode.Driving:
v = MKMapItem.MKLaunchOptionsDirectionsModeDriving; v = MKMapItem.MKLaunchOptionsDirectionsModeDriving;
break; break;
@ -105,21 +104,21 @@ namespace MapKit {
} }
#if !WATCH // MapType: __WATCHOS_PROHIBITED #if !WATCH // MapType: __WATCHOS_PROHIBITED
if (MapType.HasValue){ if (MapType.HasValue) {
keys [i] = MKMapItem.MKLaunchOptionsMapTypeKey; keys [i] = MKMapItem.MKLaunchOptionsMapTypeKey;
values [i++] = new NSNumber ((int) MapType.Value); values [i++] = new NSNumber ((int) MapType.Value);
} }
#endif #endif
if (MapCenter.HasValue){ if (MapCenter.HasValue) {
keys [i] = MKMapItem.MKLaunchOptionsMapCenterKey; keys [i] = MKMapItem.MKLaunchOptionsMapCenterKey;
values [i++] = NSValue.FromMKCoordinate (MapCenter.Value); values [i++] = NSValue.FromMKCoordinate (MapCenter.Value);
} }
if (MapSpan.HasValue){ if (MapSpan.HasValue) {
keys [i] = MKMapItem.MKLaunchOptionsMapSpanKey; keys [i] = MKMapItem.MKLaunchOptionsMapSpanKey;
values [i++] = NSValue.FromMKCoordinateSpan (MapSpan.Value); values [i++] = NSValue.FromMKCoordinateSpan (MapSpan.Value);
} }
#if !WATCH // ShowsTraffic: __WATCHOS_PROHIBITED #if !WATCH // ShowsTraffic: __WATCHOS_PROHIBITED
if (ShowTraffic.HasValue){ if (ShowTraffic.HasValue) {
keys [i] = MKMapItem.MKLaunchOptionsShowsTrafficKey; keys [i] = MKMapItem.MKLaunchOptionsShowsTrafficKey;
values [i++] = new NSNumber (ShowTraffic.Value); values [i++] = new NSNumber (ShowTraffic.Value);
} }
@ -145,6 +144,6 @@ namespace MapKit {
return _OpenMaps (mapItems, launchOptions?.ToDictionary ()); return _OpenMaps (mapItems, launchOptions?.ToDictionary ());
} }
} }
} }
#endif #endif

Просмотреть файл

@ -12,7 +12,7 @@ namespace MapKit {
public partial class MKMultiPoint { public partial class MKMultiPoint {
public unsafe MKMapPoint [] Points { public unsafe MKMapPoint [] Points {
get { get {
var source = (MKMapPoint *) _Points; var source = (MKMapPoint*) _Points;
nint n = PointCount; nint n = PointCount;
var result = new MKMapPoint [n]; var result = new MKMapPoint [n];
for (int i = 0; i < n; i++) for (int i = 0; i < n; i++)
@ -26,7 +26,7 @@ namespace MapKit {
{ {
var range = new NSRange (first, count); var range = new NSRange (first, count);
var target = new CLLocationCoordinate2D [count]; var target = new CLLocationCoordinate2D [count];
fixed (CLLocationCoordinate2D *firstE = &target [0]){ fixed (CLLocationCoordinate2D* firstE = &target [0]) {
GetCoords ((IntPtr) firstE, range); GetCoords ((IntPtr) firstE, range);
} }
return target; return target;

Просмотреть файл

@ -23,8 +23,8 @@ namespace MapKit {
[UnsupportedOSPlatform ("ios7.0")] [UnsupportedOSPlatform ("ios7.0")]
[ObsoletedOSPlatform ("ios7.0", "Use 'MKOverlayRenderer' instead.")] [ObsoletedOSPlatform ("ios7.0", "Use 'MKOverlayRenderer' instead.")]
#else #else
[TV (9,2)] [TV (9, 2)]
[Mac (10,9)] [Mac (10, 9)]
#endif #endif
[DllImport (Constants.MapKitLibrary)] [DllImport (Constants.MapKitLibrary)]
public static extern nfloat MKRoadWidthAtZoomScale (/* MKZoomScale */ nfloat zoomScale); public static extern nfloat MKRoadWidthAtZoomScale (/* MKZoomScale */ nfloat zoomScale);

Просмотреть файл

@ -7,17 +7,17 @@ using ObjCRuntime;
namespace MapKit { namespace MapKit {
public enum MKPointOfInterestFilterType { public enum MKPointOfInterestFilterType {
Including, Including,
Excluding, Excluding,
} }
public partial class MKPointOfInterestFilter { public partial class MKPointOfInterestFilter {
public MKPointOfInterestFilter (MKPointOfInterestCategory[] categories) : this (categories, MKPointOfInterestFilterType.Including) public MKPointOfInterestFilter (MKPointOfInterestCategory [] categories) : this (categories, MKPointOfInterestFilterType.Including)
{ {
} }
public MKPointOfInterestFilter (MKPointOfInterestCategory[] categories, MKPointOfInterestFilterType type) public MKPointOfInterestFilter (MKPointOfInterestCategory [] categories, MKPointOfInterestFilterType type)
{ {
// two different `init*` would share the same C# signature // two different `init*` would share the same C# signature
switch (type) { switch (type) {

Просмотреть файл

@ -17,8 +17,8 @@ namespace MapKit {
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (points)); ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (points));
if (points.Length == 0) if (points.Length == 0)
return _FromPoints (IntPtr.Zero, 0); return _FromPoints (IntPtr.Zero, 0);
fixed (MKMapPoint *first = &points [0]){ fixed (MKMapPoint* first = &points [0]) {
return _FromPoints ((IntPtr) first, points.Length); return _FromPoints ((IntPtr) first, points.Length);
} }
} }
@ -29,8 +29,8 @@ namespace MapKit {
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (points)); ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (points));
if (points.Length == 0) if (points.Length == 0)
return _FromPoints (IntPtr.Zero, 0); return _FromPoints (IntPtr.Zero, 0);
fixed (MKMapPoint *first = &points [0]){ fixed (MKMapPoint* first = &points [0]) {
return _FromPoints ((IntPtr) first, points.Length, interiorPolygons); return _FromPoints ((IntPtr) first, points.Length, interiorPolygons);
} }
} }
@ -42,7 +42,7 @@ namespace MapKit {
if (coords.Length == 0) if (coords.Length == 0)
return _FromCoordinates (IntPtr.Zero, 0); return _FromCoordinates (IntPtr.Zero, 0);
fixed (CLLocationCoordinate2D *first = &coords [0]){ fixed (CLLocationCoordinate2D* first = &coords [0]) {
return _FromCoordinates ((IntPtr) first, coords.Length); return _FromCoordinates ((IntPtr) first, coords.Length);
} }
} }
@ -53,8 +53,8 @@ namespace MapKit {
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (coords)); ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (coords));
if (coords.Length == 0) if (coords.Length == 0)
return _FromCoordinates (IntPtr.Zero, 0); return _FromCoordinates (IntPtr.Zero, 0);
fixed (CLLocationCoordinate2D *first = &coords [0]){ fixed (CLLocationCoordinate2D* first = &coords [0]) {
return _FromCoordinates ((IntPtr) first, coords.Length, interiorPolygons); return _FromCoordinates ((IntPtr) first, coords.Length, interiorPolygons);
} }
} }

Просмотреть файл

@ -10,15 +10,15 @@ using ObjCRuntime;
namespace MapKit { namespace MapKit {
public partial class MKPolyline { public partial class MKPolyline {
public static unsafe MKPolyline FromPoints (MKMapPoint [] points) public static unsafe MKPolyline FromPoints (MKMapPoint [] points)
{ {
if (points is null) if (points is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (points)); ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (points));
if (points.Length == 0) if (points.Length == 0)
return _FromPoints (IntPtr.Zero, 0); return _FromPoints (IntPtr.Zero, 0);
fixed (MKMapPoint *first = &points [0]){ fixed (MKMapPoint* first = &points [0]) {
return _FromPoints ((IntPtr) first, points.Length); return _FromPoints ((IntPtr) first, points.Length);
} }
} }
@ -29,8 +29,8 @@ namespace MapKit {
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (coords)); ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (coords));
if (coords.Length == 0) if (coords.Length == 0)
return _FromCoordinates (IntPtr.Zero, 0); return _FromCoordinates (IntPtr.Zero, 0);
fixed (CLLocationCoordinate2D *first = &coords [0]){ fixed (CLLocationCoordinate2D* first = &coords [0]) {
return _FromCoordinates ((IntPtr) first, coords.Length); return _FromCoordinates ((IntPtr) first, coords.Length);
} }
} }

Просмотреть файл

@ -28,8 +28,7 @@ namespace MapKit {
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#endif #endif
[StructLayout (LayoutKind.Sequential)] [StructLayout (LayoutKind.Sequential)]
public struct MKTileOverlayPath public struct MKTileOverlayPath {
{
public /* NSInteger */ nint X; public /* NSInteger */ nint X;
public /* NSInteger */ nint Y; public /* NSInteger */ nint Y;
public /* NSInteger */ nint Z; public /* NSInteger */ nint Z;
@ -49,7 +48,7 @@ namespace MapKit {
public struct MKCoordinateSpan { public struct MKCoordinateSpan {
public /* CLLocationDegrees */ double LatitudeDelta; public /* CLLocationDegrees */ double LatitudeDelta;
public /* CLLocationDegrees */ double LongitudeDelta; public /* CLLocationDegrees */ double LongitudeDelta;
// MKCoordinateSpanMake // MKCoordinateSpanMake
public MKCoordinateSpan (double latitudeDelta, double longitudeDelta) public MKCoordinateSpan (double latitudeDelta, double longitudeDelta)
{ {
@ -70,7 +69,7 @@ namespace MapKit {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[Mac (10,9)] [Mac (10, 9)]
#endif #endif
[StructLayout (LayoutKind.Sequential)] [StructLayout (LayoutKind.Sequential)]
public struct MKCoordinateRegion { public struct MKCoordinateRegion {
@ -85,10 +84,10 @@ namespace MapKit {
} }
// note: CLLocationDistance is double - see CLLocation.h // note: CLLocationDistance is double - see CLLocation.h
[DllImport (Constants.MapKitLibrary, EntryPoint="MKCoordinateRegionMakeWithDistance")] [DllImport (Constants.MapKitLibrary, EntryPoint = "MKCoordinateRegionMakeWithDistance")]
extern static public MKCoordinateRegion FromDistance (CLLocationCoordinate2D center, /* CLLocationDistance */ double latitudinalMeters, /* CLLocationDistance */ double longitudinalMeters); extern static public MKCoordinateRegion FromDistance (CLLocationCoordinate2D center, /* CLLocationDistance */ double latitudinalMeters, /* CLLocationDistance */ double longitudinalMeters);
[DllImport (Constants.MapKitLibrary, EntryPoint="MKCoordinateRegionForMapRect")] [DllImport (Constants.MapKitLibrary, EntryPoint = "MKCoordinateRegionForMapRect")]
extern static public MKCoordinateRegion FromMapRect (MKMapRect rect); extern static public MKCoordinateRegion FromMapRect (MKMapRect rect);
public override string ToString () public override string ToString ()
@ -104,25 +103,25 @@ namespace MapKit {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[Mac (10,9)] [Mac (10, 9)]
#endif #endif
[StructLayout (LayoutKind.Sequential)] [StructLayout (LayoutKind.Sequential)]
public struct MKMapPoint { public struct MKMapPoint {
public double X, Y; public double X, Y;
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapPointForCoordinate")] [DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapPointForCoordinate")]
public extern static MKMapPoint FromCoordinate (CLLocationCoordinate2D coordinate); public extern static MKMapPoint FromCoordinate (CLLocationCoordinate2D coordinate);
[DllImport (Constants.MapKitLibrary, EntryPoint="MKCoordinateForMapPoint")] [DllImport (Constants.MapKitLibrary, EntryPoint = "MKCoordinateForMapPoint")]
public extern static CLLocationCoordinate2D ToCoordinate (MKMapPoint mapPoint); public extern static CLLocationCoordinate2D ToCoordinate (MKMapPoint mapPoint);
// MKMapPointMake // MKMapPointMake
public MKMapPoint (double x, double y) public MKMapPoint (double x, double y)
{ {
X = x; X = x;
Y = y; Y = y;
} }
// MKMapPointEqualToPoint // MKMapPointEqualToPoint
public static bool operator == (MKMapPoint a, MKMapPoint b) public static bool operator == (MKMapPoint a, MKMapPoint b)
{ {
@ -136,7 +135,7 @@ namespace MapKit {
public override bool Equals (object? other) public override bool Equals (object? other)
{ {
if (other is MKMapPoint){ if (other is MKMapPoint) {
var omap = (MKMapPoint) other; var omap = (MKMapPoint) other;
return omap.X == X && omap.Y == Y; return omap.X == X && omap.Y == Y;
@ -148,7 +147,7 @@ namespace MapKit {
{ {
return (int) (X + Y); return (int) (X + Y);
} }
// MKStringFromMapPoint does not really exists, it's inlined in MKGeometry.h // MKStringFromMapPoint does not really exists, it's inlined in MKGeometry.h
public override string ToString () public override string ToString ()
{ {
@ -166,7 +165,7 @@ namespace MapKit {
[StructLayout (LayoutKind.Sequential)] [StructLayout (LayoutKind.Sequential)]
public struct MKMapSize { public struct MKMapSize {
public double Width, Height; public double Width, Height;
// MKMapSizeMake // MKMapSizeMake
public MKMapSize (double width, double height) public MKMapSize (double width, double height)
{ {
@ -180,10 +179,10 @@ namespace MapKit {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("macos")] [SupportedOSPlatform ("macos")]
#else #else
[TV (9,2)] [TV (9, 2)]
#endif #endif
public static MKMapSize World { get { return new MKMapSize (0x10000000, 0x10000000); }} public static MKMapSize World { get { return new MKMapSize (0x10000000, 0x10000000); } }
// MKMapSizeEqualToSize // MKMapSizeEqualToSize
public static bool operator == (MKMapSize a, MKMapSize b) public static bool operator == (MKMapSize a, MKMapSize b)
{ {
@ -209,7 +208,7 @@ namespace MapKit {
{ {
return (int) (Width + Height); return (int) (Width + Height);
} }
// MKStringFromMapSize does not really exists, it's inlined in MKGeometry.h // MKStringFromMapSize does not really exists, it's inlined in MKGeometry.h
public override string ToString () public override string ToString ()
{ {
@ -224,7 +223,7 @@ namespace MapKit {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[Mac (10,9)] [Mac (10, 9)]
#endif #endif
[StructLayout (LayoutKind.Sequential)] [StructLayout (LayoutKind.Sequential)]
public struct MKMapRect { public struct MKMapRect {
@ -234,7 +233,7 @@ namespace MapKit {
[SupportedOSPlatform ("ios")] [SupportedOSPlatform ("ios")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[TV (9,2)] [TV (9, 2)]
#endif #endif
public static readonly MKMapRect Null = new MKMapRect (double.PositiveInfinity, double.PositiveInfinity, 0, 0); public static readonly MKMapRect Null = new MKMapRect (double.PositiveInfinity, double.PositiveInfinity, 0, 0);
@ -255,14 +254,14 @@ namespace MapKit {
Size.Width = width; Size.Width = width;
Size.Height = height; Size.Height = height;
} }
// MKMapRectGetMinX // MKMapRectGetMinX
public double MinX { public double MinX {
get { get {
return Origin.X; return Origin.X;
} }
} }
// MKMapRectGetMinY // MKMapRectGetMinY
public double MinY { public double MinY {
get { get {
@ -276,49 +275,49 @@ namespace MapKit {
return Origin.X + Size.Width; return Origin.X + Size.Width;
} }
} }
// MKMapRectGetMaxY // MKMapRectGetMaxY
public double MaxY { public double MaxY {
get { get {
return Origin.Y + Size.Height; return Origin.Y + Size.Height;
} }
} }
// MKMapRectGetMidX // MKMapRectGetMidX
public double MidX { public double MidX {
get { get {
return Origin.X + Size.Width / 2.0; return Origin.X + Size.Width / 2.0;
} }
} }
// MKMapRectGetMidY // MKMapRectGetMidY
public double MidY { public double MidY {
get { get {
return Origin.Y + Size.Height / 2.0; return Origin.Y + Size.Height / 2.0;
} }
} }
// MKMapRectGetWidth // MKMapRectGetWidth
public double Width { public double Width {
get { get {
return Size.Width; return Size.Width;
} }
} }
// MKMapRectGetHeight // MKMapRectGetHeight
public double Height { public double Height {
get { get {
return Size.Height; return Size.Height;
} }
} }
// MKMapRectIsNull // MKMapRectIsNull
public bool IsNull { public bool IsNull {
get { get {
return Double.IsInfinity (Origin.X) || Double.IsInfinity (Origin.Y); return Double.IsInfinity (Origin.X) || Double.IsInfinity (Origin.Y);
} }
} }
// MKMapRectIsEmpty // MKMapRectIsEmpty
public bool IsEmpty { public bool IsEmpty {
get { get {
@ -332,14 +331,14 @@ namespace MapKit {
[SupportedOSPlatform ("ios")] [SupportedOSPlatform ("ios")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[TV (9,2)] [TV (9, 2)]
#endif #endif
public MKMapRect World { public MKMapRect World {
get { get {
return new MKMapRect (0, 0, 0x10000000, 0x10000000); return new MKMapRect (0, 0, 0x10000000, 0x10000000);
} }
} }
// MKMapRectEqualToRect // MKMapRectEqualToRect
public static bool operator == (MKMapRect a, MKMapRect b) public static bool operator == (MKMapRect a, MKMapRect b)
{ {
@ -365,58 +364,58 @@ namespace MapKit {
{ {
return Origin.GetHashCode () ^ Size.GetHashCode (); return Origin.GetHashCode () ^ Size.GetHashCode ();
} }
// MKStringFromMapRect does not really exists, it's inlined in MKGeometry.h // MKStringFromMapRect does not really exists, it's inlined in MKGeometry.h
public override string ToString () public override string ToString ()
{ {
return string.Format ("{{{0}, {1}}}", Origin, Size); return string.Format ("{{{0}, {1}}}", Origin, Size);
} }
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectContainsPoint")] [DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectContainsPoint")]
[return: MarshalAs (UnmanagedType.I1)] [return: MarshalAs (UnmanagedType.I1)]
static extern bool MKMapRectContainsPoint (MKMapRect rect, MKMapPoint point); static extern bool MKMapRectContainsPoint (MKMapRect rect, MKMapPoint point);
public bool Contains (MKMapPoint point) public bool Contains (MKMapPoint point)
{ {
return MKMapRectContainsPoint (this, point); return MKMapRectContainsPoint (this, point);
} }
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectContainsRect")] [DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectContainsRect")]
[return: MarshalAs (UnmanagedType.I1)] [return: MarshalAs (UnmanagedType.I1)]
static extern bool MKMapRectContainsRect (MKMapRect rect1, MKMapRect rect2); static extern bool MKMapRectContainsRect (MKMapRect rect1, MKMapRect rect2);
public bool Contains (MKMapRect rect) public bool Contains (MKMapRect rect)
{ {
return MKMapRectContainsRect (this, rect); return MKMapRectContainsRect (this, rect);
} }
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectUnion")] [DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectUnion")]
static public extern MKMapRect Union (MKMapRect rect1, MKMapRect rect2); static public extern MKMapRect Union (MKMapRect rect1, MKMapRect rect2);
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectIntersection")] [DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectIntersection")]
static public extern MKMapRect Intersection (MKMapRect rect1, MKMapRect rect2); static public extern MKMapRect Intersection (MKMapRect rect1, MKMapRect rect2);
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectIntersectsRect")] [DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectIntersectsRect")]
[return: MarshalAs (UnmanagedType.I1)] [return: MarshalAs (UnmanagedType.I1)]
static public extern bool Intersects (MKMapRect rect1, MKMapRect rect2); static public extern bool Intersects (MKMapRect rect1, MKMapRect rect2);
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectInset")] [DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectInset")]
static extern MKMapRect MKMapRectInset (MKMapRect rect, double dx, double dy); static extern MKMapRect MKMapRectInset (MKMapRect rect, double dx, double dy);
public MKMapRect Inset (double dx, double dy) public MKMapRect Inset (double dx, double dy)
{ {
return MKMapRectInset (this, dx, dy); return MKMapRectInset (this, dx, dy);
} }
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectOffset")] [DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectOffset")]
static extern MKMapRect MKMapRectOffset (MKMapRect rect, double dx, double dy); static extern MKMapRect MKMapRectOffset (MKMapRect rect, double dx, double dy);
public MKMapRect Offset (double dx, double dy) public MKMapRect Offset (double dx, double dy)
{ {
return MKMapRectOffset (this, dx, dy); return MKMapRectOffset (this, dx, dy);
} }
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectDivide")] [DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectDivide")]
static extern void MKMapRectDivide (MKMapRect rect, out MKMapRect slice, out MKMapRect remainder, double amount, CGRectEdge edge); static extern void MKMapRectDivide (MKMapRect rect, out MKMapRect slice, out MKMapRect remainder, double amount, CGRectEdge edge);
public MKMapRect Divide (double amount, CGRectEdge edge, out MKMapRect remainder) public MKMapRect Divide (double amount, CGRectEdge edge, out MKMapRect remainder)
@ -425,18 +424,18 @@ namespace MapKit {
MKMapRectDivide (this, out slice, out remainder, amount, edge); MKMapRectDivide (this, out slice, out remainder, amount, edge);
return slice; return slice;
} }
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectSpans180thMeridian")] [DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectSpans180thMeridian")]
[return: MarshalAs (UnmanagedType.I1)] [return: MarshalAs (UnmanagedType.I1)]
static extern bool MKMapRectSpans180thMeridian (MKMapRect rect); static extern bool MKMapRectSpans180thMeridian (MKMapRect rect);
public bool Spans180thMeridian { public bool Spans180thMeridian {
get { return MKMapRectSpans180thMeridian (this); } get { return MKMapRectSpans180thMeridian (this); }
} }
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectRemainder")] [DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectRemainder")]
static extern MKMapRect MKMapRectRemainder (MKMapRect rect); static extern MKMapRect MKMapRectRemainder (MKMapRect rect);
public MKMapRect Remainder () public MKMapRect Remainder ()
{ {
return MKMapRectRemainder (this); return MKMapRectRemainder (this);
@ -450,17 +449,17 @@ namespace MapKit {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[Mac (10,9)] [Mac (10, 9)]
#endif #endif
public static class MKGeometry { public static class MKGeometry {
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapPointsPerMeterAtLatitude")] [DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapPointsPerMeterAtLatitude")]
static extern public double MapPointsPerMeterAtLatitude (/* CLLocationDegrees */ double latitude); static extern public double MapPointsPerMeterAtLatitude (/* CLLocationDegrees */ double latitude);
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMetersPerMapPointAtLatitude")] [DllImport (Constants.MapKitLibrary, EntryPoint = "MKMetersPerMapPointAtLatitude")]
static extern public /* CLLocationDistance */ double MetersPerMapPointAtLatitude (/* CLLocationDegrees */ double latitude); static extern public /* CLLocationDistance */ double MetersPerMapPointAtLatitude (/* CLLocationDegrees */ double latitude);
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMetersBetweenMapPoints")] [DllImport (Constants.MapKitLibrary, EntryPoint = "MKMetersBetweenMapPoints")]
static extern public /* CLLocationDistance */ double MetersBetweenMapPoints (MKMapPoint a, MKMapPoint b); static extern public /* CLLocationDistance */ double MetersBetweenMapPoints (MKMapPoint a, MKMapPoint b);
} }

Просмотреть файл

@ -18,14 +18,16 @@ using Foundation;
namespace MediaAccessibility { namespace MediaAccessibility {
[Native] [Native]
[iOS (7,0)][Mac (10,9)] [iOS (7, 0)]
[Mac (10, 9)]
public enum MACaptionAppearanceDomain : long { public enum MACaptionAppearanceDomain : long {
Default = 0, Default = 0,
User = 1, User = 1,
} }
[Native] [Native]
[iOS (7,0)][Mac (10,9)] [iOS (7, 0)]
[Mac (10, 9)]
public enum MACaptionAppearanceDisplayType : long { public enum MACaptionAppearanceDisplayType : long {
ForcedOnly = 0, ForcedOnly = 0,
Automatic = 1, Automatic = 1,
@ -33,14 +35,16 @@ namespace MediaAccessibility {
} }
[Native] [Native]
[iOS (7,0)][Mac (10,9)] [iOS (7, 0)]
[Mac (10, 9)]
public enum MACaptionAppearanceBehavior : long { public enum MACaptionAppearanceBehavior : long {
UseValue = 0, UseValue = 0,
UseContentIfAvailable = 1, UseContentIfAvailable = 1,
} }
[Native] [Native]
[iOS (7,0)][Mac (10,9)] [iOS (7, 0)]
[Mac (10, 9)]
public enum MACaptionAppearanceFontStyle : long { public enum MACaptionAppearanceFontStyle : long {
Default = 0, Default = 0,
MonospacedWithSerif = 1, MonospacedWithSerif = 1,
@ -53,7 +57,8 @@ namespace MediaAccessibility {
} }
[Native] [Native]
[iOS (7,0)][Mac (10,9)] [iOS (7, 0)]
[Mac (10, 9)]
public enum MACaptionAppearanceTextEdgeStyle : long { public enum MACaptionAppearanceTextEdgeStyle : long {
Undefined = 0, Undefined = 0,
None = 1, None = 1,

Просмотреть файл

@ -17,9 +17,9 @@ namespace MediaAccessibility {
[SupportedOSPlatform ("ios13.0")] [SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[TV (13,0)] [TV (13, 0)]
[Mac (10,15)] [Mac (10, 15)]
[iOS (13,0)] [iOS (13, 0)]
#endif #endif
public static partial class MAImageCaptioning { public static partial class MAImageCaptioning {

Просмотреть файл

@ -25,8 +25,8 @@ namespace MediaAccessibility {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (7,0)] [iOS (7, 0)]
[Mac (10,9)] [Mac (10, 9)]
#endif #endif
public static partial class MACaptionAppearance { public static partial class MACaptionAppearance {
@ -54,7 +54,7 @@ namespace MediaAccessibility {
[DllImport (Constants.MediaAccessibilityLibrary)] [DllImport (Constants.MediaAccessibilityLibrary)]
[return: MarshalAs (UnmanagedType.I1)] [return: MarshalAs (UnmanagedType.I1)]
static extern bool MACaptionAppearanceAddSelectedLanguage (nint domain, static extern bool MACaptionAppearanceAddSelectedLanguage (nint domain,
/* CFStringRef __nonnull */ IntPtr language); /* CFStringRef __nonnull */ IntPtr language);
public static bool AddSelectedLanguage (MACaptionAppearanceDomain domain, string language) public static bool AddSelectedLanguage (MACaptionAppearanceDomain domain, string language)
@ -73,7 +73,7 @@ namespace MediaAccessibility {
using (var langs = new CFArray (MACaptionAppearanceCopySelectedLanguages ((int) domain), owns: true)) { using (var langs = new CFArray (MACaptionAppearanceCopySelectedLanguages ((int) domain), owns: true)) {
var languages = new string? [langs.Count]; var languages = new string? [langs.Count];
for (int i = 0; i < langs.Count; i++) { for (int i = 0; i < langs.Count; i++) {
languages[i] = CFString.FromHandle (langs.GetValue (i)); languages [i] = CFString.FromHandle (langs.GetValue (i));
} }
return languages; return languages;
} }
@ -81,12 +81,12 @@ namespace MediaAccessibility {
[DllImport (Constants.MediaAccessibilityLibrary)] [DllImport (Constants.MediaAccessibilityLibrary)]
static extern nint MACaptionAppearanceGetDisplayType (nint domain); static extern nint MACaptionAppearanceGetDisplayType (nint domain);
public static MACaptionAppearanceDisplayType GetDisplayType (MACaptionAppearanceDomain domain) public static MACaptionAppearanceDisplayType GetDisplayType (MACaptionAppearanceDomain domain)
{ {
return (MACaptionAppearanceDisplayType) (int) MACaptionAppearanceGetDisplayType ((int) domain); return (MACaptionAppearanceDisplayType) (int) MACaptionAppearanceGetDisplayType ((int) domain);
} }
[DllImport (Constants.MediaAccessibilityLibrary)] [DllImport (Constants.MediaAccessibilityLibrary)]
static extern void MACaptionAppearanceSetDisplayType (nint domain, nint displayType); static extern void MACaptionAppearanceSetDisplayType (nint domain, nint displayType);
@ -103,16 +103,16 @@ namespace MediaAccessibility {
using (var chars = new CFArray (MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics ((int) domain), owns: true)) { using (var chars = new CFArray (MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics ((int) domain), owns: true)) {
NSString [] characteristics = new NSString [chars.Count]; NSString [] characteristics = new NSString [chars.Count];
for (int i = 0; i < chars.Count; i++) { for (int i = 0; i < chars.Count; i++) {
characteristics[i] = new NSString (chars.GetValue (i)); characteristics [i] = new NSString (chars.GetValue (i));
} }
return characteristics; return characteristics;
} }
} }
[DllImport (Constants.MediaAccessibilityLibrary)] [DllImport (Constants.MediaAccessibilityLibrary)]
static extern /* CGColorRef __nonnull */ IntPtr MACaptionAppearanceCopyForegroundColor (nint domain, static extern /* CGColorRef __nonnull */ IntPtr MACaptionAppearanceCopyForegroundColor (nint domain,
/* MACaptionAppearanceBehavior * __nullable */ ref nint behavior); /* MACaptionAppearanceBehavior * __nullable */ ref nint behavior);
public static CGColor GetForegroundColor (MACaptionAppearanceDomain domain, ref MACaptionAppearanceBehavior behavior) public static CGColor GetForegroundColor (MACaptionAppearanceDomain domain, ref MACaptionAppearanceBehavior behavior)
{ {
nint b = (int) behavior; nint b = (int) behavior;
@ -122,7 +122,7 @@ namespace MediaAccessibility {
} }
[DllImport (Constants.MediaAccessibilityLibrary)] [DllImport (Constants.MediaAccessibilityLibrary)]
static extern /* CGColorRef __nonnull */ IntPtr MACaptionAppearanceCopyBackgroundColor (nint domain, static extern /* CGColorRef __nonnull */ IntPtr MACaptionAppearanceCopyBackgroundColor (nint domain,
/* MACaptionAppearanceBehavior * __nullable */ ref nint behavior); /* MACaptionAppearanceBehavior * __nullable */ ref nint behavior);
public static CGColor GetBackgroundColor (MACaptionAppearanceDomain domain, ref MACaptionAppearanceBehavior behavior) public static CGColor GetBackgroundColor (MACaptionAppearanceDomain domain, ref MACaptionAppearanceBehavior behavior)
@ -134,7 +134,7 @@ namespace MediaAccessibility {
} }
[DllImport (Constants.MediaAccessibilityLibrary)] [DllImport (Constants.MediaAccessibilityLibrary)]
static extern /* CGColorRef __nonnull */ IntPtr MACaptionAppearanceCopyWindowColor (nint domain, static extern /* CGColorRef __nonnull */ IntPtr MACaptionAppearanceCopyWindowColor (nint domain,
/* MACaptionAppearanceBehavior * __nullable */ ref nint behavior); /* MACaptionAppearanceBehavior * __nullable */ ref nint behavior);
public static CGColor GetWindowColor (MACaptionAppearanceDomain domain, ref MACaptionAppearanceBehavior behavior) public static CGColor GetWindowColor (MACaptionAppearanceDomain domain, ref MACaptionAppearanceBehavior behavior)
@ -193,7 +193,7 @@ namespace MediaAccessibility {
} }
[DllImport (Constants.MediaAccessibilityLibrary)] [DllImport (Constants.MediaAccessibilityLibrary)]
static extern /* CTFontDescriptorRef __nonnull */ IntPtr MACaptionAppearanceCopyFontDescriptorForStyle (nint domain, static extern /* CTFontDescriptorRef __nonnull */ IntPtr MACaptionAppearanceCopyFontDescriptorForStyle (nint domain,
/* MACaptionAppearanceBehavior * __nullable */ ref nint behavior, nint fontStyle); /* MACaptionAppearanceBehavior * __nullable */ ref nint behavior, nint fontStyle);
public static CTFontDescriptor GetFontDescriptor (MACaptionAppearanceDomain domain, ref MACaptionAppearanceBehavior behavior, MACaptionAppearanceFontStyle fontStyle) public static CTFontDescriptor GetFontDescriptor (MACaptionAppearanceDomain domain, ref MACaptionAppearanceBehavior behavior, MACaptionAppearanceFontStyle fontStyle)
@ -234,9 +234,9 @@ namespace MediaAccessibility {
[SupportedOSPlatform ("ios13.0")] [SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[TV (13,0)] [TV (13, 0)]
[Mac (10,15)] [Mac (10, 15)]
[iOS (13,0)] [iOS (13, 0)]
#endif #endif
[DllImport (Constants.MediaAccessibilityLibrary)] [DllImport (Constants.MediaAccessibilityLibrary)]
static extern void MACaptionAppearanceDidDisplayCaptions (IntPtr /* CFArratRef */ strings); static extern void MACaptionAppearanceDidDisplayCaptions (IntPtr /* CFArratRef */ strings);
@ -247,11 +247,11 @@ namespace MediaAccessibility {
[SupportedOSPlatform ("ios13.0")] [SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[TV (13,0)] [TV (13, 0)]
[Mac (10,15)] [Mac (10, 15)]
[iOS (13,0)] [iOS (13, 0)]
#endif #endif
public static void DidDisplayCaptions (string[] strings) public static void DidDisplayCaptions (string [] strings)
{ {
if ((strings is null) || (strings.Length == 0)) if ((strings is null) || (strings.Length == 0))
MACaptionAppearanceDidDisplayCaptions (IntPtr.Zero); MACaptionAppearanceDidDisplayCaptions (IntPtr.Zero);
@ -267,11 +267,11 @@ namespace MediaAccessibility {
[SupportedOSPlatform ("ios13.0")] [SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[TV (13,0)] [TV (13, 0)]
[Mac (10,15)] [Mac (10, 15)]
[iOS (13,0)] [iOS (13, 0)]
#endif #endif
public static void DidDisplayCaptions (NSAttributedString[] strings) public static void DidDisplayCaptions (NSAttributedString [] strings)
{ {
// CFAttributedString is “toll-free bridged” with its Foundation counterpart, NSAttributedString. // CFAttributedString is “toll-free bridged” with its Foundation counterpart, NSAttributedString.
// https://developer.apple.com/documentation/corefoundation/cfattributedstring?language=objc // https://developer.apple.com/documentation/corefoundation/cfattributedstring?language=objc
@ -297,15 +297,15 @@ namespace MediaAccessibility {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (8,0)] [iOS (8, 0)]
[Mac (10,10)] [Mac (10, 10)]
#endif #endif
[DllImport (Constants.MediaAccessibilityLibrary)] [DllImport (Constants.MediaAccessibilityLibrary)]
static extern unsafe IntPtr /* CFArrayRef __nonnull */ MAAudibleMediaCopyPreferredCharacteristics (); static extern unsafe IntPtr /* CFArrayRef __nonnull */ MAAudibleMediaCopyPreferredCharacteristics ();
// according to webkit source code (the only use I could find) this is an array of CFString // according to webkit source code (the only use I could find) this is an array of CFString
// https://github.com/WebKit/webkit/blob/master/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp // https://github.com/WebKit/webkit/blob/master/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp
static public string?[]? GetPreferredCharacteristics () static public string? []? GetPreferredCharacteristics ()
{ {
var handle = MAAudibleMediaCopyPreferredCharacteristics (); var handle = MAAudibleMediaCopyPreferredCharacteristics ();
if (handle == IntPtr.Zero) if (handle == IntPtr.Zero)

Просмотреть файл

@ -25,16 +25,14 @@ using ObjCRuntime;
namespace MediaLibrary { namespace MediaLibrary {
[Native] [Native]
public enum MLMediaSourceType : ulong public enum MLMediaSourceType : ulong {
{
Audio = 1 << 0, Audio = 1 << 0,
Image = 1 << 1, Image = 1 << 1,
Movie = 1 << 2 Movie = 1 << 2
} }
[Native] [Native]
public enum MLMediaType : ulong public enum MLMediaType : ulong {
{
Audio = 1 << 0, Audio = 1 << 0,
Image = 1 << 1, Image = 1 << 1,
Movie = 1 << 2 Movie = 1 << 2

Просмотреть файл

@ -13,7 +13,7 @@
using System; using System;
using System.Collections; using System.Collections;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
using CoreGraphics; using CoreGraphics;
@ -72,7 +72,7 @@ namespace MediaPlayer {
return UInt64ForProperty (AlbumPersistentIDProperty); return UInt64ForProperty (AlbumPersistentIDProperty);
} }
} }
public ulong ArtistPersistentID { public ulong ArtistPersistentID {
get { get {
return UInt64ForProperty (ArtistPersistentIDProperty); return UInt64ForProperty (ArtistPersistentIDProperty);
@ -264,14 +264,14 @@ namespace MediaPlayer {
return Int32ForProperty (IsCloudItemProperty) != 0; return Int32ForProperty (IsCloudItemProperty) != 0;
} }
} }
#if NET #if NET
[SupportedOSPlatform ("ios9.2")] [SupportedOSPlatform ("ios9.2")]
[SupportedOSPlatform ("macos10.12.2")] [SupportedOSPlatform ("macos10.12.2")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (9,2)] [iOS (9, 2)]
#endif #endif
public bool HasProtectedAsset { public bool HasProtectedAsset {
get { get {
@ -285,7 +285,7 @@ namespace MediaPlayer {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (10,0)] [iOS (10, 0)]
#endif #endif
public bool IsExplicitItem { public bool IsExplicitItem {
get { get {
@ -299,7 +299,7 @@ namespace MediaPlayer {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (10,0)] [iOS (10, 0)]
#endif #endif
public NSDate? DateAdded { public NSDate? DateAdded {
get { get {
@ -313,7 +313,7 @@ namespace MediaPlayer {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (10,3)] [iOS (10, 3)]
#endif #endif
public NSString? PlaybackStoreID { public NSString? PlaybackStoreID {
get { get {
@ -327,10 +327,10 @@ namespace MediaPlayer {
[SupportedOSPlatform ("ios14.5")] [SupportedOSPlatform ("ios14.5")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[Watch (7,4)] [Watch (7, 4)]
[TV (14,5)] [TV (14, 5)]
[Mac (11,3)] [Mac (11, 3)]
[iOS (14,5)] [iOS (14, 5)]
#endif #endif
public bool IsPreorder { public bool IsPreorder {
get { get {

Просмотреть файл

@ -11,7 +11,7 @@
using System; using System;
using System.Collections; using System.Collections;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
using CoreGraphics; using CoreGraphics;

Просмотреть файл

@ -12,15 +12,14 @@
#if !TVOS && !MONOMAC && !WATCH #if !TVOS && !MONOMAC && !WATCH
using System; using System;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
#nullable enable #nullable enable
namespace MediaPlayer { namespace MediaPlayer {
public partial class MPMediaQuery public partial class MPMediaQuery {
{
public MPMediaItem GetItem (nuint index) public MPMediaItem GetItem (nuint index)
{ {
using (var array = new NSArray (Messaging.IntPtr_objc_msgSend (Handle, Selector.GetHandle ("items")))) using (var array = new NSArray (Messaging.IntPtr_objc_msgSend (Handle, Selector.GetHandle ("items"))))

Просмотреть файл

@ -22,13 +22,13 @@ namespace MediaPlayer {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[Mac (10,12,2)] [Mac (10, 12, 2)]
#endif #endif
public class MPNowPlayingInfo { public class MPNowPlayingInfo {
public MPNowPlayingInfo () public MPNowPlayingInfo ()
{ {
} }
public double? ElapsedPlaybackTime; public double? ElapsedPlaybackTime;
public double? PlaybackRate; public double? PlaybackRate;
public int? PlaybackQueueIndex; public int? PlaybackQueueIndex;
@ -37,7 +37,7 @@ namespace MediaPlayer {
public int? ChapterCount; public int? ChapterCount;
public int? AlbumTrackCount; public int? AlbumTrackCount;
public int? AlbumTrackNumber; public int? AlbumTrackNumber;
public int? DiscCount; public int? DiscCount;
public int? DiscNumber; public int? DiscNumber;
public ulong? PersistentID; public ulong? PersistentID;
public double? PlaybackDuration; public double? PlaybackDuration;
@ -47,7 +47,7 @@ namespace MediaPlayer {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (8,0)] [iOS (8, 0)]
#endif #endif
public double? DefaultPlaybackRate; public double? DefaultPlaybackRate;
@ -57,25 +57,25 @@ namespace MediaPlayer {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (9,0)] [iOS (9, 0)]
#endif #endif
public MPNowPlayingInfoLanguageOptionGroup[]? AvailableLanguageOptions { get; set; } public MPNowPlayingInfoLanguageOptionGroup []? AvailableLanguageOptions { get; set; }
#if NET #if NET
[SupportedOSPlatform ("ios9.0")] [SupportedOSPlatform ("ios9.0")]
[SupportedOSPlatform ("macos10.12.2")] [SupportedOSPlatform ("macos10.12.2")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (9,0)] [iOS (9, 0)]
#endif #endif
public MPNowPlayingInfoLanguageOption[]? CurrentLanguageOptions { get; set; } public MPNowPlayingInfoLanguageOption []? CurrentLanguageOptions { get; set; }
#if NET #if NET
[SupportedOSPlatform ("ios10.0")] [SupportedOSPlatform ("ios10.0")]
[SupportedOSPlatform ("macos10.12.2")] [SupportedOSPlatform ("macos10.12.2")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (10,0)] [iOS (10, 0)]
#endif #endif
public string? CollectionIdentifier { get; set; } public string? CollectionIdentifier { get; set; }
#if NET #if NET
@ -84,7 +84,7 @@ namespace MediaPlayer {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (10,0)] [iOS (10, 0)]
#endif #endif
public string? ExternalContentIdentifier { get; set; } public string? ExternalContentIdentifier { get; set; }
#if NET #if NET
@ -93,7 +93,7 @@ namespace MediaPlayer {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (10,0)] [iOS (10, 0)]
#endif #endif
public string? ExternalUserProfileIdentifier { get; set; } public string? ExternalUserProfileIdentifier { get; set; }
#if NET #if NET
@ -102,7 +102,7 @@ namespace MediaPlayer {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (10,0)] [iOS (10, 0)]
#endif #endif
public float? PlaybackProgress { get; set; } public float? PlaybackProgress { get; set; }
#if NET #if NET
@ -111,7 +111,7 @@ namespace MediaPlayer {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (10,0)] [iOS (10, 0)]
#endif #endif
public MPNowPlayingInfoMediaType? MediaType { get; set; } public MPNowPlayingInfoMediaType? MediaType { get; set; }
#if NET #if NET
@ -120,7 +120,7 @@ namespace MediaPlayer {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (10,0)] [iOS (10, 0)]
#endif #endif
public bool? IsLiveStream { get; set; } public bool? IsLiveStream { get; set; }
#if NET #if NET
@ -129,7 +129,7 @@ namespace MediaPlayer {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (10,3)] [iOS (10, 3)]
#endif #endif
public NSUrl? AssetUrl { get; set; } public NSUrl? AssetUrl { get; set; }
#if NET #if NET
@ -138,9 +138,9 @@ namespace MediaPlayer {
[SupportedOSPlatform ("macos10.13.1")] [SupportedOSPlatform ("macos10.13.1")]
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
#else #else
[iOS (11,1)] [iOS (11, 1)]
[TV (11,1)] [TV (11, 1)]
[Mac (10,13,1)] [Mac (10, 13, 1)]
#endif #endif
public NSDate? CurrentPlaybackDate { get; set; } public NSDate? CurrentPlaybackDate { get; set; }
@ -183,7 +183,7 @@ namespace MediaPlayer {
if (PlaybackProgress.HasValue) if (PlaybackProgress.HasValue)
Add (dict, MPNowPlayingInfoCenter.PropertyPlaybackProgress, new NSNumber (PlaybackProgress.Value)); Add (dict, MPNowPlayingInfoCenter.PropertyPlaybackProgress, new NSNumber (PlaybackProgress.Value));
if (MediaType.HasValue) if (MediaType.HasValue)
Add (dict, MPNowPlayingInfoCenter.PropertyMediaType, new NSNumber ((int)MediaType.Value)); Add (dict, MPNowPlayingInfoCenter.PropertyMediaType, new NSNumber ((int) MediaType.Value));
if (IsLiveStream.HasValue) if (IsLiveStream.HasValue)
Add (dict, MPNowPlayingInfoCenter.PropertyIsLiveStream, new NSNumber (IsLiveStream.Value)); Add (dict, MPNowPlayingInfoCenter.PropertyIsLiveStream, new NSNumber (IsLiveStream.Value));
if (AssetUrl is not null) if (AssetUrl is not null)
@ -238,7 +238,7 @@ namespace MediaPlayer {
{ {
if (source is null) if (source is null)
return; return;
NSObject? result; NSObject? result;
if (TryGetValue (source, MPNowPlayingInfoCenter.PropertyElapsedPlaybackTime, out result)) if (TryGetValue (source, MPNowPlayingInfoCenter.PropertyElapsedPlaybackTime, out result))

Просмотреть файл

@ -15,13 +15,13 @@ using ObjCRuntime;
namespace MediaPlayer { namespace MediaPlayer {
public partial class MPSkipIntervalCommand { public partial class MPSkipIntervalCommand {
public double[]? PreferredIntervals { public double []? PreferredIntervals {
get { get {
NSArray a = _PreferredIntervals; NSArray a = _PreferredIntervals;
if ((a is null) || (a.Count == 0)) if ((a is null) || (a.Count == 0))
return null; return null;
return NSArray.ArrayFromHandle<double> (a.Handle, input => { return NSArray.ArrayFromHandle<double> (a.Handle, input => {
return new NSNumber (input).DoubleValue; return new NSNumber (input).DoubleValue;
}); });
} }

Просмотреть файл

@ -25,9 +25,9 @@ namespace MediaPlayer {
[UnsupportedOSPlatform ("ios11.3")] [UnsupportedOSPlatform ("ios11.3")]
[ObsoletedOSPlatform ("ios11.3", "Use 'MPVolumeView' to present volume controls.")] [ObsoletedOSPlatform ("ios11.3", "Use 'MPVolumeView' to present volume controls.")]
#else #else
[Deprecated (PlatformName.iOS, 11,3, message: "Use 'MPVolumeView' to present volume controls.")] [Deprecated (PlatformName.iOS, 11, 3, message: "Use 'MPVolumeView' to present volume controls.")]
#endif #endif
[DllImport (Constants.MediaPlayerLibrary, EntryPoint="MPVolumeSettingsAlertShow")] [DllImport (Constants.MediaPlayerLibrary, EntryPoint = "MPVolumeSettingsAlertShow")]
public extern static void AlertShow (); public extern static void AlertShow ();
#if NET #if NET
@ -36,9 +36,9 @@ namespace MediaPlayer {
[UnsupportedOSPlatform ("ios11.3")] [UnsupportedOSPlatform ("ios11.3")]
[ObsoletedOSPlatform ("ios11.3", "Use 'MPVolumeView' to present volume controls.")] [ObsoletedOSPlatform ("ios11.3", "Use 'MPVolumeView' to present volume controls.")]
#else #else
[Deprecated (PlatformName.iOS, 11,3, message: "Use 'MPVolumeView' to present volume controls.")] [Deprecated (PlatformName.iOS, 11, 3, message: "Use 'MPVolumeView' to present volume controls.")]
#endif #endif
[DllImport (Constants.MediaPlayerLibrary, EntryPoint="MPVolumeSettingsAlertHide")] [DllImport (Constants.MediaPlayerLibrary, EntryPoint = "MPVolumeSettingsAlertHide")]
public extern static void AlertHide (); public extern static void AlertHide ();
// note: sizeof (BOOL) is 1 like C, i.e. it's not a Win32 BOOL (4 bytes) // note: sizeof (BOOL) is 1 like C, i.e. it's not a Win32 BOOL (4 bytes)
@ -48,9 +48,9 @@ namespace MediaPlayer {
[UnsupportedOSPlatform ("ios11.3")] [UnsupportedOSPlatform ("ios11.3")]
[ObsoletedOSPlatform ("ios11.3", "Use 'MPVolumeView' to present volume controls.")] [ObsoletedOSPlatform ("ios11.3", "Use 'MPVolumeView' to present volume controls.")]
#else #else
[Deprecated (PlatformName.iOS, 11,3, message: "Use 'MPVolumeView' to present volume controls.")] [Deprecated (PlatformName.iOS, 11, 3, message: "Use 'MPVolumeView' to present volume controls.")]
#endif #endif
[DllImport (Constants.MediaPlayerLibrary, EntryPoint="MPVolumeSettingsAlertIsVisible")] [DllImport (Constants.MediaPlayerLibrary, EntryPoint = "MPVolumeSettingsAlertIsVisible")]
[return: MarshalAs (UnmanagedType.I1)] [return: MarshalAs (UnmanagedType.I1)]
public extern static /* BOOL */ bool AlertIsVisible (); public extern static /* BOOL */ bool AlertIsVisible ();
} }

Просмотреть файл

@ -37,10 +37,10 @@ namespace MediaPlayer {
[Deprecated (PlatformName.iOS, 9, 0)] [Deprecated (PlatformName.iOS, 9, 0)]
[Native] [Native]
public enum MPMovieLoadState : long { public enum MPMovieLoadState : long {
Unknown = 0, Unknown = 0,
Playable = 1 << 0, Playable = 1 << 0,
PlaythroughOK = 1 << 1, PlaythroughOK = 1 << 1,
Stalled = 1 << 2, Stalled = 1 << 2,
} }
// NSInteger -> MPMoviePlayerController.h // NSInteger -> MPMoviePlayerController.h
@ -108,32 +108,32 @@ namespace MediaPlayer {
} }
// NSUInteger -> MPMediaItem.h // NSUInteger -> MPMediaItem.h
[Watch (7,0)] [Watch (7, 0)]
[Native] [Native]
[Flags] [Flags]
public enum MPMediaType : ulong { public enum MPMediaType : ulong {
Music = 1 << 0, Music = 1 << 0,
Podcast = 1 << 1, Podcast = 1 << 1,
AudioBook = 1 << 2, AudioBook = 1 << 2,
AudioITunesU = 1 << 3, AudioITunesU = 1 << 3,
AnyAudio = 0x00ff, AnyAudio = 0x00ff,
[Mac (10,12,2)] [Mac (10, 12, 2)]
Movie = 1 << 8, Movie = 1 << 8,
[Mac (10,12,2)] [Mac (10, 12, 2)]
TVShow = 1 << 9, TVShow = 1 << 9,
[Mac (10,12,2)] [Mac (10, 12, 2)]
VideoPodcast = 1 << 10, VideoPodcast = 1 << 10,
[Mac (10,12,2)] [Mac (10, 12, 2)]
MusicVideo = 1 << 11, MusicVideo = 1 << 11,
[Mac (10,12,2)] [Mac (10, 12, 2)]
VideoITunesU = 1 << 12, VideoITunesU = 1 << 12,
[iOS (7,0)] [iOS (7, 0)]
[Mac (10,12,2)] [Mac (10, 12, 2)]
HomeVideo = 1 << 13, HomeVideo = 1 << 13,
[Mac (10,12,2)] [Mac (10, 12, 2)]
TypeAnyVideo = 0xff00, TypeAnyVideo = 0xff00,
Any = 0xFFFFFFFFFFFFFFFF Any = 0xFFFFFFFFFFFFFFFF
} }
// NSInteger -> MPMediaPlaylist.h // NSInteger -> MPMediaPlaylist.h
@ -143,12 +143,12 @@ namespace MediaPlayer {
[Native] [Native]
[Flags] [Flags]
public enum MPMediaPlaylistAttribute : long { public enum MPMediaPlaylistAttribute : long {
None = 0, None = 0,
OnTheGo = (1 << 0), // if set, the playlist was created on a device rather than synced from iTunes OnTheGo = (1 << 0), // if set, the playlist was created on a device rather than synced from iTunes
Smart = (1 << 1), Smart = (1 << 1),
Genius = (1 << 2) Genius = (1 << 2)
}; };
// NSInteger -> MPMediaQuery.h // NSInteger -> MPMediaQuery.h
[NoMac] [NoMac]
[NoTV] [NoTV]
@ -187,19 +187,19 @@ namespace MediaPlayer {
AspectFill, AspectFill,
Fill Fill
} }
// untyped enum -> MPMoviePlayerController.h // untyped enum -> MPMoviePlayerController.h
[NoMac] [NoMac]
public enum MPMovieControlMode { public enum MPMovieControlMode {
Default, Default,
VolumeOnly, VolumeOnly,
Hidden Hidden
} }
// NSInteger -> /MPMusicPlayerController.h // NSInteger -> /MPMusicPlayerController.h
[NoMac] [NoMac]
[NoWatch] [NoWatch]
[TV (14,0)] [TV (14, 0)]
[Native] [Native]
public enum MPMusicPlaybackState : long { public enum MPMusicPlaybackState : long {
Stopped, Stopped,
@ -209,11 +209,11 @@ namespace MediaPlayer {
SeekingForward, SeekingForward,
SeekingBackward SeekingBackward
} }
// NSInteger -> /MPMusicPlayerController.h // NSInteger -> /MPMusicPlayerController.h
[NoMac] [NoMac]
[NoWatch] [NoWatch]
[TV (14,0)] [TV (14, 0)]
[Native] [Native]
public enum MPMusicRepeatMode : long { public enum MPMusicRepeatMode : long {
Default, Default,
@ -221,11 +221,11 @@ namespace MediaPlayer {
One, One,
All All
} }
// NSInteger -> /MPMusicPlayerController.h // NSInteger -> /MPMusicPlayerController.h
[NoMac] [NoMac]
[NoWatch] [NoWatch]
[TV (14,0)] [TV (14, 0)]
[Native] [Native]
public enum MPMusicShuffleMode : long { public enum MPMusicShuffleMode : long {
Default, Default,
@ -236,76 +236,73 @@ namespace MediaPlayer {
public delegate void MPMediaItemEnumerator (string property, NSObject value, ref bool stop); public delegate void MPMediaItemEnumerator (string property, NSObject value, ref bool stop);
[Mac (10,12,2)] [Mac (10, 12, 2)]
[Watch (5,0)] [Watch (5, 0)]
[Native] [Native]
public enum MPShuffleType : long public enum MPShuffleType : long {
{
Off, Off,
Items, Items,
Collections Collections
} }
[Mac (10,12,2)] [Mac (10, 12, 2)]
[Watch (5,0)] [Watch (5, 0)]
[Native] [Native]
public enum MPRepeatType : long public enum MPRepeatType : long {
{
Off, Off,
One, One,
All All
} }
[Mac (10,12,2)] [Mac (10, 12, 2)]
[iOS (10,0)] [iOS (10, 0)]
[Watch (5,0)] [Watch (5, 0)]
[Native] [Native]
public enum MPChangeLanguageOptionSetting : long public enum MPChangeLanguageOptionSetting : long {
{
None, None,
NowPlayingItemOnly, NowPlayingItemOnly,
Permanent Permanent
} }
// NSInteger -> MPRemoteCommand.h // NSInteger -> MPRemoteCommand.h
[Mac (10,12,2)] [Mac (10, 12, 2)]
[iOS (7,1)] [iOS (7, 1)]
[Watch (5,0)] [Watch (5, 0)]
[Native] [Native]
public enum MPRemoteCommandHandlerStatus : long { public enum MPRemoteCommandHandlerStatus : long {
Success = 0, Success = 0,
NoSuchContent = 100, NoSuchContent = 100,
[iOS (9,1)] [iOS (9, 1)]
NoActionableNowPlayingItem = 110, NoActionableNowPlayingItem = 110,
[iOS (11,0)] [iOS (11, 0)]
[TV (11,0)] [TV (11, 0)]
[Mac (10,13)] [Mac (10, 13)]
DeviceNotFound = 120, DeviceNotFound = 120,
CommandFailed = 200 CommandFailed = 200
} }
// NSUInteger -> MPRemoteCommandEvent.h // NSUInteger -> MPRemoteCommandEvent.h
[Mac (10,12,2)] [Mac (10, 12, 2)]
[iOS (7,1)] [iOS (7, 1)]
[Watch (5,0)] [Watch (5, 0)]
[Native] [Native]
public enum MPSeekCommandEventType : ulong { public enum MPSeekCommandEventType : ulong {
BeginSeeking, BeginSeeking,
EndSeeking EndSeeking
} }
[Mac (10,12,2)] [Mac (10, 12, 2)]
[iOS (9,0)] [iOS (9, 0)]
[Watch (5,0)] [Watch (5, 0)]
[Native] [Native]
public enum MPNowPlayingInfoLanguageOptionType : ulong { public enum MPNowPlayingInfoLanguageOptionType : ulong {
Audible, Audible,
Legible Legible
} }
[Mac (10,14,2)] [Mac (10, 14, 2)]
[Watch (7,0)] [Watch (7, 0)]
[iOS (9,3)] [iOS (9, 3)]
[Native] [Native]
[ErrorDomain ("MPErrorDomain")] [ErrorDomain ("MPErrorDomain")]
public enum MPErrorCode : long { public enum MPErrorCode : long {
@ -322,7 +319,7 @@ namespace MediaPlayer {
[NoMac] [NoMac]
[NoTV] [NoTV]
[NoWatch] [NoWatch]
[iOS (9,3)] [iOS (9, 3)]
[Native] [Native]
public enum MPMediaLibraryAuthorizationStatus : long { public enum MPMediaLibraryAuthorizationStatus : long {
NotDetermined = 0, NotDetermined = 0,
@ -331,25 +328,23 @@ namespace MediaPlayer {
Authorized Authorized
} }
[Mac (10,12,2)] [Mac (10, 12, 2)]
[iOS (10,0)] [iOS (10, 0)]
[TV (10,0)] [TV (10, 0)]
[Watch (5,0)] [Watch (5, 0)]
[Native] [Native]
public enum MPNowPlayingInfoMediaType : ulong public enum MPNowPlayingInfoMediaType : ulong {
{
None = 0, None = 0,
Audio, Audio,
Video Video
} }
[Mac (10,12,2)] [Mac (10, 12, 2)]
[Watch (5,0)] [Watch (5, 0)]
[iOS (11, 0)] [iOS (11, 0)]
[TV (11, 0)] [TV (11, 0)]
[Native] [Native]
public enum MPNowPlayingPlaybackState : ulong public enum MPNowPlayingPlaybackState : ulong {
{
Unknown = 0, Unknown = 0,
Playing, Playing,
Paused, Paused,

Просмотреть файл

@ -24,8 +24,8 @@ namespace MediaToolbox {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (9,0)] [iOS (9, 0)]
[Mac (10,11)] [Mac (10, 11)]
#endif #endif
[DllImport (Constants.MediaToolboxLibrary)] [DllImport (Constants.MediaToolboxLibrary)]
static extern /* CFStringRef CM_NULLABLE */ IntPtr MTCopyLocalizedNameForMediaType ( static extern /* CFStringRef CM_NULLABLE */ IntPtr MTCopyLocalizedNameForMediaType (
@ -37,8 +37,8 @@ namespace MediaToolbox {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (9,0)] [iOS (9, 0)]
[Mac (10,11)] [Mac (10, 11)]
#endif #endif
static public string? GetLocalizedName (this CMMediaType mediaType) static public string? GetLocalizedName (this CMMediaType mediaType)
{ {
@ -51,8 +51,8 @@ namespace MediaToolbox {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (9,0)] [iOS (9, 0)]
[Mac (10,11)] [Mac (10, 11)]
#endif #endif
[DllImport (Constants.MediaToolboxLibrary)] [DllImport (Constants.MediaToolboxLibrary)]
static extern /* CFStringRef CM_NULLABLE */ IntPtr MTCopyLocalizedNameForMediaSubType ( static extern /* CFStringRef CM_NULLABLE */ IntPtr MTCopyLocalizedNameForMediaSubType (
@ -64,8 +64,8 @@ namespace MediaToolbox {
[SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")] [SupportedOSPlatform ("tvos")]
#else #else
[iOS (9,0)] [iOS (9, 0)]
[Mac (10,11)] [Mac (10, 11)]
#endif #endif
static public string? GetLocalizedName (this CMMediaType mediaType, uint mediaSubType) static public string? GetLocalizedName (this CMMediaType mediaType, uint mediaSubType)
{ {

Просмотреть файл

@ -10,6 +10,7 @@
#nullable enable #nullable enable
using System; using System;
using System.ComponentModel;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using ObjCRuntime; using ObjCRuntime;
@ -206,7 +207,26 @@ namespace Network {
[iOS (15,0)] [iOS (15,0)]
[MacCatalyst (15,0)] [MacCatalyst (15,0)]
#endif #endif
public NWInterfaceRadioType GetPathRadioType (uint pathIndex)
=> nw_data_transfer_report_get_path_radio_type (GetCheckedHandle (), pathIndex);
#if !XAMCORE_5_0
#if NET
[SupportedOSPlatform ("tvos15.0")]
[SupportedOSPlatform ("macos12.0")]
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
#endif
[Obsolete ("Use the 'GetPathRadioType' property instead.")]
[EditorBrowsable (EditorBrowsableState.Never)]
public NWInterfaceRadioType get_path_radio_type (uint pathIndex) public NWInterfaceRadioType get_path_radio_type (uint pathIndex)
=> nw_data_transfer_report_get_path_radio_type (GetCheckedHandle (), pathIndex); => nw_data_transfer_report_get_path_radio_type (GetCheckedHandle (), pathIndex);
#endif
} }
} }

Просмотреть файл

@ -189,10 +189,12 @@ namespace PassKit {
[Mac (12,0), iOS (15,0), Watch (8,0)] [Mac (12,0), iOS (15,0), Watch (8,0)]
Continue = 16, Continue = 16,
#if !NET #if !NET
#pragma warning disable 0618 // warning CS0618: 'PKPaymentButtonType.[field]' is obsolete: 'Use '[replacement]'.'
[iOS (12,0)] [iOS (12,0)]
Book2 = Checkout, Book2 = Checkout,
[iOS (12,0)] [iOS (12,0)]
Checkout2 = Book, Checkout2 = Book,
#pragma warning restore
#endif // !NET #endif // !NET
} }

Просмотреть файл

@ -17,7 +17,7 @@ using ObjCRuntime;
namespace SceneKit { namespace SceneKit {
[Watch (3,0)] [Watch (3, 0)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] // untyped enum (SceneKitTypes.h) but described as the value of `code` for `NSError` which is an NSInteger [Native] // untyped enum (SceneKitTypes.h) but described as the value of `code` for `NSError` which is an NSInteger
[ErrorDomain ("SCNErrorDomain")] [ErrorDomain ("SCNErrorDomain")]
@ -25,7 +25,7 @@ namespace SceneKit {
ProgramCompilationError = 1, ProgramCompilationError = 1,
} }
[Watch (3,0)] [Watch (3, 0)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
public enum SCNGeometryPrimitiveType : long { public enum SCNGeometryPrimitiveType : long {
@ -33,32 +33,32 @@ namespace SceneKit {
TriangleStrip, TriangleStrip,
Line, Line,
Point, Point,
[TV (10,0), Mac (10,12), iOS (10,0)] [TV (10, 0), Mac (10, 12), iOS (10, 0)]
Polygon Polygon
} }
[Watch (3,0)] [Watch (3, 0)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
public enum SCNTransparencyMode : long { public enum SCNTransparencyMode : long {
AOne, AOne,
RgbZero, RgbZero,
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
SingleLayer = 2, SingleLayer = 2,
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
DualLayer = 3, DualLayer = 3,
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
Default = AOne, Default = AOne,
} }
[Watch (3,0)] [Watch (3, 0)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
public enum SCNCullMode : long { public enum SCNCullMode : long {
Back, Front Back, Front
} }
[Watch (3,0)] [Watch (3, 0)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
public enum SCNFilterMode : long { public enum SCNFilterMode : long {
@ -67,7 +67,7 @@ namespace SceneKit {
Linear Linear
} }
[Watch (3,0)] [Watch (3, 0)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
public enum SCNWrapMode : long { public enum SCNWrapMode : long {
@ -78,7 +78,7 @@ namespace SceneKit {
Mirror Mirror
} }
[Watch (3,0)] [Watch (3, 0)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
public enum SCNSceneSourceStatus : long { public enum SCNSceneSourceStatus : long {
@ -89,7 +89,7 @@ namespace SceneKit {
Complete = 16 Complete = 16
} }
[Watch (3,0)] [Watch (3, 0)]
[Mac (10, 9)] [Mac (10, 9)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
@ -99,7 +99,7 @@ namespace SceneKit {
Back Back
} }
[Watch (3,0)] [Watch (3, 0)]
[Mac (10, 9)] [Mac (10, 9)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
@ -108,7 +108,7 @@ namespace SceneKit {
Additive Additive
} }
[Watch (3,0)] [Watch (3, 0)]
[Mac (10, 10)] [Mac (10, 10)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
@ -119,7 +119,7 @@ namespace SceneKit {
EaseInEaseOut EaseInEaseOut
} }
[Watch (3,0)] [Watch (3, 0)]
[Mac (10, 10)] [Mac (10, 10)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
@ -129,7 +129,7 @@ namespace SceneKit {
Modulated Modulated
} }
[Watch (3,0)] [Watch (3, 0)]
[Mac (10, 10)] [Mac (10, 10)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
@ -139,7 +139,7 @@ namespace SceneKit {
Kinematic Kinematic
} }
[Watch (3,0)] [Watch (3, 0)]
[Mac (10, 10)] [Mac (10, 10)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
@ -148,7 +148,7 @@ namespace SceneKit {
OutsideExtent OutsideExtent
} }
[Watch (3,0)] [Watch (3, 0)]
[Mac (10, 10)] [Mac (10, 10)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
@ -160,7 +160,7 @@ namespace SceneKit {
YoungestFirst YoungestFirst
} }
[Watch (3,0)] [Watch (3, 0)]
[Mac (10, 10)] [Mac (10, 10)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
@ -173,7 +173,7 @@ namespace SceneKit {
Replace Replace
} }
[Watch (3,0)] [Watch (3, 0)]
[Mac (10, 10)] [Mac (10, 10)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
@ -184,7 +184,7 @@ namespace SceneKit {
BillboardYAligned BillboardYAligned
} }
[Watch (3,0)] [Watch (3, 0)]
[Mac (10, 10)] [Mac (10, 10)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
@ -194,7 +194,7 @@ namespace SceneKit {
Vertex Vertex
} }
[Watch (3,0)] [Watch (3, 0)]
[Mac (10, 10)] [Mac (10, 10)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
@ -204,7 +204,7 @@ namespace SceneKit {
Random Random
} }
[Watch (3,0)] [Watch (3, 0)]
[Mac (10, 10)] [Mac (10, 10)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
@ -214,7 +214,7 @@ namespace SceneKit {
AutoReverse AutoReverse
} }
[Watch (3,0)] [Watch (3, 0)]
[Mac (10, 10)] [Mac (10, 10)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
@ -224,7 +224,7 @@ namespace SceneKit {
OverOtherProperty OverOtherProperty
} }
[Watch (3,0)] [Watch (3, 0)]
[Mac (10, 10)] [Mac (10, 10)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
@ -235,7 +235,7 @@ namespace SceneKit {
PostCollision PostCollision
} }
[Watch (3,0)] [Watch (3, 0)]
[Mac (10, 10)] [Mac (10, 10)]
[iOS (8, 0)] [iOS (8, 0)]
[Native] [Native]
@ -246,8 +246,7 @@ namespace SceneKit {
} }
// Utility enum // Utility enum
public enum SCNGeometrySourceSemantics public enum SCNGeometrySourceSemantics {
{
Vertex, Vertex,
Normal, Normal,
Color, Color,
@ -259,8 +258,7 @@ namespace SceneKit {
} }
// Utility enum // Utility enum
public enum SCNAnimationImportPolicy public enum SCNAnimationImportPolicy {
{
Unknown, Unknown,
Play, Play,
PlayRepeatedly, PlayRepeatedly,
@ -271,10 +269,10 @@ namespace SceneKit {
// Utility enum // Utility enum
public enum SCNPhysicsSearchMode { public enum SCNPhysicsSearchMode {
Unknown = -1, Unknown = -1,
Any, Closest, All, Any, Closest, All,
} }
[Watch (3,0)] [Watch (3, 0)]
[Native] [Native]
public enum SCNAntialiasingMode : ulong { public enum SCNAntialiasingMode : ulong {
None, None,
@ -288,17 +286,18 @@ namespace SceneKit {
#endif #endif
} }
[Watch (3,0)] [Watch (3, 0)]
[Native] [Native]
public enum SCNPhysicsCollisionCategory : ulong { public enum SCNPhysicsCollisionCategory : ulong {
None = 0, None = 0,
Default = 1 << 0, Default = 1 << 0,
Static = 1 << 1, Static = 1 << 1,
All = UInt64.MaxValue All = UInt64.MaxValue
} }
[Watch (3,0)] [Watch (3, 0)]
[iOS (9,0)][Mac (10,11)] [iOS (9, 0)]
[Mac (10, 11)]
[Native] [Native]
public enum SCNBillboardAxis : ulong { public enum SCNBillboardAxis : ulong {
X = 1 << 0, X = 1 << 0,
@ -307,35 +306,36 @@ namespace SceneKit {
All = (X | Y | Z) All = (X | Y | Z)
} }
[Watch (3,0)] [Watch (3, 0)]
[iOS (9,0)][Mac (10,11)] [iOS (9, 0)]
[Mac (10, 11)]
[Native] [Native]
public enum SCNReferenceLoadingPolicy : long { public enum SCNReferenceLoadingPolicy : long {
Immediate = 0, Immediate = 0,
OnDemand = 1 OnDemand = 1
} }
[Watch (3,0)] [Watch (3, 0)]
[iOS (9,0)][Mac (10,11)] [iOS (9, 0)]
[Mac (10, 11)]
[Native] [Native]
public enum SCNBlendMode : long public enum SCNBlendMode : long {
{
Alpha = 0, Alpha = 0,
Add = 1, Add = 1,
Subtract = 2, Subtract = 2,
Multiply = 3, Multiply = 3,
Screen = 4, Screen = 4,
Replace = 5, Replace = 5,
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
Max = 6, Max = 6,
} }
[Watch (3,0)] [Watch (3, 0)]
[iOS (9,0)][Mac (10,11)] [iOS (9, 0)]
[Mac (10, 11)]
[Native] [Native]
[Flags] [Flags]
public enum SCNDebugOptions : ulong public enum SCNDebugOptions : ulong {
{
None = 0, None = 0,
ShowPhysicsShapes = 1 << 0, ShowPhysicsShapes = 1 << 0,
ShowBoundingBoxes = 1 << 1, ShowBoundingBoxes = 1 << 1,
@ -343,26 +343,27 @@ namespace SceneKit {
ShowLightExtents = 1 << 3, ShowLightExtents = 1 << 3,
ShowPhysicsFields = 1 << 4, ShowPhysicsFields = 1 << 4,
ShowWireframe = 1 << 5, ShowWireframe = 1 << 5,
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
RenderAsWireframe = 1 << 6, RenderAsWireframe = 1 << 6,
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
ShowSkeletons = 1 << 7, ShowSkeletons = 1 << 7,
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
ShowCreases = 1 << 8, ShowCreases = 1 << 8,
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
ShowConstraints = 1 << 9, ShowConstraints = 1 << 9,
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
ShowCameras = 1 << 10, ShowCameras = 1 << 10,
} }
[Watch (3,0)] [Watch (3, 0)]
[iOS (9,0)][Mac (10,11)] [iOS (9, 0)]
[Mac (10, 11)]
[Native] [Native]
public enum SCNRenderingApi : ulong public enum SCNRenderingApi : ulong {
{
Metal, Metal,
#if !MONOMAC #if !MONOMAC
[Unavailable (PlatformName.MacCatalyst)][NoMac] [Unavailable (PlatformName.MacCatalyst)]
[NoMac]
OpenGLES2, OpenGLES2,
#else #else
[NoiOS][NoTV][NoMacCatalyst] [NoiOS][NoTV][NoMacCatalyst]
@ -374,17 +375,17 @@ namespace SceneKit {
#endif #endif
} }
[Watch (3,0)] [Watch (3, 0)]
[iOS (9,0)][Mac (10,11)] [iOS (9, 0)]
[Mac (10, 11)]
[Native] [Native]
public enum SCNBufferFrequency : long public enum SCNBufferFrequency : long {
{
Frame = 0, Frame = 0,
Node = 1, Node = 1,
Shadable = 2, Shadable = 2,
} }
[Watch (3,0)] [Watch (3, 0)]
[TV (10, 0), Mac (10, 12), iOS (10, 0)] [TV (10, 0), Mac (10, 12), iOS (10, 0)]
[Native] [Native]
public enum SCNMovabilityHint : long { public enum SCNMovabilityHint : long {
@ -392,11 +393,10 @@ namespace SceneKit {
Movable Movable
} }
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[Native] [Native]
[Flags] [Flags]
public enum SCNColorMask : long public enum SCNColorMask : long {
{
None = 0, None = 0,
Red = 1 << 3, Red = 1 << 3,
Green = 1 << 2, Green = 1 << 2,
@ -405,10 +405,9 @@ namespace SceneKit {
All = 15, All = 15,
} }
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[Native] [Native]
public enum SCNInteractionMode : long public enum SCNInteractionMode : long {
{
Fly, Fly,
OrbitTurntable, OrbitTurntable,
OrbitAngleMapping, OrbitAngleMapping,
@ -417,78 +416,69 @@ namespace SceneKit {
Pan, Pan,
Truck, Truck,
} }
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[Native] [Native]
public enum SCNFillMode : ulong public enum SCNFillMode : ulong {
{
Fill = 0, Fill = 0,
Lines = 1, Lines = 1,
} }
[NoWatch, Mac (10,13), iOS (11,0)] [NoWatch, Mac (10, 13), iOS (11, 0)]
[TV (12,0)] [TV (12, 0)]
[Native] [Native]
public enum SCNTessellationSmoothingMode : long public enum SCNTessellationSmoothingMode : long {
{
None = 0, None = 0,
PNTriangles, PNTriangles,
Phong, Phong,
} }
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[Native] [Native]
public enum SCNHitTestSearchMode : long public enum SCNHitTestSearchMode : long {
{
Closest = 0, Closest = 0,
All = 1, All = 1,
Any = 2, Any = 2,
} }
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[Native] [Native]
public enum SCNCameraProjectionDirection : long public enum SCNCameraProjectionDirection : long {
{
Vertical = 0, Vertical = 0,
Horizontal = 1, Horizontal = 1,
} }
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[Native] [Native]
public enum SCNNodeFocusBehavior : long public enum SCNNodeFocusBehavior : long {
{
None = 0, None = 0,
Occluding, Occluding,
Focusable, Focusable,
} }
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] [Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Native] [Native]
public enum SCNLightProbeType : long public enum SCNLightProbeType : long {
{
Irradiance = 0, Irradiance = 0,
Radiance = 1, Radiance = 1,
} }
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] [Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Native] [Native]
public enum SCNLightProbeUpdateType : long public enum SCNLightProbeUpdateType : long {
{
Never = 0, Never = 0,
Realtime = 1, Realtime = 1,
} }
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] [Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Native] [Native]
public enum SCNLightAreaType : long public enum SCNLightAreaType : long {
{
Rectangle = 1, Rectangle = 1,
Polygon = 4, Polygon = 4,
} }
[Mac (10, 10)] [Mac (10, 10)]
[iOS (8, 0)] [iOS (8, 0)]
public enum SCNPhysicsShapeType public enum SCNPhysicsShapeType {
{
ConvexHull, ConvexHull,
BoundingBox, BoundingBox,
ConcavePolyhedron, ConcavePolyhedron,

Просмотреть файл

@ -16,14 +16,13 @@ using CoreAnimation;
#nullable enable #nullable enable
namespace SceneKit namespace SceneKit {
{
public partial class SCNAnimatable { public partial class SCNAnimatable {
public void AddAnimation (CAAnimation animation, string? key = null) public void AddAnimation (CAAnimation animation, string? key = null)
{ {
var nskey = key is null ? null : new NSString (key); var nskey = key is null ? null : new NSString (key);
AddAnimation (animation, nskey); AddAnimation (animation, nskey);
nskey?.Dispose (); nskey?.Dispose ();
} }

Просмотреть файл

@ -92,7 +92,7 @@ namespace SceneKit {
public abstract partial class SCNSceneRenderer : NSObject { public abstract partial class SCNSceneRenderer : NSObject {
[Mac (10, 10)] [Mac (10, 10)]
[Obsolete ("Use 'SCNSceneRenderer_Extensions.PrepareAsync' instead.")] [Obsolete ("Use 'SCNSceneRenderer_Extensions.PrepareAsync' instead.")]
public unsafe virtual Task<bool> PrepareAsync (NSObject[] objects) public unsafe virtual Task<bool> PrepareAsync (NSObject [] objects)
{ {
return SCNSceneRenderer_Extensions.PrepareAsync (this, objects); return SCNSceneRenderer_Extensions.PrepareAsync (this, objects);
} }
@ -110,11 +110,10 @@ namespace SceneKit {
#if !NET #if !NET
[Mac (10,9), iOS (8,0), Watch (4,0)] [Mac (10, 9), iOS (8, 0), Watch (4, 0)]
public delegate void SCNAnimationEventHandler (AnimationType animation, NSObject animatedObject, bool playingBackward); public delegate void SCNAnimationEventHandler (AnimationType animation, NSObject animatedObject, bool playingBackward);
public partial class SCNAnimationEvent : NSObject public partial class SCNAnimationEvent : NSObject {
{
public static SCNAnimationEvent Create (nfloat keyTime, SCNAnimationEventHandler eventHandler) public static SCNAnimationEvent Create (nfloat keyTime, SCNAnimationEventHandler eventHandler)
{ {
var handler = new Action<IntPtr, NSObject, bool> ((animationPtr, animatedObject, playingBackward) => { var handler = new Action<IntPtr, NSObject, bool> ((animationPtr, animatedObject, playingBackward) => {
@ -127,9 +126,9 @@ namespace SceneKit {
#endif // !NET #endif // !NET
#if !WATCH && !NET #if !WATCH && !NET
[iOS (11,0)] [iOS (11, 0)]
[TV (11,0)] [TV (11, 0)]
[Mac (10,13,0, PlatformArchitecture.Arch64)] [Mac (10, 13, 0, PlatformArchitecture.Arch64)]
static public partial class SCNAnimatableExtensions { static public partial class SCNAnimatableExtensions {
static public void AddAnimation (this ISCNAnimatable self, SCNAnimation animation, string key) static public void AddAnimation (this ISCNAnimatable self, SCNAnimation animation, string key)
{ {
@ -141,7 +140,7 @@ namespace SceneKit {
#endif // !WATCH && !NET #endif // !WATCH && !NET
#if !NET #if !NET
[Watch (3,0)] [Watch (3, 0)]
public partial class SCNHitTestOptions { public partial class SCNHitTestOptions {
[Obsolete ("Use 'SearchMode' instead.")] [Obsolete ("Use 'SearchMode' instead.")]
public SCNHitTestSearchMode? OptionSearchMode { public SCNHitTestSearchMode? OptionSearchMode {
@ -153,9 +152,9 @@ namespace SceneKit {
#if !MONOMAC && !WATCH && !__MACCATALYST__ #if !MONOMAC && !WATCH && !__MACCATALYST__
public partial class SCNView { public partial class SCNView {
[Watch (6,0), TV (13,0), iOS (13,0)] [Watch (6, 0), TV (13, 0), iOS (13, 0)]
[Obsolete ("Empty stub. (not a public API).")] [Obsolete ("Empty stub. (not a public API).")]
public virtual bool DrawableResizesAsynchronously { get; set; } public virtual bool DrawableResizesAsynchronously { get; set; }
} }
#endif // !MONOMAC && !WATCH && !__MACCATALYST__ #endif // !MONOMAC && !WATCH && !__MACCATALYST__
#endif // !NET #endif // !NET

Просмотреть файл

@ -23,28 +23,28 @@ namespace SceneKit {
public static unsafe SCNGeometrySource FromVertices (SCNVector3 [] vertices) public static unsafe SCNGeometrySource FromVertices (SCNVector3 [] vertices)
{ {
if (vertices is null) if (vertices is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (vertices)); ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (vertices));
fixed (SCNVector3 *ptr = &vertices [0]) fixed (SCNVector3* ptr = &vertices [0])
return FromVertices ((IntPtr)ptr, vertices.Length); return FromVertices ((IntPtr) ptr, vertices.Length);
} }
public static unsafe SCNGeometrySource FromNormals (SCNVector3 [] normals) public static unsafe SCNGeometrySource FromNormals (SCNVector3 [] normals)
{ {
if (normals is null) if (normals is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (normals)); ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (normals));
fixed (SCNVector3 *ptr = &normals[0]) fixed (SCNVector3* ptr = &normals [0])
return FromNormals ((IntPtr)ptr, normals.Length); return FromNormals ((IntPtr) ptr, normals.Length);
} }
public static unsafe SCNGeometrySource FromTextureCoordinates (CGPoint [] texcoords) public static unsafe SCNGeometrySource FromTextureCoordinates (CGPoint [] texcoords)
{ {
if (texcoords is null) if (texcoords is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (texcoords)); ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (texcoords));
fixed (CGPoint *ptr = &texcoords[0]) fixed (CGPoint* ptr = &texcoords [0])
return FromTextureCoordinates ((IntPtr)ptr, texcoords.Length); return FromTextureCoordinates ((IntPtr) ptr, texcoords.Length);
} }
static NSString SemanticToToken (SCNGeometrySourceSemantics geometrySourceSemantic) static NSString SemanticToToken (SCNGeometrySourceSemantics geometrySourceSemantic)
@ -70,7 +70,7 @@ namespace SceneKit {
throw new System.ArgumentException ("geometrySourceSemantic"); throw new System.ArgumentException ("geometrySourceSemantic");
} }
} }
public static SCNGeometrySource FromData (NSData data, SCNGeometrySourceSemantics semantic, nint vectorCount, bool floatComponents, nint componentsPerVector, nint bytesPerComponent, nint offset, nint stride) public static SCNGeometrySource FromData (NSData data, SCNGeometrySourceSemantics semantic, nint vectorCount, bool floatComponents, nint componentsPerVector, nint bytesPerComponent, nint offset, nint stride)
{ {
return FromData (data, SemanticToToken (semantic), vectorCount, floatComponents, componentsPerVector, bytesPerComponent, offset, stride); return FromData (data, SemanticToToken (semantic), vectorCount, floatComponents, componentsPerVector, bytesPerComponent, offset, stride);
@ -83,5 +83,5 @@ namespace SceneKit {
} }
#endif #endif
} }
} }

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше