[net9.0] Merge main into net9.0. (#21272)
This brings Xcode 16 support to .NET 9.
This commit is contained in:
Коммит
003ef568be
28
Make.config
28
Make.config
|
@ -218,9 +218,11 @@ MACCATALYST_NUGET_VERSION_NO_METADATA=$(MACCATALYST_NUGET_VERSION)$(NUGET_PREREL
|
|||
MACCATALYST_NUGET_VERSION_FULL=$(MACCATALYST_NUGET_VERSION_NO_METADATA)$(NUGET_BUILD_METADATA)
|
||||
|
||||
# Xcode version should have both a major and a minor version (even if the minor version is 0)
|
||||
XCODE_VERSION=15.4
|
||||
XCODE_URL=https://dl.internalx.com/internal-files/xcodes/Xcode_15.4.xip
|
||||
XCODE_DEVELOPER_ROOT=/Applications/Xcode_15.4.0.app/Contents/Developer
|
||||
XCODE_VERSION=16.0
|
||||
XCODE_URL=https://dl.internalx.com/internal-files/xcodes/Xcode_16.xip
|
||||
XCODE_IOS_SIMULATOR_FILENAME=iOS_18_Simulator_Runtime.dmg
|
||||
XCODE_IOS_SIMULATOR_VERSION=22A3351
|
||||
XCODE_DEVELOPER_ROOT=/Applications/Xcode_16.0.0.app/Contents/Developer
|
||||
XCODE_PRODUCT_BUILD_VERSION:=$(shell /usr/libexec/PlistBuddy -c 'Print :ProductBuildVersion' $(XCODE_DEVELOPER_ROOT)/../version.plist 2>/dev/null || echo " $(shell tput setaf 1 2>/dev/null)The required Xcode ($(XCODE_VERSION)) is not installed in $(basename $(basename $(XCODE_DEVELOPER_ROOT)))$(shell tput sgr0 2>/dev/null)" >&2)
|
||||
|
||||
# We define stable Xcode as the Xcode app being named like "Xcode_#.#[.#].app"
|
||||
|
@ -264,9 +266,9 @@ MIN_CMAKE_URL=https://cmake.org/files/v3.6/cmake-3.6.2-Darwin-x86_64.dmg
|
|||
MIN_CMAKE_VERSION=2.8.8
|
||||
|
||||
# ObjectiveSharpie min/max versions
|
||||
MIN_SHARPIE_VERSION=3.5.76
|
||||
MAX_SHARPIE_VERSION=3.5.99
|
||||
MIN_SHARPIE_URL=https://download.visualstudio.microsoft.com/download/pr/87c92e02-3d02-45de-bdd5-41721ed5bfc9/60cd0050e247aa99da79a52ef3228f32/objectivesharpie-3.5.76.pkg
|
||||
MIN_SHARPIE_VERSION=3.5.115
|
||||
MAX_SHARPIE_VERSION=3.5.999
|
||||
MIN_SHARPIE_URL=https://download.visualstudio.microsoft.com/download/pr/8445c488-35b2-44d5-a80f-15954ca1fcf8/bb2946f34caefe1ba3bc5cedfda31879/objectivesharpie-3.5.115.pkg
|
||||
|
||||
# Minimum OSX versions for building XI/XM
|
||||
MIN_OSX_BUILD_VERSION=13.0
|
||||
|
@ -306,11 +308,11 @@ DOTNET_MIN_MACCATALYST_SDK_VERSION=15.0
|
|||
DOTNET_MIN_MACOS_SDK_VERSION=12.0
|
||||
|
||||
# The min simulator version available in the Xcode we're using
|
||||
MIN_IOS_SIMULATOR_VERSION=14.3
|
||||
MIN_WATCHOS_SIMULATOR_VERSION=7.1
|
||||
MIN_IOS_SIMULATOR_VERSION=15.0
|
||||
MIN_WATCHOS_SIMULATOR_VERSION=8.0
|
||||
# This is the iOS version that matches the watchOS version (i.e same Xcode)
|
||||
MIN_WATCHOS_COMPANION_SIMULATOR_VERSION=14.5
|
||||
MIN_TVOS_SIMULATOR_VERSION=14.0
|
||||
MIN_WATCHOS_COMPANION_SIMULATOR_VERSION=15.0
|
||||
MIN_TVOS_SIMULATOR_VERSION=15.0
|
||||
# These are the simulator package ids for the versions above
|
||||
EXTRA_SIMULATORS=com.apple.pkg.iPhoneSimulatorSDK15_0 com.apple.pkg.AppleTVSimulatorSDK15_0 com.apple.pkg.WatchSimulatorSDK8_0
|
||||
|
||||
|
@ -479,8 +481,8 @@ SIMULATORWATCH_OBJC_CFLAGS = $(SIMULATORWATCH_CFLAGS) $(COMMON_SIMULATOR_OBJC_
|
|||
SIMULATORWATCH64_OBJC_CFLAGS = $(SIMULATORWATCH64_CFLAGS) $(COMMON_SIMULATOR_OBJC_CFLAGS)
|
||||
|
||||
DEVICEWATCH_SDK = $(XCODE_DEVELOPER_ROOT)/Platforms/WatchOS.platform/Developer/SDKs/WatchOS$(WATCH_SDK_VERSION).sdk
|
||||
DEVICEWATCH_CFLAGS = -arch armv7k -mwatchos-version-min=$(MIN_WATCHOS_SDK_VERSION) -isysroot $(DEVICEWATCH_SDK) $(CFLAGS) -fembed-bitcode $(IOS_COMMON_DEFINES)
|
||||
DEVICEWATCH64_32_CFLAGS = -arch arm64_32 -mwatchos-version-min=$(MIN_WATCHOS64_32_SDK_VERSION) -isysroot $(DEVICEWATCH_SDK) $(CFLAGS) -fembed-bitcode $(IOS_COMMON_DEFINES)
|
||||
DEVICEWATCH_CFLAGS = -arch armv7k -mwatchos-version-min=$(MIN_WATCHOS_SDK_VERSION) -isysroot $(DEVICEWATCH_SDK) $(CFLAGS) $(IOS_COMMON_DEFINES)
|
||||
DEVICEWATCH64_32_CFLAGS = -arch arm64_32 -mwatchos-version-min=$(MIN_WATCHOS64_32_SDK_VERSION) -isysroot $(DEVICEWATCH_SDK) $(CFLAGS) $(IOS_COMMON_DEFINES)
|
||||
DEVICEWATCH_OBJC_CFLAGS = $(DEVICEWATCH_CFLAGS) $(DEVICE_OBJC_CFLAGS)
|
||||
DEVICEWATCH64_32_OBJC_CFLAGS = $(DEVICEWATCH64_32_CFLAGS) $(DEVICE_OBJC_CFLAGS)
|
||||
|
||||
|
@ -689,7 +691,7 @@ $(TOP)/Build.props: Make.config
|
|||
ifeq ($(XCODE_IS_STABLE),true)
|
||||
# do nothing
|
||||
else ifeq ($(XCODE_IS_STABLE),false)
|
||||
$(Q) printf "\t\t<EnablePreviewFeatures>true</EnablePreviewFeatures>\n" >> $@.tmp
|
||||
$(Q) printf '\t\t<NoWarn>$$(NoWarn);XCODE_$(subst .,_,$(XCODE_VERSION))_PREVIEW</NoWarn>\n' >> $@.tmp
|
||||
else
|
||||
$(error "The variable XCODE_IS_STABLE is not set!")
|
||||
endif
|
||||
|
|
|
@ -48,8 +48,8 @@
|
|||
# line changed in git).
|
||||
#
|
||||
|
||||
IOS_PACKAGE_VERSION=17.5.0.$(IOS_COMMIT_DISTANCE)
|
||||
MAC_PACKAGE_VERSION=9.5.0.$(MAC_COMMIT_DISTANCE)
|
||||
IOS_PACKAGE_VERSION=17.99.0.$(IOS_COMMIT_DISTANCE)
|
||||
MAC_PACKAGE_VERSION=9.99.0.$(MAC_COMMIT_DISTANCE)
|
||||
|
||||
#
|
||||
# ** NuGet package version numbers **
|
||||
|
@ -65,11 +65,11 @@ MAC_PACKAGE_VERSION=9.5.0.$(MAC_COMMIT_DISTANCE)
|
|||
|
||||
# WARNING: Do **not** use versions higher than the available Xcode SDK or else we will have issues with mtouch (See https://github.com/xamarin/xamarin-macios/issues/7705)
|
||||
|
||||
IOS_NUGET_OS_VERSION=17.5
|
||||
TVOS_NUGET_OS_VERSION=17.5
|
||||
WATCHOS_NUGET_OS_VERSION=10.5
|
||||
MACOS_NUGET_OS_VERSION=14.5
|
||||
MACCATALYST_NUGET_OS_VERSION=17.5
|
||||
IOS_NUGET_OS_VERSION=18.0
|
||||
TVOS_NUGET_OS_VERSION=18.0
|
||||
WATCHOS_NUGET_OS_VERSION=11.0
|
||||
MACOS_NUGET_OS_VERSION=15.0
|
||||
MACCATALYST_NUGET_OS_VERSION=18.0
|
||||
|
||||
|
||||
# In theory we should define the default platform version if it's not specified in the TFM. The default should not change for a given .NET version:
|
||||
|
@ -127,7 +127,7 @@ MACCATALYST_NUGET_OS_VERSION=17.5
|
|||
# would add support for trying the preview release by doing:
|
||||
#
|
||||
# <TargetFramework>net9.0-18.0</TargetFramework>
|
||||
# <EnablePreviewFeatures>true</EnablePreviewFeatures>
|
||||
# <NoWarn>XCODE_16_0_PREVIEW;$(NoWarn)</NoWarn>
|
||||
#
|
||||
# Note that any SUPPORTED_API_VERSIONS entry below for older OS versions need a corresponding entry in
|
||||
# the eng/Version.Details.xml and eng/Versions.props files.
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
<string>17.2</string>
|
||||
<string>17.4</string>
|
||||
<string>17.5</string>
|
||||
<string>18.0</string>
|
||||
</array>
|
||||
<key>tvOS</key>
|
||||
<array>
|
||||
|
@ -74,6 +75,7 @@
|
|||
<string>17.2</string>
|
||||
<string>17.4</string>
|
||||
<string>17.5</string>
|
||||
<string>18.0</string>
|
||||
</array>
|
||||
<key>watchOS</key>
|
||||
<array>
|
||||
|
@ -102,6 +104,7 @@
|
|||
<string>10.2</string>
|
||||
<string>10.4</string>
|
||||
<string>10.5</string>
|
||||
<string>11.0</string>
|
||||
</array>
|
||||
<key>MacCatalyst</key>
|
||||
<array>
|
||||
|
@ -115,6 +118,7 @@
|
|||
<string>17.2</string>
|
||||
<string>17.4</string>
|
||||
<string>17.5</string>
|
||||
<string>18.0</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>MacCatalystVersionMap</key>
|
||||
|
@ -157,6 +161,8 @@
|
|||
<string>14.4</string>
|
||||
<key>17.5</key>
|
||||
<string>14.5</string>
|
||||
<key>18.0</key>
|
||||
<string>15.0</string>
|
||||
</dict>
|
||||
<key>RecommendedXcodeVersion</key>
|
||||
<string>@XCODE_VERSION@</string>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<string>14.2</string>
|
||||
<string>14.4</string>
|
||||
<string>14.5</string>
|
||||
<string>15.0</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>RecommendedXcodeVersion</key>
|
||||
|
|
|
@ -161,6 +161,7 @@ package-download/all-package-references.csproj: $(GIT_DIRECTORY)/HEAD $(GIT_DIRE
|
|||
.stamp-install-t4: $(TOP)/.config/dotnet-tools.json .stamp-download-dotnet-packages
|
||||
@# https://github.com/dotnet/sdk/issues/16165
|
||||
$(Q) rm -f ~/.dotnet/toolResolverCache/*/dotnet-t4
|
||||
$(Q) rm -f ~/.dotnet/toolResolverCache/*/dotnet-ilrepack
|
||||
$(DOTNET) tool restore
|
||||
$(Q) touch $@
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
<string>17.2</string>
|
||||
<string>17.4</string>
|
||||
<string>17.5</string>
|
||||
<string>18.0</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>SupportedTargetPlatformVersions</key>
|
||||
|
@ -46,6 +47,7 @@
|
|||
<string>17.2</string>
|
||||
<string>17.4</string>
|
||||
<string>17.5</string>
|
||||
<string>18.0</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>MacCatalystVersionMap</key>
|
||||
|
@ -88,6 +90,8 @@
|
|||
<string>14.4</string>
|
||||
<key>17.5</key>
|
||||
<string>14.5</string>
|
||||
<key>18.0</key>
|
||||
<string>15.0</string>
|
||||
</dict>
|
||||
<key>RecommendedXcodeVersion</key>
|
||||
<string>@XCODE_VERSION@</string>
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
<string>17.2</string>
|
||||
<string>17.4</string>
|
||||
<string>17.5</string>
|
||||
<string>18.0</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>SupportedTargetPlatformVersions</key>
|
||||
|
@ -82,6 +83,7 @@
|
|||
<string>17.2</string>
|
||||
<string>17.4</string>
|
||||
<string>17.5</string>
|
||||
<string>18.0</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>RecommendedXcodeVersion</key>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<string>14.2</string>
|
||||
<string>14.4</string>
|
||||
<string>14.5</string>
|
||||
<string>15.0</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>SupportedTargetPlatformVersions</key>
|
||||
|
@ -46,6 +47,7 @@
|
|||
<string>14.2</string>
|
||||
<string>14.4</string>
|
||||
<string>14.5</string>
|
||||
<string>15.0</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>RecommendedXcodeVersion</key>
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
<string>17.2</string>
|
||||
<string>17.4</string>
|
||||
<string>17.5</string>
|
||||
<string>18.0</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>SupportedTargetPlatformVersions</key>
|
||||
|
@ -72,6 +73,7 @@
|
|||
<string>17.2</string>
|
||||
<string>17.4</string>
|
||||
<string>17.5</string>
|
||||
<string>18.0</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>RecommendedXcodeVersion</key>
|
||||
|
|
|
@ -64,7 +64,7 @@ following property in their project file to make their intention clear:
|
|||
|
||||
```xml
|
||||
<PropertyGroup>
|
||||
<EnablePreviewFeatures>true</EnablePreviewFeatures>
|
||||
<NoWarn>XCODE_16_0;$(NoWarn)</NoWarn>
|
||||
</PropertyGroup>
|
||||
```
|
||||
|
||||
|
@ -89,7 +89,7 @@ We'll release a single workload (per platform), with bindings for every OS
|
|||
version we currently support or plan to support. This means our stable
|
||||
releases may point to preview packages (but these preview packages have to be
|
||||
opted in by doing two things: appending the OS version to their target
|
||||
framework + setting EnablePreviewFeatures=true)
|
||||
framework + adding the specific experimental warning to NoWarn)
|
||||
|
||||
We'll rename our packages. Currently we ship these packages:
|
||||
|
||||
|
@ -162,14 +162,7 @@ Note 2: One complication here is that TargetPlatformVersion might not be set
|
|||
condition that accepts an empty TargetPlatformVersion. This corresponds with
|
||||
the default target platform version.
|
||||
|
||||
Note 3: we load the preview sdk (Microsoft.iOS.Sdk.net8.0_18.0) even if
|
||||
`EnablePreviewFeatures!=true` - we show the error requesting
|
||||
`EnablePreviewFeatures` to be set from the preview sdk instead (this is to get
|
||||
an actionable error message). Without this, the user would get this rather
|
||||
unhelpful error message: `error NETSDK1139: The target platform identifier ios
|
||||
was not recognized.`
|
||||
|
||||
Note 4: we load a special error-handling version of the sdk if we don't
|
||||
Note 3: we load a special error-handling version of the sdk if we don't
|
||||
support a TargetPlatformVersion for given TargetFrameworkVersion, and show an
|
||||
error about unsupported TargetPlatformVersion. Without this, the user would
|
||||
get this rather unhelpful error message: `error NETSDK1139: The target
|
||||
|
|
|
@ -65,6 +65,15 @@ References:
|
|||
* https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.experimentalattribute?view=net-8.0
|
||||
* https://learn.microsoft.com/en-us/dotnet/fundamentals/apicompat/preview-apis#experimentalattribute
|
||||
|
||||
## Previws of new API bindings (XCODE_x_y_PREVIEW)
|
||||
|
||||
We sometimes release previews of new API bindings, and until these are deemed
|
||||
stable (by both Apple and us), we mark all our API bindings as preview of the
|
||||
new Xcode version.
|
||||
|
||||
The diagnostic id is `XCODE_x_y_PREVIEW`, where `x` and `y` are Xcode's major and
|
||||
minor versions.
|
||||
|
||||
## CryptoTokenKit (APL0001)
|
||||
|
||||
CryptoTokenKit requires special hardware to test, so it's not trivial for us to do so.
|
||||
|
@ -75,4 +84,16 @@ We've tentatively set .NET 10 as the release when we'll stop marking CryptoToken
|
|||
|
||||
The diagnostic id for CryptoTokenKit is APL0001.
|
||||
|
||||
## FSKit (APL0002)
|
||||
|
||||
FSKit is a new framework in macOS 15.0 to implement a file system in user space.
|
||||
|
||||
At the moment implementing a file system is out of our reach, so we haven't
|
||||
been able to validate the API, and as such we mark every type in this
|
||||
framework as preview API for a while.
|
||||
|
||||
We've tentatively set .NET 11 as the release when we'll stop marking FSKit as preview API.
|
||||
|
||||
The diagnostic id for FSKit is APL0002.
|
||||
|
||||
[1]: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.experimentalattribute?view=net-8.0
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<document type="com.apple.InterfaceBuilder.AppleTV.Storyboard" version="3.0" toolsVersion="9046" systemVersion="14F27" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES" initialViewController="BYZ-38-t0r">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9035" />
|
||||
</dependencies>
|
||||
<scenes/>
|
||||
</document>
|
||||
|
|
|
@ -1021,13 +1021,6 @@
|
|||
<Error Text="Only CoreCLR is supported on macOS. Set 'UseMonoRuntime=false' to use CoreCLR." Condition="'$(_PlatformName)' == 'macOS' And '$(UseMonoRuntime)' != 'false'" />
|
||||
</Target>
|
||||
|
||||
<Target Name="_VerifyPreviewFeaturesIfUnstableXcode">
|
||||
<Error
|
||||
Text="These are preview bindings for an unstable version of Xcode. Opt into preview features by adding <EnablePreviewFeatures>True</EnablePreviewFeatures> to your project file."
|
||||
Condition="'$(_XamarinIsPreviewRelease)' == 'true' And '$(EnablePreviewFeatures)' != 'true'"
|
||||
/>
|
||||
</Target>
|
||||
|
||||
<Target Name="_VerifyValidProperties">
|
||||
<Error
|
||||
Text="The property 'MtouchArch' is deprecated, please remove it from the project file. Use 'RuntimeIdentifier' or 'RuntimeIdentifiers' instead to specify the target architecture."
|
||||
|
@ -1041,7 +1034,6 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<_ComputeVariablesDependsOn>
|
||||
_VerifyPreviewFeaturesIfUnstableXcode;
|
||||
_VerifyValidRuntime;
|
||||
_GenerateBundleName;
|
||||
_ComputeFrameworkVariables;
|
||||
|
@ -1628,13 +1620,19 @@
|
|||
|
||||
<WriteLinesToFile SessionId="$(BuildSessionId)" File="$(_MtouchSymbolsList)" Lines="@(_ProcessedReferenceNativeSymbol)" Overwrite="true" />
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- There are known bugs in the classic linker with Xcode 15, so keep use the classic linker in that case -->
|
||||
<!-- In Xcode 16 we don't know of any problems for now, so enable the new linker by default -->
|
||||
<_UseClassicLinker Condition="'$(_UseClassicLinker)' == '' And $([MSBuild]::VersionGreaterThanOrEquals('$(_XcodeVersion)', '16.0'))">false</_UseClassicLinker>
|
||||
<_UseClassicLinker Condition="'$(_UseClassicLinker)' == '' And $([MSBuild]::VersionGreaterThanOrEquals('$(_XcodeVersion)', '15.0'))">true</_UseClassicLinker>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<_AllLinkerFlags Include="@(_AssemblyLinkerFlags);@(_MainLinkerFlags);@(_CustomLinkFlags)" />
|
||||
<_AllLinkerFlags Condition="'$(_ExportSymbolsExplicitly)' != 'true'" Include="@(_ProcessedReferenceNativeSymbol->'-u%(Identity)')" />
|
||||
|
||||
<!-- check if needs to be removed: https://github.com/xamarin/xamarin-macios/issues/18693 -->
|
||||
<_AllLinkerFlags Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(_XcodeVersion)', '15.0')) And '$(_UseClassicLinker)' != 'false'" Include="-Xlinker" />
|
||||
<_AllLinkerFlags Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(_XcodeVersion)', '15.0')) And '$(_UseClassicLinker)' != 'false'" Include="-ld_classic" />
|
||||
<_AllLinkerFlags Condition="'$(_UseClassicLinker)' == 'true'" Include="-Xlinker" />
|
||||
<_AllLinkerFlags Condition="'$(_UseClassicLinker)' == 'true'" Include="-ld_classic" />
|
||||
</ItemGroup>
|
||||
|
||||
<LinkNativeCode
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 4cb9dc263251f8c8eac41b95a857f37025974599
|
||||
Subproject commit bd3d13362bfda48a34fa0cc419744c4a1f4dc45a
|
17
mk/rules.mk
17
mk/rules.mk
|
@ -339,14 +339,17 @@ define NativeCompilationTemplate
|
|||
|
||||
endef
|
||||
|
||||
DEBUG_FLAGS=-DDEBUG -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG
|
||||
RELEASE_FLAGS=-O2 -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST
|
||||
|
||||
$(eval $(call NativeCompilationTemplate,,-O2))
|
||||
$(eval $(call NativeCompilationTemplate,-debug,-DDEBUG))
|
||||
$(eval $(call NativeCompilationTemplate,-dotnet,-O2 -DDOTNET))
|
||||
$(eval $(call NativeCompilationTemplate,-dotnet-debug,-DDEBUG -DDOTNET))
|
||||
$(eval $(call NativeCompilationTemplate,-dotnet-coreclr,-O2 -DCORECLR_RUNTIME -DDOTNET))
|
||||
$(eval $(call NativeCompilationTemplate,-dotnet-coreclr-debug,-DDEBUG -DCORECLR_RUNTIME -DDOTNET))
|
||||
$(eval $(call NativeCompilationTemplate,-dotnet-nativeaot,-O2 -DCORECLR_RUNTIME -DDOTNET -DNATIVEAOT))
|
||||
$(eval $(call NativeCompilationTemplate,-dotnet-nativeaot-debug,-DDEBUG -DCORECLR_RUNTIME -DDOTNET -DNATIVEAOT))
|
||||
$(eval $(call NativeCompilationTemplate,-debug,$(DEBUG_FLAGS)))
|
||||
$(eval $(call NativeCompilationTemplate,-dotnet,$(RELEASE_FLAGS) -DDOTNET))
|
||||
$(eval $(call NativeCompilationTemplate,-dotnet-debug,$(DEBUG_FLAGS) -DDOTNET))
|
||||
$(eval $(call NativeCompilationTemplate,-dotnet-coreclr,$(RELEASE_FLAGS) -DCORECLR_RUNTIME -DDOTNET))
|
||||
$(eval $(call NativeCompilationTemplate,-dotnet-coreclr-debug,$(DEBUG_FLAGS) -DCORECLR_RUNTIME -DDOTNET))
|
||||
$(eval $(call NativeCompilationTemplate,-dotnet-nativeaot,$(RELEASE_FLAGS) -DCORECLR_RUNTIME -DDOTNET -DNATIVEAOT))
|
||||
$(eval $(call NativeCompilationTemplate,-dotnet-nativeaot-debug,$(DEBUG_FLAGS) -DCORECLR_RUNTIME -DDOTNET -DNATIVEAOT))
|
||||
|
||||
.libs/iphoneos .libs/iphonesimulator .libs/watchos .libs/watchsimulator .libs/tvos .libs/tvsimulator .libs/maccatalyst .libs/mac:
|
||||
$(Q) mkdir -p $@
|
||||
|
|
|
@ -165,6 +165,9 @@ namespace Xamarin.MacDev.Tasks {
|
|||
if (watch)
|
||||
yield return "watch";
|
||||
|
||||
if ((devices & IPhoneDeviceType.TV) != 0)
|
||||
yield return "tv";
|
||||
|
||||
yield break;
|
||||
}
|
||||
|
||||
|
|
|
@ -1674,6 +1674,7 @@ Copyright (C) 2018 Microsoft. All rights reserved.
|
|||
|
||||
<PropertyGroup>
|
||||
<_CompiledApiDefinitionAssembly>$(DeviceSpecificIntermediateOutputPath)compiled-api-definitions.dll</_CompiledApiDefinitionAssembly>
|
||||
<_CompiledApiDefinitionNoWarn>$(_CompiledApiDefinitionNoWarn);$(NoWarn)</_CompiledApiDefinitionNoWarn>
|
||||
<_CompiledApiDefinitionNoWarn>$(_CompiledApiDefinitionNoWarn);436</_CompiledApiDefinitionNoWarn>
|
||||
<_CompiledApiDefinitionDocumentationFile>$(DeviceSpecificIntermediateOutputPath)compiled-api-definitions.xml</_CompiledApiDefinitionDocumentationFile>
|
||||
<_CompiledApiDefinitionNoWarn>$(_CompiledApiDefinitionNoWarn);1591</_CompiledApiDefinitionNoWarn> <!-- Don't expect every public API to have documentation -->
|
||||
|
|
|
@ -573,6 +573,15 @@ namespace AVFoundation {
|
|||
|
||||
[MarshalAs (UnmanagedType.I1)]
|
||||
public bool HasUniformFormatDescriptions;
|
||||
|
||||
internal AVSampleCursorChunkInfo_Blittable ToBlittable ()
|
||||
{
|
||||
var rv = new AVSampleCursorChunkInfo_Blittable ();
|
||||
rv.HasUniformSampleSizes = HasUniformSampleSizes;
|
||||
rv.HasUniformSampleDurations = HasUniformSampleDurations;
|
||||
rv.HasUniformFormatDescriptions = HasUniformFormatDescriptions;
|
||||
return rv;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ namespace AVKit {
|
|||
ContentRatingUnknown = -1100,
|
||||
ContentDisallowedByPasscode = -1101,
|
||||
ContentDisallowedByProfile = -1102,
|
||||
RecordingFailed = -1200,
|
||||
}
|
||||
|
||||
[NoWatch]
|
||||
|
|
|
@ -20,5 +20,22 @@ namespace Accessibility {
|
|||
return AXPrefersHorizontalTextLayout () != 0;
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
[DllImport (Constants.AccessibilityLibrary)]
|
||||
static extern byte AXPrefersNonBlinkingTextInsertionIndicator ();
|
||||
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
public static bool NonBlinkingTextInsertionIndicator ()
|
||||
{
|
||||
return AXPrefersNonBlinkingTextInsertionIndicator () != 0;
|
||||
}
|
||||
#endif // NET
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using CoreGraphics;
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
#if NET
|
||||
|
||||
namespace Accessibility {
|
||||
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
[Native]
|
||||
public enum AXSettingsFeature : long {
|
||||
/// <summary>Jump to the "Allow Apps to Request to Use" setting in Personal Voice.</summary>
|
||||
PersonalVoiceAllowAppsToRequestToUse = 1,
|
||||
}
|
||||
|
||||
public static class AXSettings {
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
[DllImport (Constants.AccessibilityLibrary)]
|
||||
static extern byte AXAssistiveAccessEnabled ();
|
||||
|
||||
/// <summary>Returns whether Assistive Access is running.</summary>
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
public static bool IsAssistiveAccessEnabled {
|
||||
get {
|
||||
return AXAssistiveAccessEnabled () != 0;
|
||||
}
|
||||
}
|
||||
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
[DllImport (Constants.AccessibilityLibrary)]
|
||||
unsafe static extern void AXOpenSettingsFeature (nint /* AXSettingsFeature */ feature, BlockLiteral *block);
|
||||
|
||||
/// <summary>Open the Settings app to the specified section.</summary>
|
||||
/// <param name="feature">The section to open.</param>
|
||||
/// <param name="completionHandler">This callback is called when the section has been opened. The <see cref="Foundation.NSError" /> argument will be null if successful.</param>
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
public unsafe static void OpenSettingsFeature (AXSettingsFeature feature, Action<NSError?> completionHandler)
|
||||
{
|
||||
delegate* unmanaged<IntPtr, IntPtr, void> trampoline = &OpenSettingsFeatureCompletionHandler;
|
||||
using var block = new BlockLiteral (trampoline, completionHandler, typeof (AXSettings), nameof (OpenSettingsFeatureCompletionHandler));
|
||||
AXOpenSettingsFeature ((nint) (long) feature, &block);
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly]
|
||||
static void OpenSettingsFeatureCompletionHandler (IntPtr block, IntPtr error)
|
||||
{
|
||||
var del = BlockLiteral.GetTarget<Action<NSError?>> (block);
|
||||
if (del is not null) {
|
||||
var errorObject = Runtime.GetNSObject<NSError> (error);
|
||||
del (errorObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // NET
|
|
@ -22,6 +22,7 @@
|
|||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using ObjCRuntime;
|
||||
using Foundation;
|
||||
|
||||
|
@ -890,7 +891,10 @@ namespace AppKit {
|
|||
[NoMacCatalyst]
|
||||
[Native]
|
||||
public enum NSWindowSharingType : ulong {
|
||||
None, ReadOnly, ReadWrite
|
||||
None,
|
||||
ReadOnly,
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'ReadOnly' instead.")]
|
||||
ReadWrite,
|
||||
}
|
||||
|
||||
[NoMacCatalyst]
|
||||
|
@ -1982,13 +1986,29 @@ namespace AppKit {
|
|||
ApplicationOnlyMask = 1
|
||||
}
|
||||
|
||||
#if XAMCORE_5_0
|
||||
[NoMacCatalyst]
|
||||
#else
|
||||
[MacCatalyst (13, 1)]
|
||||
[Deprecated (PlatformName.MacCatalyst, 13, 1, message: "This enum doesn't exist on this platform.")]
|
||||
#if __MACCATALYST__
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
#endif
|
||||
#endif
|
||||
[Native]
|
||||
public enum NSCollectionViewDropOperation : long {
|
||||
On = 0, Before = 1
|
||||
}
|
||||
|
||||
#if XAMCORE_5_0
|
||||
[NoMacCatalyst]
|
||||
#else
|
||||
[MacCatalyst (13, 1)]
|
||||
[Deprecated (PlatformName.MacCatalyst, 13, 1, message: "This enum doesn't exist on this platform.")]
|
||||
#if __MACCATALYST__
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
#endif
|
||||
#endif
|
||||
[Native]
|
||||
public enum NSCollectionViewItemHighlightState : long {
|
||||
None = 0,
|
||||
|
@ -1997,7 +2017,15 @@ namespace AppKit {
|
|||
AsDropTarget = 3
|
||||
}
|
||||
|
||||
#if XAMCORE_5_0
|
||||
[NoMacCatalyst]
|
||||
#else
|
||||
[MacCatalyst (13, 1)]
|
||||
[Deprecated (PlatformName.MacCatalyst, 13, 1, message: "This enum doesn't exist on this platform.")]
|
||||
#if __MACCATALYST__
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
#endif
|
||||
#endif
|
||||
[Native]
|
||||
[Flags]
|
||||
public enum NSCollectionViewScrollPosition : ulong {
|
||||
|
|
|
@ -179,9 +179,21 @@ namespace AppKit {
|
|||
NSFrameRectWithWidthUsingOperation (rect, frameWidth, (nuint) (ulong) operation);
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[ObsoletedOSPlatform ("macos14.0", "Use 'NSCursor.DisappearingItemCursor' instead." )]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 14, 0, message: "Use 'NSCursor.DisappearingItemCursor' instead.")]
|
||||
#endif
|
||||
[DllImport (Constants.AppKitLibrary, EntryPoint = "NSShowAnimationEffect")]
|
||||
extern static void NSShowAnimationEffect (nuint animationEffect, CGPoint centerLocation, CGSize size, NativeHandle animationDelegate, NativeHandle didEndSelector, IntPtr contextInfo);
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[ObsoletedOSPlatform ("macos14.0", "Use 'NSCursor.DisappearingItemCursor' instead." )]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 14, 0, message: "Use 'NSCursor.DisappearingItemCursor' instead.")]
|
||||
#endif
|
||||
public static void ShowAnimationEffect (NSAnimationEffect animationEffect, CGPoint centerLocation, CGSize size, NSObject animationDelegate, Selector didEndSelector, IntPtr contextInfo)
|
||||
{
|
||||
NSShowAnimationEffect ((nuint) (ulong) animationEffect, centerLocation, size, animationDelegate.GetHandle (), didEndSelector.Handle, contextInfo);
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
// Copyright 2014 Xamarin, Inc.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
|
@ -40,5 +41,5 @@ using System.Runtime.CompilerServices;
|
|||
#endif
|
||||
|
||||
#if NET && !XCODE_IS_STABLE && !COREBUILD
|
||||
[assembly: RequiresPreviewFeatures("These are preview bindings for an unstable version of Xcode. Opt into preview features by adding <EnablePreviewFeatures>True</EnablePreviewFeatures> to your project file.")]
|
||||
[assembly: Experimental("XCODE_@XCODE_VERSION@_PREVIEW", UrlFormat = "https://github.com/xamarin/xamarin-macios/blob/main/docs/preview-apis.md")]
|
||||
#endif
|
||||
|
|
|
@ -82,6 +82,20 @@ namespace AudioToolbox {
|
|||
None = 2
|
||||
}
|
||||
|
||||
[Flags]
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public enum AudioConverterOptions : uint {
|
||||
None = 0,
|
||||
Unbuffered = 1 << 16,
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
|
@ -441,6 +455,49 @@ namespace AudioToolbox {
|
|||
return new AudioConverter (ptr, true);
|
||||
}
|
||||
|
||||
/// <summary>Create a new AudioConverter with the specified options.</summary>
|
||||
/// <param name="sourceFormat">The format of the source audio to be converted.</param>
|
||||
/// <param name="destinationFormat">The format to convert the source audio to.</param>
|
||||
/// <param name="options">Any <see cref="AudioConverterOptions" /> to use.</param>
|
||||
/// <param name="error">In case of failure, will contain the error code for the failure. Otherwise the value <see cref="AudioConverterError.None" /> will be returned.</param>
|
||||
/// <returns>A new AudioConverter instance, or null in case of failure.</returns>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public static AudioConverter? Create (AudioStreamBasicDescription sourceFormat, AudioStreamBasicDescription destinationFormat, AudioConverterOptions options, out AudioConverterError error)
|
||||
{
|
||||
IntPtr ptr = default (IntPtr);
|
||||
unsafe {
|
||||
error = AudioConverterNewWithOptions (&sourceFormat, &destinationFormat, options, &ptr);
|
||||
}
|
||||
if (error != AudioConverterError.None)
|
||||
return null;
|
||||
return new AudioConverter (ptr, true);
|
||||
}
|
||||
|
||||
/// <summary>Create a new AudioConverter with the specified options.</summary>
|
||||
/// <param name="sourceFormat">The format of the source audio to be converted.</param>
|
||||
/// <param name="destinationFormat">The format to convert the source audio to.</param>
|
||||
/// <param name="options">Any <see cref="AudioConverterOptions" /> to use.</param>
|
||||
/// <returns>A new AudioConverter instance, or null in case of failure.</returns>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public static AudioConverter? Create (AudioStreamBasicDescription sourceFormat, AudioStreamBasicDescription destinationFormat, AudioConverterOptions options)
|
||||
{
|
||||
return Create (sourceFormat, destinationFormat, options, out var _);
|
||||
}
|
||||
|
||||
public static AudioFormatType []? DecodeFormats {
|
||||
get {
|
||||
return GetFormats (AudioFormatProperty.DecodeFormatIDs);
|
||||
|
@ -641,6 +698,49 @@ namespace AudioToolbox {
|
|||
}
|
||||
}
|
||||
|
||||
#if NET
|
||||
public delegate void PrepareCompletionCallback (AudioConverterError status);
|
||||
|
||||
[UnmanagedCallersOnly]
|
||||
static void PrepareCompletionHandler (IntPtr block, int status)
|
||||
{
|
||||
var del = BlockLiteral.GetTarget<PrepareCompletionCallback> (block);
|
||||
if (del is not null)
|
||||
del ((AudioConverterError) status);
|
||||
}
|
||||
|
||||
/// <summary>Optimizes any subsequent creation of audio converters in this process.</summary>
|
||||
/// <param name="flags">Reserved; always pass 0.</param>
|
||||
/// <param name="ioReserved">Reserved; always pass IntPtr.Zero.</param>
|
||||
/// <param name="completionCallback">Optional callback to invoke when the preparation is complete.</param>
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
[BindingImpl (BindingImplOptions.Optimizable)]
|
||||
public unsafe static void Prepare (uint flags = 0, IntPtr ioReserved = default (IntPtr), PrepareCompletionCallback? completionCallback = null)
|
||||
{
|
||||
if (completionCallback is null) {
|
||||
AudioConverterPrepare (flags, ioReserved, null);
|
||||
} else {
|
||||
delegate* unmanaged<IntPtr, int, void> trampoline = &PrepareCompletionHandler;
|
||||
using var block = new BlockLiteral (trampoline, completionCallback, typeof (AudioConverter), nameof (PrepareCompletionHandler));
|
||||
AudioConverterPrepare (flags, ioReserved, &block);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Optimizes any subsequent creation of audio converters in this process.</summary>
|
||||
/// <param name="completionCallback">Callback to invoke when the preparation is complete.</param>
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
public unsafe static void Prepare (PrepareCompletionCallback completionCallback)
|
||||
{
|
||||
Prepare (0, IntPtr.Zero, completionCallback);
|
||||
}
|
||||
#endif // NET
|
||||
|
||||
public AudioConverterError Reset ()
|
||||
{
|
||||
return AudioConverterReset (Handle);
|
||||
|
@ -743,6 +843,32 @@ namespace AudioToolbox {
|
|||
unsafe static extern AudioConverterError AudioConverterNewSpecific (AudioStreamBasicDescription* inSourceFormat, AudioStreamBasicDescription* inDestinationFormat,
|
||||
int inNumberClassDescriptions, AudioClassDescription* inClassDescriptions, IntPtr* outAudioConverter);
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.AudioToolboxLibrary)]
|
||||
unsafe static extern void AudioConverterPrepare (uint inFlags, IntPtr ioReserved, BlockLiteral* block);
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.AudioToolboxLibrary)]
|
||||
unsafe static extern /* OSStatus */ AudioConverterError AudioConverterNewWithOptions (
|
||||
/* const AudioStreamBasicDescription * */ AudioStreamBasicDescription* inSourceFormat,
|
||||
/* const AudioStreamBasicDescription * */ AudioStreamBasicDescription* inDestinationFormat,
|
||||
/* AudioConverterOptions */ AudioConverterOptions inOptions,
|
||||
/* AudioConverterRef __nullable * __nonnull */ IntPtr* outAudioConverter);
|
||||
|
||||
[DllImport (Constants.AudioToolboxLibrary)]
|
||||
static extern AudioConverterError AudioConverterDispose (IntPtr inAudioConverter);
|
||||
|
||||
|
|
|
@ -1160,6 +1160,9 @@ namespace AudioToolbox {
|
|||
[DllImport (Constants.AudioToolboxLibrary)]
|
||||
unsafe extern static OSStatus AudioFileCountUserData (AudioFileID handle, uint userData, int* count);
|
||||
|
||||
/// <summary>Get the number of user data for the specified chunk type.</summary>
|
||||
/// <param name="userData">The fourcc of the ID whose count to retrieve.</param>
|
||||
/// <returns>The number of user udata for the specified ID.</returns>
|
||||
public int CountUserData (uint userData)
|
||||
{
|
||||
int count;
|
||||
|
@ -1170,29 +1173,219 @@ namespace AudioToolbox {
|
|||
return -1;
|
||||
}
|
||||
|
||||
/// <summary>Get the number of user data for the specified chunk type.</summary>
|
||||
/// <param name="chunkType">The fourcc of the chunk.</param>
|
||||
/// <returns>The number of user data for the specified chunk type.</returns>
|
||||
public int CountUserData (AudioFileChunkType chunkType)
|
||||
{
|
||||
return CountUserData ((uint) chunkType);
|
||||
}
|
||||
|
||||
[DllImport (Constants.AudioToolboxLibrary)]
|
||||
unsafe extern static OSStatus AudioFileGetUserDataSize (AudioFileID audioFile, uint userDataID, int index, int* userDataSize);
|
||||
|
||||
/// <summary>Get the size of the specified user data.</summary>
|
||||
/// <param name="userDataId">The fourcc of the chunk.</param>
|
||||
/// <param name="index">The index of the chunk if there are more than one chunk.</param>
|
||||
/// <returns>Returns the (non-negative) size on success, otherwise -1.</returns>
|
||||
public int GetUserDataSize (uint userDataId, int index)
|
||||
{
|
||||
int ds;
|
||||
|
||||
unsafe {
|
||||
if (AudioFileGetUserDataSize (Handle, userDataId, index, &ds) == 0)
|
||||
if (AudioFileGetUserDataSize (Handle, userDataId, index, &ds) != 0)
|
||||
return -1;
|
||||
}
|
||||
return ds;
|
||||
}
|
||||
|
||||
/// <summary>Get the size of the specified user data.</summary>
|
||||
/// <param name="chunkType">The fourcc of the chunk.</param>
|
||||
/// <param name="index">The index of the chunk if there are more than one chunk.</param>
|
||||
/// <returns>Returns the (non-negative) size on success, otherwise -1.</returns>
|
||||
public int GetUserDataSize (AudioFileChunkType chunkType, int index)
|
||||
{
|
||||
return GetUserDataSize ((uint) chunkType, index);
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios17.0")]
|
||||
[SupportedOSPlatform ("tvos17.0")]
|
||||
[SupportedOSPlatform ("maccatalyst17.0")]
|
||||
[SupportedOSPlatform ("macos14.0")]
|
||||
#else
|
||||
[iOS (17, 0), TV (17, 0), MacCatalyst (17, 0), Mac (14, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.AudioToolboxLibrary)]
|
||||
unsafe extern static OSStatus AudioFileGetUserDataSize64 (AudioFileID audioFile, uint userDataID, int index, ulong* userDataSize);
|
||||
|
||||
/// <summary>Get the 64-bit size of the specified user data.</summary>
|
||||
/// <param name="userDataId">The fourcc of the chunk.</param>
|
||||
/// <param name="index">The index of the chunk if there are more than one chunk.</param>
|
||||
/// <param name="size">The retrieved 64-bit size of the specified user data.</param>
|
||||
/// <returns>Returns <see cref="AudioFileError.Success" /> on success, otherwise an <see cref="AudioFileError" /> error code.</returns>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios17.0")]
|
||||
[SupportedOSPlatform ("tvos17.0")]
|
||||
[SupportedOSPlatform ("maccatalyst17.0")]
|
||||
[SupportedOSPlatform ("macos14.0")]
|
||||
#else
|
||||
[iOS (17, 0), TV (17, 0), MacCatalyst (17, 0), Mac (14, 0)]
|
||||
#endif
|
||||
public AudioFileError GetUserDataSize (uint userDataId, int index, out ulong size)
|
||||
{
|
||||
size = 0;
|
||||
unsafe {
|
||||
return (AudioFileError) AudioFileGetUserDataSize64 (Handle, userDataId, index, (ulong*) Unsafe.AsPointer<ulong> (ref size));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Get the 64-bit size of the specified user data.</summary>
|
||||
/// <param name="chunkType">The fourcc of the chunk.</param>
|
||||
/// <param name="index">The index of the chunk if there are more than one chunk.</param>
|
||||
/// <param name="size">The retrieved 64-bit size of the specified user data.</param>
|
||||
/// <returns>Returns <see cref="AudioFileError.Success" /> on success, otherwise an <see cref="AudioFileError" /> error code.</returns>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios17.0")]
|
||||
[SupportedOSPlatform ("tvos17.0")]
|
||||
[SupportedOSPlatform ("maccatalyst17.0")]
|
||||
[SupportedOSPlatform ("macos14.0")]
|
||||
#else
|
||||
[iOS (17, 0), TV (17, 0), MacCatalyst (17, 0), Mac (14, 0)]
|
||||
#endif
|
||||
public AudioFileError GetUserDataSize (AudioFileChunkType chunkType, int index, out ulong size)
|
||||
{
|
||||
return GetUserDataSize ((uint) chunkType, index, out size);
|
||||
}
|
||||
|
||||
[DllImport (Constants.AudioToolboxLibrary)]
|
||||
unsafe extern static OSStatus AudioFileGetUserData (AudioFileID audioFile, int userDataID, int index, int* userDataSize, IntPtr userData);
|
||||
|
||||
/// <summary>Get part of the data of a chunk in a file.</summary>
|
||||
/// <param name="userDataID">The fourcc of the chunk.</param>
|
||||
/// <param name="index">The index of the chunk if there are more than one chunk.</param>
|
||||
/// <param name="size">On input the size of the memory <paramref name="userData" /> points to. On output the number of bytes written.</param>
|
||||
/// <param name="userData">A pointer to memory where the data will be copied.</param>
|
||||
/// <returns>Returns <see cref="AudioFileError.Success" /> on success, otherwise an <see cref="AudioFileError" /> error code.</returns>
|
||||
#if XAMCORE_5_0
|
||||
public AudioFileError GetUserData (int userDataID, int index, ref int size, IntPtr userData)
|
||||
#else
|
||||
public int GetUserData (int userDataID, int index, ref int size, IntPtr userData)
|
||||
#endif
|
||||
{
|
||||
unsafe {
|
||||
return AudioFileGetUserData (Handle, userDataID, index, (int*) Unsafe.AsPointer<int> (ref size), userData);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Get part of the data of a chunk in a file.</summary>
|
||||
/// <param name="chunkType">The fourcc of the chunk.</param>
|
||||
/// <param name="index">The index of the chunk if there are more than one chunk.</param>
|
||||
/// <param name="size">On input the size of the memory <paramref name="userData" /> points to. On output the number of bytes written.</param>
|
||||
/// <param name="userData">A pointer to memory where the data will be copied.</param>
|
||||
/// <returns>Returns <see cref="AudioFileError.Success" /> on success, otherwise an <see cref="AudioFileError" /> error code.</returns>
|
||||
public AudioFileError GetUserData (AudioFileChunkType chunkType, int index, ref int size, IntPtr userData)
|
||||
{
|
||||
return (AudioFileError) GetUserData ((int) chunkType, index, ref size, userData);
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios17.0")]
|
||||
[SupportedOSPlatform ("tvos17.0")]
|
||||
[SupportedOSPlatform ("maccatalyst17.0")]
|
||||
[SupportedOSPlatform ("macos14.0")]
|
||||
#else
|
||||
[iOS (17, 0), TV (17, 0), MacCatalyst (17, 0), Mac (14, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.AudioToolboxLibrary)]
|
||||
unsafe extern static OSStatus AudioFileGetUserDataAtOffset (AudioFileID audioFile, uint userDataID, int index, long inOffset, int* userDataSize, IntPtr userData);
|
||||
|
||||
/// <summary>Get part of the data of a chunk in a file.</summary>
|
||||
/// <param name="userDataId">The fourcc of the chunk.</param>
|
||||
/// <param name="index">The index of the chunk if there are more than one chunk.</param>
|
||||
/// <param name="offset">The offset from the first byte of the chunk of the data to get.</param>
|
||||
/// <param name="size">On input the size of the memory <paramref name="userData" /> points to. On output the number of bytes written.</param>
|
||||
/// <param name="userData">A pointer to memory where the data will be copied.</param>
|
||||
/// <returns>Returns <see cref="AudioFileError.Success" /> on success, otherwise an <see cref="AudioFileError" /> error code.</returns>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios17.0")]
|
||||
[SupportedOSPlatform ("tvos17.0")]
|
||||
[SupportedOSPlatform ("maccatalyst17.0")]
|
||||
[SupportedOSPlatform ("macos14.0")]
|
||||
#else
|
||||
[iOS (17, 0), TV (17, 0), MacCatalyst (17, 0), Mac (14, 0)]
|
||||
#endif
|
||||
public AudioFileError GetUserData (uint userDataId, int index, long offset, ref int size, IntPtr userData)
|
||||
{
|
||||
unsafe {
|
||||
return (AudioFileError) AudioFileGetUserDataAtOffset (Handle, userDataId, index, offset, (int*) Unsafe.AsPointer<int> (ref size), userData);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Get part of the data of a chunk in a file.</summary>
|
||||
/// <param name="chunkType">The fourcc of the chunk.</param>
|
||||
/// <param name="index">The index of the chunk if there are more than one chunk.</param>
|
||||
/// <param name="offset">The offset from the first byte of the chunk of the data to get.</param>
|
||||
/// <param name="size">On input the size of the memory <paramref name="userData" /> points to. On output the number of bytes written.</param>
|
||||
/// <param name="userData">A pointer to memory where the data will be copied.</param>
|
||||
/// <returns>Returns <see cref="AudioFileError.Success" /> on success, otherwise an <see cref="AudioFileError" /> error code.</returns>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios17.0")]
|
||||
[SupportedOSPlatform ("tvos17.0")]
|
||||
[SupportedOSPlatform ("maccatalyst17.0")]
|
||||
[SupportedOSPlatform ("macos14.0")]
|
||||
#else
|
||||
[iOS (17, 0), TV (17, 0), MacCatalyst (17, 0), Mac (14, 0)]
|
||||
#endif
|
||||
public AudioFileError GetUserData (AudioFileChunkType chunkType, int index, long offset, ref int size, IntPtr userData)
|
||||
{
|
||||
return GetUserData ((uint) chunkType, index, offset, ref size, userData);
|
||||
}
|
||||
|
||||
/// <summary>Get part of the data of a chunk in a file.</summary>
|
||||
/// <param name="userDataId">The fourcc of the chunk.</param>
|
||||
/// <param name="index">The index of the chunk if there are more than one chunk.</param>
|
||||
/// <param name="offset">The offset from the first byte of the chunk of the data to get.</param>
|
||||
/// <param name="size">The number of bytes written into the byte array.</param>
|
||||
/// <param name="data">An array of bytes where the data will be copied.</param>
|
||||
/// <returns>Returns <see cref="AudioFileError.Success" /> on success, otherwise an <see cref="AudioFileError" /> error code.</returns>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios17.0")]
|
||||
[SupportedOSPlatform ("tvos17.0")]
|
||||
[SupportedOSPlatform ("maccatalyst17.0")]
|
||||
[SupportedOSPlatform ("macos14.0")]
|
||||
#else
|
||||
[iOS (17, 0), TV (17, 0), MacCatalyst (17, 0), Mac (14, 0)]
|
||||
#endif
|
||||
public AudioFileError GetUserData (uint userDataId, int index, long offset, byte [] data, out int size)
|
||||
{
|
||||
size = data.Length;
|
||||
unsafe {
|
||||
fixed (byte* dataPtr = data)
|
||||
return GetUserData (userDataId, index, offset, ref size, (IntPtr) dataPtr);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Get part of the data of a chunk in a file.</summary>
|
||||
/// <param name="chunkType">The fourcc of the chunk.</param>
|
||||
/// <param name="index">The index of the chunk if there are more than one chunk.</param>
|
||||
/// <param name="offset">The offset from the first byte of the chunk of the data to get.</param>
|
||||
/// <param name="size">The number of bytes written into the byte array.</param>
|
||||
/// <param name="data">An array of bytes where the data will be copied.</param>
|
||||
/// <returns>Returns <see cref="AudioFileError.Success" /> on success, otherwise an <see cref="AudioFileError" /> error code.</returns>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios17.0")]
|
||||
[SupportedOSPlatform ("tvos17.0")]
|
||||
[SupportedOSPlatform ("maccatalyst17.0")]
|
||||
[SupportedOSPlatform ("macos14.0")]
|
||||
#else
|
||||
[iOS (17, 0), TV (17, 0), MacCatalyst (17, 0), Mac (14, 0)]
|
||||
#endif
|
||||
public AudioFileError GetUserData (AudioFileChunkType chunkType, int index, long offset, byte [] data, out int size)
|
||||
{
|
||||
return GetUserData ((uint) chunkType, index, offset, data, out size);
|
||||
}
|
||||
|
||||
[DllImport (Constants.AudioToolboxLibrary)]
|
||||
extern static OSStatus AudioFileSetUserData (AudioFileID inAudioFile, int userDataID, int index, int userDataSize, IntPtr userData);
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Diagnostics;
|
||||
|
@ -81,7 +82,13 @@ namespace AudioToolbox {
|
|||
DVIIntelIMA = 0x6d730011,
|
||||
MicrosoftGSM = 0x6d730031,
|
||||
AES3 = 0x61657333, // 'aes3'
|
||||
#if !XAMCORE_5_0
|
||||
[Obsolete ("Use 'EnhancedAC3' instead.")]
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
EnhancedAES3 = 0x65632d33, // 'ec-3'
|
||||
#endif
|
||||
/// <summary>Enhanced AC-3.</summary>
|
||||
EnhancedAC3 = 0x65632d33, // 'ec-3'
|
||||
Flac = 0x666c6163, // 'flac'
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios13.0")]
|
||||
|
@ -95,6 +102,16 @@ namespace AudioToolbox {
|
|||
#endif
|
||||
LatmInLoas = 0x6c6f6173, // 'loas'
|
||||
Opus = 0x6f707573, // 'opus'
|
||||
/// <summary>Apple Positional Audio Codec.</summary>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
#else
|
||||
[NoWatch, iOS (18, 0), TV (18, 0), MacCatalyst (18, 0), Mac (15, 0)]
|
||||
#endif
|
||||
Apac = 0x61706163, // 'apac'
|
||||
}
|
||||
|
||||
[Flags]
|
||||
|
@ -921,6 +938,46 @@ namespace AudioToolbox {
|
|||
#endif
|
||||
Ogg_7_1 = (215U << 16) | 8,
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
MPEG_5_0_E = (216U << 16) | 5,
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
MPEG_5_1_E = (217U << 16) | 6,
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
MPEG_6_1_B = (218U << 16) | 7,
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
MPEG_7_1_D = (219U << 16) | 8,
|
||||
|
||||
Unknown = 0xFFFF0000 // needs to be ORed with the actual number of channels
|
||||
}
|
||||
|
||||
|
@ -1427,6 +1484,70 @@ namespace AudioToolbox {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>This struct represents the native <see href="https://developer.apple.com/documentation/coreaudiotypes/audiobufferlist">AudioBufferList</see> struct.</summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// Typically it's better to use the <see cref="AudioBuffers" /> class to wrap a pointer to a native AudioBufferList,
|
||||
/// but some audio code needs to minimize memory allocations due to being executed in a realtime thread. In that case,
|
||||
/// using this struct is better, because it's possible to use it without incurring any memory allocations.
|
||||
/// </para>
|
||||
///
|
||||
/// <para>
|
||||
/// Note that this struct should never be created in C#, the only valid way to use it is to cast a pointer (<see cref="IntPtr" />)
|
||||
/// to a pointer of this struct:
|
||||
/// </para>
|
||||
///
|
||||
/// <example>
|
||||
/// <code lang="csharp lang-csharp"><![CDATA[
|
||||
/// public unsafe static void Callback (IntPtr audioBufferListPtr) {
|
||||
/// AudioBufferList* audioBufferList = (AudioBufferList* ) audioBufferListPtr;
|
||||
/// for (var i = 0; i < audioBufferList->Count; i++) {
|
||||
/// AudioBuffer* buffer = audioBufferList->GetBuffer (index),
|
||||
/// // Use the buffer for something
|
||||
/// }
|
||||
/// }
|
||||
/// ]]></code>
|
||||
/// </example>
|
||||
/// </remarks>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#endif
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public unsafe readonly ref struct AudioBufferList {
|
||||
readonly uint mNumberOfBuffers;
|
||||
|
||||
/// <summary>Returns the number of audio buffers in this list.</summary>
|
||||
public uint Count { get => mNumberOfBuffers; }
|
||||
|
||||
/// <summary>Return a pointer to the <see cref="AudioBuffer" /> at the specified index.</summary>
|
||||
/// <param name="index">The index of the <see cref="AudioBuffer" /> to retrieve.</param>
|
||||
/// <returns>A pointer to the <see cref="AudioBuffer" /> at the specified index.</returns>
|
||||
public AudioBuffer* GetBuffer (int index)
|
||||
{
|
||||
if (index < 0 || index >= Count)
|
||||
throw new ArgumentOutOfRangeException (nameof (index));
|
||||
|
||||
//
|
||||
// Decodes
|
||||
//
|
||||
// struct AudioBufferList
|
||||
// {
|
||||
// UInt32 mNumberBuffers;
|
||||
// AudioBuffer mBuffers[1]; // this is a variable length array of mNumberBuffers elements
|
||||
// }
|
||||
//
|
||||
fixed (uint* bufferPtr = &mNumberOfBuffers) {
|
||||
byte* baddress = (byte*) bufferPtr;
|
||||
|
||||
var ptr = baddress + IntPtr.Size + index * sizeof (AudioBuffer);
|
||||
return (AudioBuffer*) ptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// CoreAudioClock.h (inside AudioToolbox)
|
||||
// It was a confusion between CA (CoreAudio) and CA (CoreAnimation)
|
||||
#if NET
|
||||
|
|
|
@ -51,15 +51,19 @@ namespace AudioToolbox {
|
|||
[iOS (16, 0)]
|
||||
[MacCatalyst (16, 0)]
|
||||
public enum AUSpatialMixerPersonalizedHrtfMode : uint {
|
||||
[NoiOS, NoTV]
|
||||
[NoMacCatalyst]
|
||||
[iOS (18, 0), TV (18, 0), MacCatalyst (18, 0)]
|
||||
Off = 0,
|
||||
[NoiOS, NoTV]
|
||||
[NoMacCatalyst]
|
||||
[iOS (18, 0), TV (18, 0), MacCatalyst (18, 0)]
|
||||
On = 1,
|
||||
[NoiOS, NoTV]
|
||||
[NoMacCatalyst]
|
||||
[iOS (18, 0), TV (18, 0), MacCatalyst (18, 0)]
|
||||
Auto = 2,
|
||||
}
|
||||
|
||||
[iOS (17, 0), TV (17, 0), MacCatalyst (17, 0), Mac (14, 0)]
|
||||
public enum AUVoiceIOOtherAudioDuckingLevel : uint {
|
||||
Default = 0,
|
||||
Min = 10,
|
||||
Mid = 20,
|
||||
Max = 30,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
|
@ -418,21 +419,29 @@ namespace AudioUnit {
|
|||
ReverbRoomType = 10,
|
||||
UsesInternalReverb = 1005,
|
||||
SpatializationAlgorithm = 3000,
|
||||
[Deprecated (PlatformName.iOS, 9, 0)]
|
||||
[Deprecated (PlatformName.TvOS, 9, 0)]
|
||||
[Deprecated (PlatformName.MacCatalyst, 13, 1)]
|
||||
[Deprecated (PlatformName.MacOSX, 10, 11)]
|
||||
DistanceParams = 3010,
|
||||
[Deprecated (PlatformName.iOS, 9, 0)]
|
||||
[Deprecated (PlatformName.TvOS, 9, 0)]
|
||||
[Deprecated (PlatformName.MacCatalyst, 13, 1)]
|
||||
[Deprecated (PlatformName.MacOSX, 10, 11)]
|
||||
AttenuationCurve = 3013,
|
||||
[Deprecated (PlatformName.iOS, 9, 0)]
|
||||
[Deprecated (PlatformName.TvOS, 9, 0)]
|
||||
[Deprecated (PlatformName.MacCatalyst, 13, 1)]
|
||||
[Deprecated (PlatformName.MacOSX, 10, 11)]
|
||||
RenderingFlags = 3003,
|
||||
SpatialMixerRenderingFlags = 3003,
|
||||
SpatialMixerSourceMode = 3005,
|
||||
SpatialMixerDistanceParams = 3010,
|
||||
#if !XAMCORE_5_0
|
||||
[Obsolete ("Use 'SpatialMixerDistanceParams' instead.")]
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
DistanceParams = SpatialMixerDistanceParams,
|
||||
[Obsolete ("Use 'SpatialMixerAttenuationCurve' instead.")]
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
AttenuationCurve = SpatialMixerAttenuationCurve,
|
||||
[Obsolete ("Use 'SpatialMixerRenderingFlags' instead.")]
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
RenderingFlags = SpatialMixerRenderingFlags,
|
||||
#endif
|
||||
SpatialMixerAttenuationCurve = 3013,
|
||||
SpatialMixerOutputType = 3100,
|
||||
SpatialMixerPointSourceInHeadMode = 3103,
|
||||
[Mac (12, 3), iOS (18, 0), TV (18, 0), MacCatalyst (18, 0), NoWatch]
|
||||
SpatialMixerEnableHeadTracking = 3111,
|
||||
[Mac (13, 0), iOS (18, 0), TV (18, 0), MacCatalyst (18, 0), NoWatch]
|
||||
SpatialMixerPersonalizedHrtfMode = 3113,
|
||||
[Mac (14, 0), iOS (18, 0), TV (18, 0), MacCatalyst (18, 0), NoWatch]
|
||||
SpatialMixerAnyInputIsUsingPersonalizedHrtf = 3116,
|
||||
|
||||
// AUScheduledSoundPlayer
|
||||
ScheduleAudioSlice = 3300,
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
#if NET
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
namespace BrowserEngineKit {
|
||||
#if IOS || MACCATALYST || TVOS
|
||||
[SupportedOSPlatform ("ios17.4")]
|
||||
[SupportedOSPlatform ("maccatalyst17.4")]
|
||||
[SupportedOSPlatform ("tvos17.4")]
|
||||
[UnsupportedOSPlatform ("macos")]
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct BEDirectionalTextRange
|
||||
{
|
||||
public nint Offset;
|
||||
public nint Length;
|
||||
}
|
||||
#endif // __IOS__ || __MACCATALYST__
|
||||
}
|
||||
#endif // NET
|
|
@ -10,6 +10,7 @@
|
|||
#nullable enable
|
||||
|
||||
using System;
|
||||
using CoreGraphics;
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
using System.ComponentModel;
|
||||
|
@ -18,8 +19,8 @@ using System.ComponentModel;
|
|||
using NativeHandle = System.IntPtr;
|
||||
#endif
|
||||
|
||||
#if !NET
|
||||
namespace CarPlay {
|
||||
#if !NET
|
||||
[Register (SkipRegistration = true)]
|
||||
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
|
||||
[Obsolete ("This API has been removed from the native SDK.")]
|
||||
|
@ -38,5 +39,24 @@ namespace CarPlay {
|
|||
|
||||
public override NativeHandle ClassHandle => throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if !XAMCORE_5_0 && __IOS__
|
||||
public partial class CPListItem {
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("ios14.0", "Do not use; this API was removed.")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
[UnsupportedOSPlatform ("macos")]
|
||||
[UnsupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("ios")]
|
||||
#else
|
||||
[Deprecated (PlatformName.iOS, 14, 0, message: "Do not use; this API was removed.")]
|
||||
#endif
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
public static CGSize MaximumListItemImageSize {
|
||||
get {
|
||||
return default (CGSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !XAMCORE_5_0 && __IOS__
|
||||
}
|
||||
|
|
|
@ -162,15 +162,6 @@ namespace CloudKit {
|
|||
#endif
|
||||
|
||||
#if WATCH
|
||||
|
||||
public partial class CKModifyBadgeOperation {
|
||||
|
||||
// `init` does not work on watchOS but we can keep compatibility with a different init
|
||||
public CKModifyBadgeOperation () : this (0)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public partial class CKModifyRecordZonesOperation {
|
||||
|
||||
// `init` does not work on watchOS but we can keep compatibility with a different init
|
||||
|
|
|
@ -0,0 +1,97 @@
|
|||
#if !XAMCORE_5_0
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
#if !NET
|
||||
using NativeHandle = System.IntPtr;
|
||||
#endif
|
||||
|
||||
namespace CloudKit {
|
||||
[Register ("CKFetchNotificationChangesOperation", SkipRegistration = true)]
|
||||
#if NET
|
||||
[UnsupportedOSPlatform ("ios", "Use 'CKDatabaseSubscription', 'CKFetchDatabaseChangesOperation' and 'CKFetchRecordZoneChangesOperation' instead.")]
|
||||
[UnsupportedOSPlatform ("macos", "Use 'CKDatabaseSubscription', 'CKFetchDatabaseChangesOperation' and 'CKFetchRecordZoneChangesOperation' instead.")]
|
||||
[UnsupportedOSPlatform ("tvos", "Use 'CKDatabaseSubscription', 'CKFetchDatabaseChangesOperation' and 'CKFetchRecordZoneChangesOperation' instead.")]
|
||||
[UnsupportedOSPlatform ("maccatalyst", "Use 'CKDatabaseSubscription', 'CKFetchDatabaseChangesOperation' and 'CKFetchRecordZoneChangesOperation' instead.")]
|
||||
#else
|
||||
[Obsolete ("Use 'CKDatabaseSubscription', 'CKFetchDatabaseChangesOperation' and 'CKFetchRecordZoneChangesOperation' instead.")]
|
||||
#endif
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
public unsafe partial class CKFetchNotificationChangesOperation : CKOperation {
|
||||
public override NativeHandle ClassHandle { get => throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms); }
|
||||
|
||||
protected CKFetchNotificationChangesOperation (NSObjectFlag t) : base (t)
|
||||
{
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
|
||||
protected internal CKFetchNotificationChangesOperation (NativeHandle handle) : base (handle)
|
||||
{
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
|
||||
public CKFetchNotificationChangesOperation ()
|
||||
: base (NSObjectFlag.Empty)
|
||||
{
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
|
||||
public CKFetchNotificationChangesOperation (CKServerChangeToken? previousServerChangeToken)
|
||||
: base (NSObjectFlag.Empty)
|
||||
{
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
|
||||
public unsafe virtual global::System.Action<CKServerChangeToken, NSError>? Completed {
|
||||
get {
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
set {
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool MoreComing {
|
||||
get {
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe virtual global::System.Action<CKNotification>? NotificationChanged {
|
||||
get {
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
set {
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual CKServerChangeToken? PreviousServerChangeToken {
|
||||
get {
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
set {
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual nuint ResultsLimit {
|
||||
get {
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
set {
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
}
|
||||
} /* class CKFetchNotificationChangesOperation */
|
||||
}
|
||||
|
||||
#endif // !XAMCORE_5_0
|
|
@ -0,0 +1,67 @@
|
|||
#if !XAMCORE_5_0
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
#if !NET
|
||||
using NativeHandle = System.IntPtr;
|
||||
#endif
|
||||
|
||||
namespace CloudKit {
|
||||
[Register ("CKMarkNotificationsReadOperation", SkipRegistration = true)]
|
||||
#if NET
|
||||
[UnsupportedOSPlatform ("ios", "Use 'CKDatabaseSubscription', 'CKFetchDatabaseChangesOperation' and 'CKFetchRecordZoneChangesOperation' instead.")]
|
||||
[UnsupportedOSPlatform ("macos", "Use 'CKDatabaseSubscription', 'CKFetchDatabaseChangesOperation' and 'CKFetchRecordZoneChangesOperation' instead.")]
|
||||
[UnsupportedOSPlatform ("tvos", "Use 'CKDatabaseSubscription', 'CKFetchDatabaseChangesOperation' and 'CKFetchRecordZoneChangesOperation' instead.")]
|
||||
[UnsupportedOSPlatform ("maccatalyst", "Use 'CKDatabaseSubscription', 'CKFetchDatabaseChangesOperation' and 'CKFetchRecordZoneChangesOperation' instead.")]
|
||||
#endif
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
public unsafe partial class CKMarkNotificationsReadOperation : CKOperation {
|
||||
public override NativeHandle ClassHandle { get => throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms); }
|
||||
|
||||
protected CKMarkNotificationsReadOperation (NSObjectFlag t) : base (t)
|
||||
{
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
|
||||
protected internal CKMarkNotificationsReadOperation (NativeHandle handle) : base (handle)
|
||||
{
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
|
||||
public CKMarkNotificationsReadOperation (CKNotificationID [] notificationIds)
|
||||
: base (NSObjectFlag.Empty)
|
||||
{
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
|
||||
public unsafe virtual CKMarkNotificationsReadHandler? Completed {
|
||||
get {
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
set {
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual CKNotificationID []? NotificationIds {
|
||||
get {
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
set {
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
}
|
||||
} /* class CKMarkNotificationsReadOperation */
|
||||
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
public delegate void CKMarkNotificationsReadHandler (CKNotificationID [] notificationIDsMarkedRead, NSError operationError);
|
||||
}
|
||||
#endif // !XAMCORE_5_0
|
|
@ -0,0 +1,74 @@
|
|||
#if !XAMCORE_5_0
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
#if !NET
|
||||
using NativeHandle = System.IntPtr;
|
||||
#endif
|
||||
|
||||
namespace CloudKit {
|
||||
[Register ("CKModifyBadgeOperation", SkipRegistration = true)]
|
||||
#if NET
|
||||
[UnsupportedOSPlatform ("ios", "Modifying badge counts is no longer supported.")]
|
||||
[UnsupportedOSPlatform ("macos", "Modifying badge counts is no longer supported.")]
|
||||
[UnsupportedOSPlatform ("tvos", "Modifying badge counts is no longer supported.")]
|
||||
[UnsupportedOSPlatform ("maccatalyst", "Modifying badge counts is no longer supported.")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Modifying badge counts is no longer supported.")]
|
||||
[Deprecated (PlatformName.iOS, 18, 0, message: "Modifying badge counts is no longer supported.")]
|
||||
[Deprecated (PlatformName.WatchOS, 11, 0, message: "Modifying badge counts is no longer supported.")]
|
||||
[Deprecated (PlatformName.TvOS, 18, 0, message: "Modifying badge counts is no longer supported.")]
|
||||
#endif
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
public class CKModifyBadgeOperation : CKOperation {
|
||||
public override NativeHandle ClassHandle { get => throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms); }
|
||||
|
||||
public CKModifyBadgeOperation () : base (NSObjectFlag.Empty)
|
||||
{
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
|
||||
protected CKModifyBadgeOperation (NSObjectFlag t) : base (t)
|
||||
{
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
|
||||
protected internal CKModifyBadgeOperation (NativeHandle handle) : base (handle)
|
||||
{
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
|
||||
public CKModifyBadgeOperation (nuint badgeValue)
|
||||
: base (NSObjectFlag.Empty)
|
||||
{
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
|
||||
public virtual nuint BadgeValue {
|
||||
get {
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
set {
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe virtual global::System.Action<NSError>? Completed {
|
||||
get {
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
set {
|
||||
throw new PlatformNotSupportedException (Constants.TypeRemovedAllPlatforms);
|
||||
}
|
||||
}
|
||||
} /* class CKModifyBadgeOperation */
|
||||
}
|
||||
#endif // !XAMCORE_5_0
|
|
@ -70,7 +70,9 @@ namespace Contacts {
|
|||
NotDetermined = 0,
|
||||
Restricted,
|
||||
Denied,
|
||||
Authorized
|
||||
Authorized,
|
||||
[iOS (18, 0), NoMacCatalyst, Watch (11, 0), NoMac]
|
||||
Limited,
|
||||
}
|
||||
|
||||
// NSInteger -> CNContainer.h
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
#if NET
|
||||
using System;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using ObjCRuntime;
|
||||
|
||||
namespace CoreData {
|
||||
public partial class NSPersistentStoreCoordinator {
|
||||
#if !__TVOS__
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
public NSManagedObjectID GetManagedObjectId (string value)
|
||||
{
|
||||
using var str = new TransientString (value);
|
||||
return GetManagedObjectId ((IntPtr) str, (nuint) value.Length);
|
||||
}
|
||||
#endif // !__TVOS__
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -991,6 +991,41 @@ namespace CoreGraphics {
|
|||
#endif
|
||||
public bool IsPQBased => CGColorSpaceIsPQBased (Handle) != 0;
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
#else
|
||||
[Mac (15, 0)]
|
||||
[iOS (18, 0)]
|
||||
[TV (18, 0)]
|
||||
[MacCatalyst (18, 0)]
|
||||
[Watch (11, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.CoreGraphicsLibrary)]
|
||||
extern static /* CGColorSpaceRef */ IntPtr CGColorSpaceCopyBaseColorSpace (/* CGColorSpaceRef */ IntPtr space);
|
||||
|
||||
/// <summary>Get the base color space, or a new color space without any image-specific metadata.</summary>
|
||||
/// <returns>If the current color space is a pattern or an indexed color space, get the base color space. If the current color space contains image-specific metadata associated with the gain map, get a new color space without the metadata. Otherwise returns a null value.</returns>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
#else
|
||||
[Mac (15, 0)]
|
||||
[iOS (18, 0)]
|
||||
[TV (18, 0)]
|
||||
[MacCatalyst (18, 0)]
|
||||
[Watch (11, 0)]
|
||||
#endif
|
||||
public CGColorSpace? CopyBaseColorSpace ()
|
||||
{
|
||||
var h = CGColorSpaceCopyBaseColorSpace (Handle);
|
||||
return FromHandle (h, true);
|
||||
}
|
||||
|
||||
|
||||
#endif // !COREBUILD
|
||||
}
|
||||
|
|
|
@ -1433,6 +1433,109 @@ namespace CoreGraphics {
|
|||
public void DrawConicGradient (CGGradient? gradient, CGPoint point, nfloat angle) =>
|
||||
CGContextDrawConicGradient (Handle, gradient.GetHandle (), point, angle);
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.CoreGraphicsLibrary)]
|
||||
static extern byte CGContextSetEDRTargetHeadroom (/* CGContextRef __nonnull */ IntPtr context, /* float */ float headroom);
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.CoreGraphicsLibrary)]
|
||||
static extern float CGContextGetEDRTargetHeadroom (/* CGContextRef __nonnull */ IntPtr context);
|
||||
|
||||
/// <summary>Get the EDR headroom that's used when rendering HDR content.</summary>
|
||||
/// <returns>The EDR headroom.</returns>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public float GetEdrTargetHeadroom ()
|
||||
{
|
||||
return CGContextGetEDRTargetHeadroom (Handle);
|
||||
}
|
||||
|
||||
/// <summary>Get the EDR headroom that's used when rendering HDR content.</summary>
|
||||
/// <param name="value">The value to set. Must be greater than 1.0f.</param>
|
||||
/// <returns>Returns true if successful, false otherwise.</returns>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public bool SetEdrTargetHeadroom (float value)
|
||||
{
|
||||
return CGContextSetEDRTargetHeadroom (Handle, value) != 0;
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.CoreGraphicsLibrary)]
|
||||
static extern /* bool */ byte CGContextDrawImageApplyingToneMapping (/* CGContextRef __nonnull */ IntPtr context, CGRect r, /* CGImageRef */ IntPtr image, CGToneMapping method, /* CFDictionaryRef __nullable */ IntPtr options);
|
||||
|
||||
/// <summary>Draw the specified image onto the CGContext, applying the tone mapping and any tone mapping options.</summary>
|
||||
/// <param name="rect">The rectangle where the image is rendered.</param>
|
||||
/// <param name="image">The image to render.</param>
|
||||
/// <param name="method">The tone mapping method to use.</param>
|
||||
/// <param name="options">The tone mapping options to use.</param>
|
||||
/// <returns>Returns true if successful, otherwise false.</returns>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public bool DrawImageApplyingToneMapping (CGRect rect, CGImage image, CGToneMapping method, NSDictionary? options)
|
||||
{
|
||||
var rv = CGContextDrawImageApplyingToneMapping (Handle, rect, image.Handle, method, options.GetHandle ());
|
||||
return rv != 0;
|
||||
}
|
||||
|
||||
/// <summary>Draw the specified image onto the CGContext, applying the tone mapping and any tone mapping options.</summary>
|
||||
/// <param name="rect">The rectangle where the image is rendered.</param>
|
||||
/// <param name="image">The image to render.</param>
|
||||
/// <param name="method">The tone mapping method to use.</param>
|
||||
/// <param name="options">The tone mapping options to use.</param>
|
||||
/// <returns>Returns true if successful, otherwise false.</returns>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public bool DrawImageApplyingToneMapping (CGRect rect, CGImage image, CGToneMapping method, CGToneMappingOptions? options)
|
||||
{
|
||||
var rv = CGContextDrawImageApplyingToneMapping (Handle, rect, image.Handle, method, options?.Dictionary?.GetHandle () ?? IntPtr.Zero);
|
||||
return rv != 0;
|
||||
}
|
||||
#endif // !COREBUILD
|
||||
}
|
||||
}
|
||||
|
|
|
@ -376,6 +376,78 @@ namespace CoreGraphics {
|
|||
CGPDFContextEndTag (Handle);
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.CoreGraphicsLibrary)]
|
||||
static extern void CGPDFContextSetParentTree (/* CGContextRef cg_nullable */ IntPtr context, /* CGPDFDictionaryRef */ IntPtr parentTreeDictionary);
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public void SetParentTree (CGPDFDictionary parentTreeDictionary)
|
||||
{
|
||||
CGPDFContextSetParentTree (GetCheckedHandle (), parentTreeDictionary.GetNonNullHandle (nameof (parentTreeDictionary)));
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.CoreGraphicsLibrary)]
|
||||
static extern void CGPDFContextSetIDTree (/* CGContextRef cg_nullable */ IntPtr context, /* CGPDFDictionaryRef */ IntPtr IDTreeDictionary);
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public void SetIdTree (CGPDFDictionary idTreeDictionary)
|
||||
{
|
||||
CGPDFContextSetIDTree (GetCheckedHandle (), idTreeDictionary.GetNonNullHandle (nameof (idTreeDictionary)));
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.CoreGraphicsLibrary)]
|
||||
static extern void CGPDFContextSetPageTagStructureTree (/* CGContextRef cg_nullable */ IntPtr context, /* CFDictionaryRef */ IntPtr pageTagStructureTreeDictionary);
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public void SetPageTagStructureTree (NSDictionary pageTagStructureTreeDictionary)
|
||||
{
|
||||
CGPDFContextSetPageTagStructureTree (GetCheckedHandle (), pageTagStructureTreeDictionary.GetNonNullHandle (nameof (pageTagStructureTreeDictionary)));
|
||||
}
|
||||
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
|
|
|
@ -168,6 +168,8 @@ namespace CoreGraphics {
|
|||
Figure = 700,
|
||||
Formula,
|
||||
Form,
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
Object = 800,
|
||||
}
|
||||
|
||||
// untyped enum -> CGPDFObject.h
|
||||
|
|
|
@ -358,15 +358,15 @@ namespace CoreGraphics {
|
|||
EventWindowUnderMousePointerThatCanHandleThisEvent = 92,
|
||||
|
||||
// no documentation for this value in the header file.
|
||||
/// <summary>A value that represnets the scroll wheel's scroll phase.</summary>
|
||||
/// <summary>A value that represents the scroll wheel's scroll phase.</summary>
|
||||
ScrollWheelEventScrollPhase = 99,
|
||||
|
||||
// no documentation for this value in the header file.
|
||||
/// <summary>A value that represnets the scroll wheel's scroll count.</summary>
|
||||
/// <summary>A value that represents the scroll wheel's scroll count.</summary>
|
||||
ScrollWheelEventScrollCount = 100,
|
||||
|
||||
// no documentation for this value in the header file.
|
||||
/// <summary>A value that represnets the scroll wheel's scroll momentum.</summary>
|
||||
/// <summary>A value that represents the scroll wheel's scroll momentum.</summary>
|
||||
ScrollWheelEventMomentumPhase = 123,
|
||||
|
||||
// the header file doesn't say whether this is an integer or a double
|
||||
|
@ -376,6 +376,26 @@ namespace CoreGraphics {
|
|||
// the header file doesn't say whether this is an integer or a double
|
||||
/// <summary>The unaccelerated pointer movement for the Y axis.</summary>
|
||||
EventUnacceleratedPointerMovementY = 171,
|
||||
|
||||
// no documentation for this value in the header file.
|
||||
/// <summary>A value that represents the scroll wheel's scroll momentum.</summary>
|
||||
ScrollWheelEventMomentumOptionPhase = 173,
|
||||
|
||||
// no documentation for this value in the header file.
|
||||
/// <summary>A value that represents the accelerated delta value for axis 1.</summary>
|
||||
ScrollWheelEventAcceleratedDeltaAxis1 = 176,
|
||||
|
||||
// no documentation for this value in the header file.
|
||||
/// <summary>A value that represents the accelerated delta value for axis 2.</summary>
|
||||
ScrollWheelEventAcceleratedDeltaAxis2 = 175,
|
||||
|
||||
// no documentation for this value in the header file.
|
||||
/// <summary>A value that represents the raw delta value for axis 1.</summary>
|
||||
ScrollWheelEventRawDeltaAxis1 = 178,
|
||||
|
||||
// no documentation for this value in the header file.
|
||||
/// <summary>A value that represents the raw delta value for axis 2.</summary>
|
||||
ScrollWheelEventRawDeltaAxis2 = 177
|
||||
}
|
||||
|
||||
// CGEventTypes.h:typedef uint32_t CGEventType;
|
||||
|
|
|
@ -253,19 +253,25 @@ namespace CoreGraphics {
|
|||
#if MONOMAC || __MACCATALYST__
|
||||
#if NET
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[ObsoletedOSPlatform ("maccatalyst18.0", "Use ScreenCaptureKit instead.")]
|
||||
[UnsupportedOSPlatform ("ios")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use ScreenCaptureKit instead.")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[MacCatalyst (13,1)]
|
||||
[Deprecated (PlatformName.MacCatalyst, 17, 0, message: "Use ScreenCaptureKit instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 14, 0, message: "Use ScreenCaptureKit instead.")]
|
||||
#endif
|
||||
[DllImport (Constants.CoreGraphicsLibrary)]
|
||||
static extern IntPtr CGWindowListCreateImage(CGRect screenBounds, CGWindowListOption windowOption, uint windowID, CGWindowImageOption imageOption);
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[ObsoletedOSPlatform ("maccatalyst18.0", "Use ScreenCaptureKit instead.")]
|
||||
[UnsupportedOSPlatform ("ios")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use ScreenCaptureKit instead.")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[MacCatalyst (13,1)]
|
||||
|
@ -277,11 +283,15 @@ namespace CoreGraphics {
|
|||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[ObsoletedOSPlatform ("maccatalyst18.0", "Use ScreenCaptureKit instead.")]
|
||||
[UnsupportedOSPlatform ("ios")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use ScreenCaptureKit instead.")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[MacCatalyst (13,1)]
|
||||
[Deprecated (PlatformName.MacCatalyst, 18, 0, message: "Use ScreenCaptureKit instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use ScreenCaptureKit instead.")]
|
||||
#endif
|
||||
public static CGImage? ScreenImage (int windownumber, CGRect bounds, CGWindowListOption windowOption,
|
||||
CGWindowImageOption imageOption)
|
||||
|
@ -588,6 +598,202 @@ namespace CoreGraphics {
|
|||
#endif
|
||||
public CGImageByteOrderInfo ByteOrderInfo => CGImageGetByteOrderInfo (Handle);
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.CoreGraphicsLibrary)]
|
||||
unsafe static extern /* CGImageRef __nullable */ IntPtr CGImageCreateWithContentHeadroom (
|
||||
/* float */ float headroom,
|
||||
/* size_t */ nint width,
|
||||
/* size_t */ nint height,
|
||||
/* size_t */ nint bitsPerComponent,
|
||||
/* size_t */ nint bitsPerPixel,
|
||||
/* size_t */ nint bytesPerRow,
|
||||
/* CGColorSpaceRef cg_nullable */ IntPtr space,
|
||||
/* CGBitmapInfo */ CGBitmapFlags bitmapInfo,
|
||||
/* CGDataProviderRef cg_nullable */ IntPtr provider,
|
||||
/* const CGFloat * __nullable */ nfloat* decode,
|
||||
/* bool */ byte shouldInterpolate,
|
||||
/* CGColorRenderingIntent */ CGColorRenderingIntent intent);
|
||||
|
||||
/// <summary>Create a new CGImage instance with the specified content headroom.</summary>
|
||||
/// <param name="headroom">The content headroom. Must be either 0.0f or greater than or equal to 1.0f.</param>
|
||||
/// <param name="width">The width of the new image.</param>
|
||||
/// <param name="height">The height of the new image.</param>
|
||||
/// <param name="bitsPerComponent">Bits per component for the new image.</param>
|
||||
/// <param name="bitsPerPixel">Bits per pixel for the new image.</param>
|
||||
/// <param name="bytesPerRow">Bytes per row for the new image.</param>
|
||||
/// <param name="colorSpace">The colorspace for the new image.</param>
|
||||
/// <param name="bitmapFlags">The bitmap flags for the new image.</param>
|
||||
/// <param name="provider">The data provider for the new image.</param>
|
||||
/// <param name="decode">The decode array for the new image.</param>
|
||||
/// <param name="shouldInterpolate">Whether image is interpolated or not.</param>
|
||||
/// <param name="intent">The rendering intent for the new image.</param>
|
||||
/// <returns>A new CGImage instance.</returns>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public CGImage (float headroom, int width, int height, int bitsPerComponent, int bitsPerPixel, int bytesPerRow,
|
||||
CGColorSpace? colorSpace, CGBitmapFlags bitmapFlags, CGDataProvider? provider,
|
||||
nfloat []? decode, bool shouldInterpolate, CGColorRenderingIntent intent)
|
||||
: base (Create (headroom, width, height, bitsPerComponent, bitsPerPixel, bytesPerRow, colorSpace, bitmapFlags, provider, decode, shouldInterpolate, intent), true)
|
||||
{
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
static IntPtr Create (float headroom, int width, int height, int bitsPerComponent, int bitsPerPixel, int bytesPerRow,
|
||||
CGColorSpace? colorSpace, CGBitmapFlags bitmapFlags, CGDataProvider? provider,
|
||||
nfloat []? decode, bool shouldInterpolate, CGColorRenderingIntent intent)
|
||||
{
|
||||
if (headroom != 0.0f && headroom < 1.0f)
|
||||
throw new ArgumentException (nameof (headroom));
|
||||
if (width < 0)
|
||||
throw new ArgumentException (nameof (width));
|
||||
if (height < 0)
|
||||
throw new ArgumentException (nameof (height));
|
||||
if (bitsPerPixel < 0)
|
||||
throw new ArgumentException (nameof (bitsPerPixel));
|
||||
if (bitsPerComponent < 0)
|
||||
throw new ArgumentException (nameof (bitsPerComponent));
|
||||
if (bytesPerRow < 0)
|
||||
throw new ArgumentException (nameof (bytesPerRow));
|
||||
|
||||
unsafe {
|
||||
fixed (nfloat* decodePtr = decode) {
|
||||
return CGImageCreateWithContentHeadroom (headroom, width, height, bitsPerComponent, bitsPerPixel, bytesPerRow,
|
||||
colorSpace.GetHandle (), bitmapFlags, provider.GetHandle (),
|
||||
decodePtr, shouldInterpolate.AsByte (), intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.CoreGraphicsLibrary)]
|
||||
unsafe static extern /* CGImageRef __nullable */ IntPtr CGImageCreateCopyWithContentHeadroom (
|
||||
/* float */ float headroom,
|
||||
/* CGImageRef cg_nullable */ IntPtr image);
|
||||
|
||||
/// <summary>Create a copy of the current image, adding or replacing the current image's headroom.</summary>
|
||||
/// <param name="headroom">Must be either equal to 0 or greater or equal to 1.0.</param>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public CGImage? Copy (float headroom)
|
||||
{
|
||||
if (headroom != 0.0f && headroom < 1.0f)
|
||||
throw new ArgumentException (nameof (headroom));
|
||||
|
||||
var rv = CGImageCreateCopyWithContentHeadroom (headroom, GetCheckedHandle ());
|
||||
return Runtime.GetINativeObject<CGImage> (rv, owns: true);
|
||||
}
|
||||
|
||||
/// <summary>Get the default content headroom for HDR images.</summary>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public static float DefaultHdrImageContentHeadroom {
|
||||
get => CoreGraphicsFields.DefaultHdrImageContentHeadroom;
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.CoreGraphicsLibrary)]
|
||||
static extern float CGImageGetContentHeadroom (/* __nullable CGImageRef */ IntPtr handle);
|
||||
|
||||
/// <summary>Get the content headroom for this image.</summary>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public float ContentHeadroom => CGImageGetContentHeadroom (Handle);
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.CoreGraphicsLibrary)]
|
||||
static extern /* bool */ byte CGImageShouldToneMap (/* __nullable CGImageRef */ IntPtr handle);
|
||||
|
||||
/// <summary>Get whether this image should be tone mapped when rendered.</summary>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public bool ShouldToneMap => CGImageShouldToneMap (Handle) != 0;
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.CoreGraphicsLibrary)]
|
||||
static extern /* bool */ byte CGImageContainsImageSpecificToneMappingMetadata (/* __nullable CGImageRef */ IntPtr handle);
|
||||
|
||||
/// <summary>Get whether this image has image-specific tone mapping metadata.</summary>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public bool ContainsImageSpecificToneMappingMetadata => CGImageContainsImageSpecificToneMappingMetadata (Handle) != 0;
|
||||
#endif // !COREBUILD
|
||||
}
|
||||
}
|
||||
|
|
|
@ -714,6 +714,12 @@ namespace CoreImage {
|
|||
return new CIBlendWithBlueMask (handle);
|
||||
case "CIBlendWithRedMask":
|
||||
return new CIBlendWithRedMask (handle);
|
||||
case "CIMaximumScaleTransform":
|
||||
return new CIMaximumScaleTransform (handle);
|
||||
case "CIToneMapHeadroom":
|
||||
return new CIToneMapHeadroom (handle);
|
||||
case "CIAreaBoundsRed":
|
||||
return new CIAreaBoundsRed (handle);
|
||||
default:
|
||||
throw new NotImplementedException (String.Format ("Unknown filter type returned: `{0}', returning a default CIFilter", filterName));
|
||||
}
|
||||
|
|
|
@ -108,6 +108,7 @@ namespace CoreMedia {
|
|||
Cinepak = 0x63766964,
|
||||
JPEG = 0x6a706567,
|
||||
JPEG_OpenDML = 0x646d6231,
|
||||
JPEG_XL = ('j' << 24) + ('x' << 16) + ('l' << 8) + 'c', // 'jxlc'
|
||||
SorensonVideo = 0x53565131,
|
||||
SorensonVideo3 = 0x53565133,
|
||||
H263 = 0x68323633,
|
||||
|
|
|
@ -2544,6 +2544,23 @@ namespace CoreMidi {
|
|||
SetInt (MidiPropertyExtensions.kMIDIPropertyUMPCanTransmitGroupless, value ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[NoWatch, NoTV, Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public int AssociatedEndpoint {
|
||||
get {
|
||||
return GetInt (MidiPropertyExtensions.kMIDIPropertyAssociatedEndpoint);
|
||||
}
|
||||
set {
|
||||
SetInt (MidiPropertyExtensions.kMIDIPropertyAssociatedEndpoint, value);
|
||||
}
|
||||
}
|
||||
// MidiEndpoint
|
||||
#endif // !COREBUILD
|
||||
}
|
||||
|
@ -2557,6 +2574,14 @@ namespace CoreMidi {
|
|||
ThruConnectionsChanged,
|
||||
SerialPortOwnerChanged,
|
||||
IOError,
|
||||
#if !MONOMAC
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[UnsupportedOSPlatform ("macos")]
|
||||
#endif
|
||||
InternalStart = 0x1000,
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -0,0 +1,161 @@
|
|||
#if !TVOS && !WATCH
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using ObjCRuntime;
|
||||
using CoreFoundation;
|
||||
using Foundation;
|
||||
|
||||
using MidiObjectRef = System.Int32;
|
||||
using MidiClientRef = System.Int32;
|
||||
using MidiDeviceRef = System.Int32;
|
||||
using MidiDeviceListRef = System.Int32;
|
||||
using MidiPortRef = System.Int32;
|
||||
using MidiEndpointRef = System.Int32;
|
||||
using MidiEntityRef = System.Int32;
|
||||
|
||||
namespace CoreMidi {
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#endif
|
||||
[NativeName ("MIDI2DeviceManufacturer")]
|
||||
public struct Midi2DeviceManufacturer {
|
||||
// Byte sysExIDByte[3]; // 1-byte SysEx IDs are padded with trailing zeroes
|
||||
byte sysExIdByte0;
|
||||
byte sysExIdByte1;
|
||||
byte sysExIdByte2;
|
||||
|
||||
public byte [] SysExIdByte {
|
||||
get {
|
||||
return new byte [] { sysExIdByte0, sysExIdByte1, sysExIdByte2 };
|
||||
}
|
||||
set {
|
||||
if (value is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (value));
|
||||
if (value.Length != 3)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentOutOfRangeException (nameof (value), "Length must be 3");
|
||||
|
||||
sysExIdByte0 = value [0];
|
||||
sysExIdByte1 = value [1];
|
||||
sysExIdByte2 = value [2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#endif
|
||||
[NativeName ("MIDI2DeviceRevisionLevel")]
|
||||
public struct Midi2DeviceRevisionLevel {
|
||||
// Byte revisionLevel[4];
|
||||
byte revisionLevel0;
|
||||
byte revisionLevel1;
|
||||
byte revisionLevel2;
|
||||
byte revisionLevel3;
|
||||
|
||||
public byte [] RevisionLevel {
|
||||
get {
|
||||
return new byte [] { revisionLevel0, revisionLevel1, revisionLevel2, revisionLevel3 };
|
||||
}
|
||||
set {
|
||||
if (value is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (value));
|
||||
if (value.Length != 4)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentOutOfRangeException (nameof (value), "Length must be 4");
|
||||
|
||||
revisionLevel0 = value [0];
|
||||
revisionLevel1 = value [1];
|
||||
revisionLevel2 = value [2];
|
||||
revisionLevel3 = value [3];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
[NativeName ("MIDICIProfileIDStandard")]
|
||||
public struct MidiCIProfileIdStandard {
|
||||
public byte /* MIDIUInteger7 */ ProfileIdByte1;
|
||||
public byte /* MIDIUInteger7 */ ProfileBank;
|
||||
public byte /* MIDIUInteger7 */ ProfileNumber;
|
||||
public byte /* MIDIUInteger7 */ ProfileVersion;
|
||||
public byte /* MIDIUInteger7 */ ProfileLevel;
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
[NativeName ("MIDICIProfileIDManufacturerSpecific")]
|
||||
public struct MidiCIProfileIdManufacturerSpecific {
|
||||
public byte /* MIDIUInteger7 */ SysExId1;
|
||||
public byte /* MIDIUInteger7 */ SysExId2;
|
||||
public byte /* MIDIUInteger7 */ SysExId3;
|
||||
public byte /* MIDIUInteger7 */ Info1;
|
||||
public byte /* MIDIUInteger7 */ Info2;
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
[NativeName ("MIDICIProfileID")]
|
||||
public struct MidiCIProfileId {
|
||||
// This is a union between MidiCIProfileIdStandard and MidiCIProfileIdManufacturerSpecific, each with the same size (5 bytes)
|
||||
// So declare a struct with 5 bytes, and then do some memory copies to convert to each element of the union.
|
||||
byte /* MIDIUInteger7 */ Value0;
|
||||
byte /* MIDIUInteger7 */ Value1;
|
||||
byte /* MIDIUInteger7 */ Value2;
|
||||
byte /* MIDIUInteger7 */ Value3;
|
||||
byte /* MIDIUInteger7 */ Value4;
|
||||
|
||||
public unsafe MidiCIProfileIdStandard Standard {
|
||||
get {
|
||||
fixed (MidiCIProfileId* self = &this) {
|
||||
return *(MidiCIProfileIdStandard*) self;
|
||||
}
|
||||
}
|
||||
set {
|
||||
fixed (MidiCIProfileId* self = &this) {
|
||||
*self = *(MidiCIProfileId*) &value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe MidiCIProfileIdManufacturerSpecific ManufacturerSpecific {
|
||||
get {
|
||||
fixed (MidiCIProfileId* self = &this) {
|
||||
return *(MidiCIProfileIdManufacturerSpecific*) self;
|
||||
}
|
||||
}
|
||||
set {
|
||||
fixed (MidiCIProfileId* self = &this) {
|
||||
*self = *(MidiCIProfileId*) &value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -28,6 +28,7 @@ namespace CoreSpotlight {
|
|||
RemoteConnectionError = -1003,
|
||||
QuotaExceeded = -1004,
|
||||
IndexingUnsupported = -1005,
|
||||
MismatchedClientState = -1006,
|
||||
}
|
||||
|
||||
/// <summary>Enumerates errors that can occur while running a Core Spotlight query with <see cref="M:CoreSpotlight.CSSearchQuery.Start" />.</summary>
|
||||
|
@ -53,4 +54,12 @@ namespace CoreSpotlight {
|
|||
CompleteUnlessOpen,
|
||||
CompleteUntilFirstUserAuthentication,
|
||||
}
|
||||
|
||||
[NoTV, Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Native]
|
||||
public enum CSUserInteraction : long {
|
||||
Select,
|
||||
Default = Select,
|
||||
Focus,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2666,6 +2666,99 @@ namespace CoreText {
|
|||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.CoreTextLibrary)]
|
||||
extern static /* CGRect */ CGRect CTFontGetTypographicBoundsForAdaptiveImageProvider (
|
||||
/* CTFontRef */ IntPtr font,
|
||||
/* id<CTAdaptiveImageProviding> __Nullable */ IntPtr provider);
|
||||
|
||||
/// <summary>Computes metrics that clients performing their own typesetting of an adaptive image glyph need.</summary>
|
||||
/// <returns>The typographic bounds in points expressed as a rectangle, where the rectangle's Width property corresponds to the advance width, the rectangle's Bottom property corresponds to the ascent (above the baseline), and Top property corresponds to the descent (below the baseline).</returns>
|
||||
/// <param name="provider">The adaptive image provider used during the computation. If null, then default results will be returned, on the assumption that an image is not yet available.</param>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public CGRect GetTypographicBoundsForAdaptiveImageProvider (ICTAdaptiveImageProviding? provider)
|
||||
{
|
||||
return CTFontGetTypographicBoundsForAdaptiveImageProvider (Handle, provider.GetHandle ());
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.CoreTextLibrary)]
|
||||
extern static void CTFontDrawImageFromAdaptiveImageProviderAtPoint (
|
||||
/* CTFontRef */ IntPtr font,
|
||||
/* id<CTAdaptiveImageProviding> __Nullable */ IntPtr provider,
|
||||
/* CGPoint */ CGPoint point,
|
||||
/* CGContexRef */ IntPtr context);
|
||||
|
||||
/// <summary>Draws the image for an adaptive image glyph at the given point.</summary>
|
||||
/// <param name="provider">The adaptive image provider used during the rendering.</param>
|
||||
/// <param name="point">The adaptive image glyph is rendered relative to this point.</param>
|
||||
/// <param name="context">The <see cref="CoreGraphics.CGBitmapContext" /> where the adaptive image glyph is drawn.</param>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public void DrawImage (ICTAdaptiveImageProviding provider, CGPoint point, CGContext context)
|
||||
{
|
||||
CTFontDrawImageFromAdaptiveImageProviderAtPoint (Handle, provider.GetNonNullHandle (nameof (provider)), point, context.GetNonNullHandle (nameof (context)));
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios13.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos13.0")]
|
||||
#else
|
||||
[Watch (6, 0), TV (13, 0), iOS (13, 0), MacCatalyst (13, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.CoreTextLibrary)]
|
||||
extern static byte CTFontHasTable (
|
||||
/* CTFontRef */ IntPtr font,
|
||||
/* CTFontTableTag */ CTFontTable tag);
|
||||
|
||||
/// <summary>Checks whether a table is present in a font.</summary>
|
||||
/// <param name="tag">The table identifier to check for.</param>
|
||||
/// <returns>Whether the table is present in the font or not.</returns>
|
||||
/// <remarks>The check behaves as if <see cref="CTFontTableOptions.None" /> was specified.</remarks>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios13.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos13.0")]
|
||||
#else
|
||||
[Watch (6, 0), TV (13, 0), iOS (13, 0), MacCatalyst (13, 0)]
|
||||
#endif
|
||||
public bool HasTable (CTFontTable tag)
|
||||
{
|
||||
return CTFontHasTable (GetCheckedHandle (), tag) != 0;
|
||||
}
|
||||
|
||||
|
||||
public override string? ToString ()
|
||||
{
|
||||
return FullName;
|
||||
|
|
|
@ -401,6 +401,17 @@ namespace CoreText {
|
|||
}
|
||||
}
|
||||
#endif // !XAMCORE_5_0
|
||||
|
||||
#if NET && (__IOS__ || __MACCATALYST__)
|
||||
[SupportedOSPlatform ("ios13.0")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[UnsupportedOSPlatform ("macos")]
|
||||
public string? RegistrationUserInfo {
|
||||
get { return Adapter.GetStringValue (Dictionary, CTFontDescriptorAttributeKey.RegistrationUserInfo); }
|
||||
set { Adapter.SetValue (Dictionary, CTFontDescriptorAttributeKey.RegistrationUserInfo!, value); }
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if NET
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace CoreText {
|
|||
#endif
|
||||
Persistent = 2,
|
||||
#if NET
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[UnsupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[UnsupportedOSPlatform ("ios")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
|
@ -442,9 +442,41 @@ namespace CoreText {
|
|||
}
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
[SupportedOSPlatform ("ios")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'CreateFontDescriptors' or 'RegisterFontsForUrl' instead.")]
|
||||
[ObsoletedOSPlatform ("tvos18.0", "Use 'CreateFontDescriptors' or 'RegisterFontsForUrl' instead.")]
|
||||
[ObsoletedOSPlatform ("ios18.0", "Use 'CreateFontDescriptors' or 'RegisterFontsForUrl' instead.")]
|
||||
[ObsoletedOSPlatform ("maccatalyst18.0", "Use 'CreateFontDescriptors' or 'RegisterFontsForUrl' instead.")]
|
||||
#else
|
||||
[Deprecated (PlatformName.iOS, 18, 0, message: "Use 'CreateFontDescriptors' or 'RegisterFontsForUrl' instead.")]
|
||||
[Deprecated (PlatformName.MacCatalyst, 18, 0, message: "Use 'CreateFontDescriptors' or 'RegisterFontsForUrl' instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 18, 0, message: "Use 'CreateFontDescriptors' or 'RegisterFontsForUrl' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'CreateFontDescriptors' or 'RegisterFontsForUrl' instead.")]
|
||||
[Deprecated (PlatformName.WatchOS, 11, 0, message: "Use 'CreateFontDescriptors' or 'RegisterFontsForUrl' instead.")]
|
||||
#endif
|
||||
[DllImport (Constants.CoreTextLibrary)]
|
||||
unsafe static extern byte CTFontManagerRegisterGraphicsFont (IntPtr cgfont, IntPtr* error);
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
[SupportedOSPlatform ("ios")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'CreateFontDescriptors' or 'RegisterFontsForUrl' instead.")]
|
||||
[ObsoletedOSPlatform ("tvos18.0", "Use 'CreateFontDescriptors' or 'RegisterFontsForUrl' instead.")]
|
||||
[ObsoletedOSPlatform ("ios18.0", "Use 'CreateFontDescriptors' or 'RegisterFontsForUrl' instead.")]
|
||||
[ObsoletedOSPlatform ("maccatalyst18.0", "Use 'CreateFontDescriptors' or 'RegisterFontsForUrl' instead.")]
|
||||
#else
|
||||
[Deprecated (PlatformName.iOS, 18, 0, message: "Use 'CreateFontDescriptors' or 'RegisterFontsForUrl' instead.")]
|
||||
[Deprecated (PlatformName.MacCatalyst, 18, 0, message: "Use 'CreateFontDescriptors' or 'RegisterFontsForUrl' instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 18, 0, message: "Use 'CreateFontDescriptors' or 'RegisterFontsForUrl' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'CreateFontDescriptors' or 'RegisterFontsForUrl' instead.")]
|
||||
[Deprecated (PlatformName.WatchOS, 11, 0, message: "Use 'CreateFontDescriptors' or 'RegisterFontsForUrl' instead.")]
|
||||
#endif
|
||||
public static bool RegisterGraphicsFont (CGFont font, [NotNullWhen (true)] out NSError? error)
|
||||
{
|
||||
if (font is null)
|
||||
|
@ -466,9 +498,41 @@ namespace CoreText {
|
|||
return ret;
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
[SupportedOSPlatform ("ios")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[ObsoletedOSPlatform ("macos15.0")]
|
||||
[ObsoletedOSPlatform ("tvos18.0")]
|
||||
[ObsoletedOSPlatform ("ios18.0")]
|
||||
[ObsoletedOSPlatform ("maccatalyst18.0")]
|
||||
#else
|
||||
[Deprecated (PlatformName.iOS, 18, 0)]
|
||||
[Deprecated (PlatformName.MacCatalyst, 18, 0)]
|
||||
[Deprecated (PlatformName.TvOS, 18, 0)]
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0)]
|
||||
[Deprecated (PlatformName.WatchOS, 11, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.CoreTextLibrary)]
|
||||
unsafe static extern byte CTFontManagerUnregisterGraphicsFont (IntPtr cgfont, IntPtr* error);
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
[SupportedOSPlatform ("ios")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[ObsoletedOSPlatform ("macos15.0")]
|
||||
[ObsoletedOSPlatform ("tvos18.0")]
|
||||
[ObsoletedOSPlatform ("ios18.0")]
|
||||
[ObsoletedOSPlatform ("maccatalyst18.0")]
|
||||
#else
|
||||
[Deprecated (PlatformName.iOS, 18, 0)]
|
||||
[Deprecated (PlatformName.MacCatalyst, 18, 0)]
|
||||
[Deprecated (PlatformName.TvOS, 18, 0)]
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0)]
|
||||
[Deprecated (PlatformName.WatchOS, 11, 0)]
|
||||
#endif
|
||||
public static bool UnregisterGraphicsFont (CGFont font, out NSError? error)
|
||||
{
|
||||
if (font is null)
|
||||
|
|
|
@ -424,5 +424,22 @@ namespace CoreText {
|
|||
CFMutableDictionary.SetValue (Dictionary.Handle, CTStringAttributeKey.WritingDirection.GetHandle (), array);
|
||||
GC.KeepAlive (numbers); // make sure the numbers aren't freed until we're done with them
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
// The attribute value must be an object conforming to the CTAdaptiveImageProviding protocol.
|
||||
public ICTAdaptiveImageProviding? AdaptiveImageProvider {
|
||||
get {
|
||||
var h = CFDictionary.GetValue (Dictionary.Handle, CTStringAttributeKey.AdaptiveImageProvider.GetHandle ());
|
||||
return Runtime.GetINativeObject<ICTAdaptiveImageProviding> (h, owns: false);
|
||||
}
|
||||
set {
|
||||
Adapter.SetNativeValue (Dictionary, CTStringAttributeKey.AdaptiveImageProvider!, value);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,11 +62,13 @@ namespace CoreVideo {
|
|||
}
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[UnsupportedOSPlatform ("ios")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
[UnsupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[NoiOS]
|
||||
[NoTV]
|
||||
[NoMacCatalyst]
|
||||
|
@ -76,10 +78,12 @@ namespace CoreVideo {
|
|||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[UnsupportedOSPlatform ("ios")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
[UnsupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[NoiOS]
|
||||
[NoTV]
|
||||
[NoMacCatalyst]
|
||||
|
@ -111,10 +115,12 @@ namespace CoreVideo {
|
|||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[UnsupportedOSPlatform ("ios")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
[UnsupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[NoiOS]
|
||||
[NoTV]
|
||||
[NoMacCatalyst]
|
||||
|
@ -124,10 +130,12 @@ namespace CoreVideo {
|
|||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[UnsupportedOSPlatform ("ios")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
[UnsupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[NoiOS]
|
||||
[NoTV]
|
||||
[NoMacCatalyst]
|
||||
|
@ -165,10 +173,12 @@ namespace CoreVideo {
|
|||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[UnsupportedOSPlatform ("ios")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
[UnsupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[NoiOS]
|
||||
[NoTV]
|
||||
[NoMacCatalyst]
|
||||
|
@ -178,10 +188,12 @@ namespace CoreVideo {
|
|||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[UnsupportedOSPlatform ("ios")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
[UnsupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[NoiOS]
|
||||
[NoTV]
|
||||
[NoMacCatalyst]
|
||||
|
@ -210,17 +222,41 @@ namespace CoreVideo {
|
|||
public static CVDisplayLink? CreateFromOpenGLMask (uint mask)
|
||||
=> CreateFromOpenGLMask (mask, out var _);
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
extern static void CVDisplayLinkRetain (IntPtr handle);
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
extern static void CVDisplayLinkRelease (IntPtr handle);
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
protected internal override void Retain ()
|
||||
{
|
||||
CVDisplayLinkRetain (GetCheckedHandle ());
|
||||
}
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
protected internal override void Release ()
|
||||
{
|
||||
CVDisplayLinkRelease (GetCheckedHandle ());
|
||||
|
@ -236,7 +272,20 @@ namespace CoreVideo {
|
|||
}
|
||||
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
unsafe extern static CVReturn CVDisplayLinkCreateWithActiveCGDisplays (IntPtr* displayLinkOut);
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
static IntPtr Create ()
|
||||
{
|
||||
CVReturn ret;
|
||||
|
@ -251,80 +300,217 @@ namespace CoreVideo {
|
|||
return handle;
|
||||
|
||||
}
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
public CVDisplayLink ()
|
||||
: base (Create (), true)
|
||||
{
|
||||
}
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
extern static CVReturn CVDisplayLinkSetCurrentCGDisplay (IntPtr displayLink, int /* CGDirectDisplayID = uint32_t */ displayId);
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
public CVReturn SetCurrentDisplay (int displayId)
|
||||
{
|
||||
return CVDisplayLinkSetCurrentCGDisplay (Handle, displayId);
|
||||
}
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
extern static CVReturn CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext (IntPtr displayLink, IntPtr cglContext, IntPtr cglPixelFormat);
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
public CVReturn SetCurrentDisplay (CGLContext cglContext, CGLPixelFormat cglPixelFormat)
|
||||
{
|
||||
return CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext (Handle, cglContext.Handle, cglPixelFormat.Handle);
|
||||
}
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
extern static int /* CGDirectDisplayID = uint32_t */ CVDisplayLinkGetCurrentCGDisplay (IntPtr displayLink);
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
public int GetCurrentDisplay ()
|
||||
{
|
||||
return CVDisplayLinkGetCurrentCGDisplay (Handle);
|
||||
}
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
extern static CVReturn CVDisplayLinkStart (IntPtr displayLink);
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
public CVReturn Start ()
|
||||
{
|
||||
return CVDisplayLinkStart (Handle);
|
||||
}
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
extern static CVReturn CVDisplayLinkStop (IntPtr displayLink);
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
public CVReturn Stop ()
|
||||
{
|
||||
return CVDisplayLinkStop (Handle);
|
||||
}
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
extern static CVTime CVDisplayLinkGetNominalOutputVideoRefreshPeriod (IntPtr displayLink);
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
public CVTime NominalOutputVideoRefreshPeriod {
|
||||
get {
|
||||
return CVDisplayLinkGetNominalOutputVideoRefreshPeriod (Handle);
|
||||
}
|
||||
}
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
extern static CVTime CVDisplayLinkGetOutputVideoLatency (IntPtr displayLink);
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
public CVTime OutputVideoLatency {
|
||||
get {
|
||||
return CVDisplayLinkGetOutputVideoLatency (Handle);
|
||||
}
|
||||
}
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
extern static double CVDisplayLinkGetActualOutputVideoRefreshPeriod (IntPtr displayLink);
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
public double ActualOutputVideoRefreshPeriod {
|
||||
get {
|
||||
return CVDisplayLinkGetActualOutputVideoRefreshPeriod (Handle);
|
||||
}
|
||||
}
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
extern static byte CVDisplayLinkIsRunning (IntPtr displayLink);
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
public bool IsRunning {
|
||||
get {
|
||||
return CVDisplayLinkIsRunning (Handle) != 0;
|
||||
}
|
||||
}
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
unsafe extern static CVReturn CVDisplayLinkGetCurrentTime (IntPtr displayLink, CVTimeStamp* outTime);
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
public CVReturn GetCurrentTime (out CVTimeStamp outTime)
|
||||
{
|
||||
CVReturn ret;
|
||||
|
@ -364,12 +550,22 @@ namespace CoreVideo {
|
|||
}
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
extern static unsafe CVReturn CVDisplayLinkSetOutputCallback (IntPtr displayLink, delegate* unmanaged<IntPtr, CVTimeStamp*, CVTimeStamp*, CVOptionFlags, CVOptionFlags *, IntPtr, CVReturn> function, IntPtr userInfo);
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
extern static CVReturn CVDisplayLinkSetOutputCallback (IntPtr displayLink, CVDisplayLinkOutputCallback function, IntPtr userInfo);
|
||||
#endif
|
||||
|
||||
#if NET
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
#endif
|
||||
public CVReturn SetOutputCallback (DisplayLinkOutputCallback callback)
|
||||
{
|
||||
callbackHandle = GCHandle.Alloc (callback);
|
||||
|
@ -387,10 +583,12 @@ namespace CoreVideo {
|
|||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[UnsupportedOSPlatform ("ios")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
[UnsupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[NoiOS]
|
||||
[NoTV]
|
||||
[NoMacCatalyst]
|
||||
|
@ -400,10 +598,12 @@ namespace CoreVideo {
|
|||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[UnsupportedOSPlatform ("ios")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
[UnsupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[NoiOS]
|
||||
[NoTV]
|
||||
[NoMacCatalyst]
|
||||
|
@ -413,10 +613,12 @@ namespace CoreVideo {
|
|||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[UnsupportedOSPlatform ("ios")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
[UnsupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[NoiOS]
|
||||
[NoTV]
|
||||
[NoMacCatalyst]
|
||||
|
@ -426,10 +628,12 @@ namespace CoreVideo {
|
|||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[ObsoletedOSPlatform ("macos15.0", "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[UnsupportedOSPlatform ("ios")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
[UnsupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'NSView.GetDisplayLink', 'NSWindow.GetDisplayLink' or 'NSScreen.GetDisplayLink' instead.")]
|
||||
[NoiOS]
|
||||
[NoTV]
|
||||
[NoMacCatalyst]
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
#if !WATCH
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using CoreFoundation;
|
||||
using CoreGraphics;
|
||||
using Foundation;
|
||||
using Metal;
|
||||
using ObjCRuntime;
|
||||
|
||||
#if !NET
|
||||
using NativeHandle = System.IntPtr;
|
||||
#endif
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace CoreVideo {
|
||||
|
||||
/// <summary>A CVPixelBuffer wrapped in a Metal based buffer.</summary>
|
||||
/// <remarks>This type is used to provide buffers to Metal.</remarks>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public class CVMetalBuffer : CVBuffer {
|
||||
#if !COREBUILD
|
||||
[Preserve (Conditional = true)]
|
||||
internal CVMetalBuffer (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
}
|
||||
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
extern static /* CFTypeID */ nint CVMetalBufferCacheGetTypeID ();
|
||||
|
||||
public static nint GetTypeId ()
|
||||
{
|
||||
return CVMetalBufferCacheGetTypeID ();
|
||||
}
|
||||
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
extern static /* id<MTLBuffer> CV_NULLABLE */ IntPtr CVMetalBufferGetBuffer (IntPtr /* CVMetalBufferRef CV_NONNULL */ buffer);
|
||||
|
||||
/// <summary>Retrieve the Metal MTLBuffer for the CVMetalBuffer.</summary>
|
||||
public IMTLBuffer? GetMetalBuffer ()
|
||||
{
|
||||
return Runtime.GetINativeObject<IMTLBuffer> (CVMetalBufferGetBuffer (GetCheckedHandle ()), owns: false);
|
||||
}
|
||||
|
||||
#endif // !COREBUILD
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !WATCH
|
|
@ -0,0 +1,125 @@
|
|||
#if !WATCH
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using CoreFoundation;
|
||||
using CoreGraphics;
|
||||
using Foundation;
|
||||
using Metal;
|
||||
using ObjCRuntime;
|
||||
|
||||
#if !NET
|
||||
using NativeHandle = System.IntPtr;
|
||||
#endif
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace CoreVideo {
|
||||
|
||||
/// <summary>A cache used to manage <see cref="CVMetalBuffer" /> instances.</summary>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public class CVMetalBufferCache : NativeObject {
|
||||
#if !COREBUILD
|
||||
[Preserve (Conditional = true)]
|
||||
internal CVMetalBufferCache (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
}
|
||||
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
extern static /* CFTypeID */ nint CVMetalBufferGetTypeID ();
|
||||
|
||||
public static nint GetTypeId ()
|
||||
{
|
||||
return CVMetalBufferGetTypeID ();
|
||||
}
|
||||
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
unsafe extern static /* CVReturn */ CVReturn CVMetalBufferCacheCreate (
|
||||
IntPtr /* CFAllocatorRef CV_NULLABLE */ allocator,
|
||||
IntPtr /* CFDictionaryRef CV_NULLABLE */ cacheAttributes,
|
||||
IntPtr /* id<MTLDevice> CV_NONNULL */ metalDevice,
|
||||
IntPtr* /* CV_RETURNS_RETAINED_PARAMETER CVMetalBufferCacheRef CV_NULLABLE * CV_NONNULL */ cacheOut
|
||||
);
|
||||
|
||||
static IntPtr Create (IMTLDevice device, NSDictionary? attributes)
|
||||
{
|
||||
IntPtr handle;
|
||||
CVReturn res;
|
||||
unsafe {
|
||||
res = CVMetalBufferCacheCreate (IntPtr.Zero, attributes.GetHandle (), device.GetNonNullHandle (nameof (device)), &handle);
|
||||
}
|
||||
if (res != CVReturn.Success)
|
||||
throw new Exception ($"Could not create CVMetalBufferCache, CVMetalBufferCacheCreate returned: {res}");
|
||||
return handle;
|
||||
}
|
||||
|
||||
/// <summary>Create a new <see cref="CVMetalBufferCache" /> instance.</summary>
|
||||
/// <param name="device">The Metal device to create the <see cref="CVMetalBufferCache" /> instance for.</param>
|
||||
/// <param name="attributes">An optional dictionary of attributes to apply to the cache.</param>
|
||||
public CVMetalBufferCache (IMTLDevice device, NSDictionary? attributes)
|
||||
: base (Create (device, attributes), owns: true)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Create a new <see cref="CVMetalBufferCache" /> instance.</summary>
|
||||
/// <param name="device">The Metal device to create the <see cref="CVMetalBufferCache" /> instance for.</param>
|
||||
/// <param name="attributes">Optional attributes to apply to the cache.</param>
|
||||
public CVMetalBufferCache (IMTLDevice device, CVMetalBufferCacheAttributes? attributes)
|
||||
: this (device, attributes?.Dictionary)
|
||||
{
|
||||
}
|
||||
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
unsafe extern static /* CVReturn */ CVReturn CVMetalBufferCacheCreateBufferFromImage (
|
||||
IntPtr /* CFAllocatorRef CV_NULLABLE */ allocator,
|
||||
IntPtr /* CVMetalBufferCacheRef CV_NONNULL */ bufferCache,
|
||||
IntPtr /* CVImageBufferRef CV_NONNULL */ imageBuffer,
|
||||
IntPtr* /* CV_RETURNS_RETAINED_PARAMETER CVMetalBufferRef CV_NULLABLE * CV_NONNULL */ bufferOut
|
||||
);
|
||||
|
||||
/// <summary>Create a <see cref="CVMetalBuffer" /> for an existing <see cref="CVImageBuffer" />.</summary>
|
||||
/// <param name="imageBuffer">The image buffer to create the <see cref="CVMetalBuffer" /> from.</param>
|
||||
public CVMetalBuffer? CreateBufferFromImage (CVImageBuffer imageBuffer)
|
||||
{
|
||||
IntPtr handle;
|
||||
CVReturn res;
|
||||
unsafe {
|
||||
res = CVMetalBufferCacheCreateBufferFromImage (IntPtr.Zero, GetCheckedHandle (), imageBuffer.GetNonNullHandle (nameof (imageBuffer)), &handle);
|
||||
}
|
||||
if (res != CVReturn.Success)
|
||||
throw new Exception ($"Could not create CVMetalBuffer, CVMetalBufferCacheCreateBufferFromImage returned: {res}");
|
||||
return Runtime.GetINativeObject<CVMetalBuffer> (handle, true);
|
||||
}
|
||||
|
||||
[DllImport (Constants.CoreVideoLibrary)]
|
||||
unsafe extern static /* CVReturn */ CVReturn CVMetalBufferCacheFlush (
|
||||
IntPtr /* CVMetalBufferCacheRef CV_NONNULL */ bufferCache,
|
||||
CVOptionFlags options
|
||||
);
|
||||
|
||||
/// <summary>Perform internal housekeeping/recycling operations.</summary>
|
||||
/// <remarks>This method must be called periodically.</remarks>
|
||||
public void Flush ()
|
||||
{
|
||||
Flush (CVOptionFlags.None);
|
||||
}
|
||||
|
||||
/// <summary>Perform internal housekeeping/recycling operations.</summary>
|
||||
/// <param name="options">Any flags for the flush operation. Currently unused, always pass <see cref="CVOptionFlags.None" />.</param>
|
||||
/// <remarks>This method must be called periodically.</remarks>
|
||||
public void Flush (CVOptionFlags options)
|
||||
{
|
||||
CVMetalBufferCacheFlush (GetCheckedHandle (), options);
|
||||
}
|
||||
#endif // !COREBUILD
|
||||
}
|
||||
}
|
||||
#endif // !WATCH
|
|
@ -366,6 +366,7 @@ namespace CoreVideo {
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // !COREBUILD
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,6 +63,8 @@ namespace CoreVideo {
|
|||
CV48RGB = 0x62343872,
|
||||
CV32AlphaGray = 0x62333261,
|
||||
CV16Gray = 0x62313667,
|
||||
/// <summary>30-bit RGB, 10-bit big endian samples, 2 unused padding bits (at most significant end).</summary>
|
||||
CV30RGB_r210 = 0x72323130, // 'r210'
|
||||
CV422YpCbCr8 = 0x32767579,
|
||||
CV4444YpCbCrA8 = 0x76343038,
|
||||
CV4444YpCbCrA8R = 0x72343038,
|
||||
|
@ -122,6 +124,57 @@ namespace CoreVideo {
|
|||
CV64Rgba_DownscaledProResRaw = 0x62703634, // 'bp64'
|
||||
// iOS 14.2
|
||||
CV64RgbaLE = 0x6C363472,
|
||||
|
||||
/* Lossless pixel formats */
|
||||
|
||||
/// <summary>Lossless-compressed form of <see cref="CV32BGRA" />.</summary>
|
||||
Lossless_32BGRA = ('&' << 24) + ('B' << 16) + ('G' << 8) + 'A', // '&BGA'
|
||||
|
||||
/// <summary>Lossless-compressed form of <see cref="CV64RGBAHalf" />.</summary>
|
||||
/// <remarks>No CVPlanarPixelBufferInfo struct.</remarks>
|
||||
Lossless_64RGBAHalf = ('&' << 24) + ('R' << 16) + ('h' << 8) + 'A', // '&RhA'
|
||||
|
||||
/// <summary>Lossless-compressed form of <see cref="CV420YpCbCr8BiPlanarVideoRange" />.</summary>
|
||||
/// <remarks>No CVPlanarPixelBufferInfo struct.</remarks>
|
||||
Lossless_420YpCbCr8BiPlanarVideoRange = ('&' << 24) + ('8' << 16) + ('v' << 8) + '0', // '&8v0'
|
||||
|
||||
/// <summary>Lossless-compressed form of <see cref="CV420YpCbCr8BiPlanarFullRange" />.</summary>
|
||||
/// <remarks>No CVPlanarPixelBufferInfo struct.</remarks>
|
||||
Lossless_420YpCbCr8BiPlanarFullRange = ('&' << 24) + ('8' << 16) + ('f' << 8) + '0', // '&8f0'
|
||||
|
||||
/// <summary>Lossless-compressed form of <see cref="CV420YpCbCr10BiPlanarVideoRange" />.</summary>
|
||||
/// <remarks>No CVPlanarPixelBufferInfo struct. Compressed-packed with bo padding bits between pixels.</remarks>
|
||||
Lossless_420YpCbCr10PackedBiPlanarVideoRange = ('&' << 24) + ('x' << 16) + ('v' << 8) + '0', // '&xv0'
|
||||
|
||||
/// <summary>Lossless-compressed form of <see cref="CV422YpCbCr10BiPlanarVideoRange" />.</summary>
|
||||
/// <remarks>No CVPlanarPixelBufferInfo struct. Compressed-packed with bo padding bits between pixels.</remarks>
|
||||
Lossless_422YpCbCr10PackedBiPlanarVideoRange = ('&' << 24) + ('x' << 16) + ('v' << 8) + '2', // '&xv2'
|
||||
|
||||
/// <summary>Lossless-compressed form of <see cref="CV420YpCbCr10BiPlanarFullRange" />.</summary>
|
||||
/// <remarks>No CVPlanarPixelBufferInfo struct. Compressed-packed with bo padding bits between pixels.</remarks>
|
||||
Lossless_420YpCbCr10PackedBiPlanarFullRange = ('&' << 24) + ('x' << 16) + ('f' << 8) + '0', // '&xf0'
|
||||
|
||||
/* Lossy pixel formats */
|
||||
|
||||
/// <summary>Lossy-compressed form of <see cref="CV32BGRA" />.</summary>
|
||||
/// <remarks>No CVPlanarPixelBufferInfo struct.</remarks>
|
||||
Lossy_32BGRA = ('-' << 24) + ('B' << 16) + ('G' << 8) + 'A', // '-BGA'
|
||||
|
||||
/// <summary>Lossy-compressed form of <see cref="CV420YpCbCr8BiPlanarVideoRange" />.</summary>
|
||||
/// <remarks>No CVPlanarPixelBufferInfo struct.</remarks>
|
||||
Lossy_420YpCbCr8BiPlanarVideoRange = ('-' << 24) + ('8' << 16) + ('v' << 8) + '0', // '-8v0'
|
||||
|
||||
/// <summary>Lossy-compressed form of <see cref="CV420YpCbCr8BiPlanarFullRange" />.</summary>
|
||||
/// <remarks>No CVPlanarPixelBufferInfo struct.</remarks>
|
||||
Lossy_420YpCbCr8BiPlanarFullRange = ('-' << 24) + ('8' << 16) + ('f' << 8) + '0', // '-8f0'
|
||||
|
||||
/// <summary>Lossy-compressed form of <see cref="CV420YpCbCr10BiPlanarVideoRange" />.</summary>
|
||||
/// <remarks>No CVPlanarPixelBufferInfo struct. Compressed-packed with bo padding bits between pixels.</remarks>
|
||||
Lossy_420YpCbCr10PackedBiPlanarVideoRange = ('-' << 24) + ('x' << 16) + ('v' << 8) + '0', // '-xv0'
|
||||
|
||||
/// <summary>Lossy-compressed form of <see cref="CV422YpCbCr10BiPlanarVideoRange" />.</summary>
|
||||
/// <remarks>No CVPlanarPixelBufferInfo struct. Compressed-packed with bo padding bits between pixels.</remarks>
|
||||
Lossy_422YpCbCr10PackedBiPlanarVideoRange = ('-' << 24) + ('x' << 16) + ('v' << 8) + '2', // '-xv2'
|
||||
}
|
||||
|
||||
#if !COREBUILD
|
||||
|
|
|
@ -15,14 +15,14 @@ using Foundation;
|
|||
|
||||
namespace DeviceDiscoveryExtension {
|
||||
|
||||
[NoMac, iOS (16, 0), NoMacCatalyst, NoWatch, NoTV]
|
||||
[Mac (15, 0), iOS (16, 0), MacCatalyst (18, 0), NoWatch, NoTV]
|
||||
[Native]
|
||||
public enum DDDeviceProtocol : long {
|
||||
Invalid = 0,
|
||||
Dial = 1,
|
||||
}
|
||||
|
||||
[NoMac, iOS (16, 0), NoMacCatalyst, NoWatch, NoTV]
|
||||
[Mac (15, 0), iOS (16, 0), MacCatalyst (18, 0), NoWatch, NoTV]
|
||||
[Native]
|
||||
public enum DDDeviceCategory : long {
|
||||
HiFiSpeaker = 0,
|
||||
|
@ -31,9 +31,11 @@ namespace DeviceDiscoveryExtension {
|
|||
Tv = 3,
|
||||
LaptopComputer = 4,
|
||||
DesktopComputer = 5,
|
||||
[iOS (18, 0)]
|
||||
AccessorySetup = 6,
|
||||
}
|
||||
|
||||
[NoMac, iOS (16, 0), NoMacCatalyst, NoWatch, NoTV]
|
||||
[Mac (15, 0), iOS (16, 0), MacCatalyst (18, 0), NoWatch, NoTV]
|
||||
[Native]
|
||||
public enum DDDeviceState : long {
|
||||
Invalid = 0,
|
||||
|
@ -43,7 +45,7 @@ namespace DeviceDiscoveryExtension {
|
|||
Invalidating = 30,
|
||||
}
|
||||
|
||||
[NoMac, iOS (16, 0), NoMacCatalyst, NoWatch, NoTV]
|
||||
[Mac (15, 0), iOS (16, 0), MacCatalyst (18, 0), NoWatch, NoTV]
|
||||
[Native]
|
||||
public enum DDDeviceMediaPlaybackState : long {
|
||||
NoContent = 0,
|
||||
|
@ -51,7 +53,7 @@ namespace DeviceDiscoveryExtension {
|
|||
Playing = 2,
|
||||
}
|
||||
|
||||
[NoMac, iOS (16, 0), NoMacCatalyst, NoWatch, NoTV]
|
||||
[Mac (15, 0), iOS (16, 0), MacCatalyst (18, 0), NoWatch, NoTV]
|
||||
[ErrorDomain ("DDErrorDomain")]
|
||||
[Native]
|
||||
public enum DDErrorCode : long {
|
||||
|
@ -66,7 +68,7 @@ namespace DeviceDiscoveryExtension {
|
|||
// Next, // don't bind 'Next', it's not static and we'd have to break compat if it were ever to change
|
||||
}
|
||||
|
||||
[NoMac, iOS (16, 0), NoMacCatalyst, NoWatch, NoTV]
|
||||
[Mac (15, 0), iOS (16, 0), MacCatalyst (18, 0), NoWatch, NoTV]
|
||||
[Native]
|
||||
public enum DDEventType : long {
|
||||
Unknown = 0,
|
||||
|
@ -74,4 +76,12 @@ namespace DeviceDiscoveryExtension {
|
|||
DeviceLost = 41,
|
||||
DeviceChanged = 42,
|
||||
}
|
||||
|
||||
[Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0), NoWatch, NoTV]
|
||||
[Native]
|
||||
[Flags]
|
||||
public enum DDDeviceSupports : ulong {
|
||||
BluetoothPairingLE = 1 << 1,
|
||||
BluetoothTransportBridging = 1 << 2,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
#if NET
|
||||
using Foundation;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace FSKit {
|
||||
public partial class FSBlockDeviceResource {
|
||||
public unsafe void Read (byte [] buffer, long offset, nuint length, FSBlockDeviceResourceReadReplyHandler reply)
|
||||
{
|
||||
fixed (byte* bufferPtr = buffer) {
|
||||
Read ((IntPtr) bufferPtr, offset, length, reply);
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe void SynchronousRead (byte [] buffer, long offset, nuint length, FSBlockDeviceResourceReadReplyHandler reply)
|
||||
{
|
||||
fixed (byte* bufferPtr = buffer) {
|
||||
SynchronousRead ((IntPtr) bufferPtr, offset, length, reply);
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe void Write (byte [] buffer, long offset, nuint length, FSBlockDeviceResourceWriteReplyHandler reply)
|
||||
{
|
||||
fixed (byte* bufferPtr = buffer) {
|
||||
Write ((IntPtr) bufferPtr, offset, length, reply);
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe void SynchronousWrite (byte [] buffer, long offset, nuint length, FSBlockDeviceResourceWriteReplyHandler reply)
|
||||
{
|
||||
fixed (byte* bufferPtr = buffer) {
|
||||
SynchronousWrite ((IntPtr) bufferPtr, offset, length, reply);
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe void SynchronousMetadataRead (byte [] buffer, long offset, nuint length, FSBlockDeviceResourceMetadataReplyHandler reply)
|
||||
{
|
||||
fixed (byte* bufferPtr = buffer) {
|
||||
SynchronousMetadataRead ((IntPtr) bufferPtr, offset, length, reply);
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe void SynchronousMetadataRead (byte [] buffer, long offset, nuint length, FSMetadataReadahead[] readAheadExtents, FSBlockDeviceResourceMetadataReplyHandler reply)
|
||||
{
|
||||
fixed (byte* bufferPtr = buffer) {
|
||||
fixed (FSMetadataReadahead* readAheadExtentsPtr = readAheadExtents) {
|
||||
SynchronousMetadataRead ((IntPtr) bufferPtr, offset, length, (IntPtr) readAheadExtentsPtr, readAheadExtents.Length, reply);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe void MetadataWrite (byte [] buffer, long offset, nuint length, FSBlockDeviceResourceMetadataReplyHandler reply)
|
||||
{
|
||||
fixed (byte* bufferPtr = buffer) {
|
||||
MetadataWrite ((IntPtr) bufferPtr, offset, length, reply);
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe void SynchronousMetadataWrite (byte [] buffer, long offset, nuint length, FSBlockDeviceResourceMetadataReplyHandler reply)
|
||||
{
|
||||
fixed (byte* bufferPtr = buffer) {
|
||||
SynchronousMetadataWrite ((IntPtr) bufferPtr, offset, length, reply);
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe void DelayedMetadataWriteFrom (byte [] buffer, long offset, nuint length, FSBlockDeviceResourceMetadataReplyHandler reply)
|
||||
{
|
||||
fixed (byte* bufferPtr = buffer) {
|
||||
DelayedMetadataWriteFrom ((IntPtr) bufferPtr, offset, length, reply);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // NET
|
|
@ -0,0 +1,36 @@
|
|||
#if NET
|
||||
using System;
|
||||
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace FSKit {
|
||||
public partial class FSFileName {
|
||||
[DesignatedInitializer]
|
||||
public FSFileName (byte [] bytes)
|
||||
{
|
||||
if (bytes is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (bytes));
|
||||
|
||||
unsafe {
|
||||
fixed (byte* bytesPtr = bytes) {
|
||||
InitializeHandle (InitWithBytes ((IntPtr) bytesPtr, (nuint) bytes.Length));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public FSFileName Create (byte [] bytes)
|
||||
{
|
||||
if (bytes is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (bytes));
|
||||
|
||||
unsafe {
|
||||
fixed (byte* bytesPtr = bytes) {
|
||||
return _Create ((IntPtr) bytesPtr, (nuint) bytes.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // NET
|
|
@ -0,0 +1,59 @@
|
|||
#if NET
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
// Let's hope that by .NET 11 we've ironed out all the bugs in the API.
|
||||
// This can of course be adjusted as needed (until we've released as stable).
|
||||
#if NET110_0_OR_GREATER
|
||||
#define STABLE_FSKIT
|
||||
#endif
|
||||
|
||||
namespace FSKit {
|
||||
#if !STABLE_FSKIT
|
||||
[Experimental ("APL0002")]
|
||||
#endif
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[UnsupportedOSPlatform ("maccatalyst")]
|
||||
[UnsupportedOSPlatform ("ios")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
public static class FSKitFunctions {
|
||||
[DllImport (Constants.FSKitLibrary)]
|
||||
static extern IntPtr fskit_std_log ();
|
||||
|
||||
public static NSObject GetStdLog ()
|
||||
{
|
||||
return Runtime.GetNSObject (fskit_std_log ())!;
|
||||
}
|
||||
|
||||
[DllImport (Constants.FSKitLibrary)]
|
||||
static extern IntPtr fs_errorForPOSIXError (int errorCode);
|
||||
|
||||
public static NSError GetErrorForPosixError (int errorCode)
|
||||
{
|
||||
return Runtime.GetNSObject<NSError> (fs_errorForPOSIXError (errorCode))!;
|
||||
}
|
||||
|
||||
[DllImport (Constants.FSKitLibrary)]
|
||||
static extern IntPtr fs_errorForMachError (int errorCode);
|
||||
|
||||
public static NSError GetErrorForMachError (int errorCode)
|
||||
{
|
||||
return Runtime.GetNSObject<NSError> (fs_errorForMachError (errorCode))!;
|
||||
}
|
||||
|
||||
[DllImport (Constants.FSKitLibrary)]
|
||||
static extern IntPtr fs_errorForCocoaError (int errorCode);
|
||||
|
||||
public static NSError GetErrorForCocoaError (int errorCode)
|
||||
{
|
||||
return Runtime.GetNSObject<NSError> (fs_errorForCocoaError (errorCode))!;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // NET
|
|
@ -0,0 +1,41 @@
|
|||
#if NET
|
||||
|
||||
using System;
|
||||
|
||||
using CoreFoundation;
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace FSKit {
|
||||
public partial class FSMessageConnection {
|
||||
public NSString GetLocalizedMessage (NSString message, NSString tableName, NSBundle bundle, params NSObject[] arguments)
|
||||
{
|
||||
var argumentPtrs = new IntPtr [arguments.Length];
|
||||
for (var i = 0; i < arguments.Length; i++)
|
||||
argumentPtrs [i] = arguments [i].GetNonNullHandle ($"{nameof (arguments)} [{i}]");
|
||||
|
||||
var rv = Messaging.objc_msgSend_5_vargs (
|
||||
this.GetNonNullHandle ("this"),
|
||||
Selector.GetHandle ("localizedMessage:table:bundle:"),
|
||||
message.GetNonNullHandle (nameof (message)),
|
||||
tableName.GetNonNullHandle (nameof (message)),
|
||||
bundle.GetNonNullHandle (nameof (bundle)),
|
||||
argumentPtrs);
|
||||
|
||||
GC.KeepAlive (message);
|
||||
GC.KeepAlive (tableName);
|
||||
GC.KeepAlive (bundle);
|
||||
GC.KeepAlive (arguments);
|
||||
|
||||
return Runtime.GetNSObject<NSString> (rv)!;
|
||||
}
|
||||
|
||||
public string GetLocalizedMessage (string message, string tableName, NSBundle bundle, params NSObject[] arguments)
|
||||
{
|
||||
return (string) GetLocalizedMessage ((NSString) message, (NSString) tableName, bundle, arguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // NET
|
|
@ -0,0 +1,25 @@
|
|||
#if NET
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
#nullable enable
|
||||
|
||||
// Let's hope that by .NET 11 we've ironed out all the bugs in the API.
|
||||
// This can of course be adjusted as needed (until we've released as stable).
|
||||
#if NET110_0_OR_GREATER
|
||||
#define STABLE_FSKIT
|
||||
#endif
|
||||
|
||||
namespace FSKit {
|
||||
#if !STABLE_FSKIT
|
||||
[Experimental ("APL0002")]
|
||||
#endif
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct FSMetadataReadahead
|
||||
{
|
||||
public long Offset;
|
||||
public nuint Length;
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -151,6 +151,17 @@ namespace Foundation {
|
|||
return ((NSNumber) value).Int64Value;
|
||||
}
|
||||
|
||||
protected ulong? GetULongValue (NSString key)
|
||||
{
|
||||
if (key is null)
|
||||
throw new ArgumentNullException (nameof (key));
|
||||
|
||||
if (!Dictionary.TryGetValue (key, out var value))
|
||||
return null;
|
||||
|
||||
return ((NSNumber) value).UInt64Value;
|
||||
}
|
||||
|
||||
protected uint? GetUIntValue (NSString key)
|
||||
{
|
||||
if (key is null)
|
||||
|
|
|
@ -244,6 +244,7 @@ namespace Foundation {
|
|||
YearForWeakOfYear = (1 << 14),
|
||||
|
||||
Nanosecond = (1 << 15),
|
||||
DayOfYear = (1 << 16),
|
||||
|
||||
Calendar = (1 << 20),
|
||||
TimeZone = (1 << 21),
|
||||
|
|
|
@ -108,10 +108,15 @@ namespace Foundation {
|
|||
static IntPtr sw = Dlfcn.dlopen (Constants.SharedWithYouLibrary, 1);
|
||||
static IntPtr swc = Dlfcn.dlopen (Constants.SharedWithYouCoreLibrary, 1);
|
||||
static IntPtr th = Dlfcn.dlopen (Constants.ThreadNetworkLibrary, 1);
|
||||
static IntPtr mx = Dlfcn.dlopen (Constants.MediaExtensionLibrary, 1);
|
||||
static IntPtr ni = Dlfcn.dlopen (Constants.NearbyInteractionLibrary, 1);
|
||||
static IntPtr sm = Dlfcn.dlopen (Constants.ServiceManagementLibrary, 1);
|
||||
static IntPtr sa = Dlfcn.dlopen (Constants.SafetyKitLibrary, 1);
|
||||
static IntPtr cr = Dlfcn.dlopen (Constants.CryptoTokenKitLibrary, 1);
|
||||
static IntPtr dd = Dlfcn.dlopen (Constants.DeviceDiscoveryExtensionLibrary, 1);
|
||||
// FSKit was removed from Xcode 16 RC, but keeping it commented, because it's likely to return in a later release
|
||||
// static IntPtr fk = Dlfcn.dlopen (Constants.FSKitLibrary, 1);
|
||||
static IntPtr be = Dlfcn.dlopen (Constants.BrowserEngineKitLibrary, 1);
|
||||
|
||||
#if !NET
|
||||
[Obsolete ("Use PlatformAssembly for easier code sharing across platforms.")]
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
#if !WATCH
|
||||
using System;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
namespace GameKit {
|
||||
/// <summary>This enum is used to select how to initialize a new instance of a <see cref="GKGameCenterViewController" />.</summary>
|
||||
public enum GKGameCenterViewControllerInitializationOption {
|
||||
/// <summary>The <c>id</c> parameter passed to the constructor is an achievement ID.</summary>
|
||||
Achievement,
|
||||
/// <summary>The <c>id</c> parameter passed to the constructor is a leaderboard set ID.</summary>
|
||||
LeaderboardSet,
|
||||
}
|
||||
|
||||
public partial class GKGameCenterViewController {
|
||||
/// <summary>Create a new GKGameCenterViewController instance that presents an achievement.</summary>
|
||||
/// <param name="achievementId">The ID of the achievement to show.</param>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios14.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos14.0")]
|
||||
#else
|
||||
[TV (14, 0), Mac (11, 0), iOS (14, 0), MacCatalyst (14, 0)]
|
||||
#endif
|
||||
public GKGameCenterViewController (string achievementId)
|
||||
: this (achievementId, GKGameCenterViewControllerInitializationOption.Achievement)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Create a new GKGameCenterViewController instance that presents an achievement or a leaderboard set.</summary>
|
||||
/// <param name="id">The ID of the achievement or the leaderboard set to show.</param>
|
||||
/// <param name="option">Use this option to specify whether the GKGameCenterViewController shows an achievement or a leader board set.</param>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public GKGameCenterViewController (string id, GKGameCenterViewControllerInitializationOption option)
|
||||
: base (NSObjectFlag.Empty)
|
||||
{
|
||||
switch (option) {
|
||||
case GKGameCenterViewControllerInitializationOption.Achievement:
|
||||
InitializeHandle (_InitWithAchievementId (id));
|
||||
break;
|
||||
case GKGameCenterViewControllerInitializationOption.LeaderboardSet:
|
||||
InitializeHandle (_InitWithLeaderboardSetId (id));
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException (nameof (option), option, "Invalid enum value.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !WATCH
|
|
@ -222,6 +222,10 @@ namespace GameKit {
|
|||
}
|
||||
|
||||
// NSInteger -> GKVoiceChat.h
|
||||
[Deprecated (PlatformName.iOS, 18, 0, message: "No longer supported.")]
|
||||
[Deprecated (PlatformName.MacCatalyst, 18, 0, message: "No longer supported.")]
|
||||
[Deprecated (PlatformName.TvOS, 18, 0, message: "No longer supported.")]
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "No longer supported.")]
|
||||
[Native]
|
||||
public enum GKVoiceChatPlayerState : long {
|
||||
Connected,
|
||||
|
|
|
@ -369,6 +369,11 @@ namespace HealthKit {
|
|||
[Mac (13, 0)]
|
||||
[MacCatalyst (13, 1)]
|
||||
[Native]
|
||||
[Deprecated (PlatformName.iOS, 18, 0, message: "Use 'HKCategoryValueVaginalBleeding' instead.")]
|
||||
[Deprecated (PlatformName.MacCatalyst, 18, 0, message: "Use 'HKCategoryValueVaginalBleeding' instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 18, 0, message: "Use 'HKCategoryValueVaginalBleeding' instead.")]
|
||||
[Deprecated (PlatformName.WatchOS, 11, 0, message: "Use 'HKCategoryValueVaginalBleeding' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'HKCategoryValueVaginalBleeding' instead.")]
|
||||
public enum HKCategoryValueMenstrualFlow : long {
|
||||
NotApplicable = 0,
|
||||
Unspecified = 1,
|
||||
|
@ -380,6 +385,16 @@ namespace HealthKit {
|
|||
None,
|
||||
}
|
||||
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Native]
|
||||
public enum HKCategoryValueVaginalBleeding : long {
|
||||
Unspecified = 1,
|
||||
Light = 2,
|
||||
Medium = 3,
|
||||
Heavy = 4,
|
||||
None = 5,
|
||||
}
|
||||
|
||||
/// <summary>Enumerates the results of an ovulation test.</summary>
|
||||
[Mac (13, 0)]
|
||||
[MacCatalyst (13, 1)]
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using ObjCRuntime;
|
||||
using Foundation;
|
||||
using HKQuantityRef = System.IntPtr;
|
||||
using NSErrorRef = System.IntPtr;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace HealthKit {
|
||||
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
public static class HKAppleSleepingBreathingDisturbances {
|
||||
|
||||
[DllImport (Constants.HealthKitLibrary)]
|
||||
unsafe static extern /* NSNumber * _Nullable */ IntPtr HKAppleSleepingBreathingDisturbancesClassificationForQuantity (HKQuantityRef value);
|
||||
|
||||
/// <summary>Get the breathing disturbances classification for a given quantity of breathing disturbance.</summary>
|
||||
/// <param name="value">The quantity of the breathing disturbance whose classification to get.</param>
|
||||
/// <returns>The breathing disturbances classification for the specified breathing disturbance quantity.</returns>
|
||||
public static HKAppleSleepingBreathingDisturbancesClassification? GetClassification (HKQuantity value)
|
||||
{
|
||||
var ptr = HKAppleSleepingBreathingDisturbancesClassificationForQuantity (value.GetHandle ());
|
||||
var number = Runtime.GetNSObject<NSNumber> (ptr);
|
||||
if (number is null)
|
||||
return null;
|
||||
return (HKAppleSleepingBreathingDisturbancesClassification) number.LongValue;
|
||||
}
|
||||
|
||||
[DllImport (Constants.HealthKitLibrary)]
|
||||
static extern HKQuantityRef HKAppleSleepingBreathingDisturbancesMinimumQuantityForClassification (nint /* HKAppleSleepingBreathingDisturbancesClassification */ classification);
|
||||
|
||||
/// <summary>Get the minimum quantity for a breathing disturbances classification.</summary>
|
||||
/// <param name="classification">The classification to get the minimum quantity for.</param>
|
||||
/// <returns>The minimum quantity for the specified breathing disturbances classification.</returns>
|
||||
public static HKQuantity? GetMinimumQuantity (HKAppleSleepingBreathingDisturbancesClassification classification)
|
||||
{
|
||||
return Runtime.GetNSObject<HKQuantity> (HKAppleSleepingBreathingDisturbancesMinimumQuantityForClassification ((nint) (long) classification));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
namespace HealthKit {
|
||||
/// <summary>This class contains helper functions for the <see cref="HKStateOfMindValenceClassification" /> enum.</summary>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[Watch (11, 0), NoTV, Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public static class HKStateOfMindValence {
|
||||
[DllImport (Constants.HealthKitLibrary)]
|
||||
static extern IntPtr HKStateOfMindValenceClassificationForValence (double valence);
|
||||
|
||||
/// <summary>Gets the valence classification appropriate for a given valence value.</summary>
|
||||
/// <param name="valence">The valence value whose classification to get.</param>
|
||||
/// <returns>The valence classification, or null if the specified valence is outside of the supported range of valence values.</returns>
|
||||
public static HKStateOfMindValenceClassification? GetClassification (double valence)
|
||||
{
|
||||
var nsnumber = Runtime.GetNSObject<NSNumber> (HKStateOfMindValenceClassificationForValence (valence), owns: false);
|
||||
if (nsnumber is null)
|
||||
return null;
|
||||
return (HKStateOfMindValenceClassification) (long) nsnumber.LongValue;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -117,6 +117,7 @@ namespace HomeKit {
|
|||
FailedToJoinNetwork = 102,
|
||||
// iOS 15
|
||||
AccessoryIsSuspended = 103,
|
||||
// iOS 17.4
|
||||
PartialCommunicationFailure = 104,
|
||||
}
|
||||
|
||||
|
@ -626,6 +627,78 @@ namespace HomeKit {
|
|||
[MacCatalyst (14, 0)]
|
||||
[Field ("HMCharacteristicTypeIsConfigured")]
|
||||
IsConfigured,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMCharacteristicTypeInputSourceType")]
|
||||
InputSourceType,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMCharacteristicTypeInputDeviceType")]
|
||||
InputDeviceType,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMCharacteristicTypeClosedCaptions")]
|
||||
ClosedCaptions,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMCharacteristicTypePowerModeSelection")]
|
||||
PowerModeSelection,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMCharacteristicTypeCurrentMediaState")]
|
||||
CurrentMediaState,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMCharacteristicTypeRemoteKey")]
|
||||
RemoteKey,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMCharacteristicTypePictureMode")]
|
||||
PictureMode,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMCharacteristicTypeConfiguredName")]
|
||||
ConfiguredName,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMCharacteristicTypeIdentifier")]
|
||||
Identifier,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMCharacteristicTypeActiveIdentifier")]
|
||||
ActiveIdentifier,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMCharacteristicTypeTargetVisibilityState")]
|
||||
TargetVisibilityState,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMCharacteristicTypeCurrentVisibilityState")]
|
||||
CurrentVisibilityState,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMCharacteristicTypeRouterStatus")]
|
||||
RouterStatus,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMCharacteristicTypeWANStatusList")]
|
||||
WanStatusList,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMCharacteristicTypeWiFiSatelliteStatus")]
|
||||
WiFiSatelliteStatus,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMCharacteristicTypeVolumeControlType")]
|
||||
VolumeControlType,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMCharacteristicTypeVolumeSelector")]
|
||||
VolumeSelector,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMCharacteristicTypeTargetMediaState")]
|
||||
TargetMediaState,
|
||||
}
|
||||
|
||||
// conveniance enum (ObjC uses NSString)
|
||||
|
@ -821,6 +894,22 @@ namespace HomeKit {
|
|||
[MacCatalyst (14, 0)]
|
||||
[Field ("HMServiceTypeFaucet")]
|
||||
Faucet,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMServiceTypeTelevision")]
|
||||
Television,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMServiceTypeInputSource")]
|
||||
InputSource,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMServiceTypeWiFiRouter")]
|
||||
WiFiRouter,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMServiceTypeWiFiSatellite")]
|
||||
WiFiSatellite,
|
||||
}
|
||||
|
||||
// conveniance enum (ObjC uses NSString)
|
||||
|
@ -1165,6 +1254,34 @@ namespace HomeKit {
|
|||
[MacCatalyst (14, 0)]
|
||||
[Field ("HMAccessoryCategoryTypeShowerHead")]
|
||||
ShowerHead,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMAccessoryCategoryTypeTelevision")]
|
||||
Television,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMAccessoryCategoryTypeTelevisionSetTopBox")]
|
||||
TelevisionSetTopBox,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMAccessoryCategoryTypeTelevisionStreamingStick")]
|
||||
TelevisionStreamingStick,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMAccessoryCategoryTypeWiFiRouter")]
|
||||
WiFiRouter,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMAccessoryCategoryTypeSpeaker")]
|
||||
Speaker,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMAccessoryCategoryTypeAudioReceiver")]
|
||||
AudioReceiver,
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("HMAccessoryCategoryTypeAirPort")]
|
||||
AirPort,
|
||||
}
|
||||
|
||||
/// <summary>Enumerates events such as sunrise and sunset.</summary>
|
||||
|
@ -1470,4 +1587,153 @@ namespace HomeKit {
|
|||
Unsecured = 0,
|
||||
Secured = 1,
|
||||
}
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Native]
|
||||
public enum HMCharacteristicValueInputSourceType : long {
|
||||
Other = 0,
|
||||
HomeScreen = 1,
|
||||
Tuner = 2,
|
||||
Hdmi = 3,
|
||||
CompositeVideo = 4,
|
||||
SVideo = 5,
|
||||
ComponentVideo = 6,
|
||||
Dvi = 7,
|
||||
AirPlay = 8,
|
||||
Usb = 9,
|
||||
Application = 10,
|
||||
}
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Native]
|
||||
public enum HMCharacteristicValueInputDeviceType : long {
|
||||
Other = 0,
|
||||
TV = 1,
|
||||
Recording = 2,
|
||||
Tuner = 3,
|
||||
Playback = 4,
|
||||
AudioSystem = 5,
|
||||
None = 6,
|
||||
}
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Native]
|
||||
public enum HMCharacteristicValueClosedCaptions : long {
|
||||
Disabled = 0,
|
||||
Enabled = 1,
|
||||
}
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Native]
|
||||
public enum HMCharacteristicValuePowerModeSelection : long {
|
||||
Show = 0,
|
||||
Hide = 1,
|
||||
}
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Native]
|
||||
public enum HMCharacteristicValueCurrentMediaState : long {
|
||||
Playing = 0,
|
||||
Paused = 1,
|
||||
Stopped = 2,
|
||||
Unknown = 3,
|
||||
Loading = 4,
|
||||
Interrupted = 5,
|
||||
}
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Native]
|
||||
public enum HMCharacteristicValueRemoteKey : long {
|
||||
Rewind = 0,
|
||||
FastForward = 1,
|
||||
NextTrack = 2,
|
||||
PreviousTrack = 3,
|
||||
ArrowUp = 4,
|
||||
ArrowDown = 5,
|
||||
ArrowLeft = 6,
|
||||
ArrowRight = 7,
|
||||
Select = 8,
|
||||
Back = 9,
|
||||
Exit = 10,
|
||||
PlayPause = 11,
|
||||
Play = 12,
|
||||
Pause = 13,
|
||||
Menu = 14,
|
||||
Info = 15,
|
||||
Home = 16,
|
||||
}
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Native]
|
||||
public enum HMCharacteristicValuePictureMode : long {
|
||||
Standard = 0,
|
||||
Movie = 1,
|
||||
Sport = 2,
|
||||
Game = 3,
|
||||
Photo = 4,
|
||||
Vivid = 5,
|
||||
Dark = 6,
|
||||
Bright = 7,
|
||||
Computer = 8,
|
||||
Night = 9,
|
||||
Calibrated = 10,
|
||||
Custom1 = 11,
|
||||
Custom2 = 12,
|
||||
Custom3 = 13,
|
||||
}
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Native]
|
||||
public enum HMCharacteristicValueTargetVisibilityState : long {
|
||||
Show = 0,
|
||||
Hide = 1,
|
||||
}
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Native]
|
||||
public enum HMCharacteristicValueCurrentVisibilityState : long {
|
||||
Shown = 0,
|
||||
Hidden = 1,
|
||||
Connected = 2,
|
||||
AlwaysShown = 3,
|
||||
}
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Native]
|
||||
public enum HMCharacteristicValueRouterStatus : long {
|
||||
Ready = 0,
|
||||
NotReady = 1,
|
||||
}
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Native]
|
||||
public enum HMCharacteristicValueWiFiSatelliteStatus : long {
|
||||
Unknown = 0,
|
||||
Connected = 1,
|
||||
NotConnected = 2,
|
||||
}
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Native]
|
||||
public enum HMCharacteristicValueVolumeControlType : long {
|
||||
None = 0,
|
||||
Relative,
|
||||
RelativeWithCurrent,
|
||||
Absolute,
|
||||
}
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Native]
|
||||
public enum HMCharacteristicValueVolumeSelector : long {
|
||||
VolumeIncrement = 0,
|
||||
VolumeDecrement,
|
||||
}
|
||||
|
||||
[Watch (11, 0), TV (18, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Native]
|
||||
public enum HMCharacteristicValueTargetMediaState : long {
|
||||
Play = 0,
|
||||
Pause = 1,
|
||||
Stop = 2,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ namespace JavaScriptCore {
|
|||
[iOS (13, 0)]
|
||||
[MacCatalyst (13, 1)]
|
||||
Symbol,
|
||||
[iOS (18, 0), MacCatalyst (18, 0), TV (18, 0), NoMac]
|
||||
BigInt,
|
||||
}
|
||||
|
||||
// typedef unsigned -> JSObjectRef.h
|
||||
|
@ -42,4 +44,12 @@ namespace JavaScriptCore {
|
|||
None = 0,
|
||||
NoAutomaticPrototype = 1 << 1
|
||||
}
|
||||
|
||||
[iOS (18, 0), MacCatalyst (18, 0), TV (18, 0), NoMac]
|
||||
public enum JSRelationCondition : uint {
|
||||
Undefined,
|
||||
Equal,
|
||||
GreaterThan,
|
||||
LessThan,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#if !WATCH && !TV
|
||||
using Foundation;
|
||||
|
||||
namespace LocalAuthentication {
|
||||
public partial class LADomainStateCompanion {
|
||||
/// <summary>Returns all the companions paired with this device, as a bitmask of <see cref="LACompanionType" />.</summary>
|
||||
public LACompanionType AvailableCompanionTypes {
|
||||
get {
|
||||
var setOfCompanions = WeakAvailableCompanionTypes;
|
||||
var rv = default (LACompanionType);
|
||||
foreach (var value in setOfCompanions) {
|
||||
var companion = (LACompanionType) (long) value.LongValue;
|
||||
rv |= companion;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !WATCH && !TV
|
|
@ -13,14 +13,20 @@ namespace LocalAuthentication {
|
|||
[MacCatalyst (13, 1)]
|
||||
DeviceOwnerAuthenticationWithBiometrics = 1,
|
||||
DeviceOwnerAuthentication = 2,
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'DeviceOwnerAuthenticationWithCompanion' instead.")]
|
||||
[NoiOS]
|
||||
[NoWatch]
|
||||
[NoMacCatalyst]
|
||||
DeviceOwnerAuthenticationWithWatch = 3,
|
||||
[NoWatch, NoTV, MacCatalyst (18, 0), Mac (15, 0), iOS (18, 0)]
|
||||
DeviceOwnerAuthenticationWithCompanion = 3,
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'DeviceOwnerAuthenticationWithBiometricsOrCompanion' instead.")]
|
||||
[NoiOS]
|
||||
[NoWatch]
|
||||
[NoMacCatalyst]
|
||||
DeviceOwnerAuthenticationWithBiometricsOrWatch = 4,
|
||||
[NoWatch, NoTV, MacCatalyst (18, 0), Mac (15, 0), iOS (18, 0)]
|
||||
DeviceOwnerAuthenticationWithBiometricsOrCompanion = 4,
|
||||
[Obsolete ("Use DeviceOwnerAuthenticationWithBiometricsOrWatch enum value instead.")]
|
||||
[NoiOS]
|
||||
[NoWatch]
|
||||
|
@ -65,6 +71,7 @@ namespace LocalAuthentication {
|
|||
#endif
|
||||
AppCancel = -9,
|
||||
InvalidContext = -10,
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'CompanionNotAvailable' instead.")]
|
||||
[NoiOS, NoWatch, NoMacCatalyst]
|
||||
WatchNotAvailable = -11,
|
||||
[NoiOS, NoWatch, NoMacCatalyst]
|
||||
|
@ -83,6 +90,8 @@ namespace LocalAuthentication {
|
|||
[MacCatalyst (13, 1)]
|
||||
BiometryLockout = -8,
|
||||
NotInteractive = -1004,
|
||||
[NoWatch]
|
||||
CompanionNotAvailable = -11,
|
||||
}
|
||||
|
||||
/// <summary>Enumerates local authentication credential types.</summary>
|
||||
|
|
|
@ -216,6 +216,7 @@ $(IOS_BUILD_DIR)/AssemblyInfo.cs: $(TOP)/src/AssemblyInfo.cs.in | $(IOS_BUILD_DI
|
|||
-e 's|@NUGET_VERSION_REV@|$(IOS_NUGET_VERSION_PATCH)|g' \
|
||||
-e 's|@NUGET_VERSION_BUILD@|$(IOS_NUGET_COMMIT_DISTANCE)|g' \
|
||||
-e 's|@DOTNET_PLATFORM@|iOS|g' \
|
||||
-e 's|@XCODE_VERSION@|$(subst .,_,$(XCODE_VERSION))|g' \
|
||||
< $< > $@.tmp
|
||||
$(Q) diff $@ $@.tmp >/dev/null 2>&1 || mv -f $@.tmp $@
|
||||
$(Q) rm -f $@.tmp
|
||||
|
@ -510,6 +511,7 @@ $(MACOS_BUILD_DIR)/AssemblyInfo.cs: $(TOP)/src/AssemblyInfo.cs.in | $(MACOS_BUIL
|
|||
-e 's|@NUGET_VERSION_REV@|$(MACOS_NUGET_VERSION_PATCH)|g' \
|
||||
-e 's|@NUGET_VERSION_BUILD@|$(MACOS_NUGET_COMMIT_DISTANCE)|g' \
|
||||
-e 's|@DOTNET_PLATFORM@|macOS|g' \
|
||||
-e 's|@XCODE_VERSION@|$(subst .,_,$(XCODE_VERSION))|g' \
|
||||
< $< > $@.tmp
|
||||
$(Q) diff $@ $@.tmp >/dev/null 2>&1 || mv -f $@.tmp $@
|
||||
$(Q) rm -f $@.tmp
|
||||
|
@ -735,6 +737,7 @@ $(WATCH_BUILD_DIR)/AssemblyInfo.cs: $(TOP)/src/AssemblyInfo.cs.in $(TOP)/Make.co
|
|||
-e 's|@PACKAGE_VERSION_MINOR@|$(IOS_PACKAGE_VERSION_MINOR)|g' \
|
||||
-e 's|@PACKAGE_VERSION_REV@|$(IOS_PACKAGE_VERSION_REV)|g' \
|
||||
-e 's|@PACKAGE_VERSION_BUILD@|$(IOS_PACKAGE_VERSION_BUILD)|g' \
|
||||
-e 's|@XCODE_VERSION@|$(subst .,_,$(XCODE_VERSION))|g' \
|
||||
$< > $@.tmp
|
||||
$(Q) diff $@ $@.tmp >/dev/null 2>&1 || mv -f $@.tmp $@
|
||||
$(Q) rm -f $@.tmp
|
||||
|
@ -945,6 +948,7 @@ $(TVOS_BUILD_DIR)/AssemblyInfo.cs: $(TOP)/src/AssemblyInfo.cs.in $(TOP)/Make.con
|
|||
-e 's|@NUGET_VERSION_REV@|$(TVOS_NUGET_VERSION_PATCH)|g' \
|
||||
-e 's|@NUGET_VERSION_BUILD@|$(TVOS_NUGET_COMMIT_DISTANCE)|g' \
|
||||
-e 's|@DOTNET_PLATFORM@|tvOS|g' \
|
||||
-e 's|@XCODE_VERSION@|$(subst .,_,$(XCODE_VERSION))|g' \
|
||||
$< > $@.tmp
|
||||
$(Q) diff $@ $@.tmp >/dev/null 2>&1 || mv -f $@.tmp $@
|
||||
$(Q) rm -f $@.tmp
|
||||
|
@ -1111,6 +1115,7 @@ $(MACCATALYST_BUILD_DIR)/AssemblyInfo.cs: $(TOP)/src/AssemblyInfo.cs.in $(TOP)/M
|
|||
-e 's|@NUGET_VERSION_REV@|$(MACCATALYST_NUGET_VERSION_PATCH)|g' \
|
||||
-e 's|@NUGET_VERSION_BUILD@|$(MACCATALYST_NUGET_COMMIT_DISTANCE)|g' \
|
||||
-e 's|@DOTNET_PLATFORM@|MacCatalyst|g' \
|
||||
-e 's|@XCODE_VERSION@|$(subst .,_,$(XCODE_VERSION))|g' \
|
||||
$< > $@.tmp
|
||||
$(Q) diff $@ $@.tmp >/dev/null 2>&1 || mv -f $@.tmp $@
|
||||
$(Q) rm -f $@.tmp
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
#if !WATCH
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
using MapKit;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace MapKit {
|
||||
/// <summary>This enum is used to select how to initialize a new instance of a <see cref="MKAddressFilter" />.</summary>
|
||||
public enum MKAddressFilterConstructorOption {
|
||||
/// <summary>The <c>options</c> parameter passed to the constructor are inclusive.</summary>
|
||||
Include,
|
||||
/// <summary>The <c>options</c> parameter passed to the constructor are exclusive.</summary>
|
||||
Exclude,
|
||||
}
|
||||
|
||||
public partial class MKAddressFilter {
|
||||
/// <summary>Create a new <see cref="MKAddressFilter" /> with the specified address filter options.</summary>
|
||||
/// <param name="options">The address filter options to use.</param>
|
||||
/// <param name="constructorOption">Specify whether the <paramref name="options" /> argument is including or excluding the given options.</param>
|
||||
/// <returns>A new <see cref="MKAddressFilter" /> instance with the specified address filter options.</returns>
|
||||
public MKAddressFilter (MKAddressFilterOption options, MKAddressFilterConstructorOption constructorOption)
|
||||
: base (NSObjectFlag.Empty)
|
||||
{
|
||||
switch (constructorOption) {
|
||||
case MKAddressFilterConstructorOption.Include:
|
||||
InitializeHandle (_InitIncludingOptions (options));
|
||||
break;
|
||||
case MKAddressFilterConstructorOption.Exclude:
|
||||
InitializeHandle (_InitExcludingOptions (options));
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException (nameof (constructorOption), constructorOption, "Invalid enum value.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -174,6 +174,8 @@ namespace MapKit {
|
|||
Address = 1 << 0,
|
||||
PointOfInterest = 1 << 1,
|
||||
Query = 1 << 2,
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
PhysicalFeature = 1 << 3,
|
||||
}
|
||||
|
||||
[Flags]
|
||||
|
@ -183,6 +185,8 @@ namespace MapKit {
|
|||
public enum MKLocalSearchResultType : ulong {
|
||||
Address = 1 << 0,
|
||||
PointOfInterest = 1 << 1,
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
PhysicalFeature = 1 << 2,
|
||||
}
|
||||
|
||||
[Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0), NoWatch, TV (16, 0)]
|
||||
|
@ -355,6 +359,138 @@ namespace MapKit {
|
|||
|
||||
[Field ("MKPointOfInterestCategoryZoo")]
|
||||
Zoo,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryAnimalService")]
|
||||
AnimalService,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryAutomotiveRepair")]
|
||||
AutomotiveRepair,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryBaseball")]
|
||||
Baseball,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryBasketball")]
|
||||
Basketball,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryBeauty")]
|
||||
Beauty,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryBowling")]
|
||||
Bowling,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryCastle")]
|
||||
Castle,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryConventionCenter")]
|
||||
ConventionCenter,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryDistillery")]
|
||||
Distillery,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryFairground")]
|
||||
Fairground,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryFishing")]
|
||||
Fishing,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryFortress")]
|
||||
Fortress,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryGolf")]
|
||||
Golf,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryGoKart")]
|
||||
GoKart,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryHiking")]
|
||||
Hiking,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryKayaking")]
|
||||
Kayaking,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryLandmark")]
|
||||
Landmark,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryMailbox")]
|
||||
Mailbox,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryMiniGolf")]
|
||||
MiniGolf,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryMusicVenue")]
|
||||
MusicVenue,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryNationalMonument")]
|
||||
NationalMonument,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryPlanetarium")]
|
||||
Planetarium,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryRockClimbing")]
|
||||
RockClimbing,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryRVPark")]
|
||||
RVPark,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategorySkatePark")]
|
||||
SkatePark,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategorySkating")]
|
||||
Skating,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategorySkiing")]
|
||||
Skiing,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategorySoccer")]
|
||||
Soccer,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategorySpa")]
|
||||
Spa,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategorySurfing")]
|
||||
Surfing,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategorySwimming")]
|
||||
Swimming,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryTennis")]
|
||||
Tennis,
|
||||
|
||||
[NoWatch, TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
[Field ("MKPointOfInterestCategoryVolleyball")]
|
||||
Volleyball,
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -309,6 +309,33 @@ namespace MediaAccessibility {
|
|||
MACaptionAppearanceDidDisplayCaptions (array.Handle);
|
||||
}
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
#else
|
||||
[TV (18, 0), iOS (18, 0), MacCatalyst (18, 0), Mac (15, 0), Watch (11, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.MediaAccessibilityLibrary)]
|
||||
static extern byte MACaptionAppearanceIsCustomized (nint /* MACaptionAppearanceDomain */ domain);
|
||||
|
||||
/// <summary>Checks whether the specified style has been customized by the user.</summary>
|
||||
/// <param name="domain">The style to check</param>
|
||||
/// <returns>True if the specified style has been customized by the user, false otherwise.</returns>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
#else
|
||||
[TV (18, 0), iOS (18, 0), MacCatalyst (18, 0), Mac (15, 0), Watch (11, 0)]
|
||||
#endif
|
||||
public static bool IsCustomized (MACaptionAppearanceDomain domain)
|
||||
{
|
||||
return MACaptionAppearanceIsCustomized ((nint) (long) domain) != 0;
|
||||
}
|
||||
}
|
||||
|
||||
#if NET
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
#if NET
|
||||
#if MONOMAC
|
||||
using System;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
namespace MediaExtension {
|
||||
public partial class MEByteSource {
|
||||
/// <summary>Read data asynchronously into a byte array.</summary>
|
||||
/// <param name="offset">The offset (relative to the start of the ifle) where to start reading.</param>
|
||||
/// <param name="data">The byte array to write the data into.</param>
|
||||
/// <param name="completionHandler">The delegate which is called when the read operation has completed.</param>
|
||||
/// <remarks>This overload will try to fill the <paramref name="data" /> byte array with data.</remarks>
|
||||
public void ReadData (long offset, byte[] data, MEByteSourceReadBytesCallback completionHandler)
|
||||
{
|
||||
ReadData ((nuint) data.Length, offset, data, completionHandler);
|
||||
}
|
||||
|
||||
/// <summary>Read data asynchronously into a byte array.</summary>
|
||||
/// <param name="length">The number of bytes to read.</param>
|
||||
/// <param name="offset">The offset (relative to the start of the ifle) where to start reading.</param>
|
||||
/// <param name="data">The byte array to write the data into.</param>
|
||||
/// <param name="completionHandler">The delegate which is called when the read operation has completed.</param>
|
||||
public void ReadData (nuint length, long offset, byte[] data, MEByteSourceReadBytesCallback completionHandler)
|
||||
{
|
||||
if (data is null)
|
||||
ThrowHelper.ThrowArgumentNullException (nameof (data));
|
||||
|
||||
if (length > (nuint) data.Length)
|
||||
ThrowHelper.ThrowArgumentOutOfRangeException (nameof (length), length, $"length cannot be higher than the length of the data array.");
|
||||
|
||||
unsafe {
|
||||
fixed (byte* dataPtr = data) {
|
||||
ReadData (length, offset, dataPtr, completionHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Read data synchronously into a byte array.</summary>
|
||||
/// <param name="offset">The offset (relative to the start of the ifle) where to start reading.</param>
|
||||
/// <param name="data">The byte array to write the data into.</param>
|
||||
/// <param name="bytesRead">Upon return, will contain the number of read bytes.</param>
|
||||
/// <param name="error">Null if an error occurred, otherwise an <see cref="NSError" /> instance with information about the error. The error will be <see cref="MEError.EndOfStream" /> if the end was reached.</param>
|
||||
/// <returns>True if successful, false otherwise.</returns>
|
||||
/// <remarks>This overload will try to fill the <paramref name="data" /> byte array with data.</remarks>
|
||||
public bool ReadData (long offset, byte[] data, out nuint bytesRead, out NSError? error)
|
||||
{
|
||||
return ReadData ((nuint) data.Length, offset, data, out bytesRead, out error);
|
||||
}
|
||||
|
||||
/// <summary>Read data synchronously into a byte array.</summary>
|
||||
/// <param name="length">The number of bytes to read.</param>
|
||||
/// <param name="offset">The offset (relative to the start of the ifle) where to start reading.</param>
|
||||
/// <param name="data">The byte array to write the data into.</param>
|
||||
/// <param name="bytesRead">Upon return, will contain the number of read bytes.</param>
|
||||
/// <param name="error">Null if an error occurred, otherwise an <see cref="NSError" /> instance with information about the error. The error will be <see cref="MEError.EndOfStream" /> if the end was reached.</param>
|
||||
/// <returns>True if successful, false otherwise.</returns>
|
||||
public bool ReadData (nuint length, long offset, byte[] data, out nuint bytesRead, out NSError? error)
|
||||
{
|
||||
if (data is null)
|
||||
ThrowHelper.ThrowArgumentNullException (nameof (data));
|
||||
|
||||
if (length > (nuint) data.Length)
|
||||
ThrowHelper.ThrowArgumentOutOfRangeException (nameof (length), length, $"length cannot be higher than the length of the data array.");
|
||||
|
||||
unsafe {
|
||||
fixed (byte* dataPtr = data) {
|
||||
return ReadData (length, offset, dataPtr, out bytesRead, out error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endif // MONOMAC
|
||||
#endif // NET
|
|
@ -0,0 +1,42 @@
|
|||
#if NET
|
||||
#if MONOMAC
|
||||
using System;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
namespace MediaExtension {
|
||||
/// <summary>This enum is used to select how to initialize a new instance of a <see cref="MERawProcessingBooleanParameter" />.</summary>
|
||||
public enum MERawProcessingBooleanParameterInitializationOption {
|
||||
/// <summary>The <c>neutralOrCameraValue</c> parameter passed to the constructor is a neutral value.</summary>
|
||||
NeutralValue,
|
||||
/// <summary>The <c>neutralOrCameraValue</c> parameter passed to the constructor is a camera value.</summary>
|
||||
CameraValue,
|
||||
}
|
||||
|
||||
public partial class MERawProcessingBooleanParameter {
|
||||
/// <summary>Create a new <see cref="MERawProcessingBooleanParameter" /> instance.</summary>
|
||||
/// <param name="name">The name of the parameter.</param>
|
||||
/// <param name="key">The key value for the parameter.</param>
|
||||
/// <param name="description">The description for the parameter.</param>
|
||||
/// <param name="initialValue">The parameter's initial value.</param>
|
||||
/// <param name="neutralOrCameraValue">The parameter's neutral or camera value.</param>
|
||||
/// <param name="option">Specifies whether <paramref name="neutralOrCameraValue" /> is a neutral or a camera value.</param>
|
||||
public MERawProcessingBooleanParameter (string name, string key, string description, bool initialValue, bool neutralOrCameraValue, MERawProcessingBooleanParameterInitializationOption option)
|
||||
: base (NSObjectFlag.Empty)
|
||||
{
|
||||
switch (option) {
|
||||
case MERawProcessingBooleanParameterInitializationOption.NeutralValue:
|
||||
InitializeHandle (_InitWithNeutralValue (name, key, description, initialValue, neutralOrCameraValue));
|
||||
break;
|
||||
case MERawProcessingBooleanParameterInitializationOption.CameraValue:
|
||||
InitializeHandle (_InitWithCameraValue (name, key, description, initialValue, neutralOrCameraValue));
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException (nameof (option), option, "Invalid enum value.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // MONOMAC
|
||||
#endif // NET
|
|
@ -0,0 +1,44 @@
|
|||
#if NET
|
||||
#if MONOMAC
|
||||
using System;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
namespace MediaExtension {
|
||||
/// <summary>This enum is used to select how to initialize a new instance of a <see cref="MERawProcessingFloatParameter" />.</summary>
|
||||
public enum MERawProcessingFloatParameterInitializationOption {
|
||||
/// <summary>The <c>neutralOrCameraValue</c> parameter passed to the constructor is a neutral value.</summary>
|
||||
NeutralValue,
|
||||
/// <summary>The <c>neutralOrCameraValue</c> parameter passed to the constructor is a camera value.</summary>
|
||||
CameraValue,
|
||||
}
|
||||
|
||||
public partial class MERawProcessingFloatParameter {
|
||||
/// <summary>Create a new <see cref="MERawProcessingFloatParameter" /> instance.</summary>
|
||||
/// <param name="name">The name of the parameter.</param>
|
||||
/// <param name="key">The key value for the parameter.</param>
|
||||
/// <param name="description">The description for the parameter.</param>
|
||||
/// <param name="initialValue">The parameter's initial value.</param>
|
||||
/// <param name="maximum">The parameter's maximum value.</param>
|
||||
/// <param name="minimum">The parameter's minimum value.</param>
|
||||
/// <param name="neutralOrCameraValue">The parameter's neutral or camera value.</param>
|
||||
/// <param name="option">Specifies whether <paramref name="neutralOrCameraValue" /> is a neutral or a camera value.</param>
|
||||
public MERawProcessingFloatParameter (string name, string key, string description, float initialValue, float maximum, float minimum, float neutralOrCameraValue, MERawProcessingFloatParameterInitializationOption option)
|
||||
: base (NSObjectFlag.Empty)
|
||||
{
|
||||
switch (option) {
|
||||
case MERawProcessingFloatParameterInitializationOption.NeutralValue:
|
||||
InitializeHandle (_InitWithNeutralValue (name, key, description, initialValue, maximum, minimum, neutralOrCameraValue));
|
||||
break;
|
||||
case MERawProcessingFloatParameterInitializationOption.CameraValue:
|
||||
InitializeHandle (_InitWithCameraValue (name, key, description, initialValue, maximum, minimum, neutralOrCameraValue));
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException (nameof (option), option, "Invalid enum value.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // MONOMAC
|
||||
#endif // NET
|
|
@ -0,0 +1,44 @@
|
|||
#if NET
|
||||
#if MONOMAC
|
||||
using System;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
namespace MediaExtension {
|
||||
/// <summary>This enum is used to select how to initialize a new instance of a <see cref="MERawProcessingIntegerParameter" />.</summary>
|
||||
public enum MERawProcessingIntegerParameterInitializationOption {
|
||||
/// <summary>The <c>neutralOrCameraValue</c> parameter passed to the constructor is a neutral value.</summary>
|
||||
NeutralValue,
|
||||
/// <summary>The <c>neutralOrCameraValue</c> parameter passed to the constructor is a camera value.</summary>
|
||||
CameraValue,
|
||||
}
|
||||
|
||||
public partial class MERawProcessingIntegerParameter {
|
||||
/// <summary>Create a new <see cref="MERawProcessingIntegerParameter" /> instance.</summary>
|
||||
/// <param name="name">The name of the parameter.</param>
|
||||
/// <param name="key">The key value for the parameter.</param>
|
||||
/// <param name="description">The description for the parameter.</param>
|
||||
/// <param name="initialValue">The parameter's initial value.</param>
|
||||
/// <param name="maximum">The parameter's maximum value.</param>
|
||||
/// <param name="minimum">The parameter's minimum value.</param>
|
||||
/// <param name="neutralOrCameraValue">The parameter's neutral or camera value.</param>
|
||||
/// <param name="option">Specifies whether <paramref name="neutralOrCameraValue" /> is a neutral or a camera value.</param>
|
||||
public MERawProcessingIntegerParameter (string name, string key, string description, nint initialValue, nint maximum, nint minimum, nint neutralOrCameraValue, MERawProcessingIntegerParameterInitializationOption option)
|
||||
: base (NSObjectFlag.Empty)
|
||||
{
|
||||
switch (option) {
|
||||
case MERawProcessingIntegerParameterInitializationOption.NeutralValue:
|
||||
InitializeHandle (_InitWithNeutralValue (name, key, description, initialValue, maximum, minimum, neutralOrCameraValue));
|
||||
break;
|
||||
case MERawProcessingIntegerParameterInitializationOption.CameraValue:
|
||||
InitializeHandle (_InitWithCameraValue (name, key, description, initialValue, maximum, minimum, neutralOrCameraValue));
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException (nameof (option), option, "Invalid enum value.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // MONOMAC
|
||||
#endif // NET
|
|
@ -0,0 +1,43 @@
|
|||
#if NET
|
||||
#if MONOMAC
|
||||
using System;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
namespace MediaExtension {
|
||||
/// <summary>This enum is used to select how to initialize a new instance of a <see cref="MERawProcessingListParameter" />.</summary>
|
||||
public enum MERawProcessingListParameterInitializationOption {
|
||||
/// <summary>The <c>neutralOrCameraValue</c> parameter passed to the constructor is a neutral value.</summary>
|
||||
NeutralValue,
|
||||
/// <summary>The <c>neutralOrCameraValue</c> parameter passed to the constructor is a camera value.</summary>
|
||||
CameraValue,
|
||||
}
|
||||
|
||||
public partial class MERawProcessingListParameter {
|
||||
/// <summary>Create a new <see cref="MERawProcessingListParameter" /> instance.</summary>
|
||||
/// <param name="name">The name of the parameter.</param>
|
||||
/// <param name="key">The key value for the parameter.</param>
|
||||
/// <param name="description">The description for the parameter.</param>
|
||||
/// <param name="listElements">The parameter's list elements value.</param>
|
||||
/// <param name="initialValue">The parameter's initial value.</param>
|
||||
/// <param name="neutralOrCameraValue">The parameter's neutral or camera value.</param>
|
||||
/// <param name="option">Specifies whether <paramref name="neutralOrCameraValue" /> is a neutral or a camera value.</param>
|
||||
public MERawProcessingListParameter (string name, string key, string description, MERawProcessingListElementParameter[] listElements, nint initialValue, nint neutralOrCameraValue, MERawProcessingListParameterInitializationOption option)
|
||||
: base (NSObjectFlag.Empty)
|
||||
{
|
||||
switch (option) {
|
||||
case MERawProcessingListParameterInitializationOption.NeutralValue:
|
||||
InitializeHandle (_InitWithNeutralValue (name, key, description, listElements, initialValue, neutralOrCameraValue));
|
||||
break;
|
||||
case MERawProcessingListParameterInitializationOption.CameraValue:
|
||||
InitializeHandle (_InitWithCameraValue (name, key, description, listElements, initialValue, neutralOrCameraValue));
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException (nameof (option), option, "Invalid enum value.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // MONOMAC
|
||||
#endif // NET
|
|
@ -0,0 +1,28 @@
|
|||
#if NET
|
||||
#if MONOMAC
|
||||
using System;
|
||||
|
||||
using AVFoundation;
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
namespace MediaExtension {
|
||||
public partial interface IMESampleCursor {
|
||||
/// <summary>Compute an exact sample location based on data returned from <see cref="GetEstimatedSampleLocation" />.</summary>
|
||||
/// <param name="estimatedSampleLocation">The estimated sample location returned from <see cref="GetEstimatedSampleLocation" />.</param>
|
||||
/// <param name="refinementData">The refinement data returned from <see cref="GetEstimatedSampleLocation" />.</param>
|
||||
/// <param name="refinedLocation">Upon return, the exact location of the sample.</param>
|
||||
/// <param name="error">Upon return, null if successful, otherwise an <see cref="NSError" /> instance for the error.</param>
|
||||
/// <returns>True if successful, false otherwise.</returns>
|
||||
public bool RefineSampleLocation (AVSampleCursorStorageRange estimatedSampleLocation, byte [] refinementData, out AVSampleCursorStorageRange refinedLocation, out NSError? error)
|
||||
{
|
||||
unsafe {
|
||||
fixed (byte* refinementDataPtr = refinementData) {
|
||||
return RefineSampleLocation (estimatedSampleLocation, refinementDataPtr, (nuint) refinementData.Length, out refinedLocation, out error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // MONOMAC
|
||||
#endif // NET
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
|
||||
public partial interface IMTLCommandBuffer {
|
||||
|
||||
/// <summary>Marks the specified residency sets as part of the current command buffer execution.</summary>
|
||||
/// <param name="residencySets">The residency sets to mark.</param>
|
||||
public void UseResidencySets (params IMTLResidencySet [] residencySets)
|
||||
{
|
||||
NativeObjectExtensions.CallWithPointerToFirstElementAndCount (residencySets, nameof (residencySets), UseResidencySets);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
|
||||
public partial interface IMTLCommandQueue {
|
||||
|
||||
/// <summary>Marks the specified residency sets as part of the current command buffer execution.</summary>
|
||||
/// <param name="residencySets">The residency sets to mark.</param>
|
||||
public void AddResidencySets (params IMTLResidencySet [] residencySets)
|
||||
{
|
||||
NativeObjectExtensions.CallWithPointerToFirstElementAndCount (residencySets, nameof (residencySets), AddResidencySets);
|
||||
}
|
||||
|
||||
/// <summary>Removes the specified residency sets from the current command buffer execution.</summary>
|
||||
/// <param name="residencySets">The residency sets to mark.</param>
|
||||
public void RemoveResidencySets (params IMTLResidencySet [] residencySets)
|
||||
{
|
||||
NativeObjectExtensions.CallWithPointerToFirstElementAndCount (residencySets, nameof (residencySets), RemoveResidencySets);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -55,15 +55,14 @@ namespace Metal {
|
|||
}
|
||||
}
|
||||
|
||||
#if MONOMAC || __MACCATALYST__
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[UnsupportedOSPlatform ("ios")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[MacCatalyst (15,0)]
|
||||
[MacCatalyst (15, 0)]
|
||||
[iOS (18, 0), TV (18, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.MetalLibrary)]
|
||||
unsafe static extern IntPtr MTLCopyAllDevices ();
|
||||
|
@ -71,10 +70,11 @@ namespace Metal {
|
|||
#if NET
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[UnsupportedOSPlatform ("ios")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[MacCatalyst (15,0)]
|
||||
[MacCatalyst (15, 0)]
|
||||
[iOS (18, 0), TV (18, 0)]
|
||||
#endif
|
||||
public static IMTLDevice [] GetAllDevices ()
|
||||
{
|
||||
|
@ -84,8 +84,6 @@ namespace Metal {
|
|||
return devices;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if MONOMAC
|
||||
|
||||
#if NET
|
||||
|
|
|
@ -384,14 +384,55 @@ namespace Metal {
|
|||
[NoiOS]
|
||||
[NoMacCatalyst]
|
||||
BC7_RGBAUnorm_sRGB = 153,
|
||||
|
||||
[Deprecated (PlatformName.iOS, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.MacCatalyst, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
PVRTC_RGB_2BPP = 160,
|
||||
|
||||
[Deprecated (PlatformName.iOS, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.MacCatalyst, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
PVRTC_RGB_2BPP_sRGB = 161,
|
||||
|
||||
[Deprecated (PlatformName.iOS, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.MacCatalyst, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
PVRTC_RGB_4BPP = 162,
|
||||
|
||||
[Deprecated (PlatformName.iOS, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.MacCatalyst, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
PVRTC_RGB_4BPP_sRGB = 163,
|
||||
|
||||
[Deprecated (PlatformName.iOS, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.MacCatalyst, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
PVRTC_RGBA_2BPP = 164,
|
||||
|
||||
[Deprecated (PlatformName.iOS, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.MacCatalyst, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
PVRTC_RGBA_2BPP_sRGB = 165,
|
||||
|
||||
[Deprecated (PlatformName.iOS, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.MacCatalyst, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
PVRTC_RGBA_4BPP = 166,
|
||||
|
||||
[Deprecated (PlatformName.iOS, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.MacCatalyst, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 18, 0, message: "Use ASTC/ETC2/BC formats instead.")]
|
||||
PVRTC_RGBA_4BPP_sRGB = 167,
|
||||
|
||||
EAC_R11Unorm = 170,
|
||||
EAC_R11Snorm = 172,
|
||||
EAC_RG11Unorm = 174,
|
||||
|
@ -919,7 +960,14 @@ namespace Metal {
|
|||
[Flags]
|
||||
public enum MTLPipelineOption : ulong {
|
||||
None,
|
||||
ArgumentInfo,
|
||||
#if !XAMCORE_5_0
|
||||
[Deprecated (PlatformName.iOS, 18, 0, message: "Use 'BindingInfo' instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 18, 0, message: "Use 'BindingInfo' instead.")]
|
||||
[Deprecated (PlatformName.MacCatalyst, 18, 0, message: "Use 'BindingInfo' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'BindingInfo' instead.")]
|
||||
ArgumentInfo = 1 << 0,
|
||||
#endif
|
||||
BindingInfo = 1 << 0,
|
||||
BufferTypeInfo,
|
||||
[iOS (14, 0)]
|
||||
[TV (14, 0)]
|
||||
|
@ -1061,6 +1109,8 @@ namespace Metal {
|
|||
v3_0 = (3uL << 16) + 0,
|
||||
[iOS (17, 0), TV (17, 0), MacCatalyst (17, 0), Mac (14, 0), NoWatch]
|
||||
v3_1 = (3uL << 16) + 1,
|
||||
[TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
v3_2 = (3ul << 16) + 2,
|
||||
}
|
||||
|
||||
/// <summary>Enumerates values that indicate whether to clip or clamp depth values.</summary>
|
||||
|
@ -1637,7 +1687,15 @@ namespace Metal {
|
|||
[MacCatalyst (14, 0)]
|
||||
CompileToBinary = 1uL << 0,
|
||||
[iOS (17, 0), TV (17, 0), MacCatalyst (17, 0), Mac (14, 0)]
|
||||
[Deprecated (PlatformName.MacCatalyst, 18, 0, message: "Use 'StoreFunctionInMetalPipelinesScript' instead.")]
|
||||
[Deprecated (PlatformName.iOS, 18, 0, message: "Use 'StoreFunctionInMetalPipelinesScript' instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 18, 0, message: "Use 'StoreFunctionInMetalPipelinesScript' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 15, 0, message: "Use 'StoreFunctionInMetalPipelinesScript' instead.")]
|
||||
StoreFunctionInMetalScript = 1uL << 1,
|
||||
[TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
StoreFunctionInMetalPipelinesScript = 1 << 1,
|
||||
[TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
FailOnBinaryArchiveMiss = 1 << 2,
|
||||
}
|
||||
|
||||
[Flags, iOS (14, 0), TV (16, 0)]
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
|
||||
public partial interface IMTLResidencySet {
|
||||
|
||||
/// <summary>Adds allocations to be committed the next time <see cref="Commit" /> is called.</summary>
|
||||
/// <param name="allocations">The allocations to add.</param>
|
||||
public void AddAllocations (params IMTLAllocation [] allocations)
|
||||
{
|
||||
NativeObjectExtensions.CallWithPointerToFirstElementAndCount (allocations, nameof (allocations), AddAllocations);
|
||||
}
|
||||
|
||||
/// <summary>Marks allocations to be removed the next time <see cref="Commit" /> is called.</summary>
|
||||
/// <param name="allocations">The allocations to remove.</param>
|
||||
public void RemoveAllocations (params IMTLAllocation [] allocations)
|
||||
{
|
||||
NativeObjectExtensions.CallWithPointerToFirstElementAndCount (allocations, nameof (allocations), RemoveAllocations);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -261,4 +261,134 @@ namespace MetalPerformanceShaders {
|
|||
public uint RowOffset;
|
||||
public uint ColumnOffset;
|
||||
}
|
||||
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct MPSNDArrayOffsets {
|
||||
// NSInteger dimensions[16];
|
||||
nint dimension0;
|
||||
nint dimension1;
|
||||
nint dimension2;
|
||||
nint dimension3;
|
||||
nint dimension4;
|
||||
nint dimension5;
|
||||
nint dimension6;
|
||||
nint dimension7;
|
||||
nint dimension8;
|
||||
nint dimension9;
|
||||
nint dimension10;
|
||||
nint dimension11;
|
||||
nint dimension12;
|
||||
nint dimension13;
|
||||
nint dimension14;
|
||||
nint dimension15;
|
||||
|
||||
public nint [] Dimensions {
|
||||
get => new nint [] {
|
||||
dimension0,
|
||||
dimension1,
|
||||
dimension2,
|
||||
dimension3,
|
||||
dimension4,
|
||||
dimension5,
|
||||
dimension6,
|
||||
dimension7,
|
||||
dimension8,
|
||||
dimension9,
|
||||
dimension10,
|
||||
dimension11,
|
||||
dimension12,
|
||||
dimension13,
|
||||
dimension14,
|
||||
dimension15,
|
||||
};
|
||||
set {
|
||||
if (value is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (value));
|
||||
if (value.Length != 16)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentOutOfRangeException (nameof (value), "Length must be 16.");
|
||||
|
||||
dimension0 = value [0];
|
||||
dimension1 = value [1];
|
||||
dimension2 = value [2];
|
||||
dimension3 = value [3];
|
||||
dimension4 = value [4];
|
||||
dimension5 = value [5];
|
||||
dimension6 = value [6];
|
||||
dimension7 = value [7];
|
||||
dimension8 = value [8];
|
||||
dimension9 = value [9];
|
||||
dimension10 = value [10];
|
||||
dimension11 = value [11];
|
||||
dimension12 = value [12];
|
||||
dimension13 = value [13];
|
||||
dimension14 = value [14];
|
||||
dimension15 = value [15];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct MPSNDArraySizes {
|
||||
// NSUInteger dimensions[16];
|
||||
nuint dimension0;
|
||||
nuint dimension1;
|
||||
nuint dimension2;
|
||||
nuint dimension3;
|
||||
nuint dimension4;
|
||||
nuint dimension5;
|
||||
nuint dimension6;
|
||||
nuint dimension7;
|
||||
nuint dimension8;
|
||||
nuint dimension9;
|
||||
nuint dimension10;
|
||||
nuint dimension11;
|
||||
nuint dimension12;
|
||||
nuint dimension13;
|
||||
nuint dimension14;
|
||||
nuint dimension15;
|
||||
|
||||
public nuint [] Dimensions {
|
||||
get => new nuint [] {
|
||||
dimension0,
|
||||
dimension1,
|
||||
dimension2,
|
||||
dimension3,
|
||||
dimension4,
|
||||
dimension5,
|
||||
dimension6,
|
||||
dimension7,
|
||||
dimension8,
|
||||
dimension9,
|
||||
dimension10,
|
||||
dimension11,
|
||||
dimension12,
|
||||
dimension13,
|
||||
dimension14,
|
||||
dimension15,
|
||||
};
|
||||
set {
|
||||
if (value is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (value));
|
||||
if (value.Length != 16)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentOutOfRangeException (nameof (value), "Length must be 16.");
|
||||
|
||||
dimension0 = value [0];
|
||||
dimension1 = value [1];
|
||||
dimension2 = value [2];
|
||||
dimension3 = value [3];
|
||||
dimension4 = value [4];
|
||||
dimension5 = value [5];
|
||||
dimension6 = value [6];
|
||||
dimension7 = value [7];
|
||||
dimension8 = value [8];
|
||||
dimension9 = value [9];
|
||||
dimension10 = value [10];
|
||||
dimension11 = value [11];
|
||||
dimension12 = value [12];
|
||||
dimension13 = value [13];
|
||||
dimension14 = value [14];
|
||||
dimension15 = value [15];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,6 +60,8 @@ namespace MetalPerformanceShaders {
|
|||
Float32 = FloatBit | 32,
|
||||
|
||||
SignedBit = 0x20000000,
|
||||
[TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
Int4 = SignedBit | 4,
|
||||
Int8 = SignedBit | 8,
|
||||
Int16 = SignedBit | 16,
|
||||
Int32 = SignedBit | 32,
|
||||
|
@ -68,6 +70,8 @@ namespace MetalPerformanceShaders {
|
|||
[MacCatalyst (14, 1)]
|
||||
Int64 = SignedBit | 64,
|
||||
|
||||
[TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
UInt4 = 4,
|
||||
UInt8 = 8,
|
||||
UInt16 = 16,
|
||||
UInt32 = 32,
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
#nullable enable
|
||||
|
||||
using System;
|
||||
|
||||
using Metal;
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
namespace MetalPerformanceShaders {
|
||||
public partial class MPSNDArray {
|
||||
|
@ -92,5 +94,38 @@ namespace MetalPerformanceShaders {
|
|||
ReadBytes ((IntPtr) p, strideBytesPerDimension: IntPtr.Zero);
|
||||
}
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public MPSNDArray? Create (nuint numberOfDimensions, nuint [] dimensionSizes, nuint [] dimStrides)
|
||||
{
|
||||
if (dimensionSizes is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (dimensionSizes));
|
||||
|
||||
if (dimStrides is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (dimStrides));
|
||||
|
||||
if (dimensionSizes.Length != (int) numberOfDimensions)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentOutOfRangeException (nameof (dimensionSizes), $"Length must be equal to 'numberOfDimensions'.");
|
||||
|
||||
if (dimStrides.Length != (int) numberOfDimensions)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentOutOfRangeException (nameof (dimStrides), $"Length must be equal to 'numberOfDimensions'.");
|
||||
|
||||
MPSNDArray? rv;
|
||||
unsafe {
|
||||
fixed (nuint* dimensionSizesPtr = dimensionSizes) {
|
||||
fixed (nuint* dimStridesPtr = dimStrides) {
|
||||
rv = _Create (numberOfDimensions, (IntPtr) dimensionSizesPtr, (IntPtr) dimStridesPtr);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
#nullable enable
|
||||
|
||||
using System;
|
||||
|
||||
using Metal;
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
namespace MetalPerformanceShaders {
|
||||
public partial class MPSNDArrayDescriptor {
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
public void PermuteWithDimensionOrder (nuint [] dimensionOrder)
|
||||
{
|
||||
if (dimensionOrder is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (dimensionOrder));
|
||||
|
||||
if (dimensionOrder.Length != (int) NumberOfDimensions)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentOutOfRangeException (nameof (dimensionOrder), $"Length must be equal to 'NumberOfDimensions'.");
|
||||
|
||||
unsafe {
|
||||
fixed (nuint* ptr = dimensionOrder) {
|
||||
_PermuteWithDimensionOrder ((IntPtr) ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
#nullable enable
|
||||
|
||||
using System;
|
||||
using Metal;
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
namespace MetalPerformanceShaders {
|
||||
public partial class MPSNDArrayIdentity {
|
||||
public MPSNDArray? Reshape (IMTLCommandBuffer? commandBuffer, MPSNDArray sourceArray, nuint [] dimensionSizes, MPSNDArray? destinationArray)
|
||||
{
|
||||
MPSNDArray? rv;
|
||||
unsafe {
|
||||
fixed (nuint* dimensionsPtr = dimensionSizes) {
|
||||
rv = _Reshape (commandBuffer, sourceArray, (nuint) dimensionSizes.Length, (IntPtr) dimensionsPtr, destinationArray);
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
public MPSNDArray? Reshape (IMTLComputeCommandEncoder? encoder, IMTLCommandBuffer? commandBuffer, MPSNDArray sourceArray, nuint [] dimensionSizes, MPSNDArray? destinationArray)
|
||||
{
|
||||
MPSNDArray? rv;
|
||||
unsafe {
|
||||
fixed (nuint* dimensionsPtr = dimensionSizes) {
|
||||
rv = _Reshape (encoder, commandBuffer, sourceArray, (nuint) dimensionSizes.Length, (IntPtr) dimensionsPtr, destinationArray);
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -23,6 +23,14 @@ namespace MetalPerformanceShadersGraph {
|
|||
Chw = 4,
|
||||
Hwc = 5,
|
||||
Hw = 6,
|
||||
[Mac (13, 2), iOS (16, 3), TV (16, 3), MacCatalyst (16, 3)]
|
||||
Ncdhw = 7,
|
||||
[Mac (13, 2), iOS (16, 3), TV (16, 3), MacCatalyst (16, 3)]
|
||||
Ndhwc = 8,
|
||||
[Mac (13, 2), iOS (16, 3), TV (16, 3), MacCatalyst (16, 3)]
|
||||
Oidhw = 9,
|
||||
[Mac (13, 2), iOS (16, 3), TV (16, 3), MacCatalyst (16, 3)]
|
||||
Dhwio = 10,
|
||||
}
|
||||
|
||||
[Native]
|
||||
|
@ -31,6 +39,8 @@ namespace MetalPerformanceShadersGraph {
|
|||
Valid = 1,
|
||||
Same = 2,
|
||||
ExplicitOffset = 3,
|
||||
[Mac (13, 0), iOS (16, 0), TV (16, 0), MacCatalyst (16, 0)]
|
||||
OnnxSameLower = 4,
|
||||
}
|
||||
|
||||
[Native]
|
||||
|
@ -101,4 +111,15 @@ namespace MetalPerformanceShadersGraph {
|
|||
BoxMuller = 1,
|
||||
}
|
||||
|
||||
[TV (15, 4), Mac (12, 3), iOS (15, 4), MacCatalyst (15, 4)]
|
||||
public enum MPSGraphOptimization : ulong {
|
||||
Level0 = 0,
|
||||
Level1 = 1L,
|
||||
}
|
||||
|
||||
[TV (15, 4), Mac (12, 3), iOS (15, 4), MacCatalyst (15, 4)]
|
||||
public enum MPSGraphOptimizationProfile : ulong {
|
||||
Performance = 0,
|
||||
PowerEfficiency = 1L,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Buffers;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
using Metal;
|
||||
using MetalPerformanceShaders;
|
||||
|
||||
namespace MetalPerformanceShadersGraph {
|
||||
/// <summary>This enum is used to select how to initialize a new instance of a <see cref="MPSGraphExecutable" />.</summary>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios17.0")]
|
||||
[SupportedOSPlatform ("maccatalyst17.0")]
|
||||
[SupportedOSPlatform ("macos14.0")]
|
||||
[SupportedOSPlatform ("tvos17.0")]
|
||||
#else
|
||||
[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
|
||||
#endif
|
||||
public enum MPSGraphExecutableInitializationOption {
|
||||
/// <summary>The <c>packageUrl</c> parameter passed to the constructor is a url to a CoreML package.</summary>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios18.0")]
|
||||
[SupportedOSPlatform ("maccatalyst18.0")]
|
||||
[SupportedOSPlatform ("macos15.0")]
|
||||
[SupportedOSPlatform ("tvos18.0")]
|
||||
#else
|
||||
[TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
#endif
|
||||
CoreMLPackage,
|
||||
|
||||
/// <summary>The <c>packageUrl</c> parameter passed to the constructor is a url to a MPSGraph package.</summary>
|
||||
MPSGraphPackage,
|
||||
}
|
||||
|
||||
public partial class MPSGraphExecutable {
|
||||
/// <summary>Create a new MPSGraphExecutable instance from a package url and a compilation descriptor..</summary>
|
||||
/// <param name="packageUrl">The url to the package to use.</param>
|
||||
/// <param name="compilationDescriptor">The optional compilation descriptor use.</param>
|
||||
/// <param name="option">Use this option to specify whether the package url points to a CoreML package or an MPSGraph package.</param>
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios17.0")]
|
||||
[SupportedOSPlatform ("maccatalyst17.0")]
|
||||
[SupportedOSPlatform ("macos14.0")]
|
||||
[SupportedOSPlatform ("tvos17.0")]
|
||||
#else
|
||||
[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
|
||||
#endif
|
||||
public MPSGraphExecutable (NSUrl packageUrl, MPSGraphCompilationDescriptor? compilationDescriptor, MPSGraphExecutableInitializationOption option)
|
||||
: base (NSObjectFlag.Empty)
|
||||
{
|
||||
switch (option) {
|
||||
case MPSGraphExecutableInitializationOption.CoreMLPackage:
|
||||
InitializeHandle (_InitWithCoreMLPackage (packageUrl, compilationDescriptor));
|
||||
break;
|
||||
case MPSGraphExecutableInitializationOption.MPSGraphPackage:
|
||||
InitializeHandle (_InitWithMPSGraphPackage (packageUrl, compilationDescriptor));
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException (nameof (option), option, "Invalid enum value.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -42,6 +42,7 @@ namespace Network {
|
|||
public NWEndpoint (NativeHandle handle, bool owns) : base (handle, owns) { }
|
||||
#endif
|
||||
|
||||
#if !COREBUILD
|
||||
[DllImport (Constants.NetworkLibrary)]
|
||||
extern static NWEndpointType nw_endpoint_get_type (OS_nw_endpoint handle);
|
||||
|
||||
|
@ -269,5 +270,22 @@ namespace Network {
|
|||
}
|
||||
}
|
||||
|
||||
internal NWEndpoint []? FromNSArrayHandle (IntPtr handle)
|
||||
{
|
||||
return NSArray.ArrayFromHandle<NWEndpoint> (handle);
|
||||
}
|
||||
|
||||
/// <summary>Returns an autoreleased NSArray handle.</summary>
|
||||
internal IntPtr ToNSArrayHandle (NWEndpoint [] array)
|
||||
{
|
||||
using var rv = NSArray.FromNSObjects (array);
|
||||
if (rv is null)
|
||||
return IntPtr.Zero;
|
||||
rv.DangerousRetain ();
|
||||
rv.DangerousAutorelease ();
|
||||
return rv.Handle;
|
||||
}
|
||||
#endif // !COREBUILD
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -169,6 +169,8 @@ namespace Network {
|
|||
Default = 0,
|
||||
Allow = 1,
|
||||
Prohibit = 2,
|
||||
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
|
||||
Persistent = 3,
|
||||
}
|
||||
|
||||
// this maps to `nw_path_status_t` in Network/Headers/path.h (and not the enum from NetworkExtension)
|
||||
|
|
|
@ -40,6 +40,7 @@ namespace Network {
|
|||
public NWInterface (NativeHandle handle, bool owns) : base (handle, owns) { }
|
||||
#endif
|
||||
|
||||
#if !COREBUILD
|
||||
[DllImport (Constants.NetworkLibrary)]
|
||||
static extern NWInterfaceType nw_interface_get_type (OS_nw_interface iface);
|
||||
|
||||
|
@ -54,5 +55,6 @@ namespace Network {
|
|||
static extern /* uint32_t */ uint nw_interface_get_index (OS_nw_interface iface);
|
||||
|
||||
public uint Index => nw_interface_get_index (GetCheckedHandle ());
|
||||
#endif // !COREBUILD
|
||||
}
|
||||
}
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче