diff --git a/Make.config b/Make.config
index 95bb98c184c8..9239051e95c8 100644
--- a/Make.config
+++ b/Make.config
@@ -18,6 +18,7 @@ PACKAGE_HEAD_REV=$(shell git rev-parse HEAD)
# PACKAGE_HEAD_BRANCH (set to the release branch name, this shows up in the IDE's version information, as well as mtouch/mmp --version)
# IOS_PACKAGE_VERSION (major/minor #)
# MAC_PACKAGE_VERSION (major/minor #)
+# PACKAGE_VERSION_REV (set to 0 and increment for service releases or previews)
# (and updating the same on master as well, to next version)
#
@@ -37,21 +38,23 @@ else
CURRENT_BRANCH:=$(PACKAGE_HEAD_BRANCH)
endif
+# for service releases and previews
+PACKAGE_VERSION_REV=0
+
IOS_PRODUCT=Xamarin.iOS
IOS_PACKAGE_NAME=Xamarin.iOS
IOS_PACKAGE_NAME_LOWER=$(shell echo $(IOS_PACKAGE_NAME) | tr "[:upper:]" "[:lower:]")
# NEVER customize IOS_PACKAGE_VERSION itself, other parts (mtouch, web updater) are using the IOS_PACKAGE_VERSION_* variables
-IOS_PACKAGE_VERSION=10.15.0.$(IOS_COMMIT_DISTANCE)
+IOS_PACKAGE_VERSION=11.3.$(PACKAGE_VERSION_REV).$(IOS_COMMIT_DISTANCE)
IOS_PACKAGE_VERSION_MAJOR=$(word 1, $(subst ., ,$(IOS_PACKAGE_VERSION)))
IOS_PACKAGE_VERSION_MINOR=$(word 2, $(subst ., ,$(IOS_PACKAGE_VERSION)))
-IOS_PACKAGE_VERSION_REV=$(word 3, $(subst ., ,$(IOS_PACKAGE_VERSION)))
+IOS_PACKAGE_VERSION_REV=$(PACKAGE_VERSION_REV)
IOS_PACKAGE_VERSION_BUILD=$(IOS_COMMIT_DISTANCE)
IOS_PACKAGE_UPDATE_ID=$(shell printf "2%02d%02d%02d%03d" $(IOS_PACKAGE_VERSION_MAJOR) $(IOS_PACKAGE_VERSION_MINOR) $(IOS_PACKAGE_VERSION_REV) $(IOS_PACKAGE_VERSION_BUILD))
-# Xcode 8.3
-XCODE_VERSION=8.3
-XCODE_URL=http://xamarin-storage/bot-provisioning/Xcode_8.3.xip
-XCODE_DEVELOPER_ROOT=/Applications/Xcode83.app/Contents/Developer
+XCODE_VERSION=9
+XCODE_URL=http://xamarin-storage/bot-provisioning/Xcode_9_GM_seed.xip
+XCODE_DEVELOPER_ROOT=/Applications/Xcode9-GM.app/Contents/Developer
# Minimum Mono version
MIN_MONO_VERSION=5.4.0.60
@@ -72,10 +75,10 @@ MIN_OSX_BUILD_VERSION=10.12
MIN_OSX_VERSION_FOR_IOS=10.11
MIN_OSX_VERSION_FOR_MAC=10.11
-IOS_SDK_VERSION=10.3
-OSX_SDK_VERSION=10.12
-WATCH_SDK_VERSION=3.2
-TVOS_SDK_VERSION=10.2
+IOS_SDK_VERSION=11.0
+OSX_SDK_VERSION=10.13
+WATCH_SDK_VERSION=4.0
+TVOS_SDK_VERSION=11.0
MIN_IOS_SDK_VERSION=6.0
MIN_OSX_SDK_VERSION=10.7
@@ -249,10 +252,10 @@ MAC_PRODUCT=Xamarin.Mac
MAC_PACKAGE_NAME=xamarin.mac
MAC_PACKAGE_NAME_LOWER=$(shell echo $(MAC_PACKAGE_NAME) | tr "[:upper:]" "[:lower:]")
-MAC_PACKAGE_VERSION=3.9.0.$(MAC_COMMIT_DISTANCE)
+MAC_PACKAGE_VERSION=4.1.$(PACKAGE_VERSION_REV).$(MAC_COMMIT_DISTANCE)
MAC_PACKAGE_VERSION_MAJOR=$(word 1, $(subst ., ,$(MAC_PACKAGE_VERSION)))
MAC_PACKAGE_VERSION_MINOR=$(word 2, $(subst ., ,$(MAC_PACKAGE_VERSION)))
-MAC_PACKAGE_VERSION_REV=$(word 3, $(subst ., ,$(MAC_PACKAGE_VERSION)))
+MAC_PACKAGE_VERSION_REV=$(PACKAGE_VERSION_REV)
MAC_PACKAGE_VERSION_BUILD=$(word 4, $(subst ., ,$(MAC_PACKAGE_VERSION)))
MAC_PACKAGE_VERSION_MAJOR_MINOR=$(MAC_PACKAGE_VERSION_MAJOR).$(MAC_PACKAGE_VERSION_MINOR)
MAC_PACKAGE_UPDATE_ID=$(shell echo $(subst ., ,$(MAC_PACKAGE_VERSION).$(MAC_PACKAGE_VERSION_BUILD)) | awk '{printf "2%02d%02d%02d%03d",$$1,$$2,$$3,$$4}')
diff --git a/README.md b/README.md
index 3ad16fb71e72..1ac8445b6092 100644
--- a/README.md
+++ b/README.md
@@ -142,4 +142,3 @@ We use [Mono's Coding Guidelines](http://www.mono-project.com/community/contribu
### Reporting Bugs
We use [Bugzilla](https://bugzilla.xamarin.com/newbug) to track issues.
-
diff --git a/Versions-ios.plist.in b/Versions-ios.plist.in
index 859bc81aed45..738f00f802a5 100644
--- a/Versions-ios.plist.in
+++ b/Versions-ios.plist.in
@@ -23,6 +23,7 @@
10.1
10.2
10.3
+ 11.0
tvOS
@@ -32,6 +33,7 @@
10.0
10.1
10.2
+ 11.0
watchOS
@@ -42,6 +44,7 @@
3.0
3.1
3.2
+ 4.0
RecommendedXcodeVersion
diff --git a/Versions-mac.plist.in b/Versions-mac.plist.in
index 02734a11e841..8b90fc642e3f 100644
--- a/Versions-mac.plist.in
+++ b/Versions-mac.plist.in
@@ -12,6 +12,7 @@
10.10
10.11
10.12
+ 10.13
RecommendedXcodeVersion
diff --git a/builds/Makefile b/builds/Makefile
index 2241e3d477ec..6545c0ac0100 100644
--- a/builds/Makefile
+++ b/builds/Makefile
@@ -805,6 +805,7 @@ SIM_ACVARS = \
$(COMMON_ACVARS) \
ac_cv_func_clock_nanosleep=no \
mono_cv_uscore=yes \
+ ac_cv_func_system=no \
define SimulatorBuildTemplate
@@ -1856,6 +1857,7 @@ endif
LLVM_BASE_CONFIGURE_FLAGS=--enable-libcpp --enable-optimized --enable-assertions=no --disable-jit --disable-docs --disable-doxygen
LLVM_CXXFLAGS=$(CCACHE_CXXFLAGS)
+LLVM_BASE_CONFIGURE_ENVIRONMENT=$(COMMON_ACVARS)
# This is used just for linking with the 32 bit cross compiler
# FIXME: Avoid building the libs not needed by mono
@@ -1863,6 +1865,7 @@ LLVM_CXXFLAGS=$(CCACHE_CXXFLAGS)
@mkdir -p llvm/
@echo "Configuring llvm"
@cd llvm && \
+ $(LLVM_BASE_CONFIGURE_ENVIRONMENT) \
$(abspath $(LLVM_PATH)/configure) --prefix=$$PWD/usr --build=i386-apple-darwin10.7 --enable-targets="arm" $(LLVM_BASE_CONFIGURE_FLAGS) --cache-file=../llvm.config.cache CC="$(CCACHE)clang" CXX="$(CCACHE)clang++" CXXFLAGS="$(LLVM_CXXFLAGS)" > $@.log 2>&1 || (echo "Configuring llvm failed:" && cat $@.log | sed "s/^/ /" && exit 1)
$(Q) @touch $@
@echo Configured llvm
@@ -1871,6 +1874,7 @@ LLVM_CXXFLAGS=$(CCACHE_CXXFLAGS)
@mkdir -p llvm64/
@echo "Configuring llvm64"
@cd llvm64 && \
+ $(LLVM_BASE_CONFIGURE_ENVIRONMENT) \
$(abspath $(LLVM_PATH)/configure) --prefix=$$PWD/usr --enable-targets="arm arm64" $(LLVM_BASE_CONFIGURE_FLAGS) --cache-file=../llvm64.config.cache CC="$(CCACHE)clang" CXX="$(CCACHE)clang++" CXXFLAGS="-Qunused-arguments" > $@.log 2>&1 || (echo "Configuring llvm64 failed:" && cat $@.log | sed "s/^/ /" && exit 1)
$(Q) @touch $@
@echo "Configured llvm64"
diff --git a/docs/website/mtouch-errors.md b/docs/website/mtouch-errors.md
index 12eb1da7d5ed..b255e499c7b7 100644
--- a/docs/website/mtouch-errors.md
+++ b/docs/website/mtouch-errors.md
@@ -560,9 +560,21 @@ linker. This will most likely result in native linker errors.
The solution is to remove the `--dynamic-symbol-mode=linker` argument from the additional mtouch arguments in the project's Build options.
-### MT0116: Aot files could not be found at the expected directory '{msymdir}'.
+### MT0116: Invalid architecture: {arch}. 32-bit architectures are not supported when deployment target is 11 or later. Make sure the project does not build for a 32-bit architecture.
-
+iOS 11 does not contain support for 32-bit applications, so it's not supported
+to build for a 32-bit application when the deployment target is iOS 11 or
+later.
+
+Either change the target architecture in the project's iOS build options to
+arm64, or change the deployment target in the project's Info.plist to an
+earlier iOS version.
+
+### MT0117: Can't launch a 32-bit app on a simulator that only supports 64-bit.
+
+### MT0116: Aot files could not be found at the expected directory '{msymdir}'.
+
+
### MT0123: The current language was set to '{language}' according to the LANG environment variable (LANG={LANG}).
diff --git a/external/Touch.Unit b/external/Touch.Unit
index 055659f10af4..8f1e19d731c7 160000
--- a/external/Touch.Unit
+++ b/external/Touch.Unit
@@ -1 +1 @@
-Subproject commit 055659f10af409c7e369ee3372bd3f4b1a99fd2c
+Subproject commit 8f1e19d731c7490993e5b25aaa2fc340498079b5
diff --git a/external/Xamarin.MacDev b/external/Xamarin.MacDev
index da6aeb0f4924..59023905966b 160000
--- a/external/Xamarin.MacDev
+++ b/external/Xamarin.MacDev
@@ -1 +1 @@
-Subproject commit da6aeb0f49243a497a921c0cef24264b1ca1279c
+Subproject commit 59023905966b465cc92bb46535cf66a59a38d39f
diff --git a/external/llvm b/external/llvm
index 6aa74ae5723b..975e3a690300 160000
--- a/external/llvm
+++ b/external/llvm
@@ -1 +1 @@
-Subproject commit 6aa74ae5723b13433adce76e94adcc090f2768ee
+Subproject commit 975e3a6903003d7dba1b01f8a3c4a42a55049842
diff --git a/external/mono b/external/mono
index b2acee0ade0c..7d7887780057 160000
--- a/external/mono
+++ b/external/mono
@@ -1 +1 @@
-Subproject commit b2acee0ade0c53b0e70a322f3adb15071517add0
+Subproject commit 7d7887780057e40f3921ceedca6c1579a928655d
diff --git a/external/opentk b/external/opentk
index 2335bde3612c..396bc90c7ac2 160000
--- a/external/opentk
+++ b/external/opentk
@@ -1 +1 @@
-Subproject commit 2335bde3612c0cfcc1f0057d494c2ce681b54df4
+Subproject commit 396bc90c7ac2e7ce442840a5e8bd91e5e79b381e
diff --git a/jenkins/nunit-summary.xslt b/jenkins/nunit-summary.xslt
deleted file mode 100644
index bf270e66d55a..000000000000
--- a/jenkins/nunit-summary.xslt
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [PASS]
-
-
- [FAIL]
-
-
- [IGNORED]
-
-
- [INCONCLUSIVE]
-
-
- [INFO]
-
-
- . :
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mk/xamarin.mk b/mk/xamarin.mk
index e09a031c6bcc..5ea227abed32 100644
--- a/mk/xamarin.mk
+++ b/mk/xamarin.mk
@@ -1,5 +1,5 @@
ifdef ENABLE_XAMARIN
-NEEDED_MACCORE_VERSION := 93175c63568e00cf7cf7ac4be5a5cbd4d51bb0b9
+NEEDED_MACCORE_VERSION := e2905474b133977db654cf4036e78616ed92c3bf
NEEDED_MACCORE_BRANCH := master
MACCORE_DIRECTORY := maccore
diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets
index 3c0c2782f7cd..f601b56c0459 100644
--- a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets
+++ b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets
@@ -1856,7 +1856,7 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved.
-
diff --git a/msbuild/tests/MyPhotoEditingExtension/Info.plist b/msbuild/tests/MyPhotoEditingExtension/Info.plist
index 3698f5d349be..37a6585165db 100644
--- a/msbuild/tests/MyPhotoEditingExtension/Info.plist
+++ b/msbuild/tests/MyPhotoEditingExtension/Info.plist
@@ -18,6 +18,8 @@
1.0
CFBundleSignature
????
+ MinimumOSVersion
+ 8.0
CFBundleVersion
1
NSExtension
diff --git a/msbuild/tests/MyShareExtension/Info.plist b/msbuild/tests/MyShareExtension/Info.plist
index 70c38f8e2eb6..7d795b753f7a 100644
--- a/msbuild/tests/MyShareExtension/Info.plist
+++ b/msbuild/tests/MyShareExtension/Info.plist
@@ -18,6 +18,8 @@
1.0
CFBundleSignature
????
+ MinimumOSVersion
+ 8.0
CFBundleVersion
1
NSExtension
diff --git a/msbuild/tests/MySingleView/Info.plist b/msbuild/tests/MySingleView/Info.plist
index bb938e4d18a9..dbf35be44e97 100644
--- a/msbuild/tests/MySingleView/Info.plist
+++ b/msbuild/tests/MySingleView/Info.plist
@@ -15,7 +15,7 @@
UIMainStoryboardFile
MainStoryboard
MinimumOSVersion
- 6.1
+ 7.0
CFBundleDisplayName
ApplicationName
CFBundleIdentifier
diff --git a/msbuild/tests/MyTodayExtension/Info.plist b/msbuild/tests/MyTodayExtension/Info.plist
index 3081b14e398a..bde8933a3016 100644
--- a/msbuild/tests/MyTodayExtension/Info.plist
+++ b/msbuild/tests/MyTodayExtension/Info.plist
@@ -18,6 +18,8 @@
1.0
CFBundleSignature
????
+ MinimumOSVersion
+ 8.0
CFBundleVersion
1
NSExtension
diff --git a/msbuild/tests/Xamarin.iOS.Tasks.Tests/TargetTests/TargetTests.cs b/msbuild/tests/Xamarin.iOS.Tasks.Tests/TargetTests/TargetTests.cs
index 2b2560b97b83..de2f3b7e3e60 100644
--- a/msbuild/tests/Xamarin.iOS.Tasks.Tests/TargetTests/TargetTests.cs
+++ b/msbuild/tests/Xamarin.iOS.Tasks.Tests/TargetTests/TargetTests.cs
@@ -36,6 +36,7 @@ string[] ExpectedExecutableBundleResources {
"LaunchImage-568h@2x.png",
"LaunchImage.png",
"LaunchImage@2x.png",
+ "Assets.car",
};
return files.Select (s => Path.Combine (AppBundlePath, s)).ToArray ();
}
@@ -435,7 +436,7 @@ public void BundleResources ()
var path = Path.Combine (MonoTouchProjectPath, "Info.plist");
var plist = PDictionary.FromFile (path);
- plist.SetMinimumOSVersion ("6.1");
+ plist.SetMinimumOSVersion ("7.0");
plist.Save (path, true);
RunTarget (MonoTouchProject, TargetName.CollectBundleResources);
@@ -480,7 +481,7 @@ public void AddAppIcon_NoClean()
// Start without app icon.
plist.Remove("XSAppIconAssets");
- plist.SetMinimumOSVersion ("6.1");
+ plist.SetMinimumOSVersion ("7.0");
plist.Save (path, true);
RunTarget (project, TargetName.CompileImageAssets);
diff --git a/runtime/Makefile b/runtime/Makefile
index aea83e631024..82b82ffb2010 100644
--- a/runtime/Makefile
+++ b/runtime/Makefile
@@ -41,7 +41,7 @@ Delegates.generated.cs: Delegates.cs.t4 delegates.t4
$(Q_GEN) $(TT) $< -o $@
bindings-generator.exe: bindings-generator.cs
- $(Q) $(SYSTEM_MCS) $< -o:$@
+ $(Q) $(SYSTEM_MCS) $< -o:$@ -debug:full
bindings-generated.m: bindings-generator.exe
$(Q_GEN) $(SYSTEM_MONO) --debug $< $@
diff --git a/runtime/bindings-generator.cs b/runtime/bindings-generator.cs
index f22abaa890b6..72906481807f 100644
--- a/runtime/bindings-generator.cs
+++ b/runtime/bindings-generator.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.Linq;
using System.Text;
/*
@@ -35,6 +36,7 @@ public static int Main (string[] args)
writer.WriteLine ("/* This file is generated */");
writer.WriteLine ();
writer.WriteLine ("#include \"bindings.h\"");
+ writer.WriteLine ("#include ");
writer.WriteLine ();
writer.WriteLine ("#ifdef __cplusplus");
writer.WriteLine ("extern \"C\" {");
@@ -75,6 +77,26 @@ static IEnumerable GetFunctionData ()
{
var data = new List ();
+ data.Add (
+ new FunctionData {
+ Comment = " // NVector3 func ()",
+ Prefix = "simd__",
+ Variants = Variants.All,
+ ReturnType = Types.NVector3,
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // void func (NVector3)",
+ Prefix = "simd__",
+ Variants = Variants.msgSend | Variants.msgSendSuper,
+ Parameters = new ParameterData[] {
+ new ParameterData { TypeData = Types.NVector3 }
+ },
+ }
+ );
+
data.Add (
new FunctionData {
Comment = " // void func (Vector3)",
@@ -669,6 +691,32 @@ static IEnumerable GetFunctionData ()
}
);
+ data.Add (
+ new FunctionData {
+ Comment = " // MDLAxisAlignedBoundingBox func (float)",
+ Prefix = "simd__",
+ Variants = Variants.All,
+ ReturnType = Types.MDLAxisAlignedBoundingBox,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.Float },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // IntPtr func (IntPtr, MDLAxisAlignedBoundingBox, float)",
+ Prefix = "simd__",
+ Variants = Variants.All,
+ ReturnType = Types.IntPtr,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.IntPtr },
+ new ParameterData { TypeData = Types.MDLAxisAlignedBoundingBox },
+ new ParameterData { TypeData = Types.Float },
+ },
+ }
+ );
+
data.Add (
new FunctionData {
Comment = " // Vector3 func (Vector4i)",
@@ -1443,6 +1491,26 @@ static IEnumerable GetFunctionData ()
}
);
+ data.Add (
+ new FunctionData {
+ Comment = " // Quaternion func ()",
+ Prefix = "simd__",
+ Variants = Variants.All,
+ ReturnType = Types.QuatF,
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // void func (Quaternion)",
+ Prefix = "simd__",
+ Variants = Variants.NonStret,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.QuatF },
+ },
+ }
+ );
+
// Required for ModelIO
data.Add (
new FunctionData {
@@ -1862,6 +1930,372 @@ static IEnumerable GetFunctionData ()
}
);
+ // Required for ARKit
+
+ data.Add (
+ new FunctionData {
+ Comment = " // Matrix4 func (/* UIInterfaceOrientation */ Int32, CGSize, nfloat, nfloat)",
+ Prefix = "simd__",
+ Variants = Variants.All,
+ ReturnType = Types.Matrix4f,
+ Parameters = new ParameterData[] {
+ new ParameterData { TypeData = Types.Int32 },
+ new ParameterData { TypeData = Types.CGSize },
+ new ParameterData { TypeData = Types.NFloat },
+ new ParameterData { TypeData = Types.NFloat },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // Matrix4 func (/* UIInterfaceOrientation */ Int64, CGSize, nfloat, nfloat)",
+ Prefix = "simd__",
+ Variants = Variants.All,
+ ReturnType = Types.Matrix4f,
+ Parameters = new ParameterData[] {
+ new ParameterData { TypeData = Types.Int64 },
+ new ParameterData { TypeData = Types.CGSize },
+ new ParameterData { TypeData = Types.NFloat },
+ new ParameterData { TypeData = Types.NFloat },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // CGPoint func (Vector3, /* UIInterfaceOrientation */ Int32, CGSize)",
+ Prefix = "simd__",
+ Variants = Variants.All,
+ ReturnType = Types.CGPoint,
+ Parameters = new ParameterData[] {
+ new ParameterData { TypeData = Types.NVector3 },
+ new ParameterData { TypeData = Types.Int32 },
+ new ParameterData { TypeData = Types.CGSize },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // CGPoint func (Vector3, /* UIInterfaceOrientation */ Int64, CGSize)",
+ Prefix = "simd__",
+ Variants = Variants.All,
+ ReturnType = Types.CGPoint,
+ Parameters = new ParameterData[] {
+ new ParameterData { TypeData = Types.NVector3 },
+ new ParameterData { TypeData = Types.Int64 },
+ new ParameterData { TypeData = Types.CGSize },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // Matrix4 func (/* UIInterfaceOrientation */ nint)",
+ Prefix = "simd__",
+ Variants = Variants.All,
+ ReturnType = Types.Matrix4f,
+ Parameters = new ParameterData[] {
+ new ParameterData { TypeData = Types.NInt },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // MPSImageHistogramInfo func ()",
+ Prefix = "simd__",
+ Variants = Variants.All,
+ ReturnType = Types.MPSImageHistogramInfo,
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // void func (NMatrix2)",
+ Prefix = "simd__",
+ Variants = Variants.NonStret,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.NMatrix2 },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // NMatrix2 func ()",
+ Prefix = "simd__",
+ Variants = Variants.All,
+ ReturnType = Types.NMatrix2,
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // IntPtr func (IntPtr, ref MPSImageHistogramInfo)",
+ Prefix = "simd__",
+ Variants = Variants.NonStret,
+ ReturnType = Types.IntPtr,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.IntPtr },
+ new ParameterData { TypeData = Types.MPSImageHistogramInfo, IsRef = true },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // IntPtr func (IntPtr, NMatrix2)",
+ Prefix = "simd__",
+ Variants = Variants.NonStret,
+ ReturnType = Types.IntPtr,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.IntPtr },
+ new ParameterData { TypeData = Types.NMatrix2 },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // void func (NMatrix3)",
+ Prefix = "simd__",
+ Variants = Variants.NonStret,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.NMatrix3 },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // IntPtr func (NMatrix3)",
+ Prefix = "simd__",
+ Variants = Variants.NonStret,
+ ReturnType = Types.IntPtr,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.NMatrix3 },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // MDLVoxelIndexExtent2 func ()",
+ Prefix = "simd__",
+ Variants = Variants.All,
+ ReturnType = Types.MDLVoxelIndexExtent2,
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // NMatrix3 func ()",
+ Prefix = "simd__",
+ Variants = Variants.All,
+ ReturnType = Types.NMatrix3,
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // void func (MDLVoxelIndexExtent2)",
+ Prefix = "simd__",
+ Variants = Variants.NonStret,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.MDLVoxelIndexExtent2 },
+ }
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // IntPtr func (IntPtr, NMatrix3)",
+ Prefix = "simd__",
+ Variants = Variants.NonStret,
+ ReturnType = Types.IntPtr,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.IntPtr },
+ new ParameterData { TypeData = Types.NMatrix3 },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // void func (NMatrix4)",
+ Prefix = "simd__",
+ Variants = Variants.NonStret,
+ Parameters = new ParameterData[] {
+ new ParameterData { TypeData = Types.NMatrix4 },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // IntPtr func (NMatrix4)",
+ Prefix = "simd__",
+ Variants = Variants.NonStret,
+ ReturnType = Types.IntPtr,
+ Parameters = new ParameterData[] {
+ new ParameterData { TypeData = Types.NMatrix4 },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // void func (NMatrix4, double)",
+ Prefix = "simd__",
+ Variants = Variants.NonStret,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.NMatrix4 },
+ new ParameterData { TypeData = Types.Double },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // IntPtr func (NMatrix4, bool)",
+ Prefix = "simd__",
+ Variants = Variants.NonStret,
+ ReturnType = Types.IntPtr,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.NMatrix4 },
+ new ParameterData { TypeData = Types.Bool },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // IntPtr func (MDLVoxelIndexExtent2)",
+ Prefix = "simd__",
+ Variants = Variants.NonStret,
+ ReturnType = Types.IntPtr,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.MDLVoxelIndexExtent2 },
+ },
+ }
+ );
+
+
+ data.Add (
+ new FunctionData {
+ Comment = " // IntPtr func (IntPtr, nuint, NMatrix4)",
+ Prefix = "simd__",
+ Variants = Variants.NonStret,
+ ReturnType = Types.IntPtr,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.IntPtr },
+ new ParameterData { TypeData = Types.NUInt },
+ new ParameterData { TypeData = Types.NMatrix4 },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // NMatrix4 func ()",
+ Prefix = "simd__",
+ Variants = Variants.All,
+ ReturnType = Types.NMatrix4,
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // NMatrix4 func (int, CGSize, nfloat, nfloat)",
+ Prefix = "simd__",
+ Variants = Variants.All,
+ ReturnType = Types.NMatrix4,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.Int32 },
+ new ParameterData { TypeData = Types.CGSize },
+ new ParameterData { TypeData = Types.NFloat },
+ new ParameterData { TypeData = Types.NFloat },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // NMatrix4 func (Int64, CGSize, nfloat, nfloat)",
+ Prefix = "simd__",
+ Variants = Variants.All,
+ ReturnType = Types.NMatrix4,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.Int64 },
+ new ParameterData { TypeData = Types.CGSize },
+ new ParameterData { TypeData = Types.NFloat },
+ new ParameterData { TypeData = Types.NFloat },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // NMatrix4 func (double)",
+ Prefix = "simd__",
+ Variants = Variants.All,
+ ReturnType = Types.NMatrix4,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.Double },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // NMatrix4 func (nint)",
+ Prefix = "simd__",
+ Variants = Variants.All,
+ ReturnType = Types.NMatrix4,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.NInt },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // IntPtr func (IntPtr, nint, NMatrix4)",
+ Prefix = "simd__",
+ Variants = Variants.NonStret,
+ ReturnType = Types.IntPtr,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.IntPtr },
+ new ParameterData { TypeData = Types.NInt },
+ new ParameterData { TypeData = Types.NMatrix4 },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // IntPtr func (IntPtr, NMatrix4)",
+ Prefix = "simd__",
+ Variants = Variants.NonStret,
+ ReturnType = Types.IntPtr,
+ Parameters = new ParameterData [] {
+ new ParameterData { TypeData = Types.IntPtr },
+ new ParameterData { TypeData = Types.NMatrix4 },
+ },
+ }
+ );
+
+ data.Add (
+ new FunctionData {
+ Comment = " // NMatrix4x3 func ()",
+ Prefix = "simd__",
+ Variants = Variants.All,
+ ReturnType = Types.NMatrix4x3,
+ }
+ );
+
// We must expand functions with native types to their actual type as well.
for (int i = data.Count - 1; i >= 0; i--) {
if (!data [i].HasNativeType)
@@ -1878,176 +2312,260 @@ static string GetTypeNameForSignature (string managed_type)
return managed_type;
}
- static void MarshalToManaged (StringWriter writer, TypeData type, string nativeVariable, string managedVariable)
+ static void MarshalToManaged (StringWriter writer, TypeData type, string nativeVariable, string managedVariable, bool isRef = false)
{
+ var accessor = isRef ? "->" : ".";
switch (type.ManagedType) {
case "Vector2d":
case "Vector2i":
case "Vector2":
- writer.WriteLine ("\t{0}.a = {1} [0];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.b = {1} [1];", managedVariable, nativeVariable);
+ writer.WriteLine ("\t{0}{2}a = {1} [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}b = {1} [1];", managedVariable, nativeVariable, accessor);
break;
case "Vector3d":
case "Vector3i":
case "Vector3":
- writer.WriteLine ("\t{0}.a = {1} [0];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.b = {1} [1];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.c = {1} [2];", managedVariable, nativeVariable);
+ case "NVector3":
+ case "NVector3d":
+ writer.WriteLine ("\t{0}{2}a = {1} [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}b = {1} [1];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}c = {1} [2];", managedVariable, nativeVariable, accessor);
break;
case "Vector4d":
case "Vector4i":
case "Vector4":
if (type.NativeType == "vector_float3") {
- writer.WriteLine ("\t{0}.a = {1} [0];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.b = {1} [1];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.c = {1} [2];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.d = 0;", managedVariable);
+ writer.WriteLine ("\t{0}{2}a = {1} [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}b = {1} [1];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}c = {1} [2];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{1}d = 0;", managedVariable, accessor);
} else if (type.NativeType == "vector_float4" || type.NativeType == "vector_int4" || type.NativeType == "vector_double4") {
- writer.WriteLine ("\t{0}.a = {1} [0];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.b = {1} [1];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.c = {1} [2];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.d = {1} [3];", managedVariable, nativeVariable);
+ writer.WriteLine ("\t{0}{2}a = {1} [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}b = {1} [1];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}c = {1} [2];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}d = {1} [3];", managedVariable, nativeVariable, accessor);
} else {
goto default;
}
break;
case "Matrix2":
+ case "NMatrix2":
writer.WriteLine ("\tfor (int i = 0; i < 2; i++) {");
- writer.WriteLine ("\t\t{0}.columns [i].a = {1}.columns [i] [0];", managedVariable, nativeVariable);
- writer.WriteLine ("\t\t{0}.columns [i].b = {1}.columns [i] [1];", managedVariable, nativeVariable);
+ writer.WriteLine ("\t\t{0}{2}columns [i].a = {1}.columns [i] [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t\t{0}{2}columns [i].b = {1}.columns [i] [1];", managedVariable, nativeVariable, accessor);
writer.WriteLine ("\t}");
break;
case "Matrix3":
+ case "NMatrix3":
writer.WriteLine ("\tfor (int i = 0; i < 3; i++) {");
- writer.WriteLine ("\t\t{0}.columns [i].a = {1}.columns [i] [0];", managedVariable, nativeVariable);
- writer.WriteLine ("\t\t{0}.columns [i].b = {1}.columns [i] [1];", managedVariable, nativeVariable);
- writer.WriteLine ("\t\t{0}.columns [i].c = {1}.columns [i] [2];", managedVariable, nativeVariable);
+ writer.WriteLine ("\t\t{0}{2}columns [i].a = {1}.columns [i] [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t\t{0}{2}columns [i].b = {1}.columns [i] [1];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t\t{0}{2}columns [i].c = {1}.columns [i] [2];", managedVariable, nativeVariable, accessor);
writer.WriteLine ("\t}");
break;
case "Matrix4":
+ case "NMatrix4":
+ case "NMatrix4d":
+ writer.WriteLine ("\tfor (int i = 0; i < 4; i++) {");
+ writer.WriteLine ("\t\t{0}{2}columns [i].a = {1}.columns [i] [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t\t{0}{2}columns [i].b = {1}.columns [i] [1];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t\t{0}{2}columns [i].c = {1}.columns [i] [2];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t\t{0}{2}columns [i].d = {1}.columns [i] [3];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t}");
+ break;
+ case "NMatrix4x3":
writer.WriteLine ("\tfor (int i = 0; i < 4; i++) {");
- writer.WriteLine ("\t\t{0}.columns [i].a = {1}.columns [i] [0];", managedVariable, nativeVariable);
- writer.WriteLine ("\t\t{0}.columns [i].b = {1}.columns [i] [1];", managedVariable, nativeVariable);
- writer.WriteLine ("\t\t{0}.columns [i].c = {1}.columns [i] [2];", managedVariable, nativeVariable);
- writer.WriteLine ("\t\t{0}.columns [i].d = {1}.columns [i] [3];", managedVariable, nativeVariable);
+ writer.WriteLine ("\t\t{0}{2}columns [i].a = {1}.columns [i] [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t\t{0}{2}columns [i].b = {1}.columns [i] [1];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t\t{0}{2}columns [i].c = {1}.columns [i] [2];", managedVariable, nativeVariable, accessor);
writer.WriteLine ("\t}");
break;
case "MDLAxisAlignedBoundingBox":
- writer.WriteLine ("\t{0}.maxBounds.a = {1}.maxBounds [0];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.maxBounds.b = {1}.maxBounds [1];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.maxBounds.c = {1}.maxBounds [2];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.minBounds.a = {1}.minBounds [0];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.minBounds.b = {1}.minBounds [1];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.minBounds.c = {1}.minBounds [2];", managedVariable, nativeVariable);
+ writer.WriteLine ("\t{0}{2}maxBounds.a = {1}.maxBounds [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}maxBounds.b = {1}.maxBounds [1];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}maxBounds.c = {1}.maxBounds [2];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}minBounds.a = {1}.minBounds [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}minBounds.b = {1}.minBounds [1];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}minBounds.c = {1}.minBounds [2];", managedVariable, nativeVariable, accessor);
break;
case "GKBox":
- writer.WriteLine ("\t{0}.maxBounds.a = {1}.maxBounds [0];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.maxBounds.b = {1}.maxBounds [1];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.maxBounds.c = {1}.maxBounds [2];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.minBounds.a = {1}.minBounds [0];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.minBounds.b = {1}.minBounds [1];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.minBounds.c = {1}.minBounds [2];", managedVariable, nativeVariable);
+ writer.WriteLine ("\t{0}{2}maxBounds.a = {1}.maxBounds [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}maxBounds.b = {1}.maxBounds [1];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}maxBounds.c = {1}.maxBounds [2];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}minBounds.a = {1}.minBounds [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}minBounds.b = {1}.minBounds [1];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}minBounds.c = {1}.minBounds [2];", managedVariable, nativeVariable, accessor);
break;
case "GKQuad":
- writer.WriteLine ("\t{0}.maxBounds.a = {1}.maxBounds [0];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.maxBounds.b = {1}.maxBounds [1];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.minBounds.a = {1}.minBounds [0];", managedVariable, nativeVariable);
- writer.WriteLine ("\t{0}.minBounds.b = {1}.minBounds [1];", managedVariable, nativeVariable);
+ writer.WriteLine ("\t{0}{2}maxBounds.a = {1}.maxBounds [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}maxBounds.b = {1}.maxBounds [1];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}minBounds.a = {1}.minBounds [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}minBounds.b = {1}.minBounds [1];", managedVariable, nativeVariable, accessor);
break;
case "GKTriangle":
writer.WriteLine ("\tfor (int i = 0; i < 3; i++) {");
- writer.WriteLine ("\t\t{0}.points [i].a = {1}.points [i] [0];", managedVariable, nativeVariable);
- writer.WriteLine ("\t\t{0}.points [i].b = {1}.points [i] [1];", managedVariable, nativeVariable);
- writer.WriteLine ("\t\t{0}.points [i].c = {1}.points [i] [2];", managedVariable, nativeVariable);
+ writer.WriteLine ("\t\t{0}{2}points [i].a = {1}.points [i] [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t\t{0}{2}points [i].b = {1}.points [i] [1];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t\t{0}{2}points [i].c = {1}.points [i] [2];", managedVariable, nativeVariable, accessor);
writer.WriteLine ("\t}");
break;
+ case "Quaternion":
+ writer.WriteLine ("\t{0}{2}vector.a = {1}.vector [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}vector.b = {1}.vector [1];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}vector.c = {1}.vector [2];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}vector.d = {1}.vector [3];", managedVariable, nativeVariable, accessor);
+ break;
+ case "MPSImageHistogramInfo":
+ writer.WriteLine ("\t{0}{2}numberOfHistogramEntries = {1}.numberOfHistogramEntries;", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}histogramForAlpha = {1}.histogramForAlpha;", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}minPixelValue.a = {1}.minPixelValue [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}minPixelValue.b = {1}.minPixelValue [1];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}minPixelValue.c = {1}.minPixelValue [2];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}minPixelValue.d = {1}.minPixelValue [3];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}maxPixelValue.a = {1}.maxPixelValue [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}maxPixelValue.b = {1}.maxPixelValue [1];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}maxPixelValue.c = {1}.maxPixelValue [2];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}maxPixelValue.d = {1}.maxPixelValue [3];", managedVariable, nativeVariable, accessor);
+ break;
+ case "MDLVoxelIndexExtent2":
+ writer.WriteLine ("\t{0}{2}minimumExtent.a = {1}.minimumExtent [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}minimumExtent.b = {1}.minimumExtent [1];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}minimumExtent.c = {1}.minimumExtent [2];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}minimumExtent.d = {1}.minimumExtent [3];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}maximumExtent.a = {1}.maximumExtent [0];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}maximumExtent.b = {1}.maximumExtent [1];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}maximumExtent.c = {1}.maximumExtent [2];", managedVariable, nativeVariable, accessor);
+ writer.WriteLine ("\t{0}{2}maximumExtent.d = {1}.maximumExtent [3];", managedVariable, nativeVariable, accessor);
+ break;
default:
throw new NotImplementedException (string.Format ("MarshalToManaged for: NativeType: {0} ManagedType: {1}", type.NativeType, type.ManagedType));
}
}
- static void MarshalToNative (StringWriter writer, TypeData type, string nativeVariable, string managedVariable)
+ static void MarshalToNative (StringWriter writer, TypeData type, string nativeVariable, string managedVariable, bool isRef)
{
+ var accessor = isRef ? "->" : ".";
switch (type.ManagedType) {
case "Vector2d":
case "Vector2i":
case "Vector2":
- writer.WriteLine ("\t{0} [0] = {1}.a;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0} [1] = {1}.b;", nativeVariable, managedVariable);
+ writer.WriteLine ("\t{0} [0] = {1}{2}a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0} [1] = {1}{2}b;", nativeVariable, managedVariable, accessor);
break;
case "Vector3d":
case "Vector3i":
case "Vector3":
- writer.WriteLine ("\t{0} [0] = {1}.a;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0} [1] = {1}.b;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0} [2] = {1}.c;", nativeVariable, managedVariable);
+ case "NVector3":
+ case "NVector3d":
+ writer.WriteLine ("\t{0} [0] = {1}{2}a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0} [1] = {1}{2}b;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0} [2] = {1}{2}c;", nativeVariable, managedVariable, accessor);
break;
case "Vector4d":
case "Vector4i":
case "Vector4":
if (type.NativeType == "vector_float3") {
- writer.WriteLine ("\t{0} [0] = {1}.a;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0} [1] = {1}.b;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0} [2] = {1}.c;", nativeVariable, managedVariable);
+ writer.WriteLine ("\t{0} [0] = {1}{2}a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0} [1] = {1}{2}b;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0} [2] = {1}{2}c;", nativeVariable, managedVariable, accessor);
} else if (type.NativeType == "vector_float4" || type.NativeType == "vector_int4" || type.NativeType == "vector_double4") {
- writer.WriteLine ("\t{0} [0] = {1}.a;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0} [1] = {1}.b;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0} [2] = {1}.c;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0} [3] = {1}.d;", nativeVariable, managedVariable);
+ writer.WriteLine ("\t{0} [0] = {1}{2}a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0} [1] = {1}{2}b;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0} [2] = {1}{2}c;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0} [3] = {1}{2}d;", nativeVariable, managedVariable, accessor);
} else {
goto default;
}
break;
case "Matrix2":
+ case "NMatrix2":
writer.WriteLine ("\tfor (int i = 0; i < 2; i++) {");
- writer.WriteLine ("\t\t{0}.columns [i][0] = {1}.columns [i].a;", nativeVariable, managedVariable);
- writer.WriteLine ("\t\t{0}.columns [i][1] = {1}.columns [i].b;", nativeVariable, managedVariable);
+ writer.WriteLine ("\t\t{0}.columns [i][0] = {1}{2}columns [i].a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t\t{0}.columns [i][1] = {1}{2}columns [i].b;", nativeVariable, managedVariable, accessor);
writer.WriteLine ("\t}");
break;
case "Matrix3":
+ case "NMatrix3":
writer.WriteLine ("\tfor (int i = 0; i < 3; i++) {");
- writer.WriteLine ("\t\t{0}.columns [i][0] = {1}.columns [i].a;", nativeVariable, managedVariable);
- writer.WriteLine ("\t\t{0}.columns [i][1] = {1}.columns [i].b;", nativeVariable, managedVariable);
- writer.WriteLine ("\t\t{0}.columns [i][2] = {1}.columns [i].c;", nativeVariable, managedVariable);
+ writer.WriteLine ("\t\t{0}.columns [i][0] = {1}{2}columns [i].a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t\t{0}.columns [i][1] = {1}{2}columns [i].b;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t\t{0}.columns [i][2] = {1}{2}columns [i].c;", nativeVariable, managedVariable, accessor);
writer.WriteLine ("\t}");
break;
case "Matrix4":
+ case "NMatrix4":
+ case "NMatrix4d":
+ writer.WriteLine ("\tfor (int i = 0; i < 4; i++) {");
+ writer.WriteLine ("\t\t{0}.columns [i][0] = {1}{2}columns [i].a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t\t{0}.columns [i][1] = {1}{2}columns [i].b;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t\t{0}.columns [i][2] = {1}{2}columns [i].c;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t\t{0}.columns [i][3] = {1}{2}columns [i].d;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t}");
+ break;
+ case "NMatrix4x3":
writer.WriteLine ("\tfor (int i = 0; i < 4; i++) {");
- writer.WriteLine ("\t\t{0}.columns [i][0] = {1}.columns [i].a;", nativeVariable, managedVariable);
- writer.WriteLine ("\t\t{0}.columns [i][1] = {1}.columns [i].b;", nativeVariable, managedVariable);
- writer.WriteLine ("\t\t{0}.columns [i][2] = {1}.columns [i].c;", nativeVariable, managedVariable);
- writer.WriteLine ("\t\t{0}.columns [i][3] = {1}.columns [i].d;", nativeVariable, managedVariable);
+ writer.WriteLine ("\t\t{0}.columns [i][0] = {1}{2}columns [i].a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t\t{0}.columns [i][1] = {1}{2}columns [i].b;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t\t{0}.columns [i][2] = {1}{2}columns [i].c;", nativeVariable, managedVariable, accessor);
writer.WriteLine ("\t}");
break;
case "MDLAxisAlignedBoundingBox":
- writer.WriteLine ("\t{0}.maxBounds [0] = {1}.maxBounds.a;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0}.maxBounds [1] = {1}.maxBounds.b;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0}.maxBounds [2] = {1}.maxBounds.c;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0}.minBounds [0] = {1}.minBounds.a;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0}.minBounds [1] = {1}.minBounds.b;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0}.minBounds [2] = {1}.minBounds.c;", nativeVariable, managedVariable);
+ writer.WriteLine ("\t{0}.maxBounds [0] = {1}{2}maxBounds.a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.maxBounds [1] = {1}{2}maxBounds.b;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.maxBounds [2] = {1}{2}maxBounds.c;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.minBounds [0] = {1}{2}minBounds.a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.minBounds [1] = {1}{2}minBounds.b;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.minBounds [2] = {1}{2}minBounds.c;", nativeVariable, managedVariable, accessor);
break;
case "GKBox":
- writer.WriteLine ("\t{0}.maxBounds [0] = {1}.maxBounds.a;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0}.maxBounds [1] = {1}.maxBounds.b;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0}.maxBounds [2] = {1}.maxBounds.c;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0}.minBounds [0] = {1}.minBounds.a;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0}.minBounds [1] = {1}.minBounds.b;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0}.minBounds [2] = {1}.minBounds.c;", nativeVariable, managedVariable);
+ writer.WriteLine ("\t{0}.maxBounds [0] = {1}{2}maxBounds.a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.maxBounds [1] = {1}{2}maxBounds.b;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.maxBounds [2] = {1}{2}maxBounds.c;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.minBounds [0] = {1}{2}minBounds.a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.minBounds [1] = {1}{2}minBounds.b;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.minBounds [2] = {1}{2}minBounds.c;", nativeVariable, managedVariable, accessor);
break;
case "GKQuad":
- writer.WriteLine ("\t{0}.maxBounds [0] = {1}.maxBounds.a;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0}.maxBounds [1] = {1}.maxBounds.b;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0}.minBounds [0] = {1}.minBounds.a;", nativeVariable, managedVariable);
- writer.WriteLine ("\t{0}.minBounds [1] = {1}.minBounds.b;", nativeVariable, managedVariable);
+ writer.WriteLine ("\t{0}.maxBounds [0] = {1}{2}maxBounds.a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.maxBounds [1] = {1}{2}maxBounds.b;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.minBounds [0] = {1}{2}minBounds.a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.minBounds [1] = {1}{2}minBounds.b;", nativeVariable, managedVariable, accessor);
break;
case "GKTriangle":
writer.WriteLine ("\tfor (int i = 0; i < 3; i++) {");
- writer.WriteLine ("\t\t{0}.points [i][0] = {1}.points [i].a;", nativeVariable, managedVariable);
- writer.WriteLine ("\t\t{0}.points [i][1] = {1}.points [i].b;", nativeVariable, managedVariable);
- writer.WriteLine ("\t\t{0}.points [i][2] = {1}.points [i].c;", nativeVariable, managedVariable);
+ writer.WriteLine ("\t\t{0}.points [i][0] = {1}{2}points [i].a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t\t{0}.points [i][1] = {1}{2}points [i].b;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t\t{0}.points [i][2] = {1}{2}points [i].c;", nativeVariable, managedVariable, accessor);
writer.WriteLine ("\t}");
break;
+ case "Quaternion":
+ writer.WriteLine ("\t{0}.vector [0] = {1}{2}vector.a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.vector [1] = {1}{2}vector.b;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.vector [2] = {1}{2}vector.c;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.vector [3] = {1}{2}vector.d;", nativeVariable, managedVariable, accessor);
+ break;
+ case "MPSImageHistogramInfo":
+ writer.WriteLine ("\t{0}.numberOfHistogramEntries = {1}{2}numberOfHistogramEntries;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.histogramForAlpha = {1}{2}histogramForAlpha;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.minPixelValue [0] = {1}{2}minPixelValue.a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.minPixelValue [1] = {1}{2}minPixelValue.b;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.minPixelValue [2] = {1}{2}minPixelValue.c;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.minPixelValue [3] = {1}{2}minPixelValue.d;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.maxPixelValue [0] = {1}{2}maxPixelValue.a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.maxPixelValue [1] = {1}{2}maxPixelValue.b;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.maxPixelValue [2] = {1}{2}maxPixelValue.c;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.maxPixelValue [3] = {1}{2}maxPixelValue.d;", nativeVariable, managedVariable, accessor);
+ break;
+ case "MDLVoxelIndexExtent2":
+ writer.WriteLine ("\t{0}.minimumExtent [0] = {1}{2}minimumExtent.a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.minimumExtent [1] = {1}{2}minimumExtent.b;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.minimumExtent [2] = {1}{2}minimumExtent.c;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.minimumExtent [3] = {1}{2}minimumExtent.d;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.maximumExtent [0] = {1}{2}maximumExtent.a;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.maximumExtent [1] = {1}{2}maximumExtent.b;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.maximumExtent [2] = {1}{2}maximumExtent.c;", nativeVariable, managedVariable, accessor);
+ writer.WriteLine ("\t{0}.maximumExtent [3] = {1}{2}maximumExtent.d;", nativeVariable, managedVariable, accessor);
+ break;
default:
throw new NotImplementedException (string.Format ("MarshalToNative for: NativeType: {0} ManagedType: {1}", type.NativeType, type.ManagedType));
}
@@ -2086,7 +2604,7 @@ static void WriteParametersMarshal (StringWriter writer, ParameterData [] ps)
continue;
writer.WriteLine ("\t{0} v{1};", p.TypeData.NativeType, i);
- MarshalToNative (writer, p.TypeData, "v" + i.ToString (), "p" + i.ToString ());
+ MarshalToNative (writer, p.TypeData, "v" + i.ToString (), "p" + i.ToString (), p.IsRef);
}
}
@@ -2097,14 +2615,35 @@ static void WriteParametersInvoke (StringWriter writer, ParameterData [] ps)
for (int i = 0; i < ps.Length; i++) {
var p = ps [i];
+ writer.Write (", ");
+ if (p.IsRef && p.TypeData != Types.IntPtr)
+ writer.Write ("&");
if (p.TypeData.RequireMarshal) {
- writer.Write (", v{0}", i);
+ writer.Write ("v{0}", i);
} else {
- writer.Write (", p{0}", i);
+ writer.Write ("p{0}", i);
}
}
}
+ static void WriteParametersNativeDeclaration (StringWriter writer, ParameterData [] parameters, bool isTypedef)
+ {
+ if (parameters == null)
+ return;
+
+
+ for (int i = 0; i < parameters.Length; i++) {
+ var p = parameters [i];
+ writer.Write (", ");
+ writer.Write (isTypedef ? p.TypeData.NativeType : p.TypeData.NativeWrapperType);
+ if (p.IsRef && p.TypeData != Types.IntPtr)
+ writer.Write ("*");
+ writer.Write (" ");
+ writer.Write (isTypedef ? "f" : "p");
+ writer.Write (i);
+ }
+ }
+
static void WriteMessageStretSenderCode (StringWriter writer, TypeData type, bool isSuper)
{
var nonstret = isSuper ? "objc_msgSendSuper" : "objc_msgSend";
@@ -2130,35 +2669,56 @@ static void WriteCatchHandler (StringWriter writer)
writer.WriteLine ("\t}");
}
+ static void WriteMarshalParametersToManaged (StringWriter writer, FunctionData func)
+ {
+ if (func.Parameters == null)
+ return;
+
+ for (int i = 0; i < func.Parameters.Length; i++) {
+ var p = func.Parameters [i];
+ if (!p.IsRef || !p.TypeData.RequireMarshal)
+ continue;
+ MarshalToManaged (writer, p.TypeData, $"v{i}", $"p{i}", true);
+ }
+ }
+
+ static void WriteMarshalReturnValue (StringWriter writer, FunctionData func, string indent, bool tmpReturnValue)
+ {
+ if (func.ReturnType != null) {
+ if (func.ReturnType.RequireMarshal) {
+ // Marshal return value back
+ writer.WriteLine ("{0}{1} rvm;", indent, func.ReturnType.NativeWrapperType);
+ MarshalToManaged (writer, func.ReturnType, "rv", "rvm");
+ writer.WriteLine ("{0}return rvm;", indent);
+ } else if (tmpReturnValue) {
+ writer.WriteLine ("{0}return rv;", indent);
+ }
+ }
+ }
+
static void Write_objc_msgSend (StringWriter writer, FunctionData func)
{
+ var tmpReturnValue = func.ReturnType != null && (func.ReturnType.RequireMarshal == true || func.Parameters?.Any ((v) => v.IsRef && v.TypeData.RequireMarshal) == true);
+
// func name
var overload = "objc_msgSend";
var funcName = GetFuncName (func, overload);
// typedef
writer.Write ("typedef {0} (*func_{1}) (id self, SEL sel", func.ReturnType == null ? "void" : func.ReturnType.NativeType, funcName.ToString ());
- if (func.Parameters != null) {
- for (int i = 0; i < func.Parameters.Length; i++) {
- writer.Write (", {0} f{1}", func.Parameters [i].TypeData.NativeType, i);
- }
- }
+ WriteParametersNativeDeclaration (writer, func.Parameters, true);
writer.WriteLine (");");
// declaration
writer.WriteLine (func.ReturnType != null ? func.ReturnType.NativeWrapperType : "void");
writer.Write (funcName);
writer.Write (" (id self, SEL sel");
- if (func.Parameters != null) {
- for (int i = 0; i < func.Parameters.Length; i++) {
- writer.Write (", {0} p{1}", func.Parameters [i].TypeData.NativeWrapperType, i);
- }
- }
+ WriteParametersNativeDeclaration (writer, func.Parameters, false);
writer.WriteLine (")");
// body
writer.WriteLine ("{");
- if (func.ReturnType != null && func.ReturnType.RequireMarshal) {
+ if (tmpReturnValue) {
writer.WriteLine ("\t{0} rv;", func.ReturnType.NativeType);
}
@@ -2178,7 +2738,7 @@ static void Write_objc_msgSend (StringWriter writer, FunctionData func)
// invoke
writer.Write (indent);
if (func.ReturnType != null) {
- if (func.ReturnType.RequireMarshal) {
+ if (tmpReturnValue) {
writer.Write ("rv = ");
} else {
writer.Write ("return ");
@@ -2188,14 +2748,8 @@ static void Write_objc_msgSend (StringWriter writer, FunctionData func)
WriteParametersInvoke (writer, func.Parameters);
writer.WriteLine (");");
- if (func.ReturnType != null) {
- if (func.ReturnType.RequireMarshal) {
- // Marshal return value back
- writer.WriteLine ("{0}{1} rvm;", indent, func.ReturnType.NativeWrapperType);
- MarshalToManaged (writer, func.ReturnType, "rv", "rvm");
- writer.WriteLine ("{0}return rvm;", indent);
- }
- }
+ WriteMarshalParametersToManaged (writer, func);
+ WriteMarshalReturnValue (writer, func, indent, tmpReturnValue);
// @catch
if (func.MarshalExceptions)
@@ -2207,33 +2761,27 @@ static void Write_objc_msgSend (StringWriter writer, FunctionData func)
static void Write_objc_msgSendSuper (StringWriter writer, FunctionData func)
{
+ var tmpReturnValue = func.ReturnType != null && (func.ReturnType.RequireMarshal == true || func.Parameters?.Any ((v) => v.IsRef && v.TypeData.RequireMarshal) == true);
+
// func name
var overload = "objc_msgSendSuper";
var funcName = GetFuncName (func, overload);
// typedef
writer.Write ("typedef {0} (*func_{1}) (struct objc_super *super, SEL sel", func.ReturnType == null ? "void" : func.ReturnType.NativeType, funcName.ToString ());
- if (func.Parameters != null) {
- for (int i = 0; i < func.Parameters.Length; i++) {
- writer.Write (", {0} f{1}", func.Parameters [i].TypeData.NativeType, i);
- }
- }
+ WriteParametersNativeDeclaration (writer, func.Parameters, true);
writer.WriteLine (");");
// declaration
writer.WriteLine (func.ReturnType != null ? func.ReturnType.NativeWrapperType : "void");
writer.Write (funcName);
writer.Write (" (struct objc_super *super, SEL sel");
- if (func.Parameters != null) {
- for (int i = 0; i < func.Parameters.Length; i++) {
- writer.Write (", {0} p{1}", func.Parameters [i].TypeData.NativeWrapperType, i);
- }
- }
+ WriteParametersNativeDeclaration (writer, func.Parameters, false);
writer.WriteLine (")");
// body
writer.WriteLine ("{");
- if (func.ReturnType != null && func.ReturnType.RequireMarshal) {
+ if (tmpReturnValue) {
writer.WriteLine ("\t{0} rv;", func.ReturnType.NativeType);
}
@@ -2253,7 +2801,7 @@ static void Write_objc_msgSendSuper (StringWriter writer, FunctionData func)
// invoke
writer.Write (indent);
if (func.ReturnType != null) {
- if (func.ReturnType.RequireMarshal) {
+ if (tmpReturnValue) {
writer.Write ("rv = ");
} else {
writer.Write ("return ");
@@ -2263,14 +2811,8 @@ static void Write_objc_msgSendSuper (StringWriter writer, FunctionData func)
WriteParametersInvoke (writer, func.Parameters);
writer.WriteLine (");");
- if (func.ReturnType != null) {
- if (func.ReturnType.RequireMarshal) {
- // Marshal return value back
- writer.WriteLine ("{0}{1} rvm;", indent, func.ReturnType.NativeWrapperType);
- MarshalToManaged (writer, func.ReturnType, "rv", "rvm");
- writer.WriteLine ("{0}return rvm;", indent);
- }
- }
+ WriteMarshalParametersToManaged (writer, func);
+ WriteMarshalReturnValue (writer, func, indent, tmpReturnValue);
// @catch
if (func.MarshalExceptions)
@@ -2291,22 +2833,14 @@ static void Write_objc_msgSend_stret (StringWriter writer, FunctionData func)
// typedef
writer.Write ("typedef {0} (*func_{1}) (id self, SEL sel", func.ReturnType.NativeType, funcName.ToString ());
- if (func.Parameters != null) {
- for (int i = 0; i < func.Parameters.Length; i++) {
- writer.Write (", {0} f{1}", func.Parameters [i].TypeData.NativeType, i);
- }
- }
+ WriteParametersNativeDeclaration (writer, func.Parameters, true);
writer.WriteLine (");");
// declaration
writer.WriteLine ("void");
writer.Write (funcName);
writer.Write (" ({0} *stret_rv, id self, SEL sel", func.ReturnType.NativeWrapperType);
- if (func.Parameters != null) {
- for (int i = 0; i < func.Parameters.Length; i++) {
- writer.Write (", {0} p{1}", func.Parameters [i].TypeData.NativeWrapperType, i);
- }
- }
+ WriteParametersNativeDeclaration (writer, func.Parameters, false);
writer.WriteLine (")");
// body
@@ -2338,6 +2872,7 @@ static void Write_objc_msgSend_stret (StringWriter writer, FunctionData func)
WriteParametersInvoke (writer, func.Parameters);
writer.WriteLine (");");
+ WriteMarshalParametersToManaged (writer, func);
if (func.ReturnType.RequireMarshal) {
// Marshal return value back
MarshalToManaged (writer, func.ReturnType, "rv", "(*stret_rv)");
@@ -2362,22 +2897,14 @@ static void Write_objc_msgSendSuper_stret (StringWriter writer, FunctionData fun
// typedef
writer.Write ("typedef {0} (*func_{1}) (struct objc_super *super, SEL sel", func.ReturnType.NativeType, funcName.ToString ());
- if (func.Parameters != null) {
- for (int i = 0; i < func.Parameters.Length; i++) {
- writer.Write (", {0} f{1}", func.Parameters [i].TypeData.NativeType, i);
- }
- }
+ WriteParametersNativeDeclaration (writer, func.Parameters, true);
writer.WriteLine (");");
// declaration
writer.WriteLine ("void");
writer.Write (funcName);
writer.Write (" ({0} *stret_rv, struct objc_super *super, SEL sel", func.ReturnType.NativeWrapperType);
- if (func.Parameters != null) {
- for (int i = 0; i < func.Parameters.Length; i++) {
- writer.Write (", {0} p{1}", func.Parameters [i].TypeData.NativeWrapperType, i);
- }
- }
+ WriteParametersNativeDeclaration (writer, func.Parameters, false);
writer.WriteLine (")");
// body
@@ -2409,6 +2936,7 @@ static void Write_objc_msgSendSuper_stret (StringWriter writer, FunctionData fun
WriteParametersInvoke (writer, func.Parameters);
writer.WriteLine (");");
+ WriteMarshalParametersToManaged (writer, func);
if (func.ReturnType.RequireMarshal) {
// Marshal return value back
MarshalToManaged (writer, func.ReturnType, "rv", "(*stret_rv)");
@@ -2436,6 +2964,12 @@ public static class Types {
NativeWrapperType = "struct Vector3f",
RequireMarshal = true,
};
+ public static TypeData NVector3 = new TypeData {
+ ManagedType = "NVector3",
+ NativeType = "vector_float3",
+ NativeWrapperType = "struct Vector4f", // Yes, Vector4f, since NVector3 has 4 floats.
+ RequireMarshal = true,
+ };
public static TypeData Vector4 = new TypeData {
ManagedType = "Vector4",
NativeType = "vector_float4",
@@ -2479,6 +3013,12 @@ public static class Types {
NativeWrapperType = "struct Vector3d",
RequireMarshal = true,
};
+ public static TypeData VectorDouble3 = new TypeData {
+ ManagedType = "VectorDouble3",
+ NativeType = "vector_double3",
+ NativeWrapperType = "struct Vector3d",
+ RequireMarshal = true,
+ };
public static TypeData Vector4d = new TypeData {
ManagedType = "Vector4d",
NativeType = "vector_double4",
@@ -2494,6 +3034,15 @@ public static class Types {
IsX86Stret = true,
IsX64Stret = false,
};
+ public static TypeData NMatrix2 = new TypeData {
+ ManagedType = "NMatrix2",
+ NativeType = "matrix_float2x2",
+ NativeWrapperType = "struct NMatrix2",
+ RequireMarshal = true,
+ IsARMStret = true,
+ IsX86Stret = true,
+ IsX64Stret = false,
+ };
public static TypeData Matrix3f = new TypeData {
ManagedType = "Matrix3",
NativeType = "matrix_float3x3",
@@ -2503,6 +3052,15 @@ public static class Types {
IsX86Stret = true,
IsX64Stret = true,
};
+ public static TypeData NMatrix3 = new TypeData {
+ ManagedType = "NMatrix3",
+ NativeType = "matrix_float3x3",
+ NativeWrapperType = "struct NMatrix3",
+ RequireMarshal = true,
+ IsARMStret = true,
+ IsX86Stret = true,
+ IsX64Stret = true,
+ };
public static TypeData Matrix4f = new TypeData {
ManagedType = "Matrix4",
NativeType = "matrix_float4x4",
@@ -2512,6 +3070,35 @@ public static class Types {
IsX86Stret = true,
IsX64Stret = true,
};
+ public static TypeData NMatrix4 = new TypeData {
+ ManagedType = "NMatrix4",
+ NativeType = "matrix_float4x4",
+ NativeWrapperType = "struct NMatrix4",
+ RequireMarshal = true,
+ IsARMStret = true,
+ IsX86Stret = true,
+ IsX64Stret = true,
+ };
+
+ public static TypeData NMatrix4d = new TypeData {
+ ManagedType = "NMatrix4d",
+ NativeType = "matrix_double4x4",
+ NativeWrapperType = "struct NMatrix4d",
+ RequireMarshal = true,
+ IsARMStret = true,
+ IsX86Stret = true,
+ IsX64Stret = true,
+ };
+
+ public static TypeData NMatrix4x3 = new TypeData {
+ ManagedType = "NMatrix4x3",
+ NativeType = "matrix_float4x3",
+ NativeWrapperType = "struct NMatrix4x3",
+ RequireMarshal = true,
+ IsARMStret = true,
+ IsX86Stret = true,
+ IsX64Stret = true,
+ };
public static TypeData Double = new TypeData {
ManagedType = "Double",
NativeType = "double",
@@ -2618,6 +3205,47 @@ public static class Types {
IsX86Stret = true,
IsX64Stret = true,
};
+
+ public static TypeData CGSize = new TypeData {
+ ManagedType = "CGSize",
+ NativeType = "CGSize",
+ NativeWrapperType = "CGSize",
+ RequireMarshal = false,
+ };
+
+ public static TypeData CGPoint = new TypeData {
+ ManagedType = "CGPoint",
+ NativeType = "CGPoint",
+ NativeWrapperType = "CGPoint",
+ RequireMarshal = false,
+ };
+
+ public static TypeData QuatF = new TypeData {
+ ManagedType = "Quaternion",
+ NativeType = "simd_quatf",
+ NativeWrapperType = "struct QuatF",
+ RequireMarshal = true,
+ };
+
+ public static TypeData MPSImageHistogramInfo = new TypeData {
+ ManagedType = "MPSImageHistogramInfo",
+ NativeType = "MPSImageHistogramInfo",
+ NativeWrapperType = "struct MPSImageHistogramInfoWrapper",
+ RequireMarshal = true,
+ IsARMStret = true,
+ IsX86Stret = true,
+ IsX64Stret = true,
+ };
+
+ public static TypeData MDLVoxelIndexExtent2 = new TypeData {
+ ManagedType = "MDLVoxelIndexExtent2",
+ NativeType = "MDLVoxelIndexExtent",
+ NativeWrapperType = "struct MDLVoxelIndexExtentWrapper",
+ RequireMarshal = true,
+ IsARMStret = true,
+ IsX86Stret = true,
+ IsX64Stret = true,
+ };
}
}
diff --git a/runtime/bindings-generator.csproj b/runtime/bindings-generator.csproj
index 700f3a30966d..2400ef66e078 100644
--- a/runtime/bindings-generator.csproj
+++ b/runtime/bindings-generator.csproj
@@ -6,7 +6,7 @@
{6B616492-49F0-43EF-8390-F9D1B4CCC632}
Exe
zzg
- zzg
+ bindings-generator
v4.5
8.0.30703
2.0
@@ -21,7 +21,6 @@
4
x86
false
- /work/maccore/xcode7/maccore/bindings-generated.m
full
@@ -32,6 +31,10 @@
true
x86
+
+ Project
+ ${ProjectDir}/bindings-generated.m
+
diff --git a/runtime/bindings.h b/runtime/bindings.h
index fd91e261a072..e98d8d3e0544 100644
--- a/runtime/bindings.h
+++ b/runtime/bindings.h
@@ -2,6 +2,7 @@
#define __BINDINGS_H__
#import
+#import
#include
#include
#include
@@ -82,6 +83,11 @@ typedef __attribute__((__ext_vector_type__(4))) float vector_float4;
typedef struct { vector_float2 columns[2]; } matrix_float2x2;
typedef struct { vector_float3 columns[3]; } matrix_float3x3;
typedef struct { vector_float4 columns[4]; } matrix_float4x4;
+typedef struct { vector_float3 columns[4]; } matrix_float4x3;
+
+typedef struct { vector_double4 columns[4]; } matrix_double4x4;
+
+typedef struct { vector_float4 vector; } simd_quatf;
typedef struct {
vector_float3 maxBounds;
@@ -102,6 +108,20 @@ typedef struct {
vector_float3 points[3];
} GKTriangle;
+typedef struct
+{
+ NSUInteger numberOfHistogramEntries;
+ BOOL histogramForAlpha;
+ vector_float4 minPixelValue;
+ vector_float4 maxPixelValue;
+} MPSImageHistogramInfo;
+
+typedef vector_int4 MDLVoxelIndex;
+typedef struct {
+ MDLVoxelIndex minimumExtent;
+ MDLVoxelIndex maximumExtent;
+} MDLVoxelIndexExtent;
+
/*
* iOS has a vector type (vector_float3) which can't be expressed
* in P/Invoke signatures, so we need custom wrappers.
@@ -141,14 +161,39 @@ struct Matrix2f {
Vector2f columns [2];
};
+struct NMatrix2 {
+ Vector2f columns [2];
+};
+
struct Matrix3f {
Vector3f columns [3];
};
+struct NMatrix3 {
+ Vector4f columns [3];
+};
+
struct Matrix4f {
Vector4f columns [4];
};
+struct NMatrix4 {
+ Vector4f columns [4];
+};
+
+struct NMatrix4d {
+ Vector4d columns [4];
+};
+
+struct NMatrix4x3 {
+ // Use Vector4f here, since the managed version has padding to match accordingly.
+ Vector4f columns [4];
+};
+
+struct QuatF {
+ Vector4f vector;
+};
+
struct MDLAxisAlignedBoundingBoxWrapper {
Vector3f maxBounds;
Vector3f minBounds;
@@ -168,6 +213,32 @@ struct GKTriangleWrapper {
Vector3f points [3];
};
+struct MPSImageHistogramInfoWrapper {
+ NSUInteger numberOfHistogramEntries;
+ BOOL histogramForAlpha;
+ // The minPixelValue field starts at offset 16, but we can't use
+ // __attribute__ ((aligned (16))), because that will make clang align the
+ // entire struct on a 16-byte boundary, which doesn't match how we've
+ // defined it in managed code (explicit layout, but no specific alignment).
+ // So we need to manually pad the struct to match the managed definition.
+#if defined (__x86_64__) || defined (__arm64__)
+ uint8_t dummy[7];
+#else
+ uint8_t dummy[11];
+#endif
+ Vector4f minPixelValue;
+ Vector4f maxPixelValue;
+};
+
+typedef Vector4i MDLVoxelIndexWrapper;
+
+struct MDLVoxelIndexExtentWrapper {
+ MDLVoxelIndexWrapper minimumExtent;
+ MDLVoxelIndexWrapper maximumExtent;
+};
+
+static_assert (sizeof (MPSImageHistogramInfoWrapper) == sizeof (MPSImageHistogramInfo), "Sizes aren't equal");
+
struct Vector4f xamarin_vector_float3__Vector4_objc_msgSend (id self, SEL sel);
void xamarin_vector_float3__Vector4_objc_msgSend_stret (struct Vector4f *v4, id self, SEL sel);
void xamarin_vector_float3__void_objc_msgSend_Vector4 (id self, SEL sel, struct Vector4f p0);
@@ -185,6 +256,8 @@ void xamarin_vector_float3__Vector3_objc_msgSendSuper_stret (struct
void xamarin_vector_float3__void_objc_msgSendSuper_Vector3 (struct objc_super *super, SEL sel, struct Vector3f p0);
void xamarin_vector_float3__Vector3_objc_msgSendSuper_stret_Vector3 (struct Vector3f *v3, struct objc_super *super, SEL sel, struct Vector3f p0);
struct Vector3f xamarin_vector_float3__Vector3_objc_msgSendSuper_Vector3 (struct objc_super *super, SEL sel, struct Vector3f p0);
+CGPoint xamarin_CGPoint__VNNormalizedFaceBoundingBoxPointForLandmarkPoint_Vector2_CGRect_nuint_nuint_string (struct Vector2f faceLandmarkPoint, CGRect faceBoundingBox, xm_nuint_t imageWidth, xm_nuint_t imageHeight, const char **error_msg);
+CGPoint xamarin_CGPoint__VNImagePointForFaceLandmarkPoint_Vector2_CGRect_nuint_nuint_string (struct Vector2f faceLandmarkPoint, CGRect faceBoundingBox, xm_nuint_t imageWidth, xm_nuint_t imageHeight, const char **error_msg);
#ifndef XAMCORE_2_0
#ifdef MONOMAC
diff --git a/runtime/bindings.m b/runtime/bindings.m
index 3be38bf87c28..0ffdf803e451 100644
--- a/runtime/bindings.m
+++ b/runtime/bindings.m
@@ -11,6 +11,7 @@
*/
#include "bindings.h"
+#include
/*
* Hand-written bindings to support ObjectiveC exceptions.
@@ -88,3 +89,67 @@
#endif
#endif
+/*
+ * Vector c bindings
+ *
+ * The following code uses dlsym to not have a linking dependency on Xcode 9,
+ * the code can be simplified once we require to remove dlsym or xcode 9 becomes the minimum supported version
+ */
+
+typedef CGPoint (*vision_func) (vector_float2 faceLandmarkPoint, CGRect faceBoundingBox, size_t imageWidth, size_t imageHeight);
+
+CGPoint
+xamarin_CGPoint__VNNormalizedFaceBoundingBoxPointForLandmarkPoint_Vector2_CGRect_nuint_nuint_string (struct Vector2f faceLandmarkPoint, CGRect faceBoundingBox, xm_nuint_t imageWidth, xm_nuint_t imageHeight, const char **error_msg) {
+
+ static vision_func func = NULL;
+ *error_msg = NULL;
+
+ if (func == NULL) {
+ void *vision_handle = dlopen ("/System/Library/Frameworks/Vision.framework/Vision", RTLD_LAZY);
+ if (vision_handle == NULL) {
+ *error_msg = "Could not open Vision Framework";
+ return CGPointMake (0, 0);
+ }
+
+ func = (vision_func) dlsym (vision_handle, "VNNormalizedFaceBoundingBoxPointForLandmarkPoint");
+
+ if (func == NULL) {
+ *error_msg = "Could not obtain the address for VNNormalizedFaceBoundingBoxPointForLandmarkPoint";
+ return CGPointMake (0, 0);
+ }
+ }
+
+ vector_float2 flp;
+ flp [0] = faceLandmarkPoint.a;
+ flp [1] = faceLandmarkPoint.b;
+
+ return func (flp, faceBoundingBox, imageWidth, imageHeight);
+}
+
+CGPoint
+xamarin_CGPoint__VNImagePointForFaceLandmarkPoint_Vector2_CGRect_nuint_nuint_string (struct Vector2f faceLandmarkPoint, CGRect faceBoundingBox, xm_nuint_t imageWidth, xm_nuint_t imageHeight, const char **error_msg) {
+
+ static vision_func func = NULL;
+ *error_msg = NULL;
+
+ if (func == NULL) {
+ void *vision_handle = dlopen ("/System/Library/Frameworks/Vision.framework/Vision", RTLD_LAZY);
+ if (vision_handle == NULL) {
+ *error_msg = "Could not open Vision Framework";
+ return CGPointMake (0, 0);
+ }
+
+ func = (vision_func) dlsym (vision_handle, "VNImagePointForFaceLandmarkPoint");
+
+ if (func == NULL) {
+ *error_msg = "Could not obtain the address for VNImagePointForFaceLandmarkPoint";
+ return CGPointMake (0, 0);
+ }
+ }
+
+ vector_float2 flp;
+ flp [0] = faceLandmarkPoint.a;
+ flp [1] = faceLandmarkPoint.b;
+
+ return func (flp, faceBoundingBox, imageWidth, imageHeight);
+}
diff --git a/runtime/delegates.t4 b/runtime/delegates.t4
index 8f311a3d0b40..f56fb3114174 100644
--- a/runtime/delegates.t4
+++ b/runtime/delegates.t4
@@ -71,7 +71,8 @@
new XDelegate ("MethodDescription", "UnmanagedMethodDescription", "xamarin_get_method_for_selector",
"Class", "IntPtr", "cls",
- "SEL", "IntPtr", "sel"
+ "SEL", "IntPtr", "sel",
+ "bool", "bool", "is_static"
) { WrappedManagedFunction = "GetMethodForSelector" },
new XDelegate ("MonoObject *", "IntPtr", "xamarin_get_nsobject",
@@ -140,6 +141,7 @@
new XDelegate ("MethodDescription", "UnmanagedMethodDescription", "xamarin_get_method_and_object_for_selector",
"Class", "IntPtr", "cls",
"SEL", "IntPtr", "sel",
+ "bool", "bool", "is_static",
"id", "IntPtr", "obj",
"MonoObject **", "ref IntPtr", "mthis"
) { WrappedManagedFunction = "GetMethodAndObjectForSelector" },
diff --git a/runtime/runtime.m b/runtime/runtime.m
index 8b25e4c99138..f820eb6df0b3 100644
--- a/runtime/runtime.m
+++ b/runtime/runtime.m
@@ -1119,7 +1119,7 @@ -(void) xamarinSetGCHandle: (int) gc_handle;
Dl_info info;
if (dladdr ((void *) xamarin_initialize_embedded, &info) != 0) {
- char *last_sep = strrchr (info.dli_fname, '/');
+ const char *last_sep = strrchr (info.dli_fname, '/');
if (last_sep == NULL) {
libname = strdup (info.dli_fname);
} else {
diff --git a/runtime/trampolines-invoke.m b/runtime/trampolines-invoke.m
index 5c52a83ccc28..28aa4db00fd6 100644
--- a/runtime/trampolines-invoke.m
+++ b/runtime/trampolines-invoke.m
@@ -88,9 +88,9 @@
int mofs = 0;
if (is_ctor || is_static) {
- desc = xamarin_get_method_for_selector ([self class], sel, &exception_gchandle);
+ desc = xamarin_get_method_for_selector ([self class], sel, is_static, &exception_gchandle);
} else {
- desc = xamarin_get_method_and_object_for_selector ([self class], sel, self, &mthis, &exception_gchandle);
+ desc = xamarin_get_method_and_object_for_selector ([self class], sel, is_static, self, &mthis, &exception_gchandle);
}
if (exception_gchandle != 0)
goto exception_handling;
diff --git a/runtime/xamarin/runtime.h b/runtime/xamarin/runtime.h
index e79af184a479..32affb4bee21 100644
--- a/runtime/xamarin/runtime.h
+++ b/runtime/xamarin/runtime.h
@@ -225,7 +225,7 @@ MonoObject* xamarin_get_class (Class ptr, guint32 *exception_gchandle)
MonoObject* xamarin_get_selector (SEL ptr, guint32 *exception_gchandle);
Class xamarin_get_class_handle (MonoObject *obj, guint32 *exception_gchandle);
SEL xamarin_get_selector_handle (MonoObject *obj, guint32 *exception_gchandle);
-MethodDescription xamarin_get_method_for_selector (Class cls, SEL sel, guint32 *exception_gchandle);
+MethodDescription xamarin_get_method_for_selector (Class cls, SEL sel, bool is_static, guint32 *exception_gchandle);
bool xamarin_has_nsobject (id obj, guint32 *exception_gchandle);
MonoObject* xamarin_get_nsobject (id obj, guint32 *exception_gchandle);
id xamarin_get_handle_for_inativeobject (MonoObject *obj, guint32 *exception_gchandle);
@@ -239,7 +239,7 @@ MonoObject* xamarin_get_nsobject_with_type (id obj, void *type, int32_t *
void xamarin_dispose (MonoObject *mobj, guint32 *exception_gchandle);
bool xamarin_is_parameter_transient (MonoReflectionMethod *method, int parameter /* 0-based */, guint32 *exception_gchandle);
bool xamarin_is_parameter_out (MonoReflectionMethod *method, int parameter /* 0-based */, guint32 *exception_gchandle);
-MethodDescription xamarin_get_method_and_object_for_selector (Class cls, SEL sel, id self, MonoObject **mthis, guint32 *exception_gchandle);
+MethodDescription xamarin_get_method_and_object_for_selector (Class cls, SEL sel, bool is_static, id self, MonoObject **mthis, guint32 *exception_gchandle);
guint32 xamarin_create_product_exception_for_error (int code, const char *message, guint32 *exception_gchandle);
#ifdef __cplusplus
diff --git a/src/.gitignore b/src/.gitignore
index 670a8c1c0e24..c59267add1fb 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -11,3 +11,5 @@ xammac.csproj
xamtvos.csproj
xamwatch.csproj
generator-ikvm.csproj
+~.pmcs-*
+*~
diff --git a/src/ARKit/ARPointCloud.cs b/src/ARKit/ARPointCloud.cs
new file mode 100644
index 000000000000..3684d1d92f4a
--- /dev/null
+++ b/src/ARKit/ARPointCloud.cs
@@ -0,0 +1,43 @@
+//
+// ARPointCloud.cs: Nicer code for ARPointCloud
+//
+// Authors:
+// Vincent Dondain
+//
+// Copyright 2017 Microsoft Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0
+
+using System;
+using System.Runtime.InteropServices;
+using Vector3 = global::OpenTK.NVector3;
+
+namespace XamCore.ARKit {
+ public partial class ARPointCloud {
+
+ public unsafe Vector3 [] Points {
+ get {
+ var count = (int)Count;
+ var rv = new Vector3 [count];
+ var ptr = (Vector3 *) GetRawPoints ();
+ for (int i = 0; i < count; i++)
+ rv [i] = *ptr++;
+ return rv;
+ }
+ }
+
+ public unsafe ulong [] Identifiers {
+ get {
+ var count = (int)Count;
+ var rv = new ulong [count];
+ var ptr = (ulong*)GetRawIdentifiers ();
+ for (int i = 0; i < count; i++)
+ rv [i] = *ptr++;
+ return rv;
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/src/AVFoundation/AVAssetDownloadUrlSession.cs b/src/AVFoundation/AVAssetDownloadUrlSession.cs
index 0d9ba9cddf82..1462c3f83056 100644
--- a/src/AVFoundation/AVAssetDownloadUrlSession.cs
+++ b/src/AVFoundation/AVAssetDownloadUrlSession.cs
@@ -27,7 +27,7 @@ public partial class AVAssetDownloadUrlSession : NSUrlSession {
}
#if !XAMCORE_4_0
- [Obsolete ("Use the overload with a `INSUrlSessionDelegate` parameter.")]
+ [Obsolete ("Use the overload with a 'INSUrlSessionDelegate' parameter.")]
public new static NSUrlSession FromConfiguration (NSUrlSessionConfiguration configuration, NSUrlSessionDelegate sessionDelegate, NSOperationQueue delegateQueue)
{
throw new NotSupportedException ("NS_UNAVAILABLE");
diff --git a/src/AVFoundation/AVCompat.cs b/src/AVFoundation/AVCompat.cs
index 1996dfad95db..74031ae39839 100644
--- a/src/AVFoundation/AVCompat.cs
+++ b/src/AVFoundation/AVCompat.cs
@@ -14,7 +14,7 @@ namespace XamCore.AVFoundation {
#if !XAMCORE_2_0
partial class AVAssetResourceLoadingDataRequest {
- [Obsolete ("Type is not meant to be created by user code")]
+ [Obsolete ("Type is not meant to be created by user code.")]
public AVAssetResourceLoadingDataRequest ()
{
}
@@ -24,7 +24,7 @@ public AVAssetResourceLoadingDataRequest ()
#if !XAMCORE_3_0
partial class AVAsset {
- [Obsolete ("Use GetChapterMetadataGroups")]
+ [Obsolete ("Use 'GetChapterMetadataGroups'.")]
public virtual AVMetadataItem[] ChapterMetadataGroups (NSLocale forLocale, AVMetadataItem[] commonKeys)
{
return null;
@@ -33,7 +33,7 @@ public virtual AVMetadataItem[] ChapterMetadataGroups (NSLocale forLocale, AVMet
partial class AVAssetTrack {
- [Obsolete ("Use GetAssociatedTracks")]
+ [Obsolete ("Use 'GetAssociatedTracks'.")]
public virtual NSString GetAssociatedTracksOfType (NSString avAssetTrackTrackAssociationType)
{
return null;
@@ -42,7 +42,7 @@ public virtual NSString GetAssociatedTracksOfType (NSString avAssetTrackTrackAss
partial class AVMutableCompositionTrack {
- [Obsolete ("Use InsertTimeRanges overload accepting an NSValue array")]
+ [Obsolete ("Use 'InsertTimeRanges' overload accepting an 'NSValue' array.")]
public virtual bool InsertTimeRanges (NSValue cmTimeRanges, AVAssetTrack[] tracks, CMTime startTime, out NSError error)
{
return InsertTimeRanges (new NSValue [] { cmTimeRanges }, tracks, startTime, out error);
@@ -52,7 +52,7 @@ public virtual bool InsertTimeRanges (NSValue cmTimeRanges, AVAssetTrack[] track
partial class AVCaptureAudioDataOutputSampleBufferDelegate {
- [Obsolete ("This member only exists for AVCaptureVideoDataOutputSampleBufferDelegate")]
+ [Obsolete ("This member only exists for 'AVCaptureVideoDataOutputSampleBufferDelegate'.")]
public virtual void DidDropSampleBuffer (AVCaptureOutput captureOutput, CMSampleBuffer sampleBuffer, AVCaptureConnection connection)
{
}
@@ -60,7 +60,7 @@ public virtual void DidDropSampleBuffer (AVCaptureOutput captureOutput, CMSample
static partial class AVCaptureAudioDataOutputSampleBufferDelegate_Extensions {
- [Obsolete ("This member only exists for AVCaptureVideoDataOutputSampleBufferDelegate")]
+ [Obsolete ("This member only exists for 'AVCaptureVideoDataOutputSampleBufferDelegate'.")]
public static void DidDropSampleBuffer (IAVCaptureAudioDataOutputSampleBufferDelegate This, AVCaptureOutput captureOutput, CMSampleBuffer sampleBuffer, AVCaptureConnection connection)
{
}
@@ -68,9 +68,17 @@ public static void DidDropSampleBuffer (IAVCaptureAudioDataOutputSampleBufferDel
#endif
#if !XAMCORE_4_0
+ partial class AVCaptureInputPort {
+
+ [Obsolete ("Valid instance of this type cannot be directly created.")]
+ public AVCaptureInputPort ()
+ {
+ }
+ }
+
partial class AVAudioChannelLayout {
- [Obsolete ("Valid instance of this type cannot be directly created")]
+ [Obsolete ("Valid instance of this type cannot be directly created.")]
public AVAudioChannelLayout ()
{
}
@@ -78,7 +86,7 @@ public AVAudioChannelLayout ()
partial class AVAudioConnectionPoint {
- [Obsolete ("Valid instance of this type cannot be directly created")]
+ [Obsolete ("Valid instance of this type cannot be directly created.")]
public AVAudioConnectionPoint ()
{
}
@@ -86,8 +94,8 @@ public AVAudioConnectionPoint ()
#if TVOS
// tvOS removed some types - we need to keep stubs of them for binary compatibility
- [Obsolete ("Removed in tvOS 10")]
- [Deprecated (PlatformName.TvOS, 10, 0, PlatformArchitecture.None, "Removed in tvOS 10")]
+ [Obsolete ("Removed in tvOS 10.")]
+ [Deprecated (PlatformName.TvOS, 10, 0, PlatformArchitecture.None)]
public class AVAssetDownloadDelegate : NSObject, IAVAssetDownloadDelegate {
public AVAssetDownloadDelegate ()
{
@@ -152,13 +160,13 @@ public virtual void WillPerformHttpRedirection (NSUrlSession session, NSUrlSessi
}
}
- [Obsolete ("Removed in tvOS 10")]
- [Deprecated (PlatformName.TvOS, 10, 0, PlatformArchitecture.None, "Removed in tvOS 10")]
+ [Obsolete ("Removed in tvOS 10.")]
+ [Deprecated (PlatformName.TvOS, 10, 0, PlatformArchitecture.None)]
public interface IAVAssetDownloadDelegate : INativeObject, IDisposable, INSUrlSessionTaskDelegate, INSUrlSessionDelegate {
}
- [Obsolete ("Removed in tvOS 10")]
- [Deprecated (PlatformName.TvOS, 10, 0, PlatformArchitecture.None, "Removed in tvOS 10")]
+ [Obsolete ("Removed in tvOS 10.")]
+ [Deprecated (PlatformName.TvOS, 10, 0, PlatformArchitecture.None)]
public static class AVAssetDownloadDelegate_Extensions {
public static void DidFinishDownloadingToUrl (this IAVAssetDownloadDelegate This, NSUrlSession session, AVAssetDownloadTask assetDownloadTask, NSUrl location)
@@ -177,8 +185,8 @@ public static void DidResolveMediaSelection (this IAVAssetDownloadDelegate This,
}
}
- [Obsolete ("Removed in tvOS 10")]
- [Deprecated (PlatformName.TvOS, 10, 0, PlatformArchitecture.None, "Removed in tvOS 10")]
+ [Obsolete ("Removed in tvOS 10.")]
+ [Deprecated (PlatformName.TvOS, 10, 0, PlatformArchitecture.None)]
public class AVAssetDownloadTask : NSUrlSessionTask {
public override IntPtr ClassHandle {
@@ -242,8 +250,8 @@ protected internal AVAssetDownloadTask (IntPtr handle)
}
}
- [Obsolete ("Removed in tvOS 10")]
- [Deprecated (PlatformName.TvOS, 10, 0, PlatformArchitecture.None, "Removed in tvOS 10")]
+ [Obsolete ("Removed in tvOS 10.")]
+ [Deprecated (PlatformName.TvOS, 10, 0, PlatformArchitecture.None)]
public class AVAssetDownloadUrlSession : NSUrlSession {
public new static NSUrlSession SharedSession {
@@ -280,7 +288,7 @@ public static AVAssetDownloadUrlSession CreateSession (NSUrlSessionConfiguration
throw new NotImplementedException ();
}
- [Obsolete ("Use the overload with a `INSUrlSessionDelegate` parameter.")]
+ [Obsolete ("Use the overload with a 'INSUrlSessionDelegate' parameter.")]
public new static NSUrlSession FromConfiguration (NSUrlSessionConfiguration configuration, NSUrlSessionDelegate sessionDelegate, NSOperationQueue delegateQueue)
{
throw new NotImplementedException ();
@@ -387,104 +395,6 @@ public AVAssetDownloadTask GetAssetDownloadTask (AVUrlAsset urlAsset, string tit
}
}
- [Obsolete ("Removed in tvOS 10")]
- [Deprecated (PlatformName.TvOS, 10, 0, PlatformArchitecture.None, "Removed in tvOS 10")]
- public class AVAudioInputNode : AVAudioIONode, IAVAudio3DMixing, IAVAudioMixing, IAVAudioStereoMixing {
-
- public override IntPtr ClassHandle {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public virtual float Obstruction {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- public virtual float Occlusion {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- public virtual float Pan {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- public virtual Vector3 Position {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- public virtual float Rate {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- public virtual AVAudio3DMixingRenderingAlgorithm RenderingAlgorithm {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- public virtual float ReverbBlend {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- public virtual float Volume {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- protected AVAudioInputNode (NSObjectFlag t) : base (t)
- {
- throw new NotImplementedException ();
- }
-
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- protected internal AVAudioInputNode (IntPtr handle) : base (handle)
- {
- }
-
- public virtual AVAudioMixingDestination DestinationForMixer (AVAudioNode mixer, nuint bus)
- {
- throw new NotImplementedException ();
- }
- }
#endif // TVOS
#endif // !XAMCORE_4_0
}
diff --git a/src/AVFoundation/AVDepthData.cs b/src/AVFoundation/AVDepthData.cs
new file mode 100644
index 000000000000..3bc17e77707d
--- /dev/null
+++ b/src/AVFoundation/AVDepthData.cs
@@ -0,0 +1,41 @@
+//
+// AVDepthData.cs
+//
+// Authors:
+// Alex Soto (alexsoto@microsoft.com)
+//
+// Copyright 2017 Xamarin Inc.
+//
+
+#if !WATCH
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+using XamCore.CoreVideo;
+using XamCore.ImageIO;
+
+namespace XamCore.AVFoundation {
+ public partial class AVDepthData {
+
+ public static AVDepthData Create (CGImageAuxiliaryDataInfo dataInfo, out NSError error)
+ {
+ return Create (dataInfo.Dictionary, out error);
+ }
+
+ public CVPixelFormatType [] AvailableDepthDataTypes {
+ get {
+ var values = WeakAvailableDepthDataTypes;
+ if (values == null)
+ return null;
+
+ var count = values.Length;
+ var arr = new CVPixelFormatType [count];
+ for (int i = 0; i < count; i++)
+ arr [i] = (CVPixelFormatType) values [i].UInt32Value; // CVPixelFormatType is uint.
+
+ return arr;
+ }
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/src/AVFoundation/AVOutputSettingsAssistant.cs b/src/AVFoundation/AVOutputSettingsAssistant.cs
index be7d66f90f47..dd25aeb5825b 100644
--- a/src/AVFoundation/AVOutputSettingsAssistant.cs
+++ b/src/AVFoundation/AVOutputSettingsAssistant.cs
@@ -43,6 +43,19 @@ public AVOutputSettingsAssistant Preset3840x2160 {
return FromPreset (_Preset3840x2160);
}
}
+
+ public AVOutputSettingsAssistant PresetHevc1920x1080 {
+ get {
+ return FromPreset (_PresetHevc1920x1080);
+ }
+ }
+
+ public AVOutputSettingsAssistant PresetHevc3840x2160 {
+ get {
+ return FromPreset (_PresetHevc3840x2160);
+ }
+ }
+
}
}
diff --git a/src/AVFoundation/AVPlayerLooper.cs b/src/AVFoundation/AVPlayerLooper.cs
new file mode 100644
index 000000000000..2be117f53c3e
--- /dev/null
+++ b/src/AVFoundation/AVPlayerLooper.cs
@@ -0,0 +1,46 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if !WATCH
+
+using XamCore.Foundation;
+using XamCore.CoreFoundation;
+using XamCore.AudioToolbox;
+using XamCore.ObjCRuntime;
+using System;
+
+namespace XamCore.AVFoundation {
+
+ public partial class AVPlayerLooper {
+
+#if !XAMCORE_4_0 // This API got introduced in Xcode 8.0 binding but is not currently present nor in Xcode 8.3 or Xcode 9.0 needs research
+
+ bool loopingEnabled = true;
+
+ [Obsolete ("This selector does not exist in the header and was wrongly added.")]
+ public virtual bool LoopingEnabled {
+ get {
+ return loopingEnabled;
+ }
+ }
+#endif
+ }
+}
+#endif // !WATCH
diff --git a/src/AVFoundation/Enums.cs b/src/AVFoundation/Enums.cs
index b9cd4a88da41..0f1900cde407 100644
--- a/src/AVFoundation/Enums.cs
+++ b/src/AVFoundation/Enums.cs
@@ -803,7 +803,11 @@ public enum AVContentKeyRequestRetryReason {
[TV (10, 2), Mac (10, 12, 4), iOS (10, 3), NoWatch]
public enum AVContentKeySystem {
[Field ("AVContentKeySystemFairPlayStreaming")]
- FairPlayStreaming,
+ FairPlayStreaming = 0,
+
+ [TV (11, 0), NoWatch, Mac (10, 13), iOS (11, 0)]
+ [Field ("AVContentKeySystemClearKey")]
+ AVContentKeySystemClearKey = 1,
}
// Convience enum for native string values
@@ -836,5 +840,141 @@ public enum AVAssetExportSessionPreset {
AppleM4A = 8, // AVAssetExportPresetAppleM4A
[Field ("AVAssetExportPresetPassthrough")]
Passthrough = 9, // AVAssetExportPresetPassthrough
+
+ [iOS (11, 0), Mac (10, 13)]
+ [Field ("AVOutputSettingsPresetHEVC1920x1080")]
+ PresetHevc1920x1080 = 11,
+
+ [iOS (11, 0), Mac (10, 13)]
+ [Field ("AVOutputSettingsPresetHEVC3840x2160")]
+ PresetHevc3840x2160 = 12,
+ }
+
+ [TV (11,0), NoWatch, iOS (11,0)]
+ [Native]
+ public enum AVDepthDataAccuracy : nint {
+ Relative = 0,
+ Absolute = 1,
+ }
+
+ [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
+ [Native]
+ public enum AVAudioEngineManualRenderingMode : nint {
+ Offline = 0,
+ Realtime = 1
+ }
+
+ [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
+ [Native]
+ public enum AVAudioEngineManualRenderingStatus : nint {
+ Error = -1,
+ Success = 0,
+ InsufficientDataFromInputNode = 1,
+ CannotDoInCurrentContext = 2
+ }
+
+ [TV (11,0), NoWatch, Mac (10,13), iOS (11,0)]
+ [Native]
+ public enum AVAudioSessionRouteSharingPolicy : nuint {
+ Default = 0,
+ LongForm = 1,
+ Independent = 2
+ }
+
+ [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
+ [Native]
+ public enum AVAudioPlayerNodeCompletionCallbackType : nint {
+ Consumed = 0,
+ Rendered = 1,
+ PlayedBack = 2
+ }
+
+ [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
+ public enum AVAudioEngineManualRenderingError
+ {
+ InvalidMode = -80800,
+ Initialized = -80801,
+ NotRunning = -80802,
+ }
+
+ [NoTV, iOS (11,0)]
+ [NoWatch]
+ [Native]
+ public enum AVCaptureLensStabilizationStatus : nint
+ {
+ Unsupported = 0,
+ Off = 1,
+ Active = 2,
+ OutOfRange = 3,
+ Unavailable = 4
+ }
+
+ [NoWatch, NoTV, iOS (11,0)]
+ [Native]
+ public enum AVCaptureOutputDataDroppedReason : nint
+ {
+ None = 0,
+ LateData = 1,
+ OutOfBuffers = 2,
+ Discontinuity = 3,
+ }
+
+ [TV (11, 0), NoWatch, Mac (10, 13), iOS (11, 0)]
+ public enum AVVideoApertureMode {
+ [Field ("AVVideoApertureModeCleanAperture")]
+ CleanAperture = 0,
+
+ [Field ("AVVideoApertureModeProductionAperture")]
+ ProductionAperture = 1,
+
+ [Field ("AVVideoApertureModeEncodedPixels")]
+ EncodedPixels = 2,
+ }
+
+ /*
+ // Enum values are present in header but missing rdar filed at: https://bugreport.apple.com/web/?problemID=34184435
+ [NoWatch, NoTV, NoMac, iOS (11, 0)]
+ public enum AVAssetDownloadedAssetEvictionPriority {
+ [Field ("AVAssetDownloadedAssetEvictionPriorityDefault")]
+ Default = 0,
+
+ [Field ("AVAssetDownloadedAssetEvictionPriorityImportant")]
+ Important = 1,
+ }
+ */
+
+ [NoWatch, iOS (11, 0), TV (11,0), Mac (10,13)]
+ public enum AVAssetWriterInputMediaDataLocation {
+ [Field ("AVAssetWriterInputMediaDataLocationInterleavedWithMainMediaData")]
+ InterleavedWithMainMediaData = 0,
+
+ [Field ("AVAssetWriterInputMediaDataLocationBeforeMainMediaDataNotInterleaved")]
+ BeforeMainMediaDataNotInterleaved = 1,
+ }
+
+ [TV (11, 0), NoWatch, Mac (10, 13), iOS (11, 0)]
+ public enum AVVideoCodecType {
+ [Field ("AVVideoCodecTypeH264")]
+ H264 = 0,
+
+ [Field ("AVVideoCodecTypeJPEG")]
+ Jpeg = 1,
+
+ [Field ("AVVideoCodecTypeAppleProRes422")]
+ AppleProRes422 = 3,
+
+ [Field ("AVVideoCodecTypeAppleProRes4444")]
+ AppleProRes4444 = 4,
+
+ [Field ("AVVideoCodecTypeHEVC")]
+ Hevc = 5,
+
+ }
+
+ [TV (11,0), NoWatch, iOS (11,0)]
+ [Native]
+ public enum AVDepthDataQuality : nint {
+ Low = 0,
+ High = 1
}
}
diff --git a/src/Accounts/Enums.cs b/src/Accounts/Enums.cs
index 46ccf9e20995..3e7d95b91c55 100644
--- a/src/Accounts/Enums.cs
+++ b/src/Accounts/Enums.cs
@@ -29,7 +29,7 @@ public enum ACErrorCode {
#if XAMCORE_3_0
MissingTransportMessageId,
#else
- [Obsolete ("Use MissingTransportMessageId")]
+ [Obsolete ("Use 'MissingTransportMessageId'.")]
MissingMessageID,
#pragma warning disable 618 // MissingMessageID is obsolete
MissingTransportMessageId = MissingMessageID,
diff --git a/src/AddressBook/ABAddressBook.cs b/src/AddressBook/ABAddressBook.cs
index c1bbcf69e449..f71fff844dfc 100644
--- a/src/AddressBook/ABAddressBook.cs
+++ b/src/AddressBook/ABAddressBook.cs
@@ -39,7 +39,7 @@
using XamCore.ObjCRuntime;
namespace XamCore.AddressBook {
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class ExternalChangeEventArgs : EventArgs {
public ExternalChangeEventArgs (ABAddressBook addressBook, NSDictionary info)
{
@@ -91,7 +91,7 @@ static InitConstants ()
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class ABAddressBook : INativeObject, IDisposable, IEnumerable {
public static readonly NSString ErrorDomain;
diff --git a/src/AddressBook/ABEnums.cs b/src/AddressBook/ABEnums.cs
index 43f41d813dd4..836d66417a0f 100644
--- a/src/AddressBook/ABEnums.cs
+++ b/src/AddressBook/ABEnums.cs
@@ -34,7 +34,7 @@
using XamCore.ObjCRuntime;
namespace XamCore.AddressBook {
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
[Native]
[ErrorDomain ("ABAddressBookErrorDomain")]
public enum ABAddressBookError : nint {
@@ -42,7 +42,7 @@ public enum ABAddressBookError : nint {
OperationNotPermittedByUserError
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
[Native]
public enum ABAuthorizationStatus : nint {
NotDetermined = 0,
diff --git a/src/AddressBook/ABGroup.cs b/src/AddressBook/ABGroup.cs
index d8ab3461fda7..7a61d9245d06 100644
--- a/src/AddressBook/ABGroup.cs
+++ b/src/AddressBook/ABGroup.cs
@@ -63,7 +63,7 @@ internal static void Init ()
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class ABGroup : ABRecord, IEnumerable {
[DllImport (Constants.AddressBookLibrary)]
diff --git a/src/AddressBook/ABMultiValue.cs b/src/AddressBook/ABMultiValue.cs
index 0c0507836a6b..fd4985e56221 100644
--- a/src/AddressBook/ABMultiValue.cs
+++ b/src/AddressBook/ABMultiValue.cs
@@ -94,7 +94,7 @@ public static IntPtr ToIntPtr (NSObject value)
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public struct ABMultiValueEntry
{
ABMultiValue self;
@@ -166,7 +166,7 @@ public int Identifier {
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class ABMultiValue : INativeObject, IDisposable, IEnumerable>
{
IntPtr handle;
@@ -286,7 +286,7 @@ public ABMutableMultiValue ToMutableMultiValue ()
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class ABMutableMultiValue : ABMultiValue
{
internal ABMutableMultiValue (IntPtr handle)
@@ -331,7 +331,7 @@ public bool RemoveAt (nint index)
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class ABMutableDateMultiValue : ABMutableMultiValue {
public ABMutableDateMultiValue ()
: base (ABMultiValue.CreateMutable (ABPropertyType.MultiDateTime))
@@ -339,7 +339,7 @@ public ABMutableDateMultiValue ()
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class ABMutableDictionaryMultiValue : ABMutableMultiValue {
public ABMutableDictionaryMultiValue ()
: base (ABMultiValue.CreateMutable (ABPropertyType.MultiDictionary))
@@ -347,7 +347,7 @@ public ABMutableDictionaryMultiValue ()
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class ABMutableStringMultiValue : ABMutableMultiValue {
public ABMutableStringMultiValue ()
: base (ABMultiValue.CreateMutable (ABPropertyType.MultiString),
diff --git a/src/AddressBook/ABPerson.cs b/src/AddressBook/ABPerson.cs
index f031e426ccaf..ff513a767f64 100644
--- a/src/AddressBook/ABPerson.cs
+++ b/src/AddressBook/ABPerson.cs
@@ -39,19 +39,19 @@
using XamCore.ObjCRuntime;
namespace XamCore.AddressBook {
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public enum ABPersonSortBy : uint /* uint32_t */ {
FirstName = 0,
LastName = 1,
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public enum ABPersonCompositeNameFormat : uint /* uint32_t */ {
FirstNameFirst = 0,
LastNameFirst = 1,
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public enum ABPersonProperty {
Address,
Birthday,
@@ -80,7 +80,7 @@ public enum ABPersonProperty {
SocialProfile
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
[Native]
[iOS (4,1)]
public enum ABPersonImageFormat : nint_compat_int {
@@ -88,7 +88,7 @@ public enum ABPersonImageFormat : nint_compat_int {
OriginalSize = 2
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
static class ABPersonPropertyId {
public static int Address {get; private set;}
@@ -223,7 +223,7 @@ public static ABPersonProperty ToPersonProperty (int id)
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public static class ABPersonAddressKey {
public static NSString City {get; private set;}
@@ -257,7 +257,7 @@ internal static void Init ()
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public static class ABPersonDateLabel {
public static NSString Anniversary {get; private set;}
@@ -280,14 +280,14 @@ internal static void Init ()
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public enum ABPersonKind {
None,
Organization,
Person,
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
static class ABPersonKindId {
public static NSNumber Organization {get; private set;}
public static NSNumber Person {get; private set;}
@@ -330,7 +330,7 @@ public static NSNumber FromPersonKind (ABPersonKind value)
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
static class ABPersonSocialProfile {
public static readonly NSString URLKey;
public static readonly NSString ServiceKey;
@@ -353,7 +353,7 @@ static ABPersonSocialProfile ()
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public static class ABPersonSocialProfileService
{
public static readonly NSString Twitter;
@@ -384,7 +384,7 @@ static ABPersonSocialProfileService ()
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public static class ABPersonPhoneLabel {
public static NSString HomeFax {get; private set;}
public static NSString iPhone {get; private set;}
@@ -421,7 +421,7 @@ internal static void Init ()
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public static class ABPersonInstantMessageService {
public static NSString Aim {get; private set;}
public static NSString Icq {get; private set;}
@@ -463,7 +463,7 @@ internal static void Init ()
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public static class ABPersonInstantMessageKey {
public static NSString Service {get; private set;}
public static NSString Username {get; private set;}
@@ -488,7 +488,7 @@ internal static void Init ()
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public static class ABPersonUrlLabel {
public static NSString HomePage {get; private set;}
@@ -511,7 +511,7 @@ internal static void Init ()
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public static class ABPersonRelatedNamesLabel {
public static NSString Assistant {get; private set;}
public static NSString Brother {get; private set;}
@@ -554,7 +554,7 @@ internal static void Init ()
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public static class ABLabel {
public static NSString Home {get; private set;}
public static NSString Other {get; private set;}
@@ -581,7 +581,7 @@ internal static void Init ()
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class ABPerson : ABRecord, IComparable, IComparable {
[DllImport (Constants.AddressBookLibrary)]
extern static IntPtr ABPersonCreate ();
@@ -1089,7 +1089,7 @@ public static ABPerson[] CreateFromVCard (ABRecord source, NSData vCardData)
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class SocialProfile : DictionaryContainer
{
public SocialProfile ()
@@ -1147,7 +1147,7 @@ public string Url {
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class InstantMessageService : DictionaryContainer
{
public InstantMessageService ()
@@ -1190,7 +1190,7 @@ public string Username {
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class PersonAddress : DictionaryContainer
{
public PersonAddress ()
diff --git a/src/AddressBook/ABRecord.cs b/src/AddressBook/ABRecord.cs
index 42b83b959b89..4d9b2f775ce1 100644
--- a/src/AddressBook/ABRecord.cs
+++ b/src/AddressBook/ABRecord.cs
@@ -37,14 +37,14 @@
using XamCore.ObjCRuntime;
namespace XamCore.AddressBook {
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public enum ABRecordType : uint /* uint32_t */ {
Person = 0,
Group = 1,
Source = 2
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public enum ABPropertyType : uint /* uint32_t */ {
Invalid = 0,
String = 0x1,
@@ -59,7 +59,7 @@ public enum ABPropertyType : uint /* uint32_t */ {
MultiDictionary = ABMultiValue.Mask | Dictionary,
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public abstract class ABRecord : INativeObject, IDisposable {
public const int InvalidRecordId = -1;
diff --git a/src/AddressBook/ABSource.cs b/src/AddressBook/ABSource.cs
index de699c362ca0..700528a68689 100644
--- a/src/AddressBook/ABSource.cs
+++ b/src/AddressBook/ABSource.cs
@@ -39,7 +39,7 @@
namespace XamCore.AddressBook {
// note: not a true flag
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public enum ABSourceType : int /* typedef int */ {
Local = 0x0,
Exchange = 0x1,
@@ -52,7 +52,7 @@ public enum ABSourceType : int /* typedef int */ {
SearchableMask = 0x01000000
};
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class ABSource : ABRecord {
#if !XAMCORE_2_0
[Advice ("Use ABSourceType.SearchableMask")]
@@ -82,13 +82,13 @@ public ABSourceType SourceType {
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public enum ABSourceProperty {
Name,
Type,
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
static class ABSourcePropertyId {
public static int Name { get; private set;}
diff --git a/src/AddressBookUI/ABAddressFormatting.cs b/src/AddressBookUI/ABAddressFormatting.cs
index 470e4873fc16..c35bfb684b3c 100644
--- a/src/AddressBookUI/ABAddressFormatting.cs
+++ b/src/AddressBookUI/ABAddressFormatting.cs
@@ -16,7 +16,7 @@
namespace XamCore.AddressBookUI {
// http://developer.apple.com/library/ios/#DOCUMENTATION/AddressBookUI/Reference/AddressBookUI_Functions/Reference/reference.html#//apple_ref/c/func/ABCreateStringWithAddressDictionary
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
static public class ABAddressFormatting {
[DllImport (Constants.AddressBookUILibrary)]
diff --git a/src/AddressBookUI/ABNewPersonViewController.cs b/src/AddressBookUI/ABNewPersonViewController.cs
index 956c8abbd0b3..bbd7a4bdc197 100644
--- a/src/AddressBookUI/ABNewPersonViewController.cs
+++ b/src/AddressBookUI/ABNewPersonViewController.cs
@@ -14,7 +14,7 @@
namespace XamCore.AddressBookUI {
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class ABNewPersonCompleteEventArgs : EventArgs {
public ABNewPersonCompleteEventArgs (ABPerson person)
@@ -53,7 +53,7 @@ public override void DidCompleteWithNewPerson (ABNewPersonViewController control
#endif
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
partial class ABNewPersonViewController {
ABPerson displayedPerson;
diff --git a/src/AddressBookUI/ABPeoplePickerNavigationController.cs b/src/AddressBookUI/ABPeoplePickerNavigationController.cs
index d51eced3ec8b..913fb7f9ac5d 100644
--- a/src/AddressBookUI/ABPeoplePickerNavigationController.cs
+++ b/src/AddressBookUI/ABPeoplePickerNavigationController.cs
@@ -14,7 +14,7 @@
using XamCore.ObjCRuntime;
namespace XamCore.AddressBookUI {
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class ABPeoplePickerSelectPersonEventArgs : EventArgs {
public ABPeoplePickerSelectPersonEventArgs (ABPerson person)
@@ -27,7 +27,7 @@ public ABPeoplePickerSelectPersonEventArgs (ABPerson person)
public bool Continue {get; set;}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class ABPeoplePickerPerformActionEventArgs : ABPeoplePickerSelectPersonEventArgs {
public ABPeoplePickerPerformActionEventArgs (ABPerson person, ABPersonProperty property, int? identifier)
@@ -41,7 +41,7 @@ public ABPeoplePickerPerformActionEventArgs (ABPerson person, ABPersonProperty p
public int? Identifier {get; private set;}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class ABPeoplePickerSelectPerson2EventArgs : EventArgs {
public ABPeoplePickerSelectPerson2EventArgs (ABPerson person)
@@ -52,7 +52,7 @@ public ABPeoplePickerSelectPerson2EventArgs (ABPerson person)
public ABPerson Person {get; private set;}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class ABPeoplePickerPerformAction2EventArgs : ABPeoplePickerSelectPerson2EventArgs {
public ABPeoplePickerPerformAction2EventArgs (ABPerson person, ABPersonProperty property, int? identifier)
@@ -170,7 +170,7 @@ public override void Cancelled (ABPeoplePickerNavigationController peoplePicker)
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
partial class ABPeoplePickerNavigationController {
DisplayedPropertiesCollection displayedProperties;
diff --git a/src/AddressBookUI/ABPersonViewController.cs b/src/AddressBookUI/ABPersonViewController.cs
index 15974cbafa4a..f16d0571ea5e 100644
--- a/src/AddressBookUI/ABPersonViewController.cs
+++ b/src/AddressBookUI/ABPersonViewController.cs
@@ -13,7 +13,7 @@
using XamCore.ObjCRuntime;
namespace XamCore.AddressBookUI {
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class ABPersonViewPerformDefaultActionEventArgs : EventArgs {
public ABPersonViewPerformDefaultActionEventArgs (ABPerson person, ABPersonProperty property, int? identifier)
{
@@ -56,7 +56,7 @@ public override bool ShouldPerformDefaultActionForPerson (ABPersonViewController
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
partial class ABPersonViewController {
ABPerson displayedPerson;
diff --git a/src/AddressBookUI/ABUnknownPersonViewController.cs b/src/AddressBookUI/ABUnknownPersonViewController.cs
index 321fee8e4035..1194341bad3e 100644
--- a/src/AddressBookUI/ABUnknownPersonViewController.cs
+++ b/src/AddressBookUI/ABUnknownPersonViewController.cs
@@ -13,7 +13,7 @@
using XamCore.ObjCRuntime;
namespace XamCore.AddressBookUI {
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class ABUnknownPersonCreatedEventArgs : EventArgs {
public ABUnknownPersonCreatedEventArgs (ABPerson person)
@@ -65,7 +65,7 @@ public override bool ShouldPerformDefaultActionForPerson (ABUnknownPersonViewCon
}
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
partial class ABUnknownPersonViewController {
ABPerson displayedPerson;
diff --git a/src/AddressBookUI/DisplayedPropertiesCollection.cs b/src/AddressBookUI/DisplayedPropertiesCollection.cs
index 6ca79146009a..c23c6f25dada 100644
--- a/src/AddressBookUI/DisplayedPropertiesCollection.cs
+++ b/src/AddressBookUI/DisplayedPropertiesCollection.cs
@@ -18,7 +18,7 @@ namespace XamCore.AddressBookUI {
delegate T ABFunc ();
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Contacts API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Contacts' API instead.")]
public class DisplayedPropertiesCollection : ICollection {
ABFunc g;
diff --git a/src/AppKit/Enums.cs b/src/AppKit/Enums.cs
index 6275208e28be..11dfbb68b7ea 100644
--- a/src/AppKit/Enums.cs
+++ b/src/AppKit/Enums.cs
@@ -116,7 +116,7 @@ public enum NSComposite : nuint_compat_int {
DestinationAtop,
XOR,
PlusDarker,
- [Availability (Introduced = Platform.Mac_10_0, Deprecated = Platform.Mac_10_10, Message = "Use NSCompositeSourceOver instead")]
+ [Availability (Introduced = Platform.Mac_10_0, Deprecated = Platform.Mac_10_10, Message = "Use NSCompositeSourceOver instead.")]
Highlight,
PlusLighter,
[Mac (10,10)] Multiply,
@@ -138,7 +138,11 @@ public enum NSComposite : nuint_compat_int {
[Native]
public enum NSBackingStore : nuint_compat_int {
- Retained, Nonretained, Buffered
+ [Availability (Introduced = Platform.Mac_10_0, Deprecated = Platform.Mac_10_13, Message = "Use 'Buffered' instead.")]
+ Retained,
+ [Availability (Introduced = Platform.Mac_10_0, Deprecated = Platform.Mac_10_13, Message = "Use 'Buffered' instead.")]
+ Nonretained,
+ Buffered,
}
[Native]
@@ -194,7 +198,7 @@ public enum NSColorSpaceModel : nint {
#if !XAMCORE_3_0
[Flags]
[Native]
- [Obsolete ("Use NSFileWrapperReadingOptions in Foundation instead")]
+ [Obsolete ("Use NSFileWrapperReadingOptions in Foundation instead.")]
public enum NSFileWrapperReadingOptions : nuint_compat_int {
Immediate = 1, WithoutMapping = 2
}
@@ -223,7 +227,7 @@ public enum NSLineBreakMode : nuint_compat_int {
#if !XAMCORE_4_0
[Native]
- [Availability (Introduced = Platform.Mac_10_0, Deprecated = Platform.Mac_10_10, Message = "Use formatters instead")]
+ [Availability (Introduced = Platform.Mac_10_0, Deprecated = Platform.Mac_10_10, Message = "Use formatters instead.")]
public enum NSType : nuint_compat_int {
Any = 0,
Int = 1,
@@ -929,7 +933,7 @@ public enum NSSelectionDirection : nuint_compat_int {
[Native]
public enum NSWindowButton : nuint_compat_int {
CloseButton, MiniaturizeButton, ZoomButton, ToolbarButton, DocumentIconButton, DocumentVersionsButton = 6,
- [Availability (Deprecated = Platform.Mac_10_12, Message = "The standard window button for FullScreenButton is always null; use ZoomButton instead")]
+ [Availability (Deprecated = Platform.Mac_10_12, Message = "The standard window button for FullScreenButton is always null; use ZoomButton instead.")]
FullScreenButton
}
@@ -1444,6 +1448,7 @@ public enum NSPrintingPaginationMode : nuint_compat_int {
[Flags]
#if !XAMCORE_4_0
[Native]
+ [Availability (Deprecated = Platform.Mac_10_11, Message = "Use 'NSGlyphProperty' instead.")]
public enum NSGlyphStorageOptions : nuint_compat_int {
#else
public enum NSGlyphStorageOptions : int
@@ -1454,7 +1459,7 @@ public enum NSGlyphStorageOptions : int
}
#if !XAMCORE_4_0
- [Availability (Deprecated = Platform.Mac_10_11, Message = "Use NSTextStorageEditActions instead")]
+ [Availability (Deprecated = Platform.Mac_10_11, Message = "Use NSTextStorageEditActions instead.")]
[Flags]
[Native]
public enum NSTextStorageEditedFlags : nuint_compat_int {
@@ -1558,7 +1563,10 @@ public enum NSFontSymbolicTraits : int { // uint32_t NSFontSymbolicTraits
MonoSpaceTrait = (1 << 10),
VerticalTrait = (1 << 11),
UIOptimizedTrait = (1 << 12),
-
+ [Mac (10,13)]
+ TraitTightLeading = 1 << 15,
+ [Mac (10,13)]
+ TraitLooseLeading = 1 << 16,
UnknownClass = 0 << 28,
OldStyleSerifsClass = 1 << 28,
TransitionalSerifsClass = 2 << 28,
@@ -1608,7 +1616,7 @@ public enum NSToolbarSizeMode : nuint_compat_int {
Default, Regular, Small
}
- [Availability (Introduced = Platform.Mac_10_0, Deprecated = Platform.Mac_10_10, Message = "Use NSAlertButtonReturn instead")]
+ [Availability (Introduced = Platform.Mac_10_0, Deprecated = Platform.Mac_10_10, Message = "Use NSAlertButtonReturn instead.")]
#if !XAMCORE_4_0
[Native]
public enum NSAlertType : nint {
@@ -1622,7 +1630,7 @@ public enum NSAlertType : int {
}
#if !XAMCORE_4_0
- [Availability (Introduced = Platform.Mac_10_0, Deprecated = Platform.Mac_10_10, Message = "Use NSModalResponse instead")]
+ [Availability (Introduced = Platform.Mac_10_0, Deprecated = Platform.Mac_10_10, Message = "Use NSModalResponse instead.")]
[Native]
public enum NSPanelButtonType : nint {
Cancel, Ok
@@ -2112,6 +2120,7 @@ public static class NSFileTypeForHFSTypeCode {
// These constants specify the possible states of a drawer.
[Native]
+ [Deprecated (PlatformName.MacOSX, 10, 13, message: "Use 'NSSplitViewController' instead.")]
public enum NSDrawerState : nuint_compat_int {
Closed = 0,
Opening = 1,
@@ -2148,6 +2157,7 @@ public enum NSRuleEditorNestingMode : nuint_compat_int {
}
[Native]
+ [Availability (Deprecated = Platform.Mac_10_11, Message = "Use 'NSGlyphProperty' instead.")]
public enum NSGlyphInscription : nuint_compat_int {
Base, Below, Above, Overstrike, OverBelow
}
@@ -2735,4 +2745,100 @@ public enum NSScrubberAlignment : nint
Center
}
+ [Mac (10,13)]
+ public enum NSFontError : int {
+ AssetDownloadError = 66304,
+ ErrorMinimum = 66304,
+ ErrorMaximum = 66335,
+ }
+
+ [Mac (10,13)]
+ [Native]
+ public enum NSAccessibilityAnnotationPosition : nint {
+ FullRange,
+ Start,
+ End,
+ }
+
+ [Mac (10,13)]
+ [Native]
+ public enum NSAccessibilityCustomRotorSearchDirection : nint {
+ Previous,
+ Next,
+ }
+
+ [Mac (10,13)]
+ [Native]
+ public enum NSAccessibilityCustomRotorType : nint {
+ Custom = 0,
+ Any = 1,
+ Annotation,
+ BoldText,
+ Heading,
+ HeadingLevel1,
+ HeadingLevel2,
+ HeadingLevel3,
+ HeadingLevel4,
+ HeadingLevel5,
+ HeadingLevel6,
+ Image,
+ ItalicText,
+ Landmark,
+ Link,
+ List,
+ MisspelledWord,
+ Table,
+ TextField,
+ UnderlinedText,
+ VisitedLink,
+ }
+
+ [Mac (10, 13)]
+ [Native]
+ public enum NSColorType : nint {
+ ComponentBased,
+ Pattern,
+ Catalog,
+ }
+
+ [Mac (10,13)]
+ [Native]
+ [Flags]
+ public enum NSFontAssetRequestOptions : nuint {
+ UsesStandardUI = 1 << 0,
+ }
+
+ [Mac (10,13)]
+ [Native]
+ [Flags]
+ public enum NSFontPanelModeMask : nuint {
+ Face = 1 << 0,
+ Size = 1 << 1,
+ Collection = 1 << 2,
+ UnderlineEffect = 1 << 8,
+ StrikethroughEffect = 1 << 9,
+ TextColorEffect = 1 << 10,
+ DocumentColorEffect = 1 << 11,
+ ShadowEffect = 1 << 12,
+ AllEffects = (nuint)0XFFF00,
+ StandardModes = (nuint)0XFFFF,
+ AllModes = (nuint)0XFFFFFFFF,
+ }
+
+ [Mac (10,13)]
+ [Native]
+ public enum NSLevelIndicatorPlaceholderVisibility : nint {
+ Automatic = 0,
+ Always = 1,
+ WhileEditing = 2,
+ }
+
+ [Mac (10,13)]
+ [Native]
+ public enum NSSegmentDistribution : nint {
+ Fit = 0,
+ Fill,
+ FillEqually,
+ FillProportionally,
+ }
}
diff --git a/src/AppKit/NSApplication.cs b/src/AppKit/NSApplication.cs
index 90841fddacb5..e6206d88293a 100644
--- a/src/AppKit/NSApplication.cs
+++ b/src/AppKit/NSApplication.cs
@@ -132,7 +132,7 @@ public void DiscardEvents (NSEventMask mask, NSEvent lastEvent)
DiscardEvents ((nuint)(ulong) mask, lastEvent);
}
- [Obsolete ("This method does nothing")]
+ [Obsolete ("This method does nothing.")]
public static void RestoreWindow (string identifier, Foundation.NSCoder state, NSWindowCompletionHandler onCompletion)
{
}
diff --git a/src/AppKit/NSBezierPath.cs b/src/AppKit/NSBezierPath.cs
index ec44e5cac158..b069738604f6 100644
--- a/src/AppKit/NSBezierPath.cs
+++ b/src/AppKit/NSBezierPath.cs
@@ -88,7 +88,7 @@ public unsafe void SetAssociatedPointsAtIndex (CGPoint[] points, nint index)
_SetAssociatedPointsAtIndex ((IntPtr)ptr, index);
}
- public unsafe void AppendPathWithPoints (CGPoint[] points)
+ public unsafe void Append (CGPoint[] points)
{
if (points == null)
throw new ArgumentNullException ("points");
@@ -99,6 +99,14 @@ public unsafe void AppendPathWithPoints (CGPoint[] points)
_AppendPathWithPoints ((IntPtr)ptr, points.Length);
}
+#if !XAMCORE_4_0
+ [Obsolete ("Use 'Append (CGPoint[])' instead.")]
+ public unsafe void AppendPathWithPoints (CGPoint[] points)
+ {
+ Append (points);
+ }
+
+ [Obsolete ("Use 'Append (uint[], NSFont)' instead.")]
public unsafe void AppendPathWithGlyphs (uint[] glyphs, NSFont font)
{
if (glyphs == null)
@@ -109,6 +117,18 @@ public unsafe void AppendPathWithGlyphs (uint[] glyphs, NSFont font)
fixed (uint* ptr = &glyphs [0])
_AppendPathWithGlyphs ((IntPtr)ptr, glyphs.Length, font);
}
+#endif
+ [Mac (10,13)]
+ public unsafe void Append (uint[] glyphs, NSFont font)
+ {
+ if (glyphs == null)
+ throw new ArgumentNullException ("glyphs");
+ if (glyphs.Length < 1)
+ throw new ArgumentException ("glyphs array is empty");
+
+ fixed (uint* ptr = &glyphs [0])
+ _AppendBezierPathWithCGGlyphs ((IntPtr)ptr, glyphs.Length, font);
+ }
}
}
diff --git a/src/AppKit/NSComboBox.cs b/src/AppKit/NSComboBox.cs
index 63917b1250f4..1440a353a146 100644
--- a/src/AppKit/NSComboBox.cs
+++ b/src/AppKit/NSComboBox.cs
@@ -5,7 +5,7 @@
namespace XamCore.AppKit {
public partial class NSComboBox {
- [Obsolete ("Use GetItemObject instead")]
+ [Obsolete ("Use GetItemObject instead.")]
public virtual NSComboBox GetItem (nint index)
{
return (NSComboBox) GetItemObject (index);
diff --git a/src/AppKit/NSFont.cs b/src/AppKit/NSFont.cs
new file mode 100644
index 000000000000..2a53fbb14bcc
--- /dev/null
+++ b/src/AppKit/NSFont.cs
@@ -0,0 +1,56 @@
+using System;
+using System.Runtime.InteropServices;
+using XamCore.CoreFoundation;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+using XamCore.CoreGraphics;
+using XamCore.CoreAnimation;
+using XamCore.CoreText;
+
+using CGGlyph = System.UInt16;
+
+namespace XamCore.AppKit {
+ public partial class NSFont
+ {
+ public static NSFont FromCTFont (CTFont font)
+ {
+ if (font == null)
+ return null;
+ return new NSFont (font.Handle);
+ }
+
+ [Mac (10,13)]
+ public unsafe CGRect [] GetBoundingRects (CGGlyph [] glyphs)
+ {
+ if (glyphs == null)
+ throw new ArgumentNullException ("glyphs");
+ if (glyphs.Length < 1)
+ throw new ArgumentException ("glyphs array is empty");
+
+ CGRect [] bounds = new CGRect [glyphs.Length];
+ fixed (CGRect* boundsPtr = &bounds [0]) {
+ fixed (CGGlyph* glyphsPtr = &glyphs [0]) {
+ _GetBoundingRects ((IntPtr)boundsPtr, (IntPtr)glyphsPtr, (nuint)glyphs.Length);
+ }
+ }
+ return bounds;
+ }
+
+ [Mac (10,13)]
+ public unsafe CGSize [] GetAdvancements (CGGlyph [] glyphs)
+ {
+ if (glyphs == null)
+ throw new ArgumentNullException ("glyphs");
+ if (glyphs.Length < 1)
+ throw new ArgumentException ("glyphs array is empty");
+
+ CGSize [] advancements = new CGSize [glyphs.Length];
+ fixed (CGSize* advancementsPtr = &advancements [0]) {
+ fixed (CGGlyph* glyphsPtr = &glyphs [0]) {
+ _GetAdvancements ((IntPtr)advancementsPtr, (IntPtr)glyphsPtr, (nuint)glyphs.Length);
+ }
+ }
+ return advancements;
+ }
+ }
+}
diff --git a/src/AppKit/NSTextContainer.cs b/src/AppKit/NSTextContainer.cs
index ced7c2d17a72..04901e790c28 100644
--- a/src/AppKit/NSTextContainer.cs
+++ b/src/AppKit/NSTextContainer.cs
@@ -6,7 +6,7 @@ namespace XamCore.AppKit
{
public partial class NSTextContainer
{
- [Availability (Obsoleted = Platform.Mac_10_11, Message = "Use NSTextContainer.FromSize instead")]
+ [Availability (Obsoleted = Platform.Mac_10_11, Message = "Use NSTextContainer.FromSize instead.")]
public NSTextContainer (CGSize size)
{
Handle = InitWithContainerSize (size);
@@ -26,7 +26,7 @@ public static NSTextContainer FromSize (CGSize size)
return new NSTextContainer (size, false);
}
- [Availability (Deprecated = Platform.Mac_10_11, Message = "Use NSTextContainer.FromSize instead")]
+ [Availability (Deprecated = Platform.Mac_10_11, Message = "Use NSTextContainer.FromSize instead.")]
public static NSTextContainer FromContainerSize (CGSize containerSize)
{
return new NSTextContainer (containerSize, true);
diff --git a/src/AssetsLibrary/ALAsset.cs b/src/AssetsLibrary/ALAsset.cs
index bc71600b93ca..516bed6938ca 100644
--- a/src/AssetsLibrary/ALAsset.cs
+++ b/src/AssetsLibrary/ALAsset.cs
@@ -17,12 +17,12 @@
namespace XamCore.AssetsLibrary {
// internally used (not exposed by ObjC)
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Photos API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Photos' API instead.")]
public enum ALAssetType {
Video, Photo, Unknown
}
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Photos API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Photos' API instead.")]
public partial class ALAsset {
public ALAssetType AssetType {
get {
diff --git a/src/AssetsLibrary/ALAssetsGroup.cs b/src/AssetsLibrary/ALAssetsGroup.cs
index 1ad52b6b5663..805fa57d4357 100644
--- a/src/AssetsLibrary/ALAssetsGroup.cs
+++ b/src/AssetsLibrary/ALAssetsGroup.cs
@@ -16,7 +16,7 @@
namespace XamCore.AssetsLibrary {
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Photos API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Photos' API instead.")]
public partial class ALAssetsGroup {
public NSString Name {
get {
diff --git a/src/AssetsLibrary/ALAssetsLibrary.cs b/src/AssetsLibrary/ALAssetsLibrary.cs
index 6c97c2378aa3..3fdcf7235ab5 100644
--- a/src/AssetsLibrary/ALAssetsLibrary.cs
+++ b/src/AssetsLibrary/ALAssetsLibrary.cs
@@ -20,7 +20,7 @@
namespace XamCore.AssetsLibrary
{
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Photos API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Photos' API instead.")]
public partial class ALAssetsLibrary
{
[Obsolete ("Use the overload that takes a CGImage instead")]
diff --git a/src/AssetsLibrary/Enums.cs b/src/AssetsLibrary/Enums.cs
index eabe42c11ce1..47c15acc289d 100644
--- a/src/AssetsLibrary/Enums.cs
+++ b/src/AssetsLibrary/Enums.cs
@@ -4,7 +4,7 @@
namespace XamCore.AssetsLibrary {
// NSInteger -> ALAssetsLibrary.h
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Photos API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Photos' API instead.")]
[Native]
public enum ALAssetOrientation : nint {
Up,
@@ -18,7 +18,7 @@ public enum ALAssetOrientation : nint {
}
// NSUInteger -> ALAssetsLibrary.h
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Photos API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Photos' API instead.")]
[Native]
[Flags]
public enum ALAssetsGroupType : nuint {
@@ -32,7 +32,7 @@ public enum ALAssetsGroupType : nuint {
}
// untyped enum -> ALAssetsLibrary.h
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Photos API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Photos' API instead.")]
[ErrorDomain ("ALAssetsLibraryErrorDomain")]
public enum ALAssetsError {
UnknownError = -1,
@@ -48,7 +48,7 @@ public enum ALAssetsError {
}
// NSInteger -> ALAssetsLibrary.h
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use Photos API instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the 'Photos' API instead.")]
[Native]
public enum ALAuthorizationStatus : nint {
NotDetermined,
diff --git a/src/AudioToolbox/AudioFile.cs b/src/AudioToolbox/AudioFile.cs
index 463981623f44..f6f1ad929f4a 100644
--- a/src/AudioToolbox/AudioFile.cs
+++ b/src/AudioToolbox/AudioFile.cs
@@ -46,6 +46,8 @@ public enum AudioFileType { // UInt32 AudioFileTypeID
AIFF = 0x41494646, // AIFF
AIFC = 0x41494643, // AIFC
WAVE = 0x57415645, // WAVE
+ [NoWatch, iOS (11,0), Mac(10,13), TV (11,0)]
+ RF64 = 0x52463634, // RF64
SoundDesigner2 = 0x53643266, // Sd2f
Next = 0x4e655854, // NeXT
MP3 = 0x4d504733, // MPG3
@@ -60,6 +62,8 @@ public enum AudioFileType { // UInt32 AudioFileTypeID
ThreeGP = 0x33677070, // 3gpp
ThreeGP2 = 0x33677032, // 3gp2
AMR = 0x616d7266, // amrf
+ [NoWatch, iOS (11,0), Mac(10,13), TV (11,0)]
+ FLAC = 0x666c6163, // flac
}
public enum AudioFileError {// Implictly cast to OSType in AudioFile.h
diff --git a/src/AudioToolbox/AudioQueue.cs b/src/AudioToolbox/AudioQueue.cs
index b0585c980c23..fde1576377a3 100644
--- a/src/AudioToolbox/AudioQueue.cs
+++ b/src/AudioToolbox/AudioQueue.cs
@@ -262,7 +262,7 @@ public unsafe void CopyToAudioData (IntPtr source, int size)
[StructLayout(LayoutKind.Explicit)]
public struct AudioQueueParameterEvent {
[FieldOffset(0)]
- [Advice ("Use Parameter")]
+ [Advice ("Use Parameter.")]
public uint ID;
[FieldOffset(0)]
diff --git a/src/AudioToolbox/AudioSession.cs b/src/AudioToolbox/AudioSession.cs
index 974df9491977..91723e52f977 100644
--- a/src/AudioToolbox/AudioSession.cs
+++ b/src/AudioToolbox/AudioSession.cs
@@ -194,7 +194,7 @@ public AudioSessionOutputRouteKind [] CurrentOutputRoutes {
}
}
- [Availability (Deprecated = Platform.iOS_7_0, Message = "Use AVAudioSession instead")]
+ [Availability (Deprecated = Platform.iOS_7_0, Message = "Use 'AVAudioSession' instead.")]
public static class AudioSession {
static bool initialized;
public static event EventHandler Interrupted;
diff --git a/src/AudioToolbox/AudioType.cs b/src/AudioToolbox/AudioType.cs
index f0a1607b2517..34919b9e5c8d 100644
--- a/src/AudioToolbox/AudioType.cs
+++ b/src/AudioToolbox/AudioType.cs
@@ -78,6 +78,8 @@ public enum AudioFormatType : uint_compat_int { // UInt32 in AudioStreamBasicDes
MicrosoftGSM = 0x6d730031,
AES3 = 0x61657333, // 'aes3'
EnhancedAES3 = 0x65632d33, // 'ec-3'
+ Flac = 0x666c6163, // 'flac'
+ Opus = 0x6f707573, // 'opus'
}
[Flags]
@@ -142,7 +144,7 @@ public struct AudioStreamBasicDescription {
const int AudioUnitSampleFractionBits = 24;
const AudioFormatFlags AudioFormatFlagIsBigEndian = 0;
- [Availability (Deprecated = Platform.iOS_8_0 | Platform.Mac_10_10, Message = "Canonical is no longer encouraged, since fixed-point no longer provides a performance advantage over floating point. AudioFormatFlagsNativeFloatPacked is preffered instead")]
+ [Availability (Deprecated = Platform.iOS_8_0 | Platform.Mac_10_10, Message = "Canonical is no longer encouraged, since fixed-point no longer provides a performance advantage over floating point. 'AudioFormatFlagsNativeFloatPacked' is preffered instead.")]
public static readonly AudioFormatFlags AudioFormatFlagsAudioUnitCanonical = AudioFormatFlags.IsSignedInteger | (BitConverter.IsLittleEndian ? 0 : AudioFormatFlags.IsBigEndian) |
AudioFormatFlags.IsPacked | AudioFormatFlags.IsNonInterleaved | (AudioFormatFlags) (AudioUnitSampleFractionBits << (int)AudioFormatFlags.LinearPCMSampleFractionShift);
@@ -424,7 +426,31 @@ public enum AudioChannelLabel : int { // UInt32 AudioChannelLabel
Discrete_13 = (1<<16) | 13,
Discrete_14 = (1<<16) | 14,
Discrete_15 = (1<<16) | 15,
- Discrete_65535 = (1<<16) | 65535
+ Discrete_65535 = (1<<16) | 65535,
+
+ // HOA ACN channels
+
+ // generic
+ HoaAcn = 500,
+
+ // numbered
+ HoaAcn0 = (2 << 16) | 0,
+ HoaAcn1 = (2 << 16) | 1,
+ HoaAcn2 = (2 << 16) | 2,
+ HoaAcn3 = (2 << 16) | 3,
+ HoaAcn4 = (2 << 16) | 4,
+ HoaAcn5 = (2 << 16) | 5,
+ HoaAcn6 = (2 << 16) | 6,
+ HoaAcn7 = (2 << 16) | 7,
+ HoaAcn8 = (2 << 16) | 8,
+ HoaAcn9 = (2 << 16) | 9,
+ HoaAcn10 = (2 << 16) | 10,
+ HoaAcn11 = (2 << 16) | 11,
+ HoaAcn12 = (2 << 16) | 12,
+ HoaAcn13 = (2 << 16) | 13,
+ HoaAcn14 = (2 << 16) | 14,
+ HoaAcn15 = (2 << 16) | 15,
+ HoaAcn65024 = (2 << 16) | 65024
}
[Flags]
@@ -663,7 +689,10 @@ public enum AudioChannelLayoutTag : uint { // UInt32 AudioChannelLayoutTag
DTS_8_0_B = (179<<16) | 8,
DTS_8_1_A = (180<<16) | 9,
DTS_8_1_B = (181<<16) | 9,
- DTS_6_1_D = (182<<16) | 7,
+ DTS_6_1_D = (182<<16) | 7,
+
+ HOA_ACN_SN3D = (190U<<16),
+ HOA_ACN_N3D = (191U<<16),
DiscreteInOrder = (147<<16) | 0, // needs to be ORed with the actual number of channels
Unknown = 0xFFFF0000 // needs to be ORed with the actual number of channels
@@ -1111,7 +1140,6 @@ public override string ToString ()
}
}
-#if !WATCH
[StructLayout(LayoutKind.Sequential)]
public struct AudioBuffer {
public int NumberChannels;
@@ -1136,5 +1164,4 @@ public struct CABarBeatTime {
public /* UInt16 */ ushort Reserved;
}
#endif
-#endif // !WATCH
}
diff --git a/src/AudioUnit/AudioComponent.cs b/src/AudioUnit/AudioComponent.cs
index a39846606230..a4fad8fefec2 100644
--- a/src/AudioUnit/AudioComponent.cs
+++ b/src/AudioUnit/AudioComponent.cs
@@ -38,6 +38,177 @@
namespace XamCore.AudioUnit
{
+
+#if !COREBUILD
+ // keys are not constants and had to be found in AudioToolbox.framework/Headers/AudioComponent.h
+ [NoWatch, NoTV, Mac (10,13), iOS (11,0)]
+ public partial class ResourceUsageInfo : DictionaryContainer {
+ static NSString userClientK = new NSString ("iokit.user-client");
+ static NSString globalNameK = new NSString ("mach-lookup.global-name");
+ static NSString networkClientK = new NSString ("network.client");
+ static NSString exceptionK = new NSString ("temporary-exception.files.all.read-write");
+
+ public ResourceUsageInfo () : base () {}
+
+ public ResourceUsageInfo (NSDictionary dic) : base (dic) {}
+
+ public string[] IOKitUserClient {
+ get {
+ var array = GetNativeValue (userClientK);
+ if (array == null )
+ return null;
+ return NSArray.StringArrayFromHandle (array.Handle);
+ }
+ set {
+ if (value == null)
+ RemoveValue (userClientK);
+ else
+ SetArrayValue (userClientK, value);
+ }
+ }
+
+ public string[] MachLookUpGlobalName {
+ get {
+ var array = GetNativeValue (globalNameK);
+ if (array == null)
+ return null;
+ return NSArray.StringArrayFromHandle (array.Handle);
+ }
+ set {
+ if (value == null)
+ RemoveValue (globalNameK);
+ else
+ SetArrayValue (globalNameK, value);
+ }
+ }
+
+ public bool? NetworkClient {
+ get {
+ return GetBoolValue (networkClientK);
+ }
+ set {
+ SetBooleanValue (networkClientK, value);
+ }
+ }
+
+ public bool? TemporaryExceptionReadWrite {
+ get {
+ return GetBoolValue (exceptionK);
+ }
+ set {
+ SetBooleanValue (exceptionK, value);
+ }
+ }
+ }
+
+ // keys are not constants and had to be found in AudioToolbox.framework/Headers/AudioComponent.h
+ [NoWatch, NoTV, Mac (10,13), iOS (11,0)]
+ public partial class AudioComponentInfo : DictionaryContainer {
+ static NSString typeK = new NSString ("type");
+ static NSString subtypeK = new NSString ("subtype");
+ static NSString manufacturerK = new NSString ("manufacturer");
+ static NSString nameK = new NSString ("name");
+ static NSString versionK = new NSString ("version");
+ static NSString factoryFunctionK = new NSString ("factoryFunction");
+ static NSString sandboxSafeK = new NSString ("sandboxSafe");
+ static NSString resourceUsageK = new NSString ("resourceUsage");
+ static NSString tagsK = new NSString ("tags");
+
+ public AudioComponentInfo () : base () {}
+
+ public AudioComponentInfo (NSDictionary dic) : base (dic) {}
+
+ public string Type {
+ get {
+ return GetStringValue (typeK);
+ }
+ set {
+ SetStringValue (typeK, value);
+ }
+ }
+
+ public string Subtype {
+ get {
+ return GetStringValue (subtypeK);
+ }
+ set {
+ SetStringValue (subtypeK, value);
+ }
+ }
+
+ public string Manufacturer {
+ get {
+ return GetStringValue (manufacturerK);
+ }
+ set {
+ SetStringValue (manufacturerK, value);
+ }
+ }
+
+ public string Name {
+ get {
+ return GetStringValue (nameK);
+ }
+ set {
+ SetStringValue (nameK, value);
+ }
+ }
+
+ public nuint? Version {
+ get {
+ return GetNUIntValue (versionK);
+ }
+ set {
+ SetNumberValue (versionK, value);
+ }
+ }
+
+ public string FactoryFunction {
+ get {
+ return GetStringValue (factoryFunctionK);
+ }
+ set {
+ SetStringValue (factoryFunctionK, value);
+ }
+ }
+
+ public bool? SandboxSafe {
+ get {
+ return GetBoolValue (sandboxSafeK);
+ }
+ set {
+ SetBooleanValue (sandboxSafeK, value);
+ }
+ }
+
+ public ResourceUsageInfo ResourceUsage {
+ get {
+ return GetStrongDictionary (resourceUsageK);
+ }
+ set {
+ SetNativeValue (resourceUsageK, value?.Dictionary, true);
+ }
+ }
+
+ public string[] Tags {
+ get {
+ var array = GetNativeValue (tagsK);
+ if (array == null)
+ return null;
+ return NSArray.StringArrayFromHandle (array.Handle);
+ }
+ set {
+ if (value == null)
+ RemoveValue (tagsK);
+ else
+ SetArrayValue (tagsK, value);
+ }
+ }
+ }
+
+#endif
+
+
public class AudioComponent : INativeObject {
#if !COREBUILD
internal IntPtr handle;
@@ -224,6 +395,59 @@ public XamCore.AppKit.NSImage GetIcon ()
return new XamCore.AppKit.NSImage (AudioComponentGetIcon (handle));
}
#endif
+
+#if IOS || MONOMAC
+ [NoWatch, NoTV, Mac (10,13), iOS (11,0)]
+ [DllImport (Constants.AudioUnitLibrary)]
+ static extern int /* OSStatus */ AudioUnitExtensionSetComponentList (IntPtr /* CFString */ extensionIdentifier, /* CFArrayRef */ IntPtr audioComponentInfo);
+
+ [NoWatch, NoTV, Mac (10,13), iOS (11,0)]
+ [DllImport (Constants.AudioUnitLibrary)]
+ static extern /* CFArrayRef */ IntPtr AudioUnitExtensionCopyComponentList (IntPtr /* CFString */ extensionIdentifier);
+
+ [NoWatch, NoTV, Mac (10,13), iOS (11,0)]
+ public AudioComponentInfo[] ComponentList {
+ get {
+ using (var cfString = new CFString (Name)) {
+ var cHandle = AudioUnitExtensionCopyComponentList (cfString.Handle);
+ if (cHandle == IntPtr.Zero)
+ return null;
+ using (var nsArray = Runtime.GetNSObject (cHandle, owns: true)) {
+ if (nsArray == null)
+ return null;
+ // make things easier for developers since we do not know how to have an implicit conversion from NSObject to AudioComponentInfo
+ var dics = NSArray.FromArray (nsArray);
+ var result = new AudioComponentInfo [dics.Length];
+ for (var i = 0; i < result.Length; i++) {
+ result [i] = new AudioComponentInfo (dics[i]);
+ }
+ return result;
+ }
+ }
+ }
+ set {
+ if (value == null)
+ throw new ArgumentNullException (nameof (value));
+ using (var cfString = new CFString (Name)) {
+ var dics = new NSDictionary [value.Length];
+ for (var i = 0; i < value.Length; i++) {
+ dics [i] = value [i].Dictionary;
+ }
+ using (var array = NSArray.FromNSObjects (dics)) {
+ var result = (AudioConverterError) AudioUnitExtensionSetComponentList (cfString.Handle, array.Handle);
+ switch (result) {
+ case AudioConverterError.None:
+ return;
+ default:
+ throw new InvalidOperationException ($"ComponentList could not be set, error {result.ToString ()}");
+
+ }
+ }
+ }
+ }
+ }
+#endif
+
#endif // !COREBUILD
}
@@ -241,4 +465,4 @@ public static class AudioComponentConfigurationInfo {
public static NSString ValidationResult = new NSString ("ValidationResult");
}
#endif
-}
\ No newline at end of file
+}
diff --git a/src/AudioUnit/AudioComponentDescription.cs b/src/AudioUnit/AudioComponentDescription.cs
index 8b2bc1a20445..6198fabb8279 100644
--- a/src/AudioUnit/AudioComponentDescription.cs
+++ b/src/AudioUnit/AudioComponentDescription.cs
@@ -142,10 +142,10 @@ public enum AudioTypeMixer { // OSType in AudioComponentDescription
Spacial=0x3364656d, // Same as Embedded3D
#if MONOMAC
Stereo=0x736d7872, // 'smxr'
- [Availability (Deprecated = Platform.Mac_10_10, Message = "Use Spacial instead")]
+ [Availability (Deprecated = Platform.Mac_10_10, Message = "Use 'Spacial' instead.")]
ThreeD=0x33646d78, // '3dmx'
#else
- [Availability (Deprecated = Platform.iOS_8_0, Message = "Use Spacial instead")]
+ [Availability (Deprecated = Platform.iOS_8_0, Message = "Use 'Spacial' instead.")]
Embedded3D=0x3364656d, // '3dem'
#endif
}
diff --git a/src/AudioUnit/AudioUnit.cs b/src/AudioUnit/AudioUnit.cs
index 3838a7681122..60ae7eef178a 100644
--- a/src/AudioUnit/AudioUnit.cs
+++ b/src/AudioUnit/AudioUnit.cs
@@ -63,6 +63,10 @@ public enum AudioUnitStatus { // Implictly cast to OSType
Initialized = -10849,
InvalidOfflineRender = -10848,
Unauthorized = -10847,
+ [iOS (11,0), Mac (10,13, onlyOn64: true), TV (11,0), NoWatch]
+ MidiOutputBufferFull = -66753,
+ [iOS (11,0), Mac (10,13, onlyOn64: true), TV (11,0), NoWatch]
+ ExtensionNotFound = -66744,
}
public enum AudioComponentStatus { // Implictly cast to OSType
@@ -352,6 +356,50 @@ public enum AudioUnitClumpID // UInt32 in AudioUnitParameterInfo
System = 0
}
+ public enum AUParameterEventType : uint
+ {
+ Immediate = 1,
+ Ramped = 2,
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ public struct AudioUnitParameterEvent
+ {
+ public uint Scope;
+ public uint Element;
+ public uint Parameter;
+ public AUParameterEventType EventType;
+
+ [StructLayout (LayoutKind.Explicit)]
+ public struct EventValuesStruct
+ {
+ [StructLayout (LayoutKind.Sequential)]
+ public struct RampStruct
+ {
+ public int StartBufferOffset;
+ public uint DurationInFrames;
+ public float StartValue;
+ public float EndValue;
+ }
+
+
+ [FieldOffset (0)]
+ public RampStruct Ramp;
+
+ [StructLayout (LayoutKind.Sequential)]
+ public struct ImmediateStruct
+ {
+ public uint BufferOffset;
+ public float Value;
+ }
+
+ [FieldOffset (0)]
+ public ImmediateStruct Immediate;
+ }
+
+ public EventValuesStruct EventValues;
+ }
+
public class AudioUnit : IDisposable, XamCore.ObjCRuntime.INativeObject
{
internal IntPtr handle;
@@ -460,7 +508,7 @@ static int renderCallback(IntPtr inRefCon, ref AudioUnitRenderActionFlags _ioAct
#endif
#if !XAMCORE_3_0
- [Obsolete ("Use SetFormat instead as it has the ability of returning a status code")]
+ [Obsolete ("Use 'SetFormat' instead as it has the ability of returning a status code.")]
public void SetAudioFormat(XamCore.AudioToolbox.AudioStreamBasicDescription audioFormat, AudioUnitScopeType scope, uint audioUnitElement = 0)
{
var err = AudioUnitSetProperty(handle,
@@ -501,7 +549,7 @@ public uint GetCurrentDevice (AudioUnitScopeType scope, uint audioUnitElement =
#if !XAMCORE_3_0 || MONOMAC
#if !MONOMAC
- [Obsolete ("This API is not available on iOS")]
+ [Obsolete ("This API is not available on iOS.")]
#endif
public static uint GetCurrentInputDevice ()
{
@@ -873,6 +921,11 @@ public AudioUnitStatus SetParameter (AudioUnitParameterType type, float value, A
return AudioUnitSetParameter (handle, type, scope, audioUnitElement, value, 0);
}
+ public AudioUnitStatus ScheduleParameter (AudioUnitParameterEvent inParameterEvent, uint inNumParamEvents)
+ {
+ return AudioUnitScheduleParameters (handle, inParameterEvent, inNumParamEvents);
+ }
+
public void Dispose()
{
Dispose (true);
@@ -1032,6 +1085,9 @@ static extern AudioUnitStatus AudioUnitGetPropertyInfo (IntPtr inUnit, AudioUnit
static extern AudioUnitStatus AudioUnitSetParameter (IntPtr inUnit, AudioUnitParameterType inID, AudioUnitScopeType inScope,
uint inElement, float inValue, uint inBufferOffsetInFrames);
+ [DllImport (Constants.AudioUnitLibrary)]
+ static extern AudioUnitStatus AudioUnitScheduleParameters (IntPtr inUnit, AudioUnitParameterEvent inParameterEvent, uint inNumParamEvents);
+
#if MONOMAC
[DllImport (Constants.AudioUnitLibrary)]
static extern int AudioObjectGetPropertyData (
@@ -1959,7 +2015,8 @@ public enum AUSpatializationAlgorithm : uint
Hrtf = 2,
SoundField = 3,
VectorBasedPanning = 4,
- StereoPassThrough = 5
+ StereoPassThrough = 5,
+ HrtfHQ = 6,
}
public enum AU3DMixerAttenuationCurve : uint
@@ -2073,7 +2130,7 @@ public enum AudioUnitSubType : uint
}
#if !XAMCORE_4_0 && !COREBUILD
#if XAMCORE_2_0 || !MONOMAC
- [Obsolete ("Use AUImplementorStringFromValueCallback instead")]
+ [Obsolete ("Use 'AUImplementorStringFromValueCallback' instead.")]
public delegate NSString _AUImplementorStringFromValueCallback (AUParameter param, IntPtr value);
#endif
#endif
diff --git a/src/CFNetwork/CFHTTPStream.cs b/src/CFNetwork/CFHTTPStream.cs
index b0c124cd70ef..047645f693c4 100644
--- a/src/CFNetwork/CFHTTPStream.cs
+++ b/src/CFNetwork/CFHTTPStream.cs
@@ -20,7 +20,7 @@ namespace XamCore.CoreServices {
#endif
// all fields constants that this is using are deprecated in Xcode 7
- [Availability (Deprecated = Platform.iOS_9_0 | Platform.Mac_10_11, Message = "Use NSUrlSession")]
+ [Availability (Deprecated = Platform.iOS_9_0 | Platform.Mac_10_11, Message = "Use 'NSUrlSession'.")]
public partial class CFHTTPStream : CFReadStream {
internal CFHTTPStream (IntPtr handle)
diff --git a/src/CloudKit/CKCompat.cs b/src/CloudKit/CKCompat.cs
index d9aef88830c5..202d95c9c984 100644
--- a/src/CloudKit/CKCompat.cs
+++ b/src/CloudKit/CKCompat.cs
@@ -12,7 +12,7 @@ namespace XamCore.CloudKit {
#if !XAMCORE_4_0 && !WATCH
public partial class CKOperation {
- [Obsoleted (PlatformName.iOS, 9,3, message: "Do not use; this API was removed in iOS 9.3 and will always return 0")]
+ [Obsoleted (PlatformName.iOS, 9,3, message: "Do not use; this API was removed and will always return 0.")]
public virtual ulong ActivityStart ()
{
return 0;
@@ -21,7 +21,7 @@ public virtual ulong ActivityStart ()
public partial class CKNotificationID {
- [Obsolete ("This type is not meant to be created by user code")]
+ [Obsolete ("This type is not meant to be created by user code.")]
public CKNotificationID ()
{
}
diff --git a/src/CloudKit/Enums.cs b/src/CloudKit/Enums.cs
index 199d99ab8792..7075c64976dc 100644
--- a/src/CloudKit/Enums.cs
+++ b/src/CloudKit/Enums.cs
@@ -80,6 +80,7 @@ public enum CKErrorCode : nint {
[iOS (10,0), TV (10,0), Mac (10,12)] ReferenceViolation = 31,
[iOS (10,0), TV (10,0), Mac (10,12)] ManagedAccountRestricted = 32,
[iOS (10,0), TV (10,0), Mac (10,12)] ParticipantMayNeedVerification = 33,
+ [iOS (11,0), TV (11,0), Mac (10,13), Watch (4,0)] ResponseLost = 34,
}
// NSInteger -> CKModifyRecordsOperation.h
@@ -102,7 +103,7 @@ public enum CKNotificationType : nint {
Query = 1,
RecordZone = 2,
ReadNotification = 3,
- [iOS (10,0), TV (10,0), Mac (10,12)] Database = 4,
+ [iOS (10,0), TV (10,0), Mac (10,12), Watch (3,0)] Database = 4,
}
// NSInteger -> CKNotification.h
@@ -152,7 +153,7 @@ public enum CKSubscriptionType : nint {
// NSInteger -> CKSubscription.h
[NoWatch]
- [Availability (Introduced = Platform.iOS_8_0 | Platform.Mac_10_10 , Deprecated = Platform.iOS_10_0 | Platform.Mac_10_12, Message = "Use CKQuerySubscriptionOptions instead")]
+ [Availability (Introduced = Platform.iOS_8_0 | Platform.Mac_10_10 , Deprecated = Platform.iOS_10_0 | Platform.Mac_10_12, Message = "Use 'CKQuerySubscriptionOptions' instead.")]
[Flags]
[Native]
public enum CKSubscriptionOptions : nuint {
@@ -215,4 +216,18 @@ public enum CKQuerySubscriptionOptions : nuint
RecordDeletion = 1 << 2,
FiresOnce = 1 << 3,
}
+
+ [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
+ [Native]
+ public enum CKOperationGroupTransferSize : nint
+ {
+ Unknown,
+ Kilobytes,
+ Megabytes,
+ TensOfMegabytes,
+ HundredsOfMegabytes,
+ Gigabytes,
+ TensOfGigabytes,
+ HundredsOfGigabytes,
+ }
}
diff --git a/src/Constants.iOS.cs.in b/src/Constants.iOS.cs.in
index fe2270d46543..d7247c38c0fb 100644
--- a/src/Constants.iOS.cs.in
+++ b/src/Constants.iOS.cs.in
@@ -37,6 +37,7 @@ namespace MonoTouch {
public const string MapKitLibrary = "/System/Library/Frameworks/MapKit.framework/MapKit";
public const string GameKitLibrary = "/System/Library/Frameworks/GameKit.framework/GameKit";
public const string EventKitLibrary = "/System/Library/Frameworks/EventKit.framework/EventKit";
+ public const string EventKitUILibrary = "/System/Library/Frameworks/EventKitUI.framework/EventKitUI";
public const string ImageIOLibrary = "/System/Library/Frameworks/ImageIO.framework/ImageIO";
public const string AssetsLibraryLibrary = "/System/Library/Frameworks/AssetsLibrary.framework/AssetsLibrary";
public const string CoreVideoLibrary = "/System/Library/Frameworks/CoreVideo.framework/CoreVideo";
@@ -105,5 +106,16 @@ namespace MonoTouch {
public const string UserNotificationsUILibrary = "/System/Library/Frameworks/UserNotificationsUI.framework/UserNotificationsUI";
public const string IntentsLibrary = "/System/Library/Frameworks/Intents.framework/Intents";
public const string IntentsUILibrary = "/System/Library/Frameworks/IntentsUI.framework/IntentsUI";
+ // iOS 11.0
+ public const string ARKitLibrary = "/System/Library/Frameworks/ARKit.framework/ARKit";
+ public const string CoreNFCLibrary = "/System/Library/Frameworks/CoreNFC.framework/CoreNFC";
+ public const string DeviceCheckLibrary = "/System/Library/Frameworks/DeviceCheck.framework/DeviceCheck";
+ public const string IdentityLookupLibrary = "/System/Library/Frameworks/IdentityLookup.framework/IdentityLookup";
+ public const string CoreMLLibrary = "/System/Library/Frameworks/CoreML.framework/CoreML";
+ public const string VisionLibrary = "/System/Library/Frameworks/Vision.framework/Vision";
+ public const string FileProviderLibrary = "/System/Library/Frameworks/FileProvider.framework/FileProvider";
+ public const string FileProviderUILibrary = "/System/Library/Frameworks/FileProviderUI.framework/FileProviderUI";
+ public const string IOSurfaceLibrary = "/System/Library/Frameworks/IOSurface.framework/IOSurface";
+ public const string PdfKitLibrary = "/System/Library/Frameworks/PDFKit.framework/PDFKit";
}
}
diff --git a/src/Constants.mac.cs.in b/src/Constants.mac.cs.in
index 629560446c24..5f08f1c7a019 100644
--- a/src/Constants.mac.cs.in
+++ b/src/Constants.mac.cs.in
@@ -125,5 +125,12 @@ namespace MonoMac {
public const string PhotosLibrary = "/System/Library/Frameworks/Photos.framework/Photos";
public const string IntentsLibrary = "/System/Library/Frameworks/Intents.framework/Intents";
public const string MediaPlayerLibrary = "/System/Library/Frameworks/MediaPlayer.framework/MediaPlayer";
+
+ // macOS 10.13
+ public const string CoreMLLibrary = "/System/Library/Frameworks/CoreML.framework/CoreML";
+ public const string VisionLibrary = "/System/Library/Frameworks/Vision.framework/Vision";
+ public const string IOSurfaceLibrary = "/System/Library/Frameworks/IOSurface.framework/IOSurface";
+ public const string PhotosUILibrary = "/System/Library/Frameworks/Photos.framework/PhotosUI";
+ public const string ExternalAccessoryLibrary = "/System/Library/Frameworks/ExternalAccessory.framework/ExternalAccessory";
}
}
diff --git a/src/Constants.tvos.cs.in b/src/Constants.tvos.cs.in
index ce9c31ea4d79..940bd22ac0a2 100644
--- a/src/Constants.tvos.cs.in
+++ b/src/Constants.tvos.cs.in
@@ -69,5 +69,10 @@ namespace ObjCRuntime {
// tvOS 10.2
public const string VideoToolboxLibrary = "/System/Library/Frameworks/VideoToolbox.framework/VideoToolbox";
+ // tvOS 11.0
+ public const string DeviceCheckLibrary = "/System/Library/Frameworks/DeviceCheck.framework/DeviceCheck";
+ public const string CoreMLLibrary = "/System/Library/Frameworks/CoreML.framework/CoreML";
+ public const string VisionLibrary = "/System/Library/Frameworks/Vision.framework/Vision";
+ public const string IOSurfaceLibrary = "/System/Library/Frameworks/IOSurface.framework/IOSurface";
}
}
diff --git a/src/Constants.watch.cs.in b/src/Constants.watch.cs.in
index df181fa9691a..52cf432001ef 100644
--- a/src/Constants.watch.cs.in
+++ b/src/Constants.watch.cs.in
@@ -42,6 +42,11 @@ namespace ObjCRuntime {
// WatchOS 3.2
public const string IntentsLibrary = "/System/Library/Frameworks/Intents.framework/Intents";
-
+
+ // WatchOS 4.0
+ public const string CoreBluetoothLibrary = "/System/Library/Frameworks/CoreBluetooth.framework/CoreBluetooth";
+ public const string CoreMLLibrary = "/System/Library/Frameworks/CoreML.framework/CoreML";
+ public const string CoreVideoLibrary = "/System/Library/Frameworks/CoreVideo.framework/CoreVideo";
+ public const string VisionLibrary = "/System/Library/Frameworks/Vision.framework/Vision";
}
}
diff --git a/src/Contacts/CNEnums.cs b/src/Contacts/CNEnums.cs
index 4de1f60b2575..d1ef6a26a155 100644
--- a/src/Contacts/CNEnums.cs
+++ b/src/Contacts/CNEnums.cs
@@ -94,7 +94,13 @@ public enum CNErrorCode : nint {
ValidationTypeMismatch = 301,
ValidationConfigurationError = 302,
PredicateInvalid = 400,
- PolicyViolation = 500
+ PolicyViolation = 500,
+ [iOS (11,0), Mac (10,13)]
+ ClientIdentifierInvalid = 600,
+ [iOS (11,0), Mac (10,13)]
+ ClientIdentifierDoesNotExist = 601,
+ [iOS (11,0), Mac (10,13)]
+ VCardMalformed = 700,
}
// NSInteger -> CNPostalAddressFormatter.h
diff --git a/src/Contacts/CNObsolete.cs b/src/Contacts/CNObsolete.cs
index 377370dbfe98..a52a5d698001 100644
--- a/src/Contacts/CNObsolete.cs
+++ b/src/Contacts/CNObsolete.cs
@@ -13,7 +13,7 @@ namespace XamCore.Contacts {
public static partial class CNGroup_PredicatesExtension {
#if !MONOMAC
- [Obsolete ("This API is only available on OSX 10.11+")]
+ [Obsolete ("This API is only available on macOS 10.11+.")]
public static Foundation.NSPredicate GetPredicateForSubgroupsInGroup (CNGroup This, string parentGroupIdentifier)
{
return null;
diff --git a/src/Contacts/CNPostalAddress.cs b/src/Contacts/CNPostalAddress.cs
deleted file mode 100644
index 847003821982..000000000000
--- a/src/Contacts/CNPostalAddress.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// CNPostalAddress.cs: Implements some nicer methods for CNPostalAddress
-//
-// Authors:
-// Alex Soto
-//
-// Copyright 2015 Xamarin Inc. All rights reserved.
-//
-
-using System;
-using XamCore.Foundation;
-
-namespace XamCore.Contacts {
-#if XAMCORE_2_0 // The Contacts framework uses generics heavily, which is only supported in Unified (for now at least)
- // Strong typed Keys to enum
- public enum CNPostalAddressKeyOption {
- Street,
- City,
- State,
- PostalCode,
- Country,
- IsoCountryCode
- }
-
- public partial class CNPostalAddress {
-
- public static string LocalizeProperty (CNPostalAddressKeyOption option)
- {
- var srvc = LocalizeOptionsToNSString (option);
- return LocalizeProperty (srvc);
- }
-
- static NSString LocalizeOptionsToNSString (CNPostalAddressKeyOption option)
- {
- switch (option) {
- case CNPostalAddressKeyOption.Street:
- return CNPostalAddressKey.Street;
- case CNPostalAddressKeyOption.City:
- return CNPostalAddressKey.City;
- case CNPostalAddressKeyOption.State:
- return CNPostalAddressKey.State;
- case CNPostalAddressKeyOption.PostalCode:
- return CNPostalAddressKey.PostalCode;
- case CNPostalAddressKeyOption.Country:
- return CNPostalAddressKey.Country;
- case CNPostalAddressKeyOption.IsoCountryCode:
- return CNPostalAddressKey.IsoCountryCode;
- default:
- throw new ArgumentOutOfRangeException ("option");
- }
- }
- }
-#endif // XAMCORE_2_0
-}
-
diff --git a/src/CoreAnimation/CAEnums.cs b/src/CoreAnimation/CAEnums.cs
index f20cd0c670b3..23caa9ecc8c5 100644
--- a/src/CoreAnimation/CAEnums.cs
+++ b/src/CoreAnimation/CAEnums.cs
@@ -31,6 +31,7 @@
using XamCore.Foundation;
using System.Runtime.InteropServices;
using XamCore.CoreGraphics;
+using XamCore.ObjCRuntime;
namespace XamCore.CoreAnimation {
@@ -47,6 +48,16 @@ public enum CAEdgeAntialiasingMask : uint_compat_int {
TopBottomEdges = TopEdge | BottomEdge
}
+ [NoWatch] // headers not updated
+ [iOS (11,0)][TV (11,0)][Mac (10,13)]
+ [Native][Flags]
+ public enum CACornerMask : nuint {
+ MinXMinYCorner = 1 << 0,
+ MaxXMinYCorner = 1 << 1,
+ MinXMaxYCorner = 1 << 2,
+ MaxXMaxYCorner = 1 << 3,
+ }
+
#if MONOMAC
// untyped enum -> CALayer.h (only on OSX headers)
// note: autoresizingMask is an `unsigned int` @property
diff --git a/src/CoreBluetooth/AdvertisementDataOptions.cs b/src/CoreBluetooth/AdvertisementDataOptions.cs
index 96a398a59f30..35d8b242e354 100644
--- a/src/CoreBluetooth/AdvertisementDataOptions.cs
+++ b/src/CoreBluetooth/AdvertisementDataOptions.cs
@@ -37,6 +37,7 @@ namespace XamCore.CoreBluetooth {
// It's intentionally not called AdvertisementDataOptions because different options
// are valid in different contexts
//
+ [Watch (4,0)]
[iOS (6,0)]
public class StartAdvertisingOptions : DictionaryContainer
{
diff --git a/src/CoreBluetooth/CBUUID.cs b/src/CoreBluetooth/CBUUID.cs
index 8d09c3963b06..43b6d6f62679 100644
--- a/src/CoreBluetooth/CBUUID.cs
+++ b/src/CoreBluetooth/CBUUID.cs
@@ -205,5 +205,15 @@ public unsafe string ToString (bool fullUuid)
return sb.ToString ();
}
+
+#if MONOMAC
+ // workaround for 27160443 – Trello: https://trello.com/c/oqB27JA6
+ // try new constant (10.13+) and fallback to the old/misnamed one
+ public static NSString CharacteristicValidRangeString {
+ get {
+ return CBUUIDCharacteristicValidRangeString ?? CBUUIDValidRangeString;
+ }
+ }
+#endif
}
}
diff --git a/src/CoreBluetooth/CoreBluetooth.cs b/src/CoreBluetooth/CoreBluetooth.cs
index b35e460060f1..dc5ed96ae03d 100644
--- a/src/CoreBluetooth/CoreBluetooth.cs
+++ b/src/CoreBluetooth/CoreBluetooth.cs
@@ -113,10 +113,10 @@ public CBPeer ()
}
}
#endif
-#if !MONOMAC && !XAMCORE_4_0
+#if !WATCH && !XAMCORE_4_0
public partial class CBCentralManager {
- public virtual CBCentralManagerState State {
+ public new virtual CBCentralManagerState State {
get {
return (CBCentralManagerState)base.State;
}
diff --git a/src/CoreBluetooth/Enums.cs b/src/CoreBluetooth/Enums.cs
index f1bca3817337..6e7aa4194262 100644
--- a/src/CoreBluetooth/Enums.cs
+++ b/src/CoreBluetooth/Enums.cs
@@ -13,13 +13,11 @@
namespace XamCore.CoreBluetooth {
-#if !MONOMAC
+ [Mac (10,13)]
+ [Watch (4,0)]
[iOS (10,0)]
[Native]
public enum CBManagerState : nint {
-#else
- internal enum CBManagerState {
-#endif
Unknown = 0,
Resetting,
Unsupported,
@@ -30,7 +28,8 @@ internal enum CBManagerState {
// NSInteger -> CBCentralManager.h
[Introduced (PlatformName.iOS, 5, 0)]
- [Deprecated (PlatformName.iOS, 10, 0, message: "Use CBManagerState instead")]
+ [Deprecated (PlatformName.iOS, 10, 0, message: "Use 'CBManagerState' instead.")]
+ [NoWatch]
[Native]
public enum CBCentralManagerState : nint {
Unknown = CBManagerState.Unknown,
@@ -43,7 +42,8 @@ public enum CBCentralManagerState : nint {
// NSInteger -> CBPeripheralManager.h
[Introduced (PlatformName.iOS, 6, 0)]
- [Deprecated (PlatformName.iOS, 10, 0, message: "Use CBManagerState instead")]
+ [Deprecated (PlatformName.iOS, 10, 0, message: "Use 'CBManagerState' instead.")]
+ [NoWatch]
[Native]
public enum CBPeripheralManagerState : nint {
Unknown = CBManagerState.Unknown,
@@ -55,16 +55,19 @@ public enum CBPeripheralManagerState : nint {
}
// NSInteger -> CBPeripheralManager.h
+ [Watch (4,0)]
[Native]
public enum CBPeripheralState : nint {
Disconnected,
Connecting,
Connected,
- Disconnecting
+ [iOS (9,0)][Mac (10,13)]
+ Disconnecting,
}
#if !XAMCORE_4_0
// NSInteger -> CBPeripheralManager.h
+ [Watch (4,0)]
[Native]
public enum CBPeripheralManagerAuthorizationStatus : nint {
NotDetermined,
@@ -75,6 +78,7 @@ public enum CBPeripheralManagerAuthorizationStatus : nint {
#endif
// NSUInteger -> CBCharacteristic.h
+ [Watch (4,0)]
[Flags]
[Native]
public enum CBCharacteristicProperties : nuint_compat_int {
@@ -86,10 +90,13 @@ public enum CBCharacteristicProperties : nuint_compat_int {
Indicate = 32,
AuthenticatedSignedWrites = 64,
ExtendedProperties = 128,
+ [Mac (10,9)]
NotifyEncryptionRequired = 0x100,
+ [Mac (10,9)]
IndicateEncryptionRequired = 0x200
}
+ [Watch (4,0)]
[ErrorDomain ("CBErrorDomain")]
[Native] // NSInteger -> CBError.h
public enum CBError : nint {
@@ -104,12 +111,15 @@ public enum CBError : nint {
PeripheralDisconnected,
UUIDNotAllowed,
AlreadyAdvertising,
- // iOS7.1
+ [iOS (7,1)][Mac (10,13)]
ConnectionFailed,
- // iOS 9
- ConnectionLimitReached
+ [iOS (9,0)][Mac (10,13)]
+ ConnectionLimitReached,
+ [iOS (11,0)][TV (11,0)][Mac (10,13)]
+ UnknownDevice,
}
+ [Watch (4,0)]
[ErrorDomain ("CBATTErrorDomain")]
[Native] // NSInteger -> CBError.h
public enum CBATTError : nint {
@@ -134,6 +144,7 @@ public enum CBATTError : nint {
}
// NSInteger -> CBPeripheral.h
+ [Watch (4,0)]
[Native]
public enum CBCharacteristicWriteType : nint {
WithResponse,
@@ -141,6 +152,8 @@ public enum CBCharacteristicWriteType : nint {
}
// NSUInteger -> CBCharacteristic.h
+ [Mac (10,9)]
+ [Watch (4,0)]
[Flags]
[Native]
public enum CBAttributePermissions : nuint_compat_int {
@@ -151,6 +164,7 @@ public enum CBAttributePermissions : nuint_compat_int {
}
// NSInteger -> CBPeripheralManager.h
+ [Watch (4,0)]
[Native]
public enum CBPeripheralManagerConnectionLatency : nint {
Low = 0,
diff --git a/src/CoreBluetooth/GuidWrapper.cs b/src/CoreBluetooth/GuidWrapper.cs
index ff98b6d7bc76..599496b8289d 100644
--- a/src/CoreBluetooth/GuidWrapper.cs
+++ b/src/CoreBluetooth/GuidWrapper.cs
@@ -58,8 +58,8 @@ public void ConnectPeripheral (CBPeripheral peripheral, PeripheralConnectionOpti
ConnectPeripheral (peripheral, options == null ? null : options.Dictionary);
}
-#if !TVOS
- [Availability (Introduced = Platform.iOS_5_0, Deprecated = Platform.iOS_7_0, Obsoleted = Platform.iOS_9_0, Message = "Use RetrievePeripheralsWithIdentifiers instead")]
+#if !TVOS && !WATCH
+ [Availability (Introduced = Platform.iOS_5_0, Deprecated = Platform.iOS_7_0, Obsoleted = Platform.iOS_9_0, Message = "Use 'RetrievePeripheralsWithIdentifiers' instead.")]
public void RetrievePeripherals (CBUUID [] peripheralUuids)
{
if (peripheralUuids == null)
@@ -83,19 +83,19 @@ public void RetrievePeripherals (CBUUID peripheralUuid)
#endif
#if !XAMCORE_2_0
- [Obsolete ("Use the CBUUID overload since Guid internal memory representation is different")]
+ [Obsolete ("Use the 'CBUUID' overload since Guid internal memory representation is different.")]
public void RetrievePeripherals (Guid [] peripheralUuids)
{
CFUUID.WithArray (peripheralUuids, "peripheralUuids", x => RetrievePeripherals (x));
}
- [Obsolete ("Use the CBUUID overload since Guid internal memory representation is different")]
+ [Obsolete ("Use the 'CBUUID' overload since Guid internal memory representation is different.")]
public void RetrievePeripherals (Guid peripheralUuid)
{
RetrievePeripherals (new [] { peripheralUuid });
}
- [Obsolete ("Use the CBUUID overload since Guid internal memory representation is different")]
+ [Obsolete ("Use the 'CBUUID' overload since Guid internal memory representation is different.")]
public void ScanForPeripherals (Guid [] serviceUuids, NSDictionary options)
{
if (serviceUuids == null)
@@ -104,25 +104,25 @@ public void ScanForPeripherals (Guid [] serviceUuids, NSDictionary options)
CFUUID.WithArray (serviceUuids, "serviceUuids", x => ScanForPeripherals (x, options));
}
- [Obsolete ("Use the CBUUID overload since Guid internal memory representation is different")]
+ [Obsolete ("Use the 'CBUUID' overload since Guid internal memory representation is different.")]
public void ScanForPeripherals (Guid[] serviceUuids, PeripheralScanningOptions options = null)
{
ScanForPeripherals (serviceUuids, options == null ? null : options.Dictionary);
}
- [Obsolete ("Use the CBUUID overload since Guid internal memory representation is different")]
+ [Obsolete ("Use the 'CBUUID' overload since Guid internal memory representation is different.")]
public void ScanForPeripherals (Guid [] serviceUuids)
{
ScanForPeripherals (serviceUuids, null as NSDictionary);
}
- [Obsolete ("Use the CBUUID overload since Guid internal memory representation is different")]
+ [Obsolete ("Use the 'CBUUID' overload since Guid internal memory representation is different.")]
public void ScanForPeripherals (Guid serviceUuid, NSDictionary options)
{
ScanForPeripherals (new [] { serviceUuid }, options);
}
- [Obsolete ("Use the CBUUID overload since Guid internal memory representation is different")]
+ [Obsolete ("Use the 'CBUUID' overload since Guid internal memory representation is different.")]
public void ScanForPeripherals (Guid serviceUuid)
{
ScanForPeripherals (new [] { serviceUuid }, null as NSDictionary);
diff --git a/src/CoreBluetooth/PeripheralConnectionOptions.cs b/src/CoreBluetooth/PeripheralConnectionOptions.cs
index 6622f3110304..1a6e4679780c 100644
--- a/src/CoreBluetooth/PeripheralConnectionOptions.cs
+++ b/src/CoreBluetooth/PeripheralConnectionOptions.cs
@@ -33,6 +33,7 @@
namespace XamCore.CoreBluetooth {
+ [Watch (4,0)]
public class PeripheralConnectionOptions : DictionaryContainer
{
#if !COREBUILD
diff --git a/src/CoreData/Enums.cs b/src/CoreData/Enums.cs
index 36a542259277..3b09557d5f6a 100644
--- a/src/CoreData/Enums.cs
+++ b/src/CoreData/Enums.cs
@@ -51,6 +51,10 @@ public enum NSAttributeType : nuint {
Boolean = 800,
Date = 900,
Binary = 1000,
+ [iOS (11,0), TV (11,0), Mac (10,13), Watch (4,0)]
+ Uuid = 1100,
+ [iOS (11,0), TV (11,0), Mac (10,13), Watch (4,0)]
+ Uri = 1200,
Transformable = 1800,
ObjectID = 2000
}
@@ -147,7 +151,9 @@ public enum ValidationErrorType : nuint {
InvalidDate = 1650,
StringTooLong = 1660,
StringTooShort = 1670,
- StringPatternMatching = 1680
+ StringPatternMatching = 1680,
+ [iOS (11,0), TV (11,0), Mac (10,13), Watch (4,0)]
+ InvalidUri = 1690,
}
[Native]
@@ -183,6 +189,37 @@ public enum MigrationErrorType {
MigrationManagerDestinationStore = 134160,
EntityMigrationPolicy = 134170,
InferredMappingModel = 134190,
- ExternalRecordImport = 134200
+ ExternalRecordImport = 134200,
+ [iOS (11,0), TV (11,0), Mac (10,3), Watch (4,0)]
+ HistoryTokenExpired = 134301,
+ }
+
+ [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
+ [Native]
+ public enum NSFetchIndexElementType : nuint
+ {
+ Binary,
+ RTree
+ }
+
+ [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
+ [Native]
+ public enum NSPersistentHistoryChangeType : nint
+ {
+ Insert,
+ Update,
+ Delete
+ }
+
+ [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
+ [Native]
+ public enum NSPersistentHistoryResultType : nint
+ {
+ StatusOnly = 0,
+ ObjectIds = 1,
+ Count = 2,
+ TransactionsOnly = 3,
+ ChangesOnly = 4,
+ TransactionsAndChanges = 5
}
}
diff --git a/src/CoreFoundation/CFStream.cs b/src/CoreFoundation/CFStream.cs
index 2ea4d1170443..1e4b6cda17b0 100644
--- a/src/CoreFoundation/CFStream.cs
+++ b/src/CoreFoundation/CFStream.cs
@@ -244,7 +244,7 @@ public static void CreatePairWithSocketToHost (string host, int port,
internal extern static /* CFReadStreamRef __nonnull */ IntPtr CFReadStreamCreateForHTTPRequest (
/* CFAllocatorRef __nullable */ IntPtr alloc, /* CFHTTPMessageRef __nonnull */ IntPtr request);
- [Availability (Deprecated = Platform.iOS_9_0 | Platform.Mac_10_11, Message = "Use NSUrlSession")]
+ [Availability (Deprecated = Platform.iOS_9_0 | Platform.Mac_10_11, Message = "Use 'NSUrlSession'.")]
public static CFHTTPStream CreateForHTTPRequest (CFHTTPMessage request)
{
if (request == null)
diff --git a/src/CoreGraphics/CGColorConverter.cs b/src/CoreGraphics/CGColorConverter.cs
index 3ee9cb913c58..6f9a3645e087 100644
--- a/src/CoreGraphics/CGColorConverter.cs
+++ b/src/CoreGraphics/CGColorConverter.cs
@@ -21,17 +21,17 @@
namespace XamCore.CoreGraphics {
// uint32_t enum -> CGColorConverter.h
- [TV (9,2)][Obsoleted (PlatformName.TvOS, 10,0, message: "Replaced by CGColorConversionInfoTransformType. This code does not work on tvOS 10+")]
- [iOS (9,3)][Obsoleted (PlatformName.iOS, 10,0, message: "Replaced by CGColorConversionInfoTransformType. This code does not work on iOS 10+")]
- [Obsolete ("Use CGColorConversionInfoTransformType")]
+ [TV (9,2)][Obsoleted (PlatformName.TvOS, 10,0, message: "Replaced by 'CGColorConversionInfoTransformType'.")]
+ [iOS (9,3)][Obsoleted (PlatformName.iOS, 10,0, message: "Replaced by 'CGColorConversionInfoTransformType'.")]
+ [Obsolete ("Use 'CGColorConversionInfoTransformType'.")]
public enum CGColorConverterTransformType : uint {
FromSpace,
ToSpace,
ApplySpace
}
- [TV (9,2)][Obsoleted (PlatformName.TvOS, 10,0, message: "Replaced by GColorConversionInfoTriple. This code does not work on tvOS 10+")]
- [iOS (9,3)][Obsoleted (PlatformName.iOS, 10,0, message: "Replaced by GColorConversionInfoTriple. This code does not work on iOS 10+")]
+ [TV (9,2)][Obsoleted (PlatformName.TvOS, 10,0, message: "Replaced by 'GColorConversionInfoTriple'.")]
+ [iOS (9,3)][Obsoleted (PlatformName.iOS, 10,0, message: "Replaced by 'GColorConversionInfoTriple'.")]
[StructLayout (LayoutKind.Sequential)]
public struct CGColorConverterTriple {
public CGColorSpace Space;
@@ -40,8 +40,8 @@ public struct CGColorConverterTriple {
}
// CGColorConverter.h
- [TV (9,2)][Obsoleted (PlatformName.TvOS, 10,0, message: "Replaced by CGColorConversionInfo. This code does not work on tvOS 10+")]
- [iOS (9,3)][Obsoleted (PlatformName.iOS, 10,0, message: "Replaced by CGColorConversionInfo. This code does not work on iOS 10+")]
+ [TV (9,2)][Obsoleted (PlatformName.TvOS, 10,0, message: "Replaced by 'CGColorConversionInfo'.")]
+ [iOS (9,3)][Obsoleted (PlatformName.iOS, 10,0, message: "Replaced by 'CGColorConversionInfo'.")]
public class CGColorConverter : INativeObject, IDisposable
{
/* invoked by marshallers */
diff --git a/src/CoreGraphics/CGColorSpace.cs b/src/CoreGraphics/CGColorSpace.cs
index 1534e137ab79..4f2994e4c2f0 100644
--- a/src/CoreGraphics/CGColorSpace.cs
+++ b/src/CoreGraphics/CGColorSpace.cs
@@ -66,7 +66,7 @@ public class CGColorSpace : INativeObject
internal IntPtr handle;
#if !XAMCORE_3_0
- [Obsolete ("Use a real `null` value instead of this managed wrapper over a null native instance")]
+ [Obsolete ("Use a real 'null' value instead of this managed wrapper over a null native instance.")]
#if XAMCORE_2_0
readonly
#endif
@@ -143,7 +143,7 @@ public static CGColorSpace CreateDeviceRGB ()
}
#if !XAMCORE_3_0
- [Obsolete ("This method has been renamed CreateDeviceCmyk()")]
+ [Obsolete ("This method has been renamed 'CreateDeviceCmyk'.")]
[EditorBrowsable (EditorBrowsableState.Never)]
public static /* CGColorSpaceRef */ CGColorSpace CreateDeviceCMYK ()
{
diff --git a/src/CoreGraphics/CGContext.cs b/src/CoreGraphics/CGContext.cs
index 170b14fbebfe..70cfc810de23 100644
--- a/src/CoreGraphics/CGContext.cs
+++ b/src/CoreGraphics/CGContext.cs
@@ -970,7 +970,7 @@ public void SetFontSize (nfloat size)
extern static void CGContextSelectFont (/* CGContextRef */ IntPtr c,
/* const char* __nullable */ string name, /* CGFloat */ nfloat size, CGTextEncoding textEncoding);
- [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the CoreText API instead")]
+ [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the 'CoreText' API instead.")]
public void SelectFont (string name, nfloat size, CGTextEncoding textEncoding)
{
CGContextSelectFont (handle, name, size, textEncoding);
@@ -1002,7 +1002,7 @@ public void ShowGlyphsAtPositions (ushort [] glyphs, CGPoint [] positions, int s
[DllImport (Constants.CoreGraphicsLibrary)]
extern static void CGContextShowText (/* CGContextRef */ IntPtr c, /* const char* __nullable */ string s, /* size_t */ nint length);
- [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the CoreText API instead")]
+ [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the 'CoreText' API instead.")]
public void ShowText (string str, int count)
{
if (str == null)
@@ -1012,7 +1012,7 @@ public void ShowText (string str, int count)
CGContextShowText (handle, str, count);
}
- [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the CoreText API instead")]
+ [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the 'CoreText' API instead.")]
public void ShowText (string str)
{
CGContextShowText (handle, str, str == null ? 0 : str.Length);
@@ -1021,7 +1021,7 @@ public void ShowText (string str)
[DllImport (Constants.CoreGraphicsLibrary)]
extern static void CGContextShowText (/* CGContextRef */ IntPtr c, /* const char* __nullable */ byte[] bytes, /* size_t */ nint length);
- [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the CoreText API instead")]
+ [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the 'CoreText' API instead.")]
public void ShowText (byte[] bytes, int count)
{
if (bytes == null)
@@ -1031,7 +1031,7 @@ public void ShowText (byte[] bytes, int count)
CGContextShowText (handle, bytes, count);
}
- [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the CoreText API instead")]
+ [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the 'CoreText' API instead.")]
public void ShowText (byte[] bytes)
{
CGContextShowText (handle, bytes, bytes == null ? 0 : bytes.Length);
@@ -1041,13 +1041,13 @@ public void ShowText (byte[] bytes)
extern static void CGContextShowTextAtPoint (/* CGContextRef __nullable */ IntPtr c, /* CGFloat */ nfloat x,
/* CGFloat */ nfloat y, /* const char* __nullable */ string str, /* size_t */ nint length);
- [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the CoreText API instead")]
+ [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the 'CoreText' API instead.")]
public void ShowTextAtPoint (nfloat x, nfloat y, string str, int length)
{
CGContextShowTextAtPoint (handle, x, y, str, length);
}
- [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the CoreText API instead")]
+ [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the 'CoreText' API instead.")]
public void ShowTextAtPoint (nfloat x, nfloat y, string str)
{
CGContextShowTextAtPoint (handle, x, y, str, str == null ? 0 : str.Length);
@@ -1070,13 +1070,13 @@ public void ShowTextAtPoint (nfloat x, nfloat y, byte[] bytes)
extern static void CGContextShowGlyphs (/* CGContextRef __nullable */ IntPtr c,
/* const CGGlyph * __nullable */ ushort [] glyphs, /* size_t */ nint count);
- [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the CoreText API instead")]
+ [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the 'CoreText' API instead.")]
public void ShowGlyphs (ushort [] glyphs)
{
CGContextShowGlyphs (handle, glyphs, glyphs == null ? 0 : glyphs.Length);
}
- [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the CoreText API instead")]
+ [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the 'CoreText' API instead.")]
public void ShowGlyphs (ushort [] glyphs, int count)
{
if (glyphs == null)
@@ -1090,7 +1090,7 @@ public void ShowGlyphs (ushort [] glyphs, int count)
extern static void CGContextShowGlyphsAtPoint (/* CGContextRef */ IntPtr context, /* CGFloat */ nfloat x,
/* CGFloat */ nfloat y, /* const CGGlyph * __nullable */ ushort [] glyphs, /* size_t */ nint count);
- [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the CoreText API instead")]
+ [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the 'CoreText' API instead.")]
public void ShowGlyphsAtPoint (nfloat x, nfloat y, ushort [] glyphs, int count)
{
if (glyphs == null)
@@ -1100,7 +1100,7 @@ public void ShowGlyphsAtPoint (nfloat x, nfloat y, ushort [] glyphs, int count)
CGContextShowGlyphsAtPoint (handle, x, y, glyphs, count);
}
- [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the CoreText API instead")]
+ [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the 'CoreText' API instead.")]
public void ShowGlyphsAtPoint (nfloat x, nfloat y, ushort [] glyphs)
{
CGContextShowGlyphsAtPoint (handle, x, y, glyphs, glyphs == null ? 0 : glyphs.Length);
@@ -1111,7 +1111,7 @@ extern static void CGContextShowGlyphsWithAdvances (/* CGContextRef __nullable *
/* const CGGlyph * __nullable */ ushort [] glyphs,
/* const CGSize * __nullable */ CGSize [] advances, /* size_t */ nint count);
- [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the CoreText API instead")]
+ [Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_9, Message = "Use the 'CoreText' API instead.")]
public void ShowGlyphsWithAdvances (ushort [] glyphs, CGSize [] advances, int count)
{
if (glyphs == null)
diff --git a/src/CoreGraphics/CGPDFOperatorTable.cs b/src/CoreGraphics/CGPDFOperatorTable.cs
index b0420adf8c20..9c21f6f891cb 100644
--- a/src/CoreGraphics/CGPDFOperatorTable.cs
+++ b/src/CoreGraphics/CGPDFOperatorTable.cs
@@ -92,7 +92,7 @@ public void SetCallback (string name, Action callback)
}));
}
- [Advice ("Use the nicer SetCallback(string,Action) API when possible (OSX)")]
+ [Advice ("Use the nicer SetCallback(string,Action) API when possible.")]
#endif
// this API is ugly - but I do not see a better way with the AOT limitation
public void SetCallback (string name, Action callback)
diff --git a/src/CoreImage/CIFilter.cs b/src/CoreImage/CIFilter.cs
index f6872048c952..df6245ed98f3 100644
--- a/src/CoreImage/CIFilter.cs
+++ b/src/CoreImage/CIFilter.cs
@@ -643,7 +643,7 @@ bool SupportsInputImage {
}
#if MONOMAC && !XAMCORE_3_0
- [Obsolete ("This type has been renamed to CICmykHalftone")]
+ [Obsolete ("This type has been renamed to CICmykHalftone.")]
public class CICMYKHalftone : CICmykHalftone {
public CICMYKHalftone () {}
public CICMYKHalftone (IntPtr handle) : base (handle) {}
diff --git a/src/CoreImage/Enums.cs b/src/CoreImage/Enums.cs
index 7349c7d45056..0694bfa1e562 100644
--- a/src/CoreImage/Enums.cs
+++ b/src/CoreImage/Enums.cs
@@ -22,6 +22,7 @@
//
using System;
+using XamCore.ObjCRuntime;
namespace XamCore.CoreImage {
@@ -44,14 +45,14 @@ public enum CIFormat {
RGBAh = 1,
#if MONOMAC
RGBA16 = 2,
- [Obsolete ("This value can not be shared across Mac/iOS binaries, future proof with kRGBAf instead")]
+ [Obsolete ("This value can not be shared across Mac/iOS binaries, future proof with kRGBAf instead.")]
RGBAf = 3,
// Please, do not add values into MonoMac/iOS without adding an explicit value
#elif !XAMCORE_3_0
- [Obsolete ("This value can not be shared across Mac/iOS binaries, future proof with kBGRA8 instead")]
+ [Obsolete ("This value can not be shared across Mac/iOS binaries, future proof with kBGRA8 instead.")]
BGRA8 = 2 ,
- [Obsolete ("This value can not be shared across Mac/iOS binaries, future proof with kRGBA8 instead")]
+ [Obsolete ("This value can not be shared across Mac/iOS binaries, future proof with kRGBA8 instead.")]
RGBA8 = 3,
// Please, do not add values into MonoMac/iOS without adding an explicit value
#endif
@@ -72,4 +73,38 @@ public enum CIFormat {
RGh = 21,
RGf = 22
}
+
+ [iOS (11,0)]
+ [Mac (10,13)]
+ [TV (11,0)]
+ [Native]
+ public enum CIQRCodeErrorCorrectionLevel : nint {
+ L = 76,
+ M = 77,
+ Q = 81,
+ H = 72,
+ }
+
+ [iOS (11,0)]
+ [Mac (10,13)]
+ [TV (11,0)]
+ [Native]
+ public enum CIDataMatrixCodeEccVersion : nint {
+ V000 = 0,
+ V050 = 50,
+ V080 = 80,
+ V100 = 100,
+ V140 = 140,
+ V200 = 200,
+ }
+
+ [iOS (11,0)]
+ [Mac (10,13)]
+ [TV (11,0)]
+ [Native]
+ public enum CIRenderDestinationAlphaMode : nuint {
+ None = 0,
+ Premultiplied = 1,
+ Unpremultiplied = 2,
+ }
}
diff --git a/src/CoreLocation/CLCompat.cs b/src/CoreLocation/CLCompat.cs
index 6b7473be9f0f..ecd3af01fbde 100644
--- a/src/CoreLocation/CLCompat.cs
+++ b/src/CoreLocation/CLCompat.cs
@@ -8,7 +8,7 @@ namespace XamCore.CoreLocation {
#if !XAMCORE_2_0
public partial class CLBeaconRegion {
- [Obsolete ("Does not return a valid instance on iOS8")]
+ [Obsolete ("Does not return a valid instance on iOS 8.")]
public CLBeaconRegion ()
{
}
@@ -20,7 +20,7 @@ public CLBeaconRegion ()
#if !TVOS
public partial class CLHeading {
- [Obsolete ("Use the Description property from NSObject")]
+ [Obsolete ("Use the 'Description' property from 'NSObject'.")]
public new virtual string Description ()
{
return base.Description;
@@ -30,7 +30,7 @@ public partial class CLHeading {
public partial class CLLocation {
- [Obsolete ("Use the Description property from NSObject")]
+ [Obsolete ("Use the 'Description' property from 'NSObject'.")]
public new virtual string Description ()
{
return base.Description;
diff --git a/src/CoreLocation/CLEnums.cs b/src/CoreLocation/CLEnums.cs
index 2def304da7af..44b36dd4e5a6 100644
--- a/src/CoreLocation/CLEnums.cs
+++ b/src/CoreLocation/CLEnums.cs
@@ -87,7 +87,7 @@ public enum CLAuthorizationStatus : uint_compat_int {
Restricted,
Denied,
- [Availability (Deprecated = Platform.iOS_8_0, Message = "Use AuthorizedAlways instead")]
+ [Availability (Deprecated = Platform.iOS_8_0, Message = "Use 'AuthorizedAlways' instead.")]
Authorized,
AuthorizedAlways = Authorized,
AuthorizedWhenInUse
diff --git a/src/CoreML/MLDictionaryFeatureProvider.cs b/src/CoreML/MLDictionaryFeatureProvider.cs
new file mode 100644
index 000000000000..b426a8d4395a
--- /dev/null
+++ b/src/CoreML/MLDictionaryFeatureProvider.cs
@@ -0,0 +1,25 @@
+//
+// MLDictionaryFeatureProvider.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0
+
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.CoreML {
+ public partial class MLDictionaryFeatureProvider {
+
+ [Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
+ public MLFeatureValue this [string featureName] {
+ get { return GetFeatureValue (featureName); }
+ }
+ }
+}
+#endif
diff --git a/src/CoreML/MLMultiArray.cs b/src/CoreML/MLMultiArray.cs
new file mode 100644
index 000000000000..650689f1ad0d
--- /dev/null
+++ b/src/CoreML/MLMultiArray.cs
@@ -0,0 +1,91 @@
+//
+// MLMultiArray.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0
+
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.CoreML {
+ public partial class MLMultiArray {
+ static NSNumber[] ConvertArray (nint[] value)
+ {
+ if (value == null)
+ return null;
+
+ return Array.ConvertAll (value, NSNumber.FromNInt);
+ }
+
+ // NSArray => nint[]
+ internal static nint[] ConvertArray (IntPtr handle)
+ {
+ return NSArray.ArrayFromHandle (handle, (v) => Messaging.nint_objc_msgSend (v, Selector.GetHandle ("integerValue")));
+ }
+
+ [Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
+ public MLMultiArray (nint [] shape, MLMultiArrayDataType dataType, out NSError error)
+ : this (ConvertArray (shape), dataType, out error)
+ {
+ }
+
+ [Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
+ public MLMultiArray (IntPtr dataPointer, nint [] shape, MLMultiArrayDataType dataType, nint [] strides, Action deallocator, out NSError error)
+ : this (dataPointer, ConvertArray (shape), dataType, ConvertArray (strides), deallocator, out error)
+ {
+ }
+
+ [Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
+ public NSNumber this [nint idx] {
+ get { return GetObject (idx); }
+ set { SetObject (value, idx); }
+ }
+
+ [Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
+ public NSNumber this [params nint[] indices] {
+ get { return GetObject (indices); }
+ set { SetObject (value, indices); }
+ }
+
+ [Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
+ public NSNumber this [NSNumber [] key] {
+ get { return GetObject (key); }
+ set { SetObject (value, key); }
+ }
+
+ [Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
+ public NSNumber GetObject (params nint[] indices)
+ {
+ using (var arr = NSArray.FromNSObjects (NSNumber.FromNInt, indices))
+ return GetObject (arr.GetHandle ());
+ }
+
+ [Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
+ public void SetObject (NSNumber obj, params nint[] indices)
+ {
+ using (var arr = NSArray.FromNSObjects (NSNumber.FromNInt, indices))
+ SetObject (obj, arr.GetHandle ());
+ }
+
+ [Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
+ public nint[] Shape {
+ get {
+ return ConvertArray (_Shape);
+ }
+ }
+
+ [Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
+ public nint[] Strides {
+ get {
+ return ConvertArray (_Strides);
+ }
+ }
+ }
+}
+#endif
diff --git a/src/CoreML/MLMultiArrayConstraint.cs b/src/CoreML/MLMultiArrayConstraint.cs
new file mode 100644
index 000000000000..d8c3a3613ac0
--- /dev/null
+++ b/src/CoreML/MLMultiArrayConstraint.cs
@@ -0,0 +1,25 @@
+//
+// MLMultiArrayConstraint.cs
+//
+// Authors:
+// Rolf Bjarne Kvinge
+//
+// Copyright 2017 Microsoft Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0
+
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.CoreML {
+ public partial class MLMultiArrayConstraint {
+ public nint[] Shape {
+ get {
+ return MLMultiArray.ConvertArray (_Shape);
+ }
+ }
+ }
+}
+#endif
diff --git a/src/CoreMedia/CMAttachmentBearer.cs b/src/CoreMedia/CMAttachmentBearer.cs
index 68ca48e213b5..428899145e80 100644
--- a/src/CoreMedia/CMAttachmentBearer.cs
+++ b/src/CoreMedia/CMAttachmentBearer.cs
@@ -28,6 +28,23 @@ public static NSDictionary GetAttachments (this ICMAttachmentBearer target, CMAt
return Runtime.GetNSObject (attachments, true);
}
+#if XAMCORE_2_0
+ // There is some API that needs a more strongly typed version of a NSDictionary
+ // and there is no easy way to downcast from NSDictionary to NSDictionary
+ public static NSDictionary GetAttachments (this ICMAttachmentBearer target, CMAttachmentMode attachmentMode)
+ where TKey : class, INativeObject
+ where TValue : class, INativeObject
+ {
+ if (target == null)
+ throw new ArgumentNullException (nameof (target));
+ var attachments = CMCopyDictionaryOfAttachments (IntPtr.Zero, target.Handle, attachmentMode);
+ if (attachments == IntPtr.Zero)
+ return null;
+
+ return Runtime.GetNSObject> (attachments, true);
+ }
+#endif
+
[DllImport(Constants.CoreMediaLibrary)]
extern static /* CFTypeRef */ IntPtr CMGetAttachment (/* CMAttachmentBearerRef */ IntPtr target, /* CFStringRef */ IntPtr key,
/* CMAttachmentMode */ out CMAttachmentMode attachmentModeOut);
diff --git a/src/CoreMedia/CMSync.cs b/src/CoreMedia/CMSync.cs
index 482751c38d94..f5972bcd80d5 100644
--- a/src/CoreMedia/CMSync.cs
+++ b/src/CoreMedia/CMSync.cs
@@ -212,7 +212,7 @@ public double Rate {
[DllImport(Constants.CoreMediaLibrary)]
extern static /* CMTimebaseRef */ IntPtr CMTimebaseGetMasterTimebase (/* CMTimebaseRef */ IntPtr timebase);
- [Availability (Introduced = Platform.iOS_6_0 | Platform.Mac_10_8, Deprecated = Platform.iOS_9_0 | Platform.Mac_10_11, Message="Please use CopyMasterTimebase")]
+ [Availability (Introduced = Platform.iOS_6_0 | Platform.Mac_10_8, Deprecated = Platform.iOS_9_0 | Platform.Mac_10_11, Message="Use 'CopyMasterTimebase' instead.")]
public CMTimebase GetMasterTimebase ()
{
var ptr = CMTimebaseGetMasterTimebase (Handle);
@@ -225,7 +225,7 @@ public CMTimebase GetMasterTimebase ()
[DllImport(Constants.CoreMediaLibrary)]
extern static /* CMClockRef */ IntPtr CMTimebaseGetMasterClock (/* CMTimebaseRef */ IntPtr timebase);
- [Availability (Introduced = Platform.iOS_6_0 | Platform.Mac_10_8, Deprecated = Platform.iOS_9_0 | Platform.Mac_10_11, Message="Please use CopyMasterClock")]
+ [Availability (Introduced = Platform.iOS_6_0 | Platform.Mac_10_8, Deprecated = Platform.iOS_9_0 | Platform.Mac_10_11, Message="Use 'CopyMasterClock' instead.")]
public CMClock GetMasterClock ()
{
var ptr = CMTimebaseGetMasterClock (Handle);
@@ -238,7 +238,7 @@ public CMClock GetMasterClock ()
[DllImport(Constants.CoreMediaLibrary)]
extern static /* CMClockOrTimebaseRef */ IntPtr CMTimebaseGetMaster (/* CMTimebaseRef */ IntPtr timebase);
- [Availability (Introduced = Platform.iOS_6_0 | Platform.Mac_10_8, Deprecated = Platform.iOS_9_0 | Platform.Mac_10_11, Message="Please use CopyMaster")]
+ [Availability (Introduced = Platform.iOS_6_0 | Platform.Mac_10_8, Deprecated = Platform.iOS_9_0 | Platform.Mac_10_11, Message="Use 'CopyMaster' instead.")]
public CMClockOrTimebase GetMaster ()
{
var ptr = CMTimebaseGetMaster (Handle);
@@ -251,7 +251,7 @@ public CMClockOrTimebase GetMaster ()
[DllImport(Constants.CoreMediaLibrary)]
extern static /* CMClockRef */ IntPtr CMTimebaseGetUltimateMasterClock (/* CMTimebaseRef */ IntPtr timebase);
- [Availability (Introduced = Platform.iOS_6_0 | Platform.Mac_10_8, Deprecated = Platform.iOS_9_0 | Platform.Mac_10_11, Message="Please use CopyUltimateMasterClock")]
+ [Availability (Introduced = Platform.iOS_6_0 | Platform.Mac_10_8, Deprecated = Platform.iOS_9_0 | Platform.Mac_10_11, Message="Use 'CopyUltimateMasterClock' instead.")]
public CMClock GetUltimateMasterClock ()
{
var ptr = CMTimebaseGetUltimateMasterClock (Handle);
diff --git a/src/CoreMedia/CoreMedia.cs b/src/CoreMedia/CoreMedia.cs
index 88dd775eba91..54382224bd47 100644
--- a/src/CoreMedia/CoreMedia.cs
+++ b/src/CoreMedia/CoreMedia.cs
@@ -104,7 +104,7 @@ public struct CMTimeRange {
public static readonly CMTimeRange Zero;
#if !XAMCORE_3_0
- [Obsolete ("Use InvalidRange")]
+ [Obsolete ("Use 'InvalidRange'.")]
public static readonly CMTimeRange Invalid;
#endif
public static readonly CMTimeRange InvalidRange;
diff --git a/src/CoreMotion/CMCompat.cs b/src/CoreMotion/CMCompat.cs
index 4ce59806016d..a99ca4679344 100644
--- a/src/CoreMotion/CMCompat.cs
+++ b/src/CoreMotion/CMCompat.cs
@@ -9,7 +9,7 @@ namespace XamCore.CoreMotion {
public partial class CMSensorRecorder {
- [Obsolete ("Apple removed this API in iOS 9.3")]
+ [Obsolete ("Apple removed this API in iOS 9.3.")]
public virtual CMSensorDataList GetAccelerometerDataSince (ulong identifier)
{
return null;
diff --git a/src/CoreSpotlight/CSSearchableItemAttributeSet.cs b/src/CoreSpotlight/CSSearchableItemAttributeSet.cs
index f761e94e0c2a..807861c077ea 100644
--- a/src/CoreSpotlight/CSSearchableItemAttributeSet.cs
+++ b/src/CoreSpotlight/CSSearchableItemAttributeSet.cs
@@ -4,6 +4,7 @@
using System;
using XamCore.Foundation;
+using XamCore.ObjCRuntime;
namespace XamCore.CoreSpotlight {
@@ -17,6 +18,34 @@ public INSSecureCoding this [CSCustomAttributeKey key] {
SetValue (value, key);
}
}
+
+ // Manually deal with these properties until we get BindAs working
+ [iOS (11,0), NoTV, Mac (10, 11)]
+ public bool? IsUserCreated {
+ get {
+ return _IsUserCreated?.BoolValue;
+ } set {
+ _IsUserCreated = value.HasValue ? new NSNumber (value.Value) : null;
+ }
+ }
+
+ [iOS (11, 0), NoTV, Mac (10, 11)]
+ public bool? IsUserOwned {
+ get {
+ return _IsUserOwned?.BoolValue;
+ } set {
+ _IsUserOwned = value.HasValue ? new NSNumber (value.Value) : null;
+ }
+ }
+
+ [iOS (11, 0), NoTV, Mac (10, 11)]
+ public bool? IsUserCurated {
+ get {
+ return _IsUserCurated?.BoolValue;
+ } set {
+ _IsUserCurated = value.HasValue ? new NSNumber (value.Value) : null;
+ }
+ }
}
}
diff --git a/src/CoreText/CTFont.cs b/src/CoreText/CTFont.cs
index 298d9ad993ee..911f342c2831 100644
--- a/src/CoreText/CTFont.cs
+++ b/src/CoreText/CTFont.cs
@@ -2191,7 +2191,7 @@ public CTFontDescriptor [] GetDefaultCascadeList (string [] languages)
var ret = new CTFontDescriptor [n];
for (nint i = 0; i < n; i++)
- ret [i] = new CTFontDescriptor (retArray.GetValue (i), true);
+ ret [i] = new CTFontDescriptor (retArray.GetValue (i), false);
return ret;
}
diff --git a/src/CoreText/CTFontManager.cs b/src/CoreText/CTFontManager.cs
index e1ece334be36..5c23e28105cd 100644
--- a/src/CoreText/CTFontManager.cs
+++ b/src/CoreText/CTFontManager.cs
@@ -64,7 +64,7 @@ public static bool IsFontSupported (NSUrl url)
return CTFontManagerIsSupportedFont (url.Handle);
}
#elif !XAMCORE_3_0
- [Obsolete ("API not available on iOS, it will always return false")]
+ [Obsolete ("API not available on iOS, it will always return false.")]
[Availability (Deprecated = Platform.Mac_10_6, Unavailable = Platform.iOS_Version)]
public static bool IsFontSupported (NSUrl url)
{
diff --git a/src/CoreVideo/CVBuffer.cs b/src/CoreVideo/CVBuffer.cs
index bb905d0e1e3e..6925166e7345 100644
--- a/src/CoreVideo/CVBuffer.cs
+++ b/src/CoreVideo/CVBuffer.cs
@@ -34,6 +34,7 @@
namespace XamCore.CoreVideo {
// CVBuffer.h
+ [Watch (4,0)]
[iOS (4,0)]
public partial class CVBuffer : INativeObject
#if !COREBUILD
@@ -166,6 +167,17 @@ public NSDictionary GetAttachments (CVAttachmentMode attachmentMode)
return (NSDictionary) Runtime.GetNSObject (CVBufferGetAttachments (handle, attachmentMode));
}
+#if XAMCORE_2_0
+ // There is some API that needs a more strongly typed version of a NSDictionary
+ // and there is no easy way to downcast from NSDictionary to NSDictionary
+ public NSDictionary GetAttachments (CVAttachmentMode attachmentMode)
+ where TKey : class, INativeObject
+ where TValue : class, INativeObject
+ {
+ return Runtime.GetNSObject> (CVBufferGetAttachments (handle, attachmentMode));
+ }
+#endif
+
[DllImport (Constants.CoreVideoLibrary)]
extern static void CVBufferPropagateAttachments (/* CVBufferRef */ IntPtr sourceBuffer, /* CVBufferRef */ IntPtr destinationBuffer);
diff --git a/src/CoreVideo/CVImageBuffer.cs b/src/CoreVideo/CVImageBuffer.cs
index 185e9977d756..357ac4907ebf 100644
--- a/src/CoreVideo/CVImageBuffer.cs
+++ b/src/CoreVideo/CVImageBuffer.cs
@@ -36,6 +36,7 @@ namespace XamCore.CoreVideo {
// CVImageBuffer.h
[iOS (4,0)]
+ [Watch (4,0)]
public partial class CVImageBuffer : CVBuffer {
#if !COREBUILD
#if !XAMCORE_2_0
diff --git a/src/CoreVideo/CVOpenGLESTexture.cs b/src/CoreVideo/CVOpenGLESTexture.cs
index 2748e8a97010..4d75f8ad1553 100644
--- a/src/CoreVideo/CVOpenGLESTexture.cs
+++ b/src/CoreVideo/CVOpenGLESTexture.cs
@@ -7,6 +7,9 @@
// Copyright 2012-2015 Xamarin Inc
//
//
+
+#if !WATCH
+
using System;
using System.Runtime.InteropServices;
@@ -133,3 +136,5 @@ public void GetCleanTexCoords (out float [] lowerLeft, out float [] lowerRight,
}
}
+
+#endif
diff --git a/src/CoreVideo/CVOpenGLESTextureCache.cs b/src/CoreVideo/CVOpenGLESTextureCache.cs
index 09c0ab0f7212..0452f931624e 100644
--- a/src/CoreVideo/CVOpenGLESTextureCache.cs
+++ b/src/CoreVideo/CVOpenGLESTextureCache.cs
@@ -7,6 +7,9 @@
// Copyright 2012-2015 Xamarin Inc
//
//
+
+#if !WATCH
+
using System;
using System.Runtime.InteropServices;
@@ -155,3 +158,5 @@ extern static CVReturn CVOpenGLESTextureCacheCreateTextureFromImage (
/* CVOpenGLESTextureRef __nullable * __nonnull */ out IntPtr textureOut);
}
}
+
+#endif
diff --git a/src/CoreVideo/CVPixelBuffer.cs b/src/CoreVideo/CVPixelBuffer.cs
index 66a1a1ab7db8..8fc24b5bf1e7 100644
--- a/src/CoreVideo/CVPixelBuffer.cs
+++ b/src/CoreVideo/CVPixelBuffer.cs
@@ -14,6 +14,7 @@
namespace XamCore.CoreVideo {
+ [Watch (4,0)]
[iOS (4,0)]
public partial class CVPixelBuffer : CVImageBuffer {
#if !COREBUILD
@@ -454,7 +455,7 @@ extern static CVReturn CVPixelBufferLockBaseAddress (
/* CVPixelBufferRef __nonnull */ IntPtr pixelBuffer, CVPixelBufferLock lockFlags);
#if !XAMCORE_3_0
- [Obsolete ("Use Lock(CVPixelBufferLock) instead")]
+ [Obsolete ("Use 'Lock (CVPixelBufferLock)' instead.")]
public CVReturn Lock (CVOptionFlags lockFlags)
{
return CVPixelBufferLockBaseAddress (handle, (CVPixelBufferLock) lockFlags);
@@ -471,7 +472,7 @@ extern static CVReturn CVPixelBufferUnlockBaseAddress (
/* CVPixelBufferRef __nonnull */ IntPtr pixelBuffer, CVPixelBufferLock unlockFlags);
#if !XAMCORE_3_0
- [Obsolete ("Use Unlock(CVPixelBufferLock)")]
+ [Obsolete ("Use 'Unlock (CVPixelBufferLock)'.")]
public CVReturn Unlock (CVOptionFlags unlockFlags)
{
return CVPixelBufferUnlockBaseAddress (handle, (CVPixelBufferLock) unlockFlags);
diff --git a/src/CoreVideo/CVPixelBufferAttributes.cs b/src/CoreVideo/CVPixelBufferAttributes.cs
index 2686072103eb..45c0cbe2962b 100644
--- a/src/CoreVideo/CVPixelBufferAttributes.cs
+++ b/src/CoreVideo/CVPixelBufferAttributes.cs
@@ -32,6 +32,7 @@
namespace XamCore.CoreVideo {
+ [Watch (4,0)]
[iOS (6,0)]
public class CVPixelBufferAttributes : DictionaryContainer
{
@@ -192,7 +193,8 @@ public bool? AllocateWithIOSurface {
return GetNSDictionary (CVPixelBuffer.IOSurfacePropertiesKey) != null;
}
}
-
+
+#if !WATCH
[iOS (6,0)]
public bool? OpenGLESCompatibility {
set {
@@ -212,6 +214,7 @@ public bool? MetalCompatibility {
return GetBoolValue (CVPixelBuffer.MetalCompatibilityKey);
}
}
+#endif // !WATCH
#endif
#endif
}
diff --git a/src/CoreVideo/CVPixelBufferPool.cs b/src/CoreVideo/CVPixelBufferPool.cs
index 52160ad09a0a..eabf107c9a66 100644
--- a/src/CoreVideo/CVPixelBufferPool.cs
+++ b/src/CoreVideo/CVPixelBufferPool.cs
@@ -16,6 +16,7 @@
namespace XamCore.CoreVideo {
// CVPixelBufferPool.h
+ [Watch (4,0)]
[iOS (4,0)]
public partial class CVPixelBufferPool : INativeObject
#if !COREBUILD
diff --git a/src/CoreVideo/CVPixelBufferPoolSettings.cs b/src/CoreVideo/CVPixelBufferPoolSettings.cs
index a715bf934e7d..382a3c0e345c 100644
--- a/src/CoreVideo/CVPixelBufferPoolSettings.cs
+++ b/src/CoreVideo/CVPixelBufferPoolSettings.cs
@@ -33,6 +33,7 @@
namespace XamCore.CoreVideo {
+ [Watch (4,0)]
public class CVPixelBufferPoolSettings : DictionaryContainer
{
#if !COREBUILD
@@ -66,6 +67,7 @@ public double? MaximumBufferAgeInSeconds {
#endif
}
+ [Watch (4,0)]
public partial class CVPixelBufferPoolAllocationSettings : DictionaryContainer {
#if !COREBUILD
public CVPixelBufferPoolAllocationSettings ()
diff --git a/src/CoreVideo/CVPixelFormatDescription.cs b/src/CoreVideo/CVPixelFormatDescription.cs
index bdd61b5a534b..1fb3d3edffa0 100644
--- a/src/CoreVideo/CVPixelFormatDescription.cs
+++ b/src/CoreVideo/CVPixelFormatDescription.cs
@@ -33,6 +33,7 @@
namespace XamCore.CoreVideo {
+ [Watch (4,0)]
[iOS (4,0)]
public static class CVPixelFormatDescription {
#if !COREBUILD
diff --git a/src/CoreVideo/CVTime.cs b/src/CoreVideo/CVTime.cs
index 36a71763e2b4..6f5f5de02aad 100644
--- a/src/CoreVideo/CVTime.cs
+++ b/src/CoreVideo/CVTime.cs
@@ -33,6 +33,7 @@
namespace XamCore.CoreVideo {
// CVBase.h
+ [Watch (4,0)]
public struct CVTime {
public /* int64_t */ long TimeValue;
diff --git a/src/CoreVideo/CoreVideo.cs b/src/CoreVideo/CoreVideo.cs
index 773e730ad880..1d617251db58 100644
--- a/src/CoreVideo/CoreVideo.cs
+++ b/src/CoreVideo/CoreVideo.cs
@@ -33,12 +33,14 @@
namespace XamCore.CoreVideo {
// uint32_t -> CVBuffer.h
+ [Watch (4,0)]
public enum CVAttachmentMode : uint {
ShouldNotPropagate = 0,
ShouldPropagate = 1,
}
[Flags]
+ [Watch (4,0)]
#if XAMCORE_4_0
public enum CVPixelBufferLock : ulong {
#else
@@ -51,29 +53,34 @@ public enum CVPixelBufferLock : uint_compat_int {
}
// CVPixelBuffer.h
+ [Watch (4,0)]
public struct CVPlanarComponentInfo {
public /* int32_t */ int Offset;
public /* uint32_t */ uint RowBytes;
}
// CVPixelBuffer.h
+ [Watch (4,0)]
public struct CVPlanarPixelBufferInfo {
public CVPlanarComponentInfo[] ComponentInfo;
}
// CVPixelBuffer.h
+ [Watch (4,0)]
public struct CVPlanarPixelBufferInfo_YCbCrPlanar {
public CVPlanarComponentInfo ComponentInfoY;
public CVPlanarComponentInfo ComponentInfoCb;
public CVPlanarComponentInfo ComponentInfoCr;
}
+ [Watch (4,0)]
public struct CVPlanarPixelBufferInfo_YCbCrBiPlanar {
public CVPlanarComponentInfo ComponentInfoY;
public CVPlanarComponentInfo ComponentInfoCbCr;
}
// int32_t -> CVReturn.h
+ [Watch (4,0)]
public enum CVReturn : int {
Success = 0,
First = -6660,
@@ -99,10 +106,12 @@ public enum CVReturn : int {
// uint64_t -> CVBase.h
+ [Watch (4,0)]
public enum CVOptionFlags : long {
None = 0,
}
+ [Watch (4,0)]
public struct CVTimeStamp {
public UInt32 Version;
public Int32 VideoTimeScale;
@@ -115,6 +124,7 @@ public struct CVTimeStamp {
public UInt64 Reserved;
}
+ [Watch (4,0)]
public struct CVSMPTETime {
public Int16 Subframes;
public Int16 SubframeDivisor;
@@ -128,11 +138,13 @@ public struct CVSMPTETime {
}
[Flags]
+ [Watch (4,0)]
public enum CVTimeFlags : int {
IsIndefinite = 1 << 0
}
[Flags]
+ [Watch (4,0)]
#if XAMCORE_2_0
public enum CVTimeStampFlags : ulong {
#else
@@ -150,11 +162,13 @@ public enum CVTimeStampFlags {
}
[Flags]
+ [Watch (4,0)]
public enum CVSMPTETimeFlags : uint_compat_int {
Valid = (1 << 0),
Running = (1 << 1)
}
+ [Watch (4,0)]
public enum CVSMPTETimeType : uint_compat_int {
Type24 = 0,
Type25 = 1,
@@ -166,15 +180,18 @@ public enum CVSMPTETimeType : uint_compat_int {
Type5994 = 7
}
+ [Watch (4,0)]
public struct CVFillExtendedPixelsCallBackData {
public nint /* CFIndex */ Version;
public CVFillExtendedPixelsCallBack FillCallBack;
public IntPtr UserInfo;
}
+ [Watch (4,0)]
public delegate bool CVFillExtendedPixelsCallBack (IntPtr pixelBuffer, IntPtr refCon);
// CVOptionFlags (uint64_t) -> CVPixelBufferPool.h
+ [Watch (4,0)]
[iOS (9,0)][Mac (10,11)]
public enum CVPixelBufferPoolFlushFlags : ulong {
FlushExcessBuffers = 1,
diff --git a/src/CoreWlan/CWInterface.cs b/src/CoreWlan/CWInterface.cs
index 8f330c5906e7..1fd6e7b6b248 100644
--- a/src/CoreWlan/CWInterface.cs
+++ b/src/CoreWlan/CWInterface.cs
@@ -49,5 +49,24 @@ public CWNetwork [] ScanForNetworksWithName (string networkName, out NSError err
return networks.ToArray ();
return null;
}
+
+ [Mac (10,13)]
+ public CWNetwork [] ScanForNetworksWithSsid (NSData ssid, bool includeHidden, out NSError error)
+ {
+ NSSet networks = _ScanForNetworksWithSsid (ssid, includeHidden, out error);
+ if (networks != null)
+ return networks.ToArray ();
+ return null;
+ }
+
+ [Mac (10,13)]
+ public CWNetwork [] ScanForNetworksWithName (string networkName, bool includeHidden, out NSError error)
+ {
+ NSSet networks = _ScanForNetworksWithName (networkName, includeHidden, out error);
+ if (networks != null)
+ return networks.ToArray ();
+ return null;
+ }
+
}
}
diff --git a/src/EventKit/EKEnums.cs b/src/EventKit/EKEnums.cs
index 81336520f056..b15ec7c2e1f8 100644
--- a/src/EventKit/EKEnums.cs
+++ b/src/EventKit/EKEnums.cs
@@ -79,7 +79,7 @@ public enum EKErrorCode : nint {
// untyped enum -> EKTypes.h
// Special note: some API (like `dayOfWeek:` and `dayOfWeek:weekNumber:` use an `NSInteger` instead of the enum
- [Availability (Deprecated = Platform.iOS_9_0 | Platform.Mac_10_11, Message = "Use EKWeekday")]
+ [Availability (Deprecated = Platform.iOS_9_0 | Platform.Mac_10_11, Message = "Use 'EKWeekday'.")]
public enum EKDay {
NotSet = 0,
Sunday = 1,
diff --git a/src/EventKit/EventKit.cs b/src/EventKit/EventKit.cs
index 3c4553aa4146..cb6b4e93773a 100644
--- a/src/EventKit/EventKit.cs
+++ b/src/EventKit/EventKit.cs
@@ -72,6 +72,13 @@ public virtual EKRecurrenceRule RecurrenceRule {
get { throw new NotSupportedException (); }
set { throw new NotSupportedException (); }
}
+#endif
+ }
+
+ partial class EKAlarm {
+#if !XAMCORE_4_0
+ [Obsolete ("Use the static methods FromDate or FromTimeInterval to create alarms")]
+ public EKAlarm () {}
#endif
}
}
diff --git a/src/EventKitUI/EKUIBundle.cs b/src/EventKitUI/EKUIBundle.cs
new file mode 100644
index 000000000000..e4fb93a21b61
--- /dev/null
+++ b/src/EventKitUI/EKUIBundle.cs
@@ -0,0 +1,27 @@
+//
+// EventKitUIBundle C# bindings
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0
+using System;
+using System.Runtime.InteropServices;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.EventKitUI {
+ public static class EKUIBundle {
+
+ [iOS (11,0)]
+ [DllImport (Constants.EventKitUILibrary)]
+ static extern IntPtr EventKitUIBundle ();
+
+ [iOS (11,0)]
+ public static NSBundle UIBundle { get; } = Runtime.GetNSObject (EventKitUIBundle ());
+ }
+}
+#endif
diff --git a/src/ExternalAccessory/EAEnums.cs b/src/ExternalAccessory/EAEnums.cs
index 19cbcebc6816..bf22376b3fa9 100644
--- a/src/ExternalAccessory/EAEnums.cs
+++ b/src/ExternalAccessory/EAEnums.cs
@@ -9,6 +9,7 @@
namespace XamCore.ExternalAccessory {
+ [NoMac]
[TV (10,0)]
[iOS (8,0)]
[Native]
@@ -19,6 +20,7 @@ public enum EAWiFiUnconfiguredAccessoryProperties : nuint {
SupportsHomeKit = (1 << 2), // iOS 8 beta 5
}
+ [NoMac]
[TV (10,0)]
[iOS (8,0)]
[Native]
@@ -30,6 +32,7 @@ public enum EAWiFiUnconfiguredAccessoryBrowserState : nint {
}
// NSInteger -> EAWiFiUnconfiguredAccessoryBrowser.h
+ [NoMac]
[TV (10,0)]
[iOS (8,0)]
[Native]
@@ -42,6 +45,7 @@ public enum EAWiFiUnconfiguredAccessoryConfigurationStatus : nint {
// NSInteger -> EAAccessoryManager.h
[TV (10,0)]
[iOS (6,0)]
+ [Mac (10, 13)]
[Native]
[ErrorDomain ("EABluetoothAccessoryPickerErrorDomain")]
public enum EABluetoothAccessoryPickerError : nint {
diff --git a/src/Foundation/Compat.cs b/src/Foundation/Compat.cs
index c90643b77328..29c435f71f8f 100644
--- a/src/Foundation/Compat.cs
+++ b/src/Foundation/Compat.cs
@@ -14,7 +14,7 @@ namespace XamCore.Foundation {
#if !XAMCORE_3_0
public partial class NSOperation {
- [Obsolete ("Use WaitUntilFinished method")]
+ [Obsolete ("Use 'WaitUntilFinished' method.")]
public virtual void WaitUntilFinishedNS ()
{
WaitUntilFinished ();
@@ -25,7 +25,7 @@ public virtual void WaitUntilFinishedNS ()
#if !XAMCORE_4_0 && (XAMCORE_2_0 || !MONOMAC) && !WATCH
public partial class NSUserActivity {
- [Obsolete ("Use the constructor that allows you to set an activity type")]
+ [Obsolete ("Use the constructor that allows you to set an activity type.")]
public NSUserActivity ()
#if XAMCORE_2_0
: this (String.Empty)
diff --git a/src/Foundation/Enum.cs b/src/Foundation/Enum.cs
index dbcf9d2de913..8f7131780a53 100644
--- a/src/Foundation/Enum.cs
+++ b/src/Foundation/Enum.cs
@@ -226,7 +226,7 @@ public enum NSDataWritingOptions : nuint {
WithoutOverwriting = 2,
#if !XAMCORE_2_0
- [Obsolete ("No longer available")]
+ [Obsolete ("No longer available.")]
Coordinated = 1 << 2,
#endif
@@ -363,6 +363,8 @@ public enum NSCocoaError : int {
CoderReadCorruptError = 4864,
CoderValueNotFoundError = 4865,
+ [Mac (10,13), iOS (11,0), Watch (4,0), TV (11,0)]
+ CoderInvalidValueError = 4866,
CoderErrorMinimum = 4864,
CoderErrorMaximum = 4991,
@@ -722,7 +724,9 @@ public enum NSJsonReadingOptions : nuint_compat_int {
[Flags]
[Native]
public enum NSJsonWritingOptions : nuint_compat_int {
- PrettyPrinted = 1
+ PrettyPrinted = 1,
+ [Mac (10,13), iOS (11,0), TV (11,0), Watch (4,0)]
+ SortedKeys = (1 << 1),
}
[Native]
@@ -805,7 +809,7 @@ public enum NSUnderlineStyle : nint {
#if !MONOMAC || !XAMCORE_3_0
[Native]
#if MONOMAC
- [Obsolete ("Use NSWritingDirection in AppKit instead")]
+ [Obsolete ("Use NSWritingDirection in AppKit instead.")]
#endif
public enum NSWritingDirection : nint {
Natural = -1, LeftToRight = 0, RightToLeft = 1,
@@ -929,7 +933,7 @@ public enum NSDataBase64EncodingOptions : nuint_compat_int {
}
#if !XAMCORE_3_0
- [iOS (7,0)][Deprecated (PlatformName.iOS, 9, 0, message: "Use NSWritingDirectionFormatType")]
+ [iOS (7,0)][Deprecated (PlatformName.iOS, 9, 0, message: "Use 'NSWritingDirectionFormatType'.")]
[Flags]
[Native]
public enum NSTextWritingDirection : nint {
@@ -1109,12 +1113,14 @@ public override string ToString ()
}
}
-#if MONOMAC
+ [Mac (10,10,3)]
+ [Watch (4,0)]
+ [TV (11,0)]
+ [iOS (11,0)]
[Native]
public enum NSProcessInfoThermalState : nint {
Nominal, Fair, Serious, Critical
}
-#endif
[Native]
#if XAMCORE_2_0
@@ -1235,6 +1241,8 @@ public enum NSIso8601DateFormatOptions : nuint {
DashSeparatorInDate = 1 << 8,
ColonSeparatorInTime = 1 << 9,
ColonSeparatorInTimeZone = 1 << 10,
+ [Mac (10,13), iOS (11,0), TV (11,0), Watch (4,0)]
+ FractionalSeconds = 1 << 11,
FullDate = Year | Month | Day | DashSeparatorInDate,
FullTime = Time | ColonSeparatorInTime | TimeZone | ColonSeparatorInTimeZone,
InternetDateTime = FullDate | FullTime,
@@ -1258,4 +1266,36 @@ public enum NSMeasurementFormatterUnitOptions : nuint {
TemperatureWithoutUnit = (1 << 2)
}
+
+ [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
+ [Native]
+ public enum NSItemProviderRepresentationVisibility : nint {
+ All = 0,
+ Team = 1,
+ Group = 2,
+ OwnProcess = 3,
+ }
+
+ [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
+ [Native]
+ public enum NSItemProviderFileOptions : nint {
+ OpenInPlace = 1,
+ }
+
+ [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
+ [Native]
+ public enum NSLinguisticTaggerUnit : nint {
+ Word,
+ Sentence,
+ Paragraph,
+ Document,
+ }
+
+ [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
+ [Native]
+ public enum NSUrlSessionDelayedRequestDisposition : nint {
+ ContinueLoading = 0,
+ UseNewRequest = 1,
+ Cancel = 2,
+ }
}
diff --git a/src/Foundation/Enums.cs b/src/Foundation/Enums.cs
index 8e1b2bd67e4d..2c845f177176 100644
--- a/src/Foundation/Enums.cs
+++ b/src/Foundation/Enums.cs
@@ -116,4 +116,13 @@ public enum NSStringTransform {
[Field ("NSStringTransformStripDiacritics")]
StripDiacritics,
}
+
+ [NoWatch, NoTV, NoMac, iOS (11, 0)]
+ [Native]
+ public enum NSUrlSessionMultipathServiceType : nint {
+ None = 0,
+ Handover = 1,
+ Interactive = 2,
+ Aggregate = 3,
+ }
}
diff --git a/src/Foundation/NSDictionary_2.cs b/src/Foundation/NSDictionary_2.cs
index d25804b0b864..50a9528491fe 100644
--- a/src/Foundation/NSDictionary_2.cs
+++ b/src/Foundation/NSDictionary_2.cs
@@ -166,7 +166,7 @@ public static NSDictionary FromObjectsAndKeys (TValue [] objects,
#if XAMCORE_4_0
public static NSDictionary FromObjectsAndKeys (TValue [] objects, TKey [] keys)
#else
- [Obsolete ("TKey and TValue are inversed and won't work unless both types are identical. Use the generic overload that takes a count parameter instead")]
+ [Obsolete ("'TKey' and 'TValue' are inversed and won't work unless both types are identical. Use the generic overload that takes a count parameter instead.")]
public static NSDictionary FromObjectsAndKeys (TKey [] objects, TValue [] keys)
#endif
{
diff --git a/src/Foundation/NSDistributedNotificationCenter.cs b/src/Foundation/NSDistributedNotificationCenter.cs
index c417c5c95336..762f7dde1f83 100644
--- a/src/Foundation/NSDistributedNotificationCenter.cs
+++ b/src/Foundation/NSDistributedNotificationCenter.cs
@@ -14,15 +14,15 @@
namespace XamCore.Foundation {
- [Obsolete ("This is not available in iOS")]
+ [Obsolete ("This is not available in iOS.")]
public partial class NSDistributedNotificationCenter {
- [Obsolete ("This is not available in iOS")]
+ [Obsolete ("This is not available in iOS.")]
public void AddObserver (NSObject observer, Selector aSelector, string aName, string anObject)
{
}
- [Obsolete ("This is not available in iOS")]
+ [Obsolete ("This is not available in iOS.")]
public void RemoveObserver (NSObject observer, string aName, string anObject)
{
}
diff --git a/src/Foundation/NSExpression.cs b/src/Foundation/NSExpression.cs
index acb130491f0e..79462354fc9a 100644
--- a/src/Foundation/NSExpression.cs
+++ b/src/Foundation/NSExpression.cs
@@ -166,7 +166,7 @@ public virtual NSExpression Operand {
}
#if !XAMCORE_4_0 && !WATCH
- [Obsolete("ValueWithObject is deprecated, please use EvaluateWith instead.")]
+ [Obsolete("Use 'EvaluateWith' instead.")]
public virtual NSExpression ExpressionValueWithObject (NSObject obj, NSMutableDictionary context) {
var result = EvaluateWith (obj, context);
// if it can be casted, do return an NSEXpression else null
diff --git a/src/Foundation/NSFileManagerDelegate.cs b/src/Foundation/NSFileManagerDelegate.cs
index 291bd15de7b7..8ec4b64b0fef 100644
--- a/src/Foundation/NSFileManagerDelegate.cs
+++ b/src/Foundation/NSFileManagerDelegate.cs
@@ -19,7 +19,7 @@ public virtual bool ShouldCopyItemAtPath (NSFileManager fileManager, string srcP
}
#if !XAMCORE_3_0
- [Obsolete ("API removed after iOS 2.0 / OSX 10.5. It will never be called by the OS.")]
+ [Obsolete ("API removed after iOS 2.0 / macOS 10.5. It will never be called by the OS.")]
public virtual bool ShouldProceedAfterError (NSFileManager fm, NSDictionary errorInfo)
{
return false;
@@ -35,7 +35,7 @@ public static bool ShouldCopyItemAtPath (this INSFileManagerDelegate This, NSFil
}
#if !XAMCORE_3_0
- [Obsolete ("API removed after iOS 2.0 / OSX 10.5. It will never be called by the OS.")]
+ [Obsolete ("API removed after iOS 2.0 / macOS 10.5. It will never be called by the OS.")]
public static bool ShouldProceedAfterError (INSFileManagerDelegate This, NSFileManager fm, NSDictionary errorInfo)
{
return false;
diff --git a/src/Foundation/NSFormatter.cs b/src/Foundation/NSFormatter.cs
index 2d83a7da3dc3..7a5546f8f484 100644
--- a/src/Foundation/NSFormatter.cs
+++ b/src/Foundation/NSFormatter.cs
@@ -3,7 +3,7 @@
namespace XamCore.Foundation {
public partial class NSFormatter {
#if !XAMCORE_4_0
- [Obsolete ("Use IsPartialStringValid (ref string partialString, out NSRange proposedSelRange, string origString, NSRange origSelRange, out string error) instead")]
+ [Obsolete ("Use 'IsPartialStringValid (ref string partialString, out NSRange proposedSelRange, string origString, NSRange origSelRange, out string error)' instead.")]
public virtual bool IsPartialStringValid (out string partialString, out NSRange proposedSelRange, string origString, NSRange origSelRange, out NSString error)
{
partialString = origString;
diff --git a/src/Foundation/NSItemProvider.cs b/src/Foundation/NSItemProvider.cs
index 8359ad60453a..b511b55ca2e3 100644
--- a/src/Foundation/NSItemProvider.cs
+++ b/src/Foundation/NSItemProvider.cs
@@ -1,14 +1,15 @@
using System;
using System.Threading.Tasks;
using XamCore.CloudKit;
+using XamCore.ObjCRuntime;
namespace XamCore.Foundation
{
-#if MONOMAC && XAMCORE_2_0 // Only 64-bit on mac
+#if (MONOMAC || IOS) && XAMCORE_2_0 // Only 64-bit on mac
public partial class NSItemProvider
{
-#if !XAMCORE_4_0
- [Obsolete ("Use RegisterCloudKitShare (CloudKitRegistrationPreparationAction) instead")]
+#if !XAMCORE_4_0 && MONOMAC
+ [Obsolete ("Use RegisterCloudKitShare (CloudKitRegistrationPreparationAction) instead.")]
public virtual void RegisterCloudKitShare (Action preparationHandler)
{
CloudKitRegistrationPreparationAction action = handler => preparationHandler (handler);
@@ -16,6 +17,7 @@ public virtual void RegisterCloudKitShare (Action RegisterCloudKitShareAsync ()
{
var tcs = new TaskCompletionSource ();
@@ -25,6 +27,45 @@ public virtual Task RegisterCloudKitShar
RegisterCloudKitShare (action);
return tcs.Task;
}
- }
#endif
+
+ [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
+ public NSProgress LoadObject (Action completionHandler) where T: NSObject, INSItemProviderReading
+ {
+ return LoadObject (new Class (typeof (T)), (rv, err) =>
+ {
+ var obj = rv as T;
+ if (obj == null && rv != null)
+ obj = Runtime.ConstructNSObject (rv.Handle);
+ completionHandler (obj, err);
+ });
+ }
+
+ [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
+ public Task LoadObjectAsync () where T: NSObject, INSItemProviderReading
+ {
+ var rv = LoadObjectAsync (new Class (typeof (T)));
+ return rv.ContinueWith ((v) =>
+ {
+ var obj = v.Result as T;
+ if (obj == null && v.Result != null)
+ obj = Runtime.ConstructNSObject (v.Result.Handle);
+ return obj;
+ });
+ }
+
+ [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
+ public Task LoadObjectAsync (out NSProgress result) where T: NSObject, INSItemProviderReading
+ {
+ var rv = LoadObjectAsync (new Class (typeof (T)), out result);
+ return rv.ContinueWith ((v) =>
+ {
+ var obj = v.Result as T;
+ if (obj == null && v.Result != null)
+ obj = Runtime.ConstructNSObject (v.Result.Handle);
+ return obj;
+ });
+ }
+ }
+#endif // (MONOMAC || IOS) && XAMCORE_2_0
}
diff --git a/src/Foundation/NSMetadataItem.cs b/src/Foundation/NSMetadataItem.cs
index 72de9c50220d..f2b7a3b5a20e 100644
--- a/src/Foundation/NSMetadataItem.cs
+++ b/src/Foundation/NSMetadataItem.cs
@@ -18,12 +18,34 @@ bool GetBool (NSString key)
return n == null ? false : n.BoolValue;
}
+ bool? GetNullableBool (NSString key)
+ {
+ var n = Runtime.GetNSObject (GetHandle (key));
+ return n?.BoolValue;
+ }
+
double GetDouble (NSString key)
{
var n = Runtime.GetNSObject (GetHandle (key));
return n == null ? 0 : n.DoubleValue;
}
+ double? GetNullableDouble (NSString key)
+ {
+ var n = Runtime.GetNSObject (GetHandle (key));
+ return n?.DoubleValue;
+ }
+
+ nint? GetNInt (NSString key)
+ {
+ var n = Runtime.GetNSObject (GetHandle (key));
+#if XAMCORE_2_0
+ return n?.NIntValue;
+#else
+ return n?.IntValue;
+#endif
+ }
+
// same order as NSMetadataAttributes.h
public NSString FileSystemName {
@@ -83,12 +105,14 @@ public NSString[] ContentTypeTree {
}
}
+ // XAMCORE_4_0 FIXME return nullable
public bool IsUbiquitous {
get {
return GetBool (NSMetadataQuery.ItemIsUbiquitousKey);
}
}
+ // XAMCORE_4_0 FIXME return nullable
public bool UbiquitousItemHasUnresolvedConflicts {
get {
return GetBool (NSMetadataQuery.UbiquitousItemHasUnresolvedConflictsKey);
@@ -106,30 +130,35 @@ public NSItemDownloadingStatus DownloadingStatus {
}
}
+ // XAMCORE_4_0 FIXME return nullable
public bool UbiquitousItemIsDownloading {
get {
return GetBool (NSMetadataQuery.UbiquitousItemIsDownloadingKey);
}
}
+ // XAMCORE_4_0 FIXME return nullable
public bool UbiquitousItemIsUploaded {
get {
return GetBool (NSMetadataQuery.UbiquitousItemIsUploadedKey);
}
}
+ // XAMCORE_4_0 FIXME return nullable
public bool UbiquitousItemIsUploading {
get {
return GetBool (NSMetadataQuery.UbiquitousItemIsUploadingKey);
}
}
+ // XAMCORE_4_0 FIXME return nullable
public double UbiquitousItemPercentDownloaded {
get {
return GetDouble (NSMetadataQuery.UbiquitousItemPercentDownloadedKey);
}
}
+ // XAMCORE_4_0 FIXME return nullable
public double UbiquitousItemPercentUploaded {
get {
return GetDouble (NSMetadataQuery.UbiquitousItemPercentUploadedKey);
@@ -150,6 +179,7 @@ public NSError UbiquitousItemUploadingError {
}
}
+ // XAMCORE_4_0 FIXME return nullable
[iOS (8,0)][Mac (10,10)]
public bool UbiquitousItemDownloadRequested {
get {
@@ -157,6 +187,7 @@ public bool UbiquitousItemDownloadRequested {
}
}
+ // XAMCORE_4_0 FIXME return nullable
[iOS (8,0)][Mac (10,10)]
public bool UbiquitousItemIsExternalDocument {
get {
@@ -177,5 +208,1014 @@ public NSUrl UbiquitousItemUrlInLocalContainer {
return Runtime.GetNSObject (GetHandle (NSMetadataQuery.UbiquitousItemURLInLocalContainerKey));
}
}
+
+#if MONOMAC
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] Keywords {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.KeywordsKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Title {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.TitleKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] Authors {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.AuthorsKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] Editors {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.EditorsKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] Participants {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.ParticipantsKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] Projects {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.ProjectsKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public NSDate DownloadedDate {
+ get {
+ return Runtime.GetNSObject (GetHandle (NSMetadataQuery.DownloadedDateKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] WhereFroms {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.WhereFromsKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Comment {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.CommentKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Copyright {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.CopyrightKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public NSDate LastUsedDate {
+ get {
+ return Runtime.GetNSObject (GetHandle (NSMetadataQuery.LastUsedDateKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public NSDate ContentCreationDate {
+ get {
+ return Runtime.GetNSObject (GetHandle (NSMetadataQuery.ContentCreationDateKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public NSDate ContentModificationDate {
+ get {
+ return Runtime.GetNSObject (GetHandle (NSMetadataQuery.ContentModificationDateKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public NSDate DateAdded {
+ get {
+ return Runtime.GetNSObject (GetHandle (NSMetadataQuery.DateAddedKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? DurationSeconds {
+ get {
+ return GetNullableDouble (NSMetadataQuery.DurationSecondsKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] ContactKeywords {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.ContactKeywordsKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Version {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.VersionKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public nint? PixelHeight {
+ get {
+ return GetNInt (NSMetadataQuery.PixelHeightKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public nint? PixelWidth {
+ get {
+ return GetNInt (NSMetadataQuery.PixelWidthKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public nint? PixelCount {
+ get {
+ return GetNInt (NSMetadataQuery.PixelCountKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string ColorSpace {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.ColorSpaceKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public nint? BitsPerSample {
+ get {
+ return GetNInt (NSMetadataQuery.BitsPerSampleKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public bool? FlashOnOff {
+ get {
+ return GetNullableBool (NSMetadataQuery.FlashOnOffKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? FocalLength {
+ get {
+ return GetNullableDouble (NSMetadataQuery.FocalLengthKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string AcquisitionMake {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.AcquisitionMakeKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string AcquisitionModel {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.AcquisitionModelKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? IsoSpeed {
+ get {
+ return GetNullableDouble (NSMetadataQuery.IsoSpeedKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public nint? Orientation {
+ get {
+ return GetNInt (NSMetadataQuery.OrientationKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] LayerNames {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.LayerNamesKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? WhiteBalance {
+ get {
+ return GetNullableDouble (NSMetadataQuery.WhiteBalanceKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? Aperture {
+ get {
+ return GetNullableDouble (NSMetadataQuery.ApertureKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string ProfileName {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.ProfileNameKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public nint? ResolutionWidthDpi {
+ get {
+ return GetNInt (NSMetadataQuery.ResolutionWidthDpiKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public nint? ResolutionHeightDpi {
+ get {
+ return GetNInt (NSMetadataQuery.ResolutionHeightDpiKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public nint? ExposureMode {
+ get {
+ return GetNInt (NSMetadataQuery.ExposureModeKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? ExposureTimeSeconds {
+ get {
+ return GetNullableDouble (NSMetadataQuery.ExposureTimeSecondsKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string ExifVersion {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.ExifVersionKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string CameraOwner {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.CameraOwnerKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public nint? FocalLength35mm {
+ get {
+ return GetNInt (NSMetadataQuery.FocalLength35mmKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string LensModel {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.LensModelKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string ExifGpsVersion {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.ExifGpsVersionKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? Altitude {
+ get {
+ return GetNullableDouble (NSMetadataQuery.AltitudeKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? Latitude {
+ get {
+ return GetNullableDouble (NSMetadataQuery.LatitudeKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? Longitude {
+ get {
+ return GetNullableDouble (NSMetadataQuery.LongitudeKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? Speed {
+ get {
+ return GetNullableDouble (NSMetadataQuery.SpeedKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public NSDate Timestamp {
+ get {
+ return Runtime.GetNSObject (GetHandle (NSMetadataQuery.TimestampKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? GpsTrack {
+ get {
+ return GetNullableDouble (NSMetadataQuery.GpsTrackKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? ImageDirection {
+ get {
+ return GetNullableDouble (NSMetadataQuery.ImageDirectionKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string NamedLocation {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.NamedLocationKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string GpsStatus {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.GpsStatusKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string GpsMeasureMode {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.GpsMeasureModeKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? GpsDop {
+ get {
+ return GetNullableDouble (NSMetadataQuery.GpsDopKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string GpsMapDatum {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.GpsMapDatumKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? GpsDestLatitude {
+ get {
+ return GetNullableDouble (NSMetadataQuery.GpsDestLatitudeKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? GpsDestLongitude {
+ get {
+ return GetNullableDouble (NSMetadataQuery.GpsDestLongitudeKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? GpsDestBearing {
+ get {
+ return GetNullableDouble (NSMetadataQuery.GpsDestBearingKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? GpsDestDistance {
+ get {
+ return GetNullableDouble (NSMetadataQuery.GpsDestDistanceKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string GpsProcessingMethod {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.GpsProcessingMethodKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string GpsAreaInformation {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.GpsAreaInformationKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public NSDate GpsDateStamp {
+ get {
+ return Runtime.GetNSObject (GetHandle (NSMetadataQuery.GpsDateStampKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? GpsDifferental {
+ get {
+ return GetNullableDouble (NSMetadataQuery.GpsDifferentalKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] Codecs {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.CodecsKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] MediaTypes {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.MediaTypesKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public bool? Streamable {
+ get {
+ return GetNullableBool (NSMetadataQuery.StreamableKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public nint? TotalBitRate {
+ get {
+ return GetNInt (NSMetadataQuery.TotalBitRateKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public nint? VideoBitRate {
+ get {
+ return GetNInt (NSMetadataQuery.VideoBitRateKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public nint? AudioBitRate {
+ get {
+ return GetNInt (NSMetadataQuery.AudioBitRateKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string DeliveryType {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.DeliveryTypeKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Album {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.AlbumKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public bool? HasAlphaChannel {
+ get {
+ return GetNullableBool (NSMetadataQuery.HasAlphaChannelKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public bool? RedEyeOnOff {
+ get {
+ return GetNullableBool (NSMetadataQuery.RedEyeOnOffKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string MeteringMode {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.MeteringModeKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? MaxAperture {
+ get {
+ return GetNullableDouble (NSMetadataQuery.MaxApertureKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public nint? FNumber {
+ get {
+ return GetNInt (NSMetadataQuery.FNumberKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string ExposureProgram {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.ExposureProgramKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string ExposureTimeString {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.ExposureTimeStringKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Headline {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.HeadlineKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Instructions {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.InstructionsKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string City {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.CityKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string StateOrProvince {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.StateOrProvinceKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Country {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.CountryKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string TextContent {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.TextContentKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public nint? AudioSampleRate {
+ get {
+ return GetNInt (NSMetadataQuery.AudioSampleRateKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public nint? AudioChannelCount {
+ get {
+ return GetNInt (NSMetadataQuery.AudioChannelCountKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? Tempo {
+ get {
+ return GetNullableDouble (NSMetadataQuery.TempoKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string KeySignature {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.KeySignatureKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string TimeSignature {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.TimeSignatureKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string AudioEncodingApplication {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.AudioEncodingApplicationKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Composer {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.ComposerKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Lyricist {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.LyricistKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public nint? AudioTrackNumber {
+ get {
+ return GetNInt (NSMetadataQuery.AudioTrackNumberKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public NSDate RecordingDate {
+ get {
+ return Runtime.GetNSObject (GetHandle (NSMetadataQuery.RecordingDateKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string MusicalGenre {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.MusicalGenreKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public bool? IsGeneralMidiSequence {
+ get {
+ return GetNullableBool (NSMetadataQuery.IsGeneralMidiSequenceKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public nint? RecordingYear {
+ get {
+ return GetNInt (NSMetadataQuery.RecordingYearKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] Organizations {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.OrganizationsKey)); }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] Languages {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.LanguagesKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Rights {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.RightsKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] Publishers {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.PublishersKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] Contributors {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.ContributorsKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] Coverage {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.CoverageKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Subject {
+ get {
+ return Runtime.GetNSObject (GetHandle (NSMetadataQuery.SubjectKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Theme {
+ get {
+ return Runtime.GetNSObject (GetHandle (NSMetadataQuery.ThemeKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Description {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.DescriptionKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Identifier {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.IdentifierKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] Audiences {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.AudiencesKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public nint? NumberOfPages {
+ get {
+ return GetNInt (NSMetadataQuery.NumberOfPagesKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? PageWidth {
+ get {
+ return GetNullableDouble (NSMetadataQuery.PageWidthKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? PageHeight {
+ get {
+ return GetNullableDouble (NSMetadataQuery.PageHeightKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string SecurityMethod {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.SecurityMethodKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Creator {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.CreatorKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] EncodingApplications {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.EncodingApplicationsKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public NSDate DueDate {
+ get {
+ return Runtime.GetNSObject (GetHandle (NSMetadataQuery.DueDateKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public double? StarRating {
+ get {
+ return GetNullableDouble (NSMetadataQuery.StarRatingKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] PhoneNumbers {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.PhoneNumbersKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] EmailAddresses {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.EmailAddressesKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] InstantMessageAddresses {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.InstantMessageAddressesKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Kind {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.KindKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] Recipients {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.RecipientsKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string FinderComment {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.FinderCommentKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] Fonts {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.FontsKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string AppleLoopsRoot {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.AppleLoopsRootKeyKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string AppleLoopsKeyFilterType {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.AppleLoopsKeyFilterTypeKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string AppleLoopsLoopMode {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.AppleLoopsLoopModeKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] AppleLoopDescriptors {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.AppleLoopDescriptorsKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string MusicalInstrumentCategory {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.MusicalInstrumentCategoryKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string MusicalInstrumentName {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.MusicalInstrumentNameKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string CFBundleIdentifier {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.CFBundleIdentifierKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Information {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.InformationKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Director {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.DirectorKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Producer {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.ProducerKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string Genre {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.GenreKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] Performers {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.PerformersKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string OriginalFormat {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.OriginalFormatKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string OriginalSource {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.OriginalSourceKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] AuthorEmailAddresses {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.AuthorEmailAddressesKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] RecipientEmailAddresses {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.RecipientEmailAddressesKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] AuthorAddresses {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.AuthorAddressesKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] RecipientAddresses {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.RecipientAddressesKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public bool? IsLikelyJunk {
+ get {
+ return GetNullableBool (NSMetadataQuery.IsLikelyJunkKey);
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] ExecutableArchitectures {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.ExecutableArchitecturesKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string ExecutablePlatform {
+ get {
+ return NSString.FromHandle (GetHandle (NSMetadataQuery.ExecutablePlatformKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public string [] ApplicationCategories {
+ get {
+ return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.ApplicationCategoriesKey));
+ }
+ }
+
+ [NoWatch, NoTV, NoiOS, Mac (10, 9)]
+ public bool? IsApplicationManaged {
+ get {
+ return GetNullableBool (NSMetadataQuery.IsApplicationManagedKey);
+ }
+ }
+#endif
}
}
diff --git a/src/Foundation/NSMutableDictionary_2.cs b/src/Foundation/NSMutableDictionary_2.cs
index a8df846f0e79..a57e755a2a20 100644
--- a/src/Foundation/NSMutableDictionary_2.cs
+++ b/src/Foundation/NSMutableDictionary_2.cs
@@ -230,7 +230,7 @@ public static NSMutableDictionary FromObjectsAndKeys (TValue [] ob
#if XAMCORE_4_0
public static NSMutableDictionary FromObjectsAndKeys (TValue [] objects, TKey [] keys)
#else
- [Obsolete ("TKey and TValue are inversed and won't work unless both types are identical. Use the generic overload that takes a count parameter instead")]
+ [Obsolete ("'TKey' and 'TValue' are inversed and won't work unless both types are identical. Use the generic overload that takes a count parameter instead.")]
public static NSMutableDictionary FromObjectsAndKeys (TKey [] objects, TValue [] keys)
#endif
{
diff --git a/src/Foundation/NSObject.iOS.cs b/src/Foundation/NSObject.iOS.cs
index 8539ee155cef..fdcf859f71f8 100644
--- a/src/Foundation/NSObject.iOS.cs
+++ b/src/Foundation/NSObject.iOS.cs
@@ -19,7 +19,7 @@ public partial class NSObject : INativeObject
#if !COREBUILD
#if !XAMCORE_4_0 && !WATCH
- [Obsolete ("Use PlatformAssembly for easier code sharing across platforms")]
+ [Obsolete ("Use 'PlatformAssembly' for easier code sharing across platforms.")]
public readonly static Assembly MonoTouchAssembly = typeof (NSObject).Assembly;
#endif
diff --git a/src/Foundation/NSObject.mac.cs b/src/Foundation/NSObject.mac.cs
index 74a4225d1d7c..c548884f31f0 100644
--- a/src/Foundation/NSObject.mac.cs
+++ b/src/Foundation/NSObject.mac.cs
@@ -97,11 +97,15 @@ public partial class NSObject : INativeObject
static IntPtr pl = Dlfcn.dlopen (Constants.PhotosLibrary, 1);
static IntPtr mp = Dlfcn.dlopen (Constants.MediaPlayerLibrary, 1);
static IntPtr pc = Dlfcn.dlopen (Constants.PrintCoreLibrary, 1);
+ static IntPtr cml = Dlfcn.dlopen (Constants.CoreMLLibrary, 1);
+ static IntPtr vn = Dlfcn.dlopen (Constants.VisionLibrary, 1);
+ static IntPtr ios = Dlfcn.dlopen (Constants.IOSurfaceLibrary, 1);
+ static IntPtr ex = Dlfcn.dlopen (Constants.ExternalAccessoryLibrary, 1);
#endif
// ** IF YOU ADD ITEMS HERE PLEASE UPDATE linker/ObjCExtensions.cs and mmp/linker/MonoMac.Tuner/MonoMacNamespaces.cs
#if !XAMCORE_4_0
- [Obsolete ("Use PlatformAssembly for easier code sharing across platforms")]
+ [Obsolete ("Use PlatformAssembly for easier code sharing across platforms.")]
public static readonly Assembly MonoMacAssembly = typeof (NSObject).Assembly;
#endif
diff --git a/src/Foundation/NSPortMessage.cs b/src/Foundation/NSPortMessage.cs
index 69915593bc45..8b5f96f7d509 100644
--- a/src/Foundation/NSPortMessage.cs
+++ b/src/Foundation/NSPortMessage.cs
@@ -9,23 +9,23 @@ public partial class NSPortMessage {
// Apple will reject iOS application using those selectors - as they only exists in OSX
// However we exposed them in monotouch.dll so we provide stubs for binary compatibility
- [Obsolete ("Only available on OSX")]
+ [Obsolete ("Only available on macOS.")]
public virtual uint MsgId {
get { throw new NotSupportedException (); }
set { throw new NotSupportedException (); }
}
- [Obsolete ("Only available on OSX")]
+ [Obsolete ("Only available on macOS.")]
public virtual NSPort ReceivePort {
get { throw new NotSupportedException (); }
}
- [Obsolete ("Only available on OSX")]
+ [Obsolete ("Only available on macOS.")]
public virtual NSPort SendPort {
get { throw new NotSupportedException (); }
}
- [Obsolete ("Only available on OSX")]
+ [Obsolete ("Only available on macOS.")]
public virtual bool SendBefore (NSDate date)
{
throw new NotSupportedException ();
diff --git a/src/Foundation/NSProgress.cs b/src/Foundation/NSProgress.cs
new file mode 100644
index 000000000000..689e91dc28e3
--- /dev/null
+++ b/src/Foundation/NSProgress.cs
@@ -0,0 +1,30 @@
+#if !COREBUILD && XAMCORE_2_0
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Foundation {
+ public partial class NSProgress {
+ //Manual bindings until BindAs support is merged
+ public nint? EstimatedTimeRemaining {
+ get { return _EstimatedTimeRemaining?.NIntValue; }
+ set { _EstimatedTimeRemaining = value != null ? new NSNumber (value.Value) : null; }
+ }
+
+ public nint? Throughput {
+ get { return _Throughput?.NIntValue; }
+ set { _Throughput = value != null ? new NSNumber (value.Value) : null; }
+ }
+
+ public nint? FileTotalCount {
+ get { return _FileTotalCount?.NIntValue; }
+ set { _FileTotalCount = value != null ? new NSNumber (value.Value) : null; }
+ }
+
+ public nint? FileCompletedCount {
+ get { return _FileCompletedCount?.NIntValue; }
+ set { _FileCompletedCount = value != null ? new NSNumber (value.Value) : null; }
+ }
+ }
+}
+#endif
diff --git a/src/Foundation/NSProxy.cs b/src/Foundation/NSProxy.cs
new file mode 100644
index 000000000000..6763f207387c
--- /dev/null
+++ b/src/Foundation/NSProxy.cs
@@ -0,0 +1,37 @@
+//
+// NSProxy.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+// HACK:
+// Yep this is just a hack to workaround https://bugzilla.xamarin.com/show_bug.cgi?id=59247
+// we need to have a better solution that removes all what NSProxy does not responds to.
+// Right now this works because NSObject implements NSObject protocol just like NSProxy, but
+// NSProxy responds to far less selectors hence doing it internal so it is not a breaking change
+// when we provide the correct fix.
+
+using System;
+using System.ComponentModel;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Foundation {
+ [EditorBrowsable (EditorBrowsableState.Never)]
+ [Register ("NSProxy", true)]
+ internal abstract class NSProxy : NSObject {
+ }
+}
+
+namespace XamCore.WebKit {
+ // We need to keep NSProxy (avoid linking it) if WKNavigationDelegate or IWKNavigationDelegate
+ // is used. Unfortunately [Preserve] can't help us here because we do not generate partial
+ // interfaces rigth now, so we know WKWebView will be there and can hold a reference to it.
+ public partial class WKWebView {
+ [Preserve (Conditional = true)]
+ static Type hack = typeof (NSProxy);
+ }
+}
diff --git a/src/Foundation/NSUnit.cs b/src/Foundation/NSUnit.cs
new file mode 100644
index 000000000000..cf406cc98131
--- /dev/null
+++ b/src/Foundation/NSUnit.cs
@@ -0,0 +1,121 @@
+//
+// NSUnit.cs
+//
+// Authors:
+// Alex Soto (alexsoto@microsoft.com)
+//
+// Copyright 2017 Xamarin Inc.
+//
+
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Foundation {
+#if !XAMCORE_4_0
+ public partial class NSUnit {
+ [Obsolete ("Use .ctor(string)")]
+ public NSUnit () { }
+ }
+
+ public partial class NSUnitAcceleration {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitAcceleration () : base (NSObjectFlag.Empty) { }
+ }
+
+ public partial class NSUnitAngle {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitAngle () : base (NSObjectFlag.Empty) { }
+ }
+
+ public partial class NSUnitArea {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitArea () : base (NSObjectFlag.Empty) { }
+ }
+
+ public partial class NSUnitConcentrationMass {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitConcentrationMass () : base (NSObjectFlag.Empty) { }
+ }
+
+ public partial class NSUnitDispersion {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitDispersion () : base (NSObjectFlag.Empty) { }
+ }
+
+ public partial class NSUnitDuration {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitDuration () : base (NSObjectFlag.Empty) { }
+ }
+
+ public partial class NSUnitElectricCharge {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitElectricCharge () : base (NSObjectFlag.Empty) { }
+ }
+
+ public partial class NSUnitElectricCurrent {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitElectricCurrent () : base (NSObjectFlag.Empty) { }
+ }
+
+ public partial class NSUnitElectricPotentialDifference {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitElectricPotentialDifference () : base (NSObjectFlag.Empty) { }
+ }
+
+ public partial class NSUnitElectricResistance {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitElectricResistance () : base (NSObjectFlag.Empty) { }
+ }
+
+ public partial class NSUnitEnergy {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitEnergy () : base (NSObjectFlag.Empty) { }
+ }
+
+ public partial class NSUnitFrequency {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitFrequency () : base (NSObjectFlag.Empty) { }
+ }
+
+ public partial class NSUnitFuelEfficiency {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitFuelEfficiency () : base (NSObjectFlag.Empty) { }
+ }
+
+ public partial class NSUnitLength {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitLength () : base (NSObjectFlag.Empty) { }
+ }
+
+ public partial class NSUnitIlluminance {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitIlluminance () : base (NSObjectFlag.Empty) { }
+ }
+
+ public partial class NSUnitMass {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitMass () : base (NSObjectFlag.Empty) { }
+ }
+
+ public partial class NSUnitPower {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitPower () : base (NSObjectFlag.Empty) { }
+ }
+
+ public partial class NSUnitPressure {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitPressure () : base (NSObjectFlag.Empty) { }
+ }
+
+ public partial class NSUnitSpeed {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitSpeed () : base (NSObjectFlag.Empty) { }
+ }
+
+ public partial class NSUnitVolume {
+ [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")]
+ public NSUnitVolume () : base (NSObjectFlag.Empty) { }
+ }
+#endif
+}
diff --git a/src/GameKit/GKCompat.cs b/src/GameKit/GKCompat.cs
index 7b330a561631..53174e2231b5 100644
--- a/src/GameKit/GKCompat.cs
+++ b/src/GameKit/GKCompat.cs
@@ -10,7 +10,7 @@ namespace XamCore.GameKit {
public partial class GKMatchRequest {
[iOS (8,0), Mac (10,10)]
- [Obsolete ("Use RecipientResponseHandler property")]
+ [Obsolete ("Use 'RecipientResponseHandler' property.")]
public virtual void SetRecipientResponseHandler (Action handler)
{
RecipientResponseHandler = handler;
@@ -19,7 +19,7 @@ public virtual void SetRecipientResponseHandler (Action (out IntPtr buffer, ref T[] points) where T : struct
{
- var size = Marshal.SizeOf (typeof (T));
+ var type = typeof (T);
+ // Vector3 is 12 bytes but vector_float3 is 16
+ var size = type == typeof (Vector3) ? 16 : Marshal.SizeOf (type);
var length = points.Length * size;
buffer = Marshal.AllocHGlobal (length);
diff --git a/src/HealthKit/Enums.cs b/src/HealthKit/Enums.cs
index 036abe3e0f4a..6be1f017125e 100644
--- a/src/HealthKit/Enums.cs
+++ b/src/HealthKit/Enums.cs
@@ -301,8 +301,8 @@ public enum HKWorkoutActivityType : nuint {
Curling,
Cycling,
Dance,
- [Deprecated (PlatformName.WatchOS, 3, 0, message: "Use HKWorkoutActivityType.Dance, HKWorkoutActivityType.Barre, or HKWorkoutActivityType.Pilates")]
- [Deprecated (PlatformName.iOS, 10, 0, message: "Use HKWorkoutActivityType.Dance, HKWorkoutActivityType.Barre, or HKWorkoutActivityType.Pilates")]
+ [Deprecated (PlatformName.WatchOS, 3, 0, message: "Use 'HKWorkoutActivityType.Dance', 'HKWorkoutActivityType.Barre', or 'HKWorkoutActivityType.Pilates'.")]
+ [Deprecated (PlatformName.iOS, 10, 0, message: "Use 'HKWorkoutActivityType.Dance', 'HKWorkoutActivityType.Barre', or 'HKWorkoutActivityType.Pilates'.")]
DanceInspiredTraining,
Elliptical,
EquestrianSports,
diff --git a/src/HealthKit/HKObsolete.cs b/src/HealthKit/HKObsolete.cs
index 0fca178689e8..beaf13187f06 100644
--- a/src/HealthKit/HKObsolete.cs
+++ b/src/HealthKit/HKObsolete.cs
@@ -5,18 +5,18 @@ namespace XamCore.HealthKit {
#if !XAMCORE_3_0
public partial class HKStatisticsCollectionQuery {
- [Obsolete ("Use InitialResultsHandler")]
+ [Obsolete ("Use 'InitialResultsHandler'.")]
public virtual void SetInitialResultsHandler (HKStatisticsCollectionQueryInitialResultsHandler handler)
{
InitialResultsHandler = handler;
}
- [Obsolete ("Use StatisticsUpdated, this handler use an incorrect type and does nothing to avoid a crash")]
+ [Obsolete ("Use 'StatisticsUpdated', this handler uses an incorrect type and does nothing to avoid a crash.")]
public virtual void SetStatisticsUpdateHandler (HKStatisticsCollectionQueryInitialResultsHandler handler)
{
}
- [Obsolete ("Use StatisticsUpdated, this handler use an incorrect type and does nothing to avoid a crash")]
+ [Obsolete ("Use 'StatisticsUpdated', this handler uses an incorrect type and does nothing to avoid a crash.")]
public virtual HKStatisticsCollectionQueryInitialResultsHandler StatisticsUpdateHandler {
get; set;
}
@@ -24,7 +24,7 @@ public virtual HKStatisticsCollectionQueryInitialResultsHandler StatisticsUpdate
public partial class HKObjectType {
- [Obsolete ("Use GetWorkoutType, it will return a valid HKWorkoutType instance")]
+ [Obsolete ("Use 'GetWorkoutType', it will return a valid HKWorkoutType instance.")]
static public HKWorkout WorkoutType ()
{
// would throw an InvalidCastException since the old selector returned a HKWorkoutType
diff --git a/src/HomeKit/HMEnums.cs b/src/HomeKit/HMEnums.cs
index 1d7c329f917f..9849944e27c8 100644
--- a/src/HomeKit/HMEnums.cs
+++ b/src/HomeKit/HMEnums.cs
@@ -101,6 +101,9 @@ public enum HMError : nint {
NotAuthorizedForMicrophoneAccess = 89,
// iOS 10.2
IncompatibleNetwork = 90,
+ // iOS 11
+ NoHomeHub = 91,
+ IncompatibleHomeHub = 92, // HMErrorCodeNoCompatibleHomeHub introduced and deprecated on iOS 11. HMErrorCodeIncompatibleHomeHub = HMErrorCodeNoCompatibleHomeHub.
}
@@ -143,7 +146,7 @@ public enum HMCharacteristicType {
[Field ("HMCharacteristicTypeHeatingThreshold")]
HeatingThreshold,
- [Obsolete ("This value does not exist anymore and will always return null")]
+ [Obsolete ("This value does not exist anymore and will always return null.")]
HeatingCoolingStatus,
[Field ("HMCharacteristicTypeCurrentRelativeHumidity")]
@@ -164,12 +167,21 @@ public enum HMCharacteristicType {
[Field ("HMCharacteristicTypeName")]
Name,
+ [Deprecated (PlatformName.TvOS, 11, 0, message: "Use 'HMAccessory.Manufacturer' instead.")]
+ [Deprecated (PlatformName.WatchOS, 4, 0, message: "Use 'HMAccessory.Manufacturer' instead.")]
+ [Deprecated (PlatformName.iOS, 11, 0, message: "Use 'HMAccessory.Manufacturer' instead.")]
[Field ("HMCharacteristicTypeManufacturer")]
Manufacturer,
+ [Deprecated (PlatformName.TvOS, 11, 0, message: "Use 'HMAccessory.Model' instead.")]
+ [Deprecated (PlatformName.WatchOS, 4, 0, message: "Use 'HMAccessory.Model' instead.")]
+ [Deprecated (PlatformName.iOS, 11, 0, message: "Use 'HMAccessory.Model' instead.")]
[Field ("HMCharacteristicTypeModel")]
Model,
+ [Deprecated (PlatformName.TvOS, 11, 0, message: "No longer supported.")]
+ [Deprecated (PlatformName.WatchOS, 4, 0, message: "No longer supported.")]
+ [Deprecated (PlatformName.iOS, 11, 0, message: "No longer supported.")]
[Field ("HMCharacteristicTypeSerialNumber")]
SerialNumber,
@@ -284,6 +296,9 @@ public enum HMCharacteristicType {
CurrentVerticalTilt,
[iOS (9,0)]
+ [Deprecated (PlatformName.TvOS, 11, 0, message: "Use 'HMAccessory.FirmwareVersion' instead.")]
+ [Deprecated (PlatformName.WatchOS, 4, 0, message: "Use 'HMAccessory.FirmwareVersion' instead.")]
+ [Deprecated (PlatformName.iOS, 11, 0, message: "Use 'HMAccessory.FirmwareVersion' instead.")]
[Field ("HMCharacteristicTypeFirmwareVersion")]
FirmwareVersion,
@@ -557,6 +572,10 @@ public enum HMCharacteristicType {
[iOS (10,3), Watch (3,2), TV (10,2)]
[Field ("HMCharacteristicTypeLabelIndex")]
LabelIndex,
+
+ [iOS (11,0), Watch (4,0), TV (11,0)]
+ [Field ("HMCharacteristicTypeColorTemperature")]
+ ColorTemperature,
}
// conveniance enum (ObjC uses NSString)
@@ -987,7 +1006,7 @@ public enum HMAccessoryCategoryType {
GarageDoorOpener,
#if !WATCH && !TVOS
- [Obsolete ("Use GarageDoorOpener instead")]
+ [Obsolete ("Use 'GarageDoorOpener' instead.")]
DoorOpener = GarageDoorOpener,
#endif
@@ -1055,9 +1074,12 @@ public enum HMAccessoryCategoryType {
[iOS (9,0)]
[TV (10,0)]
- // conveniance enum (ObjC uses NSString)
public enum HMSignificantEvent {
+
+ [Field ("HMSignificantEventSunrise")]
Sunrise,
+
+ [Field ("HMSignificantEventSunset")]
Sunset,
}
@@ -1229,4 +1251,41 @@ public enum HMCharacteristicValueLabelNamespace : nint {
Dot = 0,
Numeral,
}
+
+ [Watch (4,0), TV (11,0), iOS (11,0)]
+ [Native]
+ public enum HMEventTriggerActivationState : nuint {
+ Disabled = 0,
+ DisabledNoHomeHub = 1,
+ DisabledNoCompatibleHomeHub = 2,
+ DisabledNoLocationServicesAuthorization = 3,
+ Enabled = 4,
+ }
+
+ [Watch (4,0), TV (11,0), iOS (11,0)]
+ [Native]
+ public enum HMHomeHubState : nuint {
+ NotAvailable = 0,
+ Connected,
+ Disconnected,
+ }
+
+ [Watch (4,0), TV (11,0), iOS (11,0)]
+ [Native]
+ public enum HMPresenceEventType : nuint {
+ EveryEntry = 1,
+ EveryExit = 2,
+ FirstEntry = 3,
+ LastExit = 4,
+ AtHome = FirstEntry,
+ NotAtHome = LastExit,
+ }
+
+ [Watch (4,0), TV (11,0), iOS (11,0)]
+ [Native]
+ public enum HMPresenceEventUserType : nuint {
+ CurrentUser = 1,
+ HomeUsers = 2,
+ CustomUsers = 3,
+ }
}
diff --git a/src/HomeKit/HMEventTrigger.cs b/src/HomeKit/HMEventTrigger.cs
index 0a5ce8f0949b..f719d7c609fe 100644
--- a/src/HomeKit/HMEventTrigger.cs
+++ b/src/HomeKit/HMEventTrigger.cs
@@ -6,26 +6,20 @@ namespace XamCore.HomeKit {
partial class HMEventTrigger {
- internal static NSString GetEnumConstant (HMSignificantEvent value)
- {
- switch (value) {
- case HMSignificantEvent.Sunrise:
- return HMSignificantEventInternal.Sunrise;
- case HMSignificantEvent.Sunset:
- return HMSignificantEventInternal.Sunset;
- default:
- return null;
- }
- }
-
+ [Deprecated (PlatformName.iOS, 11, 0, message: "Use 'CreatePredicateForEvaluatingTriggerOccurringBeforeSignificantEvent (HMSignificantTimeEvent)' instead.")]
+ [Deprecated (PlatformName.TvOS, 11, 0, message: "Use 'CreatePredicateForEvaluatingTriggerOccurringBeforeSignificantEvent (HMSignificantTimeEvent)' instead.")]
+ [Deprecated (PlatformName.WatchOS, 4, 0, message: "Use 'CreatePredicateForEvaluatingTriggerOccurringBeforeSignificantEvent (HMSignificantTimeEvent)' instead.")]
static public NSPredicate CreatePredicateForEvaluatingTriggerOccurringBeforeSignificantEvent (HMSignificantEvent significantEvent, NSDateComponents offset)
{
- return CreatePredicateForEvaluatingTriggerOccurringBeforeSignificantEvent (GetEnumConstant (significantEvent), offset);
+ return CreatePredicateForEvaluatingTriggerOccurringBeforeSignificantEvent (significantEvent.GetConstant (), offset);
}
+ [Deprecated (PlatformName.iOS, 11, 0, message: "Use 'CreatePredicateForEvaluatingTriggerOccurringAfterSignificantEvent (HMSignificantTimeEvent)' instead.")]
+ [Deprecated (PlatformName.TvOS, 11, 0, message: "Use 'CreatePredicateForEvaluatingTriggerOccurringAfterSignificantEvent (HMSignificantTimeEvent)' instead.")]
+ [Deprecated (PlatformName.WatchOS, 4, 0, message: "Use 'CreatePredicateForEvaluatingTriggerOccurringAfterSignificantEvent (HMSignificantTimeEvent)' instead.")]
static public NSPredicate CreatePredicateForEvaluatingTriggerOccurringAfterSignificantEvent (HMSignificantEvent significantEvent, NSDateComponents offset)
{
- return CreatePredicateForEvaluatingTriggerOccurringAfterSignificantEvent (GetEnumConstant (significantEvent), offset);
+ return CreatePredicateForEvaluatingTriggerOccurringAfterSignificantEvent (significantEvent.GetConstant (), offset);
}
}
}
diff --git a/src/HomeKit/HMMutableSignificantTimeEvent.cs b/src/HomeKit/HMMutableSignificantTimeEvent.cs
new file mode 100644
index 000000000000..027d6c120c6d
--- /dev/null
+++ b/src/HomeKit/HMMutableSignificantTimeEvent.cs
@@ -0,0 +1,17 @@
+using System;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.HomeKit {
+
+ partial class HMMutableSignificantTimeEvent {
+
+ public virtual HMSignificantEvent SignificantEvent {
+ get {
+ return (HMSignificantEvent) (HMSignificantEventExtensions.GetValue (_SignificantEvent));
+ }
+ set {
+ _SignificantEvent = HMSignificantEventExtensions.GetConstant (value);
+ }
+ }
+ }
+}
diff --git a/src/HomeKit/HMSignificantTimeEvent.cs b/src/HomeKit/HMSignificantTimeEvent.cs
new file mode 100644
index 000000000000..e99ef3d00670
--- /dev/null
+++ b/src/HomeKit/HMSignificantTimeEvent.cs
@@ -0,0 +1,17 @@
+using System;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.HomeKit {
+
+ partial class HMSignificantTimeEvent {
+
+ public virtual HMSignificantEvent SignificantEvent {
+ get {
+ return (HMSignificantEvent) (HMSignificantEventExtensions.GetValue (_SignificantEvent));
+ }
+ set {
+ _SignificantEvent = HMSignificantEventExtensions.GetConstant (value);
+ }
+ }
+ }
+}
diff --git a/src/IOSurface/IODefs.cs b/src/IOSurface/IODefs.cs
new file mode 100644
index 000000000000..071e28a4e57a
--- /dev/null
+++ b/src/IOSurface/IODefs.cs
@@ -0,0 +1,38 @@
+//
+// IOSurface
+//
+// Authors:
+// Miguel de Icaza (miguel@xamarin.com)
+//
+// Copyright 2017 Microsoft
+//
+
+using System;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.IOSurface {
+
+ public enum IOSurfaceLockOptions : uint {
+ ReadOnly = 1,
+ AvoidSync = 2,
+ }
+
+ public enum IOSurfacePurgeabilityState : uint {
+ NonVolatile = 0,
+ Volatile = 1,
+ Empty = 2,
+ KeepCurrent = 3,
+ }
+
+ // To be used with kIOSurfaceCacheMode or IOSurfacePropertyKeyCacheMode
+ public enum IOSurfaceMemoryMap {
+ DefaultCache = 0,
+ InhibitCache = 1 << 8,
+ WriteThruCache = 2 << 8,
+ CopybackCache = 3 << 8,
+ WriteCombineCache = 4 << 8,
+ CopybackInnerCache = 5 << 8,
+ };
+
+
+}
diff --git a/src/IOSurface/IOSurface.cs b/src/IOSurface/IOSurface.cs
new file mode 100644
index 000000000000..4db673835618
--- /dev/null
+++ b/src/IOSurface/IOSurface.cs
@@ -0,0 +1,104 @@
+//
+// IOSurface.cs
+//
+// Copyright 2016 Microsoft
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if XAMCORE_2_0
+using System;
+using System.Runtime.InteropServices;
+using XamCore.CoreFoundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.IOSurface {
+ public partial class IOSurface {
+
+ // kern_return_t
+ // See bug #59201 [iOS (10,0)]
+ [iOS (11, 0)]
+ [Mac (10, 12)]
+ [TV (11, 0)]
+ public int Lock (IOSurfaceLockOptions options, ref int seed)
+ {
+ unsafe {
+ fixed (int *p = &seed){
+ return _Lock (options, (IntPtr) p);
+ }
+ }
+ }
+
+ // kern_return_t
+ // See bug #59201 [iOS (10,0)]
+ [iOS (11, 0)]
+ [Mac (10, 12)]
+ [TV (11, 0)]
+ public int Lock (IOSurfaceLockOptions options)
+ {
+ return _Lock (options, IntPtr.Zero);
+ }
+
+ // kern_return_t
+ // See bug #59201 [iOS (10,0)]
+ [iOS (11, 0)]
+ [Mac (10, 12)]
+ [TV (11, 0)]
+ public int Unlock (IOSurfaceLockOptions options, ref int seed)
+ {
+ unsafe {
+ fixed (int *p = &seed){
+ return _Unlock (options, (IntPtr) p);
+ }
+ }
+ }
+
+ // kern_return_t
+ // See bug #59201 [iOS (10,0)]
+ [iOS (11, 0)]
+ [Mac (10, 12)]
+ [TV (11, 0)]
+ public int Unlock (IOSurfaceLockOptions options)
+ {
+ return _Unlock (options, IntPtr.Zero);
+ }
+
+#if !MONOMAC
+ // kern_return_t
+ [iOS (11, 0)]
+ [TV (11, 0)]
+ public int SetPurgeable (IOSurfacePurgeabilityState newState, ref IOSurfacePurgeabilityState oldState)
+ {
+ unsafe {
+ fixed (IOSurfacePurgeabilityState *p = &oldState){
+ return _SetPurgeable (newState, (IntPtr) p);
+ }
+ }
+ }
+
+ [iOS (11, 0)]
+ [TV (11, 0)]
+ public int SetPurgeable (IOSurfacePurgeabilityState newState)
+ {
+ return _SetPurgeable (newState, IntPtr.Zero);
+ }
+#endif
+ }
+}
+#endif
\ No newline at end of file
diff --git a/src/ImageIO/CGImageDestination.cs b/src/ImageIO/CGImageDestination.cs
index ee76b3c0bc4c..fe9f456a9ed0 100644
--- a/src/ImageIO/CGImageDestination.cs
+++ b/src/ImageIO/CGImageDestination.cs
@@ -188,6 +188,18 @@ internal NSMutableDictionary ToDictionary ()
}
#endif
+ public partial class CGImageAuxiliaryDataInfo {
+
+ public CGImageMetadata Metadata {
+ get {
+ return GetNativeValue (CGImageAuxiliaryDataInfoKeys.MetadataKey);
+ }
+ set {
+ SetNativeValue (CGImageAuxiliaryDataInfoKeys.MetadataKey, value);
+ }
+ }
+ }
+
public class CGImageDestination : INativeObject, IDisposable {
internal IntPtr handle;
@@ -470,5 +482,17 @@ public bool CopyImageSource (CGImageSource image, CGImageDestinationOptions opti
o.Dispose ();
}
}
+
+ [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
+ [DllImport (Constants.ImageIOLibrary)]
+ static extern void CGImageDestinationAddAuxiliaryDataInfo (IntPtr /* CGImageDestinationRef* */ idst, IntPtr /* CFStringRef* */ auxiliaryImageDataType, IntPtr /* CFDictionaryRef* */ auxiliaryDataInfoDictionary);
+
+ [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
+ public void AddAuxiliaryDataInfo (CGImageAuxiliaryDataType auxiliaryImageDataType, CGImageAuxiliaryDataInfo auxiliaryDataInfo)
+ {
+ using (var dict = auxiliaryDataInfo?.Dictionary) {
+ CGImageDestinationAddAuxiliaryDataInfo (Handle, auxiliaryImageDataType.GetConstant ().GetHandle (), dict.GetHandle ());
+ }
+ }
}
-}
+}
\ No newline at end of file
diff --git a/src/ImageIO/CGImageMetadata.cs b/src/ImageIO/CGImageMetadata.cs
index 3e805a307e08..d1985d463434 100644
--- a/src/ImageIO/CGImageMetadata.cs
+++ b/src/ImageIO/CGImageMetadata.cs
@@ -43,6 +43,14 @@ public CGImageMetadata (IntPtr handle)
Handle = handle;
}
+ [Preserve (Conditional = true)]
+ internal CGImageMetadata (IntPtr handle, bool owns)
+ {
+ Handle = handle;
+ if (!owns)
+ CFObject.CFRetain (Handle);
+ }
+
[DllImport (Constants.ImageIOLibrary)]
static extern /* CGImageMetadataRef __nullable */ IntPtr CGImageMetadataCreateFromXMPData (
/* CFDataRef __nonnull */ IntPtr data);
diff --git a/src/ImageIO/CGImageSource.cs b/src/ImageIO/CGImageSource.cs
index 48ec2e38cc9f..51de887d3d2c 100644
--- a/src/ImageIO/CGImageSource.cs
+++ b/src/ImageIO/CGImageSource.cs
@@ -249,14 +249,14 @@ public nint ImageCount {
extern static /* CFDictionaryRef __nullable */ IntPtr CGImageSourceCopyProperties (
/* CGImageSourceRef __nonnull */ IntPtr isrc, /* CFDictionaryRef __nullable */ IntPtr options);
- [Advice ("Use GetProperties")]
+ [Advice ("Use 'GetProperties'.")]
public NSDictionary CopyProperties (NSDictionary dict)
{
var result = CGImageSourceCopyProperties (handle, dict == null ? IntPtr.Zero : dict.Handle);
return result == IntPtr.Zero ? null : Runtime.GetNSObject (result);
}
- [Advice ("Use GetProperties")]
+ [Advice ("Use 'GetProperties'.")]
public NSDictionary CopyProperties (CGImageOptions options)
{
if (options == null)
@@ -269,14 +269,14 @@ public NSDictionary CopyProperties (CGImageOptions options)
/* CGImageSourceRef __nonnull */ IntPtr isrc, /* size_t */ nint index,
/* CFDictionaryRef __nullable */ IntPtr options);
- [Advice ("Use GetProperties")]
+ [Advice ("Use 'GetProperties'.")]
public NSDictionary CopyProperties (NSDictionary dict, int imageIndex)
{
var result = CGImageSourceCopyPropertiesAtIndex (handle, imageIndex, dict == null ? IntPtr.Zero : dict.Handle);
return result == IntPtr.Zero ? null : Runtime.GetNSObject (result);
}
- [Advice ("Use GetProperties")]
+ [Advice ("Use 'GetProperties'.")]
public NSDictionary CopyProperties (CGImageOptions options, int imageIndex)
{
if (options == null)
@@ -376,5 +376,22 @@ public CGImageSourceStatus GetStatus (int index)
{
return CGImageSourceGetStatusAtIndex (handle, index);
}
+
+ [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
+ [DllImport (Constants.ImageIOLibrary)]
+ static extern IntPtr /* CFDictionaryRef* */ CGImageSourceCopyAuxiliaryDataInfoAtIndex (IntPtr /* CGImageSourceRef* */ isrc, nuint index, IntPtr /* CFStringRef* */ auxiliaryImageDataType);
+
+ [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
+ public CGImageAuxiliaryDataInfo CopyAuxiliaryDataInfo (nuint index, CGImageAuxiliaryDataType auxiliaryImageDataType)
+ {
+ var ptr = CGImageSourceCopyAuxiliaryDataInfoAtIndex (Handle, index, auxiliaryImageDataType.GetConstant ().GetHandle ());
+ if (ptr == IntPtr.Zero)
+ return null;
+
+ var dictionary = Runtime.GetNSObject (ptr);
+ var info = new CGImageAuxiliaryDataInfo (dictionary);
+
+ return info;
+ }
}
}
diff --git a/src/Intents/INBillTypeResolutionResult.cs b/src/Intents/INBillTypeResolutionResult.cs
new file mode 100644
index 000000000000..a0dd2b65da62
--- /dev/null
+++ b/src/Intents/INBillTypeResolutionResult.cs
@@ -0,0 +1,43 @@
+//
+// INBillTypeResolutionResult.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0 && !MONOMAC
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Intents {
+ public partial class INBillTypeResolutionResult {
+
+ public static INBillTypeResolutionResult GetSuccess (INBillType resolvedValue)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return SuccessWithResolvedBillType (resolvedValue);
+ else
+ return SuccessWithResolvedValue (resolvedValue);
+ }
+
+ public static INBillTypeResolutionResult GetConfirmationRequired (INBillType valueToConfirm)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return ConfirmationRequiredWithBillTypeToConfirm (valueToConfirm);
+ else
+ return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
+ }
+ }
+}
+#endif
diff --git a/src/Intents/INCallRecord.cs b/src/Intents/INCallRecord.cs
new file mode 100644
index 000000000000..7f61356e8725
--- /dev/null
+++ b/src/Intents/INCallRecord.cs
@@ -0,0 +1,27 @@
+//
+// INCallRecord.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Intents {
+ public partial class INCallRecord {
+
+ public double? CallDuration {
+ get { return WeakCallDuration?.DoubleValue; }
+ }
+
+ public bool? Unseen {
+ get { return WeakUnseen?.BoolValue; }
+ }
+ }
+}
+#endif
diff --git a/src/Intents/INCallRecordTypeResolutionResult.cs b/src/Intents/INCallRecordTypeResolutionResult.cs
new file mode 100644
index 000000000000..f2fd7e4b38e9
--- /dev/null
+++ b/src/Intents/INCallRecordTypeResolutionResult.cs
@@ -0,0 +1,47 @@
+//
+// INCallRecordTypeResolutionResult.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Intents {
+ public partial class INCallRecordTypeResolutionResult {
+
+ public static INCallRecordTypeResolutionResult GetSuccess (INCallRecordType resolvedValue)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#elif MONOMAC
+ if (PlatformHelper.CheckSystemVersion (10, 13))
+#endif
+ return SuccessWithResolvedCallRecordType (resolvedValue);
+ else
+ return SuccessWithResolvedValue (resolvedValue);
+ }
+
+ public static INCallRecordTypeResolutionResult GetConfirmationRequired (INCallRecordType valueToConfirm)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#elif MONOMAC
+ if (PlatformHelper.CheckSystemVersion (10, 13))
+#endif
+ return ConfirmationRequiredWithCallRecordTypeToConfirm (valueToConfirm);
+ else
+ return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
+ }
+ }
+}
+#endif
diff --git a/src/Intents/INCarAirCirculationModeResolutionResult.cs b/src/Intents/INCarAirCirculationModeResolutionResult.cs
new file mode 100644
index 000000000000..298fb3959fcf
--- /dev/null
+++ b/src/Intents/INCarAirCirculationModeResolutionResult.cs
@@ -0,0 +1,43 @@
+//
+// INCarAirCirculationModeResolutionResult.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0 && !MONOMAC
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Intents {
+ public partial class INCarAirCirculationModeResolutionResult {
+
+ public static INCarAirCirculationModeResolutionResult GetSuccess (INCarAirCirculationMode resolvedValue)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return SuccessWithResolvedCarAirCirculationMode (resolvedValue);
+ else
+ return SuccessWithResolvedValue (resolvedValue);
+ }
+
+ public static INCarAirCirculationModeResolutionResult GetConfirmationRequired (INCarAirCirculationMode valueToConfirm)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return ConfirmationRequiredWithCarAirCirculationModeToConfirm (valueToConfirm);
+ else
+ return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
+ }
+ }
+}
+#endif
diff --git a/src/Intents/INCarAudioSourceResolutionResult.cs b/src/Intents/INCarAudioSourceResolutionResult.cs
new file mode 100644
index 000000000000..3466267f8dfb
--- /dev/null
+++ b/src/Intents/INCarAudioSourceResolutionResult.cs
@@ -0,0 +1,43 @@
+//
+// INCarAudioSourceResolutionResult.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0 && !MONOMAC
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Intents {
+ public partial class INCarAudioSourceResolutionResult {
+
+ public static INCarAudioSourceResolutionResult GetSuccess (INCarAudioSource resolvedValue)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return SuccessWithResolvedCarAudioSource (resolvedValue);
+ else
+ return SuccessWithResolvedValue (resolvedValue);
+ }
+
+ public static INCarAudioSourceResolutionResult GetConfirmationRequired (INCarAudioSource valueToConfirm)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return ConfirmationRequiredWithCarAudioSourceToConfirm (valueToConfirm);
+ else
+ return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
+ }
+ }
+}
+#endif
diff --git a/src/Intents/INCarDefrosterResolutionResult.cs b/src/Intents/INCarDefrosterResolutionResult.cs
new file mode 100644
index 000000000000..89e80df50ebc
--- /dev/null
+++ b/src/Intents/INCarDefrosterResolutionResult.cs
@@ -0,0 +1,43 @@
+//
+// INCarDefrosterResolutionResult.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0 && !MONOMAC
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Intents {
+ public partial class INCarDefrosterResolutionResult {
+
+ public static INCarDefrosterResolutionResult GetSuccess (INCarDefroster resolvedValue)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return SuccessWithResolvedCarDefroster (resolvedValue);
+ else
+ return SuccessWithResolvedValue (resolvedValue);
+ }
+
+ public static INCarDefrosterResolutionResult GetConfirmationRequired (INCarDefroster valueToConfirm)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return ConfirmationRequiredWithCarDefrosterToConfirm (valueToConfirm);
+ else
+ return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
+ }
+ }
+}
+#endif
diff --git a/src/Intents/INCarSeatResolutionResult.cs b/src/Intents/INCarSeatResolutionResult.cs
new file mode 100644
index 000000000000..581d3d411e6f
--- /dev/null
+++ b/src/Intents/INCarSeatResolutionResult.cs
@@ -0,0 +1,42 @@
+//
+// INCarSeatResolutionResult.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0 && !MONOMAC
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Intents {
+ public partial class INCarSeatResolutionResult {
+ public static INCarSeatResolutionResult GetSuccess (INCarSeat resolvedValue)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return SuccessWithResolvedCarSeat (resolvedValue);
+ else
+ return SuccessWithResolvedValue (resolvedValue);
+ }
+
+ public static INCarSeatResolutionResult GetConfirmationRequired (INCarSeat valueToConfirm)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return ConfirmationRequiredWithCarSeatToConfirm (valueToConfirm);
+ else
+ return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/src/Intents/INCarSignalOptionsResolutionResult.cs b/src/Intents/INCarSignalOptionsResolutionResult.cs
new file mode 100644
index 000000000000..4f0450546c23
--- /dev/null
+++ b/src/Intents/INCarSignalOptionsResolutionResult.cs
@@ -0,0 +1,43 @@
+//
+// INCarAirCirculationModeResolutionResult.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0 && !MONOMAC
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Intents {
+ public partial class INCarSignalOptionsResolutionResult {
+
+ public static INCarSignalOptionsResolutionResult GetSuccess (INCarSignalOptions resolvedValue)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return SuccessWithResolvedCarSignalOptions (resolvedValue);
+ else
+ return SuccessWithResolvedValue (resolvedValue);
+ }
+
+ public static INCarSignalOptionsResolutionResult GetConfirmationRequired (INCarSignalOptions valueToConfirm)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return ConfirmationRequiredWithCarSignalOptionsToConfirm (valueToConfirm);
+ else
+ return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
+ }
+ }
+}
+#endif
diff --git a/src/Intents/INCompat.cs b/src/Intents/INCompat.cs
index f025cf4438fe..de334370f1ee 100644
--- a/src/Intents/INCompat.cs
+++ b/src/Intents/INCompat.cs
@@ -24,6 +24,14 @@ public INRideStatus ()
{
}
}
+
+ public partial class INRestaurantGuest {
+ [Obsolete ("This constructor does not create a valid instance of the type")]
+ public INRestaurantGuest ()
+ : base (IntPtr.Zero) // base class doesn't have a default ctor.
+ {
+ }
+ }
#endif
}
#endif
\ No newline at end of file
diff --git a/src/Intents/INInteraction.cs b/src/Intents/INInteraction.cs
new file mode 100644
index 000000000000..5cbf62d41188
--- /dev/null
+++ b/src/Intents/INInteraction.cs
@@ -0,0 +1,24 @@
+//
+// INInteraction.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0 && !MONOMAC
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Intents {
+ public partial class INInteraction {
+
+ public T GetParameterValue (INParameter parameter) where T : NSObject
+ {
+ return Runtime.GetNSObject (_GetParameterValue (parameter));
+ }
+ }
+}
+#endif
diff --git a/src/Intents/INMessageAttributeOptionsResolutionResult.cs b/src/Intents/INMessageAttributeOptionsResolutionResult.cs
new file mode 100644
index 000000000000..a550e690a6d5
--- /dev/null
+++ b/src/Intents/INMessageAttributeOptionsResolutionResult.cs
@@ -0,0 +1,47 @@
+//
+// INMessageAttributeOptionsResolutionResult.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Intents {
+ public partial class INMessageAttributeOptionsResolutionResult {
+
+ public static INMessageAttributeOptionsResolutionResult GetSuccess (INMessageAttributeOptions resolvedValue)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#elif MONOMAC
+ if (PlatformHelper.CheckSystemVersion (10, 13))
+#endif
+ return SuccessWithResolvedMessageAttributeOptions (resolvedValue);
+ else
+ return SuccessWithResolvedValue (resolvedValue);
+ }
+
+ public static INMessageAttributeOptionsResolutionResult GetConfirmationRequired (INMessageAttributeOptions valueToConfirm)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#elif MONOMAC
+ if (PlatformHelper.CheckSystemVersion (10, 13))
+#endif
+ return ConfirmationRequiredWithMessageAttributeOptionsToConfirm (valueToConfirm);
+ else
+ return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
+ }
+ }
+}
+#endif
diff --git a/src/Intents/INMessageAttributeResolutionResult.cs b/src/Intents/INMessageAttributeResolutionResult.cs
new file mode 100644
index 000000000000..dd9d3f0ffe2d
--- /dev/null
+++ b/src/Intents/INMessageAttributeResolutionResult.cs
@@ -0,0 +1,47 @@
+//
+// INMessageAttributeResolutionResult.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Intents {
+ public partial class INMessageAttributeResolutionResult {
+
+ public static INMessageAttributeResolutionResult GetSuccess (INMessageAttribute resolvedValue)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#elif MONOMAC
+ if (PlatformHelper.CheckSystemVersion (10, 13))
+#endif
+ return SuccessWithResolvedMessageAttribute (resolvedValue);
+ else
+ return SuccessWithResolvedValue (resolvedValue);
+ }
+
+ public static INMessageAttributeResolutionResult GetConfirmationRequired (INMessageAttribute valueToConfirm)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#elif MONOMAC
+ if (PlatformHelper.CheckSystemVersion (10, 13))
+#endif
+ return ConfirmationRequiredWithMessageAttributeToConfirm (valueToConfirm);
+ else
+ return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
+ }
+ }
+}
+#endif
diff --git a/src/Intents/INPaymentStatusResolutionResult.cs b/src/Intents/INPaymentStatusResolutionResult.cs
new file mode 100644
index 000000000000..50f43cd96dc4
--- /dev/null
+++ b/src/Intents/INPaymentStatusResolutionResult.cs
@@ -0,0 +1,43 @@
+//
+// INPaymentStatusResolutionResult.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0 && !MONOMAC
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Intents {
+ public partial class INPaymentStatusResolutionResult {
+
+ public static INPaymentStatusResolutionResult GetSuccess (INPaymentStatus resolvedValue)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return SuccessWithResolvedPaymentStatus (resolvedValue);
+ else
+ return SuccessWithResolvedValue (resolvedValue);
+ }
+
+ public static INPaymentStatusResolutionResult GetConfirmationRequired (INPaymentStatus valueToConfirm)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return ConfirmationRequiredWithPaymentStatusToConfirm (valueToConfirm);
+ else
+ return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
+ }
+ }
+}
+#endif
diff --git a/src/Intents/INRadioTypeResolutionResult.cs b/src/Intents/INRadioTypeResolutionResult.cs
new file mode 100644
index 000000000000..c018f196c448
--- /dev/null
+++ b/src/Intents/INRadioTypeResolutionResult.cs
@@ -0,0 +1,43 @@
+//
+// INRadioTypeResolutionResult.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0 && !MONOMAC
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Intents {
+ public partial class INRadioTypeResolutionResult {
+
+ public static INRadioTypeResolutionResult GetSuccess (INRadioType resolvedValue)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return SuccessWithResolvedRadioType (resolvedValue);
+ else
+ return SuccessWithResolvedValue (resolvedValue);
+ }
+
+ public static INRadioTypeResolutionResult GetConfirmationRequired (INRadioType valueToConfirm)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return ConfirmationRequiredWithRadioTypeToConfirm (valueToConfirm);
+ else
+ return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
+ }
+ }
+}
+#endif
diff --git a/src/Intents/INRelativeReferenceResolutionResult.cs b/src/Intents/INRelativeReferenceResolutionResult.cs
new file mode 100644
index 000000000000..ea8129300b30
--- /dev/null
+++ b/src/Intents/INRelativeReferenceResolutionResult.cs
@@ -0,0 +1,43 @@
+//
+// INRelativeReferenceResolutionResult.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0 && !MONOMAC
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Intents {
+ public partial class INRelativeReferenceResolutionResult {
+
+ public static INRelativeReferenceResolutionResult GetSuccess (INRelativeReference resolvedValue)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return SuccessWithResolvedRelativeReference (resolvedValue);
+ else
+ return SuccessWithResolvedValue (resolvedValue);
+ }
+
+ public static INRelativeReferenceResolutionResult GetConfirmationRequired (INRelativeReference valueToConfirm)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return ConfirmationRequiredWithRelativeReferenceToConfirm (valueToConfirm);
+ else
+ return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
+ }
+ }
+}
+#endif
diff --git a/src/Intents/INRelativeSettingResolutionResult.cs b/src/Intents/INRelativeSettingResolutionResult.cs
new file mode 100644
index 000000000000..e6dd58686452
--- /dev/null
+++ b/src/Intents/INRelativeSettingResolutionResult.cs
@@ -0,0 +1,43 @@
+//
+// INRelativeSettingResolutionResult.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0 && !MONOMAC
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Intents {
+ public partial class INRelativeSettingResolutionResult {
+
+ public static INRelativeSettingResolutionResult GetSuccess (INRelativeSetting resolvedValue)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return SuccessWithResolvedRelativeSetting (resolvedValue);
+ else
+ return SuccessWithResolvedValue (resolvedValue);
+ }
+
+ public static INRelativeSettingResolutionResult GetConfirmationRequired (INRelativeSetting valueToConfirm)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return ConfirmationRequiredWithRelativeSettingToConfirm (valueToConfirm);
+ else
+ return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
+ }
+ }
+}
+#endif
diff --git a/src/Intents/INSearchCallHistoryIntent.cs b/src/Intents/INSearchCallHistoryIntent.cs
new file mode 100644
index 000000000000..b0ee38f8ef6f
--- /dev/null
+++ b/src/Intents/INSearchCallHistoryIntent.cs
@@ -0,0 +1,23 @@
+//
+// INSearchCallHistoryIntent.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Intents {
+ public partial class INSearchCallHistoryIntent {
+
+ public bool? Unseen {
+ get { return WeakUnseen?.BoolValue; }
+ }
+ }
+}
+#endif
diff --git a/src/Intents/INSpeakableString.cs b/src/Intents/INSpeakableString.cs
new file mode 100644
index 000000000000..d3ab88bccde1
--- /dev/null
+++ b/src/Intents/INSpeakableString.cs
@@ -0,0 +1,33 @@
+//
+// INSpeakableString.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Intents {
+ public partial class INSpeakableString {
+ public INSpeakableString (string identifier, string spokenPhrase, string pronunciationHint)
+ : base (NSObjectFlag.Empty)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#elif MONOMAC
+ if (PlatformHelper.CheckSystemVersion (10, 13))
+#endif
+ InitializeHandle (InitWithVocabularyIdentifier (identifier, spokenPhrase, pronunciationHint));
+ else
+ InitializeHandle (InitWithIdentifier (identifier, spokenPhrase, pronunciationHint));
+ }
+ }
+}
+#endif
diff --git a/src/Intents/INWorkoutGoalUnitTypeResolutionResult.cs b/src/Intents/INWorkoutGoalUnitTypeResolutionResult.cs
new file mode 100644
index 000000000000..294f343d745c
--- /dev/null
+++ b/src/Intents/INWorkoutGoalUnitTypeResolutionResult.cs
@@ -0,0 +1,43 @@
+//
+// INWorkoutGoalUnitTypeResolutionResult.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0 && !MONOMAC
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Intents {
+ public partial class INWorkoutGoalUnitTypeResolutionResult {
+
+ public static INWorkoutGoalUnitTypeResolutionResult GetSuccess (INWorkoutGoalUnitType resolvedValue)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return SuccessWithResolvedWorkoutGoalUnitType (resolvedValue);
+ else
+ return SuccessWithResolvedValue (resolvedValue);
+ }
+
+ public static INWorkoutGoalUnitTypeResolutionResult GetConfirmationRequired (INWorkoutGoalUnitType valueToConfirm)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return ConfirmationRequiredWithWorkoutGoalUnitTypeToConfirm (valueToConfirm);
+ else
+ return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
+ }
+ }
+}
+#endif
diff --git a/src/Intents/INWorkoutLocationTypeResolutionResult.cs b/src/Intents/INWorkoutLocationTypeResolutionResult.cs
new file mode 100644
index 000000000000..69c7feb77f0c
--- /dev/null
+++ b/src/Intents/INWorkoutLocationTypeResolutionResult.cs
@@ -0,0 +1,43 @@
+//
+// INWorkoutLocationTypeResolutionResult.cs
+//
+// Authors:
+// Alex Soto
+//
+// Copyright 2017 Xamarin Inc. All rights reserved.
+//
+
+#if XAMCORE_2_0 && !MONOMAC
+using System;
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Intents {
+ public partial class INWorkoutLocationTypeResolutionResult {
+
+ public static INWorkoutLocationTypeResolutionResult GetSuccess (INWorkoutLocationType resolvedValue)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return SuccessWithResolvedWorkoutLocationType (resolvedValue);
+ else
+ return SuccessWithResolvedValue (resolvedValue);
+ }
+
+ public static INWorkoutLocationTypeResolutionResult GetConfirmationRequired (INWorkoutLocationType valueToConfirm)
+ {
+#if IOS
+ if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
+#elif WATCH
+ if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
+#endif
+ return ConfirmationRequiredWithWorkoutLocationTypeToConfirm (valueToConfirm);
+ else
+ return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
+ }
+ }
+}
+#endif
diff --git a/src/LocalAuthentication/LAEnums.cs b/src/LocalAuthentication/LAEnums.cs
index 69469a0d8fd4..46bb84ffc3e0 100644
--- a/src/LocalAuthentication/LAEnums.cs
+++ b/src/LocalAuthentication/LAEnums.cs
@@ -30,17 +30,29 @@ public enum LAStatus : nint {
/// Authentication could not start, because passcode is not set on the device.
PasscodeNotSet = -5,
/// 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 = -6,
+
/// 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 = -7,
+ [Deprecated (PlatformName.iOS, 11,0, message: "Use 'BiometryLockout' instead.")]
+ [Deprecated (PlatformName.MacOSX, 10,13, message: "Use 'BiometryLockout' instead.")]
TouchIDLockout = -8,
AppCancel = -9,
- InvalidContext = -10
+ InvalidContext = -10,
+
+ BiometryNotAvailable = TouchIDNotAvailable,
+ BiometryNotEnrolled = TouchIDNotEnrolled,
+ BiometryLockout = TouchIDLockout,
+
+ NotInteractive = -1004,
}
- [iOS (9,0)]
- [Mac (10,11)]
+ [iOS (9,0), Mac (10,11), Watch (3,0), TV (11,0)]
[Native]
public enum LACredentialType : nint {
ApplicationPassword = 0
diff --git a/src/Makefile b/src/Makefile
index bd9d2eb1ee65..7c2b213e3f45 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -767,7 +767,7 @@ WATCHOS_EXTRA_CORE_SOURCES = \
$(WATCH_BUILD_DIR)/Constants.cs \
$(WATCH_BUILD_DIR)/AssemblyInfo.cs \
$(IOS_OPENTK_1_0_CORE_SOURCES) \
- CoreVideo/CVPixelFormatType.cs \
+ AudioToolbox/AudioBuffers.cs \
AudioToolbox/AudioType.cs \
$(SHARED_SYSTEM_DRAWING_SOURCES) \
$(MONO_PATH)/mcs/class/System.Drawing/System.Drawing/Color.cs \
diff --git a/src/MapKit/MKEnums.cs b/src/MapKit/MKEnums.cs
index 37e25f1ec421..ade73139616b 100644
--- a/src/MapKit/MKEnums.cs
+++ b/src/MapKit/MKEnums.cs
@@ -38,7 +38,9 @@ public enum MKMapType : nuint_compat_int {
Satellite,
Hybrid,
SatelliteFlyover,
- HybridFlyover
+ HybridFlyover,
+ [iOS (11,0)][TV (11,0)][Mac (10,13, onlyOn64: true)]
+ MutedStandard,
}
// NSUInteger -> MKDistanceFormatter.h
@@ -97,7 +99,7 @@ public enum MKAnnotationViewDragState : nuint_compat_int {
[NoTV]
[NoWatch]
[Native]
- [Availability (Deprecated = Platform.iOS_9_0, Message = "Use the MKPinAnnotationView's PinTintColor instead")]
+ [Availability (Deprecated = Platform.iOS_9_0, Message = "Use 'MKPinAnnotationView.PinTintColor' instead.")]
public enum MKPinAnnotationColor : nuint_compat_int {
Red, Green, Purple
}
@@ -116,6 +118,28 @@ public enum MKSearchCompletionFilterType : nint {
AndQueries = 0,
Only
}
+
+ [TV (11,0)][NoWatch][iOS (11,0)][Mac (10,13, onlyOn64: true)]
+ [Native]
+ public enum MKAnnotationViewCollisionMode : nint {
+ Rectangle,
+ Circle,
+ }
+
+ [TV (11,0)][NoWatch][iOS (11,0)][NoMac]
+ [Native]
+ public enum MKScaleViewAlignment : nint {
+ Leading,
+ Trailing,
+ }
+
+ [TV (11,0)][NoWatch][iOS (11,0)][Mac (10,13, onlyOn64: true)]
+ [Native]
+ public enum MKFeatureVisibility : nint {
+ Adaptive,
+ Hidden,
+ Visible,
+ }
}
#endif
diff --git a/src/MapKit/MKFeatureDisplayPriority.cs b/src/MapKit/MKFeatureDisplayPriority.cs
new file mode 100644
index 000000000000..1b34010970d7
--- /dev/null
+++ b/src/MapKit/MKFeatureDisplayPriority.cs
@@ -0,0 +1,16 @@
+#if XAMCORE_2_0 || !MONOMAC
+using System;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.MapKit {
+
+ // .net does not allow float-based enumerations
+ [TV (11,0)][NoWatch][iOS (11,0)][Mac (10,13, onlyOn64: true)]
+ public static class MKFeatureDisplayPriority {
+ public const float Required = 1000f;
+ public const float DefaultHigh = 750f;
+ public const float DefaultLow = 250f;
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/src/MediaAccessibility/MediaAccessibility.cs b/src/MediaAccessibility/MediaAccessibility.cs
index e6a10fa339ee..9763e8deee81 100644
--- a/src/MediaAccessibility/MediaAccessibility.cs
+++ b/src/MediaAccessibility/MediaAccessibility.cs
@@ -70,10 +70,10 @@ public static partial class MACaptionAppearance {
// FIXME: make this a real notification
public static readonly NSString SettingsChangedNotification;
- [Advice ("Use MediaCharacteristic.DescribesMusicAndSoundForAccessibility getter")]
+ [Advice ("Use 'MediaCharacteristic.DescribesMusicAndSoundForAccessibility' getter.")]
public static readonly NSString MediaCharacteristicDescribesMusicAndSoundForAccessibility;
- [Advice ("Use MediaCharacteristic.TranscribesSpokenDialogForAccessibility getter")]
+ [Advice ("Use 'MediaCharacteristic.TranscribesSpokenDialogForAccessibility' getter.")]
public static readonly NSString MediaCharacteristicTranscribesSpokenDialogForAccessibility;
static MACaptionAppearance ()
diff --git a/src/MediaPlayer/MPNowPlayingInfoCenter.cs b/src/MediaPlayer/MPNowPlayingInfoCenter.cs
index 3e69e8142ec0..be0c2a59222f 100644
--- a/src/MediaPlayer/MPNowPlayingInfoCenter.cs
+++ b/src/MediaPlayer/MPNowPlayingInfoCenter.cs
@@ -7,13 +7,14 @@
// Copyright 2011, Xamarin Inc
//
+#if XAMCORE_2_0 || !MONOMAC
-#if XAMCORE_2_0
using XamCore.Foundation;
using XamCore.ObjCRuntime;
namespace XamCore.MediaPlayer {
+ [Mac (10,12,2, onlyOn64: true)]
public class MPNowPlayingInfo {
public MPNowPlayingInfo ()
{
@@ -220,13 +221,10 @@ public MPNowPlayingInfo NowPlaying {
return new MPNowPlayingInfo (_NowPlayingInfo);
}
set {
- if (value == null)
- _NowPlayingInfo = null;
- else
- _NowPlayingInfo = value.ToDictionary ();
+ _NowPlayingInfo = value?.ToDictionary ();
}
}
}
}
-#endif
\ No newline at end of file
+#endif
diff --git a/src/MediaPlayer/MPPlayableContentDelegate.cs b/src/MediaPlayer/MPPlayableContentDelegate.cs
index fcf60518ee7d..a352ec774669 100644
--- a/src/MediaPlayer/MPPlayableContentDelegate.cs
+++ b/src/MediaPlayer/MPPlayableContentDelegate.cs
@@ -7,7 +7,7 @@
namespace XamCore.MediaPlayer {
public partial class MPPlayableContentDelegate {
- [Obsolete ("Use InitiatePlaybackOfContentItem instead")]
+ [Obsolete ("Use 'InitiatePlaybackOfContentItem' instead.")]
public virtual void PlayableContentManager (MPPlayableContentManager contentManager, NSIndexPath indexPath, Action completionHandler)
{
InitiatePlaybackOfContentItem (contentManager, indexPath, completionHandler);
@@ -16,7 +16,7 @@ public virtual void PlayableContentManager (MPPlayableContentManager contentMana
}
public static partial class MPPlayableContentDelegate_Extensions {
- [Obsolete ("Use InitiatePlaybackOfContentItem instead")]
+ [Obsolete ("Use 'InitiatePlaybackOfContentItem' instead.")]
public static void PlayableContentManager (this IMPPlayableContentDelegate This, MPPlayableContentManager contentManager, NSIndexPath indexPath, Action completionHandler)
{
This.InitiatePlaybackOfContentItem (contentManager, indexPath, completionHandler);
@@ -28,7 +28,7 @@ public static void PlayableContentManager (this IMPPlayableContentDelegate This,
public partial class MPPlayableContentDataSource : NSObject {
[Unavailable (PlatformName.MacOSX, PlatformArchitecture.All)]
[Introduced (PlatformName.iOS, 10, 0)]
- [Obsolete ("Use 'MPPlayableContentDataSource_Extensions.GetContentItemAsync' instead")]
+ [Obsolete ("Use 'MPPlayableContentDataSource_Extensions.GetContentItemAsync' instead.")]
public unsafe virtual Task GetContentItemAsync (string identifier)
{
return MPPlayableContentDataSource_Extensions.GetContentItemAsync (this, identifier);
diff --git a/src/MediaPlayer/MediaPlayer.cs b/src/MediaPlayer/MediaPlayer.cs
index 8fe8f54ccb29..c878d08cef4c 100644
--- a/src/MediaPlayer/MediaPlayer.cs
+++ b/src/MediaPlayer/MediaPlayer.cs
@@ -18,6 +18,7 @@ namespace XamCore.MediaPlayer {
[Native]
[NoMac]
[NoTV]
+ [Availability (Deprecated = Platform.iOS_9_0)]
public enum MPMoviePlaybackState : nint {
Stopped,
Playing,
@@ -31,6 +32,7 @@ public enum MPMoviePlaybackState : nint {
[Native]
[NoMac]
[NoTV]
+ [Availability (Deprecated = Platform.iOS_9_0)]
public enum MPMovieLoadState : nint {
Unknown = 0,
Playable = 1 << 0,
@@ -275,6 +277,8 @@ public enum MPRemoteCommandHandlerStatus : nint {
NoSuchContent = 100,
[iOS (9,1)]
NoActionableNowPlayingItem = 110,
+ [iOS (11,0)][TV (11,0)][Mac (10,13)]
+ DeviceNotFound = 120,
CommandFailed = 200
}
diff --git a/src/Metal/Defs.cs b/src/Metal/Defs.cs
index 955ee40b1237..ad007fdaec51 100644
--- a/src/Metal/Defs.cs
+++ b/src/Metal/Defs.cs
@@ -92,6 +92,21 @@ public override string ToString ()
}
}
+ [StructLayout (LayoutKind.Sequential)]
+ public struct MTLSamplePosition
+ {
+ public float X;
+
+ public float Y;
+
+ public MTLSamplePosition (float x, float y)
+ {
+ this.X = x;
+ this.Y = y;
+ }
+ }
+
+
public struct MTLClearColor {
public double Red, Green, Blue, Alpha;
diff --git a/src/Metal/MTLArgumentEncoder.cs b/src/Metal/MTLArgumentEncoder.cs
new file mode 100644
index 000000000000..a4d1f1e7f187
--- /dev/null
+++ b/src/Metal/MTLArgumentEncoder.cs
@@ -0,0 +1,13 @@
+#if XAMCORE_2_0
+using System;
+
+namespace XamCore.Metal {
+ public static partial class MTLArgumentEncoder_Extensions {
+ public unsafe static void SetBuffers (this IMTLArgumentEncoder This, IMTLBuffer [] buffers, nint [] offsets, Foundation.NSRange range)
+ {
+ fixed (void* handle = offsets)
+ This.SetBuffers (buffers, (IntPtr)handle, range);
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/src/Metal/MTLArrays.cs b/src/Metal/MTLArrays.cs
index 3d60902a249c..6c2a43444548 100644
--- a/src/Metal/MTLArrays.cs
+++ b/src/Metal/MTLArrays.cs
@@ -79,5 +79,31 @@ public MTLAttributeDescriptor this [nuint idx] {
}
}
}
+
+ public partial class MTLPipelineBufferDescriptorArray {
+ public MTLPipelineBufferDescriptor this [nuint index]
+ {
+ get {
+ return GetObject (index);
+ }
+ set {
+ SetObject (value, index);
+ }
+ }
+ }
+
+#if IOS
+ public partial class MTLTileRenderPipelineColorAttachmentDescriptorArray {
+ public MTLTileRenderPipelineColorAttachmentDescriptor this [nuint index]
+ {
+ get {
+ return GetObject (index);
+ }
+ set {
+ SetObject (value, index);
+ }
+ }
+ }
+#endif
}
#endif
diff --git a/src/Metal/MTLCompat.cs b/src/Metal/MTLCompat.cs
index 1273027e501e..3d14882e433b 100644
--- a/src/Metal/MTLCompat.cs
+++ b/src/Metal/MTLCompat.cs
@@ -4,19 +4,6 @@
namespace XamCore.Metal {
-#if IOS || TVOS
- public static partial class MTLRenderCommandEncoder_Extensions {
-
- // Apple removed this in Xcode 8
- [Introduced (PlatformName.iOS, 9,0)]
- [Deprecated (PlatformName.iOS, 10,0, message: "Removed in iOS 10")]
- [Introduced (PlatformName.TvOS, 9,1)]
- [Deprecated (PlatformName.TvOS, 10,0, message: "Removed in tvOS 10")]
- public static void SetDepthClipMode (IMTLRenderCommandEncoder This, MTLDepthClipMode depthClipMode)
- {
- }
- }
-#endif
}
#endif
diff --git a/src/Metal/MTLDevice.cs b/src/Metal/MTLDevice.cs
index d28c7297bd7c..bdebca9564dc 100644
--- a/src/Metal/MTLDevice.cs
+++ b/src/Metal/MTLDevice.cs
@@ -16,6 +16,10 @@
using XamCore.ObjCRuntime;
namespace XamCore.Metal {
+#if MONOMAC
+ [Advice ("The 'NSString' argument will match a property of 'MTLDeviceNotificationHandler'.")]
+ public delegate void MTLDeviceNotificationHandler (IMTLDevice device, NSString notifyName);
+#endif
[iOS (8,0)][Mac (10,11)]
public static partial class MTLDevice {
@@ -42,6 +46,73 @@ public static IMTLDevice SystemDefault {
return system_default;
}
}
+
+#if MONOMAC
+ [Mac (10,11, onlyOn64: true), NoiOS, NoWatch, NoTV]
+ [DllImport (Constants.MetalLibrary)]
+ unsafe static extern IntPtr MTLCopyAllDevices ();
+
+ [Mac (10,11, onlyOn64: true), NoiOS, NoWatch, NoTV]
+ public static IMTLDevice [] GetAllDevices ()
+ {
+ var rv = MTLCopyAllDevices ();
+ return NSArray.ArrayFromHandle (rv);
+ }
+
+ [Mac (10, 13, onlyOn64: true), NoiOS, NoWatch, NoTV]
+ [DllImport (Constants.MetalLibrary)]
+ unsafe static extern IntPtr MTLCopyAllDevicesWithObserver (ref IntPtr observer, void* handler);
+
+ [Mac (10, 13, onlyOn64: true), NoiOS, NoWatch, NoTV]
+ public static IMTLDevice [] GetAllDevices (ref NSObject observer, MTLDeviceNotificationHandler handler)
+ {
+ if (observer == null)
+ throw new ArgumentNullException ("observer");
+
+ IntPtr handle = observer.Handle;
+
+ unsafe
+ {
+ BlockLiteral* block_ptr_handler;
+ BlockLiteral block_handler;
+ block_handler = new BlockLiteral ();
+ block_ptr_handler = &block_handler;
+ block_handler.SetupBlock (static_notificationHandler, handler);
+
+ var rv = MTLCopyAllDevicesWithObserver (ref handle, (void*) block_ptr_handler);
+ var obj = NSArray.ArrayFromHandle (rv);
+
+ if (handle != observer.Handle)
+ observer = Runtime.GetNSObject (handle);
+
+ return obj;
+ }
+ }
+
+ internal delegate void InnerNotification (IntPtr block, IntPtr device, IntPtr notifyName);
+ static readonly InnerNotification static_notificationHandler = TrampolineNotificationHandler;
+ [MonoPInvokeCallback (typeof (InnerNotification))]
+ public static unsafe void TrampolineNotificationHandler (IntPtr block, IntPtr device, IntPtr notifyName)
+ {
+ var descriptor = (BlockLiteral*) block;
+ var del = (MTLDeviceNotificationHandler) (descriptor->Target);
+ if (del != null)
+ del ((IMTLDevice) Runtime.GetNSObject (device), (XamCore.Foundation.NSString) Runtime.GetNSObject (notifyName));
+ }
+
+ [Mac (10, 13, onlyOn64: true), NoiOS, NoWatch, NoTV]
+ [DllImport (Constants.MetalLibrary)]
+ static extern void MTLRemoveDeviceObserver (IntPtr observer);
+
+ [Mac (10, 13, onlyOn64: true), NoiOS, NoWatch, NoTV]
+ public static void RemoveObserver (NSObject observer)
+ {
+ if (observer == null)
+ throw new ArgumentNullException ("observer");
+
+ MTLRemoveDeviceObserver (observer.Handle);
+ }
+#endif
}
public static partial class MTLDevice_Extensions {
@@ -61,11 +132,19 @@ public static IMTLBuffer CreateBufferNoCopy (this IMTLDevice This, T [] data,
var handle = GCHandle.Alloc (data, GCHandleType.Pinned); // This requires a pinned GCHandle, since it's not possible to use unsafe code to get the address of a generic object.
try {
IntPtr ptr = handle.AddrOfPinnedObject ();
- return This.CreateBufferNoCopy (ptr, (nuint)(data.Length * Marshal.SizeOf (typeof (T))) , options, deallocator);
+ return This.CreateBufferNoCopy (ptr, (nuint)(data.Length * Marshal.SizeOf (typeof (T))), options, deallocator);
} finally {
handle.Free ();
}
}
+
+ public unsafe static void GetDefaultSamplePositions (this IMTLDevice This, MTLSamplePosition [] positions, nuint count)
+ {
+ if (positions.Length < (nint)count)
+ throw new ArgumentException ("Length of 'positions' cannot be less than 'count'.");
+ fixed (void * handle = positions)
+ GetDefaultSamplePositions (This, (IntPtr)handle, count);
+ }
}
}
#endif
\ No newline at end of file
diff --git a/src/Metal/MTLEnums.cs b/src/Metal/MTLEnums.cs
index 21fb0f6e7f78..dd2129513d26 100644
--- a/src/Metal/MTLEnums.cs
+++ b/src/Metal/MTLEnums.cs
@@ -79,6 +79,8 @@ public enum MTLCommandBufferError : nuint {
InvalidResource = 9,
[iOS (10,0), TV (10,0), NoWatch, NoMac]
Memoryless = 10,
+ [Mac (10,13), NoiOS, NoTV, NoWatch]
+ DeviceRemoved = 11,
}
[Native]
@@ -93,6 +95,8 @@ public enum MTLStoreAction : nuint {
StoreAndMultisampleResolve,
[iOS (10,0), TV (10,0), NoWatch, Mac (10,12)]
Unknown,
+ [iOS (11,0), TV (11,0), NoWatch, Mac (10,13)]
+ CustomSampleDepthStore,
}
[Native]
@@ -191,6 +195,29 @@ public enum MTLVertexFormat : nuint {
Int1010102Normalized = 40,
UInt1010102Normalized = 41,
+
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ UChar4NormalizedBgra = 42,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ UChar = 45,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ Char = 46,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ UCharNormalized = 47,
+
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ CharNormalized = 48,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ UShort = 49,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ Short = 50,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ UShortNormalized = 51,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ ShortNormalized = 52,
+
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ Half = 53,
}
[Mac (10,11)]
@@ -203,7 +230,7 @@ public enum MTLPixelFormat : nuint {
#if MONOMAC
R8Unorm_sRGB = 11,
#elif !XAMCORE_3_0
- [Obsolete ("Only available on OSX")]
+ [Obsolete ("Only available on macOS.")]
R8Unorm_sRGB = 11,
#endif
R8Snorm = 12,
@@ -246,6 +273,8 @@ public enum MTLPixelFormat : nuint {
RGB10A2Uint = 91,
RG11B10Float = 92,
RGB9E5Float = 93,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ BGR10A2Unorm = 94,
RG32Uint = 103,
RG32Sint = 104,
RG32Float = 105,
@@ -474,7 +503,7 @@ public enum MTLResourceOptions : nuint {
[iOS (10,0), TV (10,0), NoWatch, NoMac]
StorageModeMemoryless = MTLStorageMode.Memoryless << 4,
- [iOS (10,0), TV (10,0), NoWatch, NoMac]
+ [iOS (10,0), TV (10,0), NoWatch, Mac (10,13)]
HazardTrackingModeUntracked = 1 << 8,
}
@@ -563,7 +592,28 @@ public enum MTLDataType : nuint {
Bool = 53,
Bool2 = 54,
Bool3 = 55,
- Bool4 = 56
+ Bool4 = 56,
+
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch] Texture = 58,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch] Sampler = 59,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch] Pointer = 60,
+
+ [NoMac, iOS (11,0), NoTV, NoWatch] R8Unorm = 62,
+ [NoMac, iOS (11,0), NoTV, NoWatch] R8Snorm = 63,
+ [NoMac, iOS (11,0), NoTV, NoWatch] R16Unorm = 64,
+ [NoMac, iOS (11,0), NoTV, NoWatch] R16Snorm = 65,
+ [NoMac, iOS (11,0), NoTV, NoWatch] Rg8Unorm = 66,
+ [NoMac, iOS (11,0), NoTV, NoWatch] Rg8Snorm = 67,
+ [NoMac, iOS (11,0), NoTV, NoWatch] Rg16Unorm = 68,
+ [NoMac, iOS (11,0), NoTV, NoWatch] Rg16Snorm = 69,
+ [NoMac, iOS (11,0), NoTV, NoWatch] Rgba8Unorm = 70,
+ [NoMac, iOS (11,0), NoTV, NoWatch] Rgba8Unorm_sRgb = 71,
+ [NoMac, iOS (11,0), NoTV, NoWatch] Rgba8Snorm = 72,
+ [NoMac, iOS (11,0), NoTV, NoWatch] Rgba16Unorm = 73,
+ [NoMac, iOS (11,0), NoTV, NoWatch] Rgba16Snorm = 74,
+ [NoMac, iOS (11,0), NoTV, NoWatch] Rgb10A2Unorm = 75,
+ [NoMac, iOS (11,0), NoTV, NoWatch] Rg11B10Float = 76,
+ [NoMac, iOS (11,0), NoTV, NoWatch] Rgb9E5Float = 77,
}
[Native]
@@ -572,6 +622,9 @@ public enum MTLArgumentType : nuint {
ThreadgroupMemory= 1,
Texture = 2,
Sampler = 3,
+
+ [NoMac, iOS (11,0), NoTV, NoWatch] ImageblockData = 16,
+ [NoMac, iOS (11,0), NoTV, NoWatch] Imageblock = 17,
}
[Native]
@@ -598,21 +651,42 @@ public enum MTLFeatureSet : nuint {
iOS_GPUFamily2_v3 = 6,
[iOS (10,0), NoTV, NoWatch, NoMac]
iOS_GPUFamily3_v2 = 7,
-
- [Mac (10,11)]
- OSX_GPUFamily1_v1 = 10000,
-
- [NoiOS, NoTV, NoWatch, Mac (10,12)]
- OSX_GPUFamily1_v2 = 10001,
-
- [NoiOS, NoTV, NoWatch, Mac (10,12)]
- OSX_ReadWriteTextureTier2 = 10002,
+ [iOS (11,0), NoTV, NoWatch, NoMac]
+ iOS_GPUFamily1_v4 = 8,
+ [iOS (11,0), NoTV, NoWatch, NoMac]
+ iOS_GPUFamily2_v4 = 9,
+ [iOS (11,0), NoTV, NoWatch, NoMac]
+ iOS_GPUFamily3_v3 = 10,
+ [iOS (11,0), NoTV, NoWatch, NoMac]
+ iOS_GPUFamily4_v1 = 11,
+
+ [Mac (10,11), NoiOS, NoTV, NoWatch]
+ macOS_GPUFamily1_v1 = 10000,
+
+ [Availability (Introduced = Platform.Mac_10_11, Deprecated = Platform.Mac_10_13, Message="Use 'macOS_GPUFamily1_v1' instead.")]
+ OSX_GPUFamily1_v1 = macOS_GPUFamily1_v1,
+
+ [Mac (10,13), NoiOS, NoTV, NoWatch]
+ macOS_GPUFamily1_v2 = 10001,
+ [Availability (Introduced = Platform.Mac_10_12, Deprecated = Platform.Mac_10_13, Message="Use 'macOS_GPUFamily1_v2' instead.")]
+ OSX_GPUFamily1_v2 = macOS_GPUFamily1_v2,
+
+ [Mac (10,13), NoiOS, NoTV, NoWatch]
+ macOS_ReadWriteTextureTier2 = 10002,
+ [Availability (Introduced = Platform.Mac_10_12, Deprecated = Platform.Mac_10_13, Message="Use 'macOS_ReadWriteTextureTier2' instead.")]
+ OSX_ReadWriteTextureTier2 = macOS_ReadWriteTextureTier2,
+
+ [Mac (10,13), NoiOS, NoTV, NoWatch]
+ macOS_GPUFamily1_v3 = 10003,
[TV (9,0)]
TVOS_GPUFamily1_v1 = 30000,
[NoiOS, TV (10,0), NoWatch, NoMac]
- tvOS_GPUFamily1_v2 = 30001
+ tvOS_GPUFamily1_v2 = 30001,
+
+ [NoiOS, TV (11,0), NoWatch, NoMac]
+ tvOS_GPUFamily2_v1 = 30003,
}
[iOS (9,0)][Mac (10,11)]
@@ -624,6 +698,8 @@ public enum MTLLanguageVersion : nuint {
v1_1 = (1 << 16) + 1,
[iOS (10,0), TV (10,0), NoWatch, Mac (10,12)]
v1_2 = (1 << 16) + 2,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ v2_0 = (2 << 16),
}
[iOS (9,0)][Mac (10,11)]
@@ -662,6 +738,9 @@ public enum MTLMultisampleDepthResolveFilter : nuint{
Sample0, Min, Max
}
+#if XAMCORE_4_0
+ [NoiOS][NoTV]
+#endif
[Mac (10,12)]
[Native]
public enum MTLSamplerBorderColor : nuint {
@@ -764,7 +843,27 @@ public enum MTLAttributeFormat : nuint {
UInt3 = 38,
UInt4 = 39,
Int1010102Normalized = 40,
- UInt1010102Normalized = 41
+ UInt1010102Normalized = 41,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ UChar4Normalized_Bgra = 42,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ UChar = 45,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ Char = 46,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ UCharNormalized = 47,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ CharNormalized = 48,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ UShort = 49,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ Short = 50,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ UShortNormalized = 51,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ ShortNormalized = 52,
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ Half = 53,
}
[iOS (10,0), TV (10,0), NoWatch, Mac (10,12)]
@@ -787,5 +886,48 @@ public enum MTLRenderStages : nuint {
Vertex = (1 << 0),
Fragment = (1 << 1)
}
+
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ [Native, Flags]
+ public enum MTLResourceUsage : nuint
+ {
+ Read = 1 << 0,
+ Write = 1 << 1,
+ Sample = 1 << 2,
+ }
+
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ [Native]
+ public enum MTLMutability : nuint
+ {
+ Default = 0,
+ Mutable = 1,
+ Immutable = 2,
+ }
+
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ [Native]
+ public enum MTLReadWriteTextureTier : nuint
+ {
+ None = 0,
+ One = 1,
+ Two = 2,
+ }
+
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ [Native]
+ public enum MTLArgumentBuffersTier : nuint
+ {
+ One = 0,
+ Two = 1,
+ }
+
+ [Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
+ [Native, Flags]
+ public enum MTLStoreActionOptions : nuint
+ {
+ None = 0,
+ CustomSamplePositions = 1 << 0,
+ }
}
#endif
diff --git a/src/Metal/MTLRenderCommandEncoder.cs b/src/Metal/MTLRenderCommandEncoder.cs
new file mode 100644
index 000000000000..0cc9c36b1dbb
--- /dev/null
+++ b/src/Metal/MTLRenderCommandEncoder.cs
@@ -0,0 +1,45 @@
+#if XAMCORE_2_0 && MONOMAC
+using System;
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+
+using XamCore.Foundation;
+using XamCore.ObjCRuntime;
+
+namespace XamCore.Metal {
+ public static class IMTLRenderCommandEncoder_Extensions {
+ [Mac (10,13, onlyOn64: true), NoiOS, NoTV, NoWatch]
+ public unsafe static void SetViewports (this IMTLRenderCommandEncoder This, MTLViewport [] viewports)
+ {
+ fixed (void* handle = viewports)
+ This.SetViewports ((IntPtr)handle, (nuint)(viewports?.Length ?? 0));
+ }
+
+ [Mac (10,13, onlyOn64: true), NoiOS, NoTV, NoWatch]
+ public unsafe static void SetScissorRects (this IMTLRenderCommandEncoder This, MTLScissorRect [] scissorRects)
+ {
+ fixed (void* handle = scissorRects)
+ This.SetScissorRects ((IntPtr)handle, (nuint)(scissorRects?.Length ?? 0));
+ }
+
+#if IOS
+ [iOS (11,0), NoTV, NoMac, NoWatch]
+ public unsafe static void SetTileBuffers (this IMTLRenderCommandEncoder This, IMTLBuffer[] buffers, nuint[] offsets, NSRange range)
+ {
+ fixed (void* handle = offsets)
+ This.SetTileBuffers (buffers, (IntPtr)handle, range);
+ }
+
+ [iOS (11,0), NoTV, NoMac, NoWatch]
+ public unsafe static void SetTileSamplerStates (this IMTLRenderCommandEncoder This, IMTLSamplerState[] samplers, float[] lodMinClamps, float[] lodMaxClamps, NSRange range)
+ {
+ fixed (void* minHandle = lodMinClamps) {
+ fixed (void* maxHandle = lodMaxClamps) {
+ This.SetTileSamplerStates (samplers, (IntPtr)minHandle, (IntPtr)maxHandle, range);
+ }
+ }
+ }
+#endif
+ }
+}
+#endif
diff --git a/src/Metal/MTLRenderPassDescriptor.cs b/src/Metal/MTLRenderPassDescriptor.cs
new file mode 100644
index 000000000000..1bff58de838a
--- /dev/null
+++ b/src/Metal/MTLRenderPassDescriptor.cs
@@ -0,0 +1,21 @@
+#if XAMCORE_2_0 && !COREBUILD
+using System;
+
+namespace XamCore.Metal {
+ public partial class MTLRenderPassDescriptor {
+ public unsafe void SetSamplePositions (MTLSamplePosition [] positions)
+ {
+ fixed (void* handle = positions)
+ SetSamplePositions ((IntPtr)handle, (nuint)(positions?.Length ?? 0));
+ }
+
+ public unsafe nuint GetSamplePositions (MTLSamplePosition [] positions)
+ {
+ fixed (void* handle = positions) {
+ nuint count = GetSamplePositions ((IntPtr)handle, (nuint)(positions?.Length ?? 0));
+ return count;
+ }
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/src/ModelIO/MDLTransform.cs b/src/ModelIO/MDLTransform.cs
new file mode 100644
index 000000000000..c8259bd27bb9
--- /dev/null
+++ b/src/ModelIO/MDLTransform.cs
@@ -0,0 +1,16 @@
+#if XAMCORE_2_0 || !MONOMAC
+using System;
+using MatrixFloat4x4 = global::OpenTK.NMatrix4;
+
+namespace XamCore.ModelIO {
+ public partial class MDLTransform {
+#if !XAMCORE_4_0
+ // Inlined from the MDLTransformComponent protocol.
+ public static MatrixFloat4x4 CreateGlobalTransform4x4 (MDLObject obj, double atTime)
+ {
+ return MatrixFloat4x4.Transpose ((MatrixFloat4x4) CreateGlobalTransform (obj, atTime));
+ }
+#endif
+ }
+}
+#endif
\ No newline at end of file
diff --git a/src/ModelIO/MDLTransformComponent.cs b/src/ModelIO/MDLTransformComponent.cs
new file mode 100644
index 000000000000..fa59063cac47
--- /dev/null
+++ b/src/ModelIO/MDLTransformComponent.cs
@@ -0,0 +1,33 @@
+#if XAMCORE_2_0 && !XAMCORE_4_0
+using OpenTK;
+using MatrixFloat4x4 = global::OpenTK.NMatrix4;
+
+namespace XamCore.ModelIO {
+ public partial class MDLTransformComponent_Extensions {
+ public static MatrixFloat4x4 GetMatrix4x4 (this IMDLTransformComponent self)
+ {
+ return MatrixFloat4x4.Transpose ((MatrixFloat4x4) self.Matrix);
+ }
+
+ public static void SetMatrix4x4 (this IMDLTransformComponent self, MatrixFloat4x4 value)
+ {
+ self.Matrix = (Matrix4) MatrixFloat4x4.Transpose (value);
+ }
+
+ public static MatrixFloat4x4 GetLocalTransform4x4(this IMDLTransformComponent This, double time)
+ {
+ return MatrixFloat4x4.Transpose ((MatrixFloat4x4) GetLocalTransform (This, time));
+ }
+
+ public static void SetLocalTransform4x4 (this IMDLTransformComponent This, MatrixFloat4x4 transform, double time)
+ {
+ SetLocalTransform (This, (Matrix4) MatrixFloat4x4.Transpose (transform), time);
+ }
+
+ public static void SetLocalTransform4x4 (this IMDLTransformComponent This, MatrixFloat4x4 transform)
+ {
+ SetLocalTransform (This, (Matrix4) MatrixFloat4x4.Transpose (transform));
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/src/ModelIO/MIEnums.cs b/src/ModelIO/MIEnums.cs
index 3f1bec93727f..586f73b1fe3e 100644
--- a/src/ModelIO/MIEnums.cs
+++ b/src/ModelIO/MIEnums.cs
@@ -18,6 +18,8 @@
using Vector2 = global::OpenTK.Vector2;
using Vector3 = global::OpenTK.Vector3;
using Vector4 = global::OpenTK.Vector4;
+using Vector4i = global::OpenTK.Vector4i;
+using VectorInt4 = global::OpenTK.Vector4i;
using Matrix2 = global::OpenTK.Matrix2;
using Matrix3 = global::OpenTK.Matrix3;
using Matrix4 = global::OpenTK.Matrix4;
@@ -250,6 +252,8 @@ public enum MDLLightType : nuint
Environment
}
+#if !XAMCORE_4_0
+ [Obsolete ("Use 'MDLVoxelIndexExtent2' instead.")]
[StructLayout(LayoutKind.Sequential)]
public struct MDLVoxelIndexExtent {
public MDLVoxelIndexExtent (Vector4 minimumExtent, Vector4 maximumExtent)
@@ -259,6 +263,27 @@ public MDLVoxelIndexExtent (Vector4 minimumExtent, Vector4 maximumExtent)
}
public Vector4 MinimumExtent, MaximumExtent;
}
+#endif
+
+ [StructLayout(LayoutKind.Sequential)]
+#if XAMCORE_4_0
+ public struct MDLVoxelIndexExtent {
+#else
+ public struct MDLVoxelIndexExtent2 {
+#endif
+ public VectorInt4 MinimumExtent { get; private set; }
+ public VectorInt4 MaximumExtent { get; private set; }
+
+#if XAMCORE_4_0
+ public MDLVoxelIndexExtent (VectorInt4 minimumExtent, VectorInt4 maximumExtent)
+#else
+ public MDLVoxelIndexExtent2 (VectorInt4 minimumExtent, VectorInt4 maximumExtent)
+#endif
+ {
+ this.MinimumExtent = minimumExtent;
+ this.MaximumExtent = maximumExtent;
+ }
+ }
[Native]
public enum MDLCameraProjection : nuint
diff --git a/src/NativeTypes/Drawing.tt b/src/NativeTypes/Drawing.tt
index a4313674e4b7..b0b51f5a23f1 100644
--- a/src/NativeTypes/Drawing.tt
+++ b/src/NativeTypes/Drawing.tt
@@ -224,13 +224,13 @@ namespace XamCore.CoreGraphics
}
#if !XAMCORE_3_0
- [Obsolete ("Use ToRoundedCGSize instead")]
+ [Obsolete ("Use 'ToRoundedCGSize' instead.")]
public CGSize ToSize ()
{
return ToRoundedCGSize ();
}
- [Obsolete ("Use ToCGPoint instead")]
+ [Obsolete ("Use 'ToCGPoint' instead.")]
public CGPoint ToPointF ()
{
return (CGPoint)this;
diff --git a/src/NetworkExtension/NECompat.cs b/src/NetworkExtension/NECompat.cs
index 913895ed4988..688cede9a80a 100644
--- a/src/NetworkExtension/NECompat.cs
+++ b/src/NetworkExtension/NECompat.cs
@@ -9,7 +9,7 @@ namespace XamCore.NetworkExtension {
#if !XAMCORE_4_0
public partial class NEPacketTunnelNetworkSettings {
- [Obsolete ("This constructor does not create a valid instance of the type")]
+ [Obsolete ("This constructor does not create a valid instance of the type.")]
public NEPacketTunnelNetworkSettings () : base (NSObjectFlag.Empty)
{
}
@@ -17,7 +17,7 @@ public NEPacketTunnelNetworkSettings () : base (NSObjectFlag.Empty)
public partial class NEPacketTunnelProvider {
- [Obsolete ("Use the overload accepting a INWTcpConnectionAuthenticationDelegate argument")]
+ [Obsolete ("Use the overload accepting a 'INWTcpConnectionAuthenticationDelegate' argument.")]
public virtual NWTcpConnection CreateTcpConnection (NWEndpoint remoteEndpoint, bool enableTls, NWTlsParameters tlsParameters, NWTcpConnectionAuthenticationDelegate @delegate)
{
return CreateTcpConnection (remoteEndpoint, enableTls, tlsParameters, (INWTcpConnectionAuthenticationDelegate) @delegate);
@@ -26,7 +26,7 @@ public virtual NWTcpConnection CreateTcpConnection (NWEndpoint remoteEndpoint, b
public partial class NWTcpConnectionAuthenticationDelegate : NSObject {
- [Obsolete ("Use 'NWTcpConnectionAuthenticationDelegate_Extensions.EvaluateTrustAsync' instead")]
+ [Obsolete ("Use 'NWTcpConnectionAuthenticationDelegate_Extensions.EvaluateTrustAsync' instead.")]
public unsafe virtual Task EvaluateTrustAsync (NWTcpConnection connection, NSArray peerCertificateChain)
{
return NWTcpConnectionAuthenticationDelegate_Extensions.EvaluateTrustAsync (this, connection, peerCertificateChain);
diff --git a/src/ObjCRuntime/Dlfcn.cs b/src/ObjCRuntime/Dlfcn.cs
index 7d85761898f8..764c2e832770 100644
--- a/src/ObjCRuntime/Dlfcn.cs
+++ b/src/ObjCRuntime/Dlfcn.cs
@@ -169,6 +169,22 @@ public static void SetInt32 (IntPtr handle, string symbol, int value)
return;
Marshal.WriteInt32 (indirect, value);
}
+
+ public static uint GetUInt32 (IntPtr handle, string symbol)
+ {
+ var indirect = dlsym (handle, symbol);
+ if (indirect == IntPtr.Zero)
+ return 0;
+ return (uint) Marshal.ReadInt32 (indirect);
+ }
+
+ public static void SetUInt32 (IntPtr handle, string symbol, uint value)
+ {
+ var indirect = dlsym (handle, symbol);
+ if (indirect == IntPtr.Zero)
+ return;
+ Marshal.WriteInt32 (indirect, (int) value);
+ }
public static long GetInt64 (IntPtr handle, string symbol)
{
@@ -186,6 +202,24 @@ public static void SetInt64 (IntPtr handle, string symbol, long value)
Marshal.WriteInt64 (indirect, value);
}
+ public static ulong GetUInt64 (IntPtr handle, string symbol)
+ {
+ var indirect = dlsym (handle, symbol);
+ if (indirect == IntPtr.Zero)
+ return 0;
+
+ return (ulong) Marshal.ReadInt64 (indirect);
+ }
+
+ public static void SetUInt64 (IntPtr handle, string symbol, long value)
+ {
+ var indirect = dlsym (handle, symbol);
+ if (indirect == IntPtr.Zero)
+ return;
+
+ Marshal.WriteInt64 (indirect, (long) value);
+ }
+
public static void SetString (IntPtr handle, string symbol, string value)
{
var indirect = dlsym (handle, symbol);
@@ -222,11 +256,21 @@ public static nint GetNInt (IntPtr handle, string symbol)
return (nint)GetIntPtr (handle, symbol);
}
+ public static void SetNInt (IntPtr handle, string symbol, nint value)
+ {
+ SetIntPtr (handle, symbol, (IntPtr) value);
+ }
+
public static nuint GetNUInt (IntPtr handle, string symbol)
{
return (nuint)GetIntPtr (handle, symbol);
}
+ public static void SetNUInt (IntPtr handle, string symbol, nuint value)
+ {
+ SetIntPtr (handle, symbol, (IntPtr) value);
+ }
+
public static nfloat GetNFloat (IntPtr handle, string symbol)
{
var indirect = dlsym (handle, symbol);
@@ -240,6 +284,18 @@ public static nfloat GetNFloat (IntPtr handle, string symbol)
return (nfloat) (*(double *) indirect);
}
}
+
+ public static void SetNFloat (IntPtr handle, string symbol, nfloat value)
+ {
+ var indirect = dlsym (handle, symbol);
+ if (indirect == IntPtr.Zero)
+ return;
+
+ unsafe {
+ nfloat* ptr = (nfloat*) indirect;
+ *ptr = value;
+ }
+ }
#endif
public static IntPtr GetIntPtr (IntPtr handle, string symbol)
diff --git a/src/ObjCRuntime/DynamicRegistrar.cs b/src/ObjCRuntime/DynamicRegistrar.cs
index cbba70861e37..b10d69020e8d 100644
--- a/src/ObjCRuntime/DynamicRegistrar.cs
+++ b/src/ObjCRuntime/DynamicRegistrar.cs
@@ -809,10 +809,10 @@ public void AddCustomType (Type type)
custom_type_map [type] = null;
}
- public UnmanagedMethodDescription GetMethodDescriptionAndObject (Type type, IntPtr selector, IntPtr obj, ref IntPtr mthis)
+ public UnmanagedMethodDescription GetMethodDescriptionAndObject (Type type, IntPtr selector, bool is_static, IntPtr obj, ref IntPtr mthis)
{
var sel = new Selector (selector);
- var res = GetMethodNoThrow (type, type, sel.Name);
+ var res = GetMethodNoThrow (type, type, sel.Name, is_static);
if (res == null)
throw ErrorHelper.CreateError (8006, "Failed to find the selector '{0}' on the type '{1}'", sel.Name, type.FullName);
@@ -856,10 +856,10 @@ internal static MethodInfo FindClosedMethod (Type closed_type, MethodBase open_m
throw ErrorHelper.CreateError (8003, "Failed to find the closed generic method '{0}' on the type '{1}'.", open_method.Name, closed_type.FullName);
}
- public UnmanagedMethodDescription GetMethodDescription (Type type, IntPtr selector)
+ public UnmanagedMethodDescription GetMethodDescription (Type type, IntPtr selector, bool is_static)
{
var sel = new Selector (selector);
- var res = GetMethodNoThrow (type, type, sel.Name);
+ var res = GetMethodNoThrow (type, type, sel.Name, is_static);
if (res == null)
throw ErrorHelper.CreateError (8006, "Failed to find the selector '{0}' on the type '{1}'", sel.Name, type.FullName);
if (type.IsGenericType && res.Method is ConstructorInfo)
@@ -868,7 +868,7 @@ public UnmanagedMethodDescription GetMethodDescription (Type type, IntPtr select
return res.MethodDescription.GetUnmanagedDescription ();
}
- ObjCMethod GetMethodNoThrow (Type original_type, Type type, string selector)
+ ObjCMethod GetMethodNoThrow (Type original_type, Type type, string selector, bool is_static)
{
var objcType = RegisterType (type);
@@ -877,8 +877,8 @@ ObjCMethod GetMethodNoThrow (Type original_type, Type type, string selector)
ObjCMember member = null;
- if (type.BaseType != typeof (object) && !objcType.Map.TryGetValue (selector, out member))
- return GetMethodNoThrow (original_type, type.BaseType, selector);
+ if (type.BaseType != typeof (object) && !objcType.TryGetMember (selector, is_static, out member))
+ return GetMethodNoThrow (original_type, type.BaseType, selector, is_static);
var method = member as ObjCMethod;
diff --git a/src/ObjCRuntime/PlatformAvailability.cs b/src/ObjCRuntime/PlatformAvailability.cs
index 8b2e905829a3..46c9643b7c8c 100644
--- a/src/ObjCRuntime/PlatformAvailability.cs
+++ b/src/ObjCRuntime/PlatformAvailability.cs
@@ -39,7 +39,7 @@ namespace XamCore.ObjCRuntime
// Only iOS and Mac versions and architectures can be ORed together.
//
[Flags]
- [Obsolete ("Use [Introduced|Deprecated|Obsoleted|Unavailable] attributes with PlatformName")]
+ [Obsolete ("Use [Introduced|Deprecated|Obsoleted|Unavailable] attributes with PlatformName.")]
public enum Platform : ulong
{
None = 0,
@@ -106,7 +106,7 @@ public enum Platform : ulong
iOS_Arch = 0x00000000ff000000
}
- [Obsolete ("Use [Introduced|Deprecated|Obsoleted|Unavailable] attributes with PlatformName")]
+ [Obsolete ("Use [Introduced|Deprecated|Obsoleted|Unavailable] attributes with PlatformName.")]
public static class PlatformHelper
{
public static bool IsValid (this Platform platform)
@@ -348,7 +348,7 @@ public static bool CheckSystemVersion (int major, int minor)
}
[AttributeUsage (AttributeTargets.All, AllowMultiple = true)]
- [Obsolete ("Use [Introduced|Deprecated|Obsoleted|Unavailable] attributes with PlatformName")]
+ [Obsolete ("Use [Introduced|Deprecated|Obsoleted|Unavailable] attributes with PlatformName.")]
public class AvailabilityAttribute : Attribute
{
public static AvailabilityAttribute Merge (IEnumerable