[IOSurface] Update for Xcode10-beta2 (#4322)

This commit is contained in:
Manuel de la Pena 2018-06-22 16:41:11 +02:00 коммит произвёл GitHub
Родитель e7f1161146
Коммит 489e0119e0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 63 добавлений и 6 удалений

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

@ -0,0 +1,53 @@
//
// IOSurface.cs
//
// Copyright 2018 Microsoft
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using Foundation;
using ObjCRuntime;
namespace IOSurface {
internal static partial class IOSurfacePropertyKey {
static bool CheckSystemVersion ()
{
#if MONOMAC
return PlatformHelper.CheckSystemVersion (10, 14);
#elif TVOS || IOS
return UIKit.UIDevice.CurrentDevice.CheckSystemVersion (12, 0);
#else
#error Unknown platform
#endif
}
public static NSString AllocSizeKey {
get {
if (CheckSystemVersion ())
return _NewAllocSizeKey;
return _DeprecatedAllocSizeKey;
}
}
}
}

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

@ -927,7 +927,8 @@ IOSURFACE_CORE_SOURCES = \
IOSurface/IODefs.cs
IOSURFACE_SOURCES = \
IOSurface/IOSurface.cs
IOSurface/IOSurface.cs \
IOSurface/IOSurfacePropertyKey.cs \
# JavaScriptCore

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

@ -21,9 +21,15 @@ namespace IOSurface {
[TV (11,0)]
[Mac (10, 12)]
interface IOSurfacePropertyKey {
[Internal]
[Field ("IOSurfacePropertyAllocSizeKey")]
NSString AllocSizeKey { get; }
NSString _DeprecatedAllocSizeKey { get; }
[iOS (12, 0), TV (12,0), Mac (10, 14)]
[Internal]
[Field ("IOSurfacePropertyKeyAllocSize")]
NSString _NewAllocSizeKey { get; }
[Field ("IOSurfacePropertyKeyWidth")]
NSString WidthKey { get; }

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

@ -1 +0,0 @@
!missing-field! IOSurfacePropertyKeyAllocSize not bound

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

@ -1 +0,0 @@
!missing-field! IOSurfacePropertyKeyAllocSize not bound

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

@ -1 +0,0 @@
!missing-field! IOSurfacePropertyKeyAllocSize not bound