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 />
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
<!-- 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 -->
<!-- Begin: Package sources from dotnet-aspnetcore -->
<!-- End: Package sources from dotnet-aspnetcore -->
<!-- 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 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" />

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

@ -75,6 +75,7 @@ DIRECTORIES += \
$(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/targets) \
$(foreach platform,$(DOTNET_PLATFORMS),Workloads/Microsoft.NET.Sdk.$(platform)) \
$(DIRECTORIES):
$(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))))
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
$$(Q) mkdir -p Workloads/Microsoft.NET.Sdk.$(1)/
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) rm -f $$@.tmp
$$(Q_GEN) ./generate-workloadmanifest-json.csharp "$(1)" "$(3)" "$(4)" "$(6)" "$$(DOTNET_$(5)_RUNTIME_IDENTIFIERS)" "$$@.tmp" "$$(DOTNET_WINDOWS_PLATFORMS)"
$$(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 \
-e "s/@NUGET_VERSION_NO_METADATA@/$3/g" \
$$< > $$@.tmp

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

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

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

@ -255,6 +255,7 @@
"MonoProfileThreadFunc", "end"
) {
XamarinRuntime = RuntimeMode.MonoVM,
Mode = DotNetMode.OnlyLegacy,
},
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.
*/
#if !DOTNET
static CFMutableDictionaryRef xamarin_thread_hash = NULL;
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.
xamarin_thread_finish (NULL);
}
#endif // !DOTNET
void
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.
xamarin_thread_hash = CFDictionaryCreateMutable (kCFAllocatorDefault, 0, NULL, NULL);
mono_profiler_install_thread (thread_start, thread_end);
#endif // !DOTNET
}
void

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

@ -51,9 +51,14 @@ namespace CoreFoundation {
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 ();
}

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

@ -34,6 +34,7 @@ using System.Net;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Threading;
using CoreFoundation;
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
int port = (buffer [2] << 8) + buffer [3];
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
[SupportedOSPlatform ("ios")]
[SupportedOSPlatform ("maccatalyst")]
@ -237,14 +304,25 @@ namespace CoreFoundation {
[SupportedOSPlatform ("tvos")]
#endif
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)
{
if (disposing) {
if (gch.IsAllocated)
gch.Free ();
}
if (Handle != NativeHandle.Zero)
CFSocketInvalidate (Handle);
base.Dispose (disposing);
}
@ -258,11 +336,11 @@ namespace CoreFoundation {
return;
CFSocketCallBackType cbType = (CFSocketCallBackType) (ulong) type;
if (cbType == CFSocketCallBackType.AcceptCallBack) {
var ep = CFSocketAddress.EndPointFromAddressPtr (address);
if (cbType == CFSocketCallBackType.AcceptCallBack && socket.AcceptEvent is not null) {
var ep = CFSocketAddress.EndPointFromAddressPtr (address, false)!;
var handle = new CFSocketNativeHandle (Marshal.ReadInt32 (data));
socket.OnAccepted (new CFSocketAcceptEventArgs (handle, ep));
} else if (cbType == CFSocketCallBackType.ConnectCallBack) {
} else if (cbType == CFSocketCallBackType.ConnectCallBack && socket.ConnectEvent is not null) {
CFSocketError result;
if (data == IntPtr.Zero)
result = CFSocketError.Success;
@ -272,28 +350,31 @@ namespace CoreFoundation {
result = (CFSocketError) Marshal.ReadInt32 (data);
}
socket.OnConnect (new CFSocketConnectEventArgs (result));
} else if (cbType == CFSocketCallBackType.DataCallBack) {
var ep = CFSocketAddress.EndPointFromAddressPtr (address);
using (var cfdata = new CFData (data, false))
socket.OnData (new CFSocketDataEventArgs (ep, cfdata.GetBuffer ()));
} else if (cbType == CFSocketCallBackType.DataCallBack && socket.DataEvent is not null) {
using (var cfdata = new CFData (data, false)) {
if (cfdata.Length > 0) {
var ep = CFSocketAddress.EndPointFromAddressPtr (address, false)!;
socket.OnData (new CFSocketDataEventArgs (ep, cfdata.GetBuffer ()));
}
}
} else if (cbType == CFSocketCallBackType.NoCallBack) {
// nothing to do
} else if (cbType == CFSocketCallBackType.ReadCallBack) {
} else if (cbType == CFSocketCallBackType.ReadCallBack && socket.ReadEvent is not null) {
socket.OnRead (new CFSocketReadEventArgs ());
} else if (cbType == CFSocketCallBackType.WriteCallBack) {
} else if (cbType == CFSocketCallBackType.WriteCallBack && socket.WriteEvent is not null) {
socket.OnWrite (new CFSocketWriteEventArgs ());
}
}
[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,
CFSocketCallBack callout, ref CFStreamClientContext ctx);
CFSocketCallBack callout, CFSocketContext* ctx);
[DllImport (Constants.CoreFoundationLibrary)]
extern static IntPtr CFSocketCreateWithNative (IntPtr allocator, CFSocketNativeHandle sock,
unsafe extern static IntPtr CFSocketCreateWithNative (IntPtr allocator, CFSocketNativeHandle sock,
nuint /*CFOptionFlags*/ callBackTypes,
CFSocketCallBack callout, ref CFStreamClientContext ctx);
CFSocketCallBack callout, CFSocketContext* ctx);
[DllImport (Constants.CoreFoundationLibrary)]
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)
: this (CFSocketSignature.AddressFamilyToInt (family),
CFSocketSignature.SocketTypeToInt (type),
CFSocketSignature.ProtocolToInt (proto), loop)
CFSocketSignature.SocketTypeToInt (type),
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)
{
var cbTypes = CFSocketCallBackType.DataCallBack | CFSocketCallBackType.ConnectCallBack;
gch = GCHandle.Alloc (this);
try {
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;
unsafe {
Initialize (
loop,
(CFSocketContext* ctx) => CFSocketCreate (IntPtr.Zero, family, type, proto, (nuint) (ulong) defaultCallbackTypes, OnCallback, ctx)
);
}
}
CFSocket (CFSocketNativeHandle sock)
{
var cbTypes = CFSocketCallBackType.DataCallBack | CFSocketCallBackType.WriteCallBack;
gch = GCHandle.Alloc (this);
try {
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;
unsafe {
Initialize (
CFRunLoop.Current,
(CFSocketContext* ctx) => CFSocketCreateWithNative (IntPtr.Zero, sock, (nuint) (ulong) defaultCallbackTypes, OnCallback, ctx)
);
}
}
[Preserve (Conditional = true)]
CFSocket (NativeHandle handle, bool owns)
: base (handle, owns)
internal CFSocket (CFSocketSignature sig, double timeout)
{
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 {
var source = new CFRunLoopSource (CFSocketCreateRunLoopSource (IntPtr.Zero, handle, 0), true);
var loop = CFRunLoop.Current;
loop.AddSource (source, CFRunLoop.ModeDefault);
var ctx = new CFSocketContext ((IntPtr) gch);
IntPtr handle;
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 {
gch.Free ();
throw;
@ -373,24 +454,18 @@ namespace CoreFoundation {
}
[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,
CFSocketCallBack callout,
IntPtr context, double timeout);
CFSocketContext* context, double timeout);
public static CFSocket CreateConnectedToSocketSignature (AddressFamily family, SocketType type,
ProtocolType proto, IPEndPoint endpoint,
double timeout)
{
var cbTypes = CFSocketCallBackType.ConnectCallBack | CFSocketCallBackType.DataCallBack;
using (var address = new CFSocketAddress (endpoint)) {
var sig = new CFSocketSignature (family, type, proto, address);
var handle = CFSocketCreateConnectedToSocketSignature (
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);
return new CFSocket (sig, timeout);
}
}
@ -413,6 +488,7 @@ namespace CoreFoundation {
public void SetAddress (IPEndPoint endpoint)
{
EnableCallBacks (CFSocketCallBackType.AcceptCallBack);
var flags = GetSocketFlags ();
flags |= CFSocketFlags.AutomaticallyReenableAcceptCallBack;
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)]
extern static CFSocketFlags CFSocketGetSocketFlags (IntPtr handle);
@ -620,5 +716,13 @@ namespace CoreFoundation {
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.
//
#nullable enable
using System;
using CoreFoundation;
using CoreText;
@ -36,13 +38,13 @@ using UIKit;
namespace Foundation {
public partial class NSAttributedString {
public string Value {
public string? Value {
get {
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));
}
@ -58,21 +60,21 @@ namespace Foundation {
}
#endif
public NSAttributedString (string str, CTStringAttributes attributes)
: this (str, attributes != null ? attributes.Dictionary : null)
public NSAttributedString (string str, CTStringAttributes? attributes)
: 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);
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);
return attr == null ? null : new CTStringAttributes (attr);
return attr is null ? null : new CTStringAttributes (attr);
}
public NSAttributedString Substring (nint start, nint len)
@ -81,52 +83,52 @@ namespace Foundation {
}
#if !MONOMAC
public NSAttributedString (string str, UIStringAttributes attributes)
: this (str, attributes != null ? attributes.Dictionary : null)
public NSAttributedString (string str, UIStringAttributes? attributes)
: 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);
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);
return attr == null ? null : new UIStringAttributes (attr);
return attr is null ? null : new UIStringAttributes (attr);
}
static internal NSDictionary ToDictionary (
UIFont font,
UIColor foregroundColor,
UIColor backgroundColor,
UIColor strokeColor,
NSParagraphStyle paragraphStyle,
static internal NSDictionary? ToDictionary (
UIFont? font,
UIColor? foregroundColor,
UIColor? backgroundColor,
UIColor? strokeColor,
NSParagraphStyle? paragraphStyle,
NSLigatureType ligature,
float kerning,
NSUnderlineStyle underlineStyle,
#if !WATCH
NSShadow shadow,
NSShadow? shadow,
#endif
float strokeWidth,
NSUnderlineStyle strikethroughStyle)
{
var attr = new UIStringAttributes ();
if (font != null) {
if (font is not null) {
attr.Font = font;
}
if (foregroundColor != null) {
if (foregroundColor is not null) {
attr.ForegroundColor = foregroundColor;
}
if (backgroundColor != null) {
if (backgroundColor is not null) {
attr.BackgroundColor = backgroundColor;
}
if (strokeColor != null) {
if (strokeColor is not null) {
attr.StrokeColor = strokeColor;
}
if (paragraphStyle != null) {
if (paragraphStyle is not null) {
attr.ParagraphStyle = paragraphStyle;
}
if (ligature != NSLigatureType.Default) {
@ -139,7 +141,7 @@ namespace Foundation {
attr.UnderlineStyle = underlineStyle;
}
#if !WATCH
if (shadow != null) {
if (shadow is not null) {
attr.Shadow = shadow;
}
#endif
@ -154,16 +156,16 @@ namespace Foundation {
}
public NSAttributedString (string str,
UIFont font = null,
UIColor foregroundColor = null,
UIColor backgroundColor = null,
UIColor strokeColor = null,
NSParagraphStyle paragraphStyle = null,
UIFont? font = null,
UIColor? foregroundColor = null,
UIColor? backgroundColor = null,
UIColor? strokeColor = null,
NSParagraphStyle? paragraphStyle = null,
NSLigatureType ligatures = NSLigatureType.Default,
float kerning = 0,
NSUnderlineStyle underlineStyle = NSUnderlineStyle.None,
#if !WATCH
NSShadow shadow = null,
NSShadow? shadow = null,
#endif
float strokeWidth = 0,
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
public static NSAttributedString CreateFrom (NSTextAttachment attachment)
{
return (null as NSAttributedString).FromTextAttachment (attachment);
return (null as NSAttributedString)!.FromTextAttachment (attachment);
}
#endif
#endif

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -14,9 +14,9 @@ namespace GameKit {
#if !XAMCORE_3_0
public partial class GKMatchRequest {
#if !NET
[iOS (8,0), Mac (10,10)]
[iOS (8, 0), Mac (10, 10)]
[Obsolete ("Use 'RecipientResponseHandler' property.")]
#else
[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 {
[Obsolete ("Use 'InviteHandler' property.")]
public virtual void SetInviteHandler (GKInviteHandler handler)
{
@ -50,22 +50,22 @@ namespace GameKit {
public partial class GKGameSession {
[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).")]
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).")]
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).")]
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).")]
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).")]
public static void DidSaveData (GKGameSession session, GKCloudPlayer player, Foundation.NSData data) {}
public static void DidSaveData (GKGameSession session, GKCloudPlayer player, Foundation.NSData data) { }
}
#endif

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

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

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

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

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

@ -20,8 +20,8 @@ namespace GameplayKit {
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.TvOS, 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).")]
public virtual bool RemoveData (NSObject data)
{
return false;

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

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

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

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

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

@ -36,9 +36,9 @@ namespace GameplayKit {
[SupportedOSPlatform ("macos10.12")]
[SupportedOSPlatform ("maccatalyst")]
#else
[iOS (10,0)]
[TV (10,0)]
[Mac (10,12)]
[iOS (10, 0)]
[TV (10, 0)]
[Mac (10, 12)]
#endif
[Register ("GKObstacleGraph", SkipRegistration = true)]
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)
{
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)

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

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

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

@ -26,16 +26,16 @@ namespace GameplayKit {
{
if (points is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (points));
var size = Marshal.SizeOf (typeof (Vector2));
var length = points.Length * size;
var buffer = Marshal.AllocHGlobal (length);
try {
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 {
if (buffer != IntPtr.Zero)
Marshal.FreeHGlobal (buffer);
@ -45,7 +45,7 @@ namespace GameplayKit {
[ThreadStatic]
static IntPtr ctor_pointer;
static unsafe IntPtr GetPointer (Vector2[] points)
static unsafe IntPtr GetPointer (Vector2 [] points)
{
if (points is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (points));
@ -61,7 +61,7 @@ namespace GameplayKit {
var buffer = Marshal.AllocHGlobal (length);
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;
return ctor_pointer = buffer;

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

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

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

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

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

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

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

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

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

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

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

@ -14,12 +14,11 @@ namespace HealthKit {
[SupportedOSPlatform ("maccatalyst15.0")]
[SupportedOSPlatform ("macos13.0")]
#else
[Watch (8,0)]
[iOS (15,0)]
[Mac (13,0)]
[Watch (8, 0)]
[iOS (15, 0)]
[Mac (13, 0)]
#endif
public static class HKAppleWalkingSteadiness
{
public static class HKAppleWalkingSteadiness {
[DllImport (Constants.HealthKitLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
@ -33,10 +32,10 @@ namespace HealthKit {
error = null;
if (HKAppleWalkingSteadinessClassificationForQuantity (value.GetHandle (), out var classificationOut, out var errorPtr)) {
classification = (HKAppleWalkingSteadinessClassification) (long) classificationOut;
error = Runtime.GetNSObject<NSError> (errorPtr, false);
error = Runtime.GetNSObject<NSError> (errorPtr, false);
return true;
}
return false;
return false;
}
@ -44,13 +43,13 @@ namespace HealthKit {
static extern HKQuantityRef HKAppleWalkingSteadinessMinimumQuantityForClassification (nint 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)]
static extern HKQuantityRef HKAppleWalkingSteadinessMaximumQuantityForClassification (nint 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;
#endif
namespace HealthKit
{
namespace HealthKit {
public partial class HKCategoryValueSleepAnalysisAsleep {
#if NET
@ -33,7 +32,7 @@ namespace HealthKit
[SupportedOSPlatform ("maccatalyst16.0")]
[UnsupportedOSPlatform ("tvos")]
#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
[DllImport (Constants.HealthKitLibrary)]
static extern NativeHandle HKCategoryValueSleepAnalysisAsleepValues ();
@ -44,14 +43,14 @@ namespace HealthKit
[SupportedOSPlatform ("maccatalyst16.0")]
[UnsupportedOSPlatform ("tvos")]
#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
public static HashSet<HKCategoryValueSleepAnalysis> GetAsleepValues ()
{
using var values = Runtime.GetNSObject<NSSet<NSNumber>> (HKCategoryValueSleepAnalysisAsleepValues ())!;
var hashSet = new HashSet<HKCategoryValueSleepAnalysis> ();
foreach (NSNumber value in values) {
hashSet.Add ((HKCategoryValueSleepAnalysis) (int)value);
hashSet.Add ((HKCategoryValueSleepAnalysis) (int) value);
}
return hashSet;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -16,8 +16,7 @@ using CoreGraphics;
using Foundation;
using ObjCRuntime;
namespace ImageIO
{
namespace ImageIO {
#if NET
[SupportedOSPlatform ("ios")]
@ -25,10 +24,9 @@ namespace ImageIO
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")]
#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
[SupportedOSPlatform ("macos10.15")]
@ -36,13 +34,13 @@ namespace ImageIO
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[Introduced (PlatformName.MacOSX, 10, 15, PlatformArchitecture.All)]
[Introduced (PlatformName.iOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.TvOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.WatchOS, 6, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.MacOSX, 10, 15, PlatformArchitecture.All)]
[Introduced (PlatformName.iOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.TvOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.WatchOS, 6, 0, PlatformArchitecture.All)]
#endif
[DllImport (Constants.ImageIOLibrary)]
static extern /* OSStatus */ CGImageAnimationStatus CGAnimateImageAtURLWithBlock ( /* CFURLRef */ IntPtr url, /* CFDictionaryRef _iio_Nullable */ IntPtr options, /* CGImageSourceAnimationHandler */ ref BlockLiteral block);
[DllImport (Constants.ImageIOLibrary)]
static extern /* OSStatus */ CGImageAnimationStatus CGAnimateImageAtURLWithBlock ( /* CFURLRef */ IntPtr url, /* CFDictionaryRef _iio_Nullable */ IntPtr options, /* CGImageSourceAnimationHandler */ ref BlockLiteral block);
#if NET
[SupportedOSPlatform ("macos10.15")]
@ -50,13 +48,13 @@ namespace ImageIO
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[Introduced (PlatformName.MacOSX, 10, 15, PlatformArchitecture.All)]
[Introduced (PlatformName.iOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.TvOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.WatchOS, 6, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.MacOSX, 10, 15, PlatformArchitecture.All)]
[Introduced (PlatformName.iOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.TvOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.WatchOS, 6, 0, PlatformArchitecture.All)]
#endif
[DllImport (Constants.ImageIOLibrary)]
static extern /* OSStatus */ CGImageAnimationStatus CGAnimateImageDataWithBlock ( /* CFDataRef _Nonnull */ IntPtr data, /* CFDictionaryRef _Nullable */ IntPtr options, /* CGImageSourceAnimationHandler _Nonnull */ ref BlockLiteral block);
[DllImport (Constants.ImageIOLibrary)]
static extern /* OSStatus */ CGImageAnimationStatus CGAnimateImageDataWithBlock ( /* CFDataRef _Nonnull */ IntPtr data, /* CFDictionaryRef _Nullable */ IntPtr options, /* CGImageSourceAnimationHandler _Nonnull */ ref BlockLiteral block);
#if NET
[SupportedOSPlatform ("macos10.15")]
@ -64,32 +62,32 @@ namespace ImageIO
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[Introduced (PlatformName.MacOSX, 10, 15, PlatformArchitecture.All)]
[Introduced (PlatformName.iOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.TvOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.WatchOS, 6, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.MacOSX, 10, 15, PlatformArchitecture.All)]
[Introduced (PlatformName.iOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.TvOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.WatchOS, 6, 0, PlatformArchitecture.All)]
#endif
[BindingImpl (BindingImplOptions.Optimizable)]
public static CGImageAnimationStatus AnimateImage (NSUrl url, CGImageAnimationOptions options, [BlockProxy (typeof (NIDCGImageSourceAnimationBlock))] CGImageSourceAnimationHandler handler)
{
[BindingImpl (BindingImplOptions.Optimizable)]
public static CGImageAnimationStatus AnimateImage (NSUrl url, CGImageAnimationOptions options, [BlockProxy (typeof (NIDCGImageSourceAnimationBlock))] CGImageSourceAnimationHandler handler)
{
#if IOS && ARCH_32
throw new PlatformNotSupportedException ("This API is not supported on this version of iOS");
#else
if (url is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (url));
if (handler is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (handler));
if (url is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (url));
if (handler is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (handler));
var block = new BlockLiteral ();
block.SetupBlockUnsafe (SDCGImageSourceAnimationBlock.Handler, handler);
var block = new BlockLiteral ();
block.SetupBlockUnsafe (SDCGImageSourceAnimationBlock.Handler, handler);
try {
return CGAnimateImageAtURLWithBlock (url.Handle, options.GetHandle (), ref block);
} finally {
block.CleanupBlock ();
}
try {
return CGAnimateImageAtURLWithBlock (url.Handle, options.GetHandle (), ref block);
} finally {
block.CleanupBlock ();
}
#endif
}
}
#if NET
[SupportedOSPlatform ("macos10.15")]
@ -97,81 +95,79 @@ namespace ImageIO
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[Introduced (PlatformName.MacOSX, 10, 15, PlatformArchitecture.All)]
[Introduced (PlatformName.iOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.TvOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.WatchOS, 6, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.MacOSX, 10, 15, PlatformArchitecture.All)]
[Introduced (PlatformName.iOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.TvOS, 13, 0, PlatformArchitecture.All)]
[Introduced (PlatformName.WatchOS, 6, 0, PlatformArchitecture.All)]
#endif
[BindingImpl (BindingImplOptions.Optimizable)]
public static CGImageAnimationStatus AnimateImage (NSData data, CGImageAnimationOptions options, [BlockProxy (typeof (NIDCGImageSourceAnimationBlock))] CGImageSourceAnimationHandler handler)
{
[BindingImpl (BindingImplOptions.Optimizable)]
public static CGImageAnimationStatus AnimateImage (NSData data, CGImageAnimationOptions options, [BlockProxy (typeof (NIDCGImageSourceAnimationBlock))] CGImageSourceAnimationHandler handler)
{
#if IOS && ARCH_32
throw new PlatformNotSupportedException ("This API is not supported on this version of iOS");
#else
if (data is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (data));
if (handler is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (handler));
if (data is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (data));
if (handler is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (handler));
var block = new BlockLiteral ();
block.SetupBlockUnsafe (SDCGImageSourceAnimationBlock.Handler, handler);
var block = new BlockLiteral ();
block.SetupBlockUnsafe (SDCGImageSourceAnimationBlock.Handler, handler);
try {
return CGAnimateImageDataWithBlock (data.Handle, options.GetHandle (), ref block);
} finally {
block.CleanupBlock ();
}
try {
return CGAnimateImageDataWithBlock (data.Handle, options.GetHandle (), ref block);
} finally {
block.CleanupBlock ();
}
#endif
}
}
//
// This class bridges native block invocations that call into C#
//
static internal class SDCGImageSourceAnimationBlock
{
static internal readonly DCGImageSourceAnimationBlock Handler = Invoke;
//
// This class bridges native block invocations that call into C#
//
static internal class SDCGImageSourceAnimationBlock {
static internal readonly DCGImageSourceAnimationBlock Handler = Invoke;
[MonoPInvokeCallback (typeof (DCGImageSourceAnimationBlock))]
static void Invoke (IntPtr block, nint index, IntPtr image, [MarshalAs (UnmanagedType.I1)] out bool stop)
{
var del = BlockLiteral.GetTarget<CGImageSourceAnimationHandler> (block);
if (del is not null)
del (index, new CoreGraphics.CGImage (image, false), out stop);
else
stop = false;
}
} /* class SDCGImageSourceAnimationBlock */
[MonoPInvokeCallback (typeof (DCGImageSourceAnimationBlock))]
static void Invoke (IntPtr block, nint index, IntPtr image, [MarshalAs (UnmanagedType.I1)] out bool stop)
{
var del = BlockLiteral.GetTarget<CGImageSourceAnimationHandler> (block);
if (del is not null)
del (index, new CoreGraphics.CGImage (image, false), out stop);
else
stop = false;
}
} /* class SDCGImageSourceAnimationBlock */
internal sealed class NIDCGImageSourceAnimationBlock : TrampolineBlockBase
{
DCGImageSourceAnimationBlock invoker;
internal sealed class NIDCGImageSourceAnimationBlock : TrampolineBlockBase {
DCGImageSourceAnimationBlock invoker;
[BindingImpl (BindingImplOptions.Optimizable)]
public unsafe NIDCGImageSourceAnimationBlock (BlockLiteral * block) : base (block)
{
invoker = block->GetDelegateForBlock<DCGImageSourceAnimationBlock> ();
}
[BindingImpl (BindingImplOptions.Optimizable)]
public unsafe NIDCGImageSourceAnimationBlock (BlockLiteral* block) : base (block)
{
invoker = block->GetDelegateForBlock<DCGImageSourceAnimationBlock> ();
}
[Preserve (Conditional = true)]
[BindingImpl (BindingImplOptions.Optimizable)]
public unsafe static CGImageSourceAnimationHandler? Create (IntPtr block)
{
if (block == IntPtr.Zero)
return null;
var del = (CGImageSourceAnimationHandler) GetExistingManagedDelegate (block);
return del ?? new NIDCGImageSourceAnimationBlock ( (BlockLiteral *) block).Invoke;
}
[Preserve (Conditional = true)]
[BindingImpl (BindingImplOptions.Optimizable)]
public unsafe static CGImageSourceAnimationHandler? Create (IntPtr block)
{
if (block == IntPtr.Zero)
return null;
var del = (CGImageSourceAnimationHandler) GetExistingManagedDelegate (block);
return del ?? new NIDCGImageSourceAnimationBlock ((BlockLiteral*) block).Invoke;
}
[BindingImpl (BindingImplOptions.Optimizable)]
void Invoke (nint index, CGImage image, out bool stop)
{
invoker (BlockPointer, index, image.GetHandle (), out stop);
}
} /* class NIDCGImageSourceAnimationBlock */
[BindingImpl (BindingImplOptions.Optimizable)]
void Invoke (nint index, CGImage image, out bool stop)
{
invoker (BlockPointer, index, image.GetHandle (), out stop);
}
} /* class NIDCGImageSourceAnimationBlock */
[UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
[UserDelegateType (typeof (CGImageSourceAnimationHandler))]
internal delegate void DCGImageSourceAnimationBlock (IntPtr block, nint index, IntPtr imageHandle, [MarshalAs (UnmanagedType.I1)] out bool stop);
}
[UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
[UserDelegateType (typeof (CGImageSourceAnimationHandler))]
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 {
public partial class CGImageDestinationOptions
{
public partial class CGImageDestinationOptions {
CGColor? destinationBackgroundColor;
public CGColor? DestinationBackgroundColor {
get { return destinationBackgroundColor; }
@ -58,15 +57,14 @@ namespace ImageIO {
}
}
public partial class CGCopyImageSourceOptions
{
public partial class CGCopyImageSourceOptions {
#if NET
[SupportedOSPlatform ("ios7.0")]
[SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")]
#else
[iOS (7,0)]
[iOS (7, 0)]
#endif
public CGImageMetadata? Metadata { get; set; }
@ -76,7 +74,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")]
#else
[iOS (7,0)]
[iOS (7, 0)]
#endif
public bool MergeMetadata { get; set; }
@ -86,7 +84,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")]
#else
[iOS (7,0)]
[iOS (7, 0)]
#endif
public bool ShouldExcludeXMP { get; set; }
@ -107,7 +105,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")]
#else
[iOS (7,0)]
[iOS (7, 0)]
#endif
public DateTime? DateTime { get; set; }
@ -117,7 +115,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")]
#else
[iOS (7,0)]
[iOS (7, 0)]
#endif
public int? Orientation { get; set; }
@ -147,7 +145,7 @@ namespace ImageIO {
using (var n = new NSNumber (Orientation.Value))
dict.LowlevelSetObject (n.Handle, kOrientation);
}
return dict;
}
}
@ -178,15 +176,15 @@ namespace ImageIO {
}
#endif
[Preserve (Conditional=true)]
[Preserve (Conditional = true)]
internal CGImageDestination (NativeHandle handle, bool owns)
: base (handle, owns)
{
}
[DllImport (Constants.ImageIOLibrary, EntryPoint="CGImageDestinationGetTypeID")]
[DllImport (Constants.ImageIOLibrary, EntryPoint = "CGImageDestinationGetTypeID")]
public extern static /* CFTypeID */ nint GetTypeID ();
[DllImport (Constants.ImageIOLibrary)]
extern static /* CFArrayRef __nonnull */ IntPtr CGImageDestinationCopyTypeIdentifiers ();
@ -221,7 +219,7 @@ namespace ImageIO {
[DllImport (Constants.ImageIOLibrary)]
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);
public static CGImageDestination? Create (NSMutableData data, string typeIdentifier, int imageCount, CGImageDestinationOptions? options = null)
@ -289,13 +287,13 @@ namespace ImageIO {
{
if (image is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (image));
CGImageDestinationAddImage (Handle, image.Handle, properties.GetHandle ());
}
[DllImport (Constants.ImageIOLibrary)]
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);
public void AddImage (CGImageSource source, int index, CGImageDestinationOptions? options = null)
@ -311,7 +309,7 @@ namespace ImageIO {
{
if (source is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (source));
CGImageDestinationAddImageFromSource (Handle, source.Handle, index, properties.GetHandle ());
}
@ -332,7 +330,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")]
#else
[iOS (7,0)]
[iOS (7, 0)]
#endif
[DllImport (Constants.ImageIOLibrary)]
extern static void CGImageDestinationAddImageAndMetadata (/* CGImageDestinationRef __nonnull */ IntPtr idst,
@ -345,7 +343,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")]
#else
[iOS (7,0)]
[iOS (7, 0)]
#endif
[EditorBrowsable (EditorBrowsableState.Advanced)]
public void AddImageAndMetadata (CGImage image, CGImageMetadata meta, NSDictionary? options)
@ -361,7 +359,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")]
#else
[iOS (7,0)]
[iOS (7, 0)]
#endif
public void AddImageAndMetadata (CGImage image, CGImageMetadata meta, CGImageDestinationOptions? options)
{
@ -375,7 +373,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")]
#else
[iOS (7,0)]
[iOS (7, 0)]
#endif
[DllImport (Constants.ImageIOLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
@ -389,7 +387,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")]
#else
[iOS (7,0)]
[iOS (7, 0)]
#endif
[EditorBrowsable (EditorBrowsableState.Advanced)]
public bool CopyImageSource (CGImageSource image, NSDictionary? options, out NSError? error)
@ -407,7 +405,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")]
#else
[iOS (7,0)]
[iOS (7, 0)]
#endif
public bool CopyImageSource (CGImageSource image, CGCopyImageSourceOptions? options, out NSError? error)
{

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

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

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

@ -29,7 +29,7 @@ namespace ImageIO {
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")]
#else
[iOS (7,0)]
[iOS (7, 0)]
#endif
public class CGImageMetadataTag : NativeObject {
@ -46,7 +46,7 @@ namespace ImageIO {
}
#endif
[Preserve (Conditional=true)]
[Preserve (Conditional = true)]
internal CGImageMetadataTag (NativeHandle handle, bool owns)
: base (handle, owns)
{
@ -83,7 +83,7 @@ namespace ImageIO {
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 ();
@ -141,7 +141,7 @@ namespace ImageIO {
extern static /* CFArrayRef __nullable */ IntPtr CGImageMetadataTagCopyQualifiers (
/* CGImageMetadataTagRef __nonnull */ IntPtr tag);
public CGImageMetadataTag?[]? GetQualifiers ()
public CGImageMetadataTag? []? GetQualifiers ()
{
IntPtr result = CGImageMetadataTagCopyQualifiers (Handle);
return CFArray.ArrayFromHandle<CGImageMetadataTag> (result, true);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -26,12 +26,11 @@ namespace Intents {
[iOS (10, 0)]
[Mac (10, 12, 0, PlatformArchitecture.Arch64)]
[Watch (3, 2)]
[TV (14,0)]
[TV (14, 0)]
#endif
[Register ("INIntentResolutionResult", SkipRegistration = true)]
public sealed partial class INIntentResolutionResult<ObjectType> : INIntentResolutionResult
where ObjectType : class, INativeObject
{
where ObjectType : class, INativeObject {
internal INIntentResolutionResult (NativeHandle handle) : base (handle)
{
}
@ -63,9 +62,9 @@ namespace Intents {
[SupportedOSPlatform ("tvos14.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[Watch (6,0)]
[iOS (13,0)]
[Mac (11,0)]
[Watch (6, 0)]
[iOS (13, 0)]
[Mac (11, 0)]
#endif
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 ("maccatalyst")]
#else
[Watch (6,0)]
[iOS (13,0)]
[Mac (11,0)]
[Watch (6, 0)]
[iOS (13, 0)]
[Mac (11, 0)]
#endif
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
if (SystemVersion.CheckmacOS (10, 13))
#endif
return SuccessWithResolvedMessageAttributeOptions (resolvedValue);
return SuccessWithResolvedMessageAttributeOptions (resolvedValue);
else
return SuccessWithResolvedValue (resolvedValue);
}
@ -39,7 +39,7 @@ namespace Intents {
#elif MONOMAC
if (SystemVersion.CheckmacOS (10, 13))
#endif
return ConfirmationRequiredWithMessageAttributeOptionsToConfirm (valueToConfirm);
return ConfirmationRequiredWithMessageAttributeOptionsToConfirm (valueToConfirm);
else
return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
}

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

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

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

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

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

@ -5,12 +5,10 @@ using ObjCRuntime;
#nullable enable
namespace Intents
{
namespace Intents {
#if !TVOS
public partial class INPerson
{
public partial class INPerson {
#if NET
[SupportedOSPlatform ("ios15.0")]
@ -18,12 +16,12 @@ namespace Intents
[SupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("tvos")]
#else
[Introduced (PlatformName.iOS, 15,0)]
[Introduced (PlatformName.MacOSX, 12,0)]
[Introduced (PlatformName.WatchOS, 8,0)]
[Introduced (PlatformName.iOS, 15, 0)]
[Introduced (PlatformName.MacOSX, 12, 0)]
[Introduced (PlatformName.WatchOS, 8, 0)]
#endif
public enum INPersonType {
Me = 0,
Me = 0,
ContactSuggestion = 1,
}
@ -33,9 +31,9 @@ namespace Intents
[SupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("tvos")]
#else
[Introduced (PlatformName.iOS, 15,0)]
[Introduced (PlatformName.MacOSX, 12,0)]
[Introduced (PlatformName.WatchOS, 8,0)]
[Introduced (PlatformName.iOS, 15, 0)]
[Introduced (PlatformName.MacOSX, 12, 0)]
[Introduced (PlatformName.WatchOS, 8, 0)]
#endif
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)
@ -48,9 +46,9 @@ namespace Intents
[SupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("tvos")]
#else
[Introduced (PlatformName.iOS, 15,0)]
[Introduced (PlatformName.MacOSX, 12,0)]
[Introduced (PlatformName.WatchOS, 8,0)]
[Introduced (PlatformName.iOS, 15, 0)]
[Introduced (PlatformName.MacOSX, 12, 0)]
[Introduced (PlatformName.WatchOS, 8, 0)]
#endif
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
if (SystemVersion.CheckmacOS (10, 13))
#endif
InitializeHandle (InitWithVocabularyIdentifier (identifier, spokenPhrase, pronunciationHint));
InitializeHandle (InitWithVocabularyIdentifier (identifier, spokenPhrase, pronunciationHint));
#if !TVOS
else
InitializeHandle (InitWithIdentifier (identifier, spokenPhrase, pronunciationHint));

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

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

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

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

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

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

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

@ -14,8 +14,8 @@ using Foundation;
namespace JavaScriptCore {
public partial class JSContext {
public JSValue this[NSObject key] {
public JSValue this [NSObject key] {
get { return _GetObject (key); }
set { _SetObject (value, key); }
}
@ -31,16 +31,16 @@ namespace JavaScriptCore {
static public JSValue From (string value, JSContext context)
{
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); }
set { _SetObject (value, index); }
}
public JSValue this[NSObject key] {
public JSValue this [NSObject key] {
get { return _ObjectForKeyedSubscript (key); }
set { _SetObject (value, key); }
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -7,17 +7,17 @@ using ObjCRuntime;
namespace MapKit {
public enum MKPointOfInterestFilterType {
public enum MKPointOfInterestFilterType {
Including,
Excluding,
}
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
switch (type) {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -25,9 +25,9 @@ namespace MediaPlayer {
[UnsupportedOSPlatform ("ios11.3")]
[ObsoletedOSPlatform ("ios11.3", "Use 'MPVolumeView' to present volume controls.")]
#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
[DllImport (Constants.MediaPlayerLibrary, EntryPoint="MPVolumeSettingsAlertShow")]
[DllImport (Constants.MediaPlayerLibrary, EntryPoint = "MPVolumeSettingsAlertShow")]
public extern static void AlertShow ();
#if NET
@ -36,9 +36,9 @@ namespace MediaPlayer {
[UnsupportedOSPlatform ("ios11.3")]
[ObsoletedOSPlatform ("ios11.3", "Use 'MPVolumeView' to present volume controls.")]
#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
[DllImport (Constants.MediaPlayerLibrary, EntryPoint="MPVolumeSettingsAlertHide")]
[DllImport (Constants.MediaPlayerLibrary, EntryPoint = "MPVolumeSettingsAlertHide")]
public extern static void AlertHide ();
// 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")]
[ObsoletedOSPlatform ("ios11.3", "Use 'MPVolumeView' to present volume controls.")]
#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
[DllImport (Constants.MediaPlayerLibrary, EntryPoint="MPVolumeSettingsAlertIsVisible")]
[DllImport (Constants.MediaPlayerLibrary, EntryPoint = "MPVolumeSettingsAlertIsVisible")]
[return: MarshalAs (UnmanagedType.I1)]
public extern static /* BOOL */ bool AlertIsVisible ();
}

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

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

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

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

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

@ -10,6 +10,7 @@
#nullable enable
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using ObjCRuntime;
@ -206,7 +207,26 @@ namespace Network {
[iOS (15,0)]
[MacCatalyst (15,0)]
#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)
=> 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)]
Continue = 16,
#if !NET
#pragma warning disable 0618 // warning CS0618: 'PKPaymentButtonType.[field]' is obsolete: 'Use '[replacement]'.'
[iOS (12,0)]
Book2 = Checkout,
[iOS (12,0)]
Checkout2 = Book,
#pragma warning restore
#endif // !NET
}

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

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

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

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

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

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

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

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

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