Merge branch 'xcode8'
This commit is contained in:
Коммит
38148c718a
|
@ -5,7 +5,7 @@
|
|||
[submodule "external/mono"]
|
||||
path = external/mono
|
||||
url = ../../mono/mono.git
|
||||
branch = mono-4.5.0-branch
|
||||
branch = mono-4.6.0-branch
|
||||
[submodule "external/fsharp"]
|
||||
path = external/fsharp
|
||||
url = ../../fsharp/fsharp.git
|
||||
|
|
25
Make.config
25
Make.config
|
@ -29,7 +29,7 @@ PACKAGE_HEAD_REV=$(shell git rev-parse HEAD)
|
|||
# on wrench, because wrench technically builds hashes, not branches)
|
||||
#
|
||||
#
|
||||
PACKAGE_HEAD_BRANCH=master
|
||||
PACKAGE_HEAD_BRANCH=xcode8
|
||||
ifeq ($(BUILD_REVISION),)
|
||||
CURRENT_BRANCH:=$(shell git rev-parse --abbrev-ref HEAD)
|
||||
else
|
||||
|
@ -47,14 +47,14 @@ IOS_PACKAGE_VERSION_REV=$(word 3, $(subst ., ,$(IOS_PACKAGE_VERSION)))
|
|||
IOS_PACKAGE_VERSION_BUILD=$(IOS_COMMIT_DISTANCE)
|
||||
IOS_PACKAGE_UPDATE_ID=$(shell printf "2%02d%02d%02d%03d" $(IOS_PACKAGE_VERSION_MAJOR) $(IOS_PACKAGE_VERSION_MINOR) $(IOS_PACKAGE_VERSION_REV) $(IOS_PACKAGE_VERSION_BUILD))
|
||||
|
||||
# Xcode 7.3
|
||||
XCODE_VERSION=7.3
|
||||
XCODE_URL=http://storage.bos.xamarin.com/bot-provisioning/Xcode_7.3.dmg
|
||||
XCODE_DEVELOPER_ROOT=/Applications/Xcode73.app/Contents/Developer
|
||||
# Xcode 8.0 GM
|
||||
XCODE_VERSION=8.0
|
||||
XCODE_URL=http://storage.bos.xamarin.com/bot-provisioning/Xcode_8_GM_seed.xip
|
||||
XCODE_DEVELOPER_ROOT=/Applications/Xcode8-GM.app/Contents/Developer
|
||||
|
||||
# Minimum Mono version
|
||||
MIN_MONO_VERSION=4.4.0.148
|
||||
MAX_MONO_VERSION=4.6.99
|
||||
MAX_MONO_VERSION=4.7.99
|
||||
MIN_MONO_URL=http://download.mono-project.com/archive/4.4.0/macos-10-universal/MonoFramework-MDK-4.4.0.148.macos10.xamarin.universal.pkg
|
||||
|
||||
# Minimum Xamarin Studio version
|
||||
|
@ -67,12 +67,12 @@ MIN_OSX_BUILD_VERSION=10.11
|
|||
MIN_OSX_VERSION_FOR_IOS=10.10
|
||||
MIN_OSX_VERSION_FOR_MAC=10.10
|
||||
|
||||
IOS_SDK_VERSION=9.3
|
||||
OSX_SDK_VERSION=10.11
|
||||
WATCH_SDK_VERSION=2.2
|
||||
TVOS_SDK_VERSION=9.2
|
||||
IOS_SDK_VERSION=10.0
|
||||
OSX_SDK_VERSION=10.12
|
||||
WATCH_SDK_VERSION=3.0
|
||||
TVOS_SDK_VERSION=10.0
|
||||
|
||||
MIN_IOS_SDK_VERSION=5.1.1
|
||||
MIN_IOS_SDK_VERSION=6.0
|
||||
MIN_OSX_SDK_VERSION=10.7
|
||||
MIN_WATCHOS_SDK_VERSION=2.0
|
||||
MIN_TVOS_SDK_VERSION=9.0
|
||||
|
@ -91,6 +91,7 @@ ifdef ENABLE_CCACHE
|
|||
CCACHE=ccache
|
||||
endif
|
||||
|
||||
DISABLE_APPLETLS=1
|
||||
ifdef DISABLE_APPLETLS
|
||||
APPLETLS_DEFINES = -d:XAMARIN_NO_TLS
|
||||
TLS_PROVIDER_ASSEMBLY_NAMES =
|
||||
|
@ -240,7 +241,7 @@ MAC_PRODUCT=Xamarin.Mac
|
|||
MAC_PACKAGE_NAME=xamarin.mac
|
||||
MAC_PACKAGE_NAME_LOWER=$(shell echo $(MAC_PACKAGE_NAME) | tr "[:upper:]" "[:lower:]")
|
||||
|
||||
MAC_PACKAGE_VERSION=2.11.2.$(MAC_COMMIT_DISTANCE)
|
||||
MAC_PACKAGE_VERSION=2.11.3.$(MAC_COMMIT_DISTANCE)
|
||||
MAC_PACKAGE_VERSION_MAJOR=$(word 1, $(subst ., ,$(MAC_PACKAGE_VERSION)))
|
||||
MAC_PACKAGE_VERSION_MINOR=$(word 2, $(subst ., ,$(MAC_PACKAGE_VERSION)))
|
||||
MAC_PACKAGE_VERSION_REV=$(word 3, $(subst ., ,$(MAC_PACKAGE_VERSION)))
|
||||
|
|
|
@ -563,6 +563,7 @@ IOS_BCL_TARGETS_DIRS += \
|
|||
$(PREFIX)/lib/mono/2.1 \
|
||||
$(PREFIX)/lib/mono/2.1/Facades \
|
||||
$(PREFIX)/lib/mono/Xamarin.iOS \
|
||||
$(PREFIX)/lib/mono/Xamarin.iOS/Facades \
|
||||
$(PREFIX)/lib/mono/2.1/repl \
|
||||
$(PREFIX)/lib/mono/Xamarin.iOS/repl \
|
||||
$(BUILD_DESTDIR)/ios/bcl/Facades \
|
||||
|
@ -586,7 +587,6 @@ TVOS_BCL_TARGETS_DIRS += \
|
|||
$(BUILD_DESTDIR)/tvos/bcl/repl \
|
||||
|
||||
IOS_BCL_TARGETS += \
|
||||
$(PREFIX)/lib/mono/Xamarin.iOS/Facades \
|
||||
$(foreach file,$(IOS_ASSEMBLIES),$(PREFIX)/lib/mono/2.1/$(file).dll) \
|
||||
$(foreach file,$(filter-out $(NO_MDB_ASSEMBLIES),$(IOS_ASSEMBLIES)),$(PREFIX)/lib/mono/2.1/$(file).dll.mdb) \
|
||||
$(foreach file,$(IOS_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.iOS/$(file).dll) \
|
||||
|
@ -595,6 +595,7 @@ IOS_BCL_TARGETS +=
|
|||
$(PREFIX)/lib/mono/2.1/mscorlib.dll \
|
||||
$(PREFIX)/bin/btouch-mono \
|
||||
$(foreach file,$(IOS_FACADE_ASSEMBLIES),$(PREFIX)/lib/mono/2.1/Facades/$(file).dll) \
|
||||
$(foreach file,$(IOS_FACADE_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.iOS/Facades/$(file).dll) \
|
||||
$(foreach file,$(IOS_REPL_ASSEMBLIES),$(PREFIX)/lib/mono/2.1/repl/$(file).dll) \
|
||||
$(foreach file,$(IOS_REPL_ASSEMBLIES),$(PREFIX)/lib/mono/2.1/repl/$(file).dll.mdb) \
|
||||
$(foreach file,$(IOS_REPL_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.iOS/repl/$(file).dll) \
|
||||
|
@ -618,8 +619,8 @@ TVOS_BCL_TARGETS += \
|
|||
$(foreach file,$(TVOS_REPL_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.TVOS/repl/$(file).dll) \
|
||||
$(foreach file,$(TVOS_REPL_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.TVOS/repl/$(file).dll.mdb) \
|
||||
|
||||
$(PREFIX)/lib/mono/Xamarin.iOS/Facades: | $(PREFIX)/lib/mono/Xamarin.iOS
|
||||
$(Q_LN) ln -Fhs $(abspath $(IOS_TARGETDIR)$(MONOTOUCH_PREFIX)/lib/mono/2.1/Facades) $@
|
||||
$(PREFIX)/lib/mono/Xamarin.iOS/Facades/%.dll: $(BUILD_DESTDIR)/ios/bcl/Facades/%.dll | $(PREFIX)/lib/mono/Xamarin.iOS/Facades
|
||||
$(Q_LN) ln -fhs $(abspath $(IOS_TARGETDIR)$(MONOTOUCH_PREFIX)/lib/mono/2.1/Facades)/$*.dll $@
|
||||
|
||||
$(PREFIX)/lib/mono/Xamarin.iOS/repl/%: | $(PREFIX)/lib/mono/Xamarin.iOS/repl
|
||||
$(Q_LN) ln -Fs ../../2.1/repl/$(@F) $@
|
||||
|
|
|
@ -68,6 +68,20 @@ namespace Xamarin.MacDev.Tasks
|
|||
return id.Value == "com.apple.watchkit";
|
||||
}
|
||||
|
||||
static bool IsMessagesExtension (PDictionary plist)
|
||||
{
|
||||
PDictionary extension;
|
||||
PString id;
|
||||
|
||||
if (!plist.TryGetValue ("NSExtension", out extension))
|
||||
return false;
|
||||
|
||||
if (!extension.TryGetValue ("NSExtensionPointIdentifier", out id))
|
||||
return false;
|
||||
|
||||
return id.Value == "com.apple.message-payload-provider";
|
||||
}
|
||||
|
||||
protected override void AppendCommandLineArguments (IDictionary<string, string> environment, ProcessArgumentBuilder args, ITaskItem[] items)
|
||||
{
|
||||
string minimumDeploymentTarget;
|
||||
|
@ -102,6 +116,9 @@ namespace Xamarin.MacDev.Tasks
|
|||
|
||||
args.Add ("--app-icon");
|
||||
args.AddQuoted (assetName);
|
||||
|
||||
if (IsMessagesExtension (plist))
|
||||
args.Add ("--product-type com.apple.product-type.app-extension.messages");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -170,6 +170,13 @@ namespace Xamarin.iOS.Tasks
|
|||
case "com.apple.spotlight.index": // iOS
|
||||
case "com.apple.AudioUnit-UI": // iOS
|
||||
case "com.apple.tv-services": // tvOS
|
||||
case "com.apple.broadcast-services": // iOS+tvOS
|
||||
case "com.apple.callkit.call-directory": // iOS
|
||||
case "com.apple.message-payload-provider": // iOS
|
||||
case "com.apple.intents-service": // iOS
|
||||
case "com.apple.intents-ui-service": // iOS
|
||||
case "com.apple.usernotifications.content-extension": // iOS
|
||||
case "com.apple.usernotifications.service": // iOS
|
||||
break;
|
||||
case "com.apple.watchkit": // iOS8.2
|
||||
if (nsExtensionAttributes == null) {
|
||||
|
|
|
@ -537,6 +537,9 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved.
|
|||
</Target>
|
||||
|
||||
<Target Name="_DetectSdkLocations" DependsOnTargets="_ComputeTargetArchitectures">
|
||||
<Error Text="Support for Classic applications (using monotouch.dll) is obsoleted in Xamarin.iOS 10.0+. Please migrate your project to Unified (Project > Migrate to Xamarin.iOS Unified API)."
|
||||
Condition="'$(TargetFrameworkIdentifier)' == 'MonoTouch'"/>
|
||||
|
||||
<DetectSdkLocations
|
||||
SessionId="$(BuildSessionId)"
|
||||
Condition="'$(IsMacEnabled)' == 'true'"
|
||||
|
@ -1553,7 +1556,7 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved.
|
|||
|
||||
<Touch
|
||||
SessionId="$(BuildSessionId)"
|
||||
Condition="'$(IsMacEnabled)' == 'true' And Exists ('$(AppBundleDir).dSYM\Contents\Info.plist')"
|
||||
Condition="'$(IsMacEnabled)' And '$(_RequireCodeSigning)' == 'true' And Exists ('$(AppBundleDir).dSYM\Contents\Info.plist')"
|
||||
Files="$(AppBundleDir).dSYM\Contents\Info.plist"
|
||||
/>
|
||||
</Target>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using MonoTouch.Foundation;
|
||||
using MonoTouch.UIKit;
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace MySingleView
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using MonoTouch.Foundation;
|
||||
using MonoTouch.UIKit;
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
using MyLibrary;
|
||||
|
||||
namespace MySingleView
|
||||
|
|
|
@ -6,11 +6,13 @@
|
|||
<ProductVersion>10.0.0</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{93788F78-16E5-432F-89D8-30F041C51974}</ProjectGuid>
|
||||
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>MyLibrary</RootNamespace>
|
||||
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
|
||||
<AssemblyName>MyLibrary</AssemblyName>
|
||||
<TargetFrameworkIdentifier>Xamarin.iOS</TargetFrameworkIdentifier>
|
||||
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -34,13 +36,12 @@
|
|||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="monotouch" />
|
||||
<Reference Include="Xamarin.iOS" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources\" />
|
||||
<Folder Include="MyLibraryFolder\" />
|
||||
</ItemGroup>
|
||||
<Import Project="..\..\..\Xamarin.iOS.Tasks\bin\Debug\Xamarin.MonoTouch.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<Compile Include="TestFoo.cs" />
|
||||
</ItemGroup>
|
||||
|
@ -66,4 +67,5 @@
|
|||
<InterfaceDefinition Include="LibraryStoryboard.storyboard" />
|
||||
<InterfaceDefinition Include="LibrarySecondStoryboard.storyboard" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
</Project>
|
||||
|
|
|
@ -6,11 +6,13 @@
|
|||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{8F2D37C2-BF1F-408A-8E7E-1B89D2126DFB}</ProjectGuid>
|
||||
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>MySingleView</RootNamespace>
|
||||
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
|
||||
<AssemblyName>MySingleView</AssemblyName>
|
||||
<TargetFrameworkIdentifier>Xamarin.iOS</TargetFrameworkIdentifier>
|
||||
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -47,6 +49,7 @@
|
|||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<MtouchArch>ARMv7</MtouchArch>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||
<DebugType>full</DebugType>
|
||||
|
@ -57,6 +60,7 @@
|
|||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' ">
|
||||
<DebugType>full</DebugType>
|
||||
|
@ -69,6 +73,7 @@
|
|||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignProvision>Automatic:AdHoc</CodesignProvision>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' ">
|
||||
<DebugType>full</DebugType>
|
||||
|
@ -80,12 +85,13 @@
|
|||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignProvision>Automatic:AppStore</CodesignProvision>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="monotouch" />
|
||||
<Reference Include="Xamarin.iOS" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources\" />
|
||||
|
@ -106,7 +112,6 @@
|
|||
<DependentUpon>MySingleViewViewController.cs</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="..\..\Xamarin.iOS.Tasks\bin\Debug\Xamarin.MonoTouch.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="MyLibrary\MyLibrary.csproj">
|
||||
<Project>{93788F78-16E5-432F-89D8-30F041C51974}</Project>
|
||||
|
@ -167,4 +172,5 @@
|
|||
<AtlasTexture Include="Resources\Archer\Archer_Attack.atlas\archer_attack_0009.png" />
|
||||
<AtlasTexture Include="Resources\Archer\Archer_Attack.atlas\archer_attack_0010.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
</Project>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using System.Drawing;
|
||||
using MonoTouch.Foundation;
|
||||
using MonoTouch.UIKit;
|
||||
using CoreGraphics;
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace MySingleView
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// actions made in the Xcode designer. If it is removed, they will be lost.
|
||||
// Manual changes to this file may not be handled correctly.
|
||||
//
|
||||
using MonoTouch.Foundation;
|
||||
using Foundation;
|
||||
|
||||
namespace MySingleView
|
||||
{
|
||||
|
|
|
@ -13,10 +13,11 @@ namespace Xamarin.iOS.Tasks
|
|||
{
|
||||
Platform = platform;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BuildTest ()
|
||||
{
|
||||
var mtouchPaths = SetupProjectPaths ("bindings-test", "../../../tests/", false, Platform);
|
||||
var mtouchPaths = SetupProjectPaths ("bindings-test", "bindings-test-unified", "../../../tests/", false, Platform, "Any CPU/Debug-unified");
|
||||
|
||||
var proj = SetupProject (Engine, mtouchPaths ["project_csprojpath"]);
|
||||
|
||||
|
@ -36,7 +37,7 @@ namespace Xamarin.iOS.Tasks
|
|||
[Test]
|
||||
public void FrameworkTest ()
|
||||
{
|
||||
var mtouchPaths = SetupProjectPaths ("bindings-test", "../../../tests/", false, Platform);
|
||||
var mtouchPaths = SetupProjectPaths ("bindings-test", "bindings-test-unified", "../../../tests/", false, Platform, "Any CPU/Debug-unified");
|
||||
|
||||
var proj = SetupProject (Engine, mtouchPaths ["project_csprojpath"]);
|
||||
AppBundlePath = mtouchPaths.AppBundlePath;
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace Xamarin.iOS.Tasks {
|
|||
{
|
||||
var mtouchPaths = SetupProjectPaths ("MyWatchApp", platform: Platform);
|
||||
using (var xiproj = XIProject.Clone (mtouchPaths.ProjectPath, "MyWatchKitExtension", "MyWatchKitApp")) {
|
||||
mtouchPaths = SetupProjectPaths ("MyWatchApp", xiproj.ProjectDirectory, platform: Platform);
|
||||
mtouchPaths = SetupProjectPaths ("MyWatchApp", "MyWatchApp", xiproj.ProjectDirectory, platform: Platform);
|
||||
|
||||
var appInfoPath = Path.Combine (mtouchPaths.ProjectPath, "Info.plist");
|
||||
var appInfoContents = File.ReadAllText (appInfoPath);
|
||||
|
|
|
@ -79,8 +79,8 @@ namespace Xamarin.iOS.Tasks
|
|||
"System.Xml.dll.mdb",
|
||||
"System.dll",
|
||||
"System.dll.mdb",
|
||||
"monotouch.dll",
|
||||
"monotouch.dll.mdb",
|
||||
"Xamarin.iOS.dll",
|
||||
"Xamarin.iOS.dll.mdb",
|
||||
"mscorlib.dll",
|
||||
"mscorlib.dll.mdb",
|
||||
"runtime-options.plist",
|
||||
|
@ -145,7 +145,7 @@ namespace Xamarin.iOS.Tasks
|
|||
Assert.IsTrue (references.Any (t => t.Include.Contains ("System.Xml")), "#3b");
|
||||
Assert.IsTrue (references.Any (t => t.Include.Contains ("System.Core")), "#3c");
|
||||
Assert.IsTrue (references.Any (t => t.Include.Contains ("mscorlib")), "#3d");
|
||||
Assert.IsTrue (references.Any (t => t.Include.Contains ("monotouch")), "#3e");
|
||||
Assert.IsTrue (references.Any (t => t.Include.Contains ("Xamarin.iOS")), "#3e");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -155,12 +155,11 @@ namespace Xamarin.iOS.Tasks
|
|||
var references = LibraryProject.GetEvaluatedItemsByName ("ReferencePath").ToArray ();
|
||||
|
||||
Assert.AreEqual (5, references.Length, "#1");
|
||||
Assert.IsTrue (references.All (t => t.Include.Contains ("2.1")), "#2");
|
||||
Assert.IsTrue (references.Any (t => t.Include.Contains ("System")), "#3a");
|
||||
Assert.IsTrue (references.Any (t => t.Include.Contains ("System.Xml")), "#3b");
|
||||
Assert.IsTrue (references.Any (t => t.Include.Contains ("System.Core")), "#3c");
|
||||
Assert.IsTrue (references.Any (t => t.Include.Contains ("mscorlib")), "#3d");
|
||||
Assert.IsTrue (references.Any (t => t.Include.Contains ("monotouch")), "#3e");
|
||||
Assert.IsTrue (references.Any (t => t.Include.Contains ("System")), "#2a");
|
||||
Assert.IsTrue (references.Any (t => t.Include.Contains ("System.Xml")), "#2b");
|
||||
Assert.IsTrue (references.Any (t => t.Include.Contains ("System.Core")), "#2c");
|
||||
Assert.IsTrue (references.Any (t => t.Include.Contains ("mscorlib")), "#2d");
|
||||
Assert.IsTrue (references.Any (t => t.Include.Contains ("Xamarin.iOS")), "#2e");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -92,7 +92,7 @@ namespace Xamarin.iOS.Tasks
|
|||
get; set;
|
||||
}
|
||||
|
||||
public ProjectPaths SetupProjectPaths (string projectName, string baseDir = "../", bool includePlatform = true, string platform = "iPhoneSimulator", string config = "Debug")
|
||||
public ProjectPaths SetupProjectPaths (string projectName, string csprojName, string baseDir = "../", bool includePlatform = true, string platform = "iPhoneSimulator", string config = "Debug")
|
||||
{
|
||||
var projectPath = Path.Combine(baseDir, projectName);
|
||||
|
||||
|
@ -103,11 +103,16 @@ namespace Xamarin.iOS.Tasks
|
|||
ProjectPath = projectPath,
|
||||
ProjectBinPath = binPath,
|
||||
ProjectObjPath = objPath,
|
||||
ProjectCSProjPath = Path.Combine (projectPath, projectName + ".csproj"),
|
||||
ProjectCSProjPath = Path.Combine (projectPath, csprojName + ".csproj"),
|
||||
AppBundlePath = Path.Combine (binPath, projectName + ".app"),
|
||||
};
|
||||
}
|
||||
|
||||
public ProjectPaths SetupProjectPaths (string projectName, string baseDir = "../", bool includePlatform = true, string platform = "iPhoneSimulator", string config = "Debug")
|
||||
{
|
||||
return SetupProjectPaths (projectName, projectName, baseDir, includePlatform, platform, config);
|
||||
}
|
||||
|
||||
[SetUp]
|
||||
public virtual void Setup ()
|
||||
{
|
||||
|
|
|
@ -1244,6 +1244,522 @@ namespace Xamarin.BindingMethods.Generator
|
|||
}
|
||||
);
|
||||
|
||||
// Required for SpriteKit
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (IntPtr, Matrix2)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData[] {
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
new ParameterData { TypeData = Types.Matrix2f },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (IntPtr, Matrix3)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData[] {
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
new ParameterData { TypeData = Types.Matrix3f },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (IntPtr, Matrix4)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData[] {
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
new ParameterData { TypeData = Types.Matrix4f },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (IntPtr, Vector3)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData[] {
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
new ParameterData { TypeData = Types.Vector3 },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (IntPtr, Vector4)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData[] {
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
new ParameterData { TypeData = Types.Vector4 },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (Vector4)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData[] {
|
||||
new ParameterData { TypeData = Types.Vector4 },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (nint, nint, Vector2, Vector2)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData[] {
|
||||
new ParameterData { TypeData = Types.NInt },
|
||||
new ParameterData { TypeData = Types.NInt },
|
||||
new ParameterData { TypeData = Types.Vector2 },
|
||||
new ParameterData { TypeData = Types.Vector2 },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // Matrix2 func ()",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.All,
|
||||
ReturnType = Types.Matrix2f,
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // Matrix3 func ()",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.All,
|
||||
ReturnType = Types.Matrix3f,
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // Vector2 func (nint)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.All,
|
||||
ReturnType = Types.Vector2,
|
||||
Parameters = new ParameterData[] {
|
||||
new ParameterData { TypeData = Types.NInt },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // void func (Matrix2)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
Parameters = new ParameterData[] {
|
||||
new ParameterData { TypeData = Types.Matrix2f },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // void func (Matrix3)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
Parameters = new ParameterData[] {
|
||||
new ParameterData { TypeData = Types.Matrix3f },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
// Required for ModelIO
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (Vector3, Vector2i, bool, IntPtr, IntPtr)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData[] {
|
||||
new ParameterData { TypeData = Types.Vector3 },
|
||||
new ParameterData { TypeData = Types.Vector2i },
|
||||
new ParameterData { TypeData = Types.Bool },
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (Matrix4, bool);",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData[] {
|
||||
new ParameterData { TypeData = Types.Matrix4f },
|
||||
new ParameterData { TypeData = Types.Bool },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (Vector3, Vector2i, bool, nint, IntPtr)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData[] {
|
||||
new ParameterData { TypeData = Types.Vector3 },
|
||||
new ParameterData { TypeData = Types.Vector2i },
|
||||
new ParameterData { TypeData = Types.Bool },
|
||||
new ParameterData { TypeData = Types.NInt },
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (IntPtr, nint, UInt32, IntPtr)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData[] {
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
new ParameterData { TypeData = Types.NInt },
|
||||
new ParameterData { TypeData = Types.UInt32 },
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (Vector3, Vector2i, bool, bool, nint, IntPtr)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData[] {
|
||||
new ParameterData { TypeData = Types.Vector3 },
|
||||
new ParameterData { TypeData = Types.Vector2i },
|
||||
new ParameterData { TypeData = Types.Bool },
|
||||
new ParameterData { TypeData = Types.Bool },
|
||||
new ParameterData { TypeData = Types.NInt },
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (Vector3, Vector2i, int, bool, nint, IntPtr)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData[] {
|
||||
new ParameterData { TypeData = Types.Vector3 },
|
||||
new ParameterData { TypeData = Types.Vector2i },
|
||||
new ParameterData { TypeData = Types.Int32 },
|
||||
new ParameterData { TypeData = Types.Bool },
|
||||
new ParameterData { TypeData = Types.NInt },
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (IntPtr, Vector2d, Vector2d, Vector2i, bool)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData [] {
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
new ParameterData { TypeData = Types.Vector2d },
|
||||
new ParameterData { TypeData = Types.Vector2d },
|
||||
new ParameterData { TypeData = Types.Vector2i },
|
||||
new ParameterData { TypeData = Types.Bool },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (Vector2i, int, int, bool, IntPtr)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData [] {
|
||||
new ParameterData { TypeData = Types.Vector2i },
|
||||
new ParameterData { TypeData = Types.Int32 },
|
||||
new ParameterData { TypeData = Types.Int32 },
|
||||
new ParameterData { TypeData = Types.Bool },
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (float, Vector2, Vector2)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData [] {
|
||||
new ParameterData { TypeData = Types.Float },
|
||||
new ParameterData { TypeData = Types.Vector2 },
|
||||
new ParameterData { TypeData = Types.Vector2 },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (float, Vector2, Vector2, IntPtr)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData [] {
|
||||
new ParameterData { TypeData = Types.Float },
|
||||
new ParameterData { TypeData = Types.Vector2 },
|
||||
new ParameterData { TypeData = Types.Vector2 },
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // Vector2d func ()",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.All,
|
||||
ReturnType = Types.Vector2d
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // Vector3 func (nuint)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.All,
|
||||
ReturnType = Types.Vector3,
|
||||
Parameters = new ParameterData [] {
|
||||
new ParameterData { TypeData = Types.NUInt },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // float func (Vector2)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.Float,
|
||||
Parameters = new ParameterData [] {
|
||||
new ParameterData { TypeData = Types.Vector2 },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // float func (Vector2i)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.Float,
|
||||
Parameters = new ParameterData [] {
|
||||
new ParameterData { TypeData = Types.Vector2i },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // void func (IntPtr, Vector2, Vector2, Int64)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
Parameters = new ParameterData [] {
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
new ParameterData { TypeData = Types.Vector2 },
|
||||
new ParameterData { TypeData = Types.Vector2 },
|
||||
new ParameterData { TypeData = Types.Int64 },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // void func (IntPtr, Vector2, Vector2, Int)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
Parameters = new ParameterData [] {
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
new ParameterData { TypeData = Types.Vector2 },
|
||||
new ParameterData { TypeData = Types.Vector2 },
|
||||
new ParameterData { TypeData = Types.Int32 },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // void func (IntPtr, Vector2, Vector2)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
Parameters = new ParameterData [] {
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
new ParameterData { TypeData = Types.Vector2 },
|
||||
new ParameterData { TypeData = Types.Vector2 },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // void func (Vector3d)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
Parameters = new ParameterData [] {
|
||||
new ParameterData { TypeData = Types.Vector3d },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // void func (float, Vector2i)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
Parameters = new ParameterData [] {
|
||||
new ParameterData { TypeData = Types.Float },
|
||||
new ParameterData { TypeData = Types.Vector2i },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // GKBox func ()",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.All,
|
||||
ReturnType = Types.GKBox
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (GKBox)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData [] {
|
||||
new ParameterData { TypeData = Types.GKBox },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (GKBox, float)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData [] {
|
||||
new ParameterData { TypeData = Types.GKBox },
|
||||
new ParameterData { TypeData = Types.Float },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (IntPtr, GKBox)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData [] {
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
new ParameterData { TypeData = Types.GKBox },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // GKQuad func ()",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.All,
|
||||
ReturnType = Types.GKQuad
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (GKQuad)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData [] {
|
||||
new ParameterData { TypeData = Types.GKQuad },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (GKQuad, float)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData [] {
|
||||
new ParameterData { TypeData = Types.GKQuad },
|
||||
new ParameterData { TypeData = Types.Float },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // IntPtr func (IntPtr, GKQuad)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.NonStret,
|
||||
ReturnType = Types.IntPtr,
|
||||
Parameters = new ParameterData [] {
|
||||
new ParameterData { TypeData = Types.IntPtr },
|
||||
new ParameterData { TypeData = Types.GKQuad },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
data.Add (
|
||||
new FunctionData {
|
||||
Comment = " // GKTriangle func (nuint)",
|
||||
Prefix = "simd__",
|
||||
Variants = Variants.All,
|
||||
ReturnType = Types.GKTriangle,
|
||||
Parameters = new ParameterData [] {
|
||||
new ParameterData { TypeData = Types.NUInt },
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
// We must expand functions with native types to their actual type as well.
|
||||
for (int i = data.Count - 1; i >= 0; i--) {
|
||||
if (!data [i].HasNativeType)
|
||||
|
@ -1263,17 +1779,20 @@ namespace Xamarin.BindingMethods.Generator
|
|||
static void MarshalToManaged (StringWriter writer, TypeData type, string nativeVariable, string managedVariable)
|
||||
{
|
||||
switch (type.ManagedType) {
|
||||
case "Vector2d":
|
||||
case "Vector2i":
|
||||
case "Vector2":
|
||||
writer.WriteLine ("\t{0}.a = {1} [0];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t{0}.b = {1} [1];", managedVariable, nativeVariable);
|
||||
break;
|
||||
case "Vector3d":
|
||||
case "Vector3i":
|
||||
case "Vector3":
|
||||
writer.WriteLine ("\t{0}.a = {1} [0];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t{0}.b = {1} [1];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t{0}.c = {1} [2];", managedVariable, nativeVariable);
|
||||
break;
|
||||
case "Vector4d":
|
||||
case "Vector4i":
|
||||
case "Vector4":
|
||||
if (type.NativeType == "vector_float3") {
|
||||
|
@ -1281,7 +1800,7 @@ namespace Xamarin.BindingMethods.Generator
|
|||
writer.WriteLine ("\t{0}.b = {1} [1];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t{0}.c = {1} [2];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t{0}.d = 0;", managedVariable);
|
||||
} else if (type.NativeType == "vector_float4" || type.NativeType == "vector_int4") {
|
||||
} else if (type.NativeType == "vector_float4" || type.NativeType == "vector_int4" || type.NativeType == "vector_double4") {
|
||||
writer.WriteLine ("\t{0}.a = {1} [0];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t{0}.b = {1} [1];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t{0}.c = {1} [2];", managedVariable, nativeVariable);
|
||||
|
@ -1290,6 +1809,19 @@ namespace Xamarin.BindingMethods.Generator
|
|||
goto default;
|
||||
}
|
||||
break;
|
||||
case "Matrix2":
|
||||
writer.WriteLine ("\tfor (int i = 0; i < 2; i++) {");
|
||||
writer.WriteLine ("\t\t{0}.columns [i].a = {1}.columns [i] [0];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t\t{0}.columns [i].b = {1}.columns [i] [1];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t}");
|
||||
break;
|
||||
case "Matrix3":
|
||||
writer.WriteLine ("\tfor (int i = 0; i < 3; i++) {");
|
||||
writer.WriteLine ("\t\t{0}.columns [i].a = {1}.columns [i] [0];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t\t{0}.columns [i].b = {1}.columns [i] [1];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t\t{0}.columns [i].c = {1}.columns [i] [2];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t}");
|
||||
break;
|
||||
case "Matrix4":
|
||||
writer.WriteLine ("\tfor (int i = 0; i < 4; i++) {");
|
||||
writer.WriteLine ("\t\t{0}.columns [i].a = {1}.columns [i] [0];", managedVariable, nativeVariable);
|
||||
|
@ -1306,6 +1838,27 @@ namespace Xamarin.BindingMethods.Generator
|
|||
writer.WriteLine ("\t{0}.minBounds.b = {1}.minBounds [1];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t{0}.minBounds.c = {1}.minBounds [2];", managedVariable, nativeVariable);
|
||||
break;
|
||||
case "GKBox":
|
||||
writer.WriteLine ("\t{0}.maxBounds.a = {1}.maxBounds [0];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t{0}.maxBounds.b = {1}.maxBounds [1];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t{0}.maxBounds.c = {1}.maxBounds [2];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t{0}.minBounds.a = {1}.minBounds [0];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t{0}.minBounds.b = {1}.minBounds [1];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t{0}.minBounds.c = {1}.minBounds [2];", managedVariable, nativeVariable);
|
||||
break;
|
||||
case "GKQuad":
|
||||
writer.WriteLine ("\t{0}.maxBounds.a = {1}.maxBounds [0];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t{0}.maxBounds.b = {1}.maxBounds [1];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t{0}.minBounds.a = {1}.minBounds [0];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t{0}.minBounds.b = {1}.minBounds [1];", managedVariable, nativeVariable);
|
||||
break;
|
||||
case "GKTriangle":
|
||||
writer.WriteLine ("\tfor (int i = 0; i < 3; i++) {");
|
||||
writer.WriteLine ("\t\t{0}.points [i].a = {1}.points [i] [0];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t\t{0}.points [i].b = {1}.points [i] [1];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t\t{0}.points [i].c = {1}.points [i] [2];", managedVariable, nativeVariable);
|
||||
writer.WriteLine ("\t}");
|
||||
break;
|
||||
default:
|
||||
throw new NotImplementedException (string.Format ("MarshalToManaged for: NativeType: {0} ManagedType: {1}", type.NativeType, type.ManagedType));
|
||||
}
|
||||
|
@ -1314,24 +1867,27 @@ namespace Xamarin.BindingMethods.Generator
|
|||
static void MarshalToNative (StringWriter writer, TypeData type, string nativeVariable, string managedVariable)
|
||||
{
|
||||
switch (type.ManagedType) {
|
||||
case "Vector2d":
|
||||
case "Vector2i":
|
||||
case "Vector2":
|
||||
writer.WriteLine ("\t{0} [0] = {1}.a;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t{0} [1] = {1}.b;", nativeVariable, managedVariable);
|
||||
break;
|
||||
case "Vector3d":
|
||||
case "Vector3i":
|
||||
case "Vector3":
|
||||
writer.WriteLine ("\t{0} [0] = {1}.a;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t{0} [1] = {1}.b;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t{0} [2] = {1}.c;", nativeVariable, managedVariable);
|
||||
break;
|
||||
case "Vector4d":
|
||||
case "Vector4i":
|
||||
case "Vector4":
|
||||
if (type.NativeType == "vector_float3") {
|
||||
writer.WriteLine ("\t{0} [0] = {1}.a;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t{0} [1] = {1}.b;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t{0} [2] = {1}.c;", nativeVariable, managedVariable);
|
||||
} else if (type.NativeType == "vector_float4" || type.NativeType == "vector_int4") {
|
||||
} else if (type.NativeType == "vector_float4" || type.NativeType == "vector_int4" || type.NativeType == "vector_double4") {
|
||||
writer.WriteLine ("\t{0} [0] = {1}.a;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t{0} [1] = {1}.b;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t{0} [2] = {1}.c;", nativeVariable, managedVariable);
|
||||
|
@ -1340,6 +1896,19 @@ namespace Xamarin.BindingMethods.Generator
|
|||
goto default;
|
||||
}
|
||||
break;
|
||||
case "Matrix2":
|
||||
writer.WriteLine ("\tfor (int i = 0; i < 2; i++) {");
|
||||
writer.WriteLine ("\t\t{0}.columns [i][0] = {1}.columns [i].a;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t\t{0}.columns [i][1] = {1}.columns [i].b;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t}");
|
||||
break;
|
||||
case "Matrix3":
|
||||
writer.WriteLine ("\tfor (int i = 0; i < 3; i++) {");
|
||||
writer.WriteLine ("\t\t{0}.columns [i][0] = {1}.columns [i].a;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t\t{0}.columns [i][1] = {1}.columns [i].b;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t\t{0}.columns [i][2] = {1}.columns [i].c;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t}");
|
||||
break;
|
||||
case "Matrix4":
|
||||
writer.WriteLine ("\tfor (int i = 0; i < 4; i++) {");
|
||||
writer.WriteLine ("\t\t{0}.columns [i][0] = {1}.columns [i].a;", nativeVariable, managedVariable);
|
||||
|
@ -1356,6 +1925,27 @@ namespace Xamarin.BindingMethods.Generator
|
|||
writer.WriteLine ("\t{0}.minBounds [1] = {1}.minBounds.b;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t{0}.minBounds [2] = {1}.minBounds.c;", nativeVariable, managedVariable);
|
||||
break;
|
||||
case "GKBox":
|
||||
writer.WriteLine ("\t{0}.maxBounds [0] = {1}.maxBounds.a;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t{0}.maxBounds [1] = {1}.maxBounds.b;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t{0}.maxBounds [2] = {1}.maxBounds.c;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t{0}.minBounds [0] = {1}.minBounds.a;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t{0}.minBounds [1] = {1}.minBounds.b;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t{0}.minBounds [2] = {1}.minBounds.c;", nativeVariable, managedVariable);
|
||||
break;
|
||||
case "GKQuad":
|
||||
writer.WriteLine ("\t{0}.maxBounds [0] = {1}.maxBounds.a;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t{0}.maxBounds [1] = {1}.maxBounds.b;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t{0}.minBounds [0] = {1}.minBounds.a;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t{0}.minBounds [1] = {1}.minBounds.b;", nativeVariable, managedVariable);
|
||||
break;
|
||||
case "GKTriangle":
|
||||
writer.WriteLine ("\tfor (int i = 0; i < 3; i++) {");
|
||||
writer.WriteLine ("\t\t{0}.points [i][0] = {1}.points [i].a;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t\t{0}.points [i][1] = {1}.points [i].b;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t\t{0}.points [i][2] = {1}.points [i].c;", nativeVariable, managedVariable);
|
||||
writer.WriteLine ("\t}");
|
||||
break;
|
||||
default:
|
||||
throw new NotImplementedException (string.Format ("MarshalToNative for: NativeType: {0} ManagedType: {1}", type.NativeType, type.ManagedType));
|
||||
}
|
||||
|
@ -1775,6 +2365,42 @@ namespace Xamarin.BindingMethods.Generator
|
|||
NativeWrapperType = "struct Vector4i",
|
||||
RequireMarshal = true,
|
||||
};
|
||||
public static TypeData Vector2d = new TypeData {
|
||||
ManagedType = "Vector2d",
|
||||
NativeType = "vector_double2",
|
||||
NativeWrapperType = "struct Vector2d",
|
||||
RequireMarshal = true
|
||||
};
|
||||
public static TypeData Vector3d = new TypeData {
|
||||
ManagedType = "Vector3d",
|
||||
NativeType = "vector_double3",
|
||||
NativeWrapperType = "struct Vector3d",
|
||||
RequireMarshal = true,
|
||||
};
|
||||
public static TypeData Vector4d = new TypeData {
|
||||
ManagedType = "Vector4d",
|
||||
NativeType = "vector_double4",
|
||||
NativeWrapperType = "struct Vector4d",
|
||||
RequireMarshal = true,
|
||||
};
|
||||
public static TypeData Matrix2f = new TypeData {
|
||||
ManagedType = "Matrix2",
|
||||
NativeType = "matrix_float2x2",
|
||||
NativeWrapperType = "struct Matrix2f",
|
||||
RequireMarshal = true,
|
||||
IsARMStret = true,
|
||||
IsX86Stret = true,
|
||||
IsX64Stret = false,
|
||||
};
|
||||
public static TypeData Matrix3f = new TypeData {
|
||||
ManagedType = "Matrix3",
|
||||
NativeType = "matrix_float3x3",
|
||||
NativeWrapperType = "struct Matrix3f",
|
||||
RequireMarshal = true,
|
||||
IsARMStret = true,
|
||||
IsX86Stret = true,
|
||||
IsX64Stret = true,
|
||||
};
|
||||
public static TypeData Matrix4f = new TypeData {
|
||||
ManagedType = "Matrix4",
|
||||
NativeType = "matrix_float4x4",
|
||||
|
@ -1860,6 +2486,36 @@ namespace Xamarin.BindingMethods.Generator
|
|||
IsX64Stret = true,
|
||||
IsARMStret = true,
|
||||
};
|
||||
|
||||
public static TypeData GKBox = new TypeData {
|
||||
ManagedType = "GKBox",
|
||||
NativeType = "GKBox",
|
||||
NativeWrapperType = "struct GKBoxWrapper",
|
||||
RequireMarshal = true,
|
||||
IsX86Stret = true,
|
||||
IsX64Stret = true,
|
||||
IsARMStret = true,
|
||||
};
|
||||
|
||||
public static TypeData GKQuad = new TypeData {
|
||||
ManagedType = "GKQuad",
|
||||
NativeType = "GKQuad",
|
||||
NativeWrapperType = "struct GKQuadWrapper",
|
||||
RequireMarshal = true,
|
||||
IsARMStret = true,
|
||||
IsX86Stret = true,
|
||||
IsX64Stret = false,
|
||||
};
|
||||
|
||||
public static TypeData GKTriangle = new TypeData {
|
||||
ManagedType = "GKTriangle",
|
||||
NativeType = "GKTriangle",
|
||||
NativeWrapperType = "struct GKTriangleWrapper",
|
||||
RequireMarshal = true,
|
||||
IsARMStret = true,
|
||||
IsX86Stret = true,
|
||||
IsX64Stret = true,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -71,10 +71,16 @@ typedef __attribute__((__ext_vector_type__(2))) int vector_int2;
|
|||
typedef __attribute__((__ext_vector_type__(3))) int vector_int3;
|
||||
typedef __attribute__((__ext_vector_type__(4))) int vector_int4;
|
||||
|
||||
typedef __attribute__((__ext_vector_type__(2))) double vector_double2;
|
||||
typedef __attribute__((__ext_vector_type__(3))) double vector_double3;
|
||||
typedef __attribute__((__ext_vector_type__(4))) double vector_double4;
|
||||
|
||||
typedef __attribute__((__ext_vector_type__(2))) float vector_float2;
|
||||
typedef __attribute__((__ext_vector_type__(3))) float vector_float3;
|
||||
typedef __attribute__((__ext_vector_type__(4))) float vector_float4;
|
||||
|
||||
typedef struct { vector_float2 columns[2]; } matrix_float2x2;
|
||||
typedef struct { vector_float3 columns[3]; } matrix_float3x3;
|
||||
typedef struct { vector_float4 columns[4]; } matrix_float4x4;
|
||||
|
||||
typedef struct {
|
||||
|
@ -82,6 +88,20 @@ typedef struct {
|
|||
vector_float3 minBounds;
|
||||
} MDLAxisAlignedBoundingBox;
|
||||
|
||||
typedef struct {
|
||||
vector_float3 maxBounds;
|
||||
vector_float3 minBounds;
|
||||
} GKBox;
|
||||
|
||||
typedef struct {
|
||||
vector_float2 maxBounds;
|
||||
vector_float2 minBounds;
|
||||
} GKQuad;
|
||||
|
||||
typedef struct {
|
||||
vector_float3 points[3];
|
||||
} GKTriangle;
|
||||
|
||||
/*
|
||||
* iOS has a vector type (vector_float3) which can't be expressed
|
||||
* in P/Invoke signatures, so we need custom wrappers.
|
||||
|
@ -107,6 +127,24 @@ struct Vector4i {
|
|||
int a, b, c, d;
|
||||
};
|
||||
|
||||
struct Vector4d {
|
||||
double a, b, c, d;
|
||||
};
|
||||
struct Vector3d {
|
||||
double a, b, c;
|
||||
};
|
||||
struct Vector2d {
|
||||
double a, b;
|
||||
};
|
||||
|
||||
struct Matrix2f {
|
||||
Vector2f columns [2];
|
||||
};
|
||||
|
||||
struct Matrix3f {
|
||||
Vector3f columns [3];
|
||||
};
|
||||
|
||||
struct Matrix4f {
|
||||
Vector4f columns [4];
|
||||
};
|
||||
|
@ -116,6 +154,19 @@ struct MDLAxisAlignedBoundingBoxWrapper {
|
|||
Vector3f minBounds;
|
||||
};
|
||||
|
||||
struct GKBoxWrapper {
|
||||
Vector3f maxBounds;
|
||||
Vector3f minBounds;
|
||||
};
|
||||
|
||||
struct GKQuadWrapper {
|
||||
Vector2f maxBounds;
|
||||
Vector2f minBounds;
|
||||
};
|
||||
|
||||
struct GKTriangleWrapper {
|
||||
Vector3f points [3];
|
||||
};
|
||||
|
||||
struct Vector4f xamarin_vector_float3__Vector4_objc_msgSend (id self, SEL sel);
|
||||
void xamarin_vector_float3__Vector4_objc_msgSend_stret (struct Vector4f *v4, id self, SEL sel);
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
#include "xamarin/main.h"
|
||||
#include "xamarin/mono-runtime.h"
|
||||
#include "xamarin/runtime.h"
|
||||
#include "product.h"
|
||||
#include "runtime-internal.h"
|
||||
|
||||
<# foreach (var export in exports) { #>
|
||||
typedef <#= export.ReturnType #> (* <#= export.EntryPoint #>_def) (<#= export.ArgumentSignature #>);
|
||||
|
@ -97,7 +99,7 @@ xamarin_initialize_dynamic_runtime (const char *mono_runtime_prefix)
|
|||
if (libmono == NULL) {
|
||||
const char *dlopen_err = dlerror ();
|
||||
if (dlopen_err != NULL)
|
||||
NSLog (@": dlopen error: %s", dlopen_err);
|
||||
PRINT (PRODUCT ": dlopen error: %s", dlopen_err);
|
||||
return "This application requires the Mono framework.";
|
||||
}
|
||||
|
||||
|
|
|
@ -677,7 +677,7 @@ void sdb_connect (const char *address)
|
|||
MONO_EXIT_GC_UNSAFE;
|
||||
|
||||
if (!shaked)
|
||||
NSLog (@PRODUCT ": Handshake error with IDE.");
|
||||
PRINT (PRODUCT ": Handshake error with IDE.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -831,7 +831,7 @@ int monotouch_connect_wifi (NSMutableArray *ips)
|
|||
long flags;
|
||||
|
||||
if (ip_count == 0) {
|
||||
NSLog (@PRODUCT ": No IPs to connect to.");
|
||||
PRINT (PRODUCT ": No IPs to connect to.");
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
@ -863,13 +863,13 @@ int monotouch_connect_wifi (NSMutableArray *ips)
|
|||
sin6->sin6_port = htons (listen_port);
|
||||
family_str = "IPv6";
|
||||
} else {
|
||||
NSLog (@PRODUCT ": Error parsing '%s': %s", ip, errno ? strerror (errno) : "unsupported address type");
|
||||
PRINT (PRODUCT ": Error parsing '%s': %s", ip, errno ? strerror (errno) : "unsupported address type");
|
||||
sockets[i] = -1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((sockets[i] = socket (family, SOCK_STREAM, IPPROTO_TCP)) == -1) {
|
||||
NSLog (@PRODUCT ": Failed to create %s socket: %s", family_str, strerror (errno));
|
||||
PRINT (PRODUCT ": Failed to create %s socket: %s", family_str, strerror (errno));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -885,7 +885,7 @@ int monotouch_connect_wifi (NSMutableArray *ips)
|
|||
}
|
||||
|
||||
if (rv < 0 && errno != EINPROGRESS) {
|
||||
NSLog (@PRODUCT ": Failed to connect to %s on port %d: %s", ip, listen_port, strerror (errno));
|
||||
PRINT (PRODUCT ": Failed to connect to %s on port %d: %s", ip, listen_port, strerror (errno));
|
||||
close (sockets[i]);
|
||||
sockets[i] = -1;
|
||||
continue;
|
||||
|
@ -931,7 +931,7 @@ int monotouch_connect_wifi (NSMutableArray *ips)
|
|||
continue;
|
||||
|
||||
// irrecoverable error
|
||||
NSLog (@PRODUCT ": Error while waiting for connections: %s", strerror (errno));
|
||||
PRINT (PRODUCT ": Error while waiting for connections: %s", strerror (errno));
|
||||
free (sockets);
|
||||
return 1;
|
||||
}
|
||||
|
@ -955,7 +955,7 @@ int monotouch_connect_wifi (NSMutableArray *ips)
|
|||
|
||||
// okay, this socket is ready for reading or writing...
|
||||
if (getsockopt (sockets[i], SOL_SOCKET, SO_ERROR, &error, &optlen) < 0) {
|
||||
NSLog (@PRODUCT ": Error while trying to get socket options for %s: %s", [[ips objectAtIndex:i] UTF8String], strerror (errno));
|
||||
PRINT (PRODUCT ": Error while trying to get socket options for %s: %s", [[ips objectAtIndex:i] UTF8String], strerror (errno));
|
||||
close (sockets[i]);
|
||||
sockets[i] = -1;
|
||||
waiting--;
|
||||
|
@ -963,7 +963,7 @@ int monotouch_connect_wifi (NSMutableArray *ips)
|
|||
}
|
||||
|
||||
if (error != 0) {
|
||||
NSLog (@PRODUCT ": Socket error while connecting to IDE on %s:%d: %s", [[ips objectAtIndex:i] UTF8String], listen_port, strerror (error));
|
||||
PRINT (PRODUCT ": Socket error while connecting to IDE on %s:%d: %s", [[ips objectAtIndex:i] UTF8String], listen_port, strerror (error));
|
||||
close (sockets[i]);
|
||||
sockets[i] = -1;
|
||||
waiting--;
|
||||
|
@ -1018,13 +1018,13 @@ int monotouch_connect_usb ()
|
|||
// Create the listen socket and set it up
|
||||
listen_socket = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (listen_socket == -1) {
|
||||
NSLog (@PRODUCT ": Could not create socket for the IDE to connect to: %s", strerror (errno));
|
||||
PRINT (PRODUCT ": Could not create socket for the IDE to connect to: %s", strerror (errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
flags = 1;
|
||||
if (setsockopt (listen_socket, SOL_SOCKET, SO_REUSEADDR, &flags, sizeof (flags)) == -1) {
|
||||
NSLog (@PRODUCT ": Could not set SO_REUSEADDR on the listening socket (%s)", strerror (errno));
|
||||
PRINT (PRODUCT ": Could not set SO_REUSEADDR on the listening socket (%s)", strerror (errno));
|
||||
// not a fatal failure
|
||||
}
|
||||
|
||||
|
@ -1035,7 +1035,7 @@ int monotouch_connect_usb ()
|
|||
listen_addr.sin_addr.s_addr = INADDR_ANY;
|
||||
rv = bind (listen_socket, (struct sockaddr *) &listen_addr, sizeof (listen_addr));
|
||||
if (rv == -1) {
|
||||
NSLog (@PRODUCT ": Could not bind to address: %s", strerror (errno));
|
||||
PRINT (PRODUCT ": Could not bind to address: %s", strerror (errno));
|
||||
rv = 2;
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -1047,7 +1047,7 @@ int monotouch_connect_usb ()
|
|||
|
||||
rv = listen (listen_socket, 1);
|
||||
if (rv == -1) {
|
||||
NSLog (@PRODUCT ": Could not listen for the IDE: %s", strerror (errno));
|
||||
PRINT (PRODUCT ": Could not listen for the IDE: %s", strerror (errno));
|
||||
rv = 2;
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -1090,7 +1090,7 @@ int monotouch_connect_usb ()
|
|||
} while (rv == -1 && errno == EINTR);
|
||||
|
||||
if (rv == -1) {
|
||||
NSLog (@PRODUCT ": Failed while waiting for the IDE to connect: %s", strerror (errno));
|
||||
PRINT (PRODUCT ": Failed while waiting for the IDE to connect: %s", strerror (errno));
|
||||
rv = 2;
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -1098,14 +1098,14 @@ int monotouch_connect_usb ()
|
|||
len = sizeof (struct sockaddr_in);
|
||||
fd = accept (listen_socket, (struct sockaddr *) &listen_addr, &len);
|
||||
if (fd == -1) {
|
||||
NSLog (@PRODUCT ": Failed to accept connection from the IDE: %s", strerror (errno));
|
||||
PRINT (PRODUCT ": Failed to accept connection from the IDE: %s", strerror (errno));
|
||||
rv = 3;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
flags = 1;
|
||||
if (setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, (char *) &flags, sizeof (flags)) < 0) {
|
||||
NSLog (@PRODUCT ": Could not set TCP_NODELAY on socket (%s)", strerror (errno));
|
||||
PRINT (PRODUCT ": Could not set TCP_NODELAY on socket (%s)", strerror (errno));
|
||||
// not a fatal failure
|
||||
}
|
||||
|
||||
|
@ -1338,12 +1338,12 @@ int monotouch_debug_listen (int debug_port, int output_port)
|
|||
// Create the listen socket and set it up
|
||||
listen_socket = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (listen_socket == -1) {
|
||||
NSLog (@PRODUCT ": Could not create socket for the IDE to connect to: %s", strerror (errno));
|
||||
PRINT (PRODUCT ": Could not create socket for the IDE to connect to: %s", strerror (errno));
|
||||
return 1;
|
||||
} else {
|
||||
flag = 1;
|
||||
if (setsockopt (listen_socket, SOL_SOCKET, SO_REUSEADDR, &flag, sizeof (flag)) == -1) {
|
||||
NSLog (@PRODUCT ": Could not set SO_REUSEADDR on the listening socket (%s)", strerror (errno));
|
||||
PRINT (PRODUCT ": Could not set SO_REUSEADDR on the listening socket (%s)", strerror (errno));
|
||||
// not a fatal failure
|
||||
}
|
||||
|
||||
|
@ -1353,7 +1353,7 @@ int monotouch_debug_listen (int debug_port, int output_port)
|
|||
listen_addr.sin_addr.s_addr = INADDR_ANY;
|
||||
rv = bind (listen_socket, (struct sockaddr *) &listen_addr, sizeof (listen_addr));
|
||||
if (rv == -1) {
|
||||
NSLog (@PRODUCT ": Could not bind to address: %s", strerror (errno));
|
||||
PRINT (PRODUCT ": Could not bind to address: %s", strerror (errno));
|
||||
close (listen_socket);
|
||||
return 2;
|
||||
} else {
|
||||
|
@ -1364,7 +1364,7 @@ int monotouch_debug_listen (int debug_port, int output_port)
|
|||
|
||||
rv = listen (listen_socket, 1);
|
||||
if (rv == -1) {
|
||||
NSLog (@PRODUCT ": Could not listen for the IDE: %s", strerror (errno));
|
||||
PRINT (PRODUCT ": Could not listen for the IDE: %s", strerror (errno));
|
||||
close (listen_socket);
|
||||
return 2;
|
||||
} else {
|
||||
|
@ -1382,14 +1382,14 @@ int monotouch_debug_listen (int debug_port, int output_port)
|
|||
do {
|
||||
if ((rv = select (listen_socket + 1, &rset, NULL, NULL, &tv)) == 0) {
|
||||
// timeout hit, no connections available.
|
||||
NSLog (@PRODUCT ": Listened for connections from the IDE for 2 seconds, nobody connected.");
|
||||
PRINT (PRODUCT ": Listened for connections from the IDE for 2 seconds, nobody connected.");
|
||||
close (listen_socket);
|
||||
return 3;
|
||||
}
|
||||
} while (rv == -1 && errno == EINTR);
|
||||
|
||||
if (rv == -1) {
|
||||
NSLog (@PRODUCT ": Failed while waiting for the IDE to connect: %s", strerror (errno));
|
||||
PRINT (PRODUCT ": Failed while waiting for the IDE to connect: %s", strerror (errno));
|
||||
close (listen_socket);
|
||||
return 2;
|
||||
}
|
||||
|
@ -1397,14 +1397,14 @@ int monotouch_debug_listen (int debug_port, int output_port)
|
|||
len = sizeof (struct sockaddr_in);
|
||||
output_socket = accept (listen_socket, (struct sockaddr *) &listen_addr, &len);
|
||||
if (output_socket == -1) {
|
||||
NSLog (@PRODUCT ": Failed to accept connection from the IDE: %s", strerror (errno));
|
||||
PRINT (PRODUCT ": Failed to accept connection from the IDE: %s", strerror (errno));
|
||||
close (listen_socket);
|
||||
return 3;
|
||||
}
|
||||
|
||||
flag = 1;
|
||||
if (setsockopt (output_socket, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof (flag)) < 0) {
|
||||
NSLog (@PRODUCT ": Could not set TCP_NODELAY on socket (%s)", strerror (errno));
|
||||
PRINT (PRODUCT ": Could not set TCP_NODELAY on socket (%s)", strerror (errno));
|
||||
// not a fatal failure
|
||||
}
|
||||
|
||||
|
@ -1443,7 +1443,7 @@ int monotouch_debug_connect (NSMutableArray *ips, int debug_port, int output_por
|
|||
long flags;
|
||||
|
||||
if (ip_count == 0) {
|
||||
NSLog (@PRODUCT ": No IPs to connect to.");
|
||||
PRINT (PRODUCT ": No IPs to connect to.");
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
@ -1470,13 +1470,13 @@ int monotouch_debug_connect (NSMutableArray *ips, int debug_port, int output_por
|
|||
sin6->sin6_port = htons (output_port);
|
||||
family_str = "IPv6";
|
||||
} else {
|
||||
NSLog (@PRODUCT ": Error parsing '%s': %s", ip, errno ? strerror (errno) : "unsupported address type");
|
||||
PRINT (PRODUCT ": Error parsing '%s': %s", ip, errno ? strerror (errno) : "unsupported address type");
|
||||
sockets[i] = -1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((sockets[i] = socket (family, SOCK_STREAM, IPPROTO_TCP)) == -1) {
|
||||
NSLog (@PRODUCT ": Failed to create %s socket: %s", family_str, strerror (errno));
|
||||
PRINT (PRODUCT ": Failed to create %s socket: %s", family_str, strerror (errno));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1492,7 +1492,7 @@ int monotouch_debug_connect (NSMutableArray *ips, int debug_port, int output_por
|
|||
}
|
||||
|
||||
if (rv < 0 && errno != EINPROGRESS) {
|
||||
NSLog (@PRODUCT ": Failed to connect to %s on port %d: %s", ip, output_port, strerror (errno));
|
||||
PRINT (PRODUCT ": Failed to connect to %s on port %d: %s", ip, output_port, strerror (errno));
|
||||
close (sockets[i]);
|
||||
sockets[i] = -1;
|
||||
continue;
|
||||
|
@ -1538,7 +1538,7 @@ int monotouch_debug_connect (NSMutableArray *ips, int debug_port, int output_por
|
|||
continue;
|
||||
|
||||
// irrecoverable error
|
||||
NSLog (@PRODUCT ": Error while waiting for connections: %s", strerror (errno));
|
||||
PRINT (PRODUCT ": Error while waiting for connections: %s", strerror (errno));
|
||||
free (sockets);
|
||||
return 1;
|
||||
}
|
||||
|
@ -1562,7 +1562,7 @@ int monotouch_debug_connect (NSMutableArray *ips, int debug_port, int output_por
|
|||
|
||||
// okay, this socket is ready for reading or writing...
|
||||
if (getsockopt (sockets[i], SOL_SOCKET, SO_ERROR, &error, &optlen) < 0) {
|
||||
NSLog (@PRODUCT ": Error while trying to get socket options for %s: %s", [[ips objectAtIndex:i] UTF8String], strerror (errno));
|
||||
PRINT (PRODUCT ": Error while trying to get socket options for %s: %s", [[ips objectAtIndex:i] UTF8String], strerror (errno));
|
||||
close (sockets[i]);
|
||||
sockets[i] = -1;
|
||||
waiting--;
|
||||
|
@ -1570,7 +1570,7 @@ int monotouch_debug_connect (NSMutableArray *ips, int debug_port, int output_por
|
|||
}
|
||||
|
||||
if (error != 0) {
|
||||
NSLog (@PRODUCT ": Socket error while connecting to the IDE on %s:%d: %s", [[ips objectAtIndex:i] UTF8String], output_port, strerror (error));
|
||||
PRINT (PRODUCT ": Socket error while connecting to the IDE on %s:%d: %s", [[ips objectAtIndex:i] UTF8String], output_port, strerror (error));
|
||||
close (sockets[i]);
|
||||
sockets[i] = -1;
|
||||
waiting--;
|
||||
|
|
|
@ -160,7 +160,7 @@ void debug_launch_time_print (const char *msg)
|
|||
date = startDate;
|
||||
}
|
||||
|
||||
NSLog (@"%s: %llu us Total: %llu us", msg, unow - date, unow - startDate);
|
||||
PRINT ("%s: %llu us Total: %llu us", msg, unow - date, unow - startDate);
|
||||
|
||||
date = unow;
|
||||
}
|
||||
|
@ -349,7 +349,7 @@ xamarin_main (int argc, char *argv[], bool is_extension)
|
|||
if (value) {
|
||||
monotouch_set_monodevelop_port (strtol (value, NULL, 10));
|
||||
} else {
|
||||
NSLog (@"MonoTouch: --%s requires an argument.", name);
|
||||
PRINT ("MonoTouch: --%s requires an argument.", name);
|
||||
}
|
||||
} else if (!strcmp (name, "connection-mode")) {
|
||||
if (!value && argc > i + 1)
|
||||
|
@ -357,7 +357,7 @@ xamarin_main (int argc, char *argv[], bool is_extension)
|
|||
if (value) {
|
||||
monotouch_set_connection_mode (value);
|
||||
} else {
|
||||
NSLog (@"MonoTouch: --%s requires an argument.", name);
|
||||
PRINT ("MonoTouch: --%s requires an argument.", name);
|
||||
}
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
|
@ -368,7 +368,7 @@ xamarin_main (int argc, char *argv[], bool is_extension)
|
|||
if (value) {
|
||||
managed_argv [managed_argc++] = value;
|
||||
} else {
|
||||
NSLog (@"MonoTouch: --%s requires an argument.", name);
|
||||
PRINT ("MonoTouch: --%s requires an argument.", name);
|
||||
}
|
||||
} else if (!strcmp (name, "setenv")) {
|
||||
if (!value && argc > i + 1)
|
||||
|
@ -384,7 +384,7 @@ xamarin_main (int argc, char *argv[], bool is_extension)
|
|||
}
|
||||
free (k);
|
||||
} else {
|
||||
NSLog (@"MonoTouch: --%s requires an argument.", name);
|
||||
PRINT ("MonoTouch: --%s requires an argument.", name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,8 @@
|
|||
|
||||
#include "xamarin/xamarin.h"
|
||||
|
||||
#define LOG(...) do { if (xamarin_log_level > 0) NSLog (@ __VA_ARGS__); } while (0);
|
||||
#define PRINT(...) do { xamarin_printf (__VA_ARGS__); } while (0);
|
||||
#define LOG(...) do { if (xamarin_log_level > 0) xamarin_printf (__VA_ARGS__); } while (0);
|
||||
|
||||
// #define DEBUG_LAUNCH_TIME
|
||||
|
||||
|
|
|
@ -676,7 +676,7 @@ gc_register_toggleref (MonoObject *obj, id self, bool isCustomType)
|
|||
#ifdef DEBUG_TOGGLEREF
|
||||
id handle = xamarin_get_nsobject_handle (obj);
|
||||
|
||||
NSLog (@"**Registering object %p handle %p RC %d flags: %i",
|
||||
PRINT ("**Registering object %p handle %p RC %d flags: %i",
|
||||
obj,
|
||||
handle,
|
||||
(int) (handle ? [handle retainCount] : 0),
|
||||
|
@ -734,7 +734,7 @@ gc_toggleref_callback (MonoObject *object)
|
|||
} else {
|
||||
cn = object_getClassName (handle);
|
||||
}
|
||||
NSLog (@"\tinspecting %p handle:%p %s flags: %i RC %d -> %s\n", object, handle, cn, (int) flags, (int) (handle ? [handle retainCount] : 0), rv);
|
||||
PRINT ("\tinspecting %p handle:%p %s flags: %i RC %d -> %s\n", object, handle, cn, (int) flags, (int) (handle ? [handle retainCount] : 0), rv);
|
||||
#endif
|
||||
|
||||
return res;
|
||||
|
@ -811,7 +811,7 @@ xamarin_open_assembly (const char *name)
|
|||
if (xamarin_get_is_mkbundle ()) {
|
||||
assembly = mono_assembly_open (name, NULL);
|
||||
if (assembly == NULL) {
|
||||
NSLog (@ PRODUCT ": Could not find the required assembly '%s' in the app. This is usually fixed by cleaning and rebuilding your project; if that doesn't work, please file a bug report: http://bugzilla.xamarin.com", name);
|
||||
PRINT (PRODUCT ": Could not find the required assembly '%s' in the app. This is usually fixed by cleaning and rebuilding your project; if that doesn't work, please file a bug report: http://bugzilla.xamarin.com", name);
|
||||
exit (1);
|
||||
}
|
||||
return assembly;
|
||||
|
@ -840,19 +840,19 @@ xamarin_open_assembly (const char *name)
|
|||
if (assembly)
|
||||
return assembly;
|
||||
|
||||
NSLog (@ PRODUCT ": Could not find the assembly '%s' in the app nor as an already loaded assembly. This is usually fixed by cleaning and rebuilding your project; if that doesn't work, please file a bug report: http://bugzilla.xamarin.com", name);
|
||||
PRINT (PRODUCT ": Could not find the assembly '%s' in the app nor as an already loaded assembly. This is usually fixed by cleaning and rebuilding your project; if that doesn't work, please file a bug report: http://bugzilla.xamarin.com", name);
|
||||
exit (1);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!xamarin_file_exists (path)) {
|
||||
NSLog (@ PRODUCT ": Could not find the assembly '%s' in the app. This is usually fixed by cleaning and rebuilding your project; if that doesn't work, please file a bug report: http://bugzilla.xamarin.com", name);
|
||||
PRINT (PRODUCT ": Could not find the assembly '%s' in the app. This is usually fixed by cleaning and rebuilding your project; if that doesn't work, please file a bug report: http://bugzilla.xamarin.com", name);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
assembly = mono_assembly_open (path, NULL);
|
||||
if (assembly == NULL) {
|
||||
NSLog (@ PRODUCT ": Could not find the required assembly '%s' in the app. This is usually fixed by cleaning and rebuilding your project; if that doesn't work, please file a bug report: http://bugzilla.xamarin.com", name);
|
||||
PRINT (PRODUCT ": Could not find the required assembly '%s' in the app. This is usually fixed by cleaning and rebuilding your project; if that doesn't work, please file a bug report: http://bugzilla.xamarin.com", name);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
@ -889,7 +889,7 @@ is_class_finalization_aware (MonoClass *cls)
|
|||
if (nsobject_class)
|
||||
rv = cls == nsobject_class || mono_class_is_assignable_from (nsobject_class, cls);
|
||||
|
||||
//NSLog (@"IsClass %s.%s finalization aware: %i\n", mono_class_get_namespace (cls), mono_class_get_name (cls), rv);
|
||||
//PRINT ("IsClass %s.%s finalization aware: %i\n", mono_class_get_namespace (cls), mono_class_get_name (cls), rv);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -901,7 +901,7 @@ object_queued_for_finalization (MonoObject *object)
|
|||
|
||||
/* This is called with the GC lock held, so it can only use signal-safe code */
|
||||
struct Managed_NSObject *obj = (struct Managed_NSObject *) object;
|
||||
//NSLog (@"In finalization response for %s.%s %p (handle: %p class_handle: %p flags: %i)\n",
|
||||
//PRINT ("In finalization response for %s.%s %p (handle: %p class_handle: %p flags: %i)\n",
|
||||
obj->flags |= NSObjectFlagsInFinalizerQueue;
|
||||
}
|
||||
|
||||
|
@ -951,7 +951,7 @@ fetch_exception_property (MonoObject *obj, const char *name, bool is_virtual)
|
|||
|
||||
return (MonoObject *) mono_runtime_invoke (get, obj, NULL, &exc);
|
||||
} else {
|
||||
NSLog (@"Could not find the property System.Exception.%s", name);
|
||||
PRINT ("Could not find the property System.Exception.%s", name);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
@ -1038,7 +1038,7 @@ xamarin_process_managed_exception_gchandle (guint32 gchandle)
|
|||
void
|
||||
xamarin_unhandled_exception_handler (MonoObject *exc, gpointer user_data)
|
||||
{
|
||||
NSLog (@"%@", print_all_exceptions (exc));
|
||||
PRINT ("%@", print_all_exceptions (exc));
|
||||
|
||||
abort ();
|
||||
}
|
||||
|
@ -1050,7 +1050,7 @@ exception_handler (NSException *exc)
|
|||
LOG (PRODUCT ": Received unhandled ObjectiveC exception: %@ %@", [exc name], [exc reason]);
|
||||
|
||||
if (xamarin_is_gc_coop) {
|
||||
NSLog (@"Uncaught Objective-C exception: %@", exc);
|
||||
PRINT ("Uncaught Objective-C exception: %@", exc);
|
||||
assert (false); // Re-throwing the Objective-C exception will probably just end up with infinite recursion
|
||||
}
|
||||
|
||||
|
@ -1106,7 +1106,7 @@ static void
|
|||
log_callback (const char *log_domain, const char *log_level, const char *message, mono_bool fatal, void *user_data)
|
||||
{
|
||||
// COOP: Not accessing managed memory: any mode
|
||||
NSLog (@"%s: %s", log_level, message);
|
||||
PRINT ("%s: %s", log_level, message);
|
||||
|
||||
if (fatal)
|
||||
abort ();
|
||||
|
@ -1116,7 +1116,7 @@ static void
|
|||
print_callback (const char *string, mono_bool is_stdout)
|
||||
{
|
||||
// COOP: Not accessing managed memory: any mode
|
||||
NSLog (@"%s", string);
|
||||
PRINT ("%s", string);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1303,7 +1303,7 @@ xamarin_assertion_message (const char *msg, ...)
|
|||
va_start (args, msg);
|
||||
vasprintf (&formatted, msg, args);
|
||||
if (formatted) {
|
||||
NSLog (@ PRODUCT ": %s", formatted);
|
||||
PRINT ( PRODUCT ": %s", formatted);
|
||||
free (formatted);
|
||||
}
|
||||
va_end (args);
|
||||
|
@ -1583,7 +1583,7 @@ xamarin_create_gchandle (id self, void *managed_object, int flags, bool force_we
|
|||
assert ((gchandle & GCHANDLE_MASK) == 0); // Make sure we don't create too many gchandles...
|
||||
set_raw_gchandle (self, gchandle | flags);
|
||||
#if defined(DEBUG_REF_COUNTING)
|
||||
NSLog (@"\tGCHandle created for %p: %d (flags: %p) = %d %s\n", self, gchandle, GINT_TO_POINTER (flags), get_raw_gchandle (self), weak ? "weak" : "strong");
|
||||
PRINT ("\tGCHandle created for %p: %d (flags: %p) = %d %s\n", self, gchandle, GINT_TO_POINTER (flags), get_raw_gchandle (self), weak ? "weak" : "strong");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1607,7 +1607,7 @@ xamarin_switch_gchandle (id self, bool to_weak)
|
|||
if (to_weak == is_weak) {
|
||||
// we already have the GCHandle we need
|
||||
#if defined(DEBUG_REF_COUNTING)
|
||||
NSLog (@"Object %p already has a %s GCHandle = %d\n", self, to_weak ? "weak" : "strong", old_gchandle);
|
||||
PRINT ("Object %p already has a %s GCHandle = %d\n", self, to_weak ? "weak" : "strong", old_gchandle);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
@ -1621,7 +1621,7 @@ xamarin_switch_gchandle (id self, bool to_weak)
|
|||
// if we do, managed ctors end up being executed at a different moment,
|
||||
// which breaks implicit assumptions in people's code.)
|
||||
#if defined(DEBUG_REF_COUNTING)
|
||||
NSLog (@"Object %p has no managed object to create a %s GCHandle for\n", self, to_weak ? "weak" : "strong");
|
||||
PRINT ("Object %p has no managed object to create a %s GCHandle for\n", self, to_weak ? "weak" : "strong");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
@ -1663,7 +1663,7 @@ xamarin_switch_gchandle (id self, bool to_weak)
|
|||
MONO_THREAD_DETACH; // COOP: this will switch to GC_SAFE
|
||||
|
||||
#if defined(DEBUG_REF_COUNTING)
|
||||
NSLog (@"Switched object %p to %s GCHandle = %d\n", self, to_weak ? "weak" : "strong", new_gchandle);
|
||||
PRINT ("Switched object %p to %s GCHandle = %d\n", self, to_weak ? "weak" : "strong", new_gchandle);
|
||||
#endif
|
||||
|
||||
xamarin_process_managed_exception_gchandle (exception_gchandle);
|
||||
|
@ -1675,14 +1675,14 @@ xamarin_free_gchandle (id self, int gchandle)
|
|||
// COOP: no managed memory access, but calls mono function mono_gc_handle_free. Assuming that function can be called with any mode: this function can be called with any mode as well
|
||||
if (gchandle) {
|
||||
#if defined(DEBUG_REF_COUNTING)
|
||||
NSLog (@"\tGCHandle %i destroyed for object %p\n", gchandle, self);
|
||||
PRINT ("\tGCHandle %i destroyed for object %p\n", gchandle, self);
|
||||
#endif
|
||||
mono_gchandle_free (gchandle);
|
||||
|
||||
set_raw_gchandle (self, 0);
|
||||
} else {
|
||||
#if defined(DEBUG_REF_COUNTING)
|
||||
NSLog (@"\tNo GCHandle for the object %p\n", self);
|
||||
PRINT ("\tNo GCHandle for the object %p\n", self);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -1735,7 +1735,7 @@ xamarin_release_managed_ref (id self, MonoObject *managed_obj)
|
|||
guint32 exception_gchandle = 0;
|
||||
|
||||
#if defined(DEBUG_REF_COUNTING)
|
||||
NSLog (@"monotouch_release_managed_ref (%s Handle=%p) retainCount=%d; HasManagedRef=%i GCHandle=%i IsUserType=%i\n",
|
||||
PRINT ("monotouch_release_managed_ref (%s Handle=%p) retainCount=%d; HasManagedRef=%i GCHandle=%i IsUserType=%i\n",
|
||||
class_getName (object_getClass (self)), self, (int32_t) [self retainCount], user_type ? xamarin_has_managed_ref (self) : 666, user_type ? get_gchandle (self) : 666, user_type);
|
||||
#endif
|
||||
|
||||
|
@ -1772,7 +1772,7 @@ xamarin_create_managed_ref (id self, gpointer managed_object, bool retain)
|
|||
bool user_type = is_user_type (self);
|
||||
|
||||
#if defined(DEBUG_REF_COUNTING)
|
||||
NSLog (@"monotouch_create_managed_ref (%s Handle=%p) retainCount=%d; HasManagedRef=%i GCHandle=%i IsUserType=%i\n",
|
||||
PRINT ("monotouch_create_managed_ref (%s Handle=%p) retainCount=%d; HasManagedRef=%i GCHandle=%i IsUserType=%i\n",
|
||||
class_getName ([self class]), self, get_safe_retainCount (self), user_type ? xamarin_has_managed_ref (self) : 666, user_type ? get_gchandle (self) : 666, user_type);
|
||||
#endif
|
||||
|
||||
|
@ -1841,7 +1841,7 @@ get_method_block_wrapper_creator (MonoMethod *method, int par, guint32 *exceptio
|
|||
mp.method = method;
|
||||
mp.par = par;
|
||||
|
||||
// NSLog (@"Looking up method and par (%x and %d)", (int) method, par);
|
||||
// PRINT ("Looking up method and par (%x and %d)", (int) method, par);
|
||||
MONO_ENTER_GC_SAFE;
|
||||
pthread_mutex_lock (&wrapper_hash_lock);
|
||||
MONO_EXIT_GC_SAFE;
|
||||
|
@ -1856,14 +1856,14 @@ get_method_block_wrapper_creator (MonoMethod *method, int par, guint32 *exceptio
|
|||
res = (MonoObject *) mono_g_hash_table_lookup (xamarin_wrapper_hash, &mp);
|
||||
pthread_mutex_unlock (&wrapper_hash_lock);
|
||||
if (res != NULL){
|
||||
// NSLog (@"Found match: %x", (int) res);
|
||||
// PRINT ("Found match: %x", (int) res);
|
||||
return res;
|
||||
}
|
||||
|
||||
res = xamarin_get_block_wrapper_creator ((MonoObject *) mono_method_get_object (mono_domain_get (), method, NULL), par, exception_gchandle);
|
||||
if (*exception_gchandle != 0)
|
||||
return NULL;
|
||||
// NSLog (@"New value: %x", (int) res);
|
||||
// PRINT ("New value: %x", (int) res);
|
||||
|
||||
nmp = (MethodAndPar *) malloc (sizeof (MethodAndPar));
|
||||
*nmp = mp;
|
||||
|
@ -2004,8 +2004,8 @@ xamarin_process_nsexception_using_mode (NSException *ns_exception, bool throwMan
|
|||
mode = xamarin_on_marshal_objectivec_exception (ns_exception, throwManagedAsDefault, &exception_gchandle);
|
||||
|
||||
if (exception_gchandle != 0) {
|
||||
NSLog (@PRODUCT ": Got an exception while executing the MarshalObjectiveCException event (this exception will be ignored):");
|
||||
NSLog (@"%@", print_all_exceptions (mono_gchandle_get_target (exception_gchandle)));
|
||||
PRINT (PRODUCT ": Got an exception while executing the MarshalObjectiveCException event (this exception will be ignored):");
|
||||
PRINT ("%@", print_all_exceptions (mono_gchandle_get_target (exception_gchandle)));
|
||||
mono_gchandle_free (exception_gchandle);
|
||||
exception_gchandle = 0;
|
||||
}
|
||||
|
@ -2028,8 +2028,8 @@ xamarin_process_nsexception_using_mode (NSException *ns_exception, bool throwMan
|
|||
} else {
|
||||
int handle = xamarin_create_ns_exception (ns_exception, &exception_gchandle);
|
||||
if (exception_gchandle != 0) {
|
||||
NSLog (@PRODUCT ": Got an exception while creating a managed NSException wrapper (will throw this exception instead):");
|
||||
NSLog (@"%@", print_all_exceptions (mono_gchandle_get_target (exception_gchandle)));
|
||||
PRINT (PRODUCT ": Got an exception while creating a managed NSException wrapper (will throw this exception instead):");
|
||||
PRINT ("%@", print_all_exceptions (mono_gchandle_get_target (exception_gchandle)));
|
||||
handle = exception_gchandle;
|
||||
exception_gchandle = 0;
|
||||
}
|
||||
|
@ -2061,8 +2061,8 @@ xamarin_process_managed_exception (MonoObject *exception)
|
|||
mono_gchandle_free (handle);
|
||||
|
||||
if (exception_gchandle != 0) {
|
||||
NSLog (@PRODUCT ": Got an exception while executing the MarshalManagedCException event (this exception will be ignored):");
|
||||
NSLog (@"%@", print_all_exceptions (mono_gchandle_get_target (exception_gchandle)));
|
||||
PRINT (PRODUCT ": Got an exception while executing the MarshalManagedCException event (this exception will be ignored):");
|
||||
PRINT ("%@", print_all_exceptions (mono_gchandle_get_target (exception_gchandle)));
|
||||
mono_gchandle_free (exception_gchandle);
|
||||
exception_gchandle = 0;
|
||||
mode = MarshalManagedExceptionModeDefault;
|
||||
|
@ -2083,8 +2083,8 @@ xamarin_process_managed_exception (MonoObject *exception)
|
|||
NSException *ns_exc = xamarin_unwrap_ns_exception (handle, &exception_gchandle);
|
||||
|
||||
if (exception_gchandle != 0) {
|
||||
NSLog (@PRODUCT ": Got an exception while unwrapping a managed NSException wrapper (this exception will be ignored):");
|
||||
NSLog (@"%@", print_all_exceptions (mono_gchandle_get_target (exception_gchandle)));
|
||||
PRINT (PRODUCT ": Got an exception while unwrapping a managed NSException wrapper (this exception will be ignored):");
|
||||
PRINT ("%@", print_all_exceptions (mono_gchandle_get_target (exception_gchandle)));
|
||||
mono_gchandle_free (exception_gchandle);
|
||||
exception_gchandle = 0;
|
||||
ns_exc = NULL;
|
||||
|
@ -2106,8 +2106,8 @@ xamarin_process_managed_exception (MonoObject *exception)
|
|||
|
||||
fullname = xamarin_type_get_full_name (mono_class_get_type (mono_object_get_class (exception)), &exception_gchandle);
|
||||
if (exception_gchandle != 0) {
|
||||
NSLog (@PRODUCT ": Got an exception when trying to get the typename for an exception (this exception will be ignored):");
|
||||
NSLog (@"%@", print_all_exceptions (mono_gchandle_get_target (exception_gchandle)));
|
||||
PRINT (PRODUCT ": Got an exception when trying to get the typename for an exception (this exception will be ignored):");
|
||||
PRINT ("%@", print_all_exceptions (mono_gchandle_get_target (exception_gchandle)));
|
||||
mono_gchandle_free (exception_gchandle);
|
||||
exception_gchandle = 0;
|
||||
fullname = "Unknown";
|
||||
|
@ -2164,6 +2164,33 @@ xamarin_insert_dllmap ()
|
|||
#endif // defined (__i386__) || defined (__x86_64__)
|
||||
}
|
||||
|
||||
void
|
||||
xamarin_printf (const char *format, ...)
|
||||
{
|
||||
va_list list;
|
||||
va_start (list, format);
|
||||
xamarin_vprintf (format, list);
|
||||
va_end (list);
|
||||
}
|
||||
|
||||
void
|
||||
xamarin_vprintf (const char *format, va_list args)
|
||||
{
|
||||
NSString *message = [[NSString alloc] initWithFormat: [NSString stringWithUTF8String: format] arguments: args];
|
||||
|
||||
#if TARGET_OS_WATCH && defined (__arm__) // maybe make this configurable somehow?
|
||||
const char *msg = [message UTF8String];
|
||||
int len = strlen (msg);
|
||||
fwrite (msg, 1, len, stdout);
|
||||
if (len == 0 || msg [len - 1] != '\n')
|
||||
fwrite ("\n", 1, 1, stdout);
|
||||
fflush (stdout);
|
||||
#else
|
||||
NSLog (@"%@", message);
|
||||
#endif
|
||||
|
||||
[message release];
|
||||
}
|
||||
/*
|
||||
* Object unregistration:
|
||||
*
|
||||
|
|
|
@ -36,7 +36,7 @@ struct Xamarin_block_descriptor {
|
|||
void (*dispose_helper)(void *src); // IFF (1<<25)
|
||||
// required ABI.2010.3.16
|
||||
const char *signature; // IFF (1<<30)
|
||||
int xamarin_size;
|
||||
volatile int ref_count;
|
||||
// variable-length string
|
||||
};
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <objc/runtime.h>
|
||||
#include <objc/message.h>
|
||||
#include <pthread.h>
|
||||
#include <libkern/OSAtomic.h>
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
@ -261,7 +262,9 @@ xamarin_dispose_helper (void *a)
|
|||
int handle = GPOINTER_TO_INT (bl->global_handle);
|
||||
mono_gchandle_free (handle);
|
||||
bl->global_handle = GINT_TO_POINTER (-1);
|
||||
free (bl->descriptor); // allocated using Marshal.AllocHGlobal (if NSStackBlock) or malloc (if copied through xamarin_copy_helper).
|
||||
if (OSAtomicDecrement32Barrier (&bl->descriptor->ref_count) == 0) {
|
||||
free (bl->descriptor); // allocated using Marshal.AllocHGlobal.
|
||||
}
|
||||
bl->descriptor = NULL;
|
||||
}
|
||||
|
||||
|
@ -277,9 +280,8 @@ xamarin_copy_helper (void *dst, void *src)
|
|||
target->global_handle = GINT_TO_POINTER (mono_gchandle_new (mono_gchandle_get_target (GPOINTER_TO_INT (source->local_handle)), FALSE));
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
int len = source->descriptor->xamarin_size;
|
||||
target->descriptor = (struct Xamarin_block_descriptor *) malloc (len);
|
||||
memcpy (target->descriptor, source->descriptor, len);
|
||||
OSAtomicIncrement32 (&source->descriptor->ref_count);
|
||||
target->descriptor = source->descriptor;
|
||||
}
|
||||
|
||||
struct Xamarin_block_descriptor xamarin_block_descriptor =
|
||||
|
|
|
@ -37,7 +37,7 @@ create_mt_exception (char *msg)
|
|||
static void
|
||||
dump_state (struct CallState *state)
|
||||
{
|
||||
NSLog (@"type: %u is_stret: %i self: %p SEL: %s -- double_ret: %f float_ret: %f longlong_ret: %llu ptr_ret: %p\n",
|
||||
PRINT ("type: %u is_stret: %i self: %p SEL: %s -- double_ret: %f float_ret: %f longlong_ret: %llu ptr_ret: %p\n",
|
||||
state->type, (state->type & Tramp_Stret) == Tramp_Stret, state->self, sel_getName (state->sel),
|
||||
state->double_ret, state->float_ret, state->longlong_ret, state->ptr_ret);
|
||||
}
|
||||
|
|
|
@ -383,7 +383,7 @@ xamarin_copyWithZone_trampoline1 (id self, SEL sel, NSZone *zone)
|
|||
struct objc_super sup;
|
||||
|
||||
#if defined (DEBUG_REF_COUNTING)
|
||||
NSLog (@"xamarin_copyWithZone_trampoline1 (%p, %s, %p)\n", self, sel_getName (sel), zone);
|
||||
PRINT ("xamarin_copyWithZone_trampoline1 (%p, %s, %p)\n", self, sel_getName (sel), zone);
|
||||
#endif
|
||||
|
||||
// Clear out our own GCHandle
|
||||
|
@ -413,7 +413,7 @@ xamarin_copyWithZone_trampoline2 (id self, SEL sel, NSZone *zone)
|
|||
int gchandle;
|
||||
|
||||
#if defined (DEBUG_REF_COUNTING)
|
||||
NSLog (@"xamarin_copyWithZone_trampoline2 (%p, %s, %p)\n", self, sel_getName (sel), zone);
|
||||
PRINT ("xamarin_copyWithZone_trampoline2 (%p, %s, %p)\n", self, sel_getName (sel), zone);
|
||||
#endif
|
||||
|
||||
// Clear out our own GCHandle
|
||||
|
@ -447,7 +447,7 @@ xamarin_release_trampoline (id self, SEL sel)
|
|||
ref_count = [self retainCount];
|
||||
|
||||
#if defined(DEBUG_REF_COUNTING)
|
||||
NSLog (@"xamarin_release_trampoline (%s Handle=%p) retainCount=%d; HasManagedRef=%i GCHandle=%i\n",
|
||||
PRINT ("xamarin_release_trampoline (%s Handle=%p) retainCount=%d; HasManagedRef=%i GCHandle=%i\n",
|
||||
class_getName ([self class]), self, ref_count, xamarin_has_managed_ref (self), xamarin_get_gchandle (self));
|
||||
#endif
|
||||
|
||||
|
@ -484,7 +484,7 @@ xamarin_notify_dealloc (id self, int gchandle)
|
|||
/* Object is about to die. Unregister it and free any gchandles we may have */
|
||||
MonoObject *mobj = mono_gchandle_get_target (gchandle);
|
||||
#if defined(DEBUG_REF_COUNTING)
|
||||
NSLog (@"xamarin_notify_dealloc (%p, %i) target: %p\n", self, gchandle, mobj);
|
||||
PRINT ("xamarin_notify_dealloc (%p, %i) target: %p\n", self, gchandle, mobj);
|
||||
#endif
|
||||
xamarin_free_gchandle (self, gchandle);
|
||||
xamarin_unregister_nsobject (self, mobj, &exception_gchandle);
|
||||
|
@ -524,7 +524,7 @@ xamarin_retain_trampoline (id self, SEL sel)
|
|||
self = xamarin_invoke_objc_method_implementation (self, sel, (IMP) xamarin_retain_trampoline);
|
||||
|
||||
#if defined(DEBUG_REF_COUNTING)
|
||||
NSLog (@"xamarin_retain_trampoline (%s Handle=%p) initial retainCount=%d; new retainCount=%d HadManagedRef=%i HasManagedRef=%i old GCHandle=%i new GCHandle=%i\n",
|
||||
PRINT ("xamarin_retain_trampoline (%s Handle=%p) initial retainCount=%d; new retainCount=%d HadManagedRef=%i HasManagedRef=%i old GCHandle=%i new GCHandle=%i\n",
|
||||
class_getName ([self class]), self, ref_count, (int) [self retainCount], had_managed_ref, xamarin_has_managed_ref (self), pre_gchandle, xamarin_get_gchandle (self));
|
||||
#endif
|
||||
|
||||
|
|
|
@ -2,8 +2,10 @@
|
|||
#include <objc/objc.h>
|
||||
#include <objc/runtime.h>
|
||||
#include <objc/message.h>
|
||||
#include <iconv.h>
|
||||
|
||||
#include "xamarin/xamarin.h"
|
||||
#include "runtime-internal.h"
|
||||
#include "monotouch-support.h"
|
||||
|
||||
const char *
|
||||
|
@ -19,7 +21,13 @@ void
|
|||
xamarin_log (const unsigned short *unicodeMessage)
|
||||
{
|
||||
// COOP: no managed memory access: any mode.
|
||||
NSLog (@"%S", unicodeMessage);
|
||||
int length = 0;
|
||||
const unsigned short *ptr = unicodeMessage;
|
||||
while (*ptr++)
|
||||
length += sizeof (unsigned short);
|
||||
NSString *msg = [[NSString alloc] initWithBytes: unicodeMessage length: length encoding: NSUTF16LittleEndianStringEncoding];
|
||||
xamarin_printf ([msg UTF8String]);
|
||||
[msg release];
|
||||
}
|
||||
|
||||
void*
|
||||
|
@ -76,7 +84,7 @@ xamarin_start_wwan (const char *uri)
|
|||
|
||||
if (CFReadStreamOpen (stream)) {
|
||||
// CFStreamStatus status = CFReadStreamGetStatus (stream);
|
||||
// NSLog (@"CFStreamStatus %i", status);
|
||||
// PRINT ("CFStreamStatus %i", status);
|
||||
// note: some earlier iOS7 beta returned 1 (Opening) instead of 2 (Open) - a bit more time was needed or
|
||||
// CFReadStreamRead blocks (and never return)
|
||||
CFReadStreamRead (stream, buf, 1);
|
||||
|
@ -116,13 +124,13 @@ xamarin_GetFolderPath (int folder)
|
|||
|
||||
void objc_msgSend_stret (id self, SEL op, ...)
|
||||
{
|
||||
NSLog (@"Unimplemented objc_msgSend_stret %s", sel_getName (op));
|
||||
PRINT ("Unimplemented objc_msgSend_stret %s", sel_getName (op));
|
||||
abort ();
|
||||
}
|
||||
|
||||
void objc_msgSendSuper_stret (struct objc_super *super, SEL op, ...)
|
||||
{
|
||||
NSLog (@"Unimplemented objc_msgSendSuper_stret %s", sel_getName (op));
|
||||
PRINT ("Unimplemented objc_msgSendSuper_stret %s", sel_getName (op));
|
||||
abort ();
|
||||
}
|
||||
|
||||
|
|
|
@ -155,6 +155,10 @@ void xamarin_throw_product_exception (int code, const char *message);
|
|||
|
||||
id xamarin_invoke_objc_method_implementation (id self, SEL sel, IMP xamarin_impl);
|
||||
|
||||
// this functions support NSLog/NSString-style format specifiers.
|
||||
void xamarin_printf (const char *format, ...);
|
||||
void xamarin_vprintf (const char *format, va_list args);
|
||||
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
void mono_aot_register_module (void *aot_info);
|
||||
#endif
|
||||
|
|
|
@ -11,7 +11,7 @@ using System;
|
|||
using XamCore.Foundation;
|
||||
|
||||
namespace XamCore.AVFoundation {
|
||||
#if !MONOMAC
|
||||
#if !MONOMAC && !WATCH && !TVOS
|
||||
public partial class AVAssetDownloadTask : NSUrlSessionTask {
|
||||
|
||||
// NSURLRequest and NSURLResponse objects are not available for AVAssetDownloadTask
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
//
|
||||
// Copyright 2015 Xamarin Inc.
|
||||
//
|
||||
|
||||
#if !TVOS && !WATCH
|
||||
using System;
|
||||
using XamCore.Foundation;
|
||||
using XamCore.ObjCRuntime;
|
||||
|
@ -113,4 +113,4 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
// Copyright 2012, 2014 Xamarin Inc
|
||||
//
|
||||
|
||||
#if !WATCH
|
||||
|
||||
using System;
|
||||
using XamCore.Foundation;
|
||||
using XamCore.CoreMedia;
|
||||
using XamCore.CoreVideo;
|
||||
|
||||
namespace XamCore.AVFoundation {
|
||||
public partial class AVAssetResourceLoadingDataRequest {
|
||||
|
@ -20,3 +20,5 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
// Authors:
|
||||
// Miguel de Icaza
|
||||
//
|
||||
|
||||
#if !WATCH
|
||||
|
||||
using XamCore.Foundation;
|
||||
using XamCore.ObjCRuntime;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using XamCore.AudioToolbox;
|
||||
|
||||
namespace XamCore.AVFoundation {
|
||||
|
@ -26,3 +26,5 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -34,5 +34,44 @@ namespace XamCore.AVFoundation {
|
|||
public struct AVAudioConverterPrimeInfo {
|
||||
public uint LeadingFrames;
|
||||
public uint TrailingFrames;
|
||||
|
||||
public AVAudioConverterPrimeInfo (uint leadingFrames, uint trailingFrames)
|
||||
{
|
||||
LeadingFrames = leadingFrames;
|
||||
TrailingFrames = trailingFrames;
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return $"({LeadingFrames}:{TrailingFrames})";
|
||||
}
|
||||
|
||||
public static bool operator == (AVAudioConverterPrimeInfo left, AVAudioConverterPrimeInfo right)
|
||||
{
|
||||
return left.Equals (right);
|
||||
}
|
||||
|
||||
public static bool operator != (AVAudioConverterPrimeInfo left, AVAudioConverterPrimeInfo right)
|
||||
{
|
||||
return !left.Equals (right);
|
||||
}
|
||||
|
||||
public override bool Equals (object obj)
|
||||
{
|
||||
if (!(obj is AVAudioConverterPrimeInfo))
|
||||
return false;
|
||||
|
||||
return this.Equals ((AVAudioConverterPrimeInfo)obj);
|
||||
}
|
||||
|
||||
public bool Equals (AVAudioConverterPrimeInfo other)
|
||||
{
|
||||
return LeadingFrames == other.LeadingFrames && TrailingFrames == other.TrailingFrames;
|
||||
}
|
||||
|
||||
public override int GetHashCode ()
|
||||
{
|
||||
return LeadingFrames.GetHashCode () ^ TrailingFrames.GetHashCode ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,7 +80,8 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if !WATCH
|
||||
public partial class AVAudioPlayer {
|
||||
|
||||
public static AVAudioPlayer FromUrl (NSUrl url, out NSError error)
|
||||
|
@ -164,4 +165,5 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
#endif
|
||||
}
|
||||
#endif // !WATCH
|
||||
}
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#if !WATCH
|
||||
|
||||
using XamCore.Foundation;
|
||||
using XamCore.CoreFoundation;
|
||||
using XamCore.AudioToolbox;
|
||||
|
@ -104,6 +107,11 @@ namespace XamCore.AVFoundation {
|
|||
Handle = InitWithUrl (url, settings.Dictionary, out error);
|
||||
}
|
||||
|
||||
AVAudioRecorder (NSUrl url, AVAudioFormat format, out NSError error) {
|
||||
// We use this method because it allows us to out NSError but, as a side effect, it is possible for the handle to be null and we will need to check this manually (on the Create method).
|
||||
Handle = InitWithUrl (url, format, out error);
|
||||
}
|
||||
|
||||
public static AVAudioRecorder Create (NSUrl url, AudioSettings settings, out NSError error)
|
||||
{
|
||||
if (settings == null)
|
||||
|
@ -120,6 +128,23 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
}
|
||||
|
||||
[iOS (10,0), Mac (10,12)]
|
||||
public static AVAudioRecorder Create (NSUrl url, AVAudioFormat format, out NSError error)
|
||||
{
|
||||
if (format == null)
|
||||
throw new ArgumentNullException (nameof (format));
|
||||
error = null;
|
||||
try {
|
||||
AVAudioRecorder r = new AVAudioRecorder (url, format, out error);
|
||||
if (r.Handle == IntPtr.Zero)
|
||||
return null;
|
||||
|
||||
return r;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
#if !XAMCORE_2_0
|
||||
[Advice ("Use Create method")]
|
||||
public static AVAudioRecorder ToUrl (NSUrl url, AVAudioRecorderSettings settings, out NSError error)
|
||||
|
@ -144,3 +169,5 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
#endif // !TVOS
|
||||
}
|
||||
|
||||
#endif // !WATCH
|
||||
|
|
|
@ -72,7 +72,7 @@ namespace XamCore.AVFoundation {
|
|||
return outError;
|
||||
}
|
||||
|
||||
#if !TVOS
|
||||
#if !TVOS && !WATCH
|
||||
public NSError SetActive (bool active, AVAudioSessionSetActiveOptions options)
|
||||
{
|
||||
NSError outError;
|
||||
|
@ -113,7 +113,7 @@ namespace XamCore.AVFoundation {
|
|||
return AVAudioSession.CategoryRecord;
|
||||
case AVAudioSessionCategory.PlayAndRecord:
|
||||
return AVAudioSession.CategoryPlayAndRecord;
|
||||
#if !TVOS
|
||||
#if !TVOS && !WATCH
|
||||
case AVAudioSessionCategory.AudioProcessing:
|
||||
return AVAudioSession.CategoryAudioProcessing;
|
||||
#endif
|
||||
|
|
|
@ -82,6 +82,7 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
}
|
||||
|
||||
#if !WATCH
|
||||
public AVAudioDataSourcePolarPattern []SupportedPolarPatterns {
|
||||
get {
|
||||
var x = SupportedPolarPatterns_;
|
||||
|
@ -109,6 +110,7 @@ namespace XamCore.AVFoundation {
|
|||
{
|
||||
return SetPreferredPolarPattern_ (ToToken (pattern), out outError);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -41,5 +41,38 @@ namespace XamCore.AVFoundation {
|
|||
Start = startBeat;
|
||||
Length = lengthInBeats;
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return $"(Start={Start},Length={Length})";
|
||||
}
|
||||
|
||||
public static bool operator == (AVBeatRange left, AVBeatRange right)
|
||||
{
|
||||
return left.Equals (right);
|
||||
}
|
||||
|
||||
public static bool operator != (AVBeatRange left, AVBeatRange right)
|
||||
{
|
||||
return !left.Equals (right);
|
||||
}
|
||||
|
||||
public override bool Equals (object obj)
|
||||
{
|
||||
if (!(obj is AVBeatRange))
|
||||
return false;
|
||||
|
||||
return this.Equals ((AVBeatRange)obj);
|
||||
}
|
||||
|
||||
public bool Equals (AVBeatRange other)
|
||||
{
|
||||
return Start == other.Start && Length == other.Length;
|
||||
}
|
||||
|
||||
public override int GetHashCode ()
|
||||
{
|
||||
return Start.GetHashCode () ^ Length.GetHashCode ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#if !TVOS
|
||||
#if !TVOS && !WATCH
|
||||
|
||||
using System;
|
||||
using XamCore.ObjCRuntime;
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
//
|
||||
// AVCaptureDeviceDiscoverySession.cs
|
||||
//
|
||||
// Authors:
|
||||
// Alex Soto (alexsoto@microsoft.com)
|
||||
//
|
||||
// Copyright 2016 Xamarin Inc.
|
||||
//
|
||||
|
||||
using System;
|
||||
using XamCore.Foundation;
|
||||
using XamCore.ObjCRuntime;
|
||||
|
||||
namespace XamCore.AVFoundation {
|
||||
#if IOS
|
||||
public partial class AVCaptureDeviceDiscoverySession {
|
||||
[iOS (10,0)]
|
||||
public static AVCaptureDeviceDiscoverySession Create (AVCaptureDeviceType [] deviceTypes, string mediaType, AVCaptureDevicePosition position)
|
||||
{
|
||||
var arr = new NSMutableArray ();
|
||||
foreach (var device in deviceTypes)
|
||||
arr.Add (device.GetConstant ());
|
||||
|
||||
return _Create (arr, mediaType, position);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
|
@ -28,7 +28,7 @@
|
|||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#if !TVOS
|
||||
#if !TVOS && !WATCH
|
||||
|
||||
using System;
|
||||
using XamCore.Foundation;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
// Copyright 2014 Xamarin Inc (http://www.xamarin.com)
|
||||
//
|
||||
|
||||
#if !TVOS
|
||||
#if !TVOS && !WATCH
|
||||
|
||||
using System;
|
||||
using XamCore.Foundation;
|
||||
|
@ -44,4 +44,4 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
}
|
||||
|
||||
#endif // !TVOS
|
||||
#endif // !TVOS && !WATCH
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#if XAMCORE_2_0 && !MONOMAC && !TVOS
|
||||
#if XAMCORE_2_0 && IOS
|
||||
using XamCore.Foundation;
|
||||
using XamCore.ObjCRuntime;
|
||||
using System;
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
// Copyright 2014-2015 Xamarin Inc. All rights reserved.
|
||||
// Copyright 2014-2016 Xamarin Inc. All rights reserved.
|
||||
|
||||
#if !WATCH
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using OpenTK;
|
||||
using XamCore.CoreMedia;
|
||||
using XamCore.Foundation;
|
||||
using XamCore.ObjCRuntime;
|
||||
|
||||
namespace XamCore.AVFoundation {
|
||||
|
||||
|
@ -61,4 +66,426 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
partial class AVAudioChannelLayout {
|
||||
|
||||
[Obsolete ("Valid instance of this type cannot be directly created")]
|
||||
public AVAudioChannelLayout ()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
partial class AVAudioConnectionPoint {
|
||||
|
||||
[Obsolete ("Valid instance of this type cannot be directly created")]
|
||||
public AVAudioConnectionPoint ()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
#if TVOS
|
||||
// tvOS removed some types - we need to keep stubs of them for binary compatibility
|
||||
[Obsolete ("Removed in tvOS 10")]
|
||||
[Deprecated (PlatformName.TvOS, 10, 0, PlatformArchitecture.None, "Removed in tvOS 10")]
|
||||
public class AVAssetDownloadDelegate : NSObject, IAVAssetDownloadDelegate {
|
||||
public AVAssetDownloadDelegate ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[EditorBrowsable (EditorBrowsableState.Advanced)]
|
||||
protected AVAssetDownloadDelegate (NSObjectFlag t)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[EditorBrowsable (EditorBrowsableState.Advanced)]
|
||||
protected internal AVAssetDownloadDelegate (IntPtr handle)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public virtual void DidCompleteWithError (NSUrlSession session, NSUrlSessionTask task, NSError error)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public virtual void DidFinishCollectingMetrics (NSUrlSession session, NSUrlSessionTask task, NSUrlSessionTaskMetrics metrics)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public virtual void DidFinishDownloadingToUrl (NSUrlSession session, AVAssetDownloadTask assetDownloadTask, NSUrl location)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public virtual void DidLoadTimeRange (NSUrlSession session, AVAssetDownloadTask assetDownloadTask, CMTimeRange timeRange, NSValue[] loadedTimeRanges, CMTimeRange timeRangeExpectedToLoad)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public virtual void DidReceiveChallenge (NSUrlSession session, NSUrlSessionTask task, NSUrlAuthenticationChallenge challenge, [BlockProxy (typeof(Trampolines.NIDActionArity2V0))] Action<NSUrlSessionAuthChallengeDisposition, NSUrlCredential> completionHandler)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public virtual void DidResolveMediaSelection (NSUrlSession session, AVAssetDownloadTask assetDownloadTask, AVMediaSelection resolvedMediaSelection)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public virtual void DidSendBodyData (NSUrlSession session, NSUrlSessionTask task, long bytesSent, long totalBytesSent, long totalBytesExpectedToSend)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public virtual void NeedNewBodyStream (NSUrlSession session, NSUrlSessionTask task, [BlockProxy (typeof(Trampolines.NIDActionArity1V0))] Action<NSInputStream> completionHandler)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public virtual void WillPerformHttpRedirection (NSUrlSession session, NSUrlSessionTask task, NSHttpUrlResponse response, NSUrlRequest newRequest, [BlockProxy (typeof(Trampolines.NIDActionArity1V1))] Action<NSUrlRequest> completionHandler)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
[Obsolete ("Removed in tvOS 10")]
|
||||
[Deprecated (PlatformName.TvOS, 10, 0, PlatformArchitecture.None, "Removed in tvOS 10")]
|
||||
public interface IAVAssetDownloadDelegate : INativeObject, IDisposable, INSUrlSessionTaskDelegate, INSUrlSessionDelegate {
|
||||
}
|
||||
|
||||
[Obsolete ("Removed in tvOS 10")]
|
||||
[Deprecated (PlatformName.TvOS, 10, 0, PlatformArchitecture.None, "Removed in tvOS 10")]
|
||||
public static class AVAssetDownloadDelegate_Extensions {
|
||||
|
||||
public static void DidFinishDownloadingToUrl (this IAVAssetDownloadDelegate This, NSUrlSession session, AVAssetDownloadTask assetDownloadTask, NSUrl location)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public static void DidLoadTimeRange (this IAVAssetDownloadDelegate This, NSUrlSession session, AVAssetDownloadTask assetDownloadTask, CMTimeRange timeRange, NSValue[] loadedTimeRanges, CMTimeRange timeRangeExpectedToLoad)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public static void DidResolveMediaSelection (this IAVAssetDownloadDelegate This, NSUrlSession session, AVAssetDownloadTask assetDownloadTask, AVMediaSelection resolvedMediaSelection)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
[Obsolete ("Removed in tvOS 10")]
|
||||
[Deprecated (PlatformName.TvOS, 10, 0, PlatformArchitecture.None, "Removed in tvOS 10")]
|
||||
public class AVAssetDownloadTask : NSUrlSessionTask {
|
||||
|
||||
public override IntPtr ClassHandle {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public override NSUrlRequest CurrentRequest {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual NSUrl DestinationUrl {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual NSValue[] LoadedTimeRanges {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual NSDictionary<NSString, NSObject> Options {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public override NSUrlRequest OriginalRequest {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public override NSUrlResponse Response {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual AVUrlAsset UrlAsset {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
[EditorBrowsable (EditorBrowsableState.Advanced),]
|
||||
protected AVAssetDownloadTask (NSObjectFlag t)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[EditorBrowsable (EditorBrowsableState.Advanced)]
|
||||
protected internal AVAssetDownloadTask (IntPtr handle)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
[Obsolete ("Removed in tvOS 10")]
|
||||
[Deprecated (PlatformName.TvOS, 10, 0, PlatformArchitecture.None, "Removed in tvOS 10")]
|
||||
public class AVAssetDownloadUrlSession : NSUrlSession {
|
||||
|
||||
public new static NSUrlSession SharedSession {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public override IntPtr ClassHandle {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
[EditorBrowsable (EditorBrowsableState.Advanced)]
|
||||
protected internal AVAssetDownloadUrlSession (IntPtr handle) : base (handle)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[EditorBrowsable (EditorBrowsableState.Advanced)]
|
||||
protected AVAssetDownloadUrlSession (NSObjectFlag t) : base (t)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public static AVAssetDownloadUrlSession CreateSession (NSUrlSessionConfiguration configuration, IAVAssetDownloadDelegate @delegate, NSOperationQueue delegateQueue)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public new static NSUrlSession FromConfiguration (NSUrlSessionConfiguration configuration)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public new static NSUrlSession FromConfiguration (NSUrlSessionConfiguration configuration, NSUrlSessionDelegate sessionDelegate, NSOperationQueue delegateQueue)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public new static NSUrlSession FromWeakConfiguration (NSUrlSessionConfiguration configuration, NSObject weakDelegate, NSOperationQueue delegateQueue)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public override NSUrlSessionDataTask CreateDataTask (NSUrlRequest request)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public override NSUrlSessionDataTask CreateDataTask (NSUrl url)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public override NSUrlSessionDataTask CreateDataTask (NSUrlRequest request, NSUrlSessionResponse completionHandler)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public override NSUrlSessionDataTask CreateDataTask (NSUrl url, NSUrlSessionResponse completionHandler)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public override NSUrlSessionDownloadTask CreateDownloadTask (NSUrlRequest request, NSUrlDownloadSessionResponse completionHandler)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public override NSUrlSessionDownloadTask CreateDownloadTask (NSUrl url, NSUrlDownloadSessionResponse completionHandler)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public override NSUrlSessionDownloadTask CreateDownloadTask (NSData resumeData)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public override NSUrlSessionDownloadTask CreateDownloadTask (NSUrl url)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public override NSUrlSessionDownloadTask CreateDownloadTask (NSUrlRequest request)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public override NSUrlSessionDownloadTask CreateDownloadTaskFromResumeData (NSData resumeData, NSUrlDownloadSessionResponse completionHandler)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public override NSUrlSessionUploadTask CreateUploadTask (NSUrlRequest request, NSUrl fileURL)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public override NSUrlSessionUploadTask CreateUploadTask (NSUrlRequest request, NSData bodyData)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public override NSUrlSessionUploadTask CreateUploadTask (NSUrlRequest request, NSUrl fileURL, NSUrlSessionResponse completionHandler)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public override NSUrlSessionUploadTask CreateUploadTask (NSUrlRequest request, NSData bodyData, NSUrlSessionResponse completionHandler)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public override NSUrlSessionUploadTask CreateUploadTask (NSUrlRequest request)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public virtual AVAssetDownloadTask GetAssetDownloadTask (AVUrlAsset urlAsset, NSUrl destinationUrl, NSDictionary options)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public AVAssetDownloadTask GetAssetDownloadTask (AVUrlAsset urlAsset, NSUrl destinationUrl, AVAssetDownloadOptions options)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public virtual AVAssetDownloadTask GetAssetDownloadTask (AVUrlAsset urlAsset, string title, NSData artworkData, NSDictionary options)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public AVAssetDownloadTask GetAssetDownloadTask (AVUrlAsset urlAsset, string title, NSData artworkData, AVAssetDownloadOptions options)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
[Obsolete ("Removed in tvOS 10")]
|
||||
[Deprecated (PlatformName.TvOS, 10, 0, PlatformArchitecture.None, "Removed in tvOS 10")]
|
||||
public class AVAudioInputNode : AVAudioIONode, IAVAudio3DMixing, IAVAudioMixing, IAVAudioStereoMixing {
|
||||
|
||||
public override IntPtr ClassHandle {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual float Obstruction {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
set {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual float Occlusion {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
set {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual float Pan {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
set {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual Vector3 Position {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
set {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual float Rate {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
set {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual AVAudio3DMixingRenderingAlgorithm RenderingAlgorithm {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
set {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual float ReverbBlend {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
set {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual float Volume {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
set {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
[EditorBrowsable (EditorBrowsableState.Advanced)]
|
||||
protected AVAudioInputNode (NSObjectFlag t) : base (t)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[EditorBrowsable (EditorBrowsableState.Advanced)]
|
||||
protected internal AVAudioInputNode (IntPtr handle) : base (handle)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual AVAudioMixingDestination DestinationForMixer (AVAudioNode mixer, nuint bus)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
#endif // TVOS
|
||||
#endif // !XAMCORE_4_0
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#if !WATCH
|
||||
|
||||
using System;
|
||||
|
||||
using XamCore.Foundation;
|
||||
|
@ -125,3 +127,5 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#if XAMCORE_2_0 && !MONOMAC && !TVOS
|
||||
#if XAMCORE_2_0 && IOS
|
||||
using XamCore.CoreGraphics;
|
||||
using XamCore.Foundation;
|
||||
using XamCore.ObjCRuntime;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#if XAMCORE_2_0 && !MONOMAC && !TVOS
|
||||
#if XAMCORE_2_0 && IOS
|
||||
using XamCore.Foundation;
|
||||
using XamCore.ObjCRuntime;
|
||||
using System;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
//
|
||||
// Copyright 2012, 2014 Xamarin Inc
|
||||
//
|
||||
#if !MONOMAC
|
||||
#if !MONOMAC && !WATCH
|
||||
|
||||
using System;
|
||||
using XamCore.Foundation;
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
#if !WATCH
|
||||
|
||||
using System;
|
||||
|
||||
using XamCore.Foundation;
|
||||
using XamCore.CoreFoundation;
|
||||
using XamCore.ObjCRuntime;
|
||||
using XamCore.AudioToolbox;
|
||||
|
||||
namespace XamCore.AVFoundation {
|
||||
public partial class AVPlayerItemVideoOutput {
|
||||
|
||||
enum InitMode {
|
||||
PixelAttributes,
|
||||
OutputSettings
|
||||
}
|
||||
|
||||
AVPlayerItemVideoOutput (NSDictionary data, AVPlayerItemVideoOutput.InitMode mode) : this (IntPtr.Zero)
|
||||
{
|
||||
switch (mode) {
|
||||
case InitMode.PixelAttributes:
|
||||
Handle = _FromPixelBufferAttributes (data);
|
||||
break;
|
||||
case InitMode.OutputSettings:
|
||||
Handle = _FromOutputSettings (data);
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentException (nameof (mode));
|
||||
}
|
||||
}
|
||||
|
||||
[DesignatedInitializer]
|
||||
[Advice ("Please use the constructor that uses one of the available StrongDictionaries. This constructor expects Pixelbugger attributes.")]
|
||||
protected AVPlayerItemVideoOutput (NSDictionary pixelBufferAttributes) : this (pixelBufferAttributes, InitMode.PixelAttributes) {}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -7,6 +7,8 @@
|
|||
// Copyright 2015 Xamarin Inc.
|
||||
//
|
||||
|
||||
#if !WATCH
|
||||
|
||||
using XamCore.ObjCRuntime;
|
||||
using XamCore.CoreVideo;
|
||||
|
||||
|
@ -28,3 +30,4 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -23,6 +23,7 @@ using MonoTouch.ObjCRuntime;
|
|||
|
||||
namespace XamCore.AVFoundation {
|
||||
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct AVAudio3DVectorOrientation {
|
||||
#if !COREBUILD
|
||||
public Vector3 Forward, Up;
|
||||
|
@ -67,6 +68,7 @@ namespace XamCore.AVFoundation {
|
|||
#endif
|
||||
}
|
||||
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct AVAudio3DAngularOrientation {
|
||||
|
||||
public float Yaw, Pitch, Roll;
|
||||
|
@ -109,6 +111,7 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
}
|
||||
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct AVCaptureWhiteBalanceGains {
|
||||
public float RedGain, GreenGain, BlueGain;
|
||||
|
||||
|
@ -118,13 +121,46 @@ namespace XamCore.AVFoundation {
|
|||
GreenGain = greenGain;
|
||||
BlueGain = blueGain;
|
||||
}
|
||||
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("(RedGain={0},GreenGain={1},BlueGain={2})", RedGain, GreenGain, BlueGain);
|
||||
}
|
||||
|
||||
public static bool operator ==(AVCaptureWhiteBalanceGains left, AVCaptureWhiteBalanceGains right)
|
||||
{
|
||||
return (left.RedGain == right.RedGain &&
|
||||
left.GreenGain == right.GreenGain &&
|
||||
left.BlueGain == right.BlueGain);
|
||||
}
|
||||
|
||||
public static bool operator !=(AVCaptureWhiteBalanceGains left, AVCaptureWhiteBalanceGains right)
|
||||
{
|
||||
return (left.RedGain != right.RedGain ||
|
||||
left.GreenGain != right.GreenGain ||
|
||||
left.BlueGain != right.BlueGain);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (!(obj is AVCaptureWhiteBalanceGains))
|
||||
return false;
|
||||
|
||||
return this.Equals((AVCaptureWhiteBalanceGains)obj);
|
||||
}
|
||||
|
||||
public bool Equals(AVCaptureWhiteBalanceGains other)
|
||||
{
|
||||
return this == other;
|
||||
}
|
||||
|
||||
public override int GetHashCode ()
|
||||
{
|
||||
return RedGain.GetHashCode () ^ GreenGain.GetHashCode () ^ BlueGain.GetHashCode ();
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct AVCaptureWhiteBalanceChromaticityValues {
|
||||
public float X, Y;
|
||||
|
||||
|
@ -138,8 +174,37 @@ namespace XamCore.AVFoundation {
|
|||
{
|
||||
return String.Format ("({0},{1})", X, Y);
|
||||
}
|
||||
|
||||
public static bool operator ==(AVCaptureWhiteBalanceChromaticityValues left, AVCaptureWhiteBalanceChromaticityValues right)
|
||||
{
|
||||
return left.X == right.X && left.Y == right.Y;
|
||||
}
|
||||
|
||||
public static bool operator !=(AVCaptureWhiteBalanceChromaticityValues left, AVCaptureWhiteBalanceChromaticityValues right)
|
||||
{
|
||||
return left.X != right.X || left.Y != right.Y;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (!(obj is AVCaptureWhiteBalanceChromaticityValues))
|
||||
return false;
|
||||
|
||||
return this.Equals((AVCaptureWhiteBalanceChromaticityValues)obj);
|
||||
}
|
||||
|
||||
public bool Equals(AVCaptureWhiteBalanceChromaticityValues other)
|
||||
{
|
||||
return this == other;
|
||||
}
|
||||
|
||||
public override int GetHashCode ()
|
||||
{
|
||||
return X.GetHashCode () ^ Y.GetHashCode ();
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct AVCaptureWhiteBalanceTemperatureAndTintValues {
|
||||
public float Temperature, Tint;
|
||||
|
||||
|
@ -152,6 +217,35 @@ namespace XamCore.AVFoundation {
|
|||
{
|
||||
return String.Format ("(Temperature={0},Tint={1})", Temperature, Tint);
|
||||
}
|
||||
|
||||
public static bool operator ==(AVCaptureWhiteBalanceTemperatureAndTintValues left, AVCaptureWhiteBalanceTemperatureAndTintValues right)
|
||||
{
|
||||
return left.Temperature == right.Temperature && left.Tint == right.Tint;
|
||||
}
|
||||
|
||||
public static bool operator !=(AVCaptureWhiteBalanceTemperatureAndTintValues left, AVCaptureWhiteBalanceTemperatureAndTintValues right)
|
||||
{
|
||||
return left.Temperature != right.Temperature || left.Tint != right.Tint;
|
||||
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (!(obj is AVCaptureWhiteBalanceTemperatureAndTintValues))
|
||||
return false;
|
||||
|
||||
return this.Equals((AVCaptureWhiteBalanceTemperatureAndTintValues)obj);
|
||||
}
|
||||
|
||||
public bool Equals(AVCaptureWhiteBalanceTemperatureAndTintValues other)
|
||||
{
|
||||
return this == other;
|
||||
}
|
||||
|
||||
public override int GetHashCode ()
|
||||
{
|
||||
return Temperature.GetHashCode () ^ Tint.GetHashCode ();
|
||||
}
|
||||
}
|
||||
|
||||
#if !COREBUILD
|
||||
|
@ -159,6 +253,7 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
#endif
|
||||
|
||||
#if !WATCH
|
||||
public static class AVUtilities {
|
||||
|
||||
[DllImport (Constants.AVFoundationLibrary)]
|
||||
|
@ -170,4 +265,5 @@ namespace XamCore.AVFoundation {
|
|||
return AVMakeRectWithAspectRatioInsideRect (aspectRatio, self);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#if !WATCH
|
||||
|
||||
using System;
|
||||
|
||||
using XamCore.Foundation;
|
||||
|
@ -68,3 +70,4 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -67,6 +67,7 @@ namespace XamCore.AVFoundation {
|
|||
HighAutoLevel,
|
||||
}
|
||||
|
||||
#if !WATCH
|
||||
public class AVVideoSettingsUncompressed : CVPixelBufferAttributes
|
||||
{
|
||||
#if !COREBUILD
|
||||
|
@ -604,4 +605,5 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
#endif
|
||||
}
|
||||
#endif // !WATCH
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
// Copyright 2014 Xamarin Inc.
|
||||
//
|
||||
|
||||
#if !WATCH
|
||||
|
||||
using System;
|
||||
|
||||
using XamCore.Foundation;
|
||||
|
@ -44,3 +46,4 @@ namespace XamCore.AVFoundation {
|
|||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -40,6 +40,7 @@ namespace XamCore.AVFoundation {
|
|||
Max = 0x7F
|
||||
}
|
||||
|
||||
[NoWatch]
|
||||
[iOS (4,0)]
|
||||
[Native]
|
||||
// NSInteger - AVAssetExportSession.h
|
||||
|
@ -52,6 +53,7 @@ namespace XamCore.AVFoundation {
|
|||
Cancelled
|
||||
}
|
||||
|
||||
[NoWatch]
|
||||
[iOS (4,0)]
|
||||
[Native]
|
||||
// NSInteger - AVAssetReader.h
|
||||
|
@ -63,6 +65,7 @@ namespace XamCore.AVFoundation {
|
|||
Cancelled,
|
||||
}
|
||||
|
||||
[NoWatch]
|
||||
[iOS (4,1)]
|
||||
[Native]
|
||||
// NSInteger - AVAssetWriter.h
|
||||
|
@ -74,7 +77,7 @@ namespace XamCore.AVFoundation {
|
|||
Cancelled,
|
||||
}
|
||||
|
||||
[NoTV]
|
||||
[NoTV, NoWatch]
|
||||
[iOS (4,0)]
|
||||
[Native]
|
||||
// NSInteger - AVCaptureSession.h
|
||||
|
@ -85,6 +88,7 @@ namespace XamCore.AVFoundation {
|
|||
LandscapeLeft,
|
||||
}
|
||||
|
||||
[NoWatch]
|
||||
[NoTV]
|
||||
[iOS (4,0)]
|
||||
[Native]
|
||||
|
@ -93,6 +97,7 @@ namespace XamCore.AVFoundation {
|
|||
Off, On, Auto
|
||||
}
|
||||
|
||||
[NoWatch]
|
||||
[NoTV]
|
||||
[iOS (4,0)]
|
||||
[Native]
|
||||
|
@ -101,6 +106,7 @@ namespace XamCore.AVFoundation {
|
|||
Off, On, Auto
|
||||
}
|
||||
|
||||
[NoWatch]
|
||||
[NoTV]
|
||||
[iOS (4,0)]
|
||||
[Native]
|
||||
|
@ -121,6 +127,7 @@ namespace XamCore.AVFoundation {
|
|||
#endif
|
||||
}
|
||||
|
||||
[NoWatch]
|
||||
[NoTV]
|
||||
[iOS (4,0)]
|
||||
[Native]
|
||||
|
@ -130,7 +137,8 @@ namespace XamCore.AVFoundation {
|
|||
Back = 1,
|
||||
Front = 2
|
||||
}
|
||||
|
||||
|
||||
[NoWatch]
|
||||
[NoTV]
|
||||
[iOS (4,0)]
|
||||
[Native]
|
||||
|
@ -139,6 +147,7 @@ namespace XamCore.AVFoundation {
|
|||
Locked, AutoExpose, ContinuousAutoExposure, [iOS (8,0)] Custom
|
||||
}
|
||||
|
||||
[NoWatch]
|
||||
[NoTV]
|
||||
[iOS (4,0)]
|
||||
[Native]
|
||||
|
@ -147,8 +156,9 @@ namespace XamCore.AVFoundation {
|
|||
Locked, AutoWhiteBalance, ContinuousAutoWhiteBalance
|
||||
}
|
||||
|
||||
#if !MONOMAC || !XAMCORE_4_0
|
||||
[Flags]
|
||||
[NoTV]
|
||||
[NoTV, NoWatch]
|
||||
[iOS (4,0)]
|
||||
[Native]
|
||||
[Availability (Deprecated = Platform.iOS_6_0)]
|
||||
|
@ -156,9 +166,11 @@ namespace XamCore.AVFoundation {
|
|||
public enum AVAudioSessionInterruptionFlags : nuint_compat_int {
|
||||
ShouldResume = 1
|
||||
}
|
||||
#endif
|
||||
|
||||
// Populated in NSError.Code, an NSInteger
|
||||
// anonymous enum - AVError.h
|
||||
[NoWatch]
|
||||
[Native]
|
||||
public enum AVError : nint {
|
||||
Unknown = -11800,
|
||||
|
@ -181,11 +193,11 @@ namespace XamCore.AVFoundation {
|
|||
MediaServicesWereReset = -11819,
|
||||
ExportFailed = -11820,
|
||||
DecodeFailed = -11821,
|
||||
InvalidSourceMedia = - 11822,
|
||||
InvalidSourceMedia = -11822,
|
||||
FileAlreadyExists = -11823,
|
||||
CompositionTrackSegmentsNotContiguous = -11824,
|
||||
InvalidCompositionTrackSegmentDuration = -11825,
|
||||
InvalidCompositionTrackSegmentSourceStartTime= -11826,
|
||||
InvalidCompositionTrackSegmentSourceStartTime = -11826,
|
||||
InvalidCompositionTrackSegmentSourceDuration = -11827,
|
||||
FormatNotRecognized = -11828,
|
||||
FailedToParse = -11829, // Should have been FileFailedToParse
|
||||
|
@ -225,10 +237,15 @@ namespace XamCore.AVFoundation {
|
|||
|
||||
#if !MONOMAC
|
||||
[iOS (9,0)]
|
||||
RecordingAlreadyInProgress = -11859
|
||||
RecordingAlreadyInProgress = -11859,
|
||||
#endif
|
||||
[NoWatch, iOS (10,0), TV (10,0), Mac (10,12)]
|
||||
UnsupportedOutputSettings = -11861,
|
||||
[NoWatch, iOS (10,0), TV (10,0), Mac (10,12)]
|
||||
OperationNotAllowed = -11862,
|
||||
}
|
||||
|
||||
[NoWatch]
|
||||
[iOS (4,0)]
|
||||
[Native]
|
||||
// NSInteger - AVPlayer.h
|
||||
|
@ -238,6 +255,7 @@ namespace XamCore.AVFoundation {
|
|||
None
|
||||
}
|
||||
|
||||
[NoWatch]
|
||||
[iOS (4,0)]
|
||||
[Native]
|
||||
// NSInteger - AVPlayerItem.h
|
||||
|
@ -245,6 +263,7 @@ namespace XamCore.AVFoundation {
|
|||
Unknown, ReadyToPlay, Failed
|
||||
}
|
||||
|
||||
#if !MONOMAC || !XAMCORE_4_0
|
||||
[NoTV]
|
||||
[Flags]
|
||||
[iOS (4,0)]
|
||||
|
@ -254,7 +273,9 @@ namespace XamCore.AVFoundation {
|
|||
public enum AVAudioSessionFlags : nuint_compat_int {
|
||||
NotifyOthersOnDeactivation = 1
|
||||
}
|
||||
#endif
|
||||
|
||||
[NoWatch]
|
||||
[iOS (4,0)]
|
||||
[Native]
|
||||
// NSInteger - AVAsynchronousKeyValueLoading.h
|
||||
|
@ -262,6 +283,7 @@ namespace XamCore.AVFoundation {
|
|||
Unknown, Loading, Loaded, Failed, Cancelled
|
||||
}
|
||||
|
||||
[NoWatch]
|
||||
[iOS (4,0)]
|
||||
[Native]
|
||||
// NSInteger - AVPlayer.h
|
||||
|
@ -271,6 +293,7 @@ namespace XamCore.AVFoundation {
|
|||
Failed
|
||||
}
|
||||
|
||||
[NoWatch]
|
||||
[Native]
|
||||
// NSUInteger - AVAsset.h
|
||||
public enum AVAssetReferenceRestrictions : nuint_compat_int {
|
||||
|
@ -282,6 +305,7 @@ namespace XamCore.AVFoundation {
|
|||
ForbidAll = 0xFFFF,
|
||||
}
|
||||
|
||||
[NoWatch]
|
||||
[Native]
|
||||
// NSInteger - AVAssetImageGenerator.h
|
||||
public enum AVAssetImageGeneratorResult : nint {
|
||||
|
@ -297,7 +321,7 @@ namespace XamCore.AVFoundation {
|
|||
NotPlaying, Playing
|
||||
}
|
||||
|
||||
[NoTV]
|
||||
[NoTV, NoWatch]
|
||||
[Mac (10,7)] // N/A in iOS
|
||||
[Native]
|
||||
// NSInteger - AVCaptureSession.h
|
||||
|
@ -306,6 +330,7 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
#endif
|
||||
|
||||
#if !MONOMAC || !XAMCORE_4_0
|
||||
[Flags]
|
||||
[Native]
|
||||
// NSUInteger - AVAudioSession.h
|
||||
|
@ -352,8 +377,12 @@ namespace XamCore.AVFoundation {
|
|||
[NoTV]
|
||||
DefaultToSpeaker = 8,
|
||||
|
||||
[iOS (9,0), Mac (10,11)]
|
||||
InterruptSpokenAudioAndMixWithOthers = 17
|
||||
[iOS (9,0)]
|
||||
InterruptSpokenAudioAndMixWithOthers = 17,
|
||||
[NoWatch, iOS (10,0), TV (10,0)]
|
||||
AllowBluetoothA2DP = 32,
|
||||
[NoWatch, iOS (10,0), TV (10,0)]
|
||||
AllowAirPlay = 64,
|
||||
}
|
||||
|
||||
[Native]
|
||||
|
@ -381,7 +410,9 @@ namespace XamCore.AVFoundation {
|
|||
[iOS (9,0)]
|
||||
CodeResourceNotAvailable = 0x21726573
|
||||
}
|
||||
#endif
|
||||
|
||||
[NoWatch]
|
||||
[NoTV]
|
||||
[Native]
|
||||
// NSInteger - AVCaptureDevice.h
|
||||
|
@ -405,6 +436,7 @@ namespace XamCore.AVFoundation {
|
|||
Mastering
|
||||
}
|
||||
|
||||
[NoWatch]
|
||||
[NoTV]
|
||||
[Native]
|
||||
// NSInteger - AVCaptureDevice.h
|
||||
|
@ -412,6 +444,7 @@ namespace XamCore.AVFoundation {
|
|||
NotDetermined, Restricted, Denied, Authorized
|
||||
}
|
||||
|
||||
#if !MONOMAC || !XAMCORE_4_0
|
||||
[iOS (7,0)]
|
||||
[Native]
|
||||
// NSInteger - AVSpeechSynthesis.h
|
||||
|
@ -419,6 +452,7 @@ namespace XamCore.AVFoundation {
|
|||
Immediate,
|
||||
Word
|
||||
}
|
||||
#endif
|
||||
|
||||
[iOS (8,0)]
|
||||
[Native]
|
||||
|
@ -439,7 +473,8 @@ namespace XamCore.AVFoundation {
|
|||
StereoPassThrough = 5
|
||||
}
|
||||
|
||||
[NoTV]
|
||||
#if !MONOMAC || !XAMCORE_4_0
|
||||
[NoTV, NoWatch]
|
||||
[Native]
|
||||
public enum AVAudioSessionRecordPermission : nuint {
|
||||
Undetermined = 1970168948 /*'undt'*/,
|
||||
|
@ -452,6 +487,7 @@ namespace XamCore.AVFoundation {
|
|||
Begin = 1,
|
||||
End = 0
|
||||
}
|
||||
#endif
|
||||
|
||||
[Flags]
|
||||
[Native]
|
||||
|
@ -526,19 +562,21 @@ namespace XamCore.AVFoundation {
|
|||
Linear = 3
|
||||
}
|
||||
|
||||
[NoWatch]
|
||||
[NoTV]
|
||||
[Native]
|
||||
public enum AVQueuedSampleBufferRenderingStatus : nint {
|
||||
Unknown, Rendering, Failed
|
||||
}
|
||||
|
||||
[NoWatch]
|
||||
[NoTV]
|
||||
[Native]
|
||||
public enum AVCaptureVideoStabilizationMode : nint {
|
||||
Off, Standard, Cinematic, Auto = -1
|
||||
}
|
||||
|
||||
[NoTV]
|
||||
[NoTV, NoMac, NoWatch, iOS (8,0)]
|
||||
[Native]
|
||||
public enum AVCaptureAutoFocusSystem : nint {
|
||||
None,
|
||||
|
@ -596,7 +634,7 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
|
||||
#if !MONOMAC
|
||||
[NoTV]
|
||||
[NoTV, NoWatch]
|
||||
[iOS (9,0)]
|
||||
[Native]
|
||||
public enum AVCaptureSessionInterruptionReason : nint {
|
||||
|
@ -655,4 +693,60 @@ namespace XamCore.AVFoundation {
|
|||
TruncateDestinationToMovieHeaderOnly = (1 << 0)
|
||||
}
|
||||
#endif
|
||||
|
||||
[NoTV, NoWatch, NoMac, iOS (10,0)]
|
||||
[Native]
|
||||
public enum AVCaptureColorSpace : nint
|
||||
{
|
||||
Srgb = 0,
|
||||
P3D65 = 1
|
||||
}
|
||||
|
||||
[iOS (8,0)]
|
||||
[Native]
|
||||
public enum AVMusicTrackLoopCount : nint
|
||||
{
|
||||
Forever = -1
|
||||
}
|
||||
|
||||
[NoWatch, iOS (10,0), TV (10,0), Mac (10,12)]
|
||||
[Native]
|
||||
public enum AVPlayerTimeControlStatus : nint
|
||||
{
|
||||
Paused,
|
||||
WaitingToPlayAtSpecifiedRate,
|
||||
Playing
|
||||
}
|
||||
|
||||
[NoWatch, NoTV, iOS (10,0), NoMac]
|
||||
[Native]
|
||||
public enum AVAudioSessionIOType : nint
|
||||
{
|
||||
NotSpecified = 0,
|
||||
Aggregated = 1,
|
||||
}
|
||||
|
||||
[NoWatch, iOS (10,0), TV (10,0), Mac (10,12)]
|
||||
[Native]
|
||||
public enum AVPlayerLooperStatus : nint {
|
||||
Unknown,
|
||||
Ready,
|
||||
Failed,
|
||||
Cancelled
|
||||
}
|
||||
|
||||
[NoiOS, TV (10,0), NoWatch, NoMac]
|
||||
[Native]
|
||||
public enum AVContentProposalAction : nint {
|
||||
Accept,
|
||||
Reject,
|
||||
Defer
|
||||
}
|
||||
|
||||
[NoiOS, TV (10,0), NoWatch, NoMac]
|
||||
[Native]
|
||||
public enum AVPlayerViewControllerSkippingBehavior : nint {
|
||||
Default = 0,
|
||||
SkipItem
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
//
|
||||
//
|
||||
|
||||
#if !WATCH
|
||||
|
||||
using System;
|
||||
using XamCore.Foundation;
|
||||
using XamCore.ObjCRuntime;
|
||||
|
@ -393,3 +395,5 @@ namespace XamCore.AVFoundation {
|
|||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace XamCore.AVKit {
|
|||
}
|
||||
#endif
|
||||
|
||||
#if !TVOS
|
||||
#if !TVOS && (!MONOMAC || !XAMCORE_4_0)
|
||||
[iOS (9,0)]
|
||||
[Native]
|
||||
[ErrorDomain ("AVKitErrorDomain")]
|
||||
|
|
|
@ -88,11 +88,13 @@ namespace XamCore.AppKit {
|
|||
Cancelled, Success, Failure, ReplyLater
|
||||
}
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
[Native]
|
||||
public enum NSApplicationLayoutDirection : nint {
|
||||
LeftToRight = 0,
|
||||
RightToLeft = 1
|
||||
}
|
||||
#endif
|
||||
|
||||
[Native]
|
||||
public enum NSImageInterpolation : nuint_compat_int {
|
||||
|
@ -218,6 +220,7 @@ namespace XamCore.AppKit {
|
|||
|
||||
#region NSCell Defines
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
[Native]
|
||||
[Availability (Introduced = Platform.Mac_10_0, Deprecated = Platform.Mac_10_10, Message = "Use formatters instead")]
|
||||
public enum NSType : nuint_compat_int {
|
||||
|
@ -229,6 +232,7 @@ namespace XamCore.AppKit {
|
|||
Double = 6,
|
||||
PositiveDouble = 7
|
||||
}
|
||||
#endif
|
||||
|
||||
[Native]
|
||||
public enum NSCellType : nuint_compat_int {
|
||||
|
@ -267,6 +271,10 @@ namespace XamCore.AppKit {
|
|||
ImageBelow,
|
||||
ImageAbove,
|
||||
ImageOverlaps,
|
||||
[Mac (10,12)]
|
||||
ImageLeading,
|
||||
[Mac (10,12)]
|
||||
ImageTrailing,
|
||||
}
|
||||
|
||||
[Native]
|
||||
|
@ -480,8 +488,12 @@ namespace XamCore.AppKit {
|
|||
Pen = 1, PenLower = 2, PenUpper = 4
|
||||
}
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
[Native]
|
||||
public enum NSKey : nuint_compat_int {
|
||||
#else
|
||||
public enum NSKey : int
|
||||
#endif
|
||||
A = 0x00,
|
||||
S = 0x01,
|
||||
D = 0x02,
|
||||
|
@ -675,8 +687,12 @@ namespace XamCore.AppKit {
|
|||
#endif
|
||||
}
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
[Native]
|
||||
public enum NSFunctionKey : nuint_compat_int {
|
||||
#else
|
||||
public enum NSFunctionKey : int {
|
||||
#endif
|
||||
UpArrow = 0xF700,
|
||||
DownArrow = 0xF701,
|
||||
LeftArrow = 0xF702,
|
||||
|
@ -751,8 +767,12 @@ namespace XamCore.AppKit {
|
|||
ModeSwitch = 0xF747
|
||||
}
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
[Native]
|
||||
public enum NSEventSubtype : nuint_compat_int {
|
||||
#else
|
||||
public enum NSEventSubtype : short {
|
||||
#endif
|
||||
WindowExposed = 0,
|
||||
ApplicationActivated = 1,
|
||||
ApplicationDeactivated = 2,
|
||||
|
@ -761,14 +781,28 @@ namespace XamCore.AppKit {
|
|||
AWT = 16
|
||||
}
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
[Native]
|
||||
public enum NSSystemDefinedEvents : nuint_compat_int {
|
||||
#else
|
||||
public enum NSSystemDefinedEvents : short {
|
||||
#endif
|
||||
NSPowerOffEventType = 1
|
||||
}
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
[Native]
|
||||
public enum NSEventMouseSubtype : nuint_compat_int {
|
||||
Mouse, TablePoint, TabletProximity, Touch
|
||||
#else
|
||||
public enum NSEventMouseSubtype : short {
|
||||
#endif
|
||||
Mouse,
|
||||
#if !XAMCORE_4_0
|
||||
TablePoint,
|
||||
#else
|
||||
TabletPoint,
|
||||
#endif
|
||||
TabletProximity, Touch
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -821,8 +855,12 @@ namespace XamCore.AppKit {
|
|||
|
||||
#region NSWindow
|
||||
[Flags]
|
||||
#if !XAMCORE_4_0
|
||||
[Native]
|
||||
public enum NSWindowStyle : nuint_compat_int {
|
||||
#else
|
||||
public enum NSWindowStyle : int {
|
||||
#endif
|
||||
Borderless = 0 << 0,
|
||||
Titled = 1 << 0,
|
||||
Closable = 1 << 1,
|
||||
|
@ -862,12 +900,17 @@ namespace XamCore.AppKit {
|
|||
IgnoresCycle = 1 << 6,
|
||||
FullScreenPrimary = 1 << 7,
|
||||
FullScreenAuxiliary = 1 << 8,
|
||||
FullScreenNone = 1 << 9,
|
||||
[Mac (10, 11)] FullScreenAllowsTiling = 1 << 11,
|
||||
[Mac (10, 11)] FullScreenDisallowsTiling = 1 << 12
|
||||
}
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
[Native]
|
||||
public enum NSWindowNumberListOptions : nuint_compat_int {
|
||||
#else
|
||||
public enum NSWindowNumberListOptions : int {
|
||||
#endif
|
||||
AllApplication = 1 << 0,
|
||||
AllSpaces = 1 << 4
|
||||
}
|
||||
|
@ -881,7 +924,9 @@ namespace XamCore.AppKit {
|
|||
|
||||
[Native]
|
||||
public enum NSWindowButton : nuint_compat_int {
|
||||
CloseButton, MiniaturizeButton, ZoomButton, ToolbarButton, DocumentIconButton, DocumentVersionsButton = 6, FullScreenButton
|
||||
CloseButton, MiniaturizeButton, ZoomButton, ToolbarButton, DocumentIconButton, DocumentVersionsButton = 6,
|
||||
[Availability (Deprecated = Platform.Mac_10_12, Message = "The standard window button for FullScreenButton is always null; use ZoomButton instead")]
|
||||
FullScreenButton
|
||||
}
|
||||
|
||||
[Flags]
|
||||
|
@ -973,6 +1018,7 @@ namespace XamCore.AppKit {
|
|||
}
|
||||
|
||||
[Native]
|
||||
[Availability (Deprecated = Platform.Mac_10_12, Message = "The GradientType property is unused, and setting it has no effect.")]
|
||||
public enum NSGradientType : nuint_compat_int {
|
||||
None,
|
||||
ConcaveWeak,
|
||||
|
@ -1007,6 +1053,37 @@ namespace XamCore.AppKit {
|
|||
PlusDarker,
|
||||
Highlight,
|
||||
PlusLighter,
|
||||
|
||||
[Mac (10, 10)]
|
||||
Multiply,
|
||||
[Mac (10, 10)]
|
||||
Screen,
|
||||
[Mac (10, 10)]
|
||||
Overlay,
|
||||
[Mac (10, 10)]
|
||||
Darken,
|
||||
[Mac (10, 10)]
|
||||
Lighten,
|
||||
[Mac (10, 10)]
|
||||
ColorDodge,
|
||||
[Mac (10, 10)]
|
||||
ColorBurn,
|
||||
[Mac (10, 10)]
|
||||
SoftLight,
|
||||
[Mac (10, 10)]
|
||||
HardLight,
|
||||
[Mac (10, 10)]
|
||||
Difference,
|
||||
[Mac (10, 10)]
|
||||
Exclusion,
|
||||
[Mac (10, 10)]
|
||||
Hue,
|
||||
[Mac (10, 10)]
|
||||
Saturation,
|
||||
[Mac (10, 10)]
|
||||
Color,
|
||||
[Mac (10, 10)]
|
||||
Luminosity
|
||||
}
|
||||
|
||||
[Native]
|
||||
|
@ -1196,8 +1273,12 @@ namespace XamCore.AppKit {
|
|||
Override = 2,
|
||||
}
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
[Native]
|
||||
public enum NSTextMovement : nint {
|
||||
#else
|
||||
public enum NSTextMovement : int {
|
||||
#endif
|
||||
Other = 0,
|
||||
Return = 0x10,
|
||||
Tab = 0x11,
|
||||
|
@ -1357,13 +1438,18 @@ namespace XamCore.AppKit {
|
|||
}
|
||||
|
||||
[Flags]
|
||||
#if !XAMCORE_4_0
|
||||
[Native]
|
||||
public enum NSGlyphStorageOptions : nuint_compat_int {
|
||||
#else
|
||||
public enum NSGlyphStorageOptions : int
|
||||
#endif
|
||||
ShowControlGlyphs = 1,
|
||||
ShowInvisibleGlyphs = 2,
|
||||
WantsBidiLevels = 4
|
||||
}
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
[Availability (Deprecated = Platform.Mac_10_11, Message = "Use NSTextStorageEditActions instead")]
|
||||
[Flags]
|
||||
[Native]
|
||||
|
@ -1371,6 +1457,7 @@ namespace XamCore.AppKit {
|
|||
EditedAttributed = 1,
|
||||
EditedCharacters = 2
|
||||
}
|
||||
#endif
|
||||
|
||||
[Mac (10,11)]
|
||||
[Native]
|
||||
|
@ -1517,19 +1604,25 @@ namespace XamCore.AppKit {
|
|||
}
|
||||
|
||||
[Availability (Introduced = Platform.Mac_10_0, Deprecated = Platform.Mac_10_10, Message = "Use NSAlertButtonReturn instead")]
|
||||
#if !XAMCORE_4_0
|
||||
[Native]
|
||||
public enum NSAlertType : nint {
|
||||
#else
|
||||
public enum NSAlertType : int {
|
||||
#endif
|
||||
ErrorReturn = -2,
|
||||
OtherReturn,
|
||||
AlternateReturn,
|
||||
DefaultReturn
|
||||
}
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
[Availability (Introduced = Platform.Mac_10_0, Deprecated = Platform.Mac_10_10, Message = "Use NSModalResponse instead")]
|
||||
[Native]
|
||||
public enum NSPanelButtonType : nint {
|
||||
Cancel, Ok
|
||||
}
|
||||
#endif
|
||||
|
||||
[Native]
|
||||
public enum NSTableViewColumnAutoresizingStyle : nuint_compat_int {
|
||||
|
@ -1664,7 +1757,9 @@ namespace XamCore.AppKit {
|
|||
Below,
|
||||
Above,
|
||||
Left,
|
||||
Right
|
||||
Right,
|
||||
Leading = Left,
|
||||
Trailing = Right
|
||||
}
|
||||
|
||||
[Native]
|
||||
|
@ -1924,15 +2019,23 @@ namespace XamCore.AppKit {
|
|||
MultiScreen = 81
|
||||
}
|
||||
|
||||
#if XAMCORE_4_0
|
||||
[Native]
|
||||
public enum NSOpenGLProfile : nint {
|
||||
#else
|
||||
public enum NSOpenGLProfile : int {
|
||||
#endif
|
||||
VersionLegacy = 0x1000, // Legacy
|
||||
Version3_2Core = 0x3200, // 3.2 or better
|
||||
Version4_1Core = 0x4100
|
||||
}
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
[Native]
|
||||
public enum NSAlertButtonReturn : nint {
|
||||
#else
|
||||
public enum NSAlertButtonReturn : int {
|
||||
#endif
|
||||
First = 1000,
|
||||
Second = 1001,
|
||||
Third = 1002,
|
||||
|
@ -2259,8 +2362,12 @@ namespace XamCore.AppKit {
|
|||
}
|
||||
|
||||
[Flags]
|
||||
#if !XAMCORE_4_0
|
||||
[Native]
|
||||
public enum NSFontPanelMode : nuint_compat_int {
|
||||
#else
|
||||
public enum NSFontPanelMode : int {
|
||||
#endif
|
||||
FaceMask = 1 << 0,
|
||||
SizeMask = 1 << 1,
|
||||
CollectionMask = 1 << 2,
|
||||
|
@ -2305,7 +2412,8 @@ namespace XamCore.AppKit {
|
|||
PostImageOnFlickr,
|
||||
PostVideoOnVimeo,
|
||||
PostVideoOnYouku,
|
||||
PostVideoOnTudou
|
||||
PostVideoOnTudou,
|
||||
CloudSharing
|
||||
}
|
||||
|
||||
[Flags]
|
||||
|
@ -2367,7 +2475,18 @@ namespace XamCore.AppKit {
|
|||
AppearanceBased,
|
||||
Light,
|
||||
Dark,
|
||||
Titlebar
|
||||
Titlebar,
|
||||
Selection,
|
||||
[Mac (10,11)]
|
||||
Menu,
|
||||
[Mac (10,11)]
|
||||
Popover,
|
||||
[Mac (10,11)]
|
||||
Sidebar,
|
||||
[Mac (10,11)]
|
||||
MediumLight,
|
||||
[Mac (10,11)]
|
||||
UltraDark,
|
||||
}
|
||||
|
||||
[Native]
|
||||
|
@ -2455,4 +2574,116 @@ namespace XamCore.AppKit {
|
|||
ParagraphBreak = (1 << 4),
|
||||
ContainerBreak = (1 << 5)
|
||||
}
|
||||
|
||||
[Mac (10,12)]
|
||||
[Native]
|
||||
public enum NSWindowListOptions : nint {
|
||||
OrderedFrontToBack = (1 << 0)
|
||||
}
|
||||
|
||||
[Mac (10,12)]
|
||||
[Native]
|
||||
public enum NSStatusItemBehavior : nuint
|
||||
{
|
||||
RemovalAllowed = (1 << 1),
|
||||
TerminationOnRemoval = (1 << 2)
|
||||
}
|
||||
|
||||
[Mac (10,12)]
|
||||
[Native]
|
||||
public enum NSWindowTabbingMode : nint
|
||||
{
|
||||
Automatic,
|
||||
Preferred,
|
||||
Disallowed
|
||||
}
|
||||
|
||||
[Mac (10,12)]
|
||||
[Native]
|
||||
public enum NSWindowUserTabbingPreference : nint
|
||||
{
|
||||
Manual,
|
||||
Always,
|
||||
InFullScreen
|
||||
}
|
||||
|
||||
|
||||
[Mac (10, 12)]
|
||||
[Native]
|
||||
public enum NSGridCellPlacement : nint
|
||||
{
|
||||
Inherited = 0,
|
||||
None,
|
||||
Leading,
|
||||
Top = Leading,
|
||||
Trailing,
|
||||
Bottom = Trailing,
|
||||
Center,
|
||||
Fill
|
||||
}
|
||||
|
||||
[Mac (10, 12)]
|
||||
[Native]
|
||||
public enum NSGridRowAlignment : nint
|
||||
{
|
||||
Inherited = 0,
|
||||
None,
|
||||
FirstBaseline,
|
||||
LastBaseline
|
||||
}
|
||||
|
||||
[Mac (10, 12)]
|
||||
[Native]
|
||||
public enum NSImageLayoutDirection : nint
|
||||
{
|
||||
Unspecified = -1,
|
||||
LeftToRight = 2,
|
||||
RightToLeft = 3
|
||||
}
|
||||
|
||||
[Mac (10, 12)]
|
||||
[Native][Flags]
|
||||
public enum NSCloudKitSharingServiceOptions : nuint
|
||||
{
|
||||
Standard = 0,
|
||||
AllowPublic = 1 << 0,
|
||||
AllowPrivate = 1 << 1,
|
||||
AllowReadOnly = 1 << 4,
|
||||
AllowReadWrite = 1 << 5
|
||||
}
|
||||
|
||||
[Mac (10, 12)]
|
||||
[Native]
|
||||
public enum NSDisplayGamut : nint
|
||||
{
|
||||
Srgb = 1,
|
||||
P3,
|
||||
}
|
||||
|
||||
[Mac (10, 12)]
|
||||
[Native]
|
||||
public enum NSTabPosition : nuint
|
||||
{
|
||||
None = 0,
|
||||
Top,
|
||||
Left,
|
||||
Bottom,
|
||||
Right,
|
||||
}
|
||||
|
||||
[Mac (10, 12)]
|
||||
[Native]
|
||||
public enum NSTabViewBorderType : nuint
|
||||
{
|
||||
None = 0,
|
||||
Line,
|
||||
Bezel,
|
||||
}
|
||||
|
||||
[Mac (10, 12)]
|
||||
[Native]
|
||||
public enum NSPasteboardContentsOptions : nuint
|
||||
{
|
||||
CurrentHostOnly = 1,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,10 +32,57 @@ using XamCore.Foundation;
|
|||
namespace XamCore.AppKit {
|
||||
|
||||
public partial class NSButton {
|
||||
NSActionDispatcher dispatcher;
|
||||
|
||||
public new NSButtonCell Cell {
|
||||
get { return (NSButtonCell)base.Cell; }
|
||||
set { base.Cell = value; }
|
||||
}
|
||||
|
||||
[Mac (10,12)]
|
||||
public static NSButton CreateButton (string title, NSImage image, NSAction action)
|
||||
{
|
||||
var dispatcher = new NSActionDispatcher (action);
|
||||
var control = _CreateButton (title, image, dispatcher, NSActionDispatcher.Selector);
|
||||
control.dispatcher = dispatcher;
|
||||
return control;
|
||||
}
|
||||
|
||||
[Mac (10,12)]
|
||||
public static NSButton CreateButton (string title, NSAction action)
|
||||
{
|
||||
var dispatcher = new NSActionDispatcher (action);
|
||||
var control = _CreateButton (title, dispatcher, NSActionDispatcher.Selector);
|
||||
control.dispatcher = dispatcher;
|
||||
return control;
|
||||
}
|
||||
|
||||
[Mac (10,12)]
|
||||
public static NSButton CreateButton (NSImage image, NSAction action)
|
||||
{
|
||||
var dispatcher = new NSActionDispatcher (action);
|
||||
var control = _CreateButton (image, dispatcher, NSActionDispatcher.Selector);
|
||||
control.dispatcher = dispatcher;
|
||||
return control;
|
||||
}
|
||||
|
||||
[Mac (10,12)]
|
||||
public static NSButton CreateCheckbox (string title, NSAction action)
|
||||
{
|
||||
var dispatcher = new NSActionDispatcher (action);
|
||||
var control = _CreateCheckbox (title, dispatcher, NSActionDispatcher.Selector);
|
||||
control.dispatcher = dispatcher;
|
||||
return control;
|
||||
}
|
||||
|
||||
[Mac (10,12)]
|
||||
public static NSButton CreateRadioButton (string title, NSAction action)
|
||||
{
|
||||
var dispatcher = new NSActionDispatcher (action);
|
||||
var control = _CreateRadioButton (title, dispatcher, NSActionDispatcher.Selector);
|
||||
control.dispatcher = dispatcher;
|
||||
return control;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
//
|
||||
// NSMutableFontCollection.cs
|
||||
//
|
||||
// Author:
|
||||
// Chris Hamons <chris.hamons@xamarin.com>
|
||||
//
|
||||
// Copyright 2016 Xamarin Inc. (http://xamarin.com)
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
|
||||
namespace XamCore.AppKit
|
||||
{
|
||||
#if !XAMCORE_4_0
|
||||
public partial class NSMutableFontCollection
|
||||
{
|
||||
[Obsolete ("macOS 10.12 does not allow creation via this constructor")]
|
||||
public NSMutableFontCollection ()
|
||||
{
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
|
@ -12,12 +12,31 @@ using XamCore.Foundation;
|
|||
namespace XamCore.AppKit {
|
||||
|
||||
public partial class NSSegmentedControl {
|
||||
NSActionDispatcher dispatcher;
|
||||
|
||||
public new NSSegmentedCell Cell {
|
||||
get { return (NSSegmentedCell) base.Cell; }
|
||||
set { base.Cell = value; }
|
||||
}
|
||||
|
||||
[Mac (10,12)]
|
||||
public static NSSegmentedControl FromLabels (string[] labels, NSSegmentSwitchTracking trackingMode, NSAction action)
|
||||
{
|
||||
var dispatcher = new NSActionDispatcher (action);
|
||||
var control = _FromLabels (labels, trackingMode, dispatcher, NSActionDispatcher.Selector);
|
||||
control.dispatcher = dispatcher;
|
||||
return control;
|
||||
}
|
||||
|
||||
[Mac (10,12)]
|
||||
public static NSSegmentedControl FromImages (NSImage[] images, NSSegmentSwitchTracking trackingMode, NSAction action)
|
||||
{
|
||||
var dispatcher = new NSActionDispatcher (action);
|
||||
var control = _FromImages (images, trackingMode, dispatcher, NSActionDispatcher.Selector);
|
||||
control.dispatcher = dispatcher;
|
||||
return control;
|
||||
}
|
||||
|
||||
public void UnselectAllSegments()
|
||||
{
|
||||
NSSegmentSwitchTracking current = this.Cell.TrackingMode;
|
||||
|
|
|
@ -55,6 +55,8 @@ namespace XamCore.AppKit
|
|||
case NSSharingServiceName.PostVideoOnTudou:
|
||||
return NSSharingService.GetSharingService(NSSharingServiceNamePostVideoOnTudou);
|
||||
|
||||
case NSSharingServiceName.CloudSharing:
|
||||
return NSSharingService.GetSharingService (NSSharingServiceNameCloudSharing);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
//
|
||||
// NSButton.cs: Support for the NSButton class
|
||||
//
|
||||
// Author:
|
||||
// Michael Hutchinson (mhutchinson@novell.com)
|
||||
//
|
||||
// Copyright 2010, Novell, Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
using System;
|
||||
using XamCore.ObjCRuntime;
|
||||
using XamCore.Foundation;
|
||||
|
||||
namespace XamCore.AppKit {
|
||||
|
||||
public partial class NSSlider {
|
||||
NSActionDispatcher dispatcher;
|
||||
|
||||
[Mac (10,12)]
|
||||
public static NSSlider FromTarget (NSAction action)
|
||||
{
|
||||
var dispatcher = new NSActionDispatcher (action);
|
||||
var control = _FromTarget (dispatcher, NSActionDispatcher.Selector);
|
||||
control.dispatcher = dispatcher;
|
||||
return control;
|
||||
}
|
||||
|
||||
[Mac (10,12)]
|
||||
public static NSSlider FromValue (double value, double minValue, double maxValue, NSAction action)
|
||||
{
|
||||
var dispatcher = new NSActionDispatcher (action);
|
||||
var control = _FromValue (value, minValue, maxValue, dispatcher, NSActionDispatcher.Selector);
|
||||
control.dispatcher = dispatcher;
|
||||
return control;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
//
|
||||
// NSTextTableBlock.cs
|
||||
//
|
||||
// Author:
|
||||
// Chris Hamons <chris.hamons@xamarin.com>
|
||||
//
|
||||
// Copyright 2016 Xamarin Inc. (http://xamarin.com)
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
|
||||
namespace XamCore.AppKit
|
||||
{
|
||||
#if !XAMCORE_4_0
|
||||
public partial class NSTextTableBlock
|
||||
{
|
||||
[Obsolete ("macOS 10.12 does not allow creation via this constructor")]
|
||||
public NSTextTableBlock ()
|
||||
{
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
|
@ -70,6 +70,8 @@ namespace XamCore.AudioToolbox {
|
|||
EnqueueDuringReset = -66632,
|
||||
InvalidOfflineMode = -66626,
|
||||
BufferEnqueuedTwice = -66666,
|
||||
[iOS (10,0), Mac (10,12, onlyOn64: true)]
|
||||
CannotStartYet = -66665,
|
||||
|
||||
// There is countless of not well documented error codes returned
|
||||
QueueStopped = 0x73746f70, // 'stop'
|
||||
|
|
|
@ -40,7 +40,9 @@ namespace XamCore.AudioToolbox {
|
|||
BadPropertySize = 0x2173697a, // '!siz'
|
||||
BadSpecifierSizeError = 0x21737063, // '!spc'
|
||||
SystemSoundUnspecifiedError = -1500,
|
||||
SystemSoundClientTimedOutError = -1501
|
||||
SystemSoundClientTimedOutError = -1501,
|
||||
[iOS (10,0), Mac (10,12, onlyOn64: true)]
|
||||
SystemSoundExceededMaximumDurationError = -1502,
|
||||
}
|
||||
|
||||
enum AudioServicesPropertyKey : uint // UInt32 AudioServicesPropertyID
|
||||
|
|
|
@ -113,6 +113,7 @@ namespace XamCore.AudioToolbox {
|
|||
CafIsLittleEndian = (1 << 1)
|
||||
}
|
||||
|
||||
#if !WATCH
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
unsafe struct AudioFormatInfo
|
||||
{
|
||||
|
@ -120,6 +121,7 @@ namespace XamCore.AudioToolbox {
|
|||
public byte* MagicCookieWeak;
|
||||
public int MagicCookieSize;
|
||||
}
|
||||
#endif
|
||||
|
||||
[DebuggerDisplay ("{FormatName}")]
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
|
@ -170,6 +172,7 @@ namespace XamCore.AudioToolbox {
|
|||
return desc;
|
||||
}
|
||||
|
||||
#if !WATCH
|
||||
public unsafe static AudioChannelLayoutTag[] GetAvailableEncodeChannelLayoutTags (AudioStreamBasicDescription format)
|
||||
{
|
||||
var type_size = sizeof (AudioStreamBasicDescription);
|
||||
|
@ -313,6 +316,7 @@ namespace XamCore.AudioToolbox {
|
|||
return data != 0;
|
||||
}
|
||||
}
|
||||
#endif // !WATCH
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
|
@ -334,6 +338,7 @@ namespace XamCore.AudioToolbox {
|
|||
}
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Flags]
|
||||
public enum AudioChannelFlags : uint_compat_int { // UInt32 in AudioPanningInfo -- AudioFormat.h
|
||||
AllOff = 0,
|
||||
|
@ -465,7 +470,8 @@ namespace XamCore.AudioToolbox {
|
|||
Coord2 = value [2];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if !WATCH
|
||||
public unsafe string Name {
|
||||
get {
|
||||
IntPtr sptr;
|
||||
|
@ -497,6 +503,7 @@ namespace XamCore.AudioToolbox {
|
|||
return new CFString (sptr, true);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
internal unsafe IntPtr ToPointer ()
|
||||
{
|
||||
|
@ -662,7 +669,7 @@ namespace XamCore.AudioToolbox {
|
|||
Unknown = 0xFFFF0000 // needs to be ORed with the actual number of channels
|
||||
}
|
||||
|
||||
#if !COREBUILD
|
||||
#if !COREBUILD && !WATCH
|
||||
public static class AudioChannelLayoutTagExtensions
|
||||
{
|
||||
public static AudioChannelBit? ToAudioChannel (this AudioChannelLayoutTag layoutTag)
|
||||
|
@ -705,6 +712,7 @@ namespace XamCore.AudioToolbox {
|
|||
}
|
||||
}
|
||||
|
||||
#if !WATCH
|
||||
[Advice ("Use the strongly typed AudioTag instead")]
|
||||
public int Tag {
|
||||
get {
|
||||
|
@ -724,11 +732,13 @@ namespace XamCore.AudioToolbox {
|
|||
ChannelUsage = (AudioChannelBit) value;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
public AudioChannelLayoutTag AudioTag;
|
||||
public AudioChannelBit ChannelUsage;
|
||||
public AudioChannelDescription[] Channels;
|
||||
|
||||
#if !WATCH
|
||||
public unsafe string Name {
|
||||
get {
|
||||
IntPtr sptr;
|
||||
|
@ -786,6 +796,7 @@ namespace XamCore.AudioToolbox {
|
|||
Marshal.FreeHGlobal (ptr);
|
||||
return layout;
|
||||
}
|
||||
#endif // !WATCH
|
||||
|
||||
internal static AudioChannelLayout FromHandle (IntPtr handle)
|
||||
{
|
||||
|
@ -823,6 +834,7 @@ namespace XamCore.AudioToolbox {
|
|||
return buffer;
|
||||
}
|
||||
|
||||
#if !WATCH
|
||||
public static AudioFormatError Validate (AudioChannelLayout layout)
|
||||
{
|
||||
if (layout == null)
|
||||
|
@ -954,6 +966,7 @@ namespace XamCore.AudioToolbox {
|
|||
return data;
|
||||
}
|
||||
}
|
||||
#endif // !WATCH
|
||||
|
||||
public NSData AsData ()
|
||||
{
|
||||
|
@ -974,6 +987,7 @@ namespace XamCore.AudioToolbox {
|
|||
TimeRunning = 1 << 1
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
public enum MPEG4ObjectID { // long
|
||||
AacMain = 1,
|
||||
AacLc = 2,
|
||||
|
@ -1097,6 +1111,7 @@ namespace XamCore.AudioToolbox {
|
|||
}
|
||||
}
|
||||
|
||||
#if !WATCH
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct AudioBuffer {
|
||||
public int NumberChannels;
|
||||
|
@ -1121,4 +1136,5 @@ namespace XamCore.AudioToolbox {
|
|||
public /* UInt16 */ ushort Reserved;
|
||||
}
|
||||
#endif
|
||||
#endif // !WATCH
|
||||
}
|
||||
|
|
|
@ -230,7 +230,7 @@ namespace XamCore.AudioToolbox {
|
|||
}
|
||||
set {
|
||||
currentSequence = value;
|
||||
MusicPlayerSetSequence (handle, value.Handle);
|
||||
MusicPlayerSetSequence (handle, value == null ? IntPtr.Zero : value.Handle);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -73,7 +73,9 @@ namespace XamCore.AudioUnit
|
|||
InstanceInvalidated = -66749,
|
||||
NotPermitted = -66748,
|
||||
InitializationTimedOut = -66747,
|
||||
InvalidFormat = -66746
|
||||
InvalidFormat = -66746,
|
||||
[iOS (10,0), Mac (10,12, onlyOn64: true)]
|
||||
RenderTimeout = -66745,
|
||||
}
|
||||
|
||||
public enum AudioCodecManufacturer : uint // Implictly cast to OSType in CoreAudio.framework - CoreAudioTypes.h
|
||||
|
@ -90,7 +92,7 @@ namespace XamCore.AudioUnit
|
|||
Audiofile = 3,
|
||||
EXS24 = 4
|
||||
}
|
||||
|
||||
|
||||
public class AudioUnitException : Exception {
|
||||
static string Lookup (int k)
|
||||
{
|
||||
|
@ -1234,6 +1236,8 @@ namespace XamCore.AudioUnit
|
|||
ClassInfoFromDocument = 50,
|
||||
RequestViewController = 56,
|
||||
ParametersForOverview = 57,
|
||||
[iOS (10,0), Mac (10,12, onlyOn64: true)]
|
||||
SupportsMpe = 58,
|
||||
|
||||
#if MONOMAC
|
||||
FastDispatch = 5,
|
||||
|
@ -1320,6 +1324,8 @@ namespace XamCore.AudioUnit
|
|||
MatrixLevels = 3006,
|
||||
MatrixDimensions = 3009,
|
||||
MeterClipping = 3011,
|
||||
[iOS (10,0), Mac (10,12, onlyOn64: true)]
|
||||
InputAnchorTimeStamp = 3016,
|
||||
|
||||
// SpatialMixer
|
||||
ReverbRoomType = 10,
|
||||
|
@ -1764,6 +1770,10 @@ namespace XamCore.AudioUnit
|
|||
public struct AUParameterObserverToken
|
||||
{
|
||||
public IntPtr ObserverToken;
|
||||
public AUParameterObserverToken (IntPtr observerToken)
|
||||
{
|
||||
ObserverToken = observerToken;
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
|
@ -1969,6 +1979,23 @@ namespace XamCore.AudioUnit
|
|||
DistanceAttenuation = (1 << 2)
|
||||
}
|
||||
|
||||
[iOS (10,0), Mac (10,12, onlyOn64: true)]
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct AUParameterAutomationEvent {
|
||||
public ulong HostTime;
|
||||
public ulong Address;
|
||||
public float Value;
|
||||
public AUParameterAutomationEventType EventType;
|
||||
ulong Reserved;
|
||||
}
|
||||
|
||||
[iOS (10,0), Mac (10,12, onlyOn64: true)]
|
||||
public enum AUParameterAutomationEventType : uint {
|
||||
Value = 0,
|
||||
Touch = 1,
|
||||
Release = 2
|
||||
}
|
||||
|
||||
#if !COREBUILD
|
||||
// Configuration Info Keys
|
||||
public static class AudioUnitConfigurationInfo
|
||||
|
@ -2047,8 +2074,10 @@ namespace XamCore.AudioUnit
|
|||
NetReceive = 0x6E726376, // 'nrcv'
|
||||
#endif
|
||||
}
|
||||
#if !XAMCORE_4_0 && !MONOMAC && !COREBUILD
|
||||
#if !XAMCORE_4_0 && !COREBUILD
|
||||
#if XAMCORE_2_0 || !MONOMAC
|
||||
[Obsolete ("Use AUImplementorStringFromValueCallback instead")]
|
||||
public delegate NSString _AUImplementorStringFromValueCallback (AUParameter param, IntPtr value);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
//
|
||||
// CXProvider extensions and syntax sugar
|
||||
//
|
||||
// Authors:
|
||||
// Alex Soto <alex.soto@xamarin.com>
|
||||
//
|
||||
// Copyright 2016 Xamarin Inc. All rights reserved.
|
||||
//
|
||||
|
||||
using System;
|
||||
using XamCore.Foundation;
|
||||
using XamCore.ObjCRuntime;
|
||||
|
||||
#if XAMCORE_2_0
|
||||
namespace XamCore.CallKit {
|
||||
public partial class CXProvider {
|
||||
|
||||
public CXCallAction [] GetPendingCallActions<T> (NSUuid callUuid)
|
||||
{
|
||||
return GetPendingCallActions (new Class (typeof (T)), callUuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // XAMCORE_2_0
|
|
@ -4,7 +4,7 @@
|
|||
// Authors:
|
||||
// Alex Soto <alex.soto@xamarin.com>
|
||||
//
|
||||
// Copyright 2015 Xamarin Inc. All rights reserved.
|
||||
// Copyright 2015-2016 Xamarin Inc. All rights reserved.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
@ -18,7 +18,12 @@ namespace XamCore.ClockKit {
|
|||
ModularLarge,
|
||||
UtilitarianSmall,
|
||||
UtilitarianLarge,
|
||||
CircularSmall
|
||||
CircularSmall,
|
||||
// nothing has the value of 5
|
||||
[Watch (3,0)]
|
||||
UtilitarianSmallFlat = 6,
|
||||
[Watch (3,0)]
|
||||
ExtraLarge = 7,
|
||||
}
|
||||
|
||||
[Native]
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
// Copyright 2016, Xamarin Inc. All rights reserved.
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
#if !COREBUILD
|
||||
|
||||
using XamCore.CloudKit;
|
||||
using XamCore.ObjCRuntime;
|
||||
using XamCore.Foundation;
|
||||
using System;
|
||||
|
||||
namespace XamCore.CloudKit {
|
||||
|
||||
|
||||
#if !XAMCORE_4_0 && !WATCH
|
||||
public partial class CKOperation {
|
||||
|
||||
[Obsoleted (PlatformName.iOS, 9,3, message: "Do not use; this API was removed in iOS 9.3 and will always return 0")]
|
||||
|
@ -16,6 +18,49 @@ namespace XamCore.CloudKit {
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class CKNotificationID {
|
||||
|
||||
[Obsolete ("This type is not meant to be created by user code")]
|
||||
public CKNotificationID ()
|
||||
{
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if XAMCORE_2_0 || !MONOMAC
|
||||
public partial class CKFetchNotificationChangesOperation {
|
||||
|
||||
// `init` does not work on watchOS but we can keep compatibility with a different init
|
||||
public CKFetchNotificationChangesOperation () : this ((CKServerChangeToken) null)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
public CKModifyRecordZonesOperation () : this (null, null)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public partial class CKModifyRecordsOperation {
|
||||
|
||||
// `init` does not work on watchOS but we can keep compatibility with a different init
|
||||
public CKModifyRecordsOperation () : this (null, null)
|
||||
{
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using XamCore.ObjCRuntime;
|
||||
using XamCore.ObjCRuntime;
|
||||
using XamCore.Foundation;
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
using XamCore.ObjCRuntime;
|
||||
using XamCore.Foundation;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace XamCore.CloudKit
|
||||
{
|
||||
#if XAMCORE_2_0
|
||||
|
||||
public partial class CKUserIdentityLookupInfo
|
||||
{
|
||||
// extra parameter to get a unique signature for a string argument
|
||||
CKUserIdentityLookupInfo (string id, int type)
|
||||
{
|
||||
var h = type == 0 ? _FromEmail (id) : _FromPhoneNumber (id);
|
||||
InitializeHandle (h);
|
||||
}
|
||||
|
||||
public static CKUserIdentityLookupInfo FromEmail (string email)
|
||||
{
|
||||
if (string.IsNullOrEmpty (email))
|
||||
throw new ArgumentNullException (nameof (email));
|
||||
return new CKUserIdentityLookupInfo (email, 0);
|
||||
}
|
||||
|
||||
public static CKUserIdentityLookupInfo FromPhoneNumber (string phoneNumber)
|
||||
{
|
||||
if (string.IsNullOrEmpty (phoneNumber))
|
||||
throw new ArgumentNullException (nameof (phoneNumber));
|
||||
return new CKUserIdentityLookupInfo (phoneNumber, 1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
|
@ -6,6 +6,7 @@ using System;
|
|||
namespace XamCore.CloudKit
|
||||
{
|
||||
// NSInteger -> CKContainer.h
|
||||
[Watch (3,0)]
|
||||
[iOS (8,0)]
|
||||
[Availability (Platform.Mac_10_10)]
|
||||
[Native]
|
||||
|
@ -17,6 +18,7 @@ namespace XamCore.CloudKit
|
|||
}
|
||||
|
||||
// NSUInteger -> CKContainer.h
|
||||
[Watch (3,0)]
|
||||
[iOS (8,0)]
|
||||
[Availability (Platform.Mac_10_10)]
|
||||
[Native]
|
||||
|
@ -26,6 +28,7 @@ namespace XamCore.CloudKit
|
|||
}
|
||||
|
||||
// NSInteger -> CKContainer.h
|
||||
[Watch (3,0)]
|
||||
[iOS (8,0)]
|
||||
[Availability (Platform.Mac_10_10)]
|
||||
[Native]
|
||||
|
@ -37,6 +40,7 @@ namespace XamCore.CloudKit
|
|||
}
|
||||
|
||||
// NSInteger -> CKError.h
|
||||
[Watch (3,0)]
|
||||
[iOS (8,0)]
|
||||
[Availability (Platform.Mac_10_10)]
|
||||
[Native]
|
||||
|
@ -71,9 +75,15 @@ namespace XamCore.CloudKit
|
|||
ZoneNotFound = 26,
|
||||
LimitExceeded = 27,
|
||||
UserDeletedZone = 28,
|
||||
[iOS (10,0), TV (10,0), Mac (10,12)] TooManyParticipants = 29,
|
||||
[iOS (10,0), TV (10,0), Mac (10,12)] AlreadyShared = 30,
|
||||
[iOS (10,0), TV (10,0), Mac (10,12)] ReferenceViolation = 31,
|
||||
[iOS (10,0), TV (10,0), Mac (10,12)] ManagedAccountRestricted = 32,
|
||||
[iOS (10,0), TV (10,0), Mac (10,12)] ParticipantMayNeedVerification = 33,
|
||||
}
|
||||
|
||||
// NSInteger -> CKModifyRecordsOperation.h
|
||||
[Watch (3,0)]
|
||||
[iOS (8,0)]
|
||||
[Availability (Platform.Mac_10_10)]
|
||||
[Native]
|
||||
|
@ -84,16 +94,19 @@ namespace XamCore.CloudKit
|
|||
}
|
||||
|
||||
// NSInteger -> CKNotification.h
|
||||
[Watch (3,0)]
|
||||
[iOS (8,0)]
|
||||
[Availability (Platform.Mac_10_10)]
|
||||
[Native]
|
||||
public enum CKNotificationType : nint {
|
||||
Query = 1,
|
||||
RecordZone = 2,
|
||||
ReadNotification = 3
|
||||
ReadNotification = 3,
|
||||
[iOS (10,0), TV (10,0), Mac (10,12)] Database = 4,
|
||||
}
|
||||
|
||||
// NSInteger -> CKNotification.h
|
||||
[Watch (3,0)]
|
||||
[iOS (8,0)]
|
||||
[Availability (Platform.Mac_10_10)]
|
||||
[Native]
|
||||
|
@ -104,16 +117,19 @@ namespace XamCore.CloudKit
|
|||
}
|
||||
|
||||
// NSUInteger -> CKRecordZone.h
|
||||
[Watch (3,0)]
|
||||
[iOS (8,0)]
|
||||
[Availability (Platform.Mac_10_10)]
|
||||
[Flags]
|
||||
[Native]
|
||||
public enum CKRecordZoneCapabilities : nuint {
|
||||
FetchChanges = 1 << 0,
|
||||
Atomic = 1 << 1
|
||||
Atomic = 1 << 1,
|
||||
[iOS (10,0), Watch (3,0), TV (10,0), Mac (10,12)] Sharing = 1 << 2,
|
||||
}
|
||||
|
||||
// NSUInteger -> CKReference.h
|
||||
[Watch (3,0)]
|
||||
[iOS (8,0)]
|
||||
[Availability (Platform.Mac_10_10)]
|
||||
[Native]
|
||||
|
@ -123,17 +139,20 @@ namespace XamCore.CloudKit
|
|||
}
|
||||
|
||||
// NSInteger -> CKSubscription.h
|
||||
[NoWatch]
|
||||
[iOS (8,0)]
|
||||
[Availability (Platform.Mac_10_10)]
|
||||
[Native]
|
||||
public enum CKSubscriptionType : nint {
|
||||
Query = 1,
|
||||
RecordZone = 2
|
||||
RecordZone = 2,
|
||||
[iOS (10,0), TV (10,0), Mac (10,12)] Database = 3,
|
||||
}
|
||||
|
||||
// NSInteger -> CKSubscription.h
|
||||
[iOS (8,0)]
|
||||
[Availability (Platform.Mac_10_10)]
|
||||
|
||||
[NoWatch]
|
||||
[Availability (Introduced = Platform.iOS_8_0 | Platform.Mac_10_10 , Deprecated = Platform.iOS_10_0 | Platform.Mac_10_12, Message = "Use CKQuerySubscriptionOptions instead")]
|
||||
[Flags]
|
||||
[Native]
|
||||
public enum CKSubscriptionOptions : nuint {
|
||||
|
@ -142,6 +161,58 @@ namespace XamCore.CloudKit
|
|||
FiresOnRecordDeletion = 1 << 2,
|
||||
FiresOnce = 1 << 3,
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[iOS (10,0), Mac (10,12)]
|
||||
[Native]
|
||||
public enum CKDatabaseScope : nint
|
||||
{
|
||||
Public = 1,
|
||||
Private,
|
||||
Shared,
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[iOS (10,0), Mac (10,12)]
|
||||
[Native]
|
||||
public enum CKShareParticipantAcceptanceStatus : nint
|
||||
{
|
||||
Unknown,
|
||||
Pending,
|
||||
Accepted,
|
||||
Removed,
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[iOS (10,0), Mac (10,12)]
|
||||
[Native]
|
||||
public enum CKShareParticipantPermission : nint
|
||||
{
|
||||
Unknown,
|
||||
None,
|
||||
ReadOnly,
|
||||
ReadWrite,
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[iOS (10,10), Mac (10,12)]
|
||||
[Native]
|
||||
public enum CKShareParticipantType : nint
|
||||
{
|
||||
Unknown = 0,
|
||||
Owner = 1,
|
||||
PrivateUser = 3,
|
||||
PublicUser = 4,
|
||||
}
|
||||
|
||||
[NoWatch]
|
||||
[iOS (10,0), Mac(10,12)]
|
||||
[Native]
|
||||
public enum CKQuerySubscriptionOptions : nuint
|
||||
{
|
||||
RecordCreation = 1 << 0,
|
||||
RecordUpdate = 1 << 1,
|
||||
RecordDeletion = 1 << 2,
|
||||
FiresOnce = 1 << 3,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -96,5 +96,14 @@ namespace MonoTouch {
|
|||
public const string GameplayKitLibrary = "/System/Library/Frameworks/GameplayKit.framework/GameplayKit";
|
||||
// iOS 9.3
|
||||
public const string HealthKitUILibrary = "/System/Library/Frameworks/HealthKitUI.framework/HealthKit";
|
||||
// iOS 10.0
|
||||
public const string CallKitLibrary = "/System/Library/Frameworks/CallKit.framework/CallKit";
|
||||
public const string MessagesLibrary = "/System/Library/Frameworks/Messages.framework/Messages";
|
||||
public const string SpeechLibrary = "/System/Library/Frameworks/Speech.framework/";
|
||||
public const string VideoSubscriberAccountLibrary = "/System/Library/Frameworks/VideoSubscriberAccount.framework/VideoSubscriberAccount";
|
||||
public const string UserNotificationsLibrary = "/System/Library/Frameworks/UserNotifications.framework/UserNotifications";
|
||||
public const string UserNotificationsUILibrary = "/System/Library/Frameworks/UserNotificationsUI.framework/UserNotificationsUI";
|
||||
public const string IntentsLibrary = "/System/Library/Frameworks/Intents.framework/Intents";
|
||||
public const string IntentsUILibrary = "/System/Library/Frameworks/IntentsUI.framework/IntentsUI";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,5 +117,11 @@ namespace MonoMac {
|
|||
public const string CoreAudioKitLibrary = "/System/Library/Frameworks/CoreAudioKit.framework/CoreAudioKit";
|
||||
public const string MediaToolboxLibrary = "/System/Library/Frameworks/MediaToolbox.framework/MediaToolbox";
|
||||
public const string MediaLibraryLibrary = "/System/Library/Frameworks/MediaLibrary.framework/MediaLibrary";
|
||||
|
||||
public const string SafariServicesLibrary = "/System/Library/Frameworks/SafariServices.framework/SafariServices";
|
||||
|
||||
// macOS 10.12
|
||||
public const string PhotosLibrary = "/System/Library/Frameworks/Photos.framework/Photos";
|
||||
public const string IntentsLibrary = "/System/Library/Frameworks/Intents.framework/Intents";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace ObjCRuntime {
|
|||
public const string GameKitLibrary = "/System/Library/Frameworks/GameKit.framework/GameKit";
|
||||
public const string GameplayKitLibrary = "/System/Library/Frameworks/GameplayKit.framework/GameplayKit";
|
||||
public const string GLKitLibrary = "/System/Library/Frameworks/GLKit.framework/GLKit";
|
||||
public const string HomeKitLibrary = "/System/Library/Frameworks/HomeKit.framework/HomeKit";
|
||||
public const string ImageIOLibrary = "/System/Library/Frameworks/ImageIO.framework/ImageIO";
|
||||
public const string JavaScriptCoreLibrary = "/System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore";
|
||||
public const string MediaAccessibilityLibrary = "/System/Library/Frameworks/MediaAccessibility.framework/MediaAccessibility";
|
||||
|
@ -57,5 +58,13 @@ namespace ObjCRuntime {
|
|||
|
||||
// TVOS 9.2
|
||||
public const string MapKitLibrary = "/System/Library/Frameworks/MapKit.framework/MapKit";
|
||||
|
||||
// TVOS 10.0
|
||||
public const string ExternalAccessoryLibrary = "/System/Library/Frameworks/ExternalAccessory.framework/ExternalAccessory";
|
||||
public const string MultipeerConnectivityLibrary = "/System/Library/Frameworks/MultipeerConnectivity.framework/MultipeerConnectivity";
|
||||
public const string PhotosLibrary = "/System/Library/Frameworks/Photos.framework/Photos";
|
||||
public const string ReplayKitLibrary = "/System/Library/Frameworks/ReplayKit.framework/ReplayKit";
|
||||
public const string UserNotificationsLibrary = "/System/Library/Frameworks/UserNotifications.framework/UserNotifications";
|
||||
public const string VideoSubscriberAccountLibrary = "/System/Library/Frameworks/VideoSubscriberAccount.framework/VideoSubscriberAccount";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,5 +31,13 @@ namespace ObjCRuntime {
|
|||
public const string UIKitLibrary = "/System/Library/Frameworks/UIKit.framework/UIKit";
|
||||
public const string WatchConnectivityLibrary = "/System/Library/Frameworks/WatchConnectivity.framework/WatchConnectivity";
|
||||
public const string WatchKitLibrary = "/System/Library/Frameworks/WatchKit.framework/WatchKit";
|
||||
|
||||
// WatchOS 3.0
|
||||
public const string AVFoundationLibrary = "/System/Library/Frameworks/AVFoundation.framework/AVFoundation";
|
||||
public const string CloudKitLibrary = "/System/Library/Frameworks/CloudKit.framework/CloudKit";
|
||||
public const string GameKitLibrary = "/System/Library/Frameworks/GameKit.framework/GameKit";
|
||||
public const string SceneKitLibrary = "/System/Library/Frameworks/SceneKit.framework/SceneKit";
|
||||
public const string SpriteKitLibrary = "/System/Library/Frameworks/SpriteKit.framework/SpriteKit";
|
||||
public const string UserNotificationsLibrary = "/System/Library/Frameworks/UserNotifications.framework/UserNotifications";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -142,6 +142,11 @@ namespace XamCore.CoreAnimation {
|
|||
}
|
||||
}
|
||||
#endif
|
||||
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
|
||||
public CAContentsFormat ContentsFormat {
|
||||
get { return CAContentsFormatExtensions.GetValue (_ContentsFormat); }
|
||||
set { _ContentsFormat = value.GetConstant (); }
|
||||
}
|
||||
}
|
||||
|
||||
#if !MONOMAC
|
||||
|
|
|
@ -141,11 +141,18 @@ namespace XamCore.CoreAnimation {
|
|||
[DllImport(Constants.QuartzLibrary)]
|
||||
extern static CATransform3D CATransform3DInvert (CATransform3D t);
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
[Obsolete ("Use Invert() as the argument to this method is unused.")]
|
||||
public CATransform3D Invert (CATransform3D t)
|
||||
{
|
||||
return CATransform3DInvert (this);
|
||||
}
|
||||
|
||||
#endif
|
||||
public CATransform3D Invert ()
|
||||
{
|
||||
return CATransform3DInvert (this);
|
||||
}
|
||||
|
||||
[DllImport(Constants.QuartzLibrary, EntryPoint="CATransform3DMakeAffineTransform")]
|
||||
public extern static CATransform3D MakeFromAffine (CGAffineTransform m);
|
||||
|
||||
|
|
|
@ -113,4 +113,23 @@ namespace XamCore.CoreBluetooth {
|
|||
}
|
||||
}
|
||||
#endif
|
||||
#if !MONOMAC && !XAMCORE_4_0
|
||||
public partial class CBCentralManager {
|
||||
|
||||
public virtual CBCentralManagerState State {
|
||||
get {
|
||||
return (CBCentralManagerState)base.State;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public partial class CBPeripheralManager {
|
||||
|
||||
public virtual CBPeripheralManagerState State {
|
||||
get {
|
||||
return (CBPeripheralManagerState)base.State;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -13,9 +13,13 @@ using XamCore.ObjCRuntime;
|
|||
|
||||
namespace XamCore.CoreBluetooth {
|
||||
|
||||
// NSInteger -> CBCentralManager.h
|
||||
#if !MONOMAC
|
||||
[iOS (10,0)]
|
||||
[Native]
|
||||
public enum CBCentralManagerState : nint {
|
||||
public enum CBManagerState : nint {
|
||||
#else
|
||||
internal enum CBManagerState {
|
||||
#endif
|
||||
Unknown = 0,
|
||||
Resetting,
|
||||
Unsupported,
|
||||
|
@ -24,15 +28,30 @@ namespace XamCore.CoreBluetooth {
|
|||
PoweredOn
|
||||
}
|
||||
|
||||
// NSInteger -> CBCentralManager.h
|
||||
[Introduced (PlatformName.iOS, 5, 0)]
|
||||
[Deprecated (PlatformName.iOS, 10, 0, message: "Use CBManagerState instead")]
|
||||
[Native]
|
||||
public enum CBCentralManagerState : nint {
|
||||
Unknown = CBManagerState.Unknown,
|
||||
Resetting = CBManagerState.Resetting,
|
||||
Unsupported = CBManagerState.Unsupported,
|
||||
Unauthorized = CBManagerState.Unauthorized,
|
||||
PoweredOff = CBManagerState.PoweredOff,
|
||||
PoweredOn = CBManagerState.PoweredOn
|
||||
}
|
||||
|
||||
// NSInteger -> CBPeripheralManager.h
|
||||
[Introduced (PlatformName.iOS, 6, 0)]
|
||||
[Deprecated (PlatformName.iOS, 10, 0, message: "Use CBManagerState instead")]
|
||||
[Native]
|
||||
public enum CBPeripheralManagerState : nint {
|
||||
Unknown = 0,
|
||||
Resetting,
|
||||
Unsupported,
|
||||
Unauthorized,
|
||||
PoweredOff,
|
||||
PoweredOn
|
||||
Unknown = CBManagerState.Unknown,
|
||||
Resetting = CBManagerState.Resetting,
|
||||
Unsupported = CBManagerState.Unsupported,
|
||||
Unauthorized = CBManagerState.Unauthorized,
|
||||
PoweredOff = CBManagerState.PoweredOff,
|
||||
PoweredOn = CBManagerState.PoweredOn
|
||||
}
|
||||
|
||||
// NSInteger -> CBPeripheralManager.h
|
||||
|
@ -44,6 +63,7 @@ namespace XamCore.CoreBluetooth {
|
|||
Disconnecting
|
||||
}
|
||||
|
||||
#if !MONOMAC || !XAMCORE_4_0
|
||||
// NSInteger -> CBPeripheralManager.h
|
||||
[Native]
|
||||
public enum CBPeripheralManagerAuthorizationStatus : nint {
|
||||
|
@ -52,6 +72,7 @@ namespace XamCore.CoreBluetooth {
|
|||
Denied,
|
||||
Authorized,
|
||||
}
|
||||
#endif
|
||||
|
||||
// NSUInteger -> CBCharacteristic.h
|
||||
[Flags]
|
||||
|
|
|
@ -131,4 +131,58 @@ namespace XamCore.CoreData {
|
|||
ObjectIDs = 1,
|
||||
Count = 2
|
||||
}
|
||||
|
||||
[Native]
|
||||
public enum ValidationErrorType : nuint {
|
||||
ManagedObjectValidation = 1550,
|
||||
MultipleErrors = 1560,
|
||||
MissingMandatoryProperty = 1570,
|
||||
RelationshipLacksMinimumCount = 1580,
|
||||
RelationshipExceedsMaximumCount = 1590,
|
||||
RelationshipDeniedDelete = 1600,
|
||||
NumberTooLarge = 1610,
|
||||
NumberTooSmall = 1620,
|
||||
DateTooLate = 1630,
|
||||
DateTooSoon = 1640,
|
||||
InvalidDate = 1650,
|
||||
StringTooLong = 1660,
|
||||
StringTooShort = 1670,
|
||||
StringPatternMatching = 1680
|
||||
}
|
||||
|
||||
[Native]
|
||||
public enum ObjectGraphManagementErrorType : nuint {
|
||||
ManagedObjectContextLocking = 132000,
|
||||
PersistentStoreCoordinatorLocking = 132010,
|
||||
ManagedObjectReferentialIntegrity = 133000,
|
||||
ManagedObjectExternalRelationship = 133010,
|
||||
ManagedObjectMerge = 133020
|
||||
}
|
||||
|
||||
[Native]
|
||||
public enum PersistentStoreErrorType : nuint {
|
||||
InvalidType = 134000,
|
||||
TypeMismatch = 134010,
|
||||
IncompatibleSchema = 134020,
|
||||
Save = 134030,
|
||||
IncompleteSave = 134040,
|
||||
SaveConflicts = 134050,
|
||||
Operation = 134070,
|
||||
Open = 134080,
|
||||
Timeout = 134090,
|
||||
IncompatibleVersionHash = 134100
|
||||
}
|
||||
|
||||
[Native]
|
||||
public enum MigrationErrorType {
|
||||
Migration = 134110,
|
||||
MigrationCancelled = 134120,
|
||||
MigrationMissingSourceModel = 134130,
|
||||
MigrationMissingMappingModel = 134140,
|
||||
MigrationManagerSourceStore = 134150,
|
||||
MigrationManagerDestinationStore = 134160,
|
||||
EntityMigrationPolicy = 134170,
|
||||
InferredMappingModel = 134190,
|
||||
ExternalRecordImport = 134200
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,153 @@
|
|||
//
|
||||
// CGColorConversionInfo.cs: Implements the managed CGColorConversionInfo
|
||||
//
|
||||
// Copyright 2016 Xamarin Inc.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using XamCore.ObjCRuntime;
|
||||
|
||||
#if !COREBUILD
|
||||
using XamCore.CoreFoundation;
|
||||
using XamCore.Foundation;
|
||||
#endif
|
||||
|
||||
namespace XamCore.CoreGraphics {
|
||||
|
||||
// uint32_t enum -> CGColorConversionInfo.h
|
||||
[iOS (10,0)][TV (10,0)][Watch (3,0)][Mac (10,12)]
|
||||
public enum CGColorConversionInfoTransformType : uint {
|
||||
FromSpace = 0,
|
||||
ToSpace,
|
||||
ApplySpace
|
||||
}
|
||||
|
||||
[iOS (10,0)][TV (10,0)][Watch (3,0)][Mac (10,12)]
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct GColorConversionInfoTriple {
|
||||
public CGColorSpace Space;
|
||||
public CGColorConversionInfoTransformType Transform;
|
||||
public CGColorRenderingIntent Intent;
|
||||
}
|
||||
|
||||
// CGColorConverter.h
|
||||
[iOS (10,0)][TV (10,0)][Watch (3,0)][Mac (10,12)]
|
||||
public partial class CGColorConversionInfo : INativeObject, IDisposable {
|
||||
|
||||
/* invoked by marshallers */
|
||||
internal CGColorConversionInfo (IntPtr handle)
|
||||
{
|
||||
Handle = handle;
|
||||
}
|
||||
|
||||
[Preserve (Conditional=true)]
|
||||
internal CGColorConversionInfo (IntPtr handle, bool owns)
|
||||
{
|
||||
Handle = handle;
|
||||
if (!owns)
|
||||
CFObject.CFRetain (Handle);
|
||||
}
|
||||
|
||||
[DllImport(Constants.CoreGraphicsLibrary)]
|
||||
extern static /* CGColorConversionInfoRef __nullable */ IntPtr CGColorConversionInfoCreateFromList (/* __nullable CFDictionaryRef */ IntPtr options,
|
||||
/* CGColorSpaceRef __nullable */ IntPtr space1, CGColorConversionInfoTransformType transform1, CGColorRenderingIntent intent1,
|
||||
/* CGColorSpaceRef __nullable */ IntPtr space2, CGColorConversionInfoTransformType transform2, CGColorRenderingIntent intent2,
|
||||
/* CGColorSpaceRef __nullable */ IntPtr space3, CGColorConversionInfoTransformType transform3, CGColorRenderingIntent intent3,
|
||||
IntPtr lastSpaceMarker);
|
||||
|
||||
#if !MONOMAC && !WATCH
|
||||
// https://developer.apple.com/library/ios/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARM64FunctionCallingConventions.html
|
||||
// Declare dummies until we're on the stack then the arguments
|
||||
// <quote>C language requires arguments smaller than int to be promoted before a call, but beyond that, unused bytes on the stack are not specified by this ABI</quote>
|
||||
[DllImport(Constants.CoreGraphicsLibrary, EntryPoint="CGColorConversionInfoCreateFromList")]
|
||||
extern static /* CGColorConversionInfoRef __nullable */ IntPtr CGColorConversionInfoCreateFromList_arm64 (/* __nullable CFDictionaryRef */ IntPtr options,
|
||||
IntPtr space1, long transform1, long intent1, // varargs starts after them
|
||||
IntPtr dummy4, IntPtr dummy5, IntPtr dummy6, IntPtr dummy7, // dummies so the rest goes to the stack
|
||||
IntPtr space2, long transform2, long intent2,
|
||||
IntPtr space3, long transform3, long intent3,
|
||||
IntPtr lastSpaceMarker);
|
||||
#endif
|
||||
|
||||
static GColorConversionInfoTriple empty = new GColorConversionInfoTriple ();
|
||||
|
||||
|
||||
public CGColorConversionInfo (CGColorConversionOptions options, params GColorConversionInfoTriple [] triples)
|
||||
: this (options?.Dictionary, triples)
|
||||
{
|
||||
}
|
||||
|
||||
public CGColorConversionInfo (NSDictionary options, params GColorConversionInfoTriple [] triples)
|
||||
{
|
||||
// the API won't return a valid instance if no triple is given, i.e. at least one is needed.
|
||||
// `null` is accepted to mark the end of the list, not to make it optional
|
||||
if ((triples == null) || (triples.Length == 0))
|
||||
throw new ArgumentNullException ("triples");
|
||||
if (triples.Length > 3)
|
||||
throw new ArgumentException ("A maximum of 3 triples are supported");
|
||||
|
||||
IntPtr o = NativeObjectHelper.GetHandle (options);
|
||||
var first = triples [0]; // there's always one
|
||||
var second = triples.Length > 1 ? triples [1] : empty;
|
||||
var third = triples.Length > 2 ? triples [2] : empty;
|
||||
#if !MONOMAC && !WATCH
|
||||
if ((IntPtr.Size == 8) && (Runtime.Arch == Arch.DEVICE)) {
|
||||
Handle = CGColorConversionInfoCreateFromList_arm64 (o, NativeObjectHelper.GetHandle (first.Space), (long) first.Transform, (long) first.Intent,
|
||||
IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero,
|
||||
NativeObjectHelper.GetHandle (second.Space), (long) second.Transform, (long) second.Intent,
|
||||
NativeObjectHelper.GetHandle (third.Space), (long) third.Transform, (long) third.Intent,
|
||||
IntPtr.Zero);
|
||||
} else {
|
||||
#endif
|
||||
Handle = CGColorConversionInfoCreateFromList (o, NativeObjectHelper.GetHandle (first.Space), first.Transform, first.Intent,
|
||||
NativeObjectHelper.GetHandle (second.Space), second.Transform, second.Intent,
|
||||
NativeObjectHelper.GetHandle (third.Space), third.Transform, third.Intent,
|
||||
IntPtr.Zero);
|
||||
#if !MONOMAC && !WATCH
|
||||
}
|
||||
#endif
|
||||
if (Handle == IntPtr.Zero)
|
||||
throw new Exception ("Failed to create CGColorConverter");
|
||||
}
|
||||
|
||||
[iOS (10,0)][Mac (10,12)]
|
||||
[DllImport(Constants.CoreGraphicsLibrary)]
|
||||
extern static IntPtr CGColorConversionInfoCreate (/* cg_nullable CGColorSpaceRef */ IntPtr src, /* cg_nullable CGColorSpaceRef */ IntPtr dst);
|
||||
|
||||
[iOS (10,0)][Mac (10,12)]
|
||||
public CGColorConversionInfo (CGColorSpace src, CGColorSpace dst)
|
||||
{
|
||||
// API accept null arguments but returns null, which we can't use
|
||||
if (src == null)
|
||||
throw new ArgumentNullException (nameof (src));
|
||||
if (dst == null)
|
||||
throw new ArgumentNullException (nameof (dst));
|
||||
Handle = CGColorConversionInfoCreate (src.Handle, dst.Handle);
|
||||
|
||||
if (Handle == IntPtr.Zero)
|
||||
throw new Exception ("Failed to create CGColorConversionInfo");
|
||||
}
|
||||
|
||||
~CGColorConversionInfo ()
|
||||
{
|
||||
Dispose (false);
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
Dispose (true);
|
||||
GC.SuppressFinalize (this);
|
||||
}
|
||||
|
||||
public IntPtr Handle { get; private set; }
|
||||
|
||||
protected virtual void Dispose (bool disposing)
|
||||
{
|
||||
if (Handle != IntPtr.Zero){
|
||||
CFObject.CFRelease (Handle);
|
||||
Handle = IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@
|
|||
// Copyright 2016 Xamarin Inc.
|
||||
//
|
||||
|
||||
#if !MONOMAC
|
||||
#if !MONOMAC && !WATCH
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
@ -21,16 +21,17 @@ using XamCore.Foundation;
|
|||
namespace XamCore.CoreGraphics {
|
||||
|
||||
// uint32_t enum -> CGColorConverter.h
|
||||
[TV (9,2)]
|
||||
[iOS (9,3)]
|
||||
[TV (9,2)][Obsoleted (PlatformName.TvOS, 10,0, message: "Replaced by CGColorConversionInfoTransformType. This code does not work on tvOS 10+")]
|
||||
[iOS (9,3)][Obsoleted (PlatformName.iOS, 10,0, message: "Replaced by CGColorConversionInfoTransformType. This code does not work on iOS 10+")]
|
||||
[Obsolete ("Use CGColorConversionInfoTransformType")]
|
||||
public enum CGColorConverterTransformType : uint {
|
||||
FromSpace,
|
||||
ToSpace,
|
||||
ApplySpace
|
||||
}
|
||||
|
||||
[TV (9,2)]
|
||||
[iOS (9,3)]
|
||||
[TV (9,2)][Obsoleted (PlatformName.TvOS, 10,0, message: "Replaced by GColorConversionInfoTriple. This code does not work on tvOS 10+")]
|
||||
[iOS (9,3)][Obsoleted (PlatformName.iOS, 10,0, message: "Replaced by GColorConversionInfoTriple. This code does not work on iOS 10+")]
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct CGColorConverterTriple {
|
||||
public CGColorSpace Space;
|
||||
|
@ -39,120 +40,42 @@ namespace XamCore.CoreGraphics {
|
|||
}
|
||||
|
||||
// CGColorConverter.h
|
||||
[TV (9,2)]
|
||||
[iOS (9,3)]
|
||||
[TV (9,2)][Obsoleted (PlatformName.TvOS, 10,0, message: "Replaced by CGColorConversionInfo. This code does not work on tvOS 10+")]
|
||||
[iOS (9,3)][Obsoleted (PlatformName.iOS, 10,0, message: "Replaced by CGColorConversionInfo. This code does not work on iOS 10+")]
|
||||
public class CGColorConverter : INativeObject, IDisposable
|
||||
{
|
||||
IntPtr handle;
|
||||
|
||||
/* invoked by marshallers */
|
||||
internal CGColorConverter (IntPtr handle)
|
||||
{
|
||||
this.handle = handle;
|
||||
}
|
||||
|
||||
[Preserve (Conditional=true)]
|
||||
internal CGColorConverter (IntPtr handle, bool owns)
|
||||
{
|
||||
this.handle = handle;
|
||||
// if (!owns)
|
||||
// CGColorConverterRetain (this.handle);
|
||||
// FIXME: ^ Apple does not provide this API (it might not be reference counted)
|
||||
}
|
||||
|
||||
[DllImport(Constants.CoreGraphicsLibrary)]
|
||||
extern static IntPtr CGColorConverterCreate (/* __nullable CFDictionaryRef */ IntPtr options,
|
||||
/* CGColorSpaceRef __nullable */ IntPtr space1, CGColorConverterTransformType transform1, CGColorRenderingIntent intent1,
|
||||
/* CGColorSpaceRef __nullable */ IntPtr space2, CGColorConverterTransformType transform2, CGColorRenderingIntent intent2,
|
||||
/* CGColorSpaceRef __nullable */ IntPtr space3, CGColorConverterTransformType transform3, CGColorRenderingIntent intent3,
|
||||
IntPtr lastSpaceMarker);
|
||||
|
||||
// https://developer.apple.com/library/ios/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARM64FunctionCallingConventions.html
|
||||
// Declare dummies until we're on the stack then the arguments
|
||||
// <quote>C language requires arguments smaller than int to be promoted before a call, but beyond that, unused bytes on the stack are not specified by this ABI</quote>
|
||||
[DllImport(Constants.CoreGraphicsLibrary, EntryPoint="CGColorConverterCreate")]
|
||||
extern static IntPtr CGColorConverterCreate_arm64 (/* __nullable CFDictionaryRef */ IntPtr options,
|
||||
IntPtr space1, long transform1, long intent1, // varargs starts after them
|
||||
IntPtr dummy4, IntPtr dummy5, IntPtr dummy6, IntPtr dummy7, // dummies so the rest goes to the stack
|
||||
IntPtr space2, long transform2, long intent2,
|
||||
IntPtr space3, long transform3, long intent3,
|
||||
IntPtr lastSpaceMarker);
|
||||
|
||||
static CGColorConverterTriple empty = new CGColorConverterTriple ();
|
||||
|
||||
public CGColorConverter (NSDictionary options, params CGColorConverterTriple [] triples)
|
||||
{
|
||||
// the API won't return a valid instance if no triple is given, i.e. at least one is needed.
|
||||
// `null` is accepted to mark the end of the list, not to make it optional
|
||||
if ((triples == null) || (triples.Length == 0))
|
||||
throw new ArgumentNullException ("triples");
|
||||
if (triples.Length > 3)
|
||||
throw new ArgumentException ("A maximum of 3 triples are supported");
|
||||
|
||||
IntPtr o = NativeObjectHelper.GetHandle (options);
|
||||
var first = triples [0]; // there's always one
|
||||
var second = triples.Length > 1 ? triples [1] : empty;
|
||||
var third = triples.Length > 2 ? triples [2] : empty;
|
||||
if ((IntPtr.Size == 8) && (Runtime.Arch == Arch.DEVICE)) {
|
||||
handle = CGColorConverterCreate_arm64 (o, NativeObjectHelper.GetHandle (first.Space), (long) first.Transform, (long) first.Intent,
|
||||
IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero,
|
||||
NativeObjectHelper.GetHandle (second.Space), (long) second.Transform, (long) second.Intent,
|
||||
NativeObjectHelper.GetHandle (third.Space), (long) third.Transform, (long) third.Intent,
|
||||
IntPtr.Zero);
|
||||
} else {
|
||||
handle = CGColorConverterCreate (o, NativeObjectHelper.GetHandle (first.Space), first.Transform, first.Intent,
|
||||
NativeObjectHelper.GetHandle (second.Space), second.Transform, second.Intent,
|
||||
NativeObjectHelper.GetHandle (third.Space), third.Transform, third.Intent,
|
||||
IntPtr.Zero);
|
||||
}
|
||||
|
||||
if (handle == IntPtr.Zero)
|
||||
throw new Exception ("Failed to create CGColorConverter");
|
||||
}
|
||||
|
||||
#if false
|
||||
// Apple has not yet (beta 3) provided this API for devices (only works on simulator)
|
||||
// https://trello.com/c/Rwko9Wef/37-24734681-cgcolorconvertercreatesimple-is-missing-for-device-builds
|
||||
|
||||
[DllImport(Constants.CoreGraphicsLibrary)]
|
||||
extern static IntPtr CGColorConverterCreateSimple (/* __nullable CGColorSpaceRef */ IntPtr from, /* __nullable CGColorSpaceRef */ IntPtr to);
|
||||
|
||||
public CGColorConverter (CGColorSpace from, CGColorSpace to)
|
||||
{
|
||||
handle = CGColorConverterCreateSimple (NativeObjectHelper.GetHandle (from), NativeObjectHelper.GetHandle (to));
|
||||
|
||||
if (handle == IntPtr.Zero)
|
||||
throw new Exception ("Failed to create CGColorConverter");
|
||||
}
|
||||
#endif
|
||||
|
||||
~CGColorConverter ()
|
||||
{
|
||||
Dispose (false);
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
Dispose (true);
|
||||
GC.SuppressFinalize (this);
|
||||
}
|
||||
|
||||
public IntPtr Handle {
|
||||
get { return handle; }
|
||||
get { return IntPtr.Zero; }
|
||||
}
|
||||
|
||||
[DllImport (Constants.CoreGraphicsLibrary)]
|
||||
extern static void CGColorConverterRelease (/* CGColorConverterRef */ IntPtr converter);
|
||||
|
||||
protected virtual void Dispose (bool disposing)
|
||||
{
|
||||
if (handle != IntPtr.Zero){
|
||||
CGColorConverterRelease (handle);
|
||||
handle = IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !MONOMAC
|
||||
#endif // !MONOMAC && !WATCH
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// Authors: Mono Team
|
||||
//
|
||||
// Copyright 2009 Novell, Inc
|
||||
// Copyright 2011-2014 Xamarin Inc
|
||||
// Copyright 2011-2014,2016 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
|
@ -30,6 +30,7 @@ using System;
|
|||
using System.ComponentModel;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using XamCore.CoreFoundation;
|
||||
using XamCore.ObjCRuntime;
|
||||
using XamCore.Foundation;
|
||||
|
||||
|
@ -378,6 +379,62 @@ namespace XamCore.CoreGraphics {
|
|||
IntPtr ptr = CGColorSpaceCopyICCProfile (handle);
|
||||
return (ptr == IntPtr.Zero) ? null : new NSData (ptr, true);
|
||||
}
|
||||
|
||||
[iOS (10,0)][Mac (10,12)]
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[DllImport (Constants.CoreGraphicsLibrary)]
|
||||
static extern /* CFDataRef* */ IntPtr CGColorSpaceCopyICCData (/* CGColorSpaceRef */ IntPtr space);
|
||||
|
||||
[iOS (10,0)][Mac (10,12)]
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
public NSData GetIccData ()
|
||||
{
|
||||
IntPtr ptr = CGColorSpaceCopyICCData (handle);
|
||||
return (ptr == IntPtr.Zero) ? null : new NSData (ptr, true);
|
||||
}
|
||||
|
||||
[iOS (10,0)]
|
||||
[TV (10,0)]
|
||||
[DllImport (Constants.CoreGraphicsLibrary)]
|
||||
static extern unsafe /* CFStringRef* */ IntPtr CGColorSpaceCopyName (/* CGColorSpaceRef */ IntPtr space);
|
||||
|
||||
[iOS (10,0)]
|
||||
[TV (10,0)]
|
||||
public string Name {
|
||||
get {
|
||||
return CFString.FetchString (CGColorSpaceCopyName (handle));
|
||||
}
|
||||
}
|
||||
|
||||
[iOS (10,0)][Mac (10,12)]
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[DllImport (Constants.CoreGraphicsLibrary)]
|
||||
static extern bool CGColorSpaceIsWideGamutRGB (/* CGColorSpaceRef */ IntPtr space);
|
||||
|
||||
[iOS (10,0)][Mac (10,12)]
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
public bool IsWideGamutRgb {
|
||||
get {
|
||||
return CGColorSpaceIsWideGamutRGB (handle);
|
||||
}
|
||||
}
|
||||
|
||||
[iOS (10,0)][Mac (10,12)]
|
||||
[TV (10,0)]
|
||||
[DllImport (Constants.CoreGraphicsLibrary)]
|
||||
static extern bool CGColorSpaceSupportsOutput (/* CGColorSpaceRef */ IntPtr space);
|
||||
|
||||
[iOS (10,0)][Mac (10,12)]
|
||||
[TV (10,0)]
|
||||
public bool SupportsOutput {
|
||||
get {
|
||||
return CGColorSpaceSupportsOutput (handle);
|
||||
}
|
||||
}
|
||||
#endif // !COREBUILD
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
using XamCore.Foundation;
|
||||
using XamCore.CoreGraphics;
|
||||
using XamCore.CoreFoundation;
|
||||
using XamCore.ObjCRuntime;
|
||||
#if !MONOMAC
|
||||
using XamCore.Metal;
|
||||
using XamCore.OpenGLES;
|
||||
|
@ -73,26 +74,20 @@ namespace XamCore.CoreImage {
|
|||
|
||||
public int? CIImageFormat {
|
||||
get {
|
||||
return GetInt32Value (CIContext.WorkingFormat);
|
||||
return GetInt32Value (CIContext.WorkingFormatField);
|
||||
}
|
||||
set {
|
||||
SetNumberValue (CIContext.WorkingFormat, value);
|
||||
SetNumberValue (CIContext.WorkingFormatField, value);
|
||||
}
|
||||
}
|
||||
|
||||
[Advice ("Not available on OSX")]
|
||||
[Mac (10,12)]
|
||||
public bool? PriorityRequestLow {
|
||||
get {
|
||||
#if MONOMAC
|
||||
return false;
|
||||
#else
|
||||
return GetBoolValue (CIContext.PriorityRequestLow);
|
||||
#endif
|
||||
}
|
||||
set {
|
||||
#if !MONOMAC
|
||||
SetBooleanValue (CIContext.PriorityRequestLow, value);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -104,14 +99,39 @@ namespace XamCore.CoreImage {
|
|||
SetBooleanValue (CIContext.HighQualityDownsample, value);
|
||||
}
|
||||
}
|
||||
|
||||
[iOS (7,0)]
|
||||
public bool? OutputPremultiplied {
|
||||
get {
|
||||
return GetBoolValue (CIContext.OutputPremultiplied);
|
||||
}
|
||||
set {
|
||||
SetBooleanValue (CIContext.OutputPremultiplied, value);
|
||||
}
|
||||
}
|
||||
|
||||
[iOS (10,0)][Mac (10,12)]
|
||||
public bool? CacheIntermediates {
|
||||
get {
|
||||
return GetBoolValue (CIContext.CacheIntermediates);
|
||||
}
|
||||
set {
|
||||
SetBooleanValue (CIContext.CacheIntermediates, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public partial class CIContext {
|
||||
|
||||
[iOS (8,0)]
|
||||
public CIContext (CIContextOptions options) :
|
||||
this (options?.Dictionary)
|
||||
{
|
||||
}
|
||||
|
||||
public static CIContext FromContext (CGContext ctx, CIContextOptions options)
|
||||
{
|
||||
NSDictionary dict = options == null ? null : options.Dictionary;
|
||||
|
||||
return FromContext (ctx, dict);
|
||||
return FromContext (ctx, options?.Dictionary);
|
||||
}
|
||||
|
||||
public static CIContext FromContext (CGContext ctx)
|
||||
|
@ -138,6 +158,7 @@ namespace XamCore.CoreImage {
|
|||
#endif
|
||||
|
||||
#if MONOMAC
|
||||
[Deprecated (PlatformName.MacOSX, 10, 11)]
|
||||
public CGLayer CreateCGLayer (CGSize size)
|
||||
{
|
||||
return CreateCGLayer (size, null);
|
||||
|
@ -145,7 +166,7 @@ namespace XamCore.CoreImage {
|
|||
#else
|
||||
public static CIContext FromOptions (CIContextOptions options)
|
||||
{
|
||||
return FromOptions (options == null ? null : options.Dictionary);
|
||||
return FromOptions (options?.Dictionary);
|
||||
}
|
||||
|
||||
public CGImage CreateCGImage (CIImage image, CGRect fromRect, CIFormat ciImageFormat, CGColorSpace colorSpace)
|
||||
|
|
|
@ -2,12 +2,13 @@
|
|||
// Authors:
|
||||
// Sebastien Pouliot <sebastien@xamarin.com>
|
||||
//
|
||||
// Copyright 2013 Xamarin, Inc.
|
||||
// Copyright 2013, 2016 Xamarin, Inc.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using XamCore.Foundation;
|
||||
using XamCore.ObjCRuntime;
|
||||
|
||||
namespace XamCore.CoreImage {
|
||||
|
||||
|
@ -15,6 +16,10 @@ namespace XamCore.CoreImage {
|
|||
|
||||
public FaceDetectorAccuracy? Accuracy { get; set; }
|
||||
public float? MinFeatureSize { get; set; }
|
||||
|
||||
[iOS (10,0)][Mac (10,12)]
|
||||
public int? MaxFeatureCount { get; set; }
|
||||
|
||||
public bool? TrackingEnabled { get; set; }
|
||||
public bool? EyeBlink { get; set; }
|
||||
public bool? Smile { get; set; }
|
||||
|
@ -29,9 +34,9 @@ namespace XamCore.CoreImage {
|
|||
|
||||
internal NSDictionary ToDictionary ()
|
||||
{
|
||||
// We have now 10 possible keys so begining with 5 *might* be optimal
|
||||
List<NSObject> keys = new List<NSObject> (5);
|
||||
List<NSObject> values = new List<NSObject> (5);
|
||||
// We now have 11 possible keys so begining with 6 *might* be optimal
|
||||
List<NSObject> keys = new List<NSObject> (6);
|
||||
List<NSObject> values = new List<NSObject> (6);
|
||||
|
||||
if (CIDetector.Accuracy != null) {
|
||||
keys.Add (CIDetector.Accuracy);
|
||||
|
@ -86,6 +91,11 @@ namespace XamCore.CoreImage {
|
|||
values.Add (new NSNumber ((int) ImageOrientation.Value));
|
||||
}
|
||||
|
||||
if (CIDetector.MaxFeatureCount != null && MaxFeatureCount != null) {
|
||||
keys.Add (CIDetector.MaxFeatureCount);
|
||||
values.Add (new NSNumber ((int) MaxFeatureCount.Value));
|
||||
}
|
||||
|
||||
return NSDictionary.FromObjectsAndKeys (values.ToArray (), keys.ToArray ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -217,39 +217,4 @@ namespace XamCore.CoreImage {
|
|||
{
|
||||
}
|
||||
}
|
||||
|
||||
// convenience enum (fields are used) but also a `typedef int` -> CIImage.h
|
||||
public enum CIFormat {
|
||||
ARGB8 = 0,
|
||||
RGBAh = 1,
|
||||
#if MONOMAC
|
||||
RGBA16 = 2,
|
||||
[Obsolete ("This value can not be shared across Mac/iOS binaries, future proof with kRGBAf instead")]
|
||||
RGBAf = 3,
|
||||
|
||||
// Please, do not add values into MonoMac/iOS without adding an explicit value
|
||||
#elif !XAMCORE_3_0
|
||||
[Obsolete ("This value can not be shared across Mac/iOS binaries, future proof with kBGRA8 instead")]
|
||||
BGRA8 = 2 ,
|
||||
[Obsolete ("This value can not be shared across Mac/iOS binaries, future proof with kRGBA8 instead")]
|
||||
RGBA8 = 3,
|
||||
// Please, do not add values into MonoMac/iOS without adding an explicit value
|
||||
#endif
|
||||
kRGBAf = 4,
|
||||
kBGRA8 = 5,
|
||||
kRGBA8 = 6,
|
||||
ABGR8 = 7,
|
||||
A8 = 11,
|
||||
A16 = 12,
|
||||
Ah = 13,
|
||||
Af = 14,
|
||||
R8 = 15,
|
||||
R16 = 16,
|
||||
Rh = 17,
|
||||
Rf = 18,
|
||||
RG8 = 19,
|
||||
RG16 = 20,
|
||||
RGh = 21,
|
||||
RGf = 22
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,4 +37,39 @@ namespace XamCore.CoreImage {
|
|||
RightBottom = 7,
|
||||
LeftBottom = 8
|
||||
}
|
||||
|
||||
// convenience enum (fields are used) but also a `typedef int` -> CIImage.h
|
||||
public enum CIFormat {
|
||||
ARGB8 = 0,
|
||||
RGBAh = 1,
|
||||
#if MONOMAC
|
||||
RGBA16 = 2,
|
||||
[Obsolete ("This value can not be shared across Mac/iOS binaries, future proof with kRGBAf instead")]
|
||||
RGBAf = 3,
|
||||
|
||||
// Please, do not add values into MonoMac/iOS without adding an explicit value
|
||||
#elif !XAMCORE_3_0
|
||||
[Obsolete ("This value can not be shared across Mac/iOS binaries, future proof with kBGRA8 instead")]
|
||||
BGRA8 = 2 ,
|
||||
[Obsolete ("This value can not be shared across Mac/iOS binaries, future proof with kRGBA8 instead")]
|
||||
RGBA8 = 3,
|
||||
// Please, do not add values into MonoMac/iOS without adding an explicit value
|
||||
#endif
|
||||
kRGBAf = 4,
|
||||
kBGRA8 = 5,
|
||||
kRGBA8 = 6,
|
||||
ABGR8 = 7,
|
||||
A8 = 11,
|
||||
A16 = 12,
|
||||
Ah = 13,
|
||||
Af = 14,
|
||||
R8 = 15,
|
||||
R16 = 16,
|
||||
Rh = 17,
|
||||
Rf = 18,
|
||||
RG8 = 19,
|
||||
RG16 = 20,
|
||||
RGh = 21,
|
||||
RGf = 22
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#if !XAMCORE_2_0
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
@ -7,6 +5,7 @@ using XamCore.ObjCRuntime;
|
|||
|
||||
namespace XamCore.CoreLocation {
|
||||
|
||||
#if !XAMCORE_2_0
|
||||
public partial class CLBeaconRegion {
|
||||
|
||||
[Obsolete ("Does not return a valid instance on iOS8")]
|
||||
|
@ -14,6 +13,28 @@ namespace XamCore.CoreLocation {
|
|||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#if !XAMCORE_4_0 && !WATCH
|
||||
|
||||
#if !TVOS
|
||||
public partial class CLHeading {
|
||||
|
||||
[Obsolete ("Use the Description property from NSObject")]
|
||||
public new virtual string Description ()
|
||||
{
|
||||
return base.Description;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
public partial class CLLocation {
|
||||
|
||||
[Obsolete ("Use the Description property from NSObject")]
|
||||
public new virtual string Description ()
|
||||
{
|
||||
return base.Description;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -33,6 +33,10 @@ using System;
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
using XamCore.ObjCRuntime;
|
||||
#if IOS && !COREBUILD && XAMCORE_2_0
|
||||
using XamCore.Contacts;
|
||||
using XamCore.Intents;
|
||||
#endif
|
||||
|
||||
namespace XamCore.CoreLocation {
|
||||
|
||||
|
@ -95,4 +99,14 @@ namespace XamCore.CoreLocation {
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if IOS && !COREBUILD && XAMCORE_2_0 // This code comes from Intents.CLPlacemark_INIntentsAdditions Category
|
||||
public partial class CLPlacemark {
|
||||
[iOS (10, 0)]
|
||||
static public CLPlacemark GetPlacemark (CLLocation location, string name, CNPostalAddress postalAddress)
|
||||
{
|
||||
return (null as CLPlacemark)._GetPlacemark (location, name, postalAddress);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -71,11 +71,13 @@ namespace XamCore.CoreMidi {
|
|||
NotPermitted = -10844
|
||||
}
|
||||
|
||||
#if !MONOMAC || !XAMCORE_4_0
|
||||
// NSUInteger -> MIDINetworkSession.h
|
||||
[Native]
|
||||
public enum MidiNetworkConnectionPolicy : nuint_compat_int {
|
||||
NoOne, HostsInContactsList, Anyone
|
||||
}
|
||||
#endif
|
||||
|
||||
[Flags]
|
||||
// SInt32 - MIDIServices.h
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
// Compatibility stubs
|
||||
|
||||
#if !XAMCORE_4_0 && IOS
|
||||
|
||||
using System;
|
||||
|
||||
namespace XamCore.CoreSpotlight {
|
||||
|
||||
partial class CSCustomAttributeKey {
|
||||
|
||||
[Obsolete ("Use .ctor(string)")]
|
||||
public CSCustomAttributeKey () : this (String.Empty)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -29,6 +29,16 @@ namespace XamCore.CoreSpotlight {
|
|||
QuotaExceeded = -1004,
|
||||
IndexingUnsupported = -1005,
|
||||
}
|
||||
|
||||
[NoTV][iOS (10,0)]
|
||||
[ErrorDomain ("CSSearchQueryErrorDomain")]
|
||||
[Native]
|
||||
public enum CSSearchQueryErrorCode : nint {
|
||||
Unknown = -2000,
|
||||
IndexUnreachable = -2001,
|
||||
InvalidQuery = -2002,
|
||||
Cancelled = -2003
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -6,24 +6,28 @@ namespace XamCore.CoreTelephony {
|
|||
|
||||
public partial class CTCall {
|
||||
#if !COREBUILD
|
||||
[Availability (Deprecated = Platform.iOS_10_0, Message = "Use CallKit")]
|
||||
public string StateDialing {
|
||||
get {
|
||||
return Dlfcn.SlowGetStringConstant (Constants.CoreTelephonyLibrary, "CTCallStateDialing");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Availability (Deprecated = Platform.iOS_10_0, Message = "Use CallKit")]
|
||||
public string StateIncoming {
|
||||
get {
|
||||
return Dlfcn.SlowGetStringConstant (Constants.CoreTelephonyLibrary, "CTCallStateIncoming");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Availability (Deprecated = Platform.iOS_10_0, Message = "Use CallKit")]
|
||||
public string StateConnected {
|
||||
get {
|
||||
return Dlfcn.SlowGetStringConstant (Constants.CoreTelephonyLibrary, "CTCallStateConnected");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Availability (Deprecated = Platform.iOS_10_0, Message = "Use CallKit")]
|
||||
public string StateDisconnected {
|
||||
get {
|
||||
return Dlfcn.SlowGetStringConstant (Constants.CoreTelephonyLibrary, "CTCallStateDisconnected");
|
||||
|
|
|
@ -81,6 +81,7 @@ namespace XamCore.CoreText {
|
|||
LineHeightMultiple = 7,
|
||||
MaximumLineHeight = 8,
|
||||
MinimumLineHeight = 9,
|
||||
[Availability (Introduced = Platform.iOS_3_2 | Platform.Mac_10_5, Deprecated = Platform.iOS_6_0 | Platform.Mac_10_8, Message="Please use MaximumLineSpacing")]
|
||||
LineSpacing = 10,
|
||||
ParagraphSpacing = 11,
|
||||
ParagraphSpacingBefore = 12,
|
||||
|
|
|
@ -79,6 +79,7 @@ namespace XamCore.CoreText {
|
|||
public static readonly NSString KerningAdjustment;
|
||||
public static readonly NSString LigatureFormation;
|
||||
public static readonly NSString ForegroundColor;
|
||||
public static readonly NSString BackgroundColor;
|
||||
public static readonly NSString ParagraphStyle;
|
||||
public static readonly NSString StrokeWidth;
|
||||
public static readonly NSString StrokeColor;
|
||||
|
@ -86,6 +87,7 @@ namespace XamCore.CoreText {
|
|||
public static readonly NSString Superscript;
|
||||
public static readonly NSString UnderlineColor;
|
||||
public static readonly NSString VerticalForms;
|
||||
public static readonly NSString HorizontalInVerticalForms;
|
||||
public static readonly NSString GlyphInfo;
|
||||
public static readonly NSString CharacterShape;
|
||||
public static readonly NSString RunDelegate;
|
||||
|
@ -106,6 +108,7 @@ namespace XamCore.CoreText {
|
|||
KerningAdjustment = Dlfcn.GetStringConstant (handle, "kCTKernAttributeName");
|
||||
LigatureFormation = Dlfcn.GetStringConstant (handle, "kCTLigatureAttributeName");
|
||||
ForegroundColor = Dlfcn.GetStringConstant (handle, "kCTForegroundColorAttributeName");
|
||||
BackgroundColor = Dlfcn.GetStringConstant (handle, "kCTBackgroundColorAttributeName");
|
||||
ParagraphStyle = Dlfcn.GetStringConstant (handle, "kCTParagraphStyleAttributeName");
|
||||
StrokeWidth = Dlfcn.GetStringConstant (handle, "kCTStrokeWidthAttributeName");
|
||||
StrokeColor = Dlfcn.GetStringConstant (handle, "kCTStrokeColorAttributeName");
|
||||
|
@ -113,6 +116,7 @@ namespace XamCore.CoreText {
|
|||
Superscript = Dlfcn.GetStringConstant (handle, "kCTSuperscriptAttributeName");
|
||||
UnderlineColor = Dlfcn.GetStringConstant (handle, "kCTUnderlineColorAttributeName");
|
||||
VerticalForms = Dlfcn.GetStringConstant (handle, "kCTVerticalFormsAttributeName");
|
||||
HorizontalInVerticalForms = Dlfcn.GetStringConstant (handle, "kCTHorizontalInVerticalFormsAttributeName");
|
||||
GlyphInfo = Dlfcn.GetStringConstant (handle, "kCTGlyphInfoAttributeName");
|
||||
CharacterShape = Dlfcn.GetStringConstant (handle, "kCTCharacterShapeAttributeName");
|
||||
RunDelegate = Dlfcn.GetStringConstant (handle, "kCTRunDelegateAttributeName");
|
||||
|
@ -193,6 +197,22 @@ namespace XamCore.CoreText {
|
|||
set {Adapter.SetNativeValue (Dictionary, CTStringAttributeKey.ForegroundColor, value);}
|
||||
}
|
||||
|
||||
[iOS (10,0)][Mac (10,12)]
|
||||
public CGColor BackgroundColor {
|
||||
get {
|
||||
var h = IntPtr.Zero;
|
||||
var x = CTStringAttributeKey.BackgroundColor;
|
||||
if (x != null)
|
||||
h = CFDictionary.GetValue (Dictionary.Handle, x.Handle);
|
||||
return h == IntPtr.Zero ? null : new CGColor (h);
|
||||
}
|
||||
set {
|
||||
var x = CTStringAttributeKey.BackgroundColor;
|
||||
if (x != null)
|
||||
Adapter.SetNativeValue (Dictionary, x, value);
|
||||
}
|
||||
}
|
||||
|
||||
public CTParagraphStyle ParagraphStyle {
|
||||
get {
|
||||
var h = CFDictionary.GetValue (Dictionary.Handle, CTStringAttributeKey.ParagraphStyle.Handle);
|
||||
|
@ -281,6 +301,19 @@ namespace XamCore.CoreText {
|
|||
}
|
||||
}
|
||||
|
||||
[iOS (10,0)][Mac (10,12)]
|
||||
public int? HorizontalInVerticalForms {
|
||||
get {
|
||||
var x = CTStringAttributeKey.HorizontalInVerticalForms;
|
||||
return x != null ? Adapter.GetInt32Value (Dictionary, x) : null;
|
||||
}
|
||||
set {
|
||||
var x = CTStringAttributeKey.HorizontalInVerticalForms;
|
||||
if (x != null)
|
||||
Adapter.SetValue (Dictionary, x, value);
|
||||
}
|
||||
}
|
||||
|
||||
public CTGlyphInfo GlyphInfo {
|
||||
get {
|
||||
var h = CFDictionary.GetValue (Dictionary.Handle, CTStringAttributeKey.GlyphInfo.Handle);
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче